59 lines
5.4 MiB
59 lines
5.4 MiB
var process={env:{NODE_ENV:"production"}};!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("worker_threads"),require("module"),require("path")):"function"==typeof define&&define.amd?define(["worker_threads","module","path"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).WorkerThreads,t.Module,t.path)}(this,(function(t,e,i){"use strict";function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function r(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(i){if("default"!==i){var n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:function(){return t[i]}})}})),e.default=t,Object.freeze(e)}var s=r(t),a=n(e),l=n(i);class c{state;constructor(t){this.state=t}get value(){return this.state}set value(t){this.state=t}}function u(t){return new c(t)}function h(t,e){let i=-1;const n=t.length;for(;++i<n;)e(t[i],i,t);return t}function p(t){return Array.isArray(t)&&t.every((t=>t&&("object"==typeof t.position||Array.isArray(t.position)||""!=t.lng&&""!=t.lat)))}function d(t,e){const i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=[];let r;if(e=e||i.length,t)for(r=0;r<t;r++)n[r]=i[0|Math.random()*e];else{let t;for(n[8]=n[13]=n[18]=n[23]="-",n[14]="4",r=0;r<36;r++)n[r]||(t=0|16*Math.random(),n[r]=i[19==r?3&t|8:t])}return n.join("")}function f(t,e){if(null!==t){h(Object.keys(t),(i=>{e(t[i],i,t)}))}return t}function m(...t){class e{}function i(t,e){for(const i of Reflect.ownKeys(e))if("constructor"!==i&&"prototype"!==i&&"name"!==i){const n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,n)}}for(const n of t)i(e,n),i(e.prototype,n.prototype),i(e.prototype,n.prototype.__proto__);return e}function g(t,e){if(Array.isArray(e)){let i=!1;return e.forEach((e=>{const n=g(t,e);n&&(i=n)})),i}return v(t)===y(e)}const y=t=>t.toLowerCase(),v=t=>y(Object.prototype.toString.call(t).replace(/\[/g,"").replace(/\]/g,"").replace(/\s/g,"").replace(/object/g,"")),_=Array.isArray,x=t=>g(t,"object"),b=t=>g(t,"function"),w=t=>g(t,"string");function A(t,e){let i;if(w(t))return(n=t)?document.createTextNode(n):null;if(t instanceof Element)return t;if(b(t)){if(t.tag.toString().startsWith("class ")){return A((new t.tag).render())}return A(t.tag())}if(!x(t))return t;var n;i=document.createElement(t.tag);const{attrs:r,children:o}=t;return function(t,e={}){f(e,((e,i)=>{"style"===i?function(t,e){w(e)?t.style=e:x(e)&&f(e,((e,i)=>{t.style[i]=e}))}(t,e):["class","className"].includes(i)?function(t,e){const i=[];if("string"==typeof e)e=e.split(" ");else if(x(e)){const t=[];f(e,((e,n)=>{e?t.push(n):i.push(n)})),e=[...t]}if(!_(e))return t;{const n=t.classList;e.forEach((t=>{n.contains(t)?i.includes(t)&&n.remove(t):n.add(t)}))}}(t,e):i.includes("on")?function(t,e,i,n={}){"passive"in n&&E?t.addEventListener(e,i,n):t.addEventListener(e,i,n.capture)}(t,i.slice(2).toLowerCase(),e):!function(t,e){_(e)||(e=[e]);const i=[];return e.forEach((e=>{i.push(t.getAttribute(e))})),1===i.length?i[0]:i}(t,i)?t[i]=e:t.setAttribute(i,e)}))}(i,r),o&&o.forEach((t=>{const e=t.element?t.element:t,n=t=>{_(t)?t.forEach((t=>n(t))):i.appendChild(A(t))};n(e)})),t.element=i,e&&function(t,e){_(e)?e.forEach((e=>{e&&(x(e)&&e.tag?t.appendChild(A(e)):t.appendChild(e))})):t.appendChild(e)}(e,i),t.element}const E=!1;class S{option;constructor(t){this.option=Object.assign({minimumLevel:1,maximumLevel:20,show:!0,layer:d(0,25),tileSize:256},t);const e={type:"raster",tiles:[this.option.url],tileSize:this.option.tileSize};cNt.value.addSource(this.option.layer+"source",e);const i={id:this.option.layer,type:"raster",source:this.option.layer+"source",minzoom:this.option.minimumLevel,maxzoom:this.option.maximumLevel,layout:{visibility:this.option.show?"visible":"none"},paint:{"raster-opacity":1}};cNt.value.addLayer(i)}destroy(){cNt.value.removeLayer(this.option.layer),cNt.value.removeSource(this.option.layer+"source")}setLayerShowOrHidden(t){if(!cNt.value.getLayer(this.option.layer))throw new Error(`Layer name "${this.option.layer}" does not exist.`);{const e=t?"visible":"none";cNt.value.setLayoutProperty(this.option.layer,"visibility",e)}}}class M{option;constructor(t){if(this.option=Object.assign({layer:d(0,25),url:"",sourceLayer:"",minimumLevel:1,maximumLevel:20,type:"line",style:{paint:{"line-color":"red","line-width":1.5}}},t),cNt.value.getSource(this.option.layer+"source")||cNt.value.getLayer(this.option.layer))throw new Error(`Layer name "${this.option.layer}" exists.`);cNt.value.addSource(this.option.layer+"source",{type:"vector",tiles:[this.option.url]}),cNt.value.addLayer({id:this.option.layer,type:this.option.type,source:this.option.layer+"source","source-layer":this.option.sourceLayer,minzoom:this.option.minimumLevel,maxzoom:this.option.maximumLevel,...this.option.style})}destroy(){cNt.value.removeLayer(this.option.layer),cNt.value.removeSource(this.option.layer+"source")}setLayerShowOrHidden(t){if(!cNt.value.getLayer(this.option.layer))throw new Error(`Layer name "${this.option.layer}" does not exist.`);{const e=t?"visible":"none";cNt.value.setLayoutProperty(this.option.layer,"visibility",e)}}}var T;!function(t){t[t.click=0]="click",t[t.mouseIn=1]="mouseIn",t[t.mouseOut=2]="mouseOut",t[t.mouseMove=3]="mouseMove",t[t.rightClick=4]="rightClick",t[t.clusterClick=5]="clusterClick"}(T||(T={}));const I=u({click:{},mouseIn:{},mouseOut:{},mouseMove:{},rightClick:{},clusterClick:{}});class C{id;bbox;_options;addEventListener(t,e){switch(t){case"mouseIn":I.value[t][this.id]=t=>{if(!t.features||t.defaultPrevented)return;const i=t.features[0];e(i.properties)},cNt.value.on("mouseover",this.id,I.value[t][this.id]);break;case"mouseOut":I.value[t][this.id]=t=>{t.defaultPrevented||e(t)},cNt.value.on("mouseout",this.id,I.value[t][this.id]);break;case"mouseMove":I.value[t][this.id]=t=>{if(!t.features||t.defaultPrevented)return;const i=t.features[0];e(i.properties)},cNt.value.on("mousemove",this.id,I.value[t][this.id]);break;case"rightClick":I.value[t][this.id]=t=>{if(!t.features||t.defaultPrevented)return;const i=t.features[0];e(i.properties)},cNt.value.on("contextmenu",this.id,I.value[t][this.id]);break;case"click":I.value[t][this.id]=t=>{if(!t.features||t.defaultPrevented)return;const i=t.features[0];e(i.properties)},cNt.value.on("click",this.id,I.value[t][this.id]);break;case"clusterClick":I.value[t][this.id]=t=>{const i=cNt.value.queryRenderedFeatures(t.point,{layers:[`${this.id}-clusters`]}),n=i[0].properties.cluster_id,r=i[0].properties.point_count;cNt.value.getSource(`${this.id}source`).getClusterLeaves(n,r,0,((t,i)=>{let n=i;this._options.originData instanceof Array&&(n=i.map((t=>t.properties))),e(n)}))},cNt.value.on("click",`${this.id}-clusters`,I.value[t][this.id])}}removeEventListener(t){switch(t){case"mouseIn":cNt.value.off("mouseover",this.id,I.value[t][this.id]);break;case"mouseOut":cNt.value.off("mouseout",this.id,I.value[t][this.id]);break;case"mouseMove":cNt.value.off("mousemove",this.id,I.value[t][this.id]);break;case"rightClick":cNt.value.off("contextmenu",this.id,I.value[t][this.id]);break;case"click":cNt.value.off("click",this.id,I.value[t][this.id]);break;case"clusterClick":cNt.value.off("click",`${this.id}-clusters`,I.value[t][this.id])}I.value[t][this.id]&&delete I.value[t][this.id]}flyTo(){cNt.value.fitBounds(this.bbox,{padding:{top:30,bottom:30,left:30,right:30}})}destroy(){cNt.value.removeLayer(this.id),cNt.value.getSource(this.id+"source")&&cNt.value.removeSource(this.id+"source"),cNt.value.getLayer(this.id+"Highlight")&&(cNt.value.removeLayer(this.id+"Highlight"),cNt.value.removeSource(this.id+"Highlightsource")),cNt.value.hasImage(this.id+"icon")&&cNt.value.removeImage(this.id+"icon"),cNt.value.getLayer(this.id+"label")&&(cNt.value.removeLayer(this.id+"label"),cNt.value.removeSource(this.id+"labelsource")),cNt.value.getLayer(this.id+"line")&&(cNt.value.removeLayer(this.id+"line"),cNt.value.removeSource(this.id+"linesource"));const t=cNt.value.listImages();t.length>0&&t.forEach((t=>{-1!=t.indexOf(this.id)&&cNt.value.removeImage(t)}))}show(t){if(!cNt.value.getLayer(this.id))throw new Error(`Layer name "${this.id}" does not exist.`);{const e=t?"visible":"none";cNt.value.setLayoutProperty(this.id,"visibility",e),cNt.value.getLayer(this.id+"Highlight")&&cNt.value.setLayoutProperty(this.id+"Highlight","visibility",e),cNt.value.getLayer(this.id+"label")&&cNt.value.setLayoutProperty(this.id+"label","visibility",e),cNt.value.getLayer(this.id+"line")&&cNt.value.setLayoutProperty(this.id+"line","visibility",e)}}}var P=6371008.8,L={centimeters:100*P,centimetres:100*P,degrees:P/111325,feet:3.28084*P,inches:39.37*P,kilometers:P/1e3,kilometres:P/1e3,meters:P,metres:P,miles:P/1609.344,millimeters:1e3*P,millimetres:1e3*P,nauticalmiles:P/1852,radians:1,yards:1.0936*P};function D(t,e,i){void 0===i&&(i={});var n={type:"Feature"};return(0===i.id||i.id)&&(n.id=i.id),i.bbox&&(n.bbox=i.bbox),n.properties=e||{},n.geometry=t,n}function R(t,e,i){if(void 0===i&&(i={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!H(t[0])||!H(t[1]))throw new Error("coordinates must contain numbers");return D({type:"Point",coordinates:t},e,i)}function O(t,e,i){void 0===i&&(i={});for(var n=0,r=t;n<r.length;n++){var o=r[n];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}return D({type:"Polygon",coordinates:t},e,i)}function k(t,e,i){if(void 0===i&&(i={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return D({type:"LineString",coordinates:t},e,i)}function N(t,e){void 0===e&&(e={});var i={type:"FeatureCollection"};return e.id&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.features=t,i}function B(t,e,i){return void 0===i&&(i={}),D({type:"MultiLineString",coordinates:t},e,i)}function z(t,e,i){return void 0===i&&(i={}),D({type:"MultiPoint",coordinates:t},e,i)}function F(t,e,i){return void 0===i&&(i={}),D({type:"MultiPolygon",coordinates:t},e,i)}function V(t,e){void 0===e&&(e="kilometers");var i=L[e];if(!i)throw new Error(e+" units is invalid");return t*i}function U(t,e){void 0===e&&(e="kilometers");var i=L[e];if(!i)throw new Error(e+" units is invalid");return t/i}function G(t){return 180*(t%(2*Math.PI))/Math.PI}function j(t){return t%360*Math.PI/180}function H(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function W(t){return!!t&&t.constructor===Object}function q(t,e,i){if(null!==t)for(var n,r,o,s,a,l,c,u,h=0,p=0,d=t.type,f="FeatureCollection"===d,m="Feature"===d,g=f?t.features.length:1,y=0;y<g;y++){a=(u=!!(c=f?t.features[y].geometry:m?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var v=0;v<a;v++){var _=0,x=0;if(null!==(s=u?c.geometries[v]:c)){l=s.coordinates;var b=s.type;switch(h=!i||"Polygon"!==b&&"MultiPolygon"!==b?0:1,b){case null:break;case"Point":if(!1===e(l,p,y,_,x))return!1;p++,_++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(!1===e(l[n],p,y,_,x))return!1;p++,"MultiPoint"===b&&_++}"LineString"===b&&_++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(r=0;r<l[n].length-h;r++){if(!1===e(l[n][r],p,y,_,x))return!1;p++}"MultiLineString"===b&&_++,"Polygon"===b&&x++}"Polygon"===b&&_++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(x=0,r=0;r<l[n].length;r++){for(o=0;o<l[n][r].length-h;o++){if(!1===e(l[n][r][o],p,y,_,x))return!1;p++}x++}_++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(!1===q(s.geometries[n],e,i))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function X(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var i=0;i<t.features.length&&!1!==e(t.features[i],i);i++);}function Z(t){var e=[];return q(t,(function(t){e.push(t)})),e}function Y(t,e){var i,n,r,o,s,a,l,c,u,h,p=0,d="FeatureCollection"===t.type,f="Feature"===t.type,m=d?t.features.length:1;for(i=0;i<m;i++){for(a=d?t.features[i].geometry:f?t.geometry:t,c=d?t.features[i].properties:f?t.properties:{},u=d?t.features[i].bbox:f?t.bbox:void 0,h=d?t.features[i].id:f?t.id:void 0,s=(l=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,r=0;r<s;r++)if(null!==(o=l?a.geometries[r]:a))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(o,p,c,u,h))return!1;break;case"GeometryCollection":for(n=0;n<o.geometries.length;n++)if(!1===e(o.geometries[n],p,c,u,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,p,c,u,h))return!1;p++}}function Q(t,e){Y(t,(function(t,i,n,r,o){var s,a=null===t?null:t.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return!1!==e(D(t,n,{bbox:r,id:o}),i,0)&&void 0}switch(a){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var l=0;l<t.coordinates.length;l++){var c=t.coordinates[l];if(!1===e(D({type:s,coordinates:c},n),i,l))return!1}}))}function J(t,e){Q(t,(function(t,i,n){var r=0;if(t.geometry){var o=t.geometry.type;if("Point"!==o&&"MultiPoint"!==o){var s,a=0,l=0,c=0;return!1!==q(t,(function(o,u,h,p,d){if(void 0===s||i>a||p>l||d>c)return s=o,a=i,l=p,c=d,void(r=0);var f=k([s,o],t.properties);if(!1===e(f,i,n,d,r))return!1;r++,s=o}))&&void 0}}}))}function K(t){var e=[1/0,1/0,-1/0,-1/0];return q(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])})),e}function $(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function tt(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function et(t){return"Feature"===t.type?t.geometry:t}function it(t,e){return"FeatureCollection"===t.type?"FeatureCollection":"GeometryCollection"===t.type?"GeometryCollection":"Feature"===t.type&&null!==t.geometry?t.geometry.type:t.type}K.default=K;var nt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function rt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ot(t){if(t.__esModule)return t;var e=t.default;if("function"==typeof e){var i=function t(){return this instanceof t?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};i.prototype=e.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(i,e,n.get?n:{enumerable:!0,get:function(){return t[e]}})})),i}function st(t,e,i,n,r){at(t,e,i||0,n||t.length-1,r||ct)}function at(t,e,i,n,r){for(;n>i;){if(n-i>600){var o=n-i+1,s=e-i+1,a=Math.log(o),l=.5*Math.exp(2*a/3),c=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1);at(t,e,Math.max(i,Math.floor(e-s*l/o+c)),Math.min(n,Math.floor(e+(o-s)*l/o+c)),r)}var u=t[e],h=i,p=n;for(lt(t,i,e),r(t[n],u)>0&<(t,i,n);h<p;){for(lt(t,h,p),h++,p--;r(t[h],u)<0;)h++;for(;r(t[p],u)>0;)p--}0===r(t[i],u)?lt(t,i,p):lt(t,++p,n),p<=e&&(i=p+1),e<=p&&(n=p-1)}}function lt(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function ct(t,e){return t<e?-1:t>e?1:0}function ut(t,e,i){if(void 0===i&&(i={}),!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var n=$(t),r=et(e),o=r.type,s=e.bbox,a=r.coordinates;if(s&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(n,s))return!1;"Polygon"===o&&(a=[a]);for(var l=!1,c=0;c<a.length&&!l;c++)if(ht(n,a[c][0],i.ignoreBoundary)){for(var u=!1,h=1;h<a[c].length&&!u;)ht(n,a[c][h],!i.ignoreBoundary)&&(u=!0),h++;u||(l=!0)}return l}function ht(t,e,i){var n=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var r=0,o=e.length-1;r<e.length;o=r++){var s=e[r][0],a=e[r][1],l=e[o][0],c=e[o][1];if(t[1]*(s-l)+a*(l-t[0])+c*(t[0]-s)==0&&(s-t[0])*(l-t[0])<=0&&(a-t[1])*(c-t[1])<=0)return!i;a>t[1]!=c>t[1]&&t[0]<(l-s)*(t[1]-a)/(c-a)+s&&(n=!n)}return n}function pt(t,e,i){void 0===i&&(i={});var n=$(t),r=$(e),o=j(r[1]-n[1]),s=j(r[0]-n[0]),a=j(n[1]),l=j(r[1]),c=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(a)*Math.cos(l);return V(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)),i.units)}function dt(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return ft(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach((function(i){switch(i){case"type":case"features":return;default:e[i]=t[i]}})),e.features=t.features.map((function(t){return ft(t)})),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return gt(t);default:throw new Error("unknown GeoJSON type")}}function ft(t){var e={type:"Feature"};return Object.keys(t).forEach((function(i){switch(i){case"type":case"properties":case"geometry":return;default:e[i]=t[i]}})),e.properties=mt(t.properties),e.geometry=gt(t.geometry),e}function mt(t){var e={};return t?(Object.keys(t).forEach((function(i){var n=t[i];"object"==typeof n?null===n?e[i]=null:Array.isArray(n)?e[i]=n.map((function(t){return t})):e[i]=mt(n):e[i]=n})),e):e}function gt(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map((function(t){return gt(t)})),e):(e.coordinates=yt(t.coordinates),e)}function yt(t){var e=t;return"object"!=typeof e[0]?e.slice():e.map((function(t){return yt(t)}))}function vt(t){return function(t,e){void 0===e&&(e={});var i=Number(t[0]),n=Number(t[1]),r=Number(t[2]),o=Number(t[3]);if(6===t.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var s=[i,n];return O([[s,[r,n],[r,o],[i,o],s]],e.properties,{bbox:t,id:e.id})}(K(t))}function _t(t,e,i,n){void 0===n&&(n={});var r=$(t),o=j(r[0]),s=j(r[1]),a=j(i),l=U(e,n.units),c=Math.asin(Math.sin(s)*Math.cos(l)+Math.cos(s)*Math.sin(l)*Math.cos(a));return R([G(o+Math.atan2(Math.sin(a)*Math.sin(l)*Math.cos(s),Math.cos(l)-Math.sin(s)*Math.sin(c))),G(c)],n.properties)}function xt(t,e,i){if(void 0===i&&(i={}),!0===i.final)return function(t,e){var i=xt(e,t);return i=(i+180)%360}(t,e);var n=$(t),r=$(e),o=j(n[0]),s=j(r[0]),a=j(n[1]),l=j(r[1]),c=Math.sin(s-o)*Math.cos(l),u=Math.cos(a)*Math.sin(l)-Math.sin(a)*Math.cos(l)*Math.cos(s-o);return G(Math.atan2(c,u))}function bt(t,e){void 0===e&&(e={});var i=K(t);return R([(i[0]+i[2])/2,(i[1]+i[3])/2],e.properties,e)}function wt(t,e){void 0===e&&(e={});var i=0,n=0,r=0;return q(t,(function(t){i+=t[0],n+=t[1],r++}),!0),R([i/r,n/r],e.properties)}function At(t){if(!t)throw new Error("geojson is required");var e=[];return Q(t,(function(t){!function(t,e){var i=[],n=t.geometry;if(null!==n){switch(n.type){case"Polygon":i=tt(n);break;case"LineString":i=[tt(n)]}i.forEach((function(i){var n=function(t,e){var i=[];return t.reduce((function(t,n){var r=k([t,n],e);return r.bbox=function(t,e){var i=t[0],n=t[1],r=e[0],o=e[1],s=i<r?i:r,a=n<o?n:o,l=i>r?i:r,c=n>o?n:o;return[s,a,l,c]}(t,n),i.push(r),n})),i}(i,t.properties);n.forEach((function(t){t.id=e.length,e.push(t)}))}))}}(t,e)})),N(e)}var Et={exports:{}};function St(t,e,i){if(!i)return e.indexOf(t);for(let n=0;n<e.length;n++)if(i(t,e[n]))return n;return-1}function Mt(t,e){Tt(t,0,t.children.length,e,t)}function Tt(t,e,i,n,r){r||(r=Bt(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let o=e;o<i;o++){const e=t.children[o];It(r,t.leaf?n(e):e)}return r}function It(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function Ct(t,e){return t.minX-e.minX}function Pt(t,e){return t.minY-e.minY}function Lt(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function Dt(t){return t.maxX-t.minX+(t.maxY-t.minY)}function Rt(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function Ot(t,e){const i=Math.max(t.minX,e.minX),n=Math.max(t.minY,e.minY),r=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,r-i)*Math.max(0,o-n)}function kt(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function Nt(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function Bt(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function zt(t,e,i,n,r){const o=[e,i];for(;o.length;){if((i=o.pop())-(e=o.pop())<=n)continue;const s=e+Math.ceil((i-e)/n/2)*n;st(t,s,e,i,r),o.push(e,s,s,i)}}var Ft=Object.freeze({__proto__:null,default:class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const i=[];if(!Nt(t,e))return i;const n=this.toBBox,r=[];for(;e;){for(let o=0;o<e.children.length;o++){const s=e.children[o],a=e.leaf?n(s):s;Nt(t,a)&&(e.leaf?i.push(s):kt(t,a)?this._all(s,i):r.push(s))}e=r.pop()}return i}collides(t){let e=this.data;if(!Nt(t,e))return!1;const i=[];for(;e;){for(let n=0;n<e.children.length;n++){const r=e.children[n],o=e.leaf?this.toBBox(r):r;if(Nt(t,o)){if(e.leaf||kt(t,o))return!0;i.push(r)}}e=i.pop()}return!1}load(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(let e=0;e<t.length;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=Bt([]),this}remove(t,e){if(!t)return this;let i=this.data;const n=this.toBBox(t),r=[],o=[];let s,a,l;for(;i||r.length;){if(i||(i=r.pop(),a=r[r.length-1],s=o.pop(),l=!0),i.leaf){const n=St(t,i.children,e);if(-1!==n)return i.children.splice(n,1),r.push(i),this._condense(r),this}l||i.leaf||!kt(i,n)?a?(s++,i=a.children[s],l=!1):i=null:(r.push(i),o.push(s),s=0,a=i,i=i.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const i=[];for(;t;)t.leaf?e.push(...t.children):i.push(...t.children),t=i.pop();return e}_build(t,e,i,n){const r=i-e+1;let o,s=this._maxEntries;if(r<=s)return o=Bt(t.slice(e,i+1)),Mt(o,this.toBBox),o;n||(n=Math.ceil(Math.log(r)/Math.log(s)),s=Math.ceil(r/Math.pow(s,n-1))),o=Bt([]),o.leaf=!1,o.height=n;const a=Math.ceil(r/s),l=a*Math.ceil(Math.sqrt(s));zt(t,e,i,l,this.compareMinX);for(let r=e;r<=i;r+=l){const e=Math.min(r+l-1,i);zt(t,r,e,a,this.compareMinY);for(let i=r;i<=e;i+=a){const r=Math.min(i+a-1,e);o.children.push(this._build(t,i,r,n-1))}}return Mt(o,this.toBBox),o}_chooseSubtree(t,e,i,n){for(;n.push(e),!e.leaf&&n.length-1!==i;){let i,n=1/0,r=1/0;for(let o=0;o<e.children.length;o++){const s=e.children[o],a=Lt(s),l=Rt(t,s)-a;l<r?(r=l,n=a<n?a:n,i=s):l===r&&a<n&&(n=a,i=s)}e=i||e.children[0]}return e}_insert(t,e,i){const n=i?t:this.toBBox(t),r=[],o=this._chooseSubtree(n,this.data,e,r);for(o.children.push(t),It(o,n);e>=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)}_split(t,e){const i=t[e],n=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,n);const o=this._chooseSplitIndex(i,r,n),s=Bt(i.children.splice(o,i.children.length-o));s.height=i.height,s.leaf=i.leaf,Mt(i,this.toBBox),Mt(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(i,s)}_splitRoot(t,e){this.data=Bt([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Mt(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let n,r=1/0,o=1/0;for(let s=e;s<=i-e;s++){const e=Tt(t,0,s,this.toBBox),a=Tt(t,s,i,this.toBBox),l=Ot(e,a),c=Lt(e)+Lt(a);l<r?(r=l,n=s,o=c<o?c:o):l===r&&c<o&&(o=c,n=s)}return n||i-e}_chooseSplitAxis(t,e,i){const n=t.leaf?this.compareMinX:Ct,r=t.leaf?this.compareMinY:Pt;this._allDistMargin(t,e,i,n)<this._allDistMargin(t,e,i,r)&&t.children.sort(n)}_allDistMargin(t,e,i,n){t.children.sort(n);const r=this.toBBox,o=Tt(t,0,e,r),s=Tt(t,i-e,i,r);let a=Dt(o)+Dt(s);for(let n=e;n<i-e;n++){const e=t.children[n];It(o,t.leaf?r(e):e),a+=Dt(o)}for(let n=i-e-1;n>=e;n--){const e=t.children[n];It(s,t.leaf?r(e):e),a+=Dt(s)}return a}_adjustParentBBoxes(t,e,i){for(let n=i;n>=0;n--)It(e[n],t)}_condense(t){for(let e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children,e.splice(e.indexOf(t[i]),1)):this.clear():Mt(t[i],this.toBBox)}}}),Vt=ot(Ft),Ut={};!function(t){function e(t,e,i){void 0===i&&(i={});var n={type:"Feature"};return(0===i.id||i.id)&&(n.id=i.id),i.bbox&&(n.bbox=i.bbox),n.properties=e||{},n.geometry=t,n}function i(t,i,n){if(void 0===n&&(n={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!p(t[0])||!p(t[1]))throw new Error("coordinates must contain numbers");return e({type:"Point",coordinates:t},i,n)}function n(t,i,n){void 0===n&&(n={});for(var r=0,o=t;r<o.length;r++){var s=o[r];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<s[s.length-1].length;a++)if(s[s.length-1][a]!==s[0][a])throw new Error("First and last Position are not equivalent.")}return e({type:"Polygon",coordinates:t},i,n)}function r(t,i,n){if(void 0===n&&(n={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return e({type:"LineString",coordinates:t},i,n)}function o(t,e){void 0===e&&(e={});var i={type:"FeatureCollection"};return e.id&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.features=t,i}function s(t,i,n){return void 0===n&&(n={}),e({type:"MultiLineString",coordinates:t},i,n)}function a(t,i,n){return void 0===n&&(n={}),e({type:"MultiPoint",coordinates:t},i,n)}function l(t,i,n){return void 0===n&&(n={}),e({type:"MultiPolygon",coordinates:t},i,n)}function c(e,i){void 0===i&&(i="kilometers");var n=t.factors[i];if(!n)throw new Error(i+" units is invalid");return e*n}function u(e,i){void 0===i&&(i="kilometers");var n=t.factors[i];if(!n)throw new Error(i+" units is invalid");return e/n}function h(t){return 180*(t%(2*Math.PI))/Math.PI}function p(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.earthRadius=6371008.8,t.factors={centimeters:100*t.earthRadius,centimetres:100*t.earthRadius,degrees:t.earthRadius/111325,feet:3.28084*t.earthRadius,inches:39.37*t.earthRadius,kilometers:t.earthRadius/1e3,kilometres:t.earthRadius/1e3,meters:t.earthRadius,metres:t.earthRadius,miles:t.earthRadius/1609.344,millimeters:1e3*t.earthRadius,millimetres:1e3*t.earthRadius,nauticalmiles:t.earthRadius/1852,radians:1,yards:1.0936*t.earthRadius},t.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/t.earthRadius,yards:1.0936133},t.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046},t.feature=e,t.geometry=function(t,e,o){switch(t){case"Point":return i(e).geometry;case"LineString":return r(e).geometry;case"Polygon":return n(e).geometry;case"MultiPoint":return a(e).geometry;case"MultiLineString":return s(e).geometry;case"MultiPolygon":return l(e).geometry;default:throw new Error(t+" is invalid")}},t.point=i,t.points=function(t,e,n){return void 0===n&&(n={}),o(t.map((function(t){return i(t,e)})),n)},t.polygon=n,t.polygons=function(t,e,i){return void 0===i&&(i={}),o(t.map((function(t){return n(t,e)})),i)},t.lineString=r,t.lineStrings=function(t,e,i){return void 0===i&&(i={}),o(t.map((function(t){return r(t,e)})),i)},t.featureCollection=o,t.multiLineString=s,t.multiPoint=a,t.multiPolygon=l,t.geometryCollection=function(t,i,n){return void 0===n&&(n={}),e({type:"GeometryCollection",geometries:t},i,n)},t.round=function(t,e){if(void 0===e&&(e=0),e&&!(e>=0))throw new Error("precision must be a positive number");var i=Math.pow(10,e||0);return Math.round(t*i)/i},t.radiansToLength=c,t.lengthToRadians=u,t.lengthToDegrees=function(t,e){return h(u(t,e))},t.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},t.radiansToDegrees=h,t.degreesToRadians=function(t){return t%360*Math.PI/180},t.convertLength=function(t,e,i){if(void 0===e&&(e="kilometers"),void 0===i&&(i="kilometers"),!(t>=0))throw new Error("length must be a positive number");return c(u(t,e),i)},t.convertArea=function(e,i,n){if(void 0===i&&(i="meters"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("area must be a positive number");var r=t.areaFactors[i];if(!r)throw new Error("invalid original units");var o=t.areaFactors[n];if(!o)throw new Error("invalid final units");return e/r*o},t.isNumber=p,t.isObject=function(t){return!!t&&t.constructor===Object},t.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!p(t))throw new Error("bbox must only contain numbers")}))},t.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}}(Ut);var Gt={};Object.defineProperty(Gt,"__esModule",{value:!0});var jt=Ut;function Ht(t,e,i){if(null!==t)for(var n,r,o,s,a,l,c,u,h=0,p=0,d=t.type,f="FeatureCollection"===d,m="Feature"===d,g=f?t.features.length:1,y=0;y<g;y++){a=(u=!!(c=f?t.features[y].geometry:m?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var v=0;v<a;v++){var _=0,x=0;if(null!==(s=u?c.geometries[v]:c)){l=s.coordinates;var b=s.type;switch(h=!i||"Polygon"!==b&&"MultiPolygon"!==b?0:1,b){case null:break;case"Point":if(!1===e(l,p,y,_,x))return!1;p++,_++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(!1===e(l[n],p,y,_,x))return!1;p++,"MultiPoint"===b&&_++}"LineString"===b&&_++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(r=0;r<l[n].length-h;r++){if(!1===e(l[n][r],p,y,_,x))return!1;p++}"MultiLineString"===b&&_++,"Polygon"===b&&x++}"Polygon"===b&&_++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(x=0,r=0;r<l[n].length;r++){for(o=0;o<l[n][r].length-h;o++){if(!1===e(l[n][r][o],p,y,_,x))return!1;p++}x++}_++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(!1===Ht(s.geometries[n],e,i))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Wt(t,e){var i;switch(t.type){case"FeatureCollection":for(i=0;i<t.features.length&&!1!==e(t.features[i].properties,i);i++);break;case"Feature":e(t.properties,0)}}function qt(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var i=0;i<t.features.length&&!1!==e(t.features[i],i);i++);}function Xt(t,e){var i,n,r,o,s,a,l,c,u,h,p=0,d="FeatureCollection"===t.type,f="Feature"===t.type,m=d?t.features.length:1;for(i=0;i<m;i++){for(a=d?t.features[i].geometry:f?t.geometry:t,c=d?t.features[i].properties:f?t.properties:{},u=d?t.features[i].bbox:f?t.bbox:void 0,h=d?t.features[i].id:f?t.id:void 0,s=(l=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,r=0;r<s;r++)if(null!==(o=l?a.geometries[r]:a))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(o,p,c,u,h))return!1;break;case"GeometryCollection":for(n=0;n<o.geometries.length;n++)if(!1===e(o.geometries[n],p,c,u,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,p,c,u,h))return!1;p++}}function Zt(t,e){Xt(t,(function(t,i,n,r,o){var s,a=null===t?null:t.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return!1!==e(jt.feature(t,n,{bbox:r,id:o}),i,0)&&void 0}switch(a){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var l=0;l<t.coordinates.length;l++){var c={type:s,coordinates:t.coordinates[l]};if(!1===e(jt.feature(c,n),i,l))return!1}}))}function Yt(t,e){Zt(t,(function(t,i,n){var r=0;if(t.geometry){var o=t.geometry.type;if("Point"!==o&&"MultiPoint"!==o){var s,a=0,l=0,c=0;return!1!==Ht(t,(function(o,u,h,p,d){if(void 0===s||i>a||p>l||d>c)return s=o,a=i,l=p,c=d,void(r=0);var f=jt.lineString([s,o],t.properties);if(!1===e(f,i,n,d,r))return!1;r++,s=o}))&&void 0}}}))}function Qt(t,e){if(!t)throw new Error("geojson is required");Zt(t,(function(t,i,n){if(null!==t.geometry){var r=t.geometry.type,o=t.geometry.coordinates;switch(r){case"LineString":if(!1===e(t,i,n,0,0))return!1;break;case"Polygon":for(var s=0;s<o.length;s++)if(!1===e(jt.lineString(o[s],t.properties),i,n,s))return!1}}}))}Gt.coordAll=function(t){var e=[];return Ht(t,(function(t){e.push(t)})),e},Gt.coordEach=Ht,Gt.coordReduce=function(t,e,i,n){var r=i;return Ht(t,(function(t,n,o,s,a){r=0===n&&void 0===i?t:e(r,t,n,o,s,a)}),n),r},Gt.featureEach=qt,Gt.featureReduce=function(t,e,i){var n=i;return qt(t,(function(t,r){n=0===r&&void 0===i?t:e(n,t,r)})),n},Gt.findPoint=function(t,e){if(e=e||{},!jt.isObject(e))throw new Error("options is invalid");var i,n=e.featureIndex||0,r=e.multiFeatureIndex||0,o=e.geometryIndex||0,s=e.coordIndex||0,a=e.properties;switch(t.type){case"FeatureCollection":n<0&&(n=t.features.length+n),a=a||t.features[n].properties,i=t.features[n].geometry;break;case"Feature":a=a||t.properties,i=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":i=t;break;default:throw new Error("geojson is invalid")}if(null===i)return null;var l=i.coordinates;switch(i.type){case"Point":return jt.point(l,a,e);case"MultiPoint":return r<0&&(r=l.length+r),jt.point(l[r],a,e);case"LineString":return s<0&&(s=l.length+s),jt.point(l[s],a,e);case"Polygon":return o<0&&(o=l.length+o),s<0&&(s=l[o].length+s),jt.point(l[o][s],a,e);case"MultiLineString":return r<0&&(r=l.length+r),s<0&&(s=l[r].length+s),jt.point(l[r][s],a,e);case"MultiPolygon":return r<0&&(r=l.length+r),o<0&&(o=l[r].length+o),s<0&&(s=l[r][o].length-s),jt.point(l[r][o][s],a,e)}throw new Error("geojson is invalid")},Gt.findSegment=function(t,e){if(e=e||{},!jt.isObject(e))throw new Error("options is invalid");var i,n=e.featureIndex||0,r=e.multiFeatureIndex||0,o=e.geometryIndex||0,s=e.segmentIndex||0,a=e.properties;switch(t.type){case"FeatureCollection":n<0&&(n=t.features.length+n),a=a||t.features[n].properties,i=t.features[n].geometry;break;case"Feature":a=a||t.properties,i=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":i=t;break;default:throw new Error("geojson is invalid")}if(null===i)return null;var l=i.coordinates;switch(i.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=l.length+s-1),jt.lineString([l[s],l[s+1]],a,e);case"Polygon":return o<0&&(o=l.length+o),s<0&&(s=l[o].length+s-1),jt.lineString([l[o][s],l[o][s+1]],a,e);case"MultiLineString":return r<0&&(r=l.length+r),s<0&&(s=l[r].length+s-1),jt.lineString([l[r][s],l[r][s+1]],a,e);case"MultiPolygon":return r<0&&(r=l.length+r),o<0&&(o=l[r].length+o),s<0&&(s=l[r][o].length-s-1),jt.lineString([l[r][o][s],l[r][o][s+1]],a,e)}throw new Error("geojson is invalid")},Gt.flattenEach=Zt,Gt.flattenReduce=function(t,e,i){var n=i;return Zt(t,(function(t,r,o){n=0===r&&0===o&&void 0===i?t:e(n,t,r,o)})),n},Gt.geomEach=Xt,Gt.geomReduce=function(t,e,i){var n=i;return Xt(t,(function(t,r,o,s,a){n=0===r&&void 0===i?t:e(n,t,r,o,s,a)})),n},Gt.lineEach=Qt,Gt.lineReduce=function(t,e,i){var n=i;return Qt(t,(function(t,r,o,s){n=0===r&&void 0===i?t:e(n,t,r,o,s)})),n},Gt.propEach=Wt,Gt.propReduce=function(t,e,i){var n=i;return Wt(t,(function(t,r){n=0===r&&void 0===i?t:e(n,t,r)})),n},Gt.segmentEach=Yt,Gt.segmentReduce=function(t,e,i){var n=i,r=!1;return Yt(t,(function(t,o,s,a,l){n=!1===r&&void 0===i?t:e(n,t,o,s,a,l),r=!0})),n};var Jt={};Object.defineProperty(Jt,"__esModule",{value:!0});var Kt=Gt;function $t(t){var e=[1/0,1/0,-1/0,-1/0];return Kt.coordEach(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])})),e}$t.default=$t,Jt.default=$t;var te=Vt,ee=Ut,ie=Gt,ne=Jt.default,re=ie.featureEach;ie.coordEach;var oe=ee.featureCollection;function se(t){var e=new te(t);return e.insert=function(t){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:ne(t),te.prototype.insert.call(this,t)},e.load=function(t){var e=[];return Array.isArray(t)?t.forEach((function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:ne(t),e.push(t)})):re(t,(function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:ne(t),e.push(t)})),te.prototype.load.call(this,e)},e.remove=function(t,e){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:ne(t),te.prototype.remove.call(this,t,e)},e.clear=function(){return te.prototype.clear.call(this)},e.search=function(t){var e=te.prototype.search.call(this,this.toBBox(t));return oe(e)},e.collides=function(t){return te.prototype.collides.call(this,this.toBBox(t))},e.all=function(){var t=te.prototype.all.call(this);return oe(t)},e.toJSON=function(){return te.prototype.toJSON.call(this)},e.fromJSON=function(t){return te.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e;if(t.bbox)e=t.bbox;else if(Array.isArray(t)&&4===t.length)e=t;else if(Array.isArray(t)&&6===t.length)e=[t[0],t[1],t[3],t[4]];else if("Feature"===t.type)e=ne(t);else{if("FeatureCollection"!==t.type)throw new Error("invalid geojson");e=ne(t)}return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}Et.exports=se,Et.exports.default=se;var ae=rt(Et.exports);function le(t,e){var i={},n=[];if("LineString"===t.type&&(t=D(t)),"LineString"===e.type&&(e=D(e)),"Feature"===t.type&&"Feature"===e.type&&null!==t.geometry&&null!==e.geometry&&"LineString"===t.geometry.type&&"LineString"===e.geometry.type&&2===t.geometry.coordinates.length&&2===e.geometry.coordinates.length){var r=ce(t,e);return r&&n.push(r),N(n)}var o=ae();return o.load(At(e)),X(At(t),(function(t){X(o.search(t),(function(e){var r=ce(t,e);if(r){var o=tt(r).join(",");i[o]||(i[o]=!0,n.push(r))}}))})),N(n)}function ce(t,e){var i=tt(t),n=tt(e);if(2!==i.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==n.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var r=i[0][0],o=i[0][1],s=i[1][0],a=i[1][1],l=n[0][0],c=n[0][1],u=n[1][0],h=n[1][1],p=(h-c)*(s-r)-(u-l)*(a-o),d=(u-l)*(o-c)-(h-c)*(r-l),f=(s-r)*(o-c)-(a-o)*(r-l);if(0===p)return null;var m=d/p,g=f/p;return m>=0&&m<=1&&g>=0&&g<=1?R([r+m*(s-r),o+m*(a-o)]):null}function ue(t,e,i){void 0===i&&(i={});var n=R([1/0,1/0],{dist:1/0}),r=0;return Q(t,(function(t){for(var o=tt(t),s=0;s<o.length-1;s++){var a=R(o[s]);a.properties.dist=pt(e,a,i);var l=R(o[s+1]);l.properties.dist=pt(e,l,i);var c=pt(a,l,i),u=Math.max(a.properties.dist,l.properties.dist),h=xt(a,l),p=_t(e,u,h+90,i),d=_t(e,u,h-90,i),f=le(k([p.geometry.coordinates,d.geometry.coordinates]),k([a.geometry.coordinates,l.geometry.coordinates])),m=null;f.features.length>0&&((m=f.features[0]).properties.dist=pt(e,m,i),m.properties.location=r+pt(a,m,i)),a.properties.dist<n.properties.dist&&((n=a).properties.index=s,n.properties.location=r),l.properties.dist<n.properties.dist&&((n=l).properties.index=s+1,n.properties.location=r+c),m&&m.properties.dist<n.properties.dist&&((n=m).properties.index=s),r+=c}})),n}var he=6378137;function pe(t){return function(t,e,i){var n=i;return Y(t,(function(t,r,o,s,a){n=0===r&&void 0===i?t:e(n,t,r,o,s,a)})),n}(t,(function(t,e){return t+function(t){var e,i=0;switch(t.type){case"Polygon":return de(t.coordinates);case"MultiPolygon":for(e=0;e<t.coordinates.length;e++)i+=de(t.coordinates[e]);return i;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(e)}),0)}function de(t){var e=0;if(t&&t.length>0){e+=Math.abs(fe(t[0]));for(var i=1;i<t.length;i++)e-=Math.abs(fe(t[i]))}return e}function fe(t){var e,i,n,r,o,s,a=0,l=t.length;if(l>2){for(s=0;s<l;s++)s===l-2?(n=l-2,r=l-1,o=0):s===l-1?(n=l-1,r=0,o=1):(n=s,r=s+1,o=s+2),e=t[n],i=t[r],a+=(me(t[o][0])-me(e[0]))*Math.sin(me(i[1]));a=a*he*he/2}return a}function me(t){return t*Math.PI/180}function ge(t,e,i){void 0===i&&(i={});for(var n=et(t).coordinates,r=0,o=0;o<n.length&&!(e>=r&&o===n.length-1);o++){if(r>=e){var s=e-r;if(s){var a=xt(n[o],n[o-1])-180;return _t(n[o],s,a,i)}return R(n[o])}r+=pt(n[o],n[o+1],i)}return R(n[n.length-1])}function ye(t,e){return void 0===e&&(e={}),function(t,e,i){var n=i,r=!1;return J(t,(function(t,o,s,a,l){n=!1===r&&void 0===i?t:e(n,t,o,s,a,l),r=!0})),n}(t,(function(t,i){var n=i.geometry.coordinates;return t+pt(n[0],n[1],e)}),0)}function ve(t,e,i,n){if(!W(n=n||{}))throw new Error("options is invalid");var r,o=[];if("Feature"===t.type)r=t.geometry.coordinates;else{if("LineString"!==t.type)throw new Error("input must be a LineString Feature or Geometry");r=t.coordinates}for(var s,a,l,c=r.length,u=0,h=0;h<r.length&&!(e>=u&&h===r.length-1);h++){if(u>e&&0===o.length){if(!(s=e-u))return o.push(r[h]),k(o);a=xt(r[h],r[h-1])-180,l=_t(r[h],s,a,n),o.push(l.geometry.coordinates)}if(u>=i)return(s=i-u)?(a=xt(r[h],r[h-1])-180,l=_t(r[h],s,a,n),o.push(l.geometry.coordinates),k(o)):(o.push(r[h]),k(o));if(u>=e&&o.push(r[h]),h===r.length-1)return k(o);u+=pt(r[h],r[h+1],n)}if(u<e&&r.length===c)throw new Error("Start position is beyond line");var p=r[r.length-1];return k([p,p])}function _e(t,e,i){void 0===i&&(i={});for(var n=$(t),r=tt(e),o=0;o<r.length-1;o++){var s=!1;if(i.ignoreEndVertices&&(0===o&&(s="start"),o===r.length-2&&(s="end"),0===o&&o+1===r.length-1&&(s="both")),xe(r[o],r[o+1],n,s,void 0===i.epsilon?null:i.epsilon))return!0}return!1}function xe(t,e,i,n,r){var o=i[0],s=i[1],a=t[0],l=t[1],c=e[0],u=e[1],h=c-a,p=u-l,d=(i[0]-a)*p-(i[1]-l)*h;if(null!==r){if(Math.abs(d)>r)return!1}else if(0!==d)return!1;return n?"start"===n?Math.abs(h)>=Math.abs(p)?h>0?a<o&&o<=c:c<=o&&o<a:p>0?l<s&&s<=u:u<=s&&s<l:"end"===n?Math.abs(h)>=Math.abs(p)?h>0?a<=o&&o<c:c<o&&o<=a:p>0?l<=s&&s<u:u<s&&s<=l:"both"===n&&(Math.abs(h)>=Math.abs(p)?h>0?a<o&&o<c:c<o&&o<a:p>0?l<s&&s<u:u<s&&s<l):Math.abs(h)>=Math.abs(p)?h>0?a<=o&&o<=c:c<=o&&o<=a:p>0?l<=s&&s<=u:u<=s&&s<=l}function be(t,e){var i=et(t),n=et(e),r=i.type,o=n.type;switch(r){case"Point":switch(o){case"MultiPoint":return function(t,e){var i,n=!1;for(i=0;i<e.coordinates.length;i++)if(Ae(e.coordinates[i],t.coordinates)){n=!0;break}return n}(i,n);case"LineString":return _e(i,n,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return ut(i,n,{ignoreBoundary:!0});default:throw new Error("feature2 "+o+" geometry not supported")}case"MultiPoint":switch(o){case"MultiPoint":return function(t,e){for(var i=0;i<t.coordinates.length;i++){for(var n=!1,r=0;r<e.coordinates.length;r++)Ae(t.coordinates[i],e.coordinates[r])&&(n=!0);if(!n)return!1}return!0}(i,n);case"LineString":return function(t,e){for(var i=!1,n=0;n<t.coordinates.length;n++){if(!_e(t.coordinates[n],e))return!1;i||(i=_e(t.coordinates[n],e,{ignoreEndVertices:!0}))}return i}(i,n);case"Polygon":case"MultiPolygon":return function(t,e){for(var i=!0,n=!1,r=0;r<t.coordinates.length;r++){if(!(n=ut(t.coordinates[1],e))){i=!1;break}n=ut(t.coordinates[1],e,{ignoreBoundary:!0})}return i&&n}(i,n);default:throw new Error("feature2 "+o+" geometry not supported")}case"LineString":switch(o){case"LineString":return function(t,e){for(var i=0;i<t.coordinates.length;i++)if(!_e(t.coordinates[i],e))return!1;return!0}(i,n);case"Polygon":case"MultiPolygon":return function(t,e){var i=K(e),n=K(t);if(!we(i,n))return!1;for(var r=!1,o=0;o<t.coordinates.length-1;o++){if(!ut(t.coordinates[o],e))return!1;if(r||(r=ut(t.coordinates[o],e,{ignoreBoundary:!0})),!r)r=ut(Ee(t.coordinates[o],t.coordinates[o+1]),e,{ignoreBoundary:!0})}return r}(i,n);default:throw new Error("feature2 "+o+" geometry not supported")}case"Polygon":switch(o){case"Polygon":case"MultiPolygon":return function(t,e){var i=K(t);if(!we(K(e),i))return!1;for(var n=0;n<t.coordinates[0].length;n++)if(!ut(t.coordinates[0][n],e))return!1;return!0}(i,n);default:throw new Error("feature2 "+o+" geometry not supported")}default:throw new Error("feature1 "+r+" geometry not supported")}}function we(t,e){return!(t[0]>e[0])&&(!(t[2]<e[2])&&(!(t[1]>e[1])&&!(t[3]<e[3])))}function Ae(t,e){return t[0]===e[0]&&t[1]===e[1]}function Ee(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}function Se(t,e,i){void 0===i&&(i={}),i.mask&&!i.units&&(i.units="kilometers");for(var n=[],r=t[0],o=t[1],s=t[2],a=t[3],l=e/pt([r,o],[s,o],i)*(s-r),c=e/pt([r,o],[r,a],i)*(a-o),u=s-r,h=a-o,p=Math.floor(u/l),d=(h-Math.floor(h/c)*c)/2,f=r+(u-p*l)/2;f<=s;){for(var m=o+d;m<=a;){var g=R([f,m],i.properties);i.mask?be(g,i.mask)&&n.push(g):n.push(g),m+=c}f+=l}return N(n)}function Me(t,e,i){if(!W(i=i||{}))throw new Error("options is invalid");var n=i.units,r=i.reverse;if(!t)throw new Error("geojson is required");if(e<=0)throw new Error("segmentLength must be greater than 0");var o=[];return Q(t,(function(t){r&&(t.geometry.coordinates=t.geometry.coordinates.reverse()),function(t,e,i,n){var r=ye(t,{units:i});if(r<=e)return n(t);var o=r/e;Number.isInteger(o)||(o=Math.floor(o)+1);for(var s=0;s<o;s++){n(ve(t,e*s,e*(s+1),{units:i}),s)}}(t,e,n,(function(t){o.push(t)}))})),N(o)}function Te(t,e){void 0===e&&(e={});var i=et(t);switch(e.properties||"Feature"!==t.type||(e.properties=t.properties),i.type){case"Polygon":return function(t,e){void 0===e&&(e={});var i=et(t),n=i.coordinates,r=e.properties?e.properties:"Feature"===t.type?t.properties:{};return Ie(n,r)}(i,e);case"MultiPolygon":return function(t,e){void 0===e&&(e={});var i=et(t),n=i.coordinates,r=e.properties?e.properties:"Feature"===t.type?t.properties:{},o=[];return n.forEach((function(t){o.push(Ie(t,r))})),N(o)}(i,e);default:throw new Error("invalid poly")}}function Ie(t,e){return t.length>1?B(t,e):k(t[0],e)}var Ce,Pe,Le=Object.prototype.toString,De=function(t){var e=Le.call(t),i="[object Arguments]"===e;return i||(i="[object Array]"!==e&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===Le.call(t.callee)),i};var Re=Array.prototype.slice,Oe=De,ke=Object.keys,Ne=ke?function(t){return ke(t)}:function(){if(Pe)return Ce;var t;if(Pe=1,!Object.keys){var e=Object.prototype.hasOwnProperty,i=Object.prototype.toString,n=De,r=Object.prototype.propertyIsEnumerable,o=!r.call({toString:null},"toString"),s=r.call((function(){}),"prototype"),a=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(t){var e=t.constructor;return e&&e.prototype===t},c={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},u=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!c["$"+t]&&e.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{l(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();t=function(t){var r=null!==t&&"object"==typeof t,c="[object Function]"===i.call(t),h=n(t),p=r&&"[object String]"===i.call(t),d=[];if(!r&&!c&&!h)throw new TypeError("Object.keys called on a non-object");var f=s&&c;if(p&&t.length>0&&!e.call(t,0))for(var m=0;m<t.length;++m)d.push(String(m));if(h&&t.length>0)for(var g=0;g<t.length;++g)d.push(String(g));else for(var y in t)f&&"prototype"===y||!e.call(t,y)||d.push(String(y));if(o)for(var v=function(t){if("undefined"==typeof window||!u)return l(t);try{return l(t)}catch(t){return!1}}(t),_=0;_<a.length;++_)v&&"constructor"===a[_]||!e.call(t,a[_])||d.push(a[_]);return d}}return Ce=t}(),Be=Object.keys;Ne.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return Oe(t)?Be(Re.call(t)):Be(t)})}else Object.keys=Ne;return Object.keys||Ne};var ze,Fe=Ne,Ve=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),i=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(i))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var r=Object.getOwnPropertyDescriptor(t,e);if(42!==r.value||!0!==r.enumerable)return!1}return!0},Ue=Ve,Ge=function(){return Ue()&&!!Symbol.toStringTag},je="undefined"!=typeof Symbol&&Symbol,He=Ve,We={foo:{}},qe=Object,Xe=Object.prototype.toString,Ze=Math.max,Ye=function(t,e){for(var i=[],n=0;n<t.length;n+=1)i[n]=t[n];for(var r=0;r<e.length;r+=1)i[r+t.length]=e[r];return i},Qe=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==Xe.apply(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var i,n=function(t,e){for(var i=[],n=e||0,r=0;n<t.length;n+=1,r+=1)i[r]=t[n];return i}(arguments,1),r=Ze(0,e.length-n.length),o=[],s=0;s<r;s++)o[s]="$"+s;if(i=Function("binder","return function ("+function(t,e){for(var i="",n=0;n<t.length;n+=1)i+=t[n],n+1<t.length&&(i+=e);return i}(o,",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof i){var r=e.apply(this,Ye(n,arguments));return Object(r)===r?r:this}return e.apply(t,Ye(n,arguments))})),e.prototype){var a=function(){};a.prototype=e.prototype,i.prototype=new a,a.prototype=null}return i},Je=Function.prototype.bind||Qe,Ke=Function.prototype.call,$e=Object.prototype.hasOwnProperty,ti=Je.call(Ke,$e),ei=SyntaxError,ii=Function,ni=TypeError,ri=function(t){try{return ii('"use strict"; return ('+t+").constructor;")()}catch(t){}},oi=Object.getOwnPropertyDescriptor;if(oi)try{oi({},"")}catch(zO){oi=null}var si=function(){throw new ni},ai=oi?function(){try{return si}catch(t){try{return oi(arguments,"callee").get}catch(t){return si}}}():si,li="function"==typeof je&&"function"==typeof Symbol&&"symbol"==typeof je("foo")&&"symbol"==typeof Symbol("bar")&&He(),ci={__proto__:We}.foo===We.foo&&!({__proto__:null}instanceof qe),ui=Object.getPrototypeOf||(ci?function(t){return t.__proto__}:null),hi={},pi="undefined"!=typeof Uint8Array&&ui?ui(Uint8Array):ze,di={"%AggregateError%":"undefined"==typeof AggregateError?ze:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?ze:ArrayBuffer,"%ArrayIteratorPrototype%":li&&ui?ui([][Symbol.iterator]()):ze,"%AsyncFromSyncIteratorPrototype%":ze,"%AsyncFunction%":hi,"%AsyncGenerator%":hi,"%AsyncGeneratorFunction%":hi,"%AsyncIteratorPrototype%":hi,"%Atomics%":"undefined"==typeof Atomics?ze:Atomics,"%BigInt%":"undefined"==typeof BigInt?ze:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?ze:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?ze:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?ze:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?ze:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?ze:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?ze:FinalizationRegistry,"%Function%":ii,"%GeneratorFunction%":hi,"%Int8Array%":"undefined"==typeof Int8Array?ze:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?ze:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?ze:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":li&&ui?ui(ui([][Symbol.iterator]())):ze,"%JSON%":"object"==typeof JSON?JSON:ze,"%Map%":"undefined"==typeof Map?ze:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&li&&ui?ui((new Map)[Symbol.iterator]()):ze,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?ze:Promise,"%Proxy%":"undefined"==typeof Proxy?ze:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?ze:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?ze:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&li&&ui?ui((new Set)[Symbol.iterator]()):ze,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?ze:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":li&&ui?ui(""[Symbol.iterator]()):ze,"%Symbol%":li?Symbol:ze,"%SyntaxError%":ei,"%ThrowTypeError%":ai,"%TypedArray%":pi,"%TypeError%":ni,"%Uint8Array%":"undefined"==typeof Uint8Array?ze:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?ze:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?ze:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?ze:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?ze:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?ze:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?ze:WeakSet};if(ui)try{null.error}catch(zO){var fi=ui(ui(zO));di["%Error.prototype%"]=fi}var mi=function t(e){var i;if("%AsyncFunction%"===e)i=ri("async function () {}");else if("%GeneratorFunction%"===e)i=ri("function* () {}");else if("%AsyncGeneratorFunction%"===e)i=ri("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(i=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var r=t("%AsyncGenerator%");r&&ui&&(i=ui(r.prototype))}return di[e]=i,i},gi={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},yi=Je,vi=ti,_i=yi.call(Function.call,Array.prototype.concat),xi=yi.call(Function.apply,Array.prototype.splice),bi=yi.call(Function.call,String.prototype.replace),wi=yi.call(Function.call,String.prototype.slice),Ai=yi.call(Function.call,RegExp.prototype.exec),Ei=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Si=/\\(\\)?/g,Mi=function(t,e){var i,n=t;if(vi(gi,n)&&(n="%"+(i=gi[n])[0]+"%"),vi(di,n)){var r=di[n];if(r===hi&&(r=mi(n)),void 0===r&&!e)throw new ni("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:r}}throw new ei("intrinsic "+t+" does not exist!")},Ti=function(t,e){if("string"!=typeof t||0===t.length)throw new ni("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new ni('"allowMissing" argument must be a boolean');if(null===Ai(/^%?[^%]*%?$/,t))throw new ei("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=function(t){var e=wi(t,0,1),i=wi(t,-1);if("%"===e&&"%"!==i)throw new ei("invalid intrinsic syntax, expected closing `%`");if("%"===i&&"%"!==e)throw new ei("invalid intrinsic syntax, expected opening `%`");var n=[];return bi(t,Ei,(function(t,e,i,r){n[n.length]=i?bi(r,Si,"$1"):e||t})),n}(t),n=i.length>0?i[0]:"",r=Mi("%"+n+"%",e),o=r.name,s=r.value,a=!1,l=r.alias;l&&(n=l[0],xi(i,_i([0,1],l)));for(var c=1,u=!0;c<i.length;c+=1){var h=i[c],p=wi(h,0,1),d=wi(h,-1);if(('"'===p||"'"===p||"`"===p||'"'===d||"'"===d||"`"===d)&&p!==d)throw new ei("property names with quotes must have matching quotes");if("constructor"!==h&&u||(a=!0),vi(di,o="%"+(n+="."+h)+"%"))s=di[o];else if(null!=s){if(!(h in s)){if(!e)throw new ni("base intrinsic for "+t+" exists, but the property is not available.");return}if(oi&&c+1>=i.length){var f=oi(s,h);s=(u=!!f)&&"get"in f&&!("originalValue"in f.get)?f.get:s[h]}else u=vi(s,h),s=s[h];u&&!a&&(di[o]=s)}}return s},Ii={exports:{}},Ci=Ti("%Object.defineProperty%",!0),Pi=function(){if(Ci)try{return Ci({},"a",{value:1}),!0}catch(t){return!1}return!1};Pi.hasArrayLengthDefineBug=function(){if(!Pi())return null;try{return 1!==Ci([],"length",{value:1}).length}catch(t){return!0}};var Li=Pi,Di=Ti("%Object.getOwnPropertyDescriptor%",!0);if(Di)try{Di([],"length")}catch(zO){Di=null}var Ri=Di,Oi=Li(),ki=Ti,Ni=Oi&&ki("%Object.defineProperty%",!0);if(Ni)try{Ni({},"a",{value:1})}catch(zO){Ni=!1}var Bi=ki("%SyntaxError%"),zi=ki("%TypeError%"),Fi=Ri,Vi=function(t,e,i){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new zi("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new zi("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new zi("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new zi("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new zi("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new zi("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,r=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,s=arguments.length>6&&arguments[6],a=!!Fi&&Fi(t,e);if(Ni)Ni(t,e,{configurable:null===o&&a?a.configurable:!o,enumerable:null===n&&a?a.enumerable:!n,value:i,writable:null===r&&a?a.writable:!r});else{if(!s&&(n||r||o))throw new Bi("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=i}},Ui=Ti,Gi=Vi,ji=Li(),Hi=Ri,Wi=Ui("%TypeError%"),qi=Ui("%Math.floor%"),Xi=function(t,e){if("function"!=typeof t)throw new Wi("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||qi(e)!==e)throw new Wi("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],n=!0,r=!0;if("length"in t&&Hi){var o=Hi(t,"length");o&&!o.configurable&&(n=!1),o&&!o.writable&&(r=!1)}return(n||r||!i)&&(ji?Gi(t,"length",e,!0,!0):Gi(t,"length",e)),t};!function(t){var e=Je,i=Ti,n=Xi,r=i("%TypeError%"),o=i("%Function.prototype.apply%"),s=i("%Function.prototype.call%"),a=i("%Reflect.apply%",!0)||e.call(s,o),l=i("%Object.defineProperty%",!0),c=i("%Math.max%");if(l)try{l({},"a",{value:1})}catch(t){l=null}t.exports=function(t){if("function"!=typeof t)throw new r("a function is required");var i=a(e,s,arguments);return n(i,1+c(0,t.length-(arguments.length-1)),!0)};var u=function(){return a(e,o,arguments)};l?l(t.exports,"apply",{value:u}):t.exports.apply=u}(Ii);var Zi=Ii.exports,Yi=Ti,Qi=Zi,Ji=Qi(Yi("String.prototype.indexOf")),Ki=function(t,e){var i=Yi(t,!!e);return"function"==typeof i&&Ji(t,".prototype.")>-1?Qi(i):i},$i=Ge(),tn=Ki("Object.prototype.toString"),en=function(t){return!($i&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===tn(t)},nn=function(t){return!!en(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==tn(t)&&"[object Function]"===tn(t.callee)},rn=function(){return en(arguments)}();en.isLegacyArguments=nn;var on=rn?en:nn,sn=Fe,an="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),ln=Object.prototype.toString,cn=Array.prototype.concat,un=Vi,hn=Li(),pn=function(t,e,i,n){if(e in t)if(!0===n){if(t[e]===i)return}else if("function"!=typeof(r=n)||"[object Function]"!==ln.call(r)||!n())return;var r;hn?un(t,e,i,!0):un(t,e,i)},dn=function(t,e){var i=arguments.length>2?arguments[2]:{},n=sn(e);an&&(n=cn.call(n,Object.getOwnPropertySymbols(e)));for(var r=0;r<n.length;r+=1)pn(t,n[r],e[n[r]],i[n[r]])};dn.supportsDescriptors=!!hn;var fn=dn,mn=function(t){return t!=t},gn=function(t,e){return 0===t&&0===e?1/t==1/e:t===e||!(!mn(t)||!mn(e))},yn=gn,vn=function(){return"function"==typeof Object.is?Object.is:yn},_n=vn,xn=fn,bn=fn,wn=gn,An=vn,En=function(){var t=_n();return xn(Object,{is:t},{is:function(){return Object.is!==t}}),t},Sn=Zi(An(),Object);bn(Sn,{getPolyfill:An,implementation:wn,shim:En});var Mn,Tn,In,Cn,Pn=Sn,Ln=Ki,Dn=Ge();if(Dn){Mn=Ln("Object.prototype.hasOwnProperty"),Tn=Ln("RegExp.prototype.exec"),In={};var Rn=function(){throw In};Cn={toString:Rn,valueOf:Rn},"symbol"==typeof Symbol.toPrimitive&&(Cn[Symbol.toPrimitive]=Rn)}var On=Ln("Object.prototype.toString"),kn=Object.getOwnPropertyDescriptor,Nn=Dn?function(t){if(!t||"object"!=typeof t)return!1;var e=kn(t,"lastIndex");if(!(e&&Mn(e,"value")))return!1;try{Tn(t,Cn)}catch(t){return t===In}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===On(t)},Bn=function(){return"string"==typeof function(){}.name},zn=Object.getOwnPropertyDescriptor;if(zn)try{zn([],"length")}catch(zO){zn=null}Bn.functionsHaveConfigurableNames=function(){if(!Bn()||!zn)return!1;var t=zn((function(){}),"name");return!!t&&!!t.configurable};var Fn=Function.prototype.bind;Bn.boundFunctionsHaveNames=function(){return Bn()&&"function"==typeof Fn&&""!==function(){}.bind().name};var Vn=Bn,Un=Vi,Gn=Li(),jn=Vn.functionsHaveConfigurableNames(),Hn=TypeError,Wn=function(t,e){if("function"!=typeof t)throw new Hn("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!jn||(Gn?Un(t,"name",e,!0,!0):Un(t,"name",e)),t},qn=Object,Xn=TypeError,Zn=Wn((function(){if(null!=this&&this!==qn(this))throw new Xn("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t}),"get flags",!0),Yn=Zn,Qn=fn.supportsDescriptors,Jn=Object.getOwnPropertyDescriptor,Kn=function(){if(Qn&&"gim"===/a/gim.flags){var t=Jn(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var e="",i={};if(Object.defineProperty(i,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(i,"sticky",{get:function(){e+="y"}}),"dy"===e)return t.get}}return Yn},$n=fn.supportsDescriptors,tr=Kn,er=Object.getOwnPropertyDescriptor,ir=Object.defineProperty,nr=TypeError,rr=Object.getPrototypeOf,or=/a/,sr=fn,ar=Zn,lr=Kn,cr=function(){if(!$n||!rr)throw new nr("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=tr(),e=rr(or),i=er(e,"flags");return i&&i.get===t||ir(e,"flags",{configurable:!0,enumerable:!1,get:t}),t},ur=Zi(lr());sr(ur,{getPolyfill:lr,implementation:ar,shim:cr});var hr=ur,pr=Date.prototype.getDay,dr=Object.prototype.toString,fr=Ge(),mr=Fe,gr=on,yr=Pn,vr=Nn,_r=hr,xr=function(t){return"object"==typeof t&&null!==t&&(fr?function(t){try{return pr.call(t),!0}catch(t){return!1}}(t):"[object Date]"===dr.call(t))},br=Date.prototype.getTime;function wr(t,e,i){var n=i||{};return!!(n.strict?yr(t,e):t===e)||(!t||!e||"object"!=typeof t&&"object"!=typeof e?n.strict?yr(t,e):t==e:function(t,e,i){var n,r;if(typeof t!=typeof e)return!1;if(Ar(t)||Ar(e))return!1;if(t.prototype!==e.prototype)return!1;if(gr(t)!==gr(e))return!1;var o=vr(t),s=vr(e);if(o!==s)return!1;if(o||s)return t.source===e.source&&_r(t)===_r(e);if(xr(t)&&xr(e))return br.call(t)===br.call(e);var a=Er(t),l=Er(e);if(a!==l)return!1;if(a||l){if(t.length!==e.length)return!1;for(n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}if(typeof t!=typeof e)return!1;try{var c=mr(t),u=mr(e)}catch(t){return!1}if(c.length!==u.length)return!1;for(c.sort(),u.sort(),n=c.length-1;n>=0;n--)if(c[n]!=u[n])return!1;for(n=c.length-1;n>=0;n--)if(!wr(t[r=c[n]],e[r],i))return!1;return!0}(t,e,n))}function Ar(t){return null==t}function Er(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}var Sr=wr,Mr=rt(Sr);function Tr(t,e){var i=tt(e),n=tt(t),r=n[0],o=n[n.length-1],s=t.geometry.coordinates;return Mr(i[0],r)?s.unshift(i[1]):Mr(i[0],o)?s.push(i[1]):Mr(i[1],r)?s.unshift(i[0]):Mr(i[1],o)&&s.push(i[0]),t}function Ir(t,e){var i=!0;return Q(t,(function(t){Q(e,(function(e){if(!1===i)return!1;i=function(t,e){switch(t.type){case"Point":switch(e.type){case"Point":return i=t.coordinates,n=e.coordinates,!(i[0]===n[0]&&i[1]===n[1]);case"LineString":return!Cr(e,t);case"Polygon":return!ut(t,e)}break;case"LineString":switch(e.type){case"Point":return!Cr(t,e);case"LineString":return!function(t,e){if(le(t,e).features.length>0)return!0;return!1}(t,e);case"Polygon":return!Pr(e,t)}break;case"Polygon":switch(e.type){case"Point":return!ut(e,t);case"LineString":return!Pr(t,e);case"Polygon":return!function(t,e){for(var i=0,n=t.coordinates[0];i<n.length;i++){if(ut(n[i],e))return!0}for(var r=0,o=e.coordinates[0];r<o.length;r++){if(ut(o[r],t))return!0}var s=le(Te(t),Te(e));if(s.features.length>0)return!0;return!1}(e,t)}}var i,n;return!1}(t.geometry,e.geometry)}))})),i}function Cr(t,e){for(var i=0;i<t.coordinates.length-1;i++)if(Lr(t.coordinates[i],t.coordinates[i+1],e.coordinates))return!0;return!1}function Pr(t,e){for(var i=0,n=e.coordinates;i<n.length;i++){if(ut(n[i],t))return!0}return le(e,Te(t)).features.length>0}function Lr(t,e,i){var n=i[0]-t[0],r=i[1]-t[1],o=e[0]-t[0],s=e[1]-t[1];return 0==n*s-r*o&&(Math.abs(o)>=Math.abs(s)?o>0?t[0]<=i[0]&&i[0]<=e[0]:e[0]<=i[0]&&i[0]<=t[0]:s>0?t[1]<=i[1]&&i[1]<=e[1]:e[1]<=i[1]&&i[1]<=t[1])}function Dr(t,e){var i=et(t),n=et(e),r=i.type,o=n.type,s=i.coordinates,a=n.coordinates;switch(r){case"Point":if("Point"===o)return Or(s,a);throw new Error("feature2 "+o+" geometry not supported");case"MultiPoint":switch(o){case"Point":return function(t,e){var i,n=!1;for(i=0;i<t.coordinates.length;i++)if(Or(t.coordinates[i],e.coordinates)){n=!0;break}return n}(i,n);case"MultiPoint":return function(t,e){for(var i=0,n=e.coordinates;i<n.length;i++){for(var r=n[i],o=!1,s=0,a=t.coordinates;s<a.length;s++){if(Or(r,a[s])){o=!0;break}}if(!o)return!1}return!0}(i,n);default:throw new Error("feature2 "+o+" geometry not supported")}case"LineString":switch(o){case"Point":return _e(n,i,{ignoreEndVertices:!0});case"LineString":return function(t,e){for(var i=!1,n=0,r=e.coordinates;n<r.length;n++){var o=r[n];if(_e({type:"Point",coordinates:o},t,{ignoreEndVertices:!0})&&(i=!0),!_e({type:"Point",coordinates:o},t,{ignoreEndVertices:!1}))return!1}return i}(i,n);case"MultiPoint":return function(t,e){for(var i=!1,n=0,r=e.coordinates;n<r.length;n++){var o=r[n];if(_e(o,t,{ignoreEndVertices:!0})&&(i=!0),!_e(o,t))return!1}if(i)return!0;return!1}(i,n);default:throw new Error("feature2 "+o+" geometry not supported")}case"Polygon":switch(o){case"Point":return ut(n,i,{ignoreBoundary:!0});case"LineString":return function(t,e){var i=!1,n=0,r=K(t),o=K(e);if(!Rr(r,o))return!1;for(;n<e.coordinates.length-1;n++){if(ut({type:"Point",coordinates:kr(e.coordinates[n],e.coordinates[n+1])},t,{ignoreBoundary:!0})){i=!0;break}}return i}(i,n);case"Polygon":return function(t,e){if("Feature"===t.type&&null===t.geometry)return!1;if("Feature"===e.type&&null===e.geometry)return!1;var i=K(t),n=K(e);if(!Rr(i,n))return!1;for(var r=et(e).coordinates,o=0,s=r;o<s.length;o++)for(var a=0,l=s[o];a<l.length;a++){if(!ut(l[a],t))return!1}return!0}(i,n);case"MultiPoint":return function(t,e){for(var i=0,n=e.coordinates;i<n.length;i++){if(!ut(n[i],t,{ignoreBoundary:!0}))return!1}return!0}(i,n);default:throw new Error("feature2 "+o+" geometry not supported")}default:throw new Error("feature1 "+r+" geometry not supported")}}function Rr(t,e){return!(t[0]>e[0])&&(!(t[2]<e[2])&&(!(t[1]>e[1])&&!(t[3]<e[3])))}function Or(t,e){return t[0]===e[0]&&t[1]===e[1]}function kr(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}var Nr=Sr,Br=function(t){this.precision=t&&t.precision?t.precision:17,this.direction=!(!t||!t.direction)&&t.direction,this.pseudoNode=!(!t||!t.pseudoNode)&&t.pseudoNode,this.objectComparator=t&&t.objectComparator?t.objectComparator:Vr};function zr(t){return t.coordinates.map((function(e){return{type:t.type.replace("Multi",""),coordinates:e}}))}function Fr(t,e){return t.hasOwnProperty("coordinates")?t.coordinates.length===e.coordinates.length:t.length===e.length}function Vr(t,e){return Nr(t,e,{strict:!0})}Br.prototype.compare=function(t,e){if(t.type!==e.type||!Fr(t,e))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,e.coordinates);case"LineString":return this.compareLine(t.coordinates,e.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,e);case"Feature":return this.compareFeature(t,e);default:if(0===t.type.indexOf("Multi")){var i=this,n=zr(t),r=zr(e);return n.every((function(t){return this.some((function(e){return i.compare(t,e)}))}),r)}}return!1},Br.prototype.compareCoord=function(t,e){if(t.length!==e.length)return!1;for(var i=0;i<t.length;i++)if(t[i].toFixed(this.precision)!==e[i].toFixed(this.precision))return!1;return!0},Br.prototype.compareLine=function(t,e,i,n){if(!Fr(t,e))return!1;var r=this.pseudoNode?t:this.removePseudo(t),o=this.pseudoNode?e:this.removePseudo(e);if(!n||this.compareCoord(r[0],o[0])||(o=this.fixStartIndex(o,r))){var s=this.compareCoord(r[i],o[i]);return this.direction||s?this.comparePath(r,o):!!this.compareCoord(r[i],o[o.length-(1+i)])&&this.comparePath(r.slice().reverse(),o)}},Br.prototype.fixStartIndex=function(t,e){for(var i,n=-1,r=0;r<t.length;r++)if(this.compareCoord(t[r],e[0])){n=r;break}return n>=0&&(i=[].concat(t.slice(n,t.length),t.slice(1,n+1))),i},Br.prototype.comparePath=function(t,e){var i=this;return t.every((function(t,e){return i.compareCoord(t,this[e])}),e)},Br.prototype.comparePolygon=function(t,e){if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){var i=t.coordinates.slice(1,t.coordinates.length),n=e.coordinates.slice(1,e.coordinates.length),r=this;return i.every((function(t){return this.some((function(e){return r.compareLine(t,e,1,!0)}))}),n)}return!1},Br.prototype.compareFeature=function(t,e){return!(t.id!==e.id||!this.objectComparator(t.properties,e.properties)||!this.compareBBox(t,e))&&this.compare(t.geometry,e.geometry)},Br.prototype.compareBBox=function(t,e){return!!(!t.bbox&&!e.bbox||t.bbox&&e.bbox&&this.compareCoord(t.bbox,e.bbox))},Br.prototype.removePseudo=function(t){return t};var Ur=rt(Br);function Gr(t,e){var i=et(t),n=et(e),r=i.type,o=n.type;if("MultiPoint"===r&&"MultiPoint"!==o||("LineString"===r||"MultiLineString"===r)&&"LineString"!==o&&"MultiLineString"!==o||("Polygon"===r||"MultiPolygon"===r)&&"Polygon"!==o&&"MultiPolygon"!==o)throw new Error("features must be of the same type");if("Point"===r)throw new Error("Point geometry not supported");if(new Ur({precision:6}).compare(t,e))return!1;var s=0;switch(r){case"MultiPoint":for(var a=0;a<i.coordinates.length;a++)for(var l=0;l<n.coordinates.length;l++){var c=i.coordinates[a],u=n.coordinates[l];if(c[0]===u[0]&&c[1]===u[1])return!0}return!1;case"LineString":case"MultiLineString":J(t,(function(t){J(e,(function(e){(function(t,e,i){if(void 0===i&&(i={}),!W(i=i||{}))throw new Error("options is invalid");var n,r=i.tolerance||0,o=[],s=ae(),a=At(t);return s.load(a),J(e,(function(t){var e=!1;t&&(X(s.search(t),(function(i){if(!1===e){var o=tt(t).sort(),s=tt(i).sort();Mr(o,s)||(0===r?_e(o[0],i)&&_e(o[1],i):ue(i,o[0]).properties.dist<=r&&ue(i,o[1]).properties.dist<=r)?(e=!0,n=n?Tr(n,t):t):(0===r?_e(s[0],t)&&_e(s[1],t):ue(t,s[0]).properties.dist<=r&&ue(t,s[1]).properties.dist<=r)&&(n=n?Tr(n,i):i)}})),!1===e&&n&&(o.push(n),n=void 0))})),n&&o.push(n),N(o)})(t,e).features.length&&s++}))}));break;case"Polygon":case"MultiPolygon":J(t,(function(t){J(e,(function(e){le(t,e).features.length&&s++}))}))}return s>0}function jr(t,e){var i=!1;return Q(t,(function(t){Q(e,(function(e){if(!0===i)return!0;i=!Ir(t.geometry,e.geometry)}))})),i}
|
||
/**
|
||
* splaytree v3.1.2
|
||
* Fast Splay tree for Node and browser
|
||
*
|
||
* @author Alexander Milevski <info@w8r.name>
|
||
* @license MIT
|
||
* @preserve
|
||
*/
|
||
/*! *****************************************************************************
|
||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||
this file except in compliance with the License. You may obtain a copy of the
|
||
License at http://www.apache.org/licenses/LICENSE-2.0
|
||
|
||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
||
MERCHANTABLITY OR NON-INFRINGEMENT.
|
||
|
||
See the Apache Version 2.0 License for specific language governing permissions
|
||
and limitations under the License.
|
||
***************************************************************************** */function Hr(t,e){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}var Wr=function(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null};function qr(t,e){return t>e?1:t<e?-1:0}function Xr(t,e,i){for(var n=new Wr(null,null),r=n,o=n;;){var s=i(t,e.key);if(s<0){if(null===e.left)break;if(i(t,e.left.key)<0){var a=e.left;if(e.left=a.right,a.right=e,null===(e=a).left)break}o.left=e,o=e,e=e.left}else{if(!(s>0))break;if(null===e.right)break;if(i(t,e.right.key)>0){a=e.right;if(e.right=a.left,a.left=e,null===(e=a).right)break}r.right=e,r=e,e=e.right}}return r.right=e.left,o.left=e.right,e.left=n.right,e.right=n.left,e}function Zr(t,e,i,n){var r=new Wr(t,e);if(null===i)return r.left=r.right=null,r;var o=n(t,(i=Xr(t,i,n)).key);return o<0?(r.left=i.left,r.right=i,i.left=null):o>=0&&(r.right=i.right,r.left=i,i.right=null),r}function Yr(t,e,i){var n=null,r=null;if(e){var o=i((e=Xr(t,e,i)).key,t);0===o?(n=e.left,r=e.right):o<0?(r=e.right,e.right=null,n=e):(n=e.left,e.left=null,r=e)}return{left:n,right:r}}function Qr(t,e,i,n,r){if(t){n(e+(i?"└── ":"├── ")+r(t)+"\n");var o=e+(i?" ":"│ ");t.left&&Qr(t.left,o,!1,n,r),t.right&&Qr(t.right,o,!0,n,r)}}var Jr=function(){function t(t){void 0===t&&(t=qr),this._root=null,this._size=0,this._comparator=t}return t.prototype.insert=function(t,e){return this._size++,this._root=Zr(t,e,this._root,this._comparator)},t.prototype.add=function(t,e){var i=new Wr(t,e);null===this._root&&(i.left=i.right=null,this._size++,this._root=i);var n=this._comparator,r=Xr(t,this._root,n),o=n(t,r.key);return 0===o?this._root=r:(o<0?(i.left=r.left,i.right=r,r.left=null):o>0&&(i.right=r.right,i.left=r,r.right=null),this._size++,this._root=i),this._root},t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},t.prototype._remove=function(t,e,i){var n;return null===e?null:0===i(t,(e=Xr(t,e,i)).key)?(null===e.left?n=e.right:(n=Xr(t,e.left,i)).right=e.right,this._size--,n):e},t.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=Xr(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},t.prototype.findStatic=function(t){for(var e=this._root,i=this._comparator;e;){var n=i(t,e.key);if(0===n)return e;e=n<0?e.left:e.right}return null},t.prototype.find=function(t){return this._root&&(this._root=Xr(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},t.prototype.contains=function(t){for(var e=this._root,i=this._comparator;e;){var n=i(t,e.key);if(0===n)return!0;e=n<0?e.left:e.right}return!1},t.prototype.forEach=function(t,e){for(var i=this._root,n=[],r=!1;!r;)null!==i?(n.push(i),i=i.left):0!==n.length?(i=n.pop(),t.call(e,i),i=i.right):r=!0;return this},t.prototype.range=function(t,e,i,n){for(var r=[],o=this._comparator,s=this._root;0!==r.length||s;)if(s)r.push(s),s=s.left;else{if(o((s=r.pop()).key,e)>0)break;if(o(s.key,t)>=0&&i.call(n,s))return this;s=s.right}return this},t.prototype.keys=function(){var t=[];return this.forEach((function(e){var i=e.key;return t.push(i)})),t},t.prototype.values=function(){var t=[];return this.forEach((function(e){var i=e.data;return t.push(i)})),t},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},t.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},t.prototype.at=function(t){for(var e=this._root,i=!1,n=0,r=[];!i;)if(e)r.push(e),e=e.left;else if(r.length>0){if(e=r.pop(),n===t)return e;n++,e=e.right}else i=!0;return null},t.prototype.next=function(t){var e=this._root,i=null;if(t.right){for(i=t.right;i.left;)i=i.left;return i}for(var n=this._comparator;e;){var r=n(t.key,e.key);if(0===r)break;r<0?(i=e,e=e.left):e=e.right}return i},t.prototype.prev=function(t){var e=this._root,i=null;if(null!==t.left){for(i=t.left;i.right;)i=i.right;return i}for(var n=this._comparator;e;){var r=n(t.key,e.key);if(0===r)break;r<0?e=e.left:(i=e,e=e.right)}return i},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return function(t){var e=t,i=[],n=!1,r=new Wr(null,null),o=r;for(;!n;)e?(i.push(e),e=e.left):i.length>0?e=(e=o=o.next=i.pop()).right:n=!0;return o.next=null,r.next}(this._root)},t.prototype.load=function(t,e,i){void 0===e&&(e=[]),void 0===i&&(i=!1);var n=t.length,r=this._comparator;if(i&&to(t,e,0,n-1,r),null===this._root)this._root=Kr(t,e,0,n),this._size=n;else{var o=function(t,e,i){var n=new Wr(null,null),r=n,o=t,s=e;for(;null!==o&&null!==s;)i(o.key,s.key)<0?(r.next=o,o=o.next):(r.next=s,s=s.next),r=r.next;null!==o?r.next=o:null!==s&&(r.next=s);return n.next}(this.toList(),function(t,e){for(var i=new Wr(null,null),n=i,r=0;r<t.length;r++)n=n.next=new Wr(t[r],e[r]);return n.next=null,i.next}(t,e),r);n=this._size+n,this._root=$r({head:o},0,n)}return this},t.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(t){void 0===t&&(t=function(t){return String(t.key)});var e=[];return Qr(this._root,"",!0,(function(t){return e.push(t)}),t),e.join("")},t.prototype.update=function(t,e,i){var n=this._comparator,r=Yr(t,this._root,n),o=r.left,s=r.right;n(t,e)<0?s=Zr(e,i,s,n):o=Zr(e,i,o,n),this._root=function(t,e,i){return null===e?t:(null===t||((e=Xr(t.key,e,i)).left=t),e)}(o,s,n)},t.prototype.split=function(t){return Yr(t,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var t,e,i;return Hr(this,(function(n){switch(n.label){case 0:t=this._root,e=[],i=!1,n.label=1;case 1:return i?[3,6]:null===t?[3,2]:(e.push(t),t=t.left,[3,5]);case 2:return 0===e.length?[3,4]:[4,t=e.pop()];case 3:return n.sent(),t=t.right,[3,5];case 4:i=!0,n.label=5;case 5:return[3,1];case 6:return[2]}}))},t}();function Kr(t,e,i,n){var r=n-i;if(r>0){var o=i+Math.floor(r/2),s=t[o],a=e[o],l=new Wr(s,a);return l.left=Kr(t,e,i,o),l.right=Kr(t,e,o+1,n),l}return null}function $r(t,e,i){var n=i-e;if(n>0){var r=e+Math.floor(n/2),o=$r(t,e,r),s=t.head;return s.left=o,t.head=t.head.next,s.right=$r(t,r+1,i),s}return null}function to(t,e,i,n,r){if(!(i>=n)){for(var o=t[i+n>>1],s=i-1,a=n+1;;){do{s++}while(r(t[s],o)<0);do{a--}while(r(t[a],o)>0);if(s>=a)break;var l=t[s];t[s]=t[a],t[a]=l,l=e[s],e[s]=e[a],e[a]=l}to(t,e,i,a,r),to(t,e,a+1,n,r)}}function eo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function io(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function no(t,e,i){return e&&io(t.prototype,e),i&&io(t,i),t}var ro=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},oo=function(t,e){if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;var i=t.ll.x<e.ll.x?e.ll.x:t.ll.x,n=t.ur.x<e.ur.x?t.ur.x:e.ur.x;return{ll:{x:i,y:t.ll.y<e.ll.y?e.ll.y:t.ll.y},ur:{x:n,y:t.ur.y<e.ur.y?t.ur.y:e.ur.y}}},so=Number.EPSILON;void 0===so&&(so=Math.pow(2,-52));var ao=so*so,lo=function(t,e){if(-so<t&&t<so&&-so<e&&e<so)return 0;var i=t-e;return i*i<ao*t*e?0:t<e?-1:1},co=function(){function t(){eo(this,t),this.reset()}return no(t,[{key:"reset",value:function(){this.xRounder=new uo,this.yRounder=new uo}},{key:"round",value:function(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}]),t}(),uo=function(){function t(){eo(this,t),this.tree=new Jr,this.round(0)}return no(t,[{key:"round",value:function(t){var e=this.tree.add(t),i=this.tree.prev(e);if(null!==i&&0===lo(e.key,i.key))return this.tree.remove(t),i.key;var n=this.tree.next(e);return null!==n&&0===lo(e.key,n.key)?(this.tree.remove(t),n.key):t}}]),t}(),ho=new co,po=function(t,e){return t.x*e.y-t.y*e.x},fo=function(t,e){return t.x*e.x+t.y*e.y},mo=function(t,e,i){var n={x:e.x-t.x,y:e.y-t.y},r={x:i.x-t.x,y:i.y-t.y},o=po(n,r);return lo(o,0)},go=function(t){return Math.sqrt(fo(t,t))},yo=function(t,e,i){var n={x:e.x-t.x,y:e.y-t.y},r={x:i.x-t.x,y:i.y-t.y};return po(r,n)/go(r)/go(n)},vo=function(t,e,i){var n={x:e.x-t.x,y:e.y-t.y},r={x:i.x-t.x,y:i.y-t.y};return fo(r,n)/go(r)/go(n)},_o=function(t,e,i){return 0===e.y?null:{x:t.x+e.x/e.y*(i-t.y),y:i}},xo=function(t,e,i){return 0===e.x?null:{x:i,y:t.y+e.y/e.x*(i-t.x)}},bo=function(){function t(e,i){eo(this,t),void 0===e.events?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=i}return no(t,null,[{key:"compare",value:function(e,i){var n=t.comparePoints(e.point,i.point);return 0!==n?n:(e.point!==i.point&&e.link(i),e.isLeft!==i.isLeft?e.isLeft?1:-1:Ao.compare(e.segment,i.segment))}},{key:"comparePoints",value:function(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}}]),no(t,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var e=t.point.events,i=0,n=e.length;i<n;i++){var r=e[i];this.point.events.push(r),r.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var t=this.point.events.length,e=0;e<t;e++){var i=this.point.events[e];if(void 0===i.segment.consumedBy)for(var n=e+1;n<t;n++){var r=this.point.events[n];void 0===r.consumedBy&&(i.otherSE.point.events===r.otherSE.point.events&&i.segment.consume(r.segment))}}}},{key:"getAvailableLinkedEvents",value:function(){for(var t=[],e=0,i=this.point.events.length;e<i;e++){var n=this.point.events[e];n!==this&&!n.segment.ringOut&&n.segment.isInResult()&&t.push(n)}return t}},{key:"getLeftmostComparator",value:function(t){var e=this,i=new Map,n=function(n){var r=n.otherSE;i.set(n,{sine:yo(e.point,t.point,r.point),cosine:vo(e.point,t.point,r.point)})};return function(t,e){i.has(t)||n(t),i.has(e)||n(e);var r=i.get(t),o=r.sine,s=r.cosine,a=i.get(e),l=a.sine,c=a.cosine;return o>=0&&l>=0?s<c?1:s>c?-1:0:o<0&&l<0?s<c?-1:s>c?1:0:l<o?-1:l>o?1:0}}}]),t}(),wo=0,Ao=function(){function t(e,i,n,r){eo(this,t),this.id=++wo,this.leftSE=e,e.segment=this,e.otherSE=i,this.rightSE=i,i.segment=this,i.otherSE=e,this.rings=n,this.windings=r}return no(t,null,[{key:"compare",value:function(t,e){var i=t.leftSE.point.x,n=e.leftSE.point.x,r=t.rightSE.point.x,o=e.rightSE.point.x;if(o<i)return 1;if(r<n)return-1;var s=t.leftSE.point.y,a=e.leftSE.point.y,l=t.rightSE.point.y,c=e.rightSE.point.y;if(i<n){if(a<s&&a<l)return 1;if(a>s&&a>l)return-1;var u=t.comparePoint(e.leftSE.point);if(u<0)return 1;if(u>0)return-1;var h=e.comparePoint(t.rightSE.point);return 0!==h?h:-1}if(i>n){if(s<a&&s<c)return-1;if(s>a&&s>c)return 1;var p=e.comparePoint(t.leftSE.point);if(0!==p)return p;var d=t.comparePoint(e.rightSE.point);return d<0?1:d>0?-1:1}if(s<a)return-1;if(s>a)return 1;if(r<o){var f=e.comparePoint(t.rightSE.point);if(0!==f)return f}if(r>o){var m=t.comparePoint(e.rightSE.point);if(m<0)return 1;if(m>0)return-1}if(r!==o){var g=l-s,y=r-i,v=c-a,_=o-n;if(g>y&&v<_)return 1;if(g<y&&v>_)return-1}return r>o?1:r<o||l<c?-1:l>c?1:t.id<e.id?-1:t.id>e.id?1:0}}]),no(t,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var e=this.leftSE.point,i=this.rightSE.point,n=this.vector();if(e.x===i.x)return t.x===e.x?0:t.x<e.x?1:-1;var r=(t.y-e.y)/n.y,o=e.x+r*n.x;if(t.x===o)return 0;var s=(t.x-e.x)/n.x,a=e.y+s*n.y;return t.y===a?0:t.y<a?-1:1}},{key:"getIntersection",value:function(t){var e=this.bbox(),i=t.bbox(),n=oo(e,i);if(null===n)return null;var r=this.leftSE.point,o=this.rightSE.point,s=t.leftSE.point,a=t.rightSE.point,l=ro(e,s)&&0===this.comparePoint(s),c=ro(i,r)&&0===t.comparePoint(r),u=ro(e,a)&&0===this.comparePoint(a),h=ro(i,o)&&0===t.comparePoint(o);if(c&&l)return h&&!u?o:!h&&u?a:null;if(c)return u&&r.x===a.x&&r.y===a.y?null:r;if(l)return h&&o.x===s.x&&o.y===s.y?null:s;if(h&&u)return null;if(h)return o;if(u)return a;var p=function(t,e,i,n){if(0===e.x)return xo(i,n,t.x);if(0===n.x)return xo(t,e,i.x);if(0===e.y)return _o(i,n,t.y);if(0===n.y)return _o(t,e,i.y);var r=po(e,n);if(0==r)return null;var o={x:i.x-t.x,y:i.y-t.y},s=po(o,e)/r,a=po(o,n)/r;return{x:(t.x+a*e.x+(i.x+s*n.x))/2,y:(t.y+a*e.y+(i.y+s*n.y))/2}}(r,this.vector(),s,t.vector());return null===p?null:ro(n,p)?ho.round(p.x,p.y):null}},{key:"split",value:function(e){var i=[],n=void 0!==e.events,r=new bo(e,!0),o=new bo(e,!1),s=this.rightSE;this.replaceRightSE(o),i.push(o),i.push(r);var a=new t(r,s,this.rings.slice(),this.windings.slice());return bo.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),bo.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),o.checkForConsuming()),i}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var e=0,i=this.windings.length;e<i;e++)this.windings[e]*=-1}},{key:"consume",value:function(e){for(var i=this,n=e;i.consumedBy;)i=i.consumedBy;for(;n.consumedBy;)n=n.consumedBy;var r=t.compare(i,n);if(0!==r){if(r>0){var o=i;i=n,n=o}if(i.prev===n){var s=i;i=n,n=s}for(var a=0,l=n.rings.length;a<l;a++){var c=n.rings[a],u=n.windings[a],h=i.rings.indexOf(c);-1===h?(i.rings.push(c),i.windings.push(u)):i.windings[h]+=u}n.rings=null,n.windings=null,n.consumedBy=i,n.leftSE.consumedBy=i.leftSE,n.rightSE.consumedBy=i.rightSE}}},{key:"prevInResult",value:function(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}},{key:"beforeState",value:function(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){var t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}},{key:"afterState",value:function(){if(void 0!==this._afterState)return this._afterState;var t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};for(var e=this._afterState.rings,i=this._afterState.windings,n=this._afterState.multiPolys,r=0,o=this.rings.length;r<o;r++){var s=this.rings[r],a=this.windings[r],l=e.indexOf(s);-1===l?(e.push(s),i.push(a)):i[l]+=a}for(var c=[],u=[],h=0,p=e.length;h<p;h++)if(0!==i[h]){var d=e[h],f=d.poly;if(-1===u.indexOf(f))if(d.isExterior)c.push(f);else{-1===u.indexOf(f)&&u.push(f);var m=c.indexOf(d.poly);-1!==m&&c.splice(m,1)}}for(var g=0,y=c.length;g<y;g++){var v=c[g].multiPoly;-1===n.indexOf(v)&&n.push(v)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;var t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(Oo.type){case"union":var i=0===t.length,n=0===e.length;this._isInResult=i!==n;break;case"intersection":var r,o;t.length<e.length?(r=t.length,o=e.length):(r=e.length,o=t.length),this._isInResult=o===Oo.numMultiPolys&&r<o;break;case"xor":var s=Math.abs(t.length-e.length);this._isInResult=s%2==1;break;case"difference":var a=function(t){return 1===t.length&&t[0].isSubject};this._isInResult=a(t)!==a(e);break;default:throw new Error("Unrecognized operation type found ".concat(Oo.type))}return this._isInResult}}],[{key:"fromRing",value:function(e,i,n){var r,o,s,a=bo.comparePoints(e,i);if(a<0)r=e,o=i,s=1;else{if(!(a>0))throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));r=i,o=e,s=-1}return new t(new bo(r,!0),new bo(o,!1),[n],[s])}}]),t}(),Eo=function(){function t(e,i,n){if(eo(this,t),!Array.isArray(e)||0===e.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=i,this.isExterior=n,this.segments=[],"number"!=typeof e[0][0]||"number"!=typeof e[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var r=ho.round(e[0][0],e[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};for(var o=r,s=1,a=e.length;s<a;s++){if("number"!=typeof e[s][0]||"number"!=typeof e[s][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var l=ho.round(e[s][0],e[s][1]);l.x===o.x&&l.y===o.y||(this.segments.push(Ao.fromRing(o,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),o=l)}r.x===o.x&&r.y===o.y||this.segments.push(Ao.fromRing(o,r,this))}return no(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.segments.length;e<i;e++){var n=this.segments[e];t.push(n.leftSE),t.push(n.rightSE)}return t}}]),t}(),So=function(){function t(e,i){if(eo(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Eo(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var n=1,r=e.length;n<r;n++){var o=new Eo(e[n],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=i}return no(t,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),e=0,i=this.interiorRings.length;e<i;e++)for(var n=this.interiorRings[e].getSweepEvents(),r=0,o=n.length;r<o;r++)t.push(n[r]);return t}}]),t}(),Mo=function(){function t(e,i){if(eo(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof e[0][0][0]&&(e=[e])}catch(t){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var n=0,r=e.length;n<r;n++){var o=new So(e[n],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=i}return no(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++)for(var n=this.polys[e].getSweepEvents(),r=0,o=n.length;r<o;r++)t.push(n[r]);return t}}]),t}(),To=function(){function t(e){eo(this,t),this.events=e;for(var i=0,n=e.length;i<n;i++)e[i].segment.ringOut=this;this.poly=null}return no(t,null,[{key:"factory",value:function(e){for(var i=[],n=0,r=e.length;n<r;n++){var o=e[n];if(o.isInResult()&&!o.ringOut){for(var s=null,a=o.leftSE,l=o.rightSE,c=[a],u=a.point,h=[];s=a,a=l,c.push(a),a.point!==u;)for(;;){var p=a.getAvailableLinkedEvents();if(0===p.length){var d=c[0].point,f=c[c.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(d.x,",")+" ".concat(d.y,"]. Last matching segment found ends at")+" [".concat(f.x,", ").concat(f.y,"]."))}if(1===p.length){l=p[0].otherSE;break}for(var m=null,g=0,y=h.length;g<y;g++)if(h[g].point===a.point){m=g;break}if(null===m){h.push({index:c.length,point:a.point});var v=a.getLeftmostComparator(s);l=p.sort(v)[0].otherSE;break}var _=h.splice(m)[0],x=c.splice(_.index);x.unshift(x[0].otherSE),i.push(new t(x.reverse()))}i.push(new t(c))}}return i}}]),no(t,[{key:"getGeom",value:function(){for(var t=this.events[0].point,e=[t],i=1,n=this.events.length-1;i<n;i++){var r=this.events[i].point,o=this.events[i+1].point;0!==mo(r,t,o)&&(e.push(r),t=r)}if(1===e.length)return null;var s=e[0],a=e[1];0===mo(s,t,a)&&e.shift(),e.push(e[0]);for(var l=this.isExteriorRing()?1:-1,c=this.isExteriorRing()?0:e.length-1,u=this.isExteriorRing()?e.length:-1,h=[],p=c;p!=u;p+=l)h.push([e[p].x,e[p].y]);return h}},{key:"isExteriorRing",value:function(){if(void 0===this._isExteriorRing){var t=this.enclosingRing();this._isExteriorRing=!t||!t.isExteriorRing()}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var t=this.events[0],e=1,i=this.events.length;e<i;e++){var n=this.events[e];bo.compare(t,n)>0&&(t=n)}for(var r=t.segment.prevInResult(),o=r?r.prevInResult():null;;){if(!r)return null;if(!o)return r.ringOut;if(o.ringOut!==r.ringOut)return o.ringOut.enclosingRing()!==r.ringOut?r.ringOut:r.ringOut.enclosingRing();r=o.prevInResult(),o=r?r.prevInResult():null}}}]),t}(),Io=function(){function t(e){eo(this,t),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}return no(t,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(var e=0,i=this.interiorRings.length;e<i;e++){var n=this.interiorRings[e].getGeom();null!==n&&t.push(n)}return t}}]),t}(),Co=function(){function t(e){eo(this,t),this.rings=e,this.polys=this._composePolys(e)}return no(t,[{key:"getGeom",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++){var n=this.polys[e].getGeom();null!==n&&t.push(n)}return t}},{key:"_composePolys",value:function(t){for(var e=[],i=0,n=t.length;i<n;i++){var r=t[i];if(!r.poly)if(r.isExteriorRing())e.push(new Io(r));else{var o=r.enclosingRing();o.poly||e.push(new Io(o)),o.poly.addInterior(r)}}return e}}]),t}(),Po=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ao.compare;eo(this,t),this.queue=e,this.tree=new Jr(i),this.segments=[]}return no(t,[{key:"process",value:function(t){var e=t.segment,i=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),i;var n=t.isLeft?this.tree.insert(e):this.tree.find(e);if(!n)throw new Error("Unable to find segment #".concat(e.id," ")+"[".concat(e.leftSE.point.x,", ").concat(e.leftSE.point.y,"] -> ")+"[".concat(e.rightSE.point.x,", ").concat(e.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var r=n,o=n,s=void 0,a=void 0;void 0===s;)null===(r=this.tree.prev(r))?s=null:void 0===r.key.consumedBy&&(s=r.key);for(;void 0===a;)null===(o=this.tree.next(o))?a=null:void 0===o.key.consumedBy&&(a=o.key);if(t.isLeft){var l=null;if(s){var c=s.getIntersection(e);if(null!==c&&(e.isAnEndpoint(c)||(l=c),!s.isAnEndpoint(c)))for(var u=this._splitSafely(s,c),h=0,p=u.length;h<p;h++)i.push(u[h])}var d=null;if(a){var f=a.getIntersection(e);if(null!==f&&(e.isAnEndpoint(f)||(d=f),!a.isAnEndpoint(f)))for(var m=this._splitSafely(a,f),g=0,y=m.length;g<y;g++)i.push(m[g])}if(null!==l||null!==d){var v=null;if(null===l)v=d;else if(null===d)v=l;else{v=bo.comparePoints(l,d)<=0?l:d}this.queue.remove(e.rightSE),i.push(e.rightSE);for(var _=e.split(v),x=0,b=_.length;x<b;x++)i.push(_[x])}i.length>0?(this.tree.remove(e),i.push(t)):(this.segments.push(e),e.prev=s)}else{if(s&&a){var w=s.getIntersection(a);if(null!==w){if(!s.isAnEndpoint(w))for(var A=this._splitSafely(s,w),E=0,S=A.length;E<S;E++)i.push(A[E]);if(!a.isAnEndpoint(w))for(var M=this._splitSafely(a,w),T=0,I=M.length;T<I;T++)i.push(M[T])}}this.tree.remove(e)}return i}},{key:"_splitSafely",value:function(t,e){this.tree.remove(t);var i=t.rightSE;this.queue.remove(i);var n=t.split(e);return n.push(i),void 0===t.consumedBy&&this.tree.insert(t),n}}]),t}(),Lo=void 0!==process&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Do=void 0!==process&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Ro=function(){function t(){eo(this,t)}return no(t,[{key:"run",value:function(t,e,i){Oo.type=t,ho.reset();for(var n=[new Mo(e,!0)],r=0,o=i.length;r<o;r++)n.push(new Mo(i[r],!1));if(Oo.numMultiPolys=n.length,"difference"===Oo.type)for(var s=n[0],a=1;a<n.length;)null!==oo(n[a].bbox,s.bbox)?a++:n.splice(a,1);if("intersection"===Oo.type)for(var l=0,c=n.length;l<c;l++)for(var u=n[l],h=l+1,p=n.length;h<p;h++)if(null===oo(u.bbox,n[h].bbox))return[];for(var d=new Jr(bo.compare),f=0,m=n.length;f<m;f++)for(var g=n[f].getSweepEvents(),y=0,v=g.length;y<v;y++)if(d.insert(g[y]),d.size>Lo)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var _=new Po(d),x=d.size,b=d.pop();b;){var w=b.key;if(d.size===x){var A=w.segment;throw new Error("Unable to pop() ".concat(w.isLeft?"left":"right"," SweepEvent ")+"[".concat(w.point.x,", ").concat(w.point.y,"] from segment #").concat(A.id," ")+"[".concat(A.leftSE.point.x,", ").concat(A.leftSE.point.y,"] -> ")+"[".concat(A.rightSE.point.x,", ").concat(A.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(d.size>Lo)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(_.segments.length>Do)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var E=_.process(w),S=0,M=E.length;S<M;S++){var T=E[S];void 0===T.consumedBy&&d.insert(T)}x=d.size,b=d.pop()}ho.reset();var I=To.factory(_.segments);return new Co(I).getGeom()}}]),t}(),Oo=new Ro,ko={union:function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return Oo.run("union",t,i)},intersection:function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return Oo.run("intersection",t,i)},xor:function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return Oo.run("xor",t,i)},difference:function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return Oo.run("difference",t,i)}},No=ko;"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(null==this)throw new TypeError(this+" is not an object");var e=Object(this),i=Math.max(Math.min(e.length,9007199254740991),0)||0,n=1 in arguments&&parseInt(Number(arguments[1]),10)||0;n=n<0?Math.max(i+n,0):Math.min(n,i);var r=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:i;for(r=r<0?Math.max(i+arguments[2],0):Math.min(r,i);n<r;)e[n]=t,++n;return e},writable:!0}),Number.isFinite=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)},Number.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(t){return t!=t},Math.trunc=Math.trunc||function(t){return t<0?Math.ceil(t):Math.floor(t)};var Bo=function(){};Bo.prototype.interfaces_=function(){return[]},Bo.prototype.getClass=function(){return Bo},Bo.prototype.equalsWithTolerance=function(t,e,i){return Math.abs(t-e)<=i};var zo=function(t){function e(e){t.call(this,e),this.name="IllegalArgumentException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),Fo=function(){},Vo={MAX_VALUE:{configurable:!0}};Fo.isNaN=function(t){return Number.isNaN(t)},Fo.doubleToLongBits=function(t){return t},Fo.longBitsToDouble=function(t){return t},Fo.isInfinite=function(t){return!Number.isFinite(t)},Vo.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(Fo,Vo);var Uo=function(){},Go=function(){},jo=function(){};function Ho(){}var Wo=function t(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)this.x=0,this.y=0,this.z=t.NULL_ORDINATE;else if(1===arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.z=e.z}else 2===arguments.length?(this.x=arguments[0],this.y=arguments[1],this.z=t.NULL_ORDINATE):3===arguments.length&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},qo={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};Wo.prototype.setOrdinate=function(t,e){switch(t){case Wo.X:this.x=e;break;case Wo.Y:this.y=e;break;case Wo.Z:this.z=e;break;default:throw new zo("Invalid ordinate index: "+t)}},Wo.prototype.equals2D=function(){if(1===arguments.length){var t=arguments[0];return this.x===t.x&&this.y===t.y}if(2===arguments.length){var e=arguments[0],i=arguments[1];return!!Bo.equalsWithTolerance(this.x,e.x,i)&&!!Bo.equalsWithTolerance(this.y,e.y,i)}},Wo.prototype.getOrdinate=function(t){switch(t){case Wo.X:return this.x;case Wo.Y:return this.y;case Wo.Z:return this.z}throw new zo("Invalid ordinate index: "+t)},Wo.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||Fo.isNaN(this.z))&&Fo.isNaN(t.z)},Wo.prototype.equals=function(t){return t instanceof Wo&&this.equals2D(t)},Wo.prototype.equalInZ=function(t,e){return Bo.equalsWithTolerance(this.z,t.z,e)},Wo.prototype.compareTo=function(t){var e=t;return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:this.y>e.y?1:0},Wo.prototype.clone=function(){},Wo.prototype.copy=function(){return new Wo(this)},Wo.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},Wo.prototype.distance3D=function(t){var e=this.x-t.x,i=this.y-t.y,n=this.z-t.z;return Math.sqrt(e*e+i*i+n*n)},Wo.prototype.distance=function(t){var e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)},Wo.prototype.hashCode=function(){var t=17;return t=37*(t=37*t+Wo.hashCode(this.x))+Wo.hashCode(this.y)},Wo.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},Wo.prototype.interfaces_=function(){return[Uo,Go,Ho]},Wo.prototype.getClass=function(){return Wo},Wo.hashCode=function(){if(1===arguments.length){var t=Fo.doubleToLongBits(arguments[0]);return Math.trunc((t^t)>>>32)}},qo.DimensionalComparator.get=function(){return Xo},qo.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},qo.NULL_ORDINATE.get=function(){return Fo.NaN},qo.X.get=function(){return 0},qo.Y.get=function(){return 1},qo.Z.get=function(){return 2},Object.defineProperties(Wo,qo);var Xo=function(t){if(this._dimensionsToTest=2,0===arguments.length);else if(1===arguments.length){var e=arguments[0];if(2!==e&&3!==e)throw new zo("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};Xo.prototype.compare=function(t,e){var i=t,n=e,r=Xo.compare(i.x,n.x);if(0!==r)return r;var o=Xo.compare(i.y,n.y);return 0!==o?o:this._dimensionsToTest<=2?0:Xo.compare(i.z,n.z)},Xo.prototype.interfaces_=function(){return[jo]},Xo.prototype.getClass=function(){return Xo},Xo.compare=function(t,e){return t<e?-1:t>e?1:Fo.isNaN(t)?Fo.isNaN(e)?0:-1:Fo.isNaN(e)?1:0};var Zo=function(){};Zo.prototype.create=function(){},Zo.prototype.interfaces_=function(){return[]},Zo.prototype.getClass=function(){return Zo};var Yo=function(){},Qo={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};Yo.prototype.interfaces_=function(){return[]},Yo.prototype.getClass=function(){return Yo},Yo.toLocationSymbol=function(t){switch(t){case Yo.EXTERIOR:return"e";case Yo.BOUNDARY:return"b";case Yo.INTERIOR:return"i";case Yo.NONE:return"-"}throw new zo("Unknown location value: "+t)},Qo.INTERIOR.get=function(){return 0},Qo.BOUNDARY.get=function(){return 1},Qo.EXTERIOR.get=function(){return 2},Qo.NONE.get=function(){return-1},Object.defineProperties(Yo,Qo);var Jo=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},Ko=function(){},$o={LOG_10:{configurable:!0}};Ko.prototype.interfaces_=function(){return[]},Ko.prototype.getClass=function(){return Ko},Ko.log10=function(t){var e=Math.log(t);return Fo.isInfinite(e)||Fo.isNaN(e)?e:e/Ko.LOG_10},Ko.min=function(t,e,i,n){var r=t;return e<r&&(r=e),i<r&&(r=i),n<r&&(r=n),r},Ko.clamp=function(){if("number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1],i=arguments[2];return t<e?e:t>i?i:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var n=arguments[0],r=arguments[1],o=arguments[2];return n<r?r:n>o?o:n}},Ko.wrap=function(t,e){return t<0?e- -t%e:t%e},Ko.max=function(){if(3===arguments.length){var t=arguments[1],e=arguments[2],i=arguments[0];return t>i&&(i=t),e>i&&(i=e),i}if(4===arguments.length){var n=arguments[1],r=arguments[2],o=arguments[3],s=arguments[0];return n>s&&(s=n),r>s&&(s=r),o>s&&(s=o),s}},Ko.average=function(t,e){return(t+e)/2},$o.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(Ko,$o);var ts=function(t){this.str=t};ts.prototype.append=function(t){this.str+=t},ts.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},ts.prototype.toString=function(t){return this.str};var es=function(t){this.value=t};es.prototype.intValue=function(){return this.value},es.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},es.isNaN=function(t){return Number.isNaN(t)};var is=function(){};is.isWhitespace=function(t){return t<=32&&t>=0||127===t},is.toUpperCase=function(t){return t.toUpperCase()};var ns=function t(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length){if("number"==typeof arguments[0]){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var i=arguments[0];this.init(i)}else if("string"==typeof arguments[0]){t.call(this,t.parse(arguments[0]))}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.init(n,r)}},rs={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};ns.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},ns.prototype.extractSignificantDigits=function(t,e){var i=this.abs(),n=ns.magnitude(i._hi),r=ns.TEN.pow(n);(i=i.divide(r)).gt(ns.TEN)?(i=i.divide(ns.TEN),n+=1):i.lt(ns.ONE)&&(i=i.multiply(ns.TEN),n-=1);for(var o=n+1,s=new ts,a=ns.MAX_PRINT_DIGITS-1,l=0;l<=a;l++){t&&l===o&&s.append(".");var c=Math.trunc(i._hi);if(c<0)break;var u=!1,h=0;c>9?(u=!0,h="9"):h="0"+c,s.append(h),i=i.subtract(ns.valueOf(c)).multiply(ns.TEN),u&&i.selfAdd(ns.TEN);var p=!0,d=ns.magnitude(i._hi);if(d<0&&Math.abs(d)>=a-l&&(p=!1),!p)break}return e[0]=n,s.toString()},ns.prototype.sqr=function(){return this.multiply(this)},ns.prototype.doubleValue=function(){return this._hi+this._lo},ns.prototype.subtract=function(){if(arguments[0]instanceof ns){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},ns.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},ns.prototype.isZero=function(){return 0===this._hi&&0===this._lo},ns.prototype.selfSubtract=function(){if(arguments[0]instanceof ns){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},ns.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},ns.prototype.min=function(t){return this.le(t)?this:t},ns.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof ns){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfDivide(e,0)}}else if(2===arguments.length){var i,n,r,o,s=arguments[0],a=arguments[1],l=null,c=null,u=null,h=null;return r=this._hi/s,h=(l=(u=ns.SPLIT*r)-(l=u-r))*(c=(h=ns.SPLIT*s)-(c=h-s))-(o=r*s)+l*(n=s-c)+(i=r-l)*c+i*n,h=r+(u=(this._hi-o-h+this._lo-r*a)/s),this._hi=h,this._lo=r-h+u,this}},ns.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},ns.prototype.divide=function(){if(arguments[0]instanceof ns){var t,e,i,n,r=arguments[0],o=null,s=null,a=null,l=null;return t=(i=this._hi/r._hi)-(o=(a=ns.SPLIT*i)-(o=a-i)),l=o*(s=(l=ns.SPLIT*r._hi)-(s=l-r._hi))-(n=i*r._hi)+o*(e=r._hi-s)+t*s+t*e,a=(this._hi-n-l+this._lo-i*r._lo)/r._hi,new ns(l=i+a,i-l+a)}if("number"==typeof arguments[0]){var c=arguments[0];return Fo.isNaN(c)?ns.createNaN():ns.copy(this).selfDivide(c,0)}},ns.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},ns.prototype.pow=function(t){if(0===t)return ns.valueOf(1);var e=new ns(this),i=ns.valueOf(1),n=Math.abs(t);if(n>1)for(;n>0;)n%2==1&&i.selfMultiply(e),(n/=2)>0&&(e=e.sqr());else i=e;return t<0?i.reciprocal():i},ns.prototype.ceil=function(){if(this.isNaN())return ns.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new ns(t,e)},ns.prototype.compareTo=function(t){var e=t;return this._hi<e._hi?-1:this._hi>e._hi?1:this._lo<e._lo?-1:this._lo>e._lo?1:0},ns.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},ns.prototype.setValue=function(){if(arguments[0]instanceof ns){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},ns.prototype.max=function(t){return this.ge(t)?this:t},ns.prototype.sqrt=function(){if(this.isZero())return ns.valueOf(0);if(this.isNegative())return ns.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,i=ns.valueOf(e),n=this.subtract(i.sqr())._hi*(.5*t);return i.add(n)},ns.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof ns){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e,i,n,r,o,s=arguments[0],a=null;return a=(n=this._hi+s)-(r=n-this._hi),i=(o=(a=s-r+(this._hi-a))+this._lo)+(n-(e=n+o)),this._hi=e+i,this._lo=i+(e-this._hi),this}}else if(2===arguments.length){var l,c,u,h,p=arguments[0],d=arguments[1],f=null,m=null,g=null;u=this._hi+p,c=this._lo+d,m=u-(g=u-this._hi),f=c-(h=c-this._lo);var y=(l=u+(g=(m=p-g+(this._hi-m))+c))+(g=(f=d-h+(this._lo-f))+(g+(u-l))),v=g+(l-y);return this._hi=y,this._lo=v,this}},ns.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof ns){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfMultiply(e,0)}}else if(2===arguments.length){var i,n,r=arguments[0],o=arguments[1],s=null,a=null,l=null,c=null;s=(l=ns.SPLIT*this._hi)-this._hi,c=ns.SPLIT*r,s=l-s,i=this._hi-s,a=c-r;var u=(l=this._hi*r)+(c=s*(a=c-a)-l+s*(n=r-a)+i*a+i*n+(this._hi*o+this._lo*r)),h=c+(s=l-u);return this._hi=u,this._lo=h,this}},ns.prototype.selfSqr=function(){return this.selfMultiply(this)},ns.prototype.floor=function(){if(this.isNaN())return ns.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new ns(t,e)},ns.prototype.negate=function(){return this.isNaN()?this:new ns(-this._hi,-this._lo)},ns.prototype.clone=function(){},ns.prototype.multiply=function(){if(arguments[0]instanceof ns){var t=arguments[0];return t.isNaN()?ns.createNaN():ns.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return Fo.isNaN(e)?ns.createNaN():ns.copy(this).selfMultiply(e,0)}},ns.prototype.isNaN=function(){return Fo.isNaN(this._hi)},ns.prototype.intValue=function(){return Math.trunc(this._hi)},ns.prototype.toString=function(){var t=ns.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},ns.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),i=this.extractSignificantDigits(!0,e),n=e[0]+1,r=i;if("."===i.charAt(0))r="0"+i;else if(n<0)r="0."+ns.stringOfChar("0",-n)+i;else if(-1===i.indexOf(".")){var o=n-i.length;r=i+ns.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+r:r},ns.prototype.reciprocal=function(){var t,e,i,n,r=null,o=null,s=null,a=null;t=(i=1/this._hi)-(r=(s=ns.SPLIT*i)-(r=s-i)),o=(a=ns.SPLIT*this._hi)-this._hi;var l=i+(s=(1-(n=i*this._hi)-(a=r*(o=a-o)-n+r*(e=this._hi-o)+t*o+t*e)-i*this._lo)/this._hi);return new ns(l,i-l+s)},ns.prototype.toSciNotation=function(){if(this.isZero())return ns.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),i=this.extractSignificantDigits(!1,e),n=ns.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===i.charAt(0))throw new Error("Found leading zero: "+i);var r="";i.length>1&&(r=i.substring(1));var o=i.charAt(0)+"."+r;return this.isNegative()?"-"+o+n:o+n},ns.prototype.abs=function(){return this.isNaN()?ns.NaN:this.isNegative()?this.negate():new ns(this)},ns.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},ns.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},ns.prototype.add=function(){if(arguments[0]instanceof ns){var t=arguments[0];return ns.copy(this).selfAdd(t)}if("number"==typeof arguments[0]){var e=arguments[0];return ns.copy(this).selfAdd(e)}},ns.prototype.init=function(){if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof ns){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(2===arguments.length){var i=arguments[0],n=arguments[1];this._hi=i,this._lo=n}},ns.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},ns.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},ns.prototype.trunc=function(){return this.isNaN()?ns.NaN:this.isPositive()?this.floor():this.ceil()},ns.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},ns.prototype.interfaces_=function(){return[Ho,Uo,Go]},ns.prototype.getClass=function(){return ns},ns.sqr=function(t){return ns.valueOf(t).selfMultiply(t)},ns.valueOf=function(){return"string"==typeof arguments[0]?ns.parse(arguments[0]):"number"==typeof arguments[0]?new ns(arguments[0]):void 0},ns.sqrt=function(t){return ns.valueOf(t).sqrt()},ns.parse=function(t){for(var e=0,i=t.length;is.isWhitespace(t.charAt(e));)e++;var n=!1;if(e<i){var r=t.charAt(e);"-"!==r&&"+"!==r||(e++,"-"===r&&(n=!0))}for(var o=new ns,s=0,a=0,l=0;!(e>=i);){var c=t.charAt(e);if(e++,is.isDigit(c)){var u=c-"0";o.selfMultiply(ns.TEN),o.selfAdd(u),s++}else{if("."!==c){if("e"===c||"E"===c){var h=t.substring(e);try{l=es.parseInt(h)}catch(e){throw e instanceof Error?new Error("Invalid exponent "+h+" in string "+t):e}break}throw new Error("Unexpected character '"+c+"' at position "+e+" in string "+t)}a=s}}var p=o,d=s-a-l;if(0===d)p=o;else if(d>0){var f=ns.TEN.pow(d);p=o.divide(f)}else if(d<0){var m=ns.TEN.pow(-d);p=o.multiply(m)}return n?p.negate():p},ns.createNaN=function(){return new ns(Fo.NaN,Fo.NaN)},ns.copy=function(t){return new ns(t)},ns.magnitude=function(t){var e=Math.abs(t),i=Math.log(e)/Math.log(10),n=Math.trunc(Math.floor(i));return 10*Math.pow(10,n)<=e&&(n+=1),n},ns.stringOfChar=function(t,e){for(var i=new ts,n=0;n<e;n++)i.append(t);return i.toString()},rs.PI.get=function(){return new ns(3.141592653589793,12246467991473532e-32)},rs.TWO_PI.get=function(){return new ns(6.283185307179586,24492935982947064e-32)},rs.PI_2.get=function(){return new ns(1.5707963267948966,6123233995736766e-32)},rs.E.get=function(){return new ns(2.718281828459045,14456468917292502e-32)},rs.NaN.get=function(){return new ns(Fo.NaN,Fo.NaN)},rs.EPS.get=function(){return 123259516440783e-46},rs.SPLIT.get=function(){return 134217729},rs.MAX_PRINT_DIGITS.get=function(){return 32},rs.TEN.get=function(){return ns.valueOf(10)},rs.ONE.get=function(){return ns.valueOf(1)},rs.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},rs.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(ns,rs);var os=function(){},ss={DP_SAFE_EPSILON:{configurable:!0}};os.prototype.interfaces_=function(){return[]},os.prototype.getClass=function(){return os},os.orientationIndex=function(t,e,i){var n=os.orientationIndexFilter(t,e,i);if(n<=1)return n;var r=ns.valueOf(e.x).selfAdd(-t.x),o=ns.valueOf(e.y).selfAdd(-t.y),s=ns.valueOf(i.x).selfAdd(-e.x),a=ns.valueOf(i.y).selfAdd(-e.y);return r.selfMultiply(a).selfSubtract(o.selfMultiply(s)).signum()},os.signOfDet2x2=function(t,e,i,n){return t.multiply(n).selfSubtract(e.multiply(i)).signum()},os.intersection=function(t,e,i,n){var r=ns.valueOf(n.y).selfSubtract(i.y).selfMultiply(ns.valueOf(e.x).selfSubtract(t.x)),o=ns.valueOf(n.x).selfSubtract(i.x).selfMultiply(ns.valueOf(e.y).selfSubtract(t.y)),s=r.subtract(o),a=ns.valueOf(n.x).selfSubtract(i.x).selfMultiply(ns.valueOf(t.y).selfSubtract(i.y)),l=ns.valueOf(n.y).selfSubtract(i.y).selfMultiply(ns.valueOf(t.x).selfSubtract(i.x)),c=a.subtract(l).selfDivide(s).doubleValue(),u=ns.valueOf(t.x).selfAdd(ns.valueOf(e.x).selfSubtract(t.x).selfMultiply(c)).doubleValue(),h=ns.valueOf(e.x).selfSubtract(t.x).selfMultiply(ns.valueOf(t.y).selfSubtract(i.y)),p=ns.valueOf(e.y).selfSubtract(t.y).selfMultiply(ns.valueOf(t.x).selfSubtract(i.x)),d=h.subtract(p).selfDivide(s).doubleValue(),f=ns.valueOf(i.y).selfAdd(ns.valueOf(n.y).selfSubtract(i.y).selfMultiply(d)).doubleValue();return new Wo(u,f)},os.orientationIndexFilter=function(t,e,i){var n=null,r=(t.x-i.x)*(e.y-i.y),o=(t.y-i.y)*(e.x-i.x),s=r-o;if(r>0){if(o<=0)return os.signum(s);n=r+o}else{if(!(r<0))return os.signum(s);if(o>=0)return os.signum(s);n=-r-o}var a=os.DP_SAFE_EPSILON*n;return s>=a||-s>=a?os.signum(s):2},os.signum=function(t){return t>0?1:t<0?-1:0},ss.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(os,ss);var as=function(){},ls={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};ls.X.get=function(){return 0},ls.Y.get=function(){return 1},ls.Z.get=function(){return 2},ls.M.get=function(){return 3},as.prototype.setOrdinate=function(t,e,i){},as.prototype.size=function(){},as.prototype.getOrdinate=function(t,e){},as.prototype.getCoordinate=function(){},as.prototype.getCoordinateCopy=function(t){},as.prototype.getDimension=function(){},as.prototype.getX=function(t){},as.prototype.clone=function(){},as.prototype.expandEnvelope=function(t){},as.prototype.copy=function(){},as.prototype.getY=function(t){},as.prototype.toCoordinateArray=function(){},as.prototype.interfaces_=function(){return[Go]},as.prototype.getClass=function(){return as},Object.defineProperties(as,ls);var cs=function(){},us=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(cs),hs=function(){};hs.arraycopy=function(t,e,i,n,r){for(var o=0,s=e;s<e+r;s++)i[n+o]=t[s],o++},hs.getProperty=function(t){return{"line.separator":"\n"}[t]};var ps=function t(){if(this.x=null,this.y=null,this.w=null,0===arguments.length)this.x=0,this.y=0,this.w=1;else if(1===arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.w=1}else if(2===arguments.length){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var i=arguments[0],n=arguments[1];this.x=i,this.y=n,this.w=1}else if(arguments[0]instanceof t&&arguments[1]instanceof t){var r=arguments[0],o=arguments[1];this.x=r.y*o.w-o.y*r.w,this.y=o.x*r.w-r.x*o.w,this.w=r.x*o.y-o.x*r.y}else if(arguments[0]instanceof Wo&&arguments[1]instanceof Wo){var s=arguments[0],a=arguments[1];this.x=s.y-a.y,this.y=a.x-s.x,this.w=s.x*a.y-a.x*s.y}}else if(3===arguments.length){var l=arguments[0],c=arguments[1],u=arguments[2];this.x=l,this.y=c,this.w=u}else if(4===arguments.length){var h=arguments[0],p=arguments[1],d=arguments[2],f=arguments[3],m=h.y-p.y,g=p.x-h.x,y=h.x*p.y-p.x*h.y,v=d.y-f.y,_=f.x-d.x,x=d.x*f.y-f.x*d.y;this.x=g*x-_*y,this.y=v*y-m*x,this.w=m*_-v*g}};ps.prototype.getY=function(){var t=this.y/this.w;if(Fo.isNaN(t)||Fo.isInfinite(t))throw new us;return t},ps.prototype.getX=function(){var t=this.x/this.w;if(Fo.isNaN(t)||Fo.isInfinite(t))throw new us;return t},ps.prototype.getCoordinate=function(){var t=new Wo;return t.x=this.getX(),t.y=this.getY(),t},ps.prototype.interfaces_=function(){return[]},ps.prototype.getClass=function(){return ps},ps.intersection=function(t,e,i,n){var r=t.y-e.y,o=e.x-t.x,s=t.x*e.y-e.x*t.y,a=i.y-n.y,l=n.x-i.x,c=i.x*n.y-n.x*i.y,u=r*l-a*o,h=(o*c-l*s)/u,p=(a*s-r*c)/u;if(Fo.isNaN(h)||Fo.isInfinite(h)||Fo.isNaN(p)||Fo.isInfinite(p))throw new us;return new Wo(h,p)};var ds=function t(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,0===arguments.length)this.init();else if(1===arguments.length){if(arguments[0]instanceof Wo){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof t){var i=arguments[0];this.init(i)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(4===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2],l=arguments[3];this.init(o,s,a,l)}},fs={serialVersionUID:{configurable:!0}};ds.prototype.getArea=function(){return this.getWidth()*this.getHeight()},ds.prototype.equals=function(t){if(!(t instanceof ds))return!1;var e=t;return this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY()},ds.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new ds;var e=this._minx>t._minx?this._minx:t._minx,i=this._miny>t._miny?this._miny:t._miny,n=this._maxx<t._maxx?this._maxx:t._maxx,r=this._maxy<t._maxy?this._maxy:t._maxy;return new ds(e,n,i,r)},ds.prototype.isNull=function(){return this._maxx<this._minx},ds.prototype.getMaxX=function(){return this._maxx},ds.prototype.covers=function(){if(1===arguments.length){if(arguments[0]instanceof Wo){var t=arguments[0];return this.covers(t.x,t.y)}if(arguments[0]instanceof ds){var e=arguments[0];return!this.isNull()&&!e.isNull()&&(e.getMinX()>=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy)}}else if(2===arguments.length){var i=arguments[0],n=arguments[1];return!this.isNull()&&(i>=this._minx&&i<=this._maxx&&n>=this._miny&&n<=this._maxy)}},ds.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof ds){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}if(arguments[0]instanceof Wo){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(2===arguments.length){var i=arguments[0],n=arguments[1];return!this.isNull()&&!(i>this._maxx||i<this._minx||n>this._maxy||n<this._miny)}},ds.prototype.getMinY=function(){return this._miny},ds.prototype.getMinX=function(){return this._minx},ds.prototype.expandToInclude=function(){if(1===arguments.length){if(arguments[0]instanceof Wo){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof ds){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this._minx=e.getMinX(),this._maxx=e.getMaxX(),this._miny=e.getMinY(),this._maxy=e.getMaxY()):(e._minx<this._minx&&(this._minx=e._minx),e._maxx>this._maxx&&(this._maxx=e._maxx),e._miny<this._miny&&(this._miny=e._miny),e._maxy>this._maxy&&(this._maxy=e._maxy))}}else if(2===arguments.length){var i=arguments[0],n=arguments[1];this.isNull()?(this._minx=i,this._maxx=i,this._miny=n,this._maxy=n):(i<this._minx&&(this._minx=i),i>this._maxx&&(this._maxx=i),n<this._miny&&(this._miny=n),n>this._maxy&&(this._maxy=n))}},ds.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},ds.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},ds.prototype.compareTo=function(t){var e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this._minx<e._minx?-1:this._minx>e._minx?1:this._miny<e._miny?-1:this._miny>e._miny?1:this._maxx<e._maxx?-1:this._maxx>e._maxx?1:this._maxy<e._maxy?-1:this._maxy>e._maxy?1:0},ds.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},ds.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},ds.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},ds.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},ds.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},ds.prototype.expandBy=function(){if(1===arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){var e=arguments[0],i=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=i,this._maxy+=i,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},ds.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof ds){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof Wo){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var i=arguments[0],n=arguments[1];return this.covers(i,n)}},ds.prototype.centre=function(){return this.isNull()?null:new Wo((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},ds.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof Wo){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof ds){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(2===arguments.length){var i=arguments[0],n=arguments[1];this.init(i.x,n.x,i.y,n.y)}else if(4===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];r<o?(this._minx=r,this._maxx=o):(this._minx=o,this._maxx=r),s<a?(this._miny=s,this._maxy=a):(this._miny=a,this._maxy=s)}},ds.prototype.getMaxY=function(){return this._maxy},ds.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var i=0;return this._maxy<t._miny?i=t._miny-this._maxy:this._miny>t._maxy&&(i=this._miny-t._maxy),0===e?i:0===i?e:Math.sqrt(e*e+i*i)},ds.prototype.hashCode=function(){var t=17;return t=37*(t=37*(t=37*(t=37*t+Wo.hashCode(this._minx))+Wo.hashCode(this._maxx))+Wo.hashCode(this._miny))+Wo.hashCode(this._maxy)},ds.prototype.interfaces_=function(){return[Uo,Ho]},ds.prototype.getClass=function(){return ds},ds.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],i=arguments[2];return i.x>=(t.x<e.x?t.x:e.x)&&i.x<=(t.x>e.x?t.x:e.x)&&i.y>=(t.y<e.y?t.y:e.y)&&i.y<=(t.y>e.y?t.y:e.y)}if(4===arguments.length){var n=arguments[0],r=arguments[1],o=arguments[2],s=arguments[3],a=Math.min(o.x,s.x),l=Math.max(o.x,s.x),c=Math.min(n.x,r.x),u=Math.max(n.x,r.x);return!(c>l)&&(!(u<a)&&(a=Math.min(o.y,s.y),l=Math.max(o.y,s.y),c=Math.min(n.y,r.y),u=Math.max(n.y,r.y),!(c>l)&&!(u<a)))}},fs.serialVersionUID.get=function(){return 0x51845cd552189800},Object.defineProperties(ds,fs);var ms={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},gs=function(t){this.geometryFactory=t||new el};gs.prototype.read=function(t){var e,i,n;t=t.replace(/[\n\r]/g," ");var r=ms.typeStr.exec(t);if(-1!==t.search("EMPTY")&&((r=ms.emptyTypeStr.exec(t))[2]=void 0),r&&(i=r[1].toLowerCase(),n=r[2],vs[i]&&(e=vs[i].apply(this,[n]))),void 0===e)throw new Error("Could not parse WKT "+t);return e},gs.prototype.write=function(t){return this.extractGeometry(t)},gs.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!ys[e])return null;var i=e.toUpperCase();return t.isEmpty()?i+" EMPTY":i+"("+ys[e].apply(this,[t])+")"};var ys={coordinate:function(t){return t.x+" "+t.y},point:function(t){return ys.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=[],i=0,n=t._geometries.length;i<n;++i)e.push("("+ys.point.apply(this,[t._geometries[i]])+")");return e.join(",")},linestring:function(t){for(var e=[],i=0,n=t._points._coordinates.length;i<n;++i)e.push(ys.coordinate.apply(this,[t._points._coordinates[i]]));return e.join(",")},linearring:function(t){for(var e=[],i=0,n=t._points._coordinates.length;i<n;++i)e.push(ys.coordinate.apply(this,[t._points._coordinates[i]]));return e.join(",")},multilinestring:function(t){for(var e=[],i=0,n=t._geometries.length;i<n;++i)e.push("("+ys.linestring.apply(this,[t._geometries[i]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+ys.linestring.apply(this,[t._shell])+")");for(var i=0,n=t._holes.length;i<n;++i)e.push("("+ys.linestring.apply(this,[t._holes[i]])+")");return e.join(",")},multipolygon:function(t){for(var e=[],i=0,n=t._geometries.length;i<n;++i)e.push("("+ys.polygon.apply(this,[t._geometries[i]])+")");return e.join(",")},geometrycollection:function(t){for(var e=[],i=0,n=t._geometries.length;i<n;++i)e.push(this.extractGeometry(t._geometries[i]));return e.join(",")}},vs={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split(ms.spaces);return this.geometryFactory.createPoint(new Wo(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){var e;if(void 0===t)return this.geometryFactory.createMultiPoint();for(var i=t.trim().split(","),n=[],r=0,o=i.length;r<o;++r)e=i[r].replace(ms.trimParens,"$1"),n.push(vs.point.apply(this,[e]));return this.geometryFactory.createMultiPoint(n)},linestring:function(t){if(void 0===t)return this.geometryFactory.createLineString();for(var e,i=t.trim().split(","),n=[],r=0,o=i.length;r<o;++r)e=i[r].trim().split(ms.spaces),n.push(new Wo(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLineString(n)},linearring:function(t){if(void 0===t)return this.geometryFactory.createLinearRing();for(var e,i=t.trim().split(","),n=[],r=0,o=i.length;r<o;++r)e=i[r].trim().split(ms.spaces),n.push(new Wo(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLinearRing(n)},multilinestring:function(t){var e;if(void 0===t)return this.geometryFactory.createMultiLineString();for(var i=t.trim().split(ms.parenComma),n=[],r=0,o=i.length;r<o;++r)e=i[r].replace(ms.trimParens,"$1"),n.push(vs.linestring.apply(this,[e]));return this.geometryFactory.createMultiLineString(n)},polygon:function(t){var e,i,n;if(void 0===t)return this.geometryFactory.createPolygon();for(var r,o=t.trim().split(ms.parenComma),s=[],a=0,l=o.length;a<l;++a)e=o[a].replace(ms.trimParens,"$1"),i=vs.linestring.apply(this,[e]),n=this.geometryFactory.createLinearRing(i._points),0===a?r=n:s.push(n);return this.geometryFactory.createPolygon(r,s)},multipolygon:function(t){var e;if(void 0===t)return this.geometryFactory.createMultiPolygon();for(var i=t.trim().split(ms.doubleParenComma),n=[],r=0,o=i.length;r<o;++r)e=i[r].replace(ms.trimParens,"$1"),n.push(vs.polygon.apply(this,[e]));return this.geometryFactory.createMultiPolygon(n)},geometrycollection:function(t){if(void 0===t)return this.geometryFactory.createGeometryCollection();for(var e=(t=t.replace(/,\s*([A-Za-z])/g,"|$1")).trim().split("|"),i=[],n=0,r=e.length;n<r;++n)i.push(this.read(e[n]));return this.geometryFactory.createGeometryCollection(i)}},_s=function(t){this.parser=new gs(t)};_s.prototype.write=function(t){return this.parser.write(t)},_s.toLineString=function(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var xs=function(t){function e(e){t.call(this,e),this.name="RuntimeException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),bs=function(t){function e(){if(t.call(this),0===arguments.length)t.call(this);else if(1===arguments.length){var e=arguments[0];t.call(this,e)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(xs),ws=function(){};ws.prototype.interfaces_=function(){return[]},ws.prototype.getClass=function(){return ws},ws.shouldNeverReachHere=function(){if(0===arguments.length)ws.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments[0];throw new bs("Should never reach here"+(null!==t?": "+t:""))}},ws.isTrue=function(){var t;if(1===arguments.length)ws.isTrue(arguments[0],null);else if(2===arguments.length&&(t=arguments[1],!arguments[0]))throw null===t?new bs:new bs(t)},ws.equals=function(){var t,e,i;if(2===arguments.length)ws.equals(t=arguments[0],e=arguments[1],null);else if(3===arguments.length&&(t=arguments[0],i=arguments[2],!(e=arguments[1]).equals(t)))throw new bs("Expected "+t+" but encountered "+e+(null!==i?": "+i:""))};var As=function(){this._result=null,this._inputLines=Array(2).fill().map((function(){return Array(2)})),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new Wo,this._intPt[1]=new Wo,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},Es={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};As.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},As.prototype.getTopologySummary=function(){var t=new ts;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},As.prototype.computeIntersection=function(t,e,i,n){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=i,this._inputLines[1][1]=n,this._result=this.computeIntersect(t,e,i,n)},As.prototype.getIntersectionNum=function(){return this._result},As.prototype.computeIntLineIndex=function(){if(0===arguments.length)null===this._intLineIndex&&(this._intLineIndex=Array(2).fill().map((function(){return Array(2)})),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(1===arguments.length){var t=arguments[0];this.getEdgeDistance(t,0)>this.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},As.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},As.prototype.setPrecisionModel=function(t){this._precisionModel=t},As.prototype.isInteriorIntersection=function(){var t=this;if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var e=arguments[0],i=0;i<this._result;i++)if(!t._intPt[i].equals2D(t._inputLines[e][0])&&!t._intPt[i].equals2D(t._inputLines[e][1]))return!0;return!1}},As.prototype.getIntersection=function(t){return this._intPt[t]},As.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},As.prototype.hasIntersection=function(){return this._result!==As.NO_INTERSECTION},As.prototype.getEdgeDistance=function(t,e){return As.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1])},As.prototype.isCollinear=function(){return this._result===As.COLLINEAR_INTERSECTION},As.prototype.toString=function(){return _s.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+_s.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},As.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},As.prototype.isIntersection=function(t){for(var e=0;e<this._result;e++)if(this._intPt[e].equals2D(t))return!0;return!1},As.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},As.prototype.interfaces_=function(){return[]},As.prototype.getClass=function(){return As},As.computeEdgeDistance=function(t,e,i){var n=Math.abs(i.x-e.x),r=Math.abs(i.y-e.y),o=-1;if(t.equals(e))o=0;else if(t.equals(i))o=n>r?n:r;else{var s=Math.abs(t.x-e.x),a=Math.abs(t.y-e.y);0!==(o=n>r?s:a)||t.equals(e)||(o=Math.max(s,a))}return ws.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o},As.nonRobustComputeEdgeDistance=function(t,e,i){var n=t.x-e.x,r=t.y-e.y,o=Math.sqrt(n*n+r*r);return ws.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},Es.DONT_INTERSECT.get=function(){return 0},Es.DO_INTERSECT.get=function(){return 1},Es.COLLINEAR.get=function(){return 2},Es.NO_INTERSECTION.get=function(){return 0},Es.POINT_INTERSECTION.get=function(){return 1},Es.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(As,Es);var Ss=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(t){var e=new ds(this._inputLines[0][0],this._inputLines[0][1]),i=new ds(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&i.contains(t)},e.prototype.computeIntersection=function(){if(3!==arguments.length)return t.prototype.computeIntersection.apply(this,arguments);var e=arguments[0],i=arguments[1],n=arguments[2];if(this._isProper=!1,ds.intersects(i,n,e)&&0===Is.orientationIndex(i,n,e)&&0===Is.orientationIndex(n,i,e))return this._isProper=!0,(e.equals(i)||e.equals(n))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(t,e,i,n,r){r.x=this.smallestInAbsValue(t.x,e.x,i.x,n.x),r.y=this.smallestInAbsValue(t.y,e.y,i.y,n.y),t.x-=r.x,t.y-=r.y,e.x-=r.x,e.y-=r.y,i.x-=r.x,i.y-=r.y,n.x-=r.x,n.y-=r.y},e.prototype.safeHCoordinateIntersection=function(t,i,n,r){var o=null;try{o=ps.intersection(t,i,n,r)}catch(s){if(!(s instanceof us))throw s;o=e.nearestEndpoint(t,i,n,r)}return o},e.prototype.intersection=function(t,i,n,r){var o=this.intersectionWithNormalization(t,i,n,r);return this.isInSegmentEnvelopes(o)||(o=new Wo(e.nearestEndpoint(t,i,n,r))),null!==this._precisionModel&&this._precisionModel.makePrecise(o),o},e.prototype.smallestInAbsValue=function(t,e,i,n){var r=t,o=Math.abs(r);return Math.abs(e)<o&&(r=e,o=Math.abs(e)),Math.abs(i)<o&&(r=i,o=Math.abs(i)),Math.abs(n)<o&&(r=n),r},e.prototype.checkDD=function(t,e,i,n,r){var o=os.intersection(t,e,i,n),s=this.isInSegmentEnvelopes(o);hs.out.println("DD in env = "+s+" --------------------- "+o),r.distance(o)>1e-4&&hs.out.println("Distance = "+r.distance(o))},e.prototype.intersectionWithNormalization=function(t,e,i,n){var r=new Wo(t),o=new Wo(e),s=new Wo(i),a=new Wo(n),l=new Wo;this.normalizeToEnvCentre(r,o,s,a,l);var c=this.safeHCoordinateIntersection(r,o,s,a);return c.x+=l.x,c.y+=l.y,c},e.prototype.computeCollinearIntersection=function(e,i,n,r){var o=ds.intersects(e,i,n),s=ds.intersects(e,i,r),a=ds.intersects(n,r,e),l=ds.intersects(n,r,i);return o&&s?(this._intPt[0]=n,this._intPt[1]=r,t.COLLINEAR_INTERSECTION):a&&l?(this._intPt[0]=e,this._intPt[1]=i,t.COLLINEAR_INTERSECTION):o&&a?(this._intPt[0]=n,this._intPt[1]=e,!n.equals(e)||s||l?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&l?(this._intPt[0]=n,this._intPt[1]=i,!n.equals(i)||s||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&a?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||o||l?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&l?(this._intPt[0]=r,this._intPt[1]=i,!r.equals(i)||o||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,i,n,r){var o=t.x<e.x?t.x:e.x,s=t.y<e.y?t.y:e.y,a=t.x>e.x?t.x:e.x,l=t.y>e.y?t.y:e.y,c=i.x<n.x?i.x:n.x,u=i.y<n.y?i.y:n.y,h=i.x>n.x?i.x:n.x,p=i.y>n.y?i.y:n.y,d=((o>c?o:c)+(a<h?a:h))/2,f=((s>u?s:u)+(l<p?l:p))/2;r.x=d,r.y=f,t.x-=r.x,t.y-=r.y,e.x-=r.x,e.y-=r.y,i.x-=r.x,i.y-=r.y,n.x-=r.x,n.y-=r.y},e.prototype.computeIntersect=function(e,i,n,r){if(this._isProper=!1,!ds.intersects(e,i,n,r))return t.NO_INTERSECTION;var o=Is.orientationIndex(e,i,n),s=Is.orientationIndex(e,i,r);if(o>0&&s>0||o<0&&s<0)return t.NO_INTERSECTION;var a=Is.orientationIndex(n,r,e),l=Is.orientationIndex(n,r,i);return a>0&&l>0||a<0&&l<0?t.NO_INTERSECTION:0===o&&0===s&&0===a&&0===l?this.computeCollinearIntersection(e,i,n,r):(0===o||0===s||0===a||0===l?(this._isProper=!1,e.equals2D(n)||e.equals2D(r)?this._intPt[0]=e:i.equals2D(n)||i.equals2D(r)?this._intPt[0]=i:0===o?this._intPt[0]=new Wo(n):0===s?this._intPt[0]=new Wo(r):0===a?this._intPt[0]=new Wo(e):0===l&&(this._intPt[0]=new Wo(i))):(this._isProper=!0,this._intPt[0]=this.intersection(e,i,n,r)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,i,n){var r=t,o=Is.distancePointLine(t,i,n),s=Is.distancePointLine(e,i,n);return s<o&&(o=s,r=e),(s=Is.distancePointLine(i,t,e))<o&&(o=s,r=i),(s=Is.distancePointLine(n,t,e))<o&&(o=s,r=n),r},e}(As),Ms=function(){};Ms.prototype.interfaces_=function(){return[]},Ms.prototype.getClass=function(){return Ms},Ms.orientationIndex=function(t,e,i){var n=e.x-t.x,r=e.y-t.y,o=i.x-e.x,s=i.y-e.y;return Ms.signOfDet2x2(n,r,o,s)},Ms.signOfDet2x2=function(t,e,i,n){var r=null,o=null,s=null;if(r=1,0===t||0===n)return 0===e||0===i?0:e>0?i>0?-r:r:i>0?r:-r;if(0===e||0===i)return n>0?t>0?r:-r:t>0?-r:r;if(e>0?n>0?e<=n||(r=-r,o=t,t=i,i=o,o=e,e=n,n=o):e<=-n?(r=-r,i=-i,n=-n):(o=t,t=-i,i=o,o=e,e=-n,n=o):n>0?-e<=n?(r=-r,t=-t,e=-e):(o=-t,t=i,i=o,o=-e,e=n,n=o):e>=n?(t=-t,e=-e,i=-i,n=-n):(r=-r,o=-t,t=-i,i=o,o=-e,e=-n,n=o),t>0){if(!(i>0))return r;if(!(t<=i))return r}else{if(i>0)return-r;if(!(t>=i))return-r;r=-r,t=-t,i=-i}for(;;){if((n-=(s=Math.floor(i/t))*e)<0)return-r;if(n>e)return r;if(t>(i-=s*t)+i){if(e<n+n)return r}else{if(e>n+n)return-r;i=t-i,n=e-n,r=-r}if(0===n)return 0===i?0:-r;if(0===i)return r;if((e-=(s=Math.floor(t/i))*n)<0)return r;if(e>n)return-r;if(i>(t-=s*i)+t){if(n<e+e)return-r}else{if(n>e+e)return r;t=i-t,e=n-e,r=-r}if(0===e)return 0===t?0:r;if(0===t)return-r}};var Ts=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};Ts.prototype.countSegment=function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var i=t.x,n=e.x;return i>n&&(i=e.x,n=t.x),this._p.x>=i&&this._p.x<=n&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var r=t.x-this._p.x,o=t.y-this._p.y,s=e.x-this._p.x,a=e.y-this._p.y,l=Ms.signOfDet2x2(r,o,s,a);if(0===l)return this._isPointOnSegment=!0,null;a<o&&(l=-l),l>0&&this._crossingCount++}},Ts.prototype.isPointInPolygon=function(){return this.getLocation()!==Yo.EXTERIOR},Ts.prototype.getLocation=function(){return this._isPointOnSegment?Yo.BOUNDARY:this._crossingCount%2==1?Yo.INTERIOR:Yo.EXTERIOR},Ts.prototype.isOnSegment=function(){return this._isPointOnSegment},Ts.prototype.interfaces_=function(){return[]},Ts.prototype.getClass=function(){return Ts},Ts.locatePointInRing=function(){if(arguments[0]instanceof Wo&&Jo(arguments[1],as)){for(var t=arguments[1],e=new Ts(arguments[0]),i=new Wo,n=new Wo,r=1;r<t.size();r++)if(t.getCoordinate(r,i),t.getCoordinate(r-1,n),e.countSegment(i,n),e.isOnSegment())return e.getLocation();return e.getLocation()}if(arguments[0]instanceof Wo&&arguments[1]instanceof Array){for(var o=arguments[1],s=new Ts(arguments[0]),a=1;a<o.length;a++){var l=o[a],c=o[a-1];if(s.countSegment(l,c),s.isOnSegment())return s.getLocation()}return s.getLocation()}};var Is=function(){},Cs={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};Is.prototype.interfaces_=function(){return[]},Is.prototype.getClass=function(){return Is},Is.orientationIndex=function(t,e,i){return os.orientationIndex(t,e,i)},Is.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,i=t[0].x,n=1;n<t.length-1;n++){var r=t[n].x-i,o=t[n+1].y;e+=r*(t[n-1].y-o)}return e/2}if(Jo(arguments[0],as)){var s=arguments[0],a=s.size();if(a<3)return 0;var l=new Wo,c=new Wo,u=new Wo;s.getCoordinate(0,c),s.getCoordinate(1,u);var h=c.x;u.x-=h;for(var p=0,d=1;d<a-1;d++)l.y=c.y,c.x=u.x,c.y=u.y,s.getCoordinate(d+1,u),u.x-=h,p+=c.x*(l.y-u.y);return p/2}},Is.distanceLineLine=function(t,e,i,n){if(t.equals(e))return Is.distancePointLine(t,i,n);if(i.equals(n))return Is.distancePointLine(n,t,e);var r=!1;if(ds.intersects(t,e,i,n)){var o=(e.x-t.x)*(n.y-i.y)-(e.y-t.y)*(n.x-i.x);if(0===o)r=!0;else{var s=(t.y-i.y)*(n.x-i.x)-(t.x-i.x)*(n.y-i.y),a=((t.y-i.y)*(e.x-t.x)-(t.x-i.x)*(e.y-t.y))/o,l=s/o;(l<0||l>1||a<0||a>1)&&(r=!0)}}else r=!0;return r?Ko.min(Is.distancePointLine(t,i,n),Is.distancePointLine(e,i,n),Is.distancePointLine(i,t,e),Is.distancePointLine(n,t,e)):0},Is.isPointInRing=function(t,e){return Is.locatePointInRing(t,e)!==Yo.EXTERIOR},Is.computeLength=function(t){var e=t.size();if(e<=1)return 0;var i=0,n=new Wo;t.getCoordinate(0,n);for(var r=n.x,o=n.y,s=1;s<e;s++){t.getCoordinate(s,n);var a=n.x,l=n.y,c=a-r,u=l-o;i+=Math.sqrt(c*c+u*u),r=a,o=l}return i},Is.isCCW=function(t){var e=t.length-1;if(e<3)throw new zo("Ring has fewer than 4 points, so orientation cannot be determined");for(var i=t[0],n=0,r=1;r<=e;r++){var o=t[r];o.y>i.y&&(i=o,n=r)}var s=n;do{(s-=1)<0&&(s=e)}while(t[s].equals2D(i)&&s!==n);var a=n;do{a=(a+1)%e}while(t[a].equals2D(i)&&a!==n);var l=t[s],c=t[a];if(l.equals2D(i)||c.equals2D(i)||l.equals2D(c))return!1;var u=Is.computeOrientation(l,i,c),h=!1;return h=0===u?l.x>c.x:u>0,h},Is.locatePointInRing=function(t,e){return Ts.locatePointInRing(t,e)},Is.distancePointLinePerpendicular=function(t,e,i){var n=(i.x-e.x)*(i.x-e.x)+(i.y-e.y)*(i.y-e.y),r=((e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y))/n;return Math.abs(r)*Math.sqrt(n)},Is.computeOrientation=function(t,e,i){return Is.orientationIndex(t,e,i)},Is.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new zo("Line array must contain at least one vertex");for(var i=t.distance(e[0]),n=0;n<e.length-1;n++){var r=Is.distancePointLine(t,e[n],e[n+1]);r<i&&(i=r)}return i}if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];if(s.x===a.x&&s.y===a.y)return o.distance(s);var l=(a.x-s.x)*(a.x-s.x)+(a.y-s.y)*(a.y-s.y),c=((o.x-s.x)*(a.x-s.x)+(o.y-s.y)*(a.y-s.y))/l;if(c<=0)return o.distance(s);if(c>=1)return o.distance(a);var u=((s.y-o.y)*(a.x-s.x)-(s.x-o.x)*(a.y-s.y))/l;return Math.abs(u)*Math.sqrt(l)}},Is.isOnLine=function(t,e){for(var i=new Ss,n=1;n<e.length;n++){var r=e[n-1],o=e[n];if(i.computeIntersection(t,r,o),i.hasIntersection())return!0}return!1},Cs.CLOCKWISE.get=function(){return-1},Cs.RIGHT.get=function(){return Is.CLOCKWISE},Cs.COUNTERCLOCKWISE.get=function(){return 1},Cs.LEFT.get=function(){return Is.COUNTERCLOCKWISE},Cs.COLLINEAR.get=function(){return 0},Cs.STRAIGHT.get=function(){return Is.COLLINEAR},Object.defineProperties(Is,Cs);var Ps=function(){};Ps.prototype.filter=function(t){},Ps.prototype.interfaces_=function(){return[]},Ps.prototype.getClass=function(){return Ps};var Ls=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},Ds={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};Ls.prototype.isGeometryCollection=function(){return this.getSortIndex()===Ls.SORTINDEX_GEOMETRYCOLLECTION},Ls.prototype.getFactory=function(){return this._factory},Ls.prototype.getGeometryN=function(t){return this},Ls.prototype.getArea=function(){return 0},Ls.prototype.isRectangle=function(){return!1},Ls.prototype.equals=function(){if(arguments[0]instanceof Ls){var t=arguments[0];return null!==t&&this.equalsTopo(t)}if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof Ls))return!1;var i=e;return this.equalsExact(i)}},Ls.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},Ls.prototype.geometryChanged=function(){this.apply(Ls.geometryChangedFilter)},Ls.prototype.geometryChangedAction=function(){this._envelope=null},Ls.prototype.equalsNorm=function(t){return null!==t&&this.norm().equalsExact(t.norm())},Ls.prototype.getLength=function(){return 0},Ls.prototype.getNumGeometries=function(){return 1},Ls.prototype.compareTo=function(){if(1===arguments.length){var t=arguments[0],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}if(2===arguments.length){var i=arguments[0],n=arguments[1];return this.getSortIndex()!==i.getSortIndex()?this.getSortIndex()-i.getSortIndex():this.isEmpty()&&i.isEmpty()?0:this.isEmpty()?-1:i.isEmpty()?1:this.compareToSameClass(i,n)}},Ls.prototype.getUserData=function(){return this._userData},Ls.prototype.getSRID=function(){return this._SRID},Ls.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},Ls.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===Ls.SORTINDEX_GEOMETRYCOLLECTION)throw new zo("This method does not support GeometryCollection arguments")},Ls.prototype.equal=function(t,e,i){return 0===i?t.equals(e):t.distance(e)<=i},Ls.prototype.norm=function(){var t=this.copy();return t.normalize(),t},Ls.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},Ls.prototype.getEnvelopeInternal=function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new ds(this._envelope)},Ls.prototype.setSRID=function(t){this._SRID=t},Ls.prototype.setUserData=function(t){this._userData=t},Ls.prototype.compare=function(t,e){for(var i=t.iterator(),n=e.iterator();i.hasNext()&&n.hasNext();){var r=i.next(),o=n.next(),s=r.compareTo(o);if(0!==s)return s}return i.hasNext()?1:n.hasNext()?-1:0},Ls.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},Ls.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===Ls.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===Ls.SORTINDEX_MULTIPOINT||this.getSortIndex()===Ls.SORTINDEX_MULTILINESTRING||this.getSortIndex()===Ls.SORTINDEX_MULTIPOLYGON},Ls.prototype.interfaces_=function(){return[Go,Uo,Ho]},Ls.prototype.getClass=function(){return Ls},Ls.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},Ls.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(null===t[e])return!0;return!1},Ds.serialVersionUID.get=function(){return 0x799ea46522854c00},Ds.SORTINDEX_POINT.get=function(){return 0},Ds.SORTINDEX_MULTIPOINT.get=function(){return 1},Ds.SORTINDEX_LINESTRING.get=function(){return 2},Ds.SORTINDEX_LINEARRING.get=function(){return 3},Ds.SORTINDEX_MULTILINESTRING.get=function(){return 4},Ds.SORTINDEX_POLYGON.get=function(){return 5},Ds.SORTINDEX_MULTIPOLYGON.get=function(){return 6},Ds.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},Ds.geometryChangedFilter.get=function(){return Rs},Object.defineProperties(Ls,Ds);var Rs=function(){};Rs.interfaces_=function(){return[Ps]},Rs.filter=function(t){t.geometryChangedAction()};var Os=function(){};Os.prototype.filter=function(t){},Os.prototype.interfaces_=function(){return[]},Os.prototype.getClass=function(){return Os};var ks=function(){},Ns={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};ks.prototype.isInBoundary=function(t){},ks.prototype.interfaces_=function(){return[]},ks.prototype.getClass=function(){return ks},Ns.Mod2BoundaryNodeRule.get=function(){return Bs},Ns.EndPointBoundaryNodeRule.get=function(){return zs},Ns.MultiValentEndPointBoundaryNodeRule.get=function(){return Fs},Ns.MonoValentEndPointBoundaryNodeRule.get=function(){return Vs},Ns.MOD2_BOUNDARY_RULE.get=function(){return new Bs},Ns.ENDPOINT_BOUNDARY_RULE.get=function(){return new zs},Ns.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Fs},Ns.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Vs},Ns.OGC_SFS_BOUNDARY_RULE.get=function(){return ks.MOD2_BOUNDARY_RULE},Object.defineProperties(ks,Ns);var Bs=function(){};Bs.prototype.isInBoundary=function(t){return t%2==1},Bs.prototype.interfaces_=function(){return[ks]},Bs.prototype.getClass=function(){return Bs};var zs=function(){};zs.prototype.isInBoundary=function(t){return t>0},zs.prototype.interfaces_=function(){return[ks]},zs.prototype.getClass=function(){return zs};var Fs=function(){};Fs.prototype.isInBoundary=function(t){return t>1},Fs.prototype.interfaces_=function(){return[ks]},Fs.prototype.getClass=function(){return Fs};var Vs=function(){};Vs.prototype.isInBoundary=function(t){return 1===t},Vs.prototype.interfaces_=function(){return[ks]},Vs.prototype.getClass=function(){return Vs};var Us=function(){};function Gs(t){this.message=t||""}Us.prototype.add=function(){},Us.prototype.addAll=function(){},Us.prototype.isEmpty=function(){},Us.prototype.iterator=function(){},Us.prototype.size=function(){},Us.prototype.toArray=function(){},Us.prototype.remove=function(){},Gs.prototype=new Error,Gs.prototype.name="IndexOutOfBoundsException";var js=function(){};js.prototype.hasNext=function(){},js.prototype.next=function(){},js.prototype.remove=function(){};var Hs=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(Us);function Ws(t){this.message=t||""}Ws.prototype=new Error,Ws.prototype.name="NoSuchElementException";var qs=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof Us&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,Us]},e.prototype.add=function(t){return 1===arguments.length?this.array_.push(t):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.set=function(t,e){var i=this.array_[t];return this.array_[t]=e,i},e.prototype.iterator=function(){return new Xs(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new Gs;return this.array_[t]},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,i=this.array_.length;e<i;e++)t.push(this.array_[e]);return t},e.prototype.remove=function(t){for(var e=!1,i=0,n=this.array_.length;i<n;i++)if(this.array_[i]===t){this.array_.splice(i,1),e=!0;break}return e},e}(Hs),Xs=function(t){function e(e){t.call(this),this.arrayList_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new Ws;return this.arrayList_.get(this.position_++)},e.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},e.prototype.set=function(t){return this.arrayList_.set(this.position_-1,t)},e.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},e}(js),Zs=function(t){function e(){if(t.call(this),0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.ensureCapacity(e.length),this.add(e,!0)}else if(2===arguments.length){var i=arguments[0],n=arguments[1];this.ensureCapacity(i.length),this.add(i,n)}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={coordArrayType:{configurable:!0}};return i.coordArrayType.get=function(){return new Array(0).fill(null)},e.prototype.getCoordinate=function(t){return this.get(t)},e.prototype.addAll=function(){if(2===arguments.length){for(var e=arguments[1],i=!1,n=arguments[0].iterator();n.hasNext();)this.add(n.next(),e),i=!0;return i}return t.prototype.addAll.apply(this,arguments)},e.prototype.clone=function(){for(var e=t.prototype.clone.call(this),i=0;i<this.size();i++)e.add(i,this.get(i).copy());return e},e.prototype.toCoordinateArray=function(){return this.toArray(e.coordArrayType)},e.prototype.add=function(){var e=this;if(1===arguments.length){var i=arguments[0];t.prototype.add.call(this,i)}else if(2===arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var n=arguments[0],r=arguments[1];return this.add(n,r,!0),!0}if(arguments[0]instanceof Wo&&"boolean"==typeof arguments[1]){var o=arguments[0];if(!arguments[1])if(this.size()>=1)if(this.get(this.size()-1).equals2D(o))return null;t.prototype.add.call(this,o)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var s=arguments[0],a=arguments[1];return this.add(s,a),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var l=arguments[0],c=arguments[1];if(arguments[2])for(var u=0;u<l.length;u++)e.add(l[u],c);else for(var h=l.length-1;h>=0;h--)e.add(l[h],c);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof Wo){var p=arguments[0],d=arguments[1];if(!arguments[2]){var f=this.size();if(f>0){if(p>0)if(this.get(p-1).equals2D(d))return null;if(p<f)if(this.get(p).equals2D(d))return null}}t.prototype.add.call(this,p,d)}}else if(4===arguments.length){var m=arguments[0],g=arguments[1],y=arguments[2],v=arguments[3],_=1;y>v&&(_=-1);for(var x=y;x!==v;x+=_)e.add(m[x],g);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new Wo(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,i),e}(qs),Ys=function(){},Qs={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Qs.ForwardComparator.get=function(){return Js},Qs.BidirectionalComparator.get=function(){return Ks},Qs.coordArrayType.get=function(){return new Array(0).fill(null)},Ys.prototype.interfaces_=function(){return[]},Ys.prototype.getClass=function(){return Ys},Ys.isRing=function(t){return!(t.length<4)&&!!t[0].equals2D(t[t.length-1])},Ys.ptNotInList=function(t,e){for(var i=0;i<t.length;i++){var n=t[i];if(Ys.indexOf(n,e)<0)return n}return null},Ys.scroll=function(t,e){var i=Ys.indexOf(e,t);if(i<0)return null;var n=new Array(t.length).fill(null);hs.arraycopy(t,i,n,0,t.length-i),hs.arraycopy(t,0,n,t.length-i,i),hs.arraycopy(n,0,t,0,t.length)},Ys.equals=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(null===t||null===e)return!1;if(t.length!==e.length)return!1;for(var i=0;i<t.length;i++)if(!t[i].equals(e[i]))return!1;return!0}if(3===arguments.length){var n=arguments[0],r=arguments[1],o=arguments[2];if(n===r)return!0;if(null===n||null===r)return!1;if(n.length!==r.length)return!1;for(var s=0;s<n.length;s++)if(0!==o.compare(n[s],r[s]))return!1;return!0}},Ys.intersection=function(t,e){for(var i=new Zs,n=0;n<t.length;n++)e.intersects(t[n])&&i.add(t[n],!0);return i.toCoordinateArray()},Ys.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},Ys.removeRepeatedPoints=function(t){return Ys.hasRepeatedPoints(t)?new Zs(t,!1).toCoordinateArray():t},Ys.reverse=function(t){for(var e=t.length-1,i=Math.trunc(e/2),n=0;n<=i;n++){var r=t[n];t[n]=t[e-n],t[e-n]=r}},Ys.removeNull=function(t){for(var e=0,i=0;i<t.length;i++)null!==t[i]&&e++;var n=new Array(e).fill(null);if(0===e)return n;for(var r=0,o=0;o<t.length;o++)null!==t[o]&&(n[r++]=t[o]);return n},Ys.copyDeep=function(){if(1===arguments.length){for(var t=arguments[0],e=new Array(t.length).fill(null),i=0;i<t.length;i++)e[i]=new Wo(t[i]);return e}if(5===arguments.length)for(var n=arguments[0],r=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4],l=0;l<a;l++)o[s+l]=new Wo(n[r+l])},Ys.isEqualReversed=function(t,e){for(var i=0;i<t.length;i++){var n=t[i],r=e[t.length-i-1];if(0!==n.compareTo(r))return!1}return!0},Ys.envelope=function(t){for(var e=new ds,i=0;i<t.length;i++)e.expandToInclude(t[i]);return e},Ys.toCoordinateArray=function(t){return t.toArray(Ys.coordArrayType)},Ys.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},Ys.indexOf=function(t,e){for(var i=0;i<e.length;i++)if(t.equals(e[i]))return i;return-1},Ys.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var i=t.length-1-e,n=t[e].compareTo(t[i]);if(0!==n)return n}return 1},Ys.compare=function(t,e){for(var i=0;i<t.length&&i<e.length;){var n=t[i].compareTo(e[i]);if(0!==n)return n;i++}return i<e.length?-1:i<t.length?1:0},Ys.minCoordinate=function(t){for(var e=null,i=0;i<t.length;i++)(null===e||e.compareTo(t[i])>0)&&(e=t[i]);return e},Ys.extract=function(t,e,i){e=Ko.clamp(e,0,t.length);var n=(i=Ko.clamp(i,-1,t.length))-e+1;i<0&&(n=0),e>=t.length&&(n=0),i<e&&(n=0);var r=new Array(n).fill(null);if(0===n)return r;for(var o=0,s=e;s<=i;s++)r[o++]=t[s];return r},Object.defineProperties(Ys,Qs);var Js=function(){};Js.prototype.compare=function(t,e){return Ys.compare(t,e)},Js.prototype.interfaces_=function(){return[jo]},Js.prototype.getClass=function(){return Js};var Ks=function(){};Ks.prototype.compare=function(t,e){var i=t,n=e;if(i.length<n.length)return-1;if(i.length>n.length)return 1;if(0===i.length)return 0;var r=Ys.compare(i,n);return Ys.isEqualReversed(i,n)?0:r},Ks.prototype.OLDcompare=function(t,e){var i=t,n=e;if(i.length<n.length)return-1;if(i.length>n.length)return 1;if(0===i.length)return 0;for(var r=Ys.increasingDirection(i),o=Ys.increasingDirection(n),s=r>0?0:i.length-1,a=o>0?0:i.length-1,l=0;l<i.length;l++){var c=i[s].compareTo(n[a]);if(0!==c)return c;s+=r,a+=o}return 0},Ks.prototype.interfaces_=function(){return[jo]},Ks.prototype.getClass=function(){return Ks};var $s=function(){};$s.prototype.get=function(){},$s.prototype.put=function(){},$s.prototype.size=function(){},$s.prototype.values=function(){},$s.prototype.entrySet=function(){};var ta=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}($s);function ea(t){this.message=t||""}function ia(){}ea.prototype=new Error,ea.prototype.name="OperationNotSupported",ia.prototype=new Us,ia.prototype.contains=function(){};var na=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof Us&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contains=function(t){for(var e=0,i=this.array_.length;e<i;e++){if(this.array_[e]===t)return!0}return!1},e.prototype.add=function(t){return!this.contains(t)&&(this.array_.push(t),!0)},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.remove=function(t){throw new Error},e.prototype.size=function(){return this.array_.length},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,i=this.array_.length;e<i;e++)t.push(this.array_[e]);return t},e.prototype.iterator=function(){return new ra(this)},e}(ia),ra=function(t){function e(e){t.call(this),this.hashSet_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new Ws;return this.hashSet_.array_[this.position_++]},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new ea},e}(js);function oa(t){return null===t?0:t.color}function sa(t){return null===t?null:t.parent}function aa(t,e){null!==t&&(t.color=e)}function la(t){return null===t?null:t.left}function ca(t){return null===t?null:t.right}function ua(){this.root_=null,this.size_=0}ua.prototype=new ta,ua.prototype.get=function(t){for(var e=this.root_;null!==e;){var i=t.compareTo(e.key);if(i<0)e=e.left;else{if(!(i>0))return e.value;e=e.right}}return null},ua.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:0,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var i,n,r=this.root_;do{if(i=r,(n=t.compareTo(r.key))<0)r=r.left;else{if(!(n>0)){var o=r.value;return r.value=e,o}r=r.right}}while(null!==r);var s={key:t,left:null,right:null,value:e,parent:i,color:0,getValue:function(){return this.value},getKey:function(){return this.key}};return n<0?i.left=s:i.right=s,this.fixAfterInsertion(s),this.size_++,null},ua.prototype.fixAfterInsertion=function(t){var e=this;for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(sa(t)===la(sa(sa(t)))){var i=ca(sa(sa(t)));1===oa(i)?(aa(sa(t),0),aa(i,0),aa(sa(sa(t)),1),t=sa(sa(t))):(t===ca(sa(t))&&(t=sa(t),e.rotateLeft(t)),aa(sa(t),0),aa(sa(sa(t)),1),e.rotateRight(sa(sa(t))))}else{var n=la(sa(sa(t)));1===oa(n)?(aa(sa(t),0),aa(n,0),aa(sa(sa(t)),1),t=sa(sa(t))):(t===la(sa(t))&&(t=sa(t),e.rotateRight(t)),aa(sa(t),0),aa(sa(sa(t)),1),e.rotateLeft(sa(sa(t))))}this.root_.color=0},ua.prototype.values=function(){var t=new qs,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=ua.successor(e));)t.add(e.value);return t},ua.prototype.entrySet=function(){var t=new na,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=ua.successor(e));)t.add(e);return t},ua.prototype.rotateLeft=function(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},ua.prototype.rotateRight=function(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},ua.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},ua.successor=function(t){if(null===t)return null;if(null!==t.right){for(var e=t.right;null!==e.left;)e=e.left;return e}for(var i=t.parent,n=t;null!==i&&n===i.right;)n=i,i=i.parent;return i},ua.prototype.size=function(){return this.size_};var ha=function(){};function pa(){}function da(){this.array_=[],arguments[0]instanceof Us&&this.addAll(arguments[0])}ha.prototype.interfaces_=function(){return[]},ha.prototype.getClass=function(){return ha},pa.prototype=new ia,da.prototype=new pa,da.prototype.contains=function(t){for(var e=0,i=this.array_.length;e<i;e++){if(0===this.array_[e].compareTo(t))return!0}return!1},da.prototype.add=function(t){if(this.contains(t))return!1;for(var e=0,i=this.array_.length;e<i;e++){if(1===this.array_[e].compareTo(t))return this.array_.splice(e,0,t),!0}return this.array_.push(t),!0},da.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},da.prototype.remove=function(t){throw new ea},da.prototype.size=function(){return this.array_.length},da.prototype.isEmpty=function(){return 0===this.array_.length},da.prototype.toArray=function(){for(var t=[],e=0,i=this.array_.length;e<i;e++)t.push(this.array_[e]);return t},da.prototype.iterator=function(){return new fa(this)};var fa=function(t){this.treeSet_=t,this.position_=0};fa.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new Ws;return this.treeSet_.array_[this.position_++]},fa.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},fa.prototype.remove=function(){throw new ea};var ma=function(){};ma.sort=function(){var t,e,i,n,r=arguments[0];if(1===arguments.length)n=function(t,e){return t.compareTo(e)},r.sort(n);else if(2===arguments.length)i=arguments[1],n=function(t,e){return i.compare(t,e)},r.sort(n);else if(3===arguments.length){(e=r.slice(arguments[1],arguments[2])).sort();var o=r.slice(0,arguments[1]).concat(e,r.slice(arguments[2],r.length));for(r.splice(0,r.length),t=0;t<o.length;t++)r.push(o[t])}else if(4===arguments.length)for(e=r.slice(arguments[1],arguments[2]),i=arguments[3],n=function(t,e){return i.compare(t,e)},e.sort(n),o=r.slice(0,arguments[1]).concat(e,r.slice(arguments[2],r.length)),r.splice(0,r.length),t=0;t<o.length;t++)r.push(o[t])},ma.asList=function(t){for(var e=new qs,i=0,n=t.length;i<n;i++)e.add(t[i]);return e};var ga=function(){},ya={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};ya.P.get=function(){return 0},ya.L.get=function(){return 1},ya.A.get=function(){return 2},ya.FALSE.get=function(){return-1},ya.TRUE.get=function(){return-2},ya.DONTCARE.get=function(){return-3},ya.SYM_FALSE.get=function(){return"F"},ya.SYM_TRUE.get=function(){return"T"},ya.SYM_DONTCARE.get=function(){return"*"},ya.SYM_P.get=function(){return"0"},ya.SYM_L.get=function(){return"1"},ya.SYM_A.get=function(){return"2"},ga.prototype.interfaces_=function(){return[]},ga.prototype.getClass=function(){return ga},ga.toDimensionSymbol=function(t){switch(t){case ga.FALSE:return ga.SYM_FALSE;case ga.TRUE:return ga.SYM_TRUE;case ga.DONTCARE:return ga.SYM_DONTCARE;case ga.P:return ga.SYM_P;case ga.L:return ga.SYM_L;case ga.A:return ga.SYM_A}throw new zo("Unknown dimension value: "+t)},ga.toDimensionValue=function(t){switch(is.toUpperCase(t)){case ga.SYM_FALSE:return ga.FALSE;case ga.SYM_TRUE:return ga.TRUE;case ga.SYM_DONTCARE:return ga.DONTCARE;case ga.SYM_P:return ga.P;case ga.SYM_L:return ga.L;case ga.SYM_A:return ga.A}throw new zo("Unknown dimension symbol: "+t)},Object.defineProperties(ga,ya);var va=function(){};va.prototype.filter=function(t){},va.prototype.interfaces_=function(){return[]},va.prototype.getClass=function(){return va};var _a=function(){};_a.prototype.filter=function(t,e){},_a.prototype.isDone=function(){},_a.prototype.isGeometryChanged=function(){},_a.prototype.interfaces_=function(){return[]},_a.prototype.getClass=function(){return _a};var xa=function(t){function e(e,i){if(t.call(this,i),this._geometries=e||[],t.hasNullElements(this._geometries))throw new zo("geometries must not contain null elements")}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){for(var t=new ds,e=0;e<this._geometries.length;e++)t.expandToInclude(this._geometries[e].getEnvelopeInternal());return t},e.prototype.getGeometryN=function(t){return this._geometries[t]},e.prototype.getSortIndex=function(){return t.SORTINDEX_GEOMETRYCOLLECTION},e.prototype.getCoordinates=function(){for(var t=new Array(this.getNumPoints()).fill(null),e=-1,i=0;i<this._geometries.length;i++)for(var n=this._geometries[i].getCoordinates(),r=0;r<n.length;r++)t[++e]=n[r];return t},e.prototype.getArea=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getArea();return t},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],i=arguments[1];if(!this.isEquivalentClass(e))return!1;var n=e;if(this._geometries.length!==n._geometries.length)return!1;for(var r=0;r<this._geometries.length;r++)if(!this._geometries[r].equalsExact(n._geometries[r],i))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<this._geometries.length;t++)this._geometries[t].normalize();ma.sort(this._geometries)},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},e.prototype.getBoundaryDimension=function(){for(var t=ga.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getBoundaryDimension());return t},e.prototype.getDimension=function(){for(var t=ga.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getDimension());return t},e.prototype.getLength=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getNumPoints();return t},e.prototype.getNumGeometries=function(){return this._geometries.length},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),i=0;i<this._geometries.length;i++)e[i]=this._geometries[i].reverse();return this.getFactory().createGeometryCollection(e)},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0],e=new da(ma.asList(this._geometries)),i=new da(ma.asList(t._geometries));return this.compare(e,i)}if(2===arguments.length){for(var n=arguments[1],r=arguments[0],o=this.getNumGeometries(),s=r.getNumGeometries(),a=0;a<o&&a<s;){var l=this.getGeometryN(a),c=r.getGeometryN(a),u=l.compareToSameClass(c,n);if(0!==u)return u;a++}return a<o?1:a<s?-1:0}},e.prototype.apply=function(){var t=this;if(Jo(arguments[0],Os))for(var e=arguments[0],i=0;i<this._geometries.length;i++)t._geometries[i].apply(e);else if(Jo(arguments[0],_a)){var n=arguments[0];if(0===this._geometries.length)return null;for(var r=0;r<this._geometries.length&&(t._geometries[r].apply(n),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else if(Jo(arguments[0],va)){var o=arguments[0];o.filter(this);for(var s=0;s<this._geometries.length;s++)t._geometries[s].apply(o)}else if(Jo(arguments[0],Ps)){var a=arguments[0];a.filter(this);for(var l=0;l<this._geometries.length;l++)t._geometries[l].apply(a)}},e.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),ws.shouldNeverReachHere(),null},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._geometries=new Array(this._geometries.length).fill(null);for(var i=0;i<this._geometries.length;i++)e._geometries[i]=this._geometries[i].clone();return e},e.prototype.getGeometryType=function(){return"GeometryCollection"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),i=0;i<t.length;i++)t[i]=this._geometries[i].copy();return new e(t,this._factory)},e.prototype.isEmpty=function(){for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isEmpty())return!1;return!0},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},i.serialVersionUID.get=function(){return-0x4f07bcb1f857d800},Object.defineProperties(e,i),e}(Ls),ba=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return Ls.SORTINDEX_MULTILINESTRING},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],i=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,i)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?ga.FALSE:0},e.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isClosed())return!1;return!0},e.prototype.getDimension=function(){return 1},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),i=0;i<this._geometries.length;i++)e[t-1-i]=this._geometries[i].reverse();return this.getFactory().createMultiLineString(e)},e.prototype.getBoundary=function(){return new wa(this).getBoundary()},e.prototype.getGeometryType=function(){return"MultiLineString"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),i=0;i<t.length;i++)t[i]=this._geometries[i].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[ha]},e.prototype.getClass=function(){return e},i.serialVersionUID.get=function(){return 0x7155d2ab4afa8000},Object.defineProperties(e,i),e}(xa),wa=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,1===arguments.length){var t=arguments[0],e=ks.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(2===arguments.length){var i=arguments[0],n=arguments[1];this._geom=i,this._geomFact=i.getFactory(),this._bnRule=n}};wa.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return 1===e.length?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)},wa.prototype.getBoundary=function(){return this._geom instanceof Ra?this.boundaryLineString(this._geom):this._geom instanceof ba?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},wa.prototype.boundaryLineString=function(t){return this._geom.isEmpty()?this.getEmptyMultiPoint():t.isClosed()?this._bnRule.isInBoundary(2)?t.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},wa.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},wa.prototype.computeBoundaryCoordinates=function(t){var e=this,i=new qs;this._endpointMap=new ua;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);0!==r.getNumPoints()&&(e.addEndpoint(r.getCoordinateN(0)),e.addEndpoint(r.getCoordinateN(r.getNumPoints()-1)))}for(var o=this._endpointMap.entrySet().iterator();o.hasNext();){var s=o.next(),a=s.getValue().count;e._bnRule.isInBoundary(a)&&i.add(s.getKey())}return Ys.toCoordinateArray(i)},wa.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);null===e&&(e=new Aa,this._endpointMap.put(t,e)),e.count++},wa.prototype.interfaces_=function(){return[]},wa.prototype.getClass=function(){return wa},wa.getBoundary=function(){return 1===arguments.length?new wa(arguments[0]).getBoundary():2===arguments.length?new wa(arguments[0],arguments[1]).getBoundary():void 0};var Aa=function(){this.count=null};function Ea(){}function Sa(){}Aa.prototype.interfaces_=function(){return[]},Aa.prototype.getClass=function(){return Aa};var Ma=function(){};function Ta(){}function Ia(){}function Ca(){}var Pa=function(){},La={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Pa.prototype.interfaces_=function(){return[]},Pa.prototype.getClass=function(){return Pa},Pa.chars=function(t,e){for(var i=new Array(e).fill(null),n=0;n<e;n++)i[n]=t;return String(i)},Pa.getStackTrace=function(){if(1===arguments.length){var t=arguments[0],e=new Ta,i=new Ea;return t.printStackTrace(i),e.toString()}if(2===arguments.length){var n=arguments[1],r="";new Sa(Pa.getStackTrace(arguments[0]));for(var o=new Ca,s=0;s<n;s++)try{r+=o.readLine()+Pa.NEWLINE}catch(t){if(!(t instanceof Ia))throw t;ws.shouldNeverReachHere()}return r}},Pa.split=function(t,e){for(var i=e.length,n=new qs,r=""+t,o=r.indexOf(e);o>=0;){var s=r.substring(0,o);n.add(s),o=(r=r.substring(o+i)).indexOf(e)}r.length>0&&n.add(r);for(var a=new Array(n.size()).fill(null),l=0;l<a.length;l++)a[l]=n.get(l);return a},Pa.toString=function(){if(1===arguments.length){var t=arguments[0];return Pa.SIMPLE_ORDINATE_FORMAT.format(t)}},Pa.spaces=function(t){return Pa.chars(" ",t)},La.NEWLINE.get=function(){return hs.getProperty("line.separator")},La.SIMPLE_ORDINATE_FORMAT.get=function(){return new Ma},Object.defineProperties(Pa,La);var Da=function(){};Da.prototype.interfaces_=function(){return[]},Da.prototype.getClass=function(){return Da},Da.copyCoord=function(t,e,i,n){for(var r=Math.min(t.getDimension(),i.getDimension()),o=0;o<r;o++)i.setOrdinate(n,o,t.getOrdinate(e,o))},Da.isRing=function(t){var e=t.size();return 0===e||!(e<=3)&&(t.getOrdinate(0,as.X)===t.getOrdinate(e-1,as.X)&&t.getOrdinate(0,as.Y)===t.getOrdinate(e-1,as.Y))},Da.isEqual=function(t,e){var i=t.size();if(i!==e.size())return!1;for(var n=Math.min(t.getDimension(),e.getDimension()),r=0;r<i;r++)for(var o=0;o<n;o++){var s=t.getOrdinate(r,o),a=e.getOrdinate(r,o);if(t.getOrdinate(r,o)!==e.getOrdinate(r,o)&&(!Fo.isNaN(s)||!Fo.isNaN(a)))return!1}return!0},Da.extend=function(t,e,i){var n=t.create(i,e.getDimension()),r=e.size();if(Da.copy(e,0,n,0,r),r>0)for(var o=r;o<i;o++)Da.copy(e,r-1,n,o,1);return n},Da.reverse=function(t){for(var e=t.size()-1,i=Math.trunc(e/2),n=0;n<=i;n++)Da.swap(t,n,e-n)},Da.swap=function(t,e,i){if(e===i)return null;for(var n=0;n<t.getDimension();n++){var r=t.getOrdinate(e,n);t.setOrdinate(e,n,t.getOrdinate(i,n)),t.setOrdinate(i,n,r)}},Da.copy=function(t,e,i,n,r){for(var o=0;o<r;o++)Da.copyCoord(t,e+o,i,n+o)},Da.toString=function(){if(1===arguments.length){var t=arguments[0],e=t.size();if(0===e)return"()";var i=t.getDimension(),n=new ts;n.append("(");for(var r=0;r<e;r++){r>0&&n.append(" ");for(var o=0;o<i;o++)o>0&&n.append(","),n.append(Pa.toString(t.getOrdinate(r,o)))}return n.append(")"),n.toString()}},Da.ensureValidRing=function(t,e){var i=e.size();return 0===i?e:i<=3?Da.createClosedRing(t,e,4):e.getOrdinate(0,as.X)===e.getOrdinate(i-1,as.X)&&e.getOrdinate(0,as.Y)===e.getOrdinate(i-1,as.Y)?e:Da.createClosedRing(t,e,i+1)},Da.createClosedRing=function(t,e,i){var n=t.create(i,e.getDimension()),r=e.size();Da.copy(e,0,n,0,r);for(var o=r;o<i;o++)Da.copy(e,0,n,o,1);return n};var Ra=function(t){function e(e,i){t.call(this,i),this._points=null,this.init(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new ds:this._points.expandEnvelope(new ds)},e.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},e.prototype.getSortIndex=function(){return t.SORTINDEX_LINESTRING},e.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],i=arguments[1];if(!this.isEquivalentClass(e))return!1;var n=e;if(this._points.size()!==n._points.size())return!1;for(var r=0;r<this._points.size();r++)if(!this.equal(this._points.getCoordinate(r),n._points.getCoordinate(r),i))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=this,e=0;e<Math.trunc(this._points.size()/2);e++){var i=t._points.size()-1-e;if(!t._points.getCoordinate(e).equals(t._points.getCoordinate(i)))return t._points.getCoordinate(e).compareTo(t._points.getCoordinate(i))>0&&Da.reverse(t._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?ga.FALSE:0},e.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return Is.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();return Da.reverse(t),this.getFactory().createLineString(t)},e.prototype.compareToSameClass=function(){if(1===arguments.length){for(var t=arguments[0],e=0,i=0;e<this._points.size()&&i<t._points.size();){var n=this._points.getCoordinate(e).compareTo(t._points.getCoordinate(i));if(0!==n)return n;e++,i++}return e<this._points.size()?1:i<t._points.size()?-1:0}if(2===arguments.length){var r=arguments[0];return arguments[1].compare(this._points,r._points)}},e.prototype.apply=function(){if(Jo(arguments[0],Os))for(var t=arguments[0],e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e));else if(Jo(arguments[0],_a)){var i=arguments[0];if(0===this._points.size())return null;for(var n=0;n<this._points.size()&&(i.filter(this._points,n),!i.isDone());n++);i.isGeometryChanged()&&this.geometryChanged()}else if(Jo(arguments[0],va)){arguments[0].filter(this)}else if(Jo(arguments[0],Ps)){arguments[0].filter(this)}},e.prototype.getBoundary=function(){return new wa(this).getBoundary()},e.prototype.isEquivalentClass=function(t){return t instanceof e},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._points=this._points.clone(),e},e.prototype.getCoordinateN=function(t){return this._points.getCoordinate(t)},e.prototype.getGeometryType=function(){return"LineString"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._points},e.prototype.isEmpty=function(){return 0===this._points.size()},e.prototype.init=function(t){if(null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),1===t.size())throw new zo("Invalid number of points in LineString (found "+t.size()+" - must be 0 or >= 2)");this._points=t},e.prototype.isCoordinate=function(t){for(var e=0;e<this._points.size();e++)if(this._points.getCoordinate(e).equals(t))return!0;return!1},e.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},e.prototype.getPointN=function(t){return this.getFactory().createPoint(this._points.getCoordinate(t))},e.prototype.interfaces_=function(){return[ha]},e.prototype.getClass=function(){return e},i.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,i),e}(Ls),Oa=function(){};Oa.prototype.interfaces_=function(){return[]},Oa.prototype.getClass=function(){return Oa};var ka=function(t){function e(e,i){t.call(this,i),this._coordinates=e||null,this.init(this._coordinates)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new ds;var t=new ds;return t.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),t},e.prototype.getSortIndex=function(){return t.SORTINDEX_POINT},e.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],i=arguments[1];return!!this.isEquivalentClass(e)&&(!(!this.isEmpty()||!e.isEmpty())||this.isEmpty()===e.isEmpty()&&this.equal(e.getCoordinate(),this.getCoordinate(),i))}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){},e.prototype.getCoordinate=function(){return 0!==this._coordinates.size()?this._coordinates.getCoordinate(0):null},e.prototype.getBoundaryDimension=function(){return ga.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getNumPoints=function(){return this.isEmpty()?0:1},e.prototype.reverse=function(){return this.copy()},e.prototype.getX=function(){if(null===this.getCoordinate())throw new Error("getX called on empty Point");return this.getCoordinate().x},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0];return this.getCoordinate().compareTo(t.getCoordinate())}if(2===arguments.length){var e=arguments[0];return arguments[1].compare(this._coordinates,e._coordinates)}},e.prototype.apply=function(){if(Jo(arguments[0],Os)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(Jo(arguments[0],_a)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this._coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else if(Jo(arguments[0],va)){arguments[0].filter(this)}else if(Jo(arguments[0],Ps)){arguments[0].filter(this)}},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._coordinates=this._coordinates.clone(),e},e.prototype.getGeometryType=function(){return"Point"},e.prototype.copy=function(){return new e(this._coordinates.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._coordinates},e.prototype.getY=function(){if(null===this.getCoordinate())throw new Error("getY called on empty Point");return this.getCoordinate().y},e.prototype.isEmpty=function(){return 0===this._coordinates.size()},e.prototype.init=function(t){null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),ws.isTrue(t.size()<=1),this._coordinates=t},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[Oa]},e.prototype.getClass=function(){return e},i.serialVersionUID.get=function(){return 0x44077bad161cbc00},Object.defineProperties(e,i),e}(Ls),Na=function(){};Na.prototype.interfaces_=function(){return[]},Na.prototype.getClass=function(){return Na};var Ba=function(t){function e(e,i,n){if(t.call(this,n),this._shell=null,this._holes=null,null===e&&(e=this.getFactory().createLinearRing()),null===i&&(i=[]),t.hasNullElements(i))throw new zo("holes must not contain null elements");if(e.isEmpty()&&t.hasNonEmptyElements(i))throw new zo("shell is empty but holes are not");this._shell=e,this._holes=i}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},e.prototype.getSortIndex=function(){return t.SORTINDEX_POLYGON},e.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var t=new Array(this.getNumPoints()).fill(null),e=-1,i=this._shell.getCoordinates(),n=0;n<i.length;n++)t[++e]=i[n];for(var r=0;r<this._holes.length;r++)for(var o=this._holes[r].getCoordinates(),s=0;s<o.length;s++)t[++e]=o[s];return t},e.prototype.getArea=function(){var t=0;t+=Math.abs(Is.signedArea(this._shell.getCoordinateSequence()));for(var e=0;e<this._holes.length;e++)t-=Math.abs(Is.signedArea(this._holes[e].getCoordinateSequence()));return t},e.prototype.isRectangle=function(){if(0!==this.getNumInteriorRing())return!1;if(null===this._shell)return!1;if(5!==this._shell.getNumPoints())return!1;for(var t=this._shell.getCoordinateSequence(),e=this.getEnvelopeInternal(),i=0;i<5;i++){var n=t.getX(i);if(n!==e.getMinX()&&n!==e.getMaxX())return!1;var r=t.getY(i);if(r!==e.getMinY()&&r!==e.getMaxY())return!1}for(var o=t.getX(0),s=t.getY(0),a=1;a<=4;a++){var l=t.getX(a),c=t.getY(a);if(l!==o===(c!==s))return!1;o=l,s=c}return!0},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],i=arguments[1];if(!this.isEquivalentClass(e))return!1;var n=e,r=this._shell,o=n._shell;if(!r.equalsExact(o,i))return!1;if(this._holes.length!==n._holes.length)return!1;for(var s=0;s<this._holes.length;s++)if(!this._holes[s].equalsExact(n._holes[s],i))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){if(0===arguments.length){this.normalize(this._shell,!0);for(var t=0;t<this._holes.length;t++)this.normalize(this._holes[t],!1);ma.sort(this._holes)}else if(2===arguments.length){var e=arguments[0],i=arguments[1];if(e.isEmpty())return null;var n=new Array(e.getCoordinates().length-1).fill(null);hs.arraycopy(e.getCoordinates(),0,n,0,n.length);var r=Ys.minCoordinate(e.getCoordinates());Ys.scroll(n,r),hs.arraycopy(n,0,e.getCoordinates(),0,n.length),e.getCoordinates()[n.length]=n[0],Is.isCCW(e.getCoordinates())===i&&Ys.reverse(e.getCoordinates())}},e.prototype.getCoordinate=function(){return this._shell.getCoordinate()},e.prototype.getNumInteriorRing=function(){return this._holes.length},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.getLength=function(){var t=0;t+=this._shell.getLength();for(var e=0;e<this._holes.length;e++)t+=this._holes[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=this._shell.getNumPoints(),e=0;e<this._holes.length;e++)t+=this._holes[e].getNumPoints();return t},e.prototype.reverse=function(){var t=this.copy();t._shell=this._shell.copy().reverse(),t._holes=new Array(this._holes.length).fill(null);for(var e=0;e<this._holes.length;e++)t._holes[e]=this._holes[e].copy().reverse();return t},e.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0],e=this._shell,i=t._shell;return e.compareToSameClass(i)}if(2===arguments.length){var n=arguments[1],r=arguments[0],o=this._shell,s=r._shell,a=o.compareToSameClass(s,n);if(0!==a)return a;for(var l=this.getNumInteriorRing(),c=r.getNumInteriorRing(),u=0;u<l&&u<c;){var h=this.getInteriorRingN(u),p=r.getInteriorRingN(u),d=h.compareToSameClass(p,n);if(0!==d)return d;u++}return u<l?1:u<c?-1:0}},e.prototype.apply=function(t){var e=this;if(Jo(t,Os)){this._shell.apply(t);for(var i=0;i<this._holes.length;i++)e._holes[i].apply(t)}else if(Jo(t,_a)){if(this._shell.apply(t),!t.isDone())for(var n=0;n<this._holes.length&&(e._holes[n].apply(t),!t.isDone());n++);t.isGeometryChanged()&&this.geometryChanged()}else if(Jo(t,va))t.filter(this);else if(Jo(t,Ps)){t.filter(this),this._shell.apply(t);for(var r=0;r<this._holes.length;r++)e._holes[r].apply(t)}},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var t=new Array(this._holes.length+1).fill(null);t[0]=this._shell;for(var e=0;e<this._holes.length;e++)t[e+1]=this._holes[e];return t.length<=1?this.getFactory().createLinearRing(t[0].getCoordinateSequence()):this.getFactory().createMultiLineString(t)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._shell=this._shell.clone(),e._holes=new Array(this._holes.length).fill(null);for(var i=0;i<this._holes.length;i++)e._holes[i]=this._holes[i].clone();return e},e.prototype.getGeometryType=function(){return"Polygon"},e.prototype.copy=function(){for(var t=this._shell.copy(),i=new Array(this._holes.length).fill(null),n=0;n<i.length;n++)i[n]=this._holes[n].copy();return new e(t,i,this._factory)},e.prototype.getExteriorRing=function(){return this._shell},e.prototype.isEmpty=function(){return this._shell.isEmpty()},e.prototype.getInteriorRingN=function(t){return this._holes[t]},e.prototype.interfaces_=function(){return[Na]},e.prototype.getClass=function(){return e},i.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(e,i),e}(Ls),za=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return Ls.SORTINDEX_MULTIPOINT},e.prototype.isValid=function(){return!0},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],i=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,i)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getCoordinate=function(){if(1===arguments.length){var e=arguments[0];return this._geometries[e].getCoordinate()}return t.prototype.getCoordinate.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return ga.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.getGeometryType=function(){return"MultiPoint"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),i=0;i<t.length;i++)t[i]=this._geometries[i].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Oa]},e.prototype.getClass=function(){return e},i.serialVersionUID.get=function(){return-0x6fb1ed4162e0fc00},Object.defineProperties(e,i),e}(xa),Fa=function(t){function e(e,i){e instanceof Wo&&i instanceof el&&(e=i.getCoordinateSequenceFactory().create(e)),t.call(this,e,i),this.validateConstruction()}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return Ls.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return ga.FALSE},e.prototype.isClosed=function(){return!!this.isEmpty()||t.prototype.isClosed.call(this)},e.prototype.reverse=function(){var t=this._points.copy();return Da.reverse(t),this.getFactory().createLinearRing(t)},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!t.prototype.isClosed.call(this))throw new zo("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new zo("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},i.MINIMUM_VALID_SIZE.get=function(){return 4},i.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,i),e}(Ra),Va=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return Ls.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],i=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,i)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),i=0;i<this._geometries.length;i++)e[i]=this._geometries[i].reverse();return this.getFactory().createMultiPolygon(e)},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var t=new qs,e=0;e<this._geometries.length;e++)for(var i=this._geometries[e].getBoundary(),n=0;n<i.getNumGeometries();n++)t.add(i.getGeometryN(n));var r=new Array(t.size()).fill(null);return this.getFactory().createMultiLineString(t.toArray(r))},e.prototype.getGeometryType=function(){return"MultiPolygon"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),i=0;i<t.length;i++)t[i]=this._geometries[i].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Na]},e.prototype.getClass=function(){return e},i.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(e,i),e}(xa),Ua=function(t){this._factory=t||null,this._isUserDataCopied=!1},Ga={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Ua.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},Ua.prototype.edit=function(t,e){if(null===t)return null;var i=this.editInternal(t,e);return this._isUserDataCopied&&i.setUserData(t.getUserData()),i},Ua.prototype.editInternal=function(t,e){return null===this._factory&&(this._factory=t.getFactory()),t instanceof xa?this.editGeometryCollection(t,e):t instanceof Ba?this.editPolygon(t,e):t instanceof ka||t instanceof Ra?e.edit(t,this._factory):(ws.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},Ua.prototype.editGeometryCollection=function(t,e){for(var i=e.edit(t,this._factory),n=new qs,r=0;r<i.getNumGeometries();r++){var o=this.edit(i.getGeometryN(r),e);null===o||o.isEmpty()||n.add(o)}return i.getClass()===za?this._factory.createMultiPoint(n.toArray([])):i.getClass()===ba?this._factory.createMultiLineString(n.toArray([])):i.getClass()===Va?this._factory.createMultiPolygon(n.toArray([])):this._factory.createGeometryCollection(n.toArray([]))},Ua.prototype.editPolygon=function(t,e){var i=e.edit(t,this._factory);if(null===i&&(i=this._factory.createPolygon(null)),i.isEmpty())return i;var n=this.edit(i.getExteriorRing(),e);if(null===n||n.isEmpty())return this._factory.createPolygon();for(var r=new qs,o=0;o<i.getNumInteriorRing();o++){var s=this.edit(i.getInteriorRingN(o),e);null===s||s.isEmpty()||r.add(s)}return this._factory.createPolygon(n,r.toArray([]))},Ua.prototype.interfaces_=function(){return[]},Ua.prototype.getClass=function(){return Ua},Ua.GeometryEditorOperation=function(){},Ga.NoOpGeometryOperation.get=function(){return ja},Ga.CoordinateOperation.get=function(){return Ha},Ga.CoordinateSequenceOperation.get=function(){return Wa},Object.defineProperties(Ua,Ga);var ja=function(){};ja.prototype.edit=function(t,e){return t},ja.prototype.interfaces_=function(){return[Ua.GeometryEditorOperation]},ja.prototype.getClass=function(){return ja};var Ha=function(){};Ha.prototype.edit=function(t,e){var i=this.editCoordinates(t.getCoordinates(),t);return null===i?t:t instanceof Fa?e.createLinearRing(i):t instanceof Ra?e.createLineString(i):t instanceof ka?i.length>0?e.createPoint(i[0]):e.createPoint():t},Ha.prototype.interfaces_=function(){return[Ua.GeometryEditorOperation]},Ha.prototype.getClass=function(){return Ha};var Wa=function(){};Wa.prototype.edit=function(t,e){return t instanceof Fa?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Ra?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof ka?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},Wa.prototype.interfaces_=function(){return[Ua.GeometryEditorOperation]},Wa.prototype.getClass=function(){return Wa};var qa=function(){var t=this;if(this._dimension=3,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var e=arguments[0];this._coordinates=new Array(e).fill(null);for(var i=0;i<e;i++)t._coordinates[i]=new Wo}else if(Jo(arguments[0],as)){var n=arguments[0];if(null===n)return this._coordinates=new Array(0).fill(null),null;this._dimension=n.getDimension(),this._coordinates=new Array(n.size()).fill(null);for(var r=0;r<this._coordinates.length;r++)t._coordinates[r]=n.getCoordinateCopy(r)}}else if(2===arguments.length)if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var o=arguments[0],s=arguments[1];this._coordinates=o,this._dimension=s,null===o&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var a=arguments[0],l=arguments[1];this._coordinates=new Array(a).fill(null),this._dimension=l;for(var c=0;c<a;c++)t._coordinates[c]=new Wo}},Xa={serialVersionUID:{configurable:!0}};qa.prototype.setOrdinate=function(t,e,i){switch(e){case as.X:this._coordinates[t].x=i;break;case as.Y:this._coordinates[t].y=i;break;case as.Z:this._coordinates[t].z=i;break;default:throw new zo("invalid ordinateIndex")}},qa.prototype.size=function(){return this._coordinates.length},qa.prototype.getOrdinate=function(t,e){switch(e){case as.X:return this._coordinates[t].x;case as.Y:return this._coordinates[t].y;case as.Z:return this._coordinates[t].z}return Fo.NaN},qa.prototype.getCoordinate=function(){if(1===arguments.length){var t=arguments[0];return this._coordinates[t]}if(2===arguments.length){var e=arguments[0],i=arguments[1];i.x=this._coordinates[e].x,i.y=this._coordinates[e].y,i.z=this._coordinates[e].z}},qa.prototype.getCoordinateCopy=function(t){return new Wo(this._coordinates[t])},qa.prototype.getDimension=function(){return this._dimension},qa.prototype.getX=function(t){return this._coordinates[t].x},qa.prototype.clone=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].clone();return new qa(t,this._dimension)},qa.prototype.expandEnvelope=function(t){for(var e=0;e<this._coordinates.length;e++)t.expandToInclude(this._coordinates[e]);return t},qa.prototype.copy=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].copy();return new qa(t,this._dimension)},qa.prototype.toString=function(){if(this._coordinates.length>0){var t=new ts(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e<this._coordinates.length;e++)t.append(", "),t.append(this._coordinates[e]);return t.append(")"),t.toString()}return"()"},qa.prototype.getY=function(t){return this._coordinates[t].y},qa.prototype.toCoordinateArray=function(){return this._coordinates},qa.prototype.interfaces_=function(){return[as,Ho]},qa.prototype.getClass=function(){return qa},Xa.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(qa,Xa);var Za=function(){},Ya={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Za.prototype.readResolve=function(){return Za.instance()},Za.prototype.create=function(){if(1===arguments.length){if(arguments[0]instanceof Array)return new qa(arguments[0]);if(Jo(arguments[0],as))return new qa(arguments[0])}else if(2===arguments.length){var t=arguments[0],e=arguments[1];return e>3&&(e=3),e<2?new qa(t):new qa(t,e)}},Za.prototype.interfaces_=function(){return[Zo,Ho]},Za.prototype.getClass=function(){return Za},Za.instance=function(){return Za.instanceObject},Ya.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},Ya.instanceObject.get=function(){return new Za},Object.defineProperties(Za,Ya);var Qa=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return this.map_.get(t)||null},e.prototype.put=function(t,e){return this.map_.set(t,e),e},e.prototype.values=function(){for(var t=new qs,e=this.map_.values(),i=e.next();!i.done;)t.add(i.value),i=e.next();return t},e.prototype.entrySet=function(){var t=new na;return this.map_.entries().forEach((function(e){return t.add(e)})),t},e.prototype.size=function(){return this.map_.size()},e}($s),Ja=function t(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=t.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof $a){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var i=arguments[0];this._modelType=t.FIXED,this.setScale(i)}else if(arguments[0]instanceof t){var n=arguments[0];this._modelType=n._modelType,this._scale=n._scale}},Ka={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Ja.prototype.equals=function(t){if(!(t instanceof Ja))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},Ja.prototype.compareTo=function(t){var e=t,i=this.getMaximumSignificantDigits(),n=e.getMaximumSignificantDigits();return new es(i).compareTo(new es(n))},Ja.prototype.getScale=function(){return this._scale},Ja.prototype.isFloating=function(){return this._modelType===Ja.FLOATING||this._modelType===Ja.FLOATING_SINGLE},Ja.prototype.getType=function(){return this._modelType},Ja.prototype.toString=function(){var t="UNKNOWN";return this._modelType===Ja.FLOATING?t="Floating":this._modelType===Ja.FLOATING_SINGLE?t="Floating-Single":this._modelType===Ja.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},Ja.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];return Fo.isNaN(t)||this._modelType===Ja.FLOATING_SINGLE?t:this._modelType===Ja.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof Wo){var e=arguments[0];if(this._modelType===Ja.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},Ja.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===Ja.FLOATING?t=16:this._modelType===Ja.FLOATING_SINGLE?t=6:this._modelType===Ja.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},Ja.prototype.setScale=function(t){this._scale=Math.abs(t)},Ja.prototype.interfaces_=function(){return[Ho,Uo]},Ja.prototype.getClass=function(){return Ja},Ja.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},Ka.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},Ka.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(Ja,Ka);var $a=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},tl={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};$a.prototype.readResolve=function(){return $a.nameToTypeMap.get(this._name)},$a.prototype.toString=function(){return this._name},$a.prototype.interfaces_=function(){return[Ho]},$a.prototype.getClass=function(){return $a},tl.serialVersionUID.get=function(){return-552860263173159e4},tl.nameToTypeMap.get=function(){return new Qa},Object.defineProperties($a,tl),Ja.Type=$a,Ja.FIXED=new $a("FIXED"),Ja.FLOATING=new $a("FLOATING"),Ja.FLOATING_SINGLE=new $a("FLOATING SINGLE");var el=function t(){this._precisionModel=new Ja,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?Jo(arguments[0],Zo)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Ja&&(this._precisionModel=arguments[0]):2===arguments.length?(this._precisionModel=arguments[0],this._SRID=arguments[1]):3===arguments.length&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},il={serialVersionUID:{configurable:!0}};el.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new Wo(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new Wo(t.getMinX(),t.getMinY()),new Wo(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new Wo(t.getMinX(),t.getMinY()),new Wo(t.getMinX(),t.getMaxY()),new Wo(t.getMaxX(),t.getMaxY()),new Wo(t.getMaxX(),t.getMinY()),new Wo(t.getMinX(),t.getMinY())]),null)},el.prototype.createLineString=function(t){return t?t instanceof Array?new Ra(this.getCoordinateSequenceFactory().create(t),this):Jo(t,as)?new Ra(t,this):void 0:new Ra(this.getCoordinateSequenceFactory().create([]),this)},el.prototype.createMultiLineString=function(){return 0===arguments.length?new ba(null,this):1===arguments.length?new ba(arguments[0],this):void 0},el.prototype.buildGeometry=function(t){for(var e=null,i=!1,n=!1,r=t.iterator();r.hasNext();){var o=r.next(),s=o.getClass();null===e&&(e=s),s!==e&&(i=!0),o.isGeometryCollectionOrDerived()&&(n=!0)}if(null===e)return this.createGeometryCollection();if(i||n)return this.createGeometryCollection(el.toGeometryArray(t));var a=t.iterator().next();if(t.size()>1){if(a instanceof Ba)return this.createMultiPolygon(el.toPolygonArray(t));if(a instanceof Ra)return this.createMultiLineString(el.toLineStringArray(t));if(a instanceof ka)return this.createMultiPoint(el.toPointArray(t));ws.shouldNeverReachHere("Unhandled class: "+a.getClass().getName())}return a},el.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},el.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Wo){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(Jo(arguments[0],as))return new ka(arguments[0],this)}},el.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},el.prototype.createPolygon=function(){if(0===arguments.length)return new Ba(null,null,this);if(1===arguments.length){if(Jo(arguments[0],as)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof Fa){var i=arguments[0];return this.createPolygon(i,null)}}else if(2===arguments.length){return new Ba(arguments[0],arguments[1],this)}},el.prototype.getSRID=function(){return this._SRID},el.prototype.createGeometryCollection=function(){return 0===arguments.length?new xa(null,this):1===arguments.length?new xa(arguments[0],this):void 0},el.prototype.createGeometry=function(t){return new Ua(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},el.prototype.getPrecisionModel=function(){return this._precisionModel},el.prototype.createLinearRing=function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(Jo(arguments[0],as))return new Fa(arguments[0],this)}},el.prototype.createMultiPolygon=function(){return 0===arguments.length?new Va(null,this):1===arguments.length?new Va(arguments[0],this):void 0},el.prototype.createMultiPoint=function(){if(0===arguments.length)return new za(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new za(arguments[0],this);if(arguments[0]instanceof Array){var t=arguments[0];return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(Jo(arguments[0],as)){var e=arguments[0];if(null===e)return this.createMultiPoint(new Array(0).fill(null));for(var i=new Array(e.size()).fill(null),n=0;n<e.size();n++){var r=this.getCoordinateSequenceFactory().create(1,e.getDimension());Da.copy(e,n,r,0,1),i[n]=this.createPoint(r)}return this.createMultiPoint(i)}}},el.prototype.interfaces_=function(){return[Ho]},el.prototype.getClass=function(){return el},el.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},el.toGeometryArray=function(t){if(null===t)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},el.getDefaultCoordinateSequenceFactory=function(){return Za.instance()},el.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},el.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},el.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},el.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},el.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},el.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},el.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},il.serialVersionUID.get=function(){return-0x5ea75f2051eeb400},Object.defineProperties(el,il);var nl=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],rl=function(t){this.geometryFactory=t||new el};rl.prototype.read=function(t){var e,i=(e="string"==typeof t?JSON.parse(t):t).type;if(!ol[i])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==nl.indexOf(i)?ol[i].apply(this,[e.coordinates]):"GeometryCollection"===i?ol[i].apply(this,[e.geometries]):ol[i].apply(this,[e])},rl.prototype.write=function(t){var e=t.getGeometryType();if(!sl[e])throw new Error("Geometry is not supported");return sl[e].apply(this,[t])};var ol={Feature:function(t){var e={};for(var i in t)e[i]=t[i];if(t.geometry){var n=t.geometry.type;if(!ol[n])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=ol.bbox.apply(this,[t.bbox])),e},FeatureCollection:function(t){var e={};if(t.features){e.features=[];for(var i=0;i<t.features.length;++i)e.features.push(this.read(t.features[i]))}return t.bbox&&(e.bbox=this.parse.bbox.apply(this,[t.bbox])),e},coordinates:function(t){for(var e=[],i=0;i<t.length;++i){var n=t[i];e.push(new Wo(n[0],n[1]))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new Wo(t[0],t[1]),new Wo(t[2],t[1]),new Wo(t[2],t[3]),new Wo(t[0],t[3]),new Wo(t[0],t[1])])},Point:function(t){var e=new Wo(t[0],t[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(t){for(var e=[],i=0;i<t.length;++i)e.push(ol.Point.apply(this,[t[i]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(t){var e=ol.coordinates.apply(this,[t]);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){for(var e=[],i=0;i<t.length;++i)e.push(ol.LineString.apply(this,[t[i]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(t){for(var e=ol.coordinates.apply(this,[t[0]]),i=this.geometryFactory.createLinearRing(e),n=[],r=1;r<t.length;++r){var o=t[r],s=ol.coordinates.apply(this,[o]),a=this.geometryFactory.createLinearRing(s);n.push(a)}return this.geometryFactory.createPolygon(i,n)},MultiPolygon:function(t){for(var e=[],i=0;i<t.length;++i){var n=t[i];e.push(ol.Polygon.apply(this,[n]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(t){for(var e=[],i=0;i<t.length;++i){var n=t[i];e.push(this.read(n))}return this.geometryFactory.createGeometryCollection(e)}},sl={coordinate:function(t){return[t.x,t.y]},Point:function(t){return{type:"Point",coordinates:sl.coordinate.apply(this,[t.getCoordinate()])}},MultiPoint:function(t){for(var e=[],i=0;i<t._geometries.length;++i){var n=t._geometries[i],r=sl.Point.apply(this,[n]);e.push(r.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(t){for(var e=[],i=t.getCoordinates(),n=0;n<i.length;++n){var r=i[n];e.push(sl.coordinate.apply(this,[r]))}return{type:"LineString",coordinates:e}},MultiLineString:function(t){for(var e=[],i=0;i<t._geometries.length;++i){var n=t._geometries[i],r=sl.LineString.apply(this,[n]);e.push(r.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],i=sl.LineString.apply(this,[t._shell]);e.push(i.coordinates);for(var n=0;n<t._holes.length;++n){var r=t._holes[n],o=sl.LineString.apply(this,[r]);e.push(o.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(t){for(var e=[],i=0;i<t._geometries.length;++i){var n=t._geometries[i],r=sl.Polygon.apply(this,[n]);e.push(r.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(t){for(var e=[],i=0;i<t._geometries.length;++i){var n=t._geometries[i],r=n.getGeometryType();e.push(sl[r].apply(this,[n]))}return{type:"GeometryCollection",geometries:e}}},al=function(t){this.geometryFactory=t||new el,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new rl(this.geometryFactory)};al.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===Ja.FIXED&&this.reducePrecision(e),e},al.prototype.reducePrecision=function(t){var e,i;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(e=0,i=t.points.length;e<i;e++)this.precisionModel.makePrecise(t.points[e]);else if(t.geometries)for(e=0,i=t.geometries.length;e<i;e++)this.reducePrecision(t.geometries[e])};var ll=function(){this.parser=new rl(this.geometryFactory)};ll.prototype.write=function(t){return this.parser.write(t)};var cl=function(){},ul={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};function hl(t){this.message=t||""}function pl(){this.array_=[]}cl.prototype.interfaces_=function(){return[]},cl.prototype.getClass=function(){return cl},cl.opposite=function(t){return t===cl.LEFT?cl.RIGHT:t===cl.RIGHT?cl.LEFT:t},ul.ON.get=function(){return 0},ul.LEFT.get=function(){return 1},ul.RIGHT.get=function(){return 2},Object.defineProperties(cl,ul),hl.prototype=new Error,hl.prototype.name="EmptyStackException",pl.prototype=new Hs,pl.prototype.add=function(t){return this.array_.push(t),!0},pl.prototype.get=function(t){if(t<0||t>=this.size())throw new Error;return this.array_[t]},pl.prototype.push=function(t){return this.array_.push(t),t},pl.prototype.pop=function(t){if(0===this.array_.length)throw new hl;return this.array_.pop()},pl.prototype.peek=function(){if(0===this.array_.length)throw new hl;return this.array_[this.array_.length-1]},pl.prototype.empty=function(){return 0===this.array_.length},pl.prototype.isEmpty=function(){return this.empty()},pl.prototype.search=function(t){return this.array_.indexOf(t)},pl.prototype.size=function(){return this.array_.length},pl.prototype.toArray=function(){for(var t=[],e=0,i=this.array_.length;e<i;e++)t.push(this.array_[e]);return t};var dl=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};dl.prototype.getCoordinate=function(){return this._minCoord},dl.prototype.getRightmostSide=function(t,e){var i=this.getRightmostSideOfSegment(t,e);return i<0&&(i=this.getRightmostSideOfSegment(t,e-1)),i<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),i},dl.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();ws.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],i=t[this._minIndex+1],n=Is.computeOrientation(this._minCoord,i,e),r=!1;(e.y<this._minCoord.y&&i.y<this._minCoord.y&&n===Is.COUNTERCLOCKWISE||e.y>this._minCoord.y&&i.y>this._minCoord.y&&n===Is.CLOCKWISE)&&(r=!0),r&&(this._minIndex=this._minIndex-1)},dl.prototype.getRightmostSideOfSegment=function(t,e){var i=t.getEdge().getCoordinates();if(e<0||e+1>=i.length)return-1;if(i[e].y===i[e+1].y)return-1;var n=cl.LEFT;return i[e].y<i[e+1].y&&(n=cl.RIGHT),n},dl.prototype.getEdge=function(){return this._orientedDe},dl.prototype.checkForRightmostCoordinate=function(t){for(var e=this,i=t.getEdge().getCoordinates(),n=0;n<i.length-1;n++)(null===e._minCoord||i[n].x>e._minCoord.x)&&(e._minDe=t,e._minIndex=n,e._minCoord=i[n])},dl.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},dl.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var i=e.next();i.isForward()&&this.checkForRightmostCoordinate(i)}ws.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===cl.LEFT&&(this._orientedDe=this._minDe.getSym())},dl.prototype.interfaces_=function(){return[]},dl.prototype.getClass=function(){return dl};var fl=function(t){function e(i,n){t.call(this,e.msgWithCoord(i,n)),this.pt=n?new Wo(n):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(t,e){return e?t:t+" [ "+e+" ]"},e}(xs),ml=function(){this.array_=[]};ml.prototype.addLast=function(t){this.array_.push(t)},ml.prototype.removeFirst=function(){return this.array_.shift()},ml.prototype.isEmpty=function(){return 0===this.array_.length};var gl=function(){this._finder=null,this._dirEdgeList=new qs,this._nodes=new qs,this._rightMostCoord=null,this._env=null,this._finder=new dl};gl.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){t.next().setVisited(!1)}},gl.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},gl.prototype.computeNodeDepth=function(t){for(var e=null,i=t.getEdges().iterator();i.hasNext();){var n=i.next();if(n.isVisited()||n.getSym().isVisited()){e=n;break}}if(null===e)throw new fl("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var r=t.getEdges().iterator();r.hasNext();){var o=r.next();o.setVisited(!0),this.copySymDepths(o)}},gl.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(cl.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},gl.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},gl.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(cl.RIGHT)>=1&&e.getDepth(cl.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},gl.prototype.computeDepths=function(t){var e=new na,i=new ml,n=t.getNode();for(i.addLast(n),e.add(n),t.setVisited(!0);!i.isEmpty();){var r=i.removeFirst();e.add(r),this.computeNodeDepth(r);for(var o=r.getEdges().iterator();o.hasNext();){var s=o.next().getSym();if(!s.isVisited()){var a=s.getNode();e.contains(a)||(i.addLast(a),e.add(a))}}}},gl.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},gl.prototype.getEnvelope=function(){if(null===this._env){for(var t=new ds,e=this._dirEdgeList.iterator();e.hasNext();)for(var i=e.next().getEdge().getCoordinates(),n=0;n<i.length-1;n++)t.expandToInclude(i[n]);this._env=t}return this._env},gl.prototype.addReachable=function(t){var e=new pl;for(e.add(t);!e.empty();){var i=e.pop();this.add(i,e)}},gl.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(cl.LEFT,t.getDepth(cl.RIGHT)),e.setDepth(cl.RIGHT,t.getDepth(cl.LEFT))},gl.prototype.add=function(t,e){t.setVisited(!0),this._nodes.add(t);for(var i=t.getEdges().iterator();i.hasNext();){var n=i.next();this._dirEdgeList.add(n);var r=n.getSym().getNode();r.isVisited()||e.push(r)}},gl.prototype.getNodes=function(){return this._nodes},gl.prototype.getDirectedEdges=function(){return this._dirEdgeList},gl.prototype.interfaces_=function(){return[Uo]},gl.prototype.getClass=function(){return gl};var yl=function t(){if(this.location=null,1===arguments.length){if(arguments[0]instanceof Array){var e=arguments[0];this.init(e.length)}else if(Number.isInteger(arguments[0])){var i=arguments[0];this.init(1),this.location[cl.ON]=i}else if(arguments[0]instanceof t){var n=arguments[0];if(this.init(n.location.length),null!==n)for(var r=0;r<this.location.length;r++)this.location[r]=n.location[r]}}else if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];this.init(3),this.location[cl.ON]=o,this.location[cl.LEFT]=s,this.location[cl.RIGHT]=a}};yl.prototype.setAllLocations=function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},yl.prototype.isNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==Yo.NONE)return!1;return!0},yl.prototype.setAllLocationsIfNull=function(t){for(var e=0;e<this.location.length;e++)this.location[e]===Yo.NONE&&(this.location[e]=t)},yl.prototype.isLine=function(){return 1===this.location.length},yl.prototype.merge=function(t){if(t.location.length>this.location.length){var e=new Array(3).fill(null);e[cl.ON]=this.location[cl.ON],e[cl.LEFT]=Yo.NONE,e[cl.RIGHT]=Yo.NONE,this.location=e}for(var i=0;i<this.location.length;i++)this.location[i]===Yo.NONE&&i<t.location.length&&(this.location[i]=t.location[i])},yl.prototype.getLocations=function(){return this.location},yl.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[cl.LEFT];this.location[cl.LEFT]=this.location[cl.RIGHT],this.location[cl.RIGHT]=t},yl.prototype.toString=function(){var t=new ts;return this.location.length>1&&t.append(Yo.toLocationSymbol(this.location[cl.LEFT])),t.append(Yo.toLocationSymbol(this.location[cl.ON])),this.location.length>1&&t.append(Yo.toLocationSymbol(this.location[cl.RIGHT])),t.toString()},yl.prototype.setLocations=function(t,e,i){this.location[cl.ON]=t,this.location[cl.LEFT]=e,this.location[cl.RIGHT]=i},yl.prototype.get=function(t){return t<this.location.length?this.location[t]:Yo.NONE},yl.prototype.isArea=function(){return this.location.length>1},yl.prototype.isAnyNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===Yo.NONE)return!0;return!1},yl.prototype.setLocation=function(){if(1===arguments.length){var t=arguments[0];this.setLocation(cl.ON,t)}else if(2===arguments.length){var e=arguments[0],i=arguments[1];this.location[e]=i}},yl.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(Yo.NONE)},yl.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},yl.prototype.allPositionsEqual=function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},yl.prototype.interfaces_=function(){return[]},yl.prototype.getClass=function(){return yl};var vl=function t(){if(this.elt=new Array(2).fill(null),1===arguments.length){if(Number.isInteger(arguments[0])){var e=arguments[0];this.elt[0]=new yl(e),this.elt[1]=new yl(e)}else if(arguments[0]instanceof t){var i=arguments[0];this.elt[0]=new yl(i.elt[0]),this.elt[1]=new yl(i.elt[1])}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.elt[0]=new yl(Yo.NONE),this.elt[1]=new yl(Yo.NONE),this.elt[n].setLocation(r)}else if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];this.elt[0]=new yl(o,s,a),this.elt[1]=new yl(o,s,a)}else if(4===arguments.length){var l=arguments[0],c=arguments[1],u=arguments[2],h=arguments[3];this.elt[0]=new yl(Yo.NONE,Yo.NONE,Yo.NONE),this.elt[1]=new yl(Yo.NONE,Yo.NONE,Yo.NONE),this.elt[l].setLocations(c,u,h)}};vl.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},vl.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},vl.prototype.isNull=function(t){return this.elt[t].isNull()},vl.prototype.setAllLocationsIfNull=function(){if(1===arguments.length){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(2===arguments.length){var e=arguments[0],i=arguments[1];this.elt[e].setAllLocationsIfNull(i)}},vl.prototype.isLine=function(t){return this.elt[t].isLine()},vl.prototype.merge=function(t){for(var e=this,i=0;i<2;i++)null===e.elt[i]&&null!==t.elt[i]?e.elt[i]=new yl(t.elt[i]):e.elt[i].merge(t.elt[i])},vl.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},vl.prototype.getLocation=function(){if(1===arguments.length){var t=arguments[0];return this.elt[t].get(cl.ON)}if(2===arguments.length){var e=arguments[0],i=arguments[1];return this.elt[e].get(i)}},vl.prototype.toString=function(){var t=new ts;return null!==this.elt[0]&&(t.append("A:"),t.append(this.elt[0].toString())),null!==this.elt[1]&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()},vl.prototype.isArea=function(){if(0===arguments.length)return this.elt[0].isArea()||this.elt[1].isArea();if(1===arguments.length){var t=arguments[0];return this.elt[t].isArea()}},vl.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},vl.prototype.setLocation=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(cl.ON,e)}else if(3===arguments.length){var i=arguments[0],n=arguments[1],r=arguments[2];this.elt[i].setLocation(n,r)}},vl.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},vl.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},vl.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new yl(this.elt[t].location[0]))},vl.prototype.interfaces_=function(){return[]},vl.prototype.getClass=function(){return vl},vl.toLineLabel=function(t){for(var e=new vl(Yo.NONE),i=0;i<2;i++)e.setLocation(i,t.getLocation(i));return e};var _l=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new qs,this._pts=new qs,this._label=new vl(Yo.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new qs,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};_l.prototype.computeRing=function(){if(null!==this._ring)return null;for(var t=new Array(this._pts.size()).fill(null),e=0;e<this._pts.size();e++)t[e]=this._pts.get(e);this._ring=this._geometryFactory.createLinearRing(t),this._isHole=Is.isCCW(this._ring.getCoordinates())},_l.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},_l.prototype.computePoints=function(t){var e=this;this._startDe=t;var i=t,n=!0;do{if(null===i)throw new fl("Found null DirectedEdge");if(i.getEdgeRing()===e)throw new fl("Directed Edge visited twice during ring-building at "+i.getCoordinate());e._edges.add(i);var r=i.getLabel();ws.isTrue(r.isArea()),e.mergeLabel(r),e.addPoints(i.getEdge(),i.isForward(),n),n=!1,e.setEdgeRing(i,e),i=e.getNext(i)}while(i!==this._startDe)},_l.prototype.getLinearRing=function(){return this._ring},_l.prototype.getCoordinate=function(t){return this._pts.get(t)},_l.prototype.computeMaxNodeDegree=function(){var t=this;this._maxNodeDegree=0;var e=this._startDe;do{var i=e.getNode().getEdges().getOutgoingDegree(t);i>t._maxNodeDegree&&(t._maxNodeDegree=i),e=t.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2},_l.prototype.addPoints=function(t,e,i){var n=t.getCoordinates();if(e){var r=1;i&&(r=0);for(var o=r;o<n.length;o++)this._pts.add(n[o])}else{var s=n.length-2;i&&(s=n.length-1);for(var a=s;a>=0;a--)this._pts.add(n[a])}},_l.prototype.isHole=function(){return this._isHole},_l.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},_l.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!Is.isPointInRing(t,e.getCoordinates()))return!1;for(var i=this._holes.iterator();i.hasNext();){if(i.next().containsPoint(t))return!1}return!0},_l.prototype.addHole=function(t){this._holes.add(t)},_l.prototype.isShell=function(){return null===this._shell},_l.prototype.getLabel=function(){return this._label},_l.prototype.getEdges=function(){return this._edges},_l.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},_l.prototype.getShell=function(){return this._shell},_l.prototype.mergeLabel=function(){if(1===arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){var e=arguments[1],i=arguments[0].getLocation(e,cl.RIGHT);if(i===Yo.NONE)return null;if(this._label.getLocation(e)===Yo.NONE)return this._label.setLocation(e,i),null}},_l.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},_l.prototype.toPolygon=function(t){for(var e=new Array(this._holes.size()).fill(null),i=0;i<this._holes.size();i++)e[i]=this._holes.get(i).getLinearRing();return t.createPolygon(this.getLinearRing(),e)},_l.prototype.interfaces_=function(){return[]},_l.prototype.getClass=function(){return _l};var xl=function(t){function e(){var e=arguments[0],i=arguments[1];t.call(this,e,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setEdgeRing=function(t,e){t.setMinEdgeRing(e)},e.prototype.getNext=function(t){return t.getNextMin()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(_l),bl=function(t){function e(){var e=arguments[0],i=arguments[1];t.call(this,e,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildMinimalRings=function(){var t=new qs,e=this._startDe;do{if(null===e.getMinEdgeRing()){var i=new xl(e,this._geometryFactory);t.add(i)}e=e.getNext()}while(e!==this._startDe);return t},e.prototype.setEdgeRing=function(t,e){t.setEdgeRing(e)},e.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var t=this._startDe;do{t.getNode().getEdges().linkMinimalDirectedEdges(this),t=t.getNext()}while(t!==this._startDe)},e.prototype.getNext=function(t){return t.getNext()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(_l),wl=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._label=t}};wl.prototype.setVisited=function(t){this._isVisited=t},wl.prototype.setInResult=function(t){this._isInResult=t},wl.prototype.isCovered=function(){return this._isCovered},wl.prototype.isCoveredSet=function(){return this._isCoveredSet},wl.prototype.setLabel=function(t){this._label=t},wl.prototype.getLabel=function(){return this._label},wl.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},wl.prototype.updateIM=function(t){ws.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},wl.prototype.isInResult=function(){return this._isInResult},wl.prototype.isVisited=function(){return this._isVisited},wl.prototype.interfaces_=function(){return[]},wl.prototype.getClass=function(){return wl};var Al=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var e=arguments[0],i=arguments[1];this._coord=e,this._edges=i,this._label=new vl(0,Yo.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();){if(t.next().getEdge().isInResult())return!0}return!1},e.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(t){t.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(t){},e.prototype.computeMergedLocation=function(t,e){var i=Yo.NONE;if(i=this._label.getLocation(e),!t.isNull(e)){var n=t.getLocation(e);i!==Yo.BOUNDARY&&(i=n)}return i},e.prototype.setLabel=function(){if(2!==arguments.length)return t.prototype.setLabel.apply(this,arguments);var e=arguments[0],i=arguments[1];null===this._label?this._label=new vl(e,i):this._label.setLocation(e,i)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){var t=this;if(arguments[0]instanceof e){var i=arguments[0];this.mergeLabel(i._label)}else if(arguments[0]instanceof vl)for(var n=arguments[0],r=0;r<2;r++){var o=t.computeMergedLocation(n,r);t._label.getLocation(r)===Yo.NONE&&t._label.setLocation(r,o)}},e.prototype.add=function(t){this._edges.insert(t),t.setNode(this)},e.prototype.setLabelBoundary=function(t){if(null===this._label)return null;var e=Yo.NONE;null!==this._label&&(e=this._label.getLocation(t));var i=null;if(e===Yo.BOUNDARY)i=Yo.INTERIOR;else i=Yo.BOUNDARY;this._label.setLocation(t,i)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(wl),El=function(){this.nodeMap=new ua,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};El.prototype.find=function(t){return this.nodeMap.get(t)},El.prototype.addNode=function(){if(arguments[0]instanceof Wo){var t=arguments[0],e=this.nodeMap.get(t);return null===e&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof Al){var i=arguments[0],n=this.nodeMap.get(i.getCoordinate());return null===n?(this.nodeMap.put(i.getCoordinate(),i),i):(n.mergeLabel(i),n)}},El.prototype.print=function(t){for(var e=this.iterator();e.hasNext();){e.next().print(t)}},El.prototype.iterator=function(){return this.nodeMap.values().iterator()},El.prototype.values=function(){return this.nodeMap.values()},El.prototype.getBoundaryNodes=function(t){for(var e=new qs,i=this.iterator();i.hasNext();){var n=i.next();n.getLabel().getLocation(t)===Yo.BOUNDARY&&e.add(n)}return e},El.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},El.prototype.interfaces_=function(){return[]},El.prototype.getClass=function(){return El};var Sl=function(){},Ml={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Sl.prototype.interfaces_=function(){return[]},Sl.prototype.getClass=function(){return Sl},Sl.isNorthern=function(t){return t===Sl.NE||t===Sl.NW},Sl.isOpposite=function(t,e){return t!==e&&2===(t-e+4)%4},Sl.commonHalfPlane=function(t,e){if(t===e)return t;if(2===(t-e+4)%4)return-1;var i=t<e?t:e;return 0===i&&3===(t>e?t:e)?3:i},Sl.isInHalfPlane=function(t,e){return e===Sl.SE?t===Sl.SE||t===Sl.SW:t===e||t===e+1},Sl.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new zo("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Sl.NE:Sl.SE:e>=0?Sl.NW:Sl.SW}if(arguments[0]instanceof Wo&&arguments[1]instanceof Wo){var i=arguments[0],n=arguments[1];if(n.x===i.x&&n.y===i.y)throw new zo("Cannot compute the quadrant for two identical points "+i);return n.x>=i.x?n.y>=i.y?Sl.NE:Sl.SE:n.y>=i.y?Sl.NW:Sl.SW}},Ml.NE.get=function(){return 0},Ml.NW.get=function(){return 1},Ml.SW.get=function(){return 2},Ml.SE.get=function(){return 3},Object.defineProperties(Sl,Ml);var Tl=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,1===arguments.length){var t=arguments[0];this._edge=t}else if(3===arguments.length){var e=arguments[0],i=arguments[1],n=arguments[2];this._edge=e,this.init(i,n),this._label=null}else if(4===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this._edge=r,this.init(o,s),this._label=a}};Tl.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:Is.computeOrientation(t._p0,t._p1,this._p1)},Tl.prototype.getDy=function(){return this._dy},Tl.prototype.getCoordinate=function(){return this._p0},Tl.prototype.setNode=function(t){this._node=t},Tl.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),i=this.getClass().getName(),n=i.lastIndexOf("."),r=i.substring(n+1);t.print(" "+r+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},Tl.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},Tl.prototype.getDirectedCoordinate=function(){return this._p1},Tl.prototype.getDx=function(){return this._dx},Tl.prototype.getLabel=function(){return this._label},Tl.prototype.getEdge=function(){return this._edge},Tl.prototype.getQuadrant=function(){return this._quadrant},Tl.prototype.getNode=function(){return this._node},Tl.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),i=e.lastIndexOf(".");return" "+e.substring(i+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},Tl.prototype.computeLabel=function(t){},Tl.prototype.init=function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=Sl.quadrant(this._dx,this._dy),ws.isTrue(!(0===this._dx&&0===this._dy),"EdgeEnd with identical endpoints found")},Tl.prototype.interfaces_=function(){return[Uo]},Tl.prototype.getClass=function(){return Tl};var Il=function(t){function e(){var e=arguments[0],i=arguments[1];if(t.call(this,e),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=i,i)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var n=e.getNumPoints()-1;this.init(e.getCoordinate(n),e.getCoordinate(n-1))}this.computeDirectedLabel()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getNextMin=function(){return this._nextMin},e.prototype.getDepth=function(t){return this._depth[t]},e.prototype.setVisited=function(t){this._isVisited=t},e.prototype.computeDirectedLabel=function(){this._label=new vl(this._edge.getLabel()),this._isForward||this._label.flip()},e.prototype.getNext=function(){return this._next},e.prototype.setDepth=function(t,e){if(-999!==this._depth[t]&&this._depth[t]!==e)throw new fl("assigned depths do not match",this.getCoordinate());this._depth[t]=e},e.prototype.isInteriorAreaEdge=function(){for(var t=this,e=!0,i=0;i<2;i++)t._label.isArea(i)&&t._label.getLocation(i,cl.LEFT)===Yo.INTERIOR&&t._label.getLocation(i,cl.RIGHT)===Yo.INTERIOR||(e=!1);return e},e.prototype.setNextMin=function(t){this._nextMin=t},e.prototype.print=function(e){t.prototype.print.call(this,e),e.print(" "+this._depth[cl.LEFT]+"/"+this._depth[cl.RIGHT]),e.print(" ("+this.getDepthDelta()+")"),this._isInResult&&e.print(" inResult")},e.prototype.setMinEdgeRing=function(t){this._minEdgeRing=t},e.prototype.isLineEdge=function(){var t=this._label.isLine(0)||this._label.isLine(1),e=!this._label.isArea(0)||this._label.allPositionsEqual(0,Yo.EXTERIOR),i=!this._label.isArea(1)||this._label.allPositionsEqual(1,Yo.EXTERIOR);return t&&e&&i},e.prototype.setEdgeRing=function(t){this._edgeRing=t},e.prototype.getMinEdgeRing=function(){return this._minEdgeRing},e.prototype.getDepthDelta=function(){var t=this._edge.getDepthDelta();return this._isForward||(t=-t),t},e.prototype.setInResult=function(t){this._isInResult=t},e.prototype.getSym=function(){return this._sym},e.prototype.isForward=function(){return this._isForward},e.prototype.getEdge=function(){return this._edge},e.prototype.printEdge=function(t){this.print(t),t.print(" "),this._isForward?this._edge.print(t):this._edge.printReverse(t)},e.prototype.setSym=function(t){this._sym=t},e.prototype.setVisitedEdge=function(t){this.setVisited(t),this._sym.setVisited(t)},e.prototype.setEdgeDepths=function(t,e){var i=this.getEdge().getDepthDelta();this._isForward||(i=-i);var n=1;t===cl.LEFT&&(n=-1);var r=cl.opposite(t),o=e+i*n;this.setDepth(t,e),this.setDepth(r,o)},e.prototype.getEdgeRing=function(){return this._edgeRing},e.prototype.isInResult=function(){return this._isInResult},e.prototype.setNext=function(t){this._next=t},e.prototype.isVisited=function(){return this._isVisited},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.depthFactor=function(t,e){return t===Yo.EXTERIOR&&e===Yo.INTERIOR?1:t===Yo.INTERIOR&&e===Yo.EXTERIOR?-1:0},e}(Tl),Cl=function(){};Cl.prototype.createNode=function(t){return new Al(t,null)},Cl.prototype.interfaces_=function(){return[]},Cl.prototype.getClass=function(){return Cl};var Pl=function(){if(this._edges=new qs,this._nodes=null,this._edgeEndList=new qs,0===arguments.length)this._nodes=new El(new Cl);else if(1===arguments.length){var t=arguments[0];this._nodes=new El(t)}};Pl.prototype.printEdges=function(t){t.println("Edges:");for(var e=0;e<this._edges.size();e++){t.println("edge "+e+":");var i=this._edges.get(e);i.print(t),i.eiList.print(t)}},Pl.prototype.find=function(t){return this._nodes.find(t)},Pl.prototype.addNode=function(){if(arguments[0]instanceof Al){var t=arguments[0];return this._nodes.addNode(t)}if(arguments[0]instanceof Wo){var e=arguments[0];return this._nodes.addNode(e)}},Pl.prototype.getNodeIterator=function(){return this._nodes.iterator()},Pl.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){t.next().getEdges().linkResultDirectedEdges()}},Pl.prototype.debugPrintln=function(t){hs.out.println(t)},Pl.prototype.isBoundaryNode=function(t,e){var i=this._nodes.find(e);if(null===i)return!1;var n=i.getLabel();return null!==n&&n.getLocation(t)===Yo.BOUNDARY},Pl.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();){t.next().getEdges().linkAllDirectedEdges()}},Pl.prototype.matchInSameDirection=function(t,e,i,n){return!!t.equals(i)&&(Is.computeOrientation(t,e,n)===Is.COLLINEAR&&Sl.quadrant(t,e)===Sl.quadrant(i,n))},Pl.prototype.getEdgeEnds=function(){return this._edgeEndList},Pl.prototype.debugPrint=function(t){hs.out.print(t)},Pl.prototype.getEdgeIterator=function(){return this._edges.iterator()},Pl.prototype.findEdgeInSameDirection=function(t,e){for(var i=this,n=0;n<this._edges.size();n++){var r=i._edges.get(n),o=r.getCoordinates();if(i.matchInSameDirection(t,e,o[0],o[1]))return r;if(i.matchInSameDirection(t,e,o[o.length-1],o[o.length-2]))return r}return null},Pl.prototype.insertEdge=function(t){this._edges.add(t)},Pl.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var i=e.next();if(i.getEdge()===t)return i}return null},Pl.prototype.addEdges=function(t){for(var e=this,i=t.iterator();i.hasNext();){var n=i.next();e._edges.add(n);var r=new Il(n,!0),o=new Il(n,!1);r.setSym(o),o.setSym(r),e.add(r),e.add(o)}},Pl.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},Pl.prototype.getNodes=function(){return this._nodes.values()},Pl.prototype.findEdge=function(t,e){for(var i=0;i<this._edges.size();i++){var n=this._edges.get(i),r=n.getCoordinates();if(t.equals(r[0])&&e.equals(r[1]))return n}return null},Pl.prototype.interfaces_=function(){return[]},Pl.prototype.getClass=function(){return Pl},Pl.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();){e.next().getEdges().linkResultDirectedEdges()}};var Ll=function(){this._geometryFactory=null,this._shellList=new qs;var t=arguments[0];this._geometryFactory=t};Ll.prototype.sortShellsAndHoles=function(t,e,i){for(var n=t.iterator();n.hasNext();){var r=n.next();r.isHole()?i.add(r):e.add(r)}},Ll.prototype.computePolygons=function(t){for(var e=new qs,i=t.iterator();i.hasNext();){var n=i.next().toPolygon(this._geometryFactory);e.add(n)}return e},Ll.prototype.placeFreeHoles=function(t,e){for(var i=e.iterator();i.hasNext();){var n=i.next();if(null===n.getShell()){var r=this.findEdgeRingContaining(n,t);if(null===r)throw new fl("unable to assign hole to a shell",n.getCoordinate(0));n.setShell(r)}}},Ll.prototype.buildMinimalEdgeRings=function(t,e,i){for(var n=new qs,r=t.iterator();r.hasNext();){var o=r.next();if(o.getMaxNodeDegree()>2){o.linkDirectedEdgesForMinimalEdgeRings();var s=o.buildMinimalRings(),a=this.findShell(s);null!==a?(this.placePolygonHoles(a,s),e.add(a)):i.addAll(s)}else n.add(o)}return n},Ll.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();){if(e.next().containsPoint(t))return!0}return!1},Ll.prototype.buildMaximalEdgeRings=function(t){for(var e=new qs,i=t.iterator();i.hasNext();){var n=i.next();if(n.isInResult()&&n.getLabel().isArea()&&null===n.getEdgeRing()){var r=new bl(n,this._geometryFactory);e.add(r),r.setInResult()}}return e},Ll.prototype.placePolygonHoles=function(t,e){for(var i=e.iterator();i.hasNext();){var n=i.next();n.isHole()&&n.setShell(t)}},Ll.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Ll.prototype.findEdgeRingContaining=function(t,e){for(var i=t.getLinearRing(),n=i.getEnvelopeInternal(),r=i.getCoordinateN(0),o=null,s=null,a=e.iterator();a.hasNext();){var l=a.next(),c=l.getLinearRing(),u=c.getEnvelopeInternal();null!==o&&(s=o.getLinearRing().getEnvelopeInternal());var h=!1;u.contains(n)&&Is.isPointInRing(r,c.getCoordinates())&&(h=!0),h&&(null===o||s.contains(u))&&(o=l)}return o},Ll.prototype.findShell=function(t){for(var e=0,i=null,n=t.iterator();n.hasNext();){var r=n.next();r.isHole()||(i=r,e++)}return ws.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),i},Ll.prototype.add=function(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0];Pl.linkResultDirectedEdges(arguments[1]);var i=this.buildMaximalEdgeRings(e),n=new qs,r=this.buildMinimalEdgeRings(i,this._shellList,n);this.sortShellsAndHoles(r,this._shellList,n),this.placeFreeHoles(this._shellList,n)}},Ll.prototype.interfaces_=function(){return[]},Ll.prototype.getClass=function(){return Ll};var Dl=function(){};Dl.prototype.getBounds=function(){},Dl.prototype.interfaces_=function(){return[]},Dl.prototype.getClass=function(){return Dl};var Rl=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};Rl.prototype.getItem=function(){return this._item},Rl.prototype.getBounds=function(){return this._bounds},Rl.prototype.interfaces_=function(){return[Dl,Ho]},Rl.prototype.getClass=function(){return Rl};var Ol=function(){this._size=null,this._items=null,this._size=0,this._items=new qs,this._items.add(null)};Ol.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},Ol.prototype.size=function(){return this._size},Ol.prototype.reorder=function(t){for(var e=this,i=null,n=this._items.get(t);2*t<=this._size&&((i=2*t)!==e._size&&e._items.get(i+1).compareTo(e._items.get(i))<0&&i++,e._items.get(i).compareTo(n)<0);t=i)e._items.set(t,e._items.get(i));this._items.set(t,n)},Ol.prototype.clear=function(){this._size=0,this._items.clear()},Ol.prototype.isEmpty=function(){return 0===this._size},Ol.prototype.add=function(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(e/2)))<0;e/=2)this._items.set(e,this._items.get(Math.trunc(e/2)));this._items.set(e,t)},Ol.prototype.interfaces_=function(){return[]},Ol.prototype.getClass=function(){return Ol};var kl=function(){};kl.prototype.visitItem=function(t){},kl.prototype.interfaces_=function(){return[]},kl.prototype.getClass=function(){return kl};var Nl=function(){};Nl.prototype.insert=function(t,e){},Nl.prototype.remove=function(t,e){},Nl.prototype.query=function(){},Nl.prototype.interfaces_=function(){return[]},Nl.prototype.getClass=function(){return Nl};var Bl=function(){if(this._childBoundables=new qs,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}},zl={serialVersionUID:{configurable:!0}};Bl.prototype.getLevel=function(){return this._level},Bl.prototype.size=function(){return this._childBoundables.size()},Bl.prototype.getChildBoundables=function(){return this._childBoundables},Bl.prototype.addChildBoundable=function(t){ws.isTrue(null===this._bounds),this._childBoundables.add(t)},Bl.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Bl.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},Bl.prototype.interfaces_=function(){return[Dl,Ho]},Bl.prototype.getClass=function(){return Bl},zl.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(Bl,zl);var Fl=function(){};Fl.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},Fl.min=function(t){return Fl.sort(t),t.get(0)},Fl.sort=function(t,e){var i=t.toArray();e?ma.sort(i,e):ma.sort(i);for(var n=t.iterator(),r=0,o=i.length;r<o;r++)n.next(),n.set(i[r])},Fl.singletonList=function(t){var e=new qs;return e.add(t),e};var Vl=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],i=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=i,this._distance=this.distance()};Vl.prototype.expandToQueue=function(t,e){var i=Vl.isComposite(this._boundable1),n=Vl.isComposite(this._boundable2);if(i&&n)return Vl.area(this._boundable1)>Vl.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(i)return this.expand(this._boundable1,this._boundable2,t,e),null;if(n)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new zo("neither boundable is composite")},Vl.prototype.isLeaves=function(){return!(Vl.isComposite(this._boundable1)||Vl.isComposite(this._boundable2))},Vl.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},Vl.prototype.expand=function(t,e,i,n){for(var r=t.getChildBoundables().iterator();r.hasNext();){var o=r.next(),s=new Vl(o,e,this._itemDistance);s.getDistance()<n&&i.add(s)}},Vl.prototype.getBoundable=function(t){return 0===t?this._boundable1:this._boundable2},Vl.prototype.getDistance=function(){return this._distance},Vl.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},Vl.prototype.interfaces_=function(){return[Uo]},Vl.prototype.getClass=function(){return Vl},Vl.area=function(t){return t.getBounds().getArea()},Vl.isComposite=function(t){return t instanceof Bl};var Ul=function t(){if(this._root=null,this._built=!1,this._itemBoundables=new qs,this._nodeCapacity=null,0===arguments.length){var e=t.DEFAULT_NODE_CAPACITY;this._nodeCapacity=e}else if(1===arguments.length){var i=arguments[0];ws.isTrue(i>1,"Node capacity must be greater than 1"),this._nodeCapacity=i}},Gl={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Ul.prototype.getNodeCapacity=function(){return this._nodeCapacity},Ul.prototype.lastNode=function(t){return t.get(t.size()-1)},Ul.prototype.size=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var i=e.next();i instanceof Bl?t+=this.size(i):i instanceof Rl&&(t+=1)}return t}},Ul.prototype.removeItem=function(t,e){for(var i=null,n=t.getChildBoundables().iterator();n.hasNext();){var r=n.next();r instanceof Rl&&r.getItem()===e&&(i=r)}return null!==i&&(t.getChildBoundables().remove(i),!0)},Ul.prototype.itemsTree=function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new qs:t}if(1===arguments.length){for(var e=arguments[0],i=new qs,n=e.getChildBoundables().iterator();n.hasNext();){var r=n.next();if(r instanceof Bl){var o=this.itemsTree(r);null!==o&&i.add(o)}else r instanceof Rl?i.add(r.getItem()):ws.shouldNeverReachHere()}return i.size()<=0?null:i}},Ul.prototype.insert=function(t,e){ws.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Rl(t,e))},Ul.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new qs;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var i=arguments[0],n=arguments[1],r=arguments[2];if(ws.isTrue(i>-2),n.getLevel()===i)return r.add(n),null;for(var o=n.getChildBoundables().iterator();o.hasNext();){var s=o.next();s instanceof Bl?this.boundablesAtLevel(i,s,r):(ws.isTrue(s instanceof Rl),-1===i&&r.add(s))}return null}},Ul.prototype.query=function(){var t=this;if(1===arguments.length){var e=arguments[0];this.build();var i=new qs;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.query(e,this._root,i),i}if(2===arguments.length){var n=arguments[0],r=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.query(n,this._root,r)}else if(3===arguments.length)if(Jo(arguments[2],kl)&&arguments[0]instanceof Object&&arguments[1]instanceof Bl)for(var o=arguments[0],s=arguments[2],a=arguments[1].getChildBoundables(),l=0;l<a.size();l++){var c=a.get(l);t.getIntersectsOp().intersects(c.getBounds(),o)&&(c instanceof Bl?t.query(o,c,s):c instanceof Rl?s.visitItem(c.getItem()):ws.shouldNeverReachHere())}else if(Jo(arguments[2],Hs)&&arguments[0]instanceof Object&&arguments[1]instanceof Bl)for(var u=arguments[0],h=arguments[2],p=arguments[1].getChildBoundables(),d=0;d<p.size();d++){var f=p.get(d);t.getIntersectsOp().intersects(f.getBounds(),u)&&(f instanceof Bl?t.query(u,f,h):f instanceof Rl?h.add(f.getItem()):ws.shouldNeverReachHere())}},Ul.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},Ul.prototype.getRoot=function(){return this.build(),this._root},Ul.prototype.remove=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.remove(t,this._root,e)}if(3===arguments.length){var i=arguments[0],n=arguments[1],r=arguments[2],o=this.removeItem(n,r);if(o)return!0;for(var s=null,a=n.getChildBoundables().iterator();a.hasNext();){var l=a.next();if(this.getIntersectsOp().intersects(l.getBounds(),i)&&(l instanceof Bl&&(o=this.remove(i,l,r)))){s=l;break}}return null!==s&&s.getChildBoundables().isEmpty()&&n.getChildBoundables().remove(s),o}},Ul.prototype.createHigherLevels=function(t,e){ws.isTrue(!t.isEmpty());var i=this.createParentBoundables(t,e+1);return 1===i.size()?i.get(0):this.createHigherLevels(i,e+1)},Ul.prototype.depth=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var i=e.next();if(i instanceof Bl){var n=this.depth(i);n>t&&(t=n)}}return t+1}},Ul.prototype.createParentBoundables=function(t,e){var i=this;ws.isTrue(!t.isEmpty());var n=new qs;n.add(this.createNode(e));var r=new qs(t);Fl.sort(r,this.getComparator());for(var o=r.iterator();o.hasNext();){var s=o.next();i.lastNode(n).getChildBoundables().size()===i.getNodeCapacity()&&n.add(i.createNode(e)),i.lastNode(n).addChildBoundable(s)}return n},Ul.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Ul.prototype.interfaces_=function(){return[Ho]},Ul.prototype.getClass=function(){return Ul},Ul.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},Gl.IntersectsOp.get=function(){return jl},Gl.serialVersionUID.get=function(){return-0x35ef64c82d4c5400},Gl.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Ul,Gl);var jl=function(){},Hl=function(){};Hl.prototype.distance=function(t,e){},Hl.prototype.interfaces_=function(){return[]},Hl.prototype.getClass=function(){return Hl};var Wl=function(t){function e(i){i=i||e.DEFAULT_NODE_CAPACITY,t.call(this,i)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return e.prototype.createParentBoundablesFromVerticalSlices=function(t,e){ws.isTrue(t.length>0);for(var i=new qs,n=0;n<t.length;n++)i.addAll(this.createParentBoundablesFromVerticalSlice(t[n],e));return i},e.prototype.createNode=function(t){return new ql(t)},e.prototype.size=function(){return 0===arguments.length?t.prototype.size.call(this):t.prototype.size.apply(this,arguments)},e.prototype.insert=function(){if(2!==arguments.length)return t.prototype.insert.apply(this,arguments);var e=arguments[0],i=arguments[1];if(e.isNull())return null;t.prototype.insert.call(this,e,i)},e.prototype.getIntersectsOp=function(){return e.intersectsOp},e.prototype.verticalSlices=function(t,e){for(var i=Math.trunc(Math.ceil(t.size()/e)),n=new Array(e).fill(null),r=t.iterator(),o=0;o<e;o++){n[o]=new qs;for(var s=0;r.hasNext()&&s<i;){var a=r.next();n[o].add(a),s++}}return n},e.prototype.query=function(){if(1===arguments.length){var e=arguments[0];return t.prototype.query.call(this,e)}if(2===arguments.length){var i=arguments[0],n=arguments[1];t.prototype.query.call(this,i,n)}else if(3===arguments.length)if(Jo(arguments[2],kl)&&arguments[0]instanceof Object&&arguments[1]instanceof Bl){var r=arguments[0],o=arguments[1],s=arguments[2];t.prototype.query.call(this,r,o,s)}else if(Jo(arguments[2],Hs)&&arguments[0]instanceof Object&&arguments[1]instanceof Bl){var a=arguments[0],l=arguments[1],c=arguments[2];t.prototype.query.call(this,a,l,c)}},e.prototype.getComparator=function(){return e.yComparator},e.prototype.createParentBoundablesFromVerticalSlice=function(e,i){return t.prototype.createParentBoundables.call(this,e,i)},e.prototype.remove=function(){if(2===arguments.length){var e=arguments[0],i=arguments[1];return t.prototype.remove.call(this,e,i)}return t.prototype.remove.apply(this,arguments)},e.prototype.depth=function(){return 0===arguments.length?t.prototype.depth.call(this):t.prototype.depth.apply(this,arguments)},e.prototype.createParentBoundables=function(t,i){ws.isTrue(!t.isEmpty());var n=Math.trunc(Math.ceil(t.size()/this.getNodeCapacity())),r=new qs(t);Fl.sort(r,e.xComparator);var o=this.verticalSlices(r,Math.trunc(Math.ceil(Math.sqrt(n))));return this.createParentBoundablesFromVerticalSlices(o,i)},e.prototype.nearestNeighbour=function(){if(1===arguments.length){if(Jo(arguments[0],Hl)){var t=arguments[0],i=new Vl(this.getRoot(),this.getRoot(),t);return this.nearestNeighbour(i)}if(arguments[0]instanceof Vl){var n=arguments[0];return this.nearestNeighbour(n,Fo.POSITIVE_INFINITY)}}else if(2===arguments.length){if(arguments[0]instanceof e&&Jo(arguments[1],Hl)){var r=arguments[0],o=arguments[1],s=new Vl(this.getRoot(),r.getRoot(),o);return this.nearestNeighbour(s)}if(arguments[0]instanceof Vl&&"number"==typeof arguments[1]){var a=arguments[0],l=arguments[1],c=null,u=new Ol;for(u.add(a);!u.isEmpty()&&l>0;){var h=u.poll(),p=h.getDistance();if(p>=l)break;h.isLeaves()?(l=p,c=h):h.expandToQueue(u,l)}return[c.getBoundable(0).getItem(),c.getBoundable(1).getItem()]}}else if(3===arguments.length){var d=arguments[2],f=new Rl(arguments[0],arguments[1]),m=new Vl(this.getRoot(),f,d);return this.nearestNeighbour(m)[0]}},e.prototype.interfaces_=function(){return[Nl,Ho]},e.prototype.getClass=function(){return e},e.centreX=function(t){return e.avg(t.getMinX(),t.getMaxX())},e.avg=function(t,e){return(t+e)/2},e.centreY=function(t){return e.avg(t.getMinY(),t.getMaxY())},i.STRtreeNode.get=function(){return ql},i.serialVersionUID.get=function(){return 0x39920f7d5f261e0},i.xComparator.get=function(){return{interfaces_:function(){return[jo]},compare:function(i,n){return t.compareDoubles(e.centreX(i.getBounds()),e.centreX(n.getBounds()))}}},i.yComparator.get=function(){return{interfaces_:function(){return[jo]},compare:function(i,n){return t.compareDoubles(e.centreY(i.getBounds()),e.centreY(n.getBounds()))}}},i.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},i.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(e,i),e}(Ul),ql=function(t){function e(){var e=arguments[0];t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var i=e.next();null===t?t=new ds(i.getBounds()):t.expandToInclude(i.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Bl),Xl=function(){};Xl.prototype.interfaces_=function(){return[]},Xl.prototype.getClass=function(){return Xl},Xl.relativeSign=function(t,e){return t<e?-1:t>e?1:0},Xl.compare=function(t,e,i){if(e.equals2D(i))return 0;var n=Xl.relativeSign(e.x,i.x),r=Xl.relativeSign(e.y,i.y);switch(t){case 0:return Xl.compareValue(n,r);case 1:return Xl.compareValue(r,n);case 2:return Xl.compareValue(r,-n);case 3:return Xl.compareValue(-n,r);case 4:return Xl.compareValue(-n,-r);case 5:return Xl.compareValue(-r,-n);case 6:return Xl.compareValue(-r,n);case 7:return Xl.compareValue(n,-r)}return ws.shouldNeverReachHere("invalid octant value"),0},Xl.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var Zl=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],i=arguments[2],n=arguments[3];this._segString=t,this.coord=new Wo(e),this.segmentIndex=i,this._segmentOctant=n,this._isInterior=!e.equals2D(t.getCoordinate(i))};Zl.prototype.getCoordinate=function(){return this.coord},Zl.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},Zl.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:Xl.compare(this._segmentOctant,this.coord,e.coord)},Zl.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},Zl.prototype.isInterior=function(){return this._isInterior},Zl.prototype.interfaces_=function(){return[Uo]},Zl.prototype.getClass=function(){return Zl};var Yl=function(){this._nodeMap=new ua,this._edge=null;var t=arguments[0];this._edge=t};Yl.prototype.getSplitCoordinates=function(){var t=new Zs;this.addEndpoints();for(var e=this.iterator(),i=e.next();e.hasNext();){var n=e.next();this.addEdgeCoordinates(i,n,t),i=n}return t.toCoordinateArray()},Yl.prototype.addCollapsedNodes=function(){var t=new qs;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var i=e.next().intValue();this.add(this._edge.getCoordinate(i),i)}},Yl.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){e.next().print(t)}},Yl.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e<this._edge.size()-2;e++){var i=this._edge.getCoordinate(e),n=this._edge.getCoordinate(e+2);i.equals2D(n)&&t.add(new es(e+1))}},Yl.prototype.addEdgeCoordinates=function(t,e,i){var n=this._edge.getCoordinate(e.segmentIndex),r=e.isInterior()||!e.coord.equals2D(n);i.add(new Wo(t.coord),!1);for(var o=t.segmentIndex+1;o<=e.segmentIndex;o++)i.add(this._edge.getCoordinate(o));r&&i.add(new Wo(e.coord))},Yl.prototype.iterator=function(){return this._nodeMap.values().iterator()},Yl.prototype.addSplitEdges=function(t){this.addEndpoints(),this.addCollapsedNodes();for(var e=this.iterator(),i=e.next();e.hasNext();){var n=e.next(),r=this.createSplitEdge(i,n);t.add(r),i=n}},Yl.prototype.findCollapseIndex=function(t,e,i){if(!t.coord.equals2D(e.coord))return!1;var n=e.segmentIndex-t.segmentIndex;return e.isInterior()||n--,1===n&&(i[0]=t.segmentIndex+1,!0)},Yl.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=new Array(1).fill(null),i=this.iterator(),n=i.next();i.hasNext();){var r=i.next();this.findCollapseIndex(n,r,e)&&t.add(new es(e[0])),n=r}},Yl.prototype.getEdge=function(){return this._edge},Yl.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},Yl.prototype.createSplitEdge=function(t,e){var i=e.segmentIndex-t.segmentIndex+2,n=this._edge.getCoordinate(e.segmentIndex),r=e.isInterior()||!e.coord.equals2D(n);r||i--;var o=new Array(i).fill(null),s=0;o[s++]=new Wo(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this._edge.getCoordinate(a);return r&&(o[s]=new Wo(e.coord)),new $l(o,this._edge.getData())},Yl.prototype.add=function(t,e){var i=new Zl(this._edge,t,e,this._edge.getSegmentOctant(e)),n=this._nodeMap.get(i);return null!==n?(ws.isTrue(n.coord.equals2D(t),"Found equal nodes with different coordinates"),n):(this._nodeMap.put(i,i),i)},Yl.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),i=t.get(0).getCoordinate(0);if(!i.equals2D(e[0]))throw new xs("bad split edge start point at "+i);var n=t.get(t.size()-1).getCoordinates(),r=n[n.length-1];if(!r.equals2D(e[e.length-1]))throw new xs("bad split edge end point at "+r)},Yl.prototype.interfaces_=function(){return[]},Yl.prototype.getClass=function(){return Yl};var Ql=function(){};Ql.prototype.interfaces_=function(){return[]},Ql.prototype.getClass=function(){return Ql},Ql.octant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new zo("Cannot compute the octant for point ( "+t+", "+e+" )");var i=Math.abs(t),n=Math.abs(e);return t>=0?e>=0?i>=n?0:1:i>=n?7:6:e>=0?i>=n?3:2:i>=n?4:5}if(arguments[0]instanceof Wo&&arguments[1]instanceof Wo){var r=arguments[0],o=arguments[1],s=o.x-r.x,a=o.y-r.y;if(0===s&&0===a)throw new zo("Cannot compute the octant for two identical points "+r);return Ql.octant(s,a)}};var Jl=function(){};Jl.prototype.getCoordinates=function(){},Jl.prototype.size=function(){},Jl.prototype.getCoordinate=function(t){},Jl.prototype.isClosed=function(){},Jl.prototype.setData=function(t){},Jl.prototype.getData=function(){},Jl.prototype.interfaces_=function(){return[]},Jl.prototype.getClass=function(){return Jl};var Kl=function(){};Kl.prototype.addIntersection=function(t,e){},Kl.prototype.interfaces_=function(){return[Jl]},Kl.prototype.getClass=function(){return Kl};var $l=function(){this._nodeList=new Yl(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};$l.prototype.getCoordinates=function(){return this._pts},$l.prototype.size=function(){return this._pts.length},$l.prototype.getCoordinate=function(t){return this._pts[t]},$l.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},$l.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},$l.prototype.setData=function(t){this._data=t},$l.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:Ql.octant(t,e)},$l.prototype.getData=function(){return this._data},$l.prototype.addIntersection=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var i=arguments[1],n=arguments[3],r=new Wo(arguments[0].getIntersection(n));this.addIntersection(r,i)}},$l.prototype.toString=function(){return _s.toLineString(new qa(this._pts))},$l.prototype.getNodeList=function(){return this._nodeList},$l.prototype.addIntersectionNode=function(t,e){var i=e,n=i+1;if(n<this._pts.length){var r=this._pts[n];t.equals2D(r)&&(i=n)}return this._nodeList.add(t,i)},$l.prototype.addIntersections=function(t,e,i){for(var n=0;n<t.getIntersectionNum();n++)this.addIntersection(t,e,i,n)},$l.prototype.interfaces_=function(){return[Kl]},$l.prototype.getClass=function(){return $l},$l.getNodedSubstrings=function(){if(1===arguments.length){var t=arguments[0],e=new qs;return $l.getNodedSubstrings(t,e),e}if(2===arguments.length)for(var i=arguments[1],n=arguments[0].iterator();n.hasNext();){n.next().getNodeList().addSplitEdges(i)}};var tc=function(){if(this.p0=null,this.p1=null,0===arguments.length)this.p0=new Wo,this.p1=new Wo;else if(1===arguments.length){var t=arguments[0];this.p0=new Wo(t.p0),this.p1=new Wo(t.p1)}else if(2===arguments.length)this.p0=arguments[0],this.p1=arguments[1];else if(4===arguments.length){var e=arguments[0],i=arguments[1],n=arguments[2],r=arguments[3];this.p0=new Wo(e,i),this.p1=new Wo(n,r)}},ec={serialVersionUID:{configurable:!0}};tc.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},tc.prototype.orientationIndex=function(){if(arguments[0]instanceof tc){var t=arguments[0],e=Is.orientationIndex(this.p0,this.p1,t.p0),i=Is.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&i>=0||e<=0&&i<=0?Math.max(e,i):0}if(arguments[0]instanceof Wo){var n=arguments[0];return Is.orientationIndex(this.p0,this.p1,n)}},tc.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},tc.prototype.isVertical=function(){return this.p0.x===this.p1.x},tc.prototype.equals=function(t){if(!(t instanceof tc))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},tc.prototype.intersection=function(t){var e=new Ss;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},tc.prototype.project=function(){if(arguments[0]instanceof Wo){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new Wo(t);var e=this.projectionFactor(t),i=new Wo;return i.x=this.p0.x+e*(this.p1.x-this.p0.x),i.y=this.p0.y+e*(this.p1.y-this.p0.y),i}if(arguments[0]instanceof tc){var n=arguments[0],r=this.projectionFactor(n.p0),o=this.projectionFactor(n.p1);if(r>=1&&o>=1)return null;if(r<=0&&o<=0)return null;var s=this.project(n.p0);r<0&&(s=this.p0),r>1&&(s=this.p1);var a=this.project(n.p1);return o<0&&(a=this.p0),o>1&&(a=this.p1),new tc(s,a)}},tc.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},tc.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},tc.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},tc.prototype.distancePerpendicular=function(t){return Is.distancePointLinePerpendicular(t,this.p0,this.p1)},tc.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},tc.prototype.midPoint=function(){return tc.midPoint(this.p0,this.p1)},tc.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,i=this.p1.y-this.p0.y,n=e*e+i*i;return n<=0?Fo.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*i)/n},tc.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var i=new Array(2).fill(null),n=Fo.MAX_VALUE,r=null,o=this.closestPoint(t.p0);n=o.distance(t.p0),i[0]=o,i[1]=t.p0;var s=this.closestPoint(t.p1);(r=s.distance(t.p1))<n&&(n=r,i[0]=s,i[1]=t.p1);var a=t.closestPoint(this.p0);(r=a.distance(this.p0))<n&&(n=r,i[0]=this.p0,i[1]=a);var l=t.closestPoint(this.p1);return(r=l.distance(this.p1))<n&&(n=r,i[0]=this.p1,i[1]=l),i},tc.prototype.closestPoint=function(t){var e=this.projectionFactor(t);return e>0&&e<1?this.project(t):this.p0.distance(t)<this.p1.distance(t)?this.p0:this.p1},tc.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},tc.prototype.getLength=function(){return this.p0.distance(this.p1)},tc.prototype.compareTo=function(t){var e=t,i=this.p0.compareTo(e.p0);return 0!==i?i:this.p1.compareTo(e.p1)},tc.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},tc.prototype.equalsTopo=function(t){return this.p0.equals(t.p0)&&(this.p1.equals(t.p1)||this.p0.equals(t.p1))&&this.p1.equals(t.p0)},tc.prototype.lineIntersection=function(t){try{return ps.intersection(this.p0,this.p1,t.p0,t.p1)}catch(t){if(!(t instanceof us))throw t}return null},tc.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},tc.prototype.pointAlongOffset=function(t,e){var i=this.p0.x+t*(this.p1.x-this.p0.x),n=this.p0.y+t*(this.p1.y-this.p0.y),r=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,s=Math.sqrt(r*r+o*o),a=0,l=0;if(0!==e){if(s<=0)throw new Error("Cannot compute offset from zero-length line segment");a=e*r/s,l=e*o/s}return new Wo(i-l,n+a)},tc.prototype.setCoordinates=function(){if(1===arguments.length){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(2===arguments.length){var e=arguments[0],i=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=i.x,this.p1.y=i.y}},tc.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||Fo.isNaN(e))&&(e=1),e},tc.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},tc.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},tc.prototype.distance=function(){if(arguments[0]instanceof tc){var t=arguments[0];return Is.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof Wo){var e=arguments[0];return Is.distancePointLine(e,this.p0,this.p1)}},tc.prototype.pointAlong=function(t){var e=new Wo;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},tc.prototype.hashCode=function(){var t=Fo.doubleToLongBits(this.p0.x);t^=31*Fo.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),i=Fo.doubleToLongBits(this.p1.x);return i^=31*Fo.doubleToLongBits(this.p1.y),e^(Math.trunc(i)^Math.trunc(i>>32))},tc.prototype.interfaces_=function(){return[Uo,Ho]},tc.prototype.getClass=function(){return tc},tc.midPoint=function(t,e){return new Wo((t.x+e.x)/2,(t.y+e.y)/2)},ec.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(tc,ec);var ic=function(){this.tempEnv1=new ds,this.tempEnv2=new ds,this._overlapSeg1=new tc,this._overlapSeg2=new tc};ic.prototype.overlap=function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[1],e=arguments[2],i=arguments[3];arguments[0].getLineSegment(t,this._overlapSeg1),e.getLineSegment(i,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},ic.prototype.interfaces_=function(){return[]},ic.prototype.getClass=function(){return ic};var nc=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],i=arguments[2],n=arguments[3];this._pts=t,this._start=e,this._end=i,this._context=n};nc.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},nc.prototype.computeSelect=function(t,e,i,n){var r=this._pts[e],o=this._pts[i];if(n.tempEnv1.init(r,o),i-e==1)return n.select(this,e),null;if(!t.intersects(n.tempEnv1))return null;var s=Math.trunc((e+i)/2);e<s&&this.computeSelect(t,e,s,n),s<i&&this.computeSelect(t,s,i,n)},nc.prototype.getCoordinates=function(){for(var t=new Array(this._end-this._start+1).fill(null),e=0,i=this._start;i<=this._end;i++)t[e++]=this._pts[i];return t},nc.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},nc.prototype.setId=function(t){this._id=t},nc.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},nc.prototype.getEnvelope=function(){if(null===this._env){var t=this._pts[this._start],e=this._pts[this._end];this._env=new ds(t,e)}return this._env},nc.prototype.getEndIndex=function(){return this._end},nc.prototype.getStartIndex=function(){return this._start},nc.prototype.getContext=function(){return this._context},nc.prototype.getId=function(){return this._id},nc.prototype.computeOverlapsInternal=function(t,e,i,n,r,o){var s=this._pts[t],a=this._pts[e],l=i._pts[n],c=i._pts[r];if(e-t==1&&r-n==1)return o.overlap(this,t,i,n),null;if(o.tempEnv1.init(s,a),o.tempEnv2.init(l,c),!o.tempEnv1.intersects(o.tempEnv2))return null;var u=Math.trunc((t+e)/2),h=Math.trunc((n+r)/2);t<u&&(n<h&&this.computeOverlapsInternal(t,u,i,n,h,o),h<r&&this.computeOverlapsInternal(t,u,i,h,r,o)),u<e&&(n<h&&this.computeOverlapsInternal(u,e,i,n,h,o),h<r&&this.computeOverlapsInternal(u,e,i,h,r,o))},nc.prototype.interfaces_=function(){return[]},nc.prototype.getClass=function(){return nc};var rc=function(){};rc.prototype.interfaces_=function(){return[]},rc.prototype.getClass=function(){return rc},rc.getChainStartIndices=function(t){var e=0,i=new qs;i.add(new es(e));do{var n=rc.findChainEnd(t,e);i.add(new es(n)),e=n}while(e<t.length-1);return rc.toIntArray(i)},rc.findChainEnd=function(t,e){for(var i=e;i<t.length-1&&t[i].equals2D(t[i+1]);)i++;if(i>=t.length-1)return t.length-1;for(var n=Sl.quadrant(t[i],t[i+1]),r=e+1;r<t.length;){if(!t[r-1].equals2D(t[r]))if(Sl.quadrant(t[r-1],t[r])!==n)break;r++}return r-1},rc.getChains=function(){if(1===arguments.length)return rc.getChains(arguments[0],null);if(2===arguments.length){for(var t=arguments[0],e=arguments[1],i=new qs,n=rc.getChainStartIndices(t),r=0;r<n.length-1;r++){var o=new nc(t,n[r],n[r+1],e);i.add(o)}return i}},rc.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),i=0;i<e.length;i++)e[i]=t.get(i).intValue();return e};var oc=function(){};oc.prototype.computeNodes=function(t){},oc.prototype.getNodedSubstrings=function(){},oc.prototype.interfaces_=function(){return[]},oc.prototype.getClass=function(){return oc};var sc=function(){if(this._segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}};sc.prototype.setSegmentIntersector=function(t){this._segInt=t},sc.prototype.interfaces_=function(){return[oc]},sc.prototype.getClass=function(){return sc};var ac=function(t){function e(e){e?t.call(this,e):t.call(this),this._monoChains=new qs,this._index=new Wl,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={SegmentOverlapAction:{configurable:!0}};return e.prototype.getMonotoneChains=function(){return this._monoChains},e.prototype.getNodedSubstrings=function(){return $l.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(t){for(var e=this,i=rc.getChains(t.getCoordinates(),t).iterator();i.hasNext();){var n=i.next();n.setId(e._idCounter++),e._index.insert(n.getEnvelope(),n),e._monoChains.add(n)}},e.prototype.computeNodes=function(t){this._nodedSegStrings=t;for(var e=t.iterator();e.hasNext();)this.add(e.next());this.intersectChains()},e.prototype.intersectChains=function(){for(var t=this,e=new lc(this._segInt),i=this._monoChains.iterator();i.hasNext();)for(var n=i.next(),r=t._index.query(n.getEnvelope()).iterator();r.hasNext();){var o=r.next();if(o.getId()>n.getId()&&(n.computeOverlaps(o,e),t._nOverlaps++),t._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},i.SegmentOverlapAction.get=function(){return lc},Object.defineProperties(e,i),e}(sc),lc=function(t){function e(){t.call(this),this._si=null;var e=arguments[0];this._si=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(4!==arguments.length)return t.prototype.overlap.apply(this,arguments);var e=arguments[1],i=arguments[2],n=arguments[3],r=arguments[0].getContext(),o=i.getContext();this._si.processIntersections(r,e,o,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ic),cc=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.setQuadrantSegments(e)}else if(2===arguments.length){var i=arguments[0],n=arguments[1];this.setQuadrantSegments(i),this.setEndCapStyle(n)}else if(4===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.setQuadrantSegments(r),this.setEndCapStyle(o),this.setJoinStyle(s),this.setMitreLimit(a)}},uc={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};cc.prototype.getEndCapStyle=function(){return this._endCapStyle},cc.prototype.isSingleSided=function(){return this._isSingleSided},cc.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=cc.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=cc.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==cc.JOIN_ROUND&&(this._quadrantSegments=cc.DEFAULT_QUADRANT_SEGMENTS)},cc.prototype.getJoinStyle=function(){return this._joinStyle},cc.prototype.setJoinStyle=function(t){this._joinStyle=t},cc.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},cc.prototype.getSimplifyFactor=function(){return this._simplifyFactor},cc.prototype.getQuadrantSegments=function(){return this._quadrantSegments},cc.prototype.setEndCapStyle=function(t){this._endCapStyle=t},cc.prototype.getMitreLimit=function(){return this._mitreLimit},cc.prototype.setMitreLimit=function(t){this._mitreLimit=t},cc.prototype.setSingleSided=function(t){this._isSingleSided=t},cc.prototype.interfaces_=function(){return[]},cc.prototype.getClass=function(){return cc},cc.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},uc.CAP_ROUND.get=function(){return 1},uc.CAP_FLAT.get=function(){return 2},uc.CAP_SQUARE.get=function(){return 3},uc.JOIN_ROUND.get=function(){return 1},uc.JOIN_MITRE.get=function(){return 2},uc.JOIN_BEVEL.get=function(){return 3},uc.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},uc.DEFAULT_MITRE_LIMIT.get=function(){return 5},uc.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(cc,uc);var hc=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=Is.COUNTERCLOCKWISE,this._inputLine=t||null},pc={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};hc.prototype.isDeletable=function(t,e,i,n){var r=this._inputLine[t],o=this._inputLine[e],s=this._inputLine[i];return!!this.isConcave(r,o,s)&&(!!this.isShallow(r,o,s,n)&&this.isShallowSampled(r,o,t,i,n))},hc.prototype.deleteShallowConcavities=function(){for(var t=this,e=1,i=this.findNextNonDeletedIndex(e),n=this.findNextNonDeletedIndex(i),r=!1;n<this._inputLine.length;){var o=!1;t.isDeletable(e,i,n,t._distanceTol)&&(t._isDeleted[i]=hc.DELETE,o=!0,r=!0),e=o?n:i,i=t.findNextNonDeletedIndex(e),n=t.findNextNonDeletedIndex(i)}return r},hc.prototype.isShallowConcavity=function(t,e,i,n){return Is.computeOrientation(t,e,i)===this._angleOrientation&&Is.distancePointLine(e,t,i)<n},hc.prototype.isShallowSampled=function(t,e,i,n,r){var o=Math.trunc((n-i)/hc.NUM_PTS_TO_CHECK);o<=0&&(o=1);for(var s=i;s<n;s+=o)if(!this.isShallow(t,e,this._inputLine[s],r))return!1;return!0},hc.prototype.isConcave=function(t,e,i){var n=Is.computeOrientation(t,e,i)===this._angleOrientation;return n},hc.prototype.simplify=function(t){this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=Is.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var e=!1;do{e=this.deleteShallowConcavities()}while(e);return this.collapseLine()},hc.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===hc.DELETE;)e++;return e},hc.prototype.isShallow=function(t,e,i,n){return Is.distancePointLine(e,t,i)<n},hc.prototype.collapseLine=function(){for(var t=new Zs,e=0;e<this._inputLine.length;e++)this._isDeleted[e]!==hc.DELETE&&t.add(this._inputLine[e]);return t.toCoordinateArray()},hc.prototype.interfaces_=function(){return[]},hc.prototype.getClass=function(){return hc},hc.simplify=function(t,e){return new hc(t).simplify(e)},pc.INIT.get=function(){return 0},pc.DELETE.get=function(){return 1},pc.KEEP.get=function(){return 1},pc.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(hc,pc);var dc=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new qs},fc={COORDINATE_ARRAY_TYPE:{configurable:!0}};dc.prototype.getCoordinates=function(){return this._ptList.toArray(dc.COORDINATE_ARRAY_TYPE)},dc.prototype.setPrecisionModel=function(t){this._precisionModel=t},dc.prototype.addPt=function(t){var e=new Wo(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},dc.prototype.revere=function(){},dc.prototype.addPts=function(t,e){if(e)for(var i=0;i<t.length;i++)this.addPt(t[i]);else for(var n=t.length-1;n>=0;n--)this.addPt(t[n])},dc.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)<this._minimimVertexDistance},dc.prototype.toString=function(){return(new el).createLineString(this.getCoordinates()).toString()},dc.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new Wo(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},dc.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},dc.prototype.interfaces_=function(){return[]},dc.prototype.getClass=function(){return dc},fc.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(dc,fc);var mc=function(){},gc={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};mc.prototype.interfaces_=function(){return[]},mc.prototype.getClass=function(){return mc},mc.toDegrees=function(t){return 180*t/Math.PI},mc.normalize=function(t){for(;t>Math.PI;)t-=mc.PI_TIMES_2;for(;t<=-Math.PI;)t+=mc.PI_TIMES_2;return t},mc.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],i=arguments[1],n=i.x-e.x,r=i.y-e.y;return Math.atan2(r,n)}},mc.isAcute=function(t,e,i){var n=t.x-e.x,r=t.y-e.y;return n*(i.x-e.x)+r*(i.y-e.y)>0},mc.isObtuse=function(t,e,i){var n=t.x-e.x,r=t.y-e.y;return n*(i.x-e.x)+r*(i.y-e.y)<0},mc.interiorAngle=function(t,e,i){var n=mc.angle(e,t),r=mc.angle(e,i);return Math.abs(r-n)},mc.normalizePositive=function(t){if(t<0){for(;t<0;)t+=mc.PI_TIMES_2;t>=mc.PI_TIMES_2&&(t=0)}else{for(;t>=mc.PI_TIMES_2;)t-=mc.PI_TIMES_2;t<0&&(t=0)}return t},mc.angleBetween=function(t,e,i){var n=mc.angle(e,t),r=mc.angle(e,i);return mc.diff(n,r)},mc.diff=function(t,e){var i=null;return(i=t<e?e-t:t-e)>Math.PI&&(i=2*Math.PI-i),i},mc.toRadians=function(t){return t*Math.PI/180},mc.getTurn=function(t,e){var i=Math.sin(e-t);return i>0?mc.COUNTERCLOCKWISE:i<0?mc.CLOCKWISE:mc.NONE},mc.angleBetweenOriented=function(t,e,i){var n=mc.angle(e,t),r=mc.angle(e,i)-n;return r<=-Math.PI?r+mc.PI_TIMES_2:r>Math.PI?r-mc.PI_TIMES_2:r},gc.PI_TIMES_2.get=function(){return 2*Math.PI},gc.PI_OVER_2.get=function(){return Math.PI/2},gc.PI_OVER_4.get=function(){return Math.PI/4},gc.COUNTERCLOCKWISE.get=function(){return Is.COUNTERCLOCKWISE},gc.CLOCKWISE.get=function(){return Is.CLOCKWISE},gc.NONE.get=function(){return Is.COLLINEAR},Object.defineProperties(mc,gc);var yc=function t(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new tc,this._seg1=new tc,this._offset0=new tc,this._offset1=new tc,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],i=arguments[1],n=arguments[2];this._precisionModel=e,this._bufParams=i,this._li=new Ss,this._filletAngleQuantum=Math.PI/2/i.getQuadrantSegments(),i.getQuadrantSegments()>=8&&i.getJoinStyle()===cc.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)},vc={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};yc.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var i=Is.computeOrientation(this._s0,this._s1,this._s2),n=i===Is.CLOCKWISE&&this._side===cl.LEFT||i===Is.COUNTERCLOCKWISE&&this._side===cl.RIGHT;0===i?this.addCollinear(e):n?this.addOutsideTurn(i,e):this.addInsideTurn(i,e)},yc.prototype.addLineEndCap=function(t,e){var i=new tc(t,e),n=new tc;this.computeOffsetSegment(i,cl.LEFT,this._distance,n);var r=new tc;this.computeOffsetSegment(i,cl.RIGHT,this._distance,r);var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o);switch(this._bufParams.getEndCapStyle()){case cc.CAP_ROUND:this._segList.addPt(n.p1),this.addFilletArc(e,a+Math.PI/2,a-Math.PI/2,Is.CLOCKWISE,this._distance),this._segList.addPt(r.p1);break;case cc.CAP_FLAT:this._segList.addPt(n.p1),this._segList.addPt(r.p1);break;case cc.CAP_SQUARE:var l=new Wo;l.x=Math.abs(this._distance)*Math.cos(a),l.y=Math.abs(this._distance)*Math.sin(a);var c=new Wo(n.p1.x+l.x,n.p1.y+l.y),u=new Wo(r.p1.x+l.x,r.p1.y+l.y);this._segList.addPt(c),this._segList.addPt(u)}},yc.prototype.getCoordinates=function(){return this._segList.getCoordinates()},yc.prototype.addMitreJoin=function(t,e,i,n){var r=!0,o=null;try{o=ps.intersection(e.p0,e.p1,i.p0,i.p1),(n<=0?1:o.distance(t)/Math.abs(n))>this._bufParams.getMitreLimit()&&(r=!1)}catch(t){if(!(t instanceof us))throw t;o=new Wo(0,0),r=!1}r?this._segList.addPt(o):this.addLimitedMitreJoin(e,i,n,this._bufParams.getMitreLimit())},yc.prototype.addFilletCorner=function(t,e,i,n,r){var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o),l=i.x-t.x,c=i.y-t.y,u=Math.atan2(c,l);n===Is.CLOCKWISE?a<=u&&(a+=2*Math.PI):a>=u&&(a-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,a,u,n,r),this._segList.addPt(i)},yc.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*yc.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===cc.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===cc.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(e&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,t,this._distance),this._segList.addPt(this._offset1.p0))},yc.prototype.createSquare=function(t){this._segList.addPt(new Wo(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new Wo(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new Wo(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new Wo(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},yc.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},yc.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},yc.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},yc.prototype.initSideSegments=function(t,e,i){this._s1=t,this._s2=e,this._side=i,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,i,this._distance,this._offset1)},yc.prototype.addLimitedMitreJoin=function(t,e,i,n){var r=this._seg0.p1,o=mc.angle(r,this._seg0.p0),s=mc.angleBetweenOriented(this._seg0.p0,r,this._seg1.p1)/2,a=mc.normalize(o+s),l=mc.normalize(a+Math.PI),c=n*i,u=i-c*Math.abs(Math.sin(s)),h=r.x+c*Math.cos(l),p=r.y+c*Math.sin(l),d=new Wo(h,p),f=new tc(r,d),m=f.pointAlongOffset(1,u),g=f.pointAlongOffset(1,-u);this._side===cl.LEFT?(this._segList.addPt(m),this._segList.addPt(g)):(this._segList.addPt(g),this._segList.addPt(m))},yc.prototype.computeOffsetSegment=function(t,e,i,n){var r=e===cl.LEFT?1:-1,o=t.p1.x-t.p0.x,s=t.p1.y-t.p0.y,a=Math.sqrt(o*o+s*s),l=r*i*o/a,c=r*i*s/a;n.p0.x=t.p0.x-c,n.p0.y=t.p0.y+l,n.p1.x=t.p1.x-c,n.p1.y=t.p1.y+l},yc.prototype.addFilletArc=function(t,e,i,n,r){var o=n===Is.CLOCKWISE?-1:1,s=Math.abs(e-i),a=Math.trunc(s/this._filletAngleQuantum+.5);if(a<1)return null;for(var l=s/a,c=0,u=new Wo;c<s;){var h=e+o*c;u.x=t.x+r*Math.cos(h),u.y=t.y+r*Math.sin(h),this._segList.addPt(u),c+=l}},yc.prototype.addInsideTurn=function(t,e){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*yc.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var i=new Wo((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(i);var n=new Wo((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},yc.prototype.createCircle=function(t){var e=new Wo(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},yc.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},yc.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new dc,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*yc.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},yc.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===cc.JOIN_BEVEL||this._bufParams.getJoinStyle()===cc.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,Is.CLOCKWISE,this._distance))},yc.prototype.closeRing=function(){this._segList.closeRing()},yc.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},yc.prototype.interfaces_=function(){return[]},yc.prototype.getClass=function(){return yc},vc.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},vc.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},vc.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},vc.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(yc,vc);var _c=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};_c.prototype.getOffsetCurve=function(t,e){if(this._distance=e,0===e)return null;var i=e<0,n=Math.abs(e),r=this.getSegGen(n);t.length<=1?this.computePointCurve(t[0],r):this.computeOffsetCurve(t,i,r);var o=r.getCoordinates();return i&&Ys.reverse(o),o},_c.prototype.computeSingleSidedBufferCurve=function(t,e,i){var n=this.simplifyTolerance(this._distance);if(e){i.addSegments(t,!0);var r=hc.simplify(t,-n),o=r.length-1;i.initSideSegments(r[o],r[o-1],cl.LEFT),i.addFirstSegment();for(var s=o-2;s>=0;s--)i.addNextSegment(r[s],!0)}else{i.addSegments(t,!1);var a=hc.simplify(t,n),l=a.length-1;i.initSideSegments(a[0],a[1],cl.LEFT),i.addFirstSegment();for(var c=2;c<=l;c++)i.addNextSegment(a[c],!0)}i.addLastSegment(),i.closeRing()},_c.prototype.computeRingBufferCurve=function(t,e,i){var n=this.simplifyTolerance(this._distance);e===cl.RIGHT&&(n=-n);var r=hc.simplify(t,n),o=r.length-1;i.initSideSegments(r[o-1],r[0],e);for(var s=1;s<=o;s++){var a=1!==s;i.addNextSegment(r[s],a)}i.closeRing()},_c.prototype.computeLineBufferCurve=function(t,e){var i=this.simplifyTolerance(this._distance),n=hc.simplify(t,i),r=n.length-1;e.initSideSegments(n[0],n[1],cl.LEFT);for(var o=2;o<=r;o++)e.addNextSegment(n[o],!0);e.addLastSegment(),e.addLineEndCap(n[r-1],n[r]);var s=hc.simplify(t,-i),a=s.length-1;e.initSideSegments(s[a],s[a-1],cl.LEFT);for(var l=a-2;l>=0;l--)e.addNextSegment(s[l],!0);e.addLastSegment(),e.addLineEndCap(s[1],s[0]),e.closeRing()},_c.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case cc.CAP_ROUND:e.createCircle(t);break;case cc.CAP_SQUARE:e.createSquare(t)}},_c.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided())return null;if(0===e)return null;var i=Math.abs(e),n=this.getSegGen(i);if(t.length<=1)this.computePointCurve(t[0],n);else if(this._bufParams.isSingleSided()){var r=e<0;this.computeSingleSidedBufferCurve(t,r,n)}else this.computeLineBufferCurve(t,n);return n.getCoordinates()},_c.prototype.getBufferParameters=function(){return this._bufParams},_c.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},_c.prototype.getRingCurve=function(t,e,i){if(this._distance=i,t.length<=2)return this.getLineCurve(t,i);if(0===i)return _c.copyCoordinates(t);var n=this.getSegGen(i);return this.computeRingBufferCurve(t,e,n),n.getCoordinates()},_c.prototype.computeOffsetCurve=function(t,e,i){var n=this.simplifyTolerance(this._distance);if(e){var r=hc.simplify(t,-n),o=r.length-1;i.initSideSegments(r[o],r[o-1],cl.LEFT),i.addFirstSegment();for(var s=o-2;s>=0;s--)i.addNextSegment(r[s],!0)}else{var a=hc.simplify(t,n),l=a.length-1;i.initSideSegments(a[0],a[1],cl.LEFT),i.addFirstSegment();for(var c=2;c<=l;c++)i.addNextSegment(a[c],!0)}i.addLastSegment()},_c.prototype.getSegGen=function(t){return new yc(this._precisionModel,this._bufParams,t)},_c.prototype.interfaces_=function(){return[]},_c.prototype.getClass=function(){return _c},_c.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),i=0;i<e.length;i++)e[i]=new Wo(t[i]);return e};var xc=function(){this._subgraphs=null,this._seg=new tc,this._cga=new Is;var t=arguments[0];this._subgraphs=t},bc={DepthSegment:{configurable:!0}};xc.prototype.findStabbedSegments=function(){var t=this;if(1===arguments.length){for(var e=arguments[0],i=new qs,n=this._subgraphs.iterator();n.hasNext();){var r=n.next(),o=r.getEnvelope();e.y<o.getMinY()||e.y>o.getMaxY()||t.findStabbedSegments(e,r.getDirectedEdges(),i)}return i}if(3===arguments.length)if(Jo(arguments[2],Hs)&&arguments[0]instanceof Wo&&arguments[1]instanceof Il)for(var s=arguments[0],a=arguments[1],l=arguments[2],c=a.getEdge().getCoordinates(),u=0;u<c.length-1;u++){if(t._seg.p0=c[u],t._seg.p1=c[u+1],t._seg.p0.y>t._seg.p1.y&&t._seg.reverse(),!(Math.max(t._seg.p0.x,t._seg.p1.x)<s.x||t._seg.isHorizontal()||s.y<t._seg.p0.y||s.y>t._seg.p1.y||Is.computeOrientation(t._seg.p0,t._seg.p1,s)===Is.RIGHT)){var h=a.getDepth(cl.LEFT);t._seg.p0.equals(c[u])||(h=a.getDepth(cl.RIGHT));var p=new wc(t._seg,h);l.add(p)}}else if(Jo(arguments[2],Hs)&&arguments[0]instanceof Wo&&Jo(arguments[1],Hs))for(var d=arguments[0],f=arguments[2],m=arguments[1].iterator();m.hasNext();){var g=m.next();g.isForward()&&t.findStabbedSegments(d,g,f)}},xc.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:Fl.min(e)._leftDepth},xc.prototype.interfaces_=function(){return[]},xc.prototype.getClass=function(){return xc},bc.DepthSegment.get=function(){return wc},Object.defineProperties(xc,bc);var wc=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new tc(t),this._leftDepth=e};wc.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var i=this._upwardSeg.orientationIndex(e._upwardSeg);return 0!==i||0!==(i=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?i:this._upwardSeg.compareTo(e._upwardSeg)},wc.prototype.compareX=function(t,e){var i=t.p0.compareTo(e.p0);return 0!==i?i:t.p1.compareTo(e.p1)},wc.prototype.toString=function(){return this._upwardSeg.toString()},wc.prototype.interfaces_=function(){return[Uo]},wc.prototype.getClass=function(){return wc};var Ac=function(t,e,i){this.p0=t||null,this.p1=e||null,this.p2=i||null};Ac.prototype.area=function(){return Ac.area(this.p0,this.p1,this.p2)},Ac.prototype.signedArea=function(){return Ac.signedArea(this.p0,this.p1,this.p2)},Ac.prototype.interpolateZ=function(t){if(null===t)throw new zo("Supplied point is null.");return Ac.interpolateZ(t,this.p0,this.p1,this.p2)},Ac.prototype.longestSideLength=function(){return Ac.longestSideLength(this.p0,this.p1,this.p2)},Ac.prototype.isAcute=function(){return Ac.isAcute(this.p0,this.p1,this.p2)},Ac.prototype.circumcentre=function(){return Ac.circumcentre(this.p0,this.p1,this.p2)},Ac.prototype.area3D=function(){return Ac.area3D(this.p0,this.p1,this.p2)},Ac.prototype.centroid=function(){return Ac.centroid(this.p0,this.p1,this.p2)},Ac.prototype.inCentre=function(){return Ac.inCentre(this.p0,this.p1,this.p2)},Ac.prototype.interfaces_=function(){return[]},Ac.prototype.getClass=function(){return Ac},Ac.area=function(t,e,i){return Math.abs(((i.x-t.x)*(e.y-t.y)-(e.x-t.x)*(i.y-t.y))/2)},Ac.signedArea=function(t,e,i){return((i.x-t.x)*(e.y-t.y)-(e.x-t.x)*(i.y-t.y))/2},Ac.det=function(t,e,i,n){return t*n-e*i},Ac.interpolateZ=function(t,e,i,n){var r=e.x,o=e.y,s=i.x-r,a=n.x-r,l=i.y-o,c=n.y-o,u=s*c-a*l,h=t.x-r,p=t.y-o,d=(c*h-a*p)/u,f=(-l*h+s*p)/u;return e.z+d*(i.z-e.z)+f*(n.z-e.z)},Ac.longestSideLength=function(t,e,i){var n=t.distance(e),r=e.distance(i),o=i.distance(t),s=n;return r>s&&(s=r),o>s&&(s=o),s},Ac.isAcute=function(t,e,i){return!!mc.isAcute(t,e,i)&&(!!mc.isAcute(e,i,t)&&!!mc.isAcute(i,t,e))},Ac.circumcentre=function(t,e,i){var n=i.x,r=i.y,o=t.x-n,s=t.y-r,a=e.x-n,l=e.y-r,c=2*Ac.det(o,s,a,l),u=Ac.det(s,o*o+s*s,l,a*a+l*l),h=Ac.det(o,o*o+s*s,a,a*a+l*l);return new Wo(n-u/c,r+h/c)},Ac.perpendicularBisector=function(t,e){var i=e.x-t.x,n=e.y-t.y,r=new ps(t.x+i/2,t.y+n/2,1),o=new ps(t.x-n+i/2,t.y+i+n/2,1);return new ps(r,o)},Ac.angleBisector=function(t,e,i){var n=e.distance(t),r=n/(n+e.distance(i)),o=i.x-t.x,s=i.y-t.y;return new Wo(t.x+r*o,t.y+r*s)},Ac.area3D=function(t,e,i){var n=e.x-t.x,r=e.y-t.y,o=e.z-t.z,s=i.x-t.x,a=i.y-t.y,l=i.z-t.z,c=r*l-o*a,u=o*s-n*l,h=n*a-r*s,p=c*c+u*u+h*h,d=Math.sqrt(p)/2;return d},Ac.centroid=function(t,e,i){var n=(t.x+e.x+i.x)/3,r=(t.y+e.y+i.y)/3;return new Wo(n,r)},Ac.inCentre=function(t,e,i){var n=e.distance(i),r=t.distance(i),o=t.distance(e),s=n+r+o,a=(n*t.x+r*e.x+o*i.x)/s,l=(n*t.y+r*e.y+o*i.y)/s;return new Wo(a,l)};var Ec=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new qs;var t=arguments[0],e=arguments[1],i=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=i};Ec.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),i=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(i,Yo.EXTERIOR,Yo.INTERIOR)},Ec.prototype.addPolygon=function(t){var e=this,i=this._distance,n=cl.LEFT;this._distance<0&&(i=-this._distance,n=cl.RIGHT);var r=t.getExteriorRing(),o=Ys.removeRepeatedPoints(r.getCoordinates());if(this._distance<0&&this.isErodedCompletely(r,this._distance))return null;if(this._distance<=0&&o.length<3)return null;this.addPolygonRing(o,i,n,Yo.EXTERIOR,Yo.INTERIOR);for(var s=0;s<t.getNumInteriorRing();s++){var a=t.getInteriorRingN(s),l=Ys.removeRepeatedPoints(a.getCoordinates());e._distance>0&&e.isErodedCompletely(a,-e._distance)||e.addPolygonRing(l,i,cl.opposite(n),Yo.INTERIOR,Yo.EXTERIOR)}},Ec.prototype.isTriangleErodedCompletely=function(t,e){var i=new Ac(t[0],t[1],t[2]),n=i.inCentre();return Is.distancePointLine(n,i.p0,i.p1)<Math.abs(e)},Ec.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=Ys.removeRepeatedPoints(t.getCoordinates()),i=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(i,Yo.EXTERIOR,Yo.INTERIOR)},Ec.prototype.addCurve=function(t,e,i){if(null===t||t.length<2)return null;var n=new $l(t,new vl(0,Yo.BOUNDARY,e,i));this._curveList.add(n)},Ec.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Ec.prototype.addPolygonRing=function(t,e,i,n,r){if(0===e&&t.length<Fa.MINIMUM_VALID_SIZE)return null;var o=n,s=r;t.length>=Fa.MINIMUM_VALID_SIZE&&Is.isCCW(t)&&(o=r,s=n,i=cl.opposite(i));var a=this._curveBuilder.getRingCurve(t,i,e);this.addCurve(a,o,s)},Ec.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Ba?this.addPolygon(t):t instanceof Ra?this.addLineString(t):t instanceof ka?this.addPoint(t):(t instanceof za||t instanceof ba||t instanceof Va||t instanceof xa)&&this.addCollection(t)},Ec.prototype.isErodedCompletely=function(t,e){var i=t.getCoordinates();if(i.length<4)return e<0;if(4===i.length)return this.isTriangleErodedCompletely(i,e);var n=t.getEnvelopeInternal(),r=Math.min(n.getHeight(),n.getWidth());return e<0&&2*Math.abs(e)>r},Ec.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var i=t.getGeometryN(e);this.add(i)}},Ec.prototype.interfaces_=function(){return[]},Ec.prototype.getClass=function(){return Ec};var Sc=function(){};Sc.prototype.locate=function(t){},Sc.prototype.interfaces_=function(){return[]},Sc.prototype.getClass=function(){return Sc};var Mc=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var t=arguments[0];this._parent=t,this._atStart=!0,this._index=0,this._max=t.getNumGeometries()};Mc.prototype.next=function(){if(this._atStart)return this._atStart=!1,Mc.isAtomic(this._parent)&&this._index++,this._parent;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new Ws;var t=this._parent.getGeometryN(this._index++);return t instanceof xa?(this._subcollectionIterator=new Mc(t),this._subcollectionIterator.next()):t},Mc.prototype.remove=function(){throw new Error(this.getClass().getName())},Mc.prototype.hasNext=function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},Mc.prototype.interfaces_=function(){return[js]},Mc.prototype.getClass=function(){return Mc},Mc.isAtomic=function(t){return!(t instanceof xa)};var Tc=function(){this._geom=null;var t=arguments[0];this._geom=t};Tc.prototype.locate=function(t){return Tc.locate(t,this._geom)},Tc.prototype.interfaces_=function(){return[Sc]},Tc.prototype.getClass=function(){return Tc},Tc.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&Is.isPointInRing(t,e.getCoordinates())},Tc.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var i=e.getExteriorRing();if(!Tc.isPointInRing(t,i))return!1;for(var n=0;n<e.getNumInteriorRing();n++){var r=e.getInteriorRingN(n);if(Tc.isPointInRing(t,r))return!1}return!0},Tc.containsPoint=function(t,e){if(e instanceof Ba)return Tc.containsPointInPolygon(t,e);if(e instanceof xa)for(var i=new Mc(e);i.hasNext();){var n=i.next();if(n!==e&&Tc.containsPoint(t,n))return!0}return!1},Tc.locate=function(t,e){return e.isEmpty()?Yo.EXTERIOR:Tc.containsPoint(t,e)?Yo.INTERIOR:Yo.EXTERIOR};var Ic=function(){this._edgeMap=new ua,this._edgeList=null,this._ptInAreaLocation=[Yo.NONE,Yo.NONE]};Ic.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),i=e-1;return 0===e&&(i=this._edgeList.size()-1),this._edgeList.get(i)},Ic.prototype.propagateSideLabels=function(t){for(var e=Yo.NONE,i=this.iterator();i.hasNext();){var n=i.next().getLabel();n.isArea(t)&&n.getLocation(t,cl.LEFT)!==Yo.NONE&&(e=n.getLocation(t,cl.LEFT))}if(e===Yo.NONE)return null;for(var r=e,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getLabel();if(a.getLocation(t,cl.ON)===Yo.NONE&&a.setLocation(t,cl.ON,r),a.isArea(t)){var l=a.getLocation(t,cl.LEFT),c=a.getLocation(t,cl.RIGHT);if(c!==Yo.NONE){if(c!==r)throw new fl("side location conflict",s.getCoordinate());l===Yo.NONE&&ws.shouldNeverReachHere("found single null side (at "+s.getCoordinate()+")"),r=l}else ws.isTrue(a.getLocation(t,cl.LEFT)===Yo.NONE,"found single null side"),a.setLocation(t,cl.RIGHT,r),a.setLocation(t,cl.LEFT,r)}}},Ic.prototype.getCoordinate=function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},Ic.prototype.print=function(t){hs.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){e.next().print(t)}},Ic.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},Ic.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var i=e.size()-1,n=e.get(i).getLabel().getLocation(t,cl.LEFT);ws.isTrue(n!==Yo.NONE,"Found unlabelled area edge");for(var r=n,o=this.iterator();o.hasNext();){var s=o.next().getLabel();ws.isTrue(s.isArea(t),"Found non-area edge");var a=s.getLocation(t,cl.LEFT),l=s.getLocation(t,cl.RIGHT);if(a===l)return!1;if(l!==r)return!1;r=a}return!0},Ic.prototype.findIndex=function(t){this.iterator();for(var e=0;e<this._edgeList.size();e++){if(this._edgeList.get(e)===t)return e}return-1},Ic.prototype.iterator=function(){return this.getEdges().iterator()},Ic.prototype.getEdges=function(){return null===this._edgeList&&(this._edgeList=new qs(this._edgeMap.values())),this._edgeList},Ic.prototype.getLocation=function(t,e,i){return this._ptInAreaLocation[t]===Yo.NONE&&(this._ptInAreaLocation[t]=Tc.locate(e,i[t].getGeometry())),this._ptInAreaLocation[t]},Ic.prototype.toString=function(){var t=new ts;t.append("EdgeEndStar: "+this.getCoordinate()),t.append("\n");for(var e=this.iterator();e.hasNext();){var i=e.next();t.append(i),t.append("\n")}return t.toString()},Ic.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();){e.next().computeLabel(t)}},Ic.prototype.computeLabelling=function(t){this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var e=[!1,!1],i=this.iterator();i.hasNext();)for(var n=i.next().getLabel(),r=0;r<2;r++)n.isLine(r)&&n.getLocation(r)===Yo.BOUNDARY&&(e[r]=!0);for(var o=this.iterator();o.hasNext();)for(var s=o.next(),a=s.getLabel(),l=0;l<2;l++)if(a.isAnyNull(l)){var c=Yo.NONE;if(e[l])c=Yo.EXTERIOR;else{var u=s.getCoordinate();c=this.getLocation(l,u,t)}a.setAllLocationsIfNull(l,c)}},Ic.prototype.getDegree=function(){return this._edgeMap.size()},Ic.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},Ic.prototype.interfaces_=function(){return[]},Ic.prototype.getClass=function(){return Ic};var Cc=function(t){function e(){t.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.linkResultDirectedEdges=function(){var t=this;this.getResultAreaEdges();for(var e=null,i=null,n=this._SCANNING_FOR_INCOMING,r=0;r<this._resultAreaEdgeList.size();r++){var o=t._resultAreaEdgeList.get(r),s=o.getSym();if(o.getLabel().isArea())switch(null===e&&o.isInResult()&&(e=o),n){case t._SCANNING_FOR_INCOMING:if(!s.isInResult())continue;i=s,n=t._LINKING_TO_OUTGOING;break;case t._LINKING_TO_OUTGOING:if(!o.isInResult())continue;i.setNext(o),n=t._SCANNING_FOR_INCOMING}}if(n===this._LINKING_TO_OUTGOING){if(null===e)throw new fl("no outgoing dirEdge found",this.getCoordinate());ws.isTrue(e.isInResult(),"unable to link last incoming dirEdge"),i.setNext(e)}},e.prototype.insert=function(t){var e=t;this.insertEdgeEnd(e,e)},e.prototype.getRightmostEdge=function(){var t=this.getEdges(),e=t.size();if(e<1)return null;var i=t.get(0);if(1===e)return i;var n=t.get(e-1),r=i.getQuadrant(),o=n.getQuadrant();return Sl.isNorthern(r)&&Sl.isNorthern(o)?i:Sl.isNorthern(r)||Sl.isNorthern(o)?0!==i.getDy()?i:0!==n.getDy()?n:(ws.shouldNeverReachHere("found two horizontal edges incident on node"),null):n},e.prototype.print=function(t){hs.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var i=e.next();t.print("out "),i.print(t),t.println(),t.print("in "),i.getSym().print(t),t.println()}},e.prototype.getResultAreaEdges=function(){if(null!==this._resultAreaEdgeList)return this._resultAreaEdgeList;this._resultAreaEdgeList=new qs;for(var t=this.iterator();t.hasNext();){var e=t.next();(e.isInResult()||e.getSym().isInResult())&&this._resultAreaEdgeList.add(e)}return this._resultAreaEdgeList},e.prototype.updateLabelling=function(t){for(var e=this.iterator();e.hasNext();){var i=e.next().getLabel();i.setAllLocationsIfNull(0,t.getLocation(0)),i.setAllLocationsIfNull(1,t.getLocation(1))}},e.prototype.linkAllDirectedEdges=function(){this.getEdges();for(var t=null,e=null,i=this._edgeList.size()-1;i>=0;i--){var n=this._edgeList.get(i),r=n.getSym();null===e&&(e=r),null!==t&&r.setNext(t),t=n}e.setNext(t)},e.prototype.computeDepths=function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),i=t.getDepth(cl.LEFT),n=t.getDepth(cl.RIGHT),r=this.computeDepths(e+1,this._edgeList.size(),i);if(this.computeDepths(0,e,r)!==n)throw new fl("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[1],s=arguments[2],a=arguments[0];a<o;a++){var l=this._edgeList.get(a);l.setEdgeDepths(cl.RIGHT,s),s=l.getDepth(cl.LEFT)}return s}},e.prototype.mergeSymLabels=function(){for(var t=this.iterator();t.hasNext();){var e=t.next();e.getLabel().merge(e.getSym().getLabel())}},e.prototype.linkMinimalDirectedEdges=function(t){for(var e=this,i=null,n=null,r=this._SCANNING_FOR_INCOMING,o=this._resultAreaEdgeList.size()-1;o>=0;o--){var s=e._resultAreaEdgeList.get(o),a=s.getSym();switch(null===i&&s.getEdgeRing()===t&&(i=s),r){case e._SCANNING_FOR_INCOMING:if(a.getEdgeRing()!==t)continue;n=a,r=e._LINKING_TO_OUTGOING;break;case e._LINKING_TO_OUTGOING:if(s.getEdgeRing()!==t)continue;n.setNextMin(s),r=e._SCANNING_FOR_INCOMING}}r===this._LINKING_TO_OUTGOING&&(ws.isTrue(null!==i,"found null for first outgoing dirEdge"),ws.isTrue(i.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(i))},e.prototype.getOutgoingDegree=function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();){e.next().isInResult()&&t++}return t}if(1===arguments.length){for(var i=arguments[0],n=0,r=this.iterator();r.hasNext();){r.next().getEdgeRing()===i&&n++}return n}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=Yo.NONE,e=this.iterator();e.hasNext();){var i=e.next(),n=i.getSym();if(!i.isLineEdge()){if(i.isInResult()){t=Yo.INTERIOR;break}if(n.isInResult()){t=Yo.EXTERIOR;break}}}if(t===Yo.NONE)return null;for(var r=t,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getSym();s.isLineEdge()?s.getEdge().setCovered(r===Yo.INTERIOR):(s.isInResult()&&(r=Yo.EXTERIOR),a.isInResult()&&(r=Yo.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new vl(Yo.NONE);for(var i=this.iterator();i.hasNext();)for(var n=i.next().getEdge().getLabel(),r=0;r<2;r++){var o=n.getLocation(r);o!==Yo.INTERIOR&&o!==Yo.BOUNDARY||this._label.setLocation(r,Yo.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ic),Pc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(t){return new Al(t,new Cc)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Cl),Lc=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};Lc.prototype.compareTo=function(t){var e=t;return Lc.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},Lc.prototype.interfaces_=function(){return[Uo]},Lc.prototype.getClass=function(){return Lc},Lc.orientation=function(t){return 1===Ys.increasingDirection(t)},Lc.compareOriented=function(t,e,i,n){for(var r=e?1:-1,o=n?1:-1,s=e?t.length:-1,a=n?i.length:-1,l=e?0:t.length-1,c=n?0:i.length-1;;){var u=t[l].compareTo(i[c]);if(0!==u)return u;var h=(l+=r)===s,p=(c+=o)===a;if(h&&!p)return-1;if(!h&&p)return 1;if(h&&p)return 0}};var Dc=function(){this._edges=new qs,this._ocaMap=new ua};Dc.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e<this._edges.size();e++){var i=this._edges.get(e);e>0&&t.print(","),t.print("(");for(var n=i.getCoordinates(),r=0;r<n.length;r++)r>0&&t.print(","),t.print(n[r].x+" "+n[r].y);t.println(")")}t.print(") ")},Dc.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Dc.prototype.findEdgeIndex=function(t){for(var e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return-1},Dc.prototype.iterator=function(){return this._edges.iterator()},Dc.prototype.getEdges=function(){return this._edges},Dc.prototype.get=function(t){return this._edges.get(t)},Dc.prototype.findEqualEdge=function(t){var e=new Lc(t.getCoordinates());return this._ocaMap.get(e)},Dc.prototype.add=function(t){this._edges.add(t);var e=new Lc(t.getCoordinates());this._ocaMap.put(e,t)},Dc.prototype.interfaces_=function(){return[]},Dc.prototype.getClass=function(){return Dc};var Rc=function(){};Rc.prototype.processIntersections=function(t,e,i,n){},Rc.prototype.isDone=function(){},Rc.prototype.interfaces_=function(){return[]},Rc.prototype.getClass=function(){return Rc};var Oc=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var t=arguments[0];this._li=t};Oc.prototype.isTrivialIntersection=function(t,e,i,n){if(t===i&&1===this._li.getIntersectionNum()){if(Oc.isAdjacentSegments(e,n))return!0;if(t.isClosed()){var r=t.size()-1;if(0===e&&n===r||0===n&&e===r)return!0}}return!1},Oc.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Oc.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Oc.prototype.getLineIntersector=function(){return this._li},Oc.prototype.hasProperIntersection=function(){return this._hasProper},Oc.prototype.processIntersections=function(t,e,i,n){if(t===i&&e===n)return null;this.numTests++;var r=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=i.getCoordinates()[n],a=i.getCoordinates()[n+1];this._li.computeIntersection(r,o,s,a),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,i,n)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),i.addIntersections(this._li,n,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},Oc.prototype.hasIntersection=function(){return this._hasIntersection},Oc.prototype.isDone=function(){return!1},Oc.prototype.hasInteriorIntersection=function(){return this._hasInterior},Oc.prototype.interfaces_=function(){return[Rc]},Oc.prototype.getClass=function(){return Oc},Oc.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var kc=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],i=arguments[2];this.coord=new Wo(t),this.segmentIndex=e,this.dist=i};kc.prototype.getSegmentIndex=function(){return this.segmentIndex},kc.prototype.getCoordinate=function(){return this.coord},kc.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},kc.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},kc.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t},kc.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},kc.prototype.getDistance=function(){return this.dist},kc.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},kc.prototype.interfaces_=function(){return[Uo]},kc.prototype.getClass=function(){return kc};var Nc=function(){this._nodeMap=new ua,this.edge=null;var t=arguments[0];this.edge=t};Nc.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){e.next().print(t)}},Nc.prototype.iterator=function(){return this._nodeMap.values().iterator()},Nc.prototype.addSplitEdges=function(t){this.addEndpoints();for(var e=this.iterator(),i=e.next();e.hasNext();){var n=e.next(),r=this.createSplitEdge(i,n);t.add(r),i=n}},Nc.prototype.addEndpoints=function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)},Nc.prototype.createSplitEdge=function(t,e){var i=e.segmentIndex-t.segmentIndex+2,n=this.edge.pts[e.segmentIndex],r=e.dist>0||!e.coord.equals2D(n);r||i--;var o=new Array(i).fill(null),s=0;o[s++]=new Wo(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this.edge.pts[a];return r&&(o[s]=e.coord),new Uc(o,new vl(this.edge._label))},Nc.prototype.add=function(t,e,i){var n=new kc(t,e,i),r=this._nodeMap.get(n);return null!==r?r:(this._nodeMap.put(n,n),n)},Nc.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){if(e.next().coord.equals(t))return!0}return!1},Nc.prototype.interfaces_=function(){return[]},Nc.prototype.getClass=function(){return Nc};var Bc=function(){};Bc.prototype.getChainStartIndices=function(t){var e=0,i=new qs;i.add(new es(e));do{var n=this.findChainEnd(t,e);i.add(new es(n)),e=n}while(e<t.length-1);return Bc.toIntArray(i)},Bc.prototype.findChainEnd=function(t,e){for(var i=Sl.quadrant(t[e],t[e+1]),n=e+1;n<t.length;){if(Sl.quadrant(t[n-1],t[n])!==i)break;n++}return n-1},Bc.prototype.interfaces_=function(){return[]},Bc.prototype.getClass=function(){return Bc},Bc.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),i=0;i<e.length;i++)e[i]=t.get(i).intValue();return e};var zc=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new ds,this.env2=new ds;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Bc;this.startIndex=e.getChainStartIndices(this.pts)};zc.prototype.getCoordinates=function(){return this.pts},zc.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,i=this.pts[this.startIndex[t+1]].x;return e>i?e:i},zc.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,i=this.pts[this.startIndex[t+1]].x;return e<i?e:i},zc.prototype.computeIntersectsForChain=function(){if(4===arguments.length){var t=arguments[0],e=arguments[1],i=arguments[2],n=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[i],e.startIndex[i+1],n)}else if(6===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],l=arguments[4],c=arguments[5],u=this.pts[r],h=this.pts[o],p=s.pts[a],d=s.pts[l];if(o-r==1&&l-a==1)return c.addIntersections(this.e,r,s.e,a),null;if(this.env1.init(u,h),this.env2.init(p,d),!this.env1.intersects(this.env2))return null;var f=Math.trunc((r+o)/2),m=Math.trunc((a+l)/2);r<f&&(a<m&&this.computeIntersectsForChain(r,f,s,a,m,c),m<l&&this.computeIntersectsForChain(r,f,s,m,l,c)),f<o&&(a<m&&this.computeIntersectsForChain(f,o,s,a,m,c),m<l&&this.computeIntersectsForChain(f,o,s,m,l,c))}},zc.prototype.getStartIndexes=function(){return this.startIndex},zc.prototype.computeIntersects=function(t,e){for(var i=0;i<this.startIndex.length-1;i++)for(var n=0;n<t.startIndex.length-1;n++)this.computeIntersectsForChain(i,t,n,e)},zc.prototype.interfaces_=function(){return[]},zc.prototype.getClass=function(){return zc};var Fc=function t(){this._depth=Array(2).fill().map((function(){return Array(3)}));for(var e=0;e<2;e++)for(var i=0;i<3;i++)this._depth[e][i]=t.NULL_VALUE},Vc={NULL_VALUE:{configurable:!0}};Fc.prototype.getDepth=function(t,e){return this._depth[t][e]},Fc.prototype.setDepth=function(t,e,i){this._depth[t][e]=i},Fc.prototype.isNull=function(){if(0===arguments.length){for(var t=0;t<2;t++)for(var e=0;e<3;e++)if(this._depth[t][e]!==Fc.NULL_VALUE)return!1;return!0}if(1===arguments.length){var i=arguments[0];return this._depth[i][1]===Fc.NULL_VALUE}if(2===arguments.length){var n=arguments[0],r=arguments[1];return this._depth[n][r]===Fc.NULL_VALUE}},Fc.prototype.normalize=function(){for(var t=this,e=0;e<2;e++)if(!t.isNull(e)){var i=t._depth[e][1];t._depth[e][2]<i&&(i=t._depth[e][2]),i<0&&(i=0);for(var n=1;n<3;n++){var r=0;t._depth[e][n]>i&&(r=1),t._depth[e][n]=r}}},Fc.prototype.getDelta=function(t){return this._depth[t][cl.RIGHT]-this._depth[t][cl.LEFT]},Fc.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?Yo.EXTERIOR:Yo.INTERIOR},Fc.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},Fc.prototype.add=function(){var t=this;if(1===arguments.length)for(var e=arguments[0],i=0;i<2;i++)for(var n=1;n<3;n++){var r=e.getLocation(i,n);r!==Yo.EXTERIOR&&r!==Yo.INTERIOR||(t.isNull(i,n)?t._depth[i][n]=Fc.depthAtLocation(r):t._depth[i][n]+=Fc.depthAtLocation(r))}else if(3===arguments.length){var o=arguments[0],s=arguments[1];arguments[2]===Yo.INTERIOR&&this._depth[o][s]++}},Fc.prototype.interfaces_=function(){return[]},Fc.prototype.getClass=function(){return Fc},Fc.depthAtLocation=function(t){return t===Yo.EXTERIOR?0:t===Yo.INTERIOR?1:Fc.NULL_VALUE},Vc.NULL_VALUE.get=function(){return-1},Object.defineProperties(Fc,Vc);var Uc=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Nc(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new Fc,this._depthDelta=0,1===arguments.length){var i=arguments[0];e.call(this,i,null)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.pts=n,this._label=r}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new e(t,vl.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(t){this._isIsolated=t},e.prototype.setName=function(t){this._name=t},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var i=t;if(this.pts.length!==i.pts.length)return!1;for(var n=!0,r=!0,o=this.pts.length,s=0;s<this.pts.length;s++)if(this.pts[s].equals2D(i.pts[s])||(n=!1),this.pts[s].equals2D(i.pts[--o])||(r=!1),!n&&!r)return!1;return!0},e.prototype.getCoordinate=function(){if(0===arguments.length)return this.pts.length>0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}},e.prototype.print=function(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(t){e.updateIM(this._label,t)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&(3===this.pts.length&&!!this.pts[0].equals(this.pts[2]))},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},e.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new zc(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new ds;for(var t=0;t<this.pts.length;t++)this._env.expandToInclude(this.pts[t])}return this._env},e.prototype.addIntersection=function(t,e,i,n){var r=new Wo(t.getIntersection(n)),o=e,s=t.getEdgeDistance(i,n),a=o+1;if(a<this.pts.length){var l=this.pts[a];r.equals2D(l)&&(o=a,s=0)}this.eiList.add(r,o,s)},e.prototype.toString=function(){var t=new ts;t.append("edge "+this._name+": "),t.append("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this._label+" "+this._depthDelta),t.toString()},e.prototype.isPointwiseEqual=function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;e<this.pts.length;e++)if(!this.pts[e].equals2D(t.pts[e]))return!1;return!0},e.prototype.setDepthDelta=function(t){this._depthDelta=t},e.prototype.getEdgeIntersectionList=function(){return this.eiList},e.prototype.addIntersections=function(t,e,i){for(var n=0;n<t.getIntersectionNum();n++)this.addIntersection(t,e,i,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.updateIM=function(){if(2!==arguments.length)return t.prototype.updateIM.apply(this,arguments);var e=arguments[0],i=arguments[1];i.setAtLeastIfValid(e.getLocation(0,cl.ON),e.getLocation(1,cl.ON),1),e.isArea()&&(i.setAtLeastIfValid(e.getLocation(0,cl.LEFT),e.getLocation(1,cl.LEFT),2),i.setAtLeastIfValid(e.getLocation(0,cl.RIGHT),e.getLocation(1,cl.RIGHT),2))},e}(wl),Gc=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Dc,this._bufParams=t||null};Gc.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},Gc.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var i=e.getLabel(),n=t.getLabel();e.isPointwiseEqual(t)||(n=new vl(t.getLabel())).flip(),i.merge(n);var r=Gc.depthDelta(n),o=e.getDepthDelta()+r;e.setDepthDelta(o)}else this._edgeList.add(t),t.setDepthDelta(Gc.depthDelta(t.getLabel()))},Gc.prototype.buildSubgraphs=function(t,e){for(var i=new qs,n=t.iterator();n.hasNext();){var r=n.next(),o=r.getRightmostCoordinate(),s=new xc(i).getDepth(o);r.computeDepth(s),r.findResultEdges(),i.add(r),e.add(r.getDirectedEdges(),r.getNodes())}},Gc.prototype.createSubgraphs=function(t){for(var e=new qs,i=t.getNodes().iterator();i.hasNext();){var n=i.next();if(!n.isVisited()){var r=new gl;r.create(n),e.add(r)}}return Fl.sort(e,Fl.reverseOrder()),e},Gc.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},Gc.prototype.getNoder=function(t){if(null!==this._workingNoder)return this._workingNoder;var e=new ac,i=new Ss;return i.setPrecisionModel(t),e.setSegmentIntersector(new Oc(i)),e},Gc.prototype.buffer=function(t,e){var i=this._workingPrecisionModel;null===i&&(i=t.getPrecisionModel()),this._geomFact=t.getFactory();var n=new _c(i,this._bufParams),r=new Ec(t,e,n).getCurves();if(r.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(r,i),this._graph=new Pl(new Pc),this._graph.addEdges(this._edgeList.getEdges());var o=this.createSubgraphs(this._graph),s=new Ll(this._geomFact);this.buildSubgraphs(o,s);var a=s.getPolygons();return a.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(a)},Gc.prototype.computeNodedEdges=function(t,e){var i=this.getNoder(e);i.computeNodes(t);for(var n=i.getNodedSubstrings().iterator();n.hasNext();){var r=n.next(),o=r.getCoordinates();if(2!==o.length||!o[0].equals2D(o[1])){var s=r.getData(),a=new Uc(r.getCoordinates(),new vl(s));this.insertUniqueEdge(a)}}},Gc.prototype.setNoder=function(t){this._workingNoder=t},Gc.prototype.interfaces_=function(){return[]},Gc.prototype.getClass=function(){return Gc},Gc.depthDelta=function(t){var e=t.getLocation(0,cl.LEFT),i=t.getLocation(0,cl.RIGHT);return e===Yo.INTERIOR&&i===Yo.EXTERIOR?1:e===Yo.EXTERIOR&&i===Yo.INTERIOR?-1:0},Gc.convertSegStrings=function(t){for(var e=new el,i=new qs;t.hasNext();){var n=t.next(),r=e.createLineString(n.getCoordinates());i.add(r)}return e.buildGeometry(i)};var jc=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,2===arguments.length){var t=arguments[0],e=arguments[1];this._noder=t,this._scaleFactor=e,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(4===arguments.length){var i=arguments[0],n=arguments[1],r=arguments[2],o=arguments[3];this._noder=i,this._scaleFactor=n,this._offsetX=r,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};jc.prototype.rescale=function(){var t=this;if(Jo(arguments[0],Us))for(var e=arguments[0].iterator();e.hasNext();){var i=e.next();t.rescale(i.getCoordinates())}else if(arguments[0]instanceof Array){for(var n=arguments[0],r=0;r<n.length;r++)n[r].x=n[r].x/t._scaleFactor+t._offsetX,n[r].y=n[r].y/t._scaleFactor+t._offsetY;2===n.length&&n[0].equals2D(n[1])&&hs.out.println(n)}},jc.prototype.scale=function(){var t=this;if(Jo(arguments[0],Us)){for(var e=arguments[0],i=new qs,n=e.iterator();n.hasNext();){var r=n.next();i.add(new $l(t.scale(r.getCoordinates()),r.getData()))}return i}if(arguments[0]instanceof Array){for(var o=arguments[0],s=new Array(o.length).fill(null),a=0;a<o.length;a++)s[a]=new Wo(Math.round((o[a].x-t._offsetX)*t._scaleFactor),Math.round((o[a].y-t._offsetY)*t._scaleFactor),o[a].z);return Ys.removeRepeatedPoints(s)}},jc.prototype.isIntegerPrecision=function(){return 1===this._scaleFactor},jc.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},jc.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},jc.prototype.interfaces_=function(){return[oc]},jc.prototype.getClass=function(){return jc};var Hc=function(){this._li=new Ss,this._segStrings=null;var t=arguments[0];this._segStrings=t},Wc={fact:{configurable:!0}};Hc.prototype.checkEndPtVertexIntersections=function(){var t=this;if(0===arguments.length)for(var e=this._segStrings.iterator();e.hasNext();){var i=e.next().getCoordinates();t.checkEndPtVertexIntersections(i[0],t._segStrings),t.checkEndPtVertexIntersections(i[i.length-1],t._segStrings)}else if(2===arguments.length)for(var n=arguments[0],r=arguments[1].iterator();r.hasNext();)for(var o=r.next().getCoordinates(),s=1;s<o.length-1;s++)if(o[s].equals(n))throw new xs("found endpt/interior pt intersection at index "+s+" :pt "+n)},Hc.prototype.checkInteriorIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();)for(var e=t.next(),i=this._segStrings.iterator();i.hasNext();){var n=i.next();this.checkInteriorIntersections(e,n)}else if(2===arguments.length)for(var r=arguments[0],o=arguments[1],s=r.getCoordinates(),a=o.getCoordinates(),l=0;l<s.length-1;l++)for(var c=0;c<a.length-1;c++)this.checkInteriorIntersections(r,l,o,c);else if(4===arguments.length){var u=arguments[0],h=arguments[1],p=arguments[2],d=arguments[3];if(u===p&&h===d)return null;var f=u.getCoordinates()[h],m=u.getCoordinates()[h+1],g=p.getCoordinates()[d],y=p.getCoordinates()[d+1];if(this._li.computeIntersection(f,m,g,y),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,f,m)||this.hasInteriorIntersection(this._li,g,y)))throw new xs("found non-noded intersection at "+f+"-"+m+" and "+g+"-"+y)}},Hc.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},Hc.prototype.checkCollapses=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next();this.checkCollapses(e)}else if(1===arguments.length)for(var i=arguments[0].getCoordinates(),n=0;n<i.length-2;n++)this.checkCollapse(i[n],i[n+1],i[n+2])},Hc.prototype.hasInteriorIntersection=function(t,e,i){for(var n=0;n<t.getIntersectionNum();n++){var r=t.getIntersection(n);if(!r.equals(e)&&!r.equals(i))return!0}return!1},Hc.prototype.checkCollapse=function(t,e,i){if(t.equals(i))throw new xs("found non-noded collapse at "+Hc.fact.createLineString([t,e,i]))},Hc.prototype.interfaces_=function(){return[]},Hc.prototype.getClass=function(){return Hc},Wc.fact.get=function(){return new el},Object.defineProperties(Hc,Wc);var qc=function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var t=arguments[0],e=arguments[1],i=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=i,e<=0)throw new zo("Scale factor must be non-zero");1!==e&&(this._pt=new Wo(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new Wo,this._p1Scaled=new Wo),this.initCorners(this._pt)},Xc={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};qc.prototype.intersectsScaled=function(t,e){var i=Math.min(t.x,e.x),n=Math.max(t.x,e.x),r=Math.min(t.y,e.y),o=Math.max(t.y,e.y),s=this._maxx<i||this._minx>n||this._maxy<r||this._miny>o;if(s)return!1;var a=this.intersectsToleranceSquare(t,e);return ws.isTrue(!(s&&a),"Found bad envelope test"),a},qc.prototype.initCorners=function(t){var e=.5;this._minx=t.x-e,this._maxx=t.x+e,this._miny=t.y-e,this._maxy=t.y+e,this._corner[0]=new Wo(this._maxx,this._maxy),this._corner[1]=new Wo(this._minx,this._maxy),this._corner[2]=new Wo(this._minx,this._miny),this._corner[3]=new Wo(this._maxx,this._miny)},qc.prototype.intersects=function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},qc.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},qc.prototype.getCoordinate=function(){return this._originalPt},qc.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},qc.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=qc.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new ds(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},qc.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),!!this._li.hasIntersection())))},qc.prototype.intersectsToleranceSquare=function(t,e){var i=!1,n=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),!!this._li.isProper()||(!(!i||!n)||(!!t.equals(this._pt)||!!e.equals(this._pt))))))},qc.prototype.addSnappedNode=function(t,e){var i=t.getCoordinate(e),n=t.getCoordinate(e+1);return!!this.intersects(i,n)&&(t.addIntersection(this.getCoordinate(),e),!0)},qc.prototype.interfaces_=function(){return[]},qc.prototype.getClass=function(){return qc},Xc.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(qc,Xc);var Zc=function(){this.tempEnv1=new ds,this.selectedSegment=new tc};Zc.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[1];arguments[0].getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}},Zc.prototype.interfaces_=function(){return[]},Zc.prototype.getClass=function(){return Zc};var Yc=function(){this._index=null;var t=arguments[0];this._index=t},Qc={HotPixelSnapAction:{configurable:!0}};Yc.prototype.snap=function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],i=arguments[1],n=arguments[2],r=e.getSafeEnvelope(),o=new Jc(e,i,n);return this._index.query(r,{interfaces_:function(){return[kl]},visitItem:function(t){t.select(r,o)}}),o.isNodeAdded()}},Yc.prototype.interfaces_=function(){return[]},Yc.prototype.getClass=function(){return Yc},Qc.HotPixelSnapAction.get=function(){return Jc},Object.defineProperties(Yc,Qc);var Jc=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],i=arguments[1],n=arguments[2];this._hotPixel=e,this._parentEdge=i,this._hotPixelVertexIndex=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(2!==arguments.length)return t.prototype.select.apply(this,arguments);var e=arguments[1],i=arguments[0].getContext();if(null!==this._parentEdge&&i===this._parentEdge&&e===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(i,e)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Zc),Kc=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new qs};Kc.prototype.processIntersections=function(t,e,i,n){if(t===i&&e===n)return null;var r=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=i.getCoordinates()[n],a=i.getCoordinates()[n+1];if(this._li.computeIntersection(r,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var l=0;l<this._li.getIntersectionNum();l++)this._interiorIntersections.add(this._li.getIntersection(l));t.addIntersections(this._li,e,0),i.addIntersections(this._li,n,1)}},Kc.prototype.isDone=function(){return!1},Kc.prototype.getInteriorIntersections=function(){return this._interiorIntersections},Kc.prototype.interfaces_=function(){return[Rc]},Kc.prototype.getClass=function(){return Kc};var $c=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var t=arguments[0];this._pm=t,this._li=new Ss,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};$c.prototype.checkCorrectness=function(t){var e=$l.getNodedSubstrings(t),i=new Hc(e);try{i.checkValid()}catch(t){if(!(t instanceof cs))throw t;t.printStackTrace()}},$c.prototype.getNodedSubstrings=function(){return $l.getNodedSubstrings(this._nodedSegStrings)},$c.prototype.snapRound=function(t,e){var i=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(i),this.computeVertexSnaps(t)},$c.prototype.findInteriorIntersections=function(t,e){var i=new Kc(e);return this._noder.setSegmentIntersector(i),this._noder.computeNodes(t),i.getInteriorIntersections()},$c.prototype.computeVertexSnaps=function(){var t=this;if(Jo(arguments[0],Us))for(var e=arguments[0].iterator();e.hasNext();){var i=e.next();t.computeVertexSnaps(i)}else if(arguments[0]instanceof $l)for(var n=arguments[0],r=n.getCoordinates(),o=0;o<r.length;o++){var s=new qc(r[o],t._scaleFactor,t._li);t._pointSnapper.snap(s,n,o)&&n.addIntersection(r[o],o)}},$c.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new ac,this._pointSnapper=new Yc(this._noder.getIndex()),this.snapRound(t,this._li)},$c.prototype.computeIntersectionSnaps=function(t){for(var e=this,i=t.iterator();i.hasNext();){var n=i.next(),r=new qc(n,e._scaleFactor,e._li);e._pointSnapper.snap(r)}},$c.prototype.interfaces_=function(){return[oc]},$c.prototype.getClass=function(){return $c};var tu=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new cc,this._resultGeometry=null,this._saveException=null,1===arguments.length){var t=arguments[0];this._argGeom=t}else if(2===arguments.length){var e=arguments[0],i=arguments[1];this._argGeom=e,this._bufParams=i}},eu={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};tu.prototype.bufferFixedPrecision=function(t){var e=new jc(new $c(new Ja(1)),t.getScale()),i=new Gc(this._bufParams);i.setWorkingPrecisionModel(t),i.setNoder(e),this._resultGeometry=i.buffer(this._argGeom,this._distance)},tu.prototype.bufferReducedPrecision=function(){var t=this;if(0===arguments.length){for(var e=tu.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof fl))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var i=arguments[0],n=tu.precisionScaleFactor(this._argGeom,this._distance,i),r=new Ja(n);this.bufferFixedPrecision(r)}},tu.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===Ja.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},tu.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},tu.prototype.bufferOriginalPrecision=function(){try{var t=new Gc(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof xs))throw t;this._saveException=t}},tu.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},tu.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},tu.prototype.interfaces_=function(){return[]},tu.prototype.getClass=function(){return tu},tu.bufferOp=function(){if(2===arguments.length){var t=arguments[1];return new tu(arguments[0]).getResultGeometry(t)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof Ls&&"number"==typeof arguments[1]){var e=arguments[1],i=arguments[2],n=new tu(arguments[0]);return n.setQuadrantSegments(i),n.getResultGeometry(e)}if(arguments[2]instanceof cc&&arguments[0]instanceof Ls&&"number"==typeof arguments[1]){var r=arguments[1];return new tu(arguments[0],arguments[2]).getResultGeometry(r)}}else if(4===arguments.length){var o=arguments[1],s=arguments[2],a=arguments[3],l=new tu(arguments[0]);return l.setQuadrantSegments(s),l.setEndCapStyle(a),l.getResultGeometry(o)}},tu.precisionScaleFactor=function(t,e,i){var n=t.getEnvelopeInternal(),r=Ko.max(Math.abs(n.getMaxX()),Math.abs(n.getMaxY()),Math.abs(n.getMinX()),Math.abs(n.getMinY()))+2*(e>0?e:0),o=i-Math.trunc(Math.log(r)/Math.log(10)+1);return Math.pow(10,o)},eu.CAP_ROUND.get=function(){return cc.CAP_ROUND},eu.CAP_BUTT.get=function(){return cc.CAP_FLAT},eu.CAP_FLAT.get=function(){return cc.CAP_FLAT},eu.CAP_SQUARE.get=function(){return cc.CAP_SQUARE},eu.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(tu,eu);var iu=function(){this._pt=[new Wo,new Wo],this._distance=Fo.NaN,this._isNull=!0};iu.prototype.getCoordinates=function(){return this._pt},iu.prototype.getCoordinate=function(t){return this._pt[t]},iu.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],i=arguments[1];if(this._isNull)return this.initialize(e,i),null;var n=e.distance(i);n<this._distance&&this.initialize(e,i,n)}},iu.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(3===arguments.length){var i=arguments[0],n=arguments[1],r=arguments[2];this._pt[0].setCoordinate(i),this._pt[1].setCoordinate(n),this._distance=r,this._isNull=!1}},iu.prototype.getDistance=function(){return this._distance},iu.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],i=arguments[1];if(this._isNull)return this.initialize(e,i),null;var n=e.distance(i);n>this._distance&&this.initialize(e,i,n)}},iu.prototype.interfaces_=function(){return[]},iu.prototype.getClass=function(){return iu};var nu=function(){};nu.prototype.interfaces_=function(){return[]},nu.prototype.getClass=function(){return nu},nu.computeDistance=function(){if(arguments[2]instanceof iu&&arguments[0]instanceof Ra&&arguments[1]instanceof Wo)for(var t=arguments[1],e=arguments[2],i=arguments[0].getCoordinates(),n=new tc,r=0;r<i.length-1;r++){n.setCoordinates(i[r],i[r+1]);var o=n.closestPoint(t);e.setMinimum(o,t)}else if(arguments[2]instanceof iu&&arguments[0]instanceof Ba&&arguments[1]instanceof Wo){var s=arguments[0],a=arguments[1],l=arguments[2];nu.computeDistance(s.getExteriorRing(),a,l);for(var c=0;c<s.getNumInteriorRing();c++)nu.computeDistance(s.getInteriorRingN(c),a,l)}else if(arguments[2]instanceof iu&&arguments[0]instanceof Ls&&arguments[1]instanceof Wo){var u=arguments[0],h=arguments[1],p=arguments[2];if(u instanceof Ra)nu.computeDistance(u,h,p);else if(u instanceof Ba)nu.computeDistance(u,h,p);else if(u instanceof xa)for(var d=u,f=0;f<d.getNumGeometries();f++){var m=d.getGeometryN(f);nu.computeDistance(m,h,p)}else p.setMinimum(u.getCoordinate(),h)}else if(arguments[2]instanceof iu&&arguments[0]instanceof tc&&arguments[1]instanceof Wo){var g=arguments[1],y=arguments[2],v=arguments[0].closestPoint(g);y.setMinimum(v,g)}};var ru=function(t){this._maxPtDist=new iu,this._inputGeom=t||null},ou={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};ru.prototype.computeMaxMidpointDistance=function(t){var e=new au(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},ru.prototype.computeMaxVertexDistance=function(t){var e=new su(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},ru.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},ru.prototype.getDistancePoints=function(){return this._maxPtDist},ru.prototype.interfaces_=function(){return[]},ru.prototype.getClass=function(){return ru},ou.MaxPointDistanceFilter.get=function(){return su},ou.MaxMidpointDistanceFilter.get=function(){return au},Object.defineProperties(ru,ou);var su=function(t){this._maxPtDist=new iu,this._minPtDist=new iu,this._geom=t||null};su.prototype.filter=function(t){this._minPtDist.initialize(),nu.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},su.prototype.getMaxPointDistance=function(){return this._maxPtDist},su.prototype.interfaces_=function(){return[Os]},su.prototype.getClass=function(){return su};var au=function(t){this._maxPtDist=new iu,this._minPtDist=new iu,this._geom=t||null};au.prototype.filter=function(t,e){if(0===e)return null;var i=t.getCoordinate(e-1),n=t.getCoordinate(e),r=new Wo((i.x+n.x)/2,(i.y+n.y)/2);this._minPtDist.initialize(),nu.computeDistance(this._geom,r,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},au.prototype.isDone=function(){return!1},au.prototype.isGeometryChanged=function(){return!1},au.prototype.getMaxPointDistance=function(){return this._maxPtDist},au.prototype.interfaces_=function(){return[_a]},au.prototype.getClass=function(){return au};var lu=function(t){this._comps=t||null};lu.prototype.filter=function(t){t instanceof Ba&&this._comps.add(t)},lu.prototype.interfaces_=function(){return[va]},lu.prototype.getClass=function(){return lu},lu.getPolygons=function(){if(1===arguments.length)return lu.getPolygons(arguments[0],new qs);if(2===arguments.length){var t=arguments[0],e=arguments[1];return t instanceof Ba?e.add(t):t instanceof xa&&t.apply(new lu(e)),e}};var cu=function(){if(this._lines=null,this._isForcedToLineString=!1,1===arguments.length){var t=arguments[0];this._lines=t}else if(2===arguments.length){var e=arguments[0],i=arguments[1];this._lines=e,this._isForcedToLineString=i}};cu.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof Fa){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof Ra&&this._lines.add(t)},cu.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},cu.prototype.interfaces_=function(){return[Ps]},cu.prototype.getClass=function(){return cu},cu.getGeometry=function(){if(1===arguments.length){var t=arguments[0];return t.getFactory().buildGeometry(cu.getLines(t))}if(2===arguments.length){var e=arguments[0],i=arguments[1];return e.getFactory().buildGeometry(cu.getLines(e,i))}},cu.getLines=function(){if(1===arguments.length)return cu.getLines(arguments[0],!1);if(2===arguments.length){if(Jo(arguments[0],Us)&&Jo(arguments[1],Us)){for(var t=arguments[1],e=arguments[0].iterator();e.hasNext();){var i=e.next();cu.getLines(i,t)}return t}if(arguments[0]instanceof Ls&&"boolean"==typeof arguments[1]){var n=arguments[0],r=arguments[1],o=new qs;return n.apply(new cu(o,r)),o}if(arguments[0]instanceof Ls&&Jo(arguments[1],Us)){var s=arguments[0],a=arguments[1];return s instanceof Ra?a.add(s):s.apply(new cu(a)),a}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&Jo(arguments[0],Us)&&Jo(arguments[1],Us)){for(var l=arguments[1],c=arguments[2],u=arguments[0].iterator();u.hasNext();){var h=u.next();cu.getLines(h,l,c)}return l}if("boolean"==typeof arguments[2]&&arguments[0]instanceof Ls&&Jo(arguments[1],Us)){var p=arguments[1],d=arguments[2];return arguments[0].apply(new cu(p,d)),p}}};var uu=function(){if(this._boundaryRule=ks.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];if(null===t)throw new zo("Rule must be non-null");this._boundaryRule=t}};uu.prototype.locateInternal=function(){if(arguments[0]instanceof Wo&&arguments[1]instanceof Ba){var t=arguments[0],e=arguments[1];if(e.isEmpty())return Yo.EXTERIOR;var i=e.getExteriorRing(),n=this.locateInPolygonRing(t,i);if(n===Yo.EXTERIOR)return Yo.EXTERIOR;if(n===Yo.BOUNDARY)return Yo.BOUNDARY;for(var r=0;r<e.getNumInteriorRing();r++){var o=e.getInteriorRingN(r),s=this.locateInPolygonRing(t,o);if(s===Yo.INTERIOR)return Yo.EXTERIOR;if(s===Yo.BOUNDARY)return Yo.BOUNDARY}return Yo.INTERIOR}if(arguments[0]instanceof Wo&&arguments[1]instanceof Ra){var a=arguments[0],l=arguments[1];if(!l.getEnvelopeInternal().intersects(a))return Yo.EXTERIOR;var c=l.getCoordinates();return l.isClosed()||!a.equals(c[0])&&!a.equals(c[c.length-1])?Is.isOnLine(a,c)?Yo.INTERIOR:Yo.EXTERIOR:Yo.BOUNDARY}if(arguments[0]instanceof Wo&&arguments[1]instanceof ka){var u=arguments[0];return arguments[1].getCoordinate().equals2D(u)?Yo.INTERIOR:Yo.EXTERIOR}},uu.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?Is.locatePointInRing(t,e.getCoordinates()):Yo.EXTERIOR},uu.prototype.intersects=function(t,e){return this.locate(t,e)!==Yo.EXTERIOR},uu.prototype.updateLocationInfo=function(t){t===Yo.INTERIOR&&(this._isIn=!0),t===Yo.BOUNDARY&&this._numBoundaries++},uu.prototype.computeLocation=function(t,e){var i=this;if(e instanceof ka&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Ra)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Ba)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof ba)for(var n=e,r=0;r<n.getNumGeometries();r++){var o=n.getGeometryN(r);i.updateLocationInfo(i.locateInternal(t,o))}else if(e instanceof Va)for(var s=e,a=0;a<s.getNumGeometries();a++){var l=s.getGeometryN(a);i.updateLocationInfo(i.locateInternal(t,l))}else if(e instanceof xa)for(var c=new Mc(e);c.hasNext();){var u=c.next();u!==e&&i.computeLocation(t,u)}},uu.prototype.locate=function(t,e){return e.isEmpty()?Yo.EXTERIOR:e instanceof Ra||e instanceof Ba?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?Yo.BOUNDARY:this._numBoundaries>0||this._isIn?Yo.INTERIOR:Yo.EXTERIOR)},uu.prototype.interfaces_=function(){return[]},uu.prototype.getClass=function(){return uu};var hu=function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length)t.call(this,arguments[0],t.INSIDE_AREA,arguments[1]);else if(3===arguments.length){var e=arguments[0],i=arguments[1],n=arguments[2];this._component=e,this._segIndex=i,this._pt=n}},pu={INSIDE_AREA:{configurable:!0}};hu.prototype.isInsideArea=function(){return this._segIndex===hu.INSIDE_AREA},hu.prototype.getCoordinate=function(){return this._pt},hu.prototype.getGeometryComponent=function(){return this._component},hu.prototype.getSegmentIndex=function(){return this._segIndex},hu.prototype.interfaces_=function(){return[]},hu.prototype.getClass=function(){return hu},pu.INSIDE_AREA.get=function(){return-1},Object.defineProperties(hu,pu);var du=function(t){this._pts=t||null};du.prototype.filter=function(t){t instanceof ka&&this._pts.add(t)},du.prototype.interfaces_=function(){return[va]},du.prototype.getClass=function(){return du},du.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof ka?Fl.singletonList(t):du.getPoints(t,new qs)}if(2===arguments.length){var e=arguments[0],i=arguments[1];return e instanceof ka?i.add(e):e instanceof xa&&e.apply(new du(i)),i}};var fu=function(){this._locations=null;var t=arguments[0];this._locations=t};fu.prototype.filter=function(t){(t instanceof ka||t instanceof Ra||t instanceof Ba)&&this._locations.add(new hu(t,0,t.getCoordinate()))},fu.prototype.interfaces_=function(){return[va]},fu.prototype.getClass=function(){return fu},fu.getLocations=function(t){var e=new qs;return t.apply(new fu(e)),e};var mu=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new uu,this._minDistanceLocation=null,this._minDistance=Fo.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(3===arguments.length){var i=arguments[0],n=arguments[1],r=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=i,this._geom[1]=n,this._terminateDistance=r}};mu.prototype.computeContainmentDistance=function(){var t=this;if(0===arguments.length){var e=new Array(2).fill(null);if(this.computeContainmentDistance(0,e),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,e)}else if(2===arguments.length){var i=arguments[0],n=arguments[1],r=1-i,o=lu.getPolygons(this._geom[i]);if(o.size()>0){var s=fu.getLocations(this._geom[r]);if(this.computeContainmentDistance(s,o,n),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[r]=n[0],this._minDistanceLocation[i]=n[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&Jo(arguments[0],Hs)&&Jo(arguments[1],Hs)){for(var a=arguments[0],l=arguments[1],c=arguments[2],u=0;u<a.size();u++)for(var h=a.get(u),p=0;p<l.size();p++)if(t.computeContainmentDistance(h,l.get(p),c),t._minDistance<=t._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof hu&&arguments[1]instanceof Ba){var d=arguments[0],f=arguments[1],m=arguments[2],g=d.getCoordinate();if(Yo.EXTERIOR!==this._ptLocator.locate(g,f))return this._minDistance=0,m[0]=d,m[1]=new hu(f,g),null}},mu.prototype.computeMinDistanceLinesPoints=function(t,e,i){for(var n=this,r=0;r<t.size();r++)for(var o=t.get(r),s=0;s<e.size();s++){var a=e.get(s);if(n.computeMinDistance(o,a,i),n._minDistance<=n._terminateDistance)return null}},mu.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=cu.getLines(this._geom[0]),i=cu.getLines(this._geom[1]),n=du.getPoints(this._geom[0]),r=du.getPoints(this._geom[1]);return this.computeMinDistanceLines(e,i,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,r,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(i,n,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistancePoints(n,r,t),void this.updateMinDistance(t,!1))))},mu.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},mu.prototype.updateMinDistance=function(t,e){if(null===t[0])return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},mu.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},mu.prototype.computeMinDistance=function(){var t=this;if(0===arguments.length){if(null!==this._minDistanceLocation)return null;if(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance)return null;this.computeFacetDistance()}else if(3===arguments.length)if(arguments[2]instanceof Array&&arguments[0]instanceof Ra&&arguments[1]instanceof ka){var e=arguments[0],i=arguments[1],n=arguments[2];if(e.getEnvelopeInternal().distance(i.getEnvelopeInternal())>this._minDistance)return null;for(var r=e.getCoordinates(),o=i.getCoordinate(),s=0;s<r.length-1;s++){var a=Is.distancePointLine(o,r[s],r[s+1]);if(a<t._minDistance){t._minDistance=a;var l=new tc(r[s],r[s+1]).closestPoint(o);n[0]=new hu(e,s,l),n[1]=new hu(i,0,o)}if(t._minDistance<=t._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Ra&&arguments[1]instanceof Ra){var c=arguments[0],u=arguments[1],h=arguments[2];if(c.getEnvelopeInternal().distance(u.getEnvelopeInternal())>this._minDistance)return null;for(var p=c.getCoordinates(),d=u.getCoordinates(),f=0;f<p.length-1;f++)for(var m=0;m<d.length-1;m++){var g=Is.distanceLineLine(p[f],p[f+1],d[m],d[m+1]);if(g<t._minDistance){t._minDistance=g;var y=new tc(p[f],p[f+1]),v=new tc(d[m],d[m+1]),_=y.closestPoints(v);h[0]=new hu(c,f,_[0]),h[1]=new hu(u,m,_[1])}if(t._minDistance<=t._terminateDistance)return null}}},mu.prototype.computeMinDistancePoints=function(t,e,i){for(var n=this,r=0;r<t.size();r++)for(var o=t.get(r),s=0;s<e.size();s++){var a=e.get(s),l=o.getCoordinate().distance(a.getCoordinate());if(l<n._minDistance&&(n._minDistance=l,i[0]=new hu(o,0,o.getCoordinate()),i[1]=new hu(a,0,a.getCoordinate())),n._minDistance<=n._terminateDistance)return null}},mu.prototype.distance=function(){if(null===this._geom[0]||null===this._geom[1])throw new zo("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},mu.prototype.computeMinDistanceLines=function(t,e,i){for(var n=this,r=0;r<t.size();r++)for(var o=t.get(r),s=0;s<e.size();s++){var a=e.get(s);if(n.computeMinDistance(o,a,i),n._minDistance<=n._terminateDistance)return null}},mu.prototype.interfaces_=function(){return[]},mu.prototype.getClass=function(){return mu},mu.distance=function(t,e){return new mu(t,e).distance()},mu.isWithinDistance=function(t,e,i){return new mu(t,e,i).distance()<=i},mu.nearestPoints=function(t,e){return new mu(t,e).nearestPoints()};var gu=function(){this._pt=[new Wo,new Wo],this._distance=Fo.NaN,this._isNull=!0};gu.prototype.getCoordinates=function(){return this._pt},gu.prototype.getCoordinate=function(t){return this._pt[t]},gu.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],i=arguments[1];if(this._isNull)return this.initialize(e,i),null;var n=e.distance(i);n<this._distance&&this.initialize(e,i,n)}},gu.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(3===arguments.length){var i=arguments[0],n=arguments[1],r=arguments[2];this._pt[0].setCoordinate(i),this._pt[1].setCoordinate(n),this._distance=r,this._isNull=!1}},gu.prototype.toString=function(){return _s.toLineString(this._pt[0],this._pt[1])},gu.prototype.getDistance=function(){return this._distance},gu.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],i=arguments[1];if(this._isNull)return this.initialize(e,i),null;var n=e.distance(i);n>this._distance&&this.initialize(e,i,n)}},gu.prototype.interfaces_=function(){return[]},gu.prototype.getClass=function(){return gu};var yu=function(){};yu.prototype.interfaces_=function(){return[]},yu.prototype.getClass=function(){return yu},yu.computeDistance=function(){if(arguments[2]instanceof gu&&arguments[0]instanceof Ra&&arguments[1]instanceof Wo)for(var t=arguments[0],e=arguments[1],i=arguments[2],n=new tc,r=t.getCoordinates(),o=0;o<r.length-1;o++){n.setCoordinates(r[o],r[o+1]);var s=n.closestPoint(e);i.setMinimum(s,e)}else if(arguments[2]instanceof gu&&arguments[0]instanceof Ba&&arguments[1]instanceof Wo){var a=arguments[0],l=arguments[1],c=arguments[2];yu.computeDistance(a.getExteriorRing(),l,c);for(var u=0;u<a.getNumInteriorRing();u++)yu.computeDistance(a.getInteriorRingN(u),l,c)}else if(arguments[2]instanceof gu&&arguments[0]instanceof Ls&&arguments[1]instanceof Wo){var h=arguments[0],p=arguments[1],d=arguments[2];if(h instanceof Ra)yu.computeDistance(h,p,d);else if(h instanceof Ba)yu.computeDistance(h,p,d);else if(h instanceof xa)for(var f=h,m=0;m<f.getNumGeometries();m++){var g=f.getGeometryN(m);yu.computeDistance(g,p,d)}else d.setMinimum(h.getCoordinate(),p)}else if(arguments[2]instanceof gu&&arguments[0]instanceof tc&&arguments[1]instanceof Wo){var y=arguments[1],v=arguments[2],_=arguments[0].closestPoint(y);v.setMinimum(_,y)}};var vu=function(){this._g0=null,this._g1=null,this._ptDist=new gu,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},_u={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};vu.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},vu.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new zo("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},vu.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},vu.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},vu.prototype.computeOrientedDistance=function(t,e,i){var n=new xu(e);if(t.apply(n),i.setMaximum(n.getMaxPointDistance()),this._densifyFrac>0){var r=new bu(e,this._densifyFrac);t.apply(r),i.setMaximum(r.getMaxPointDistance())}},vu.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},vu.prototype.interfaces_=function(){return[]},vu.prototype.getClass=function(){return vu},vu.distance=function(){if(2===arguments.length)return new vu(arguments[0],arguments[1]).distance();if(3===arguments.length){var t=arguments[2],e=new vu(arguments[0],arguments[1]);return e.setDensifyFraction(t),e.distance()}},_u.MaxPointDistanceFilter.get=function(){return xu},_u.MaxDensifiedByFractionDistanceFilter.get=function(){return bu},Object.defineProperties(vu,_u);var xu=function(){this._maxPtDist=new gu,this._minPtDist=new gu,this._euclideanDist=new yu,this._geom=null;var t=arguments[0];this._geom=t};xu.prototype.filter=function(t){this._minPtDist.initialize(),yu.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},xu.prototype.getMaxPointDistance=function(){return this._maxPtDist},xu.prototype.interfaces_=function(){return[Os]},xu.prototype.getClass=function(){return xu};var bu=function(){this._maxPtDist=new gu,this._minPtDist=new gu,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};bu.prototype.filter=function(t,e){var i=this;if(0===e)return null;for(var n=t.getCoordinate(e-1),r=t.getCoordinate(e),o=(r.x-n.x)/this._numSubSegs,s=(r.y-n.y)/this._numSubSegs,a=0;a<this._numSubSegs;a++){var l=n.x+a*o,c=n.y+a*s,u=new Wo(l,c);i._minPtDist.initialize(),yu.computeDistance(i._geom,u,i._minPtDist),i._maxPtDist.setMaximum(i._minPtDist)}},bu.prototype.isDone=function(){return!1},bu.prototype.isGeometryChanged=function(){return!1},bu.prototype.getMaxPointDistance=function(){return this._maxPtDist},bu.prototype.interfaces_=function(){return[_a]},bu.prototype.getClass=function(){return bu};var wu=function(t,e,i){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._bufDistance=e||null,this._result=i||null},Au={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};wu.prototype.checkMaximumDistance=function(t,e,i){var n=new vu(e,t);if(n.setDensifyFraction(.25),this._maxDistanceFound=n.orientedDistance(),this._maxDistanceFound>i){this._isValid=!1;var r=n.getCoordinates();this._errorLocation=r[1],this._errorIndicator=t.getFactory().createLineString(r),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+_s.toLineString(r[0],r[1])+")"}},wu.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=wu.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),wu.VERBOSE&&hs.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},wu.prototype.checkNegativeValid=function(){if(!(this._input instanceof Ba||this._input instanceof Va||this._input instanceof xa))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},wu.prototype.getErrorIndicator=function(){return this._errorIndicator},wu.prototype.checkMinimumDistance=function(t,e,i){var n=new mu(t,e,i);if(this._minDistanceFound=n.distance(),this._minDistanceFound<i){this._isValid=!1;var r=n.nearestPoints();this._errorLocation=n.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(r),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+_s.toLineString(r[0],r[1])+" )"}},wu.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();if(this.checkMinimumDistance(this._input,t,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,t,this._maxValidDistance)},wu.prototype.getErrorLocation=function(){return this._errorLocation},wu.prototype.getPolygonLines=function(t){for(var e=new qs,i=new cu(e),n=lu.getPolygons(t).iterator();n.hasNext();){n.next().apply(i)}return t.getFactory().buildGeometry(e)},wu.prototype.getErrorMessage=function(){return this._errMsg},wu.prototype.interfaces_=function(){return[]},wu.prototype.getClass=function(){return wu},Au.VERBOSE.get=function(){return!1},Au.MAX_DISTANCE_DIFF_FRAC.get=function(){return.012},Object.defineProperties(wu,Au);var Eu=function(t,e,i){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=i||null},Su={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Eu.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},Eu.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Eu.MAX_ENV_DIFF_FRAC;0===t&&(t=.001);var e=new ds(this._input.getEnvelopeInternal());e.expandBy(this._distance);var i=new ds(this._result.getEnvelopeInternal());i.expandBy(t),i.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(i)),this.report("Envelope")},Eu.prototype.checkDistance=function(){var t=new wu(this._input,this._distance,this._result);t.isValid()||(this._isValid=!1,this._errorMsg=t.getErrorMessage(),this._errorLocation=t.getErrorLocation(),this._errorIndicator=t.getErrorIndicator()),this.report("Distance")},Eu.prototype.checkArea=function(){var t=this._input.getArea(),e=this._result.getArea();this._distance>0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t<e&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},Eu.prototype.checkPolygonal=function(){this._result instanceof Ba||this._result instanceof Va||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Eu.prototype.getErrorIndicator=function(){return this._errorIndicator},Eu.prototype.getErrorLocation=function(){return this._errorLocation},Eu.prototype.checkExpectedEmpty=function(){return this._input.getDimension()>=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Eu.prototype.report=function(t){if(!Eu.VERBOSE)return null;hs.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Eu.prototype.getErrorMessage=function(){return this._errorMsg},Eu.prototype.interfaces_=function(){return[]},Eu.prototype.getClass=function(){return Eu},Eu.isValidMsg=function(t,e,i){var n=new Eu(t,e,i);return n.isValid()?null:n.getErrorMessage()},Eu.isValid=function(t,e,i){return!!new Eu(t,e,i).isValid()},Su.VERBOSE.get=function(){return!1},Su.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Eu,Su);var Mu=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Mu.prototype.getCoordinates=function(){return this._pts},Mu.prototype.size=function(){return this._pts.length},Mu.prototype.getCoordinate=function(t){return this._pts[t]},Mu.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Mu.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:Ql.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Mu.prototype.setData=function(t){this._data=t},Mu.prototype.getData=function(){return this._data},Mu.prototype.toString=function(){return _s.toLineString(new qa(this._pts))},Mu.prototype.interfaces_=function(){return[Jl]},Mu.prototype.getClass=function(){return Mu};var Tu=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new qs,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};Tu.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Tu.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},Tu.prototype.getIntersectionSegments=function(){return this._intSegments},Tu.prototype.count=function(){return this._intersectionCount},Tu.prototype.getIntersections=function(){return this._intersections},Tu.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Tu.prototype.setKeepIntersections=function(t){this._keepIntersections=t},Tu.prototype.processIntersections=function(t,e,i,n){if(!this._findAllIntersections&&this.hasIntersection())return null;if(t===i&&e===n)return null;if(this._isCheckEndSegmentsOnly&&!(this.isEndSegment(t,e)||this.isEndSegment(i,n)))return null;var r=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=i.getCoordinates()[n],a=i.getCoordinates()[n+1];this._li.computeIntersection(r,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=r,this._intSegments[1]=o,this._intSegments[2]=s,this._intSegments[3]=a,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Tu.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},Tu.prototype.hasIntersection=function(){return null!==this._interiorIntersection},Tu.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},Tu.prototype.interfaces_=function(){return[Rc]},Tu.prototype.getClass=function(){return Tu},Tu.createAllIntersectionsFinder=function(t){var e=new Tu(t);return e.setFindAllIntersections(!0),e},Tu.createAnyIntersectionFinder=function(t){return new Tu(t)},Tu.createIntersectionCounter=function(t){var e=new Tu(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Iu=function(){this._li=new Ss,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Iu.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},Iu.prototype.getIntersections=function(){return this._segInt.getIntersections()},Iu.prototype.isValid=function(){return this.execute(),this._isValid},Iu.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Iu.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Tu(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new ac;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Iu.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new fl(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Iu.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+_s.toLineString(t[0],t[1])+" and "+_s.toLineString(t[2],t[3])},Iu.prototype.interfaces_=function(){return[]},Iu.prototype.getClass=function(){return Iu},Iu.computeIntersections=function(t){var e=new Iu(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Cu=function t(){this._nv=null;var e=arguments[0];this._nv=new Iu(t.toSegmentStrings(e))};Cu.prototype.checkValid=function(){this._nv.checkValid()},Cu.prototype.interfaces_=function(){return[]},Cu.prototype.getClass=function(){return Cu},Cu.toSegmentStrings=function(t){for(var e=new qs,i=t.iterator();i.hasNext();){var n=i.next();e.add(new Mu(n.getCoordinates(),n))}return e},Cu.checkValid=function(t){new Cu(t).checkValid()};var Pu=function(t){this._mapOp=t};Pu.prototype.map=function(t){for(var e=new qs,i=0;i<t.getNumGeometries();i++){var n=this._mapOp.map(t.getGeometryN(i));n.isEmpty()||e.add(n)}return t.getFactory().createGeometryCollection(el.toGeometryArray(e))},Pu.prototype.interfaces_=function(){return[]},Pu.prototype.getClass=function(){return Pu},Pu.map=function(t,e){return new Pu(e).map(t)};var Lu=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new qs,this._resultLineList=new qs;var t=arguments[0],e=arguments[1],i=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=i};Lu.prototype.collectLines=function(t){for(var e=this,i=this._op.getGraph().getEdgeEnds().iterator();i.hasNext();){var n=i.next();e.collectLineEdge(n,t,e._lineEdgesList),e.collectBoundaryTouchEdge(n,t,e._lineEdgesList)}},Lu.prototype.labelIsolatedLine=function(t,e){var i=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,i)},Lu.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},Lu.prototype.collectLineEdge=function(t,e,i){var n=t.getLabel(),r=t.getEdge();t.isLineEdge()&&(t.isVisited()||!hh.isResultOfOp(n,e)||r.isCovered()||(i.add(r),t.setVisitedEdge(!0)))},Lu.prototype.findCoveredLineEdges=function(){for(var t=this._op.getGraph().getNodes().iterator();t.hasNext();){t.next().getEdges().findCoveredLineEdges()}for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var i=e.next(),n=i.getEdge();if(i.isLineEdge()&&!n.isCoveredSet()){var r=this._op.isCoveredByA(i.getCoordinate());n.setCovered(r)}}},Lu.prototype.labelIsolatedLines=function(t){for(var e=t.iterator();e.hasNext();){var i=e.next(),n=i.getLabel();i.isIsolated()&&(n.isNull(0)?this.labelIsolatedLine(i,0):this.labelIsolatedLine(i,1))}},Lu.prototype.buildLines=function(t){for(var e=this._lineEdgesList.iterator();e.hasNext();){var i=e.next(),n=this._geometryFactory.createLineString(i.getCoordinates());this._resultLineList.add(n),i.setInResult(!0)}},Lu.prototype.collectBoundaryTouchEdge=function(t,e,i){var n=t.getLabel();return t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult()?null:(ws.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void(hh.isResultOfOp(n,e)&&e===hh.INTERSECTION&&(i.add(t.getEdge()),t.setVisitedEdge(!0))))},Lu.prototype.interfaces_=function(){return[]},Lu.prototype.getClass=function(){return Lu};var Du=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new qs;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};Du.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var i=this._geometryFactory.createPoint(e);this._resultPointList.add(i)}},Du.prototype.extractNonCoveredResultNodes=function(t){for(var e=this._op.getGraph().getNodes().iterator();e.hasNext();){var i=e.next();if(!i.isInResult()&&(!i.isIncidentEdgeInResult()&&(0===i.getEdges().getDegree()||t===hh.INTERSECTION))){var n=i.getLabel();hh.isResultOfOp(n,t)&&this.filterCoveredNodeToPoint(i)}}},Du.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Du.prototype.interfaces_=function(){return[]},Du.prototype.getClass=function(){return Du};var Ru=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};Ru.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Ru.prototype.transformPolygon=function(t,e){var i=!0,n=this.transformLinearRing(t.getExteriorRing(),t);null!==n&&n instanceof Fa&&!n.isEmpty()||(i=!1);for(var r=new qs,o=0;o<t.getNumInteriorRing();o++){var s=this.transformLinearRing(t.getInteriorRingN(o),t);null===s||s.isEmpty()||(s instanceof Fa||(i=!1),r.add(s))}if(i)return this._factory.createPolygon(n,r.toArray([]));var a=new qs;return null!==n&&a.add(n),a.addAll(r),this._factory.buildGeometry(a)},Ru.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Ru.prototype.getInputGeometry=function(){return this._inputGeom},Ru.prototype.transformMultiLineString=function(t,e){for(var i=new qs,n=0;n<t.getNumGeometries();n++){var r=this.transformLineString(t.getGeometryN(n),t);null!==r&&(r.isEmpty()||i.add(r))}return this._factory.buildGeometry(i)},Ru.prototype.transformCoordinates=function(t,e){return this.copy(t)},Ru.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Ru.prototype.transformMultiPoint=function(t,e){for(var i=new qs,n=0;n<t.getNumGeometries();n++){var r=this.transformPoint(t.getGeometryN(n),t);null!==r&&(r.isEmpty()||i.add(r))}return this._factory.buildGeometry(i)},Ru.prototype.transformMultiPolygon=function(t,e){for(var i=new qs,n=0;n<t.getNumGeometries();n++){var r=this.transformPolygon(t.getGeometryN(n),t);null!==r&&(r.isEmpty()||i.add(r))}return this._factory.buildGeometry(i)},Ru.prototype.copy=function(t){return t.copy()},Ru.prototype.transformGeometryCollection=function(t,e){for(var i=new qs,n=0;n<t.getNumGeometries();n++){var r=this.transform(t.getGeometryN(n));null!==r&&(this._pruneEmptyGeometry&&r.isEmpty()||i.add(r))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(el.toGeometryArray(i)):this._factory.buildGeometry(i)},Ru.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof ka)return this.transformPoint(t,null);if(t instanceof za)return this.transformMultiPoint(t,null);if(t instanceof Fa)return this.transformLinearRing(t,null);if(t instanceof Ra)return this.transformLineString(t,null);if(t instanceof ba)return this.transformMultiLineString(t,null);if(t instanceof Ba)return this.transformPolygon(t,null);if(t instanceof Va)return this.transformMultiPolygon(t,null);if(t instanceof xa)return this.transformGeometryCollection(t,null);throw new zo("Unknown Geometry subtype: "+t.getClass().getName())},Ru.prototype.transformLinearRing=function(t,e){var i=this.transformCoordinates(t.getCoordinateSequence(),t);if(null===i)return this._factory.createLinearRing(null);var n=i.size();return n>0&&n<4&&!this._preserveType?this._factory.createLineString(i):this._factory.createLinearRing(i)},Ru.prototype.interfaces_=function(){return[]},Ru.prototype.getClass=function(){return Ru};var Ou=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new tc,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Ra&&"number"==typeof arguments[1]){var e=arguments[1];t.call(this,arguments[0].getCoordinates(),e)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var i=arguments[0],n=arguments[1];this._srcPts=i,this._isClosed=t.isClosed(i),this._snapTolerance=n}};Ou.prototype.snapVertices=function(t,e){for(var i=this._isClosed?t.size()-1:t.size(),n=0;n<i;n++){var r=t.get(n),o=this.findSnapForVertex(r,e);null!==o&&(t.set(n,new Wo(o)),0===n&&this._isClosed&&t.set(t.size()-1,new Wo(o)))}},Ou.prototype.findSnapForVertex=function(t,e){for(var i=0;i<e.length;i++){if(t.equals2D(e[i]))return null;if(t.distance(e[i])<this._snapTolerance)return e[i]}return null},Ou.prototype.snapTo=function(t){var e=new Zs(this._srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()},Ou.prototype.snapSegments=function(t,e){if(0===e.length)return null;var i=e.length;e[0].equals2D(e[e.length-1])&&(i=e.length-1);for(var n=0;n<i;n++){var r=e[n],o=this.findSegmentIndexToSnap(r,t);o>=0&&t.add(o+1,new Wo(r),!1)}},Ou.prototype.findSegmentIndexToSnap=function(t,e){for(var i=this,n=Fo.MAX_VALUE,r=-1,o=0;o<e.size()-1;o++){if(i._seg.p0=e.get(o),i._seg.p1=e.get(o+1),i._seg.p0.equals2D(t)||i._seg.p1.equals2D(t)){if(i._allowSnappingToSourceVertices)continue;return-1}var s=i._seg.distance(t);s<i._snapTolerance&&s<n&&(n=s,r=o)}return r},Ou.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Ou.prototype.interfaces_=function(){return[]},Ou.prototype.getClass=function(){return Ou},Ou.isClosed=function(t){return!(t.length<=1)&&t[0].equals2D(t[t.length-1])};var ku=function(t){this._srcGeom=t||null},Nu={SNAP_PRECISION_FACTOR:{configurable:!0}};ku.prototype.snapTo=function(t,e){var i=this.extractTargetCoordinates(t);return new Bu(e,i).transform(this._srcGeom)},ku.prototype.snapToSelf=function(t,e){var i=this.extractTargetCoordinates(this._srcGeom),n=new Bu(t,i,!0).transform(this._srcGeom),r=n;return e&&Jo(r,Na)&&(r=n.buffer(0)),r},ku.prototype.computeSnapTolerance=function(t){return this.computeMinimumSegmentLength(t)/10},ku.prototype.extractTargetCoordinates=function(t){for(var e=new da,i=t.getCoordinates(),n=0;n<i.length;n++)e.add(i[n]);return e.toArray(new Array(0).fill(null))},ku.prototype.computeMinimumSegmentLength=function(t){for(var e=Fo.MAX_VALUE,i=0;i<t.length-1;i++){var n=t[i].distance(t[i+1]);n<e&&(e=n)}return e},ku.prototype.interfaces_=function(){return[]},ku.prototype.getClass=function(){return ku},ku.snap=function(t,e,i){var n=new Array(2).fill(null),r=new ku(t);n[0]=r.snapTo(e,i);var o=new ku(e);return n[1]=o.snapTo(n[0],i),n},ku.computeOverlaySnapTolerance=function(){if(1===arguments.length){var t=arguments[0],e=ku.computeSizeBasedSnapTolerance(t),i=t.getPrecisionModel();if(i.getType()===Ja.FIXED){var n=1/i.getScale()*2/1.415;n>e&&(e=n)}return e}if(2===arguments.length){var r=arguments[0],o=arguments[1];return Math.min(ku.computeOverlaySnapTolerance(r),ku.computeOverlaySnapTolerance(o))}},ku.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*ku.SNAP_PRECISION_FACTOR},ku.snapToSelf=function(t,e,i){return new ku(t).snapToSelf(e,i)},Nu.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(ku,Nu);var Bu=function(t){function e(e,i,n){t.call(this),this._snapTolerance=e||null,this._snapPts=i||null,this._isSelfSnap=void 0!==n&&n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(t,e){var i=new Ou(t,this._snapTolerance);return i.setAllowSnappingToSourceVertices(this._isSelfSnap),i.snapTo(e)},e.prototype.transformCoordinates=function(t,e){var i=t.toCoordinateArray(),n=this.snapLine(i,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ru),zu=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};zu.prototype.getCommon=function(){return Fo.longBitsToDouble(this._commonBits)},zu.prototype.add=function(t){var e=Fo.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=zu.signExpBits(this._commonBits),this._isFirst=!1,null):zu.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=zu.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=zu.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},zu.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=Fo.longBitsToDouble(t),i="0000000000000000000000000000000000000000000000000000000000000000"+Fo.toBinaryString(t),n=i.substring(i.length-64);return n.substring(0,1)+" "+n.substring(1,12)+"(exp) "+n.substring(12)+" [ "+e+" ]"}},zu.prototype.interfaces_=function(){return[]},zu.prototype.getClass=function(){return zu},zu.getBit=function(t,e){return 0!=(t&1<<e)?1:0},zu.signExpBits=function(t){return t>>52},zu.zeroLowerBits=function(t,e){return t&~((1<<e)-1)},zu.numCommonMostSigMantissaBits=function(t,e){for(var i=0,n=52;n>=0;n--){if(zu.getBit(t,n)!==zu.getBit(e,n))return i;i++}return 52};var Fu=function(){this._commonCoord=null,this._ccFilter=new Uu},Vu={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};Fu.prototype.addCommonBits=function(t){var e=new Gu(this._commonCoord);t.apply(e),t.geometryChanged()},Fu.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new Wo(this._commonCoord);e.x=-e.x,e.y=-e.y;var i=new Gu(e);return t.apply(i),t.geometryChanged(),t},Fu.prototype.getCommonCoordinate=function(){return this._commonCoord},Fu.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},Fu.prototype.interfaces_=function(){return[]},Fu.prototype.getClass=function(){return Fu},Vu.CommonCoordinateFilter.get=function(){return Uu},Vu.Translater.get=function(){return Gu},Object.defineProperties(Fu,Vu);var Uu=function(){this._commonBitsX=new zu,this._commonBitsY=new zu};Uu.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},Uu.prototype.getCommonCoordinate=function(){return new Wo(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},Uu.prototype.interfaces_=function(){return[Os]},Uu.prototype.getClass=function(){return Uu};var Gu=function(){this.trans=null;var t=arguments[0];this.trans=t};Gu.prototype.filter=function(t,e){var i=t.getOrdinate(e,0)+this.trans.x,n=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,i),t.setOrdinate(e,1,n)},Gu.prototype.isDone=function(){return!1},Gu.prototype.isGeometryChanged=function(){return!0},Gu.prototype.interfaces_=function(){return[_a]},Gu.prototype.getClass=function(){return Gu};var ju=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};ju.prototype.selfSnap=function(t){return new ku(t).snapTo(t,this._snapTolerance)},ju.prototype.removeCommonBits=function(t){this._cbr=new Fu,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},ju.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},ju.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),i=hh.overlayOp(e[0],e[1],t);return this.prepareResult(i)},ju.prototype.checkValid=function(t){t.isValid()||hs.out.println("Snapped geometry is invalid")},ju.prototype.computeSnapTolerance=function(){this._snapTolerance=ku.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},ju.prototype.snap=function(t){var e=this.removeCommonBits(t);return ku.snap(e[0],e[1],this._snapTolerance)},ju.prototype.interfaces_=function(){return[]},ju.prototype.getClass=function(){return ju},ju.overlayOp=function(t,e,i){return new ju(t,e).getResultGeometry(i)},ju.union=function(t,e){return ju.overlayOp(t,e,hh.UNION)},ju.intersection=function(t,e){return ju.overlayOp(t,e,hh.INTERSECTION)},ju.symDifference=function(t,e){return ju.overlayOp(t,e,hh.SYMDIFFERENCE)},ju.difference=function(t,e){return ju.overlayOp(t,e,hh.DIFFERENCE)};var Hu=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};Hu.prototype.getResultGeometry=function(t){var e=null,i=!1,n=null;try{e=hh.overlayOp(this._geom[0],this._geom[1],t);i=!0}catch(t){if(!(t instanceof xs))throw t;n=t}if(!i)try{e=ju.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof xs?n:t}return e},Hu.prototype.interfaces_=function(){return[]},Hu.prototype.getClass=function(){return Hu},Hu.overlayOp=function(t,e,i){return new Hu(t,e).getResultGeometry(i)},Hu.union=function(t,e){return Hu.overlayOp(t,e,hh.UNION)},Hu.intersection=function(t,e){return Hu.overlayOp(t,e,hh.INTERSECTION)},Hu.symDifference=function(t,e){return Hu.overlayOp(t,e,hh.SYMDIFFERENCE)},Hu.difference=function(t,e){return Hu.overlayOp(t,e,hh.DIFFERENCE)};var Wu=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};Wu.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},Wu.prototype.interfaces_=function(){return[]},Wu.prototype.getClass=function(){return Wu};var qu=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){var e=arguments[0],i=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=i}else if(3===arguments.length){var n=arguments[0],r=arguments[1],o=arguments[2];this._eventType=t.INSERT,this._label=n,this._xValue=r,this._obj=o}},Xu={INSERT:{configurable:!0},DELETE:{configurable:!0}};qu.prototype.isDelete=function(){return this._eventType===qu.DELETE},qu.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},qu.prototype.getObject=function(){return this._obj},qu.prototype.compareTo=function(t){var e=t;return this._xValue<e._xValue?-1:this._xValue>e._xValue?1:this._eventType<e._eventType?-1:this._eventType>e._eventType?1:0},qu.prototype.getInsertEvent=function(){return this._insertEvent},qu.prototype.isInsert=function(){return this._eventType===qu.INSERT},qu.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},qu.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},qu.prototype.interfaces_=function(){return[Uo]},qu.prototype.getClass=function(){return qu},Xu.INSERT.get=function(){return 1},Xu.DELETE.get=function(){return 2},Object.defineProperties(qu,Xu);var Zu=function(){};Zu.prototype.interfaces_=function(){return[]},Zu.prototype.getClass=function(){return Zu};var Yu=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],i=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=i};Yu.prototype.isTrivialIntersection=function(t,e,i,n){if(t===i&&1===this._li.getIntersectionNum()){if(Yu.isAdjacentSegments(e,n))return!0;if(t.isClosed()){var r=t.getNumPoints()-1;if(0===e&&n===r||0===n&&e===r)return!0}}return!1},Yu.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Yu.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},Yu.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Yu.prototype.isBoundaryPointInternal=function(t,e){for(var i=e.iterator();i.hasNext();){var n=i.next().getCoordinate();if(t.isIntersection(n))return!0}return!1},Yu.prototype.hasProperIntersection=function(){return this._hasProper},Yu.prototype.hasIntersection=function(){return this._hasIntersection},Yu.prototype.isDone=function(){return this._isDone},Yu.prototype.isBoundaryPoint=function(t,e){return null!==e&&(!!this.isBoundaryPointInternal(t,e[0])||!!this.isBoundaryPointInternal(t,e[1]))},Yu.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},Yu.prototype.addIntersections=function(t,e,i,n){if(t===i&&e===n)return null;this.numTests++;var r=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=i.getCoordinates()[n],a=i.getCoordinates()[n+1];this._li.computeIntersection(r,o,s,a),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),i.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,i,n)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),i.addIntersections(this._li,n,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},Yu.prototype.interfaces_=function(){return[]},Yu.prototype.getClass=function(){return Yu},Yu.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var Qu=function(t){function e(){t.call(this),this.events=new qs,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){Fl.sort(this.events);for(var t=0;t<this.events.size();t++){var e=this.events.get(t);e.isDelete()&&e.getInsertEvent().setDeleteEventIndex(t)}},e.prototype.computeIntersections=function(){if(1===arguments.length){var t=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var e=0;e<this.events.size();e++){var i=this.events.get(e);if(i.isInsert()&&this.processOverlaps(e,i.getDeleteEventIndex(),i,t),t.isDone())break}}else if(3===arguments.length)if(arguments[2]instanceof Yu&&Jo(arguments[0],Hs)&&Jo(arguments[1],Hs)){var n=arguments[0],r=arguments[1],o=arguments[2];this.addEdges(n,n),this.addEdges(r,r),this.computeIntersections(o)}else if("boolean"==typeof arguments[2]&&Jo(arguments[0],Hs)&&arguments[1]instanceof Yu){var s=arguments[0],a=arguments[1];arguments[2]?this.addEdges(s,null):this.addEdges(s),this.computeIntersections(a)}},e.prototype.addEdge=function(t,e){for(var i=t.getMonotoneChainEdge(),n=i.getStartIndexes(),r=0;r<n.length-1;r++){var o=new Wu(i,r),s=new qu(e,i.getMinX(r),o);this.events.add(s),this.events.add(new qu(i.getMaxX(r),s))}},e.prototype.processOverlaps=function(t,e,i,n){for(var r=i.getObject(),o=t;o<e;o++){var s=this.events.get(o);if(s.isInsert()){var a=s.getObject();i.isSameLabel(s)||(r.computeIntersections(a,n),this.nOverlaps++)}}},e.prototype.addEdges=function(){if(1===arguments.length)for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.addEdge(e,e)}else if(2===arguments.length)for(var i=arguments[1],n=arguments[0].iterator();n.hasNext();){var r=n.next();this.addEdge(r,i)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Zu),Ju=function(){this._min=Fo.POSITIVE_INFINITY,this._max=Fo.NEGATIVE_INFINITY},Ku={NodeComparator:{configurable:!0}};Ju.prototype.getMin=function(){return this._min},Ju.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},Ju.prototype.getMax=function(){return this._max},Ju.prototype.toString=function(){return _s.toLineString(new Wo(this._min,0),new Wo(this._max,0))},Ju.prototype.interfaces_=function(){return[]},Ju.prototype.getClass=function(){return Ju},Ku.NodeComparator.get=function(){return $u},Object.defineProperties(Ju,Ku);var $u=function(){};$u.prototype.compare=function(t,e){var i=t,n=e,r=(i._min+i._max)/2,o=(n._min+n._max)/2;return r<o?-1:r>o?1:0},$u.prototype.interfaces_=function(){return[jo]},$u.prototype.getClass=function(){return $u};var th=function(t){function e(){t.call(this),this._item=null;var e=arguments[0],i=arguments[1],n=arguments[2];this._min=e,this._max=i,this._item=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(t,e,i){if(!this.intersects(t,e))return null;i.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ju),eh=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var e=arguments[0],i=arguments[1];this._node1=e,this._node2=i,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(t,e){this._min=Math.min(t._min,e._min),this._max=Math.max(t._max,e._max)},e.prototype.query=function(t,e,i){if(!this.intersects(t,e))return null;null!==this._node1&&this._node1.query(t,e,i),null!==this._node2&&this._node2.query(t,e,i)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ju),ih=function(){this._leaves=new qs,this._root=null,this._level=0};ih.prototype.buildTree=function(){Fl.sort(this._leaves,new Ju.NodeComparator);for(var t=this._leaves,e=null,i=new qs;;){if(this.buildLevel(t,i),1===i.size())return i.get(0);e=t,t=i,i=e}},ih.prototype.insert=function(t,e,i){if(null!==this._root)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new th(t,e,i))},ih.prototype.query=function(t,e,i){this.init(),this._root.query(t,e,i)},ih.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},ih.prototype.printNode=function(t){hs.out.println(_s.toLineString(new Wo(t._min,this._level),new Wo(t._max,this._level)))},ih.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},ih.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var i=0;i<t.size();i+=2){var n=t.get(i);if(null===(i+1<t.size()?t.get(i):null))e.add(n);else{var r=new eh(t.get(i),t.get(i+1));e.add(r)}}},ih.prototype.interfaces_=function(){return[]},ih.prototype.getClass=function(){return ih};var nh=function(){this._items=new qs};nh.prototype.visitItem=function(t){this._items.add(t)},nh.prototype.getItems=function(){return this._items},nh.prototype.interfaces_=function(){return[kl]},nh.prototype.getClass=function(){return nh};var rh=function(){this._index=null;var t=arguments[0];if(!Jo(t,Na))throw new zo("Argument must be Polygonal");this._index=new ah(t)},oh={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};rh.prototype.locate=function(t){var e=new Ts(t),i=new sh(e);return this._index.query(t.y,t.y,i),e.getLocation()},rh.prototype.interfaces_=function(){return[Sc]},rh.prototype.getClass=function(){return rh},oh.SegmentVisitor.get=function(){return sh},oh.IntervalIndexedGeometry.get=function(){return ah},Object.defineProperties(rh,oh);var sh=function(){this._counter=null;var t=arguments[0];this._counter=t};sh.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},sh.prototype.interfaces_=function(){return[kl]},sh.prototype.getClass=function(){return sh};var ah=function(){this._index=new ih;var t=arguments[0];this.init(t)};ah.prototype.init=function(t){for(var e=cu.getLines(t).iterator();e.hasNext();){var i=e.next().getCoordinates();this.addLine(i)}},ah.prototype.addLine=function(t){for(var e=1;e<t.length;e++){var i=new tc(t[e-1],t[e]),n=Math.min(i.p0.y,i.p1.y),r=Math.max(i.p0.y,i.p1.y);this._index.insert(n,r,i)}},ah.prototype.query=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],i=new nh;return this._index.query(t,e,i),i.getItems()}if(3===arguments.length){var n=arguments[0],r=arguments[1],o=arguments[2];this._index.query(n,r,o)}},ah.prototype.interfaces_=function(){return[]},ah.prototype.getClass=function(){return ah};var lh=function(t){function e(){if(t.call(this),this._parentGeom=null,this._lineEdgeMap=new Qa,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new uu,2===arguments.length){var e=arguments[0],i=arguments[1],n=ks.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=i,this._boundaryNodeRule=n,null!==i&&this.add(i)}else if(3===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2];this._argIndex=r,this._parentGeom=o,this._boundaryNodeRule=s,null!==o&&this.add(o)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertBoundaryPoint=function(t,i){var n=this._nodes.addNode(i).getLabel(),r=1;n.getLocation(t,cl.ON)===Yo.BOUNDARY&&r++;var o=e.determineBoundary(this._boundaryNodeRule,r);n.setLocation(t,o)},e.prototype.computeSelfNodes=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.computeSelfNodes(t,e,!1)}if(3===arguments.length){var i=arguments[1],n=arguments[2],r=new Yu(arguments[0],!0,!1);r.setIsDoneIfProperInt(n);var o=this.createEdgeSetIntersector(),s=this._parentGeom instanceof Fa||this._parentGeom instanceof Ba||this._parentGeom instanceof Va,a=i||!s;return o.computeIntersections(this._edges,r,a),this.addSelfIntersectionNodes(this._argIndex),r}},e.prototype.computeSplitEdges=function(t){for(var e=this._edges.iterator();e.hasNext();){e.next().eiList.addSplitEdges(t)}},e.prototype.computeEdgeIntersections=function(t,e,i){var n=new Yu(e,i,!0);return n.setBoundaryNodes(this.getBoundaryNodes(),t.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,t._edges,n),n},e.prototype.getGeometry=function(){return this._parentGeom},e.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},e.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},e.prototype.addPoint=function(){if(arguments[0]instanceof ka){var t=arguments[0].getCoordinate();this.insertPoint(this._argIndex,t,Yo.INTERIOR)}else if(arguments[0]instanceof Wo){var e=arguments[0];this.insertPoint(this._argIndex,e,Yo.INTERIOR)}},e.prototype.addPolygon=function(t){this.addPolygonRing(t.getExteriorRing(),Yo.EXTERIOR,Yo.INTERIOR);for(var e=0;e<t.getNumInteriorRing();e++){var i=t.getInteriorRingN(e);this.addPolygonRing(i,Yo.INTERIOR,Yo.EXTERIOR)}},e.prototype.addEdge=function(t){this.insertEdge(t);var e=t.getCoordinates();this.insertPoint(this._argIndex,e[0],Yo.BOUNDARY),this.insertPoint(this._argIndex,e[e.length-1],Yo.BOUNDARY)},e.prototype.addLineString=function(t){var e=Ys.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=e[0],null;var i=new Uc(e,new vl(this._argIndex,Yo.INTERIOR));this._lineEdgeMap.put(t,i),this.insertEdge(i),ws.isTrue(e.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,e[0]),this.insertBoundaryPoint(this._argIndex,e[e.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),i=0,n=t.iterator();n.hasNext();){var r=n.next();e[i++]=r.getCoordinate().copy()}return e},e.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(t,e,i){if(this.isBoundaryNode(t,e))return null;i===Yo.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,i)},e.prototype.addPolygonRing=function(t,e,i){if(t.isEmpty())return null;var n=Ys.removeRepeatedPoints(t.getCoordinates());if(n.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=n[0],null;var r=e,o=i;Is.isCCW(n)&&(r=i,o=e);var s=new Uc(n,new vl(this._argIndex,Yo.BOUNDARY,r,o));this._lineEdgeMap.put(t,s),this.insertEdge(s),this.insertPoint(this._argIndex,n[0],Yo.BOUNDARY)},e.prototype.insertPoint=function(t,e,i){var n=this._nodes.addNode(e),r=n.getLabel();null===r?n._label=new vl(t,i):r.setLocation(t,i)},e.prototype.createEdgeSetIntersector=function(){return new Qu},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var i=e.next(),n=i.getLabel().getLocation(t),r=i.eiList.iterator();r.hasNext();){var o=r.next();this.addSelfIntersectionNode(t,o.coord,n)}},e.prototype.add=function(){if(1!==arguments.length)return t.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof Va&&(this._useBoundaryDeterminationRule=!1),e instanceof Ba)this.addPolygon(e);else if(e instanceof Ra)this.addLineString(e);else if(e instanceof ka)this.addPoint(e);else if(e instanceof za)this.addCollection(e);else if(e instanceof ba)this.addCollection(e);else if(e instanceof Va)this.addCollection(e);else{if(!(e instanceof xa))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var i=t.getGeometryN(e);this.add(i)}},e.prototype.locate=function(t){return Jo(this._parentGeom,Na)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new rh(this._parentGeom)),this._areaPtLocator.locate(t)):this._ptLocator.locate(t,this._parentGeom)},e.prototype.findEdge=function(){if(1===arguments.length){var e=arguments[0];return this._lineEdgeMap.get(e)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(t,e){return t.isInBoundary(e)?Yo.BOUNDARY:Yo.INTERIOR},e}(Pl),ch=function(){if(this._li=new Ss,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new lh(0,t)}else if(2===arguments.length){var e=arguments[0],i=arguments[1],n=ks.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(i.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(i.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new lh(0,e,n),this._arg[1]=new lh(1,i,n)}else if(3===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2];r.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(r.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new lh(0,r,s),this._arg[1]=new lh(1,o,s)}};ch.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},ch.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},ch.prototype.interfaces_=function(){return[]},ch.prototype.getClass=function(){return ch};var uh=function(){};uh.prototype.interfaces_=function(){return[]},uh.prototype.getClass=function(){return uh},uh.map=function(){if(arguments[0]instanceof Ls&&Jo(arguments[1],uh.MapOp)){for(var t=arguments[0],e=arguments[1],i=new qs,n=0;n<t.getNumGeometries();n++){var r=e.map(t.getGeometryN(n));null!==r&&i.add(r)}return t.getFactory().buildGeometry(i)}if(Jo(arguments[0],Us)&&Jo(arguments[1],uh.MapOp)){for(var o=arguments[0],s=arguments[1],a=new qs,l=o.iterator();l.hasNext();){var c=l.next(),u=s.map(c);null!==u&&a.add(u)}return a}},uh.MapOp=function(){};var hh=function(t){function e(){var e=arguments[0],i=arguments[1];t.call(this,e,i),this._ptLocator=new uu,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Dc,this._resultPolyList=new qs,this._resultLineList=new qs,this._resultPointList=new qs,this._graph=new Pl(new Pc),this._geomFact=e.getFactory()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var i=e.getLabel(),n=t.getLabel();e.isPointwiseEqual(t)||(n=new vl(t.getLabel())).flip();var r=e.getDepth();r.isNull()&&r.add(i),r.add(n),i.merge(n)}else this._edgeList.add(t)},e.prototype.getGraph=function(){return this._graph},e.prototype.cancelDuplicateResultEdges=function(){for(var t=this._graph.getEdgeEnds().iterator();t.hasNext();){var e=t.next(),i=e.getSym();e.isInResult()&&i.isInResult()&&(e.setInResult(!1),i.setInResult(!1))}},e.prototype.isCoveredByLA=function(t){return!!this.isCovered(t,this._resultLineList)||!!this.isCovered(t,this._resultPolyList)},e.prototype.computeGeometry=function(t,i,n,r){var o=new qs;return o.addAll(t),o.addAll(i),o.addAll(n),o.isEmpty()?e.createEmptyResult(r,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(o)},e.prototype.mergeSymLabels=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){t.next().getEdges().mergeSymLabels()}},e.prototype.isCovered=function(t,e){for(var i=e.iterator();i.hasNext();){var n=i.next();if(this._ptLocator.locate(t,n)!==Yo.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var t=new qs,e=this._edgeList.iterator();e.hasNext();){var i=e.next();i.isCollapsed()&&(e.remove(),t.add(i.getCollapsedEdge()))}this._edgeList.addAll(t)},e.prototype.updateNodeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),i=e.getEdges().getLabel();e.getLabel().merge(i)}},e.prototype.getResultGeometry=function(t){return this.computeOverlay(t),this._resultGeom},e.prototype.insertUniqueEdges=function(t){for(var e=t.iterator();e.hasNext();){var i=e.next();this.insertUniqueEdge(i)}},e.prototype.computeOverlay=function(t){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var e=new qs;this._arg[0].computeSplitEdges(e),this._arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Cu.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var i=new Ll(this._geomFact);i.add(this._graph),this._resultPolyList=i.getPolygons();var n=new Lu(this,this._geomFact,this._ptLocator);this._resultLineList=n.build(t);var r=new Du(this,this._geomFact,this._ptLocator);this._resultPointList=r.build(t),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,t)},e.prototype.labelIncompleteNode=function(t,e){var i=this._ptLocator.locate(t.getCoordinate(),this._arg[e].getGeometry());t.getLabel().setLocation(e,i)},e.prototype.copyPoints=function(t){for(var e=this._arg[t].getNodeIterator();e.hasNext();){var i=e.next();this._graph.addNode(i.getCoordinate()).setLabel(t,i.getLabel().getLocation(t))}},e.prototype.findResultAreaEdges=function(t){for(var i=this._graph.getEdgeEnds().iterator();i.hasNext();){var n=i.next(),r=n.getLabel();r.isArea()&&!n.isInteriorAreaEdge()&&e.isResultOfOp(r.getLocation(0,cl.RIGHT),r.getLocation(1,cl.RIGHT),t)&&n.setInResult(!0)}},e.prototype.computeLabelsFromDepths=function(){for(var t=this._edgeList.iterator();t.hasNext();){var e=t.next(),i=e.getLabel(),n=e.getDepth();if(!n.isNull()){n.normalize();for(var r=0;r<2;r++)i.isNull(r)||!i.isArea()||n.isNull(r)||(0===n.getDelta(r)?i.toLine(r):(ws.isTrue(!n.isNull(r,cl.LEFT),"depth of LEFT side has not been initialized"),i.setLocation(r,cl.LEFT,n.getLocation(r,cl.LEFT)),ws.isTrue(!n.isNull(r,cl.RIGHT),"depth of RIGHT side has not been initialized"),i.setLocation(r,cl.RIGHT,n.getLocation(r,cl.RIGHT))))}}},e.prototype.computeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){t.next().getEdges().computeLabelling(this._arg)}this.mergeSymLabels(),this.updateNodeLabelling()},e.prototype.labelIncompleteNodes=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),i=e.getLabel();e.isIsolated()&&(i.isNull(0)?this.labelIncompleteNode(e,0):this.labelIncompleteNode(e,1)),e.getEdges().updateLabelling(i)}},e.prototype.isCoveredByA=function(t){return!!this.isCovered(t,this._resultPolyList)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ch);hh.overlayOp=function(t,e,i){return new hh(t,e).getResultGeometry(i)},hh.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return hh.createEmptyResult(hh.INTERSECTION,t,e,t.getFactory());if(t.isGeometryCollection()){var i=e;return Pu.map(t,{interfaces_:function(){return[uh.MapOp]},map:function(t){return t.intersection(i)}})}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Hu.overlayOp(t,e,hh.INTERSECTION)},hh.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return hh.createEmptyResult(hh.SYMDIFFERENCE,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Hu.overlayOp(t,e,hh.SYMDIFFERENCE)},hh.resultDimension=function(t,e,i){var n=e.getDimension(),r=i.getDimension(),o=-1;switch(t){case hh.INTERSECTION:o=Math.min(n,r);break;case hh.UNION:o=Math.max(n,r);break;case hh.DIFFERENCE:o=n;break;case hh.SYMDIFFERENCE:o=Math.max(n,r)}return o},hh.createEmptyResult=function(t,e,i,n){var r=null;switch(hh.resultDimension(t,e,i)){case-1:r=n.createGeometryCollection(new Array(0).fill(null));break;case 0:r=n.createPoint();break;case 1:r=n.createLineString();break;case 2:r=n.createPolygon()}return r},hh.difference=function(t,e){return t.isEmpty()?hh.createEmptyResult(hh.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Hu.overlayOp(t,e,hh.DIFFERENCE))},hh.isResultOfOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],i=t.getLocation(0),n=t.getLocation(1);return hh.isResultOfOp(i,n,e)}if(3===arguments.length){var r=arguments[0],o=arguments[1];switch(r===Yo.BOUNDARY&&(r=Yo.INTERIOR),o===Yo.BOUNDARY&&(o=Yo.INTERIOR),arguments[2]){case hh.INTERSECTION:return r===Yo.INTERIOR&&o===Yo.INTERIOR;case hh.UNION:return r===Yo.INTERIOR||o===Yo.INTERIOR;case hh.DIFFERENCE:return r===Yo.INTERIOR&&o!==Yo.INTERIOR;case hh.SYMDIFFERENCE:return r===Yo.INTERIOR&&o!==Yo.INTERIOR||r!==Yo.INTERIOR&&o===Yo.INTERIOR}return!1}},hh.INTERSECTION=1,hh.UNION=2,hh.DIFFERENCE=3,hh.SYMDIFFERENCE=4;var ph=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new uu,this._seg=new tc;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};ph.prototype.isWithinToleranceOfBoundary=function(t){for(var e=this,i=0;i<this._linework.getNumGeometries();i++)for(var n=e._linework.getGeometryN(i).getCoordinateSequence(),r=0;r<n.size()-1;r++){if(n.getCoordinate(r,e._seg.p0),n.getCoordinate(r+1,e._seg.p1),e._seg.distance(t)<=e._boundaryDistanceTolerance)return!0}return!1},ph.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?Yo.BOUNDARY:this._ptLocator.locate(t,this._g)},ph.prototype.extractLinework=function(t){var e=new dh;t.apply(e);var i=e.getLinework(),n=el.toLineStringArray(i);return t.getFactory().createMultiLineString(n)},ph.prototype.interfaces_=function(){return[]},ph.prototype.getClass=function(){return ph};var dh=function(){this._linework=null,this._linework=new qs};dh.prototype.getLinework=function(){return this._linework},dh.prototype.filter=function(t){if(t instanceof Ba){var e=t;this._linework.add(e.getExteriorRing());for(var i=0;i<e.getNumInteriorRing();i++)this._linework.add(e.getInteriorRingN(i))}},dh.prototype.interfaces_=function(){return[va]},dh.prototype.getClass=function(){return dh};var fh=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};fh.prototype.extractPoints=function(t,e,i){for(var n=t.getCoordinates(),r=0;r<n.length-1;r++)this.computeOffsetPoints(n[r],n[r+1],e,i)},fh.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},fh.prototype.getPoints=function(t){for(var e=new qs,i=cu.getLines(this._g).iterator();i.hasNext();){var n=i.next();this.extractPoints(n,t,e)}return e},fh.prototype.computeOffsetPoints=function(t,e,i,n){var r=e.x-t.x,o=e.y-t.y,s=Math.sqrt(r*r+o*o),a=i*r/s,l=i*o/s,c=(e.x+t.x)/2,u=(e.y+t.y)/2;if(this._doLeft){var h=new Wo(c-l,u+a);n.add(h)}if(this._doRight){var p=new Wo(c+l,u-a);n.add(p)}},fh.prototype.interfaces_=function(){return[]},fh.prototype.getClass=function(){return fh};var mh=function t(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=t.TOLERANCE,this._testCoords=new qs;var e=arguments[0],i=arguments[1],n=arguments[2];this._boundaryDistanceTolerance=t.computeBoundaryDistanceTolerance(e,i),this._geom=[e,i,n],this._locFinder=[new ph(this._geom[0],this._boundaryDistanceTolerance),new ph(this._geom[1],this._boundaryDistanceTolerance),new ph(this._geom[2],this._boundaryDistanceTolerance)]},gh={TOLERANCE:{configurable:!0}};mh.prototype.reportResult=function(t,e,i){hs.out.println("Overlay result invalid - A:"+Yo.toLocationSymbol(e[0])+" B:"+Yo.toLocationSymbol(e[1])+" expected:"+(i?"i":"e")+" actual:"+Yo.toLocationSymbol(e[2]))},mh.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var e=this.checkValid(t);return e},mh.prototype.checkValid=function(){var t=this;if(1===arguments.length){for(var e=arguments[0],i=0;i<this._testCoords.size();i++){var n=t._testCoords.get(i);if(!t.checkValid(e,n))return t._invalidLocation=n,!1}return!0}if(2===arguments.length){var r=arguments[0],o=arguments[1];return this._location[0]=this._locFinder[0].getLocation(o),this._location[1]=this._locFinder[1].getLocation(o),this._location[2]=this._locFinder[2].getLocation(o),!!mh.hasLocation(this._location,Yo.BOUNDARY)||this.isValidResult(r,this._location)}},mh.prototype.addTestPts=function(t){var e=new fh(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},mh.prototype.isValidResult=function(t,e){var i=hh.isResultOfOp(e[0],e[1],t),n=!(i^e[2]===Yo.INTERIOR);return n||this.reportResult(t,e,i),n},mh.prototype.getInvalidLocation=function(){return this._invalidLocation},mh.prototype.interfaces_=function(){return[]},mh.prototype.getClass=function(){return mh},mh.hasLocation=function(t,e){for(var i=0;i<3;i++)if(t[i]===e)return!0;return!1},mh.computeBoundaryDistanceTolerance=function(t,e){return Math.min(ku.computeSizeBasedSnapTolerance(t),ku.computeSizeBasedSnapTolerance(e))},mh.isValid=function(t,e,i,n){return new mh(t,e,n).isValid(i)},gh.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(mh,gh);var yh=function t(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=t.extractFactory(e),this._inputGeoms=e};yh.prototype.extractElements=function(t,e){if(null===t)return null;for(var i=0;i<t.getNumGeometries();i++){var n=t.getGeometryN(i);this._skipEmpty&&n.isEmpty()||e.add(n)}},yh.prototype.combine=function(){for(var t=new qs,e=this._inputGeoms.iterator();e.hasNext();){var i=e.next();this.extractElements(i,t)}return 0===t.size()?null!==this._geomFactory?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(t)},yh.prototype.interfaces_=function(){return[]},yh.prototype.getClass=function(){return yh},yh.combine=function(){return 1===arguments.length?new yh(arguments[0]).combine():2===arguments.length?new yh(yh.createList(arguments[0],arguments[1])).combine():3===arguments.length?new yh(yh.createList(arguments[0],arguments[1],arguments[2])).combine():void 0},yh.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},yh.createList=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],i=new qs;return i.add(t),i.add(e),i}if(3===arguments.length){var n=arguments[0],r=arguments[1],o=arguments[2],s=new qs;return s.add(n),s.add(r),s.add(o),s}};var vh=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,null===this._inputPolys&&(this._inputPolys=new qs)},_h={STRTREE_NODE_CAPACITY:{configurable:!0}};vh.prototype.reduceToGeometries=function(t){for(var e=new qs,i=t.iterator();i.hasNext();){var n=i.next(),r=null;Jo(n,Hs)?r=this.unionTree(n):n instanceof Ls&&(r=n),e.add(r)}return e},vh.prototype.extractByEnvelope=function(t,e,i){for(var n=new qs,r=0;r<e.getNumGeometries();r++){var o=e.getGeometryN(r);o.getEnvelopeInternal().intersects(t)?n.add(o):i.add(o)}return this._geomFactory.buildGeometry(n)},vh.prototype.unionOptimized=function(t,e){var i=t.getEnvelopeInternal(),n=e.getEnvelopeInternal();if(!i.intersects(n))return yh.combine(t,e);if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var r=i.intersection(n);return this.unionUsingEnvelopeIntersection(t,e,r)},vh.prototype.union=function(){if(null===this._inputPolys)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var t=new Wl(vh.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var i=e.next();t.insert(i.getEnvelopeInternal(),i)}this._inputPolys=null;var n=t.itemsTree();return this.unionTree(n)},vh.prototype.binaryUnion=function(){if(1===arguments.length){var t=arguments[0];return this.binaryUnion(t,0,t.size())}if(3===arguments.length){var e=arguments[0],i=arguments[1],n=arguments[2];if(n-i<=1){var r=vh.getGeometry(e,i);return this.unionSafe(r,null)}if(n-i==2)return this.unionSafe(vh.getGeometry(e,i),vh.getGeometry(e,i+1));var o=Math.trunc((n+i)/2),s=this.binaryUnion(e,i,o),a=this.binaryUnion(e,o,n);return this.unionSafe(s,a)}},vh.prototype.repeatedUnion=function(t){for(var e=null,i=t.iterator();i.hasNext();){var n=i.next();e=null===e?n.copy():e.union(n)}return e},vh.prototype.unionSafe=function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},vh.prototype.unionActual=function(t,e){return vh.restrictToPolygons(t.union(e))},vh.prototype.unionTree=function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},vh.prototype.unionUsingEnvelopeIntersection=function(t,e,i){var n=new qs,r=this.extractByEnvelope(i,t,n),o=this.extractByEnvelope(i,e,n),s=this.unionActual(r,o);return n.add(s),yh.combine(n)},vh.prototype.bufferUnion=function(){if(1===arguments.length){var t=arguments[0];return t.get(0).getFactory().buildGeometry(t).buffer(0)}if(2===arguments.length){var e=arguments[0],i=arguments[1];return e.getFactory().createGeometryCollection([e,i]).buffer(0)}},vh.prototype.interfaces_=function(){return[]},vh.prototype.getClass=function(){return vh},vh.restrictToPolygons=function(t){if(Jo(t,Na))return t;var e=lu.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(el.toPolygonArray(e))},vh.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},vh.union=function(t){return new vh(t).union()},_h.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(vh,_h);var xh=function(){};function bh(){return new wh}function wh(){this.reset()}xh.prototype.interfaces_=function(){return[]},xh.prototype.getClass=function(){return xh},xh.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return hh.createEmptyResult(hh.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),Hu.overlayOp(t,e,hh.UNION)},wh.prototype={constructor:wh,reset:function(){this.s=this.t=0},add:function(t){Eh(Ah,t,this.t),Eh(this,Ah.s,this.s),this.s?this.t+=Ah.t:this.s=Ah.t},valueOf:function(){return this.s}};var Ah=new wh;function Eh(t,e,i){var n=t.s=e+i,r=n-e,o=n-r;t.t=e-o+(i-r)}var Sh=1e-6,Mh=Math.PI,Th=Mh/2,Ih=Mh/4,Ch=2*Mh,Ph=180/Mh,Lh=Mh/180,Dh=Math.abs,Rh=Math.atan,Oh=Math.atan2,kh=Math.cos,Nh=Math.sin,Bh=Math.sqrt;function zh(t){return t>1?0:t<-1?Mh:Math.acos(t)}function Fh(t){return t>1?Th:t<-1?-Th:Math.asin(t)}function Vh(){}function Uh(t,e){t&&jh.hasOwnProperty(t.type)&&jh[t.type](t,e)}var Gh={Feature:function(t,e){Uh(t.geometry,e)},FeatureCollection:function(t,e){for(var i=t.features,n=-1,r=i.length;++n<r;)Uh(i[n].geometry,e)}},jh={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var i=t.coordinates,n=-1,r=i.length;++n<r;)t=i[n],e.point(t[0],t[1],t[2])},LineString:function(t,e){Hh(t.coordinates,e,0)},MultiLineString:function(t,e){for(var i=t.coordinates,n=-1,r=i.length;++n<r;)Hh(i[n],e,0)},Polygon:function(t,e){Wh(t.coordinates,e)},MultiPolygon:function(t,e){for(var i=t.coordinates,n=-1,r=i.length;++n<r;)Wh(i[n],e)},GeometryCollection:function(t,e){for(var i=t.geometries,n=-1,r=i.length;++n<r;)Uh(i[n],e)}};function Hh(t,e,i){var n,r=-1,o=t.length-i;for(e.lineStart();++r<o;)n=t[r],e.point(n[0],n[1],n[2]);e.lineEnd()}function Wh(t,e){var i=-1,n=t.length;for(e.polygonStart();++i<n;)Hh(t[i],e,1);e.polygonEnd()}function qh(t){return[Oh(t[1],t[0]),Fh(t[2])]}function Xh(t){var e=t[0],i=t[1],n=kh(i);return[n*kh(e),n*Nh(e),Nh(i)]}function Zh(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Yh(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Qh(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Jh(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Kh(t){var e=Bh(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function $h(t,e){function i(i,n){return i=t(i,n),e(i[0],i[1])}return t.invert&&e.invert&&(i.invert=function(i,n){return(i=e.invert(i,n))&&t.invert(i[0],i[1])}),i}function tp(t,e){return[t>Mh?t-Ch:t<-Mh?t+Ch:t,e]}function ep(t){return function(e,i){return[(e+=t)>Mh?e-Ch:e<-Mh?e+Ch:e,i]}}function ip(t){var e=ep(t);return e.invert=ep(-t),e}function np(t,e){var i=kh(t),n=Nh(t),r=kh(e),o=Nh(e);function s(t,e){var s=kh(e),a=kh(t)*s,l=Nh(t)*s,c=Nh(e),u=c*i+a*n;return[Oh(l*r-u*o,a*i-c*n),Fh(u*r+l*o)]}return s.invert=function(t,e){var s=kh(e),a=kh(t)*s,l=Nh(t)*s,c=Nh(e),u=c*r-l*o;return[Oh(l*r+c*o,a*i+u*n),Fh(u*i-a*n)]},s}function rp(t,e){(e=Xh(e))[0]-=t,Kh(e);var i=zh(-e[1]);return((-e[2]<0?-i:i)+Ch-Sh)%Ch}function op(){var t,e=[];return{point:function(e,i){t.push([e,i])},lineStart:function(){e.push(t=[])},lineEnd:Vh,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var i=e;return e=[],t=null,i}}}function sp(t,e){return Dh(t[0]-e[0])<Sh&&Dh(t[1]-e[1])<Sh}function ap(t,e,i,n){this.x=t,this.z=e,this.o=i,this.e=n,this.v=!1,this.n=this.p=null}function lp(t,e,i,n,r){var o,s,a=[],l=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,i,n=t[0],s=t[e];if(sp(n,s)){for(r.lineStart(),o=0;o<e;++o)r.point((n=t[o])[0],n[1]);r.lineEnd()}else a.push(i=new ap(n,t,null,!0)),l.push(i.o=new ap(n,null,i,!1)),a.push(i=new ap(s,t,null,!1)),l.push(i.o=new ap(s,null,i,!0))}})),a.length){for(l.sort(e),cp(a),cp(l),o=0,s=l.length;o<s;++o)l[o].e=i=!i;for(var c,u,h=a[0];;){for(var p=h,d=!0;p.v;)if((p=p.n)===h)return;c=p.z,r.lineStart();do{if(p.v=p.o.v=!0,p.e){if(d)for(o=0,s=c.length;o<s;++o)r.point((u=c[o])[0],u[1]);else n(p.x,p.n.x,1,r);p=p.n}else{if(d)for(c=p.p.z,o=c.length-1;o>=0;--o)r.point((u=c[o])[0],u[1]);else n(p.x,p.p.x,-1,r);p=p.p}c=(p=p.o).z,d=!d}while(!p.v);r.lineEnd()}}}function cp(t){if(e=t.length){for(var e,i,n=0,r=t[0];++n<e;)r.n=i=t[n],i.p=r,r=i;r.n=i=t[0],i.p=r}}function up(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function hp(t){for(var e,i,n,r=t.length,o=-1,s=0;++o<r;)s+=t[o].length;for(i=new Array(s);--r>=0;)for(e=(n=t[r]).length;--e>=0;)i[--s]=n[e];return i}bh(),bh(),bh(),tp.invert=tp,function(t){1===t.length&&(t=function(t){return function(e,i){return up(t(e),i)}}(t))}(up);var pp=1e9,dp=-pp;function fp(t,e,i,n){function r(r,o){return t<=r&&r<=i&&e<=o&&o<=n}function o(r,o,a,c){var u=0,h=0;if(null==r||(u=s(r,a))!==(h=s(o,a))||l(r,o)<0^a>0)do{c.point(0===u||3===u?t:i,u>1?n:e)}while((u=(u+a+4)%4)!==h);else c.point(o[0],o[1])}function s(n,r){return Dh(n[0]-t)<Sh?r>0?0:3:Dh(n[0]-i)<Sh?r>0?2:1:Dh(n[1]-e)<Sh?r>0?1:0:r>0?3:2}function a(t,e){return l(t.x,e.x)}function l(t,e){var i=s(t,1),n=s(e,1);return i!==n?i-n:0===i?e[1]-t[1]:1===i?t[0]-e[0]:2===i?t[1]-e[1]:e[0]-t[0]}return function(s){var l,c,u,h,p,d,f,m,g,y,v,_=s,x=op(),b={point:w,lineStart:function(){b.point=A,c&&c.push(u=[]);y=!0,g=!1,f=m=NaN},lineEnd:function(){l&&(A(h,p),d&&g&&x.rejoin(),l.push(x.result()));b.point=w,g&&_.lineEnd()},polygonStart:function(){_=x,l=[],c=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,i=0,r=c.length;i<r;++i)for(var o,s,a=c[i],l=1,u=a.length,h=a[0],p=h[0],d=h[1];l<u;++l)o=p,s=d,p=(h=a[l])[0],d=h[1],s<=n?d>n&&(p-o)*(n-s)>(d-s)*(t-o)&&++e:d<=n&&(p-o)*(n-s)<(d-s)*(t-o)&&--e;return e}(),i=v&&e,r=(l=hp(l)).length;(i||r)&&(s.polygonStart(),i&&(s.lineStart(),o(null,null,1,s),s.lineEnd()),r&&lp(l,a,e,o,s),s.polygonEnd());_=s,l=c=u=null}};function w(t,e){r(t,e)&&_.point(t,e)}function A(o,s){var a=r(o,s);if(c&&u.push([o,s]),y)h=o,p=s,d=a,y=!1,a&&(_.lineStart(),_.point(o,s));else if(a&&g)_.point(o,s);else{var l=[f=Math.max(dp,Math.min(pp,f)),m=Math.max(dp,Math.min(pp,m))],x=[o=Math.max(dp,Math.min(pp,o)),s=Math.max(dp,Math.min(pp,s))];!function(t,e,i,n,r,o){var s,a=t[0],l=t[1],c=0,u=1,h=e[0]-a,p=e[1]-l;if(s=i-a,h||!(s>0)){if(s/=h,h<0){if(s<c)return;s<u&&(u=s)}else if(h>0){if(s>u)return;s>c&&(c=s)}if(s=r-a,h||!(s<0)){if(s/=h,h<0){if(s>u)return;s>c&&(c=s)}else if(h>0){if(s<c)return;s<u&&(u=s)}if(s=n-l,p||!(s>0)){if(s/=p,p<0){if(s<c)return;s<u&&(u=s)}else if(p>0){if(s>u)return;s>c&&(c=s)}if(s=o-l,p||!(s<0)){if(s/=p,p<0){if(s>u)return;s>c&&(c=s)}else if(p>0){if(s<c)return;s<u&&(u=s)}return c>0&&(t[0]=a+c*h,t[1]=l+c*p),u<1&&(e[0]=a+u*h,e[1]=l+u*p),!0}}}}}(l,x,t,e,i,n)?a&&(_.lineStart(),_.point(o,s),v=!1):(g||(_.lineStart(),_.point(l[0],l[1])),_.point(x[0],x[1]),a||_.lineEnd(),v=!1)}f=o,m=s,g=a}return b}}var mp=bh();function gp(t){return t}bh(),bh(),bh();var yp=1/0,vp=yp,_p=-yp,xp=_p,bp={point:function(t,e){t<yp&&(yp=t);t>_p&&(_p=t);e<vp&&(vp=e);e>xp&&(xp=e)},lineStart:Vh,lineEnd:Vh,polygonStart:Vh,polygonEnd:Vh,result:function(){var t=[[yp,vp],[_p,xp]];return _p=xp=-(vp=yp=1/0),t}};function wp(t,e,i,n){return function(r,o){var s,a,l,c=e(o),u=r.invert(n[0],n[1]),h=op(),p=e(h),d=!1,f={point:m,lineStart:y,lineEnd:v,polygonStart:function(){f.point=_,f.lineStart=x,f.lineEnd=b,a=[],s=[]},polygonEnd:function(){f.point=m,f.lineStart=y,f.lineEnd=v,a=hp(a);var t=function(t,e){var i=e[0],n=e[1],r=[Nh(i),-kh(i),0],o=0,s=0;mp.reset();for(var a=0,l=t.length;a<l;++a)if(u=(c=t[a]).length)for(var c,u,h=c[u-1],p=h[0],d=h[1]/2+Ih,f=Nh(d),m=kh(d),g=0;g<u;++g,p=v,f=x,m=b,h=y){var y=c[g],v=y[0],_=y[1]/2+Ih,x=Nh(_),b=kh(_),w=v-p,A=w>=0?1:-1,E=A*w,S=E>Mh,M=f*x;if(mp.add(Oh(M*A*Nh(E),m*b+M*kh(E))),o+=S?w+A*Ch:w,S^p>=i^v>=i){var T=Yh(Xh(h),Xh(y));Kh(T);var I=Yh(r,T);Kh(I);var C=(S^w>=0?-1:1)*Fh(I[2]);(n>C||n===C&&(T[0]||T[1]))&&(s+=S^w>=0?1:-1)}}return(o<-Sh||o<Sh&&mp<-Sh)^1&s}(s,u);a.length?(d||(o.polygonStart(),d=!0),lp(a,Ep,t,i,o)):t&&(d||(o.polygonStart(),d=!0),o.lineStart(),i(null,null,1,o),o.lineEnd()),d&&(o.polygonEnd(),d=!1),a=s=null},sphere:function(){o.polygonStart(),o.lineStart(),i(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function m(e,i){var n=r(e,i);t(e=n[0],i=n[1])&&o.point(e,i)}function g(t,e){var i=r(t,e);c.point(i[0],i[1])}function y(){f.point=g,c.lineStart()}function v(){f.point=m,c.lineEnd()}function _(t,e){l.push([t,e]);var i=r(t,e);p.point(i[0],i[1])}function x(){p.lineStart(),l=[]}function b(){_(l[0][0],l[0][1]),p.lineEnd();var t,e,i,n,r=p.clean(),c=h.result(),u=c.length;if(l.pop(),s.push(l),l=null,u)if(1&r){if((e=(i=c[0]).length-1)>0){for(d||(o.polygonStart(),d=!0),o.lineStart(),t=0;t<e;++t)o.point((n=i[t])[0],n[1]);o.lineEnd()}}else u>1&&2&r&&c.push(c.pop().concat(c.shift())),a.push(c.filter(Ap))}return f}}function Ap(t){return t.length>1}function Ep(t,e){return((t=t.x)[0]<0?t[1]-Th-Sh:Th-t[1])-((e=e.x)[0]<0?e[1]-Th-Sh:Th-e[1])}bh();var Sp=wp((function(){return!0}),(function(t){var e,i=NaN,n=NaN,r=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,s){var a=o>0?Mh:-Mh,l=Dh(o-i);Dh(l-Mh)<Sh?(t.point(i,n=(n+s)/2>0?Th:-Th),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(a,n),t.point(o,n),e=0):r!==a&&l>=Mh&&(Dh(i-r)<Sh&&(i-=r*Sh),Dh(o-a)<Sh&&(o-=a*Sh),n=function(t,e,i,n){var r,o,s=Nh(t-i);return Dh(s)>Sh?Rh((Nh(e)*(o=kh(n))*Nh(i)-Nh(n)*(r=kh(e))*Nh(t))/(r*o*s)):(e+n)/2}(i,n,o,s),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(a,n),e=0),t.point(i=o,n=s),r=a},lineEnd:function(){t.lineEnd(),i=n=NaN},clean:function(){return 2-e}}}),(function(t,e,i,n){var r;if(null==t)r=i*Th,n.point(-Mh,r),n.point(0,r),n.point(Mh,r),n.point(Mh,0),n.point(Mh,-r),n.point(0,-r),n.point(-Mh,-r),n.point(-Mh,0),n.point(-Mh,r);else if(Dh(t[0]-e[0])>Sh){var o=t[0]<e[0]?Mh:-Mh;r=i*o/2,n.point(-o,r),n.point(0,r),n.point(o,r)}else n.point(e[0],e[1])}),[-Mh,-Th]);function Mp(t,e){var i=kh(t),n=i>0,r=Dh(i)>Sh;function o(t,e){return kh(t)*kh(e)>i}function s(t,e,n){var r=[1,0,0],o=Yh(Xh(t),Xh(e)),s=Zh(o,o),a=o[0],l=s-a*a;if(!l)return!n&&t;var c=i*s/l,u=-i*a/l,h=Yh(r,o),p=Jh(r,c);Qh(p,Jh(o,u));var d=h,f=Zh(p,d),m=Zh(d,d),g=f*f-m*(Zh(p,p)-1);if(!(g<0)){var y=Bh(g),v=Jh(d,(-f-y)/m);if(Qh(v,p),v=qh(v),!n)return v;var _,x=t[0],b=e[0],w=t[1],A=e[1];b<x&&(_=x,x=b,b=_);var E=b-x,S=Dh(E-Mh)<Sh;if(!S&&A<w&&(_=w,w=A,A=_),S||E<Sh?S?w+A>0^v[1]<(Dh(v[0]-x)<Sh?w:A):w<=v[1]&&v[1]<=A:E>Mh^(x<=v[0]&&v[0]<=b)){var M=Jh(d,(-f+y)/m);return Qh(M,p),[v,qh(M)]}}}function a(e,i){var r=n?t:Mh-t,o=0;return e<-r?o|=1:e>r&&(o|=2),i<-r?o|=4:i>r&&(o|=8),o}return wp(o,(function(t){var e,i,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(h,p){var d,f=[h,p],m=o(h,p),g=n?m?0:a(h,p):m?a(h+(h<0?Mh:-Mh),p):0;if(!e&&(c=l=m)&&t.lineStart(),m!==l&&(!(d=s(e,f))||sp(e,d)||sp(f,d))&&(f[0]+=Sh,f[1]+=Sh,m=o(f[0],f[1])),m!==l)u=0,m?(t.lineStart(),d=s(f,e),t.point(d[0],d[1])):(d=s(e,f),t.point(d[0],d[1]),t.lineEnd()),e=d;else if(r&&e&&n^m){var y;g&i||!(y=s(f,e,!0))||(u=0,n?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!m||e&&sp(e,f)||t.point(f[0],f[1]),e=f,l=m,i=g},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return u|(c&&l)<<1}}}),(function(i,n,r,o){!function(t,e,i,n,r,o){if(i){var s=kh(e),a=Nh(e),l=n*i;null==r?(r=e+n*Ch,o=e-l/2):(r=rp(s,r),o=rp(s,o),(n>0?r<o:r>o)&&(r+=n*Ch));for(var c,u=r;n>0?u>o:u<o;u-=l)c=qh([s,-a*kh(u),-a*Nh(u)]),t.point(c[0],c[1])}}(o,t,e,r,i,n)}),n?[0,-t]:[-Mh,t-Mh])}function Tp(t){return function(e){var i=new Ip;for(var n in t)i[n]=t[n];return i.stream=e,i}}function Ip(){}function Cp(t,e,i){var n=e[1][0]-e[0][0],r=e[1][1]-e[0][1],o=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=o&&t.clipExtent(null),function(t,e){t&&Gh.hasOwnProperty(t.type)?Gh[t.type](t,e):Uh(t,e)}(i,t.stream(bp));var s=bp.result(),a=Math.min(n/(s[1][0]-s[0][0]),r/(s[1][1]-s[0][1])),l=+e[0][0]+(n-a*(s[1][0]+s[0][0]))/2,c=+e[0][1]+(r-a*(s[1][1]+s[0][1]))/2;return null!=o&&t.clipExtent(o),t.scale(150*a).translate([l,c])}Ip.prototype={constructor:Ip,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Pp=16,Lp=kh(30*Lh);function Dp(t,e){return+e?function(t,e){function i(n,r,o,s,a,l,c,u,h,p,d,f,m,g){var y=c-n,v=u-r,_=y*y+v*v;if(_>4*e&&m--){var x=s+p,b=a+d,w=l+f,A=Bh(x*x+b*b+w*w),E=Fh(w/=A),S=Dh(Dh(w)-1)<Sh||Dh(o-h)<Sh?(o+h)/2:Oh(b,x),M=t(S,E),T=M[0],I=M[1],C=T-n,P=I-r,L=v*C-y*P;(L*L/_>e||Dh((y*C+v*P)/_-.5)>.3||s*p+a*d+l*f<Lp)&&(i(n,r,o,s,a,l,T,I,S,x/=A,b/=A,w,m,g),g.point(T,I),i(T,I,S,x,b,w,c,u,h,p,d,f,m,g))}}return function(e){var n,r,o,s,a,l,c,u,h,p,d,f,m={point:g,lineStart:y,lineEnd:_,polygonStart:function(){e.polygonStart(),m.lineStart=x},polygonEnd:function(){e.polygonEnd(),m.lineStart=y}};function g(i,n){i=t(i,n),e.point(i[0],i[1])}function y(){u=NaN,m.point=v,e.lineStart()}function v(n,r){var o=Xh([n,r]),s=t(n,r);i(u,h,c,p,d,f,u=s[0],h=s[1],c=n,p=o[0],d=o[1],f=o[2],Pp,e),e.point(u,h)}function _(){m.point=g,e.lineEnd()}function x(){y(),m.point=b,m.lineEnd=w}function b(t,e){v(n=t,e),r=u,o=h,s=p,a=d,l=f,m.point=v}function w(){i(u,h,c,p,d,f,r,o,n,s,a,l,Pp,e),m.lineEnd=_,_()}return m}}(t,e):function(t){return Tp({point:function(e,i){e=t(e,i),this.stream.point(e[0],e[1])}})}(t)}var Rp=Tp({point:function(t,e){this.stream.point(t*Lh,e*Lh)}});function Op(t){return function(t){var e,i,n,r,o,s,a,l,c,u,h=150,p=480,d=250,f=0,m=0,g=0,y=0,v=0,_=null,x=Sp,b=null,w=gp,A=.5,E=Dp(T,A);function S(t){return[(t=o(t[0]*Lh,t[1]*Lh))[0]*h+i,n-t[1]*h]}function M(t){return(t=o.invert((t[0]-i)/h,(n-t[1])/h))&&[t[0]*Ph,t[1]*Ph]}function T(t,r){return[(t=e(t,r))[0]*h+i,n-t[1]*h]}function I(){o=$h(r=function(t,e,i){return(t%=Ch)?e||i?$h(ip(t),np(e,i)):ip(t):e||i?np(e,i):tp}(g,y,v),e);var t=e(f,m);return i=p-t[0]*h,n=d+t[1]*h,C()}function C(){return c=u=null,S}return S.stream=function(t){return c&&u===t?c:c=Rp(x(r,E(w(u=t))))},S.clipAngle=function(t){return arguments.length?(x=+t?Mp(_=t*Lh,6*Lh):(_=null,Sp),C()):_*Ph},S.clipExtent=function(t){return arguments.length?(w=null==t?(b=s=a=l=null,gp):fp(b=+t[0][0],s=+t[0][1],a=+t[1][0],l=+t[1][1]),C()):null==b?null:[[b,s],[a,l]]},S.scale=function(t){return arguments.length?(h=+t,I()):h},S.translate=function(t){return arguments.length?(p=+t[0],d=+t[1],I()):[p,d]},S.center=function(t){return arguments.length?(f=t[0]%360*Lh,m=t[1]%360*Lh,I()):[f*Ph,m*Ph]},S.rotate=function(t){return arguments.length?(g=t[0]%360*Lh,y=t[1]%360*Lh,v=t.length>2?t[2]%360*Lh:0,I()):[g*Ph,y*Ph,v*Ph]},S.precision=function(t){return arguments.length?(E=Dp(T,A=t*t),C()):Bh(A)},S.fitExtent=function(t,e){return Cp(S,t,e)},S.fitSize=function(t,e){return function(t,e,i){return Cp(t,[[0,0],e],i)}(S,t,e)},function(){return e=t.apply(this,arguments),S.invert=e.invert&&M,I()}}((function(){return t}))()}function kp(t){return function(e,i){var n=kh(e),r=kh(i),o=t(n*r);return[o*r*Nh(e),o*Nh(i)]}}function Np(t){return function(e,i){var n=Bh(e*e+i*i),r=t(n),o=Nh(r),s=kh(r);return[Oh(e*o,n*s),Fh(n&&i*o/n)]}}kp((function(t){return Bh(2/(1+t))})).invert=Np((function(t){return 2*Fh(t/2)}));var Bp,zp=kp((function(t){return(t=zh(t))&&t/Nh(t)}));function Fp(){return Op(zp).scale(79.4188).clipAngle(179.999)}function Vp(t,e){return[t,e]}function Up(t,e,i){var n=(i=i||{}).units||"kilometers",r=i.steps||8;if(!t)throw new Error("geojson is required");if("object"!=typeof i)throw new Error("options must be an object");if("number"!=typeof r)throw new Error("steps must be an number");if(void 0===e)throw new Error("radius is required");if(r<=0)throw new Error("steps must be greater than 0");var o=[];switch(t.type){case"GeometryCollection":return Y(t,(function(t){var i=Gp(t,e,n,r);i&&o.push(i)})),N(o);case"FeatureCollection":return X(t,(function(t){var i=Gp(t,e,n,r);i&&X(i,(function(t){t&&o.push(t)}))})),N(o)}return Gp(t,e,n,r)}function Gp(t,e,i,n){var r=t.properties||{},o="Feature"===t.type?t.geometry:t;if("GeometryCollection"===o.type){var s=[];return Y(t,(function(t){var r=Gp(t,e,i,n);r&&s.push(r)})),N(s)}var a=function(t){var e=bt(t).geometry.coordinates,i=[-e[0],-e[1]];return Fp().rotate(i).scale(P)}(o),l={type:o.type,coordinates:Hp(o.coordinates,a)},c=(new al).read(l),u=V(U(e,i),"meters"),h=tu.bufferOp(c,u,n);if(!jp((h=(new ll).write(h)).coordinates))return D({type:h.type,coordinates:Wp(h.coordinates,a)},r)}function jp(t){return Array.isArray(t[0])?jp(t[0]):isNaN(t[0])}function Hp(t,e){return"object"!=typeof t[0]?e(t):t.map((function(t){return Hp(t,e)}))}function Wp(t,e){return"object"!=typeof t[0]?e.invert(t):t.map((function(t){return Wp(t,e)}))}function qp(t,e,i){void 0===i&&(i={});var n=et(t),r=et(e),o=No.intersection(n.coordinates,r.coordinates);return 0===o.length?null:1===o.length?O(o[0],i.properties):F(o,i.properties)}function Xp(t,e,i,n,r,o){for(var s=[],a=0;a<6;a++){var l=t[0]+e*r[a],c=t[1]+i*o[a];s.push([l,c])}return s.push(s[0].slice()),O([s],n)}function Zp(t,e,i,n,r,o){for(var s=[],a=0;a<6;a++){var l=[];l.push(t),l.push([t[0]+e*r[a],t[1]+i*o[a]]),l.push([t[0]+e*r[(a+1)%6],t[1]+i*o[(a+1)%6]]),l.push(t),s.push(O([l],n))}return s}function Yp(t,e,i){return void 0===i&&(i={}),function(t,e,i,n){void 0===n&&(n={});for(var r=[],o=t[0],s=t[1],a=t[2],l=t[3],c=e/pt([o,s],[a,s],n)*(a-o),u=i/pt([o,s],[o,l],n)*(l-s),h=a-o,p=l-s,d=Math.floor(h/c),f=Math.floor(p/u),m=(p-f*u)/2,g=o+(h-d*c)/2,y=0;y<d;y++){for(var v=s+m,_=0;_<f;_++){var x=O([[[g,v],[g,v+u],[g+c,v+u],[g+c,v],[g,v]]],n.properties);n.mask?jr(n.mask,x)&&r.push(x):r.push(x),v+=u}g+=c}return N(r)}(t,e,e,i)}function Qp(t,e,i){if("object"!=typeof(i=i||{}))throw new Error("options is invalid");var n=i.gridType,r=i.property,o=i.weight;if(!t)throw new Error("points is required");if(function(t,e,i){if(!t)throw new Error("No featureCollection passed");if(!i)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+i+", FeatureCollection required");for(var n=0,r=t.features;n<r.length;n++){var o=r[n];if(!o||"Feature"!==o.type||!o.geometry)throw new Error("Invalid input to "+i+", Feature with geometry required");if(!o.geometry||o.geometry.type!==e)throw new Error("Invalid input to "+i+": must be a "+e+", given "+o.geometry.type)}}(t,"Point","input must contain Points"),!e)throw new Error("cellSize is required");if(void 0!==o&&"number"!=typeof o)throw new Error("weight must be a number");r=r||"elevation",n=n||"square",o=o||1;var s,a=K(t);switch(n){case"point":case"points":s=Se(a,e,i);break;case"square":case"squares":s=Yp(a,e,i);break;case"hex":case"hexes":s=function(t,e,i){void 0===i&&(i={});var n=JSON.stringify(i.properties||{}),r=t[0],o=t[1],s=t[2],a=t[3],l=(o+a)/2,c=(r+s)/2,u=2*e/pt([r,l],[s,l],i)*(s-r),h=2*e/pt([c,o],[c,a],i)*(a-o),p=u/2,d=2*p,f=Math.sqrt(3)/2*h,m=s-r,g=a-o,y=3/4*d,v=f,_=(m-d)/(d-p/2),x=Math.floor(_),b=(x*y-p/2-m)/2-p/2+y/2,w=Math.floor((g-f)/f),A=(g-w*f)/2,E=w*f-g>f/2;E&&(A-=f/4);for(var S=[],M=[],T=0;T<6;T++){var I=2*Math.PI/6*T;S.push(Math.cos(I)),M.push(Math.sin(I))}for(var C=[],P=0;P<=x;P++)for(var L=0;L<=w;L++){var D=P%2==1;if(!(0===L&&D||0===L&&E)){var R=P*y+r-b,O=L*v+o+A;if(D&&(O-=f/2),!0===i.triangles)Zp([R,O],u/2,h/2,JSON.parse(n),S,M).forEach((function(t){i.mask?qp(i.mask,t)&&C.push(t):C.push(t)}));else{var k=Xp([R,O],u/2,h/2,JSON.parse(n),S,M);i.mask?qp(i.mask,k)&&C.push(k):C.push(k)}}}return N(C)}(a,e,i);break;case"triangle":case"triangles":s=function(t,e,i){void 0===i&&(i={});for(var n=[],r=e/pt([t[0],t[1]],[t[2],t[1]],i)*(t[2]-t[0]),o=e/pt([t[0],t[1]],[t[0],t[3]],i)*(t[3]-t[1]),s=0,a=t[0];a<=t[2];){for(var l=0,c=t[1];c<=t[3];){var u=null,h=null;s%2==0&&l%2==0?(u=O([[[a,c],[a,c+o],[a+r,c],[a,c]]],i.properties),h=O([[[a,c+o],[a+r,c+o],[a+r,c],[a,c+o]]],i.properties)):s%2==0&&l%2==1?(u=O([[[a,c],[a+r,c+o],[a+r,c],[a,c]]],i.properties),h=O([[[a,c],[a,c+o],[a+r,c+o],[a,c]]],i.properties)):l%2==0&&s%2==1?(u=O([[[a,c],[a,c+o],[a+r,c+o],[a,c]]],i.properties),h=O([[[a,c],[a+r,c+o],[a+r,c],[a,c]]],i.properties)):l%2==1&&s%2==1&&(u=O([[[a,c],[a,c+o],[a+r,c],[a,c]]],i.properties),h=O([[[a,c+o],[a+r,c+o],[a+r,c],[a,c+o]]],i.properties)),i.mask?(qp(i.mask,u)&&n.push(u),qp(i.mask,h)&&n.push(h)):(n.push(u),n.push(h)),c+=o,l++}s++,a+=r}return N(n)}(a,e,i);break;default:throw new Error("invalid gridType")}var l=[];return X(s,(function(e){var s=0,a=0;X(t,(function(t){var l,c=pt("point"===n?e:wt(e),t,i);if(void 0!==r&&(l=t.properties[r]),void 0===l&&(l=t.geometry.coordinates[2]),void 0===l)throw new Error("zValue is missing");0===c&&(s=l);var u=1/Math.pow(c,o);a+=u,s+=u*l}));var c=dt(e);c.properties[r]=s/a,l.push(c)})),N(l)}zp.invert=Np((function(t){return t})),Vp.invert=Vp;class Jp{_data;constructor(t,e){const i=[];t.forEach((t=>{let n=t.position||[t.lng,t.lat];"multiPoint"!=e&&"multiLineString"!=e&&"multiPolygon"!=e||(n=[n]);const r={point:R,lineString:k,polygon:O,multiPoint:z,multiLineString:B,multiPolygon:F}[e](n,{...t.userData,...t});!function(t,e,i){if(!t)throw new Error("No feature passed");if(!i)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+i+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+i+": must be a "+e+", given "+t.geometry.type)}(r,e.charAt(0).toUpperCase()+e.slice(1),"a"),i.push(r)})),this._data=N(i)}}function Kp(t){const e=K(t);return[[e[0],e[1]],[e[2],e[3]]]}function $p(t,e){return new Jp(t,e)._data}async function td(t,e){const i=[],n=t=>{const n=K(t);if(i.push([n[0],n[1]],[n[2],n[3]]),e)if(hNt.value){const t=cNt.value.cameraForBounds(i);cNt.value.flyTo({center:t.center,zoom:Math.floor(t.zoom)})}else cNt.value.fitBounds(i)};if("string"==typeof t){n(cNt.value.getSource(t)._data)}else n(t);return i}!function(t){t[t.solid=0]="solid",t[t.dash=1]="dash",t[t.glowPower=2]="glowPower",t[t.FlowColor=3]="FlowColor",t[t.FlowColorLight=4]="FlowColorLight",t[t.RoadLine=5]="RoadLine",t[t.VerticalFlyingLine=6]="VerticalFlyingLine"}(Bp||(Bp={}));class ed extends(m(C)){options;id;step=200;arcs=[];bbox;defaultStyle;FlowColorLightPercent=.4;constructor(t,e,i){super(),this.id=i||d(0,3),this.options=Object.assign({width:1,color:"#ffffff",labelOption:{},speed:10,type:"solid",isShow:!0},e),this.step=this.options.flowAnimationSpeed?100*(1-this.options.flowAnimationSpeed)*5:300,this.bbox=Kp(t),this.options.image&&cNt.value.loadImage(this.options.image,((t,e)=>{if(t)throw t;cNt.value.hasImage(this.id+"icon")||cNt.value.addImage(this.id+"icon",e)})),"RoadLine"==this.options.type?(this.FlowColorLightPercent=this.options.FlowColorLightPercent?1-this.options.FlowColorLightPercent:.4,cNt.value.addSource(this.id+"source",{type:"geojson",lineMetrics:!0,data:null}),this._split(t),setTimeout((()=>{this._animation()}))):cNt.value.addSource(this.id+"source",{type:"geojson",lineMetrics:!0,data:t});let n=[];"FlowColor"==this.options.type?n=["interpolate",["linear"],["line-progress"],.14,"red",.28,"orange",.42,"yellow",.56,"green",.7,"blue",.84,"cyan",1,"purple"]:"RoadLine"==this.options.type&&(n=["interpolate",["linear"],["line-progress"],0,"rgba(255, 255, 255, 0)",this.FlowColorLightPercent,"rgba(255, 255, 255, 0.1)",1,this.options.color]),this.defaultStyle=n;let r={"line-pattern":this.options.image?this.id+"icon":"","line-width":this.options.width,"line-dasharray":"dash"==this.options.type?[2,2]:[2,0]};0!=n.length?r["line-gradient"]=n:r["line-color"]=this.options.color,!uNt.value||"EPSG:4326"!=uNt.value&&"EPSG:4490"!=uNt.value||(r={"line-width":this.options.width,"line-dasharray":"dash"==this.options.type?[2,2]:[2,0],"line-color":this.options.color}),cNt.value.addLayer({id:this.id,source:this.id+"source",type:"line",layout:{visibility:this.options.isShow?"visible":"none","line-join":"round","line-cap":"round"},paint:r}),this.options.highlightColor&&(cNt.value.getLayer(this.id+"Highlight")||(cNt.value.addSource(this.id+"Highlightsource",{type:"geojson",lineMetrics:!0,data:t}),cNt.value.addLayer({id:this.id+"Highlight",source:this.id+"Highlightsource",type:"line",filter:["in","id",""],layout:{visibility:this.options.isShow?"visible":"none","line-join":"round","line-cap":"round"},paint:{"line-color":this.options.highlightColor,"line-width":this.options.width}})))}_split(t){for(const e of t.features){const t=Me(e,ye(e)/this.step);this.arcs.push(t)}}_animation(){const t={type:"FeatureCollection",features:[]};let e=0;const i=cNt.value.getSource(this.id+"source"),n=()=>{e>=this.step&&(e=0,t.features.forEach((t=>t.geometry.coordinates.length=0))),this.arcs.forEach(((i,n)=>{t.features[n]||(t.features[n]={type:"Feature",geometry:{type:"LineString",coordinates:[]}});t.features[n].geometry.coordinates.push(...i.features[e].geometry.coordinates)})),i.setData(t),requestAnimationFrame(n),e++};n()}highlight(t){cNt.value.getLayer(this.id+"Highlight")&&cNt.value.setFilter(this.id+"Highlight",["in","id",t])}removeHighlight(){cNt.value.getLayer(this.id+"Highlight")&&cNt.value.setFilter(this.id+"Highlight",["in","id",""])}update(t){let e=t;this._isFeatureCollectionData(t)&&(e=$p(t,"multiLineString")),this.bbox=Kp(e),this.updateSource("source",e),this.updateSource("Highlightsource",e)}updateSource(t,e){const i=cNt.value.getSource(this.id+t);i&&i.setData(e)}_isFeatureCollectionData(t){return t instanceof Array}}class id extends(m(C)){id;sourceId;_options;_data;bbox;_loadImagesList;_layout;_paint;hoveredPolygonId;constructor(t,e,i){super(),this.id=i||d(0,5),this.sourceId=this.id+"source",this._data=t,this.hoveredPolygonId=null,this.bbox=Kp(t),this._options=Object.assign({scale:1,color:"#ffffff",imageName:"",highlightImageName:"",cluster:!1,clusterRadius:0,clusterProperties:{},clusterMinPoints:2,iconOffset:[0,0],symbolPlacement:"point",symbolSpacing:250,isShow:!0,minimumLevel:0,maximumLevel:24},e);const n={...e,...e?e.labelOption:{}};this._options.labelOption=Object.assign({pixelOffset:[0,0],allShow:!0,fontSize:"30px",fontColor:"#fff",fontFamily:["Microsoft YaHei"],horizontalOrigin:"center",verticalOrigin:"center",outlineColor:"rgba(0, 0, 0, 0)",outlineWidth:0,outlineBlur:0,iconOverlap:!1,textOverlap:!1},n||{}),this._layout={visibility:this._options.isShow?"visible":"none","icon-size":this._options.scale,"text-field":["get","text"],"text-size":this.getTextSize(),"text-offset":this._options.labelOption.pixelOffset,"icon-offset":this._options.iconOffset,"text-font":this._options.labelOption.fontFamily,"text-justify":this._options.labelOption.horizontalOrigin,"text-anchor":this._options.labelOption.verticalOrigin,"icon-allow-overlap":this.getOver("iconOverlap"),"text-allow-overlap":this.getOver("textOverlap"),"symbol-placement":this._options.symbolPlacement,"symbol-spacing":this._options.symbolSpacing},this._paint={"text-color":this._options.labelOption.fontColor,"text-opacity":this._options.labelOption.allShow?1:0,"text-halo-color":this._options.labelOption.outlineColor,"text-halo-width":this._options.labelOption.outlineWidth,"text-halo-blur":this._options.labelOption.outlineBlur},this.renderSource(),this._loadImagesList=[],this._options.highlightImage&&this.addImage("highlightImage"),this._options.image&&this.addImage("image"),this._options.highlightImage||this._options.image||this.render()}addImage(t){let e=[];const i="string"==typeof this._options[t];if(i){e=[{[d(0,2)]:this._options[t]}]}else this._options[t].length&&(e=this._options[t]);const n=[];e.forEach((e=>{const r=new Promise(((n,r)=>{const o=Object.keys(e).length?Object.keys(e)[0]:d(0,2),s=e[o]?e[o]:e;"image"==t?this._layout["icon-image"]=i?o:["get","imageName"]:this._options.highlightImageName=i?o:["get","highlightImageName"],cNt.value.loadImage(s,((t,e)=>{t?r(t):cNt.value.hasImage(o)?r(`An image name named "${o}" already exists`):(cNt.value.addImage(o,e),this._loadImagesList.push(o),n())}))}));n.push(r)})),Promise.all(n).then((()=>{"image"==t&&this.render()})).catch((t=>{console.error("Error loading images:",t)}))}renderSource(){const t={type:"geojson",data:this._data,cluster:this._options.cluster,clusterRadius:this._options.clusterRadius,clusterProperties:this._options.clusterProperties,clusterMinPoints:this._options.clusterMinPoints};this._options.clusterMaxZoom&&(t.clusterMaxZoom=this._options.clusterMaxZoom),"massivePoints"==this._options.type&&(t.cluster=!0,t.clusterRadius=0),cNt.value.addSource(this.sourceId,t)}render(){const t={id:this.id,source:this.sourceId,type:"symbol",layout:this._layout,paint:this._paint,minzoom:this._options.minimumLevel,maxzoom:this._options.maximumLevel};"assemblage"==this._options.type&&(t.filter=["!",["has","point_count"]]),cNt.value.addLayer(t),this._options.labelOption&&0==this._options.labelOption.allShow&&(cNt.value.on("mouseenter",this.id,(t=>this.mouseenter(t))),cNt.value.on("mouseleave",this.id,(()=>this.mouseleave())))}mouseenter(t){this.hoveredPolygonId=t.features[0].properties.id;cNt.value.queryRenderedFeatures(t.point,{layers:[this.id]})[0].properties.text&&this.hoveredPolygonId?null!=cNt.value.getPaintProperty(this.id,"text-opacity")&&cNt.value.setPaintProperty(this.id,"text-opacity",["case",["boolean",["==",["get","id"],this.hoveredPolygonId],!1],1,0]):this.hoveredPolygonId}mouseleave(){null!==this.hoveredPolygonId&&cNt.value.setPaintProperty(this.id,"text-opacity",0),this.hoveredPolygonId=null}highlight(t){if(this._options.highlightImageName){const e=cNt.value.querySourceFeatures(this.sourceId,{filter:["in","id",t]});if(!e.length)throw new Error(`The highlight id is ${t} does not exist`);{const t=e[0];cNt.value.addSource(this.id+"Highlightsource",{type:"geojson",data:t});let i={visibility:this._options.isShow?"visible":"none","icon-image":this._options.highlightImageName,"icon-size":this._options.scale,"text-field":["get","text"],"text-size":this.getTextSize(),"icon-offset":this._options.iconOffset,"icon-allow-overlap":this.getOver("iconOverlap"),"text-allow-overlap":this.getOver("textOverlap"),"symbol-placement":this._options.symbolPlacement,"symbol-spacing":this._options.symbolSpacing};this._options.labelOption&&(i={visibility:this._options.isShow?"visible":"none","icon-image":this._options.highlightImageName,"icon-size":this._options.scale,"text-field":["get","text"],"text-size":this.getTextSize(),"text-offset":this._options.labelOption.pixelOffset,"icon-offset":this._options.iconOffset,"text-font":this._options.labelOption.fontFamily,"text-justify":this._options.labelOption.horizontalOrigin,"text-anchor":this._options.labelOption.verticalOrigin,"icon-allow-overlap":this.getOver("iconOverlap"),"text-allow-overlap":this.getOver("textOverlap"),"symbol-placement":this._options.symbolPlacement,"symbol-spacing":this._options.symbolSpacing});let n={};this._options.labelOption&&(n={"text-color":this._options.labelOption.fontColor,"text-opacity":this._options.labelOption.allShow?1:0,"text-halo-color":this._options.labelOption.outlineColor,"text-halo-width":this._options.labelOption.outlineWidth,"text-halo-blur":this._options.labelOption.outlineBlur}),cNt.value.addLayer({id:this.id+"Highlight",source:this.id+"Highlightsource",type:"symbol",layout:i,paint:n})}}}removeHighlight(){cNt.value.removeLayer(this.id+"Highlight"),cNt.value.removeSource(this.id+"Highlightsource")}destroy(){this._loadImagesList.forEach((t=>{cNt.value.hasImage(t)&&cNt.value.removeImage(t)})),super.destroy()}_isFeatureCollectionData(t){return t instanceof Array}update(t){let e=t;this._isFeatureCollectionData(t)&&(e=$p(t,"point")),this.bbox=Kp(e),this.updateSource("source",e),this.updateSource("Highlightsource",e)}updateSource(t,e){const i=cNt.value.getSource(this.id+t);if(i)i.setData(e);else if("source"==t)throw new Error("This source does not exist")}getTextSize(){if(this._options.labelOption)return"number"==typeof this._options.labelOption.fontSize?this._options.labelOption.fontSize:Number(Number(this._options.labelOption.fontSize?this._options.labelOption.fontSize.split("px")[0]:"0")*Number(this._options.scale))}getOver(t){let e=!1;return"massivePoints"==this._options.type?e=!0:this._options.labelOption&&(e=this._options.labelOption[t]),e}}class nd extends(m(C)){id;sourceId;_options;_data;bbox;constructor(t,e,i){super(),this.id=i||d(0,5),this.sourceId=this.id+"source",this._data=t,this.bbox=Kp(t),this._options=Object.assign({color:"rgb(255,0,0)",pixelSize:20,outlineColor:"rgb(255,0,0)",outlineWidth:0,isShow:!0},e),this._options.labelOption=Object.assign({pixelOffset:[0,0],allShow:!0,fontSize:"30px",fontColor:"#fff",fontFamily:["Microsoft YaHei"],horizontalOrigin:"center",verticalOrigin:"center",outlineColor:"#fff",outlineWidth:0,outlineBlur:0},e?e.labelOption:{}),this.reander()}reander(){const t={type:"geojson",data:this._data};cNt.value.addSource(this.sourceId,t),cNt.value.addLayer({id:this.id,type:"circle",source:`${this.id}source`,layout:{visibility:this._options.isShow?"visible":"none"},paint:{"circle-color":this._options.color,"circle-radius":this._options.pixelSize,"circle-stroke-color":this._options.outlineColor,"circle-stroke-width":this._options.outlineWidth}}),cNt.value.addLayer({id:`${this.id}-label`,type:"symbol",source:`${this.id}source`,layout:{visibility:this._options.isShow?"visible":"none","text-field":["get","text"],"text-offset":this._options.labelOption?this._options.labelOption.pixelOffset:null,"text-font":this._options.labelOption?this._options.labelOption.fontFamily:null,"text-justify":this._options.labelOption?this._options.labelOption.horizontalOrigin:null,"text-anchor":this._options.labelOption?this._options.labelOption.verticalOrigin:null,"text-size":Number(this._options.labelOption&&this._options.labelOption.fontSize?this._options.labelOption.fontSize.split("px")[0]:""),"text-allow-overlap":!0},paint:{"text-color":this._options.labelOption?this._options.labelOption.fontColor:null,"text-halo-color":this._options.labelOption?this._options.labelOption.outlineColor:null,"text-halo-width":this._options.labelOption?this._options.labelOption.outlineWidth:null,"text-opacity":this._options.labelOption&&this._options.labelOption.allShow?1:0}}),this._options.labelOption&&0==this._options.labelOption.allShow&&(cNt.value.on("mouseenter",this.id,(t=>this.mouseenter(t))),cNt.value.on("mouseleave",this.id,(()=>this.mouseleave())))}mouseenter(t){const e=t.features[0].properties.id;cNt.value.queryRenderedFeatures(t.point,{layers:[`${this.id}`]})[0].properties.text&&cNt.value.setPaintProperty(`${this.id}-label`,"text-opacity",["case",["boolean",["==",["get","id"],e],!1],1,0])}mouseleave(){cNt.value.setPaintProperty(`${this.id}-label`,"text-opacity",0)}destroy(){cNt.value.removeLayer(`${this.id}-label`),this._options.labelOption&&0==this._options.labelOption.allShow&&(cNt.value.off("mouseenter",this.id,(t=>this.mouseenter(t))),cNt.value.off("mouseleave",this.id,(()=>this.mouseleave()))),super.destroy()}}function rd(t,e,i){let n;return n=p(t)?$p(t,"point"):t,new id(n,e,i)}var od={exports:{}},sd={exports:{}},ad={exports:{}};!function(t,e){!function(t){const e="132",i=100,n=300,r=301,o=302,s=303,a=304,l=306,c=307,u=1e3,h=1001,p=1002,d=1003,f=1004,m=1005,g=1006,y=1007,v=1008,_=1009,x=1012,b=1014,w=1015,A=1016,E=1020,S=1022,M=1023,T=1026,I=1027,C=33776,P=33777,L=33778,D=33779,R=35840,O=35841,k=35842,N=35843,B=37492,z=37496,F=2300,V=2301,U=2302,G=2400,j=2401,H=2402,W=2500,q=2501,X=3e3,Z=3001,Y=3007,Q=3002,J=3004,K=3005,$=3006,tt=7680,et=35044,it=35048,nt="300 es";class rt{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});const i=this._listeners;void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&i[t].push(e)}hasEventListener(t,e){if(void 0===this._listeners)return!1;const i=this._listeners;return void 0!==i[t]&&-1!==i[t].indexOf(e)}removeEventListener(t,e){if(void 0===this._listeners)return;const i=this._listeners[t];if(void 0!==i){const t=i.indexOf(e);-1!==t&&i.splice(t,1)}}dispatchEvent(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const i=e.slice(0);for(let e=0,n=i.length;e<n;e++)i[e].call(this,t);t.target=null}}}const ot=[];for(let t=0;t<256;t++)ot[t]=(t<16?"0":"")+t.toString(16);let st=1234567;const at=Math.PI/180,lt=180/Math.PI;function ct(){const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(ot[255&t]+ot[t>>8&255]+ot[t>>16&255]+ot[t>>24&255]+"-"+ot[255&e]+ot[e>>8&255]+"-"+ot[e>>16&15|64]+ot[e>>24&255]+"-"+ot[63&i|128]+ot[i>>8&255]+"-"+ot[i>>16&255]+ot[i>>24&255]+ot[255&n]+ot[n>>8&255]+ot[n>>16&255]+ot[n>>24&255]).toUpperCase()}function ut(t,e,i){return Math.max(e,Math.min(i,t))}function ht(t,e){return(t%e+e)%e}function pt(t,e,i){return(1-i)*t+i*e}function dt(t){return 0==(t&t-1)&&0!==t}function ft(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function mt(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}var gt=Object.freeze({__proto__:null,DEG2RAD:at,RAD2DEG:lt,generateUUID:ct,clamp:ut,euclideanModulo:ht,mapLinear:function(t,e,i,n,r){return n+(t-e)*(r-n)/(i-e)},inverseLerp:function(t,e,i){return t!==e?(i-t)/(e-t):0},lerp:pt,damp:function(t,e,i,n){return pt(t,e,1-Math.exp(-i*n))},pingpong:function(t,e=1){return e-Math.abs(ht(t,2*e)-e)},smoothstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)},smootherstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){return void 0!==t&&(st=t%2147483647),st=16807*st%2147483647,(st-1)/2147483646},degToRad:function(t){return t*at},radToDeg:function(t){return t*lt},isPowerOfTwo:dt,ceilPowerOfTwo:ft,floorPowerOfTwo:mt,setQuaternionFromProperEuler:function(t,e,i,n,r){const o=Math.cos,s=Math.sin,a=o(i/2),l=s(i/2),c=o((e+n)/2),u=s((e+n)/2),h=o((e-n)/2),p=s((e-n)/2),d=o((n-e)/2),f=s((n-e)/2);switch(r){case"XYX":t.set(a*u,l*h,l*p,a*c);break;case"YZY":t.set(l*p,a*u,l*h,a*c);break;case"ZXZ":t.set(l*h,l*p,a*u,a*c);break;case"XZX":t.set(a*u,l*f,l*d,a*c);break;case"YXY":t.set(l*d,a*u,l*f,a*c);break;case"ZYZ":t.set(l*f,l*d,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}});class yt{constructor(t=0,e=0){this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,i=this.y,n=t.elements;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e,i){return void 0!==i&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const i=Math.cos(e),n=Math.sin(e),r=this.x-t.x,o=this.y-t.y;return this.x=r*i-o*n+t.x,this.y=r*n+o*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}}yt.prototype.isVector2=!0;class vt{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(t,e,i,n,r,o,s,a,l){const c=this.elements;return c[0]=t,c[1]=n,c[2]=s,c[3]=e,c[4]=r,c[5]=a,c[6]=i,c[7]=o,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}extractBasis(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,n=e.elements,r=this.elements,o=i[0],s=i[3],a=i[6],l=i[1],c=i[4],u=i[7],h=i[2],p=i[5],d=i[8],f=n[0],m=n[3],g=n[6],y=n[1],v=n[4],_=n[7],x=n[2],b=n[5],w=n[8];return r[0]=o*f+s*y+a*x,r[3]=o*m+s*v+a*b,r[6]=o*g+s*_+a*w,r[1]=l*f+c*y+u*x,r[4]=l*m+c*v+u*b,r[7]=l*g+c*_+u*w,r[2]=h*f+p*y+d*x,r[5]=h*m+p*v+d*b,r[8]=h*g+p*_+d*w,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],o=t[4],s=t[5],a=t[6],l=t[7],c=t[8];return e*o*c-e*s*l-i*r*c+i*s*a+n*r*l-n*o*a}invert(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],o=t[4],s=t[5],a=t[6],l=t[7],c=t[8],u=c*o-s*l,h=s*a-c*r,p=l*r-o*a,d=e*u+i*h+n*p;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);const f=1/d;return t[0]=u*f,t[1]=(n*l-c*i)*f,t[2]=(s*i-n*o)*f,t[3]=h*f,t[4]=(c*e-n*a)*f,t[5]=(n*r-s*e)*f,t[6]=p*f,t[7]=(i*a-l*e)*f,t[8]=(o*e-i*r)*f,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,i,n,r,o,s){const a=Math.cos(r),l=Math.sin(r);return this.set(i*a,i*l,-i*(a*o+l*s)+o+t,-n*l,n*a,-n*(-l*o+a*s)+s+e,0,0,1),this}scale(t,e){const i=this.elements;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=e,i[4]*=e,i[7]*=e,this}rotate(t){const e=Math.cos(t),i=Math.sin(t),n=this.elements,r=n[0],o=n[3],s=n[6],a=n[1],l=n[4],c=n[7];return n[0]=e*r+i*a,n[3]=e*o+i*l,n[6]=e*s+i*c,n[1]=-i*r+e*a,n[4]=-i*o+e*l,n[7]=-i*s+e*c,this}translate(t,e){const i=this.elements;return i[0]+=t*i[2],i[3]+=t*i[5],i[6]+=t*i[8],i[1]+=e*i[2],i[4]+=e*i[5],i[7]+=e*i[8],this}equals(t){const e=this.elements,i=t.elements;for(let t=0;t<9;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}clone(){return(new this.constructor).fromArray(this.elements)}}let _t;vt.prototype.isMatrix3=!0;class xt{static getDataURL(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===_t&&(_t=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),_t.width=t.width,_t.height=t.height;const i=_t.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=_t}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}}let bt=0;class wt extends rt{constructor(t=wt.DEFAULT_IMAGE,e=wt.DEFAULT_MAPPING,i=1001,n=1001,r=1006,o=1008,s=1023,a=1009,l=1,c=3e3){super(),Object.defineProperty(this,"id",{value:bt++}),this.uuid=ct(),this.name="",this.image=t,this.mipmaps=[],this.mapping=e,this.wrapS=i,this.wrapT=n,this.magFilter=r,this.minFilter=o,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=a,this.offset=new yt(0,0),this.repeat=new yt(1,1),this.center=new yt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new vt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=c,this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const i={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){const n=this.image;if(void 0===n.uuid&&(n.uuid=ct()),!e&&void 0===t.images[n.uuid]){let e;if(Array.isArray(n)){e=[];for(let t=0,i=n.length;t<i;t++)n[t].isDataTexture?e.push(At(n[t].image)):e.push(At(n[t]))}else e=At(n);t.images[n.uuid]={uuid:n.uuid,url:e}}i.image=n.uuid}return e||(t.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==n)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case u:t.x=t.x-Math.floor(t.x);break;case h:t.x=t.x<0?0:1;break;case p:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case u:t.y=t.y-Math.floor(t.y);break;case h:t.y=t.y<0?0:1;break;case p:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&this.version++}}function At(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?xt.getDataURL(t):t.data?{data:Array.prototype.slice.call(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}wt.DEFAULT_IMAGE=void 0,wt.DEFAULT_MAPPING=n,wt.prototype.isTexture=!0;class Et{constructor(t=0,e=0,i=0,n=1){this.x=t,this.y=e,this.z=i,this.w=n}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,i=this.y,n=this.z,r=this.w,o=t.elements;return this.x=o[0]*e+o[4]*i+o[8]*n+o[12]*r,this.y=o[1]*e+o[5]*i+o[9]*n+o[13]*r,this.z=o[2]*e+o[6]*i+o[10]*n+o[14]*r,this.w=o[3]*e+o[7]*i+o[11]*n+o[15]*r,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,i,n,r;const o=.01,s=.1,a=t.elements,l=a[0],c=a[4],u=a[8],h=a[1],p=a[5],d=a[9],f=a[2],m=a[6],g=a[10];if(Math.abs(c-h)<o&&Math.abs(u-f)<o&&Math.abs(d-m)<o){if(Math.abs(c+h)<s&&Math.abs(u+f)<s&&Math.abs(d+m)<s&&Math.abs(l+p+g-3)<s)return this.set(1,0,0,0),this;e=Math.PI;const t=(l+1)/2,a=(p+1)/2,y=(g+1)/2,v=(c+h)/4,_=(u+f)/4,x=(d+m)/4;return t>a&&t>y?t<o?(i=0,n=.707106781,r=.707106781):(i=Math.sqrt(t),n=v/i,r=_/i):a>y?a<o?(i=.707106781,n=0,r=.707106781):(n=Math.sqrt(a),i=v/n,r=x/n):y<o?(i=.707106781,n=.707106781,r=0):(r=Math.sqrt(y),i=_/r,n=x/r),this.set(i,n,r,e),this}let y=Math.sqrt((m-d)*(m-d)+(u-f)*(u-f)+(h-c)*(h-c));return Math.abs(y)<.001&&(y=1),this.x=(m-d)/y,this.y=(u-f)/y,this.z=(h-c)/y,this.w=Math.acos((l+p+g-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e,i){return void 0!==i&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}Et.prototype.isVector4=!0;class St extends rt{constructor(t,e,i={}){super(),this.width=t,this.height=e,this.depth=1,this.scissor=new Et(0,0,t,e),this.scissorTest=!1,this.viewport=new Et(0,0,t,e),this.texture=new wt(void 0,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.isRenderTargetTexture=!0,this.texture.image={width:t,height:e,depth:1},this.texture.generateMipmaps=void 0!==i.generateMipmaps&&i.generateMipmaps,this.texture.internalFormat=void 0!==i.internalFormat?i.internalFormat:null,this.texture.minFilter=void 0!==i.minFilter?i.minFilter:g,this.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,this.stencilBuffer=void 0!==i.stencilBuffer&&i.stencilBuffer,this.depthTexture=void 0!==i.depthTexture?i.depthTexture:null}setTexture(t){t.image={width:this.width,height:this.height,depth:this.depth},this.texture=t}setSize(t,e,i=1){this.width===t&&this.height===e&&this.depth===i||(this.width=t,this.height=e,this.depth=i,this.texture.image.width=t,this.texture.image.height=e,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return(new this.constructor).copy(this)}copy(t){return this.width=t.width,this.height=t.height,this.depth=t.depth,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.texture.image={...this.texture.image},this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}St.prototype.isWebGLRenderTarget=!0;class Mt extends St{constructor(t,e,i){super(t,e);const n=this.texture;this.texture=[];for(let t=0;t<i;t++)this.texture[t]=n.clone()}setSize(t,e,i=1){if(this.width!==t||this.height!==e||this.depth!==i){this.width=t,this.height=e,this.depth=i;for(let n=0,r=this.texture.length;n<r;n++)this.texture[n].image.width=t,this.texture[n].image.height=e,this.texture[n].image.depth=i;this.dispose()}return this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e),this}copy(t){this.dispose(),this.width=t.width,this.height=t.height,this.depth=t.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this.texture.length=0;for(let e=0,i=t.texture.length;e<i;e++)this.texture[e]=t.texture[e].clone();return this}}Mt.prototype.isWebGLMultipleRenderTargets=!0;class Tt extends St{constructor(t,e,i){super(t,e,i),this.samples=4}copy(t){return super.copy.call(this,t),this.samples=t.samples,this}}Tt.prototype.isWebGLMultisampleRenderTarget=!0;class It{constructor(t=0,e=0,i=0,n=1){this._x=t,this._y=e,this._z=i,this._w=n}static slerp(t,e,i,n){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),i.slerpQuaternions(t,e,n)}static slerpFlat(t,e,i,n,r,o,s){let a=i[n+0],l=i[n+1],c=i[n+2],u=i[n+3];const h=r[o+0],p=r[o+1],d=r[o+2],f=r[o+3];if(0===s)return t[e+0]=a,t[e+1]=l,t[e+2]=c,void(t[e+3]=u);if(1===s)return t[e+0]=h,t[e+1]=p,t[e+2]=d,void(t[e+3]=f);if(u!==f||a!==h||l!==p||c!==d){let t=1-s;const e=a*h+l*p+c*d+u*f,i=e>=0?1:-1,n=1-e*e;if(n>Number.EPSILON){const r=Math.sqrt(n),o=Math.atan2(r,e*i);t=Math.sin(t*o)/r,s=Math.sin(s*o)/r}const r=s*i;if(a=a*t+h*r,l=l*t+p*r,c=c*t+d*r,u=u*t+f*r,t===1-s){const t=1/Math.sqrt(a*a+l*l+c*c+u*u);a*=t,l*=t,c*=t,u*=t}}t[e]=a,t[e+1]=l,t[e+2]=c,t[e+3]=u}static multiplyQuaternionsFlat(t,e,i,n,r,o){const s=i[n],a=i[n+1],l=i[n+2],c=i[n+3],u=r[o],h=r[o+1],p=r[o+2],d=r[o+3];return t[e]=s*d+c*u+a*p-l*h,t[e+1]=a*d+c*h+l*u-s*p,t[e+2]=l*d+c*p+s*h-a*u,t[e+3]=c*d-s*u-a*h-l*p,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,i,n){return this._x=t,this._y=e,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const i=t._x,n=t._y,r=t._z,o=t._order,s=Math.cos,a=Math.sin,l=s(i/2),c=s(n/2),u=s(r/2),h=a(i/2),p=a(n/2),d=a(r/2);switch(o){case"XYZ":this._x=h*c*u+l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u-h*p*d;break;case"YXZ":this._x=h*c*u+l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u+h*p*d;break;case"ZXY":this._x=h*c*u-l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u-h*p*d;break;case"ZYX":this._x=h*c*u-l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u+h*p*d;break;case"YZX":this._x=h*c*u+l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u-h*p*d;break;case"XZY":this._x=h*c*u-l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u+h*p*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!1!==e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const i=e/2,n=Math.sin(i);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],n=e[4],r=e[8],o=e[1],s=e[5],a=e[9],l=e[2],c=e[6],u=e[10],h=i+s+u;if(h>0){const t=.5/Math.sqrt(h+1);this._w=.25/t,this._x=(c-a)*t,this._y=(r-l)*t,this._z=(o-n)*t}else if(i>s&&i>u){const t=2*Math.sqrt(1+i-s-u);this._w=(c-a)/t,this._x=.25*t,this._y=(n+o)/t,this._z=(r+l)/t}else if(s>u){const t=2*Math.sqrt(1+s-i-u);this._w=(r-l)/t,this._x=(n+o)/t,this._y=.25*t,this._z=(a+c)/t}else{const t=2*Math.sqrt(1+u-i-s);this._w=(o-n)/t,this._x=(r+l)/t,this._y=(a+c)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return i<Number.EPSILON?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=i),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(ut(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(0===i)return this;const n=Math.min(1,e/i);return this.slerp(t,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const i=t._x,n=t._y,r=t._z,o=t._w,s=e._x,a=e._y,l=e._z,c=e._w;return this._x=i*c+o*s+n*l-r*a,this._y=n*c+o*a+r*s-i*l,this._z=r*c+o*l+i*a-n*s,this._w=o*c-i*s-n*a-r*l,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const i=this._x,n=this._y,r=this._z,o=this._w;let s=o*t._w+i*t._x+n*t._y+r*t._z;if(s<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,s=-s):this.copy(t),s>=1)return this._w=o,this._x=i,this._y=n,this._z=r,this;const a=1-s*s;if(a<=Number.EPSILON){const t=1-e;return this._w=t*o+e*this._w,this._x=t*i+e*this._x,this._y=t*n+e*this._y,this._z=t*r+e*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(a),c=Math.atan2(l,s),u=Math.sin((1-e)*c)/l,h=Math.sin(e*c)/l;return this._w=o*u+this._w*h,this._x=i*u+this._x*h,this._y=n*u+this._y*h,this._z=r*u+this._z*h,this._onChangeCallback(),this}slerpQuaternions(t,e,i){this.copy(t).slerp(e,i)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}It.prototype.isQuaternion=!0;class Ct{constructor(t=0,e=0,i=0){this.x=t,this.y=e,this.z=i}set(t,e,i){return void 0===i&&(i=this.z),this.x=t,this.y=e,this.z=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Lt.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Lt.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*n,this.y=r[1]*e+r[4]*i+r[7]*n,this.z=r[2]*e+r[5]*i+r[8]*n,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,n=this.z,r=t.elements,o=1/(r[3]*e+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*n+r[12])*o,this.y=(r[1]*e+r[5]*i+r[9]*n+r[13])*o,this.z=(r[2]*e+r[6]*i+r[10]*n+r[14])*o,this}applyQuaternion(t){const e=this.x,i=this.y,n=this.z,r=t.x,o=t.y,s=t.z,a=t.w,l=a*e+o*n-s*i,c=a*i+s*e-r*n,u=a*n+r*i-o*e,h=-r*e-o*i-s*n;return this.x=l*a+h*-r+c*-s-u*-o,this.y=c*a+h*-o+u*-r-l*-s,this.z=u*a+h*-s+l*-o-c*-r,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*n,this.y=r[1]*e+r[5]*i+r[9]*n,this.z=r[2]*e+r[6]*i+r[10]*n,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}cross(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)}crossVectors(t,e){const i=t.x,n=t.y,r=t.z,o=e.x,s=e.y,a=e.z;return this.x=n*a-r*s,this.y=r*o-i*a,this.z=i*s-n*o,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return Pt.copy(this).projectOnVector(t),this.sub(Pt)}reflect(t){return this.sub(Pt.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(ut(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,n=this.z-t.z;return e*e+i*i+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,i){const n=Math.sin(e)*t;return this.x=n*Math.sin(i),this.y=Math.cos(e)*t,this.z=n*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=n,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e,i){return void 0!==i&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}Ct.prototype.isVector3=!0;const Pt=new Ct,Lt=new It;class Dt{constructor(t=new Ct(1/0,1/0,1/0),e=new Ct(-1/0,-1/0,-1/0)){this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){let e=1/0,i=1/0,n=1/0,r=-1/0,o=-1/0,s=-1/0;for(let a=0,l=t.length;a<l;a+=3){const l=t[a],c=t[a+1],u=t[a+2];l<e&&(e=l),c<i&&(i=c),u<n&&(n=u),l>r&&(r=l),c>o&&(o=c),u>s&&(s=u)}return this.min.set(e,i,n),this.max.set(r,o,s),this}setFromBufferAttribute(t){let e=1/0,i=1/0,n=1/0,r=-1/0,o=-1/0,s=-1/0;for(let a=0,l=t.count;a<l;a++){const l=t.getX(a),c=t.getY(a),u=t.getZ(a);l<e&&(e=l),c<i&&(i=c),u<n&&(n=u),l>r&&(r=l),c>o&&(o=c),u>s&&(s=u)}return this.min.set(e,i,n),this.max.set(r,o,s),this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const i=Ot.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}setFromObject(t){return this.makeEmpty(),this.expandByObject(t)}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t){t.updateWorldMatrix(!1,!1);const e=t.geometry;void 0!==e&&(null===e.boundingBox&&e.computeBoundingBox(),kt.copy(e.boundingBox),kt.applyMatrix4(t.matrixWorld),this.union(kt));const i=t.children;for(let t=0,e=i.length;t<e;t++)this.expandByObject(i[t]);return this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsSphere(t){return this.clampPoint(t.center,Ot),Ot.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Gt),jt.subVectors(this.max,Gt),Nt.subVectors(t.a,Gt),Bt.subVectors(t.b,Gt),zt.subVectors(t.c,Gt),Ft.subVectors(Bt,Nt),Vt.subVectors(zt,Bt),Ut.subVectors(Nt,zt);let e=[0,-Ft.z,Ft.y,0,-Vt.z,Vt.y,0,-Ut.z,Ut.y,Ft.z,0,-Ft.x,Vt.z,0,-Vt.x,Ut.z,0,-Ut.x,-Ft.y,Ft.x,0,-Vt.y,Vt.x,0,-Ut.y,Ut.x,0];return!!qt(e,Nt,Bt,zt,jt)&&(e=[1,0,0,0,1,0,0,0,1],!!qt(e,Nt,Bt,zt,jt)&&(Ht.crossVectors(Ft,Vt),e=[Ht.x,Ht.y,Ht.z],qt(e,Nt,Bt,zt,jt)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return Ot.copy(t).clamp(this.min,this.max).sub(t).length()}getBoundingSphere(t){return this.getCenter(t.center),t.radius=.5*this.getSize(Ot).length(),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(Rt[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Rt[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Rt[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Rt[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Rt[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Rt[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Rt[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Rt[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Rt)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}Dt.prototype.isBox3=!0;const Rt=[new Ct,new Ct,new Ct,new Ct,new Ct,new Ct,new Ct,new Ct],Ot=new Ct,kt=new Dt,Nt=new Ct,Bt=new Ct,zt=new Ct,Ft=new Ct,Vt=new Ct,Ut=new Ct,Gt=new Ct,jt=new Ct,Ht=new Ct,Wt=new Ct;function qt(t,e,i,n,r){for(let o=0,s=t.length-3;o<=s;o+=3){Wt.fromArray(t,o);const s=r.x*Math.abs(Wt.x)+r.y*Math.abs(Wt.y)+r.z*Math.abs(Wt.z),a=e.dot(Wt),l=i.dot(Wt),c=n.dot(Wt);if(Math.max(-Math.max(a,l,c),Math.min(a,l,c))>s)return!1}return!0}const Xt=new Dt,Zt=new Ct,Yt=new Ct,Qt=new Ct;class Jt{constructor(t=new Ct,e=-1){this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const i=this.center;void 0!==e?i.copy(e):Xt.setFromPoints(t).getCenter(i);let n=0;for(let e=0,r=t.length;e<r;e++)n=Math.max(n,i.distanceToSquared(t[e]));return this.radius=Math.sqrt(n),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const i=this.center.distanceToSquared(t);return e.copy(t),i>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){Qt.subVectors(t,this.center);const e=Qt.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),i=.5*(t-this.radius);this.center.add(Qt.multiplyScalar(i/t)),this.radius+=i}return this}union(t){return Yt.subVectors(t.center,this.center).normalize().multiplyScalar(t.radius),this.expandByPoint(Zt.copy(t.center).add(Yt)),this.expandByPoint(Zt.copy(t.center).sub(Yt)),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const Kt=new Ct,$t=new Ct,te=new Ct,ee=new Ct,ie=new Ct,ne=new Ct,re=new Ct;class oe{constructor(t=new Ct,e=new Ct(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.direction).multiplyScalar(t).add(this.origin)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Kt)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(i).add(this.origin)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=Kt.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Kt.copy(this.direction).multiplyScalar(e).add(this.origin),Kt.distanceToSquared(t))}distanceSqToSegment(t,e,i,n){$t.copy(t).add(e).multiplyScalar(.5),te.copy(e).sub(t).normalize(),ee.copy(this.origin).sub($t);const r=.5*t.distanceTo(e),o=-this.direction.dot(te),s=ee.dot(this.direction),a=-ee.dot(te),l=ee.lengthSq(),c=Math.abs(1-o*o);let u,h,p,d;if(c>0)if(u=o*a-s,h=o*s-a,d=r*c,u>=0)if(h>=-d)if(h<=d){const t=1/c;u*=t,h*=t,p=u*(u+o*h+2*s)+h*(o*u+h+2*a)+l}else h=r,u=Math.max(0,-(o*h+s)),p=-u*u+h*(h+2*a)+l;else h=-r,u=Math.max(0,-(o*h+s)),p=-u*u+h*(h+2*a)+l;else h<=-d?(u=Math.max(0,-(-o*r+s)),h=u>0?-r:Math.min(Math.max(-r,-a),r),p=-u*u+h*(h+2*a)+l):h<=d?(u=0,h=Math.min(Math.max(-r,-a),r),p=h*(h+2*a)+l):(u=Math.max(0,-(o*r+s)),h=u>0?r:Math.min(Math.max(-r,-a),r),p=-u*u+h*(h+2*a)+l);else h=o>0?-r:r,u=Math.max(0,-(o*h+s)),p=-u*u+h*(h+2*a)+l;return i&&i.copy(this.direction).multiplyScalar(u).add(this.origin),n&&n.copy(te).multiplyScalar(h).add($t),p}intersectSphere(t,e){Kt.subVectors(t.center,this.origin);const i=Kt.dot(this.direction),n=Kt.dot(Kt)-i*i,r=t.radius*t.radius;if(n>r)return null;const o=Math.sqrt(r-n),s=i-o,a=i+o;return s<0&&a<0?null:s<0?this.at(a,e):this.at(s,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){const i=this.distanceToPlane(t);return null===i?null:this.at(i,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let i,n,r,o,s,a;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return l>=0?(i=(t.min.x-h.x)*l,n=(t.max.x-h.x)*l):(i=(t.max.x-h.x)*l,n=(t.min.x-h.x)*l),c>=0?(r=(t.min.y-h.y)*c,o=(t.max.y-h.y)*c):(r=(t.max.y-h.y)*c,o=(t.min.y-h.y)*c),i>o||r>n?null:((r>i||i!=i)&&(i=r),(o<n||n!=n)&&(n=o),u>=0?(s=(t.min.z-h.z)*u,a=(t.max.z-h.z)*u):(s=(t.max.z-h.z)*u,a=(t.min.z-h.z)*u),i>a||s>n?null:((s>i||i!=i)&&(i=s),(a<n||n!=n)&&(n=a),n<0?null:this.at(i>=0?i:n,e)))}intersectsBox(t){return null!==this.intersectBox(t,Kt)}intersectTriangle(t,e,i,n,r){ie.subVectors(e,t),ne.subVectors(i,t),re.crossVectors(ie,ne);let o,s=this.direction.dot(re);if(s>0){if(n)return null;o=1}else{if(!(s<0))return null;o=-1,s=-s}ee.subVectors(this.origin,t);const a=o*this.direction.dot(ne.crossVectors(ee,ne));if(a<0)return null;const l=o*this.direction.dot(ie.cross(ee));if(l<0)return null;if(a+l>s)return null;const c=-o*ee.dot(re);return c<0?null:this.at(c/s,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class se{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(t,e,i,n,r,o,s,a,l,c,u,h,p,d,f,m){const g=this.elements;return g[0]=t,g[4]=e,g[8]=i,g[12]=n,g[1]=r,g[5]=o,g[9]=s,g[13]=a,g[2]=l,g[6]=c,g[10]=u,g[14]=h,g[3]=p,g[7]=d,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new se).fromArray(this.elements)}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}copyPosition(t){const e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,i=t.elements,n=1/ae.setFromMatrixColumn(t,0).length(),r=1/ae.setFromMatrixColumn(t,1).length(),o=1/ae.setFromMatrixColumn(t,2).length();return e[0]=i[0]*n,e[1]=i[1]*n,e[2]=i[2]*n,e[3]=0,e[4]=i[4]*r,e[5]=i[5]*r,e[6]=i[6]*r,e[7]=0,e[8]=i[8]*o,e[9]=i[9]*o,e[10]=i[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const e=this.elements,i=t.x,n=t.y,r=t.z,o=Math.cos(i),s=Math.sin(i),a=Math.cos(n),l=Math.sin(n),c=Math.cos(r),u=Math.sin(r);if("XYZ"===t.order){const t=o*c,i=o*u,n=s*c,r=s*u;e[0]=a*c,e[4]=-a*u,e[8]=l,e[1]=i+n*l,e[5]=t-r*l,e[9]=-s*a,e[2]=r-t*l,e[6]=n+i*l,e[10]=o*a}else if("YXZ"===t.order){const t=a*c,i=a*u,n=l*c,r=l*u;e[0]=t+r*s,e[4]=n*s-i,e[8]=o*l,e[1]=o*u,e[5]=o*c,e[9]=-s,e[2]=i*s-n,e[6]=r+t*s,e[10]=o*a}else if("ZXY"===t.order){const t=a*c,i=a*u,n=l*c,r=l*u;e[0]=t-r*s,e[4]=-o*u,e[8]=n+i*s,e[1]=i+n*s,e[5]=o*c,e[9]=r-t*s,e[2]=-o*l,e[6]=s,e[10]=o*a}else if("ZYX"===t.order){const t=o*c,i=o*u,n=s*c,r=s*u;e[0]=a*c,e[4]=n*l-i,e[8]=t*l+r,e[1]=a*u,e[5]=r*l+t,e[9]=i*l-n,e[2]=-l,e[6]=s*a,e[10]=o*a}else if("YZX"===t.order){const t=o*a,i=o*l,n=s*a,r=s*l;e[0]=a*c,e[4]=r-t*u,e[8]=n*u+i,e[1]=u,e[5]=o*c,e[9]=-s*c,e[2]=-l*c,e[6]=i*u+n,e[10]=t-r*u}else if("XZY"===t.order){const t=o*a,i=o*l,n=s*a,r=s*l;e[0]=a*c,e[4]=-u,e[8]=l*c,e[1]=t*u+r,e[5]=o*c,e[9]=i*u-n,e[2]=n*u-i,e[6]=s*c,e[10]=r*u+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(ce,t,ue)}lookAt(t,e,i){const n=this.elements;return de.subVectors(t,e),0===de.lengthSq()&&(de.z=1),de.normalize(),he.crossVectors(i,de),0===he.lengthSq()&&(1===Math.abs(i.z)?de.x+=1e-4:de.z+=1e-4,de.normalize(),he.crossVectors(i,de)),he.normalize(),pe.crossVectors(de,he),n[0]=he.x,n[4]=pe.x,n[8]=de.x,n[1]=he.y,n[5]=pe.y,n[9]=de.y,n[2]=he.z,n[6]=pe.z,n[10]=de.z,this}multiply(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,n=e.elements,r=this.elements,o=i[0],s=i[4],a=i[8],l=i[12],c=i[1],u=i[5],h=i[9],p=i[13],d=i[2],f=i[6],m=i[10],g=i[14],y=i[3],v=i[7],_=i[11],x=i[15],b=n[0],w=n[4],A=n[8],E=n[12],S=n[1],M=n[5],T=n[9],I=n[13],C=n[2],P=n[6],L=n[10],D=n[14],R=n[3],O=n[7],k=n[11],N=n[15];return r[0]=o*b+s*S+a*C+l*R,r[4]=o*w+s*M+a*P+l*O,r[8]=o*A+s*T+a*L+l*k,r[12]=o*E+s*I+a*D+l*N,r[1]=c*b+u*S+h*C+p*R,r[5]=c*w+u*M+h*P+p*O,r[9]=c*A+u*T+h*L+p*k,r[13]=c*E+u*I+h*D+p*N,r[2]=d*b+f*S+m*C+g*R,r[6]=d*w+f*M+m*P+g*O,r[10]=d*A+f*T+m*L+g*k,r[14]=d*E+f*I+m*D+g*N,r[3]=y*b+v*S+_*C+x*R,r[7]=y*w+v*M+_*P+x*O,r[11]=y*A+v*T+_*L+x*k,r[15]=y*E+v*I+_*D+x*N,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[4],n=t[8],r=t[12],o=t[1],s=t[5],a=t[9],l=t[13],c=t[2],u=t[6],h=t[10],p=t[14];return t[3]*(+r*a*u-n*l*u-r*s*h+i*l*h+n*s*p-i*a*p)+t[7]*(+e*a*p-e*l*h+r*o*h-n*o*p+n*l*c-r*a*c)+t[11]*(+e*l*u-e*s*p-r*o*u+i*o*p+r*s*c-i*l*c)+t[15]*(-n*s*c-e*a*u+e*s*h+n*o*u-i*o*h+i*a*c)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,i){const n=this.elements;return t.isVector3?(n[12]=t.x,n[13]=t.y,n[14]=t.z):(n[12]=t,n[13]=e,n[14]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],o=t[4],s=t[5],a=t[6],l=t[7],c=t[8],u=t[9],h=t[10],p=t[11],d=t[12],f=t[13],m=t[14],g=t[15],y=u*m*l-f*h*l+f*a*p-s*m*p-u*a*g+s*h*g,v=d*h*l-c*m*l-d*a*p+o*m*p+c*a*g-o*h*g,_=c*f*l-d*u*l+d*s*p-o*f*p-c*s*g+o*u*g,x=d*u*a-c*f*a-d*s*h+o*f*h+c*s*m-o*u*m,b=e*y+i*v+n*_+r*x;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/b;return t[0]=y*w,t[1]=(f*h*r-u*m*r-f*n*p+i*m*p+u*n*g-i*h*g)*w,t[2]=(s*m*r-f*a*r+f*n*l-i*m*l-s*n*g+i*a*g)*w,t[3]=(u*a*r-s*h*r-u*n*l+i*h*l+s*n*p-i*a*p)*w,t[4]=v*w,t[5]=(c*m*r-d*h*r+d*n*p-e*m*p-c*n*g+e*h*g)*w,t[6]=(d*a*r-o*m*r-d*n*l+e*m*l+o*n*g-e*a*g)*w,t[7]=(o*h*r-c*a*r+c*n*l-e*h*l-o*n*p+e*a*p)*w,t[8]=_*w,t[9]=(d*u*r-c*f*r-d*i*p+e*f*p+c*i*g-e*u*g)*w,t[10]=(o*f*r-d*s*r+d*i*l-e*f*l-o*i*g+e*s*g)*w,t[11]=(c*s*r-o*u*r-c*i*l+e*u*l+o*i*p-e*s*p)*w,t[12]=x*w,t[13]=(c*f*n-d*u*n+d*i*h-e*f*h-c*i*m+e*u*m)*w,t[14]=(d*s*n-o*f*n-d*i*a+e*f*a+o*i*m-e*s*m)*w,t[15]=(o*u*n-c*s*n+c*i*a-e*u*a-o*i*h+e*s*h)*w,this}scale(t){const e=this.elements,i=t.x,n=t.y,r=t.z;return e[0]*=i,e[4]*=n,e[8]*=r,e[1]*=i,e[5]*=n,e[9]*=r,e[2]*=i,e[6]*=n,e[10]*=r,e[3]*=i,e[7]*=n,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,n))}makeTranslation(t,e,i){return this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const i=Math.cos(e),n=Math.sin(e),r=1-i,o=t.x,s=t.y,a=t.z,l=r*o,c=r*s;return this.set(l*o+i,l*s-n*a,l*a+n*s,0,l*s+n*a,c*s+i,c*a-n*o,0,l*a-n*s,c*a+n*o,r*a*a+i,0,0,0,0,1),this}makeScale(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,e,i,n,r,o){return this.set(1,i,r,0,t,1,o,0,e,n,1,0,0,0,0,1),this}compose(t,e,i){const n=this.elements,r=e._x,o=e._y,s=e._z,a=e._w,l=r+r,c=o+o,u=s+s,h=r*l,p=r*c,d=r*u,f=o*c,m=o*u,g=s*u,y=a*l,v=a*c,_=a*u,x=i.x,b=i.y,w=i.z;return n[0]=(1-(f+g))*x,n[1]=(p+_)*x,n[2]=(d-v)*x,n[3]=0,n[4]=(p-_)*b,n[5]=(1-(h+g))*b,n[6]=(m+y)*b,n[7]=0,n[8]=(d+v)*w,n[9]=(m-y)*w,n[10]=(1-(h+f))*w,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this}decompose(t,e,i){const n=this.elements;let r=ae.set(n[0],n[1],n[2]).length();const o=ae.set(n[4],n[5],n[6]).length(),s=ae.set(n[8],n[9],n[10]).length();this.determinant()<0&&(r=-r),t.x=n[12],t.y=n[13],t.z=n[14],le.copy(this);const a=1/r,l=1/o,c=1/s;return le.elements[0]*=a,le.elements[1]*=a,le.elements[2]*=a,le.elements[4]*=l,le.elements[5]*=l,le.elements[6]*=l,le.elements[8]*=c,le.elements[9]*=c,le.elements[10]*=c,e.setFromRotationMatrix(le),i.x=r,i.y=o,i.z=s,this}makePerspective(t,e,i,n,r,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const s=this.elements,a=2*r/(e-t),l=2*r/(i-n),c=(e+t)/(e-t),u=(i+n)/(i-n),h=-(o+r)/(o-r),p=-2*o*r/(o-r);return s[0]=a,s[4]=0,s[8]=c,s[12]=0,s[1]=0,s[5]=l,s[9]=u,s[13]=0,s[2]=0,s[6]=0,s[10]=h,s[14]=p,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this}makeOrthographic(t,e,i,n,r,o){const s=this.elements,a=1/(e-t),l=1/(i-n),c=1/(o-r),u=(e+t)*a,h=(i+n)*l,p=(o+r)*c;return s[0]=2*a,s[4]=0,s[8]=0,s[12]=-u,s[1]=0,s[5]=2*l,s[9]=0,s[13]=-h,s[2]=0,s[6]=0,s[10]=-2*c,s[14]=-p,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this}equals(t){const e=this.elements,i=t.elements;for(let t=0;t<16;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}}se.prototype.isMatrix4=!0;const ae=new Ct,le=new se,ce=new Ct(0,0,0),ue=new Ct(1,1,1),he=new Ct,pe=new Ct,de=new Ct,fe=new se,me=new It;class ge{constructor(t=0,e=0,i=0,n=ge.DefaultOrder){this._x=t,this._y=e,this._z=i,this._order=n}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,i,n=this._order){return this._x=t,this._y=e,this._z=i,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,i=!0){const n=t.elements,r=n[0],o=n[4],s=n[8],a=n[1],l=n[5],c=n[9],u=n[2],h=n[6],p=n[10];switch(e){case"XYZ":this._y=Math.asin(ut(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-c,p),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-ut(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(s,p),this._z=Math.atan2(a,l)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(ut(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(a,r));break;case"ZYX":this._y=Math.asin(-ut(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(h,p),this._z=Math.atan2(a,r)):(this._x=0,this._z=Math.atan2(-o,l));break;case"YZX":this._z=Math.asin(ut(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(s,p));break;case"XZY":this._z=Math.asin(-ut(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(h,l),this._y=Math.atan2(s,r)):(this._x=Math.atan2(-c,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===i&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return fe.makeRotationFromQuaternion(t),this.setFromRotationMatrix(fe,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return me.setFromEuler(this),this.setFromQuaternion(me,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}toVector3(t){return t?t.set(this._x,this._y,this._z):new Ct(this._x,this._y,this._z)}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}ge.prototype.isEuler=!0,ge.DefaultOrder="XYZ",ge.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class ye{constructor(){this.mask=1}set(t){this.mask=1<<t|0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return 0!=(this.mask&t.mask)}}let ve=0;const _e=new Ct,xe=new It,be=new se,we=new Ct,Ae=new Ct,Ee=new Ct,Se=new It,Me=new Ct(1,0,0),Te=new Ct(0,1,0),Ie=new Ct(0,0,1),Ce={type:"added"},Pe={type:"removed"};class Le extends rt{constructor(){super(),Object.defineProperty(this,"id",{value:ve++}),this.uuid=ct(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Le.DefaultUp.clone();const t=new Ct,e=new ge,i=new It,n=new Ct(1,1,1);e._onChange((function(){i.setFromEuler(e,!1)})),i._onChange((function(){e.setFromQuaternion(i,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:n},modelViewMatrix:{value:new se},normalMatrix:{value:new vt}}),this.matrix=new se,this.matrixWorld=new se,this.matrixAutoUpdate=Le.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new ye,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return xe.setFromAxisAngle(t,e),this.quaternion.multiply(xe),this}rotateOnWorldAxis(t,e){return xe.setFromAxisAngle(t,e),this.quaternion.premultiply(xe),this}rotateX(t){return this.rotateOnAxis(Me,t)}rotateY(t){return this.rotateOnAxis(Te,t)}rotateZ(t){return this.rotateOnAxis(Ie,t)}translateOnAxis(t,e){return _e.copy(t).applyQuaternion(this.quaternion),this.position.add(_e.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(Me,t)}translateY(t){return this.translateOnAxis(Te,t)}translateZ(t){return this.translateOnAxis(Ie,t)}localToWorld(t){return t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return t.applyMatrix4(be.copy(this.matrixWorld).invert())}lookAt(t,e,i){t.isVector3?we.copy(t):we.set(t,e,i);const n=this.parent;this.updateWorldMatrix(!0,!1),Ae.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?be.lookAt(Ae,we,this.up):be.lookAt(we,Ae,this.up),this.quaternion.setFromRotationMatrix(be),n&&(be.extractRotation(n.matrixWorld),xe.setFromRotationMatrix(be),this.quaternion.premultiply(xe.invert()))}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(Ce)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}const e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(Pe)),this}removeFromParent(){const t=this.parent;return null!==t&&t.remove(this),this}clear(){for(let t=0;t<this.children.length;t++){const e=this.children[t];e.parent=null,e.dispatchEvent(Pe)}return this.children.length=0,this}attach(t){return this.updateWorldMatrix(!0,!1),be.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),be.multiply(t.parent.matrixWorld)),t.applyMatrix4(be),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let i=0,n=this.children.length;i<n;i++){const n=this.children[i].getObjectByProperty(t,e);if(void 0!==n)return n}}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ae,t,Ee),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ae,Se,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);const e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].traverseVisible(t)}traverseAncestors(t){const e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].updateMatrixWorld(t)}updateWorldMatrix(t,e){const i=this.parent;if(!0===t&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e){const t=this.children;for(let e=0,i=t.length;e<i;e++)t[e].updateWorldMatrix(!1,!0)}}toJSON(t){const e=void 0===t||"string"==typeof t,i={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{}},i.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const n={};function r(e,i){return void 0===e[i.uuid]&&(e[i.uuid]=i.toJSON(t)),i.uuid}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(n.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&(n.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=r(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const i=e.shapes;if(Array.isArray(i))for(let e=0,n=i.length;e<n;e++){const n=i[e];r(t.shapes,n)}else r(t.shapes,i)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(r(t.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const e=[];for(let i=0,n=this.material.length;i<n;i++)e.push(r(t.materials,this.material[i]));n.material=e}else n.material=r(t.materials,this.material);if(this.children.length>0){n.children=[];for(let e=0;e<this.children.length;e++)n.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){n.animations=[];for(let e=0;e<this.animations.length;e++){const i=this.animations[e];n.animations.push(r(t.animations,i))}}if(e){const e=o(t.geometries),n=o(t.materials),r=o(t.textures),s=o(t.images),a=o(t.shapes),l=o(t.skeletons),c=o(t.animations);e.length>0&&(i.geometries=e),n.length>0&&(i.materials=n),r.length>0&&(i.textures=r),s.length>0&&(i.images=s),a.length>0&&(i.shapes=a),l.length>0&&(i.skeletons=l),c.length>0&&(i.animations=c)}return i.object=n,i;function o(t){const e=[];for(const i in t){const n=t[i];delete n.metadata,e.push(n)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e<t.children.length;e++){const i=t.children[e];this.add(i.clone())}return this}}Le.DefaultUp=new Ct(0,1,0),Le.DefaultMatrixAutoUpdate=!0,Le.prototype.isObject3D=!0;const De=new Ct,Re=new Ct,Oe=new Ct,ke=new Ct,Ne=new Ct,Be=new Ct,ze=new Ct,Fe=new Ct,Ve=new Ct,Ue=new Ct;class Ge{constructor(t=new Ct,e=new Ct,i=new Ct){this.a=t,this.b=e,this.c=i}static getNormal(t,e,i,n){n.subVectors(i,e),De.subVectors(t,e),n.cross(De);const r=n.lengthSq();return r>0?n.multiplyScalar(1/Math.sqrt(r)):n.set(0,0,0)}static getBarycoord(t,e,i,n,r){De.subVectors(n,e),Re.subVectors(i,e),Oe.subVectors(t,e);const o=De.dot(De),s=De.dot(Re),a=De.dot(Oe),l=Re.dot(Re),c=Re.dot(Oe),u=o*l-s*s;if(0===u)return r.set(-2,-1,-1);const h=1/u,p=(l*a-s*c)*h,d=(o*c-s*a)*h;return r.set(1-p-d,d,p)}static containsPoint(t,e,i,n){return this.getBarycoord(t,e,i,n,ke),ke.x>=0&&ke.y>=0&&ke.x+ke.y<=1}static getUV(t,e,i,n,r,o,s,a){return this.getBarycoord(t,e,i,n,ke),a.set(0,0),a.addScaledVector(r,ke.x),a.addScaledVector(o,ke.y),a.addScaledVector(s,ke.z),a}static isFrontFacing(t,e,i,n){return De.subVectors(i,e),Re.subVectors(t,e),De.cross(Re).dot(n)<0}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,n){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[n]),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return De.subVectors(this.c,this.b),Re.subVectors(this.a,this.b),.5*De.cross(Re).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Ge.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Ge.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,i,n,r){return Ge.getUV(t,this.a,this.b,this.c,e,i,n,r)}containsPoint(t){return Ge.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Ge.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const i=this.a,n=this.b,r=this.c;let o,s;Ne.subVectors(n,i),Be.subVectors(r,i),Fe.subVectors(t,i);const a=Ne.dot(Fe),l=Be.dot(Fe);if(a<=0&&l<=0)return e.copy(i);Ve.subVectors(t,n);const c=Ne.dot(Ve),u=Be.dot(Ve);if(c>=0&&u<=c)return e.copy(n);const h=a*u-c*l;if(h<=0&&a>=0&&c<=0)return o=a/(a-c),e.copy(i).addScaledVector(Ne,o);Ue.subVectors(t,r);const p=Ne.dot(Ue),d=Be.dot(Ue);if(d>=0&&p<=d)return e.copy(r);const f=p*l-a*d;if(f<=0&&l>=0&&d<=0)return s=l/(l-d),e.copy(i).addScaledVector(Be,s);const m=c*d-p*u;if(m<=0&&u-c>=0&&p-d>=0)return ze.subVectors(r,n),s=(u-c)/(u-c+(p-d)),e.copy(n).addScaledVector(ze,s);const g=1/(m+f+h);return o=f*g,s=h*g,e.copy(i).addScaledVector(Ne,o).addScaledVector(Be,s)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let je=0;class He extends rt{constructor(){super(),Object.defineProperty(this,"id",{value:je++}),this.uuid=ct(),this.name="",this.type="Material",this.fog=!0,this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.format=M,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=i,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=tt,this.stencilZFail=tt,this.stencilZPass=tt,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(const e in t){const i=t[e];if(void 0===i){console.warn("THREE.Material: '"+e+"' parameter is undefined.");continue}if("shading"===e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===i;continue}const n=this[e];void 0!==n?n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[e]=i:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}}toJSON(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function n(t){const e=[];for(const i in t){const n=t[i];delete n.metadata,e.push(n)}return e}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),this.sheenTint&&this.sheenTint.isColor&&(i.sheenTint=this.sheenTint.getHex()),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularTint&&this.specularTint.isColor&&(i.specularTint=this.specularTint.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularTintMap&&this.specularTintMap.isTexture&&(i.specularTintMap=this.specularTintMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationTint&&(i.attenuationTint=this.attenuationTint.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(i.blending=this.blending),0!==this.side&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.format!==M&&(i.format=this.format),!0===this.transparent&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(i.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=this.flatShading),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),e){const e=n(t.textures),r=n(t.images);e.length>0&&(i.textures=e),r.length>0&&(i.images=r)}return i}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.format=t.format,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let i=null;if(null!==e){const t=e.length;i=new Array(t);for(let n=0;n!==t;++n)i[n]=e[n].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}}He.prototype.isMaterial=!0;const We={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},qe={h:0,s:0,l:0},Xe={h:0,s:0,l:0};function Ze(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t}function Ye(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Qe(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}class Je{constructor(t,e,i){return void 0===e&&void 0===i?this.set(t):this.setRGB(t,e,i)}set(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this}setRGB(t,e,i){return this.r=t,this.g=e,this.b=i,this}setHSL(t,e,i){if(t=ht(t,1),e=ut(e,0,1),i=ut(i,0,1),0===e)this.r=this.g=this.b=i;else{const n=i<=.5?i*(1+e):i+e-i*e,r=2*i-n;this.r=Ze(r,n,t+1/3),this.g=Ze(r,n,t),this.b=Ze(r,n,t-1/3)}return this}setStyle(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let t;const n=i[1],r=i[2];switch(n){case"rgb":case"rgba":if(t=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,e(t[4]),this;if(t=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,e(t[4]),this;break;case"hsl":case"hsla":if(t=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r)){const i=parseFloat(t[1])/360,n=parseInt(t[2],10)/100,r=parseInt(t[3],10)/100;return e(t[4]),this.setHSL(i,n,r)}}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){const t=i[1],e=t.length;if(3===e)return this.r=parseInt(t.charAt(0)+t.charAt(0),16)/255,this.g=parseInt(t.charAt(1)+t.charAt(1),16)/255,this.b=parseInt(t.charAt(2)+t.charAt(2),16)/255,this;if(6===e)return this.r=parseInt(t.charAt(0)+t.charAt(1),16)/255,this.g=parseInt(t.charAt(2)+t.charAt(3),16)/255,this.b=parseInt(t.charAt(4)+t.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this}setColorName(t){const e=We[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copyGammaToLinear(t,e=2){return this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this}copyLinearToGamma(t,e=2){const i=e>0?1/e:1;return this.r=Math.pow(t.r,i),this.g=Math.pow(t.g,i),this.b=Math.pow(t.b,i),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.r=Ye(t.r),this.g=Ye(t.g),this.b=Ye(t.b),this}copyLinearToSRGB(t){return this.r=Qe(t.r),this.g=Qe(t.g),this.b=Qe(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(t){const e=this.r,i=this.g,n=this.b,r=Math.max(e,i,n),o=Math.min(e,i,n);let s,a;const l=(o+r)/2;if(o===r)s=0,a=0;else{const t=r-o;switch(a=l<=.5?t/(r+o):t/(2-r-o),r){case e:s=(i-n)/t+(i<n?6:0);break;case i:s=(n-e)/t+2;break;case n:s=(e-i)/t+4}s/=6}return t.h=s,t.s=a,t.l=l,t}getStyle(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"}offsetHSL(t,e,i){return this.getHSL(qe),qe.h+=t,qe.s+=e,qe.l+=i,this.setHSL(qe.h,qe.s,qe.l),this}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,i){return this.r=t.r+(e.r-t.r)*i,this.g=t.g+(e.g-t.g)*i,this.b=t.b+(e.b-t.b)*i,this}lerpHSL(t,e){this.getHSL(qe),t.getHSL(Xe);const i=pt(qe.h,Xe.h,e),n=pt(qe.s,Xe.s,e),r=pt(qe.l,Xe.l,e);return this.setHSL(i,n,r),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),!0===t.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}}Je.NAMES=We,Je.prototype.isColor=!0,Je.prototype.r=1,Je.prototype.g=1,Je.prototype.b=1;class Ke extends He{constructor(t){super(),this.type="MeshBasicMaterial",this.color=new Je(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this}}Ke.prototype.isMeshBasicMaterial=!0;const $e=new Ct,ti=new yt;class ei{constructor(t,e,i){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===i,this.usage=et,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this}copyAt(t,e,i){t*=this.itemSize,i*=e.itemSize;for(let n=0,r=this.itemSize;n<r;n++)this.array[t+n]=e.array[i+n];return this}copyArray(t){return this.array.set(t),this}copyColorsArray(t){const e=this.array;let i=0;for(let n=0,r=t.length;n<r;n++){let r=t[n];void 0===r&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",n),r=new Je),e[i++]=r.r,e[i++]=r.g,e[i++]=r.b}return this}copyVector2sArray(t){const e=this.array;let i=0;for(let n=0,r=t.length;n<r;n++){let r=t[n];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",n),r=new yt),e[i++]=r.x,e[i++]=r.y}return this}copyVector3sArray(t){const e=this.array;let i=0;for(let n=0,r=t.length;n<r;n++){let r=t[n];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",n),r=new Ct),e[i++]=r.x,e[i++]=r.y,e[i++]=r.z}return this}copyVector4sArray(t){const e=this.array;let i=0;for(let n=0,r=t.length;n<r;n++){let r=t[n];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",n),r=new Et),e[i++]=r.x,e[i++]=r.y,e[i++]=r.z,e[i++]=r.w}return this}applyMatrix3(t){if(2===this.itemSize)for(let e=0,i=this.count;e<i;e++)ti.fromBufferAttribute(this,e),ti.applyMatrix3(t),this.setXY(e,ti.x,ti.y);else if(3===this.itemSize)for(let e=0,i=this.count;e<i;e++)$e.fromBufferAttribute(this,e),$e.applyMatrix3(t),this.setXYZ(e,$e.x,$e.y,$e.z);return this}applyMatrix4(t){for(let e=0,i=this.count;e<i;e++)$e.x=this.getX(e),$e.y=this.getY(e),$e.z=this.getZ(e),$e.applyMatrix4(t),this.setXYZ(e,$e.x,$e.y,$e.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)$e.x=this.getX(e),$e.y=this.getY(e),$e.z=this.getZ(e),$e.applyNormalMatrix(t),this.setXYZ(e,$e.x,$e.y,$e.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)$e.x=this.getX(e),$e.y=this.getY(e),$e.z=this.getZ(e),$e.transformDirection(t),this.setXYZ(e,$e.x,$e.y,$e.z);return this}set(t,e=0){return this.array.set(t,e),this}getX(t){return this.array[t*this.itemSize]}setX(t,e){return this.array[t*this.itemSize]=e,this}getY(t){return this.array[t*this.itemSize+1]}setY(t,e){return this.array[t*this.itemSize+1]=e,this}getZ(t){return this.array[t*this.itemSize+2]}setZ(t,e){return this.array[t*this.itemSize+2]=e,this}getW(t){return this.array[t*this.itemSize+3]}setW(t,e){return this.array[t*this.itemSize+3]=e,this}setXY(t,e,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this}setXYZ(t,e,i,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,this}setXYZW(t,e,i,n,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,this.array[t+3]=r,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized};return""!==this.name&&(t.name=this.name),this.usage!==et&&(t.usage=this.usage),0===this.updateRange.offset&&-1===this.updateRange.count||(t.updateRange=this.updateRange),t}}ei.prototype.isBufferAttribute=!0;class ii extends ei{constructor(t,e,i){super(new Int8Array(t),e,i)}}class ni extends ei{constructor(t,e,i){super(new Uint8Array(t),e,i)}}class ri extends ei{constructor(t,e,i){super(new Uint8ClampedArray(t),e,i)}}class oi extends ei{constructor(t,e,i){super(new Int16Array(t),e,i)}}class si extends ei{constructor(t,e,i){super(new Uint16Array(t),e,i)}}class ai extends ei{constructor(t,e,i){super(new Int32Array(t),e,i)}}class li extends ei{constructor(t,e,i){super(new Uint32Array(t),e,i)}}class ci extends ei{constructor(t,e,i){super(new Uint16Array(t),e,i)}}ci.prototype.isFloat16BufferAttribute=!0;class ui extends ei{constructor(t,e,i){super(new Float32Array(t),e,i)}}class hi extends ei{constructor(t,e,i){super(new Float64Array(t),e,i)}}function pi(t){if(0===t.length)return-1/0;let e=t[0];for(let i=1,n=t.length;i<n;++i)t[i]>e&&(e=t[i]);return e}const di={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function fi(t,e){return new di[t](e)}let mi=0;const gi=new se,yi=new Le,vi=new Ct,_i=new Dt,xi=new Dt,bi=new Ct;class wi extends rt{constructor(){super(),Object.defineProperty(this,"id",{value:mi++}),this.uuid=ct(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(pi(t)>65535?li:si)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return void 0!==this.attributes[t]}addGroup(t,e,i=0){this.groups.push({start:t,count:e,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const i=this.attributes.normal;if(void 0!==i){const e=(new vt).getNormalMatrix(t);i.applyNormalMatrix(e),i.needsUpdate=!0}const n=this.attributes.tangent;return void 0!==n&&(n.transformDirection(t),n.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(t){return gi.makeRotationFromQuaternion(t),this.applyMatrix4(gi),this}rotateX(t){return gi.makeRotationX(t),this.applyMatrix4(gi),this}rotateY(t){return gi.makeRotationY(t),this.applyMatrix4(gi),this}rotateZ(t){return gi.makeRotationZ(t),this.applyMatrix4(gi),this}translate(t,e,i){return gi.makeTranslation(t,e,i),this.applyMatrix4(gi),this}scale(t,e,i){return gi.makeScale(t,e,i),this.applyMatrix4(gi),this}lookAt(t){return yi.lookAt(t),yi.updateMatrix(),this.applyMatrix4(yi.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(vi).negate(),this.translate(vi.x,vi.y,vi.z),this}setFromPoints(t){const e=[];for(let i=0,n=t.length;i<n;i++){const n=t[i];e.push(n.x,n.y,n.z||0)}return this.setAttribute("position",new ui(e,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Dt);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new Ct(-1/0,-1/0,-1/0),new Ct(1/0,1/0,1/0));if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,i=e.length;t<i;t++){const i=e[t];_i.setFromBufferAttribute(i),this.morphTargetsRelative?(bi.addVectors(this.boundingBox.min,_i.min),this.boundingBox.expandByPoint(bi),bi.addVectors(this.boundingBox.max,_i.max),this.boundingBox.expandByPoint(bi)):(this.boundingBox.expandByPoint(_i.min),this.boundingBox.expandByPoint(_i.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Jt);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingSphere.set(new Ct,1/0);if(t){const i=this.boundingSphere.center;if(_i.setFromBufferAttribute(t),e)for(let t=0,i=e.length;t<i;t++){const i=e[t];xi.setFromBufferAttribute(i),this.morphTargetsRelative?(bi.addVectors(_i.min,xi.min),_i.expandByPoint(bi),bi.addVectors(_i.max,xi.max),_i.expandByPoint(bi)):(_i.expandByPoint(xi.min),_i.expandByPoint(xi.max))}_i.getCenter(i);let n=0;for(let e=0,r=t.count;e<r;e++)bi.fromBufferAttribute(t,e),n=Math.max(n,i.distanceToSquared(bi));if(e)for(let r=0,o=e.length;r<o;r++){const o=e[r],s=this.morphTargetsRelative;for(let e=0,r=o.count;e<r;e++)bi.fromBufferAttribute(o,e),s&&(vi.fromBufferAttribute(t,e),bi.add(vi)),n=Math.max(n,i.distanceToSquared(bi))}this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const i=t.array,n=e.position.array,r=e.normal.array,o=e.uv.array,s=n.length/3;void 0===e.tangent&&this.setAttribute("tangent",new ei(new Float32Array(4*s),4));const a=e.tangent.array,l=[],c=[];for(let t=0;t<s;t++)l[t]=new Ct,c[t]=new Ct;const u=new Ct,h=new Ct,p=new Ct,d=new yt,f=new yt,m=new yt,g=new Ct,y=new Ct;function v(t,e,i){u.fromArray(n,3*t),h.fromArray(n,3*e),p.fromArray(n,3*i),d.fromArray(o,2*t),f.fromArray(o,2*e),m.fromArray(o,2*i),h.sub(u),p.sub(u),f.sub(d),m.sub(d);const r=1/(f.x*m.y-m.x*f.y);isFinite(r)&&(g.copy(h).multiplyScalar(m.y).addScaledVector(p,-f.y).multiplyScalar(r),y.copy(p).multiplyScalar(f.x).addScaledVector(h,-m.x).multiplyScalar(r),l[t].add(g),l[e].add(g),l[i].add(g),c[t].add(y),c[e].add(y),c[i].add(y))}let _=this.groups;0===_.length&&(_=[{start:0,count:i.length}]);for(let t=0,e=_.length;t<e;++t){const e=_[t],n=e.start;for(let t=n,r=n+e.count;t<r;t+=3)v(i[t+0],i[t+1],i[t+2])}const x=new Ct,b=new Ct,w=new Ct,A=new Ct;function E(t){w.fromArray(r,3*t),A.copy(w);const e=l[t];x.copy(e),x.sub(w.multiplyScalar(w.dot(e))).normalize(),b.crossVectors(A,e);const i=b.dot(c[t])<0?-1:1;a[4*t]=x.x,a[4*t+1]=x.y,a[4*t+2]=x.z,a[4*t+3]=i}for(let t=0,e=_.length;t<e;++t){const e=_[t],n=e.start;for(let t=n,r=n+e.count;t<r;t+=3)E(i[t+0]),E(i[t+1]),E(i[t+2])}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(void 0!==e){let i=this.getAttribute("normal");if(void 0===i)i=new ei(new Float32Array(3*e.count),3),this.setAttribute("normal",i);else for(let t=0,e=i.count;t<e;t++)i.setXYZ(t,0,0,0);const n=new Ct,r=new Ct,o=new Ct,s=new Ct,a=new Ct,l=new Ct,c=new Ct,u=new Ct;if(t)for(let h=0,p=t.count;h<p;h+=3){const p=t.getX(h+0),d=t.getX(h+1),f=t.getX(h+2);n.fromBufferAttribute(e,p),r.fromBufferAttribute(e,d),o.fromBufferAttribute(e,f),c.subVectors(o,r),u.subVectors(n,r),c.cross(u),s.fromBufferAttribute(i,p),a.fromBufferAttribute(i,d),l.fromBufferAttribute(i,f),s.add(c),a.add(c),l.add(c),i.setXYZ(p,s.x,s.y,s.z),i.setXYZ(d,a.x,a.y,a.z),i.setXYZ(f,l.x,l.y,l.z)}else for(let t=0,s=e.count;t<s;t+=3)n.fromBufferAttribute(e,t+0),r.fromBufferAttribute(e,t+1),o.fromBufferAttribute(e,t+2),c.subVectors(o,r),u.subVectors(n,r),c.cross(u),i.setXYZ(t+0,c.x,c.y,c.z),i.setXYZ(t+1,c.x,c.y,c.z),i.setXYZ(t+2,c.x,c.y,c.z);this.normalizeNormals(),i.needsUpdate=!0}}merge(t,e){if(!t||!t.isBufferGeometry)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t);void 0===e&&(e=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));const i=this.attributes;for(const n in i){if(void 0===t.attributes[n])continue;const r=i[n].array,o=t.attributes[n],s=o.array,a=o.itemSize*e,l=Math.min(s.length,r.length-a);for(let t=0,e=a;t<l;t++,e++)r[e]=s[t]}return this}normalizeNormals(){const t=this.attributes.normal;for(let e=0,i=t.count;e<i;e++)bi.fromBufferAttribute(t,e),bi.normalize(),t.setXYZ(e,bi.x,bi.y,bi.z)}toNonIndexed(){function t(t,e){const i=t.array,n=t.itemSize,r=t.normalized,o=new i.constructor(e.length*n);let s=0,a=0;for(let r=0,l=e.length;r<l;r++){s=t.isInterleavedBufferAttribute?e[r]*t.data.stride+t.offset:e[r]*n;for(let t=0;t<n;t++)o[a++]=i[s++]}return new ei(o,n,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new wi,i=this.index.array,n=this.attributes;for(const r in n){const o=t(n[r],i);e.setAttribute(r,o)}const r=this.morphAttributes;for(const n in r){const o=[],s=r[n];for(let e=0,n=s.length;e<n;e++){const n=t(s[e],i);o.push(n)}e.morphAttributes[n]=o}e.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let t=0,i=o.length;t<i;t++){const i=o[t];e.addGroup(i.start,i.count,i.materialIndex)}return e}toJSON(){const t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const i in e)void 0!==e[i]&&(t[i]=e[i]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const i=this.attributes;for(const e in i){const n=i[e];t.data.attributes[e]=n.toJSON(t.data)}const n={};let r=!1;for(const e in this.morphAttributes){const i=this.morphAttributes[e],o=[];for(let e=0,n=i.length;e<n;e++){const n=i[e];o.push(n.toJSON(t.data))}o.length>0&&(n[e]=o,r=!0)}r&&(t.data.morphAttributes=n,t.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(t.data.groups=JSON.parse(JSON.stringify(o)));const s=this.boundingSphere;return null!==s&&(t.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),t}clone(){return(new wi).copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const i=t.index;null!==i&&this.setIndex(i.clone(e));const n=t.attributes;for(const t in n){const i=n[t];this.setAttribute(t,i.clone(e))}const r=t.morphAttributes;for(const t in r){const i=[],n=r[t];for(let t=0,r=n.length;t<r;t++)i.push(n[t].clone(e));this.morphAttributes[t]=i}this.morphTargetsRelative=t.morphTargetsRelative;const o=t.groups;for(let t=0,e=o.length;t<e;t++){const e=o[t];this.addGroup(e.start,e.count,e.materialIndex)}const s=t.boundingBox;null!==s&&(this.boundingBox=s.clone());const a=t.boundingSphere;return null!==a&&(this.boundingSphere=a.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}wi.prototype.isBufferGeometry=!0;const Ai=new se,Ei=new oe,Si=new Jt,Mi=new Ct,Ti=new Ct,Ii=new Ct,Ci=new Ct,Pi=new Ct,Li=new Ct,Di=new Ct,Ri=new Ct,Oi=new Ct,ki=new yt,Ni=new yt,Bi=new yt,zi=new Ct,Fi=new Ct;class Vi extends Le{constructor(t=new wi,e=new Ke){super(),this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t){return super.copy(t),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=t.material,this.geometry=t.geometry,this}updateMorphTargets(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,i=Object.keys(e);if(i.length>0){const t=e[i[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,i=t.length;e<i;e++){const i=t[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=e}}}}else{const e=t.morphTargets;void 0!==e&&e.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(t,e){const i=this.geometry,n=this.material,r=this.matrixWorld;if(void 0===n)return;if(null===i.boundingSphere&&i.computeBoundingSphere(),Si.copy(i.boundingSphere),Si.applyMatrix4(r),!1===t.ray.intersectsSphere(Si))return;if(Ai.copy(r).invert(),Ei.copy(t.ray).applyMatrix4(Ai),null!==i.boundingBox&&!1===Ei.intersectsBox(i.boundingBox))return;let o;if(i.isBufferGeometry){const r=i.index,s=i.attributes.position,a=i.morphAttributes.position,l=i.morphTargetsRelative,c=i.attributes.uv,u=i.attributes.uv2,h=i.groups,p=i.drawRange;if(null!==r)if(Array.isArray(n))for(let i=0,d=h.length;i<d;i++){const d=h[i],f=n[d.materialIndex];for(let i=Math.max(d.start,p.start),n=Math.min(d.start+d.count,p.start+p.count);i<n;i+=3){const n=r.getX(i),h=r.getX(i+1),p=r.getX(i+2);o=Ui(this,f,t,Ei,s,a,l,c,u,n,h,p),o&&(o.faceIndex=Math.floor(i/3),o.face.materialIndex=d.materialIndex,e.push(o))}}else for(let i=Math.max(0,p.start),h=Math.min(r.count,p.start+p.count);i<h;i+=3){const h=r.getX(i),p=r.getX(i+1),d=r.getX(i+2);o=Ui(this,n,t,Ei,s,a,l,c,u,h,p,d),o&&(o.faceIndex=Math.floor(i/3),e.push(o))}else if(void 0!==s)if(Array.isArray(n))for(let i=0,r=h.length;i<r;i++){const r=h[i],d=n[r.materialIndex];for(let i=Math.max(r.start,p.start),n=Math.min(r.start+r.count,p.start+p.count);i<n;i+=3)o=Ui(this,d,t,Ei,s,a,l,c,u,i,i+1,i+2),o&&(o.faceIndex=Math.floor(i/3),o.face.materialIndex=r.materialIndex,e.push(o))}else for(let i=Math.max(0,p.start),r=Math.min(s.count,p.start+p.count);i<r;i+=3)o=Ui(this,n,t,Ei,s,a,l,c,u,i,i+1,i+2),o&&(o.faceIndex=Math.floor(i/3),e.push(o))}else i.isGeometry&&console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}function Ui(t,e,i,n,r,o,s,a,l,c,u,h){Mi.fromBufferAttribute(r,c),Ti.fromBufferAttribute(r,u),Ii.fromBufferAttribute(r,h);const p=t.morphTargetInfluences;if(o&&p){Di.set(0,0,0),Ri.set(0,0,0),Oi.set(0,0,0);for(let t=0,e=o.length;t<e;t++){const e=p[t],i=o[t];0!==e&&(Ci.fromBufferAttribute(i,c),Pi.fromBufferAttribute(i,u),Li.fromBufferAttribute(i,h),s?(Di.addScaledVector(Ci,e),Ri.addScaledVector(Pi,e),Oi.addScaledVector(Li,e)):(Di.addScaledVector(Ci.sub(Mi),e),Ri.addScaledVector(Pi.sub(Ti),e),Oi.addScaledVector(Li.sub(Ii),e)))}Mi.add(Di),Ti.add(Ri),Ii.add(Oi)}t.isSkinnedMesh&&(t.boneTransform(c,Mi),t.boneTransform(u,Ti),t.boneTransform(h,Ii));const d=function(t,e,i,n,r,o,s,a){let l;if(l=1===e.side?n.intersectTriangle(s,o,r,!0,a):n.intersectTriangle(r,o,s,2!==e.side,a),null===l)return null;Fi.copy(a),Fi.applyMatrix4(t.matrixWorld);const c=i.ray.origin.distanceTo(Fi);return c<i.near||c>i.far?null:{distance:c,point:Fi.clone(),object:t}}(t,e,i,n,Mi,Ti,Ii,zi);if(d){a&&(ki.fromBufferAttribute(a,c),Ni.fromBufferAttribute(a,u),Bi.fromBufferAttribute(a,h),d.uv=Ge.getUV(zi,Mi,Ti,Ii,ki,Ni,Bi,new yt)),l&&(ki.fromBufferAttribute(l,c),Ni.fromBufferAttribute(l,u),Bi.fromBufferAttribute(l,h),d.uv2=Ge.getUV(zi,Mi,Ti,Ii,ki,Ni,Bi,new yt));const t={a:c,b:u,c:h,normal:new Ct,materialIndex:0};Ge.getNormal(Mi,Ti,Ii,t.normal),d.face=t}return d}Vi.prototype.isMesh=!0;class Gi extends wi{constructor(t=1,e=1,i=1,n=1,r=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:n,heightSegments:r,depthSegments:o};const s=this;n=Math.floor(n),r=Math.floor(r),o=Math.floor(o);const a=[],l=[],c=[],u=[];let h=0,p=0;function d(t,e,i,n,r,o,d,f,m,g,y){const v=o/m,_=d/g,x=o/2,b=d/2,w=f/2,A=m+1,E=g+1;let S=0,M=0;const T=new Ct;for(let o=0;o<E;o++){const s=o*_-b;for(let a=0;a<A;a++){const h=a*v-x;T[t]=h*n,T[e]=s*r,T[i]=w,l.push(T.x,T.y,T.z),T[t]=0,T[e]=0,T[i]=f>0?1:-1,c.push(T.x,T.y,T.z),u.push(a/m),u.push(1-o/g),S+=1}}for(let t=0;t<g;t++)for(let e=0;e<m;e++){const i=h+e+A*t,n=h+e+A*(t+1),r=h+(e+1)+A*(t+1),o=h+(e+1)+A*t;a.push(i,n,o),a.push(n,r,o),M+=6}s.addGroup(p,M,y),p+=M,h+=S}d("z","y","x",-1,-1,i,e,t,o,r,0),d("z","y","x",1,-1,i,e,-t,o,r,1),d("x","z","y",1,1,t,i,e,n,o,2),d("x","z","y",1,-1,t,i,-e,n,o,3),d("x","y","z",1,-1,t,e,i,n,r,4),d("x","y","z",-1,-1,t,e,-i,n,r,5),this.setIndex(a),this.setAttribute("position",new ui(l,3)),this.setAttribute("normal",new ui(c,3)),this.setAttribute("uv",new ui(u,2))}static fromJSON(t){return new Gi(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function ji(t){const e={};for(const i in t){e[i]={};for(const n in t[i]){const r=t[i][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?e[i][n]=r.clone():Array.isArray(r)?e[i][n]=r.slice():e[i][n]=r}}return e}function Hi(t){const e={};for(let i=0;i<t.length;i++){const n=ji(t[i]);for(const t in n)e[t]=n[t]}return e}const Wi={clone:ji,merge:Hi};class qi extends He{constructor(t){super(),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=ji(t.uniforms),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(const i in this.uniforms){const n=this.uniforms[i].value;n&&n.isTexture?e.uniforms[i]={type:"t",value:n.toJSON(t).uuid}:n&&n.isColor?e.uniforms[i]={type:"c",value:n.getHex()}:n&&n.isVector2?e.uniforms[i]={type:"v2",value:n.toArray()}:n&&n.isVector3?e.uniforms[i]={type:"v3",value:n.toArray()}:n&&n.isVector4?e.uniforms[i]={type:"v4",value:n.toArray()}:n&&n.isMatrix3?e.uniforms[i]={type:"m3",value:n.toArray()}:n&&n.isMatrix4?e.uniforms[i]={type:"m4",value:n.toArray()}:e.uniforms[i]={value:n}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;const i={};for(const t in this.extensions)!0===this.extensions[t]&&(i[t]=!0);return Object.keys(i).length>0&&(e.extensions=i),e}}qi.prototype.isShaderMaterial=!0;class Xi extends Le{constructor(){super(),this.type="Camera",this.matrixWorldInverse=new se,this.projectionMatrix=new se,this.projectionMatrixInverse=new se}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}Xi.prototype.isCamera=!0;class Zi extends Xi{constructor(t=50,e=1,i=.1,n=2e3){super(),this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=i,this.far=n,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=2*lt*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*at*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*lt*Math.atan(Math.tan(.5*at*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(t,e,i,n,r,o){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*at*this.fov)/this.zoom,i=2*e,n=this.aspect*i,r=-.5*n;const o=this.view;if(null!==this.view&&this.view.enabled){const t=o.fullWidth,s=o.fullHeight;r+=o.offsetX*n/t,e-=o.offsetY*i/s,n*=o.width/t,i*=o.height/s}const s=this.filmOffset;0!==s&&(r+=t*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+n,e,e-i,t,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}Zi.prototype.isPerspectiveCamera=!0;const Yi=90;class Qi extends Le{constructor(t,e,i){if(super(),this.type="CubeCamera",!0!==i.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=i;const n=new Zi(Yi,1,t,e);n.layers=this.layers,n.up.set(0,-1,0),n.lookAt(new Ct(1,0,0)),this.add(n);const r=new Zi(Yi,1,t,e);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new Ct(-1,0,0)),this.add(r);const o=new Zi(Yi,1,t,e);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new Ct(0,1,0)),this.add(o);const s=new Zi(Yi,1,t,e);s.layers=this.layers,s.up.set(0,0,-1),s.lookAt(new Ct(0,-1,0)),this.add(s);const a=new Zi(Yi,1,t,e);a.layers=this.layers,a.up.set(0,-1,0),a.lookAt(new Ct(0,0,1)),this.add(a);const l=new Zi(Yi,1,t,e);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new Ct(0,0,-1)),this.add(l)}update(t,e){null===this.parent&&this.updateMatrixWorld();const i=this.renderTarget,[n,r,o,s,a,l]=this.children,c=t.xr.enabled,u=t.getRenderTarget();t.xr.enabled=!1;const h=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,t.setRenderTarget(i,0),t.render(e,n),t.setRenderTarget(i,1),t.render(e,r),t.setRenderTarget(i,2),t.render(e,o),t.setRenderTarget(i,3),t.render(e,s),t.setRenderTarget(i,4),t.render(e,a),i.texture.generateMipmaps=h,t.setRenderTarget(i,5),t.render(e,l),t.setRenderTarget(u),t.xr.enabled=c}}class Ji extends wt{constructor(t,e,i,n,o,s,a,l,c,u){super(t=void 0!==t?t:[],e=void 0!==e?e:r,i,n,o,s,a=void 0!==a?a:S,l,c,u),this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}Ji.prototype.isCubeTexture=!0;class Ki extends St{constructor(t,e,i){Number.isInteger(e)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),e=i),super(t,t,e),e=e||{},this.texture=new Ji(void 0,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:g,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.format=M,this.texture.encoding=e.encoding,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},n=new Gi(5,5,5),r=new qi({name:"CubemapFromEquirect",uniforms:ji(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=e;const o=new Vi(n,r),s=e.minFilter;return e.minFilter===v&&(e.minFilter=g),new Qi(1,10,this).update(t,o),e.minFilter=s,o.geometry.dispose(),o.material.dispose(),this}clear(t,e,i,n){const r=t.getRenderTarget();for(let r=0;r<6;r++)t.setRenderTarget(this,r),t.clear(e,i,n);t.setRenderTarget(r)}}Ki.prototype.isWebGLCubeRenderTarget=!0;const $i=new Ct,tn=new Ct,en=new vt;class nn{constructor(t=new Ct(1,0,0),e=0){this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,i,n){return this.normal.set(t,e,i),this.constant=n,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,i){const n=$i.subVectors(i,e).cross(tn.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(n,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)}intersectLine(t,e){const i=t.delta($i),n=this.normal.dot(i);if(0===n)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const r=-(t.start.dot(this.normal)+this.constant)/n;return r<0||r>1?null:e.copy(i).multiplyScalar(r).add(t.start)}intersectsLine(t){const e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const i=e||en.getNormalMatrix(t),n=this.coplanarPoint($i).applyMatrix4(t),r=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return(new this.constructor).copy(this)}}nn.prototype.isPlane=!0;const rn=new Jt,on=new Ct;class sn{constructor(t=new nn,e=new nn,i=new nn,n=new nn,r=new nn,o=new nn){this.planes=[t,e,i,n,r,o]}set(t,e,i,n,r,o){const s=this.planes;return s[0].copy(t),s[1].copy(e),s[2].copy(i),s[3].copy(n),s[4].copy(r),s[5].copy(o),this}copy(t){const e=this.planes;for(let i=0;i<6;i++)e[i].copy(t.planes[i]);return this}setFromProjectionMatrix(t){const e=this.planes,i=t.elements,n=i[0],r=i[1],o=i[2],s=i[3],a=i[4],l=i[5],c=i[6],u=i[7],h=i[8],p=i[9],d=i[10],f=i[11],m=i[12],g=i[13],y=i[14],v=i[15];return e[0].setComponents(s-n,u-a,f-h,v-m).normalize(),e[1].setComponents(s+n,u+a,f+h,v+m).normalize(),e[2].setComponents(s+r,u+l,f+p,v+g).normalize(),e[3].setComponents(s-r,u-l,f-p,v-g).normalize(),e[4].setComponents(s-o,u-c,f-d,v-y).normalize(),e[5].setComponents(s+o,u+c,f+d,v+y).normalize(),this}intersectsObject(t){const e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),rn.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(rn)}intersectsSprite(t){return rn.center.set(0,0,0),rn.radius=.7071067811865476,rn.applyMatrix4(t.matrixWorld),this.intersectsSphere(rn)}intersectsSphere(t){const e=this.planes,i=t.center,n=-t.radius;for(let t=0;t<6;t++)if(e[t].distanceToPoint(i)<n)return!1;return!0}intersectsBox(t){const e=this.planes;for(let i=0;i<6;i++){const n=e[i];if(on.x=n.normal.x>0?t.max.x:t.min.x,on.y=n.normal.y>0?t.max.y:t.min.y,on.z=n.normal.z>0?t.max.z:t.min.z,n.distanceToPoint(on)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function an(){let t=null,e=!1,i=null,n=null;function r(e,o){i(e,o),n=t.requestAnimationFrame(r)}return{start:function(){!0!==e&&null!==i&&(n=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(t){i=t},setContext:function(e){t=e}}}function ln(t,e){const i=e.isWebGL2,n=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),n.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);const i=n.get(e);i&&(t.deleteBuffer(i.buffer),n.delete(e))},update:function(e,r){if(e.isGLBufferAttribute){const t=n.get(e);return void((!t||t.version<e.version)&&n.set(e,{buffer:e.buffer,type:e.type,bytesPerElement:e.elementSize,version:e.version}))}e.isInterleavedBufferAttribute&&(e=e.data);const o=n.get(e);void 0===o?n.set(e,function(e,n){const r=e.array,o=e.usage,s=t.createBuffer();t.bindBuffer(n,s),t.bufferData(n,r,o),e.onUploadCallback();let a=5126;return r instanceof Float32Array?a=5126:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?e.isFloat16BufferAttribute?i?a=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):a=5123:r instanceof Int16Array?a=5122:r instanceof Uint32Array?a=5125:r instanceof Int32Array?a=5124:r instanceof Int8Array?a=5120:(r instanceof Uint8Array||r instanceof Uint8ClampedArray)&&(a=5121),{buffer:s,type:a,bytesPerElement:r.BYTES_PER_ELEMENT,version:e.version}}(e,r)):o.version<e.version&&(function(e,n,r){const o=n.array,s=n.updateRange;t.bindBuffer(r,e),-1===s.count?t.bufferSubData(r,0,o):(i?t.bufferSubData(r,s.offset*o.BYTES_PER_ELEMENT,o,s.offset,s.count):t.bufferSubData(r,s.offset*o.BYTES_PER_ELEMENT,o.subarray(s.offset,s.offset+s.count)),s.count=-1)}(o.buffer,e,r),o.version=e.version)}}}class cn extends wi{constructor(t=1,e=1,i=1,n=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:n};const r=t/2,o=e/2,s=Math.floor(i),a=Math.floor(n),l=s+1,c=a+1,u=t/s,h=e/a,p=[],d=[],f=[],m=[];for(let t=0;t<c;t++){const e=t*h-o;for(let i=0;i<l;i++){const n=i*u-r;d.push(n,-e,0),f.push(0,0,1),m.push(i/s),m.push(1-t/a)}}for(let t=0;t<a;t++)for(let e=0;e<s;e++){const i=e+l*t,n=e+l*(t+1),r=e+1+l*(t+1),o=e+1+l*t;p.push(i,n,o),p.push(n,r,o)}this.setIndex(p),this.setAttribute("position",new ui(d,3)),this.setAttribute("normal",new ui(f,3)),this.setAttribute("uv",new ui(m,2))}static fromJSON(t){return new cn(t.width,t.height,t.widthSegments,t.heightSegments)}}const un={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\tif ( diffuseColor.a < alphaTest ) discard;\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotVH = saturate( dot( geometry.viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float NoH ) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float NoV, float NoL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( NoL + NoV - NoL * NoV ) ) );\n}\nvec3 BRDF_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getIBLIrradiance( const in GeometricContext geometry ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec;\n\t\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\t\treflectVec = reflect( - viewDir, normal );\n\t\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\t#else\n\t\t\t\treflectVec = refract( - viewDir, normal, refractionRatio );\n\t\t\t#endif\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tlightMapIrradiance *= PI;\n\t#endif\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointLightInfo( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotLightInfo( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalLightInfo( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#else\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularTintFactor = specularTint;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARTINTMAP\n\t\t\tspecularTintFactor *= specularTintMapTexelToLinear( texture2D( specularTintMap, vUv ) ).rgb;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularTintFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( ior - 1.0 ) / ( ior + 1.0 ) ) * specularTintFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenTint = sheenTint;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenTint;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\tvec3 FssEss = specularColor * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3(\t\t0, 1,\t\t0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += irradiance * BRDF_Sheen( material.roughness, directLight.direction, geometry, material.sheenTint );\n\t#else\n\t\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",output_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t\tf.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t\tf.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3(\t1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108,\t1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605,\t1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tfloat transmissionAlpha = 1.0;\n\tfloat transmissionFactor = transmission;\n\tfloat thicknessFactor = thickness;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationTint, attenuationDistance );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n\ttransmissionAlpha = transmission.a;\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationTint;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tvec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( float roughness, float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior ) {\n\t\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance ) {\n\t\tif ( attenuationDistance == 0.0 ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 diffuseColor, vec3 specularColor, float specularF90,\n\t\tvec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness,\n\t\tvec3 attenuationColor, float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularTint;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARTINTMAP\n\t\tuniform sampler2D specularTintMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenTint;\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - clearcoat * Fcc ) + clearcoatSpecular * clearcoat;\n\t#endif\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",shadow_vert:"#include <common>\n#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}"},hn={common:{diffuse:{value:new Je(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new vt},uv2Transform:{value:new vt},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new yt(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Je(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Je(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new vt}},sprite:{diffuse:{value:new Je(16777215)},opacity:{value:1},center:{value:new yt(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new vt}}},pn={basic:{uniforms:Hi([hn.common,hn.specularmap,hn.envmap,hn.aomap,hn.lightmap,hn.fog]),vertexShader:un.meshbasic_vert,fragmentShader:un.meshbasic_frag},lambert:{uniforms:Hi([hn.common,hn.specularmap,hn.envmap,hn.aomap,hn.lightmap,hn.emissivemap,hn.fog,hn.lights,{emissive:{value:new Je(0)}}]),vertexShader:un.meshlambert_vert,fragmentShader:un.meshlambert_frag},phong:{uniforms:Hi([hn.common,hn.specularmap,hn.envmap,hn.aomap,hn.lightmap,hn.emissivemap,hn.bumpmap,hn.normalmap,hn.displacementmap,hn.fog,hn.lights,{emissive:{value:new Je(0)},specular:{value:new Je(1118481)},shininess:{value:30}}]),vertexShader:un.meshphong_vert,fragmentShader:un.meshphong_frag},standard:{uniforms:Hi([hn.common,hn.envmap,hn.aomap,hn.lightmap,hn.emissivemap,hn.bumpmap,hn.normalmap,hn.displacementmap,hn.roughnessmap,hn.metalnessmap,hn.fog,hn.lights,{emissive:{value:new Je(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:un.meshphysical_vert,fragmentShader:un.meshphysical_frag},toon:{uniforms:Hi([hn.common,hn.aomap,hn.lightmap,hn.emissivemap,hn.bumpmap,hn.normalmap,hn.displacementmap,hn.gradientmap,hn.fog,hn.lights,{emissive:{value:new Je(0)}}]),vertexShader:un.meshtoon_vert,fragmentShader:un.meshtoon_frag},matcap:{uniforms:Hi([hn.common,hn.bumpmap,hn.normalmap,hn.displacementmap,hn.fog,{matcap:{value:null}}]),vertexShader:un.meshmatcap_vert,fragmentShader:un.meshmatcap_frag},points:{uniforms:Hi([hn.points,hn.fog]),vertexShader:un.points_vert,fragmentShader:un.points_frag},dashed:{uniforms:Hi([hn.common,hn.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:un.linedashed_vert,fragmentShader:un.linedashed_frag},depth:{uniforms:Hi([hn.common,hn.displacementmap]),vertexShader:un.depth_vert,fragmentShader:un.depth_frag},normal:{uniforms:Hi([hn.common,hn.bumpmap,hn.normalmap,hn.displacementmap,{opacity:{value:1}}]),vertexShader:un.meshnormal_vert,fragmentShader:un.meshnormal_frag},sprite:{uniforms:Hi([hn.sprite,hn.fog]),vertexShader:un.sprite_vert,fragmentShader:un.sprite_frag},background:{uniforms:{uvTransform:{value:new vt},t2D:{value:null}},vertexShader:un.background_vert,fragmentShader:un.background_frag},cube:{uniforms:Hi([hn.envmap,{opacity:{value:1}}]),vertexShader:un.cube_vert,fragmentShader:un.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:un.equirect_vert,fragmentShader:un.equirect_frag},distanceRGBA:{uniforms:Hi([hn.common,hn.displacementmap,{referencePosition:{value:new Ct},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:un.distanceRGBA_vert,fragmentShader:un.distanceRGBA_frag},shadow:{uniforms:Hi([hn.lights,hn.fog,{color:{value:new Je(0)},opacity:{value:1}}]),vertexShader:un.shadow_vert,fragmentShader:un.shadow_frag}};function dn(t,e,i,n,r){const o=new Je(0);let s,a,c=0,u=null,h=0,p=null;function d(t,e){i.buffers.color.setClear(t.r,t.g,t.b,e,r)}return{getClearColor:function(){return o},setClearColor:function(t,e=1){o.set(t),c=e,d(o,c)},getClearAlpha:function(){return c},setClearAlpha:function(t){c=t,d(o,c)},render:function(i,r){let f=!1,m=!0===r.isScene?r.background:null;m&&m.isTexture&&(m=e.get(m));const g=t.xr,y=g.getSession&&g.getSession();y&&"additive"===y.environmentBlendMode&&(m=null),null===m?d(o,c):m&&m.isColor&&(d(m,1),f=!0),(t.autoClear||f)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),m&&(m.isCubeTexture||m.mapping===l)?(void 0===a&&(a=new Vi(new Gi(1,1,1),new qi({name:"BackgroundCubeMaterial",uniforms:ji(pn.cube.uniforms),vertexShader:pn.cube.vertexShader,fragmentShader:pn.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),a.geometry.deleteAttribute("uv"),a.onBeforeRender=function(t,e,i){this.matrixWorld.copyPosition(i.matrixWorld)},Object.defineProperty(a.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(a)),a.material.uniforms.envMap.value=m,a.material.uniforms.flipEnvMap.value=m.isCubeTexture&&!1===m.isRenderTargetTexture?-1:1,u===m&&h===m.version&&p===t.toneMapping||(a.material.needsUpdate=!0,u=m,h=m.version,p=t.toneMapping),i.unshift(a,a.geometry,a.material,0,0,null)):m&&m.isTexture&&(void 0===s&&(s=new Vi(new cn(2,2),new qi({name:"BackgroundMaterial",uniforms:ji(pn.background.uniforms),vertexShader:pn.background.vertexShader,fragmentShader:pn.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),s.geometry.deleteAttribute("normal"),Object.defineProperty(s.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(s)),s.material.uniforms.t2D.value=m,!0===m.matrixAutoUpdate&&m.updateMatrix(),s.material.uniforms.uvTransform.value.copy(m.matrix),u===m&&h===m.version&&p===t.toneMapping||(s.material.needsUpdate=!0,u=m,h=m.version,p=t.toneMapping),i.unshift(s,s.geometry,s.material,0,0,null))}}}function fn(t,e,i,n){const r=t.getParameter(34921),o=n.isWebGL2?null:e.get("OES_vertex_array_object"),s=n.isWebGL2||null!==o,a={},l=p(null);let c=l;function u(e){return n.isWebGL2?t.bindVertexArray(e):o.bindVertexArrayOES(e)}function h(e){return n.isWebGL2?t.deleteVertexArray(e):o.deleteVertexArrayOES(e)}function p(t){const e=[],i=[],n=[];for(let t=0;t<r;t++)e[t]=0,i[t]=0,n[t]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:e,enabledAttributes:i,attributeDivisors:n,object:t,attributes:{},index:null}}function d(){const t=c.newAttributes;for(let e=0,i=t.length;e<i;e++)t[e]=0}function f(t){m(t,0)}function m(i,r){const o=c.newAttributes,s=c.enabledAttributes,a=c.attributeDivisors;o[i]=1,0===s[i]&&(t.enableVertexAttribArray(i),s[i]=1),a[i]!==r&&((n.isWebGL2?t:e.get("ANGLE_instanced_arrays"))[n.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](i,r),a[i]=r)}function g(){const e=c.newAttributes,i=c.enabledAttributes;for(let n=0,r=i.length;n<r;n++)i[n]!==e[n]&&(t.disableVertexAttribArray(n),i[n]=0)}function y(e,i,r,o,s,a){!0!==n.isWebGL2||5124!==r&&5125!==r?t.vertexAttribPointer(e,i,r,o,s,a):t.vertexAttribIPointer(e,i,r,s,a)}function v(){_(),c!==l&&(c=l,u(c.object))}function _(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:function(r,l,h,v,_){let x=!1;if(s){const e=function(e,i,r){const s=!0===r.wireframe;let l=a[e.id];void 0===l&&(l={},a[e.id]=l);let c=l[i.id];void 0===c&&(c={},l[i.id]=c);let u=c[s];return void 0===u&&(u=p(n.isWebGL2?t.createVertexArray():o.createVertexArrayOES()),c[s]=u),u}(v,h,l);c!==e&&(c=e,u(c.object)),x=function(t,e){const i=c.attributes,n=t.attributes;let r=0;for(const t in n){const e=i[t],o=n[t];if(void 0===e)return!0;if(e.attribute!==o)return!0;if(e.data!==o.data)return!0;r++}return c.attributesNum!==r||c.index!==e}(v,_),x&&function(t,e){const i={},n=t.attributes;let r=0;for(const t in n){const e=n[t],o={};o.attribute=e,e.data&&(o.data=e.data),i[t]=o,r++}c.attributes=i,c.attributesNum=r,c.index=e}(v,_)}else{const t=!0===l.wireframe;c.geometry===v.id&&c.program===h.id&&c.wireframe===t||(c.geometry=v.id,c.program=h.id,c.wireframe=t,x=!0)}!0===r.isInstancedMesh&&(x=!0),null!==_&&i.update(_,34963),x&&(function(r,o,s,a){if(!1===n.isWebGL2&&(r.isInstancedMesh||a.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;d();const l=a.attributes,c=s.getAttributes(),u=o.defaultAttributeValues;for(const e in c){const n=c[e];if(n.location>=0){let o=l[e];if(void 0===o&&("instanceMatrix"===e&&r.instanceMatrix&&(o=r.instanceMatrix),"instanceColor"===e&&r.instanceColor&&(o=r.instanceColor)),void 0!==o){const e=o.normalized,s=o.itemSize,l=i.get(o);if(void 0===l)continue;const c=l.buffer,u=l.type,h=l.bytesPerElement;if(o.isInterleavedBufferAttribute){const i=o.data,l=i.stride,p=o.offset;if(i&&i.isInstancedInterleavedBuffer){for(let t=0;t<n.locationSize;t++)m(n.location+t,i.meshPerAttribute);!0!==r.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=i.meshPerAttribute*i.count)}else for(let t=0;t<n.locationSize;t++)f(n.location+t);t.bindBuffer(34962,c);for(let t=0;t<n.locationSize;t++)y(n.location+t,s/n.locationSize,u,e,l*h,(p+s/n.locationSize*t)*h)}else{if(o.isInstancedBufferAttribute){for(let t=0;t<n.locationSize;t++)m(n.location+t,o.meshPerAttribute);!0!==r.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=o.meshPerAttribute*o.count)}else for(let t=0;t<n.locationSize;t++)f(n.location+t);t.bindBuffer(34962,c);for(let t=0;t<n.locationSize;t++)y(n.location+t,s/n.locationSize,u,e,s*h,s/n.locationSize*t*h)}}else if(void 0!==u){const i=u[e];if(void 0!==i)switch(i.length){case 2:t.vertexAttrib2fv(n.location,i);break;case 3:t.vertexAttrib3fv(n.location,i);break;case 4:t.vertexAttrib4fv(n.location,i);break;default:t.vertexAttrib1fv(n.location,i)}}}}g()}(r,l,h,v),null!==_&&t.bindBuffer(34963,i.get(_).buffer))},reset:v,resetDefaultState:_,dispose:function(){v();for(const t in a){const e=a[t];for(const t in e){const i=e[t];for(const t in i)h(i[t].object),delete i[t];delete e[t]}delete a[t]}},releaseStatesOfGeometry:function(t){if(void 0===a[t.id])return;const e=a[t.id];for(const t in e){const i=e[t];for(const t in i)h(i[t].object),delete i[t];delete e[t]}delete a[t.id]},releaseStatesOfProgram:function(t){for(const e in a){const i=a[e];if(void 0===i[t.id])continue;const n=i[t.id];for(const t in n)h(n[t].object),delete n[t];delete i[t.id]}},initAttributes:d,enableAttribute:f,disableUnusedAttributes:g}}function mn(t,e,i,n){const r=n.isWebGL2;let o;this.setMode=function(t){o=t},this.render=function(e,n){t.drawArrays(o,e,n),i.update(n,o,1)},this.renderInstances=function(n,s,a){if(0===a)return;let l,c;if(r)l=t,c="drawArraysInstanced";else if(l=e.get("ANGLE_instanced_arrays"),c="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[c](o,n,s,a),i.update(s,o,a)}}function gn(t,e,i){let n;function r(e){if("highp"===e){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const o="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext;let s=void 0!==i.precision?i.precision:"highp";const a=r(s);a!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",a,"instead."),s=a);const l=o||e.has("WEBGL_draw_buffers"),c=!0===i.logarithmicDepthBuffer,u=t.getParameter(34930),h=t.getParameter(35660),p=t.getParameter(3379),d=t.getParameter(34076),f=t.getParameter(34921),m=t.getParameter(36347),g=t.getParameter(36348),y=t.getParameter(36349),v=h>0,_=o||e.has("OES_texture_float");return{isWebGL2:o,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==n)return n;if(!0===e.has("EXT_texture_filter_anisotropic")){const i=e.get("EXT_texture_filter_anisotropic");n=t.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n},getMaxPrecision:r,precision:s,logarithmicDepthBuffer:c,maxTextures:u,maxVertexTextures:h,maxTextureSize:p,maxCubemapSize:d,maxAttributes:f,maxVertexUniforms:m,maxVaryings:g,maxFragmentUniforms:y,vertexTextures:v,floatFragmentTextures:_,floatVertexTextures:v&&_,maxSamples:o?t.getParameter(36183):0}}function yn(t){const e=this;let i=null,n=0,r=!1,o=!1;const s=new nn,a=new vt,l={value:null,needsUpdate:!1};function c(){l.value!==i&&(l.value=i,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function u(t,i,n,r){const o=null!==t?t.length:0;let c=null;if(0!==o){if(c=l.value,!0!==r||null===c){const e=n+4*o,r=i.matrixWorldInverse;a.getNormalMatrix(r),(null===c||c.length<e)&&(c=new Float32Array(e));for(let e=0,i=n;e!==o;++e,i+=4)s.copy(t[e]).applyMatrix4(r,a),s.normal.toArray(c,i),c[i+3]=s.constant}l.value=c,l.needsUpdate=!0}return e.numPlanes=o,e.numIntersection=0,c}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(t,e,o){const s=0!==t.length||e||0!==n||r;return r=e,i=u(t,o,0),n=t.length,s},this.beginShadows=function(){o=!0,u(null)},this.endShadows=function(){o=!1,c()},this.setState=function(e,s,a){const h=e.clippingPlanes,p=e.clipIntersection,d=e.clipShadows,f=t.get(e);if(!r||null===h||0===h.length||o&&!d)o?u(null):c();else{const t=o?0:n,e=4*t;let r=f.clippingState||null;l.value=r,r=u(h,s,e,a);for(let t=0;t!==e;++t)r[t]=i[t];f.clippingState=r,this.numIntersection=p?this.numPlanes:0,this.numPlanes+=t}}}function vn(t){let e=new WeakMap;function i(t,e){return e===s?t.mapping=r:e===a&&(t.mapping=o),t}function n(t){const i=t.target;i.removeEventListener("dispose",n);const r=e.get(i);void 0!==r&&(e.delete(i),r.dispose())}return{get:function(r){if(r&&r.isTexture&&!1===r.isRenderTargetTexture){const o=r.mapping;if(o===s||o===a){if(e.has(r))return i(e.get(r).texture,r.mapping);{const o=r.image;if(o&&o.height>0){const s=t.getRenderTarget(),a=new Ki(o.height/2);return a.fromEquirectangularTexture(t,r),e.set(r,a),t.setRenderTarget(s),r.addEventListener("dispose",n),i(a.texture,r.mapping)}return null}}}return r},dispose:function(){e=new WeakMap}}}pn.physical={uniforms:Hi([pn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new yt(1,1)},clearcoatNormalMap:{value:null},sheenTint:{value:new Je(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new yt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationTint:{value:new Je(0)},specularIntensity:{value:0},specularIntensityMap:{value:null},specularTint:{value:new Je(1,1,1)},specularTintMap:{value:null}}]),vertexShader:un.meshphysical_vert,fragmentShader:un.meshphysical_frag};class _n extends Xi{constructor(t=-1,e=1,i=1,n=-1,r=.1,o=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=i,this.bottom=n,this.near=r,this.far=o,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,i,n,r,o){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2;let r=i-t,o=i+t,s=n+e,a=n-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=t*this.view.offsetX,o=r+t*this.view.width,s-=e*this.view.offsetY,a=s-e*this.view.height}this.projectionMatrix.makeOrthographic(r,o,s,a,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}_n.prototype.isOrthographicCamera=!0;class xn extends qi{constructor(t){super(t),this.type="RawShaderMaterial"}}xn.prototype.isRawShaderMaterial=!0;const bn=Math.pow(2,8),wn=[.125,.215,.35,.446,.526,.582],An=5+wn.length,En=20,Sn={[X]:0,[Z]:1,[Q]:2,[J]:3,[K]:4,[$]:5,[Y]:6},Mn=new _n,{_lodPlanes:Tn,_sizeLods:In,_sigmas:Cn}=Bn(),Pn=new Je;let Ln=null;const Dn=(1+Math.sqrt(5))/2,Rn=1/Dn,On=[new Ct(1,1,1),new Ct(-1,1,1),new Ct(1,1,-1),new Ct(-1,1,-1),new Ct(0,Dn,Rn),new Ct(0,Dn,-Rn),new Ct(Rn,0,Dn),new Ct(-Rn,0,Dn),new Ct(Dn,Rn,0),new Ct(-Dn,Rn,0)];class kn{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._blurMaterial=function(t){const e=new Float32Array(t),i=new Ct(0,1,0);return new xn({name:"SphericalGaussianBlur",defines:{n:t},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i},inputEncoding:{value:Sn[3e3]},outputEncoding:{value:Sn[3e3]}},vertexShader:Gn(),fragmentShader:`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t${jn()}\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t`,blending:0,depthTest:!1,depthWrite:!1})}(En),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,i=.1,n=100){Ln=this._renderer.getRenderTarget();const r=this._allocateTargets();return this._sceneToCubeUV(t,i,n,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t){return this._fromTexture(t)}fromCubemap(t){return this._fromTexture(t)}compileCubemapShader(){null===this._cubemapShader&&(this._cubemapShader=Un(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){null===this._equirectShader&&(this._equirectShader=Vn(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(let t=0;t<Tn.length;t++)Tn[t].dispose()}_cleanup(t){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(Ln),t.scissorTest=!1,Fn(t,0,0,t.width,t.height)}_fromTexture(t){Ln=this._renderer.getRenderTarget();const e=this._allocateTargets(t);return this._textureToCubeUV(t,e),this._applyPMREM(e),this._cleanup(e),e}_allocateTargets(t){const e={magFilter:d,minFilter:d,generateMipmaps:!1,type:_,format:1023,encoding:Nn(t)?t.encoding:Q,depthBuffer:!1},i=zn(e);return i.depthBuffer=!t,this._pingPongRenderTarget=zn(e),i}_compileMaterial(t){const e=new Vi(Tn[0],t);this._renderer.compile(e,Mn)}_sceneToCubeUV(t,e,i,n){const r=new Zi(90,1,e,i),o=[1,-1,1,1,1,1],s=[1,1,1,-1,-1,-1],a=this._renderer,l=a.autoClear,c=a.outputEncoding,u=a.toneMapping;a.getClearColor(Pn),a.toneMapping=0,a.outputEncoding=X,a.autoClear=!1;const h=new Ke({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1}),p=new Vi(new Gi,h);let d=!1;const f=t.background;f?f.isColor&&(h.color.copy(f),t.background=null,d=!0):(h.color.copy(Pn),d=!0);for(let e=0;e<6;e++){const i=e%3;0==i?(r.up.set(0,o[e],0),r.lookAt(s[e],0,0)):1==i?(r.up.set(0,0,o[e]),r.lookAt(0,s[e],0)):(r.up.set(0,o[e],0),r.lookAt(0,0,s[e])),Fn(n,i*bn,e>2?bn:0,bn,bn),a.setRenderTarget(n),d&&a.render(p,r),a.render(t,r)}p.geometry.dispose(),p.material.dispose(),a.toneMapping=u,a.outputEncoding=c,a.autoClear=l,t.background=f}_textureToCubeUV(t,e){const i=this._renderer;t.isCubeTexture?null==this._cubemapShader&&(this._cubemapShader=Un()):null==this._equirectShader&&(this._equirectShader=Vn());const n=t.isCubeTexture?this._cubemapShader:this._equirectShader,r=new Vi(Tn[0],n),o=n.uniforms;o.envMap.value=t,t.isCubeTexture||o.texelSize.value.set(1/t.image.width,1/t.image.height),o.inputEncoding.value=Sn[t.encoding],o.outputEncoding.value=Sn[e.texture.encoding],Fn(e,0,0,3*bn,2*bn),i.setRenderTarget(e),i.render(r,Mn)}_applyPMREM(t){const e=this._renderer,i=e.autoClear;e.autoClear=!1;for(let e=1;e<An;e++){const i=Math.sqrt(Cn[e]*Cn[e]-Cn[e-1]*Cn[e-1]),n=On[(e-1)%On.length];this._blur(t,e-1,e,i,n)}e.autoClear=i}_blur(t,e,i,n,r){const o=this._pingPongRenderTarget;this._halfBlur(t,o,e,i,n,"latitudinal",r),this._halfBlur(o,t,i,i,n,"longitudinal",r)}_halfBlur(t,e,i,n,r,o,s){const a=this._renderer,l=this._blurMaterial;"latitudinal"!==o&&"longitudinal"!==o&&console.error("blur direction must be either latitudinal or longitudinal!");const c=new Vi(Tn[n],l),u=l.uniforms,h=In[i]-1,p=isFinite(r)?Math.PI/(2*h):2*Math.PI/39,d=r/p,f=isFinite(r)?1+Math.floor(3*d):En;f>En&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);const m=[];let g=0;for(let t=0;t<En;++t){const e=t/d,i=Math.exp(-e*e/2);m.push(i),0==t?g+=i:t<f&&(g+=2*i)}for(let t=0;t<m.length;t++)m[t]=m[t]/g;u.envMap.value=t.texture,u.samples.value=f,u.weights.value=m,u.latitudinal.value="latitudinal"===o,s&&(u.poleAxis.value=s),u.dTheta.value=p,u.mipInt.value=8-i,u.inputEncoding.value=Sn[t.texture.encoding],u.outputEncoding.value=Sn[t.texture.encoding];const y=In[n];Fn(e,3*Math.max(0,bn-2*y),(0===n?0:2*bn)+2*y*(n>4?n-8+4:0),3*y,2*y),a.setRenderTarget(e),a.render(c,Mn)}}function Nn(t){return void 0!==t&&t.type===_&&(t.encoding===X||t.encoding===Z||t.encoding===Y)}function Bn(){const t=[],e=[],i=[];let n=8;for(let r=0;r<An;r++){const o=Math.pow(2,n);e.push(o);let s=1/o;r>4?s=wn[r-8+4-1]:0==r&&(s=0),i.push(s);const a=1/(o-1),l=-a/2,c=1+a/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=6,p=6,d=3,f=2,m=1,g=new Float32Array(d*p*h),y=new Float32Array(f*p*h),v=new Float32Array(m*p*h);for(let t=0;t<h;t++){const e=t%3*2/3-1,i=t>2?0:-1,n=[e,i,0,e+2/3,i,0,e+2/3,i+1,0,e,i,0,e+2/3,i+1,0,e,i+1,0];g.set(n,d*p*t),y.set(u,f*p*t);const r=[t,t,t,t,t,t];v.set(r,m*p*t)}const _=new wi;_.setAttribute("position",new ei(g,d)),_.setAttribute("uv",new ei(y,f)),_.setAttribute("faceIndex",new ei(v,m)),t.push(_),n>4&&n--}return{_lodPlanes:t,_sizeLods:e,_sigmas:i}}function zn(t){const e=new St(3*bn,3*bn,t);return e.texture.mapping=l,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Fn(t,e,i,n,r){t.viewport.set(e,i,n,r),t.scissor.set(e,i,n,r)}function Vn(){const t=new yt(1,1);return new xn({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:t},inputEncoding:{value:Sn[3e3]},outputEncoding:{value:Sn[3e3]}},vertexShader:Gn(),fragmentShader:`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform vec2 texelSize;\n\n\t\t\t${jn()}\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tvec2 f = fract( uv / texelSize - 0.5 );\n\t\t\t\tuv -= f * texelSize;\n\t\t\t\tvec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x += texelSize.x;\n\t\t\t\tvec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.y += texelSize.y;\n\t\t\t\tvec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x -= texelSize.x;\n\t\t\t\tvec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\n\t\t\t\tvec3 tm = mix( tl, tr, f.x );\n\t\t\t\tvec3 bm = mix( bl, br, f.x );\n\t\t\t\tgl_FragColor.rgb = mix( tm, bm, f.y );\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t`,blending:0,depthTest:!1,depthWrite:!1})}function Un(){return new xn({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:Sn[3e3]},outputEncoding:{value:Sn[3e3]}},vertexShader:Gn(),fragmentShader:`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\t${jn()}\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb;\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t`,blending:0,depthTest:!1,depthWrite:!1})}function Gn(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function jn(){return"\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include <encodings_pars_fragment>\n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t"}function Hn(t){let e=new WeakMap,i=null;function n(t){const i=t.target;i.removeEventListener("dispose",n);const r=e.get(i);void 0!==r&&(e.delete(i),r.dispose())}return{get:function(l){if(l&&l.isTexture&&!1===l.isRenderTargetTexture){const c=l.mapping,u=c===s||c===a,h=c===r||c===o;if(u||h){if(e.has(l))return e.get(l).texture;{const r=l.image;if(u&&r&&r.height>0||h&&r&&function(t){let e=0;const i=6;for(let n=0;n<i;n++)void 0!==t[n]&&e++;return e===i}(r)){const r=t.getRenderTarget();null===i&&(i=new kn(t));const o=u?i.fromEquirectangular(l):i.fromCubemap(l);return e.set(l,o),t.setRenderTarget(r),l.addEventListener("dispose",n),o.texture}return null}}}return l},dispose:function(){e=new WeakMap,null!==i&&(i.dispose(),i=null)}}}function Wn(t){const e={};function i(i){if(void 0!==e[i])return e[i];let n;switch(i){case"WEBGL_depth_texture":n=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=t.getExtension(i)}return e[i]=n,n}return{has:function(t){return null!==i(t)},init:function(t){t.isWebGL2?i("EXT_color_buffer_float"):(i("WEBGL_depth_texture"),i("OES_texture_float"),i("OES_texture_half_float"),i("OES_texture_half_float_linear"),i("OES_standard_derivatives"),i("OES_element_index_uint"),i("OES_vertex_array_object"),i("ANGLE_instanced_arrays")),i("OES_texture_float_linear"),i("EXT_color_buffer_half_float")},get:function(t){const e=i(t);return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function qn(t,e,i,n){const r={},o=new WeakMap;function s(t){const a=t.target;null!==a.index&&e.remove(a.index);for(const t in a.attributes)e.remove(a.attributes[t]);a.removeEventListener("dispose",s),delete r[a.id];const l=o.get(a);l&&(e.remove(l),o.delete(a)),n.releaseStatesOfGeometry(a),!0===a.isInstancedBufferGeometry&&delete a._maxInstanceCount,i.memory.geometries--}function a(t){const i=[],n=t.index,r=t.attributes.position;let s=0;if(null!==n){const t=n.array;s=n.version;for(let e=0,n=t.length;e<n;e+=3){const n=t[e+0],r=t[e+1],o=t[e+2];i.push(n,r,r,o,o,n)}}else{const t=r.array;s=r.version;for(let e=0,n=t.length/3-1;e<n;e+=3){const t=e+0,n=e+1,r=e+2;i.push(t,n,n,r,r,t)}}const a=new(pi(i)>65535?li:si)(i,1);a.version=s;const l=o.get(t);l&&e.remove(l),o.set(t,a)}return{get:function(t,e){return!0===r[e.id]||(e.addEventListener("dispose",s),r[e.id]=!0,i.memory.geometries++),e},update:function(t){const i=t.attributes;for(const t in i)e.update(i[t],34962);const n=t.morphAttributes;for(const t in n){const i=n[t];for(let t=0,n=i.length;t<n;t++)e.update(i[t],34962)}},getWireframeAttribute:function(t){const e=o.get(t);if(e){const i=t.index;null!==i&&e.version<i.version&&a(t)}else a(t);return o.get(t)}}}function Xn(t,e,i,n){const r=n.isWebGL2;let o,s,a;this.setMode=function(t){o=t},this.setIndex=function(t){s=t.type,a=t.bytesPerElement},this.render=function(e,n){t.drawElements(o,n,s,e*a),i.update(n,o,1)},this.renderInstances=function(n,l,c){if(0===c)return;let u,h;if(r)u=t,h="drawElementsInstanced";else if(u=e.get("ANGLE_instanced_arrays"),h="drawElementsInstancedANGLE",null===u)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[h](o,l,s,n*a,c),i.update(l,o,c)}}function Zn(t){const e={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:function(){e.frame++,e.calls=0,e.triangles=0,e.points=0,e.lines=0},update:function(t,i,n){switch(e.calls++,i){case 4:e.triangles+=n*(t/3);break;case 1:e.lines+=n*(t/2);break;case 3:e.lines+=n*(t-1);break;case 2:e.lines+=n*t;break;case 0:e.points+=n*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",i)}}}}function Yn(t,e){return t[0]-e[0]}function Qn(t,e){return Math.abs(e[1])-Math.abs(t[1])}function Jn(t){const e={},i=new Float32Array(8),n=[];for(let t=0;t<8;t++)n[t]=[t,0];return{update:function(r,o,s,a){const l=r.morphTargetInfluences,c=void 0===l?0:l.length;let u=e[o.id];if(void 0===u||u.length!==c){u=[];for(let t=0;t<c;t++)u[t]=[t,0];e[o.id]=u}for(let t=0;t<c;t++){const e=u[t];e[0]=t,e[1]=l[t]}u.sort(Qn);for(let t=0;t<8;t++)t<c&&u[t][1]?(n[t][0]=u[t][0],n[t][1]=u[t][1]):(n[t][0]=Number.MAX_SAFE_INTEGER,n[t][1]=0);n.sort(Yn);const h=o.morphAttributes.position,p=o.morphAttributes.normal;let d=0;for(let t=0;t<8;t++){const e=n[t],r=e[0],s=e[1];r!==Number.MAX_SAFE_INTEGER&&s?(h&&o.getAttribute("morphTarget"+t)!==h[r]&&o.setAttribute("morphTarget"+t,h[r]),p&&o.getAttribute("morphNormal"+t)!==p[r]&&o.setAttribute("morphNormal"+t,p[r]),i[t]=s,d+=s):(h&&!0===o.hasAttribute("morphTarget"+t)&&o.deleteAttribute("morphTarget"+t),p&&!0===o.hasAttribute("morphNormal"+t)&&o.deleteAttribute("morphNormal"+t),i[t]=0)}const f=o.morphTargetsRelative?1:1-d;a.getUniforms().setValue(t,"morphTargetBaseInfluence",f),a.getUniforms().setValue(t,"morphTargetInfluences",i)}}}function Kn(t,e,i,n){let r=new WeakMap;function o(t){const e=t.target;e.removeEventListener("dispose",o),i.remove(e.instanceMatrix),null!==e.instanceColor&&i.remove(e.instanceColor)}return{update:function(t){const s=n.render.frame,a=t.geometry,l=e.get(t,a);return r.get(l)!==s&&(e.update(l),r.set(l,s)),t.isInstancedMesh&&(!1===t.hasEventListener("dispose",o)&&t.addEventListener("dispose",o),i.update(t.instanceMatrix,34962),null!==t.instanceColor&&i.update(t.instanceColor,34962)),l},dispose:function(){r=new WeakMap}}}class $n extends wt{constructor(t=null,e=1,i=1,n=1){super(null),this.image={data:t,width:e,height:i,depth:n},this.magFilter=d,this.minFilter=d,this.wrapR=h,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}$n.prototype.isDataTexture2DArray=!0;class tr extends wt{constructor(t=null,e=1,i=1,n=1){super(null),this.image={data:t,width:e,height:i,depth:n},this.magFilter=d,this.minFilter=d,this.wrapR=h,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}tr.prototype.isDataTexture3D=!0;const er=new wt,ir=new $n,nr=new tr,rr=new Ji,or=[],sr=[],ar=new Float32Array(16),lr=new Float32Array(9),cr=new Float32Array(4);function ur(t,e,i){const n=t[0];if(n<=0||n>0)return t;const r=e*i;let o=or[r];if(void 0===o&&(o=new Float32Array(r),or[r]=o),0!==e){n.toArray(o,0);for(let n=1,r=0;n!==e;++n)r+=i,t[n].toArray(o,r)}return o}function hr(t,e){if(t.length!==e.length)return!1;for(let i=0,n=t.length;i<n;i++)if(t[i]!==e[i])return!1;return!0}function pr(t,e){for(let i=0,n=e.length;i<n;i++)t[i]=e[i]}function dr(t,e){let i=sr[e];void 0===i&&(i=new Int32Array(e),sr[e]=i);for(let n=0;n!==e;++n)i[n]=t.allocateTextureUnit();return i}function fr(t,e){const i=this.cache;i[0]!==e&&(t.uniform1f(this.addr,e),i[0]=e)}function mr(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),i[0]=e.x,i[1]=e.y);else{if(hr(i,e))return;t.uniform2fv(this.addr,e),pr(i,e)}}function gr(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y&&i[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),i[0]=e.x,i[1]=e.y,i[2]=e.z);else if(void 0!==e.r)i[0]===e.r&&i[1]===e.g&&i[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),i[0]=e.r,i[1]=e.g,i[2]=e.b);else{if(hr(i,e))return;t.uniform3fv(this.addr,e),pr(i,e)}}function yr(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y&&i[2]===e.z&&i[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),i[0]=e.x,i[1]=e.y,i[2]=e.z,i[3]=e.w);else{if(hr(i,e))return;t.uniform4fv(this.addr,e),pr(i,e)}}function vr(t,e){const i=this.cache,n=e.elements;if(void 0===n){if(hr(i,e))return;t.uniformMatrix2fv(this.addr,!1,e),pr(i,e)}else{if(hr(i,n))return;cr.set(n),t.uniformMatrix2fv(this.addr,!1,cr),pr(i,n)}}function _r(t,e){const i=this.cache,n=e.elements;if(void 0===n){if(hr(i,e))return;t.uniformMatrix3fv(this.addr,!1,e),pr(i,e)}else{if(hr(i,n))return;lr.set(n),t.uniformMatrix3fv(this.addr,!1,lr),pr(i,n)}}function xr(t,e){const i=this.cache,n=e.elements;if(void 0===n){if(hr(i,e))return;t.uniformMatrix4fv(this.addr,!1,e),pr(i,e)}else{if(hr(i,n))return;ar.set(n),t.uniformMatrix4fv(this.addr,!1,ar),pr(i,n)}}function br(t,e){const i=this.cache;i[0]!==e&&(t.uniform1i(this.addr,e),i[0]=e)}function wr(t,e){const i=this.cache;hr(i,e)||(t.uniform2iv(this.addr,e),pr(i,e))}function Ar(t,e){const i=this.cache;hr(i,e)||(t.uniform3iv(this.addr,e),pr(i,e))}function Er(t,e){const i=this.cache;hr(i,e)||(t.uniform4iv(this.addr,e),pr(i,e))}function Sr(t,e){const i=this.cache;i[0]!==e&&(t.uniform1ui(this.addr,e),i[0]=e)}function Mr(t,e){const i=this.cache;hr(i,e)||(t.uniform2uiv(this.addr,e),pr(i,e))}function Tr(t,e){const i=this.cache;hr(i,e)||(t.uniform3uiv(this.addr,e),pr(i,e))}function Ir(t,e){const i=this.cache;hr(i,e)||(t.uniform4uiv(this.addr,e),pr(i,e))}function Cr(t,e,i){const n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.safeSetTexture2D(e||er,r)}function Pr(t,e,i){const n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.setTexture3D(e||nr,r)}function Lr(t,e,i){const n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.safeSetTextureCube(e||rr,r)}function Dr(t,e,i){const n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.setTexture2DArray(e||ir,r)}function Rr(t,e){t.uniform1fv(this.addr,e)}function Or(t,e){const i=ur(e,this.size,2);t.uniform2fv(this.addr,i)}function kr(t,e){const i=ur(e,this.size,3);t.uniform3fv(this.addr,i)}function Nr(t,e){const i=ur(e,this.size,4);t.uniform4fv(this.addr,i)}function Br(t,e){const i=ur(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,i)}function zr(t,e){const i=ur(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,i)}function Fr(t,e){const i=ur(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,i)}function Vr(t,e){t.uniform1iv(this.addr,e)}function Ur(t,e){t.uniform2iv(this.addr,e)}function Gr(t,e){t.uniform3iv(this.addr,e)}function jr(t,e){t.uniform4iv(this.addr,e)}function Hr(t,e){t.uniform1uiv(this.addr,e)}function Wr(t,e){t.uniform2uiv(this.addr,e)}function qr(t,e){t.uniform3uiv(this.addr,e)}function Xr(t,e){t.uniform4uiv(this.addr,e)}function Zr(t,e,i){const n=e.length,r=dr(i,n);t.uniform1iv(this.addr,r);for(let t=0;t!==n;++t)i.safeSetTexture2D(e[t]||er,r[t])}function Yr(t,e,i){const n=e.length,r=dr(i,n);t.uniform1iv(this.addr,r);for(let t=0;t!==n;++t)i.safeSetTextureCube(e[t]||rr,r[t])}function Qr(t,e,i){this.id=t,this.addr=i,this.cache=[],this.setValue=function(t){switch(t){case 5126:return fr;case 35664:return mr;case 35665:return gr;case 35666:return yr;case 35674:return vr;case 35675:return _r;case 35676:return xr;case 5124:case 35670:return br;case 35667:case 35671:return wr;case 35668:case 35672:return Ar;case 35669:case 35673:return Er;case 5125:return Sr;case 36294:return Mr;case 36295:return Tr;case 36296:return Ir;case 35678:case 36198:case 36298:case 36306:case 35682:return Cr;case 35679:case 36299:case 36307:return Pr;case 35680:case 36300:case 36308:case 36293:return Lr;case 36289:case 36303:case 36311:case 36292:return Dr}}(e.type)}function Jr(t,e,i){this.id=t,this.addr=i,this.cache=[],this.size=e.size,this.setValue=function(t){switch(t){case 5126:return Rr;case 35664:return Or;case 35665:return kr;case 35666:return Nr;case 35674:return Br;case 35675:return zr;case 35676:return Fr;case 5124:case 35670:return Vr;case 35667:case 35671:return Ur;case 35668:case 35672:return Gr;case 35669:case 35673:return jr;case 5125:return Hr;case 36294:return Wr;case 36295:return qr;case 36296:return Xr;case 35678:case 36198:case 36298:case 36306:case 35682:return Zr;case 35680:case 36300:case 36308:case 36293:return Yr}}(e.type)}function Kr(t){this.id=t,this.seq=[],this.map={}}Jr.prototype.updateCache=function(t){const e=this.cache;t instanceof Float32Array&&e.length!==t.length&&(this.cache=new Float32Array(t.length)),pr(e,t)},Kr.prototype.setValue=function(t,e,i){const n=this.seq;for(let r=0,o=n.length;r!==o;++r){const o=n[r];o.setValue(t,e[o.id],i)}};const $r=/(\w+)(\])?(\[|\.)?/g;function to(t,e){t.seq.push(e),t.map[e.id]=e}function eo(t,e,i){const n=t.name,r=n.length;for($r.lastIndex=0;;){const o=$r.exec(n),s=$r.lastIndex;let a=o[1];const l="]"===o[2],c=o[3];if(l&&(a|=0),void 0===c||"["===c&&s+2===r){to(i,void 0===c?new Qr(a,t,e):new Jr(a,t,e));break}{let t=i.map[a];void 0===t&&(t=new Kr(a),to(i,t)),i=t}}}function io(t,e){this.seq=[],this.map={};const i=t.getProgramParameter(e,35718);for(let n=0;n<i;++n){const i=t.getActiveUniform(e,n);eo(i,t.getUniformLocation(e,i.name),this)}}function no(t,e,i){const n=t.createShader(e);return t.shaderSource(n,i),t.compileShader(n),n}io.prototype.setValue=function(t,e,i,n){const r=this.map[e];void 0!==r&&r.setValue(t,i,n)},io.prototype.setOptional=function(t,e,i){const n=e[i];void 0!==n&&this.setValue(t,i,n)},io.upload=function(t,e,i,n){for(let r=0,o=e.length;r!==o;++r){const o=e[r],s=i[o.id];!1!==s.needsUpdate&&o.setValue(t,s.value,n)}},io.seqWithValue=function(t,e){const i=[];for(let n=0,r=t.length;n!==r;++n){const r=t[n];r.id in e&&i.push(r)}return i};let ro=0;function oo(t){switch(t){case X:return["Linear","( value )"];case Z:return["sRGB","( value )"];case Q:return["RGBE","( value )"];case J:return["RGBM","( value, 7.0 )"];case K:return["RGBM","( value, 16.0 )"];case $:return["RGBD","( value, 256.0 )"];case Y:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case 3003:return["LogLuv","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",t),["Linear","( value )"]}}function so(t,e,i){const n=t.getShaderParameter(e,35713),r=t.getShaderInfoLog(e).trim();return n&&""===r?"":i.toUpperCase()+"\n\n"+r+"\n\n"+function(t){const e=t.split("\n");for(let t=0;t<e.length;t++)e[t]=t+1+": "+e[t];return e.join("\n")}(t.getShaderSource(e))}function ao(t,e){const i=oo(e);return"vec4 "+t+"( vec4 value ) { return "+i[0]+"ToLinear"+i[1]+"; }"}function lo(t,e){const i=oo(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+i[0]+i[1]+"; }"}function co(t,e){let i;switch(e){case 1:i="Linear";break;case 2:i="Reinhard";break;case 3:i="OptimizedCineon";break;case 4:i="ACESFilmic";break;case 5:i="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),i="Linear"}return"vec3 "+t+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function uo(t){return""!==t}function ho(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function po(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const fo=/^[ \t]*#include +<([\w\d./]+)>/gm;function mo(t){return t.replace(fo,go)}function go(t,e){const i=un[e];if(void 0===i)throw new Error("Can not resolve #include <"+e+">");return mo(i)}const yo=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,vo=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function _o(t){return t.replace(vo,bo).replace(yo,xo)}function xo(t,e,i,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),bo(t,e,i,n)}function bo(t,e,i,n){let r="";for(let t=parseInt(e);t<parseInt(i);t++)r+=n.replace(/\[\s*i\s*\]/g,"[ "+t+" ]").replace(/UNROLLED_LOOP_INDEX/g,t);return r}function wo(t){let e="precision "+t.precision+" float;\nprecision "+t.precision+" int;";return"highp"===t.precision?e+="\n#define HIGH_PRECISION":"mediump"===t.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(e+="\n#define LOW_PRECISION"),e}function Ao(t,e,i,n){const s=t.getContext(),a=i.defines;let u=i.vertexShader,h=i.fragmentShader;const p=function(t){let e="SHADOWMAP_TYPE_BASIC";return 1===t.shadowMapType?e="SHADOWMAP_TYPE_PCF":2===t.shadowMapType?e="SHADOWMAP_TYPE_PCF_SOFT":3===t.shadowMapType&&(e="SHADOWMAP_TYPE_VSM"),e}(i),d=function(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case r:case o:e="ENVMAP_TYPE_CUBE";break;case l:case c:e="ENVMAP_TYPE_CUBE_UV"}return e}(i),f=function(t){let e="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case o:case c:e="ENVMAP_MODE_REFRACTION"}return e}(i),m=function(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case 0:e="ENVMAP_BLENDING_MULTIPLY";break;case 1:e="ENVMAP_BLENDING_MIX";break;case 2:e="ENVMAP_BLENDING_ADD"}return e}(i),g=t.gammaFactor>0?t.gammaFactor:1,y=i.isWebGL2?"":function(t){return[t.extensionDerivatives||t.envMapCubeUV||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap||t.transmission)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(uo).join("\n")}(i),v=function(t){const e=[];for(const i in t){const n=t[i];!1!==n&&e.push("#define "+i+" "+n)}return e.join("\n")}(a),_=s.createProgram();let x,b,w=i.glslVersion?"#version "+i.glslVersion+"\n":"";i.isRawShaderMaterial?(x=[v].filter(uo).join("\n"),x.length>0&&(x+="\n"),b=[y,v].filter(uo).join("\n"),b.length>0&&(b+="\n")):(x=[wo(i),"#define SHADER_NAME "+i.shaderName,v,i.instancing?"#define USE_INSTANCING":"",i.instancingColor?"#define USE_INSTANCING_COLOR":"",i.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+g,"#define MAX_BONES "+i.maxBones,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+f:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.displacementMap&&i.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",i.specularTintMap?"#define USE_SPECULARTINTMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.useVertexTexture?"#define BONE_TEXTURE":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&!1===i.flatShading?"#define USE_MORPHNORMALS":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+p:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(uo).join("\n"),b=[y,wo(i),"#define SHADER_NAME "+i.shaderName,v,"#define GAMMA_FACTOR "+g,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.matcap?"#define USE_MATCAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+d:"",i.envMap?"#define "+f:"",i.envMap?"#define "+m:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoat?"#define USE_CLEARCOAT":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",i.specularTintMap?"#define USE_SPECULARTINTMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaTest?"#define USE_ALPHATEST":"",i.sheenTint?"#define USE_SHEEN":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors||i.instancingColor?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+p:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(i.extensionShaderTextureLOD||i.envMap)&&i.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==i.toneMapping?"#define TONE_MAPPING":"",0!==i.toneMapping?un.tonemapping_pars_fragment:"",0!==i.toneMapping?co("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",i.format===S?"#define OPAQUE":"",un.encodings_pars_fragment,i.map?ao("mapTexelToLinear",i.mapEncoding):"",i.matcap?ao("matcapTexelToLinear",i.matcapEncoding):"",i.envMap?ao("envMapTexelToLinear",i.envMapEncoding):"",i.emissiveMap?ao("emissiveMapTexelToLinear",i.emissiveMapEncoding):"",i.specularTintMap?ao("specularTintMapTexelToLinear",i.specularTintMapEncoding):"",i.lightMap?ao("lightMapTexelToLinear",i.lightMapEncoding):"",lo("linearToOutputTexel",i.outputEncoding),i.depthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(uo).join("\n")),u=mo(u),u=ho(u,i),u=po(u,i),h=mo(h),h=ho(h,i),h=po(h,i),u=_o(u),h=_o(h),i.isWebGL2&&!0!==i.isRawShaderMaterial&&(w="#version 300 es\n",x=["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+x,b=["#define varying in",i.glslVersion===nt?"":"out highp vec4 pc_fragColor;",i.glslVersion===nt?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+b);const A=w+b+h,E=no(s,35633,w+x+u),M=no(s,35632,A);if(s.attachShader(_,E),s.attachShader(_,M),void 0!==i.index0AttributeName?s.bindAttribLocation(_,0,i.index0AttributeName):!0===i.morphTargets&&s.bindAttribLocation(_,0,"position"),s.linkProgram(_),t.debug.checkShaderErrors){const t=s.getProgramInfoLog(_).trim(),e=s.getShaderInfoLog(E).trim(),i=s.getShaderInfoLog(M).trim();let n=!0,r=!0;if(!1===s.getProgramParameter(_,35714)){n=!1;const e=so(s,E,"vertex"),i=so(s,M,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(_,35715)+"\n\nProgram Info Log: "+t+"\n"+e+"\n"+i)}else""!==t?console.warn("THREE.WebGLProgram: Program Info Log:",t):""!==e&&""!==i||(r=!1);r&&(this.diagnostics={runnable:n,programLog:t,vertexShader:{log:e,prefix:x},fragmentShader:{log:i,prefix:b}})}let T,I;return s.deleteShader(E),s.deleteShader(M),this.getUniforms=function(){return void 0===T&&(T=new io(s,_)),T},this.getAttributes=function(){return void 0===I&&(I=function(t,e){const i={},n=t.getProgramParameter(e,35721);for(let r=0;r<n;r++){const n=t.getActiveAttrib(e,r),o=n.name;let s=1;35674===n.type&&(s=2),35675===n.type&&(s=3),35676===n.type&&(s=4),i[o]={type:n.type,location:t.getAttribLocation(e,o),locationSize:s}}return i}(s,_)),I},this.destroy=function(){n.releaseStatesOfProgram(this),s.deleteProgram(_),this.program=void 0},this.name=i.shaderName,this.id=ro++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=E,this.fragmentShader=M,this}function Eo(t,e,i,n,r,o,s){const a=[],u=r.isWebGL2,h=r.logarithmicDepthBuffer,p=r.floatVertexTextures,d=r.maxVertexUniforms,f=r.vertexTextures;let m=r.precision;const g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},y=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoat","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","specularIntensityMap","specularTintMap","specularTintMapEncoding","roughnessMap","metalnessMap","gradientMap","alphaMap","alphaTest","combine","vertexColors","vertexAlphas","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","format","sheenTint","transmission","transmissionMap","thicknessMap"];function v(t){let e;return t&&t.isTexture?e=t.encoding:t&&t.isWebGLRenderTarget?(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),e=t.texture.encoding):e=X,e}return{getParameters:function(o,a,y,_,x){const b=_.fog,w=o.isMeshStandardMaterial?_.environment:null,A=(o.isMeshStandardMaterial?i:e).get(o.envMap||w),E=g[o.type],S=x.isSkinnedMesh?function(t){const e=t.skeleton.bones;if(p)return 1024;{const t=d,i=Math.floor((t-20)/4),n=Math.min(i,e.length);return n<e.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+e.length+" bones. This GPU supports "+n+"."),0):n}}(x):0;let M,T;if(null!==o.precision&&(m=r.getMaxPrecision(o.precision),m!==o.precision&&console.warn("THREE.WebGLProgram.getParameters:",o.precision,"not supported, using",m,"instead.")),E){const t=pn[E];M=t.vertexShader,T=t.fragmentShader}else M=o.vertexShader,T=o.fragmentShader;const I=t.getRenderTarget(),C=o.alphaTest>0,P=o.clearcoat>0;return{isWebGL2:u,shaderID:E,shaderName:o.type,vertexShader:M,fragmentShader:T,defines:o.defines,isRawShaderMaterial:!0===o.isRawShaderMaterial,glslVersion:o.glslVersion,precision:m,instancing:!0===x.isInstancedMesh,instancingColor:!0===x.isInstancedMesh&&null!==x.instanceColor,supportsVertexTextures:f,outputEncoding:null!==I?v(I.texture):t.outputEncoding,map:!!o.map,mapEncoding:v(o.map),matcap:!!o.matcap,matcapEncoding:v(o.matcap),envMap:!!A,envMapMode:A&&A.mapping,envMapEncoding:v(A),envMapCubeUV:!!A&&(A.mapping===l||A.mapping===c),lightMap:!!o.lightMap,lightMapEncoding:v(o.lightMap),aoMap:!!o.aoMap,emissiveMap:!!o.emissiveMap,emissiveMapEncoding:v(o.emissiveMap),bumpMap:!!o.bumpMap,normalMap:!!o.normalMap,objectSpaceNormalMap:1===o.normalMapType,tangentSpaceNormalMap:0===o.normalMapType,clearcoat:P,clearcoatMap:P&&!!o.clearcoatMap,clearcoatRoughnessMap:P&&!!o.clearcoatRoughnessMap,clearcoatNormalMap:P&&!!o.clearcoatNormalMap,displacementMap:!!o.displacementMap,roughnessMap:!!o.roughnessMap,metalnessMap:!!o.metalnessMap,specularMap:!!o.specularMap,specularIntensityMap:!!o.specularIntensityMap,specularTintMap:!!o.specularTintMap,specularTintMapEncoding:v(o.specularTintMap),alphaMap:!!o.alphaMap,alphaTest:C,gradientMap:!!o.gradientMap,sheenTint:!!o.sheenTint&&(o.sheenTint.r>0||o.sheenTint.g>0||o.sheenTint.b>0),transmission:o.transmission>0,transmissionMap:!!o.transmissionMap,thicknessMap:!!o.thicknessMap,combine:o.combine,vertexTangents:!!o.normalMap&&!!x.geometry&&!!x.geometry.attributes.tangent,vertexColors:o.vertexColors,vertexAlphas:!0===o.vertexColors&&!!x.geometry&&!!x.geometry.attributes.color&&4===x.geometry.attributes.color.itemSize,vertexUvs:!!(o.map||o.bumpMap||o.normalMap||o.specularMap||o.alphaMap||o.emissiveMap||o.roughnessMap||o.metalnessMap||o.clearcoatMap||o.clearcoatRoughnessMap||o.clearcoatNormalMap||o.displacementMap||o.transmissionMap||o.thicknessMap||o.specularIntensityMap||o.specularTintMap),uvsVertexOnly:!(o.map||o.bumpMap||o.normalMap||o.specularMap||o.alphaMap||o.emissiveMap||o.roughnessMap||o.metalnessMap||o.clearcoatNormalMap||o.transmission>0||o.transmissionMap||o.thicknessMap||o.specularIntensityMap||o.specularTintMap||!o.displacementMap),fog:!!b,useFog:o.fog,fogExp2:b&&b.isFogExp2,flatShading:!!o.flatShading,sizeAttenuation:o.sizeAttenuation,logarithmicDepthBuffer:h,skinning:!0===x.isSkinnedMesh&&S>0,maxBones:S,useVertexTexture:p,morphTargets:!!x.geometry&&!!x.geometry.morphAttributes.position,morphNormals:!!x.geometry&&!!x.geometry.morphAttributes.normal,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,format:o.format,dithering:o.dithering,shadowMapEnabled:t.shadowMap.enabled&&y.length>0,shadowMapType:t.shadowMap.type,toneMapping:o.toneMapped?t.toneMapping:0,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:o.premultipliedAlpha,doubleSided:2===o.side,flipSided:1===o.side,depthPacking:void 0!==o.depthPacking&&o.depthPacking,index0AttributeName:o.index0AttributeName,extensionDerivatives:o.extensions&&o.extensions.derivatives,extensionFragDepth:o.extensions&&o.extensions.fragDepth,extensionDrawBuffers:o.extensions&&o.extensions.drawBuffers,extensionShaderTextureLOD:o.extensions&&o.extensions.shaderTextureLOD,rendererExtensionFragDepth:u||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||n.has("EXT_shader_texture_lod"),customProgramCacheKey:o.customProgramCacheKey()}},getProgramCacheKey:function(e){const i=[];if(e.shaderID?i.push(e.shaderID):(i.push(e.fragmentShader),i.push(e.vertexShader)),void 0!==e.defines)for(const t in e.defines)i.push(t),i.push(e.defines[t]);if(!1===e.isRawShaderMaterial){for(let t=0;t<y.length;t++)i.push(e[y[t]]);i.push(t.outputEncoding),i.push(t.gammaFactor)}return i.push(e.customProgramCacheKey),i.join()},getUniforms:function(t){const e=g[t.type];let i;if(e){const t=pn[e];i=Wi.clone(t.uniforms)}else i=t.uniforms;return i},acquireProgram:function(e,i){let n;for(let t=0,e=a.length;t<e;t++){const e=a[t];if(e.cacheKey===i){n=e,++n.usedTimes;break}}return void 0===n&&(n=new Ao(t,i,e,o),a.push(n)),n},releaseProgram:function(t){if(0==--t.usedTimes){const e=a.indexOf(t);a[e]=a[a.length-1],a.pop(),t.destroy()}},programs:a}}function So(){let t=new WeakMap;return{get:function(e){let i=t.get(e);return void 0===i&&(i={},t.set(e,i)),i},remove:function(e){t.delete(e)},update:function(e,i,n){t.get(e)[i]=n},dispose:function(){t=new WeakMap}}}function Mo(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program!==e.program?t.program.id-e.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function To(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function Io(t){const e=[];let i=0;const n=[],r=[],o=[],s={id:-1};function a(n,r,o,a,l,c){let u=e[i];const h=t.get(o);return void 0===u?(u={id:n.id,object:n,geometry:r,material:o,program:h.program||s,groupOrder:a,renderOrder:n.renderOrder,z:l,group:c},e[i]=u):(u.id=n.id,u.object=n,u.geometry=r,u.material=o,u.program=h.program||s,u.groupOrder=a,u.renderOrder=n.renderOrder,u.z=l,u.group=c),i++,u}return{opaque:n,transmissive:r,transparent:o,init:function(){i=0,n.length=0,r.length=0,o.length=0},push:function(t,e,i,s,l,c){const u=a(t,e,i,s,l,c);i.transmission>0?r.push(u):!0===i.transparent?o.push(u):n.push(u)},unshift:function(t,e,i,s,l,c){const u=a(t,e,i,s,l,c);i.transmission>0?r.unshift(u):!0===i.transparent?o.unshift(u):n.unshift(u)},finish:function(){for(let t=i,n=e.length;t<n;t++){const i=e[t];if(null===i.id)break;i.id=null,i.object=null,i.geometry=null,i.material=null,i.program=null,i.group=null}},sort:function(t,e){n.length>1&&n.sort(t||Mo),r.length>1&&r.sort(e||To),o.length>1&&o.sort(e||To)}}}function Co(t){let e=new WeakMap;return{get:function(i,n){let r;return!1===e.has(i)?(r=new Io(t),e.set(i,[r])):n>=e.get(i).length?(r=new Io(t),e.get(i).push(r)):r=e.get(i)[n],r},dispose:function(){e=new WeakMap}}}function Po(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let i;switch(e.type){case"DirectionalLight":i={direction:new Ct,color:new Je};break;case"SpotLight":i={position:new Ct,direction:new Ct,color:new Je,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new Ct,color:new Je,distance:0,decay:0};break;case"HemisphereLight":i={direction:new Ct,skyColor:new Je,groundColor:new Je};break;case"RectAreaLight":i={color:new Je,position:new Ct,halfWidth:new Ct,halfHeight:new Ct}}return t[e.id]=i,i}}}let Lo=0;function Do(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function Ro(t,e){const i=new Po,n=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let i;switch(e.type){case"DirectionalLight":case"SpotLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new yt};break;case"PointLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new yt,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=i,i}}}(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let t=0;t<9;t++)r.probe.push(new Ct);const o=new Ct,s=new se,a=new se;return{setup:function(o,s){let a=0,l=0,c=0;for(let t=0;t<9;t++)r.probe[t].set(0,0,0);let u=0,h=0,p=0,d=0,f=0,m=0,g=0,y=0;o.sort(Do);const v=!0!==s?Math.PI:1;for(let t=0,e=o.length;t<e;t++){const e=o[t],s=e.color,_=e.intensity,x=e.distance,b=e.shadow&&e.shadow.map?e.shadow.map.texture:null;if(e.isAmbientLight)a+=s.r*_*v,l+=s.g*_*v,c+=s.b*_*v;else if(e.isLightProbe)for(let t=0;t<9;t++)r.probe[t].addScaledVector(e.sh.coefficients[t],_);else if(e.isDirectionalLight){const t=i.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity*v),e.castShadow){const t=e.shadow,i=n.get(e);i.shadowBias=t.bias,i.shadowNormalBias=t.normalBias,i.shadowRadius=t.radius,i.shadowMapSize=t.mapSize,r.directionalShadow[u]=i,r.directionalShadowMap[u]=b,r.directionalShadowMatrix[u]=e.shadow.matrix,m++}r.directional[u]=t,u++}else if(e.isSpotLight){const t=i.get(e);if(t.position.setFromMatrixPosition(e.matrixWorld),t.color.copy(s).multiplyScalar(_*v),t.distance=x,t.coneCos=Math.cos(e.angle),t.penumbraCos=Math.cos(e.angle*(1-e.penumbra)),t.decay=e.decay,e.castShadow){const t=e.shadow,i=n.get(e);i.shadowBias=t.bias,i.shadowNormalBias=t.normalBias,i.shadowRadius=t.radius,i.shadowMapSize=t.mapSize,r.spotShadow[p]=i,r.spotShadowMap[p]=b,r.spotShadowMatrix[p]=e.shadow.matrix,y++}r.spot[p]=t,p++}else if(e.isRectAreaLight){const t=i.get(e);t.color.copy(s).multiplyScalar(_),t.halfWidth.set(.5*e.width,0,0),t.halfHeight.set(0,.5*e.height,0),r.rectArea[d]=t,d++}else if(e.isPointLight){const t=i.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity*v),t.distance=e.distance,t.decay=e.decay,e.castShadow){const t=e.shadow,i=n.get(e);i.shadowBias=t.bias,i.shadowNormalBias=t.normalBias,i.shadowRadius=t.radius,i.shadowMapSize=t.mapSize,i.shadowCameraNear=t.camera.near,i.shadowCameraFar=t.camera.far,r.pointShadow[h]=i,r.pointShadowMap[h]=b,r.pointShadowMatrix[h]=e.shadow.matrix,g++}r.point[h]=t,h++}else if(e.isHemisphereLight){const t=i.get(e);t.skyColor.copy(e.color).multiplyScalar(_*v),t.groundColor.copy(e.groundColor).multiplyScalar(_*v),r.hemi[f]=t,f++}}d>0&&(e.isWebGL2||!0===t.has("OES_texture_float_linear")?(r.rectAreaLTC1=hn.LTC_FLOAT_1,r.rectAreaLTC2=hn.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(r.rectAreaLTC1=hn.LTC_HALF_1,r.rectAreaLTC2=hn.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=a,r.ambient[1]=l,r.ambient[2]=c;const _=r.hash;_.directionalLength===u&&_.pointLength===h&&_.spotLength===p&&_.rectAreaLength===d&&_.hemiLength===f&&_.numDirectionalShadows===m&&_.numPointShadows===g&&_.numSpotShadows===y||(r.directional.length=u,r.spot.length=p,r.rectArea.length=d,r.point.length=h,r.hemi.length=f,r.directionalShadow.length=m,r.directionalShadowMap.length=m,r.pointShadow.length=g,r.pointShadowMap.length=g,r.spotShadow.length=y,r.spotShadowMap.length=y,r.directionalShadowMatrix.length=m,r.pointShadowMatrix.length=g,r.spotShadowMatrix.length=y,_.directionalLength=u,_.pointLength=h,_.spotLength=p,_.rectAreaLength=d,_.hemiLength=f,_.numDirectionalShadows=m,_.numPointShadows=g,_.numSpotShadows=y,r.version=Lo++)},setupView:function(t,e){let i=0,n=0,l=0,c=0,u=0;const h=e.matrixWorldInverse;for(let e=0,p=t.length;e<p;e++){const p=t[e];if(p.isDirectionalLight){const t=r.directional[i];t.direction.setFromMatrixPosition(p.matrixWorld),o.setFromMatrixPosition(p.target.matrixWorld),t.direction.sub(o),t.direction.transformDirection(h),i++}else if(p.isSpotLight){const t=r.spot[l];t.position.setFromMatrixPosition(p.matrixWorld),t.position.applyMatrix4(h),t.direction.setFromMatrixPosition(p.matrixWorld),o.setFromMatrixPosition(p.target.matrixWorld),t.direction.sub(o),t.direction.transformDirection(h),l++}else if(p.isRectAreaLight){const t=r.rectArea[c];t.position.setFromMatrixPosition(p.matrixWorld),t.position.applyMatrix4(h),a.identity(),s.copy(p.matrixWorld),s.premultiply(h),a.extractRotation(s),t.halfWidth.set(.5*p.width,0,0),t.halfHeight.set(0,.5*p.height,0),t.halfWidth.applyMatrix4(a),t.halfHeight.applyMatrix4(a),c++}else if(p.isPointLight){const t=r.point[n];t.position.setFromMatrixPosition(p.matrixWorld),t.position.applyMatrix4(h),n++}else if(p.isHemisphereLight){const t=r.hemi[u];t.direction.setFromMatrixPosition(p.matrixWorld),t.direction.transformDirection(h),t.direction.normalize(),u++}}},state:r}}function Oo(t,e){const i=new Ro(t,e),n=[],r=[];return{init:function(){n.length=0,r.length=0},state:{lightsArray:n,shadowsArray:r,lights:i},setupLights:function(t){i.setup(n,t)},setupLightsView:function(t){i.setupView(n,t)},pushLight:function(t){n.push(t)},pushShadow:function(t){r.push(t)}}}function ko(t,e){let i=new WeakMap;return{get:function(n,r=0){let o;return!1===i.has(n)?(o=new Oo(t,e),i.set(n,[o])):r>=i.get(n).length?(o=new Oo(t,e),i.get(n).push(o)):o=i.get(n)[r],o},dispose:function(){i=new WeakMap}}}class No extends He{constructor(t){super(),this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}No.prototype.isMeshDepthMaterial=!0;class Bo extends He{constructor(t){super(),this.type="MeshDistanceMaterial",this.referencePosition=new Ct,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(t)}copy(t){return super.copy(t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}function zo(t,e,i){let n=new sn;const r=new yt,o=new yt,s=new Et,a=new No({depthPacking:3201}),l=new Bo,c={},u=i.maxTextureSize,h={0:1,1:0,2:2},p=new qi({uniforms:{shadow_pass:{value:null},resolution:{value:new yt},radius:{value:4},samples:{value:8}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\nuniform float samples;\n#include <packing>\nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),f=p.clone();f.defines.HORIZONTAL_PASS=1;const m=new wi;m.setAttribute("position",new ei(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const y=new Vi(m,p),v=this;function _(i,n){const r=e.update(y);p.uniforms.shadow_pass.value=i.map.texture,p.uniforms.resolution.value=i.mapSize,p.uniforms.radius.value=i.radius,p.uniforms.samples.value=i.blurSamples,t.setRenderTarget(i.mapPass),t.clear(),t.renderBufferDirect(n,null,r,p,y,null),f.uniforms.shadow_pass.value=i.mapPass.texture,f.uniforms.resolution.value=i.mapSize,f.uniforms.radius.value=i.radius,f.uniforms.samples.value=i.blurSamples,t.setRenderTarget(i.map),t.clear(),t.renderBufferDirect(n,null,r,f,y,null)}function x(e,i,n,r,o,s,u){let p=null;const d=!0===r.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(p=void 0!==d?d:!0===r.isPointLight?l:a,t.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0){const t=p.uuid,e=n.uuid;let i=c[t];void 0===i&&(i={},c[t]=i);let r=i[e];void 0===r&&(r=p.clone(),i[e]=r),p=r}return p.visible=n.visible,p.wireframe=n.wireframe,p.side=3===u?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:h[n.side],p.alphaMap=n.alphaMap,p.alphaTest=n.alphaTest,p.clipShadows=n.clipShadows,p.clippingPlanes=n.clippingPlanes,p.clipIntersection=n.clipIntersection,p.displacementMap=n.displacementMap,p.displacementScale=n.displacementScale,p.displacementBias=n.displacementBias,p.wireframeLinewidth=n.wireframeLinewidth,p.linewidth=n.linewidth,!0===r.isPointLight&&!0===p.isMeshDistanceMaterial&&(p.referencePosition.setFromMatrixPosition(r.matrixWorld),p.nearDistance=o,p.farDistance=s),p}function b(i,r,o,s,a){if(!1===i.visible)return;if(i.layers.test(r.layers)&&(i.isMesh||i.isLine||i.isPoints)&&(i.castShadow||i.receiveShadow&&3===a)&&(!i.frustumCulled||n.intersectsObject(i))){i.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,i.matrixWorld);const n=e.update(i),r=i.material;if(Array.isArray(r)){const e=n.groups;for(let l=0,c=e.length;l<c;l++){const c=e[l],u=r[c.materialIndex];if(u&&u.visible){const e=x(i,0,u,s,o.near,o.far,a);t.renderBufferDirect(o,null,n,e,i,c)}}}else if(r.visible){const e=x(i,0,r,s,o.near,o.far,a);t.renderBufferDirect(o,null,n,e,i,null)}}const l=i.children;for(let t=0,e=l.length;t<e;t++)b(l[t],r,o,s,a)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(e,i,a){if(!1===v.enabled)return;if(!1===v.autoUpdate&&!1===v.needsUpdate)return;if(0===e.length)return;const l=t.getRenderTarget(),c=t.getActiveCubeFace(),h=t.getActiveMipmapLevel(),p=t.state;p.setBlending(0),p.buffers.color.setClear(1,1,1,1),p.buffers.depth.setTest(!0),p.setScissorTest(!1);for(let l=0,c=e.length;l<c;l++){const c=e[l],h=c.shadow;if(void 0===h){console.warn("THREE.WebGLShadowMap:",c,"has no shadow.");continue}if(!1===h.autoUpdate&&!1===h.needsUpdate)continue;r.copy(h.mapSize);const f=h.getFrameExtents();if(r.multiply(f),o.copy(h.mapSize),(r.x>u||r.y>u)&&(r.x>u&&(o.x=Math.floor(u/f.x),r.x=o.x*f.x,h.mapSize.x=o.x),r.y>u&&(o.y=Math.floor(u/f.y),r.y=o.y*f.y,h.mapSize.y=o.y)),null===h.map&&!h.isPointLightShadow&&3===this.type){const t={minFilter:g,magFilter:g,format:M};h.map=new St(r.x,r.y,t),h.map.texture.name=c.name+".shadowMap",h.mapPass=new St(r.x,r.y,t),h.camera.updateProjectionMatrix()}if(null===h.map){const t={minFilter:d,magFilter:d,format:M};h.map=new St(r.x,r.y,t),h.map.texture.name=c.name+".shadowMap",h.camera.updateProjectionMatrix()}t.setRenderTarget(h.map),t.clear();const m=h.getViewportCount();for(let t=0;t<m;t++){const e=h.getViewport(t);s.set(o.x*e.x,o.y*e.y,o.x*e.z,o.y*e.w),p.viewport(s),h.updateMatrices(c,t),n=h.getFrustum(),b(i,a,h.camera,c,this.type)}h.isPointLightShadow||3!==this.type||_(h,a),h.needsUpdate=!1}v.needsUpdate=!1,t.setRenderTarget(l,c,h)}}function Fo(t,e,n){const r=n.isWebGL2,o=new function(){let e=!1;const i=new Et;let n=null;const r=new Et(0,0,0,0);return{setMask:function(i){n===i||e||(t.colorMask(i,i,i,i),n=i)},setLocked:function(t){e=t},setClear:function(e,n,o,s,a){!0===a&&(e*=s,n*=s,o*=s),i.set(e,n,o,s),!1===r.equals(i)&&(t.clearColor(e,n,o,s),r.copy(i))},reset:function(){e=!1,n=null,r.set(-1,0,0,0)}}},s=new function(){let e=!1,i=null,n=null,r=null;return{setTest:function(t){t?z(2929):F(2929)},setMask:function(n){i===n||e||(t.depthMask(n),i=n)},setFunc:function(e){if(n!==e){if(e)switch(e){case 0:t.depthFunc(512);break;case 1:t.depthFunc(519);break;case 2:t.depthFunc(513);break;case 3:default:t.depthFunc(515);break;case 4:t.depthFunc(514);break;case 5:t.depthFunc(518);break;case 6:t.depthFunc(516);break;case 7:t.depthFunc(517)}else t.depthFunc(515);n=e}},setLocked:function(t){e=t},setClear:function(e){r!==e&&(t.clearDepth(e),r=e)},reset:function(){e=!1,i=null,n=null,r=null}}},a=new function(){let e=!1,i=null,n=null,r=null,o=null,s=null,a=null,l=null,c=null;return{setTest:function(t){e||(t?z(2960):F(2960))},setMask:function(n){i===n||e||(t.stencilMask(n),i=n)},setFunc:function(e,i,s){n===e&&r===i&&o===s||(t.stencilFunc(e,i,s),n=e,r=i,o=s)},setOp:function(e,i,n){s===e&&a===i&&l===n||(t.stencilOp(e,i,n),s=e,a=i,l=n)},setLocked:function(t){e=t},setClear:function(e){c!==e&&(t.clearStencil(e),c=e)},reset:function(){e=!1,i=null,n=null,r=null,o=null,s=null,a=null,l=null,c=null}}};let l={},c=null,u={},h=null,p=!1,d=null,f=null,m=null,g=null,y=null,v=null,_=null,x=!1,b=null,w=null,A=null,E=null,S=null;const M=t.getParameter(35661);let T=!1,I=0;const C=t.getParameter(7938);-1!==C.indexOf("WebGL")?(I=parseFloat(/^WebGL (\d)/.exec(C)[1]),T=I>=1):-1!==C.indexOf("OpenGL ES")&&(I=parseFloat(/^OpenGL ES (\d)/.exec(C)[1]),T=I>=2);let P=null,L={};const D=t.getParameter(3088),R=t.getParameter(2978),O=(new Et).fromArray(D),k=(new Et).fromArray(R);function N(e,i,n){const r=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(let e=0;e<n;e++)t.texImage2D(i+e,0,6408,1,1,0,6408,5121,r);return o}const B={};function z(e){!0!==l[e]&&(t.enable(e),l[e]=!0)}function F(e){!1!==l[e]&&(t.disable(e),l[e]=!1)}B[3553]=N(3553,3553,1),B[34067]=N(34067,34069,6),o.setClear(0,0,0,1),s.setClear(1),a.setClear(0),z(2929),s.setFunc(3),j(!1),H(1),z(2884),G(0);const V={[i]:32774,101:32778,102:32779};if(r)V[103]=32775,V[104]=32776;else{const t=e.get("EXT_blend_minmax");null!==t&&(V[103]=t.MIN_EXT,V[104]=t.MAX_EXT)}const U={200:0,201:1,202:768,204:770,210:776,208:774,206:772,203:769,205:771,209:775,207:773};function G(e,n,r,o,s,a,l,c){if(0!==e){if(!1===p&&(z(3042),p=!0),5===e)s=s||n,a=a||r,l=l||o,n===f&&s===y||(t.blendEquationSeparate(V[n],V[s]),f=n,y=s),r===m&&o===g&&a===v&&l===_||(t.blendFuncSeparate(U[r],U[o],U[a],U[l]),m=r,g=o,v=a,_=l),d=e,x=null;else if(e!==d||c!==x){if(f===i&&y===i||(t.blendEquation(32774),f=i,y=i),c)switch(e){case 1:t.blendFuncSeparate(1,771,1,771);break;case 2:t.blendFunc(1,1);break;case 3:t.blendFuncSeparate(0,0,769,771);break;case 4:t.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}else switch(e){case 1:t.blendFuncSeparate(770,771,1,771);break;case 2:t.blendFunc(770,1);break;case 3:t.blendFunc(0,769);break;case 4:t.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}m=null,g=null,v=null,_=null,d=e,x=c}}else!0===p&&(F(3042),p=!1)}function j(e){b!==e&&(e?t.frontFace(2304):t.frontFace(2305),b=e)}function H(e){0!==e?(z(2884),e!==w&&(1===e?t.cullFace(1029):2===e?t.cullFace(1028):t.cullFace(1032))):F(2884),w=e}function W(e,i,n){e?(z(32823),E===i&&S===n||(t.polygonOffset(i,n),E=i,S=n)):F(32823)}function q(e){void 0===e&&(e=33984+M-1),P!==e&&(t.activeTexture(e),P=e)}return{buffers:{color:o,depth:s,stencil:a},enable:z,disable:F,bindFramebuffer:function(e,i){return null===i&&null!==c&&(i=c),u[e]!==i&&(t.bindFramebuffer(e,i),u[e]=i,r&&(36009===e&&(u[36160]=i),36160===e&&(u[36009]=i)),!0)},bindXRFramebuffer:function(e){e!==c&&(t.bindFramebuffer(36160,e),c=e)},useProgram:function(e){return h!==e&&(t.useProgram(e),h=e,!0)},setBlending:G,setMaterial:function(t,e){2===t.side?F(2884):z(2884);let i=1===t.side;e&&(i=!i),j(i),1===t.blending&&!1===t.transparent?G(0):G(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),s.setFunc(t.depthFunc),s.setTest(t.depthTest),s.setMask(t.depthWrite),o.setMask(t.colorWrite);const n=t.stencilWrite;a.setTest(n),n&&(a.setMask(t.stencilWriteMask),a.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),a.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),W(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits),!0===t.alphaToCoverage?z(32926):F(32926)},setFlipSided:j,setCullFace:H,setLineWidth:function(e){e!==A&&(T&&t.lineWidth(e),A=e)},setPolygonOffset:W,setScissorTest:function(t){t?z(3089):F(3089)},activeTexture:q,bindTexture:function(e,i){null===P&&q();let n=L[P];void 0===n&&(n={type:void 0,texture:void 0},L[P]=n),n.type===e&&n.texture===i||(t.bindTexture(e,i||B[e]),n.type=e,n.texture=i)},unbindTexture:function(){const e=L[P];void 0!==e&&void 0!==e.type&&(t.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)},compressedTexImage2D:function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{t.texImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(e){!1===O.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),O.copy(e))},viewport:function(e){!1===k.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),k.copy(e))},reset:function(){t.disable(3042),t.disable(2884),t.disable(2929),t.disable(32823),t.disable(3089),t.disable(2960),t.disable(32926),t.blendEquation(32774),t.blendFunc(1,0),t.blendFuncSeparate(1,0,1,0),t.colorMask(!0,!0,!0,!0),t.clearColor(0,0,0,0),t.depthMask(!0),t.depthFunc(513),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(519,0,4294967295),t.stencilOp(7680,7680,7680),t.clearStencil(0),t.cullFace(1029),t.frontFace(2305),t.polygonOffset(0,0),t.activeTexture(33984),t.bindFramebuffer(36160,null),!0===r&&(t.bindFramebuffer(36009,null),t.bindFramebuffer(36008,null)),t.useProgram(null),t.lineWidth(1),t.scissor(0,0,t.canvas.width,t.canvas.height),t.viewport(0,0,t.canvas.width,t.canvas.height),l={},P=null,L={},c=null,u={},h=null,p=!1,d=null,f=null,m=null,g=null,y=null,v=null,_=null,x=!1,b=null,w=null,A=null,E=null,S=null,O.set(0,0,t.canvas.width,t.canvas.height),k.set(0,0,t.canvas.width,t.canvas.height),o.reset(),s.reset(),a.reset()}}}function Vo(t,e,i,n,r,o,s){const a=r.isWebGL2,l=r.maxTextures,c=r.maxCubemapSize,_=r.maxTextureSize,C=r.maxSamples,P=new WeakMap;let L,D=!1;try{D="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}function R(t,e){return D?new OffscreenCanvas(t,e):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function O(t,e,i,n){let r=1;if((t.width>n||t.height>n)&&(r=n/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const n=e?mt:Math.floor,o=n(r*t.width),s=n(r*t.height);void 0===L&&(L=R(o,s));const a=i?R(o,s):L;return a.width=o,a.height=s,a.getContext("2d").drawImage(t,0,0,o,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+o+"x"+s+")."),a}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function k(t){return dt(t.width)&&dt(t.height)}function N(t,e){return t.generateMipmaps&&e&&t.minFilter!==d&&t.minFilter!==g}function B(e,i,r,o,s=1){t.generateMipmap(e),n.get(i).__maxMipLevel=Math.log2(Math.max(r,o,s))}function z(i,n,r){if(!1===a)return n;if(null!==i){if(void 0!==t[i])return t[i];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+i+"'")}let o=n;return 6403===n&&(5126===r&&(o=33326),5131===r&&(o=33325),5121===r&&(o=33321)),6407===n&&(5126===r&&(o=34837),5131===r&&(o=34843),5121===r&&(o=32849)),6408===n&&(5126===r&&(o=34836),5131===r&&(o=34842),5121===r&&(o=32856)),33325!==o&&33326!==o&&34842!==o&&34836!==o||e.get("EXT_color_buffer_float"),o}function F(t){return t===d||t===f||t===m?9728:9729}function V(e){const i=e.target;i.removeEventListener("dispose",V),function(e){const i=n.get(e);void 0!==i.__webglInit&&(t.deleteTexture(i.__webglTexture),n.remove(e))}(i),i.isVideoTexture&&P.delete(i),s.memory.textures--}function U(e){const i=e.target;i.removeEventListener("dispose",U),function(e){const i=e.texture,r=n.get(e),o=n.get(i);if(e){if(void 0!==o.__webglTexture&&(t.deleteTexture(o.__webglTexture),s.memory.textures--),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++)t.deleteFramebuffer(r.__webglFramebuffer[e]),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer[e]);else t.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer),r.__webglMultisampledFramebuffer&&t.deleteFramebuffer(r.__webglMultisampledFramebuffer),r.__webglColorRenderbuffer&&t.deleteRenderbuffer(r.__webglColorRenderbuffer),r.__webglDepthRenderbuffer&&t.deleteRenderbuffer(r.__webglDepthRenderbuffer);if(e.isWebGLMultipleRenderTargets)for(let e=0,r=i.length;e<r;e++){const r=n.get(i[e]);r.__webglTexture&&(t.deleteTexture(r.__webglTexture),s.memory.textures--),n.remove(i[e])}n.remove(i),n.remove(e)}}(i)}let G=0;function j(t,e){const r=n.get(t);if(t.isVideoTexture&&function(t){const e=s.render.frame;P.get(t)!==e&&(P.set(t,e),t.update())}(t),t.version>0&&r.__version!==t.version){const i=t.image;if(void 0===i)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==i.complete)return void Y(r,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}i.activeTexture(33984+e),i.bindTexture(3553,r.__webglTexture)}function H(e,r){const s=n.get(e);e.version>0&&s.__version!==e.version?function(e,n,r){if(6!==n.image.length)return;Z(e,n),i.activeTexture(33984+r),i.bindTexture(34067,e.__webglTexture),t.pixelStorei(37440,n.flipY),t.pixelStorei(37441,n.premultiplyAlpha),t.pixelStorei(3317,n.unpackAlignment),t.pixelStorei(37443,0);const s=n&&(n.isCompressedTexture||n.image[0].isCompressedTexture),l=n.image[0]&&n.image[0].isDataTexture,u=[];for(let t=0;t<6;t++)u[t]=s||l?l?n.image[t].image:n.image[t]:O(n.image[t],!1,!0,c);const h=u[0],p=k(h)||a,d=o.convert(n.format),f=o.convert(n.type),m=z(n.internalFormat,d,f);let g;if(X(34067,n,p),s){for(let t=0;t<6;t++){g=u[t].mipmaps;for(let e=0;e<g.length;e++){const r=g[e];n.format!==M&&n.format!==S?null!==d?i.compressedTexImage2D(34069+t,e,m,r.width,r.height,0,r.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):i.texImage2D(34069+t,e,m,r.width,r.height,0,d,f,r.data)}}e.__maxMipLevel=g.length-1}else{g=n.mipmaps;for(let t=0;t<6;t++)if(l){i.texImage2D(34069+t,0,m,u[t].width,u[t].height,0,d,f,u[t].data);for(let e=0;e<g.length;e++){const n=g[e].image[t].image;i.texImage2D(34069+t,e+1,m,n.width,n.height,0,d,f,n.data)}}else{i.texImage2D(34069+t,0,m,d,f,u[t]);for(let e=0;e<g.length;e++){const n=g[e];i.texImage2D(34069+t,e+1,m,d,f,n.image[t])}}e.__maxMipLevel=g.length}N(n,p)&&B(34067,n,h.width,h.height),e.__version=n.version,n.onUpdate&&n.onUpdate(n)}(s,e,r):(i.activeTexture(33984+r),i.bindTexture(34067,s.__webglTexture))}const W={[u]:10497,[h]:33071,[p]:33648},q={[d]:9728,[f]:9984,[m]:9986,[g]:9729,[y]:9985,[v]:9987};function X(i,o,s){if(s?(t.texParameteri(i,10242,W[o.wrapS]),t.texParameteri(i,10243,W[o.wrapT]),32879!==i&&35866!==i||t.texParameteri(i,32882,W[o.wrapR]),t.texParameteri(i,10240,q[o.magFilter]),t.texParameteri(i,10241,q[o.minFilter])):(t.texParameteri(i,10242,33071),t.texParameteri(i,10243,33071),32879!==i&&35866!==i||t.texParameteri(i,32882,33071),o.wrapS===h&&o.wrapT===h||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(i,10240,F(o.magFilter)),t.texParameteri(i,10241,F(o.minFilter)),o.minFilter!==d&&o.minFilter!==g&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),!0===e.has("EXT_texture_filter_anisotropic")){const s=e.get("EXT_texture_filter_anisotropic");if(o.type===w&&!1===e.has("OES_texture_float_linear"))return;if(!1===a&&o.type===A&&!1===e.has("OES_texture_half_float_linear"))return;(o.anisotropy>1||n.get(o).__currentAnisotropy)&&(t.texParameterf(i,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,r.getMaxAnisotropy())),n.get(o).__currentAnisotropy=o.anisotropy)}}function Z(e,i){void 0===e.__webglInit&&(e.__webglInit=!0,i.addEventListener("dispose",V),e.__webglTexture=t.createTexture(),s.memory.textures++)}function Y(e,n,r){let s=3553;n.isDataTexture2DArray&&(s=35866),n.isDataTexture3D&&(s=32879),Z(e,n),i.activeTexture(33984+r),i.bindTexture(s,e.__webglTexture),t.pixelStorei(37440,n.flipY),t.pixelStorei(37441,n.premultiplyAlpha),t.pixelStorei(3317,n.unpackAlignment),t.pixelStorei(37443,0);const l=function(t){return!a&&(t.wrapS!==h||t.wrapT!==h||t.minFilter!==d&&t.minFilter!==g)}(n)&&!1===k(n.image),c=O(n.image,l,!1,_),u=k(c)||a,p=o.convert(n.format);let f,m=o.convert(n.type),y=z(n.internalFormat,p,m);X(s,n,u);const v=n.mipmaps;if(n.isDepthTexture)y=6402,a?y=n.type===w?36012:n.type===b?33190:n.type===E?35056:33189:n.type===w&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),n.format===T&&6402===y&&n.type!==x&&n.type!==b&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=x,m=o.convert(n.type)),n.format===I&&6402===y&&(y=34041,n.type!==E&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=E,m=o.convert(n.type))),i.texImage2D(3553,0,y,c.width,c.height,0,p,m,null);else if(n.isDataTexture)if(v.length>0&&u){for(let t=0,e=v.length;t<e;t++)f=v[t],i.texImage2D(3553,t,y,f.width,f.height,0,p,m,f.data);n.generateMipmaps=!1,e.__maxMipLevel=v.length-1}else i.texImage2D(3553,0,y,c.width,c.height,0,p,m,c.data),e.__maxMipLevel=0;else if(n.isCompressedTexture){for(let t=0,e=v.length;t<e;t++)f=v[t],n.format!==M&&n.format!==S?null!==p?i.compressedTexImage2D(3553,t,y,f.width,f.height,0,f.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):i.texImage2D(3553,t,y,f.width,f.height,0,p,m,f.data);e.__maxMipLevel=v.length-1}else if(n.isDataTexture2DArray)i.texImage3D(35866,0,y,c.width,c.height,c.depth,0,p,m,c.data),e.__maxMipLevel=0;else if(n.isDataTexture3D)i.texImage3D(32879,0,y,c.width,c.height,c.depth,0,p,m,c.data),e.__maxMipLevel=0;else if(v.length>0&&u){for(let t=0,e=v.length;t<e;t++)f=v[t],i.texImage2D(3553,t,y,p,m,f);n.generateMipmaps=!1,e.__maxMipLevel=v.length-1}else i.texImage2D(3553,0,y,p,m,c),e.__maxMipLevel=0;N(n,u)&&B(s,n,c.width,c.height),e.__version=n.version,n.onUpdate&&n.onUpdate(n)}function Q(e,r,s,a,l){const c=o.convert(s.format),u=o.convert(s.type),h=z(s.internalFormat,c,u);32879===l||35866===l?i.texImage3D(l,0,h,r.width,r.height,r.depth,0,c,u,null):i.texImage2D(l,0,h,r.width,r.height,0,c,u,null),i.bindFramebuffer(36160,e),t.framebufferTexture2D(36160,a,l,n.get(s).__webglTexture,0),i.bindFramebuffer(36160,null)}function J(e,i,n){if(t.bindRenderbuffer(36161,e),i.depthBuffer&&!i.stencilBuffer){let r=33189;if(n){const e=i.depthTexture;e&&e.isDepthTexture&&(e.type===w?r=36012:e.type===b&&(r=33190));const n=$(i);t.renderbufferStorageMultisample(36161,n,r,i.width,i.height)}else t.renderbufferStorage(36161,r,i.width,i.height);t.framebufferRenderbuffer(36160,36096,36161,e)}else if(i.depthBuffer&&i.stencilBuffer){if(n){const e=$(i);t.renderbufferStorageMultisample(36161,e,35056,i.width,i.height)}else t.renderbufferStorage(36161,34041,i.width,i.height);t.framebufferRenderbuffer(36160,33306,36161,e)}else{const e=!0===i.isWebGLMultipleRenderTargets?i.texture[0]:i.texture,r=o.convert(e.format),s=o.convert(e.type),a=z(e.internalFormat,r,s);if(n){const e=$(i);t.renderbufferStorageMultisample(36161,e,a,i.width,i.height)}else t.renderbufferStorage(36161,a,i.width,i.height)}t.bindRenderbuffer(36161,null)}function K(e){const r=n.get(e),o=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture){if(o)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,r){if(r&&r.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(i.bindFramebuffer(36160,e),!r.depthTexture||!r.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(r.depthTexture).__webglTexture&&r.depthTexture.image.width===r.width&&r.depthTexture.image.height===r.height||(r.depthTexture.image.width=r.width,r.depthTexture.image.height=r.height,r.depthTexture.needsUpdate=!0),j(r.depthTexture,0);const o=n.get(r.depthTexture).__webglTexture;if(r.depthTexture.format===T)t.framebufferTexture2D(36160,36096,3553,o,0);else{if(r.depthTexture.format!==I)throw new Error("Unknown depthTexture format");t.framebufferTexture2D(36160,33306,3553,o,0)}}(r.__webglFramebuffer,e)}else if(o){r.__webglDepthbuffer=[];for(let n=0;n<6;n++)i.bindFramebuffer(36160,r.__webglFramebuffer[n]),r.__webglDepthbuffer[n]=t.createRenderbuffer(),J(r.__webglDepthbuffer[n],e,!1)}else i.bindFramebuffer(36160,r.__webglFramebuffer),r.__webglDepthbuffer=t.createRenderbuffer(),J(r.__webglDepthbuffer,e,!1);i.bindFramebuffer(36160,null)}function $(t){return a&&t.isWebGLMultisampleRenderTarget?Math.min(C,t.samples):0}let tt=!1,et=!1;this.allocateTextureUnit=function(){const t=G;return t>=l&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+l),G+=1,t},this.resetTextureUnits=function(){G=0},this.setTexture2D=j,this.setTexture2DArray=function(t,e){const r=n.get(t);t.version>0&&r.__version!==t.version?Y(r,t,e):(i.activeTexture(33984+e),i.bindTexture(35866,r.__webglTexture))},this.setTexture3D=function(t,e){const r=n.get(t);t.version>0&&r.__version!==t.version?Y(r,t,e):(i.activeTexture(33984+e),i.bindTexture(32879,r.__webglTexture))},this.setTextureCube=H,this.setupRenderTarget=function(e){const l=e.texture,c=n.get(e),u=n.get(l);e.addEventListener("dispose",U),!0!==e.isWebGLMultipleRenderTargets&&(u.__webglTexture=t.createTexture(),u.__version=l.version,s.memory.textures++);const h=!0===e.isWebGLCubeRenderTarget,p=!0===e.isWebGLMultipleRenderTargets,d=!0===e.isWebGLMultisampleRenderTarget,f=l.isDataTexture3D||l.isDataTexture2DArray,m=k(e)||a;if(!a||l.format!==S||l.type!==w&&l.type!==A||(l.format=M,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),h){c.__webglFramebuffer=[];for(let e=0;e<6;e++)c.__webglFramebuffer[e]=t.createFramebuffer()}else if(c.__webglFramebuffer=t.createFramebuffer(),p)if(r.drawBuffers){const i=e.texture;for(let e=0,r=i.length;e<r;e++){const r=n.get(i[e]);void 0===r.__webglTexture&&(r.__webglTexture=t.createTexture(),s.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(d)if(a){c.__webglMultisampledFramebuffer=t.createFramebuffer(),c.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,c.__webglColorRenderbuffer);const n=o.convert(l.format),r=o.convert(l.type),s=z(l.internalFormat,n,r),a=$(e);t.renderbufferStorageMultisample(36161,a,s,e.width,e.height),i.bindFramebuffer(36160,c.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,c.__webglColorRenderbuffer),t.bindRenderbuffer(36161,null),e.depthBuffer&&(c.__webglDepthRenderbuffer=t.createRenderbuffer(),J(c.__webglDepthRenderbuffer,e,!0)),i.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(h){i.bindTexture(34067,u.__webglTexture),X(34067,l,m);for(let t=0;t<6;t++)Q(c.__webglFramebuffer[t],e,l,36064,34069+t);N(l,m)&&B(34067,l,e.width,e.height),i.unbindTexture()}else if(p){const t=e.texture;for(let r=0,o=t.length;r<o;r++){const o=t[r],s=n.get(o);i.bindTexture(3553,s.__webglTexture),X(3553,o,m),Q(c.__webglFramebuffer,e,o,36064+r,3553),N(o,m)&&B(3553,o,e.width,e.height)}i.unbindTexture()}else{let t=3553;f&&(a?t=l.isDataTexture3D?32879:35866:console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")),i.bindTexture(t,u.__webglTexture),X(t,l,m),Q(c.__webglFramebuffer,e,l,36064,t),N(l,m)&&B(t,l,e.width,e.height,e.depth),i.unbindTexture()}e.depthBuffer&&K(e)},this.updateRenderTargetMipmap=function(t){const e=k(t)||a,r=!0===t.isWebGLMultipleRenderTargets?t.texture:[t.texture];for(let o=0,s=r.length;o<s;o++){const s=r[o];if(N(s,e)){const e=t.isWebGLCubeRenderTarget?34067:3553,r=n.get(s).__webglTexture;i.bindTexture(e,r),B(e,s,t.width,t.height),i.unbindTexture()}}},this.updateMultisampleRenderTarget=function(e){if(e.isWebGLMultisampleRenderTarget)if(a){const r=e.width,o=e.height;let s=16384;e.depthBuffer&&(s|=256),e.stencilBuffer&&(s|=1024);const a=n.get(e);i.bindFramebuffer(36008,a.__webglMultisampledFramebuffer),i.bindFramebuffer(36009,a.__webglFramebuffer),t.blitFramebuffer(0,0,r,o,0,0,r,o,s,9728),i.bindFramebuffer(36008,null),i.bindFramebuffer(36009,a.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(t,e){t&&t.isWebGLRenderTarget&&(!1===tt&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),tt=!0),t=t.texture),j(t,e)},this.safeSetTextureCube=function(t,e){t&&t.isWebGLCubeRenderTarget&&(!1===et&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),et=!0),t=t.texture),H(t,e)}}function Uo(t,e,i){const n=i.isWebGL2;return{convert:function(t){let i;if(t===_)return 5121;if(1017===t)return 32819;if(1018===t)return 32820;if(1019===t)return 33635;if(1010===t)return 5120;if(1011===t)return 5122;if(t===x)return 5123;if(1013===t)return 5124;if(t===b)return 5125;if(t===w)return 5126;if(t===A)return n?5131:(i=e.get("OES_texture_half_float"),null!==i?i.HALF_FLOAT_OES:null);if(1021===t)return 6406;if(t===S)return 6407;if(t===M)return 6408;if(1024===t)return 6409;if(1025===t)return 6410;if(t===T)return 6402;if(t===I)return 34041;if(1028===t)return 6403;if(1029===t)return 36244;if(1030===t)return 33319;if(1031===t)return 33320;if(1032===t)return 36248;if(1033===t)return 36249;if(t===C||t===P||t===L||t===D){if(i=e.get("WEBGL_compressed_texture_s3tc"),null===i)return null;if(t===C)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===P)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===L)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===D)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(t===R||t===O||t===k||t===N){if(i=e.get("WEBGL_compressed_texture_pvrtc"),null===i)return null;if(t===R)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===O)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===k)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===N)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===t)return i=e.get("WEBGL_compressed_texture_etc1"),null!==i?i.COMPRESSED_RGB_ETC1_WEBGL:null;if((t===B||t===z)&&(i=e.get("WEBGL_compressed_texture_etc"),null!==i)){if(t===B)return i.COMPRESSED_RGB8_ETC2;if(t===z)return i.COMPRESSED_RGBA8_ETC2_EAC}return 37808===t||37809===t||37810===t||37811===t||37812===t||37813===t||37814===t||37815===t||37816===t||37817===t||37818===t||37819===t||37820===t||37821===t||37840===t||37841===t||37842===t||37843===t||37844===t||37845===t||37846===t||37847===t||37848===t||37849===t||37850===t||37851===t||37852===t||37853===t?(i=e.get("WEBGL_compressed_texture_astc"),null!==i?t:null):36492===t?(i=e.get("EXT_texture_compression_bptc"),null!==i?t:null):t===E?n?34042:(i=e.get("WEBGL_depth_texture"),null!==i?i.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}Bo.prototype.isMeshDistanceMaterial=!0;class Go extends Zi{constructor(t=[]){super(),this.cameras=t}}Go.prototype.isArrayCamera=!0;class jo extends Le{constructor(){super(),this.type="Group"}}jo.prototype.isGroup=!0;const Ho={type:"move"};class Wo{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new jo,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new jo,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Ct,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Ct),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new jo,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Ct,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Ct),this._grip}dispatchEvent(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(t,e,i){let n=null,r=null,o=null;const s=this._targetRay,a=this._grip,l=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState)if(null!==s&&(n=e.getPose(t.targetRaySpace,i),null!==n&&(s.matrix.fromArray(n.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),n.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(n.linearVelocity)):s.hasLinearVelocity=!1,n.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(n.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(Ho))),l&&t.hand){o=!0;for(const n of t.hand.values()){const t=e.getJointPose(n,i);if(void 0===l.joints[n.jointName]){const t=new jo;t.matrixAutoUpdate=!1,t.visible=!1,l.joints[n.jointName]=t,l.add(t)}const r=l.joints[n.jointName];null!==t&&(r.matrix.fromArray(t.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.jointRadius=t.radius),r.visible=null!==t}const n=l.joints["index-finger-tip"],r=l.joints["thumb-tip"],s=n.position.distanceTo(r.position),a=.02,c=.005;l.inputState.pinching&&s>a+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&s<=a-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==a&&t.gripSpace&&(r=e.getPose(t.gripSpace,i),null!==r&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1));return null!==s&&(s.visible=null!==n),null!==a&&(a.visible=null!==r),null!==l&&(l.visible=null!==o),this}}class qo extends rt{constructor(t,e){super();const i=this,n=t.state;let r=null,o=1,s=null,a="local-floor",l=null,c=null,u=null,h=null,p=null,d=!1,f=null,m=null,g=null,y=null,v=null,_=null;const x=[],b=new Map,w=new Zi;w.layers.enable(1),w.viewport=new Et;const A=new Zi;A.layers.enable(2),A.viewport=new Et;const E=[w,A],S=new Go;S.layers.enable(1),S.layers.enable(2);let M=null,T=null;function I(t){const e=b.get(t.inputSource);e&&e.dispatchEvent({type:t.type,data:t.inputSource})}function C(){b.forEach((function(t,e){t.disconnect(e)})),b.clear(),M=null,T=null,n.bindXRFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),u&&e.deleteFramebuffer(u),f&&e.deleteFramebuffer(f),m&&e.deleteRenderbuffer(m),g&&e.deleteRenderbuffer(g),u=null,f=null,m=null,g=null,p=null,h=null,c=null,r=null,k.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}function P(t){const e=r.inputSources;for(let t=0;t<x.length;t++)b.set(e[t],x[t]);for(let e=0;e<t.removed.length;e++){const i=t.removed[e],n=b.get(i);n&&(n.dispatchEvent({type:"disconnected",data:i}),b.delete(i))}for(let e=0;e<t.added.length;e++){const i=t.added[e],n=b.get(i);n&&n.dispatchEvent({type:"connected",data:i})}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(t){let e=x[t];return void 0===e&&(e=new Wo,x[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=x[t];return void 0===e&&(e=new Wo,x[t]=e),e.getGripSpace()},this.getHand=function(t){let e=x[t];return void 0===e&&(e=new Wo,x[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){o=t,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){a=t,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return s},this.getBaseLayer=function(){return null!==h?h:p},this.getBinding=function(){return c},this.getFrame=function(){return y},this.getSession=function(){return r},this.setSession=async function(t){if(r=t,null!==r){r.addEventListener("select",I),r.addEventListener("selectstart",I),r.addEventListener("selectend",I),r.addEventListener("squeeze",I),r.addEventListener("squeezestart",I),r.addEventListener("squeezeend",I),r.addEventListener("end",C),r.addEventListener("inputsourceschange",P);const t=e.getContextAttributes();if(!0!==t.xrCompatible&&await e.makeXRCompatible(),void 0===r.renderState.layers){const i={antialias:t.antialias,alpha:t.alpha,depth:t.depth,stencil:t.stencil,framebufferScaleFactor:o};p=new XRWebGLLayer(r,e,i),r.updateRenderState({baseLayer:p})}else if(e instanceof WebGLRenderingContext){const i={antialias:!0,alpha:t.alpha,depth:t.depth,stencil:t.stencil,framebufferScaleFactor:o};p=new XRWebGLLayer(r,e,i),r.updateRenderState({layers:[p]})}else{d=t.antialias;let i=null;t.depth&&(_=256,t.stencil&&(_|=1024),v=t.stencil?33306:36096,i=t.stencil?35056:33190);const s={colorFormat:t.alpha?32856:32849,depthFormat:i,scaleFactor:o};c=new XRWebGLBinding(r,e),h=c.createProjectionLayer(s),u=e.createFramebuffer(),r.updateRenderState({layers:[h]}),d&&(f=e.createFramebuffer(),m=e.createRenderbuffer(),e.bindRenderbuffer(36161,m),e.renderbufferStorageMultisample(36161,4,32856,h.textureWidth,h.textureHeight),n.bindFramebuffer(36160,f),e.framebufferRenderbuffer(36160,36064,36161,m),e.bindRenderbuffer(36161,null),null!==i&&(g=e.createRenderbuffer(),e.bindRenderbuffer(36161,g),e.renderbufferStorageMultisample(36161,4,i,h.textureWidth,h.textureHeight),e.framebufferRenderbuffer(36160,v,36161,g),e.bindRenderbuffer(36161,null)),n.bindFramebuffer(36160,null))}s=await r.requestReferenceSpace(a),k.setContext(r),k.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};const L=new Ct,D=new Ct;function R(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.copy(t.matrixWorld).invert()}this.updateCamera=function(t){if(null===r)return;S.near=A.near=w.near=t.near,S.far=A.far=w.far=t.far,M===S.near&&T===S.far||(r.updateRenderState({depthNear:S.near,depthFar:S.far}),M=S.near,T=S.far);const e=t.parent,i=S.cameras;R(S,e);for(let t=0;t<i.length;t++)R(i[t],e);S.matrixWorld.decompose(S.position,S.quaternion,S.scale),t.position.copy(S.position),t.quaternion.copy(S.quaternion),t.scale.copy(S.scale),t.matrix.copy(S.matrix),t.matrixWorld.copy(S.matrixWorld);const n=t.children;for(let t=0,e=n.length;t<e;t++)n[t].updateMatrixWorld(!0);2===i.length?function(t,e,i){L.setFromMatrixPosition(e.matrixWorld),D.setFromMatrixPosition(i.matrixWorld);const n=L.distanceTo(D),r=e.projectionMatrix.elements,o=i.projectionMatrix.elements,s=r[14]/(r[10]-1),a=r[14]/(r[10]+1),l=(r[9]+1)/r[5],c=(r[9]-1)/r[5],u=(r[8]-1)/r[0],h=(o[8]+1)/o[0],p=s*u,d=s*h,f=n/(-u+h),m=f*-u;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(m),t.translateZ(f),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.copy(t.matrixWorld).invert();const g=s+f,y=a+f,v=p-m,_=d+(n-m),x=l*a/y*g,b=c*a/y*g;t.projectionMatrix.makePerspective(v,_,x,b,g,y)}(S,w,A):S.projectionMatrix.copy(w.projectionMatrix)},this.getCamera=function(){return S},this.getFoveation=function(){return null!==h?h.fixedFoveation:null!==p?p.fixedFoveation:void 0},this.setFoveation=function(t){null!==h&&(h.fixedFoveation=t),null!==p&&void 0!==p.fixedFoveation&&(p.fixedFoveation=t)};let O=null;const k=new an;k.setAnimationLoop((function(t,i){if(l=i.getViewerPose(s),y=i,null!==l){const t=l.views;null!==p&&n.bindXRFramebuffer(p.framebuffer);let i=!1;t.length!==S.cameras.length&&(S.cameras.length=0,i=!0);for(let r=0;r<t.length;r++){const o=t[r];let s=null;if(null!==p)s=p.getViewport(o);else{const t=c.getViewSubImage(h,o);n.bindXRFramebuffer(u),void 0!==t.depthStencilTexture&&e.framebufferTexture2D(36160,v,3553,t.depthStencilTexture,0),e.framebufferTexture2D(36160,36064,3553,t.colorTexture,0),s=t.viewport}const a=E[r];a.matrix.fromArray(o.transform.matrix),a.projectionMatrix.fromArray(o.projectionMatrix),a.viewport.set(s.x,s.y,s.width,s.height),0===r&&S.matrix.copy(a.matrix),!0===i&&S.cameras.push(a)}d&&(n.bindXRFramebuffer(f),null!==_&&e.clear(_))}const o=r.inputSources;for(let t=0;t<x.length;t++){const e=x[t],n=o[t];e.update(n,i,s)}if(O&&O(t,i),d){const t=h.textureWidth,i=h.textureHeight;n.bindFramebuffer(36008,f),n.bindFramebuffer(36009,u),e.invalidateFramebuffer(36008,[v]),e.invalidateFramebuffer(36009,[v]),e.blitFramebuffer(0,0,t,i,0,0,t,i,16384,9728),e.invalidateFramebuffer(36008,[36064]),n.bindFramebuffer(36008,null),n.bindFramebuffer(36009,null),n.bindFramebuffer(36160,f)}y=null})),this.setAnimationLoop=function(t){O=t},this.dispose=function(){}}}function Xo(t){function e(e,i){e.opacity.value=i.opacity,i.color&&e.diffuse.value.copy(i.color),i.emissive&&e.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(e.map.value=i.map),i.alphaMap&&(e.alphaMap.value=i.alphaMap),i.specularMap&&(e.specularMap.value=i.specularMap),i.alphaTest>0&&(e.alphaTest.value=i.alphaTest);const n=t.get(i).envMap;if(n){e.envMap.value=n,e.flipEnvMap.value=n.isCubeTexture&&!1===n.isRenderTargetTexture?-1:1,e.reflectivity.value=i.reflectivity,e.ior.value=i.ior,e.refractionRatio.value=i.refractionRatio;const r=t.get(n).__maxMipLevel;void 0!==r&&(e.maxMipLevel.value=r)}let r,o;i.lightMap&&(e.lightMap.value=i.lightMap,e.lightMapIntensity.value=i.lightMapIntensity),i.aoMap&&(e.aoMap.value=i.aoMap,e.aoMapIntensity.value=i.aoMapIntensity),i.map?r=i.map:i.specularMap?r=i.specularMap:i.displacementMap?r=i.displacementMap:i.normalMap?r=i.normalMap:i.bumpMap?r=i.bumpMap:i.roughnessMap?r=i.roughnessMap:i.metalnessMap?r=i.metalnessMap:i.alphaMap?r=i.alphaMap:i.emissiveMap?r=i.emissiveMap:i.clearcoatMap?r=i.clearcoatMap:i.clearcoatNormalMap?r=i.clearcoatNormalMap:i.clearcoatRoughnessMap?r=i.clearcoatRoughnessMap:i.specularIntensityMap?r=i.specularIntensityMap:i.specularTintMap?r=i.specularTintMap:i.transmissionMap?r=i.transmissionMap:i.thicknessMap&&(r=i.thicknessMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),!0===r.matrixAutoUpdate&&r.updateMatrix(),e.uvTransform.value.copy(r.matrix)),i.aoMap?o=i.aoMap:i.lightMap&&(o=i.lightMap),void 0!==o&&(o.isWebGLRenderTarget&&(o=o.texture),!0===o.matrixAutoUpdate&&o.updateMatrix(),e.uv2Transform.value.copy(o.matrix))}function i(e,i){e.roughness.value=i.roughness,e.metalness.value=i.metalness,i.roughnessMap&&(e.roughnessMap.value=i.roughnessMap),i.metalnessMap&&(e.metalnessMap.value=i.metalnessMap),i.emissiveMap&&(e.emissiveMap.value=i.emissiveMap),i.bumpMap&&(e.bumpMap.value=i.bumpMap,e.bumpScale.value=i.bumpScale,1===i.side&&(e.bumpScale.value*=-1)),i.normalMap&&(e.normalMap.value=i.normalMap,e.normalScale.value.copy(i.normalScale),1===i.side&&e.normalScale.value.negate()),i.displacementMap&&(e.displacementMap.value=i.displacementMap,e.displacementScale.value=i.displacementScale,e.displacementBias.value=i.displacementBias),t.get(i).envMap&&(e.envMapIntensity.value=i.envMapIntensity)}return{refreshFogUniforms:function(t,e){t.fogColor.value.copy(e.color),e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)},refreshMaterialUniforms:function(t,n,r,o,s){n.isMeshBasicMaterial?e(t,n):n.isMeshLambertMaterial?(e(t,n),function(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}(t,n)):n.isMeshToonMaterial?(e(t,n),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isMeshPhongMaterial?(e(t,n),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isMeshStandardMaterial?(e(t,n),n.isMeshPhysicalMaterial?function(t,e,n){i(t,e),t.ior.value=e.ior,e.sheenTint&&t.sheenTint.value.copy(e.sheenTint),e.clearcoat>0&&(t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap),e.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),t.clearcoatNormalMap.value=e.clearcoatNormalMap,1===e.side&&t.clearcoatNormalScale.value.negate())),e.transmission>0&&(t.transmission.value=e.transmission,t.transmissionSamplerMap.value=n.texture,t.transmissionSamplerSize.value.set(n.width,n.height),e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap),t.thickness.value=e.thickness,e.thicknessMap&&(t.thicknessMap.value=e.thicknessMap),t.attenuationDistance.value=e.attenuationDistance,t.attenuationTint.value.copy(e.attenuationTint)),t.specularIntensity.value=e.specularIntensity,t.specularTint.value.copy(e.specularTint),e.specularIntensityMap&&(t.specularIntensityMap.value=e.specularIntensityMap),e.specularTintMap&&(t.specularTintMap.value=e.specularTintMap)}(t,n,s):i(t,n)):n.isMeshMatcapMaterial?(e(t,n),function(t,e){e.matcap&&(t.matcap.value=e.matcap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isMeshDepthMaterial?(e(t,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isMeshDistanceMaterial?(e(t,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}(t,n)):n.isMeshNormalMaterial?(e(t,n),function(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity}(t,n),n.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,n)):n.isPointsMaterial?function(t,e,i,n){let r;t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*i,t.scale.value=.5*n,e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.alphaTest>0&&(t.alphaTest.value=e.alphaTest),e.map?r=e.map:e.alphaMap&&(r=e.alphaMap),void 0!==r&&(!0===r.matrixAutoUpdate&&r.updateMatrix(),t.uvTransform.value.copy(r.matrix))}(t,n,r,o):n.isSpriteMaterial?function(t,e){let i;t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.alphaTest>0&&(t.alphaTest.value=e.alphaTest),e.map?i=e.map:e.alphaMap&&(i=e.alphaMap),void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix))}(t,n):n.isShadowMaterial?(t.color.value.copy(n.color),t.opacity.value=n.opacity):n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)}}}function Zo(t={}){const e=void 0!==t.canvas?t.canvas:function(){const t=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return t.style.display="block",t}(),i=void 0!==t.context?t.context:null,n=void 0!==t.alpha&&t.alpha,r=void 0===t.depth||t.depth,o=void 0===t.stencil||t.stencil,s=void 0!==t.antialias&&t.antialias,a=void 0===t.premultipliedAlpha||t.premultipliedAlpha,l=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,c=void 0!==t.powerPreference?t.powerPreference:"default",u=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat;let p=null,f=null;const m=[],g=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=X,this.physicallyCorrectLights=!1,this.toneMapping=0,this.toneMappingExposure=1;const y=this;let x=!1,b=0,E=0,S=null,T=-1,I=null;const C=new Et,P=new Et;let L=null,D=e.width,R=e.height,O=1,k=null,N=null;const B=new Et(0,0,D,R),z=new Et(0,0,D,R);let F=!1;const V=[],U=new sn;let G=!1,j=!1,H=null;const W=new se,q=new Ct,Z={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Y(){return null===S?O:1}let Q,J,K,$,tt,et,it,nt,rt,ot,st,at,lt,ct,ut,ht,pt,dt,ft,mt,gt,yt,vt,_t=i;function xt(t,i){for(let n=0;n<t.length;n++){const r=t[n],o=e.getContext(r,i);if(null!==o)return o}return null}try{const t={alpha:n,depth:r,stencil:o,antialias:s,premultipliedAlpha:a,preserveDrawingBuffer:l,powerPreference:c,failIfMajorPerformanceCaveat:u};if(e.addEventListener("webglcontextlost",At,!1),e.addEventListener("webglcontextrestored",Mt,!1),null===_t){const e=["webgl2","webgl","experimental-webgl"];if(!0===y.isWebGL1Renderer&&e.shift(),_t=xt(e,t),null===_t)throw xt(e)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===_t.getShaderPrecisionFormat&&(_t.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}function bt(){Q=new Wn(_t),J=new gn(_t,Q,t),Q.init(J),yt=new Uo(_t,Q,J),K=new Fo(_t,Q,J),V[0]=1029,$=new Zn,tt=new So,et=new Vo(_t,Q,K,tt,J,yt,$),it=new vn(y),nt=new Hn(y),rt=new ln(_t,J),vt=new fn(_t,Q,rt,J),ot=new qn(_t,rt,$,vt),st=new Kn(_t,ot,rt,$),ft=new Jn(_t),ht=new yn(tt),at=new Eo(y,it,nt,Q,J,vt,ht),lt=new Xo(tt),ct=new Co(tt),ut=new ko(Q,J),dt=new dn(y,it,K,st,a),pt=new zo(y,st,J),mt=new mn(_t,Q,$,J),gt=new Xn(_t,Q,$,J),$.programs=at.programs,y.capabilities=J,y.extensions=Q,y.properties=tt,y.renderLists=ct,y.shadowMap=pt,y.state=K,y.info=$}bt();const wt=new qo(y,_t);function At(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),x=!0}function Mt(){console.log("THREE.WebGLRenderer: Context Restored."),x=!1;const t=$.autoReset,e=pt.enabled,i=pt.autoUpdate,n=pt.needsUpdate,r=pt.type;bt(),$.autoReset=t,pt.enabled=e,pt.autoUpdate=i,pt.needsUpdate=n,pt.type=r}function It(t){const e=t.target;e.removeEventListener("dispose",It),function(t){(function(t){const e=tt.get(t).programs;void 0!==e&&e.forEach((function(t){at.releaseProgram(t)}))})(t),tt.remove(t)}(e)}this.xr=wt,this.getContext=function(){return _t},this.getContextAttributes=function(){return _t.getContextAttributes()},this.forceContextLoss=function(){const t=Q.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){const t=Q.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return O},this.setPixelRatio=function(t){void 0!==t&&(O=t,this.setSize(D,R,!1))},this.getSize=function(t){return t.set(D,R)},this.setSize=function(t,i,n){wt.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(D=t,R=i,e.width=Math.floor(t*O),e.height=Math.floor(i*O),!1!==n&&(e.style.width=t+"px",e.style.height=i+"px"),this.setViewport(0,0,t,i))},this.getDrawingBufferSize=function(t){return t.set(D*O,R*O).floor()},this.setDrawingBufferSize=function(t,i,n){D=t,R=i,O=n,e.width=Math.floor(t*n),e.height=Math.floor(i*n),this.setViewport(0,0,t,i)},this.getCurrentViewport=function(t){return t.copy(C)},this.getViewport=function(t){return t.copy(B)},this.setViewport=function(t,e,i,n){t.isVector4?B.set(t.x,t.y,t.z,t.w):B.set(t,e,i,n),K.viewport(C.copy(B).multiplyScalar(O).floor())},this.getScissor=function(t){return t.copy(z)},this.setScissor=function(t,e,i,n){t.isVector4?z.set(t.x,t.y,t.z,t.w):z.set(t,e,i,n),K.scissor(P.copy(z).multiplyScalar(O).floor())},this.getScissorTest=function(){return F},this.setScissorTest=function(t){K.setScissorTest(F=t)},this.setOpaqueSort=function(t){k=t},this.setTransparentSort=function(t){N=t},this.getClearColor=function(t){return t.copy(dt.getClearColor())},this.setClearColor=function(){dt.setClearColor.apply(dt,arguments)},this.getClearAlpha=function(){return dt.getClearAlpha()},this.setClearAlpha=function(){dt.setClearAlpha.apply(dt,arguments)},this.clear=function(t,e,i){let n=0;(void 0===t||t)&&(n|=16384),(void 0===e||e)&&(n|=256),(void 0===i||i)&&(n|=1024),_t.clear(n)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",At,!1),e.removeEventListener("webglcontextrestored",Mt,!1),ct.dispose(),ut.dispose(),tt.dispose(),it.dispose(),nt.dispose(),st.dispose(),vt.dispose(),wt.dispose(),wt.removeEventListener("sessionstart",Lt),wt.removeEventListener("sessionend",Dt),H&&(H.dispose(),H=null),Rt.stop()},this.renderBufferImmediate=function(t,e){vt.initAttributes();const i=tt.get(t);t.hasPositions&&!i.position&&(i.position=_t.createBuffer()),t.hasNormals&&!i.normal&&(i.normal=_t.createBuffer()),t.hasUvs&&!i.uv&&(i.uv=_t.createBuffer()),t.hasColors&&!i.color&&(i.color=_t.createBuffer());const n=e.getAttributes();t.hasPositions&&(_t.bindBuffer(34962,i.position),_t.bufferData(34962,t.positionArray,35048),vt.enableAttribute(n.position.location),_t.vertexAttribPointer(n.position.location,3,5126,!1,0,0)),t.hasNormals&&(_t.bindBuffer(34962,i.normal),_t.bufferData(34962,t.normalArray,35048),vt.enableAttribute(n.normal.location),_t.vertexAttribPointer(n.normal.location,3,5126,!1,0,0)),t.hasUvs&&(_t.bindBuffer(34962,i.uv),_t.bufferData(34962,t.uvArray,35048),vt.enableAttribute(n.uv.location),_t.vertexAttribPointer(n.uv.location,2,5126,!1,0,0)),t.hasColors&&(_t.bindBuffer(34962,i.color),_t.bufferData(34962,t.colorArray,35048),vt.enableAttribute(n.color.location),_t.vertexAttribPointer(n.color.location,3,5126,!1,0,0)),vt.disableUnusedAttributes(),_t.drawArrays(4,0,t.count),t.count=0},this.renderBufferDirect=function(t,e,i,n,r,o){null===e&&(e=Z);const s=r.isMesh&&r.matrixWorld.determinant()<0,a=Vt(t,e,n,r);K.setMaterial(n,s);let l=i.index;const c=i.attributes.position;if(null===l){if(void 0===c||0===c.count)return}else if(0===l.count)return;let u,h=1;!0===n.wireframe&&(l=ot.getWireframeAttribute(i),h=2),void 0===i.morphAttributes.position&&void 0===i.morphAttributes.normal||ft.update(r,i,n,a),vt.setup(r,n,a,i,l);let p=mt;null!==l&&(u=rt.get(l),p=gt,p.setIndex(u));const d=null!==l?l.count:c.count,f=i.drawRange.start*h,m=i.drawRange.count*h,g=null!==o?o.start*h:0,y=null!==o?o.count*h:1/0,v=Math.max(f,g),_=Math.min(d,f+m,g+y)-1,x=Math.max(0,_-v+1);if(0!==x){if(r.isMesh)!0===n.wireframe?(K.setLineWidth(n.wireframeLinewidth*Y()),p.setMode(1)):p.setMode(4);else if(r.isLine){let t=n.linewidth;void 0===t&&(t=1),K.setLineWidth(t*Y()),r.isLineSegments?p.setMode(1):r.isLineLoop?p.setMode(2):p.setMode(3)}else r.isPoints?p.setMode(0):r.isSprite&&p.setMode(4);if(r.isInstancedMesh)p.renderInstances(v,x,r.count);else if(i.isInstancedBufferGeometry){const t=Math.min(i.instanceCount,i._maxInstanceCount);p.renderInstances(v,x,t)}else p.render(v,x)}},this.compile=function(t,e){f=ut.get(t),f.init(),g.push(f),t.traverseVisible((function(t){t.isLight&&t.layers.test(e.layers)&&(f.pushLight(t),t.castShadow&&f.pushShadow(t))})),f.setupLights(y.physicallyCorrectLights),t.traverse((function(e){const i=e.material;if(i)if(Array.isArray(i))for(let n=0;n<i.length;n++)zt(i[n],t,e);else zt(i,t,e)})),g.pop(),f=null};let Pt=null;function Lt(){Rt.stop()}function Dt(){Rt.start()}const Rt=new an;function Ot(t,e,i,n){if(!1===t.visible)return;if(t.layers.test(e.layers))if(t.isGroup)i=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)f.pushLight(t),t.castShadow&&f.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||U.intersectsSprite(t)){n&&q.setFromMatrixPosition(t.matrixWorld).applyMatrix4(W);const e=st.update(t),r=t.material;r.visible&&p.push(t,e,r,i,q.z,null)}}else if(t.isImmediateRenderObject)n&&q.setFromMatrixPosition(t.matrixWorld).applyMatrix4(W),p.push(t,null,t.material,i,q.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.frame!==$.render.frame&&(t.skeleton.update(),t.skeleton.frame=$.render.frame),!t.frustumCulled||U.intersectsObject(t))){n&&q.setFromMatrixPosition(t.matrixWorld).applyMatrix4(W);const e=st.update(t),r=t.material;if(Array.isArray(r)){const n=e.groups;for(let o=0,s=n.length;o<s;o++){const s=n[o],a=r[s.materialIndex];a&&a.visible&&p.push(t,e,a,i,q.z,s)}}else r.visible&&p.push(t,e,r,i,q.z,null)}const r=t.children;for(let t=0,o=r.length;t<o;t++)Ot(r[t],e,i,n)}function kt(t,e,i,n){const r=t.opaque,o=t.transmissive,a=t.transparent;f.setupLightsView(i),o.length>0&&function(t,e,i){if(null===H){const t=!0===s&&!0===J.isWebGL2;H=new(t?Tt:St)(1024,1024,{generateMipmaps:!0,type:null!==yt.convert(A)?A:_,minFilter:v,magFilter:d,wrapS:h,wrapT:h})}const n=y.getRenderTarget();y.setRenderTarget(H),y.clear();const r=y.toneMapping;y.toneMapping=0,Nt(t,e,i),y.toneMapping=r,et.updateMultisampleRenderTarget(H),et.updateRenderTargetMipmap(H),y.setRenderTarget(n)}(r,e,i),n&&K.viewport(C.copy(n)),r.length>0&&Nt(r,e,i),o.length>0&&Nt(o,e,i),a.length>0&&Nt(a,e,i)}function Nt(t,e,i){const n=!0===e.isScene?e.overrideMaterial:null;for(let r=0,o=t.length;r<o;r++){const o=t[r],s=o.object,a=o.geometry,l=null===n?o.material:n,c=o.group;s.layers.test(i.layers)&&Bt(s,e,i,a,l,c)}}function Bt(t,e,i,n,r,o){if(t.onBeforeRender(y,e,i,n,r,o),t.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject){const n=Vt(i,e,r,t);K.setMaterial(r),vt.reset(),function(t,e){t.render((function(t){y.renderBufferImmediate(t,e)}))}(t,n)}else!0===r.transparent&&2===r.side?(r.side=1,r.needsUpdate=!0,y.renderBufferDirect(i,e,n,r,t,o),r.side=0,r.needsUpdate=!0,y.renderBufferDirect(i,e,n,r,t,o),r.side=2):y.renderBufferDirect(i,e,n,r,t,o);t.onAfterRender(y,e,i,n,r,o)}function zt(t,e,i){!0!==e.isScene&&(e=Z);const n=tt.get(t),r=f.state.lights,o=f.state.shadowsArray,s=r.state.version,a=at.getParameters(t,r.state,o,e,i),l=at.getProgramCacheKey(a);let c=n.programs;n.environment=t.isMeshStandardMaterial?e.environment:null,n.fog=e.fog,n.envMap=(t.isMeshStandardMaterial?nt:it).get(t.envMap||n.environment),void 0===c&&(t.addEventListener("dispose",It),c=new Map,n.programs=c);let u=c.get(l);if(void 0!==u){if(n.currentProgram===u&&n.lightsStateVersion===s)return Ft(t,a),u}else a.uniforms=at.getUniforms(t),t.onBuild(a,y),t.onBeforeCompile(a,y),u=at.acquireProgram(a,l),c.set(l,u),n.uniforms=a.uniforms;const h=n.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(h.clippingPlanes=ht.uniform),Ft(t,a),n.needsLights=function(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}(t),n.lightsStateVersion=s,n.needsLights&&(h.ambientLightColor.value=r.state.ambient,h.lightProbe.value=r.state.probe,h.directionalLights.value=r.state.directional,h.directionalLightShadows.value=r.state.directionalShadow,h.spotLights.value=r.state.spot,h.spotLightShadows.value=r.state.spotShadow,h.rectAreaLights.value=r.state.rectArea,h.ltc_1.value=r.state.rectAreaLTC1,h.ltc_2.value=r.state.rectAreaLTC2,h.pointLights.value=r.state.point,h.pointLightShadows.value=r.state.pointShadow,h.hemisphereLights.value=r.state.hemi,h.directionalShadowMap.value=r.state.directionalShadowMap,h.directionalShadowMatrix.value=r.state.directionalShadowMatrix,h.spotShadowMap.value=r.state.spotShadowMap,h.spotShadowMatrix.value=r.state.spotShadowMatrix,h.pointShadowMap.value=r.state.pointShadowMap,h.pointShadowMatrix.value=r.state.pointShadowMatrix);const p=u.getUniforms(),d=io.seqWithValue(p.seq,h);return n.currentProgram=u,n.uniformsList=d,u}function Ft(t,e){const i=tt.get(t);i.outputEncoding=e.outputEncoding,i.instancing=e.instancing,i.skinning=e.skinning,i.morphTargets=e.morphTargets,i.morphNormals=e.morphNormals,i.numClippingPlanes=e.numClippingPlanes,i.numIntersection=e.numClipIntersection,i.vertexAlphas=e.vertexAlphas,i.vertexTangents=e.vertexTangents}function Vt(t,e,i,n){!0!==e.isScene&&(e=Z),et.resetTextureUnits();const r=e.fog,o=i.isMeshStandardMaterial?e.environment:null,s=null===S?y.outputEncoding:S.texture.encoding,a=(i.isMeshStandardMaterial?nt:it).get(i.envMap||o),l=!0===i.vertexColors&&!!n.geometry&&!!n.geometry.attributes.color&&4===n.geometry.attributes.color.itemSize,c=!!n.geometry&&!!n.geometry.attributes.tangent,u=!!n.geometry&&!!n.geometry.morphAttributes.position,h=!!n.geometry&&!!n.geometry.morphAttributes.normal,p=tt.get(i),d=f.state.lights;if(!0===G&&(!0===j||t!==I)){const e=t===I&&i.id===T;ht.setState(i,t,e)}let m=!1;i.version===p.__version?p.needsLights&&p.lightsStateVersion!==d.state.version||p.outputEncoding!==s||n.isInstancedMesh&&!1===p.instancing?m=!0:n.isInstancedMesh||!0!==p.instancing?n.isSkinnedMesh&&!1===p.skinning?m=!0:n.isSkinnedMesh||!0!==p.skinning?p.envMap!==a||i.fog&&p.fog!==r?m=!0:void 0===p.numClippingPlanes||p.numClippingPlanes===ht.numPlanes&&p.numIntersection===ht.numIntersection?(p.vertexAlphas!==l||p.vertexTangents!==c||p.morphTargets!==u||p.morphNormals!==h)&&(m=!0):m=!0:m=!0:m=!0:(m=!0,p.__version=i.version);let g=p.currentProgram;!0===m&&(g=zt(i,e,n));let v=!1,_=!1,x=!1;const b=g.getUniforms(),w=p.uniforms;if(K.useProgram(g.program)&&(v=!0,_=!0,x=!0),i.id!==T&&(T=i.id,_=!0),v||I!==t){if(b.setValue(_t,"projectionMatrix",t.projectionMatrix),J.logarithmicDepthBuffer&&b.setValue(_t,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),I!==t&&(I=t,_=!0,x=!0),i.isShaderMaterial||i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshStandardMaterial||i.envMap){const e=b.map.cameraPosition;void 0!==e&&e.setValue(_t,q.setFromMatrixPosition(t.matrixWorld))}(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial)&&b.setValue(_t,"isOrthographic",!0===t.isOrthographicCamera),(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial||i.isShadowMaterial||n.isSkinnedMesh)&&b.setValue(_t,"viewMatrix",t.matrixWorldInverse)}if(n.isSkinnedMesh){b.setOptional(_t,n,"bindMatrix"),b.setOptional(_t,n,"bindMatrixInverse");const t=n.skeleton;t&&(J.floatVertexTextures?(null===t.boneTexture&&t.computeBoneTexture(),b.setValue(_t,"boneTexture",t.boneTexture,et),b.setValue(_t,"boneTextureSize",t.boneTextureSize)):b.setOptional(_t,t,"boneMatrices"))}var A,E;return(_||p.receiveShadow!==n.receiveShadow)&&(p.receiveShadow=n.receiveShadow,b.setValue(_t,"receiveShadow",n.receiveShadow)),_&&(b.setValue(_t,"toneMappingExposure",y.toneMappingExposure),p.needsLights&&(E=x,(A=w).ambientLightColor.needsUpdate=E,A.lightProbe.needsUpdate=E,A.directionalLights.needsUpdate=E,A.directionalLightShadows.needsUpdate=E,A.pointLights.needsUpdate=E,A.pointLightShadows.needsUpdate=E,A.spotLights.needsUpdate=E,A.spotLightShadows.needsUpdate=E,A.rectAreaLights.needsUpdate=E,A.hemisphereLights.needsUpdate=E),r&&i.fog&<.refreshFogUniforms(w,r),lt.refreshMaterialUniforms(w,i,O,R,H),io.upload(_t,p.uniformsList,w,et)),i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(io.upload(_t,p.uniformsList,w,et),i.uniformsNeedUpdate=!1),i.isSpriteMaterial&&b.setValue(_t,"center",n.center),b.setValue(_t,"modelViewMatrix",n.modelViewMatrix),b.setValue(_t,"normalMatrix",n.normalMatrix),b.setValue(_t,"modelMatrix",n.matrixWorld),g}Rt.setAnimationLoop((function(t){Pt&&Pt(t)})),"undefined"!=typeof window&&Rt.setContext(window),this.setAnimationLoop=function(t){Pt=t,wt.setAnimationLoop(t),null===t?Rt.stop():Rt.start()},wt.addEventListener("sessionstart",Lt),wt.addEventListener("sessionend",Dt),this.render=function(t,e){if(void 0!==e&&!0!==e.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===x)return;!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),!0===wt.enabled&&!0===wt.isPresenting&&(!0===wt.cameraAutoUpdate&&wt.updateCamera(e),e=wt.getCamera()),!0===t.isScene&&t.onBeforeRender(y,t,e,S),f=ut.get(t,g.length),f.init(),g.push(f),W.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),U.setFromProjectionMatrix(W),j=this.localClippingEnabled,G=ht.init(this.clippingPlanes,j,e),p=ct.get(t,m.length),p.init(),m.push(p),Ot(t,e,0,y.sortObjects),p.finish(),!0===y.sortObjects&&p.sort(k,N),!0===G&&ht.beginShadows();const i=f.state.shadowsArray;if(pt.render(i,t,e),!0===G&&ht.endShadows(),!0===this.info.autoReset&&this.info.reset(),dt.render(p,t),f.setupLights(y.physicallyCorrectLights),e.isArrayCamera){const i=e.cameras;for(let e=0,n=i.length;e<n;e++){const n=i[e];kt(p,t,n,n.viewport)}}else kt(p,t,e);null!==S&&(et.updateMultisampleRenderTarget(S),et.updateRenderTargetMipmap(S)),!0===t.isScene&&t.onAfterRender(y,t,e),K.buffers.depth.setTest(!0),K.buffers.depth.setMask(!0),K.buffers.color.setMask(!0),K.setPolygonOffset(!1),vt.resetDefaultState(),T=-1,I=null,g.pop(),f=g.length>0?g[g.length-1]:null,m.pop(),p=m.length>0?m[m.length-1]:null},this.getActiveCubeFace=function(){return b},this.getActiveMipmapLevel=function(){return E},this.getRenderTarget=function(){return S},this.setRenderTarget=function(t,e=0,i=0){S=t,b=e,E=i,t&&void 0===tt.get(t).__webglFramebuffer&&et.setupRenderTarget(t);let n=null,r=!1,o=!1;if(t){const i=t.texture;(i.isDataTexture3D||i.isDataTexture2DArray)&&(o=!0);const s=tt.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(n=s[e],r=!0):n=t.isWebGLMultisampleRenderTarget?tt.get(t).__webglMultisampledFramebuffer:s,C.copy(t.viewport),P.copy(t.scissor),L=t.scissorTest}else C.copy(B).multiplyScalar(O).floor(),P.copy(z).multiplyScalar(O).floor(),L=F;if(K.bindFramebuffer(36160,n)&&J.drawBuffers){let e=!1;if(t)if(t.isWebGLMultipleRenderTargets){const i=t.texture;if(V.length!==i.length||36064!==V[0]){for(let t=0,e=i.length;t<e;t++)V[t]=36064+t;V.length=i.length,e=!0}}else 1===V.length&&36064===V[0]||(V[0]=36064,V.length=1,e=!0);else 1===V.length&&1029===V[0]||(V[0]=1029,V.length=1,e=!0);e&&(J.isWebGL2?_t.drawBuffers(V):Q.get("WEBGL_draw_buffers").drawBuffersWEBGL(V))}if(K.viewport(C),K.scissor(P),K.setScissorTest(L),r){const n=tt.get(t.texture);_t.framebufferTexture2D(36160,36064,34069+e,n.__webglTexture,i)}else if(o){const n=tt.get(t.texture),r=e||0;_t.framebufferTextureLayer(36160,36064,n.__webglTexture,i||0,r)}T=-1},this.readRenderTargetPixels=function(t,e,i,n,r,o,s){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let a=tt.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==s&&(a=a[s]),a){K.bindFramebuffer(36160,a);try{const s=t.texture,a=s.format,l=s.type;if(a!==M&&yt.convert(a)!==_t.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const c=l===A&&(Q.has("EXT_color_buffer_half_float")||J.isWebGL2&&Q.has("EXT_color_buffer_float"));if(!(l===_||yt.convert(l)===_t.getParameter(35738)||l===w&&(J.isWebGL2||Q.has("OES_texture_float")||Q.has("WEBGL_color_buffer_float"))||c))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===_t.checkFramebufferStatus(36160)?e>=0&&e<=t.width-n&&i>=0&&i<=t.height-r&&_t.readPixels(e,i,n,r,yt.convert(a),yt.convert(l),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const t=null!==S?tt.get(S).__webglFramebuffer:null;K.bindFramebuffer(36160,t)}}},this.copyFramebufferToTexture=function(t,e,i=0){const n=Math.pow(2,-i),r=Math.floor(e.image.width*n),o=Math.floor(e.image.height*n);let s=yt.convert(e.format);J.isWebGL2&&(6407===s&&(s=32849),6408===s&&(s=32856)),et.setTexture2D(e,0),_t.copyTexImage2D(3553,i,s,t.x,t.y,r,o,0),K.unbindTexture()},this.copyTextureToTexture=function(t,e,i,n=0){const r=e.image.width,o=e.image.height,s=yt.convert(i.format),a=yt.convert(i.type);et.setTexture2D(i,0),_t.pixelStorei(37440,i.flipY),_t.pixelStorei(37441,i.premultiplyAlpha),_t.pixelStorei(3317,i.unpackAlignment),e.isDataTexture?_t.texSubImage2D(3553,n,t.x,t.y,r,o,s,a,e.image.data):e.isCompressedTexture?_t.compressedTexSubImage2D(3553,n,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,s,e.mipmaps[0].data):_t.texSubImage2D(3553,n,t.x,t.y,s,a,e.image),0===n&&i.generateMipmaps&&_t.generateMipmap(3553),K.unbindTexture()},this.copyTextureToTexture3D=function(t,e,i,n,r=0){if(y.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const o=t.max.x-t.min.x+1,s=t.max.y-t.min.y+1,a=t.max.z-t.min.z+1,l=yt.convert(n.format),c=yt.convert(n.type);let u;if(n.isDataTexture3D)et.setTexture3D(n,0),u=32879;else{if(!n.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");et.setTexture2DArray(n,0),u=35866}_t.pixelStorei(37440,n.flipY),_t.pixelStorei(37441,n.premultiplyAlpha),_t.pixelStorei(3317,n.unpackAlignment);const h=_t.getParameter(3314),p=_t.getParameter(32878),d=_t.getParameter(3316),f=_t.getParameter(3315),m=_t.getParameter(32877),g=i.isCompressedTexture?i.mipmaps[0]:i.image;_t.pixelStorei(3314,g.width),_t.pixelStorei(32878,g.height),_t.pixelStorei(3316,t.min.x),_t.pixelStorei(3315,t.min.y),_t.pixelStorei(32877,t.min.z),i.isDataTexture||i.isDataTexture3D?_t.texSubImage3D(u,r,e.x,e.y,e.z,o,s,a,l,c,g.data):i.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),_t.compressedTexSubImage3D(u,r,e.x,e.y,e.z,o,s,a,l,g.data)):_t.texSubImage3D(u,r,e.x,e.y,e.z,o,s,a,l,c,g),_t.pixelStorei(3314,h),_t.pixelStorei(32878,p),_t.pixelStorei(3316,d),_t.pixelStorei(3315,f),_t.pixelStorei(32877,m),0===r&&n.generateMipmaps&&_t.generateMipmap(u),K.unbindTexture()},this.initTexture=function(t){et.setTexture2D(t,0),K.unbindTexture()},this.resetState=function(){b=0,E=0,S=null,K.reset(),vt.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class Yo extends Zo{}Yo.prototype.isWebGL1Renderer=!0;class Qo{constructor(t,e=25e-5){this.name="",this.color=new Je(t),this.density=e}clone(){return new Qo(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}Qo.prototype.isFogExp2=!0;class Jo{constructor(t,e=1,i=1e3){this.name="",this.color=new Je(t),this.near=e,this.far=i}clone(){return new Jo(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}Jo.prototype.isFog=!0;class Ko extends Le{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),e}}Ko.prototype.isScene=!0;class $o{constructor(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=et,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=ct()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,i){t*=this.stride,i*=e.stride;for(let n=0,r=this.stride;n<r;n++)this.array[t+n]=e.array[i+n];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=ct()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(e,this.stride);return i.setUsage(this.usage),i}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=ct()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}$o.prototype.isInterleavedBuffer=!0;const ts=new Ct;class es{constructor(t,e,i,n=!1){this.name="",this.data=t,this.itemSize=e,this.offset=i,this.normalized=!0===n}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,i=this.data.count;e<i;e++)ts.x=this.getX(e),ts.y=this.getY(e),ts.z=this.getZ(e),ts.applyMatrix4(t),this.setXYZ(e,ts.x,ts.y,ts.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)ts.x=this.getX(e),ts.y=this.getY(e),ts.z=this.getZ(e),ts.applyNormalMatrix(t),this.setXYZ(e,ts.x,ts.y,ts.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)ts.x=this.getX(e),ts.y=this.getY(e),ts.z=this.getZ(e),ts.transformDirection(t),this.setXYZ(e,ts.x,ts.y,ts.z);return this}setX(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){return this.data.array[t*this.data.stride+this.offset]}getY(t){return this.data.array[t*this.data.stride+this.offset+1]}getZ(t){return this.data.array[t*this.data.stride+this.offset+2]}getW(t){return this.data.array[t*this.data.stride+this.offset+3]}setXY(t,e,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this}setXYZ(t,e,i,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=n,this}setXYZW(t,e,i,n,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=n,this.data.array[t+3]=r,this}clone(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const i=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[i+e])}return new ei(new this.array.constructor(t),this.itemSize,this.normalized)}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new es(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const i=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[i+e])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}es.prototype.isInterleavedBufferAttribute=!0;class is extends He{constructor(t){super(),this.type="SpriteMaterial",this.color=new Je(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this}}let ns;is.prototype.isSpriteMaterial=!0;const rs=new Ct,os=new Ct,ss=new Ct,as=new yt,ls=new yt,cs=new se,us=new Ct,hs=new Ct,ps=new Ct,ds=new yt,fs=new yt,ms=new yt;class gs extends Le{constructor(t){if(super(),this.type="Sprite",void 0===ns){ns=new wi;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),e=new $o(t,5);ns.setIndex([0,1,2,0,2,3]),ns.setAttribute("position",new es(e,3,0,!1)),ns.setAttribute("uv",new es(e,2,3,!1))}this.geometry=ns,this.material=void 0!==t?t:new is,this.center=new yt(.5,.5)}raycast(t,e){null===t.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),os.setFromMatrixScale(this.matrixWorld),cs.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),ss.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&os.multiplyScalar(-ss.z);const i=this.material.rotation;let n,r;0!==i&&(r=Math.cos(i),n=Math.sin(i));const o=this.center;ys(us.set(-.5,-.5,0),ss,o,os,n,r),ys(hs.set(.5,-.5,0),ss,o,os,n,r),ys(ps.set(.5,.5,0),ss,o,os,n,r),ds.set(0,0),fs.set(1,0),ms.set(1,1);let s=t.ray.intersectTriangle(us,hs,ps,!1,rs);if(null===s&&(ys(hs.set(-.5,.5,0),ss,o,os,n,r),fs.set(0,1),s=t.ray.intersectTriangle(us,ps,hs,!1,rs),null===s))return;const a=t.ray.origin.distanceTo(rs);a<t.near||a>t.far||e.push({distance:a,point:rs.clone(),uv:Ge.getUV(rs,us,hs,ps,ds,fs,ms,new yt),face:null,object:this})}copy(t){return super.copy(t),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}}function ys(t,e,i,n,r,o){as.subVectors(t,i).addScalar(.5).multiply(n),void 0!==r?(ls.x=o*as.x-r*as.y,ls.y=r*as.x+o*as.y):ls.copy(as),t.copy(e),t.x+=ls.x,t.y+=ls.y,t.applyMatrix4(cs)}gs.prototype.isSprite=!0;const vs=new Ct,_s=new Ct;class xs extends Le{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);const e=t.levels;for(let t=0,i=e.length;t<i;t++){const i=e[t];this.addLevel(i.object.clone(),i.distance)}return this.autoUpdate=t.autoUpdate,this}addLevel(t,e=0){e=Math.abs(e);const i=this.levels;let n;for(n=0;n<i.length&&!(e<i[n].distance);n++);return i.splice(n,0,{distance:e,object:t}),this.add(t),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(t){const e=this.levels;if(e.length>0){let i,n;for(i=1,n=e.length;i<n&&!(t<e[i].distance);i++);return e[i-1].object}return null}raycast(t,e){if(this.levels.length>0){vs.setFromMatrixPosition(this.matrixWorld);const i=t.ray.origin.distanceTo(vs);this.getObjectForDistance(i).raycast(t,e)}}update(t){const e=this.levels;if(e.length>1){vs.setFromMatrixPosition(t.matrixWorld),_s.setFromMatrixPosition(this.matrixWorld);const i=vs.distanceTo(_s)/t.zoom;let n,r;for(e[0].object.visible=!0,n=1,r=e.length;n<r&&i>=e[n].distance;n++)e[n-1].object.visible=!1,e[n].object.visible=!0;for(this._currentLevel=n-1;n<r;n++)e[n].object.visible=!1}}toJSON(t){const e=super.toJSON(t);!1===this.autoUpdate&&(e.object.autoUpdate=!1),e.object.levels=[];const i=this.levels;for(let t=0,n=i.length;t<n;t++){const n=i[t];e.object.levels.push({object:n.object.uuid,distance:n.distance})}return e}}const bs=new Ct,ws=new Et,As=new Et,Es=new Ct,Ss=new se;class Ms extends Vi{constructor(t,e){super(t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new se,this.bindMatrixInverse=new se}copy(t){return super.copy(t),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,this}bind(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.copy(e).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const t=new Et,e=this.geometry.attributes.skinWeight;for(let i=0,n=e.count;i<n;i++){t.x=e.getX(i),t.y=e.getY(i),t.z=e.getZ(i),t.w=e.getW(i);const n=1/t.manhattanLength();n!==1/0?t.multiplyScalar(n):t.set(1,0,0,0),e.setXYZW(i,t.x,t.y,t.z,t.w)}}updateMatrixWorld(t){super.updateMatrixWorld(t),"attached"===this.bindMode?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(t,e){const i=this.skeleton,n=this.geometry;ws.fromBufferAttribute(n.attributes.skinIndex,t),As.fromBufferAttribute(n.attributes.skinWeight,t),bs.fromBufferAttribute(n.attributes.position,t).applyMatrix4(this.bindMatrix),e.set(0,0,0);for(let t=0;t<4;t++){const n=As.getComponent(t);if(0!==n){const r=ws.getComponent(t);Ss.multiplyMatrices(i.bones[r].matrixWorld,i.boneInverses[r]),e.addScaledVector(Es.copy(bs).applyMatrix4(Ss),n)}}return e.applyMatrix4(this.bindMatrixInverse)}}Ms.prototype.isSkinnedMesh=!0;class Ts extends Le{constructor(){super(),this.type="Bone"}}Ts.prototype.isBone=!0;class Is extends wt{constructor(t=null,e=1,i=1,n,r,o,s,a,l=1003,c=1003,u,h){super(null,o,s,a,l,c,n,r,u,h),this.image={data:t,width:e,height:i},this.magFilter=l,this.minFilter=c,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}Is.prototype.isDataTexture=!0;const Cs=new se,Ps=new se;class Ls{constructor(t=[],e=[]){this.uuid=ct(),this.bones=t.slice(0),this.boneInverses=e,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){const t=this.bones,e=this.boneInverses;if(this.boneMatrices=new Float32Array(16*t.length),0===e.length)this.calculateInverses();else if(t.length!==e.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let t=0,e=this.bones.length;t<e;t++)this.boneInverses.push(new se)}}calculateInverses(){this.boneInverses.length=0;for(let t=0,e=this.bones.length;t<e;t++){const e=new se;this.bones[t]&&e.copy(this.bones[t].matrixWorld).invert(),this.boneInverses.push(e)}}pose(){for(let t=0,e=this.bones.length;t<e;t++){const e=this.bones[t];e&&e.matrixWorld.copy(this.boneInverses[t]).invert()}for(let t=0,e=this.bones.length;t<e;t++){const e=this.bones[t];e&&(e.parent&&e.parent.isBone?(e.matrix.copy(e.parent.matrixWorld).invert(),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))}}update(){const t=this.bones,e=this.boneInverses,i=this.boneMatrices,n=this.boneTexture;for(let n=0,r=t.length;n<r;n++){const r=t[n]?t[n].matrixWorld:Ps;Cs.multiplyMatrices(r,e[n]),Cs.toArray(i,16*n)}null!==n&&(n.needsUpdate=!0)}clone(){return new Ls(this.bones,this.boneInverses)}computeBoneTexture(){let t=Math.sqrt(4*this.bones.length);t=ft(t),t=Math.max(t,4);const e=new Float32Array(t*t*4);e.set(this.boneMatrices);const i=new Is(e,t,t,M,w);return this.boneMatrices=e,this.boneTexture=i,this.boneTextureSize=t,this}getBoneByName(t){for(let e=0,i=this.bones.length;e<i;e++){const i=this.bones[e];if(i.name===t)return i}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(t,e){this.uuid=t.uuid;for(let i=0,n=t.bones.length;i<n;i++){const n=t.bones[i];let r=e[n];void 0===r&&(console.warn("THREE.Skeleton: No bone found with UUID:",n),r=new Ts),this.bones.push(r),this.boneInverses.push((new se).fromArray(t.boneInverses[i]))}return this.init(),this}toJSON(){const t={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};t.uuid=this.uuid;const e=this.bones,i=this.boneInverses;for(let n=0,r=e.length;n<r;n++){const r=e[n];t.bones.push(r.uuid);const o=i[n];t.boneInverses.push(o.toArray())}return t}}class Ds extends ei{constructor(t,e,i,n=1){"number"==typeof i&&(n=i,i=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(t,e,i),this.meshPerAttribute=n}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){const t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}Ds.prototype.isInstancedBufferAttribute=!0;const Rs=new se,Os=new se,ks=[],Ns=new Vi;class Bs extends Vi{constructor(t,e,i){super(t,e),this.instanceMatrix=new Ds(new Float32Array(16*i),16),this.instanceColor=null,this.count=i,this.frustumCulled=!1}copy(t){return super.copy(t),this.instanceMatrix.copy(t.instanceMatrix),null!==t.instanceColor&&(this.instanceColor=t.instanceColor.clone()),this.count=t.count,this}getColorAt(t,e){e.fromArray(this.instanceColor.array,3*t)}getMatrixAt(t,e){e.fromArray(this.instanceMatrix.array,16*t)}raycast(t,e){const i=this.matrixWorld,n=this.count;if(Ns.geometry=this.geometry,Ns.material=this.material,void 0!==Ns.material)for(let r=0;r<n;r++){this.getMatrixAt(r,Rs),Os.multiplyMatrices(i,Rs),Ns.matrixWorld=Os,Ns.raycast(t,ks);for(let t=0,i=ks.length;t<i;t++){const i=ks[t];i.instanceId=r,i.object=this,e.push(i)}ks.length=0}}setColorAt(t,e){null===this.instanceColor&&(this.instanceColor=new Ds(new Float32Array(3*this.instanceMatrix.count),3)),e.toArray(this.instanceColor.array,3*t)}setMatrixAt(t,e){e.toArray(this.instanceMatrix.array,16*t)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}Bs.prototype.isInstancedMesh=!0;class zs extends He{constructor(t){super(),this.type="LineBasicMaterial",this.color=new Je(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this}}zs.prototype.isLineBasicMaterial=!0;const Fs=new Ct,Vs=new Ct,Us=new se,Gs=new oe,js=new Jt;class Hs extends Le{constructor(t=new wi,e=new zs){super(),this.type="Line",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t){return super.copy(t),this.material=t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(t.isBufferGeometry)if(null===t.index){const e=t.attributes.position,i=[0];for(let t=1,n=e.count;t<n;t++)Fs.fromBufferAttribute(e,t-1),Vs.fromBufferAttribute(e,t),i[t]=i[t-1],i[t]+=Fs.distanceTo(Vs);t.setAttribute("lineDistance",new ui(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else t.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}raycast(t,e){const i=this.geometry,n=this.matrixWorld,r=t.params.Line.threshold,o=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),js.copy(i.boundingSphere),js.applyMatrix4(n),js.radius+=r,!1===t.ray.intersectsSphere(js))return;Us.copy(n).invert(),Gs.copy(t.ray).applyMatrix4(Us);const s=r/((this.scale.x+this.scale.y+this.scale.z)/3),a=s*s,l=new Ct,c=new Ct,u=new Ct,h=new Ct,p=this.isLineSegments?2:1;if(i.isBufferGeometry){const n=i.index,r=i.attributes.position;if(null!==n)for(let i=Math.max(0,o.start),s=Math.min(n.count,o.start+o.count)-1;i<s;i+=p){const o=n.getX(i),s=n.getX(i+1);if(l.fromBufferAttribute(r,o),c.fromBufferAttribute(r,s),Gs.distanceSqToSegment(l,c,h,u)>a)continue;h.applyMatrix4(this.matrixWorld);const p=t.ray.origin.distanceTo(h);p<t.near||p>t.far||e.push({distance:p,point:u.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}else for(let i=Math.max(0,o.start),n=Math.min(r.count,o.start+o.count)-1;i<n;i+=p){if(l.fromBufferAttribute(r,i),c.fromBufferAttribute(r,i+1),Gs.distanceSqToSegment(l,c,h,u)>a)continue;h.applyMatrix4(this.matrixWorld);const n=t.ray.origin.distanceTo(h);n<t.near||n>t.far||e.push({distance:n,point:u.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}else i.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,i=Object.keys(e);if(i.length>0){const t=e[i[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,i=t.length;e<i;e++){const i=t[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=e}}}}else{const e=t.morphTargets;void 0!==e&&e.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}Hs.prototype.isLine=!0;const Ws=new Ct,qs=new Ct;class Xs extends Hs{constructor(t,e){super(t,e),this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.isBufferGeometry)if(null===t.index){const e=t.attributes.position,i=[];for(let t=0,n=e.count;t<n;t+=2)Ws.fromBufferAttribute(e,t),qs.fromBufferAttribute(e,t+1),i[t]=0===t?0:i[t-1],i[t+1]=i[t]+Ws.distanceTo(qs);t.setAttribute("lineDistance",new ui(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else t.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}Xs.prototype.isLineSegments=!0;class Zs extends Hs{constructor(t,e){super(t,e),this.type="LineLoop"}}Zs.prototype.isLineLoop=!0;class Ys extends He{constructor(t){super(),this.type="PointsMaterial",this.color=new Je(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this}}Ys.prototype.isPointsMaterial=!0;const Qs=new se,Js=new oe,Ks=new Jt,$s=new Ct;class ta extends Le{constructor(t=new wi,e=new Ys){super(),this.type="Points",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t){return super.copy(t),this.material=t.material,this.geometry=t.geometry,this}raycast(t,e){const i=this.geometry,n=this.matrixWorld,r=t.params.Points.threshold,o=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),Ks.copy(i.boundingSphere),Ks.applyMatrix4(n),Ks.radius+=r,!1===t.ray.intersectsSphere(Ks))return;Qs.copy(n).invert(),Js.copy(t.ray).applyMatrix4(Qs);const s=r/((this.scale.x+this.scale.y+this.scale.z)/3),a=s*s;if(i.isBufferGeometry){const r=i.index,s=i.attributes.position;if(null!==r)for(let i=Math.max(0,o.start),l=Math.min(r.count,o.start+o.count);i<l;i++){const o=r.getX(i);$s.fromBufferAttribute(s,o),ea($s,o,a,n,t,e,this)}else for(let i=Math.max(0,o.start),r=Math.min(s.count,o.start+o.count);i<r;i++)$s.fromBufferAttribute(s,i),ea($s,i,a,n,t,e,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,i=Object.keys(e);if(i.length>0){const t=e[i[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,i=t.length;e<i;e++){const i=t[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=e}}}}else{const e=t.morphTargets;void 0!==e&&e.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function ea(t,e,i,n,r,o,s){const a=Js.distanceSqToPoint(t);if(a<i){const i=new Ct;Js.closestPointToPoint(t,i),i.applyMatrix4(n);const l=r.ray.origin.distanceTo(i);if(l<r.near||l>r.far)return;o.push({distance:l,distanceToRay:Math.sqrt(a),point:i,index:e,face:null,object:s})}}ta.prototype.isPoints=!0;class ia extends wt{constructor(t,e,i,n,r,o,s,a,l){super(t,e,i,n,r,o,s,a,l),this.format=void 0!==s?s:S,this.minFilter=void 0!==o?o:g,this.magFilter=void 0!==r?r:g,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback((function e(){c.needsUpdate=!0,t.requestVideoFrameCallback(e)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const t=this.image;0=="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}ia.prototype.isVideoTexture=!0;class na extends wt{constructor(t,e,i,n,r,o,s,a,l,c,u,h){super(null,o,s,a,l,c,n,r,u,h),this.image={width:e,height:i},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}na.prototype.isCompressedTexture=!0;class ra extends wt{constructor(t,e,i,n,r,o,s,a,l){super(t,e,i,n,r,o,s,a,l),this.needsUpdate=!0}}ra.prototype.isCanvasTexture=!0;class oa extends wt{constructor(t,e,i,n,r,o,s,a,l,c){if((c=void 0!==c?c:T)!==T&&c!==I)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===i&&c===T&&(i=x),void 0===i&&c===I&&(i=E),super(null,n,r,o,s,a,c,i,l),this.image={width:t,height:e},this.magFilter=void 0!==s?s:d,this.minFilter=void 0!==a?a:d,this.flipY=!1,this.generateMipmaps=!1}}oa.prototype.isDepthTexture=!0;class sa extends wi{constructor(t=1,e=8,i=0,n=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:i,thetaLength:n},e=Math.max(3,e);const r=[],o=[],s=[],a=[],l=new Ct,c=new yt;o.push(0,0,0),s.push(0,0,1),a.push(.5,.5);for(let r=0,u=3;r<=e;r++,u+=3){const h=i+r/e*n;l.x=t*Math.cos(h),l.y=t*Math.sin(h),o.push(l.x,l.y,l.z),s.push(0,0,1),c.x=(o[u]/t+1)/2,c.y=(o[u+1]/t+1)/2,a.push(c.x,c.y)}for(let t=1;t<=e;t++)r.push(t,t+1,0);this.setIndex(r),this.setAttribute("position",new ui(o,3)),this.setAttribute("normal",new ui(s,3)),this.setAttribute("uv",new ui(a,2))}static fromJSON(t){return new sa(t.radius,t.segments,t.thetaStart,t.thetaLength)}}class aa extends wi{constructor(t=1,e=1,i=1,n=8,r=1,o=!1,s=0,a=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:i,radialSegments:n,heightSegments:r,openEnded:o,thetaStart:s,thetaLength:a};const l=this;n=Math.floor(n),r=Math.floor(r);const c=[],u=[],h=[],p=[];let d=0;const f=[],m=i/2;let g=0;function y(i){const r=d,o=new yt,f=new Ct;let y=0;const v=!0===i?t:e,_=!0===i?1:-1;for(let t=1;t<=n;t++)u.push(0,m*_,0),h.push(0,_,0),p.push(.5,.5),d++;const x=d;for(let t=0;t<=n;t++){const e=t/n*a+s,i=Math.cos(e),r=Math.sin(e);f.x=v*r,f.y=m*_,f.z=v*i,u.push(f.x,f.y,f.z),h.push(0,_,0),o.x=.5*i+.5,o.y=.5*r*_+.5,p.push(o.x,o.y),d++}for(let t=0;t<n;t++){const e=r+t,n=x+t;!0===i?c.push(n,n+1,e):c.push(n+1,n,e),y+=3}l.addGroup(g,y,!0===i?1:2),g+=y}!function(){const o=new Ct,y=new Ct;let v=0;const _=(e-t)/i;for(let l=0;l<=r;l++){const c=[],g=l/r,v=g*(e-t)+t;for(let t=0;t<=n;t++){const e=t/n,r=e*a+s,l=Math.sin(r),f=Math.cos(r);y.x=v*l,y.y=-g*i+m,y.z=v*f,u.push(y.x,y.y,y.z),o.set(l,_,f).normalize(),h.push(o.x,o.y,o.z),p.push(e,1-g),c.push(d++)}f.push(c)}for(let t=0;t<n;t++)for(let e=0;e<r;e++){const i=f[e][t],n=f[e+1][t],r=f[e+1][t+1],o=f[e][t+1];c.push(i,n,o),c.push(n,r,o),v+=6}l.addGroup(g,v,0),g+=v}(),!1===o&&(t>0&&y(!0),e>0&&y(!1)),this.setIndex(c),this.setAttribute("position",new ui(u,3)),this.setAttribute("normal",new ui(h,3)),this.setAttribute("uv",new ui(p,2))}static fromJSON(t){return new aa(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class la extends aa{constructor(t=1,e=1,i=8,n=1,r=!1,o=0,s=2*Math.PI){super(0,t,e,i,n,r,o,s),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:o,thetaLength:s}}static fromJSON(t){return new la(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class ca extends wi{constructor(t,e,i=1,n=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:i,detail:n};const r=[],o=[];function s(t,e,i,n){const r=n+1,o=[];for(let n=0;n<=r;n++){o[n]=[];const s=t.clone().lerp(i,n/r),a=e.clone().lerp(i,n/r),l=r-n;for(let t=0;t<=l;t++)o[n][t]=0===t&&n===r?s:s.clone().lerp(a,t/l)}for(let t=0;t<r;t++)for(let e=0;e<2*(r-t)-1;e++){const i=Math.floor(e/2);e%2==0?(a(o[t][i+1]),a(o[t+1][i]),a(o[t][i])):(a(o[t][i+1]),a(o[t+1][i+1]),a(o[t+1][i]))}}function a(t){r.push(t.x,t.y,t.z)}function l(e,i){const n=3*e;i.x=t[n+0],i.y=t[n+1],i.z=t[n+2]}function c(t,e,i,n){n<0&&1===t.x&&(o[e]=t.x-1),0===i.x&&0===i.z&&(o[e]=n/2/Math.PI+.5)}function u(t){return Math.atan2(t.z,-t.x)}!function(t){const i=new Ct,n=new Ct,r=new Ct;for(let o=0;o<e.length;o+=3)l(e[o+0],i),l(e[o+1],n),l(e[o+2],r),s(i,n,r,t)}(n),function(t){const e=new Ct;for(let i=0;i<r.length;i+=3)e.x=r[i+0],e.y=r[i+1],e.z=r[i+2],e.normalize().multiplyScalar(t),r[i+0]=e.x,r[i+1]=e.y,r[i+2]=e.z}(i),function(){const t=new Ct;for(let i=0;i<r.length;i+=3){t.x=r[i+0],t.y=r[i+1],t.z=r[i+2];const n=u(t)/2/Math.PI+.5,s=(e=t,Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))/Math.PI+.5);o.push(n,1-s)}var e;(function(){const t=new Ct,e=new Ct,i=new Ct,n=new Ct,s=new yt,a=new yt,l=new yt;for(let h=0,p=0;h<r.length;h+=9,p+=6){t.set(r[h+0],r[h+1],r[h+2]),e.set(r[h+3],r[h+4],r[h+5]),i.set(r[h+6],r[h+7],r[h+8]),s.set(o[p+0],o[p+1]),a.set(o[p+2],o[p+3]),l.set(o[p+4],o[p+5]),n.copy(t).add(e).add(i).divideScalar(3);const d=u(n);c(s,p+0,t,d),c(a,p+2,e,d),c(l,p+4,i,d)}})(),function(){for(let t=0;t<o.length;t+=6){const e=o[t+0],i=o[t+2],n=o[t+4],r=Math.max(e,i,n),s=Math.min(e,i,n);r>.9&&s<.1&&(e<.2&&(o[t+0]+=1),i<.2&&(o[t+2]+=1),n<.2&&(o[t+4]+=1))}}()}(),this.setAttribute("position",new ui(r,3)),this.setAttribute("normal",new ui(r.slice(),3)),this.setAttribute("uv",new ui(o,2)),0===n?this.computeVertexNormals():this.normalizeNormals()}static fromJSON(t){return new ca(t.vertices,t.indices,t.radius,t.details)}}class ua extends ca{constructor(t=1,e=0){const i=(1+Math.sqrt(5))/2,n=1/i;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-i,0,-n,i,0,n,-i,0,n,i,-n,-i,0,-n,i,0,n,-i,0,n,i,0,-i,0,-n,i,0,-n,-i,0,n,i,0,n],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new ua(t.radius,t.detail)}}const ha=new Ct,pa=new Ct,da=new Ct,fa=new Ge;class ma extends wi{constructor(t,e){if(super(),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=void 0!==e?e:1,!0===t.isGeometry)return void console.error("THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");const i=Math.pow(10,4),n=Math.cos(at*e),r=t.getIndex(),o=t.getAttribute("position"),s=r?r.count:o.count,a=[0,0,0],l=["a","b","c"],c=new Array(3),u={},h=[];for(let t=0;t<s;t+=3){r?(a[0]=r.getX(t),a[1]=r.getX(t+1),a[2]=r.getX(t+2)):(a[0]=t,a[1]=t+1,a[2]=t+2);const{a:e,b:s,c:p}=fa;if(e.fromBufferAttribute(o,a[0]),s.fromBufferAttribute(o,a[1]),p.fromBufferAttribute(o,a[2]),fa.getNormal(da),c[0]=`${Math.round(e.x*i)},${Math.round(e.y*i)},${Math.round(e.z*i)}`,c[1]=`${Math.round(s.x*i)},${Math.round(s.y*i)},${Math.round(s.z*i)}`,c[2]=`${Math.round(p.x*i)},${Math.round(p.y*i)},${Math.round(p.z*i)}`,c[0]!==c[1]&&c[1]!==c[2]&&c[2]!==c[0])for(let t=0;t<3;t++){const e=(t+1)%3,i=c[t],r=c[e],o=fa[l[t]],s=fa[l[e]],p=`${i}_${r}`,d=`${r}_${i}`;d in u&&u[d]?(da.dot(u[d].normal)<=n&&(h.push(o.x,o.y,o.z),h.push(s.x,s.y,s.z)),u[d]=null):p in u||(u[p]={index0:a[t],index1:a[e],normal:da.clone()})}}for(const t in u)if(u[t]){const{index0:e,index1:i}=u[t];ha.fromBufferAttribute(o,e),pa.fromBufferAttribute(o,i),h.push(ha.x,ha.y,ha.z),h.push(pa.x,pa.y,pa.z)}this.setAttribute("position",new ui(h,3))}}class ga{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const i=this.getUtoTmapping(t);return this.getPoint(i,e)}getPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return e}getSpacedPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let i,n=this.getPoint(0),r=0;e.push(0);for(let o=1;o<=t;o++)i=this.getPoint(o/t),r+=i.distanceTo(n),e.push(r),n=i;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const i=this.getLengths();let n=0;const r=i.length;let o;o=e||t*i[r-1];let s,a=0,l=r-1;for(;a<=l;)if(n=Math.floor(a+(l-a)/2),s=i[n]-o,s<0)a=n+1;else{if(!(s>0)){l=n;break}l=n-1}if(n=l,i[n]===o)return n/(r-1);const c=i[n];return(n+(o-c)/(i[n+1]-c))/(r-1)}getTangent(t,e){const i=1e-4;let n=t-i,r=t+i;n<0&&(n=0),r>1&&(r=1);const o=this.getPoint(n),s=this.getPoint(r),a=e||(o.isVector2?new yt:new Ct);return a.copy(s).sub(o).normalize(),a}getTangentAt(t,e){const i=this.getUtoTmapping(t);return this.getTangent(i,e)}computeFrenetFrames(t,e){const i=new Ct,n=[],r=[],o=[],s=new Ct,a=new se;for(let e=0;e<=t;e++){const i=e/t;n[e]=this.getTangentAt(i,new Ct),n[e].normalize()}r[0]=new Ct,o[0]=new Ct;let l=Number.MAX_VALUE;const c=Math.abs(n[0].x),u=Math.abs(n[0].y),h=Math.abs(n[0].z);c<=l&&(l=c,i.set(1,0,0)),u<=l&&(l=u,i.set(0,1,0)),h<=l&&i.set(0,0,1),s.crossVectors(n[0],i).normalize(),r[0].crossVectors(n[0],s),o[0].crossVectors(n[0],r[0]);for(let e=1;e<=t;e++){if(r[e]=r[e-1].clone(),o[e]=o[e-1].clone(),s.crossVectors(n[e-1],n[e]),s.length()>Number.EPSILON){s.normalize();const t=Math.acos(ut(n[e-1].dot(n[e]),-1,1));r[e].applyMatrix4(a.makeRotationAxis(s,t))}o[e].crossVectors(n[e],r[e])}if(!0===e){let e=Math.acos(ut(r[0].dot(r[t]),-1,1));e/=t,n[0].dot(s.crossVectors(r[0],r[t]))>0&&(e=-e);for(let i=1;i<=t;i++)r[i].applyMatrix4(a.makeRotationAxis(n[i],e*i)),o[i].crossVectors(n[i],r[i])}return{tangents:n,normals:r,binormals:o}}clone(){return(new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class ya extends ga{constructor(t=0,e=0,i=1,n=1,r=0,o=2*Math.PI,s=!1,a=0){super(),this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=n,this.aStartAngle=r,this.aEndAngle=o,this.aClockwise=s,this.aRotation=a}getPoint(t,e){const i=e||new yt,n=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;const o=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=n;for(;r>n;)r-=n;r<Number.EPSILON&&(r=o?0:n),!0!==this.aClockwise||o||(r===n?r=-n:r-=n);const s=this.aStartAngle+t*r;let a=this.aX+this.xRadius*Math.cos(s),l=this.aY+this.yRadius*Math.sin(s);if(0!==this.aRotation){const t=Math.cos(this.aRotation),e=Math.sin(this.aRotation),i=a-this.aX,n=l-this.aY;a=i*t-n*e+this.aX,l=i*e+n*t+this.aY}return i.set(a,l)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){const t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}}ya.prototype.isEllipseCurve=!0;class va extends ya{constructor(t,e,i,n,r,o){super(t,e,i,i,n,r,o),this.type="ArcCurve"}}function _a(){let t=0,e=0,i=0,n=0;function r(r,o,s,a){t=r,e=s,i=-3*r+3*o-2*s-a,n=2*r-2*o+s+a}return{initCatmullRom:function(t,e,i,n,o){r(e,i,o*(i-t),o*(n-e))},initNonuniformCatmullRom:function(t,e,i,n,o,s,a){let l=(e-t)/o-(i-t)/(o+s)+(i-e)/s,c=(i-e)/s-(n-e)/(s+a)+(n-i)/a;l*=s,c*=s,r(e,i,l,c)},calc:function(r){const o=r*r;return t+e*r+i*o+n*(o*r)}}}va.prototype.isArcCurve=!0;const xa=new Ct,ba=new _a,wa=new _a,Aa=new _a;class Ea extends ga{constructor(t=[],e=!1,i="centripetal",n=.5){super(),this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=i,this.tension=n}getPoint(t,e=new Ct){const i=e,n=this.points,r=n.length,o=(r-(this.closed?0:1))*t;let s,a,l=Math.floor(o),c=o-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/r)+1)*r:0===c&&l===r-1&&(l=r-2,c=1),this.closed||l>0?s=n[(l-1)%r]:(xa.subVectors(n[0],n[1]).add(n[0]),s=xa);const u=n[l%r],h=n[(l+1)%r];if(this.closed||l+2<r?a=n[(l+2)%r]:(xa.subVectors(n[r-1],n[r-2]).add(n[r-1]),a=xa),"centripetal"===this.curveType||"chordal"===this.curveType){const t="chordal"===this.curveType?.5:.25;let e=Math.pow(s.distanceToSquared(u),t),i=Math.pow(u.distanceToSquared(h),t),n=Math.pow(h.distanceToSquared(a),t);i<1e-4&&(i=1),e<1e-4&&(e=i),n<1e-4&&(n=i),ba.initNonuniformCatmullRom(s.x,u.x,h.x,a.x,e,i,n),wa.initNonuniformCatmullRom(s.y,u.y,h.y,a.y,e,i,n),Aa.initNonuniformCatmullRom(s.z,u.z,h.z,a.z,e,i,n)}else"catmullrom"===this.curveType&&(ba.initCatmullRom(s.x,u.x,h.x,a.x,this.tension),wa.initCatmullRom(s.y,u.y,h.y,a.y,this.tension),Aa.initCatmullRom(s.z,u.z,h.z,a.z,this.tension));return i.set(ba.calc(c),wa.calc(c),Aa.calc(c)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const i=t.points[e];this.points.push(i.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){const i=this.points[e];t.points.push(i.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const i=t.points[e];this.points.push((new Ct).fromArray(i))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}}function Sa(t,e,i,n,r){const o=.5*(n-e),s=.5*(r-i),a=t*t;return(2*i-2*n+o+s)*(t*a)+(-3*i+3*n-2*o-s)*a+o*t+i}function Ma(t,e,i,n){return function(t,e){const i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,n)}function Ta(t,e,i,n,r){return function(t,e){const i=1-t;return i*i*i*e}(t,e)+function(t,e){const i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,n)+function(t,e){return t*t*t*e}(t,r)}Ea.prototype.isCatmullRomCurve3=!0;class Ia extends ga{constructor(t=new yt,e=new yt,i=new yt,n=new yt){super(),this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=i,this.v3=n}getPoint(t,e=new yt){const i=e,n=this.v0,r=this.v1,o=this.v2,s=this.v3;return i.set(Ta(t,n.x,r.x,o.x,s.x),Ta(t,n.y,r.y,o.y,s.y)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}Ia.prototype.isCubicBezierCurve=!0;class Ca extends ga{constructor(t=new Ct,e=new Ct,i=new Ct,n=new Ct){super(),this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=i,this.v3=n}getPoint(t,e=new Ct){const i=e,n=this.v0,r=this.v1,o=this.v2,s=this.v3;return i.set(Ta(t,n.x,r.x,o.x,s.x),Ta(t,n.y,r.y,o.y,s.y),Ta(t,n.z,r.z,o.z,s.z)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}Ca.prototype.isCubicBezierCurve3=!0;class Pa extends ga{constructor(t=new yt,e=new yt){super(),this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new yt){const i=e;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e){const i=e||new yt;return i.copy(this.v2).sub(this.v1).normalize(),i}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}Pa.prototype.isLineCurve=!0;class La extends ga{constructor(t=new Ct,e=new Ct){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=t,this.v2=e}getPoint(t,e=new Ct){const i=e;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}getPointAt(t,e){return this.getPoint(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class Da extends ga{constructor(t=new yt,e=new yt,i=new yt){super(),this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new yt){const i=e,n=this.v0,r=this.v1,o=this.v2;return i.set(Ma(t,n.x,r.x,o.x),Ma(t,n.y,r.y,o.y)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}Da.prototype.isQuadraticBezierCurve=!0;class Ra extends ga{constructor(t=new Ct,e=new Ct,i=new Ct){super(),this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new Ct){const i=e,n=this.v0,r=this.v1,o=this.v2;return i.set(Ma(t,n.x,r.x,o.x),Ma(t,n.y,r.y,o.y),Ma(t,n.z,r.z,o.z)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}Ra.prototype.isQuadraticBezierCurve3=!0;class Oa extends ga{constructor(t=[]){super(),this.type="SplineCurve",this.points=t}getPoint(t,e=new yt){const i=e,n=this.points,r=(n.length-1)*t,o=Math.floor(r),s=r-o,a=n[0===o?o:o-1],l=n[o],c=n[o>n.length-2?n.length-1:o+1],u=n[o>n.length-3?n.length-1:o+2];return i.set(Sa(s,a.x,l.x,c.x,u.x),Sa(s,a.y,l.y,c.y,u.y)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const i=t.points[e];this.points.push(i.clone())}return this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){const i=this.points[e];t.points.push(i.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const i=t.points[e];this.points.push((new yt).fromArray(i))}return this}}Oa.prototype.isSplineCurve=!0;var ka=Object.freeze({__proto__:null,ArcCurve:va,CatmullRomCurve3:Ea,CubicBezierCurve:Ia,CubicBezierCurve3:Ca,EllipseCurve:ya,LineCurve:Pa,LineCurve3:La,QuadraticBezierCurve:Da,QuadraticBezierCurve3:Ra,SplineCurve:Oa});const Na=function(t,e,i=2){const n=e&&e.length,r=n?e[0]*i:t.length;let o=Ba(t,0,r,i,!0);const s=[];if(!o||o.next===o.prev)return s;let a,l,c,u,h,p,d;if(n&&(o=function(t,e,i,n){const r=[];let o,s,a,l,c;for(o=0,s=e.length;o<s;o++)a=e[o]*n,l=o<s-1?e[o+1]*n:t.length,c=Ba(t,a,l,n,!1),c===c.next&&(c.steiner=!0),r.push(Za(c));for(r.sort(Ha),o=0;o<r.length;o++)Wa(r[o],i),i=za(i,i.next);return i}(t,e,o,i)),t.length>80*i){a=c=t[0],l=u=t[1];for(let e=i;e<r;e+=i)h=t[e],p=t[e+1],h<a&&(a=h),p<l&&(l=p),h>c&&(c=h),p>u&&(u=p);d=Math.max(c-a,u-l),d=0!==d?1/d:0}return Fa(o,s,i,a,l,d),s};function Ba(t,e,i,n,r){let o,s;if(r===function(t,e,i,n){let r=0;for(let o=e,s=i-n;o<i;o+=n)r+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return r}(t,e,i,n)>0)for(o=e;o<i;o+=n)s=rl(o,t[o],t[o+1],s);else for(o=i-n;o>=e;o-=n)s=rl(o,t[o],t[o+1],s);return s&&Ka(s,s.next)&&(ol(s),s=s.next),s}function za(t,e){if(!t)return t;e||(e=t);let i,n=t;do{if(i=!1,n.steiner||!Ka(n,n.next)&&0!==Ja(n.prev,n,n.next))n=n.next;else{if(ol(n),n=e=n.prev,n===n.next)break;i=!0}}while(i||n!==e);return e}function Fa(t,e,i,n,r,o,s){if(!t)return;!s&&o&&function(t,e,i,n){let r=t;do{null===r.z&&(r.z=Xa(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){let e,i,n,r,o,s,a,l,c=1;do{for(i=t,t=null,o=null,s=0;i;){for(s++,n=i,a=0,e=0;e<c&&(a++,n=n.nextZ,n);e++);for(l=c;a>0||l>0&&n;)0!==a&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,a--):(r=n,n=n.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;i=n}o.nextZ=null,c*=2}while(s>1)}(r)}(t,n,r,o);let a,l,c=t;for(;t.prev!==t.next;)if(a=t.prev,l=t.next,o?Ua(t,n,r,o):Va(t))e.push(a.i/i),e.push(t.i/i),e.push(l.i/i),ol(t),t=l.next,c=l.next;else if((t=l)===c){s?1===s?Fa(t=Ga(za(t),e,i),e,i,n,r,o,2):2===s&&ja(t,e,i,n,r,o):Fa(za(t),e,i,n,r,o,1);break}}function Va(t){const e=t.prev,i=t,n=t.next;if(Ja(e,i,n)>=0)return!1;let r=t.next.next;for(;r!==t.prev;){if(Ya(e.x,e.y,i.x,i.y,n.x,n.y,r.x,r.y)&&Ja(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Ua(t,e,i,n){const r=t.prev,o=t,s=t.next;if(Ja(r,o,s)>=0)return!1;const a=r.x<o.x?r.x<s.x?r.x:s.x:o.x<s.x?o.x:s.x,l=r.y<o.y?r.y<s.y?r.y:s.y:o.y<s.y?o.y:s.y,c=r.x>o.x?r.x>s.x?r.x:s.x:o.x>s.x?o.x:s.x,u=r.y>o.y?r.y>s.y?r.y:s.y:o.y>s.y?o.y:s.y,h=Xa(a,l,e,i,n),p=Xa(c,u,e,i,n);let d=t.prevZ,f=t.nextZ;for(;d&&d.z>=h&&f&&f.z<=p;){if(d!==t.prev&&d!==t.next&&Ya(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&Ja(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,f!==t.prev&&f!==t.next&&Ya(r.x,r.y,o.x,o.y,s.x,s.y,f.x,f.y)&&Ja(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;d&&d.z>=h;){if(d!==t.prev&&d!==t.next&&Ya(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&Ja(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;f&&f.z<=p;){if(f!==t.prev&&f!==t.next&&Ya(r.x,r.y,o.x,o.y,s.x,s.y,f.x,f.y)&&Ja(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function Ga(t,e,i){let n=t;do{const r=n.prev,o=n.next.next;!Ka(r,o)&&$a(r,n,n.next,o)&&il(r,o)&&il(o,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(o.i/i),ol(n),ol(n.next),n=t=o),n=n.next}while(n!==t);return za(n)}function ja(t,e,i,n,r,o){let s=t;do{let t=s.next.next;for(;t!==s.prev;){if(s.i!==t.i&&Qa(s,t)){let a=nl(s,t);return s=za(s,s.next),a=za(a,a.next),Fa(s,e,i,n,r,o),void Fa(a,e,i,n,r,o)}t=t.next}s=s.next}while(s!==t)}function Ha(t,e){return t.x-e.x}function Wa(t,e){if(e=function(t,e){let i=e;const n=t.x,r=t.y;let o,s=-1/0;do{if(r<=i.y&&r>=i.next.y&&i.next.y!==i.y){const t=i.x+(r-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=n&&t>s){if(s=t,t===n){if(r===i.y)return i;if(r===i.next.y)return i.next}o=i.x<i.next.x?i:i.next}}i=i.next}while(i!==e);if(!o)return null;if(n===s)return o;const a=o,l=o.x,c=o.y;let u,h=1/0;i=o;do{n>=i.x&&i.x>=l&&n!==i.x&&Ya(r<c?n:s,r,l,c,r<c?s:n,r,i.x,i.y)&&(u=Math.abs(r-i.y)/(n-i.x),il(i,t)&&(u<h||u===h&&(i.x>o.x||i.x===o.x&&qa(o,i)))&&(o=i,h=u)),i=i.next}while(i!==a);return o}(t,e)){const i=nl(e,t);za(e,e.next),za(i,i.next)}}function qa(t,e){return Ja(t.prev,t,e.prev)<0&&Ja(e.next,t,t.next)<0}function Xa(t,e,i,n,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Za(t){let e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function Ya(t,e,i,n,r,o,s,a){return(r-s)*(e-a)-(t-s)*(o-a)>=0&&(t-s)*(n-a)-(i-s)*(e-a)>=0&&(i-s)*(o-a)-(r-s)*(n-a)>=0}function Qa(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&$a(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(il(t,e)&&il(e,t)&&function(t,e){let i=t,n=!1;const r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&r<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)&&(Ja(t.prev,t,e.prev)||Ja(t,e.prev,e))||Ka(t,e)&&Ja(t.prev,t,t.next)>0&&Ja(e.prev,e,e.next)>0)}function Ja(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function Ka(t,e){return t.x===e.x&&t.y===e.y}function $a(t,e,i,n){const r=el(Ja(t,e,i)),o=el(Ja(t,e,n)),s=el(Ja(i,n,t)),a=el(Ja(i,n,e));return r!==o&&s!==a||!(0!==r||!tl(t,i,e))||!(0!==o||!tl(t,n,e))||!(0!==s||!tl(i,t,n))||!(0!==a||!tl(i,e,n))}function tl(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function el(t){return t>0?1:t<0?-1:0}function il(t,e){return Ja(t.prev,t,t.next)<0?Ja(t,e,t.next)>=0&&Ja(t,t.prev,e)>=0:Ja(t,e,t.prev)<0||Ja(t,t.next,e)<0}function nl(t,e){const i=new sl(t.i,t.x,t.y),n=new sl(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,o.next=n,n.prev=o,n}function rl(t,e,i,n){const r=new sl(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function ol(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function sl(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}class al{static area(t){const e=t.length;let i=0;for(let n=e-1,r=0;r<e;n=r++)i+=t[n].x*t[r].y-t[r].x*t[n].y;return.5*i}static isClockWise(t){return al.area(t)<0}static triangulateShape(t,e){const i=[],n=[],r=[];ll(t),cl(i,t);let o=t.length;e.forEach(ll);for(let t=0;t<e.length;t++)n.push(o),o+=e[t].length,cl(i,e[t]);const s=Na(i,n);for(let t=0;t<s.length;t+=3)r.push(s.slice(t,t+3));return r}}function ll(t){const e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function cl(t,e){for(let i=0;i<e.length;i++)t.push(e[i].x),t.push(e[i].y)}class ul extends wi{constructor(t,e){super(),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];const i=this,n=[],r=[];for(let e=0,i=t.length;e<i;e++)o(t[e]);function o(t){const o=[],s=void 0!==e.curveSegments?e.curveSegments:12,a=void 0!==e.steps?e.steps:1;let l=void 0!==e.depth?e.depth:100,c=void 0===e.bevelEnabled||e.bevelEnabled,u=void 0!==e.bevelThickness?e.bevelThickness:6,h=void 0!==e.bevelSize?e.bevelSize:u-2,p=void 0!==e.bevelOffset?e.bevelOffset:0,d=void 0!==e.bevelSegments?e.bevelSegments:3;const f=e.extrudePath,m=void 0!==e.UVGenerator?e.UVGenerator:hl;void 0!==e.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),l=e.amount);let g,y,v,_,x,b=!1;f&&(g=f.getSpacedPoints(a),b=!0,c=!1,y=f.computeFrenetFrames(a,!1),v=new Ct,_=new Ct,x=new Ct),c||(d=0,u=0,h=0,p=0);const w=t.extractPoints(s);let A=w.shape;const E=w.holes;if(!al.isClockWise(A)){A=A.reverse();for(let t=0,e=E.length;t<e;t++){const e=E[t];al.isClockWise(e)&&(E[t]=e.reverse())}}const S=al.triangulateShape(A,E),M=A;for(let t=0,e=E.length;t<e;t++){const e=E[t];A=A.concat(e)}function T(t,e,i){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(i).add(t)}const I=A.length,C=S.length;function P(t,e,i){let n,r,o;const s=t.x-e.x,a=t.y-e.y,l=i.x-t.x,c=i.y-t.y,u=s*s+a*a,h=s*c-a*l;if(Math.abs(h)>Number.EPSILON){const h=Math.sqrt(u),p=Math.sqrt(l*l+c*c),d=e.x-a/h,f=e.y+s/h,m=((i.x-c/p-d)*c-(i.y+l/p-f)*l)/(s*c-a*l);n=d+s*m-t.x,r=f+a*m-t.y;const g=n*n+r*r;if(g<=2)return new yt(n,r);o=Math.sqrt(g/2)}else{let t=!1;s>Number.EPSILON?l>Number.EPSILON&&(t=!0):s<-Number.EPSILON?l<-Number.EPSILON&&(t=!0):Math.sign(a)===Math.sign(c)&&(t=!0),t?(n=-a,r=s,o=Math.sqrt(u)):(n=s,r=a,o=Math.sqrt(u/2))}return new yt(n/o,r/o)}const L=[];for(let t=0,e=M.length,i=e-1,n=t+1;t<e;t++,i++,n++)i===e&&(i=0),n===e&&(n=0),L[t]=P(M[t],M[i],M[n]);const D=[];let R,O=L.concat();for(let t=0,e=E.length;t<e;t++){const e=E[t];R=[];for(let t=0,i=e.length,n=i-1,r=t+1;t<i;t++,n++,r++)n===i&&(n=0),r===i&&(r=0),R[t]=P(e[t],e[n],e[r]);D.push(R),O=O.concat(R)}for(let t=0;t<d;t++){const e=t/d,i=u*Math.cos(e*Math.PI/2),n=h*Math.sin(e*Math.PI/2)+p;for(let t=0,e=M.length;t<e;t++){const e=T(M[t],L[t],n);B(e.x,e.y,-i)}for(let t=0,e=E.length;t<e;t++){const e=E[t];R=D[t];for(let t=0,r=e.length;t<r;t++){const r=T(e[t],R[t],n);B(r.x,r.y,-i)}}}const k=h+p;for(let t=0;t<I;t++){const e=c?T(A[t],O[t],k):A[t];b?(_.copy(y.normals[0]).multiplyScalar(e.x),v.copy(y.binormals[0]).multiplyScalar(e.y),x.copy(g[0]).add(_).add(v),B(x.x,x.y,x.z)):B(e.x,e.y,0)}for(let t=1;t<=a;t++)for(let e=0;e<I;e++){const i=c?T(A[e],O[e],k):A[e];b?(_.copy(y.normals[t]).multiplyScalar(i.x),v.copy(y.binormals[t]).multiplyScalar(i.y),x.copy(g[t]).add(_).add(v),B(x.x,x.y,x.z)):B(i.x,i.y,l/a*t)}for(let t=d-1;t>=0;t--){const e=t/d,i=u*Math.cos(e*Math.PI/2),n=h*Math.sin(e*Math.PI/2)+p;for(let t=0,e=M.length;t<e;t++){const e=T(M[t],L[t],n);B(e.x,e.y,l+i)}for(let t=0,e=E.length;t<e;t++){const e=E[t];R=D[t];for(let t=0,r=e.length;t<r;t++){const r=T(e[t],R[t],n);b?B(r.x,r.y+g[a-1].y,g[a-1].x+i):B(r.x,r.y,l+i)}}}function N(t,e){let i=t.length;for(;--i>=0;){const n=i;let r=i-1;r<0&&(r=t.length-1);for(let t=0,i=a+2*d;t<i;t++){const i=I*t,o=I*(t+1);F(e+n+i,e+r+i,e+r+o,e+n+o)}}}function B(t,e,i){o.push(t),o.push(e),o.push(i)}function z(t,e,r){V(t),V(e),V(r);const o=n.length/3,s=m.generateTopUV(i,n,o-3,o-2,o-1);U(s[0]),U(s[1]),U(s[2])}function F(t,e,r,o){V(t),V(e),V(o),V(e),V(r),V(o);const s=n.length/3,a=m.generateSideWallUV(i,n,s-6,s-3,s-2,s-1);U(a[0]),U(a[1]),U(a[3]),U(a[1]),U(a[2]),U(a[3])}function V(t){n.push(o[3*t+0]),n.push(o[3*t+1]),n.push(o[3*t+2])}function U(t){r.push(t.x),r.push(t.y)}!function(){const t=n.length/3;if(c){let t=0,e=I*t;for(let t=0;t<C;t++){const i=S[t];z(i[2]+e,i[1]+e,i[0]+e)}t=a+2*d,e=I*t;for(let t=0;t<C;t++){const i=S[t];z(i[0]+e,i[1]+e,i[2]+e)}}else{for(let t=0;t<C;t++){const e=S[t];z(e[2],e[1],e[0])}for(let t=0;t<C;t++){const e=S[t];z(e[0]+I*a,e[1]+I*a,e[2]+I*a)}}i.addGroup(t,n.length/3-t,0)}(),function(){const t=n.length/3;let e=0;N(M,e),e+=M.length;for(let t=0,i=E.length;t<i;t++){const i=E[t];N(i,e),e+=i.length}i.addGroup(t,n.length/3-t,1)}()}this.setAttribute("position",new ui(n,3)),this.setAttribute("uv",new ui(r,2)),this.computeVertexNormals()}toJSON(){const t=super.toJSON();return function(t,e,i){if(i.shapes=[],Array.isArray(t))for(let e=0,n=t.length;e<n;e++){const n=t[e];i.shapes.push(n.uuid)}else i.shapes.push(t.uuid);return void 0!==e.extrudePath&&(i.options.extrudePath=e.extrudePath.toJSON()),i}(this.parameters.shapes,this.parameters.options,t)}static fromJSON(t,e){const i=[];for(let n=0,r=t.shapes.length;n<r;n++){const r=e[t.shapes[n]];i.push(r)}const n=t.options.extrudePath;return void 0!==n&&(t.options.extrudePath=(new ka[n.type]).fromJSON(n)),new ul(i,t.options)}}const hl={generateTopUV:function(t,e,i,n,r){const o=e[3*i],s=e[3*i+1],a=e[3*n],l=e[3*n+1],c=e[3*r],u=e[3*r+1];return[new yt(o,s),new yt(a,l),new yt(c,u)]},generateSideWallUV:function(t,e,i,n,r,o){const s=e[3*i],a=e[3*i+1],l=e[3*i+2],c=e[3*n],u=e[3*n+1],h=e[3*n+2],p=e[3*r],d=e[3*r+1],f=e[3*r+2],m=e[3*o],g=e[3*o+1],y=e[3*o+2];return Math.abs(a-u)<Math.abs(s-c)?[new yt(s,1-l),new yt(c,1-h),new yt(p,1-f),new yt(m,1-y)]:[new yt(a,1-l),new yt(u,1-h),new yt(d,1-f),new yt(g,1-y)]}};class pl extends ca{constructor(t=1,e=0){const i=(1+Math.sqrt(5))/2;super([-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new pl(t.radius,t.detail)}}class dl extends wi{constructor(t,e=12,i=0,n=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:i,phiLength:n},e=Math.floor(e),n=ut(n,0,2*Math.PI);const r=[],o=[],s=[],a=1/e,l=new Ct,c=new yt;for(let r=0;r<=e;r++){const u=i+r*a*n,h=Math.sin(u),p=Math.cos(u);for(let i=0;i<=t.length-1;i++)l.x=t[i].x*h,l.y=t[i].y,l.z=t[i].x*p,o.push(l.x,l.y,l.z),c.x=r/e,c.y=i/(t.length-1),s.push(c.x,c.y)}for(let i=0;i<e;i++)for(let e=0;e<t.length-1;e++){const n=e+i*t.length,o=n,s=n+t.length,a=n+t.length+1,l=n+1;r.push(o,s,l),r.push(s,a,l)}if(this.setIndex(r),this.setAttribute("position",new ui(o,3)),this.setAttribute("uv",new ui(s,2)),this.computeVertexNormals(),n===2*Math.PI){const i=this.attributes.normal.array,n=new Ct,r=new Ct,o=new Ct,s=e*t.length*3;for(let e=0,a=0;e<t.length;e++,a+=3)n.x=i[a+0],n.y=i[a+1],n.z=i[a+2],r.x=i[s+a+0],r.y=i[s+a+1],r.z=i[s+a+2],o.addVectors(n,r).normalize(),i[a+0]=i[s+a+0]=o.x,i[a+1]=i[s+a+1]=o.y,i[a+2]=i[s+a+2]=o.z}}static fromJSON(t){return new dl(t.points,t.segments,t.phiStart,t.phiLength)}}class fl extends ca{constructor(t=1,e=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new fl(t.radius,t.detail)}}class ml extends wi{constructor(t,e,i){super(),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:i};const n=[],r=[],o=[],s=[],a=1e-5,l=new Ct,c=new Ct,u=new Ct,h=new Ct,p=new Ct;t.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");const d=e+1;for(let n=0;n<=i;n++){const d=n/i;for(let i=0;i<=e;i++){const n=i/e;t(n,d,c),r.push(c.x,c.y,c.z),n-a>=0?(t(n-a,d,u),h.subVectors(c,u)):(t(n+a,d,u),h.subVectors(u,c)),d-a>=0?(t(n,d-a,u),p.subVectors(c,u)):(t(n,d+a,u),p.subVectors(u,c)),l.crossVectors(h,p).normalize(),o.push(l.x,l.y,l.z),s.push(n,d)}}for(let t=0;t<i;t++)for(let i=0;i<e;i++){const e=t*d+i,r=t*d+i+1,o=(t+1)*d+i+1,s=(t+1)*d+i;n.push(e,r,s),n.push(r,o,s)}this.setIndex(n),this.setAttribute("position",new ui(r,3)),this.setAttribute("normal",new ui(o,3)),this.setAttribute("uv",new ui(s,2))}}class gl extends wi{constructor(t=.5,e=1,i=8,n=1,r=0,o=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:i,phiSegments:n,thetaStart:r,thetaLength:o},i=Math.max(3,i);const s=[],a=[],l=[],c=[];let u=t;const h=(e-t)/(n=Math.max(1,n)),p=new Ct,d=new yt;for(let t=0;t<=n;t++){for(let t=0;t<=i;t++){const n=r+t/i*o;p.x=u*Math.cos(n),p.y=u*Math.sin(n),a.push(p.x,p.y,p.z),l.push(0,0,1),d.x=(p.x/e+1)/2,d.y=(p.y/e+1)/2,c.push(d.x,d.y)}u+=h}for(let t=0;t<n;t++){const e=t*(i+1);for(let t=0;t<i;t++){const n=t+e,r=n,o=n+i+1,a=n+i+2,l=n+1;s.push(r,o,l),s.push(o,a,l)}}this.setIndex(s),this.setAttribute("position",new ui(a,3)),this.setAttribute("normal",new ui(l,3)),this.setAttribute("uv",new ui(c,2))}static fromJSON(t){return new gl(t.innerRadius,t.outerRadius,t.thetaSegments,t.phiSegments,t.thetaStart,t.thetaLength)}}class yl extends wi{constructor(t,e=12){super(),this.type="ShapeGeometry",this.parameters={shapes:t,curveSegments:e};const i=[],n=[],r=[],o=[];let s=0,a=0;if(!1===Array.isArray(t))l(t);else for(let e=0;e<t.length;e++)l(t[e]),this.addGroup(s,a,e),s+=a,a=0;function l(t){const s=n.length/3,l=t.extractPoints(e);let c=l.shape;const u=l.holes;!1===al.isClockWise(c)&&(c=c.reverse());for(let t=0,e=u.length;t<e;t++){const e=u[t];!0===al.isClockWise(e)&&(u[t]=e.reverse())}const h=al.triangulateShape(c,u);for(let t=0,e=u.length;t<e;t++){const e=u[t];c=c.concat(e)}for(let t=0,e=c.length;t<e;t++){const e=c[t];n.push(e.x,e.y,0),r.push(0,0,1),o.push(e.x,e.y)}for(let t=0,e=h.length;t<e;t++){const e=h[t],n=e[0]+s,r=e[1]+s,o=e[2]+s;i.push(n,r,o),a+=3}}this.setIndex(i),this.setAttribute("position",new ui(n,3)),this.setAttribute("normal",new ui(r,3)),this.setAttribute("uv",new ui(o,2))}toJSON(){const t=super.toJSON();return function(t,e){if(e.shapes=[],Array.isArray(t))for(let i=0,n=t.length;i<n;i++){const n=t[i];e.shapes.push(n.uuid)}else e.shapes.push(t.uuid);return e}(this.parameters.shapes,t)}static fromJSON(t,e){const i=[];for(let n=0,r=t.shapes.length;n<r;n++){const r=e[t.shapes[n]];i.push(r)}return new yl(i,t.curveSegments)}}class vl extends wi{constructor(t=1,e=32,i=16,n=0,r=2*Math.PI,o=0,s=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:i,phiStart:n,phiLength:r,thetaStart:o,thetaLength:s},e=Math.max(3,Math.floor(e)),i=Math.max(2,Math.floor(i));const a=Math.min(o+s,Math.PI);let l=0;const c=[],u=new Ct,h=new Ct,p=[],d=[],f=[],m=[];for(let p=0;p<=i;p++){const g=[],y=p/i;let v=0;0==p&&0==o?v=.5/e:p==i&&a==Math.PI&&(v=-.5/e);for(let i=0;i<=e;i++){const a=i/e;u.x=-t*Math.cos(n+a*r)*Math.sin(o+y*s),u.y=t*Math.cos(o+y*s),u.z=t*Math.sin(n+a*r)*Math.sin(o+y*s),d.push(u.x,u.y,u.z),h.copy(u).normalize(),f.push(h.x,h.y,h.z),m.push(a+v,1-y),g.push(l++)}c.push(g)}for(let t=0;t<i;t++)for(let n=0;n<e;n++){const e=c[t][n+1],r=c[t][n],s=c[t+1][n],l=c[t+1][n+1];(0!==t||o>0)&&p.push(e,r,l),(t!==i-1||a<Math.PI)&&p.push(r,s,l)}this.setIndex(p),this.setAttribute("position",new ui(d,3)),this.setAttribute("normal",new ui(f,3)),this.setAttribute("uv",new ui(m,2))}static fromJSON(t){return new vl(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class _l extends ca{constructor(t=1,e=0){super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new _l(t.radius,t.detail)}}class xl extends ul{constructor(t,e={}){const i=e.font;if(!i||!i.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new wi;const n=i.generateShapes(t,e.size);e.depth=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),super(n,e),this.type="TextGeometry"}}class bl extends wi{constructor(t=1,e=.4,i=8,n=6,r=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:i,tubularSegments:n,arc:r},i=Math.floor(i),n=Math.floor(n);const o=[],s=[],a=[],l=[],c=new Ct,u=new Ct,h=new Ct;for(let o=0;o<=i;o++)for(let p=0;p<=n;p++){const d=p/n*r,f=o/i*Math.PI*2;u.x=(t+e*Math.cos(f))*Math.cos(d),u.y=(t+e*Math.cos(f))*Math.sin(d),u.z=e*Math.sin(f),s.push(u.x,u.y,u.z),c.x=t*Math.cos(d),c.y=t*Math.sin(d),h.subVectors(u,c).normalize(),a.push(h.x,h.y,h.z),l.push(p/n),l.push(o/i)}for(let t=1;t<=i;t++)for(let e=1;e<=n;e++){const i=(n+1)*t+e-1,r=(n+1)*(t-1)+e-1,s=(n+1)*(t-1)+e,a=(n+1)*t+e;o.push(i,r,a),o.push(r,s,a)}this.setIndex(o),this.setAttribute("position",new ui(s,3)),this.setAttribute("normal",new ui(a,3)),this.setAttribute("uv",new ui(l,2))}static fromJSON(t){return new bl(t.radius,t.tube,t.radialSegments,t.tubularSegments,t.arc)}}class wl extends wi{constructor(t=1,e=.4,i=64,n=8,r=2,o=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:i,radialSegments:n,p:r,q:o},i=Math.floor(i),n=Math.floor(n);const s=[],a=[],l=[],c=[],u=new Ct,h=new Ct,p=new Ct,d=new Ct,f=new Ct,m=new Ct,g=new Ct;for(let s=0;s<=i;++s){const v=s/i*r*Math.PI*2;y(v,r,o,t,p),y(v+.01,r,o,t,d),m.subVectors(d,p),g.addVectors(d,p),f.crossVectors(m,g),g.crossVectors(f,m),f.normalize(),g.normalize();for(let t=0;t<=n;++t){const r=t/n*Math.PI*2,o=-e*Math.cos(r),d=e*Math.sin(r);u.x=p.x+(o*g.x+d*f.x),u.y=p.y+(o*g.y+d*f.y),u.z=p.z+(o*g.z+d*f.z),a.push(u.x,u.y,u.z),h.subVectors(u,p).normalize(),l.push(h.x,h.y,h.z),c.push(s/i),c.push(t/n)}}for(let t=1;t<=i;t++)for(let e=1;e<=n;e++){const i=(n+1)*(t-1)+(e-1),r=(n+1)*t+(e-1),o=(n+1)*t+e,a=(n+1)*(t-1)+e;s.push(i,r,a),s.push(r,o,a)}function y(t,e,i,n,r){const o=Math.cos(t),s=Math.sin(t),a=i/e*t,l=Math.cos(a);r.x=n*(2+l)*.5*o,r.y=n*(2+l)*s*.5,r.z=n*Math.sin(a)*.5}this.setIndex(s),this.setAttribute("position",new ui(a,3)),this.setAttribute("normal",new ui(l,3)),this.setAttribute("uv",new ui(c,2))}static fromJSON(t){return new wl(t.radius,t.tube,t.tubularSegments,t.radialSegments,t.p,t.q)}}class Al extends wi{constructor(t,e=64,i=1,n=8,r=!1){super(),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:i,radialSegments:n,closed:r};const o=t.computeFrenetFrames(e,r);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const s=new Ct,a=new Ct,l=new yt;let c=new Ct;const u=[],h=[],p=[],d=[];function f(r){c=t.getPointAt(r/e,c);const l=o.normals[r],p=o.binormals[r];for(let t=0;t<=n;t++){const e=t/n*Math.PI*2,r=Math.sin(e),o=-Math.cos(e);a.x=o*l.x+r*p.x,a.y=o*l.y+r*p.y,a.z=o*l.z+r*p.z,a.normalize(),h.push(a.x,a.y,a.z),s.x=c.x+i*a.x,s.y=c.y+i*a.y,s.z=c.z+i*a.z,u.push(s.x,s.y,s.z)}}!function(){for(let t=0;t<e;t++)f(t);f(!1===r?e:0),function(){for(let t=0;t<=e;t++)for(let i=0;i<=n;i++)l.x=t/e,l.y=i/n,p.push(l.x,l.y)}(),function(){for(let t=1;t<=e;t++)for(let e=1;e<=n;e++){const i=(n+1)*(t-1)+(e-1),r=(n+1)*t+(e-1),o=(n+1)*t+e,s=(n+1)*(t-1)+e;d.push(i,r,s),d.push(r,o,s)}}()}(),this.setIndex(d),this.setAttribute("position",new ui(u,3)),this.setAttribute("normal",new ui(h,3)),this.setAttribute("uv",new ui(p,2))}toJSON(){const t=super.toJSON();return t.path=this.parameters.path.toJSON(),t}static fromJSON(t){return new Al((new ka[t.path.type]).fromJSON(t.path),t.tubularSegments,t.radius,t.radialSegments,t.closed)}}class El extends wi{constructor(t){if(super(),this.type="WireframeGeometry",!0===t.isGeometry)return void console.error("THREE.WireframeGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");const e=[],i=new Set,n=new Ct,r=new Ct;if(null!==t.index){const o=t.attributes.position,s=t.index;let a=t.groups;0===a.length&&(a=[{start:0,count:s.count,materialIndex:0}]);for(let t=0,l=a.length;t<l;++t){const l=a[t],c=l.start;for(let t=c,a=c+l.count;t<a;t+=3)for(let a=0;a<3;a++){const l=s.getX(t+a),c=s.getX(t+(a+1)%3);n.fromBufferAttribute(o,l),r.fromBufferAttribute(o,c),!0===Sl(n,r,i)&&(e.push(n.x,n.y,n.z),e.push(r.x,r.y,r.z))}}}else{const o=t.attributes.position;for(let t=0,s=o.count/3;t<s;t++)for(let s=0;s<3;s++){const a=3*t+s,l=3*t+(s+1)%3;n.fromBufferAttribute(o,a),r.fromBufferAttribute(o,l),!0===Sl(n,r,i)&&(e.push(n.x,n.y,n.z),e.push(r.x,r.y,r.z))}}this.setAttribute("position",new ui(e,3))}}function Sl(t,e,i){const n=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`,r=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`;return!0!==i.has(n)&&!0!==i.has(r)&&(i.add(n,r),!0)}var Ml=Object.freeze({__proto__:null,BoxGeometry:Gi,BoxBufferGeometry:Gi,CircleGeometry:sa,CircleBufferGeometry:sa,ConeGeometry:la,ConeBufferGeometry:la,CylinderGeometry:aa,CylinderBufferGeometry:aa,DodecahedronGeometry:ua,DodecahedronBufferGeometry:ua,EdgesGeometry:ma,ExtrudeGeometry:ul,ExtrudeBufferGeometry:ul,IcosahedronGeometry:pl,IcosahedronBufferGeometry:pl,LatheGeometry:dl,LatheBufferGeometry:dl,OctahedronGeometry:fl,OctahedronBufferGeometry:fl,ParametricGeometry:ml,ParametricBufferGeometry:ml,PlaneGeometry:cn,PlaneBufferGeometry:cn,PolyhedronGeometry:ca,PolyhedronBufferGeometry:ca,RingGeometry:gl,RingBufferGeometry:gl,ShapeGeometry:yl,ShapeBufferGeometry:yl,SphereGeometry:vl,SphereBufferGeometry:vl,TetrahedronGeometry:_l,TetrahedronBufferGeometry:_l,TextGeometry:xl,TextBufferGeometry:xl,TorusGeometry:bl,TorusBufferGeometry:bl,TorusKnotGeometry:wl,TorusKnotBufferGeometry:wl,TubeGeometry:Al,TubeBufferGeometry:Al,WireframeGeometry:El});class Tl extends He{constructor(t){super(),this.type="ShadowMaterial",this.color=new Je(0),this.transparent=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this}}Tl.prototype.isShadowMaterial=!0;class Il extends He{constructor(t){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Je(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Je(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new yt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this}}Il.prototype.isMeshStandardMaterial=!0;class Cl extends Il{constructor(t){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new yt(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return ut(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.sheenTint=new Je(0),this.transmission=0,this.transmissionMap=null,this.thickness=.01,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationTint=new Je(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularTint=new Je(1,1,1),this.specularTintMap=null,this._clearcoat=0,this._transmission=0,this.setValues(t)}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.ior=t.ior,this.sheenTint.copy(t.sheenTint),this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationTint.copy(t.attenuationTint),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularTint.copy(t.specularTint),this.specularTintMap=t.specularTintMap,this}}Cl.prototype.isMeshPhysicalMaterial=!0;class Pl extends He{constructor(t){super(),this.type="MeshPhongMaterial",this.color=new Je(16777215),this.specular=new Je(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Je(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new yt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this}}Pl.prototype.isMeshPhongMaterial=!0;class Ll extends He{constructor(t){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Je(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Je(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new yt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this}}Ll.prototype.isMeshToonMaterial=!0;class Dl extends He{constructor(t){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new yt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}Dl.prototype.isMeshNormalMaterial=!0;class Rl extends He{constructor(t){super(),this.type="MeshLambertMaterial",this.color=new Je(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Je(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this}}Rl.prototype.isMeshLambertMaterial=!0;class Ol extends He{constructor(t){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Je(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new yt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.flatShading=t.flatShading,this}}Ol.prototype.isMeshMatcapMaterial=!0;class kl extends zs{constructor(t){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}kl.prototype.isLineDashedMaterial=!0;var Nl=Object.freeze({__proto__:null,ShadowMaterial:Tl,SpriteMaterial:is,RawShaderMaterial:xn,ShaderMaterial:qi,PointsMaterial:Ys,MeshPhysicalMaterial:Cl,MeshStandardMaterial:Il,MeshPhongMaterial:Pl,MeshToonMaterial:Ll,MeshNormalMaterial:Dl,MeshLambertMaterial:Rl,MeshDepthMaterial:No,MeshDistanceMaterial:Bo,MeshBasicMaterial:Ke,MeshMatcapMaterial:Ol,LineDashedMaterial:kl,LineBasicMaterial:zs,Material:He});const Bl={arraySlice:function(t,e,i){return Bl.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==i?i:t.length)):t.slice(e,i)},convertArray:function(t,e,i){return!t||!i&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){const e=t.length,i=new Array(e);for(let t=0;t!==e;++t)i[t]=t;return i.sort((function(e,i){return t[e]-t[i]})),i},sortedArray:function(t,e,i){const n=t.length,r=new t.constructor(n);for(let o=0,s=0;s!==n;++o){const n=i[o]*e;for(let i=0;i!==e;++i)r[s++]=t[n+i]}return r},flattenJSON:function(t,e,i,n){let r=1,o=t[0];for(;void 0!==o&&void 0===o[n];)o=t[r++];if(void 0===o)return;let s=o[n];if(void 0!==s)if(Array.isArray(s))do{s=o[n],void 0!==s&&(e.push(o.time),i.push.apply(i,s)),o=t[r++]}while(void 0!==o);else if(void 0!==s.toArray)do{s=o[n],void 0!==s&&(e.push(o.time),s.toArray(i,i.length)),o=t[r++]}while(void 0!==o);else do{s=o[n],void 0!==s&&(e.push(o.time),i.push(s)),o=t[r++]}while(void 0!==o)},subclip:function(t,e,i,n,r=30){const o=t.clone();o.name=e;const s=[];for(let t=0;t<o.tracks.length;++t){const e=o.tracks[t],a=e.getValueSize(),l=[],c=[];for(let t=0;t<e.times.length;++t){const o=e.times[t]*r;if(!(o<i||o>=n)){l.push(e.times[t]);for(let i=0;i<a;++i)c.push(e.values[t*a+i])}}0!==l.length&&(e.times=Bl.convertArray(l,e.times.constructor),e.values=Bl.convertArray(c,e.values.constructor),s.push(e))}o.tracks=s;let a=1/0;for(let t=0;t<o.tracks.length;++t)a>o.tracks[t].times[0]&&(a=o.tracks[t].times[0]);for(let t=0;t<o.tracks.length;++t)o.tracks[t].shift(-1*a);return o.resetDuration(),o},makeClipAdditive:function(t,e=0,i=t,n=30){n<=0&&(n=30);const r=i.tracks.length,o=e/n;for(let e=0;e<r;++e){const n=i.tracks[e],r=n.ValueTypeName;if("bool"===r||"string"===r)continue;const s=t.tracks.find((function(t){return t.name===n.name&&t.ValueTypeName===r}));if(void 0===s)continue;let a=0;const l=n.getValueSize();n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(a=l/3);let c=0;const u=s.getValueSize();s.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(c=u/3);const h=n.times.length-1;let p;if(o<=n.times[0]){const t=a,e=l-a;p=Bl.arraySlice(n.values,t,e)}else if(o>=n.times[h]){const t=h*l+a,e=t+l-a;p=Bl.arraySlice(n.values,t,e)}else{const t=n.createInterpolant(),e=a,i=l-a;t.evaluate(o),p=Bl.arraySlice(t.resultBuffer,e,i)}"quaternion"===r&&(new It).fromArray(p).normalize().conjugate().toArray(p);const d=s.times.length;for(let t=0;t<d;++t){const e=t*u+c;if("quaternion"===r)It.multiplyQuaternionsFlat(s.values,e,p,0,s.values,e);else{const t=u-2*c;for(let i=0;i<t;++i)s.values[e+i]-=p[i]}}}return t.blendMode=q,t}};class zl{constructor(t,e,i,n){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==n?n:new e.constructor(i),this.sampleValues=e,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(t){const e=this.parameterPositions;let i=this._cachedIndex,n=e[i],r=e[i-1];t:{e:{let o;i:{n:if(!(t<n)){for(let o=i+2;;){if(void 0===n){if(t<r)break n;return i=e.length,this._cachedIndex=i,this.afterEnd_(i-1,t,r)}if(i===o)break;if(r=n,n=e[++i],t<n)break e}o=e.length;break i}if(t>=r)break t;{const s=e[1];t<s&&(i=2,r=s);for(let o=i-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,t,n);if(i===o)break;if(n=r,r=e[--i-1],t>=r)break e}o=i,i=0}}for(;i<o;){const n=i+o>>>1;t<e[n]?o=n:i=n+1}if(n=e[i],r=e[i-1],void 0===r)return this._cachedIndex=0,this.beforeStart_(0,t,n);if(void 0===n)return i=e.length,this._cachedIndex=i,this.afterEnd_(i-1,r,t)}this._cachedIndex=i,this.intervalChanged_(i,r,n)}return this.interpolate_(i,r,t,n)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){const e=this.resultBuffer,i=this.sampleValues,n=this.valueSize,r=t*n;for(let t=0;t!==n;++t)e[t]=i[r+t];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}zl.prototype.beforeStart_=zl.prototype.copySampleValue_,zl.prototype.afterEnd_=zl.prototype.copySampleValue_;class Fl extends zl{constructor(t,e,i,n){super(t,e,i,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:G,endingEnd:G}}intervalChanged_(t,e,i){const n=this.parameterPositions;let r=t-2,o=t+1,s=n[r],a=n[o];if(void 0===s)switch(this.getSettings_().endingStart){case j:r=t,s=2*e-i;break;case H:r=n.length-2,s=e+n[r]-n[r+1];break;default:r=t,s=i}if(void 0===a)switch(this.getSettings_().endingEnd){case j:o=t,a=2*i-e;break;case H:o=1,a=i+n[1]-n[0];break;default:o=t-1,a=e}const l=.5*(i-e),c=this.valueSize;this._weightPrev=l/(e-s),this._weightNext=l/(a-i),this._offsetPrev=r*c,this._offsetNext=o*c}interpolate_(t,e,i,n){const r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=t*s,l=a-s,c=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,p=this._weightNext,d=(i-e)/(n-e),f=d*d,m=f*d,g=-h*m+2*h*f-h*d,y=(1+h)*m+(-1.5-2*h)*f+(-.5+h)*d+1,v=(-1-p)*m+(1.5+p)*f+.5*d,_=p*m-p*f;for(let t=0;t!==s;++t)r[t]=g*o[c+t]+y*o[l+t]+v*o[a+t]+_*o[u+t];return r}}class Vl extends zl{constructor(t,e,i,n){super(t,e,i,n)}interpolate_(t,e,i,n){const r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=t*s,l=a-s,c=(i-e)/(n-e),u=1-c;for(let t=0;t!==s;++t)r[t]=o[l+t]*u+o[a+t]*c;return r}}class Ul extends zl{constructor(t,e,i,n){super(t,e,i,n)}interpolate_(t){return this.copySampleValue_(t-1)}}class Gl{constructor(t,e,i,n){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Bl.convertArray(e,this.TimeBufferType),this.values=Bl.convertArray(i,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation)}static toJSON(t){const e=t.constructor;let i;if(e.toJSON!==this.toJSON)i=e.toJSON(t);else{i={name:t.name,times:Bl.convertArray(t.times,Array),values:Bl.convertArray(t.values,Array)};const e=t.getInterpolation();e!==t.DefaultInterpolation&&(i.interpolation=e)}return i.type=t.ValueTypeName,i}InterpolantFactoryMethodDiscrete(t){return new Ul(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new Vl(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new Fl(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case F:e=this.InterpolantFactoryMethodDiscrete;break;case V:e=this.InterpolantFactoryMethodLinear;break;case U:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){const e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(e);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",e),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return F;case this.InterpolantFactoryMethodLinear:return V;case this.InterpolantFactoryMethodSmooth:return U}}getValueSize(){return this.values.length/this.times.length}shift(t){if(0!==t){const e=this.times;for(let i=0,n=e.length;i!==n;++i)e[i]+=t}return this}scale(t){if(1!==t){const e=this.times;for(let i=0,n=e.length;i!==n;++i)e[i]*=t}return this}trim(t,e){const i=this.times,n=i.length;let r=0,o=n-1;for(;r!==n&&i[r]<t;)++r;for(;-1!==o&&i[o]>e;)--o;if(++o,0!==r||o!==n){r>=o&&(o=Math.max(o,1),r=o-1);const t=this.getValueSize();this.times=Bl.arraySlice(i,r,o),this.values=Bl.arraySlice(this.values,r*t,o*t)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const i=this.times,n=this.values,r=i.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let o=null;for(let e=0;e!==r;e++){const n=i[e];if("number"==typeof n&&isNaN(n)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,n),t=!1;break}if(null!==o&&o>n){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,n,o),t=!1;break}o=n}if(void 0!==n&&Bl.isTypedArray(n))for(let e=0,i=n.length;e!==i;++e){const i=n[e];if(isNaN(i)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,i),t=!1;break}}return t}optimize(){const t=Bl.arraySlice(this.times),e=Bl.arraySlice(this.values),i=this.getValueSize(),n=this.getInterpolation()===U,r=t.length-1;let o=1;for(let s=1;s<r;++s){let r=!1;const a=t[s];if(a!==t[s+1]&&(1!==s||a!==t[0]))if(n)r=!0;else{const t=s*i,n=t-i,o=t+i;for(let s=0;s!==i;++s){const i=e[t+s];if(i!==e[n+s]||i!==e[o+s]){r=!0;break}}}if(r){if(s!==o){t[o]=t[s];const n=s*i,r=o*i;for(let t=0;t!==i;++t)e[r+t]=e[n+t]}++o}}if(r>0){t[o]=t[r];for(let t=r*i,n=o*i,s=0;s!==i;++s)e[n+s]=e[t+s];++o}return o!==t.length?(this.times=Bl.arraySlice(t,0,o),this.values=Bl.arraySlice(e,0,o*i)):(this.times=t,this.values=e),this}clone(){const t=Bl.arraySlice(this.times,0),e=Bl.arraySlice(this.values,0),i=new this.constructor(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}}Gl.prototype.TimeBufferType=Float32Array,Gl.prototype.ValueBufferType=Float32Array,Gl.prototype.DefaultInterpolation=V;class jl extends Gl{}jl.prototype.ValueTypeName="bool",jl.prototype.ValueBufferType=Array,jl.prototype.DefaultInterpolation=F,jl.prototype.InterpolantFactoryMethodLinear=void 0,jl.prototype.InterpolantFactoryMethodSmooth=void 0;class Hl extends Gl{}Hl.prototype.ValueTypeName="color";class Wl extends Gl{}Wl.prototype.ValueTypeName="number";class ql extends zl{constructor(t,e,i,n){super(t,e,i,n)}interpolate_(t,e,i,n){const r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=(i-e)/(n-e);let l=t*s;for(let t=l+s;l!==t;l+=4)It.slerpFlat(r,0,o,l-s,o,l,a);return r}}class Xl extends Gl{InterpolantFactoryMethodLinear(t){return new ql(this.times,this.values,this.getValueSize(),t)}}Xl.prototype.ValueTypeName="quaternion",Xl.prototype.DefaultInterpolation=V,Xl.prototype.InterpolantFactoryMethodSmooth=void 0;class Zl extends Gl{}Zl.prototype.ValueTypeName="string",Zl.prototype.ValueBufferType=Array,Zl.prototype.DefaultInterpolation=F,Zl.prototype.InterpolantFactoryMethodLinear=void 0,Zl.prototype.InterpolantFactoryMethodSmooth=void 0;class Yl extends Gl{}Yl.prototype.ValueTypeName="vector";class Ql{constructor(t,e=-1,i,n=2500){this.name=t,this.tracks=i,this.duration=e,this.blendMode=n,this.uuid=ct(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],i=t.tracks,n=1/(t.fps||1);for(let t=0,r=i.length;t!==r;++t)e.push(Jl(i[t]).scale(n));const r=new this(t.name,t.duration,e,t.blendMode);return r.uuid=t.uuid,r}static toJSON(t){const e=[],i=t.tracks,n={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,n=i.length;t!==n;++t)e.push(Gl.toJSON(i[t]));return n}static CreateFromMorphTargetSequence(t,e,i,n){const r=e.length,o=[];for(let t=0;t<r;t++){let s=[],a=[];s.push((t+r-1)%r,t,(t+1)%r),a.push(0,1,0);const l=Bl.getKeyframeOrder(s);s=Bl.sortedArray(s,1,l),a=Bl.sortedArray(a,1,l),n||0!==s[0]||(s.push(r),a.push(a[0])),o.push(new Wl(".morphTargetInfluences["+e[t].name+"]",s,a).scale(1/i))}return new this(t,-1,o)}static findByName(t,e){let i=t;if(!Array.isArray(t)){const e=t;i=e.geometry&&e.geometry.animations||e.animations}for(let t=0;t<i.length;t++)if(i[t].name===e)return i[t];return null}static CreateClipsFromMorphTargetSequences(t,e,i){const n={},r=/^([\w-]*?)([\d]+)$/;for(let e=0,i=t.length;e<i;e++){const i=t[e],o=i.name.match(r);if(o&&o.length>1){const t=o[1];let e=n[t];e||(n[t]=e=[]),e.push(i)}}const o=[];for(const t in n)o.push(this.CreateFromMorphTargetSequence(t,n[t],e,i));return o}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(t,e,i,n,r){if(0!==i.length){const o=[],s=[];Bl.flattenJSON(i,o,s,n),0!==o.length&&r.push(new t(e,o,s))}},n=[],r=t.name||"default",o=t.fps||30,s=t.blendMode;let a=t.length||-1;const l=t.hierarchy||[];for(let t=0;t<l.length;t++){const r=l[t].keys;if(r&&0!==r.length)if(r[0].morphTargets){const t={};let e;for(e=0;e<r.length;e++)if(r[e].morphTargets)for(let i=0;i<r[e].morphTargets.length;i++)t[r[e].morphTargets[i]]=-1;for(const i in t){const t=[],o=[];for(let n=0;n!==r[e].morphTargets.length;++n){const n=r[e];t.push(n.time),o.push(n.morphTarget===i?1:0)}n.push(new Wl(".morphTargetInfluence["+i+"]",t,o))}a=t.length*(o||1)}else{const o=".bones["+e[t].name+"]";i(Yl,o+".position",r,"pos",n),i(Xl,o+".quaternion",r,"rot",n),i(Yl,o+".scale",r,"scl",n)}}return 0===n.length?null:new this(r,a,n,s)}resetDuration(){let t=0;for(let e=0,i=this.tracks.length;e!==i;++e){const i=this.tracks[e];t=Math.max(t,i.times[i.times.length-1])}return this.duration=t,this}trim(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this}validate(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t}optimize(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}clone(){const t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new this.constructor(this.name,this.duration,t,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function Jl(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Wl;case"vector":case"vector2":case"vector3":case"vector4":return Yl;case"color":return Hl;case"quaternion":return Xl;case"bool":case"boolean":return jl;case"string":return Zl}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){const e=[],i=[];Bl.flattenJSON(t.keys,e,i,"value"),t.times=e,t.values=i}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}const Kl={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};class $l{constructor(t,e,i){const n=this;let r,o=!1,s=0,a=0;const l=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this.itemStart=function(t){a++,!1===o&&void 0!==n.onStart&&n.onStart(t,s,a),o=!0},this.itemEnd=function(t){s++,void 0!==n.onProgress&&n.onProgress(t,s,a),s===a&&(o=!1,void 0!==n.onLoad&&n.onLoad())},this.itemError=function(t){void 0!==n.onError&&n.onError(t)},this.resolveURL=function(t){return r?r(t):t},this.setURLModifier=function(t){return r=t,this},this.addHandler=function(t,e){return l.push(t,e),this},this.removeHandler=function(t){const e=l.indexOf(t);return-1!==e&&l.splice(e,2),this},this.getHandler=function(t){for(let e=0,i=l.length;e<i;e+=2){const i=l[e],n=l[e+1];if(i.global&&(i.lastIndex=0),i.test(t))return n}return null}}}const tc=new $l;class ec{constructor(t){this.manager=void 0!==t?t:tc,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){const i=this;return new Promise((function(n,r){i.load(t,n,e,r)}))}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}const ic={};class nc extends ec{constructor(t){super(t)}load(t,e,i,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,o=Kl.get(t);if(void 0!==o)return r.manager.itemStart(t),setTimeout((function(){e&&e(o),r.manager.itemEnd(t)}),0),o;if(void 0!==ic[t])return void ic[t].push({onLoad:e,onProgress:i,onError:n});const s=t.match(/^data:(.*?)(;base64)?,(.*)$/);let a;if(s){const i=s[1],o=!!s[2];let a=s[3];a=decodeURIComponent(a),o&&(a=atob(a));try{let n;const o=(this.responseType||"").toLowerCase();switch(o){case"arraybuffer":case"blob":const t=new Uint8Array(a.length);for(let e=0;e<a.length;e++)t[e]=a.charCodeAt(e);n="blob"===o?new Blob([t.buffer],{type:i}):t.buffer;break;case"document":const e=new DOMParser;n=e.parseFromString(a,i);break;case"json":n=JSON.parse(a);break;default:n=a}setTimeout((function(){e&&e(n),r.manager.itemEnd(t)}),0)}catch(e){setTimeout((function(){n&&n(e),r.manager.itemError(t),r.manager.itemEnd(t)}),0)}}else{ic[t]=[],ic[t].push({onLoad:e,onProgress:i,onError:n}),a=new XMLHttpRequest,a.open("GET",t,!0),a.addEventListener("load",(function(e){const i=this.response,n=ic[t];if(delete ic[t],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),Kl.add(t,i);for(let t=0,e=n.length;t<e;t++){const e=n[t];e.onLoad&&e.onLoad(i)}r.manager.itemEnd(t)}else{for(let t=0,i=n.length;t<i;t++){const i=n[t];i.onError&&i.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)}}),!1),a.addEventListener("progress",(function(e){const i=ic[t];for(let t=0,n=i.length;t<n;t++){const n=i[t];n.onProgress&&n.onProgress(e)}}),!1),a.addEventListener("error",(function(e){const i=ic[t];delete ic[t];for(let t=0,n=i.length;t<n;t++){const n=i[t];n.onError&&n.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)}),!1),a.addEventListener("abort",(function(e){const i=ic[t];delete ic[t];for(let t=0,n=i.length;t<n;t++){const n=i[t];n.onError&&n.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)}),!1),void 0!==this.responseType&&(a.responseType=this.responseType),void 0!==this.withCredentials&&(a.withCredentials=this.withCredentials),a.overrideMimeType&&a.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain");for(const t in this.requestHeader)a.setRequestHeader(t,this.requestHeader[t]);a.send(null)}return r.manager.itemStart(t),a}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class rc extends ec{constructor(t){super(t)}load(t,e,i,n){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,o=Kl.get(t);if(void 0!==o)return r.manager.itemStart(t),setTimeout((function(){e&&e(o),r.manager.itemEnd(t)}),0),o;const s=document.createElementNS("http://www.w3.org/1999/xhtml","img");function a(){s.removeEventListener("load",a,!1),s.removeEventListener("error",l,!1),Kl.add(t,this),e&&e(this),r.manager.itemEnd(t)}function l(e){s.removeEventListener("load",a,!1),s.removeEventListener("error",l,!1),n&&n(e),r.manager.itemError(t),r.manager.itemEnd(t)}return s.addEventListener("load",a,!1),s.addEventListener("error",l,!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),r.manager.itemStart(t),s.src=t,s}}class oc extends ec{constructor(t){super(t)}load(t,e,i,n){const r=new Ji,o=new rc(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let s=0;function a(i){o.load(t[i],(function(t){r.images[i]=t,s++,6===s&&(r.needsUpdate=!0,e&&e(r))}),void 0,n)}for(let e=0;e<t.length;++e)a(e);return r}}class sc extends ec{constructor(t){super(t)}load(t,e,i,n){const r=this,o=new Is,s=new nc(this.manager);return s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setPath(this.path),s.setWithCredentials(r.withCredentials),s.load(t,(function(t){const i=r.parse(t);i&&(void 0!==i.image?o.image=i.image:void 0!==i.data&&(o.image.width=i.width,o.image.height=i.height,o.image.data=i.data),o.wrapS=void 0!==i.wrapS?i.wrapS:h,o.wrapT=void 0!==i.wrapT?i.wrapT:h,o.magFilter=void 0!==i.magFilter?i.magFilter:g,o.minFilter=void 0!==i.minFilter?i.minFilter:g,o.anisotropy=void 0!==i.anisotropy?i.anisotropy:1,void 0!==i.encoding&&(o.encoding=i.encoding),void 0!==i.flipY&&(o.flipY=i.flipY),void 0!==i.format&&(o.format=i.format),void 0!==i.type&&(o.type=i.type),void 0!==i.mipmaps&&(o.mipmaps=i.mipmaps,o.minFilter=v),1===i.mipmapCount&&(o.minFilter=g),void 0!==i.generateMipmaps&&(o.generateMipmaps=i.generateMipmaps),o.needsUpdate=!0,e&&e(o,i))}),i,n),o}}class ac extends ec{constructor(t){super(t)}load(t,e,i,n){const r=new wt,o=new rc(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(t,(function(i){r.image=i;const n=t.search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/);r.format=n?S:M,r.needsUpdate=!0,void 0!==e&&e(r)}),i,n),r}}class lc extends ga{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){const t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new Pa(e,t))}getPoint(t){const e=t*this.getLength(),i=this.getCurveLengths();let n=0;for(;n<i.length;){if(i[n]>=e){const t=i[n]-e,r=this.curves[n],o=r.getLength(),s=0===o?0:1-t/o;return r.getPointAt(s)}n++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let i=0,n=this.curves.length;i<n;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t,t}getSpacedPoints(t=40){const e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){const e=[];let i;for(let n=0,r=this.curves;n<r.length;n++){const o=r[n],s=o&&o.isEllipseCurve?2*t:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?t*o.points.length:t,a=o.getPoints(s);for(let t=0;t<a.length;t++){const n=a[t];i&&i.equals(n)||(e.push(n),i=n)}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){const i=t.curves[e];this.curves.push(i.clone())}return this.autoClose=t.autoClose,this}toJSON(){const t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,i=this.curves.length;e<i;e++){const i=this.curves[e];t.curves.push(i.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){const i=t.curves[e];this.curves.push((new ka[i.type]).fromJSON(i))}return this}}class cc extends lc{constructor(t){super(),this.type="Path",this.currentPoint=new yt,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,i=t.length;e<i;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){const i=new Pa(this.currentPoint.clone(),new yt(t,e));return this.curves.push(i),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,i,n){const r=new Da(this.currentPoint.clone(),new yt(t,e),new yt(i,n));return this.curves.push(r),this.currentPoint.set(i,n),this}bezierCurveTo(t,e,i,n,r,o){const s=new Ia(this.currentPoint.clone(),new yt(t,e),new yt(i,n),new yt(r,o));return this.curves.push(s),this.currentPoint.set(r,o),this}splineThru(t){const e=[this.currentPoint.clone()].concat(t),i=new Oa(e);return this.curves.push(i),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,i,n,r,o){const s=this.currentPoint.x,a=this.currentPoint.y;return this.absarc(t+s,e+a,i,n,r,o),this}absarc(t,e,i,n,r,o){return this.absellipse(t,e,i,i,n,r,o),this}ellipse(t,e,i,n,r,o,s,a){const l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(t+l,e+c,i,n,r,o,s,a),this}absellipse(t,e,i,n,r,o,s,a){const l=new ya(t,e,i,n,r,o,s,a);if(this.curves.length>0){const t=l.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class uc extends cc{constructor(t){super(t),this.uuid=ct(),this.type="Shape",this.holes=[]}getPointsHoles(t){const e=[];for(let i=0,n=this.holes.length;i<n;i++)e[i]=this.holes[i].getPoints(t);return e}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t),this.holes=[];for(let e=0,i=t.holes.length;e<i;e++){const i=t.holes[e];this.holes.push(i.clone())}return this}toJSON(){const t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let e=0,i=this.holes.length;e<i;e++){const i=this.holes[e];t.holes.push(i.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let e=0,i=t.holes.length;e<i;e++){const i=t.holes[e];this.holes.push((new cc).fromJSON(i))}return this}}class hc extends Le{constructor(t,e=1){super(),this.type="Light",this.color=new Je(t),this.intensity=e}dispose(){}copy(t){return super.copy(t),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}hc.prototype.isLight=!0;class pc extends hc{constructor(t,e,i){super(t,i),this.type="HemisphereLight",this.position.copy(Le.DefaultUp),this.updateMatrix(),this.groundColor=new Je(e)}copy(t){return hc.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}pc.prototype.isHemisphereLight=!0;const dc=new se,fc=new Ct,mc=new Ct;class gc{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new yt(512,512),this.map=null,this.mapPass=null,this.matrix=new se,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new sn,this._frameExtents=new yt(1,1),this._viewportCount=1,this._viewports=[new Et(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,i=this.matrix;fc.setFromMatrixPosition(t.matrixWorld),e.position.copy(fc),mc.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(mc),e.updateMatrixWorld(),dc.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(dc),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(e.projectionMatrix),i.multiply(e.matrixWorldInverse)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const t={};return 0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}class yc extends gc{constructor(){super(new Zi(50,1,.5,500)),this.focus=1}updateMatrices(t){const e=this.camera,i=2*lt*t.angle*this.focus,n=this.mapSize.width/this.mapSize.height,r=t.distance||e.far;i===e.fov&&n===e.aspect&&r===e.far||(e.fov=i,e.aspect=n,e.far=r,e.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this}}yc.prototype.isSpotLightShadow=!0;class vc extends hc{constructor(t,e,i=0,n=Math.PI/3,r=0,o=1){super(t,e),this.type="SpotLight",this.position.copy(Le.DefaultUp),this.updateMatrix(),this.target=new Le,this.distance=i,this.angle=n,this.penumbra=r,this.decay=o,this.shadow=new yc}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}vc.prototype.isSpotLight=!0;const _c=new se,xc=new Ct,bc=new Ct;class wc extends gc{constructor(){super(new Zi(90,1,.5,500)),this._frameExtents=new yt(4,2),this._viewportCount=6,this._viewports=[new Et(2,1,1,1),new Et(0,1,1,1),new Et(3,1,1,1),new Et(1,1,1,1),new Et(3,0,1,1),new Et(1,0,1,1)],this._cubeDirections=[new Ct(1,0,0),new Ct(-1,0,0),new Ct(0,0,1),new Ct(0,0,-1),new Ct(0,1,0),new Ct(0,-1,0)],this._cubeUps=[new Ct(0,1,0),new Ct(0,1,0),new Ct(0,1,0),new Ct(0,1,0),new Ct(0,0,1),new Ct(0,0,-1)]}updateMatrices(t,e=0){const i=this.camera,n=this.matrix,r=t.distance||i.far;r!==i.far&&(i.far=r,i.updateProjectionMatrix()),xc.setFromMatrixPosition(t.matrixWorld),i.position.copy(xc),bc.copy(i.position),bc.add(this._cubeDirections[e]),i.up.copy(this._cubeUps[e]),i.lookAt(bc),i.updateMatrixWorld(),n.makeTranslation(-xc.x,-xc.y,-xc.z),_c.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(_c)}}wc.prototype.isPointLightShadow=!0;class Ac extends hc{constructor(t,e,i=0,n=1){super(t,e),this.type="PointLight",this.distance=i,this.decay=n,this.shadow=new wc}get power(){return 4*this.intensity*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}Ac.prototype.isPointLight=!0;class Ec extends gc{constructor(){super(new _n(-5,5,5,-5,.5,500))}}Ec.prototype.isDirectionalLightShadow=!0;class Sc extends hc{constructor(t,e){super(t,e),this.type="DirectionalLight",this.position.copy(Le.DefaultUp),this.updateMatrix(),this.target=new Le,this.shadow=new Ec}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}Sc.prototype.isDirectionalLight=!0;class Mc extends hc{constructor(t,e){super(t,e),this.type="AmbientLight"}}Mc.prototype.isAmbientLight=!0;class Tc extends hc{constructor(t,e,i=10,n=10){super(t,e),this.type="RectAreaLight",this.width=i,this.height=n}get power(){return this.intensity*this.width*this.height*Math.PI}set power(t){this.intensity=t/(this.width*this.height*Math.PI)}copy(t){return super.copy(t),this.width=t.width,this.height=t.height,this}toJSON(t){const e=super.toJSON(t);return e.object.width=this.width,e.object.height=this.height,e}}Tc.prototype.isRectAreaLight=!0;class Ic{constructor(){this.coefficients=[];for(let t=0;t<9;t++)this.coefficients.push(new Ct)}set(t){for(let e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this}zero(){for(let t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this}getAt(t,e){const i=t.x,n=t.y,r=t.z,o=this.coefficients;return e.copy(o[0]).multiplyScalar(.282095),e.addScaledVector(o[1],.488603*n),e.addScaledVector(o[2],.488603*r),e.addScaledVector(o[3],.488603*i),e.addScaledVector(o[4],i*n*1.092548),e.addScaledVector(o[5],n*r*1.092548),e.addScaledVector(o[6],.315392*(3*r*r-1)),e.addScaledVector(o[7],i*r*1.092548),e.addScaledVector(o[8],.546274*(i*i-n*n)),e}getIrradianceAt(t,e){const i=t.x,n=t.y,r=t.z,o=this.coefficients;return e.copy(o[0]).multiplyScalar(.886227),e.addScaledVector(o[1],1.023328*n),e.addScaledVector(o[2],1.023328*r),e.addScaledVector(o[3],1.023328*i),e.addScaledVector(o[4],.858086*i*n),e.addScaledVector(o[5],.858086*n*r),e.addScaledVector(o[6],.743125*r*r-.247708),e.addScaledVector(o[7],.858086*i*r),e.addScaledVector(o[8],.429043*(i*i-n*n)),e}add(t){for(let e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this}addScaledSH(t,e){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(t.coefficients[i],e);return this}scale(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this}lerp(t,e){for(let i=0;i<9;i++)this.coefficients[i].lerp(t.coefficients[i],e);return this}equals(t){for(let e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0}copy(t){return this.set(t.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(t,e=0){const i=this.coefficients;for(let n=0;n<9;n++)i[n].fromArray(t,e+3*n);return this}toArray(t=[],e=0){const i=this.coefficients;for(let n=0;n<9;n++)i[n].toArray(t,e+3*n);return t}static getBasisAt(t,e){const i=t.x,n=t.y,r=t.z;e[0]=.282095,e[1]=.488603*n,e[2]=.488603*r,e[3]=.488603*i,e[4]=1.092548*i*n,e[5]=1.092548*n*r,e[6]=.315392*(3*r*r-1),e[7]=1.092548*i*r,e[8]=.546274*(i*i-n*n)}}Ic.prototype.isSphericalHarmonics3=!0;class Cc extends hc{constructor(t=new Ic,e=1){super(void 0,e),this.sh=t}copy(t){return super.copy(t),this.sh.copy(t.sh),this}fromJSON(t){return this.intensity=t.intensity,this.sh.fromArray(t.sh),this}toJSON(t){const e=super.toJSON(t);return e.object.sh=this.sh.toArray(),e}}Cc.prototype.isLightProbe=!0;class Pc extends ec{constructor(t){super(t),this.textures={}}load(t,e,i,n){const r=this,o=new nc(r.manager);o.setPath(r.path),o.setRequestHeader(r.requestHeader),o.setWithCredentials(r.withCredentials),o.load(t,(function(i){try{e(r.parse(JSON.parse(i)))}catch(e){n?n(e):console.error(e),r.manager.itemError(t)}}),i,n)}parse(t){const e=this.textures;function i(t){return void 0===e[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),e[t]}const n=new Nl[t.type];if(void 0!==t.uuid&&(n.uuid=t.uuid),void 0!==t.name&&(n.name=t.name),void 0!==t.color&&void 0!==n.color&&n.color.setHex(t.color),void 0!==t.roughness&&(n.roughness=t.roughness),void 0!==t.metalness&&(n.metalness=t.metalness),void 0!==t.sheenTint&&(n.sheenTint=(new Je).setHex(t.sheenTint)),void 0!==t.emissive&&void 0!==n.emissive&&n.emissive.setHex(t.emissive),void 0!==t.specular&&void 0!==n.specular&&n.specular.setHex(t.specular),void 0!==t.specularIntensity&&(n.specularIntensity=t.specularIntensity),void 0!==t.specularTint&&void 0!==n.specularTint&&n.specularTint.setHex(t.specularTint),void 0!==t.shininess&&(n.shininess=t.shininess),void 0!==t.clearcoat&&(n.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(n.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.transmission&&(n.transmission=t.transmission),void 0!==t.thickness&&(n.thickness=t.thickness),void 0!==t.attenuationDistance&&(n.attenuationDistance=t.attenuationDistance),void 0!==t.attenuationTint&&void 0!==n.attenuationTint&&n.attenuationTint.setHex(t.attenuationTint),void 0!==t.fog&&(n.fog=t.fog),void 0!==t.flatShading&&(n.flatShading=t.flatShading),void 0!==t.blending&&(n.blending=t.blending),void 0!==t.combine&&(n.combine=t.combine),void 0!==t.side&&(n.side=t.side),void 0!==t.shadowSide&&(n.shadowSide=t.shadowSide),void 0!==t.opacity&&(n.opacity=t.opacity),void 0!==t.format&&(n.format=t.format),void 0!==t.transparent&&(n.transparent=t.transparent),void 0!==t.alphaTest&&(n.alphaTest=t.alphaTest),void 0!==t.depthTest&&(n.depthTest=t.depthTest),void 0!==t.depthWrite&&(n.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(n.colorWrite=t.colorWrite),void 0!==t.stencilWrite&&(n.stencilWrite=t.stencilWrite),void 0!==t.stencilWriteMask&&(n.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(n.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(n.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(n.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(n.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(n.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(n.stencilZPass=t.stencilZPass),void 0!==t.wireframe&&(n.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(n.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(n.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(n.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(n.rotation=t.rotation),1!==t.linewidth&&(n.linewidth=t.linewidth),void 0!==t.dashSize&&(n.dashSize=t.dashSize),void 0!==t.gapSize&&(n.gapSize=t.gapSize),void 0!==t.scale&&(n.scale=t.scale),void 0!==t.polygonOffset&&(n.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(n.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(n.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.dithering&&(n.dithering=t.dithering),void 0!==t.alphaToCoverage&&(n.alphaToCoverage=t.alphaToCoverage),void 0!==t.premultipliedAlpha&&(n.premultipliedAlpha=t.premultipliedAlpha),void 0!==t.visible&&(n.visible=t.visible),void 0!==t.toneMapped&&(n.toneMapped=t.toneMapped),void 0!==t.userData&&(n.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?n.vertexColors=t.vertexColors>0:n.vertexColors=t.vertexColors),void 0!==t.uniforms)for(const e in t.uniforms){const r=t.uniforms[e];switch(n.uniforms[e]={},r.type){case"t":n.uniforms[e].value=i(r.value);break;case"c":n.uniforms[e].value=(new Je).setHex(r.value);break;case"v2":n.uniforms[e].value=(new yt).fromArray(r.value);break;case"v3":n.uniforms[e].value=(new Ct).fromArray(r.value);break;case"v4":n.uniforms[e].value=(new Et).fromArray(r.value);break;case"m3":n.uniforms[e].value=(new vt).fromArray(r.value);break;case"m4":n.uniforms[e].value=(new se).fromArray(r.value);break;default:n.uniforms[e].value=r.value}}if(void 0!==t.defines&&(n.defines=t.defines),void 0!==t.vertexShader&&(n.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(n.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(const e in t.extensions)n.extensions[e]=t.extensions[e];if(void 0!==t.shading&&(n.flatShading=1===t.shading),void 0!==t.size&&(n.size=t.size),void 0!==t.sizeAttenuation&&(n.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(n.map=i(t.map)),void 0!==t.matcap&&(n.matcap=i(t.matcap)),void 0!==t.alphaMap&&(n.alphaMap=i(t.alphaMap)),void 0!==t.bumpMap&&(n.bumpMap=i(t.bumpMap)),void 0!==t.bumpScale&&(n.bumpScale=t.bumpScale),void 0!==t.normalMap&&(n.normalMap=i(t.normalMap)),void 0!==t.normalMapType&&(n.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),n.normalScale=(new yt).fromArray(e)}return void 0!==t.displacementMap&&(n.displacementMap=i(t.displacementMap)),void 0!==t.displacementScale&&(n.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(n.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(n.roughnessMap=i(t.roughnessMap)),void 0!==t.metalnessMap&&(n.metalnessMap=i(t.metalnessMap)),void 0!==t.emissiveMap&&(n.emissiveMap=i(t.emissiveMap)),void 0!==t.emissiveIntensity&&(n.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(n.specularMap=i(t.specularMap)),void 0!==t.specularIntensityMap&&(n.specularIntensityMap=i(t.specularIntensityMap)),void 0!==t.specularTintMap&&(n.specularTintMap=i(t.specularTintMap)),void 0!==t.envMap&&(n.envMap=i(t.envMap)),void 0!==t.envMapIntensity&&(n.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(n.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(n.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(n.lightMap=i(t.lightMap)),void 0!==t.lightMapIntensity&&(n.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(n.aoMap=i(t.aoMap)),void 0!==t.aoMapIntensity&&(n.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(n.gradientMap=i(t.gradientMap)),void 0!==t.clearcoatMap&&(n.clearcoatMap=i(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(n.clearcoatRoughnessMap=i(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(n.clearcoatNormalMap=i(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(n.clearcoatNormalScale=(new yt).fromArray(t.clearcoatNormalScale)),void 0!==t.transmissionMap&&(n.transmissionMap=i(t.transmissionMap)),void 0!==t.thicknessMap&&(n.thicknessMap=i(t.thicknessMap)),n}setTextures(t){return this.textures=t,this}}class Lc{static decodeText(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);let e="";for(let i=0,n=t.length;i<n;i++)e+=String.fromCharCode(t[i]);try{return decodeURIComponent(escape(e))}catch(t){return e}}static extractUrlBase(t){const e=t.lastIndexOf("/");return-1===e?"./":t.substr(0,e+1)}}class Dc extends wi{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}clone(){return(new this.constructor).copy(this)}toJSON(){const t=super.toJSON(this);return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}Dc.prototype.isInstancedBufferGeometry=!0;class Rc extends ec{constructor(t){super(t)}load(t,e,i,n){const r=this,o=new nc(r.manager);o.setPath(r.path),o.setRequestHeader(r.requestHeader),o.setWithCredentials(r.withCredentials),o.load(t,(function(i){try{e(r.parse(JSON.parse(i)))}catch(e){n?n(e):console.error(e),r.manager.itemError(t)}}),i,n)}parse(t){const e={},i={};function n(t,n){if(void 0!==e[n])return e[n];const r=t.interleavedBuffers[n],o=function(t,e){if(void 0!==i[e])return i[e];const n=t.arrayBuffers[e],r=new Uint32Array(n).buffer;return i[e]=r,r}(t,r.buffer),s=fi(r.type,o),a=new $o(s,r.stride);return a.uuid=r.uuid,e[n]=a,a}const r=t.isInstancedBufferGeometry?new Dc:new wi,o=t.data.index;if(void 0!==o){const t=fi(o.type,o.array);r.setIndex(new ei(t,1))}const s=t.data.attributes;for(const e in s){const i=s[e];let o;if(i.isInterleavedBufferAttribute){const e=n(t.data,i.data);o=new es(e,i.itemSize,i.offset,i.normalized)}else{const t=fi(i.type,i.array);o=new(i.isInstancedBufferAttribute?Ds:ei)(t,i.itemSize,i.normalized)}void 0!==i.name&&(o.name=i.name),void 0!==i.usage&&o.setUsage(i.usage),void 0!==i.updateRange&&(o.updateRange.offset=i.updateRange.offset,o.updateRange.count=i.updateRange.count),r.setAttribute(e,o)}const a=t.data.morphAttributes;if(a)for(const e in a){const i=a[e],o=[];for(let e=0,r=i.length;e<r;e++){const r=i[e];let s;if(r.isInterleavedBufferAttribute){const e=n(t.data,r.data);s=new es(e,r.itemSize,r.offset,r.normalized)}else{const t=fi(r.type,r.array);s=new ei(t,r.itemSize,r.normalized)}void 0!==r.name&&(s.name=r.name),o.push(s)}r.morphAttributes[e]=o}t.data.morphTargetsRelative&&(r.morphTargetsRelative=!0);const l=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==l)for(let t=0,e=l.length;t!==e;++t){const e=l[t];r.addGroup(e.start,e.count,e.materialIndex)}const c=t.data.boundingSphere;if(void 0!==c){const t=new Ct;void 0!==c.center&&t.fromArray(c.center),r.boundingSphere=new Jt(t,c.radius)}return t.name&&(r.name=t.name),t.userData&&(r.userData=t.userData),r}}const Oc={UVMapping:n,CubeReflectionMapping:r,CubeRefractionMapping:o,EquirectangularReflectionMapping:s,EquirectangularRefractionMapping:a,CubeUVReflectionMapping:l,CubeUVRefractionMapping:c},kc={RepeatWrapping:u,ClampToEdgeWrapping:h,MirroredRepeatWrapping:p},Nc={NearestFilter:d,NearestMipmapNearestFilter:f,NearestMipmapLinearFilter:m,LinearFilter:g,LinearMipmapNearestFilter:y,LinearMipmapLinearFilter:v};class Bc extends ec{constructor(t){super(t),"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(t){return this.options=t,this}load(t,e,i,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,o=Kl.get(t);if(void 0!==o)return r.manager.itemStart(t),setTimeout((function(){e&&e(o),r.manager.itemEnd(t)}),0),o;const s={};s.credentials="anonymous"===this.crossOrigin?"same-origin":"include",s.headers=this.requestHeader,fetch(t,s).then((function(t){return t.blob()})).then((function(t){return createImageBitmap(t,Object.assign(r.options,{colorSpaceConversion:"none"}))})).then((function(i){Kl.add(t,i),e&&e(i),r.manager.itemEnd(t)})).catch((function(e){n&&n(e),r.manager.itemError(t),r.manager.itemEnd(t)})),r.manager.itemStart(t)}}Bc.prototype.isImageBitmapLoader=!0;class zc{constructor(){this.type="ShapePath",this.color=new Je,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new cc,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.currentPath.quadraticCurveTo(t,e,i,n),this}bezierCurveTo(t,e,i,n,r,o){return this.currentPath.bezierCurveTo(t,e,i,n,r,o),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t,e){function i(t){const e=[];for(let i=0,n=t.length;i<n;i++){const n=t[i],r=new uc;r.curves=n.curves,e.push(r)}return e}function n(t,e){const i=e.length;let n=!1;for(let r=i-1,o=0;o<i;r=o++){let i=e[r],s=e[o],a=s.x-i.x,l=s.y-i.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(i=e[o],a=-a,s=e[r],l=-l),t.y<i.y||t.y>s.y)continue;if(t.y===i.y){if(t.x===i.x)return!0}else{const e=l*(t.x-i.x)-a*(t.y-i.y);if(0===e)return!0;if(e<0)continue;n=!n}}else{if(t.y!==i.y)continue;if(s.x<=t.x&&t.x<=i.x||i.x<=t.x&&t.x<=s.x)return!0}}return n}const r=al.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===e)return i(o);let s,a,l;const c=[];if(1===o.length)return a=o[0],l=new uc,l.curves=a.curves,c.push(l),c;let u=!r(o[0].getPoints());u=t?!u:u;const h=[],p=[];let d,f,m=[],g=0;p[g]=void 0,m[g]=[];for(let e=0,i=o.length;e<i;e++)a=o[e],d=a.getPoints(),s=r(d),s=t?!s:s,s?(!u&&p[g]&&g++,p[g]={s:new uc,p:d},p[g].s.curves=a.curves,u&&g++,m[g]=[]):m[g].push({h:a,p:d[0]});if(!p[0])return i(o);if(p.length>1){let t=!1;const e=[];for(let t=0,e=p.length;t<e;t++)h[t]=[];for(let i=0,r=p.length;i<r;i++){const r=m[i];for(let o=0;o<r.length;o++){const s=r[o];let a=!0;for(let r=0;r<p.length;r++)n(s.p,p[r].p)&&(i!==r&&e.push({froms:i,tos:r,hole:o}),a?(a=!1,h[r].push(s)):t=!0);a&&h[i].push(s)}}e.length>0&&(t||(m=h))}for(let t=0,e=p.length;t<e;t++){l=p[t].s,c.push(l),f=m[t];for(let t=0,e=f.length;t<e;t++)l.holes.push(f[t].h)}return c}}class Fc{constructor(t){this.type="Font",this.data=t}generateShapes(t,e=100){const i=[],n=function(t,e,i){const n=Array.from(t),r=e/i.resolution,o=(i.boundingBox.yMax-i.boundingBox.yMin+i.underlineThickness)*r,s=[];let a=0,l=0;for(let t=0;t<n.length;t++){const e=n[t];if("\n"===e)a=0,l-=o;else{const t=Vc(e,r,a,l,i);a+=t.offsetX,s.push(t.path)}}return s}(t,e,this.data);for(let t=0,e=n.length;t<e;t++)Array.prototype.push.apply(i,n[t].toShapes());return i}}function Vc(t,e,i,n,r){const o=r.glyphs[t]||r.glyphs["?"];if(!o)return void console.error('THREE.Font: character "'+t+'" does not exists in font family '+r.familyName+".");const s=new zc;let a,l,c,u,h,p,d,f;if(o.o){const t=o._cachedOutline||(o._cachedOutline=o.o.split(" "));for(let r=0,o=t.length;r<o;)switch(t[r++]){case"m":a=t[r++]*e+i,l=t[r++]*e+n,s.moveTo(a,l);break;case"l":a=t[r++]*e+i,l=t[r++]*e+n,s.lineTo(a,l);break;case"q":c=t[r++]*e+i,u=t[r++]*e+n,h=t[r++]*e+i,p=t[r++]*e+n,s.quadraticCurveTo(h,p,c,u);break;case"b":c=t[r++]*e+i,u=t[r++]*e+n,h=t[r++]*e+i,p=t[r++]*e+n,d=t[r++]*e+i,f=t[r++]*e+n,s.bezierCurveTo(h,p,d,f,c,u)}}return{offsetX:o.ha*e,path:s}}let Uc;Fc.prototype.isFont=!0;const Gc={getContext:function(){return void 0===Uc&&(Uc=new(window.AudioContext||window.webkitAudioContext)),Uc},setContext:function(t){Uc=t}};class jc extends ec{constructor(t){super(t)}load(t,e,i,n){const r=this,o=new nc(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,(function(i){try{const t=i.slice(0);Gc.getContext().decodeAudioData(t,(function(t){e(t)}))}catch(e){n?n(e):console.error(e),r.manager.itemError(t)}}),i,n)}}class Hc extends Cc{constructor(t,e,i=1){super(void 0,i);const n=(new Je).set(t),r=(new Je).set(e),o=new Ct(n.r,n.g,n.b),s=new Ct(r.r,r.g,r.b),a=Math.sqrt(Math.PI),l=a*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(s).multiplyScalar(a),this.sh.coefficients[1].copy(o).sub(s).multiplyScalar(l)}}Hc.prototype.isHemisphereLightProbe=!0;class Wc extends Cc{constructor(t,e=1){super(void 0,e);const i=(new Je).set(t);this.sh.coefficients[0].set(i.r,i.g,i.b).multiplyScalar(2*Math.sqrt(Math.PI))}}Wc.prototype.isAmbientLightProbe=!0;const qc=new se,Xc=new se;class Zc{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Yc(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=Yc();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}function Yc(){return("undefined"==typeof performance?Date:performance).now()}const Qc=new Ct,Jc=new It,Kc=new Ct,$c=new Ct;class tu extends Le{constructor(t){super(),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this}setMediaElementSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this}setMediaStreamSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this}setBuffer(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this}play(t=0){if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+t;const e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(t){return t||(t=[]),!0===this._connected?(this.disconnect(),this.filters=t.slice(),this.connect()):this.filters=t.slice(),this}setDetune(t){if(this.detune=t,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(t){return this.setFilters(t?[t]:[])}setPlaybackRate(t){if(!1!==this.hasPlaybackControl)return this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(t){if(!1!==this.hasPlaybackControl)return this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(t){return this.loopStart=t,this}setLoopEnd(t){return this.loopEnd=t,this}getVolume(){return this.gain.gain.value}setVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}}const eu=new Ct,iu=new It,nu=new Ct,ru=new Ct;class ou{constructor(t,e=2048){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=e,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let t=0;const e=this.getFrequencyData();for(let i=0;i<e.length;i++)t+=e[i];return t/e.length}}class su{constructor(t,e,i){let n,r,o;switch(this.binding=t,this.valueSize=i,e){case"quaternion":n=this._slerp,r=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*i),this._workIndex=5;break;case"string":case"bool":n=this._select,r=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(5*i);break;default:n=this._lerp,r=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*i)}this._mixBufferRegion=n,this._mixBufferRegionAdditive=r,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(t,e){const i=this.buffer,n=this.valueSize,r=t*n+n;let o=this.cumulativeWeight;if(0===o){for(let t=0;t!==n;++t)i[r+t]=i[t];o=e}else{o+=e;const t=e/o;this._mixBufferRegion(i,r,0,t,n)}this.cumulativeWeight=o}accumulateAdditive(t){const e=this.buffer,i=this.valueSize,n=i*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(e,n,0,t,i),this.cumulativeWeightAdditive+=t}apply(t){const e=this.valueSize,i=this.buffer,n=t*e+e,r=this.cumulativeWeight,o=this.cumulativeWeightAdditive,s=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,r<1){const t=e*this._origIndex;this._mixBufferRegion(i,n,t,1-r,e)}o>0&&this._mixBufferRegionAdditive(i,n,this._addIndex*e,1,e);for(let t=e,r=e+e;t!==r;++t)if(i[t]!==i[t+e]){s.setValue(i,n);break}}saveOriginalState(){const t=this.binding,e=this.buffer,i=this.valueSize,n=i*this._origIndex;t.getValue(e,n);for(let t=i,r=n;t!==r;++t)e[t]=e[n+t%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let i=t;i<e;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const t=this._origIndex*this.valueSize,e=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[e+i]=this.buffer[t+i]}_select(t,e,i,n,r){if(n>=.5)for(let n=0;n!==r;++n)t[e+n]=t[i+n]}_slerp(t,e,i,n){It.slerpFlat(t,e,t,e,t,i,n)}_slerpAdditive(t,e,i,n,r){const o=this._workIndex*r;It.multiplyQuaternionsFlat(t,o,t,e,t,i),It.slerpFlat(t,e,t,e,t,o,n)}_lerp(t,e,i,n,r){const o=1-n;for(let s=0;s!==r;++s){const r=e+s;t[r]=t[r]*o+t[i+s]*n}}_lerpAdditive(t,e,i,n,r){for(let o=0;o!==r;++o){const r=e+o;t[r]=t[r]+t[i+o]*n}}}const au="\\[\\]\\.:\\/",lu=new RegExp("[\\[\\]\\.:\\/]","g"),cu="[^\\[\\]\\.:\\/]",uu="[^"+au.replace("\\.","")+"]",hu=/((?:WC+[\/:])*)/.source.replace("WC",cu),pu=/(WCOD+)?/.source.replace("WCOD",uu),du=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",cu),fu=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",cu),mu=new RegExp("^"+hu+pu+du+fu+"$"),gu=["material","materials","bones"];class yu{constructor(t,e,i){this.path=e,this.parsedPath=i||yu.parseTrackName(e),this.node=yu.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,i){return t&&t.isAnimationObjectGroup?new yu.Composite(t,e,i):new yu(t,e,i)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(lu,"")}static parseTrackName(t){const e=mu.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},n=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==n&&-1!==n){const t=i.nodeName.substring(n+1);-1!==gu.indexOf(t)&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=t)}if(null===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i}static findNode(t,e){if(!e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const i=t.skeleton.getBoneByName(e);if(void 0!==i)return i}if(t.children){const i=function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.name===e||r.uuid===e)return r;const o=i(r.children);if(o)return o}return null},n=i(t.children);if(n)return n}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){const i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)t[e++]=i[n]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){const i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=t[e++]}_setValue_array_setNeedsUpdate(t,e){const i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){const i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node;const e=this.parsedPath,i=e.objectName,n=e.propertyName;let r=e.propertyIndex;if(t||(t=yu.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(i){let n=e.objectIndex;switch(i){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(let e=0;e<t.length;e++)if(t[e].name===n){n=e;break}break;default:if(void 0===t[i])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[i]}if(void 0!==n){if(void 0===t[n])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[n]}}const o=t[n];if(void 0===o){const i=e.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+i+"."+n+" but it wasn't found.",t)}let s=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?s=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(s=this.Versioning.MatrixWorldNeedsUpdate);let a=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===n){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.isBufferGeometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==t.morphTargetDictionary[r]&&(r=t.morphTargetDictionary[r])}a=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=r}else void 0!==o.fromArray&&void 0!==o.toArray?(a=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(a=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=n;this.getValue=this.GetterByBindingType[a],this.setValue=this.SetterByBindingTypeAndVersioning[a][s]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}yu.Composite=class{constructor(t,e,i){const n=i||yu.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,n)}getValue(t,e){this.bind();const i=this._targetGroup.nCachedObjects_,n=this._bindings[i];void 0!==n&&n.getValue(t,e)}setValue(t,e){const i=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=i.length;n!==r;++n)i[n].setValue(t,e)}bind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()}unbind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}},yu.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},yu.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},yu.prototype.GetterByBindingType=[yu.prototype._getValue_direct,yu.prototype._getValue_array,yu.prototype._getValue_arrayElement,yu.prototype._getValue_toArray],yu.prototype.SetterByBindingTypeAndVersioning=[[yu.prototype._setValue_direct,yu.prototype._setValue_direct_setNeedsUpdate,yu.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[yu.prototype._setValue_array,yu.prototype._setValue_array_setNeedsUpdate,yu.prototype._setValue_array_setMatrixWorldNeedsUpdate],[yu.prototype._setValue_arrayElement,yu.prototype._setValue_arrayElement_setNeedsUpdate,yu.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[yu.prototype._setValue_fromArray,yu.prototype._setValue_fromArray_setNeedsUpdate,yu.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class vu{constructor(){this.uuid=ct(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const t={};this._indicesByUUID=t;for(let e=0,i=arguments.length;e!==i;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const e=this;this.stats={objects:{get total(){return e._objects.length},get inUse(){return this.total-e.nCachedObjects_}},get bindingsPerObject(){return e._bindings.length}}}add(){const t=this._objects,e=this._indicesByUUID,i=this._paths,n=this._parsedPaths,r=this._bindings,o=r.length;let s,a=t.length,l=this.nCachedObjects_;for(let c=0,u=arguments.length;c!==u;++c){const u=arguments[c],h=u.uuid;let p=e[h];if(void 0===p){p=a++,e[h]=p,t.push(u);for(let t=0,e=o;t!==e;++t)r[t].push(new yu(u,i[t],n[t]))}else if(p<l){s=t[p];const a=--l,c=t[a];e[c.uuid]=p,t[p]=c,e[h]=a,t[a]=u;for(let t=0,e=o;t!==e;++t){const e=r[t],o=e[a];let s=e[p];e[p]=o,void 0===s&&(s=new yu(u,i[t],n[t])),e[a]=s}}else t[p]!==s&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=l}remove(){const t=this._objects,e=this._indicesByUUID,i=this._bindings,n=i.length;let r=this.nCachedObjects_;for(let o=0,s=arguments.length;o!==s;++o){const s=arguments[o],a=s.uuid,l=e[a];if(void 0!==l&&l>=r){const o=r++,c=t[o];e[c.uuid]=l,t[l]=c,e[a]=o,t[o]=s;for(let t=0,e=n;t!==e;++t){const e=i[t],n=e[o],r=e[l];e[l]=n,e[o]=r}}}this.nCachedObjects_=r}uncache(){const t=this._objects,e=this._indicesByUUID,i=this._bindings,n=i.length;let r=this.nCachedObjects_,o=t.length;for(let s=0,a=arguments.length;s!==a;++s){const a=arguments[s].uuid,l=e[a];if(void 0!==l)if(delete e[a],l<r){const s=--r,a=t[s],c=--o,u=t[c];e[a.uuid]=l,t[l]=a,e[u.uuid]=s,t[s]=u,t.pop();for(let t=0,e=n;t!==e;++t){const e=i[t],n=e[s],r=e[c];e[l]=n,e[s]=r,e.pop()}}else{const r=--o,s=t[r];r>0&&(e[s.uuid]=l),t[l]=s,t.pop();for(let t=0,e=n;t!==e;++t){const e=i[t];e[l]=e[r],e.pop()}}}this.nCachedObjects_=r}subscribe_(t,e){const i=this._bindingsIndicesByPath;let n=i[t];const r=this._bindings;if(void 0!==n)return r[n];const o=this._paths,s=this._parsedPaths,a=this._objects,l=a.length,c=this.nCachedObjects_,u=new Array(l);n=r.length,i[t]=n,o.push(t),s.push(e),r.push(u);for(let i=c,n=a.length;i!==n;++i){const n=a[i];u[i]=new yu(n,t,e)}return u}unsubscribe_(t){const e=this._bindingsIndicesByPath,i=e[t];if(void 0!==i){const n=this._paths,r=this._parsedPaths,o=this._bindings,s=o.length-1,a=o[s];e[t[s]]=i,o[i]=a,o.pop(),r[i]=r[s],r.pop(),n[i]=n[s],n.pop()}}}vu.prototype.isAnimationObjectGroup=!0;class _u{constructor(t,e,i=null,n=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=i,this.blendMode=n;const r=e.tracks,o=r.length,s=new Array(o),a={endingStart:G,endingEnd:G};for(let t=0;t!==o;++t){const e=r[t].createInterpolant(null);s[t]=e,e.settings=a}this._interpolantSettings=a,this._interpolants=s,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,i){if(t.fadeOut(e),this.fadeIn(e),i){const i=this._clip.duration,n=t._clip.duration,r=n/i,o=i/n;t.warp(1,r,e),this.warp(o,1,e)}return this}crossFadeTo(t,e,i){return t.crossFadeFrom(this,e,i)}stopFading(){const t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,i){const n=this._mixer,r=n.time,o=this.timeScale;let s=this._timeScaleInterpolant;null===s&&(s=n._lendControlInterpolant(),this._timeScaleInterpolant=s);const a=s.parameterPositions,l=s.sampleValues;return a[0]=r,a[1]=r+i,l[0]=t/o,l[1]=e/o,this}stopWarping(){const t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,i,n){if(!this.enabled)return void this._updateWeight(t);const r=this._startTime;if(null!==r){const n=(t-r)*i;if(n<0||0===i)return;this._startTime=null,e=i*n}e*=this._updateTimeScale(t);const o=this._updateTime(e),s=this._updateWeight(t);if(s>0){const t=this._interpolants,e=this._propertyBindings;if(this.blendMode===q)for(let i=0,n=t.length;i!==n;++i)t[i].evaluate(o),e[i].accumulateAdditive(s);else for(let i=0,r=t.length;i!==r;++i)t[i].evaluate(o),e[i].accumulate(n,s)}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const i=this._weightInterpolant;if(null!==i){const n=i.evaluate(t)[0];e*=n,t>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const i=this._timeScaleInterpolant;null!==i&&(e*=i.evaluate(t)[0],t>i.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e))}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,i=this.loop;let n=this.time+t,r=this._loopCount;const o=2202===i;if(0===t)return-1===r?n:o&&1==(1&r)?e-n:n;if(2200===i){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(n>=e)n=e;else{if(!(n<0)){this.time=n;break t}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),n>=e||n<0){const i=Math.floor(n/e);n-=e*i,r+=Math.abs(i);const s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=t>0?e:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===s){const e=t<0;this._setEndings(e,!e,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:i})}}else this.time=n;if(o&&1==(1&r))return e-n}return n}_setEndings(t,e,i){const n=this._interpolantSettings;i?(n.endingStart=j,n.endingEnd=j):(n.endingStart=t?this.zeroSlopeAtStart?j:G:H,n.endingEnd=e?this.zeroSlopeAtEnd?j:G:H)}_scheduleFading(t,e,i){const n=this._mixer,r=n.time;let o=this._weightInterpolant;null===o&&(o=n._lendControlInterpolant(),this._weightInterpolant=o);const s=o.parameterPositions,a=o.sampleValues;return s[0]=r,a[0]=e,s[1]=r+t,a[1]=i,this}}class xu extends rt{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(t,e){const i=t._localRoot||this._root,n=t._clip.tracks,r=n.length,o=t._propertyBindings,s=t._interpolants,a=i.uuid,l=this._bindingsByRootAndName;let c=l[a];void 0===c&&(c={},l[a]=c);for(let t=0;t!==r;++t){const r=n[t],l=r.name;let u=c[l];if(void 0!==u)o[t]=u;else{if(u=o[t],void 0!==u){null===u._cacheIndex&&(++u.referenceCount,this._addInactiveBinding(u,a,l));continue}const n=e&&e._propertyBindings[t].binding.parsedPath;u=new su(yu.create(i,l,n),r.ValueTypeName,r.getValueSize()),++u.referenceCount,this._addInactiveBinding(u,a,l),o[t]=u}s[t].resultBuffer=u.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){const e=(t._localRoot||this._root).uuid,i=t._clip.uuid,n=this._actionsByClip[i];this._bindAction(t,n&&n.knownActions[0]),this._addInactiveAction(t,i,e)}const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0==i.useCount++&&(this._lendBinding(i),i.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}}_isActiveAction(t){const e=t._cacheIndex;return null!==e&&e<this._nActiveActions}_addInactiveAction(t,e,i){const n=this._actions,r=this._actionsByClip;let o=r[e];if(void 0===o)o={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,r[e]=o;else{const e=o.knownActions;t._byClipCacheIndex=e.length,e.push(t)}t._cacheIndex=n.length,n.push(t),o.actionByRoot[i]=t}_removeInactiveAction(t){const e=this._actions,i=e[e.length-1],n=t._cacheIndex;i._cacheIndex=n,e[n]=i,e.pop(),t._cacheIndex=null;const r=t._clip.uuid,o=this._actionsByClip,s=o[r],a=s.knownActions,l=a[a.length-1],c=t._byClipCacheIndex;l._byClipCacheIndex=c,a[c]=l,a.pop(),t._byClipCacheIndex=null,delete s.actionByRoot[(t._localRoot||this._root).uuid],0===a.length&&delete o[r],this._removeInactiveBindingsForAction(t)}_removeInactiveBindingsForAction(t){const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0==--i.referenceCount&&this._removeInactiveBinding(i)}}_lendAction(t){const e=this._actions,i=t._cacheIndex,n=this._nActiveActions++,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r}_takeBackAction(t){const e=this._actions,i=t._cacheIndex,n=--this._nActiveActions,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r}_addInactiveBinding(t,e,i){const n=this._bindingsByRootAndName,r=this._bindings;let o=n[e];void 0===o&&(o={},n[e]=o),o[i]=t,t._cacheIndex=r.length,r.push(t)}_removeInactiveBinding(t){const e=this._bindings,i=t.binding,n=i.rootNode.uuid,r=i.path,o=this._bindingsByRootAndName,s=o[n],a=e[e.length-1],l=t._cacheIndex;a._cacheIndex=l,e[l]=a,e.pop(),delete s[r],0===Object.keys(s).length&&delete o[n]}_lendBinding(t){const e=this._bindings,i=t._cacheIndex,n=this._nActiveBindings++,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r}_takeBackBinding(t){const e=this._bindings,i=t._cacheIndex,n=--this._nActiveBindings,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r}_lendControlInterpolant(){const t=this._controlInterpolants,e=this._nActiveControlInterpolants++;let i=t[e];return void 0===i&&(i=new Vl(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),i.__cacheIndex=e,t[e]=i),i}_takeBackControlInterpolant(t){const e=this._controlInterpolants,i=t.__cacheIndex,n=--this._nActiveControlInterpolants,r=e[n];t.__cacheIndex=n,e[n]=t,r.__cacheIndex=i,e[i]=r}clipAction(t,e,i){const n=e||this._root,r=n.uuid;let o="string"==typeof t?Ql.findByName(n,t):t;const s=null!==o?o.uuid:t,a=this._actionsByClip[s];let l=null;if(void 0===i&&(i=null!==o?o.blendMode:W),void 0!==a){const t=a.actionByRoot[r];if(void 0!==t&&t.blendMode===i)return t;l=a.knownActions[0],null===o&&(o=l._clip)}if(null===o)return null;const c=new _u(this,o,e,i);return this._bindAction(c,l),this._addInactiveAction(c,s,r),c}existingAction(t,e){const i=e||this._root,n=i.uuid,r="string"==typeof t?Ql.findByName(i,t):t,o=r?r.uuid:t,s=this._actionsByClip[o];return void 0!==s&&s.actionByRoot[n]||null}stopAllAction(){const t=this._actions;for(let e=this._nActiveActions-1;e>=0;--e)t[e].stop();return this}update(t){t*=this.timeScale;const e=this._actions,i=this._nActiveActions,n=this.time+=t,r=Math.sign(t),o=this._accuIndex^=1;for(let s=0;s!==i;++s)e[s]._update(n,t,r,o);const s=this._bindings,a=this._nActiveBindings;for(let t=0;t!==a;++t)s[t].apply(o);return this}setTime(t){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(t)}getRoot(){return this._root}uncacheClip(t){const e=this._actions,i=t.uuid,n=this._actionsByClip,r=n[i];if(void 0!==r){const t=r.knownActions;for(let i=0,n=t.length;i!==n;++i){const n=t[i];this._deactivateAction(n);const r=n._cacheIndex,o=e[e.length-1];n._cacheIndex=null,n._byClipCacheIndex=null,o._cacheIndex=r,e[r]=o,e.pop(),this._removeInactiveBindingsForAction(n)}delete n[i]}}uncacheRoot(t){const e=t.uuid,i=this._actionsByClip;for(const t in i){const n=i[t].actionByRoot[e];void 0!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}const n=this._bindingsByRootAndName[e];if(void 0!==n)for(const t in n){const e=n[t];e.restoreOriginalState(),this._removeInactiveBinding(e)}}uncacheAction(t,e){const i=this.existingAction(t,e);null!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}}xu.prototype._controlInterpolantsResultBuffer=new Float32Array(1);class bu{constructor(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}clone(){return new bu(void 0===this.value.clone?this.value:this.value.clone())}}class wu extends $o{constructor(t,e,i=1){super(t,e),this.meshPerAttribute=i}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}clone(t){const e=super.clone(t);return e.meshPerAttribute=this.meshPerAttribute,e}toJSON(t){const e=super.toJSON(t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}}wu.prototype.isInstancedInterleavedBuffer=!0;class Au{constructor(t,e,i,n,r){this.buffer=t,this.type=e,this.itemSize=i,this.elementSize=n,this.count=r,this.version=0}set needsUpdate(t){!0===t&&this.version++}setBuffer(t){return this.buffer=t,this}setType(t,e){return this.type=t,this.elementSize=e,this}setItemSize(t){return this.itemSize=t,this}setCount(t){return this.count=t,this}}function Eu(t,e){return t.distance-e.distance}function Su(t,e,i,n){if(t.layers.test(e.layers)&&t.raycast(e,i),!0===n){const n=t.children;for(let t=0,r=n.length;t<r;t++)Su(n[t],e,i,!0)}}Au.prototype.isGLBufferAttribute=!0;const Mu=new yt;class Tu{constructor(t=new yt(1/0,1/0),e=new yt(-1/0,-1/0)){this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const i=Mu.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(t){return this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return Mu.copy(t).clamp(this.min,this.max).sub(t).length()}intersect(t){return this.min.max(t.min),this.max.min(t.max),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}Tu.prototype.isBox2=!0;const Iu=new Ct,Cu=new Ct;class Pu{constructor(t=new Ct,e=new Ct){this.start=t,this.end=e}set(t,e){return this.start.copy(t),this.end.copy(e),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){Iu.subVectors(t,this.start),Cu.subVectors(this.end,this.start);const i=Cu.dot(Cu);let n=Cu.dot(Iu)/i;return e&&(n=ut(n,0,1)),n}closestPointToPoint(t,e,i){const n=this.closestPointToPointParameter(t,e);return this.delta(i).multiplyScalar(n).add(this.start)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}}class Lu extends Le{constructor(t){super(),this.material=t,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}}Lu.prototype.isImmediateRenderObject=!0;const Du=new Ct,Ru=new Ct,Ou=new se,ku=new se;class Nu extends Xs{constructor(t){const e=Bu(t),i=new wi,n=[],r=[],o=new Je(0,0,1),s=new Je(0,1,0);for(let t=0;t<e.length;t++){const i=e[t];i.parent&&i.parent.isBone&&(n.push(0,0,0),n.push(0,0,0),r.push(o.r,o.g,o.b),r.push(s.r,s.g,s.b))}i.setAttribute("position",new ui(n,3)),i.setAttribute("color",new ui(r,3)),super(i,new zs({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(t){const e=this.bones,i=this.geometry,n=i.getAttribute("position");ku.copy(this.root.matrixWorld).invert();for(let t=0,i=0;t<e.length;t++){const r=e[t];r.parent&&r.parent.isBone&&(Ou.multiplyMatrices(ku,r.matrixWorld),Ru.setFromMatrixPosition(Ou),n.setXYZ(i,Ru.x,Ru.y,Ru.z),Ou.multiplyMatrices(ku,r.parent.matrixWorld),Ru.setFromMatrixPosition(Ou),n.setXYZ(i+1,Ru.x,Ru.y,Ru.z),i+=2)}i.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(t)}}function Bu(t){const e=[];t&&t.isBone&&e.push(t);for(let i=0;i<t.children.length;i++)e.push.apply(e,Bu(t.children[i]));return e}const zu=new Ct,Fu=new Je,Vu=new Je;class Uu extends Xs{constructor(t=10,e=10,i=4473924,n=8947848){i=new Je(i),n=new Je(n);const r=e/2,o=t/e,s=t/2,a=[],l=[];for(let t=0,c=0,u=-s;t<=e;t++,u+=o){a.push(-s,0,u,s,0,u),a.push(u,0,-s,u,0,s);const e=t===r?i:n;e.toArray(l,c),c+=3,e.toArray(l,c),c+=3,e.toArray(l,c),c+=3,e.toArray(l,c),c+=3}const c=new wi;c.setAttribute("position",new ui(a,3)),c.setAttribute("color",new ui(l,3)),super(c,new zs({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}const Gu=new Ct,ju=new Ct,Hu=new Ct,Wu=new Ct,qu=new Xi;function Xu(t,e,i,n,r,o,s){Wu.set(r,o,s).unproject(n);const a=e[t];if(void 0!==a){const t=i.getAttribute("position");for(let e=0,i=a.length;e<i;e++)t.setXYZ(a[e],Wu.x,Wu.y,Wu.z)}}const Zu=new Dt;class Yu extends Xs{constructor(t,e=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new Float32Array(24),r=new wi;r.setIndex(new ei(i,1)),r.setAttribute("position",new ei(n,3)),super(r,new zs({color:e,toneMapped:!1})),this.object=t,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(t){if(void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&Zu.setFromObject(this.object),Zu.isEmpty())return;const e=Zu.min,i=Zu.max,n=this.geometry.attributes.position,r=n.array;r[0]=i.x,r[1]=i.y,r[2]=i.z,r[3]=e.x,r[4]=i.y,r[5]=i.z,r[6]=e.x,r[7]=e.y,r[8]=i.z,r[9]=i.x,r[10]=e.y,r[11]=i.z,r[12]=i.x,r[13]=i.y,r[14]=e.z,r[15]=e.x,r[16]=i.y,r[17]=e.z,r[18]=e.x,r[19]=e.y,r[20]=e.z,r[21]=i.x,r[22]=e.y,r[23]=e.z,n.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(t){return this.object=t,this.update(),this}copy(t){return Xs.prototype.copy.call(this,t),this.object=t.object,this}}const Qu=new Ct;let Ju,Ku;class $u extends Xs{constructor(t=1){const e=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],i=new wi;i.setAttribute("position",new ui(e,3)),i.setAttribute("color",new ui([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(i,new zs({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(t,e,i){const n=new Je,r=this.geometry.attributes.color.array;return n.set(t),n.toArray(r,0),n.toArray(r,3),n.set(e),n.toArray(r,6),n.toArray(r,9),n.set(i),n.toArray(r,12),n.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}const th=new Float32Array(1),eh=new Int32Array(th.buffer);ga.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(ga.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},cc.prototype.fromPoints=function(t){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)},Uu.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Nu.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},ec.prototype.extractUrlBase=function(t){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),Lc.extractUrlBase(t)},ec.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Tu.prototype.center=function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},Tu.prototype.empty=function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},Tu.prototype.isIntersectionBox=function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},Tu.prototype.size=function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)},Dt.prototype.center=function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},Dt.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},Dt.prototype.isIntersectionBox=function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},Dt.prototype.isIntersectionSphere=function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},Dt.prototype.size=function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)},Jt.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()},sn.prototype.setFromMatrix=function(t){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(t)},Pu.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},vt.prototype.flattenToArrayOffset=function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},vt.prototype.multiplyVector3=function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},vt.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},vt.prototype.applyToBufferAttribute=function(t){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},vt.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},vt.prototype.getInverse=function(t){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(t).invert()},se.prototype.extractPosition=function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},se.prototype.flattenToArrayOffset=function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},se.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new Ct).setFromMatrixColumn(this,3)},se.prototype.setRotationFromQuaternion=function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},se.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},se.prototype.multiplyVector3=function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},se.prototype.multiplyVector4=function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},se.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},se.prototype.rotateAxis=function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},se.prototype.crossVector=function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},se.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")},se.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},se.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},se.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},se.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},se.prototype.applyToBufferAttribute=function(t){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},se.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},se.prototype.makeFrustum=function(t,e,i,n,r,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,n,i,r,o)},se.prototype.getInverse=function(t){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(t).invert()},nn.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},It.prototype.multiplyVector3=function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},It.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()},oe.prototype.isIntersectionBox=function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},oe.prototype.isIntersectionPlane=function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},oe.prototype.isIntersectionSphere=function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},Ge.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},Ge.prototype.barycoordFromPoint=function(t,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(t,e)},Ge.prototype.midpoint=function(t){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(t)},Ge.prototypenormal=function(t){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(t)},Ge.prototype.plane=function(t){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(t)},Ge.barycoordFromPoint=function(t,e,i,n,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Ge.getBarycoord(t,e,i,n,r)},Ge.normal=function(t,e,i,n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Ge.getNormal(t,e,i,n)},uc.prototype.extractAllPoints=function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},uc.prototype.extrude=function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new ul(this,t)},uc.prototype.makeGeometry=function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new yl(this,t)},yt.prototype.fromAttribute=function(t,e,i){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,i)},yt.prototype.distanceToManhattan=function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},yt.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},Ct.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},Ct.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},Ct.prototype.getPositionFromMatrix=function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},Ct.prototype.getScaleFromMatrix=function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},Ct.prototype.getColumnFromMatrix=function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},Ct.prototype.applyProjection=function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},Ct.prototype.fromAttribute=function(t,e,i){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,i)},Ct.prototype.distanceToManhattan=function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},Ct.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},Et.prototype.fromAttribute=function(t,e,i){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,i)},Et.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},Le.prototype.getChildByName=function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},Le.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},Le.prototype.translate=function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)},Le.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},Le.prototype.applyMatrix=function(t){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)},Object.defineProperties(Le.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Vi.prototype.setDrawMode=function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")},Object.defineProperties(Vi.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Ms.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Zi.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(hc.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(ei.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===it},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(it)}}}),ei.prototype.setDynamic=function(t){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?it:et),this},ei.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},ei.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},wi.prototype.addIndex=function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},wi.prototype.addAttribute=function(t,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(t,e):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(t,new ei(arguments[1],arguments[2])))},wi.prototype.addDrawCall=function(t,e,i){void 0!==i&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},wi.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},wi.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},wi.prototype.removeAttribute=function(t){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(t)},wi.prototype.applyMatrix=function(t){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)},Object.defineProperties(wi.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),$o.prototype.setDynamic=function(t){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?it:et),this},$o.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},ul.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},ul.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},ul.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")},Ko.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")},bu.prototype.onUpdate=function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this},Object.defineProperties(He.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new Je}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===t}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(t){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=t}},vertexTangents:{get:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")},set:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")}}}),Object.defineProperties(qi.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Zo.prototype.clearTarget=function(t,e,i,n){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(t),this.clear(e,i,n)},Zo.prototype.animate=function(t){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(t)},Zo.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},Zo.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},Zo.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},Zo.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},Zo.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},Zo.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},Zo.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},Zo.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},Zo.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},Zo.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},Zo.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},Zo.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},Zo.prototype.enableScissorTest=function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},Zo.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},Zo.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},Zo.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},Zo.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},Zo.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},Zo.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},Zo.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},Zo.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},Zo.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},Zo.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()},Object.defineProperties(Zo.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(t){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===t?Z:X}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(zo.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(St.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),tu.prototype.load=function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const e=this;return(new jc).load(t,(function(t){e.setBuffer(t)})),this},ou.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Qi.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(t,e)},Qi.prototype.clear=function(t,e,i,n){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(t,e,i,n)},xt.crossOrigin=void 0,xt.loadTexture=function(t,e,i,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");const r=new ac;r.setCrossOrigin(this.crossOrigin);const o=r.load(t,i,void 0,n);return e&&(o.mapping=e),o},xt.loadTextureCube=function(t,e,i,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");const r=new oc;r.setCrossOrigin(this.crossOrigin);const o=r.load(t,i,void 0,n);return e&&(o.mapping=e),o},xt.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},xt.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};const ih={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")}};"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:e}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=e),t.ACESFilmicToneMapping=4,t.AddEquation=i,t.AddOperation=2,t.AdditiveAnimationBlendMode=q,t.AdditiveBlending=2,t.AlphaFormat=1021,t.AlwaysDepth=1,t.AlwaysStencilFunc=519,t.AmbientLight=Mc,t.AmbientLightProbe=Wc,t.AnimationClip=Ql,t.AnimationLoader=class extends ec{constructor(t){super(t)}load(t,e,i,n){const r=this,o=new nc(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,(function(i){try{e(r.parse(JSON.parse(i)))}catch(e){n?n(e):console.error(e),r.manager.itemError(t)}}),i,n)}parse(t){const e=[];for(let i=0;i<t.length;i++){const n=Ql.parse(t[i]);e.push(n)}return e}},t.AnimationMixer=xu,t.AnimationObjectGroup=vu,t.AnimationUtils=Bl,t.ArcCurve=va,t.ArrayCamera=Go,t.ArrowHelper=class extends Le{constructor(t=new Ct(0,0,1),e=new Ct(0,0,0),i=1,n=16776960,r=.2*i,o=.2*r){super(),this.type="ArrowHelper",void 0===Ju&&(Ju=new wi,Ju.setAttribute("position",new ui([0,0,0,0,1,0],3)),Ku=new aa(0,.5,1,5,1),Ku.translate(0,-.5,0)),this.position.copy(e),this.line=new Hs(Ju,new zs({color:n,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Vi(Ku,new Ke({color:n,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(i,r,o)}setDirection(t){if(t.y>.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{Qu.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle(Qu,e)}}setLength(t,e=.2*t,i=.2*e){this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(i,e,i),this.cone.position.y=t,this.cone.updateMatrix()}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}},t.Audio=tu,t.AudioAnalyser=ou,t.AudioContext=Gc,t.AudioListener=class extends Le{constructor(){super(),this.type="AudioListener",this.context=Gc.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Zc}getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}updateMatrixWorld(t){super.updateMatrixWorld(t);const e=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Qc,Jc,Kc),$c.set(0,0,-1).applyQuaternion(Jc),e.positionX){const t=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(Qc.x,t),e.positionY.linearRampToValueAtTime(Qc.y,t),e.positionZ.linearRampToValueAtTime(Qc.z,t),e.forwardX.linearRampToValueAtTime($c.x,t),e.forwardY.linearRampToValueAtTime($c.y,t),e.forwardZ.linearRampToValueAtTime($c.z,t),e.upX.linearRampToValueAtTime(i.x,t),e.upY.linearRampToValueAtTime(i.y,t),e.upZ.linearRampToValueAtTime(i.z,t)}else e.setPosition(Qc.x,Qc.y,Qc.z),e.setOrientation($c.x,$c.y,$c.z,i.x,i.y,i.z)}},t.AudioLoader=jc,t.AxesHelper=$u,t.AxisHelper=function(t){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new $u(t)},t.BackSide=1,t.BasicDepthPacking=3200,t.BasicShadowMap=0,t.BinaryTextureLoader=function(t){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new sc(t)},t.Bone=Ts,t.BooleanKeyframeTrack=jl,t.BoundingBoxHelper=function(t,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new Yu(t,e)},t.Box2=Tu,t.Box3=Dt,t.Box3Helper=class extends Xs{constructor(t,e=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new wi;n.setIndex(new ei(i,1)),n.setAttribute("position",new ui([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(n,new zs({color:e,toneMapped:!1})),this.box=t,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(t){const e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(t))}},t.BoxBufferGeometry=Gi,t.BoxGeometry=Gi,t.BoxHelper=Yu,t.BufferAttribute=ei,t.BufferGeometry=wi,t.BufferGeometryLoader=Rc,t.ByteType=1010,t.Cache=Kl,t.Camera=Xi,t.CameraHelper=class extends Xs{constructor(t){const e=new wi,i=new zs({color:16777215,vertexColors:!0,toneMapped:!1}),n=[],r=[],o={},s=new Je(16755200),a=new Je(16711680),l=new Je(43775),c=new Je(16777215),u=new Je(3355443);function h(t,e,i){p(t,i),p(e,i)}function p(t,e){n.push(0,0,0),r.push(e.r,e.g,e.b),void 0===o[t]&&(o[t]=[]),o[t].push(n.length/3-1)}h("n1","n2",s),h("n2","n4",s),h("n4","n3",s),h("n3","n1",s),h("f1","f2",s),h("f2","f4",s),h("f4","f3",s),h("f3","f1",s),h("n1","f1",s),h("n2","f2",s),h("n3","f3",s),h("n4","f4",s),h("p","n1",a),h("p","n2",a),h("p","n3",a),h("p","n4",a),h("u1","u2",l),h("u2","u3",l),h("u3","u1",l),h("c","t",c),h("p","c",u),h("cn1","cn2",u),h("cn3","cn4",u),h("cf1","cf2",u),h("cf3","cf4",u),e.setAttribute("position",new ui(n,3)),e.setAttribute("color",new ui(r,3)),super(e,i),this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}update(){const t=this.geometry,e=this.pointMap;qu.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Xu("c",e,t,qu,0,0,-1),Xu("t",e,t,qu,0,0,1),Xu("n1",e,t,qu,-1,-1,-1),Xu("n2",e,t,qu,1,-1,-1),Xu("n3",e,t,qu,-1,1,-1),Xu("n4",e,t,qu,1,1,-1),Xu("f1",e,t,qu,-1,-1,1),Xu("f2",e,t,qu,1,-1,1),Xu("f3",e,t,qu,-1,1,1),Xu("f4",e,t,qu,1,1,1),Xu("u1",e,t,qu,.7,1.1,-1),Xu("u2",e,t,qu,-.7,1.1,-1),Xu("u3",e,t,qu,0,2,-1),Xu("cf1",e,t,qu,-1,0,1),Xu("cf2",e,t,qu,1,0,1),Xu("cf3",e,t,qu,0,-1,1),Xu("cf4",e,t,qu,0,1,1),Xu("cn1",e,t,qu,-1,0,-1),Xu("cn2",e,t,qu,1,0,-1),Xu("cn3",e,t,qu,0,-1,-1),Xu("cn4",e,t,qu,0,1,-1),t.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}},t.CanvasRenderer=function(){console.error("THREE.CanvasRenderer has been removed")},t.CanvasTexture=ra,t.CatmullRomCurve3=Ea,t.CineonToneMapping=3,t.CircleBufferGeometry=sa,t.CircleGeometry=sa,t.ClampToEdgeWrapping=h,t.Clock=Zc,t.Color=Je,t.ColorKeyframeTrack=Hl,t.CompressedTexture=na,t.CompressedTextureLoader=class extends ec{constructor(t){super(t)}load(t,e,i,n){const r=this,o=[],s=new na,a=new nc(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(r.withCredentials);let l=0;function c(c){a.load(t[c],(function(t){const i=r.parse(t,!0);o[c]={width:i.width,height:i.height,format:i.format,mipmaps:i.mipmaps},l+=1,6===l&&(1===i.mipmapCount&&(s.minFilter=g),s.image=o,s.format=i.format,s.needsUpdate=!0,e&&e(s))}),i,n)}if(Array.isArray(t))for(let e=0,i=t.length;e<i;++e)c(e);else a.load(t,(function(t){const i=r.parse(t,!0);if(i.isCubemap){const t=i.mipmaps.length/i.mipmapCount;for(let e=0;e<t;e++){o[e]={mipmaps:[]};for(let t=0;t<i.mipmapCount;t++)o[e].mipmaps.push(i.mipmaps[e*i.mipmapCount+t]),o[e].format=i.format,o[e].width=i.width,o[e].height=i.height}s.image=o}else s.image.width=i.width,s.image.height=i.height,s.mipmaps=i.mipmaps;1===i.mipmapCount&&(s.minFilter=g),s.format=i.format,s.needsUpdate=!0,e&&e(s)}),i,n);return s}},t.ConeBufferGeometry=la,t.ConeGeometry=la,t.CubeCamera=Qi,t.CubeReflectionMapping=r,t.CubeRefractionMapping=o,t.CubeTexture=Ji,t.CubeTextureLoader=oc,t.CubeUVReflectionMapping=l,t.CubeUVRefractionMapping=c,t.CubicBezierCurve=Ia,t.CubicBezierCurve3=Ca,t.CubicInterpolant=Fl,t.CullFaceBack=1,t.CullFaceFront=2,t.CullFaceFrontBack=3,t.CullFaceNone=0,t.Curve=ga,t.CurvePath=lc,t.CustomBlending=5,t.CustomToneMapping=5,t.CylinderBufferGeometry=aa,t.CylinderGeometry=aa,t.Cylindrical=class{constructor(t=1,e=0,i=0){return this.radius=t,this.theta=e,this.y=i,this}set(t,e,i){return this.radius=t,this.theta=e,this.y=i,this}copy(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,i){return this.radius=Math.sqrt(t*t+i*i),this.theta=Math.atan2(t,i),this.y=e,this}clone(){return(new this.constructor).copy(this)}},t.DataTexture=Is,t.DataTexture2DArray=$n,t.DataTexture3D=tr,t.DataTextureLoader=sc,t.DataUtils=class{static toHalfFloat(t){th[0]=t;const e=eh[0];let i=e>>16&32768,n=e>>12&2047;const r=e>>23&255;return r<103?i:r>142?(i|=31744,i|=(255==r?0:1)&&8388607&e,i):r<113?(n|=2048,i|=(n>>114-r)+(n>>113-r&1),i):(i|=r-112<<10|n>>1,i+=1&n,i)}},t.DecrementStencilOp=7683,t.DecrementWrapStencilOp=34056,t.DefaultLoadingManager=tc,t.DepthFormat=T,t.DepthStencilFormat=I,t.DepthTexture=oa,t.DirectionalLight=Sc,t.DirectionalLightHelper=class extends Le{constructor(t,e,i){super(),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,void 0===e&&(e=1);let n=new wi;n.setAttribute("position",new ui([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));const r=new zs({fog:!1,toneMapped:!1});this.lightPlane=new Hs(n,r),this.add(this.lightPlane),n=new wi,n.setAttribute("position",new ui([0,0,0,0,0,1],3)),this.targetLine=new Hs(n,r),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){Gu.setFromMatrixPosition(this.light.matrixWorld),ju.setFromMatrixPosition(this.light.target.matrixWorld),Hu.subVectors(ju,Gu),this.lightPlane.lookAt(ju),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(ju),this.targetLine.scale.z=Hu.length()}},t.DiscreteInterpolant=Ul,t.DodecahedronBufferGeometry=ua,t.DodecahedronGeometry=ua,t.DoubleSide=2,t.DstAlphaFactor=206,t.DstColorFactor=208,t.DynamicBufferAttribute=function(t,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new ei(t,e).setUsage(it)},t.DynamicCopyUsage=35050,t.DynamicDrawUsage=it,t.DynamicReadUsage=35049,t.EdgesGeometry=ma,t.EdgesHelper=function(t,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new Xs(new ma(t.geometry),new zs({color:void 0!==e?e:16777215}))},t.EllipseCurve=ya,t.EqualDepth=4,t.EqualStencilFunc=514,t.EquirectangularReflectionMapping=s,t.EquirectangularRefractionMapping=a,t.Euler=ge,t.EventDispatcher=rt,t.ExtrudeBufferGeometry=ul,t.ExtrudeGeometry=ul,t.FaceColors=1,t.FileLoader=nc,t.FlatShading=1,t.Float16BufferAttribute=ci,t.Float32Attribute=function(t,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new ui(t,e)},t.Float32BufferAttribute=ui,t.Float64Attribute=function(t,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new hi(t,e)},t.Float64BufferAttribute=hi,t.FloatType=w,t.Fog=Jo,t.FogExp2=Qo,t.Font=Fc,t.FontLoader=class extends ec{constructor(t){super(t)}load(t,e,i,n){const r=this,o=new nc(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(r.withCredentials),o.load(t,(function(t){let i;try{i=JSON.parse(t)}catch(e){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),i=JSON.parse(t.substring(65,t.length-2))}const n=r.parse(i);e&&e(n)}),i,n)}parse(t){return new Fc(t)}},t.FrontSide=0,t.Frustum=sn,t.GLBufferAttribute=Au,t.GLSL1="100",t.GLSL3=nt,t.GammaEncoding=Y,t.GreaterDepth=6,t.GreaterEqualDepth=5,t.GreaterEqualStencilFunc=518,t.GreaterStencilFunc=516,t.GridHelper=Uu,t.Group=jo,t.HalfFloatType=A,t.HemisphereLight=pc,t.HemisphereLightHelper=class extends Le{constructor(t,e,i){super(),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=i;const n=new fl(e);n.rotateY(.5*Math.PI),this.material=new Ke({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);const r=n.getAttribute("position"),o=new Float32Array(3*r.count);n.setAttribute("color",new ei(o,3)),this.add(new Vi(n,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const t=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{const e=t.geometry.getAttribute("color");Fu.copy(this.light.color),Vu.copy(this.light.groundColor);for(let t=0,i=e.count;t<i;t++){const n=t<i/2?Fu:Vu;e.setXYZ(t,n.r,n.g,n.b)}e.needsUpdate=!0}t.lookAt(zu.setFromMatrixPosition(this.light.matrixWorld).negate())}},t.HemisphereLightProbe=Hc,t.IcosahedronBufferGeometry=pl,t.IcosahedronGeometry=pl,t.ImageBitmapLoader=Bc,t.ImageLoader=rc,t.ImageUtils=xt,t.ImmediateRenderObject=Lu,t.IncrementStencilOp=7682,t.IncrementWrapStencilOp=34055,t.InstancedBufferAttribute=Ds,t.InstancedBufferGeometry=Dc,t.InstancedInterleavedBuffer=wu,t.InstancedMesh=Bs,t.Int16Attribute=function(t,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new oi(t,e)},t.Int16BufferAttribute=oi,t.Int32Attribute=function(t,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new ai(t,e)},t.Int32BufferAttribute=ai,t.Int8Attribute=function(t,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new ii(t,e)},t.Int8BufferAttribute=ii,t.IntType=1013,t.InterleavedBuffer=$o,t.InterleavedBufferAttribute=es,t.Interpolant=zl,t.InterpolateDiscrete=F,t.InterpolateLinear=V,t.InterpolateSmooth=U,t.InvertStencilOp=5386,t.JSONLoader=function(){console.error("THREE.JSONLoader has been removed.")},t.KeepStencilOp=tt,t.KeyframeTrack=Gl,t.LOD=xs,t.LatheBufferGeometry=dl,t.LatheGeometry=dl,t.Layers=ye,t.LensFlare=function(){console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js")},t.LessDepth=2,t.LessEqualDepth=3,t.LessEqualStencilFunc=515,t.LessStencilFunc=513,t.Light=hc,t.LightProbe=Cc,t.Line=Hs,t.Line3=Pu,t.LineBasicMaterial=zs,t.LineCurve=Pa,t.LineCurve3=La,t.LineDashedMaterial=kl,t.LineLoop=Zs,t.LinePieces=1,t.LineSegments=Xs,t.LineStrip=0,t.LinearEncoding=X,t.LinearFilter=g,t.LinearInterpolant=Vl,t.LinearMipMapLinearFilter=1008,t.LinearMipMapNearestFilter=1007,t.LinearMipmapLinearFilter=v,t.LinearMipmapNearestFilter=y,t.LinearToneMapping=1,t.Loader=ec,t.LoaderUtils=Lc,t.LoadingManager=$l,t.LogLuvEncoding=3003,t.LoopOnce=2200,t.LoopPingPong=2202,t.LoopRepeat=2201,t.LuminanceAlphaFormat=1025,t.LuminanceFormat=1024,t.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},t.Material=He,t.MaterialLoader=Pc,t.Math=gt,t.MathUtils=gt,t.Matrix3=vt,t.Matrix4=se,t.MaxEquation=104,t.Mesh=Vi,t.MeshBasicMaterial=Ke,t.MeshDepthMaterial=No,t.MeshDistanceMaterial=Bo,t.MeshFaceMaterial=function(t){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),t},t.MeshLambertMaterial=Rl,t.MeshMatcapMaterial=Ol,t.MeshNormalMaterial=Dl,t.MeshPhongMaterial=Pl,t.MeshPhysicalMaterial=Cl,t.MeshStandardMaterial=Il,t.MeshToonMaterial=Ll,t.MinEquation=103,t.MirroredRepeatWrapping=p,t.MixOperation=1,t.MultiMaterial=function(t=[]){return console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),t.isMultiMaterial=!0,t.materials=t,t.clone=function(){return t.slice()},t},t.MultiplyBlending=4,t.MultiplyOperation=0,t.NearestFilter=d,t.NearestMipMapLinearFilter=1005,t.NearestMipMapNearestFilter=1004,t.NearestMipmapLinearFilter=m,t.NearestMipmapNearestFilter=f,t.NeverDepth=0,t.NeverStencilFunc=512,t.NoBlending=0,t.NoColors=0,t.NoToneMapping=0,t.NormalAnimationBlendMode=W,t.NormalBlending=1,t.NotEqualDepth=7,t.NotEqualStencilFunc=517,t.NumberKeyframeTrack=Wl,t.Object3D=Le,t.ObjectLoader=class extends ec{constructor(t){super(t)}load(t,e,i,n){const r=this,o=""===this.path?Lc.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||o;const s=new nc(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,(function(i){let o=null;try{o=JSON.parse(i)}catch(e){return void 0!==n&&n(e),void console.error("THREE:ObjectLoader: Can't parse "+t+".",e.message)}const s=o.metadata;void 0!==s&&void 0!==s.type&&"geometry"!==s.type.toLowerCase()?r.parse(o,e):console.error("THREE.ObjectLoader: Can't load "+t)}),i,n)}async loadAsync(t,e){const i=""===this.path?Lc.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||i;const n=new nc(this.manager);n.setPath(this.path),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials);const r=await n.loadAsync(t,e),o=JSON.parse(r),s=o.metadata;if(void 0===s||void 0===s.type||"geometry"===s.type.toLowerCase())throw new Error("THREE.ObjectLoader: Can't load "+t);return await this.parseAsync(o)}parse(t,e){const i=this.parseAnimations(t.animations),n=this.parseShapes(t.shapes),r=this.parseGeometries(t.geometries,n),o=this.parseImages(t.images,(function(){void 0!==e&&e(l)})),s=this.parseTextures(t.textures,o),a=this.parseMaterials(t.materials,s),l=this.parseObject(t.object,r,a,s,i),c=this.parseSkeletons(t.skeletons,l);if(this.bindSkeletons(l,c),void 0!==e){let t=!1;for(const e in o)if(o[e]instanceof HTMLImageElement){t=!0;break}!1===t&&e(l)}return l}async parseAsync(t){const e=this.parseAnimations(t.animations),i=this.parseShapes(t.shapes),n=this.parseGeometries(t.geometries,i),r=await this.parseImagesAsync(t.images),o=this.parseTextures(t.textures,r),s=this.parseMaterials(t.materials,o),a=this.parseObject(t.object,n,s,o,e),l=this.parseSkeletons(t.skeletons,a);return this.bindSkeletons(a,l),a}parseShapes(t){const e={};if(void 0!==t)for(let i=0,n=t.length;i<n;i++){const n=(new uc).fromJSON(t[i]);e[n.uuid]=n}return e}parseSkeletons(t,e){const i={},n={};if(e.traverse((function(t){t.isBone&&(n[t.uuid]=t)})),void 0!==t)for(let e=0,r=t.length;e<r;e++){const r=(new Ls).fromJSON(t[e],n);i[r.uuid]=r}return i}parseGeometries(t,e){const i={};if(void 0!==t){const n=new Rc;for(let r=0,o=t.length;r<o;r++){let o;const s=t[r];switch(s.type){case"BufferGeometry":case"InstancedBufferGeometry":o=n.parse(s);break;case"Geometry":console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported.");break;default:s.type in Ml?o=Ml[s.type].fromJSON(s,e):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${s.type}"`)}o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),!0===o.isBufferGeometry&&void 0!==s.userData&&(o.userData=s.userData),i[s.uuid]=o}}return i}parseMaterials(t,e){const i={},n={};if(void 0!==t){const r=new Pc;r.setTextures(e);for(let e=0,o=t.length;e<o;e++){const o=t[e];if("MultiMaterial"===o.type){const t=[];for(let e=0;e<o.materials.length;e++){const n=o.materials[e];void 0===i[n.uuid]&&(i[n.uuid]=r.parse(n)),t.push(i[n.uuid])}n[o.uuid]=t}else void 0===i[o.uuid]&&(i[o.uuid]=r.parse(o)),n[o.uuid]=i[o.uuid]}}return n}parseAnimations(t){const e={};if(void 0!==t)for(let i=0;i<t.length;i++){const n=t[i],r=Ql.parse(n);e[r.uuid]=r}return e}parseImages(t,e){const i=this,n={};let r;function o(t){if("string"==typeof t){const e=t;return function(t){return i.manager.itemStart(t),r.load(t,(function(){i.manager.itemEnd(t)}),void 0,(function(){i.manager.itemError(t),i.manager.itemEnd(t)}))}(/^(\/\/)|([a-z]+:(\/\/)?)/i.test(e)?e:i.resourcePath+e)}return t.data?{data:fi(t.type,t.data),width:t.width,height:t.height}:null}if(void 0!==t&&t.length>0){const i=new $l(e);r=new rc(i),r.setCrossOrigin(this.crossOrigin);for(let e=0,i=t.length;e<i;e++){const i=t[e],r=i.url;if(Array.isArray(r)){n[i.uuid]=[];for(let t=0,e=r.length;t<e;t++){const e=o(r[t]);null!==e&&(e instanceof HTMLImageElement?n[i.uuid].push(e):n[i.uuid].push(new Is(e.data,e.width,e.height)))}}else{const t=o(i.url);null!==t&&(n[i.uuid]=t)}}}return n}async parseImagesAsync(t){const e=this,i={};let n;async function r(t){if("string"==typeof t){const i=t,r=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(i)?i:e.resourcePath+i;return await n.loadAsync(r)}return t.data?{data:fi(t.type,t.data),width:t.width,height:t.height}:null}if(void 0!==t&&t.length>0){n=new rc(this.manager),n.setCrossOrigin(this.crossOrigin);for(let e=0,n=t.length;e<n;e++){const n=t[e],o=n.url;if(Array.isArray(o)){i[n.uuid]=[];for(let t=0,e=o.length;t<e;t++){const e=o[t],s=await r(e);null!==s&&(s instanceof HTMLImageElement?i[n.uuid].push(s):i[n.uuid].push(new Is(s.data,s.width,s.height)))}}else{const t=await r(n.url);null!==t&&(i[n.uuid]=t)}}}return i}parseTextures(t,e){function i(t,e){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}const n={};if(void 0!==t)for(let r=0,o=t.length;r<o;r++){const o=t[r];let s;void 0===o.image&&console.warn('THREE.ObjectLoader: No "image" specified for',o.uuid),void 0===e[o.image]&&console.warn("THREE.ObjectLoader: Undefined image",o.image);const a=e[o.image];Array.isArray(a)?(s=new Ji(a),6===a.length&&(s.needsUpdate=!0)):(s=a&&a.data?new Is(a.data,a.width,a.height):new wt(a),a&&(s.needsUpdate=!0)),s.uuid=o.uuid,void 0!==o.name&&(s.name=o.name),void 0!==o.mapping&&(s.mapping=i(o.mapping,Oc)),void 0!==o.offset&&s.offset.fromArray(o.offset),void 0!==o.repeat&&s.repeat.fromArray(o.repeat),void 0!==o.center&&s.center.fromArray(o.center),void 0!==o.rotation&&(s.rotation=o.rotation),void 0!==o.wrap&&(s.wrapS=i(o.wrap[0],kc),s.wrapT=i(o.wrap[1],kc)),void 0!==o.format&&(s.format=o.format),void 0!==o.type&&(s.type=o.type),void 0!==o.encoding&&(s.encoding=o.encoding),void 0!==o.minFilter&&(s.minFilter=i(o.minFilter,Nc)),void 0!==o.magFilter&&(s.magFilter=i(o.magFilter,Nc)),void 0!==o.anisotropy&&(s.anisotropy=o.anisotropy),void 0!==o.flipY&&(s.flipY=o.flipY),void 0!==o.premultiplyAlpha&&(s.premultiplyAlpha=o.premultiplyAlpha),void 0!==o.unpackAlignment&&(s.unpackAlignment=o.unpackAlignment),n[o.uuid]=s}return n}parseObject(t,e,i,n,r){let o,s,a;function l(t){return void 0===e[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),e[t]}function c(t){if(void 0!==t){if(Array.isArray(t)){const e=[];for(let n=0,r=t.length;n<r;n++){const r=t[n];void 0===i[r]&&console.warn("THREE.ObjectLoader: Undefined material",r),e.push(i[r])}return e}return void 0===i[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),i[t]}}function u(t){return void 0===n[t]&&console.warn("THREE.ObjectLoader: Undefined texture",t),n[t]}switch(t.type){case"Scene":o=new Ko,void 0!==t.background&&(Number.isInteger(t.background)?o.background=new Je(t.background):o.background=u(t.background)),void 0!==t.environment&&(o.environment=u(t.environment)),void 0!==t.fog&&("Fog"===t.fog.type?o.fog=new Jo(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(o.fog=new Qo(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":o=new Zi(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(o.focus=t.focus),void 0!==t.zoom&&(o.zoom=t.zoom),void 0!==t.filmGauge&&(o.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(o.filmOffset=t.filmOffset),void 0!==t.view&&(o.view=Object.assign({},t.view));break;case"OrthographicCamera":o=new _n(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(o.zoom=t.zoom),void 0!==t.view&&(o.view=Object.assign({},t.view));break;case"AmbientLight":o=new Mc(t.color,t.intensity);break;case"DirectionalLight":o=new Sc(t.color,t.intensity);break;case"PointLight":o=new Ac(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":o=new Tc(t.color,t.intensity,t.width,t.height);break;case"SpotLight":o=new vc(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":o=new pc(t.color,t.groundColor,t.intensity);break;case"LightProbe":o=(new Cc).fromJSON(t);break;case"SkinnedMesh":s=l(t.geometry),a=c(t.material),o=new Ms(s,a),void 0!==t.bindMode&&(o.bindMode=t.bindMode),void 0!==t.bindMatrix&&o.bindMatrix.fromArray(t.bindMatrix),void 0!==t.skeleton&&(o.skeleton=t.skeleton);break;case"Mesh":s=l(t.geometry),a=c(t.material),o=new Vi(s,a);break;case"InstancedMesh":s=l(t.geometry),a=c(t.material);const e=t.count,i=t.instanceMatrix,n=t.instanceColor;o=new Bs(s,a,e),o.instanceMatrix=new Ds(new Float32Array(i.array),16),void 0!==n&&(o.instanceColor=new Ds(new Float32Array(n.array),n.itemSize));break;case"LOD":o=new xs;break;case"Line":o=new Hs(l(t.geometry),c(t.material));break;case"LineLoop":o=new Zs(l(t.geometry),c(t.material));break;case"LineSegments":o=new Xs(l(t.geometry),c(t.material));break;case"PointCloud":case"Points":o=new ta(l(t.geometry),c(t.material));break;case"Sprite":o=new gs(c(t.material));break;case"Group":o=new jo;break;case"Bone":o=new Ts;break;default:o=new Le}if(o.uuid=t.uuid,void 0!==t.name&&(o.name=t.name),void 0!==t.matrix?(o.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(o.matrixAutoUpdate=t.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(void 0!==t.position&&o.position.fromArray(t.position),void 0!==t.rotation&&o.rotation.fromArray(t.rotation),void 0!==t.quaternion&&o.quaternion.fromArray(t.quaternion),void 0!==t.scale&&o.scale.fromArray(t.scale)),void 0!==t.castShadow&&(o.castShadow=t.castShadow),void 0!==t.receiveShadow&&(o.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(o.shadow.bias=t.shadow.bias),void 0!==t.shadow.normalBias&&(o.shadow.normalBias=t.shadow.normalBias),void 0!==t.shadow.radius&&(o.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&o.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(o.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(o.visible=t.visible),void 0!==t.frustumCulled&&(o.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(o.renderOrder=t.renderOrder),void 0!==t.userData&&(o.userData=t.userData),void 0!==t.layers&&(o.layers.mask=t.layers),void 0!==t.children){const s=t.children;for(let t=0;t<s.length;t++)o.add(this.parseObject(s[t],e,i,n,r))}if(void 0!==t.animations){const e=t.animations;for(let t=0;t<e.length;t++){const i=e[t];o.animations.push(r[i])}}if("LOD"===t.type){void 0!==t.autoUpdate&&(o.autoUpdate=t.autoUpdate);const e=t.levels;for(let t=0;t<e.length;t++){const i=e[t],n=o.getObjectByProperty("uuid",i.object);void 0!==n&&o.addLevel(n,i.distance)}}return o}bindSkeletons(t,e){0!==Object.keys(e).length&&t.traverse((function(t){if(!0===t.isSkinnedMesh&&void 0!==t.skeleton){const i=e[t.skeleton];void 0===i?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",t.skeleton):t.bind(i,t.bindMatrix)}}))}setTexturePath(t){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(t)}},t.ObjectSpaceNormalMap=1,t.OctahedronBufferGeometry=fl,t.OctahedronGeometry=fl,t.OneFactor=201,t.OneMinusDstAlphaFactor=207,t.OneMinusDstColorFactor=209,t.OneMinusSrcAlphaFactor=205,t.OneMinusSrcColorFactor=203,t.OrthographicCamera=_n,t.PCFShadowMap=1,t.PCFSoftShadowMap=2,t.PMREMGenerator=kn,t.ParametricBufferGeometry=ml,t.ParametricGeometry=ml,t.Particle=function(t){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new gs(t)},t.ParticleBasicMaterial=function(t){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new Ys(t)},t.ParticleSystem=function(t,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new ta(t,e)},t.ParticleSystemMaterial=function(t){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new Ys(t)},t.Path=cc,t.PerspectiveCamera=Zi,t.Plane=nn,t.PlaneBufferGeometry=cn,t.PlaneGeometry=cn,t.PlaneHelper=class extends Hs{constructor(t,e=1,i=16776960){const n=i,r=new wi;r.setAttribute("position",new ui([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),r.computeBoundingSphere(),super(r,new zs({color:n,toneMapped:!1})),this.type="PlaneHelper",this.plane=t,this.size=e;const o=new wi;o.setAttribute("position",new ui([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),o.computeBoundingSphere(),this.add(new Vi(o,new Ke({color:n,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(t){let e=-this.plane.constant;Math.abs(e)<1e-8&&(e=1e-8),this.scale.set(.5*this.size,.5*this.size,e),this.children[0].material.side=e<0?1:0,this.lookAt(this.plane.normal),super.updateMatrixWorld(t)}},t.PointCloud=function(t,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new ta(t,e)},t.PointCloudMaterial=function(t){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new Ys(t)},t.PointLight=Ac,t.PointLightHelper=class extends Vi{constructor(t,e,i){super(new vl(e,4,2),new Ke({wireframe:!0,fog:!1,toneMapped:!1})),this.light=t,this.light.updateMatrixWorld(),this.color=i,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}},t.Points=ta,t.PointsMaterial=Ys,t.PolarGridHelper=class extends Xs{constructor(t=10,e=16,i=8,n=64,r=4473924,o=8947848){r=new Je(r),o=new Je(o);const s=[],a=[];for(let i=0;i<=e;i++){const n=i/e*(2*Math.PI),l=Math.sin(n)*t,c=Math.cos(n)*t;s.push(0,0,0),s.push(l,0,c);const u=1&i?r:o;a.push(u.r,u.g,u.b),a.push(u.r,u.g,u.b)}for(let e=0;e<=i;e++){const l=1&e?r:o,c=t-t/i*e;for(let t=0;t<n;t++){let e=t/n*(2*Math.PI),i=Math.sin(e)*c,r=Math.cos(e)*c;s.push(i,0,r),a.push(l.r,l.g,l.b),e=(t+1)/n*(2*Math.PI),i=Math.sin(e)*c,r=Math.cos(e)*c,s.push(i,0,r),a.push(l.r,l.g,l.b)}}const l=new wi;l.setAttribute("position",new ui(s,3)),l.setAttribute("color",new ui(a,3)),super(l,new zs({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}},t.PolyhedronBufferGeometry=ca,t.PolyhedronGeometry=ca,t.PositionalAudio=class extends tu{constructor(t){super(t),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(t){return this.panner.refDistance=t,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(t){return this.panner.rolloffFactor=t,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(t){return this.panner.distanceModel=t,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(t){return this.panner.maxDistance=t,this}setDirectionalCone(t,e,i){return this.panner.coneInnerAngle=t,this.panner.coneOuterAngle=e,this.panner.coneOuterGain=i,this}updateMatrixWorld(t){if(super.updateMatrixWorld(t),!0===this.hasPlaybackControl&&!1===this.isPlaying)return;this.matrixWorld.decompose(eu,iu,nu),ru.set(0,0,1).applyQuaternion(iu);const e=this.panner;if(e.positionX){const t=this.context.currentTime+this.listener.timeDelta;e.positionX.linearRampToValueAtTime(eu.x,t),e.positionY.linearRampToValueAtTime(eu.y,t),e.positionZ.linearRampToValueAtTime(eu.z,t),e.orientationX.linearRampToValueAtTime(ru.x,t),e.orientationY.linearRampToValueAtTime(ru.y,t),e.orientationZ.linearRampToValueAtTime(ru.z,t)}else e.setPosition(eu.x,eu.y,eu.z),e.setOrientation(ru.x,ru.y,ru.z)}},t.PropertyBinding=yu,t.PropertyMixer=su,t.QuadraticBezierCurve=Da,t.QuadraticBezierCurve3=Ra,t.Quaternion=It,t.QuaternionKeyframeTrack=Xl,t.QuaternionLinearInterpolant=ql,t.REVISION=e,t.RGBADepthPacking=3201,t.RGBAFormat=M,t.RGBAIntegerFormat=1033,t.RGBA_ASTC_10x10_Format=37819,t.RGBA_ASTC_10x5_Format=37816,t.RGBA_ASTC_10x6_Format=37817,t.RGBA_ASTC_10x8_Format=37818,t.RGBA_ASTC_12x10_Format=37820,t.RGBA_ASTC_12x12_Format=37821,t.RGBA_ASTC_4x4_Format=37808,t.RGBA_ASTC_5x4_Format=37809,t.RGBA_ASTC_5x5_Format=37810,t.RGBA_ASTC_6x5_Format=37811,t.RGBA_ASTC_6x6_Format=37812,t.RGBA_ASTC_8x5_Format=37813,t.RGBA_ASTC_8x6_Format=37814,t.RGBA_ASTC_8x8_Format=37815,t.RGBA_BPTC_Format=36492,t.RGBA_ETC2_EAC_Format=z,t.RGBA_PVRTC_2BPPV1_Format=N,t.RGBA_PVRTC_4BPPV1_Format=k,t.RGBA_S3TC_DXT1_Format=P,t.RGBA_S3TC_DXT3_Format=L,t.RGBA_S3TC_DXT5_Format=D,t.RGBDEncoding=$,t.RGBEEncoding=Q,t.RGBEFormat=1023,t.RGBFormat=S,t.RGBIntegerFormat=1032,t.RGBM16Encoding=K,t.RGBM7Encoding=J,t.RGB_ETC1_Format=36196,t.RGB_ETC2_Format=B,t.RGB_PVRTC_2BPPV1_Format=O,t.RGB_PVRTC_4BPPV1_Format=R,t.RGB_S3TC_DXT1_Format=C,t.RGFormat=1030,t.RGIntegerFormat=1031,t.RawShaderMaterial=xn,t.Ray=oe,t.Raycaster=class{constructor(t,e,i=0,n=1/0){this.ray=new oe(t,e),this.near=i,this.far=n,this.camera=null,this.layers=new ye,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e&&e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type: "+e.type)}intersectObject(t,e=!1,i=[]){return Su(t,this,i,e),i.sort(Eu),i}intersectObjects(t,e=!1,i=[]){for(let n=0,r=t.length;n<r;n++)Su(t[n],this,i,e);return i.sort(Eu),i}},t.RectAreaLight=Tc,t.RedFormat=1028,t.RedIntegerFormat=1029,t.ReinhardToneMapping=2,t.RepeatWrapping=u,t.ReplaceStencilOp=7681,t.ReverseSubtractEquation=102,t.RingBufferGeometry=gl,t.RingGeometry=gl,t.SRGB8_ALPHA8_ASTC_10x10_Format=37851,t.SRGB8_ALPHA8_ASTC_10x5_Format=37848,t.SRGB8_ALPHA8_ASTC_10x6_Format=37849,t.SRGB8_ALPHA8_ASTC_10x8_Format=37850,t.SRGB8_ALPHA8_ASTC_12x10_Format=37852,t.SRGB8_ALPHA8_ASTC_12x12_Format=37853,t.SRGB8_ALPHA8_ASTC_4x4_Format=37840,t.SRGB8_ALPHA8_ASTC_5x4_Format=37841,t.SRGB8_ALPHA8_ASTC_5x5_Format=37842,t.SRGB8_ALPHA8_ASTC_6x5_Format=37843,t.SRGB8_ALPHA8_ASTC_6x6_Format=37844,t.SRGB8_ALPHA8_ASTC_8x5_Format=37845,t.SRGB8_ALPHA8_ASTC_8x6_Format=37846,t.SRGB8_ALPHA8_ASTC_8x8_Format=37847,t.Scene=Ko,t.SceneUtils=ih,t.ShaderChunk=un,t.ShaderLib=pn,t.ShaderMaterial=qi,t.ShadowMaterial=Tl,t.Shape=uc,t.ShapeBufferGeometry=yl,t.ShapeGeometry=yl,t.ShapePath=zc,t.ShapeUtils=al,t.ShortType=1011,t.Skeleton=Ls,t.SkeletonHelper=Nu,t.SkinnedMesh=Ms,t.SmoothShading=2,t.Sphere=Jt,t.SphereBufferGeometry=vl,t.SphereGeometry=vl,t.Spherical=class{constructor(t=1,e=0,i=0){return this.radius=t,this.phi=e,this.theta=i,this}set(t,e,i){return this.radius=t,this.phi=e,this.theta=i,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){const t=1e-6;return this.phi=Math.max(t,Math.min(Math.PI-t,this.phi)),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,i){return this.radius=Math.sqrt(t*t+e*e+i*i),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,i),this.phi=Math.acos(ut(e/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}},t.SphericalHarmonics3=Ic,t.SplineCurve=Oa,t.SpotLight=vc,t.SpotLightHelper=class extends Le{constructor(t,e){super(),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;const i=new wi,n=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let t=0,e=1,i=32;t<i;t++,e++){const r=t/i*Math.PI*2,o=e/i*Math.PI*2;n.push(Math.cos(r),Math.sin(r),1,Math.cos(o),Math.sin(o),1)}i.setAttribute("position",new ui(n,3));const r=new zs({fog:!1,toneMapped:!1});this.cone=new Xs(i,r),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateMatrixWorld();const t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),Du.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Du),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}},t.Sprite=gs,t.SpriteMaterial=is,t.SrcAlphaFactor=204,t.SrcAlphaSaturateFactor=210,t.SrcColorFactor=202,t.StaticCopyUsage=35046,t.StaticDrawUsage=et,t.StaticReadUsage=35045,t.StereoCamera=class{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Zi,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Zi,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(t){const e=this._cache;if(e.focus!==t.focus||e.fov!==t.fov||e.aspect!==t.aspect*this.aspect||e.near!==t.near||e.far!==t.far||e.zoom!==t.zoom||e.eyeSep!==this.eyeSep){e.focus=t.focus,e.fov=t.fov,e.aspect=t.aspect*this.aspect,e.near=t.near,e.far=t.far,e.zoom=t.zoom,e.eyeSep=this.eyeSep;const i=t.projectionMatrix.clone(),n=e.eyeSep/2,r=n*e.near/e.focus,o=e.near*Math.tan(at*e.fov*.5)/e.zoom;let s,a;Xc.elements[12]=-n,qc.elements[12]=n,s=-o*e.aspect+r,a=o*e.aspect+r,i.elements[0]=2*e.near/(a-s),i.elements[8]=(a+s)/(a-s),this.cameraL.projectionMatrix.copy(i),s=-o*e.aspect-r,a=o*e.aspect-r,i.elements[0]=2*e.near/(a-s),i.elements[8]=(a+s)/(a-s),this.cameraR.projectionMatrix.copy(i)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(Xc),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(qc)}},t.StreamCopyUsage=35042,t.StreamDrawUsage=35040,t.StreamReadUsage=35041,t.StringKeyframeTrack=Zl,t.SubtractEquation=101,t.SubtractiveBlending=3,t.TOUCH={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},t.TangentSpaceNormalMap=0,t.TetrahedronBufferGeometry=_l,t.TetrahedronGeometry=_l,t.TextBufferGeometry=xl,t.TextGeometry=xl,t.Texture=wt,t.TextureLoader=ac,t.TorusBufferGeometry=bl,t.TorusGeometry=bl,t.TorusKnotBufferGeometry=wl,t.TorusKnotGeometry=wl,t.Triangle=Ge,t.TriangleFanDrawMode=2,t.TriangleStripDrawMode=1,t.TrianglesDrawMode=0,t.TubeBufferGeometry=Al,t.TubeGeometry=Al,t.UVMapping=n,t.Uint16Attribute=function(t,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new si(t,e)},t.Uint16BufferAttribute=si,t.Uint32Attribute=function(t,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new li(t,e)},t.Uint32BufferAttribute=li,t.Uint8Attribute=function(t,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new ni(t,e)},t.Uint8BufferAttribute=ni,t.Uint8ClampedAttribute=function(t,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new ri(t,e)},t.Uint8ClampedBufferAttribute=ri,t.Uniform=bu,t.UniformsLib=hn,t.UniformsUtils=Wi,t.UnsignedByteType=_,t.UnsignedInt248Type=E,t.UnsignedIntType=b,t.UnsignedShort4444Type=1017,t.UnsignedShort5551Type=1018,t.UnsignedShort565Type=1019,t.UnsignedShortType=x,t.VSMShadowMap=3,t.Vector2=yt,t.Vector3=Ct,t.Vector4=Et,t.VectorKeyframeTrack=Yl,t.Vertex=function(t,e,i){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new Ct(t,e,i)},t.VertexColors=2,t.VideoTexture=ia,t.WebGL1Renderer=Yo,t.WebGLCubeRenderTarget=Ki,t.WebGLMultipleRenderTargets=Mt,t.WebGLMultisampleRenderTarget=Tt,t.WebGLRenderTarget=St,t.WebGLRenderTargetCube=function(t,e,i){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new Ki(t,i)},t.WebGLRenderer=Zo,t.WebGLUtils=Uo,t.WireframeGeometry=El,t.WireframeHelper=function(t,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new Xs(new El(t.geometry),new zs({color:void 0!==e?e:16777215}))},t.WrapAroundEnding=H,t.XHRLoader=function(t){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new nc(t)},t.ZeroCurvatureEnding=G,t.ZeroFactor=200,t.ZeroSlopeEnding=j,t.ZeroStencilOp=0,t.sRGBEncoding=Z,Object.defineProperty(t,"__esModule",{value:!0})}(e)}(0,ad.exports);var ld=ad.exports,cd={exports:{}},ud={exports:{}},hd={exports:{}};!function(t,e){const i=1024e3,n=.1/180*Math.PI,r=Math.atan(3/4),o=6371008.8;t.exports={WORLD_SIZE:i,PROJECTION_WORLD_SIZE:i/(o*Math.PI*2),MERCATOR_A:o,DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,EARTH_RADIUS:o,EARTH_CIRCUMFERENCE:2*Math.PI*o,EARTH_CIRCUMFERENCE_EQUATOR:40075017,FOV_ORTHO:n,FOV:r,FOV_DEGREES:180*r/Math.PI,TILE_SIZE:512}}(hd);var pd=hd.exports,dd={exports:{}};!function(t,e){function i(){}i.prototype={Coords:function(t){if(t.constructor===Array)if(t.length<2)console.error("Coords length must be at least 2");else{for(const e of t)if(e.constructor!==Number)return void console.error("Coords values must be numbers");if(!(Math.abs(t[1])>90))return t;console.error("Latitude must be between -90 and 90")}else console.error("Coords must be an array")},Line:function(t){if(t.constructor===Array){for(const e of t)if(!this.Coords(e))return void console.error("Each coordinate in a line must be a valid Coords type");return t}console.error("Line must be an array")},Rotation:function(t){if(t.constructor===Number)t={z:t};else{if(t.constructor!==Object)return void console.error("Rotation must be an object or a number");for(const e of Object.keys(t)){if(!["x","y","z"].includes(e))return void console.error("Rotation parameters must be x, y, or z");if(t[e].constructor!==Number)return void console.error("Individual rotation values must be numbers")}}return t},Scale:function(t){if(t.constructor===Number)t={x:t,y:t,z:t};else{if(t.constructor!==Object)return void console.error("Scale must be an object or a number");for(const e of Object.keys(t)){if(!["x","y","z"].includes(e))return void console.error("Scale parameters must be x, y, or z");if(t[e].constructor!==Number)return void console.error("Individual scale values must be numbers")}}return t}},t.exports=i}(dd);var fd=dd.exports;!function(t,e){var i=ld,n=pd,r={prettyPrintMatrix:function(t){for(var e=0;e<4;e++){var i=[t[e],t[e+4],t[e+8],t[e+12]];console.log(i.map((function(t){return t.toFixed(4)})))}},makePerspectiveMatrix:function(t,e,n,r){var o=new i.Matrix4,s=1/Math.tan(t/2),a=1/(n-r),l=[s/e,0,0,0,0,s,0,0,0,0,(r+n)*a,-1,0,0,2*r*n*a,0];return o.elements=l,o},makeOrthographicMatrix:function(t,e,n,r,o,s){var a=new i.Matrix4;const l=1/(e-t),c=1/(n-r),u=1/(s-o);var h=[2*l,0,0,0,0,2*c,0,0,0,0,-1*u,0,-((e+t)*l),-((n+r)*c),-(o*u),1];return a.elements=h,a},radify:function(t){function e(t){return t=t||0,2*Math.PI*t/360}return"object"==typeof t?t.length>0?t.map((function(t){return e(t)})):[e(t.x),e(t.y),e(t.z)]:e(t)},degreeify:function(t){function e(t){return 360*(t=t||0)/(2*Math.PI)}return"object"==typeof t?[e(t.x),e(t.y),e(t.z)]:e(t)},projectToWorld:function(t){var e=[-n.MERCATOR_A*n.DEG2RAD*t[0]*n.PROJECTION_WORLD_SIZE,-n.MERCATOR_A*Math.log(Math.tan(.25*Math.PI+.5*n.DEG2RAD*t[1]))*n.PROJECTION_WORLD_SIZE];if(t[2]){var r=this.projectedUnitsPerMeter(t[1]);e.push(t[2]*r)}else e.push(0);return new i.Vector3(e[0],e[1],e[2])},projectedUnitsPerMeter:function(t){return Math.abs(n.WORLD_SIZE/Math.cos(n.DEG2RAD*t)/n.EARTH_CIRCUMFERENCE)},_circumferenceAtLatitude:function(t){return n.EARTH_CIRCUMFERENCE*Math.cos(t*Math.PI/180)},mercatorZfromAltitude:function(t,e){return t/this._circumferenceAtLatitude(e)},_scaleVerticesToMeters:function(t,e){var i=this.projectedUnitsPerMeter(t[1]);this.projectToWorld(t);for(var n=0;n<e.length;n++)e[n].multiplyScalar(i);return e},projectToScreen:function(t){console.log("WARNING: Projecting to screen coordinates is not yet implemented")},unprojectFromScreen:function(t){console.log("WARNING: unproject is not yet implemented")},unprojectFromWorld:function(t){var e=[-t.x/(n.MERCATOR_A*n.DEG2RAD*n.PROJECTION_WORLD_SIZE),2*(Math.atan(Math.exp(t.y/(n.PROJECTION_WORLD_SIZE*-n.MERCATOR_A)))-Math.PI/4)/n.DEG2RAD],i=this.projectedUnitsPerMeter(e[1]),r=t.z||0;return e.push(r/i),e},toScreenPosition:function(t,e){var n=new i.Vector3,r=.5*renderer.context.canvas.width,o=.5*renderer.context.canvas.height;return t.updateMatrixWorld(),n.setFromMatrixPosition(t.matrixWorld),n.project(e),n.x=n.x*r+r,n.y=-n.y*o+o,{x:n.x,y:n.y}},getFeatureCenter:function(t,e,i){let n=[],r=0,o=0,s=0,a=[...t.geometry.coordinates[0]];return"Point"===t.geometry.type?n=[...a[0]]:("MultiPolygon"===t.geometry.type&&(a=a[0]),a.splice(-1,1),a.forEach((function(t){r+=t[0],o+=t[1]})),n=[r/a.length,o/a.length]),s=this.getObjectHeightOnFloor(t,e,i),n.length<3?n.push(s):n[2]=s,n},getObjectHeightOnFloor:function(t,e,i=t.properties.level||0){let n=i*(t.properties.levelHeight||0),r=t.properties.base_height||t.properties.min_height||0;return n+((e&&e.model?0:t.properties.height-r)+r)},_flipMaterialSides:function(t){},normalizeVertices(t){let e=new i.BufferGeometry,n=[];for(var r=0;r<t.length;r++){let e=t[r];n.push(e.x,e.y,e.z),n.push(e.x,e.y,e.z)}e.setAttribute("position",new i.BufferAttribute(new Float32Array(n),3)),e.computeBoundingSphere();var o=e.boundingSphere.center,s=t.map((function(t){return t.sub(o)}));return{vertices:s,position:o}},flattenVectors(t){var e=[];for(let i of t)e.push(i.x,i.y,i.z);return e},lnglatsToWorld:function(t){var e=t.map((function(t){var e=r.projectToWorld(t);return new i.Vector3(e.x,e.y,e.z)}));return e},extend:function(t,e){for(let i in e)t[i]=e[i]},clone:function(t){var e={};for(let i in t)e[i]=t[i];return e},clamp:function(t,e,i){return Math.min(i,Math.max(e,t))},types:{rotation:function(t,e){t||(t=0),"number"==typeof t&&(t={z:t});var i=this.applyDefault([t.x,t.y,t.z],e);return r.radify(i)},scale:function(t,e){return t||(t=1),"number"==typeof t?[t,t,t]:this.applyDefault([t.x,t.y,t.z],e)},applyDefault:function(t,e){var i=t.map((function(t,i){return t=t||e[i]}));return i}},toDecimal:function(t,e){return Number(t.toFixed(e))},equal:function(t,e){const i=Object.keys(t),n=Object.keys(e);if(i.length!==n.length)return!1;if(0==i.length&&0==n.length&&i!==n)return!1;for(const n of i){const i=t[n],r=e[n],o=this.isObject(i)&&this.isObject(r);if(o&&!equal(i,r)||!o&&i!==r)return!1}return!0},isObject:function(t){return null!=t&&"object"==typeof t},curveToLine:(t,e)=>{let{width:n,color:r}=e,o=(new i.BufferGeometry).setFromPoints(t.getPoints(100)),s=new i.LineBasicMaterial({color:r,linewidth:n});return new i.Line(o,s)},curvesToLines:t=>{var e=[16711680,2031360,2490623],i=t.map(((t,i)=>curveToLine(t,{width:3,color:e[i]||"purple"})));return i},_validate:function(t,e){t=t||{};var i={};r.extend(i,t);for(let n of Object.keys(e))if(void 0===t[n]){if(null===e[n])return void console.error(n+" is required");i[n]=e[n]}else i[n]=t[n];return i},Validator:new fd,exposedMethods:["projectToWorld","projectedUnitsPerMeter","extend","unprojectFromWorld"]};t.exports=r}(ud);var md=ud.exports;!function(t,e){const i=ld,n=md,r=pd;function o(t,e,n){this.map=t,this.camera=e,this.active=!0,this.camera.matrixAutoUpdate=!1,this.world=n||new i.Group,this.world.position.x=this.world.position.y=r.WORLD_SIZE/2,this.world.matrixAutoUpdate=!1,this.state={translateCenter:(new i.Matrix4).makeTranslation(r.WORLD_SIZE/2,-r.WORLD_SIZE/2,0),worldSizeRatio:r.TILE_SIZE/r.WORLD_SIZE,worldSize:r.TILE_SIZE*this.map.transform.scale};let o=this;this.map.on("move",(function(){o.updateCamera()})).on("resize",(function(){o.setupCamera()})),this.setupCamera()}o.prototype={setupCamera:function(){const t=this.map.transform;this.camera.aspect=t.width/t.height,this.halfFov=t._fov/2,this.cameraToCenterDistance=.5/Math.tan(this.halfFov)*t.height;const e=t._maxPitch*Math.PI/180;this.acuteAngle=Math.PI/2-e,this.updateCamera()},updateCamera:function(t){if(!this.camera)return void console.log("nocamera");const e=this.map.transform;this.camera.aspect=e.width/e.height;const r=e.centerOffset||new i.Vector3;let s=0,a=0;this.halfFov=e._fov/2;const l=Math.PI/2+e._pitch,c=Math.cos(Math.PI/2-e._pitch);this.cameraToCenterDistance=.5/Math.tan(this.halfFov)*e.height;let u=1;const h=this.worldSize();if(this.map.tb.mapboxVersion>=2){u=this.mercatorZfromAltitude(1,e.center.lat)*h;const t=e._fov*(.5+e.centerOffset.y/e.height),i=e.elevation?e.elevation.getMinElevationBelowMSL()*u:0,r=(e._camera.position[2]*h-i)/Math.cos(e._pitch);a=c*(Math.sin(t)*r/Math.sin(n.clamp(Math.PI-l-t,.01,Math.PI-.01)))+r;const o=r*(1/e._horizonShift);s=Math.min(1.01*a,o)}else{a=c*(Math.sin(this.halfFov)*this.cameraToCenterDistance/Math.sin(Math.PI-l-this.halfFov))+this.cameraToCenterDistance,s=1.01*a}this.cameraTranslateZ=(new i.Matrix4).makeTranslation(0,0,this.cameraToCenterDistance);const p=e.height/50,d=Math.max(p*c,p),f=e.height,m=e.width;this.camera instanceof i.OrthographicCamera?this.camera.projectionMatrix=n.makeOrthographicMatrix(m/-2,m/2,f/2,f/-2,d,s):this.camera.projectionMatrix=n.makePerspectiveMatrix(e._fov,m/f,d,s),this.camera.projectionMatrix.elements[8]=2*-r.x/e.width,this.camera.projectionMatrix.elements[9]=2*r.y/e.height;let g=this.calcCameraMatrix(e._pitch,e.angle);e.elevation&&(g.elements[14]=e._camera.position[2]*h),this.camera.matrixWorld.copy(g);let y=e.scale*this.state.worldSizeRatio,v=new i.Matrix4,_=new i.Matrix4,x=new i.Matrix4;v.makeScale(y,y,y);let b=e.x||e.point.x,w=e.y||e.point.y;_.makeTranslation(-b,w,0),x.makeRotationZ(Math.PI),this.world.matrix=(new i.Matrix4).premultiply(x).premultiply(this.state.translateCenter).premultiply(v).premultiply(_),this.map.fire("CameraSynced",{detail:{nearZ:d,farZ:s,pitch:e._pitch,angle:e.angle,furthestDistance:a,cameraToCenterDistance:this.cameraToCenterDistance,t:this.map.transform,tbProjMatrix:this.camera.projectionMatrix.elements,tbWorldMatrix:this.world.matrix.elements,cameraSyn:o}})},worldSize(){let t=this.map.transform;return t.tileSize*t.scale},worldSizeFromZoom(){let t=this.map.transform;return Math.pow(2,t.zoom)*t.tileSize},mercatorZfromAltitude(t,e){return t/this.circumferenceAtLatitude(e)},mercatorZfromZoom(){return this.cameraToCenterDistance/this.worldSizeFromZoom()},circumferenceAtLatitude:t=>r.EARTH_CIRCUMFERENCE*Math.cos(t*Math.PI/180),calcCameraMatrix(t,e,n){const r=this.map.transform,o=void 0===t?r._pitch:t,s=void 0===e?r.angle:e,a=void 0===n?this.cameraTranslateZ:n;return(new i.Matrix4).premultiply(a).premultiply((new i.Matrix4).makeRotationX(o)).premultiply((new i.Matrix4).makeRotationZ(s))},updateCameraState(){let t=this.map.transform;if(!t.height)return;const e=t._camera.forward(),i=t.cameraToCenterDistance,n=t.point;t._cameraZoom?t._cameraZoom:t._zoom;const r=this.mercatorZfromZoom(t)-this.mercatorZfromAltitude(t._centerAltitude,t.center.lat),o=t.cameraToCenterDistance/r;return[n.x/this.worldSize()-e[0]*i/o,n.y/this.worldSize()-e[1]*i/o,this.mercatorZfromAltitude(t._centerAltitude,t._center.lat)+-e[2]*i/o]},getWorldToCamera(t,e){let n=this.map.transform;const r=new i.Matrix4,o=new i.Matrix4,s=n._camera._orientation,a=n._camera.position,l=new i.Vector3(a[0],a[1],a[2]),c=new i.Quaternion;c.set(s[0],s[1],s[2],s[3]);const u=c.conjugate();return l.multiplyScalar(-t),o.makeTranslation(l.x,l.y,l.z),r.makeRotationFromQuaternion(u).premultiply(o),r.elements[1]*=-1,r.elements[5]*=-1,r.elements[9]*=-1,r.elements[13]*=-1,r.elements[8]*=e,r.elements[9]*=e,r.elements[10]*=e,r.elements[11]*=e,r},translate(t,e,i){let n,r,o,s,a,l,c,u,h,p,d,f,m=i[0]||i.x,g=i[1]||i.y,y=i[2]||i.z;return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*y+e[12],t[13]=e[1]*m+e[5]*g+e[9]*y+e[13],t[14]=e[2]*m+e[6]*g+e[10]*y+e[14],t[15]=e[3]*m+e[7]*g+e[11]*y+e[15]):(n=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],p=e[9],d=e[10],f=e[11],t[0]=n,t[1]=r,t[2]=o,t[3]=s,t[4]=a,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=p,t[10]=d,t[11]=f,t[12]=n*m+a*g+h*y+e[12],t[13]=r*m+l*g+p*y+e[13],t[14]=o*m+c*g+d*y+e[14],t[15]=s*m+u*g+f*y+e[15]),t}},t.exports=o}(cd);var gd=cd.exports,yd={exports:{}};!function(t,e){!function(){var e=Math.PI,i=Math.sin,n=Math.cos,r=Math.tan,o=Math.asin,s=Math.atan2,a=Math.acos,l=e/180,c=864e5,u=2440588,h=2451545;function p(t){return t.valueOf()/c-.5+u}function d(t){return new Date((t+.5-u)*c)}function f(t){return p(t)-h}var m=23.4397*l;function g(t,e){return s(i(t)*n(m)-r(e)*i(m),n(t))}function y(t,e){return o(i(e)*n(m)+n(e)*i(m)*i(t))}function v(t,e,o){return s(i(t),n(t)*i(e)-r(o)*n(e))}function _(t,e,r){return o(i(e)*i(r)+n(e)*n(r)*n(t))}function x(t,e){return l*(280.16+360.9856235*t)-e}function b(t){return l*(357.5291+.98560028*t)}function w(t){return t+l*(1.9148*i(t)+.02*i(2*t)+3e-4*i(3*t))+102.9372*l+e}function A(t){var e=w(b(t));return{dec:y(e,0),ra:g(e,0)}}var E={getPosition:function(t,e,i){var n=l*-i,r=l*e,o=f(t),s=A(o),a=x(o,n)-s.ra;return{azimuth:v(a,r,s.dec),altitude:_(a,r,s.dec)}},toJulian:function(t){return p(t)}},S=E.times=[[-.833,"sunrise","sunset"],[-.3,"sunriseEnd","sunsetStart"],[-6,"dawn","dusk"],[-12,"nauticalDawn","nauticalDusk"],[-18,"nightEnd","night"],[6,"goldenHourEnd","goldenHour"]];E.addTime=function(t,e,i){S.push([t,e,i])};var M=9e-4;function T(t,i,n){return M+(t+i)/(2*e)+n}function I(t,e,n){return h+t+.0053*i(e)-.0069*i(2*n)}function C(t,e,r,o,s,l,c){var u=function(t,e,r){return a((i(t)-i(e)*i(r))/(n(e)*n(r)))}(t,r,o);return I(T(u,e,s),l,c)}function P(t){var e=l*(134.963+13.064993*t),r=l*(93.272+13.22935*t),o=l*(218.316+13.176396*t)+6.289*l*i(e),s=5.128*l*i(r),a=385001-20905*n(e);return{ra:g(o,s),dec:y(o,s),dist:a}}function L(t,e){return new Date(t.valueOf()+e*c/24)}E.getTimes=function(t,i,n,r){var o,s,a,c,u,h=l*-n,p=l*i,m=function(t){return-2.076*Math.sqrt(t)/60}(r=r||0),g=function(t,i){return Math.round(t-M-i/(2*e))}(f(t),h),v=T(0,h,g),_=b(v),x=w(_),A=y(x,0),E=I(v,_,x),P={solarNoon:d(E),nadir:d(E-.5)};for(o=0,s=S.length;o<s;o+=1)u=E-((c=C(((a=S[o])[0]+m)*l,h,p,A,g,_,x))-E),P[a[1]]=d(u),P[a[2]]=d(c);return P},E.getMoonPosition=function(t,e,o){var a=l*-o,c=l*e,u=f(t),h=P(u),p=x(u,a)-h.ra,d=_(p,c,h.dec),m=s(i(p),r(c)*n(h.dec)-i(h.dec)*n(p));return d+=function(t){return t<0&&(t=0),2967e-7/Math.tan(t+.00312536/(t+.08901179))}(d),{azimuth:v(p,c,h.dec),altitude:d,distance:h.dist,parallacticAngle:m}},E.getMoonIllumination=function(t){var e=f(t||new Date),r=A(e),o=P(e),l=149598e3,c=a(i(r.dec)*i(o.dec)+n(r.dec)*n(o.dec)*n(r.ra-o.ra)),u=s(l*i(c),o.dist-l*n(c)),h=s(n(r.dec)*i(r.ra-o.ra),i(r.dec)*n(o.dec)-n(r.dec)*i(o.dec)*n(r.ra-o.ra));return{fraction:(1+n(u))/2,phase:.5+.5*u*(h<0?-1:1)/Math.PI,angle:h}},E.getMoonTimes=function(t,e,i,n){var r=new Date(t);n?r.setUTCHours(0,0,0,0):r.setHours(0,0,0,0);for(var o,s,a,c,u,h,p,d,f,m,g,y,v,_=.133*l,x=E.getMoonPosition(r,e,i).altitude-_,b=1;b<=24&&(o=E.getMoonPosition(L(r,b),e,i).altitude-_,d=((u=(x+(s=E.getMoonPosition(L(r,b+1),e,i).altitude-_))/2-o)*(p=-(h=(s-x)/2)/(2*u))+h)*p+o,m=0,(f=h*h-4*u*o)>=0&&(g=p-(v=Math.sqrt(f)/(2*Math.abs(u))),y=p+v,Math.abs(g)<=1&&m++,Math.abs(y)<=1&&m++,g<-1&&(g=y)),1===m?x<0?a=b+g:c=b+g:2===m&&(a=b+(d<0?y:g),c=b+(d<0?g:y)),!a||!c);b+=2)x=s;var w={};return a&&(w.rise=L(r,a)),c&&(w.set=L(r,c)),a||c||(w[d>0?"alwaysUp":"alwaysDown"]=!0),w},t.exports=E}()}(yd);var vd=yd.exports,_d={exports:{}},xd={exports:{}};!function(t,e){var i=md,n=ld,r={material:"MeshBasicMaterial",color:"black",opacity:1};t.exports=function(t){var e;function o(){return new n[r.material]({color:r.color})}return t?((e=(t=i._validate(t,r)).material&&t.material.isMaterial?t.material:t.material||t.color||t.opacity?new n[t.material]({color:t.color,transparent:t.opacity<1}):o()).opacity=t.opacity,t.side&&(e.side=t.side)):e=o(),e}}(xd);var bd=xd.exports,wd={exports:{}};!function(t,e){const i=ld,n=md;function r(t){this.map=t,this.enrolledObjects=[],this.previousFrameTime}r.prototype={unenroll:function(t){this.enrolledObjects.splice(this.enrolledObjects.indexOf(t),1)},enroll:function(t){if(t.clock=new i.Clock,t.hasDefaultAnimation=!1,t.defaultAction,t.actions=[],t.mixer,t.animations&&t.animations.length>0){t.hasDefaultAnimation=!0;let n=t.userData.defaultAnimation?t.userData.defaultAnimation:0;t.mixer=new i.AnimationMixer(t),e(n)}function e(e){for(let i=0;i<t.animations.length;i++){e>t.animations.length&&console.log("The animation index "+e+" doesn't exist for this object");let n=t.animations[i],r=t.mixer.clipAction(n);t.actions.push(r),e===i?(t.defaultAction=r,r.setEffectiveWeight(1)):r.setEffectiveWeight(0),r.play()}}let r=!1;Object.defineProperty(t,"isPlaying",{get:()=>r,set(e){r!=e&&(r=e,t.dispatchEvent({type:"IsPlayingChanged",detail:t}))}}),this.enrolledObjects.push(t),t.animationQueue=[],t.set=function(e){if(e.duration>0){let r={start:Date.now(),expiration:Date.now()+e.duration,endState:{}};n.extend(e,r);let o=e.coords,s=e.rotation,a=e.scale||e.scaleX||e.scaleY||e.scaleZ;if(s){let i=t.rotation;e.startRotation=[i.x,i.y,i.z],e.endState.rotation=n.types.rotation(e.rotation,e.startRotation),e.rotationPerMs=e.endState.rotation.map((function(t,i){return(t-e.startRotation[i])/e.duration}))}if(a){let i=t.scale;e.startScale=[i.x,i.y,i.z],e.endState.scale=n.types.scale(e.scale,e.startScale),e.scalePerMs=e.endState.scale.map((function(t,i){return(t-e.startScale[i])/e.duration}))}o&&(e.pathCurve=new i.CatmullRomCurve3(n.lnglatsToWorld([t.coordinates,e.coords])));let l={type:"set",parameters:e};this.animationQueue.push(l),tb.map.repaint=!0}else this.stop(),e.rotation=n.radify(e.rotation),this._setObject(e);return this},t.animationMethod=null,t.stop=function(e){return t.mixer&&(t.isPlaying=!1,cancelAnimationFrame(t.animationMethod)),this.animationQueue=[],this},t.followPath=function(t,e){let r={type:"followPath",parameters:n._validate(t,o.followPath)};return n.extend(r.parameters,{pathCurve:new i.CatmullRomCurve3(n.lnglatsToWorld(t.path)),start:Date.now(),expiration:Date.now()+r.parameters.duration,cb:e}),this.animationQueue.push(r),tb.map.repaint=!0,this},t._setObject=function(e){t.setScale();let r=e.position,o=e.rotation,s=e.scale,a=e.worldCoordinates,l=e.quaternion,c=e.translate,u=e.worldTranslate;if(r){this.coordinates=r;let t=n.projectToWorld(r);this.position.copy(t)}if(c){this.coordinates=[this.coordinates[0]+c[0],this.coordinates[1]+c[1],this.coordinates[2]+c[2]];let t=n.projectToWorld(c);this.position.copy(t),e.position=this.coordinates}if(u){this.translateX(u.x),this.translateY(u.y),this.translateZ(u.z);let t=n.unprojectFromWorld(this.position);this.coordinates=e.position=t}if(o&&(this.rotation.set(o[0],o[1],o[2]),e.rotation=new i.Vector3(o[0],o[1],o[2])),s&&(this.scale.set(s[0],s[1],s[2]),e.scale=this.scale),l&&(this.quaternion.setFromAxisAngle(l[0],l[1]),e.rotation=l[0].multiplyScalar(l[1])),a){this.position.copy(a);let t=n.unprojectFromWorld(a);this.coordinates=e.position=t}this.setBoundingBoxShadowFloor(),this.setReceiveShadowFloor(),this.updateMatrixWorld(),tb.map.repaint=!0;let h={type:"ObjectChanged",detail:{object:this,action:{position:e.position,rotation:e.rotation,scale:e.scale}}};this.dispatchEvent(h)},t.playDefault=function(e){if(t.mixer&&t.hasDefaultAnimation){let i={start:Date.now(),expiration:Date.now()+e.duration,endState:{}};n.extend(e,i),t.mixer.timeScale=e.speed||1;let r={type:"playDefault",parameters:e};return this.animationQueue.push(r),tb.map.repaint=!0,this}},t.playAnimation=function(i){t.mixer&&(i.animation&&e(i.animation),t.playDefault(i))},t.pauseAllActions=function(){t.mixer&&t.actions.forEach((function(t){t.paused=!0}))},t.unPauseAllActions=function(){t.mixer&&t.actions.forEach((function(t){t.paused=!1}))},t.deactivateAllActions=function(){t.mixer&&t.actions.forEach((function(t){t.stop()}))},t.activateAllActions=function(){t.mixer&&t.actions.forEach((function(t){t.play()}))},t.idle=function(){return t.mixer&&t.mixer.update(.01),tb.map.repaint=!0,this}},update:function(t){if(void 0===this.previousFrameTime&&(this.previousFrameTime=t),!this.enrolledObjects)return!1;for(let e=this.enrolledObjects.length-1;e>=0;e--){let n=this.enrolledObjects[e];if(n.animationQueue&&0!==n.animationQueue.length)for(let e=n.animationQueue.length-1;e>=0;e--){let r=n.animationQueue[e];if(!r)continue;let o=r.parameters;if(!o.expiration)return n.animationQueue.splice(e,1),void(n.animationQueue[e]&&(n.animationQueue[e].parameters.start=t));if(t>=o.expiration)o.expiration=!1,"playDefault"===r.type?n.stop():(o.endState&&n._setObject(o.endState),void 0!==o.cb&&o.cb());else{let e=(t-o.start)/o.duration;if("set"===r.type){let t={};o.pathCurve&&(t.worldCoordinates=o.pathCurve.getPoint(e)),o.rotationPerMs&&(t.rotation=o.startRotation.map((function(t,i){return t+o.rotationPerMs[i]*e*o.duration}))),o.scalePerMs&&(t.scale=o.startScale.map((function(t,i){return t+o.scalePerMs[i]*e*o.duration}))),n._setObject(t)}if("followPath"===r.type){let t={worldCoordinates:o.pathCurve.getPointAt(e)};if(o.trackHeading){let n=o.pathCurve.getTangentAt(e).normalize(),r=new i.Vector3(0,0,0),s=new i.Vector3(0,1,0);r.crossVectors(s,n).normalize();let a=Math.acos(s.dot(n));t.quaternion=[r,a]}n._setObject(t)}"playDefault"===r.type&&(n.activateAllActions(),n.isPlaying=!0,n.animationMethod=requestAnimationFrame(this.update),n.mixer.update(n.clock.getDelta()),tb.map.repaint=!0)}}}this.previousFrameTime=t}};const o={followPath:{path:null,duration:1e3,trackHeading:!0}};t.exports=r}(wd);var Ad=wd.exports,Ed={exports:{}};!function(t,e){const i=ld;!function(){class t extends i.Object3D{constructor(t){super(),this.element=t||document.createElement("div"),this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.alwaysVisible=!1,Object.defineProperty(this,"layer",{get(){return this.parent&&this.parent.parent?this.parent.parent.layer:null}}),this.dispose=function(){this.remove(),this.element=null},this.remove=function(){this.element instanceof Element&&null!==this.element.parentNode&&this.element.parentNode.removeChild(this.element)},this.addEventListener("removed",(function(){this.remove()}))}copy(t,e){return super.copy(t,e),this.element=t.element.cloneNode(!0),this}}t.prototype.isCSS2DObject=!0;const e=new i.Vector3,n=new i.Matrix4,r=new i.Matrix4,o=new i.Vector3,s=new i.Vector3;i.CSS2DObject=t,i.CSS2DRenderer=class{constructor(){const t=this;let i,a,l,c;const u={objects:new WeakMap,list:new Map};this.cacheList=u.list;const h=document.createElement("div");function p(i,n,o){if(i.isCSS2DObject)if(i.visible){i.onBeforeRender(t,n,o),e.setFromMatrixPosition(i.matrixWorld),e.applyMatrix4(r);const a=i.element;var s;s=/apple/i.test(navigator.vendor)?"translate(-50%,-50%) translate("+Math.round(e.x*l+l)+"px,"+Math.round(-e.y*c+c)+"px)":"translate(-50%,-50%) translate("+(e.x*l+l)+"px,"+(-e.y*c+c)+"px)",a.style.WebkitTransform=s,a.style.MozTransform=s,a.style.oTransform=s,a.style.transform=s,a.style.display=i.visible&&e.z>=-1&&e.z<=1?"":"none";const p={distanceToCameraSquared:d(o,i)};u.objects.set({key:i.uuid},p),u.list.set(i.uuid,i),a.parentNode!==h&&h.appendChild(a),i.onAfterRender(t,n,o)}else u.objects.delete({key:i.uuid}),u.list.delete(i.uuid),i.remove();for(let t=0,e=i.children.length;t<e;t++)p(i.children[t],n,o)}function d(t,e){return o.setFromMatrixPosition(t.matrixWorld),s.setFromMatrixPosition(e.matrixWorld),o.distanceToSquared(s)}h.style.overflow="hidden",this.domElement=h,this.getSize=function(){return{width:i,height:a}},this.render=function(t,e){!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),n.copy(e.matrixWorldInverse),r.multiplyMatrices(e.projectionMatrix,n),p(t,t,e),function(t){const e=function(t){const e=[];return t.traverse((function(t){t.isCSS2DObject&&e.push(t)})),e}(t).sort((function(t,e){let i=u.objects.get({key:t.uuid}),n=u.objects.get({key:e.uuid});if(i&&n){return i.distanceToCameraSquared-n.distanceToCameraSquared}})),i=e.length;for(let t=0,n=e.length;t<n;t++)e[t].element.style.zIndex=i-t}(t)},this.setSize=function(t,e){i=t,a=e,l=i/2,c=a/2,h.style.width=t+"px",h.style.height=e+"px"}}}}(),t.exports={CSS2DRenderer:i.CSS2DRenderer,CSS2DObject:i.CSS2DObject}}(Ed);var Sd=Ed.exports;!function(t,e){const i=md,n=ld,r=Ad,s=Sd;function a(){}a.prototype={line:function(t){t=i._validate(t,this._defaults.line);var e=i.lnglatsToWorld(t.geometry),r=i.normalizeVertices(e),o=i.flattenVectors(r.vertices),s=new Float32Array(o),a=new n.BufferGeometry;a.setAttribute("position",new n.BufferAttribute(s,3));var l=new n.LineBasicMaterial({color:16711680,linewidth:21}),c=new n.Line(a,l);return c.options=options||{},c.position.copy(r.position),c},extrusion:function(t){},unenroll:function(t,e){e||this.animationManager.unenroll(t)},_addMethods:function(t,e){var r=this;const o="label",l="tooltip",c="help",u="shadowPlane";if(e);else{function p(t,e,n,r){let o=i.radify(r);t.position.sub(e),t.position.applyAxisAngle(n,o),t.position.add(e),t.rotateOnAxis(n,o),tb.map.repaint=!0}t.coordinates||(t.coordinates=[0,0,0]),Object.defineProperty(t,"model",{get:()=>t.getObjectByName("model")}),Object.defineProperty(t,"animations",{get(){const e=t.model;return e?e.animations:null}}),r.animationManager.enroll(t),t.setCoords=function(e){return t.userData.topMargin&&t.userData.feature&&(e[2]+=((t.userData.feature.properties.height||0)-(t.userData.feature.properties.base_height||t.userData.feature.properties.min_height||0))*(t.userData.topMargin||0)),t.coordinates=e,t.set({position:e}),t},t.setTranslate=function(e){return t.set({translate:e}),t},t.setRotation=function(e){"number"==typeof e&&(e={z:e});var n={x:i.radify(e.x)||t.rotation.x,y:i.radify(e.y)||t.rotation.y,z:i.radify(e.z)||t.rotation.z};t._setObject({rotation:[n.x,n.y,n.z]})},t.calculateAdjustedPosition=function(e,n,r){let o=e.slice(),s=i.unprojectFromWorld(t.modelSize);return r?(o[0]-=0!=n.x?s[0]/n.x:0,o[1]-=0!=n.y?s[1]/n.y:0,o[2]-=0!=n.z?s[2]/n.z:0):(o[0]+=0!=n.x?s[0]/n.x:0,o[1]+=0!=n.y?s[1]/n.y:0,o[2]+=0!=n.z?s[2]/n.z:0),o},t.setRotationAxis=function(e){"number"==typeof e&&(e={z:e});let i=t.modelBox(),r=new n.Vector3(i.max.x,i.max.y,i.min.z);0!=e.x&&p(t,r,new n.Vector3(0,0,1),e.x),0!=e.y&&p(t,r,new n.Vector3(0,0,1),e.y),0!=e.z&&p(t,r,new n.Vector3(0,0,1),e.z)},Object.defineProperty(t,"scaleGroup",{get:()=>t.getObjectByName("scaleGroup")}),Object.defineProperty(t,"boxGroup",{get:()=>t.getObjectByName("boxGroup")}),Object.defineProperty(t,"boundingBox",{get:()=>t.getObjectByName("boxModel")}),Object.defineProperty(t,"boundingBoxShadow",{get:()=>t.getObjectByName("boxShadow")}),t.drawBoundingBox=function(){let e=t.box3(),i=new n.Group;i.name="boxGroup",i.updateMatrixWorld(!0);let r=new n.Box3Helper(e,a.prototype._defaults.colors.yellow);r.name="boxModel",i.add(r),r.layers.disable(0);let o=e.clone();o.max.z=o.min.z;let s=new n.Box3Helper(o,a.prototype._defaults.colors.black);s.name="boxShadow",i.add(s),s.layers.disable(0),i.visible=!1,t.scaleGroup.add(i),t.setBoundingBoxShadowFloor()},t.setBoundingBoxShadowFloor=function(){if(t.boundingBoxShadow){let e=-t.modelHeight,i=t.rotation,n=t.boundingBoxShadow;n.box.max.z=n.box.min.z=e,n.rotation.y=i.y,n.rotation.x=-i.x}},t.setAnchor=function(e){const i=t.box3(),r=i.getCenter(new n.Vector3);switch(t.none={x:0,y:0,z:0},t.center={x:r.x,y:r.y,z:i.min.z},t.bottom={x:r.x,y:i.max.y,z:i.min.z},t.bottomLeft={x:i.max.x,y:i.max.y,z:i.min.z},t.bottomRight={x:i.min.x,y:i.max.y,z:i.min.z},t.top={x:r.x,y:i.min.y,z:i.min.z},t.topLeft={x:i.max.x,y:i.min.y,z:i.min.z},t.topRight={x:i.min.x,y:i.min.y,z:i.min.z},t.left={x:i.max.x,y:r.y,z:i.min.z},t.right={x:i.min.x,y:r.y,z:i.min.z},e){case"center":t.anchor=t.center;break;case"top":t.anchor=t.top;break;case"top-left":t.anchor=t.topLeft;break;case"top-right":t.anchor=t.topRight;break;case"left":t.anchor=t.left;break;case"right":t.anchor=t.right;break;case"bottom":t.anchor=t.bottom;break;case"bottom-left":default:t.anchor=t.bottomLeft;break;case"bottom-right":t.anchor=t.bottomRight;break;case"auto":case"none":t.anchor=t.none}t.model.position.set(-t.anchor.x,-t.anchor.y,-t.anchor.z)},t.setCenter=function(e){if(e&&(0!=e.x||0!=e.y||0!=e.z)){let i=t.getSize();t.anchor={x:t.anchor.x-i.x*e.x,y:t.anchor.y-i.y*e.y,z:t.anchor.z-i.z*e.z},t.model.position.set(-t.anchor.x,-t.anchor.y,-t.anchor.z)}},Object.defineProperty(t,"label",{get:()=>t.getObjectByName(o)}),Object.defineProperty(t,"tooltip",{get:()=>t.getObjectByName(l)}),Object.defineProperty(t,"help",{get:()=>t.getObjectByName(c)});let d=!1;Object.defineProperty(t,"hidden",{get:()=>d,set(e){d!=e&&(d=e,t.visibility=!d)}}),Object.defineProperty(t,"visibility",{get:()=>t.visible,set(e){let i=e;if("visible"==e||1==e)i=!0,t.label&&(t.label.visible=i);else{if("none"!=e&&0!=e)return;i=!1,t.label&&t.label.alwaysVisible&&(t.label.visible=i),t.tooltip&&(t.tooltip.visible=i)}if(t.visible!=i){if(t.hidden&&i)return;t.visible=i,t.model&&t.model.traverse((function(e){"Mesh"!=e.type&&"SkinnedMesh"!=e.type||(i&&t.raycasted?e.layers.enable(0):e.layers.disable(0)),"LineSegments"==e.type&&e.layers.disableAll()}))}}}),t.addLabel=function(e,i,n,r){e&&t.drawLabelHTML(e,i,n,r)},t.removeLabel=function(){t.removeCSS2D(o)},t.drawLabelHTML=function(e,i=!1,n=t.anchor,s=.5){let l=r.drawLabelHTML(e,a.prototype._defaults.label.cssClass),c=t.addCSS2D(l,o,n,s);return c.alwaysVisible=i,c.visible=i,c},t.addTooltip=function(e,i,n,r=!0,o=1){let s=t.addHelp(e,l,i,n,o);s.visible=!1,s.custom=r},t.removeTooltip=function(){t.removeCSS2D(l)},t.addHelp=function(e,i=c,n=!1,o=t.anchor,s=0){let a=r.drawTooltip(e,n),l=t.addCSS2D(a,i,o,s);return l.visible=!0,l},t.removeHelp=function(){t.removeCSS2D(c)},t.addCSS2D=function(e,i,r=t.anchor,o=1){if(e){const a=t.box3(),l=a.getSize(new n.Vector3);let c={x:a.max.x,y:a.max.y,z:a.min.z};t.removeCSS2D(i);let u=new s.CSS2DObject(e);return u.name=i,u.position.set(.5*-l.x-t.model.position.x-r.x+c.x,.5*-l.y-t.model.position.y-r.y+c.y,l.z*o),u.visible=!1,t.scaleGroup.add(u),u}},t.removeCSS2D=function(e){let i=t.getObjectByName(e);if(i){i.dispose();let e=t.scaleGroup.children;e.splice(e.indexOf(i),1)}},Object.defineProperty(t,"shadowPlane",{get:()=>t.getObjectByName(u)});let f=!1;Object.defineProperty(t,"castShadow",{get:()=>f,set(e){if(t.model&&f!==e){if(t.model.traverse((function(t){t.isMesh&&(t.castShadow=!0)})),e){const i=t.modelSize,r=[i.x,i.y,i.z,t.modelHeight],o=10*Math.max(...r),s=new n.PlaneBufferGeometry(o,o),a=new n.ShadowMaterial;a.opacity=.5;let l=new n.Mesh(s,a);l.name=u,l.layers.enable(1),l.layers.disable(0),l.receiveShadow=e,t.add(l)}else t.traverse((function(e){e.isMesh&&e.material instanceof n.ShadowMaterial&&t.remove(e)}));f=e}}}),t.setReceiveShadowFloor=function(){if(t.castShadow){let e=t.shadowPlane,i=e.position,n=e.rotation;if(i.z=-t.modelHeight,n.y=t.rotation.y,n.x=-t.rotation.x,"meters"===t.userData.units){const n=t.modelSize,r=[n.x,n.y,n.z,-i.z],o=10*Math.max(...r)/e.geometry.parameters.width;e.scale.set(o,o,o)}}};let m=!1;Object.defineProperty(t,"receiveShadow",{get:()=>m,set(e){t.model&&m!==e&&(t.model.traverse((function(t){t.isMesh&&(t.receiveShadow=!0)})),m=e)}});let g=!1;Object.defineProperty(t,"wireframe",{get:()=>g,set(e){t.model&&g!==e&&(t.model.traverse((function(t){if("Mesh"==t.type||"SkinnedMesh"==t.type){let i=[];Array.isArray(t.material)?i=t.material:i.push(t.material);let n=i[0];e?(t.userData.materials=n,t.material=n.clone(),t.material.wireframe=t.material.transparent=e,t.material.opacity=.3):(t.material.dispose(),t.material=t.userData.materials,t.userData.materials.dispose(),t.userData.materials=null),e?(t.layers.disable(0),t.layers.enable(1)):(t.layers.disable(1),t.layers.enable(0))}"LineSegments"==t.type&&t.layers.disableAll()})),g=e,t.dispatchEvent({type:"Wireframed",detail:t}))}});let y=null;Object.defineProperty(t,"color",{get:()=>y,set(e){t.model&&y!==e&&(t.model.traverse((function(t){if("Mesh"==t.type||"SkinnedMesh"==t.type){let i=[];Array.isArray(t.material)?i=t.material:i.push(t.material);let r=i[0];e?(t.userData.materials=r,t.material=new n.MeshStandardMaterial,t.material.color.setHex(e)):(t.material.dispose(),t.material=t.userData.materials,t.userData.materials.dispose(),t.userData.materials=null)}})),y=e)}});let v=!1;Object.defineProperty(t,"selected",{get:()=>v,set(e){e?(t.userData.bbox&&!t.boundingBox&&t.drawBoundingBox(),t.boxGroup&&(t.boundingBox.material=a.prototype._defaults.materials.boxSelectedMaterial,t.boundingBox.parent.visible=!0,t.boundingBox.layers.enable(1),t.boundingBoxShadow.layers.enable(1)),t.label&&!t.label.alwaysVisible&&(t.label.visible=!0)):(t.boxGroup&&t.remove(t.boxGroup),t.label&&!t.label.alwaysVisible&&(t.label.visible=!1),t.removeHelp()),t.tooltip&&(t.tooltip.visible=e),v!=e&&(v=e,t.dispatchEvent({type:"SelectedChange",detail:t}))}});let _=!0;Object.defineProperty(t,"raycasted",{get:()=>_,set(e){t.model&&_!==e&&(t.model.traverse((function(t){"Mesh"!=t.type&&"SkinnedMesh"!=t.type||(e?(t.layers.disable(1),t.layers.enable(0)):(t.layers.disable(0),t.layers.enable(1)))})),_=e)}});let x=!1;Object.defineProperty(t,"over",{get:()=>x,set(e){e?(t.selected||(t.userData.bbox&&!t.boundingBox&&t.drawBoundingBox(),t.userData.tooltip&&!t.tooltip&&t.addTooltip(t.uuid,!0,t.anchor,!1),t.boxGroup&&(t.boundingBox.material=a.prototype._defaults.materials.boxOverMaterial,t.boundingBox.parent.visible=!0,t.boundingBox.layers.enable(1),t.boundingBoxShadow.layers.enable(1))),t.label&&!t.label.alwaysVisible&&(t.label.visible=!0),t.dispatchEvent({type:"ObjectMouseOver",detail:t})):(t.selected||(t.boxGroup&&(t.remove(t.boxGroup),t.tooltip&&!t.tooltip.custom&&t.removeTooltip()),t.label&&!t.label.alwaysVisible&&(t.label.visible=!1)),t.dispatchEvent({type:"ObjectMouseOut",detail:t})),t.tooltip&&(t.tooltip.visible=e||t.selected),x=e}}),t.box3=function(){let e;if(t.updateMatrix(),t.updateMatrixWorld(!0,!0),t.model){let i=t.clone(!0),r=t.model.clone();if(e=(new n.Box3).setFromObject(r),t.parent){let o=new n.Matrix4,s=new n.Matrix4;t.matrix.extractRotation(o),s.copy(o).invert(),i.setRotationFromMatrix(s),e=(new n.Box3).setFromObject(r)}}return e},t.modelBox=function(){return t.box3()},t.getSize=function(){return t.box3().getSize(new n.Vector3(0,0,0))};let b=!1;Object.defineProperty(t,"modelSize",{get:()=>(b=t.getSize(),b),set(t){b!=t&&(b=t)}}),Object.defineProperty(t,"modelHeight",{get(){let e=t.coordinates[2]||0;return"scene"===t.userData.units&&(e*=t.unitsPerMeter/t.scale.x),e}}),Object.defineProperty(t,"unitsPerMeter",{get:()=>Number(i.projectedUnitsPerMeter(t.coordinates[1]).toFixed(7))}),Object.defineProperty(t,"fixedZoom",{get:()=>t.userData.fixedZoom,set(e){t.userData.fixedZoom!==e&&(t.userData.fixedZoom=e,t.userData.units=e?"scene":"meters")}}),t.setFixedZoom=function(e){if(null!=t.fixedZoom&&0!=t.fixedZoom){e||(e=t.userData.mapScale);let n=(i=t.fixedZoom,Math.pow(2,i));if(n>e){let i=n/e;t.scale.set(i,i,i)}else t.scale.set(1,1,1)}var i},t.setScale=function(e){if("scene"!=t.userData.units){let e=t.unitsPerMeter;t.scale.set(e,e,e)}else t.fixedZoom?(e&&(t.userData.mapScale=e),t.setFixedZoom(t.userData.mapScale)):t.scale.set(1,1,1)},t.setObjectScale=function(e){t.setScale(e),t.setBoundingBoxShadowFloor(),t.setReceiveShadowFloor()}}t.add=function(e){return t.scaleGroup.add(e),e.position.z=t.coordinates[2]?-t.coordinates[2]:0,e},t.remove=function(e){e&&(e.traverse((t=>{if(t.geometry&&t.geometry.dispose(),t.material)if(t.material.isMaterial)h(t.material);else for(const e of t.material)h(e);t.dispose&&t.dispose()})),t.scaleGroup.remove(e),tb.map.repaint=!0)},t.duplicate=function(e){let n=t.clone(!0);if(n.getObjectByName("model").animations=t.animations,n.userData.feature&&(e&&e.feature&&(n.userData.feature=e.feature),n.userData.feature.properties.uuid=n.uuid),r._addMethods(n),!e||i.equal(e.scale,t.userData.scale))return n.copyAnchor(t),n;{n.userData=e,n.userData.isGeoGroup=!0,n.remove(n.boxGroup);const t=i.types.rotation(e.rotation,[0,0,0]),r=i.types.scale(e.scale,[1,1,1]);return n.model.position.set(0,0,0),n.model.rotation.set(t[0],t[1],t[2]),n.model.scale.set(r[0],r[1],r[2]),n.setAnchor(e.anchor),n.setCenter(e.adjustment),n}},t.copyAnchor=function(e){t.anchor=e.anchor,t.none={x:0,y:0,z:0},t.center=e.center,t.bottom=e.bottom,t.bottomLeft=e.bottomLeft,t.bottomRight=e.bottomRight,t.top=e.top,t.topLeft=e.topLeft,t.topRight=e.topRight,t.left=e.left,t.right=e.right},t.dispose=function(){a.prototype.unenroll(t),t.traverse((t=>{if((!t.parent||"world"!=t.parent.name)&&"threeboxObject"!==t.name){if(t.geometry&&t.geometry.dispose(),t.material)if(t.material.isMaterial)h(t.material);else for(const e of t.material)h(e);t.dispose&&t.dispose()}})),t.children=[]};const h=t=>{t.dispose();for(const e of Object.keys(t)){const i=t[e];i&&"object"==typeof i&&"minFilter"in i&&i.dispose()}let e=t;(e.map||e.alphaMap||e.aoMap||e.bumpMap||e.displacementMap||e.emissiveMap||e.envMap||e.lightMap||e.metalnessMap||e.normalMap||e.roughnessMap)&&(e.map&&e.map.dispose(),e.alphaMap&&e.alphaMap.dispose(),e.aoMap&&e.aoMap.dispose(),e.bumpMap&&e.bumpMap.dispose(),e.displacementMap&&e.displacementMap.dispose(),e.emissiveMap&&e.emissiveMap.dispose(),e.envMap&&e.envMap.dispose(),e.lightMap&&e.lightMap.dispose(),e.metalnessMap&&e.metalnessMap.dispose(),e.normalMap&&e.normalMap.dispose(),e.roughnessMap&&e.roughnessMap.dispose())};return t},_makeGroup:function(t,e){let i=new n.Group;i.name="scaleGroup",i.add(t);var r=new n.Group;if(r.userData=e||{},r.userData.isGeoGroup=!0,r.userData.feature&&(r.userData.feature.properties.uuid=r.uuid),i.length)for(o of i)r.add(o);else r.add(i);return r.name="threeboxObject",r},animationManager:new r,drawTooltip:function(t,e=!1){if(t){let i;if(e){let e=document.createElement("div");e.className="mapboxgl-popup-content";let n=document.createElement("strong");n.innerHTML=t,e.appendChild(n);let r=document.createElement("div");r.className="mapboxgl-popup-tip";let o=document.createElement("div");o.className="marker mapboxgl-popup-anchor-bottom",o.appendChild(r),o.appendChild(e),i=document.createElement("div"),i.className+="label3D",i.appendChild(o)}else i=document.createElement("span"),i.className=this._defaults.tooltip.cssClass,i.innerHTML=t;return i}},drawLabelHTML:function(t,e){let i=document.createElement("div");return i.className+=e,i.innerHTML="string"==typeof t?t:t.outerHTML,i},_defaults:{colors:{red:new n.Color(16711680),yellow:new n.Color(16776960),green:new n.Color(65280),black:new n.Color(0)},materials:{boxNormalMaterial:new n.LineBasicMaterial({color:new n.Color(16711680)}),boxOverMaterial:new n.LineBasicMaterial({color:new n.Color(16776960)}),boxSelectedMaterial:new n.LineBasicMaterial({color:new n.Color(65280)})},line:{geometry:null,color:"black",width:1,opacity:1},label:{htmlElement:null,cssClass:" label3D",alwaysVisible:!1,topMargin:-.5},tooltip:{text:"",cssClass:"toolTip text-xs",mapboxStyle:!1,topMargin:0},sphere:{position:[0,0,0],radius:1,sides:20,units:"scene",material:"MeshBasicMaterial",anchor:"bottom-left",bbox:!0,tooltip:!0,raycasted:!0},tube:{geometry:null,radius:1,sides:6,units:"scene",material:"MeshBasicMaterial",anchor:"center",bbox:!0,tooltip:!0,raycasted:!0},loadObj:{type:null,obj:null,units:"scene",scale:1,rotation:0,defaultAnimation:0,anchor:"bottom-left",bbox:!0,tooltip:!0,raycasted:!0,clone:!0},Object3D:{obj:null,units:"scene",anchor:"bottom-left",bbox:!0,tooltip:!0,raycasted:!0},extrusion:{coordinates:[[[]]],geometryOptions:{},height:100,materials:new n.MeshPhongMaterial({color:6684672,side:n.DoubleSide}),scale:1,rotation:0,units:"scene",anchor:"center",bbox:!0,tooltip:!0,raycasted:!0}},geometries:{line:["LineString"],tube:["LineString"],sphere:["Point"]}},t.exports=a}(_d);var Md=_d.exports,Td={exports:{}},Id={exports:{}};!function(t,e){const i=Md,n=md;t.exports=function(t){let e=(t=n._validate(t,i.prototype._defaults.Object3D)).obj;const r=n.types.rotation(t.rotation,[0,0,0]),o=n.types.scale(t.scale,[1,1,1]);e.rotation.set(r[0],r[1],r[2]),e.scale.set(o[0],o[1],o[2]),e.name="model";let s=i.prototype._makeGroup(e,t);return t.obj.name="model",i.prototype._addMethods(s),s.setAnchor(t.anchor),s.setCenter(t.adjustment),s.raycasted=t.raycasted,s.visibility=!0,s}}(Id);var Cd=Id.exports;!function(t,e){const i=md,n=bd,r=ld,o=Md,s=Cd;t.exports=function(t){t=i._validate(t,o.prototype._defaults.sphere);let e=new r.SphereBufferGeometry(t.radius,t.sides,t.sides),a=n(t),l=new r.Mesh(e,a);return new s({obj:l,units:t.units,anchor:t.anchor,adjustment:t.adjustment,bbox:t.bbox,tooltip:t.tooltip,raycasted:t.raycasted})}}(Td);var Pd=Td.exports,Ld={exports:{}};!function(t,e){const i=Md,n=md,r=ld,o=Cd;function s(t){t=n._validate(t,i.prototype._defaults.extrusion);let e=s.prototype.buildShape(t.coordinates),a=s.prototype.buildGeometry(e,t.geometryOptions),l=new r.Mesh(a,t.materials);return t.obj=l,new o(t)}s.prototype={buildShape:function(t){if(t[0]instanceof(r.Vector2||r.Vector3))return new r.Shape(t);let e=new r.Shape;for(let i=0;i<t.length;i++)0===i?e=new r.Shape(this.buildPoints(t[0],t[0])):e.holes.push(new r.Path(this.buildPoints(t[i],t[0])));return e},buildPoints:function(t,e){const i=[];let o=n.projectToWorld([e[0][0],e[0][1],0]);for(let e=0;e<t.length;e++){let s=n.projectToWorld([t[e][0],t[e][1],0]);i.push(new r.Vector2(n.toDecimal(s.x-o.x,9),n.toDecimal(s.y-o.y,9)))}return i},buildGeometry:function(t,e){let i=new r.ExtrudeBufferGeometry(t,e);return i.computeBoundingBox(),i}},t.exports=s}(Ld);var Dd=Ld.exports,Rd={exports:{}};!function(t,e){const i=md,n=Md,r=Sd;t.exports=function(t){t=i._validate(t,n.prototype._defaults.label);let e=n.prototype.drawLabelHTML(t.htmlElement,t.cssClass),o=new r.CSS2DObject(e);o.name="label",o.visible=t.alwaysVisible,o.alwaysVisible=t.alwaysVisible;var s=n.prototype._makeGroup(o,t);return n.prototype._addMethods(s),s.visibility=t.alwaysVisible,s}}(Rd);var Od=Rd.exports,kd={exports:{}};!function(t,e){const i=md,n=Md,r=Sd;t.exports=function(t){if((t=i._validate(t,n.prototype._defaults.tooltip)).text){let i=n.prototype.drawTooltip(t.text,t.mapboxStyle),o=new r.CSS2DObject(i);o.visible=!1,o.name="tooltip";var e=n.prototype._makeGroup(o,t);return n.prototype._addMethods(e),e}}}(kd);var Nd=kd.exports,Bd={exports:{}},zd={exports:{}};!function(t,e){const i=ld;!function(){const t=/^[og]\s*(.+)?/,e=/^mtllib /,n=/^usemtl /,r=/^usemap /,o=new i.Vector3,s=new i.Vector3,a=new i.Vector3,l=new i.Vector3,c=new i.Vector3;function u(){const t={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(t,e){if(this.object&&!1===this.object.fromDeclaration)return this.object.name=t,void(this.object.fromDeclaration=!1!==e);const i=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object={name:t||"",fromDeclaration:!1!==e,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(t,e){const i=this._finalize(!1);i&&(i.inherited||i.groupCount<=0)&&this.materials.splice(i.index,1);const n={index:this.materials.length,name:t||"",mtllib:Array.isArray(e)&&e.length>0?e[e.length-1]:"",smooth:void 0!==i?i.smooth:this.smooth,groupStart:void 0!==i?i.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(t){const e={index:"number"==typeof t?t:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return e.clone=this.clone.bind(e),e}};return this.materials.push(n),n},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(t){const e=this.currentMaterial();if(e&&-1===e.groupEnd&&(e.groupEnd=this.geometry.vertices.length/3,e.groupCount=e.groupEnd-e.groupStart,e.inherited=!1),t&&this.materials.length>1)for(let t=this.materials.length-1;t>=0;t--)this.materials[t].groupCount<=0&&this.materials.splice(t,1);return t&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),e}},i&&i.name&&"function"==typeof i.clone){const t=i.clone(0);t.inherited=!0,this.object.materials.push(t)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(t,e){const i=parseInt(t,10);return 3*(i>=0?i-1:i+e/3)},parseNormalIndex:function(t,e){const i=parseInt(t,10);return 3*(i>=0?i-1:i+e/3)},parseUVIndex:function(t,e){const i=parseInt(t,10);return 2*(i>=0?i-1:i+e/2)},addVertex:function(t,e,i){const n=this.vertices,r=this.object.geometry.vertices;r.push(n[t+0],n[t+1],n[t+2]),r.push(n[e+0],n[e+1],n[e+2]),r.push(n[i+0],n[i+1],n[i+2])},addVertexPoint:function(t){const e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])},addVertexLine:function(t){const e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])},addNormal:function(t,e,i){const n=this.normals,r=this.object.geometry.normals;r.push(n[t+0],n[t+1],n[t+2]),r.push(n[e+0],n[e+1],n[e+2]),r.push(n[i+0],n[i+1],n[i+2])},addFaceNormal:function(t,e,i){const n=this.vertices,r=this.object.geometry.normals;o.fromArray(n,t),s.fromArray(n,e),a.fromArray(n,i),c.subVectors(a,s),l.subVectors(o,s),c.cross(l),c.normalize(),r.push(c.x,c.y,c.z),r.push(c.x,c.y,c.z),r.push(c.x,c.y,c.z)},addColor:function(t,e,i){const n=this.colors,r=this.object.geometry.colors;void 0!==n[t]&&r.push(n[t+0],n[t+1],n[t+2]),void 0!==n[e]&&r.push(n[e+0],n[e+1],n[e+2]),void 0!==n[i]&&r.push(n[i+0],n[i+1],n[i+2])},addUV:function(t,e,i){const n=this.uvs,r=this.object.geometry.uvs;r.push(n[t+0],n[t+1]),r.push(n[e+0],n[e+1]),r.push(n[i+0],n[i+1])},addDefaultUV:function(){const t=this.object.geometry.uvs;t.push(0,0),t.push(0,0),t.push(0,0)},addUVLine:function(t){const e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])},addFace:function(t,e,i,n,r,o,s,a,l){const c=this.vertices.length;let u=this.parseVertexIndex(t,c),h=this.parseVertexIndex(e,c),p=this.parseVertexIndex(i,c);if(this.addVertex(u,h,p),this.addColor(u,h,p),void 0!==s&&""!==s){const t=this.normals.length;u=this.parseNormalIndex(s,t),h=this.parseNormalIndex(a,t),p=this.parseNormalIndex(l,t),this.addNormal(u,h,p)}else this.addFaceNormal(u,h,p);if(void 0!==n&&""!==n){const t=this.uvs.length;u=this.parseUVIndex(n,t),h=this.parseUVIndex(r,t),p=this.parseUVIndex(o,t),this.addUV(u,h,p),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(t){this.object.geometry.type="Points";const e=this.vertices.length;for(let i=0,n=t.length;i<n;i++){const n=this.parseVertexIndex(t[i],e);this.addVertexPoint(n),this.addColor(n)}},addLineGeometry:function(t,e){this.object.geometry.type="Line";const i=this.vertices.length,n=this.uvs.length;for(let e=0,n=t.length;e<n;e++)this.addVertexLine(this.parseVertexIndex(t[e],i));for(let t=0,i=e.length;t<i;t++)this.addUVLine(this.parseUVIndex(e[t],n))}};return t.startObject("",!1),t}class h extends i.Loader{constructor(t){super(t),this.materials=null}load(t,e,n,r){const o=this,s=new i.FileLoader(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,(function(i){try{e(o.parse(i))}catch(e){r?r(e):console.error(e),o.manager.itemError(t)}}),n,r)}setMaterials(t){return this.materials=t,this}parse(o){const s=new u;-1!==o.indexOf("\r\n")&&(o=o.replace(/\r\n/g,"\n")),-1!==o.indexOf("\\\n")&&(o=o.replace(/\\\n/g,""));const a=o.split("\n");let l="",c="",h=0,p=[];const d="function"==typeof"".trimLeft;for(let i=0,o=a.length;i<o;i++)if(l=a[i],l=d?l.trimLeft():l.trim(),h=l.length,0!==h&&(c=l.charAt(0),"#"!==c))if("v"===c){const t=l.split(/\s+/);switch(t[0]){case"v":s.vertices.push(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])),t.length>=7?s.colors.push(parseFloat(t[4]),parseFloat(t[5]),parseFloat(t[6])):s.colors.push(void 0,void 0,void 0);break;case"vn":s.normals.push(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3]));break;case"vt":s.uvs.push(parseFloat(t[1]),parseFloat(t[2]))}}else if("f"===c){const t=l.substr(1).trim().split(/\s+/),e=[];for(let i=0,n=t.length;i<n;i++){const n=t[i];if(n.length>0){const t=n.split("/");e.push(t)}}const i=e[0];for(let t=1,n=e.length-1;t<n;t++){const n=e[t],r=e[t+1];s.addFace(i[0],n[0],r[0],i[1],n[1],r[1],i[2],n[2],r[2])}}else if("l"===c){const t=l.substring(1).trim().split(" ");let e=[];const i=[];if(-1===l.indexOf("/"))e=t;else for(let n=0,r=t.length;n<r;n++){const r=t[n].split("/");""!==r[0]&&e.push(r[0]),""!==r[1]&&i.push(r[1])}s.addLineGeometry(e,i)}else if("p"===c){const t=l.substr(1).trim().split(" ");s.addPointGeometry(t)}else if(null!==(p=t.exec(l))){const t=(" "+p[0].substr(1).trim()).substr(1);s.startObject(t)}else if(n.test(l))s.object.startMaterial(l.substring(7).trim(),s.materialLibraries);else if(e.test(l))s.materialLibraries.push(l.substring(7).trim());else if(r.test(l))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if("s"===c){if(p=l.split(" "),p.length>1){const t=p[1].trim().toLowerCase();s.object.smooth="0"!==t&&"off"!==t}else s.object.smooth=!0;const t=s.object.currentMaterial();t&&(t.smooth=s.object.smooth)}else{if("\0"===l)continue;console.warn('THREE.OBJLoader: Unexpected line: "'+l+'"')}s.finalize();const f=new i.Group;f.materialLibraries=[].concat(s.materialLibraries);if(!0===!(1===s.objects.length&&0===s.objects[0].geometry.vertices.length))for(let t=0,e=s.objects.length;t<e;t++){const e=s.objects[t],n=e.geometry,r=e.materials,o="Line"===n.type,a="Points"===n.type;let l=!1;if(0===n.vertices.length)continue;const c=new i.BufferGeometry;c.setAttribute("position",new i.Float32BufferAttribute(n.vertices,3)),n.normals.length>0&&c.setAttribute("normal",new i.Float32BufferAttribute(n.normals,3)),n.colors.length>0&&(l=!0,c.setAttribute("color",new i.Float32BufferAttribute(n.colors,3))),!0===n.hasUVIndices&&c.setAttribute("uv",new i.Float32BufferAttribute(n.uvs,2));const u=[];for(let t=0,e=r.length;t<e;t++){const e=r[t],n=e.name+"_"+e.smooth+"_"+l;let c=s.materials[n];if(null!==this.materials)if(c=this.materials.create(e.name),!o||!c||c instanceof i.LineBasicMaterial){if(a&&c&&!(c instanceof i.PointsMaterial)){const t=new i.PointsMaterial({size:10,sizeAttenuation:!1});i.Material.prototype.copy.call(t,c),t.color.copy(c.color),t.map=c.map,c=t}}else{const t=new i.LineBasicMaterial;i.Material.prototype.copy.call(t,c),t.color.copy(c.color),c=t}void 0===c&&(c=o?new i.LineBasicMaterial:a?new i.PointsMaterial({size:1,sizeAttenuation:!1}):new i.MeshPhongMaterial,c.name=e.name,c.flatShading=!e.smooth,c.vertexColors=l,s.materials[n]=c),u.push(c)}let h;if(u.length>1){for(let t=0,e=r.length;t<e;t++){const e=r[t];c.addGroup(e.groupStart,e.groupCount,t)}h=o?new i.LineSegments(c,u):a?new i.Points(c,u):new i.Mesh(c,u)}else h=o?new i.LineSegments(c,u[0]):a?new i.Points(c,u[0]):new i.Mesh(c,u[0]);h.name=e.name,f.add(h)}else if(s.vertices.length>0){const t=new i.PointsMaterial({size:1,sizeAttenuation:!1}),e=new i.BufferGeometry;e.setAttribute("position",new i.Float32BufferAttribute(s.vertices,3)),s.colors.length>0&&void 0!==s.colors[0]&&(e.setAttribute("color",new i.Float32BufferAttribute(s.colors,3)),t.vertexColors=!0);const n=new i.Points(e,t);f.add(n)}return f}}i.OBJLoader=h}(),t.exports=i.OBJLoader}(zd);var Fd=zd.exports,Vd={exports:{}};!function(t,e){const i=ld;!function(){class t extends i.Loader{constructor(t){super(t)}load(t,e,n,r){const o=this,s=""===this.path?i.LoaderUtils.extractUrlBase(t||""):this.path,a=new i.FileLoader(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(t,(function(i){try{e(o.parse(i,s))}catch(e){r?r(e):console.error(e),o.manager.itemError(t)}}),n,r)}setMaterialOptions(t){return this.materialOptions=t,this}parse(t,i){const n=t.split("\n");let r={};const o=/\s+/,s={};for(let t=0;t<n.length;t++){let e=n[t];if(e=e.trim(),0===e.length||"#"===e.charAt(0))continue;const i=e.indexOf(" ");let a=i>=0?e.substring(0,i):e;a=a.toLowerCase();let l=i>=0?e.substring(i+1):"";if(l=l.trim(),"newmtl"===a)r={name:l},s[l]=r;else if("ka"===a||"kd"===a||"ks"===a||"ke"===a){const t=l.split(o,3);r[a]=[parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2])]}else r[a]=l}const a=new e(this.resourcePath||i,this.materialOptions);return a.setCrossOrigin(this.crossOrigin),a.setManager(this.manager),a.setMaterials(s),a}}class e{constructor(t="",e={}){this.baseUrl=t,this.options=e,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.crossOrigin="anonymous",this.side=void 0!==this.options.side?this.options.side:i.FrontSide,this.wrap=void 0!==this.options.wrap?this.options.wrap:i.RepeatWrapping}setCrossOrigin(t){return this.crossOrigin=t,this}setManager(t){this.manager=t}setMaterials(t){this.materialsInfo=this.convert(t),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(t){if(!this.options)return t;const e={};for(const i in t){const n=t[i],r={};e[i]=r;for(const t in n){let e=!0,i=n[t];const o=t.toLowerCase();switch(o){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(i=[i[0]/255,i[1]/255,i[2]/255]),this.options&&this.options.ignoreZeroRGBs&&0===i[0]&&0===i[1]&&0===i[2]&&(e=!1)}e&&(r[o]=i)}}return e}preload(){for(const t in this.materialsInfo)this.create(t)}getIndex(t){return this.nameLookup[t]}getAsArray(){let t=0;for(const e in this.materialsInfo)this.materialsArray[t]=this.create(e),this.nameLookup[e]=t,t++;return this.materialsArray}create(t){return void 0===this.materials[t]&&this.createMaterial_(t),this.materials[t]}createMaterial_(t){const e=this,n=this.materialsInfo[t],r={name:t,side:this.side};function o(t,i){if(r[t])return;const n=e.getTextureParams(i,r),o=e.loadTexture((s=e.baseUrl,"string"!=typeof(a=n.url)||""===a?"":/^https?:\/\//i.test(a)?a:s+a));var s,a;o.repeat.copy(n.scale),o.offset.copy(n.offset),o.wrapS=e.wrap,o.wrapT=e.wrap,r[t]=o}for(const t in n){const e=n[t];let s;if(""!==e)switch(t.toLowerCase()){case"kd":r.color=(new i.Color).fromArray(e);break;case"ks":r.specular=(new i.Color).fromArray(e);break;case"ke":r.emissive=(new i.Color).fromArray(e);break;case"map_kd":o("map",e);break;case"map_ks":o("specularMap",e);break;case"map_ke":o("emissiveMap",e);break;case"norm":o("normalMap",e);break;case"map_bump":case"bump":o("bumpMap",e);break;case"map_d":o("alphaMap",e),r.transparent=!0;break;case"ns":r.shininess=parseFloat(e);break;case"d":s=parseFloat(e),s<1&&(r.opacity=s,r.transparent=!0);break;case"tr":s=parseFloat(e),this.options&&this.options.invertTrProperty&&(s=1-s),s>0&&(r.opacity=1-s,r.transparent=!0)}}return this.materials[t]=new i.MeshPhongMaterial(r),this.materials[t]}getTextureParams(t,e){const n={scale:new i.Vector2(1,1),offset:new i.Vector2(0,0)},r=t.split(/\s+/);let o;return o=r.indexOf("-bm"),o>=0&&(e.bumpScale=parseFloat(r[o+1]),r.splice(o,2)),o=r.indexOf("-s"),o>=0&&(n.scale.set(parseFloat(r[o+1]),parseFloat(r[o+2])),r.splice(o,4)),o=r.indexOf("-o"),o>=0&&(n.offset.set(parseFloat(r[o+1]),parseFloat(r[o+2])),r.splice(o,4)),n.url=r.join(" ").trim(),n}loadTexture(t,e,n,r,o){const s=void 0!==this.manager?this.manager:i.DefaultLoadingManager;let a=s.getHandler(t);null===a&&(a=new i.TextureLoader(s)),a.setCrossOrigin&&a.setCrossOrigin(this.crossOrigin);const l=a.load(t,n,r,o);return void 0!==e&&(l.mapping=e),l}}i.MTLLoader=t}(),t.exports=i.MTLLoader}(Vd);var Ud=Vd.exports,Gd={exports:{}},jd={exports:{}};!function(t,e){t.exports=function(){var t={__esModule:!0},i=function(t){var i;try{i("require('worker_threads')").Worker}catch(i){}return e.default=function(t,e,i,n,r){setImmediate((function(){return r(Error("async operations unsupported - update to Node 12+ (or Node 10-11 with the --experimental-worker CLI flag)"),null)}));var o=function(){};return{terminate:o,postMessage:o}},t}({}),n=Uint8Array,r=Uint16Array,o=Uint32Array,s=new n([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new n([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),l=new n([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),c=function(t,e){for(var i=new r(31),n=0;n<31;++n)i[n]=e+=1<<t[n-1];var s=new o(i[30]);for(n=1;n<30;++n)for(var a=i[n];a<i[n+1];++a)s[a]=a-i[n]<<5|n;return[i,s]},u=c(s,2),h=u[0],p=u[1];h[28]=258,p[258]=28;for(var d=c(a,0),f=d[0],m=d[1],g=new r(32768),y=0;y<32768;++y){var v=(43690&y)>>>1|(21845&y)<<1;g[y]=((65280&(v=(61680&(v=(52428&v)>>>2|(13107&v)<<2))>>>4|(3855&v)<<4))>>>8|(255&v)<<8)>>>1}var _=function(t,e,i){for(var n=t.length,o=0,s=new r(e);o<n;++o)++s[t[o]-1];var a,l=new r(e);for(o=0;o<e;++o)l[o]=l[o-1]+s[o-1]<<1;if(i){a=new r(1<<e);var c=15-e;for(o=0;o<n;++o)if(t[o])for(var u=o<<4|t[o],h=e-t[o],p=l[t[o]-1]++<<h,d=p|(1<<h)-1;p<=d;++p)a[g[p]>>>c]=u}else for(a=new r(n),o=0;o<n;++o)t[o]&&(a[o]=g[l[t[o]-1]++]>>>15-t[o]);return a},x=new n(288);for(y=0;y<144;++y)x[y]=8;for(y=144;y<256;++y)x[y]=9;for(y=256;y<280;++y)x[y]=7;for(y=280;y<288;++y)x[y]=8;var b=new n(32);for(y=0;y<32;++y)b[y]=5;var w=_(x,9,0),A=_(x,9,1),E=_(b,5,0),S=_(b,5,1),M=function(t){for(var e=t[0],i=1;i<t.length;++i)t[i]>e&&(e=t[i]);return e},T=function(t,e,i){var n=e/8|0;return(t[n]|t[n+1]<<8)>>(7&e)&i},I=function(t,e){var i=e/8|0;return(t[i]|t[i+1]<<8|t[i+2]<<16)>>(7&e)},C=function(t){return(t/8|0)+(7&t&&1)},P=function(t,e,i){(null==e||e<0)&&(e=0),(null==i||i>t.length)&&(i=t.length);var s=new(t instanceof r?r:t instanceof o?o:n)(i-e);return s.set(t.subarray(e,i)),s},L=function(t,e,i){var r=t.length;if(!r||i&&!i.l&&r<5)return e||new n(0);var o=!e||i,c=!i||i.i;i||(i={}),e||(e=new n(3*r));var u=function(t){var i=e.length;if(t>i){var r=new n(Math.max(2*i,t));r.set(e),e=r}},p=i.f||0,d=i.p||0,m=i.b||0,g=i.l,y=i.d,v=i.m,x=i.n,b=8*r;do{if(!g){i.f=p=T(t,d,1);var w=T(t,d+1,3);if(d+=3,!w){var E=t[(U=C(d)+4)-4]|t[U-3]<<8,L=U+E;if(L>r){if(c)throw"unexpected EOF";break}o&&u(m+E),e.set(t.subarray(U,L),m),i.b=m+=E,i.p=d=8*L;continue}if(1==w)g=A,y=S,v=9,x=5;else{if(2!=w)throw"invalid block type";var D=T(t,d,31)+257,R=T(t,d+10,15)+4,O=D+T(t,d+5,31)+1;d+=14;for(var k=new n(O),N=new n(19),B=0;B<R;++B)N[l[B]]=T(t,d+3*B,7);d+=3*R;var z=M(N),F=(1<<z)-1;if(!c&&d+O*(z+7)>b)break;var V=_(N,z,1);for(B=0;B<O;){var U,G=V[T(t,d,F)];if(d+=15&G,(U=G>>>4)<16)k[B++]=U;else{var j=0,H=0;for(16==U?(H=3+T(t,d,3),d+=2,j=k[B-1]):17==U?(H=3+T(t,d,7),d+=3):18==U&&(H=11+T(t,d,127),d+=7);H--;)k[B++]=j}}var W=k.subarray(0,D),q=k.subarray(D);v=M(W),x=M(q),g=_(W,v,1),y=_(q,x,1)}if(d>b)throw"unexpected EOF"}o&&u(m+131072);for(var X=(1<<v)-1,Z=(1<<x)-1,Y=v+x+18;c||d+Y<b;){var Q=(j=g[I(t,d)&X])>>>4;if((d+=15&j)>b)throw"unexpected EOF";if(!j)throw"invalid length/literal";if(Q<256)e[m++]=Q;else{if(256==Q){g=null;break}var J=Q-254;Q>264&&(J=T(t,d,(1<<(tt=s[B=Q-257]))-1)+h[B],d+=tt);var K=y[I(t,d)&Z],$=K>>>4;if(!K)throw"invalid distance";if(d+=15&K,q=f[$],$>3){var tt=a[$];q+=I(t,d)&(1<<tt)-1,d+=tt}if(d>b)throw"unexpected EOF";o&&u(m+131072);for(var et=m+J;m<et;m+=4)e[m]=e[m-q],e[m+1]=e[m+1-q],e[m+2]=e[m+2-q],e[m+3]=e[m+3-q];m=et}}i.l=g,i.p=d,i.b=m,g&&(p=1,i.m=v,i.d=y,i.n=x)}while(!p);return m==e.length?e:P(e,0,m)},D=function(t,e,i){var n=e/8|0;t[n]|=i<<=7&e,t[n+1]|=i>>>8},R=function(t,e,i){var n=e/8|0;t[n]|=i<<=7&e,t[n+1]|=i>>>8,t[n+2]|=i>>>16},O=function(t,e){for(var i=[],o=0;o<t.length;++o)t[o]&&i.push({s:o,f:t[o]});var s=i.length,a=i.slice();if(!s)return[U,0];if(1==s){var l=new n(i[0].s+1);return l[i[0].s]=1,[l,1]}i.sort((function(t,e){return t.f-e.f})),i.push({s:-1,f:25001});var c=i[0],u=i[1],h=0,p=1,d=2;for(i[0]={s:-1,f:c.f+u.f,l:c,r:u};p!=s-1;)c=i[i[h].f<i[d].f?h++:d++],u=i[h!=p&&i[h].f<i[d].f?h++:d++],i[p++]={s:-1,f:c.f+u.f,l:c,r:u};var f=a[0].s;for(o=1;o<s;++o)a[o].s>f&&(f=a[o].s);var m=new r(f+1),g=k(i[p-1],m,0);if(g>e){o=0;var y=0,v=g-e,_=1<<v;for(a.sort((function(t,e){return m[e.s]-m[t.s]||t.f-e.f}));o<s;++o){var x=a[o].s;if(!(m[x]>e))break;y+=_-(1<<g-m[x]),m[x]=e}for(y>>>=v;y>0;){var b=a[o].s;m[b]<e?y-=1<<e-m[b]++-1:++o}for(;o>=0&&y;--o){var w=a[o].s;m[w]==e&&(--m[w],++y)}g=e}return[new n(m),g]},k=function(t,e,i){return-1==t.s?Math.max(k(t.l,e,i+1),k(t.r,e,i+1)):e[t.s]=i},N=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new r(++e),n=0,o=t[0],s=1,a=function(t){i[n++]=t},l=1;l<=e;++l)if(t[l]==o&&l!=e)++s;else{if(!o&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(o),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(o);s=1,o=t[l]}return[i.subarray(0,n),e]},B=function(t,e){for(var i=0,n=0;n<e.length;++n)i+=t[n]*e[n];return i},z=function(t,e,i){var n=i.length,r=C(e+2);t[r]=255&n,t[r+1]=n>>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var o=0;o<n;++o)t[r+o+4]=i[o];return 8*(r+4+n)},F=function(t,e,i,n,o,c,u,h,p,d,f){D(e,f++,i),++o[256];for(var m=O(o,15),g=m[0],y=m[1],v=O(c,15),A=v[0],S=v[1],M=N(g),T=M[0],I=M[1],C=N(A),P=C[0],L=C[1],k=new r(19),F=0;F<T.length;++F)k[31&T[F]]++;for(F=0;F<P.length;++F)k[31&P[F]]++;for(var V=O(k,7),U=V[0],G=V[1],j=19;j>4&&!U[l[j-1]];--j);var H,W,q,X,Z=d+5<<3,Y=B(o,x)+B(c,b)+u,Q=B(o,g)+B(c,A)+u+14+3*j+B(k,U)+(2*k[16]+3*k[17]+7*k[18]);if(Z<=Y&&Z<=Q)return z(e,f,t.subarray(p,p+d));if(D(e,f,1+(Q<Y)),f+=2,Q<Y){H=_(g,y,0),W=g,q=_(A,S,0),X=A;var J=_(U,G,0);for(D(e,f,I-257),D(e,f+5,L-1),D(e,f+10,j-4),f+=14,F=0;F<j;++F)D(e,f+3*F,U[l[F]]);f+=3*j;for(var K=[T,P],$=0;$<2;++$){var tt=K[$];for(F=0;F<tt.length;++F)D(e,f,J[et=31&tt[F]]),f+=U[et],et>15&&(D(e,f,tt[F]>>>5&127),f+=tt[F]>>>12)}}else H=w,W=x,q=E,X=b;for(F=0;F<h;++F)if(n[F]>255){var et;R(e,f,H[257+(et=n[F]>>>18&31)]),f+=W[et+257],et>7&&(D(e,f,n[F]>>>23&31),f+=s[et]);var it=31&n[F];R(e,f,q[it]),f+=X[it],it>3&&(R(e,f,n[F]>>>5&8191),f+=a[it])}else R(e,f,H[n[F]]),f+=W[n[F]];return R(e,f,H[256]),f+W[256]},V=new o([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),U=new n(0),G=function(t,e,i,l,c,u){var h=t.length,d=new n(l+h+5*(1+Math.ceil(h/7e3))+c),f=d.subarray(l,d.length-c),g=0;if(!e||h<8)for(var y=0;y<=h;y+=65535){var v=y+65535;v<h?g=z(f,g,t.subarray(y,v)):(f[y]=u,g=z(f,g,t.subarray(y,h)))}else{for(var _=V[e-1],x=_>>>13,b=8191&_,w=(1<<i)-1,A=new r(32768),E=new r(w+1),S=Math.ceil(i/3),M=2*S,T=function(e){return(t[e]^t[e+1]<<S^t[e+2]<<M)&w},I=new o(25e3),L=new r(288),D=new r(32),R=0,O=0,k=(y=0,0),N=0,B=0;y<h;++y){var G=T(y),j=32767&y,H=E[G];if(A[j]=H,E[G]=j,N<=y){var W=h-y;if((R>7e3||k>24576)&&W>423){g=F(t,f,0,I,L,D,O,k,B,y-B,g),k=R=O=0,B=y;for(var q=0;q<286;++q)L[q]=0;for(q=0;q<30;++q)D[q]=0}var X=2,Z=0,Y=b,Q=j-H&32767;if(W>2&&G==T(y-Q))for(var J=Math.min(x,W)-1,K=Math.min(32767,y),$=Math.min(258,W);Q<=K&&--Y&&j!=H;){if(t[y+X]==t[y+X-Q]){for(var tt=0;tt<$&&t[y+tt]==t[y+tt-Q];++tt);if(tt>X){if(X=tt,Z=Q,tt>J)break;var et=Math.min(Q,tt-2),it=0;for(q=0;q<et;++q){var nt=y-Q+q+32768&32767,rt=nt-A[nt]+32768&32767;rt>it&&(it=rt,H=nt)}}}Q+=(j=H)-(H=A[j])+32768&32767}if(Z){I[k++]=268435456|p[X]<<18|m[Z];var ot=31&p[X],st=31&m[Z];O+=s[ot]+a[st],++L[257+ot],++D[st],N=y+X,++R}else I[k++]=t[y],++L[t[y]]}}g=F(t,f,u,I,L,D,O,k,B,y-B,g),!u&&7&g&&(g=z(f,g+1,U))}return P(d,0,l+C(g)+c)},j=function(){for(var t=new o(256),e=0;e<256;++e){for(var i=e,n=9;--n;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),H=function(){var t=-1;return{p:function(e){for(var i=t,n=0;n<e.length;++n)i=j[255&i^e[n]]^i>>>8;t=i},d:function(){return~t}}},W=function(){var t=1,e=0;return{p:function(i){for(var n=t,r=e,o=i.length,s=0;s!=o;){for(var a=Math.min(s+2655,o);s<a;++s)r+=n+=i[s];n=(65535&n)+15*(n>>16),r=(65535&r)+15*(r>>16)}t=n,e=r},d:function(){return((t%=65521)>>>8<<16|(255&(e%=65521))<<8|e>>>8)+2*((255&t)<<23)}}},q=function(t,e,i,n,r){return G(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,i,n,!r)},X=function(t,e){var i={};for(var n in t)i[n]=t[n];for(var n in e)i[n]=e[n];return i},Z=function(t,e,i){for(var n=t(),r=""+t,o=r.slice(r.indexOf("[")+1,r.lastIndexOf("]")).replace(/ /g,"").split(","),s=0;s<n.length;++s){var a=n[s],l=o[s];if("function"==typeof a){e+=";"+l+"=";var c=""+a;if(a.prototype)if(-1!=c.indexOf("[native code]")){var u=c.indexOf(" ",8)+1;e+=c.slice(u,c.indexOf("(",u))}else for(var h in e+=c,a.prototype)e+=";"+l+".prototype."+h+"="+a.prototype[h];else e+=c}else i[l]=a}return[e,i]},Y=[],Q=function(t){var e=[];for(var i in t)(t[i]instanceof n||t[i]instanceof r||t[i]instanceof o)&&e.push((t[i]=new t[i].constructor(t[i])).buffer);return e},J=function(t,e,n,r){var o;if(!Y[n]){for(var s="",a={},l=t.length-1,c=0;c<l;++c)s=(o=Z(t[c],s,a))[0],a=o[1];Y[n]=Z(t[l],s,a)}var u=X({},Y[n][1]);return i.default(Y[n][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e+"}",n,u,Q(u),r)},K=function(){return[n,r,o,s,a,l,h,f,A,S,g,_,M,T,I,C,P,L,Tt,rt,ot]},$=function(){return[n,r,o,s,a,l,p,m,w,x,E,b,g,V,U,_,D,R,O,k,N,B,z,F,C,P,G,q,At,rt]},tt=function(){return[dt,gt,pt,H,j]},et=function(){return[ft,mt]},it=function(){return[yt,pt,W]},nt=function(){return[vt]},rt=function(t){return postMessage(t,[t.buffer])},ot=function(t){return t&&t.size&&new n(t.size)},st=function(t,e,i,n,r,o){var s=J(i,n,r,(function(t,e){s.terminate(),o(t,e)}));return s.postMessage([t,e],e.consume?[t.buffer]:[]),function(){s.terminate()}},at=function(t){return t.ondata=function(t,e){return postMessage([t,e],[t.buffer])},function(e){return t.push(e.data[0],e.data[1])}},lt=function(t,e,i,n,r){var o,s=J(t,n,r,(function(t,i){t?(s.terminate(),e.ondata.call(e,t)):(i[1]&&s.terminate(),e.ondata.call(e,t,i[0],i[1]))}));s.postMessage(i),e.push=function(t,i){if(o)throw"stream finished";if(!e.ondata)throw"no stream handler";s.postMessage([t,o=i],[t.buffer])},e.terminate=function(){s.terminate()}},ct=function(t,e){return t[e]|t[e+1]<<8},ut=function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+2*(t[e+3]<<23)},ht=function(t,e){return ut(t,e)|4294967296*ut(t,e)},pt=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8},dt=function(t,e){var i=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&pt(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),i){t[3]=8;for(var n=0;n<=i.length;++n)t[n+10]=i.charCodeAt(n)}},ft=function(t){if(31!=t[0]||139!=t[1]||8!=t[2])throw"invalid gzip data";var e=t[3],i=10;4&e&&(i+=t[10]|2+(t[11]<<8));for(var n=(e>>3&1)+(e>>4&1);n>0;n-=!t[i++]);return i+(2&e)},mt=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16)+2*(t[e-1]<<23)},gt=function(t){return 10+(t.filename&&t.filename.length+1||0)},yt=function(t,e){var i=e.level,n=0==i?0:i<6?1:9==i?3:2;t[0]=120,t[1]=n<<6|(n?32-2*n:1)},vt=function(t){if(8!=(15&t[0])||t[0]>>>4>7||(t[0]<<8|t[1])%31)throw"invalid zlib data";if(32&t[1])throw"invalid zlib data: preset dictionaries not supported"};function _t(t,e){return e||"function"!=typeof t||(e=t,t={}),this.ondata=e,t}var xt=function(){function t(t,e){e||"function"!=typeof t||(e=t,t={}),this.ondata=e,this.o=t||{}}return t.prototype.p=function(t,e){this.ondata(q(t,this.o,0,0,!e),e)},t.prototype.push=function(t,e){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";this.d=e,this.p(t,e||!1)},t}();t.Deflate=xt;var bt=function(t,e){lt([$,function(){return[at,xt]}],this,_t.call(this,t,e),(function(t){var e=new xt(t.data);onmessage=at(e)}),6)};function wt(t,e,i){if(i||(i=e,e={}),"function"!=typeof i)throw"no callback";return st(t,e,[$],(function(t){return rt(At(t.data[0],t.data[1]))}),0,i)}function At(t,e){return q(t,e||{},0,0)}t.AsyncDeflate=bt,t.deflate=wt,t.deflateSync=At;var Et=function(){function t(t){this.s={},this.p=new n(0),this.ondata=t}return t.prototype.e=function(t){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";var e=this.p.length,i=new n(e+t.length);i.set(this.p),i.set(t,e),this.p=i},t.prototype.c=function(t){this.d=this.s.i=t||!1;var e=this.s.b,i=L(this.p,this.o,this.s);this.ondata(P(i,e,this.s.b),this.d),this.o=P(i,this.s.b-32768),this.s.b=this.o.length,this.p=P(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(t,e){this.e(t),this.c(e)},t}();t.Inflate=Et;var St=function(t){this.ondata=t,lt([K,function(){return[at,Et]}],this,0,(function(){var t=new Et;onmessage=at(t)}),7)};function Mt(t,e,i){if(i||(i=e,e={}),"function"!=typeof i)throw"no callback";return st(t,e,[K],(function(t){return rt(Tt(t.data[0],ot(t.data[1])))}),1,i)}function Tt(t,e){return L(t,e)}t.AsyncInflate=St,t.inflate=Mt,t.inflateSync=Tt;var It=function(){function t(t,e){this.c=H(),this.l=0,this.v=1,xt.call(this,t,e)}return t.prototype.push=function(t,e){xt.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t),this.l+=t.length;var i=q(t,this.o,this.v&>(this.o),e&&8,!e);this.v&&(dt(i,this.o),this.v=0),e&&(pt(i,i.length-8,this.c.d()),pt(i,i.length-4,this.l)),this.ondata(i,e)},t}();t.Gzip=It,t.Compress=It;var Ct=function(t,e){lt([$,tt,function(){return[at,xt,It]}],this,_t.call(this,t,e),(function(t){var e=new It(t.data);onmessage=at(e)}),8)};function Pt(t,e,i){if(i||(i=e,e={}),"function"!=typeof i)throw"no callback";return st(t,e,[$,tt,function(){return[Lt]}],(function(t){return rt(Lt(t.data[0],t.data[1]))}),2,i)}function Lt(t,e){e||(e={});var i=H(),n=t.length;i.p(t);var r=q(t,e,gt(e),8),o=r.length;return dt(r,e),pt(r,o-8,i.d()),pt(r,o-4,n),r}t.AsyncGzip=Ct,t.AsyncCompress=Ct,t.gzip=Pt,t.compress=Pt,t.gzipSync=Lt,t.compressSync=Lt;var Dt=function(){function t(t){this.v=1,Et.call(this,t)}return t.prototype.push=function(t,e){if(Et.prototype.e.call(this,t),this.v){var i=this.p.length>3?ft(this.p):4;if(i>=this.p.length&&!e)return;this.p=this.p.subarray(i),this.v=0}if(e){if(this.p.length<8)throw"invalid gzip stream";this.p=this.p.subarray(0,-8)}Et.prototype.c.call(this,e)},t}();t.Gunzip=Dt;var Rt=function(t){this.ondata=t,lt([K,et,function(){return[at,Et,Dt]}],this,0,(function(){var t=new Dt;onmessage=at(t)}),9)};function Ot(t,e,i){if(i||(i=e,e={}),"function"!=typeof i)throw"no callback";return st(t,e,[K,et,function(){return[kt]}],(function(t){return rt(kt(t.data[0]))}),3,i)}function kt(t,e){return L(t.subarray(ft(t),-8),e||new n(mt(t)))}t.AsyncGunzip=Rt,t.gunzip=Ot,t.gunzipSync=kt;var Nt=function(){function t(t,e){this.c=W(),this.v=1,xt.call(this,t,e)}return t.prototype.push=function(t,e){xt.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t);var i=q(t,this.o,this.v&&2,e&&4,!e);this.v&&(yt(i,this.o),this.v=0),e&&pt(i,i.length-4,this.c.d()),this.ondata(i,e)},t}();t.Zlib=Nt;var Bt=function(t,e){lt([$,it,function(){return[at,xt,Nt]}],this,_t.call(this,t,e),(function(t){var e=new Nt(t.data);onmessage=at(e)}),10)};function zt(t,e,i){if(i||(i=e,e={}),"function"!=typeof i)throw"no callback";return st(t,e,[$,it,function(){return[Ft]}],(function(t){return rt(Ft(t.data[0],t.data[1]))}),4,i)}function Ft(t,e){e||(e={});var i=W();i.p(t);var n=q(t,e,2,4);return yt(n,e),pt(n,n.length-4,i.d()),n}t.AsyncZlib=Bt,t.zlib=zt,t.zlibSync=Ft;var Vt=function(){function t(t){this.v=1,Et.call(this,t)}return t.prototype.push=function(t,e){if(Et.prototype.e.call(this,t),this.v){if(this.p.length<2&&!e)return;this.p=this.p.subarray(2),this.v=0}if(e){if(this.p.length<4)throw"invalid zlib stream";this.p=this.p.subarray(0,-4)}Et.prototype.c.call(this,e)},t}();t.Unzlib=Vt;var Ut=function(t){this.ondata=t,lt([K,nt,function(){return[at,Et,Vt]}],this,0,(function(){var t=new Vt;onmessage=at(t)}),11)};function Gt(t,e,i){if(i||(i=e,e={}),"function"!=typeof i)throw"no callback";return st(t,e,[K,nt,function(){return[jt]}],(function(t){return rt(jt(t.data[0],ot(t.data[1])))}),5,i)}function jt(t,e){return L((vt(t),t.subarray(2,-4)),e)}t.AsyncUnzlib=Ut,t.unzlib=Gt,t.unzlibSync=jt;var Ht=function(){function t(t){this.G=Dt,this.I=Et,this.Z=Vt,this.ondata=t}return t.prototype.push=function(t,e){if(!this.ondata)throw"no stream handler";if(this.s)this.s.push(t,e);else{if(this.p&&this.p.length){var i=new n(this.p.length+t.length);i.set(this.p),i.set(t,this.p.length)}else this.p=t;if(this.p.length>2){var r=this,o=function(){r.ondata.apply(r,arguments)};this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(o):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(o):new this.Z(o),this.s.push(this.p,e),this.p=null}}},t}();t.Decompress=Ht;var Wt=function(){function t(t){this.G=Rt,this.I=St,this.Z=Ut,this.ondata=t}return t.prototype.push=function(t,e){Ht.prototype.push.call(this,t,e)},t}();function qt(t,e,i){if(i||(i=e,e={}),"function"!=typeof i)throw"no callback";return 31==t[0]&&139==t[1]&&8==t[2]?Ot(t,e,i):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Mt(t,e,i):Gt(t,e,i)}function Xt(t,e){return 31==t[0]&&139==t[1]&&8==t[2]?kt(t,e):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Tt(t,e):jt(t,e)}t.AsyncDecompress=Wt,t.decompress=qt,t.decompressSync=Xt;var Zt=function(t,e,i,r){for(var o in t){var s=t[o],a=e+o;s instanceof n?i[a]=[s,r]:Array.isArray(s)?i[a]=[s[0],X(r,s[1])]:Zt(s,a+"/",i,r)}},Yt="undefined"!=typeof TextEncoder&&new TextEncoder,Qt="undefined"!=typeof TextDecoder&&new TextDecoder,Jt=0;try{Qt.decode(U,{stream:!0}),Jt=1}catch(i){}var Kt=function(t){for(var e="",i=0;;){var n=t[i++],r=(n>127)+(n>223)+(n>239);if(i+r>t.length)return[e,P(t,i-1)];r?3==r?(n=((15&n)<<18|(63&t[i++])<<12|(63&t[i++])<<6|63&t[i++])-65536,e+=String.fromCharCode(55296|n>>10,56320|1023&n)):e+=String.fromCharCode(1&r?(31&n)<<6|63&t[i++]:(15&n)<<12|(63&t[i++])<<6|63&t[i++]):e+=String.fromCharCode(n)}},$t=function(){function t(t){this.ondata=t,Jt?this.t=new TextDecoder:this.p=U}return t.prototype.push=function(t,e){if(!this.ondata)throw"no callback";if(e||(e=!1),this.t)return this.ondata(this.t.decode(t,{stream:!e}),e);var i=new n(this.p.length+t.length);i.set(this.p),i.set(t,this.p.length);var r=Kt(i),o=r[0],s=r[1];if(e&&s.length)throw"invalid utf-8 data";this.p=s,this.ondata(o,e)},t}();t.DecodeUTF8=$t;var te=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,e){if(!this.ondata)throw"no callback";this.ondata(ee(t),e||!1)},t}();function ee(t,e){if(e){for(var i=new n(t.length),r=0;r<t.length;++r)i[r]=t.charCodeAt(r);return i}if(Yt)return Yt.encode(t);var o=t.length,s=new n(t.length+(t.length>>1)),a=0,l=function(t){s[a++]=t};for(r=0;r<o;++r){if(a+5>s.length){var c=new n(a+8+(o-r<<1));c.set(s),s=c}var u=t.charCodeAt(r);u<128||e?l(u):u<2048?(l(192|u>>>6),l(128|63&u)):u>55295&&u<57344?(l(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++r))>>>18),l(128|u>>>12&63),l(128|u>>>6&63),l(128|63&u)):(l(224|u>>>12),l(128|u>>>6&63),l(128|63&u))}return P(s,0,a)}function ie(t,e){if(e){for(var i="",n=0;n<t.length;n+=16384)i+=String.fromCharCode.apply(null,t.subarray(n,n+16384));return i}if(Qt)return Qt.decode(t);var r=Kt(t);if(r[1].length)throw"invalid utf-8 data";return r[0]}t.EncodeUTF8=te,t.strToU8=ee,t.strFromU8=ie;var ne=function(t){return 1==t?3:t<6?2:9==t?1:0},re=function(t,e){return e+30+ct(t,e+26)+ct(t,e+28)},oe=function(t,e,i){var n=ct(t,e+28),r=ie(t.subarray(e+46,e+46+n),!(2048&ct(t,e+8))),o=e+46+n,s=ut(t,e+20),a=i&&4294967295==s?se(t,o):[s,ut(t,e+24),ut(t,e+42)],l=a[0],c=a[1],u=a[2];return[ct(t,e+10),l,c,r,o+ct(t,e+30)+ct(t,e+32),u]},se=function(t,e){for(;1!=ct(t,e);e+=4+ct(t,e+2));return[ht(t,e+12),ht(t,e+4),ht(t,e+20)]},ae=function(t){var e=0;if(t)for(var i in t){var n=t[i].length;if(n>65535)throw"extra field too long";e+=n+4}return e},le=function(t,e,i,n,r,o,s,a){var l=n.length,c=i.extra,u=a&&a.length,h=ae(c);pt(t,e,null!=s?33639248:67324752),e+=4,null!=s&&(t[e++]=20,t[e++]=i.os),t[e]=20,e+=2,t[e++]=i.flag<<1|(null==o&&8),t[e++]=r&&8,t[e++]=255&i.compression,t[e++]=i.compression>>8;var p=new Date(null==i.mtime?Date.now():i.mtime),d=p.getFullYear()-1980;if(d<0||d>119)throw"date not in range 1980-2099";if(pt(t,e,2*(d<<24)|p.getMonth()+1<<21|p.getDate()<<16|p.getHours()<<11|p.getMinutes()<<5|p.getSeconds()>>>1),e+=4,null!=o&&(pt(t,e,i.crc),pt(t,e+4,o),pt(t,e+8,i.size)),pt(t,e+12,l),pt(t,e+14,h),e+=16,null!=s&&(pt(t,e,u),pt(t,e+6,i.attrs),pt(t,e+10,s),e+=14),t.set(n,e),e+=l,h)for(var f in c){var m=c[f],g=m.length;pt(t,e,+f),pt(t,e+2,g),t.set(m,e+4),e+=4+g}return u&&(t.set(a,e),e+=u),e},ce=function(t,e,i,n,r){pt(t,e,101010256),pt(t,e+8,i),pt(t,e+10,i),pt(t,e+12,n),pt(t,e+16,r)},ue=function(){function t(t){this.filename=t,this.c=H(),this.size=0,this.compression=0}return t.prototype.process=function(t,e){this.ondata(null,t,e)},t.prototype.push=function(t,e){if(!this.ondata)throw"no callback - add to ZIP archive before pushing";this.c.p(t),this.size+=t.length,e&&(this.crc=this.c.d()),this.process(t,e||!1)},t}();t.ZipPassThrough=ue;var he=function(){function t(t,e){var i=this;e||(e={}),ue.call(this,t),this.d=new xt(e,(function(t,e){i.ondata(null,t,e)})),this.compression=8,this.flag=ne(e.level)}return t.prototype.process=function(t,e){try{this.d.push(t,e)}catch(t){this.ondata(t,null,e)}},t.prototype.push=function(t,e){ue.prototype.push.call(this,t,e)},t}();t.ZipDeflate=he;var pe=function(){function t(t,e){var i=this;e||(e={}),ue.call(this,t),this.d=new bt(e,(function(t,e,n){i.ondata(t,e,n)})),this.compression=8,this.flag=ne(e.level),this.terminate=this.d.terminate}return t.prototype.process=function(t,e){this.d.push(t,e)},t.prototype.push=function(t,e){ue.prototype.push.call(this,t,e)},t}();t.AsyncZipDeflate=pe;var de=function(){function t(t){this.ondata=t,this.u=[],this.d=1}return t.prototype.add=function(t){var e=this;if(2&this.d)throw"stream finished";var i=ee(t.filename),r=i.length,o=t.comment,s=o&&ee(o),a=r!=t.filename.length||s&&o.length!=s.length,l=r+ae(t.extra)+30;if(r>65535)throw"filename too long";var c=new n(l);le(c,0,t,i,a);var u=[c],h=function(){for(var t=0,i=u;t<i.length;t++)e.ondata(null,i[t],!1);u=[]},p=this.d;this.d=0;var d=this.u.length,f=X(t,{f:i,u:a,o:s,t:function(){t.terminate&&t.terminate()},r:function(){if(h(),p){var t=e.u[d+1];t?t.r():e.d=1}p=1}}),m=0;t.ondata=function(i,r,o){if(i)e.ondata(i,r,o),e.terminate();else if(m+=r.length,u.push(r),o){var s=new n(16);pt(s,0,134695760),pt(s,4,t.crc),pt(s,8,m),pt(s,12,t.size),u.push(s),f.c=m,f.b=l+m+16,f.crc=t.crc,f.size=t.size,p&&f.r(),p=1}else p&&h()},this.u.push(f)},t.prototype.end=function(){var t=this;if(2&this.d){if(1&this.d)throw"stream finishing";throw"stream finished"}this.d?this.e():this.u.push({r:function(){1&t.d&&(t.u.splice(-1,1),t.e())},t:function(){}}),this.d=3},t.prototype.e=function(){for(var t=0,e=0,i=0,r=0,o=this.u;r<o.length;r++)i+=46+(c=o[r]).f.length+ae(c.extra)+(c.o?c.o.length:0);for(var s=new n(i+22),a=0,l=this.u;a<l.length;a++){var c;le(s,t,c=l[a],c.f,c.u,c.c,e,c.o),t+=46+c.f.length+ae(c.extra)+(c.o?c.o.length:0),e+=c.b}ce(s,t,this.u.length,i,e),this.ondata(null,s,!0),this.d=2},t.prototype.terminate=function(){for(var t=0,e=this.u;t<e.length;t++)e[t].t();this.d=2},t}();function fe(t,e,i){if(i||(i=e,e={}),"function"!=typeof i)throw"no callback";var r={};Zt(t,"",r,e);var o=Object.keys(r),s=o.length,a=0,l=0,c=s,u=Array(s),h=[],p=function(){for(var t=0;t<h.length;++t)h[t]()},d=function(){var t=new n(l+22),e=a,r=l-a;l=0;for(var o=0;o<c;++o){var s=u[o];try{var h=s.c.length;le(t,l,s,s.f,s.u,h);var p=30+s.f.length+ae(s.extra),d=l+p;t.set(s.c,d),le(t,a,s,s.f,s.u,h,l,s.m),a+=16+p+(s.m?s.m.length:0),l=d+h}catch(t){return i(t,null)}}ce(t,a,u.length,r,e),i(null,t)};s||d();for(var f=function(t){var e=o[t],n=r[e],c=n[0],f=n[1],m=H(),g=c.length;m.p(c);var y=ee(e),v=y.length,_=f.comment,x=_&&ee(_),b=x&&x.length,w=ae(f.extra),A=0==f.level?0:8,E=function(n,r){if(n)p(),i(n,null);else{var o=r.length;u[t]=X(f,{size:g,crc:m.d(),c:r,f:y,m:x,u:v!=e.length||x&&_.length!=b,compression:A}),a+=30+v+w+o,l+=76+2*(v+w)+(b||0)+o,--s||d()}};if(v>65535&&E("filename too long",null),A)if(g<16e4)try{E(null,At(c,f))}catch(t){E(t,null)}else h.push(wt(c,f,E));else E(null,c)},m=0;m<c;++m)f(m);return p}function me(t,e){e||(e={});var i={},r=[];Zt(t,"",i,e);var o=0,s=0;for(var a in i){var l=i[a],c=l[0],u=l[1],h=0==u.level?0:8,p=(E=ee(a)).length,d=u.comment,f=d&&ee(d),m=f&&f.length,g=ae(u.extra);if(p>65535)throw"filename too long";var y=h?At(c,u):c,v=y.length,_=H();_.p(c),r.push(X(u,{size:c.length,crc:_.d(),c:y,f:E,m:f,u:p!=a.length||f&&d.length!=m,o:o,compression:h})),o+=30+p+g+v,s+=76+2*(p+g)+(m||0)+v}for(var x=new n(s+22),b=o,w=s-o,A=0;A<r.length;++A){var E;le(x,(E=r[A]).o,E,E.f,E.u,E.c.length);var S=30+E.f.length+ae(E.extra);x.set(E.c,E.o+S),le(x,o,E,E.f,E.u,E.c.length,E.o,E.m),o+=16+S+(E.m?E.m.length:0)}return ce(x,o,r.length,w,b),x}t.Zip=de,t.zip=fe,t.zipSync=me;var ge=function(){function t(){}return t.prototype.push=function(t,e){this.ondata(null,t,e)},t.compression=0,t}();t.UnzipPassThrough=ge;var ye=function(){function t(){var t=this;this.i=new Et((function(e,i){t.ondata(null,e,i)}))}return t.prototype.push=function(t,e){try{this.i.push(t,e)}catch(i){this.ondata(i,t,e)}},t.compression=8,t}();t.UnzipInflate=ye;var ve=function(){function t(t,e){var i=this;e<32e4?this.i=new Et((function(t,e){i.ondata(null,t,e)})):(this.i=new St((function(t,e,n){i.ondata(t,e,n)})),this.terminate=this.i.terminate)}return t.prototype.push=function(t,e){this.i.terminate&&(t=P(t,0)),this.i.push(t,e)},t.compression=8,t}();t.AsyncUnzipInflate=ve;var _e=function(){function t(t){this.onfile=t,this.k=[],this.o={0:ge},this.p=U}return t.prototype.push=function(t,e){var i=this;if(!this.onfile)throw"no callback";if(this.c>0){var r=Math.min(this.c,t.length),o=t.subarray(0,r);if(this.c-=r,this.d?this.d.push(o,!this.c):this.k[0].push(o),(t=t.subarray(r)).length)return this.push(t,e)}else{var s=0,a=0,l=void 0,c=void 0;this.p.length?t.length?((c=new n(this.p.length+t.length)).set(this.p),c.set(t,this.p.length)):c=this.p:c=t;for(var u=c.length,h=this.c,p=h&&this.d,d=function(){var t,e=ut(c,a);if(67324752==e){s=1,l=a,f.d=null,f.c=0;var n=ct(c,a+6),r=ct(c,a+8),o=2048&n,p=8&n,d=ct(c,a+26),m=ct(c,a+28);if(u>a+30+d+m){var g=[];f.k.unshift(g),s=2;var y=ut(c,a+18),v=ut(c,a+22),_=ie(c.subarray(a+30,a+=30+d),!o);4294967295==y?(t=p?[-2]:se(c,a),y=t[0],v=t[1]):p&&(y=-1),a+=m,f.c=y;var x={name:_,compression:r,start:function(){if(!x.ondata)throw"no callback";if(y){var t=i.o[r];if(!t)throw"unknown compression type "+r;var e=y<0?new t(_):new t(_,y,v);e.ondata=function(t,e,i){x.ondata(t,e,i)};for(var n=0,o=g;n<o.length;n++)e.push(o[n],!1);i.k[0]==g?i.d=e:e.push(U,!0)}else x.ondata(null,U,!0)},terminate:function(){i.k[0]==g&&i.d.terminate&&i.d.terminate()}};y>=0&&(x.size=y,x.originalSize=v),f.onfile(x)}return"break"}if(h){if(134695760==e)return l=a+=12+(-2==h&&8),s=2,f.c=0,"break";if(33639248==e)return l=a-=4,s=2,f.c=0,"break"}},f=this;a<u-4&&"break"!==d();++a);if(this.p=U,h<0){var m=c.subarray(0,s?l-12-(-2==h&&8)-(134695760==ut(c,l-16)&&4):a);p?p.push(m,!!s):this.k[+(2==s)].push(m)}if(2&s)return this.push(c.subarray(a),e);this.p=c.subarray(a)}if(e&&this.c)throw"invalid zip file"},t.prototype.register=function(t){this.o[t.compression]=t},t}();function xe(t,e){if("function"!=typeof e)throw"no callback";for(var i=[],r=function(){for(var t=0;t<i.length;++t)i[t]()},o={},s=t.length-22;101010256!=ut(t,s);--s)if(!s||t.length-s>65558)return void e("invalid zip file",null);var a=ct(t,s+8);a||e(null,{});var l=a,c=ut(t,s+16),u=4294967295==c;if(u){if(s=ut(t,s-12),101075792!=ut(t,s))return void e("invalid zip file",null);l=a=ut(t,s+32),c=ut(t,s+48)}for(var h=function(s){var l=oe(t,c,u),h=l[0],p=l[1],d=l[2],f=l[3],m=l[4],g=re(t,l[5]);c=m;var y=function(t,i){t?(r(),e(t,null)):(o[f]=i,--a||e(null,o))};if(h)if(8==h){var v=t.subarray(g,g+p);if(p<32e4)try{y(null,Tt(v,new n(d)))}catch(t){y(t,null)}else i.push(Mt(v,{size:d},y))}else y("unknown compression type "+h,null);else y(null,P(t,g,g+p))},p=0;p<l;++p)h();return r}function be(t){for(var e={},i=t.length-22;101010256!=ut(t,i);--i)if(!i||t.length-i>65558)throw"invalid zip file";var r=ct(t,i+8);if(!r)return{};var o=ut(t,i+16),s=4294967295==o;if(s){if(i=ut(t,i-12),101075792!=ut(t,i))throw"invalid zip file";r=ut(t,i+32),o=ut(t,i+48)}for(var a=0;a<r;++a){var l=oe(t,o,s),c=l[0],u=l[1],h=l[2],p=l[3],d=l[4],f=re(t,l[5]);if(o=d,c){if(8!=c)throw"unknown compression type "+c;e[p]=Tt(t.subarray(f,f+u),new n(h))}else e[p]=P(t,f,f+u)}return e}return t.Unzip=_e,t.unzip=xe,t.unzipSync=be,t}()}(jd,jd.exports);var Hd=jd.exports;!function(t,e){const i=ld,n=Hd;!function(){let t,e,r;class o extends i.Loader{constructor(t){super(t)}load(t,e,n,r){const o=this,s=""===o.path?i.LoaderUtils.extractUrlBase(t):o.path,a=new i.FileLoader(this.manager);a.setPath(o.path),a.setResponseType("arraybuffer"),a.setRequestHeader(o.requestHeader),a.setWithCredentials(o.withCredentials),a.load(t,(function(i){try{e(o.parse(i,s))}catch(e){r?r(e):console.error(e),o.manager.itemError(t)}}),n,r)}parse(e,n){if(function(t){const e="Kaydara FBX Binary \0";return t.byteLength>=e.length&&e===w(t,0,e.length)}(e))t=(new u).parse(e);else{const i=w(e);if(!function(t){const e=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"];let i=0;function n(e){const n=t[e-1];return t=t.slice(i+e),i++,n}for(let t=0;t<e.length;++t){if(n(1)===e[t])return!1}return!0}(i))throw new Error("THREE.FBXLoader: Unknown format.");if(d(i)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+d(i));t=(new c).parse(i)}const r=new i.TextureLoader(this.manager).setPath(this.resourcePath||n).setCrossOrigin(this.crossOrigin);return new s(r,this.manager).parse(t)}}class s{constructor(t,e){this.textureLoader=t,this.manager=e}parse(){e=this.parseConnections();const t=this.parseImages(),i=this.parseTextures(t),n=this.parseMaterials(i),o=this.parseDeformers(),s=(new a).parse(o);return this.parseScene(o,s,n),r}parseConnections(){const e=new Map;if("Connections"in t){t.Connections.connections.forEach((function(t){const i=t[0],n=t[1],r=t[2];e.has(i)||e.set(i,{parents:[],children:[]});const o={ID:n,relationship:r};e.get(i).parents.push(o),e.has(n)||e.set(n,{parents:[],children:[]});const s={ID:i,relationship:r};e.get(n).children.push(s)}))}return e}parseImages(){const e={},i={};if("Video"in t.Objects){const n=t.Objects.Video;for(const t in n){const r=n[t];if(e[parseInt(t)]=r.RelativeFilename||r.Filename,"Content"in r){const e=r.Content instanceof ArrayBuffer&&r.Content.byteLength>0,o="string"==typeof r.Content&&""!==r.Content;if(e||o){const e=this.parseImage(n[t]);i[r.RelativeFilename||r.Filename]=e}}}}for(const t in e){const n=e[t];void 0!==i[n]?e[t]=i[n]:e[t]=e[t].split("\\").pop()}return e}parseImage(t){const e=t.Content,i=t.RelativeFilename||t.Filename,n=i.slice(i.lastIndexOf(".")+1).toLowerCase();let r;switch(n){case"bmp":r="image/bmp";break;case"jpg":case"jpeg":r="image/jpeg";break;case"png":r="image/png";break;case"tif":r="image/tiff";break;case"tga":null===this.manager.getHandler(".tga")&&console.warn("FBXLoader: TGA loader not found, skipping ",i),r="image/tga";break;default:return void console.warn('FBXLoader: Image type "'+n+'" is not supported.')}if("string"==typeof e)return"data:"+r+";base64,"+e;{const t=new Uint8Array(e);return window.URL.createObjectURL(new Blob([t],{type:r}))}}parseTextures(e){const i=new Map;if("Texture"in t.Objects){const n=t.Objects.Texture;for(const t in n){const r=this.parseTexture(n[t],e);i.set(parseInt(t),r)}}return i}parseTexture(t,e){const n=this.loadTexture(t,e);n.ID=t.id,n.name=t.attrName;const r=t.WrapModeU,o=t.WrapModeV,s=void 0!==r?r.value:0,a=void 0!==o?o.value:0;if(n.wrapS=0===s?i.RepeatWrapping:i.ClampToEdgeWrapping,n.wrapT=0===a?i.RepeatWrapping:i.ClampToEdgeWrapping,"Scaling"in t){const e=t.Scaling.value;n.repeat.x=e[0],n.repeat.y=e[1]}return n}loadTexture(t,n){let r;const o=this.textureLoader.path,s=e.get(t.id).children;let a;void 0!==s&&s.length>0&&void 0!==n[s[0].ID]&&(r=n[s[0].ID],0!==r.indexOf("blob:")&&0!==r.indexOf("data:")||this.textureLoader.setPath(void 0));const l=t.FileName.slice(-3).toLowerCase();if("tga"===l){const e=this.manager.getHandler(".tga");null===e?(console.warn("FBXLoader: TGA loader not found, creating placeholder texture for",t.RelativeFilename),a=new i.Texture):(e.setPath(this.textureLoader.path),a=e.load(r))}else"psd"===l?(console.warn("FBXLoader: PSD textures are not supported, creating placeholder texture for",t.RelativeFilename),a=new i.Texture):a=this.textureLoader.load(r);return this.textureLoader.setPath(o),a}parseMaterials(e){const i=new Map;if("Material"in t.Objects){const n=t.Objects.Material;for(const t in n){const r=this.parseMaterial(n[t],e);null!==r&&i.set(parseInt(t),r)}}return i}parseMaterial(t,n){const r=t.id,o=t.attrName;let s=t.ShadingModel;if("object"==typeof s&&(s=s.value),!e.has(r))return null;const a=this.parseParameters(t,n,r);let l;switch(s.toLowerCase()){case"phong":l=new i.MeshPhongMaterial;break;case"lambert":l=new i.MeshLambertMaterial;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to THREE.MeshPhongMaterial.',s),l=new i.MeshPhongMaterial}return l.setValues(a),l.name=o,l}parseParameters(t,n,r){const o={};t.BumpFactor&&(o.bumpScale=t.BumpFactor.value),t.Diffuse?o.color=(new i.Color).fromArray(t.Diffuse.value):!t.DiffuseColor||"Color"!==t.DiffuseColor.type&&"ColorRGB"!==t.DiffuseColor.type||(o.color=(new i.Color).fromArray(t.DiffuseColor.value)),t.DisplacementFactor&&(o.displacementScale=t.DisplacementFactor.value),t.Emissive?o.emissive=(new i.Color).fromArray(t.Emissive.value):!t.EmissiveColor||"Color"!==t.EmissiveColor.type&&"ColorRGB"!==t.EmissiveColor.type||(o.emissive=(new i.Color).fromArray(t.EmissiveColor.value)),t.EmissiveFactor&&(o.emissiveIntensity=parseFloat(t.EmissiveFactor.value)),t.Opacity&&(o.opacity=parseFloat(t.Opacity.value)),o.opacity<1&&(o.transparent=!0),t.ReflectionFactor&&(o.reflectivity=t.ReflectionFactor.value),t.Shininess&&(o.shininess=t.Shininess.value),t.Specular?o.specular=(new i.Color).fromArray(t.Specular.value):t.SpecularColor&&"Color"===t.SpecularColor.type&&(o.specular=(new i.Color).fromArray(t.SpecularColor.value));const s=this;return e.get(r).children.forEach((function(t){const e=t.relationship;switch(e){case"Bump":o.bumpMap=s.getTexture(n,t.ID);break;case"Maya|TEX_ao_map":o.aoMap=s.getTexture(n,t.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":o.map=s.getTexture(n,t.ID),void 0!==o.map&&(o.map.encoding=i.sRGBEncoding);break;case"DisplacementColor":o.displacementMap=s.getTexture(n,t.ID);break;case"EmissiveColor":o.emissiveMap=s.getTexture(n,t.ID),void 0!==o.emissiveMap&&(o.emissiveMap.encoding=i.sRGBEncoding);break;case"NormalMap":case"Maya|TEX_normal_map":o.normalMap=s.getTexture(n,t.ID);break;case"ReflectionColor":o.envMap=s.getTexture(n,t.ID),void 0!==o.envMap&&(o.envMap.mapping=i.EquirectangularReflectionMapping,o.envMap.encoding=i.sRGBEncoding);break;case"SpecularColor":o.specularMap=s.getTexture(n,t.ID),void 0!==o.specularMap&&(o.specularMap.encoding=i.sRGBEncoding);break;case"TransparentColor":case"TransparencyFactor":o.alphaMap=s.getTexture(n,t.ID),o.transparent=!0;break;default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",e)}})),o}getTexture(i,n){return"LayeredTexture"in t.Objects&&n in t.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),n=e.get(n).children[0].ID),i.get(n)}parseDeformers(){const i={},n={};if("Deformer"in t.Objects){const r=t.Objects.Deformer;for(const t in r){const o=r[t],s=e.get(parseInt(t));if("Skin"===o.attrType){const e=this.parseSkeleton(s,r);e.ID=t,s.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),e.geometryID=s.parents[0].ID,i[t]=e}else if("BlendShape"===o.attrType){const e={id:t};e.rawTargets=this.parseMorphTargets(s,r),e.id=t,s.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),n[t]=e}}}return{skeletons:i,morphTargets:n}}parseSkeleton(t,e){const n=[];return t.children.forEach((function(t){const r=e[t.ID];if("Cluster"!==r.attrType)return;const o={ID:t.ID,indices:[],weights:[],transformLink:(new i.Matrix4).fromArray(r.TransformLink.a)};"Indexes"in r&&(o.indices=r.Indexes.a,o.weights=r.Weights.a),n.push(o)})),{rawBones:n,bones:[]}}parseMorphTargets(t,i){const n=[];for(let r=0;r<t.children.length;r++){const o=t.children[r],s=i[o.ID],a={name:s.attrName,initialWeight:s.DeformPercent,id:s.id,fullWeights:s.FullWeights.a};if("BlendShapeChannel"!==s.attrType)return;a.geoID=e.get(parseInt(o.ID)).children.filter((function(t){return void 0===t.relationship}))[0].ID,n.push(a)}return n}parseScene(n,o,s){r=new i.Group;const a=this.parseModels(n.skeletons,o,s),c=t.Objects.Model,u=this;a.forEach((function(t){const i=c[t.ID];u.setLookAtProperties(t,i);e.get(t.ID).parents.forEach((function(e){const i=a.get(e.ID);void 0!==i&&i.add(t)})),null===t.parent&&r.add(t)})),this.bindSkeleton(n.skeletons,o,a),this.createAmbientLight(),r.traverse((function(t){if(t.userData.transformData){t.parent&&(t.userData.transformData.parentMatrix=t.parent.matrix,t.userData.transformData.parentMatrixWorld=t.parent.matrixWorld);const e=_(t.userData.transformData);t.applyMatrix4(e),t.updateWorldMatrix()}}));const h=(new l).parse();1===r.children.length&&r.children[0].isGroup&&(r.children[0].animations=h,r=r.children[0]),r.animations=h}parseModels(n,r,o){const s=new Map,a=t.Objects.Model;for(const t in a){const l=parseInt(t),c=a[t],u=e.get(l);let h=this.buildSkeleton(u,n,l,c.attrName);if(!h){switch(c.attrType){case"Camera":h=this.createCamera(u);break;case"Light":h=this.createLight(u);break;case"Mesh":h=this.createMesh(u,r,o);break;case"NurbsCurve":h=this.createCurve(u,r);break;case"LimbNode":case"Root":h=new i.Bone;break;default:h=new i.Group}h.name=c.attrName?i.PropertyBinding.sanitizeNodeName(c.attrName):"",h.ID=l}this.getTransformData(h,c),s.set(l,h)}return s}buildSkeleton(t,e,n,r){let o=null;return t.parents.forEach((function(t){for(const s in e){const a=e[s];a.rawBones.forEach((function(e,s){if(e.ID===t.ID){const t=o;o=new i.Bone,o.matrixWorld.copy(e.transformLink),o.name=r?i.PropertyBinding.sanitizeNodeName(r):"",o.ID=n,a.bones[s]=o,null!==t&&o.add(t)}}))}})),o}createCamera(e){let n,r;if(e.children.forEach((function(e){const i=t.Objects.NodeAttribute[e.ID];void 0!==i&&(r=i)})),void 0===r)n=new i.Object3D;else{let t=0;void 0!==r.CameraProjectionType&&1===r.CameraProjectionType.value&&(t=1);let e=1;void 0!==r.NearPlane&&(e=r.NearPlane.value/1e3);let o=1e3;void 0!==r.FarPlane&&(o=r.FarPlane.value/1e3);let s=window.innerWidth,a=window.innerHeight;void 0!==r.AspectWidth&&void 0!==r.AspectHeight&&(s=r.AspectWidth.value,a=r.AspectHeight.value);const l=s/a;let c=45;void 0!==r.FieldOfView&&(c=r.FieldOfView.value);const u=r.FocalLength?r.FocalLength.value:null;switch(t){case 0:n=new i.PerspectiveCamera(c,l,e,o),null!==u&&n.setFocalLength(u);break;case 1:n=new i.OrthographicCamera(-s/2,s/2,a/2,-a/2,e,o);break;default:console.warn("THREE.FBXLoader: Unknown camera type "+t+"."),n=new i.Object3D}}return n}createLight(e){let n,r;if(e.children.forEach((function(e){const i=t.Objects.NodeAttribute[e.ID];void 0!==i&&(r=i)})),void 0===r)n=new i.Object3D;else{let t;t=void 0===r.LightType?0:r.LightType.value;let e=16777215;void 0!==r.Color&&(e=(new i.Color).fromArray(r.Color.value));let o=void 0===r.Intensity?1:r.Intensity.value/100;void 0!==r.CastLightOnObject&&0===r.CastLightOnObject.value&&(o=0);let s=0;void 0!==r.FarAttenuationEnd&&(s=void 0!==r.EnableFarAttenuation&&0===r.EnableFarAttenuation.value?0:r.FarAttenuationEnd.value);const a=1;switch(t){case 0:n=new i.PointLight(e,o,s,a);break;case 1:n=new i.DirectionalLight(e,o);break;case 2:let t=Math.PI/3;void 0!==r.InnerAngle&&(t=i.MathUtils.degToRad(r.InnerAngle.value));let l=0;void 0!==r.OuterAngle&&(l=i.MathUtils.degToRad(r.OuterAngle.value),l=Math.max(l,1)),n=new i.SpotLight(e,o,s,t,l,a);break;default:console.warn("THREE.FBXLoader: Unknown light type "+r.LightType.value+", defaulting to a THREE.PointLight."),n=new i.PointLight(e,o)}void 0!==r.CastShadows&&1===r.CastShadows.value&&(n.castShadow=!0)}return n}createMesh(t,e,n){let r,o=null,s=null;const a=[];return t.children.forEach((function(t){e.has(t.ID)&&(o=e.get(t.ID)),n.has(t.ID)&&a.push(n.get(t.ID))})),a.length>1?s=a:a.length>0?s=a[0]:(s=new i.MeshPhongMaterial({color:13421772}),a.push(s)),"color"in o.attributes&&a.forEach((function(t){t.vertexColors=!0})),o.FBX_Deformer?(r=new i.SkinnedMesh(o,s),r.normalizeSkinWeights()):r=new i.Mesh(o,s),r}createCurve(t,e){const n=t.children.reduce((function(t,i){return e.has(i.ID)&&(t=e.get(i.ID)),t}),null),r=new i.LineBasicMaterial({color:3342591,linewidth:1});return new i.Line(n,r)}getTransformData(t,e){const i={};"InheritType"in e&&(i.inheritType=parseInt(e.InheritType.value)),i.eulerOrder="RotationOrder"in e?x(e.RotationOrder.value):"ZYX","Lcl_Translation"in e&&(i.translation=e.Lcl_Translation.value),"PreRotation"in e&&(i.preRotation=e.PreRotation.value),"Lcl_Rotation"in e&&(i.rotation=e.Lcl_Rotation.value),"PostRotation"in e&&(i.postRotation=e.PostRotation.value),"Lcl_Scaling"in e&&(i.scale=e.Lcl_Scaling.value),"ScalingOffset"in e&&(i.scalingOffset=e.ScalingOffset.value),"ScalingPivot"in e&&(i.scalingPivot=e.ScalingPivot.value),"RotationOffset"in e&&(i.rotationOffset=e.RotationOffset.value),"RotationPivot"in e&&(i.rotationPivot=e.RotationPivot.value),t.userData.transformData=i}setLookAtProperties(n,o){if("LookAtProperty"in o){e.get(n.ID).children.forEach((function(e){if("LookAtProperty"===e.relationship){const o=t.Objects.Model[e.ID];if("Lcl_Translation"in o){const t=o.Lcl_Translation.value;void 0!==n.target?(n.target.position.fromArray(t),r.add(n.target)):n.lookAt((new i.Vector3).fromArray(t))}}}))}}bindSkeleton(t,n,r){const o=this.parsePoseNodes();for(const s in t){const a=t[s];e.get(parseInt(a.ID)).parents.forEach((function(t){if(n.has(t.ID)){const n=t.ID;e.get(n).parents.forEach((function(t){if(r.has(t.ID)){r.get(t.ID).bind(new i.Skeleton(a.bones),o[t.ID])}}))}}))}}parsePoseNodes(){const e={};if("Pose"in t.Objects){const n=t.Objects.Pose;for(const t in n)if("BindPose"===n[t].attrType){const r=n[t].PoseNode;Array.isArray(r)?r.forEach((function(t){e[t.Node]=(new i.Matrix4).fromArray(t.Matrix.a)})):e[r.Node]=(new i.Matrix4).fromArray(r.Matrix.a)}}return e}createAmbientLight(){if("GlobalSettings"in t&&"AmbientColor"in t.GlobalSettings){const e=t.GlobalSettings.AmbientColor.value,n=e[0],o=e[1],s=e[2];if(0!==n||0!==o||0!==s){const t=new i.Color(n,o,s);r.add(new i.AmbientLight(t,1))}}}}class a{parse(i){const n=new Map;if("Geometry"in t.Objects){const r=t.Objects.Geometry;for(const t in r){const o=e.get(parseInt(t)),s=this.parseGeometry(o,r[t],i);n.set(parseInt(t),s)}}return n}parseGeometry(t,e,i){switch(e.attrType){case"Mesh":return this.parseMeshGeometry(t,e,i);case"NurbsCurve":return this.parseNurbsGeometry(e)}}parseMeshGeometry(e,i,n){const r=n.skeletons,o=[],s=e.parents.map((function(e){return t.Objects.Model[e.ID]}));if(0===s.length)return;const a=e.children.reduce((function(t,e){return void 0!==r[e.ID]&&(t=r[e.ID]),t}),null);e.children.forEach((function(t){void 0!==n.morphTargets[t.ID]&&o.push(n.morphTargets[t.ID])}));const l=s[0],c={};"RotationOrder"in l&&(c.eulerOrder=x(l.RotationOrder.value)),"InheritType"in l&&(c.inheritType=parseInt(l.InheritType.value)),"GeometricTranslation"in l&&(c.translation=l.GeometricTranslation.value),"GeometricRotation"in l&&(c.rotation=l.GeometricRotation.value),"GeometricScaling"in l&&(c.scale=l.GeometricScaling.value);const u=_(c);return this.genGeometry(i,a,o,u)}genGeometry(t,e,n,r){const o=new i.BufferGeometry;t.attrName&&(o.name=t.attrName);const s=this.parseGeoNode(t,e),a=this.genBuffers(s),l=new i.Float32BufferAttribute(a.vertex,3);if(l.applyMatrix4(r),o.setAttribute("position",l),a.colors.length>0&&o.setAttribute("color",new i.Float32BufferAttribute(a.colors,3)),e&&(o.setAttribute("skinIndex",new i.Uint16BufferAttribute(a.weightsIndices,4)),o.setAttribute("skinWeight",new i.Float32BufferAttribute(a.vertexWeights,4)),o.FBX_Deformer=e),a.normal.length>0){const t=(new i.Matrix3).getNormalMatrix(r),e=new i.Float32BufferAttribute(a.normal,3);e.applyNormalMatrix(t),o.setAttribute("normal",e)}if(a.uvs.forEach((function(t,e){let n="uv"+(e+1).toString();0===e&&(n="uv"),o.setAttribute(n,new i.Float32BufferAttribute(a.uvs[e],2))})),s.material&&"AllSame"!==s.material.mappingType){let t=a.materialIndex[0],e=0;if(a.materialIndex.forEach((function(i,n){i!==t&&(o.addGroup(e,n-e,t),t=i,e=n)})),o.groups.length>0){const e=o.groups[o.groups.length-1],i=e.start+e.count;i!==a.materialIndex.length&&o.addGroup(i,a.materialIndex.length-i,t)}0===o.groups.length&&o.addGroup(0,a.materialIndex.length,a.materialIndex[0])}return this.addMorphTargets(o,t,n,r),o}parseGeoNode(t,e){const i={};if(i.vertexPositions=void 0!==t.Vertices?t.Vertices.a:[],i.vertexIndices=void 0!==t.PolygonVertexIndex?t.PolygonVertexIndex.a:[],t.LayerElementColor&&(i.color=this.parseVertexColors(t.LayerElementColor[0])),t.LayerElementMaterial&&(i.material=this.parseMaterialIndices(t.LayerElementMaterial[0])),t.LayerElementNormal&&(i.normal=this.parseNormals(t.LayerElementNormal[0])),t.LayerElementUV){i.uv=[];let e=0;for(;t.LayerElementUV[e];)t.LayerElementUV[e].UV&&i.uv.push(this.parseUVs(t.LayerElementUV[e])),e++}return i.weightTable={},null!==e&&(i.skeleton=e,e.rawBones.forEach((function(t,e){t.indices.forEach((function(n,r){void 0===i.weightTable[n]&&(i.weightTable[n]=[]),i.weightTable[n].push({id:e,weight:t.weights[r]})}))}))),i}genBuffers(t){const e={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]};let i=0,n=0,r=!1,o=[],s=[],a=[],l=[],c=[],u=[];const h=this;return t.vertexIndices.forEach((function(p,d){let f,m=!1;p<0&&(p^=-1,m=!0);let y=[],v=[];if(o.push(3*p,3*p+1,3*p+2),t.color){const e=g(d,i,p,t.color);a.push(e[0],e[1],e[2])}if(t.skeleton){if(void 0!==t.weightTable[p]&&t.weightTable[p].forEach((function(t){v.push(t.weight),y.push(t.id)})),v.length>4){r||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),r=!0);const t=[0,0,0,0],e=[0,0,0,0];v.forEach((function(i,n){let r=i,o=y[n];e.forEach((function(e,i,n){if(r>e){n[i]=r,r=e;const s=t[i];t[i]=o,o=s}}))})),y=t,v=e}for(;v.length<4;)v.push(0),y.push(0);for(let t=0;t<4;++t)c.push(v[t]),u.push(y[t])}if(t.normal){const e=g(d,i,p,t.normal);s.push(e[0],e[1],e[2])}t.material&&"AllSame"!==t.material.mappingType&&(f=g(d,i,p,t.material)[0]),t.uv&&t.uv.forEach((function(t,e){const n=g(d,i,p,t);void 0===l[e]&&(l[e]=[]),l[e].push(n[0]),l[e].push(n[1])})),n++,m&&(h.genFace(e,t,o,f,s,a,l,c,u,n),i++,n=0,o=[],s=[],a=[],l=[],c=[],u=[])})),e}genFace(t,e,i,n,r,o,s,a,l,c){for(let u=2;u<c;u++)t.vertex.push(e.vertexPositions[i[0]]),t.vertex.push(e.vertexPositions[i[1]]),t.vertex.push(e.vertexPositions[i[2]]),t.vertex.push(e.vertexPositions[i[3*(u-1)]]),t.vertex.push(e.vertexPositions[i[3*(u-1)+1]]),t.vertex.push(e.vertexPositions[i[3*(u-1)+2]]),t.vertex.push(e.vertexPositions[i[3*u]]),t.vertex.push(e.vertexPositions[i[3*u+1]]),t.vertex.push(e.vertexPositions[i[3*u+2]]),e.skeleton&&(t.vertexWeights.push(a[0]),t.vertexWeights.push(a[1]),t.vertexWeights.push(a[2]),t.vertexWeights.push(a[3]),t.vertexWeights.push(a[4*(u-1)]),t.vertexWeights.push(a[4*(u-1)+1]),t.vertexWeights.push(a[4*(u-1)+2]),t.vertexWeights.push(a[4*(u-1)+3]),t.vertexWeights.push(a[4*u]),t.vertexWeights.push(a[4*u+1]),t.vertexWeights.push(a[4*u+2]),t.vertexWeights.push(a[4*u+3]),t.weightsIndices.push(l[0]),t.weightsIndices.push(l[1]),t.weightsIndices.push(l[2]),t.weightsIndices.push(l[3]),t.weightsIndices.push(l[4*(u-1)]),t.weightsIndices.push(l[4*(u-1)+1]),t.weightsIndices.push(l[4*(u-1)+2]),t.weightsIndices.push(l[4*(u-1)+3]),t.weightsIndices.push(l[4*u]),t.weightsIndices.push(l[4*u+1]),t.weightsIndices.push(l[4*u+2]),t.weightsIndices.push(l[4*u+3])),e.color&&(t.colors.push(o[0]),t.colors.push(o[1]),t.colors.push(o[2]),t.colors.push(o[3*(u-1)]),t.colors.push(o[3*(u-1)+1]),t.colors.push(o[3*(u-1)+2]),t.colors.push(o[3*u]),t.colors.push(o[3*u+1]),t.colors.push(o[3*u+2])),e.material&&"AllSame"!==e.material.mappingType&&(t.materialIndex.push(n),t.materialIndex.push(n),t.materialIndex.push(n)),e.normal&&(t.normal.push(r[0]),t.normal.push(r[1]),t.normal.push(r[2]),t.normal.push(r[3*(u-1)]),t.normal.push(r[3*(u-1)+1]),t.normal.push(r[3*(u-1)+2]),t.normal.push(r[3*u]),t.normal.push(r[3*u+1]),t.normal.push(r[3*u+2])),e.uv&&e.uv.forEach((function(e,i){void 0===t.uvs[i]&&(t.uvs[i]=[]),t.uvs[i].push(s[i][0]),t.uvs[i].push(s[i][1]),t.uvs[i].push(s[i][2*(u-1)]),t.uvs[i].push(s[i][2*(u-1)+1]),t.uvs[i].push(s[i][2*u]),t.uvs[i].push(s[i][2*u+1])}))}addMorphTargets(e,i,n,r){if(0===n.length)return;e.morphTargetsRelative=!0,e.morphAttributes.position=[];const o=this;n.forEach((function(n){n.rawTargets.forEach((function(n){const s=t.Objects.Geometry[n.geoID];void 0!==s&&o.genMorphGeometry(e,i,s,r,n.name)}))}))}genMorphGeometry(t,e,n,r,o){const s=void 0!==e.PolygonVertexIndex?e.PolygonVertexIndex.a:[],a=void 0!==n.Vertices?n.Vertices.a:[],l=void 0!==n.Indexes?n.Indexes.a:[],c=3*t.attributes.position.count,u=new Float32Array(c);for(let t=0;t<l.length;t++){const e=3*l[t];u[e]=a[3*t],u[e+1]=a[3*t+1],u[e+2]=a[3*t+2]}const h={vertexIndices:s,vertexPositions:u},p=this.genBuffers(h),d=new i.Float32BufferAttribute(p.vertex,3);d.name=o||n.attrName,d.applyMatrix4(r),t.morphAttributes.position.push(d)}parseNormals(t){const e=t.MappingInformationType,i=t.ReferenceInformationType,n=t.Normals.a;let r=[];return"IndexToDirect"===i&&("NormalIndex"in t?r=t.NormalIndex.a:"NormalsIndex"in t&&(r=t.NormalsIndex.a)),{dataSize:3,buffer:n,indices:r,mappingType:e,referenceType:i}}parseUVs(t){const e=t.MappingInformationType,i=t.ReferenceInformationType,n=t.UV.a;let r=[];return"IndexToDirect"===i&&(r=t.UVIndex.a),{dataSize:2,buffer:n,indices:r,mappingType:e,referenceType:i}}parseVertexColors(t){const e=t.MappingInformationType,i=t.ReferenceInformationType,n=t.Colors.a;let r=[];return"IndexToDirect"===i&&(r=t.ColorIndex.a),{dataSize:4,buffer:n,indices:r,mappingType:e,referenceType:i}}parseMaterialIndices(t){const e=t.MappingInformationType,i=t.ReferenceInformationType;if("NoMappingInformation"===e)return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:i};const n=t.Materials.a,r=[];for(let t=0;t<n.length;++t)r.push(t);return{dataSize:1,buffer:n,indices:r,mappingType:e,referenceType:i}}parseNurbsGeometry(t){if(void 0===i.NURBSCurve)return console.error("THREE.FBXLoader: The loader relies on THREE.NURBSCurve for any nurbs present in the model. Nurbs will show up as empty geometry."),new i.BufferGeometry;const e=parseInt(t.Order);if(isNaN(e))return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s",t.Order,t.id),new i.BufferGeometry;const n=e-1,r=t.KnotVector.a,o=[],s=t.Points.a;for(let t=0,e=s.length;t<e;t+=4)o.push((new i.Vector4).fromArray(s,t));let a,l;if("Closed"===t.Form)o.push(o[0]);else if("Periodic"===t.Form){a=n,l=r.length-1-a;for(let t=0;t<n;++t)o.push(o[t])}const c=new i.NURBSCurve(n,r,o,a,l).getPoints(12*o.length);return(new i.BufferGeometry).setFromPoints(c)}}class l{parse(){const t=[],e=this.parseClips();if(void 0!==e)for(const i in e){const n=e[i],r=this.addClip(n);t.push(r)}return t}parseClips(){if(void 0===t.Objects.AnimationCurve)return;const e=this.parseAnimationCurveNodes();this.parseAnimationCurves(e);const i=this.parseAnimationLayers(e);return this.parseAnimStacks(i)}parseAnimationCurveNodes(){const e=t.Objects.AnimationCurveNode,i=new Map;for(const t in e){const n=e[t];if(null!==n.attrName.match(/S|R|T|DeformPercent/)){const t={id:n.id,attr:n.attrName,curves:{}};i.set(t.id,t)}}return i}parseAnimationCurves(i){const n=t.Objects.AnimationCurve;for(const t in n){const r={id:n[t].id,times:n[t].KeyTime.a.map(f),values:n[t].KeyValueFloat.a},o=e.get(r.id);if(void 0!==o){const t=o.parents[0].ID,e=o.parents[0].relationship;e.match(/X/)?i.get(t).curves.x=r:e.match(/Y/)?i.get(t).curves.y=r:e.match(/Z/)?i.get(t).curves.z=r:e.match(/d|DeformPercent/)&&i.has(t)&&(i.get(t).curves.morph=r)}}}parseAnimationLayers(n){const o=t.Objects.AnimationLayer,s=new Map;for(const a in o){const o=[],l=e.get(parseInt(a));if(void 0!==l){l.children.forEach((function(s,a){if(n.has(s.ID)){const l=n.get(s.ID);if(void 0!==l.curves.x||void 0!==l.curves.y||void 0!==l.curves.z){if(void 0===o[a]){const n=e.get(s.ID).parents.filter((function(t){return void 0!==t.relationship}))[0].ID;if(void 0!==n){const e=t.Objects.Model[n.toString()];if(void 0===e)return void console.warn("THREE.FBXLoader: Encountered a unused curve.",s);const l={modelName:e.attrName?i.PropertyBinding.sanitizeNodeName(e.attrName):"",ID:e.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};r.traverse((function(t){t.ID===e.id&&(l.transform=t.matrix,t.userData.transformData&&(l.eulerOrder=t.userData.transformData.eulerOrder))})),l.transform||(l.transform=new i.Matrix4),"PreRotation"in e&&(l.preRotation=e.PreRotation.value),"PostRotation"in e&&(l.postRotation=e.PostRotation.value),o[a]=l}}o[a]&&(o[a][l.attr]=l)}else if(void 0!==l.curves.morph){if(void 0===o[a]){const n=e.get(s.ID).parents.filter((function(t){return void 0!==t.relationship}))[0].ID,r=e.get(n).parents[0].ID,l=e.get(r).parents[0].ID,c=e.get(l).parents[0].ID,u=t.Objects.Model[c],h={modelName:u.attrName?i.PropertyBinding.sanitizeNodeName(u.attrName):"",morphName:t.Objects.Deformer[n].attrName};o[a]=h}o[a][l.attr]=l}}})),s.set(parseInt(a),o)}}return s}parseAnimStacks(i){const n=t.Objects.AnimationStack,r={};for(const t in n){const o=e.get(parseInt(t)).children;o.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");const s=i.get(o[0].ID);r[t]={name:n[t].attrName,layer:s}}return r}addClip(t){let e=[];const n=this;return t.layer.forEach((function(t){e=e.concat(n.generateTracks(t))})),new i.AnimationClip(t.name,-1,e)}generateTracks(t){const e=[];let n=new i.Vector3,r=new i.Quaternion,o=new i.Vector3;if(t.transform&&t.transform.decompose(n,r,o),n=n.toArray(),r=(new i.Euler).setFromQuaternion(r,t.eulerOrder).toArray(),o=o.toArray(),void 0!==t.T&&Object.keys(t.T.curves).length>0){const i=this.generateVectorTrack(t.modelName,t.T.curves,n,"position");void 0!==i&&e.push(i)}if(void 0!==t.R&&Object.keys(t.R.curves).length>0){const i=this.generateRotationTrack(t.modelName,t.R.curves,r,t.preRotation,t.postRotation,t.eulerOrder);void 0!==i&&e.push(i)}if(void 0!==t.S&&Object.keys(t.S.curves).length>0){const i=this.generateVectorTrack(t.modelName,t.S.curves,o,"scale");void 0!==i&&e.push(i)}if(void 0!==t.DeformPercent){const i=this.generateMorphTrack(t);void 0!==i&&e.push(i)}return e}generateVectorTrack(t,e,n,r){const o=this.getTimesForAllAxes(e),s=this.getKeyframeTrackValues(o,e,n);return new i.VectorKeyframeTrack(t+"."+r,o,s)}generateRotationTrack(t,e,n,r,o,s){void 0!==e.x&&(this.interpolateRotations(e.x),e.x.values=e.x.values.map(i.MathUtils.degToRad)),void 0!==e.y&&(this.interpolateRotations(e.y),e.y.values=e.y.values.map(i.MathUtils.degToRad)),void 0!==e.z&&(this.interpolateRotations(e.z),e.z.values=e.z.values.map(i.MathUtils.degToRad));const a=this.getTimesForAllAxes(e),l=this.getKeyframeTrackValues(a,e,n);void 0!==r&&((r=r.map(i.MathUtils.degToRad)).push(s),r=(new i.Euler).fromArray(r),r=(new i.Quaternion).setFromEuler(r)),void 0!==o&&((o=o.map(i.MathUtils.degToRad)).push(s),o=(new i.Euler).fromArray(o),o=(new i.Quaternion).setFromEuler(o).invert());const c=new i.Quaternion,u=new i.Euler,h=[];for(let t=0;t<l.length;t+=3)u.set(l[t],l[t+1],l[t+2],s),c.setFromEuler(u),void 0!==r&&c.premultiply(r),void 0!==o&&c.multiply(o),c.toArray(h,t/3*4);return new i.QuaternionKeyframeTrack(t+".quaternion",a,h)}generateMorphTrack(t){const e=t.DeformPercent.curves.morph,n=e.values.map((function(t){return t/100})),o=r.getObjectByName(t.modelName).morphTargetDictionary[t.morphName];return new i.NumberKeyframeTrack(t.modelName+".morphTargetInfluences["+o+"]",e.times,n)}getTimesForAllAxes(t){let e=[];if(void 0!==t.x&&(e=e.concat(t.x.times)),void 0!==t.y&&(e=e.concat(t.y.times)),void 0!==t.z&&(e=e.concat(t.z.times)),e=e.sort((function(t,e){return t-e})),e.length>1){let t=1,i=e[0];for(let n=1;n<e.length;n++){const r=e[n];r!==i&&(e[t]=r,i=r,t++)}e=e.slice(0,t)}return e}getKeyframeTrackValues(t,e,i){const n=i,r=[];let o=-1,s=-1,a=-1;return t.forEach((function(t){if(e.x&&(o=e.x.times.indexOf(t)),e.y&&(s=e.y.times.indexOf(t)),e.z&&(a=e.z.times.indexOf(t)),-1!==o){const t=e.x.values[o];r.push(t),n[0]=t}else r.push(n[0]);if(-1!==s){const t=e.y.values[s];r.push(t),n[1]=t}else r.push(n[1]);if(-1!==a){const t=e.z.values[a];r.push(t),n[2]=t}else r.push(n[2])})),r}interpolateRotations(t){for(let e=1;e<t.values.length;e++){const i=t.values[e-1],n=t.values[e]-i,r=Math.abs(n);if(r>=180){const o=r/180,s=n/o;let a=i+s;const l=t.times[e-1],c=(t.times[e]-l)/o;let u=l+c;const h=[],p=[];for(;u<t.times[e];)h.push(u),u+=c,p.push(a),a+=s;t.times=A(t.times,e,h),t.values=A(t.values,e,p)}}}}class c{getPrevNode(){return this.nodeStack[this.currentIndent-2]}getCurrentNode(){return this.nodeStack[this.currentIndent-1]}getCurrentProp(){return this.currentProp}pushStack(t){this.nodeStack.push(t),this.currentIndent+=1}popStack(){this.nodeStack.pop(),this.currentIndent-=1}setCurrentProp(t,e){this.currentProp=t,this.currentPropName=e}parse(t){this.currentIndent=0,this.allNodes=new p,this.nodeStack=[],this.currentProp=[],this.currentPropName="";const e=this,i=t.split(/[\r\n]+/);return i.forEach((function(t,n){const r=t.match(/^[\s\t]*;/),o=t.match(/^[\s\t]*$/);if(r||o)return;const s=t.match("^\\t{"+e.currentIndent+"}(\\w+):(.*){",""),a=t.match("^\\t{"+e.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),l=t.match("^\\t{"+(e.currentIndent-1)+"}}");s?e.parseNodeBegin(t,s):a?e.parseNodeProperty(t,a,i[++n]):l?e.popStack():t.match(/^[^\s\t}]/)&&e.parseNodePropertyContinued(t)})),this.allNodes}parseNodeBegin(t,e){const i=e[1].trim().replace(/^"/,"").replace(/"$/,""),n=e[2].split(",").map((function(t){return t.trim().replace(/^"/,"").replace(/"$/,"")})),r={name:i},o=this.parseNodeAttr(n),s=this.getCurrentNode();0===this.currentIndent?this.allNodes.add(i,r):i in s?("PoseNode"===i?s.PoseNode.push(r):void 0!==s[i].id&&(s[i]={},s[i][s[i].id]=s[i]),""!==o.id&&(s[i][o.id]=r)):"number"==typeof o.id?(s[i]={},s[i][o.id]=r):"Properties70"!==i&&(s[i]="PoseNode"===i?[r]:r),"number"==typeof o.id&&(r.id=o.id),""!==o.name&&(r.attrName=o.name),""!==o.type&&(r.attrType=o.type),this.pushStack(r)}parseNodeAttr(t){let e=t[0];""!==t[0]&&(e=parseInt(t[0]),isNaN(e)&&(e=t[0]));let i="",n="";return t.length>1&&(i=t[1].replace(/^(\w+)::/,""),n=t[2]),{id:e,name:i,type:n}}parseNodeProperty(t,e,i){let n=e[1].replace(/^"/,"").replace(/"$/,"").trim(),r=e[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===n&&","===r&&(r=i.replace(/"/g,"").replace(/,$/,"").trim());const o=this.getCurrentNode();if("Properties70"!==o.name){if("C"===n){const t=r.split(",").slice(1),e=parseInt(t[0]),i=parseInt(t[1]);let s=r.split(",").slice(3);s=s.map((function(t){return t.trim().replace(/^"/,"")})),n="connections",r=[e,i],function(t,e){for(let i=0,n=t.length,r=e.length;i<r;i++,n++)t[n]=e[i]}(r,s),void 0===o[n]&&(o[n]=[])}"Node"===n&&(o.id=r),n in o&&Array.isArray(o[n])?o[n].push(r):"a"!==n?o[n]=r:o.a=r,this.setCurrentProp(o,n),"a"===n&&","!==r.slice(-1)&&(o.a=b(r))}else this.parseNodeSpecialProperty(t,n,r)}parseNodePropertyContinued(t){const e=this.getCurrentNode();e.a+=t,","!==t.slice(-1)&&(e.a=b(e.a))}parseNodeSpecialProperty(t,e,i){const n=i.split('",').map((function(t){return t.trim().replace(/^\"/,"").replace(/\s/,"_")})),r=n[0],o=n[1],s=n[2],a=n[3];let l=n[4];switch(o){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":l=parseFloat(l);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":l=b(l)}this.getPrevNode()[r]={type:o,type2:s,flag:a,value:l},this.setCurrentProp(this.getPrevNode(),r)}}class u{parse(t){const e=new h(t);e.skip(23);const i=e.getUint32();if(i<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+i);const n=new p;for(;!this.endOfContent(e);){const t=this.parseNode(e,i);null!==t&&n.add(t.name,t)}return n}endOfContent(t){return t.size()%16==0?(t.getOffset()+160+16&-16)>=t.size():t.getOffset()+160+16>=t.size()}parseNode(t,e){const i={},n=e>=7500?t.getUint64():t.getUint32(),r=e>=7500?t.getUint64():t.getUint32();e>=7500?t.getUint64():t.getUint32();const o=t.getUint8(),s=t.getString(o);if(0===n)return null;const a=[];for(let e=0;e<r;e++)a.push(this.parseProperty(t));const l=a.length>0?a[0]:"",c=a.length>1?a[1]:"",u=a.length>2?a[2]:"";for(i.singleProperty=1===r&&t.getOffset()===n;n>t.getOffset();){const n=this.parseNode(t,e);null!==n&&this.parseSubNode(s,i,n)}return i.propertyList=a,"number"==typeof l&&(i.id=l),""!==c&&(i.attrName=c),""!==u&&(i.attrType=u),""!==s&&(i.name=s),i}parseSubNode(t,e,i){if(!0===i.singleProperty){const t=i.propertyList[0];Array.isArray(t)?(e[i.name]=i,i.a=t):e[i.name]=t}else if("Connections"===t&&"C"===i.name){const t=[];i.propertyList.forEach((function(e,i){0!==i&&t.push(e)})),void 0===e.connections&&(e.connections=[]),e.connections.push(t)}else if("Properties70"===i.name){Object.keys(i).forEach((function(t){e[t]=i[t]}))}else if("Properties70"===t&&"P"===i.name){let t=i.propertyList[0],n=i.propertyList[1];const r=i.propertyList[2],o=i.propertyList[3];let s;0===t.indexOf("Lcl ")&&(t=t.replace("Lcl ","Lcl_")),0===n.indexOf("Lcl ")&&(n=n.replace("Lcl ","Lcl_")),s="Color"===n||"ColorRGB"===n||"Vector"===n||"Vector3D"===n||0===n.indexOf("Lcl_")?[i.propertyList[4],i.propertyList[5],i.propertyList[6]]:i.propertyList[4],e[t]={type:n,type2:r,flag:o,value:s}}else void 0===e[i.name]?"number"==typeof i.id?(e[i.name]={},e[i.name][i.id]=i):e[i.name]=i:"PoseNode"===i.name?(Array.isArray(e[i.name])||(e[i.name]=[e[i.name]]),e[i.name].push(i)):void 0===e[i.name][i.id]&&(e[i.name][i.id]=i)}parseProperty(t){const e=t.getString(1);let i;switch(e){case"C":return t.getBoolean();case"D":return t.getFloat64();case"F":return t.getFloat32();case"I":return t.getInt32();case"L":return t.getInt64();case"R":return i=t.getUint32(),t.getArrayBuffer(i);case"S":return i=t.getUint32(),t.getString(i);case"Y":return t.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":const r=t.getUint32(),o=t.getUint32(),s=t.getUint32();if(0===o)switch(e){case"b":case"c":return t.getBooleanArray(r);case"d":return t.getFloat64Array(r);case"f":return t.getFloat32Array(r);case"i":return t.getInt32Array(r);case"l":return t.getInt64Array(r)}void 0===n&&console.error("THREE.FBXLoader: External library fflate.min.js required.");const a=n.unzlibSync(new Uint8Array(t.getArrayBuffer(s))),l=new h(a.buffer);switch(e){case"b":case"c":return l.getBooleanArray(r);case"d":return l.getFloat64Array(r);case"f":return l.getFloat32Array(r);case"i":return l.getInt32Array(r);case"l":return l.getInt64Array(r)}default:throw new Error("THREE.FBXLoader: Unknown property type "+e)}}}class h{constructor(t,e){this.dv=new DataView(t),this.offset=0,this.littleEndian=void 0===e||e}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(t){this.offset+=t}getBoolean(){return 1==(1&this.getUint8())}getBooleanArray(t){const e=[];for(let i=0;i<t;i++)e.push(this.getBoolean());return e}getUint8(){const t=this.dv.getUint8(this.offset);return this.offset+=1,t}getInt16(){const t=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,t}getInt32(){const t=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,t}getInt32Array(t){const e=[];for(let i=0;i<t;i++)e.push(this.getInt32());return e}getUint32(){const t=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,t}getInt64(){let t,e;return this.littleEndian?(t=this.getUint32(),e=this.getUint32()):(e=this.getUint32(),t=this.getUint32()),2147483648&e?(e=4294967295&~e,t=4294967295&~t,4294967295===t&&(e=e+1&4294967295),t=t+1&4294967295,-(4294967296*e+t)):4294967296*e+t}getInt64Array(t){const e=[];for(let i=0;i<t;i++)e.push(this.getInt64());return e}getUint64(){let t,e;return this.littleEndian?(t=this.getUint32(),e=this.getUint32()):(e=this.getUint32(),t=this.getUint32()),4294967296*e+t}getFloat32(){const t=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t}getFloat32Array(t){const e=[];for(let i=0;i<t;i++)e.push(this.getFloat32());return e}getFloat64(){const t=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t}getFloat64Array(t){const e=[];for(let i=0;i<t;i++)e.push(this.getFloat64());return e}getArrayBuffer(t){const e=this.dv.buffer.slice(this.offset,this.offset+t);return this.offset+=t,e}getString(t){let e=[];for(let i=0;i<t;i++)e[i]=this.getUint8();const n=e.indexOf(0);return n>=0&&(e=e.slice(0,n)),i.LoaderUtils.decodeText(new Uint8Array(e))}}class p{add(t,e){this[t]=e}}function d(t){const e=t.match(/FBXVersion: (\d+)/);if(e){return parseInt(e[1])}throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function f(t){return t/46186158e3}const m=[];function g(t,e,i,n){let r;switch(n.mappingType){case"ByPolygonVertex":r=t;break;case"ByPolygon":r=e;break;case"ByVertice":r=i;break;case"AllSame":r=n.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+n.mappingType)}"IndexToDirect"===n.referenceType&&(r=n.indices[r]);const o=r*n.dataSize,s=o+n.dataSize;return function(t,e,i,n){for(let r=i,o=0;r<n;r++,o++)t[o]=e[r];return t}(m,n.buffer,o,s)}const y=new i.Euler,v=new i.Vector3;function _(t){const e=new i.Matrix4,n=new i.Matrix4,r=new i.Matrix4,o=new i.Matrix4,s=new i.Matrix4,a=new i.Matrix4,l=new i.Matrix4,c=new i.Matrix4,u=new i.Matrix4,h=new i.Matrix4,p=new i.Matrix4,d=new i.Matrix4,f=t.inheritType?t.inheritType:0;if(t.translation&&e.setPosition(v.fromArray(t.translation)),t.preRotation){const e=t.preRotation.map(i.MathUtils.degToRad);e.push(t.eulerOrder),n.makeRotationFromEuler(y.fromArray(e))}if(t.rotation){const e=t.rotation.map(i.MathUtils.degToRad);e.push(t.eulerOrder),r.makeRotationFromEuler(y.fromArray(e))}if(t.postRotation){const e=t.postRotation.map(i.MathUtils.degToRad);e.push(t.eulerOrder),o.makeRotationFromEuler(y.fromArray(e)),o.invert()}t.scale&&s.scale(v.fromArray(t.scale)),t.scalingOffset&&l.setPosition(v.fromArray(t.scalingOffset)),t.scalingPivot&&a.setPosition(v.fromArray(t.scalingPivot)),t.rotationOffset&&c.setPosition(v.fromArray(t.rotationOffset)),t.rotationPivot&&u.setPosition(v.fromArray(t.rotationPivot)),t.parentMatrixWorld&&(p.copy(t.parentMatrix),h.copy(t.parentMatrixWorld));const m=n.clone().multiply(r).multiply(o),g=new i.Matrix4;g.extractRotation(h);const _=new i.Matrix4;_.copyPosition(h);const x=_.clone().invert().multiply(h),b=g.clone().invert().multiply(x),w=s,A=new i.Matrix4;if(0===f)A.copy(g).multiply(m).multiply(b).multiply(w);else if(1===f)A.copy(g).multiply(b).multiply(m).multiply(w);else{const t=(new i.Matrix4).scale((new i.Vector3).setFromMatrixScale(p)).clone().invert(),e=b.clone().multiply(t);A.copy(g).multiply(m).multiply(e).multiply(w)}const E=u.clone().invert(),S=a.clone().invert();let M=e.clone().multiply(c).multiply(u).multiply(n).multiply(r).multiply(o).multiply(E).multiply(l).multiply(a).multiply(s).multiply(S);const T=(new i.Matrix4).copyPosition(M),I=h.clone().multiply(T);return d.copyPosition(I),M=d.clone().multiply(A),M.premultiply(h.invert()),M}function x(t){const e=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return 6===(t=t||0)?(console.warn("THREE.FBXLoader: unsupported THREE.Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),e[0]):e[t]}function b(t){return t.split(",").map((function(t){return parseFloat(t)}))}function w(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=t.byteLength),i.LoaderUtils.decodeText(new Uint8Array(t,e,n))}function A(t,e,i){return t.slice(0,e).concat(i).concat(t.slice(e))}i.FBXLoader=o}(),t.exports=i.FBXLoader}(Gd);var Wd=Gd.exports,qd={exports:{}};!function(t,e){const i=ld;!function(){class t extends i.Loader{constructor(t){super(t),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(t){return new s(t)})),this.register((function(t){return new h(t)})),this.register((function(t){return new p(t)})),this.register((function(t){return new a(t)})),this.register((function(t){return new l(t)})),this.register((function(t){return new c(t)})),this.register((function(t){return new u(t)})),this.register((function(t){return new r(t)})),this.register((function(t){return new d(t)}))}load(t,e,n,r){const o=this;let s;s=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:i.LoaderUtils.extractUrlBase(t),this.manager.itemStart(t);const a=function(e){r?r(e):console.error(e),o.manager.itemError(t),o.manager.itemEnd(t)},l=new i.FileLoader(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(t,(function(i){try{o.parse(i,s,(function(i){e(i),o.manager.itemEnd(t)}),a)}catch(t){a(t)}}),n,a)}setDRACOLoader(t){return this.dracoLoader=t,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(t){return this.ktx2Loader=t,this}setMeshoptDecoder(t){return this.meshoptDecoder=t,this}register(t){return-1===this.pluginCallbacks.indexOf(t)&&this.pluginCallbacks.push(t),this}unregister(t){return-1!==this.pluginCallbacks.indexOf(t)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(t),1),this}parse(t,e,r,s){let a;const l={},c={};if("string"==typeof t)a=t;else{if(i.LoaderUtils.decodeText(new Uint8Array(t,0,4))===f){try{l[n.KHR_BINARY_GLTF]=new y(t)}catch(t){return void(s&&s(t))}a=l[n.KHR_BINARY_GLTF].content}else a=i.LoaderUtils.decodeText(new Uint8Array(t))}const u=JSON.parse(a);if(void 0===u.asset||u.asset.version[0]<2)return void(s&&s(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.")));const h=new J(u,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});h.fileLoader.setRequestHeader(this.requestHeader);for(let t=0;t<this.pluginCallbacks.length;t++){const e=this.pluginCallbacks[t](h);c[e.name]=e,l[e.name]=!0}if(u.extensionsUsed)for(let t=0;t<u.extensionsUsed.length;++t){const e=u.extensionsUsed[t],i=u.extensionsRequired||[];switch(e){case n.KHR_MATERIALS_UNLIT:l[e]=new o;break;case n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:l[e]=new b;break;case n.KHR_DRACO_MESH_COMPRESSION:l[e]=new v(u,this.dracoLoader);break;case n.KHR_TEXTURE_TRANSFORM:l[e]=new _;break;case n.KHR_MESH_QUANTIZATION:l[e]=new w;break;default:i.indexOf(e)>=0&&void 0===c[e]&&console.warn('THREE.GLTFLoader: Unknown extension "'+e+'".')}}h.setExtensions(l),h.setPlugins(c),h.parse(r,s)}}function e(){let t={};return{get:function(e){return t[e]},add:function(e,i){t[e]=i},remove:function(e){delete t[e]},removeAll:function(){t={}}}}const n={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression"};class r{constructor(t){this.parser=t,this.name=n.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const t=this.parser,e=this.parser.json.nodes||[];for(let i=0,n=e.length;i<n;i++){const n=e[i];n.extensions&&n.extensions[this.name]&&void 0!==n.extensions[this.name].light&&t._addNodeRef(this.cache,n.extensions[this.name].light)}}_loadLight(t){const e=this.parser,n="light:"+t;let r=e.cache.get(n);if(r)return r;const o=e.json,s=((o.extensions&&o.extensions[this.name]||{}).lights||[])[t];let a;const l=new i.Color(16777215);void 0!==s.color&&l.fromArray(s.color);const c=void 0!==s.range?s.range:0;switch(s.type){case"directional":a=new i.DirectionalLight(l),a.target.position.set(0,0,-1),a.add(a.target);break;case"point":a=new i.PointLight(l),a.distance=c;break;case"spot":a=new i.SpotLight(l),a.distance=c,s.spot=s.spot||{},s.spot.innerConeAngle=void 0!==s.spot.innerConeAngle?s.spot.innerConeAngle:0,s.spot.outerConeAngle=void 0!==s.spot.outerConeAngle?s.spot.outerConeAngle:Math.PI/4,a.angle=s.spot.outerConeAngle,a.penumbra=1-s.spot.innerConeAngle/s.spot.outerConeAngle,a.target.position.set(0,0,-1),a.add(a.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+s.type)}return a.position.set(0,0,0),a.decay=2,void 0!==s.intensity&&(a.intensity=s.intensity),a.name=e.createUniqueName(s.name||"light_"+t),r=Promise.resolve(a),e.cache.add(n,r),r}createNodeAttachment(t){const e=this,i=this.parser,n=i.json.nodes[t],r=(n.extensions&&n.extensions[this.name]||{}).light;return void 0===r?null:this._loadLight(r).then((function(t){return i._getNodeRef(e.cache,r,t)}))}}class o{constructor(){this.name=n.KHR_MATERIALS_UNLIT}getMaterialType(){return i.MeshBasicMaterial}extendParams(t,e,n){const r=[];t.color=new i.Color(1,1,1),t.opacity=1;const o=e.pbrMetallicRoughness;if(o){if(Array.isArray(o.baseColorFactor)){const e=o.baseColorFactor;t.color.fromArray(e),t.opacity=e[3]}void 0!==o.baseColorTexture&&r.push(n.assignTexture(t,"map",o.baseColorTexture))}return Promise.all(r)}}class s{constructor(t){this.parser=t,this.name=n.KHR_MATERIALS_CLEARCOAT}getMaterialType(t){const e=this.parser.json.materials[t];return e.extensions&&e.extensions[this.name]?i.MeshPhysicalMaterial:null}extendMaterialParams(t,e){const n=this.parser,r=n.json.materials[t];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];if(void 0!==s.clearcoatFactor&&(e.clearcoat=s.clearcoatFactor),void 0!==s.clearcoatTexture&&o.push(n.assignTexture(e,"clearcoatMap",s.clearcoatTexture)),void 0!==s.clearcoatRoughnessFactor&&(e.clearcoatRoughness=s.clearcoatRoughnessFactor),void 0!==s.clearcoatRoughnessTexture&&o.push(n.assignTexture(e,"clearcoatRoughnessMap",s.clearcoatRoughnessTexture)),void 0!==s.clearcoatNormalTexture&&(o.push(n.assignTexture(e,"clearcoatNormalMap",s.clearcoatNormalTexture)),void 0!==s.clearcoatNormalTexture.scale)){const t=s.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new i.Vector2(t,-t)}return Promise.all(o)}}class a{constructor(t){this.parser=t,this.name=n.KHR_MATERIALS_TRANSMISSION}getMaterialType(t){const e=this.parser.json.materials[t];return e.extensions&&e.extensions[this.name]?i.MeshPhysicalMaterial:null}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=[],o=n.extensions[this.name];return void 0!==o.transmissionFactor&&(e.transmission=o.transmissionFactor),void 0!==o.transmissionTexture&&r.push(i.assignTexture(e,"transmissionMap",o.transmissionTexture)),Promise.all(r)}}class l{constructor(t){this.parser=t,this.name=n.KHR_MATERIALS_VOLUME}getMaterialType(t){const e=this.parser.json.materials[t];return e.extensions&&e.extensions[this.name]?i.MeshPhysicalMaterial:null}extendMaterialParams(t,e){const n=this.parser,r=n.json.materials[t];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];e.thickness=void 0!==s.thicknessFactor?s.thicknessFactor:0,void 0!==s.thicknessTexture&&o.push(n.assignTexture(e,"thicknessMap",s.thicknessTexture)),e.attenuationDistance=s.attenuationDistance||0;const a=s.attenuationColor||[1,1,1];return e.attenuationTint=new i.Color(a[0],a[1],a[2]),Promise.all(o)}}class c{constructor(t){this.parser=t,this.name=n.KHR_MATERIALS_IOR}getMaterialType(t){const e=this.parser.json.materials[t];return e.extensions&&e.extensions[this.name]?i.MeshPhysicalMaterial:null}extendMaterialParams(t,e){const i=this.parser.json.materials[t];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const n=i.extensions[this.name];return e.ior=void 0!==n.ior?n.ior:1.5,Promise.resolve()}}class u{constructor(t){this.parser=t,this.name=n.KHR_MATERIALS_SPECULAR}getMaterialType(t){const e=this.parser.json.materials[t];return e.extensions&&e.extensions[this.name]?i.MeshPhysicalMaterial:null}extendMaterialParams(t,e){const n=this.parser,r=n.json.materials[t];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const o=[],s=r.extensions[this.name];e.specularIntensity=void 0!==s.specularFactor?s.specularFactor:1,void 0!==s.specularTexture&&o.push(n.assignTexture(e,"specularIntensityMap",s.specularTexture));const a=s.specularColorFactor||[1,1,1];return e.specularTint=new i.Color(a[0],a[1],a[2]),void 0!==s.specularColorTexture&&o.push(n.assignTexture(e,"specularTintMap",s.specularColorTexture).then((function(t){t.encoding=i.sRGBEncoding}))),Promise.all(o)}}class h{constructor(t){this.parser=t,this.name=n.KHR_TEXTURE_BASISU}loadTexture(t){const e=this.parser,i=e.json,n=i.textures[t];if(!n.extensions||!n.extensions[this.name])return null;const r=n.extensions[this.name],o=i.images[r.source],s=e.options.ktx2Loader;if(!s){if(i.extensionsRequired&&i.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(t,o,s)}}class p{constructor(t){this.parser=t,this.name=n.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(t){const e=this.name,i=this.parser,n=i.json,r=n.textures[t];if(!r.extensions||!r.extensions[e])return null;const o=r.extensions[e],s=n.images[o.source];let a=i.textureLoader;if(s.uri){const t=i.options.manager.getHandler(s.uri);null!==t&&(a=t)}return this.detectSupport().then((function(r){if(r)return i.loadTextureImage(t,s,a);if(n.extensionsRequired&&n.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.loadTexture(t)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(t){const e=new Image;e.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.onload=e.onerror=function(){t(1===e.height)}}))),this.isSupported}}class d{constructor(t){this.name=n.EXT_MESHOPT_COMPRESSION,this.parser=t}loadBufferView(t){const e=this.parser.json,i=e.bufferViews[t];if(i.extensions&&i.extensions[this.name]){const t=i.extensions[this.name],n=this.parser.getDependency("buffer",t.buffer),r=this.parser.options.meshoptDecoder;if(!r||!r.supported){if(e.extensionsRequired&&e.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([n,r.ready]).then((function(e){const i=t.byteOffset||0,n=t.byteLength||0,o=t.count,s=t.byteStride,a=new ArrayBuffer(o*s),l=new Uint8Array(e[0],i,n);return r.decodeGltfBuffer(new Uint8Array(a),o,s,l,t.mode,t.filter),a}))}return null}}const f="glTF",m=1313821514,g=5130562;class y{constructor(t){this.name=n.KHR_BINARY_GLTF,this.content=null,this.body=null;const e=new DataView(t,0,12);if(this.header={magic:i.LoaderUtils.decodeText(new Uint8Array(t.slice(0,4))),version:e.getUint32(4,!0),length:e.getUint32(8,!0)},this.header.magic!==f)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const r=this.header.length-12,o=new DataView(t,12);let s=0;for(;s<r;){const e=o.getUint32(s,!0);s+=4;const n=o.getUint32(s,!0);if(s+=4,n===m){const n=new Uint8Array(t,12+s,e);this.content=i.LoaderUtils.decodeText(n)}else if(n===g){const i=12+s;this.body=t.slice(i,i+e)}s+=e}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class v{constructor(t,e){if(!e)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=n.KHR_DRACO_MESH_COMPRESSION,this.json=t,this.dracoLoader=e,this.dracoLoader.preload()}decodePrimitive(t,e){const i=this.json,n=this.dracoLoader,r=t.extensions[this.name].bufferView,o=t.extensions[this.name].attributes,s={},a={},l={};for(const t in o){const e=B[t]||t.toLowerCase();s[e]=o[t]}for(const e in t.attributes){const n=B[e]||e.toLowerCase();if(void 0!==o[e]){const r=i.accessors[t.attributes[e]],o=R[r.componentType];l[n]=o,a[n]=!0===r.normalized}}return e.getDependency("bufferView",r).then((function(t){return new Promise((function(e){n.decodeDracoFile(t,(function(t){for(const e in t.attributes){const i=t.attributes[e],n=a[e];void 0!==n&&(i.normalized=n)}e(t)}),s,l)}))}))}}class _{constructor(){this.name=n.KHR_TEXTURE_TRANSFORM}extendTexture(t,e){return void 0!==e.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),void 0===e.offset&&void 0===e.rotation&&void 0===e.scale||(t=t.clone(),void 0!==e.offset&&t.offset.fromArray(e.offset),void 0!==e.rotation&&(t.rotation=e.rotation),void 0!==e.scale&&t.repeat.fromArray(e.scale),t.needsUpdate=!0),t}}class x extends i.MeshStandardMaterial{constructor(t){super(),this.isGLTFSpecularGlossinessMaterial=!0;const e=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),n=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),r=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\ttexelSpecular = sRGBToLinear( texelSpecular );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),o=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),s=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.roughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.","material.roughness += geometryRoughness;","material.roughness = min( material.roughness, 1.0 );","material.specularColor = specularFactor;"].join("\n"),a={specular:{value:(new i.Color).setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=a,this.onBeforeCompile=function(t){for(const e in a)t.uniforms[e]=a[e];t.fragmentShader=t.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;").replace("uniform float metalness;","uniform float glossiness;").replace("#include <roughnessmap_pars_fragment>",e).replace("#include <metalnessmap_pars_fragment>",n).replace("#include <roughnessmap_fragment>",r).replace("#include <metalnessmap_fragment>",o).replace("#include <lights_physical_fragment>",s)},Object.defineProperties(this,{specular:{get:function(){return a.specular.value},set:function(t){a.specular.value=t}},specularMap:{get:function(){return a.specularMap.value},set:function(t){a.specularMap.value=t,t?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return a.glossiness.value},set:function(t){a.glossiness.value=t}},glossinessMap:{get:function(){return a.glossinessMap.value},set:function(t){a.glossinessMap.value=t,t?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(t)}copy(t){return super.copy(t),this.specularMap=t.specularMap,this.specular.copy(t.specular),this.glossinessMap=t.glossinessMap,this.glossiness=t.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}}class b{constructor(){this.name=n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return x}extendParams(t,e,n){const r=e.extensions[this.name];t.color=new i.Color(1,1,1),t.opacity=1;const o=[];if(Array.isArray(r.diffuseFactor)){const e=r.diffuseFactor;t.color.fromArray(e),t.opacity=e[3]}if(void 0!==r.diffuseTexture&&o.push(n.assignTexture(t,"map",r.diffuseTexture)),t.emissive=new i.Color(0,0,0),t.glossiness=void 0!==r.glossinessFactor?r.glossinessFactor:1,t.specular=new i.Color(1,1,1),Array.isArray(r.specularFactor)&&t.specular.fromArray(r.specularFactor),void 0!==r.specularGlossinessTexture){const e=r.specularGlossinessTexture;o.push(n.assignTexture(t,"glossinessMap",e)),o.push(n.assignTexture(t,"specularMap",e))}return Promise.all(o)}createMaterial(t){const e=new x(t);return e.fog=!0,e.color=t.color,e.map=void 0===t.map?null:t.map,e.lightMap=null,e.lightMapIntensity=1,e.aoMap=void 0===t.aoMap?null:t.aoMap,e.aoMapIntensity=1,e.emissive=t.emissive,e.emissiveIntensity=1,e.emissiveMap=void 0===t.emissiveMap?null:t.emissiveMap,e.bumpMap=void 0===t.bumpMap?null:t.bumpMap,e.bumpScale=1,e.normalMap=void 0===t.normalMap?null:t.normalMap,e.normalMapType=i.TangentSpaceNormalMap,t.normalScale&&(e.normalScale=t.normalScale),e.displacementMap=null,e.displacementScale=1,e.displacementBias=0,e.specularMap=void 0===t.specularMap?null:t.specularMap,e.specular=t.specular,e.glossinessMap=void 0===t.glossinessMap?null:t.glossinessMap,e.glossiness=t.glossiness,e.alphaMap=null,e.envMap=void 0===t.envMap?null:t.envMap,e.envMapIntensity=1,e.refractionRatio=.98,e}}class w{constructor(){this.name=n.KHR_MESH_QUANTIZATION}}class A extends i.Interpolant{constructor(t,e,i,n){super(t,e,i,n)}copySampleValue_(t){const e=this.resultBuffer,i=this.sampleValues,n=this.valueSize,r=t*n*3+n;for(let t=0;t!==n;t++)e[t]=i[r+t];return e}}A.prototype.beforeStart_=A.prototype.copySampleValue_,A.prototype.afterEnd_=A.prototype.copySampleValue_,A.prototype.interpolate_=function(t,e,i,n){const r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=2*s,l=3*s,c=n-e,u=(i-e)/c,h=u*u,p=h*u,d=t*l,f=d-l,m=-2*p+3*h,g=p-h,y=1-m,v=g-h+u;for(let t=0;t!==s;t++){const e=o[f+t+s],i=o[f+t+a]*c,n=o[d+t+s],l=o[d+t]*c;r[t]=y*e+v*i+m*n+g*l}return r};const E=new i.Quaternion;class S extends A{interpolate_(t,e,i,n){const r=super.interpolate_(t,e,i,n);return E.fromArray(r).normalize().toArray(r),r}}const M=0,T=1,I=2,C=3,P=4,L=5,D=6,R={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},O={9728:i.NearestFilter,9729:i.LinearFilter,9984:i.NearestMipmapNearestFilter,9985:i.LinearMipmapNearestFilter,9986:i.NearestMipmapLinearFilter,9987:i.LinearMipmapLinearFilter},k={33071:i.ClampToEdgeWrapping,33648:i.MirroredRepeatWrapping,10497:i.RepeatWrapping},N={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},B={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},z={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},F={CUBICSPLINE:void 0,LINEAR:i.InterpolateLinear,STEP:i.InterpolateDiscrete},V="OPAQUE",U="MASK",G="BLEND";function j(t,e){return"string"!=typeof t||""===t?"":(/^https?:\/\//i.test(e)&&/^\//.test(t)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(t)||/^data:.*,.*$/i.test(t)||/^blob:.*$/i.test(t)?t:e+t)}function H(t){return void 0===t.DefaultMaterial&&(t.DefaultMaterial=new i.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:i.FrontSide})),t.DefaultMaterial}function W(t,e,i){for(const n in i.extensions)void 0===t[n]&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=i.extensions[n])}function q(t,e){void 0!==e.extras&&("object"==typeof e.extras?Object.assign(t.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function X(t,e){if(t.updateMorphTargets(),void 0!==e.weights)for(let i=0,n=e.weights.length;i<n;i++)t.morphTargetInfluences[i]=e.weights[i];if(e.extras&&Array.isArray(e.extras.targetNames)){const i=e.extras.targetNames;if(t.morphTargetInfluences.length===i.length){t.morphTargetDictionary={};for(let e=0,n=i.length;e<n;e++)t.morphTargetDictionary[i[e]]=e}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function Z(t){const e=t.extensions&&t.extensions[n.KHR_DRACO_MESH_COMPRESSION];let i;return i=e?"draco:"+e.bufferView+":"+e.indices+":"+Y(e.attributes):t.indices+":"+Y(t.attributes)+":"+t.mode,i}function Y(t){let e="";const i=Object.keys(t).sort();for(let n=0,r=i.length;n<r;n++)e+=i[n]+":"+t[i[n]]+";";return e}function Q(t){switch(t){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}class J{constructor(t={},n={}){this.json=t,this.extensions={},this.plugins={},this.options=n,this.cache=new e,this.associations=new Map,this.primitiveCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.textureCache={},this.nodeNamesUsed={},"undefined"!=typeof createImageBitmap&&!1===/Firefox/.test(navigator.userAgent)?this.textureLoader=new i.ImageBitmapLoader(this.options.manager):this.textureLoader=new i.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new i.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(t){this.extensions=t}setPlugins(t){this.plugins=t}parse(t,e){const i=this,n=this.json,r=this.extensions;this.cache.removeAll(),this._invokeAll((function(t){return t._markDefs&&t._markDefs()})),Promise.all(this._invokeAll((function(t){return t.beforeRoot&&t.beforeRoot()}))).then((function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])})).then((function(e){const o={scene:e[0][n.scene||0],scenes:e[0],animations:e[1],cameras:e[2],asset:n.asset,parser:i,userData:{}};W(r,o,n),q(o,n),Promise.all(i._invokeAll((function(t){return t.afterRoot&&t.afterRoot(o)}))).then((function(){t(o)}))})).catch(e)}_markDefs(){const t=this.json.nodes||[],e=this.json.skins||[],i=this.json.meshes||[];for(let i=0,n=e.length;i<n;i++){const n=e[i].joints;for(let e=0,i=n.length;e<i;e++)t[n[e]].isBone=!0}for(let e=0,n=t.length;e<n;e++){const n=t[e];void 0!==n.mesh&&(this._addNodeRef(this.meshCache,n.mesh),void 0!==n.skin&&(i[n.mesh].isSkinnedMesh=!0)),void 0!==n.camera&&this._addNodeRef(this.cameraCache,n.camera)}}_addNodeRef(t,e){void 0!==e&&(void 0===t.refs[e]&&(t.refs[e]=t.uses[e]=0),t.refs[e]++)}_getNodeRef(t,e,i){if(t.refs[e]<=1)return i;const n=i.clone();return n.name+="_instance_"+t.uses[e]++,n}_invokeOne(t){const e=Object.values(this.plugins);e.push(this);for(let i=0;i<e.length;i++){const n=t(e[i]);if(n)return n}return null}_invokeAll(t){const e=Object.values(this.plugins);e.unshift(this);const i=[];for(let n=0;n<e.length;n++){const r=t(e[n]);r&&i.push(r)}return i}getDependency(t,e){const i=t+":"+e;let n=this.cache.get(i);if(!n){switch(t){case"scene":n=this.loadScene(e);break;case"node":n=this.loadNode(e);break;case"mesh":n=this._invokeOne((function(t){return t.loadMesh&&t.loadMesh(e)}));break;case"accessor":n=this.loadAccessor(e);break;case"bufferView":n=this._invokeOne((function(t){return t.loadBufferView&&t.loadBufferView(e)}));break;case"buffer":n=this.loadBuffer(e);break;case"material":n=this._invokeOne((function(t){return t.loadMaterial&&t.loadMaterial(e)}));break;case"texture":n=this._invokeOne((function(t){return t.loadTexture&&t.loadTexture(e)}));break;case"skin":n=this.loadSkin(e);break;case"animation":n=this.loadAnimation(e);break;case"camera":n=this.loadCamera(e);break;default:throw new Error("Unknown type: "+t)}this.cache.add(i,n)}return n}getDependencies(t){let e=this.cache.get(t);if(!e){const i=this,n=this.json[t+("mesh"===t?"es":"s")]||[];e=Promise.all(n.map((function(e,n){return i.getDependency(t,n)}))),this.cache.add(t,e)}return e}loadBuffer(t){const e=this.json.buffers[t],i=this.fileLoader;if(e.type&&"arraybuffer"!==e.type)throw new Error("THREE.GLTFLoader: "+e.type+" buffer type is not supported.");if(void 0===e.uri&&0===t)return Promise.resolve(this.extensions[n.KHR_BINARY_GLTF].body);const r=this.options;return new Promise((function(t,n){i.load(j(e.uri,r.path),t,void 0,(function(){n(new Error('THREE.GLTFLoader: Failed to load buffer "'+e.uri+'".'))}))}))}loadBufferView(t){const e=this.json.bufferViews[t];return this.getDependency("buffer",e.buffer).then((function(t){const i=e.byteLength||0,n=e.byteOffset||0;return t.slice(n,n+i)}))}loadAccessor(t){const e=this,n=this.json,r=this.json.accessors[t];if(void 0===r.bufferView&&void 0===r.sparse)return Promise.resolve(null);const o=[];return void 0!==r.bufferView?o.push(this.getDependency("bufferView",r.bufferView)):o.push(null),void 0!==r.sparse&&(o.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),o.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(o).then((function(t){const o=t[0],s=N[r.type],a=R[r.componentType],l=a.BYTES_PER_ELEMENT,c=l*s,u=r.byteOffset||0,h=void 0!==r.bufferView?n.bufferViews[r.bufferView].byteStride:void 0,p=!0===r.normalized;let d,f;if(h&&h!==c){const t=Math.floor(u/h),n="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+t+":"+r.count;let c=e.cache.get(n);c||(d=new a(o,t*h,r.count*h/l),c=new i.InterleavedBuffer(d,h/l),e.cache.add(n,c)),f=new i.InterleavedBufferAttribute(c,s,u%h/l,p)}else d=null===o?new a(r.count*s):new a(o,u,r.count*s),f=new i.BufferAttribute(d,s,p);if(void 0!==r.sparse){const e=N.SCALAR,n=R[r.sparse.indices.componentType],l=r.sparse.indices.byteOffset||0,c=r.sparse.values.byteOffset||0,u=new n(t[1],l,r.sparse.count*e),h=new a(t[2],c,r.sparse.count*s);null!==o&&(f=new i.BufferAttribute(f.array.slice(),f.itemSize,f.normalized));for(let t=0,e=u.length;t<e;t++){const e=u[t];if(f.setX(e,h[t*s]),s>=2&&f.setY(e,h[t*s+1]),s>=3&&f.setZ(e,h[t*s+2]),s>=4&&f.setW(e,h[t*s+3]),s>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse THREE.BufferAttribute.")}}return f}))}loadTexture(t){const e=this.json,i=this.options,n=e.textures[t],r=e.images[n.source];let o=this.textureLoader;if(r.uri){const t=i.manager.getHandler(r.uri);null!==t&&(o=t)}return this.loadTextureImage(t,r,o)}loadTextureImage(t,e,n){const r=this,o=this.json,s=this.options,a=o.textures[t],l=(e.uri||e.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];const c=self.URL||self.webkitURL;let u=e.uri||"",h=!1,p=!0;const d=u.search(/\.jpe?g($|\?)/i)>0||0===u.search(/^data\:image\/jpeg/);if(("image/jpeg"===e.mimeType||d)&&(p=!1),void 0!==e.bufferView)u=r.getDependency("bufferView",e.bufferView).then((function(t){if("image/png"===e.mimeType){const e=new DataView(t,25,1).getUint8(0,!1);p=6===e||4===e||3===e}h=!0;const i=new Blob([t],{type:e.mimeType});return u=c.createObjectURL(i),u}));else if(void 0===e.uri)throw new Error("THREE.GLTFLoader: Image "+t+" is missing URI and bufferView");const f=Promise.resolve(u).then((function(t){return new Promise((function(e,r){let o=e;!0===n.isImageBitmapLoader&&(o=function(t){const n=new i.Texture(t);n.needsUpdate=!0,e(n)}),n.load(j(t,s.path),o,void 0,r)}))})).then((function(e){!0===h&&c.revokeObjectURL(u),e.flipY=!1,a.name&&(e.name=a.name),p||(e.format=i.RGBFormat);const n=(o.samplers||{})[a.sampler]||{};return e.magFilter=O[n.magFilter]||i.LinearFilter,e.minFilter=O[n.minFilter]||i.LinearMipmapLinearFilter,e.wrapS=k[n.wrapS]||i.RepeatWrapping,e.wrapT=k[n.wrapT]||i.RepeatWrapping,r.associations.set(e,{type:"textures",index:t}),e})).catch((function(){return console.error("THREE.GLTFLoader: Couldn't load texture",u),null}));return this.textureCache[l]=f,f}assignTexture(t,e,i){const r=this;return this.getDependency("texture",i.index).then((function(o){if(void 0===i.texCoord||0==i.texCoord||"aoMap"===e&&1==i.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+i.texCoord+" for texture "+e+" not yet supported."),r.extensions[n.KHR_TEXTURE_TRANSFORM]){const t=void 0!==i.extensions?i.extensions[n.KHR_TEXTURE_TRANSFORM]:void 0;if(t){const e=r.associations.get(o);o=r.extensions[n.KHR_TEXTURE_TRANSFORM].extendTexture(o,t),r.associations.set(o,e)}}return t[e]=o,o}))}assignFinalMaterial(t){const e=t.geometry;let n=t.material;const r=void 0!==e.attributes.tangent,o=void 0!==e.attributes.color,s=void 0===e.attributes.normal;if(t.isPoints){const t="PointsMaterial:"+n.uuid;let e=this.cache.get(t);e||(e=new i.PointsMaterial,i.Material.prototype.copy.call(e,n),e.color.copy(n.color),e.map=n.map,e.sizeAttenuation=!1,this.cache.add(t,e)),n=e}else if(t.isLine){const t="LineBasicMaterial:"+n.uuid;let e=this.cache.get(t);e||(e=new i.LineBasicMaterial,i.Material.prototype.copy.call(e,n),e.color.copy(n.color),this.cache.add(t,e)),n=e}if(r||o||s){let t="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(t+="specular-glossiness:"),r&&(t+="vertex-tangents:"),o&&(t+="vertex-colors:"),s&&(t+="flat-shading:");let e=this.cache.get(t);e||(e=n.clone(),o&&(e.vertexColors=!0),s&&(e.flatShading=!0),r&&(e.normalScale&&(e.normalScale.y*=-1),e.clearcoatNormalScale&&(e.clearcoatNormalScale.y*=-1)),this.cache.add(t,e),this.associations.set(e,this.associations.get(n))),n=e}n.aoMap&&void 0===e.attributes.uv2&&void 0!==e.attributes.uv&&e.setAttribute("uv2",e.attributes.uv),t.material=n}getMaterialType(){return i.MeshStandardMaterial}loadMaterial(t){const e=this,r=this.json,o=this.extensions,s=r.materials[t];let a;const l={},c=s.extensions||{},u=[];if(c[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){const t=o[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];a=t.getMaterialType(),u.push(t.extendParams(l,s,e))}else if(c[n.KHR_MATERIALS_UNLIT]){const t=o[n.KHR_MATERIALS_UNLIT];a=t.getMaterialType(),u.push(t.extendParams(l,s,e))}else{const n=s.pbrMetallicRoughness||{};if(l.color=new i.Color(1,1,1),l.opacity=1,Array.isArray(n.baseColorFactor)){const t=n.baseColorFactor;l.color.fromArray(t),l.opacity=t[3]}void 0!==n.baseColorTexture&&u.push(e.assignTexture(l,"map",n.baseColorTexture)),l.metalness=void 0!==n.metallicFactor?n.metallicFactor:1,l.roughness=void 0!==n.roughnessFactor?n.roughnessFactor:1,void 0!==n.metallicRoughnessTexture&&(u.push(e.assignTexture(l,"metalnessMap",n.metallicRoughnessTexture)),u.push(e.assignTexture(l,"roughnessMap",n.metallicRoughnessTexture))),a=this._invokeOne((function(e){return e.getMaterialType&&e.getMaterialType(t)})),u.push(Promise.all(this._invokeAll((function(e){return e.extendMaterialParams&&e.extendMaterialParams(t,l)}))))}!0===s.doubleSided&&(l.side=i.DoubleSide);const h=s.alphaMode||V;return h===G?(l.transparent=!0,l.depthWrite=!1):(l.format=i.RGBFormat,l.transparent=!1,h===U&&(l.alphaTest=void 0!==s.alphaCutoff?s.alphaCutoff:.5)),void 0!==s.normalTexture&&a!==i.MeshBasicMaterial&&(u.push(e.assignTexture(l,"normalMap",s.normalTexture)),l.normalScale=new i.Vector2(1,-1),void 0!==s.normalTexture.scale&&l.normalScale.set(s.normalTexture.scale,-s.normalTexture.scale)),void 0!==s.occlusionTexture&&a!==i.MeshBasicMaterial&&(u.push(e.assignTexture(l,"aoMap",s.occlusionTexture)),void 0!==s.occlusionTexture.strength&&(l.aoMapIntensity=s.occlusionTexture.strength)),void 0!==s.emissiveFactor&&a!==i.MeshBasicMaterial&&(l.emissive=(new i.Color).fromArray(s.emissiveFactor)),void 0!==s.emissiveTexture&&a!==i.MeshBasicMaterial&&u.push(e.assignTexture(l,"emissiveMap",s.emissiveTexture)),Promise.all(u).then((function(){let r;return r=a===x?o[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(l):new a(l),s.name&&(r.name=s.name),r.map&&(r.map.encoding=i.sRGBEncoding),r.emissiveMap&&(r.emissiveMap.encoding=i.sRGBEncoding),q(r,s),e.associations.set(r,{type:"materials",index:t}),s.extensions&&W(o,r,s),r}))}createUniqueName(t){const e=i.PropertyBinding.sanitizeNodeName(t||"");let n=e;for(let t=1;this.nodeNamesUsed[n];++t)n=e+"_"+t;return this.nodeNamesUsed[n]=!0,n}loadGeometries(t){const e=this,r=this.extensions,o=this.primitiveCache;function s(t){return r[n.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(t,e).then((function(i){return $(i,t,e)}))}const a=[];for(let r=0,l=t.length;r<l;r++){const l=t[r],c=Z(l),u=o[c];if(u)a.push(u.promise);else{let t;t=l.extensions&&l.extensions[n.KHR_DRACO_MESH_COMPRESSION]?s(l):$(new i.BufferGeometry,l,e),o[c]={primitive:l,promise:t},a.push(t)}}return Promise.all(a)}loadMesh(t){const e=this,n=this.json,r=this.extensions,o=n.meshes[t],s=o.primitives,a=[];for(let t=0,e=s.length;t<e;t++){const e=void 0===s[t].material?H(this.cache):this.getDependency("material",s[t].material);a.push(e)}return a.push(e.loadGeometries(s)),Promise.all(a).then((function(n){const a=n.slice(0,n.length-1),l=n[n.length-1],c=[];for(let n=0,u=l.length;n<u;n++){const u=l[n],h=s[n];let p;const d=a[n];if(h.mode===P||h.mode===L||h.mode===D||void 0===h.mode)p=!0===o.isSkinnedMesh?new i.SkinnedMesh(u,d):new i.Mesh(u,d),!0!==p.isSkinnedMesh||p.geometry.attributes.skinWeight.normalized||p.normalizeSkinWeights(),h.mode===L?p.geometry=tt(p.geometry,i.TriangleStripDrawMode):h.mode===D&&(p.geometry=tt(p.geometry,i.TriangleFanDrawMode));else if(h.mode===T)p=new i.LineSegments(u,d);else if(h.mode===C)p=new i.Line(u,d);else if(h.mode===I)p=new i.LineLoop(u,d);else{if(h.mode!==M)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+h.mode);p=new i.Points(u,d)}Object.keys(p.geometry.morphAttributes).length>0&&X(p,o),p.name=e.createUniqueName(o.name||"mesh_"+t),q(p,o),h.extensions&&W(r,p,h),e.assignFinalMaterial(p),c.push(p)}if(1===c.length)return c[0];const u=new i.Group;for(let t=0,e=c.length;t<e;t++)u.add(c[t]);return u}))}loadCamera(t){let e;const n=this.json.cameras[t],r=n[n.type];if(r)return"perspective"===n.type?e=new i.PerspectiveCamera(i.MathUtils.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):"orthographic"===n.type&&(e=new i.OrthographicCamera(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),n.name&&(e.name=this.createUniqueName(n.name)),q(e,n),Promise.resolve(e);console.warn("THREE.GLTFLoader: Missing camera parameters.")}loadSkin(t){const e=this.json.skins[t],i={joints:e.joints};return void 0===e.inverseBindMatrices?Promise.resolve(i):this.getDependency("accessor",e.inverseBindMatrices).then((function(t){return i.inverseBindMatrices=t,i}))}loadAnimation(t){const e=this.json.animations[t],n=[],r=[],o=[],s=[],a=[];for(let t=0,i=e.channels.length;t<i;t++){const i=e.channels[t],l=e.samplers[i.sampler],c=i.target,u=void 0!==c.node?c.node:c.id,h=void 0!==e.parameters?e.parameters[l.input]:l.input,p=void 0!==e.parameters?e.parameters[l.output]:l.output;n.push(this.getDependency("node",u)),r.push(this.getDependency("accessor",h)),o.push(this.getDependency("accessor",p)),s.push(l),a.push(c)}return Promise.all([Promise.all(n),Promise.all(r),Promise.all(o),Promise.all(s),Promise.all(a)]).then((function(n){const r=n[0],o=n[1],s=n[2],a=n[3],l=n[4],c=[];for(let t=0,e=r.length;t<e;t++){const e=r[t],n=o[t],u=s[t],h=a[t],p=l[t];if(void 0===e)continue;let d;switch(e.updateMatrix(),e.matrixAutoUpdate=!0,z[p.path]){case z.weights:d=i.NumberKeyframeTrack;break;case z.rotation:d=i.QuaternionKeyframeTrack;break;default:d=i.VectorKeyframeTrack}const f=e.name?e.name:e.uuid,m=void 0!==h.interpolation?F[h.interpolation]:i.InterpolateLinear,g=[];z[p.path]===z.weights?e.traverse((function(t){!0===t.isMesh&&t.morphTargetInfluences&&g.push(t.name?t.name:t.uuid)})):g.push(f);let y=u.array;if(u.normalized){const t=Q(y.constructor),e=new Float32Array(y.length);for(let i=0,n=y.length;i<n;i++)e[i]=y[i]*t;y=e}for(let t=0,e=g.length;t<e;t++){const e=new d(g[t]+"."+z[p.path],n.array,y,m);"CUBICSPLINE"===h.interpolation&&(e.createInterpolant=function(t){return new(this instanceof i.QuaternionKeyframeTrack?S:A)(this.times,this.values,this.getValueSize()/3,t)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),c.push(e)}}const u=e.name?e.name:"animation_"+t;return new i.AnimationClip(u,void 0,c)}))}createNodeMesh(t){const e=this.json,i=this,n=e.nodes[t];return void 0===n.mesh?null:i.getDependency("mesh",n.mesh).then((function(t){const e=i._getNodeRef(i.meshCache,n.mesh,t);return void 0!==n.weights&&e.traverse((function(t){if(t.isMesh)for(let e=0,i=n.weights.length;e<i;e++)t.morphTargetInfluences[e]=n.weights[e]})),e}))}loadNode(t){const e=this.json,n=this.extensions,r=this,o=e.nodes[t],s=o.name?r.createUniqueName(o.name):"";return function(){const e=[],i=r._invokeOne((function(e){return e.createNodeMesh&&e.createNodeMesh(t)}));return i&&e.push(i),void 0!==o.camera&&e.push(r.getDependency("camera",o.camera).then((function(t){return r._getNodeRef(r.cameraCache,o.camera,t)}))),r._invokeAll((function(e){return e.createNodeAttachment&&e.createNodeAttachment(t)})).forEach((function(t){e.push(t)})),Promise.all(e)}().then((function(e){let a;if(a=!0===o.isBone?new i.Bone:e.length>1?new i.Group:1===e.length?e[0]:new i.Object3D,a!==e[0])for(let t=0,i=e.length;t<i;t++)a.add(e[t]);if(o.name&&(a.userData.name=o.name,a.name=s),q(a,o),o.extensions&&W(n,a,o),void 0!==o.matrix){const t=new i.Matrix4;t.fromArray(o.matrix),a.applyMatrix4(t)}else void 0!==o.translation&&a.position.fromArray(o.translation),void 0!==o.rotation&&a.quaternion.fromArray(o.rotation),void 0!==o.scale&&a.scale.fromArray(o.scale);return r.associations.set(a,{type:"nodes",index:t}),a}))}loadScene(t){const e=this.json,n=this.extensions,r=this.json.scenes[t],o=this,s=new i.Group;r.name&&(s.name=o.createUniqueName(r.name)),q(s,r),r.extensions&&W(n,s,r);const a=r.nodes||[],l=[];for(let t=0,i=a.length;t<i;t++)l.push(K(a[t],s,e,o));return Promise.all(l).then((function(){return s}))}}function K(t,e,n,r){const o=n.nodes[t];return r.getDependency("node",t).then((function(t){if(void 0===o.skin)return t;let e;return r.getDependency("skin",o.skin).then((function(t){e=t;const i=[];for(let t=0,n=e.joints.length;t<n;t++)i.push(r.getDependency("node",e.joints[t]));return Promise.all(i)})).then((function(n){return t.traverse((function(t){if(!t.isMesh)return;const r=[],o=[];for(let t=0,s=n.length;t<s;t++){const s=n[t];if(s){r.push(s);const n=new i.Matrix4;void 0!==e.inverseBindMatrices&&n.fromArray(e.inverseBindMatrices.array,16*t),o.push(n)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',e.joints[t])}t.bind(new i.Skeleton(r,o),t.matrixWorld)})),t}))})).then((function(t){e.add(t);const i=[];if(o.children){const e=o.children;for(let o=0,s=e.length;o<s;o++){const s=e[o];i.push(K(s,t,n,r))}}return Promise.all(i)}))}function $(t,e,n){const r=e.attributes,o=[];function s(e,i){return n.getDependency("accessor",e).then((function(e){t.setAttribute(i,e)}))}for(const e in r){const i=B[e]||e.toLowerCase();i in t.attributes||o.push(s(r[e],i))}if(void 0!==e.indices&&!t.index){const i=n.getDependency("accessor",e.indices).then((function(e){t.setIndex(e)}));o.push(i)}return q(t,e),function(t,e,n){const r=e.attributes,o=new i.Box3;if(void 0===r.POSITION)return;{const t=n.json.accessors[r.POSITION],e=t.min,s=t.max;if(void 0===e||void 0===s)return void console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");if(o.set(new i.Vector3(e[0],e[1],e[2]),new i.Vector3(s[0],s[1],s[2])),t.normalized){const e=Q(R[t.componentType]);o.min.multiplyScalar(e),o.max.multiplyScalar(e)}}const s=e.targets;if(void 0!==s){const t=new i.Vector3,e=new i.Vector3;for(let i=0,r=s.length;i<r;i++){const r=s[i];if(void 0!==r.POSITION){const i=n.json.accessors[r.POSITION],o=i.min,s=i.max;if(void 0!==o&&void 0!==s){if(e.setX(Math.max(Math.abs(o[0]),Math.abs(s[0]))),e.setY(Math.max(Math.abs(o[1]),Math.abs(s[1]))),e.setZ(Math.max(Math.abs(o[2]),Math.abs(s[2]))),i.normalized){const t=Q(R[i.componentType]);e.multiplyScalar(t)}t.max(e)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}o.expandByVector(t)}t.boundingBox=o;const a=new i.Sphere;o.getCenter(a.center),a.radius=o.min.distanceTo(o.max)/2,t.boundingSphere=a}(t,e,n),Promise.all(o).then((function(){return void 0!==e.targets?function(t,e,i){let n=!1,r=!1;for(let t=0,i=e.length;t<i;t++){const i=e[t];if(void 0!==i.POSITION&&(n=!0),void 0!==i.NORMAL&&(r=!0),n&&r)break}if(!n&&!r)return Promise.resolve(t);const o=[],s=[];for(let a=0,l=e.length;a<l;a++){const l=e[a];if(n){const e=void 0!==l.POSITION?i.getDependency("accessor",l.POSITION):t.attributes.position;o.push(e)}if(r){const e=void 0!==l.NORMAL?i.getDependency("accessor",l.NORMAL):t.attributes.normal;s.push(e)}}return Promise.all([Promise.all(o),Promise.all(s)]).then((function(e){const i=e[0],o=e[1];return n&&(t.morphAttributes.position=i),r&&(t.morphAttributes.normal=o),t.morphTargetsRelative=!0,t}))}(t,e.targets,n):t}))}function tt(t,e){let n=t.getIndex();if(null===n){const e=[],i=t.getAttribute("position");if(void 0===i)return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t;for(let t=0;t<i.count;t++)e.push(t);t.setIndex(e),n=t.getIndex()}const r=n.count-2,o=[];if(e===i.TriangleFanDrawMode)for(let t=1;t<=r;t++)o.push(n.getX(0)),o.push(n.getX(t)),o.push(n.getX(t+1));else for(let t=0;t<r;t++)t%2==0?(o.push(n.getX(t)),o.push(n.getX(t+1)),o.push(n.getX(t+2))):(o.push(n.getX(t+2)),o.push(n.getX(t+1)),o.push(n.getX(t)));o.length/3!==r&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=t.clone();return s.setIndex(o),s}i.GLTFLoader=t}(),t.exports=i.GLTFLoader}(qd);var Xd=qd.exports,Zd={exports:{}};!function(t,e){const i=ld;!function(){class t extends i.Loader{constructor(t){super(t)}load(t,e,n,r){const o=this,s=""===o.path?i.LoaderUtils.extractUrlBase(t):o.path,a=new i.FileLoader(o.manager);a.setPath(o.path),a.setRequestHeader(o.requestHeader),a.setWithCredentials(o.withCredentials),a.load(t,(function(i){try{e(o.parse(i,s))}catch(e){r?r(e):console.error(e),o.manager.itemError(t)}}),n,r)}parse(t,e){function n(t,e){const i=[],n=t.childNodes;for(let t=0,r=n.length;t<r;t++){const r=n[t];r.nodeName===e&&i.push(r)}return i}function r(t){if(0===t.length)return[];const e=t.trim().split(/\s+/),i=new Array(e.length);for(let t=0,n=e.length;t<n;t++)i[t]=e[t];return i}function o(t){if(0===t.length)return[];const e=t.trim().split(/\s+/),i=new Array(e.length);for(let t=0,n=e.length;t<n;t++)i[t]=parseFloat(e[t]);return i}function s(t){if(0===t.length)return[];const e=t.trim().split(/\s+/),i=new Array(e.length);for(let t=0,n=e.length;t<n;t++)i[t]=parseInt(e[t]);return i}function a(t){return t.substring(1)}function l(t){return 0===Object.keys(t).length}function c(t){return void 0!==t&&!0===t.hasAttribute("meter")?parseFloat(t.getAttribute("meter")):1}function u(t){return void 0!==t?t.textContent:"Y_UP"}function h(t,e,i,r){const o=n(t,e)[0];if(void 0!==o){const t=n(o,i);for(let e=0;e<t.length;e++)r(t[e])}}function p(t,e){for(const i in t){t[i].build=e(t[i])}}function d(t,e){return void 0!==t.build||(t.build=e(t)),t.build}function f(t){const e={inputs:{}};for(let i=0,n=t.childNodes.length;i<n;i++){const n=t.childNodes[i];if(1===n.nodeType&&"input"===n.nodeName){const t=a(n.getAttribute("source")),i=n.getAttribute("semantic");e.inputs[i]=t}}return e}function m(t){const e={};let i=t.getAttribute("target").split("/");const n=i.shift();let r=i.shift();const o=-1!==r.indexOf("("),s=-1!==r.indexOf(".");if(s)i=r.split("."),r=i.shift(),e.member=i.shift();else if(o){const t=r.split("(");r=t.shift();for(let e=0;e<t.length;e++)t[e]=parseInt(t[e].replace(/\)/,""));e.indices=t}return e.id=n,e.sid=r,e.arraySyntax=o,e.memberSyntax=s,e.sampler=a(t.getAttribute("source")),e}function g(t){const e=[],i=t.channels,n=t.samplers,r=t.sources;for(const t in i)if(i.hasOwnProperty(t)){const o=i[t],s=n[o.sampler],a=s.inputs.INPUT,l=s.inputs.OUTPUT;w(v(o,r[a],r[l]),e)}return e}function y(t){return d(Yt.animations[t],g)}function v(t,e,i){const n=Yt.nodes[t.id],r=Nt(n.id),o=n.transforms[t.sid],s=n.matrix.clone().transpose();let a,l,c,u,h,p;const d={};switch(o){case"matrix":for(c=0,u=e.array.length;c<u;c++)if(a=e.array[c],l=c*i.stride,void 0===d[a]&&(d[a]={}),!0===t.arraySyntax){const e=i.array[l],n=t.indices[0]+4*t.indices[1];d[a][n]=e}else for(h=0,p=i.stride;h<p;h++)d[a][h]=i.array[l+h];break;case"translate":case"rotate":case"scale":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',o)}const f=function(t,e){const i=[];for(const e in t)i.push({time:parseFloat(e),value:t[e]});i.sort(n);for(let t=0;t<16;t++)A(i,t,e.elements[t]);return i;function n(t,e){return t.time-e.time}}(d,s);return{name:r.uuid,keyframes:f}}const _=new i.Vector3,x=new i.Vector3,b=new i.Quaternion;function w(t,e){const n=t.keyframes,r=t.name,o=[],s=[],a=[],l=[];for(let t=0,e=n.length;t<e;t++){const e=n[t],i=e.time,r=e.value;St.fromArray(r).transpose(),St.decompose(_,b,x),o.push(i),s.push(_.x,_.y,_.z),a.push(b.x,b.y,b.z,b.w),l.push(x.x,x.y,x.z)}return s.length>0&&e.push(new i.VectorKeyframeTrack(r+".position",o,s)),a.length>0&&e.push(new i.QuaternionKeyframeTrack(r+".quaternion",o,a)),l.length>0&&e.push(new i.VectorKeyframeTrack(r+".scale",o,l)),e}function A(t,e,i){let n,r,o,s=!0;for(r=0,o=t.length;r<o;r++)n=t[r],void 0===n.value[e]?n.value[e]=null:s=!1;if(!0===s)for(r=0,o=t.length;r<o;r++)n=t[r],n.value[e]=i;else!function(t,e){let i,n;for(let r=0,o=t.length;r<o;r++){const o=t[r];if(null===o.value[e]){if(i=E(t,r,e),n=S(t,r,e),null===i){o.value[e]=n.value[e];continue}if(null===n){o.value[e]=i.value[e];continue}M(o,i,n,e)}}}(t,e)}function E(t,e,i){for(;e>=0;){const n=t[e];if(null!==n.value[i])return n;e--}return null}function S(t,e,i){for(;e<t.length;){const n=t[e];if(null!==n.value[i])return n;e++}return null}function M(t,e,i,n){i.time-e.time!=0?t.value[n]=(t.time-e.time)*(i.value[n]-e.value[n])/(i.time-e.time)+e.value[n]:t.value[n]=e.value[n]}function T(t){const e=[],n=t.name,r=t.end-t.start||-1,o=t.animations;for(let t=0,i=o.length;t<i;t++){const i=y(o[t]);for(let t=0,n=i.length;t<n;t++)e.push(i[t])}return new i.AnimationClip(n,r,e)}function I(t){return d(Yt.clips[t],T)}function C(t){const e={sources:{}};for(let i=0,n=t.childNodes.length;i<n;i++){const n=t.childNodes[i];if(1===n.nodeType)switch(n.nodeName){case"bind_shape_matrix":e.bindShapeMatrix=o(n.textContent);break;case"source":const t=n.getAttribute("id");e.sources[t]=ot(n);break;case"joints":e.joints=P(n);break;case"vertex_weights":e.vertexWeights=L(n)}}return e}function P(t){const e={inputs:{}};for(let i=0,n=t.childNodes.length;i<n;i++){const n=t.childNodes[i];if(1===n.nodeType&&"input"===n.nodeName){const t=n.getAttribute("semantic"),i=a(n.getAttribute("source"));e.inputs[t]=i}}return e}function L(t){const e={inputs:{}};for(let i=0,n=t.childNodes.length;i<n;i++){const n=t.childNodes[i];if(1===n.nodeType)switch(n.nodeName){case"input":const t=n.getAttribute("semantic"),i=a(n.getAttribute("source")),r=parseInt(n.getAttribute("offset"));e.inputs[t]={id:i,offset:r};break;case"vcount":e.vcount=s(n.textContent);break;case"v":e.v=s(n.textContent)}}return e}function D(t){const e={id:t.id},n=Yt.geometries[e.id];return void 0!==t.skin&&(e.skin=function(t){const e=4,n={joints:[],indices:{array:[],stride:e},weights:{array:[],stride:e}},r=t.sources,o=t.vertexWeights,s=o.vcount,a=o.v,l=o.inputs.JOINT.offset,c=o.inputs.WEIGHT.offset,u=t.sources[t.joints.inputs.JOINT],h=t.sources[t.joints.inputs.INV_BIND_MATRIX],p=r[o.inputs.WEIGHT.id].array;let d,f,m,g=0;for(d=0,m=s.length;d<m;d++){const t=s[d],i=[];for(f=0;f<t;f++){const t=a[g+l],e=p[a[g+c]];i.push({index:t,weight:e}),g+=2}for(i.sort(y),f=0;f<e;f++){const t=i[f];void 0!==t?(n.indices.array.push(t.index),n.weights.array.push(t.weight)):(n.indices.array.push(0),n.weights.array.push(0))}}t.bindShapeMatrix?n.bindMatrix=(new i.Matrix4).fromArray(t.bindShapeMatrix).transpose():n.bindMatrix=(new i.Matrix4).identity();for(d=0,m=u.array.length;d<m;d++){const t=u.array[d],e=(new i.Matrix4).fromArray(h.array,d*h.stride).transpose();n.joints.push({name:t,boneInverse:e})}return n;function y(t,e){return e.weight-t.weight}}(t.skin),n.sources.skinIndices=e.skin.indices,n.sources.skinWeights=e.skin.weights),e}function R(t){return void 0!==t.build?t.build:t.init_from}function O(t){const e=Yt.images[t];return void 0!==e?d(e,R):(console.warn("THREE.ColladaLoader: Couldn't find image with ID:",t),null)}function k(t){const e={surfaces:{},samplers:{}};for(let i=0,n=t.childNodes.length;i<n;i++){const n=t.childNodes[i];if(1===n.nodeType)switch(n.nodeName){case"newparam":N(n,e);break;case"technique":e.technique=F(n);break;case"extra":e.extra=W(n)}}return e}function N(t,e){const i=t.getAttribute("sid");for(let n=0,r=t.childNodes.length;n<r;n++){const r=t.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"surface":e.surfaces[i]=B(r);break;case"sampler2D":e.samplers[i]=z(r)}}}function B(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const n=t.childNodes[i];if(1===n.nodeType&&"init_from"===n.nodeName)e.init_from=n.textContent}return e}function z(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const n=t.childNodes[i];if(1===n.nodeType&&"source"===n.nodeName)e.source=n.textContent}return e}function F(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const n=t.childNodes[i];if(1===n.nodeType)switch(n.nodeName){case"constant":case"lambert":case"blinn":case"phong":e.type=n.nodeName,e.parameters=V(n)}}return e}function V(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const n=t.childNodes[i];if(1===n.nodeType)switch(n.nodeName){case"emission":case"diffuse":case"specular":case"bump":case"ambient":case"shininess":case"transparency":e[n.nodeName]=U(n);break;case"transparent":e[n.nodeName]={opaque:n.getAttribute("opaque"),data:U(n)}}}return e}function U(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const n=t.childNodes[i];if(1===n.nodeType)switch(n.nodeName){case"color":e[n.nodeName]=o(n.textContent);break;case"float":e[n.nodeName]=parseFloat(n.textContent);break;case"texture":e[n.nodeName]={id:n.getAttribute("texture"),extra:G(n)}}}return e}function G(t){const e={technique:{}};for(let i=0,n=t.childNodes.length;i<n;i++){const n=t.childNodes[i];if(1===n.nodeType&&"extra"===n.nodeName)j(n,e)}return e}function j(t,e){for(let i=0,n=t.childNodes.length;i<n;i++){const n=t.childNodes[i];if(1===n.nodeType&&"technique"===n.nodeName)H(n,e)}}function H(t,e){for(let i=0,n=t.childNodes.length;i<n;i++){const n=t.childNodes[i];if(1===n.nodeType)switch(n.nodeName){case"repeatU":case"repeatV":case"offsetU":case"offsetV":e.technique[n.nodeName]=parseFloat(n.textContent);break;case"wrapU":case"wrapV":"TRUE"===n.textContent.toUpperCase()?e.technique[n.nodeName]=1:"FALSE"===n.textContent.toUpperCase()?e.technique[n.nodeName]=0:e.technique[n.nodeName]=parseInt(n.textContent)}}}function W(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const n=t.childNodes[i];if(1===n.nodeType&&"technique"===n.nodeName)e.technique=q(n)}return e}function q(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const n=t.childNodes[i];if(1===n.nodeType&&"double_sided"===n.nodeName)e[n.nodeName]=parseInt(n.textContent)}return e}function X(t){return t}function Z(t){const e=(n=t.url,d(Yt.effects[n],X));var n;const r=e.profile.technique,o=e.profile.extra;let s;switch(r.type){case"phong":case"blinn":s=new i.MeshPhongMaterial;break;case"lambert":s=new i.MeshLambertMaterial;break;default:s=new i.MeshBasicMaterial}function a(t){const n=e.profile.samplers[t.id];let r=null;if(void 0!==n){r=O(e.profile.surfaces[n.source].init_from)}else console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),r=O(t.id);if(null!==r){const e=function(t){let e,i=t.slice(2+(t.lastIndexOf(".")-1>>>0));i=i.toLowerCase(),e="tga"===i?Wt:Ht;return e}(r);if(void 0!==e){const n=e.load(r),o=t.extra;if(void 0!==o&&void 0!==o.technique&&!1===l(o.technique)){const t=o.technique;n.wrapS=t.wrapU?i.RepeatWrapping:i.ClampToEdgeWrapping,n.wrapT=t.wrapV?i.RepeatWrapping:i.ClampToEdgeWrapping,n.offset.set(t.offsetU||0,t.offsetV||0),n.repeat.set(t.repeatU||1,t.repeatV||1)}else n.wrapS=i.RepeatWrapping,n.wrapT=i.RepeatWrapping;return n}return console.warn("THREE.ColladaLoader: THREE.Loader for texture %s not found.",r),null}return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",t.id),null}s.name=t.name||"";const c=r.parameters;for(const t in c){const e=c[t];switch(t){case"diffuse":e.color&&s.color.fromArray(e.color),e.texture&&(s.map=a(e.texture));break;case"specular":e.color&&s.specular&&s.specular.fromArray(e.color),e.texture&&(s.specularMap=a(e.texture));break;case"bump":e.texture&&(s.normalMap=a(e.texture));break;case"ambient":e.texture&&(s.lightMap=a(e.texture));break;case"shininess":e.float&&s.shininess&&(s.shininess=e.float);break;case"emission":e.color&&s.emissive&&s.emissive.fromArray(e.color),e.texture&&(s.emissiveMap=a(e.texture))}}let u=c.transparent,h=c.transparency;if(void 0===h&&u&&(h={float:1}),void 0===u&&h&&(u={opaque:"A_ONE",data:{color:[1,1,1,1]}}),u&&h)if(u.data.texture)s.transparent=!0;else{const t=u.data.color;switch(u.opaque){case"A_ONE":s.opacity=t[3]*h.float;break;case"RGB_ZERO":s.opacity=1-t[0]*h.float;break;case"A_ZERO":s.opacity=1-t[3]*h.float;break;case"RGB_ONE":s.opacity=t[0]*h.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',u.opaque)}s.opacity<1&&(s.transparent=!0)}return void 0!==o&&void 0!==o.technique&&1===o.technique.double_sided&&(s.side=i.DoubleSide),s}function Y(t){return d(Yt.materials[t],Z)}function Q(t){for(let e=0;e<t.childNodes.length;e++){const i=t.childNodes[e];if("technique_common"===i.nodeName)return J(i)}return{}}function J(t){const e={};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];switch(n.nodeName){case"perspective":case"orthographic":e.technique=n.nodeName,e.parameters=K(n)}}return e}function K(t){const e={};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];switch(n.nodeName){case"xfov":case"yfov":case"xmag":case"ymag":case"znear":case"zfar":case"aspect_ratio":e[n.nodeName]=parseFloat(n.textContent)}}return e}function $(t){let e;switch(t.optics.technique){case"perspective":e=new i.PerspectiveCamera(t.optics.parameters.yfov,t.optics.parameters.aspect_ratio,t.optics.parameters.znear,t.optics.parameters.zfar);break;case"orthographic":let n=t.optics.parameters.ymag,r=t.optics.parameters.xmag;const o=t.optics.parameters.aspect_ratio;r=void 0===r?n*o:r,n=void 0===n?r/o:n,r*=.5,n*=.5,e=new i.OrthographicCamera(-r,r,n,-n,t.optics.parameters.znear,t.optics.parameters.zfar);break;default:e=new i.PerspectiveCamera}return e.name=t.name||"",e}function tt(t){const e=Yt.cameras[t];return void 0!==e?d(e,$):(console.warn("THREE.ColladaLoader: Couldn't find camera with ID:",t),null)}function et(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const n=t.childNodes[i];if(1===n.nodeType)switch(n.nodeName){case"directional":case"point":case"spot":case"ambient":e.technique=n.nodeName,e.parameters=it(n)}}return e}function it(t){const e={};for(let n=0,r=t.childNodes.length;n<r;n++){const r=t.childNodes[n];if(1===r.nodeType)switch(r.nodeName){case"color":const t=o(r.textContent);e.color=(new i.Color).fromArray(t);break;case"falloff_angle":e.falloffAngle=parseFloat(r.textContent);break;case"quadratic_attenuation":const n=parseFloat(r.textContent);e.distance=n?Math.sqrt(1/n):0}}return e}function nt(t){let e;switch(t.technique){case"directional":e=new i.DirectionalLight;break;case"point":e=new i.PointLight;break;case"spot":e=new i.SpotLight;break;case"ambient":e=new i.AmbientLight}return t.parameters.color&&e.color.copy(t.parameters.color),t.parameters.distance&&(e.distance=t.parameters.distance),e}function rt(t){const e=Yt.lights[t];return void 0!==e?d(e,nt):(console.warn("THREE.ColladaLoader: Couldn't find light with ID:",t),null)}function ot(t){const e={array:[],stride:3};for(let i=0;i<t.childNodes.length;i++){const s=t.childNodes[i];if(1===s.nodeType)switch(s.nodeName){case"float_array":e.array=o(s.textContent);break;case"Name_array":e.array=r(s.textContent);break;case"technique_common":const t=n(s,"accessor")[0];void 0!==t&&(e.stride=parseInt(t.getAttribute("stride")))}}return e}function st(t){const e={};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];1===n.nodeType&&(e[n.getAttribute("semantic")]=a(n.getAttribute("source")))}return e}function at(t){const e={type:t.nodeName,material:t.getAttribute("material"),count:parseInt(t.getAttribute("count")),inputs:{},stride:0,hasUV:!1};for(let i=0,n=t.childNodes.length;i<n;i++){const n=t.childNodes[i];if(1===n.nodeType)switch(n.nodeName){case"input":const t=a(n.getAttribute("source")),i=n.getAttribute("semantic"),r=parseInt(n.getAttribute("offset")),o=parseInt(n.getAttribute("set")),l=o>0?i+o:i;e.inputs[l]={id:t,offset:r},e.stride=Math.max(e.stride,r+1),"TEXCOORD"===i&&(e.hasUV=!0);break;case"vcount":e.vcount=s(n.textContent);break;case"p":e.p=s(n.textContent)}}return e}function lt(t){let e=0;for(let i=0,n=t.length;i<n;i++){!0===t[i].hasUV&&e++}e>0&&e<t.length&&(t.uvsNeedsFix=!0)}function ct(t){const e={},i=t.sources,n=t.vertices,r=t.primitives;if(0===r.length)return{};const o=function(t){const e={};for(let i=0;i<t.length;i++){const n=t[i];void 0===e[n.type]&&(e[n.type]=[]),e[n.type].push(n)}return e}(r);for(const t in o){const r=o[t];lt(r),e[t]=ut(r,i,n)}return e}function ut(t,e,n){const r={},o={array:[],stride:0},s={array:[],stride:0},a={array:[],stride:0},l={array:[],stride:0},c={array:[],stride:0},u=[],h=4,p=[],d=4,f=new i.BufferGeometry,m=[];let g=0;for(let i=0;i<t.length;i++){const r=t[i],h=r.inputs;let d=0;switch(r.type){case"lines":case"linestrips":d=2*r.count;break;case"triangles":d=3*r.count;break;case"polylist":for(let t=0;t<r.count;t++){const e=r.vcount[t];switch(e){case 3:d+=3;break;case 4:d+=6;break;default:d+=3*(e-2)}}break;default:console.warn("THREE.ColladaLoader: Unknow primitive type:",r.type)}f.addGroup(g,d,i),g+=d,r.material&&m.push(r.material);for(const i in h){const d=h[i];switch(i){case"VERTEX":for(const i in n){const h=n[i];switch(i){case"POSITION":const n=o.array.length;if(ht(r,e[h],d.offset,o.array),o.stride=e[h].stride,e.skinWeights&&e.skinIndices&&(ht(r,e.skinIndices,d.offset,u),ht(r,e.skinWeights,d.offset,p)),!1===r.hasUV&&!0===t.uvsNeedsFix){const t=(o.array.length-n)/o.stride;for(let e=0;e<t;e++)a.array.push(0,0)}break;case"NORMAL":ht(r,e[h],d.offset,s.array),s.stride=e[h].stride;break;case"COLOR":ht(r,e[h],d.offset,c.array),c.stride=e[h].stride;break;case"TEXCOORD":ht(r,e[h],d.offset,a.array),a.stride=e[h].stride;break;case"TEXCOORD1":ht(r,e[h],d.offset,l.array),a.stride=e[h].stride;break;default:console.warn('THREE.ColladaLoader: Semantic "%s" not handled in geometry build process.',i)}}break;case"NORMAL":ht(r,e[d.id],d.offset,s.array),s.stride=e[d.id].stride;break;case"COLOR":ht(r,e[d.id],d.offset,c.array),c.stride=e[d.id].stride;break;case"TEXCOORD":ht(r,e[d.id],d.offset,a.array),a.stride=e[d.id].stride;break;case"TEXCOORD1":ht(r,e[d.id],d.offset,l.array),l.stride=e[d.id].stride}}}return o.array.length>0&&f.setAttribute("position",new i.Float32BufferAttribute(o.array,o.stride)),s.array.length>0&&f.setAttribute("normal",new i.Float32BufferAttribute(s.array,s.stride)),c.array.length>0&&f.setAttribute("color",new i.Float32BufferAttribute(c.array,c.stride)),a.array.length>0&&f.setAttribute("uv",new i.Float32BufferAttribute(a.array,a.stride)),l.array.length>0&&f.setAttribute("uv2",new i.Float32BufferAttribute(l.array,l.stride)),u.length>0&&f.setAttribute("skinIndex",new i.Float32BufferAttribute(u,h)),p.length>0&&f.setAttribute("skinWeight",new i.Float32BufferAttribute(p,d)),r.data=f,r.type=t[0].type,r.materialKeys=m,r}function ht(t,e,i,n){const r=t.p,o=t.stride,s=t.vcount;function a(t){let e=r[t+i]*c;const o=e+c;for(;e<o;e++)n.push(l[e])}const l=e.array,c=e.stride;if(void 0!==t.vcount){let t=0;for(let e=0,i=s.length;e<i;e++){const i=s[e];if(4===i){const e=t+1*o,i=t+2*o,n=t+3*o;a(t+0*o),a(e),a(n),a(e),a(i),a(n)}else if(3===i){const e=t+1*o,i=t+2*o;a(t+0*o),a(e),a(i)}else if(i>4)for(let e=1,n=i-2;e<=n;e++){const i=t+o*e,n=t+o*(e+1);a(t+0*o),a(i),a(n)}t+=o*i}}else for(let t=0,e=r.length;t<e;t+=o)a(t)}function pt(t){return d(Yt.geometries[t],ct)}function dt(t){return void 0!==t.build?t.build:t}function ft(t,e){for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(1===n.nodeType)switch(n.nodeName){case"joint":e.joints[n.getAttribute("sid")]=mt(n);break;case"link":e.links.push(yt(n))}}}function mt(t){let e;for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(1===n.nodeType)switch(n.nodeName){case"prismatic":case"revolute":e=gt(n)}}return e}function gt(t){const e={sid:t.getAttribute("sid"),name:t.getAttribute("name")||"",axis:new i.Vector3,limits:{min:0,max:0},type:t.nodeName,static:!1,zeroPosition:0,middlePosition:0};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(1===n.nodeType)switch(n.nodeName){case"axis":const t=o(n.textContent);e.axis.fromArray(t);break;case"limits":const i=n.getElementsByTagName("max")[0],r=n.getElementsByTagName("min")[0];e.limits.max=parseFloat(i.textContent),e.limits.min=parseFloat(r.textContent)}}return e.limits.min>=e.limits.max&&(e.static=!0),e.middlePosition=(e.limits.min+e.limits.max)/2,e}function yt(t){const e={sid:t.getAttribute("sid"),name:t.getAttribute("name")||"",attachments:[],transforms:[]};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(1===n.nodeType)switch(n.nodeName){case"attachment_full":e.attachments.push(vt(n));break;case"matrix":case"translate":case"rotate":e.transforms.push(_t(n))}}return e}function vt(t){const e={joint:t.getAttribute("joint").split("/").pop(),transforms:[],links:[]};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(1===n.nodeType)switch(n.nodeName){case"link":e.links.push(yt(n));break;case"matrix":case"translate":case"rotate":e.transforms.push(_t(n))}}return e}function _t(t){const e={type:t.nodeName},n=o(t.textContent);switch(e.type){case"matrix":e.obj=new i.Matrix4,e.obj.fromArray(n).transpose();break;case"translate":e.obj=new i.Vector3,e.obj.fromArray(n);break;case"rotate":e.obj=new i.Vector3,e.obj.fromArray(n),e.angle=i.MathUtils.degToRad(n[3])}return e}function xt(t,e){for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(1===n.nodeType&&"technique_common"===n.nodeName)bt(n,e)}}function bt(t,e){for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(1===n.nodeType)switch(n.nodeName){case"inertia":e.inertia=o(n.textContent);break;case"mass":e.mass=o(n.textContent)[0]}}}function wt(t){const e={target:t.getAttribute("target").split("/").pop()};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(1===n.nodeType&&"axis"===n.nodeName){const t=n.getElementsByTagName("param")[0];e.axis=t.textContent;const i=e.axis.split("inst_").pop().split("axis")[0];e.jointIndex=i.substr(0,i.length-1)}}return e}function At(t){return void 0!==t.build?t.build:t}function Et(t){const e=[],n=Vt.querySelector('[id="'+t.id+'"]');for(let t=0;t<n.childNodes.length;t++){const r=n.childNodes[t];if(1!==r.nodeType)continue;let s,a;switch(r.nodeName){case"matrix":s=o(r.textContent);const t=(new i.Matrix4).fromArray(s).transpose();e.push({sid:r.getAttribute("sid"),type:r.nodeName,obj:t});break;case"translate":case"scale":s=o(r.textContent),a=(new i.Vector3).fromArray(s),e.push({sid:r.getAttribute("sid"),type:r.nodeName,obj:a});break;case"rotate":s=o(r.textContent),a=(new i.Vector3).fromArray(s);const n=i.MathUtils.degToRad(s[3]);e.push({sid:r.getAttribute("sid"),type:r.nodeName,obj:a,angle:n})}}return e}const St=new i.Matrix4,Mt=new i.Vector3;function Tt(t){const e={name:t.getAttribute("name")||"",type:t.getAttribute("type"),id:t.getAttribute("id"),sid:t.getAttribute("sid"),matrix:new i.Matrix4,nodes:[],instanceCameras:[],instanceControllers:[],instanceLights:[],instanceGeometries:[],instanceNodes:[],transforms:{}};for(let n=0;n<t.childNodes.length;n++){const r=t.childNodes[n];if(1!==r.nodeType)continue;let s;switch(r.nodeName){case"node":e.nodes.push(r.getAttribute("id")),Tt(r);break;case"instance_camera":e.instanceCameras.push(a(r.getAttribute("url")));break;case"instance_controller":e.instanceControllers.push(It(r));break;case"instance_light":e.instanceLights.push(a(r.getAttribute("url")));break;case"instance_geometry":e.instanceGeometries.push(It(r));break;case"instance_node":e.instanceNodes.push(a(r.getAttribute("url")));break;case"matrix":s=o(r.textContent),e.matrix.multiply(St.fromArray(s).transpose()),e.transforms[r.getAttribute("sid")]=r.nodeName;break;case"translate":s=o(r.textContent),Mt.fromArray(s),e.matrix.multiply(St.makeTranslation(Mt.x,Mt.y,Mt.z)),e.transforms[r.getAttribute("sid")]=r.nodeName;break;case"rotate":s=o(r.textContent);const t=i.MathUtils.degToRad(s[3]);e.matrix.multiply(St.makeRotationAxis(Mt.fromArray(s),t)),e.transforms[r.getAttribute("sid")]=r.nodeName;break;case"scale":s=o(r.textContent),e.matrix.scale(Mt.fromArray(s)),e.transforms[r.getAttribute("sid")]=r.nodeName;break;case"extra":break;default:console.log(r)}}return kt(e.id)?console.warn("THREE.ColladaLoader: There is already a node with ID %s. Exclude current node from further processing.",e.id):Yt.nodes[e.id]=e,e}function It(t){const e={id:a(t.getAttribute("url")),materials:{},skeletons:[]};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];switch(n.nodeName){case"bind_material":const t=n.getElementsByTagName("instance_material");for(let i=0;i<t.length;i++){const n=t[i],r=n.getAttribute("symbol"),o=n.getAttribute("target");e.materials[r]=a(o)}break;case"skeleton":e.skeletons.push(a(n.textContent))}}return e}function Ct(t,e){const n=[],r=[];let o,s,a;for(o=0;o<t.length;o++){const i=t[o];let r;if(kt(i))r=Nt(i),Pt(r,e,n);else if(l=i,void 0!==Yt.visualScenes[l]){const t=Yt.visualScenes[i].children;for(let i=0;i<t.length;i++){const r=t[i];if("JOINT"===r.type){Pt(Nt(r.id),e,n)}}}else console.error("THREE.ColladaLoader: Unable to find root bone of skeleton with ID:",i)}var l;for(o=0;o<e.length;o++)for(s=0;s<n.length;s++)if(a=n[s],a.bone.name===e[o].name){r[o]=a,a.processed=!0;break}for(o=0;o<n.length;o++)a=n[o],!1===a.processed&&(r.push(a),a.processed=!0);const c=[],u=[];for(o=0;o<r.length;o++)a=r[o],c.push(a.bone),u.push(a.boneInverse);return new i.Skeleton(c,u)}function Pt(t,e,n){t.traverse((function(t){if(!0===t.isBone){let r;for(let i=0;i<e.length;i++){const n=e[i];if(n.name===t.name){r=n.boneInverse;break}}void 0===r&&(r=new i.Matrix4),n.push({bone:t,boneInverse:r,processed:!1})}}))}function Lt(t){const e=[],n=t.matrix,r=t.nodes,o=t.type,s=t.instanceCameras,a=t.instanceControllers,l=t.instanceLights,c=t.instanceGeometries,u=t.instanceNodes;for(let t=0,i=r.length;t<i;t++)e.push(Nt(r[t]));for(let t=0,i=s.length;t<i;t++){const i=tt(s[t]);null!==i&&e.push(i.clone())}for(let t=0,i=a.length;t<i;t++){const i=a[t],n=(h=i.id,d(Yt.controllers[h],D)),r=Ot(pt(n.id),i.materials),o=Ct(i.skeletons,n.skin.joints);for(let t=0,i=r.length;t<i;t++){const i=r[t];i.isSkinnedMesh&&(i.bind(o,n.skin.bindMatrix),i.normalizeSkinWeights()),e.push(i)}}var h;for(let t=0,i=l.length;t<i;t++){const i=rt(l[t]);null!==i&&e.push(i.clone())}for(let t=0,i=c.length;t<i;t++){const i=c[t],n=Ot(pt(i.id),i.materials);for(let t=0,i=n.length;t<i;t++)e.push(n[t])}for(let t=0,i=u.length;t<i;t++)e.push(Nt(u[t]).clone());let p;if(0===r.length&&1===e.length)p=e[0];else{p="JOINT"===o?new i.Bone:new i.Group;for(let t=0;t<e.length;t++)p.add(e[t])}return p.name="JOINT"===o?t.sid:t.name,p.matrix.copy(n),p.matrix.decompose(p.position,p.quaternion,p.scale),p}const Dt=new i.MeshBasicMaterial({color:16711935});function Rt(t,e){const i=[];for(let n=0,r=t.length;n<r;n++){const r=e[t[n]];void 0===r?(console.warn("THREE.ColladaLoader: Material with key %s not found. Apply fallback material.",t[n]),i.push(Dt)):i.push(Y(r))}return i}function Ot(t,e){const n=[];for(const r in t){const o=t[r],s=Rt(o.materialKeys,e);0===s.length&&("lines"===r||"linestrips"===r?s.push(new i.LineBasicMaterial):s.push(new i.MeshPhongMaterial));const a=void 0!==o.data.attributes.skinIndex,l=1===s.length?s[0]:s;let c;switch(r){case"lines":c=new i.LineSegments(o.data,l);break;case"linestrips":c=new i.Line(o.data,l);break;case"triangles":case"polylist":c=a?new i.SkinnedMesh(o.data,l):new i.Mesh(o.data,l)}n.push(c)}return n}function kt(t){return void 0!==Yt.nodes[t]}function Nt(t){return d(Yt.nodes[t],Lt)}function Bt(t){const e=new i.Group;e.name=t.name;const n=t.children;for(let t=0;t<n.length;t++){const i=n[t];e.add(Nt(i.id))}return e}function zt(t){return d(Yt.visualScenes[t],Bt)}if(0===t.length)return{scene:new i.Scene};const Ft=(new DOMParser).parseFromString(t,"application/xml"),Vt=n(Ft,"COLLADA")[0],Ut=Ft.getElementsByTagName("parsererror")[0];if(void 0!==Ut){const t=n(Ut,"div")[0];let e;return e=t?t.textContent:function(t){let e="";const i=[t];for(;i.length;){const t=i.shift();t.nodeType===Node.TEXT_NODE?e+=t.textContent:(e+="\n",i.push.apply(i,t.childNodes))}return e.trim()}(Ut),console.error("THREE.ColladaLoader: Failed to parse collada file.\n",e),null}const Gt=Vt.getAttribute("version");console.log("THREE.ColladaLoader: File version",Gt);const jt=function(t){return{unit:c(n(t,"unit")[0]),upAxis:u(n(t,"up_axis")[0])}}(n(Vt,"asset")[0]),Ht=new i.TextureLoader(this.manager);let Wt;Ht.setPath(this.resourcePath||e).setCrossOrigin(this.crossOrigin),i.TGALoader&&(Wt=new i.TGALoader(this.manager),Wt.setPath(this.resourcePath||e));const qt=[];let Xt={},Zt=0;const Yt={animations:{},clips:{},controllers:{},images:{},effects:{},materials:{},cameras:{},lights:{},geometries:{},nodes:{},visualScenes:{},kinematicsModels:{},physicsModels:{},kinematicsScenes:{}};h(Vt,"library_animations","animation",(function t(e){const n={sources:{},samplers:{},channels:{}};let r=!1;for(let i=0,o=e.childNodes.length;i<o;i++){const o=e.childNodes[i];if(1!==o.nodeType)continue;let s;switch(o.nodeName){case"source":s=o.getAttribute("id"),n.sources[s]=ot(o);break;case"sampler":s=o.getAttribute("id"),n.samplers[s]=f(o);break;case"channel":s=o.getAttribute("target"),n.channels[s]=m(o);break;case"animation":t(o),r=!0;break;default:console.log(o)}}!1===r&&(Yt.animations[e.getAttribute("id")||i.MathUtils.generateUUID()]=n)})),h(Vt,"library_animation_clips","animation_clip",(function(t){const e={name:t.getAttribute("id")||"default",start:parseFloat(t.getAttribute("start")||0),end:parseFloat(t.getAttribute("end")||0),animations:[]};for(let i=0,n=t.childNodes.length;i<n;i++){const n=t.childNodes[i];if(1===n.nodeType&&"instance_animation"===n.nodeName)e.animations.push(a(n.getAttribute("url")))}Yt.clips[t.getAttribute("id")]=e})),h(Vt,"library_controllers","controller",(function(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const n=t.childNodes[i];if(1===n.nodeType)switch(n.nodeName){case"skin":e.id=a(n.getAttribute("source")),e.skin=C(n);break;case"morph":e.id=a(n.getAttribute("source")),console.warn("THREE.ColladaLoader: Morph target animation not supported yet.")}}Yt.controllers[t.getAttribute("id")]=e})),h(Vt,"library_images","image",(function(t){const e={init_from:n(t,"init_from")[0].textContent};Yt.images[t.getAttribute("id")]=e})),h(Vt,"library_effects","effect",(function(t){const e={};for(let i=0,n=t.childNodes.length;i<n;i++){const n=t.childNodes[i];if(1===n.nodeType&&"profile_COMMON"===n.nodeName)e.profile=k(n)}Yt.effects[t.getAttribute("id")]=e})),h(Vt,"library_materials","material",(function(t){const e={name:t.getAttribute("name")};for(let i=0,n=t.childNodes.length;i<n;i++){const n=t.childNodes[i];if(1===n.nodeType&&"instance_effect"===n.nodeName)e.url=a(n.getAttribute("url"))}Yt.materials[t.getAttribute("id")]=e})),h(Vt,"library_cameras","camera",(function(t){const e={name:t.getAttribute("name")};for(let i=0,n=t.childNodes.length;i<n;i++){const n=t.childNodes[i];if(1===n.nodeType&&"optics"===n.nodeName)e.optics=Q(n)}Yt.cameras[t.getAttribute("id")]=e})),h(Vt,"library_lights","light",(function(t){let e={};for(let i=0,n=t.childNodes.length;i<n;i++){const n=t.childNodes[i];if(1===n.nodeType&&"technique_common"===n.nodeName)e=et(n)}Yt.lights[t.getAttribute("id")]=e})),h(Vt,"library_geometries","geometry",(function(t){const e={name:t.getAttribute("name"),sources:{},vertices:{},primitives:[]},i=n(t,"mesh")[0];if(void 0!==i){for(let t=0;t<i.childNodes.length;t++){const n=i.childNodes[t];if(1!==n.nodeType)continue;const r=n.getAttribute("id");switch(n.nodeName){case"source":e.sources[r]=ot(n);break;case"vertices":e.vertices=st(n);break;case"polygons":console.warn("THREE.ColladaLoader: Unsupported primitive type: ",n.nodeName);break;case"lines":case"linestrips":case"polylist":case"triangles":e.primitives.push(at(n));break;default:console.log(n)}}Yt.geometries[t.getAttribute("id")]=e}})),h(Vt,"library_nodes","node",Tt),h(Vt,"library_visual_scenes","visual_scene",(function(t){const e={name:t.getAttribute("name"),children:[]};!function(t){const e=t.getElementsByTagName("node");for(let t=0;t<e.length;t++){const i=e[t];!1===i.hasAttribute("id")&&i.setAttribute("id","three_default_"+Zt++)}}(t);const i=n(t,"node");for(let t=0;t<i.length;t++)e.children.push(Tt(i[t]));Yt.visualScenes[t.getAttribute("id")]=e})),h(Vt,"library_kinematics_models","kinematics_model",(function(t){const e={name:t.getAttribute("name")||"",joints:{},links:[]};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(1===n.nodeType&&"technique_common"===n.nodeName)ft(n,e)}Yt.kinematicsModels[t.getAttribute("id")]=e})),h(Vt,"library_physics_models","physics_model",(function(t){const e={name:t.getAttribute("name")||"",rigidBodies:{}};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(1===n.nodeType&&"rigid_body"===n.nodeName)e.rigidBodies[n.getAttribute("name")]={},xt(n,e.rigidBodies[n.getAttribute("name")])}Yt.physicsModels[t.getAttribute("id")]=e})),h(Vt,"scene","instance_kinematics_scene",(function(t){const e={bindJointAxis:[]};for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i];if(1===n.nodeType&&"bind_joint_axis"===n.nodeName)e.bindJointAxis.push(wt(n))}Yt.kinematicsScenes[a(t.getAttribute("url"))]=e})),p(Yt.animations,g),p(Yt.clips,T),p(Yt.controllers,D),p(Yt.images,R),p(Yt.effects,X),p(Yt.materials,Z),p(Yt.cameras,$),p(Yt.lights,nt),p(Yt.geometries,ct),p(Yt.visualScenes,Bt),function(){const t=Yt.clips;if(!0===l(t)){if(!1===l(Yt.animations)){const t=[];for(const e in Yt.animations){const i=y(e);for(let e=0,n=i.length;e<n;e++)t.push(i[e])}qt.push(new i.AnimationClip("default",-1,t))}}else for(const e in t)qt.push(I(e))}(),function(){const t=Object.keys(Yt.kinematicsModels)[0],e=Object.keys(Yt.kinematicsScenes)[0],n=Object.keys(Yt.visualScenes)[0];if(void 0===t||void 0===e)return;const r=(o=t,d(Yt.kinematicsModels[o],dt));var o;const s=function(t){return d(Yt.kinematicsScenes[t],At)}(e),a=zt(n),l=s.bindJointAxis,c={};for(let t=0,e=l.length;t<e;t++){const e=l[t],i=Vt.querySelector('[sid="'+e.target+'"]');if(i){const t=i.parentElement;u(e.jointIndex,t)}}function u(t,e){const i=e.getAttribute("name"),n=r.joints[t];a.traverse((function(r){r.name===i&&(c[t]={object:r,transforms:Et(e),joint:n,position:n.zeroPosition})}))}const h=new i.Matrix4;Xt={joints:r&&r.joints,getJointValue:function(t){const e=c[t];if(e)return e.position;console.warn("THREE.ColladaLoader: Joint "+t+" doesn't exist.")},setJointValue:function(t,e){const n=c[t];if(n){const r=n.joint;if(e>r.limits.max||e<r.limits.min)console.warn("THREE.ColladaLoader: Joint "+t+" value "+e+" outside of limits (min: "+r.limits.min+", max: "+r.limits.max+").");else if(r.static)console.warn("THREE.ColladaLoader: Joint "+t+" is static.");else{const o=n.object,s=r.axis,a=n.transforms;St.identity();for(let n=0;n<a.length;n++){const o=a[n];if(o.sid&&-1!==o.sid.indexOf(t))switch(r.type){case"revolute":St.multiply(h.makeRotationAxis(s,i.MathUtils.degToRad(e)));break;case"prismatic":St.multiply(h.makeTranslation(s.x*e,s.y*e,s.z*e));break;default:console.warn("THREE.ColladaLoader: Unknown joint type: "+r.type)}else switch(o.type){case"matrix":St.multiply(o.obj);break;case"translate":St.multiply(h.makeTranslation(o.obj.x,o.obj.y,o.obj.z));break;case"scale":St.scale(o.obj);break;case"rotate":St.multiply(h.makeRotationAxis(o.obj,o.angle))}}o.matrix.copy(St),o.matrix.decompose(o.position,o.quaternion,o.scale),c[t].position=e}}else console.log("THREE.ColladaLoader: "+t+" does not exist.")}}}();const Qt=function(t){return zt(a(n(t,"instance_visual_scene")[0].getAttribute("url")))}(n(Vt,"scene")[0]);return Qt.animations=qt,"Z_UP"===jt.upAxis&&Qt.quaternion.setFromEuler(new i.Euler(-Math.PI/2,0,0)),Qt.scale.multiplyScalar(jt.unit),{get animations(){return console.warn("THREE.ColladaLoader: Please access animations over scene.animations now."),qt},kinematics:Xt,library:Yt,scene:Qt}}}i.ColladaLoader=t}(),t.exports=i.ColladaLoader}(Zd);var Yd=Zd.exports;!function(t,e){const i=md,n=Md,r=Ud,o=Wd,s=Xd,a=Yd,l=new Fd,c=new r,u=new s,h=new o,p=new a;t.exports=function(t,e,r){if(void 0===t)return console.error("Invalid options provided to loadObj()");let o;switch((t=i._validate(t,n.prototype._defaults.loadObj)).type||(t.type="mtl"),t.type){case"mtl":o=l;break;case"gltf":case"glb":o=u;break;case"fbx":o=h;break;case"dae":o=p}c.load(t.mtl,(function(s){s&&"mtl"==t.type&&(s.preload(),o.setMaterials(s));o.load(t.obj,(o=>{let s=[];switch(t.type){case"mtl":o=o.children[0];break;case"gltf":case"glb":case"dae":s=o.animations,o=o.scene;break;case"fbx":s=o.animations}o.animations=s;const a=i.types.rotation(t.rotation,[0,0,0]),l=i.types.scale(t.scale,[1,1,1]);o.rotation.set(a[0],a[1],a[2]),o.scale.set(l[0],l[1],l[2]),t.normalize&&o.traverse((function(t){if(t.isMesh){let e;"MeshStandardMaterial"==t.material.type?(t.material.metalness&&(t.material.metalness*=.1),t.material.glossiness&&(t.material.glossiness*=.25),e=new THREE.Color(12,12,12)):"MeshPhongMaterial"==t.material.type&&(t.material.shininess=.1,e=new THREE.Color(20,20,20)),t.material.specular&&t.material.specular.isColor&&(t.material.specular=e)}})),o.name="model";let c=n.prototype._makeGroup(o,t);n.prototype._addMethods(c),c.setAnchor(t.anchor),c.setCenter(t.adjustment),c.raycasted=t.raycasted,r(c),e(c),c.setFixedZoom(t.mapScale),c.idle()}),(()=>null),(e=>{console.error("Could not load model file: "+t.obj+" \n "+e.stack),r("Error loading the model")}))}),(()=>null),(t=>{console.warn("No material file found "+t.stack)}))}}(Bd);var Qd=Bd.exports,Jd={exports:{}};!function(t,e){const i=ld,n=md,r=Md;function o(t){t=n._validate(t,r.prototype._defaults.line);var e=n.lnglatsToWorld(t.geometry),s=n.normalizeVertices(e),a=n.flattenVectors(s.vertices),l=new i.LineGeometry;l.setPositions(a);let c=new i.LineMaterial({color:t.color,linewidth:t.width,dashed:!1,opacity:t.opacity});return c.resolution.set(window.innerWidth,window.innerHeight),c.isMaterial=!0,c.transparent=!0,c.depthWrite=!1,(o=new i.Line2(l,c)).position.copy(s.position),o.computeLineDistances(),o}t.exports=o,function(){const t=new i.Box3,e=new i.Vector3;class n extends i.InstancedBufferGeometry{constructor(){super(),this.type="LineSegmentsGeometry";this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new i.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new i.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(t){const e=this.attributes.instanceStart,i=this.attributes.instanceEnd;return void 0!==e&&(e.applyMatrix4(t),i.applyMatrix4(t),e.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}setPositions(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));const n=new i.InstancedInterleavedBuffer(e,6,1);return this.setAttribute("instanceStart",new i.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceEnd",new i.InterleavedBufferAttribute(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));const n=new i.InstancedInterleavedBuffer(e,6,1);return this.setAttribute("instanceColorStart",new i.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceColorEnd",new i.InterleavedBufferAttribute(n,3,3)),this}fromWireframeGeometry(t){return this.setPositions(t.attributes.position.array),this}fromEdgesGeometry(t){return this.setPositions(t.attributes.position.array),this}fromMesh(t){return this.fromWireframeGeometry(new i.WireframeGeometry(t.geometry)),this}fromLineSegments(t){const e=t.geometry;if(!e.isGeometry)return e.isBufferGeometry&&this.setPositions(e.attributes.position.array),this;console.error("THREE.LineSegmentsGeometry no longer supports Geometry. Use THREE.BufferGeometry instead.")}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new i.Box3);const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;void 0!==e&&void 0!==n&&(this.boundingBox.setFromBufferAttribute(e),t.setFromBufferAttribute(n),this.boundingBox.union(t))}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new i.Sphere),null===this.boundingBox&&this.computeBoundingBox();const t=this.attributes.instanceStart,n=this.attributes.instanceEnd;if(void 0!==t&&void 0!==n){const i=this.boundingSphere.center;this.boundingBox.getCenter(i);let r=0;for(let o=0,s=t.count;o<s;o++)e.fromBufferAttribute(t,o),r=Math.max(r,i.distanceToSquared(e)),e.fromBufferAttribute(n,o),r=Math.max(r,i.distanceToSquared(e));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(t){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(t)}}n.prototype.isLineSegmentsGeometry=!0,i.LineSegmentsGeometry=n}(),function(){class t extends i.LineSegmentsGeometry{constructor(){super(),this.type="LineGeometry"}setPositions(t){for(var e=t.length-3,i=new Float32Array(2*e),n=0;n<e;n+=3)i[2*n]=t[n],i[2*n+1]=t[n+1],i[2*n+2]=t[n+2],i[2*n+3]=t[n+3],i[2*n+4]=t[n+4],i[2*n+5]=t[n+5];return super.setPositions(i),this}setColors(t){for(var e=t.length-3,i=new Float32Array(2*e),n=0;n<e;n+=3)i[2*n]=t[n],i[2*n+1]=t[n+1],i[2*n+2]=t[n+2],i[2*n+3]=t[n+3],i[2*n+4]=t[n+4],i[2*n+5]=t[n+5];return super.setColors(i),this}fromLine(t){var e=t.geometry;if(!e.isGeometry)return e.isBufferGeometry&&this.setPositions(e.attributes.position.array),this;console.error("THREE.LineGeometry no longer supports Geometry. Use THREE.BufferGeometry instead.")}}t.prototype.isLineGeometry=!0,i.LineGeometry=t}(),function(){class t extends i.LineSegmentsGeometry{constructor(t){super(),this.type="WireframeGeometry2",this.fromWireframeGeometry(new i.WireframeGeometry(t))}}t.prototype.isWireframeGeometry2=!0,i.WireframeGeometry2=t}(),function(){i.UniformsLib.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new i.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}},i.ShaderLib.line={uniforms:i.UniformsUtils.merge([i.UniformsLib.common,i.UniformsLib.fog,i.UniformsLib.line]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\tvarying vec2 vUv;\n\t\tvarying vec4 worldPos;\n\t\tvarying vec3 worldStart;\n\t\tvarying vec3 worldEnd;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\tworldStart = start.xyz;\n\t\t\tworldEnd = end.xyz;\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec3 ndcStart = clipStart.xyz / clipStart.w;\n\t\t\tvec3 ndcEnd = clipEnd.xyz / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd.xy - ndcStart.xy;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t// get the offset direction as perpendicular to the view vector\n\t\t\t\tvec3 worldDir = normalize( end.xyz - start.xyz );\n\t\t\t\tvec3 offset;\n\t\t\t\tif ( position.y < 0.5 ) {\n\n\t\t\t\t\toffset = normalize( cross( start.xyz, worldDir ) );\n\n\t\t\t\t} else {\n\n\t\t\t\t\toffset = normalize( cross( end.xyz, worldDir ) );\n\n\t\t\t\t}\n\n\t\t\t\t// sign flip\n\t\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t\tfloat forwardOffset = dot( worldDir, vec3( 0.0, 0.0, 1.0 ) );\n\n\t\t\t\t// don't extend the line if we're rendering dashes because we\n\t\t\t\t// won't be rendering the endcaps\n\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t// extend the line bounds to encompass endcaps\n\t\t\t\t\tstart.xyz += - worldDir * linewidth * 0.5;\n\t\t\t\t\tend.xyz += worldDir * linewidth * 0.5;\n\n\t\t\t\t\t// shift the position of the quad so it hugs the forward edge of the line\n\t\t\t\t\toffset.xy -= dir * forwardOffset;\n\t\t\t\t\toffset.z += 0.5;\n\n\t\t\t\t#endif\n\n\t\t\t\t// endcaps\n\t\t\t\tif ( position.y > 1.0 || position.y < 0.0 ) {\n\n\t\t\t\t\toffset.xy += dir * 2.0 * forwardOffset;\n\n\t\t\t\t}\n\n\t\t\t\t// adjust for linewidth\n\t\t\t\toffset *= linewidth * 0.5;\n\n\t\t\t\t// set the world position\n\t\t\t\tworldPos = ( position.y < 0.5 ) ? start : end;\n\t\t\t\tworldPos.xyz += offset;\n\n\t\t\t\t// project the worldpos\n\t\t\t\tvec4 clip = projectionMatrix * worldPos;\n\n\t\t\t\t// shift the depth of the projected points so the line\n\t\t\t\t// segements overlap neatly\n\t\t\t\tvec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;\n\t\t\t\tclip.z = clipPose.z * clip.w;\n\n\t\t\t#else\n\n\t\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\t\t\t\t// undo aspect ratio adjustment\n\t\t\t\tdir.x /= aspect;\n\t\t\t\toffset.x /= aspect;\n\n\t\t\t\t// sign flip\n\t\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t\t// endcaps\n\t\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\t\toffset += - dir;\n\n\t\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\t\toffset += dir;\n\n\t\t\t\t}\n\n\t\t\t\t// adjust for linewidth\n\t\t\t\toffset *= linewidth;\n\n\t\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\t\toffset /= resolution.y;\n\n\t\t\t\t// select end\n\t\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t\t// back to clip space\n\t\t\t\toffset *= clip.w;\n\n\t\t\t\tclip.xy += offset;\n\n\t\t\t#endif\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\t\tuniform float linewidth;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\t\tvarying vec4 worldPos;\n\t\tvarying vec3 worldStart;\n\t\tvarying vec3 worldEnd;\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvarying vec2 vUv;\n\n\t\tvec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {\n\n\t\t\tfloat mua;\n\t\t\tfloat mub;\n\n\t\t\tvec3 p13 = p1 - p3;\n\t\t\tvec3 p43 = p4 - p3;\n\n\t\t\tvec3 p21 = p2 - p1;\n\n\t\t\tfloat d1343 = dot( p13, p43 );\n\t\t\tfloat d4321 = dot( p43, p21 );\n\t\t\tfloat d1321 = dot( p13, p21 );\n\t\t\tfloat d4343 = dot( p43, p43 );\n\t\t\tfloat d2121 = dot( p21, p21 );\n\n\t\t\tfloat denom = d2121 * d4343 - d4321 * d4321;\n\n\t\t\tfloat numer = d1343 * d4321 - d1321 * d4343;\n\n\t\t\tmua = numer / denom;\n\t\t\tmua = clamp( mua, 0.0, 1.0 );\n\t\t\tmub = ( d1343 + d4321 * ( mua ) ) / d4343;\n\t\t\tmub = clamp( mub, 0.0, 1.0 );\n\n\t\t\treturn vec2( mua, mub );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tfloat alpha = opacity;\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t// Find the closest points on the view ray and the line segment\n\t\t\t\tvec3 rayEnd = normalize( worldPos.xyz ) * 1e5;\n\t\t\t\tvec3 lineDir = worldEnd - worldStart;\n\t\t\t\tvec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );\n\n\t\t\t\tvec3 p1 = worldStart + lineDir * params.x;\n\t\t\t\tvec3 p2 = rayEnd * params.y;\n\t\t\t\tvec3 delta = p1 - p2;\n\t\t\t\tfloat len = length( delta );\n\t\t\t\tfloat norm = len / linewidth;\n\n\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t#ifdef ALPHA_TO_COVERAGE\n\n\t\t\t\t\t\tfloat dnorm = fwidth( norm );\n\t\t\t\t\t\talpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\tif ( norm > 0.5 ) {\n\n\t\t\t\t\t\t\tdiscard;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t#endif\n\n\t\t\t\t#endif\n\n\t\t\t#else\n\n\t\t\t\t#ifdef ALPHA_TO_COVERAGE\n\n\t\t\t\t\t// artifacts appear on some hardware if a derivative is taken within a conditional\n\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\tfloat len2 = a * a + b * b;\n\t\t\t\t\tfloat dlen = fwidth( len2 );\n\n\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\talpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t#else\n\n\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t\t\t}\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, alpha );\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, alpha );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <encodings_fragment>\n\t\t\t#include <fog_fragment>\n\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t}\n\t\t"};class t extends i.ShaderMaterial{constructor(t){super({type:"LineMaterial",uniforms:i.UniformsUtils.clone(i.ShaderLib.line.uniforms),vertexShader:i.ShaderLib.line.vertexShader,fragmentShader:i.ShaderLib.line.fragmentShader,clipping:!0}),Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(t){!0===t?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashed:{enumerable:!0,get:function(){return Boolean("USE_DASH"in this.defines)},set(t){Boolean(t)!==Boolean("USE_DASH"in this.defines)&&(this.needsUpdate=!0),!0===t?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},alphaToCoverage:{enumerable:!0,get:function(){return Boolean("ALPHA_TO_COVERAGE"in this.defines)},set:function(t){Boolean(t)!==Boolean("ALPHA_TO_COVERAGE"in this.defines)&&(this.needsUpdate=!0),!0===t?(this.defines.ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(t)}}t.prototype.isLineMaterial=!0,i.LineMaterial=t}(),function(){const t=new i.Vector3,e=new i.Vector3,n=new i.Vector4,r=new i.Vector4,o=new i.Vector4,s=new i.Vector3,a=new i.Matrix4,l=new i.Line3,c=new i.Vector3,u=new i.Box3,h=new i.Sphere,p=new i.Vector4;class d extends i.Mesh{constructor(t=new i.LineSegmentsGeometry,e=new i.LineMaterial({color:16777215*Math.random()})){super(t,e),this.type="LineSegments2"}computeLineDistances(){const n=this.geometry,r=n.attributes.instanceStart,o=n.attributes.instanceEnd,s=new Float32Array(2*r.count);for(let i=0,n=0,a=r.count;i<a;i++,n+=2)t.fromBufferAttribute(r,i),e.fromBufferAttribute(o,i),s[n]=0===n?0:s[n-1],s[n+1]=s[n]+t.distanceTo(e);const a=new i.InstancedInterleavedBuffer(s,2,1);return n.setAttribute("instanceDistanceStart",new i.InterleavedBufferAttribute(a,1,0)),n.setAttribute("instanceDistanceEnd",new i.InterleavedBufferAttribute(a,1,1)),this}raycast(t,e){null===t.camera&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');const d=void 0!==t.params.Line2&&t.params.Line2.threshold||0,f=t.ray,m=t.camera,g=m.projectionMatrix,y=this.matrixWorld,v=this.geometry,_=this.material,x=_.resolution,b=_.linewidth+d,w=v.attributes.instanceStart,A=v.attributes.instanceEnd,E=-m.near,S=2*Math.max(b/x.width,b/x.height);null===v.boundingSphere&&v.computeBoundingSphere(),h.copy(v.boundingSphere).applyMatrix4(y);const M=Math.max(m.near,h.distanceToPoint(f.origin));p.set(0,0,-M,1).applyMatrix4(m.projectionMatrix),p.multiplyScalar(1/p.w),p.applyMatrix4(m.projectionMatrixInverse);const T=.5*Math.abs(S/p.w);if(h.radius+=T,!1===t.ray.intersectsSphere(h))return;null===v.boundingBox&&v.computeBoundingBox(),u.copy(v.boundingBox).applyMatrix4(y);const I=Math.max(m.near,u.distanceToPoint(f.origin));p.set(0,0,-I,1).applyMatrix4(m.projectionMatrix),p.multiplyScalar(1/p.w),p.applyMatrix4(m.projectionMatrixInverse);const C=.5*Math.abs(S/p.w);if(u.max.x+=C,u.max.y+=C,u.max.z+=C,u.min.x-=C,u.min.y-=C,u.min.z-=C,!1!==t.ray.intersectsBox(u)){f.at(1,o),o.w=1,o.applyMatrix4(m.matrixWorldInverse),o.applyMatrix4(g),o.multiplyScalar(1/o.w),o.x*=x.x/2,o.y*=x.y/2,o.z=0,s.copy(o),a.multiplyMatrices(m.matrixWorldInverse,y);for(let t=0,o=w.count;t<o;t++){if(n.fromBufferAttribute(w,t),r.fromBufferAttribute(A,t),n.w=1,r.w=1,n.applyMatrix4(a),r.applyMatrix4(a),n.z>E&&r.z>E)continue;if(n.z>E){const t=n.z-r.z,e=(n.z-E)/t;n.lerp(r,e)}else if(r.z>E){const t=r.z-n.z,e=(r.z-E)/t;r.lerp(n,e)}n.applyMatrix4(g),r.applyMatrix4(g),n.multiplyScalar(1/n.w),r.multiplyScalar(1/r.w),n.x*=x.x/2,n.y*=x.y/2,r.x*=x.x/2,r.y*=x.y/2,l.start.copy(n),l.start.z=0,l.end.copy(r),l.end.z=0;const o=l.closestPointToPointParameter(s,!0);l.at(o,c);const u=i.MathUtils.lerp(n.z,r.z,o),h=u>=-1&&u<=1,p=s.distanceTo(c)<.5*b;if(h&&p){l.start.fromBufferAttribute(w,t),l.end.fromBufferAttribute(A,t),l.start.applyMatrix4(y),l.end.applyMatrix4(y);const n=new i.Vector3,r=new i.Vector3;f.distanceSqToSegment(l.start,l.end,r,n),e.push({point:r,pointOnLine:n,distance:f.origin.distanceTo(r),object:this,face:null,faceIndex:t,uv:null,uv2:null})}}}}}d.prototype.LineSegments2=!0,i.LineSegments2=d}(),function(){class t extends i.LineSegments2{constructor(t=new i.LineGeometry,e=new i.LineMaterial({color:16777215*Math.random()})){super(t,e),this.type="Line2"}}t.prototype.isLine2=!0,i.Line2=t}(),function(){const t=new i.Vector3,e=new i.Vector3;class n extends i.Mesh{constructor(t=new i.LineSegmentsGeometry,e=new i.LineMaterial({color:16777215*Math.random()})){super(t,e),this.type="Wireframe"}computeLineDistances(){const n=this.geometry,r=n.attributes.instanceStart,o=n.attributes.instanceEnd,s=new Float32Array(2*r.count);for(let i=0,n=0,a=r.count;i<a;i++,n+=2)t.fromBufferAttribute(r,i),e.fromBufferAttribute(o,i),s[n]=0===n?0:s[n-1],s[n+1]=s[n]+t.distanceTo(e);const a=new i.InstancedInterleavedBuffer(s,2,1);return n.setAttribute("instanceDistanceStart",new i.InterleavedBufferAttribute(a,1,0)),n.setAttribute("instanceDistanceEnd",new i.InterleavedBufferAttribute(a,1,1)),this}}n.prototype.isWireframe=!0,i.Wireframe=n}()}(Jd);var Kd=Jd.exports,$d={exports:{}};!function(t,e){const i=md,n=bd,r=Md,o=ld,s=Cd;t.exports=function(t,e){t=i._validate(t,r.prototype._defaults.tube);let a=[];t.geometry.forEach((t=>{a.push(new o.Vector3(t[0],t[1],t[2]))}));const l=new o.CatmullRomCurve3(a);let c=new o.TubeGeometry(l,a.length,t.radius,t.sides,!1),u=n(t),h=new o.Mesh(c,u);return new s({obj:h,units:t.units,anchor:t.anchor,adjustment:t.adjustment,bbox:t.bbox,tooltip:t.tooltip,raycasted:t.raycasted})}}($d);var tf=$d.exports,ef={exports:{}};!function(t,e){const i=Sd;t.exports=function(t){this.map=t,this.renderer=new i.CSS2DRenderer,this.renderer.setSize(this.map.getCanvas().clientWidth,this.map.getCanvas().clientHeight),this.renderer.domElement.style.position="absolute",this.renderer.domElement.id="labelCanvas",this.renderer.domElement.style.top=0,this.renderer.domElement.style.zIndex="0",this.map.getCanvasContainer().appendChild(this.renderer.domElement),this.scene,this.camera,this.dispose=function(){this.map.getCanvasContainer().removeChild(this.renderer.domElement),this.renderer.domElement.remove(),this.renderer={}},this.setSize=function(t,e){this.renderer.setSize(t,e)},this.map.on("resize",function(){this.renderer.setSize(this.map.getCanvas().clientWidth,this.map.getCanvas().clientHeight)}.bind(this)),this.state={reset:function(){}},this.render=async function(t,e){return this.scene=t,this.camera=e,new Promise((i=>{i(this.renderer.render(t,e))}))},this.toggleLabels=async function(t,e){return new Promise((i=>{i(this.setVisibility(t,e,this.scene,this.camera,this.renderer))}))},this.setVisibility=function(t,e,i,n,r){this.renderer.cacheList.forEach((function(o){o.visible!=e&&o.layer===t&&(e&&o.alwaysVisible||!e)&&(o.visible=e,r.renderObject(o,i,n))}))}}}(ef);var nf=ef.exports,rf={exports:{}};!function(t,e){t.exports=class{constructor(t,e){this.id=t.layerId,this.type="custom",this.renderingMode="3d",this.opacity=.5,this.buildingsLayerId=t.buildingsLayerId,this.minAltitude=t.minAltitude||.1,this.tb=e}onAdd(t,e){this.map=t;const i=e.createShader(e.VERTEX_SHADER);e.shaderSource(i,"\n\t\t\tuniform mat4 u_matrix;\n\t\t\tuniform float u_height_factor;\n\t\t\tuniform float u_altitude;\n\t\t\tuniform float u_azimuth;\n\t\t\tattribute vec2 a_pos;\n\t\t\tattribute vec4 a_normal_ed;\n\t\t\tattribute lowp vec2 a_base;\n\t\t\tattribute lowp vec2 a_height;\n\t\t\tvoid main() {\n\t\t\t\tfloat base = max(0.0, a_base.x);\n\t\t\t\tfloat height = max(0.0, a_height.x);\n\t\t\t\tfloat t = mod(a_normal_ed.x, 2.0);\n\t\t\t\tvec4 pos = vec4(a_pos, t > 0.0 ? height : base, 1);\n\t\t\t\tfloat len = pos.z * u_height_factor / tan(u_altitude);\n\t\t\t\tpos.x += cos(u_azimuth) * len;\n\t\t\t\tpos.y += sin(u_azimuth) * len;\n\t\t\t\tpos.z = 0.0;\n\t\t\t\tgl_Position = u_matrix * pos;\n\t\t\t}\n\t\t\t"),e.compileShader(i);const n=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(n,"\n\t\t\tvoid main() {\n\t\t\t\tgl_FragColor = vec4(0.0, 0.0, 0.0, 0.7);\n\t\t\t}\n\t\t\t"),e.compileShader(n),this.program=e.createProgram(),e.attachShader(this.program,i),e.attachShader(this.program,n),e.linkProgram(this.program),e.validateProgram(this.program),this.uMatrix=e.getUniformLocation(this.program,"u_matrix"),this.uHeightFactor=e.getUniformLocation(this.program,"u_height_factor"),this.uAltitude=e.getUniformLocation(this.program,"u_altitude"),this.uAzimuth=e.getUniformLocation(this.program,"u_azimuth"),this.aPos=e.getAttribLocation(this.program,"a_pos"),this.aNormal=e.getAttribLocation(this.program,"a_normal_ed"),this.aBase=e.getAttribLocation(this.program,"a_base"),this.aHeight=e.getAttribLocation(this.program,"a_height")}render(t,e){t.useProgram(this.program);const i=this.map.style.sourceCaches.composite,n=i.getVisibleCoordinates().reverse(),r=this.map.getLayer(this.buildingsLayerId),o=this.map.painter.context,{lng:s,lat:a}=this.map.getCenter(),l=this.tb.getSunPosition(this.tb.lightDateTime,[s,a]);t.uniform1f(this.uAltitude,l.altitude>this.minAltitude?l.altitude:0),t.uniform1f(this.uAzimuth,l.azimuth+3*Math.PI/2),t.enable(t.BLEND),t.blendFunc(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA),t.getExtension("EXT_blend_minmax"),t.disable(t.DEPTH_TEST);for(const e of n){const n=i.getTile(e),s=n.getBucket(r);if(!s)continue;const[a,l]=s.programConfigurations.programConfigurations[this.buildingsLayerId]._buffers;t.uniformMatrix4fv(this.uMatrix,!1,e.posMatrix),t.uniform1f(this.uHeightFactor,Math.pow(2,e.overscaledZ)/n.tileSize/8);for(const e of s.segments.get()){const i=o.currentNumAttributes||0,n=2;for(let e=n;e<i;e++)t.disableVertexAttribArray(e);const r=e.vertexOffset||0;t.enableVertexAttribArray(this.aPos),t.enableVertexAttribArray(this.aNormal),t.enableVertexAttribArray(this.aHeight),t.enableVertexAttribArray(this.aBase),s.layoutVertexBuffer.bind(),t.vertexAttribPointer(this.aPos,2,t.SHORT,!1,12,12*r),t.vertexAttribPointer(this.aNormal,4,t.SHORT,!1,12,4+12*r),a.bind(),t.vertexAttribPointer(this.aHeight,1,t.FLOAT,!1,4,4*r),l.bind(),t.vertexAttribPointer(this.aBase,1,t.FLOAT,!1,4,4*r),s.indexBuffer.bind(),o.currentNumAttributes=n,t.drawElements(t.TRIANGLES,3*e.primitiveLength,t.UNSIGNED_SHORT,3*e.primitiveOffset*2)}}}}}(rf);var of=rf.exports;!function(t,e){const i=ld,n=gd,r=md,o=vd,s=pd,a=Md,l=bd,c=Pd,u=Dd,h=Od,p=Nd,d=Qd,f=Cd,m=Kd,g=tf,y=nf,v=of;function _(t,e,i){this.init(t,e,i)}_.prototype={repaint:function(){this.map.repaint=!0},init:function(t,e,n){this.options=r._validate(n||{},x),this.map=t,this.map.tb=this,this.objects=new a,this.mapboxVersion=parseFloat(this.map.version),this.renderer=new i.WebGLRenderer({alpha:!0,antialias:!0,preserveDrawingBuffer:n.preserveDrawingBuffer,canvas:t.getCanvas(),context:e}),this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setSize(this.map.getCanvas().clientWidth,this.map.getCanvas().clientHeight),this.renderer.outputEncoding=i.sRGBEncoding,this.renderer.autoClear=!1,this.labelRenderer=new y(this.map),this.scene=new i.Scene,this.world=new i.Group,this.world.name="world",this.scene.add(this.world),this.objectsCache=new Map,this.zoomLayers=[],this.fov=this.options.fov,this.orthographic=this.options.orthographic||!1,this.raycaster=new i.Raycaster,this.raycaster.layers.set(0),this.mapCenter=this.map.getCenter(),this.mapCenterUnits=r.projectToWorld([this.mapCenter.lng,this.mapCenter.lat]),this.lightDateTime=new Date,this.lightLng=this.mapCenter.lng,this.lightLat=this.mapCenter.lat,this.sunPosition,this.rotationStep=5,this.gridStep=6,this.altitudeStep=.1,this.defaultCursor="default",this.lights=this.initLights,this.options.defaultLights&&this.defaultLights(),this.options.realSunlight&&this.realSunlight(this.options.realSunlightHelper),this.skyLayerName="sky-layer",this.terrainSourceName="mapbox-dem",this.terrainExaggeration=1,this.terrainLayerName="",this.enableSelectingFeatures=this.options.enableSelectingFeatures||!1,this.enableSelectingObjects=this.options.enableSelectingObjects||!1,this.enableDraggingObjects=this.options.enableDraggingObjects||!1,this.enableRotatingObjects=this.options.enableRotatingObjects||!1,this.enableTooltips=this.options.enableTooltips||!1,this.multiLayer=this.options.multiLayer||!1,this.enableHelpTooltips=this.options.enableHelpTooltips||!1,this.map.on("style.load",(function(){this.tb.zoomLayers=[],this.tb.options.multiLayer&&this.addLayer({id:"threebox_layer",type:"custom",renderingMode:"3d",map:this,onAdd:function(t,e){},render:function(t,e){this.map.tb.update()}}),this.once("idle",(()=>{this.tb.setObjectsScale()})),this.tb.options.sky&&(this.tb.sky=!0),this.tb.options.terrain&&(this.tb.terrain=!0);["satellite","mapbox-mapbox-satellite","satelliteLayer"].forEach((t=>{this.getLayer(t)&&(this.tb.terrainLayerName=t)}))})),this.map.on("load",(function(){let e;this.selectedObject,this.selectedFeature,this.draggedObject,this.overedObject,this.overedFeature;let i,n=this.getCanvasContainer();this.getCanvasContainer().style.cursor=this.tb.defaultCursor;let o,s,a,l,c=[];function u(t){var e=n.getBoundingClientRect();return{x:t.originalEvent.clientX-e.left-n.clientLeft,y:t.originalEvent.clientY-e.top-n.clientTop}}this.unselectObject=function(){this.selectedObject.selected=!1,this.selectedObject=null},this.outObject=function(){this.overedObject.over=!1,this.overedObject=null},this.unselectFeature=function(t){void 0!==t.id&&(this.setFeatureState({source:t.source,sourceLayer:t.sourceLayer,id:t.id},{select:!1}),this.removeTooltip(t),(t=this.queryRenderedFeatures({layers:[t.layer.id],filter:["==",["id"],t.id]})[0])&&this.fire("SelectedFeatureChange",{detail:t}),this.selectedFeature=null)},this.selectFeature=function(t){this.selectedFeature=t,this.setFeatureState({source:this.selectedFeature.source,sourceLayer:this.selectedFeature.sourceLayer,id:this.selectedFeature.id},{select:!0}),this.selectedFeature=this.queryRenderedFeatures({layers:[this.selectedFeature.layer.id],filter:["==",["id"],this.selectedFeature.id]})[0],this.addTooltip(this.selectedFeature),this.fire("SelectedFeatureChange",{detail:this.selectedFeature})},this.outFeature=function(e){this.overedFeature&&void 0!==this.overedFeature&&this.overedFeature.id!=e&&(t.setFeatureState({source:this.overedFeature.source,sourceLayer:this.overedFeature.sourceLayer,id:this.overedFeature.id},{hover:!1}),this.removeTooltip(this.overedFeature),this.overedFeature=null)},this.addTooltip=function(t){if(!this.tb.enableTooltips)return;let e=this.tb.getFeatureCenter(t),i=this.tb.tooltip({text:t.properties.name||t.id||t.type,mapboxStyle:!0,feature:t});i.setCoords(e),this.tb.add(i,t.layer.id),t.tooltip=i,t.tooltip.tooltip.visible=!0},this.removeTooltip=function(t){t.tooltip&&(t.tooltip.visibility=!1,this.tb.remove(t.tooltip),t.tooltip=null)},t.onContextMenu=function(t){alert("contextMenu")},this.onClick=function(e){let i,n=[];if(t.tb.enableSelectingObjects&&(n=this.tb.queryRenderedFeatures(e.point)),i="object"==typeof n[0],i){let t=_.prototype.findParent3DObject(n[0]);if(t){if(this.selectedFeature&&this.unselectFeature(this.selectedFeature),this.selectedObject){if(this.selectedObject.uuid!=t.uuid)this.selectedObject.selected=!1,t.selected=!0,this.selectedObject=t;else if(this.selectedObject.uuid==t.uuid)return void this.unselectObject()}else this.selectedObject=t,this.selectedObject.selected=!0;this.selectedObject.dispatchEvent({type:"Wireframed",detail:this.selectedObject}),this.selectedObject.dispatchEvent({type:"IsPlayingChanged",detail:this.selectedObject}),this.repaint=!0,e.preventDefault()}}else{let i=[];if(t.tb.enableSelectingFeatures&&(i=this.queryRenderedFeatures(e.point)),i.length>0&&"fill-extrusion"==i[0].layer.type&&void 0!==i[0].id)if(this.selectedObject&&this.unselectObject(),this.selectedFeature){if(this.selectedFeature.id!=i[0].id)this.unselectFeature(this.selectedFeature),this.selectFeature(i[0]);else if(this.selectedFeature.id==i[0].id)return void this.unselectFeature(this.selectedFeature)}else this.selectFeature(i[0])}},this.onMouseMove=function(n){let r,c=u(n);if(this.getCanvasContainer().style.cursor=this.tb.defaultCursor,n.originalEvent.altKey&&this.draggedObject){if(!t.tb.enableRotatingObjects)return;e="rotate",this.getCanvasContainer().style.cursor="move",Math.min(i.x,c.x),Math.max(i.x,c.x),Math.min(i.y,c.y),Math.max(i.y,c.y);let n={x:0,y:0,z:Math.round(l[2]+~~((c.x-i.x)/this.tb.rotationStep)%360*this.tb.rotationStep%360)};return this.draggedObject.setRotation(n),void(t.tb.enableHelpTooltips&&this.draggedObject.addHelp("rot: "+n.z+"°"))}if(n.originalEvent.shiftKey&&this.draggedObject){if(!t.tb.enableDraggingObjects)return;e="translate",this.getCanvasContainer().style.cursor="move";let i=n.lngLat,r=[Number((i.lng+o).toFixed(this.tb.gridStep)),Number((i.lat+s).toFixed(this.tb.gridStep)),this.draggedObject.modelHeight];return this.draggedObject.setCoords(r),void(t.tb.enableHelpTooltips&&this.draggedObject.addHelp("lng: "+r[0]+"°, lat: "+r[1]+"°"))}if(n.originalEvent.ctrlKey&&this.draggedObject){if(!t.tb.enableDraggingObjects)return;e="altitude",this.getCanvasContainer().style.cursor="move";let i=n.point.y*this.tb.altitudeStep,r=[this.draggedObject.coordinates[0],this.draggedObject.coordinates[1],Number((-i-a).toFixed(this.tb.gridStep))];return this.draggedObject.setCoords(r),void(t.tb.enableHelpTooltips&&this.draggedObject.addHelp("alt: "+r[2]+"m"))}let h=[];if(t.tb.enableSelectingObjects&&(h=this.tb.queryRenderedFeatures(n.point)),r="object"==typeof h[0],r){let t=_.prototype.findParent3DObject(h[0]);t&&(this.outFeature(this.overedFeature),this.getCanvasContainer().style.cursor="pointer",this.selectedObject&&t.uuid==this.selectedObject.uuid?this.selectedObject&&t.uuid==this.selectedObject.uuid&&(t.over=!0,this.overedObject=t):(this.overedObject&&this.overedObject.uuid!=t.uuid&&this.outObject(),t.over=!0,this.overedObject=t),this.repaint=!0,n.preventDefault())}else{this.overedObject&&this.outObject();let e=[];t.tb.enableSelectingFeatures&&(e=this.queryRenderedFeatures(n.point)),e.length>0&&(this.outFeature(e[0]),"fill-extrusion"==e[0].layer.type&&void 0!==e[0].id&&(this.selectedFeature&&this.selectedFeature.id==e[0].id||(this.getCanvasContainer().style.cursor="pointer",this.overedFeature=e[0],this.setFeatureState({source:this.overedFeature.source,sourceLayer:this.overedFeature.sourceLayer,id:this.overedFeature.id},{hover:!0}),this.overedFeature=t.queryRenderedFeatures({layers:[this.overedFeature.layer.id],filter:["==",["id"],this.overedFeature.id]})[0],this.addTooltip(this.overedFeature))))}},this.onMouseDown=function(e){(e.originalEvent.shiftKey||e.originalEvent.altKey||e.originalEvent.ctrlKey)&&0===e.originalEvent.button&&this.selectedObject&&(t.tb.enableDraggingObjects||t.tb.enableRotatingObjects)&&(e.preventDefault(),t.getCanvasContainer().style.cursor="move",t.once("mouseup",this.onMouseUp),this.draggedObject=this.selectedObject,i=u(e),c=this.draggedObject.coordinates,l=r.degreeify(this.draggedObject.rotation),o=c[0]-e.lngLat.lng,s=c[1]-e.lngLat.lat,a=-this.draggedObject.modelHeight-e.point.y*this.tb.altitudeStep)},this.onMouseUp=function(t){this.getCanvasContainer().style.cursor=this.tb.defaultCursor,this.off("mouseup",this.onMouseUp),this.off("mouseout",this.onMouseUp),this.dragPan.enable(),this.draggedObject&&(this.draggedObject.dispatchEvent({type:"ObjectDragged",detail:{draggedObject:this.draggedObject,draggedAction:e}}),this.draggedObject.removeHelp(),this.draggedObject=null,e=null)},this.onMouseOut=function(t){if(this.overedFeature){let e=this.queryRenderedFeatures(t.point);e.length>0&&this.overedFeature.id!=e[0].id&&(this.getCanvasContainer().style.cursor=this.tb.defaultCursor,this.outFeature(e[0]))}},this.onZoom=function(t){this.tb.zoomLayers.forEach((t=>{this.tb.toggleLayer(t)})),this.tb.setObjectsScale()};let h=!1;this.on("click",this.onClick),this.on("mousemove",this.onMouseMove),this.on("mouseout",this.onMouseOut),this.on("mousedown",this.onMouseDown),this.on("zoom",this.onZoom),this.on("zoomend",this.onZoom),document.addEventListener("keydown",function(e){17===e.which||e.which,16===e.which&&(h=!0);let i=this.selectedObject;if(h&&83===e.which&&i){let e=r.toDecimal;if(i.help)i.removeHelp();else{let n=i.modelSize,o=1;"meters"!==i.userData.units&&(o=r.projectedUnitsPerMeter(i.coordinates[1]),o||(o=1),o=e(o,7)),t.tb.enableHelpTooltips&&i.addHelp("size(m): "+e(n.x/o,3)+" W, "+e(n.y/o,3)+" L, "+e(n.z/o,3)+" H"),this.repaint=!0}return!1}}.bind(this),!0),document.addEventListener("keyup",function(t){17==t.which||t.which,16===t.which&&(h=!1)}.bind(this))}))},get sky(){return this.options.sky},set sky(t){t?this.createSkyLayer():this.removeLayer(this.skyLayerName),this.options.sky=t},get terrain(){return this.options.terrain},set terrain(t){if(this.terrainLayerName="",t)this.createTerrainLayer();else{if(this.mapboxVersion<2)return void console.warn("Terrain layer are only supported by Mapbox-gl-js > v2.0");this.map.getTerrain()&&(this.map.setTerrain(null),this.map.removeSource(this.terrainSourceName))}this.options.terrain=t},get fov(){return this.options.fov},set fov(t){this.camera instanceof i.PerspectiveCamera&&this.options.fov!==t&&(this.map.transform.fov=t,this.camera.fov=this.map.transform.fov,this.cameraSync.setupCamera(),this.map.repaint=!0,this.options.fov=t)},get orthographic(){return this.options.orthographic},set orthographic(t){const e=this.map.getCanvas().clientHeight,r=this.map.getCanvas().clientWidth;t?(this.map.transform.fov=0,this.camera=new i.OrthographicCamera(r/-2,r/2,e/2,e/-2,.1,1e21)):(this.map.transform.fov=this.fov,this.camera=new i.PerspectiveCamera(this.map.transform.fov,r/e,.1,1e21)),this.camera.layers.enable(0),this.camera.layers.enable(1),this.cameraSync=new n(this.map,this.camera,this.world),this.map.repaint=!0,this.options.orthographic=t},createSkyLayer:function(){if(this.mapboxVersion<2)return console.warn("Sky layer are only supported by Mapbox-gl-js > v2.0"),void(this.options.sky=!1);this.map.getLayer(this.skyLayerName)||(this.map.addLayer({id:this.skyLayerName,type:"sky",paint:{"sky-opacity":["interpolate",["linear"],["zoom"],0,0,5,.3,8,1],"sky-type":"atmosphere","sky-atmosphere-sun":this.getSunSky(this.lightDateTime),"sky-atmosphere-sun-intensity":10}}),this.map.once("idle",(()=>{this.setSunlight(),this.repaint()})))},createTerrainLayer:function(){if(this.mapboxVersion<2)return console.warn("Terrain layer are only supported by Mapbox-gl-js > v2.0"),void(this.options.terrain=!1);this.map.getTerrain()||(this.map.addSource(this.terrainSourceName,{type:"raster-dem",url:"mapbox://mapbox.mapbox-terrain-dem-v1",tileSize:512,maxzoom:14}),this.map.setTerrain({source:this.terrainSourceName,exaggeration:this.terrainExaggeration}),this.map.once("idle",(()=>{this.cameraSync.updateCamera(),this.repaint()})))},sphere:function(t){return this.setDefaultView(t,this.options),c(t,this.world)},line:m,label:h,tooltip:p,tube:function(t){return this.setDefaultView(t,this.options),g(t,this.world)},extrusion:function(t){return this.setDefaultView(t,this.options),u(t)},Object3D:function(t){return this.setDefaultView(t,this.options),f(t)},loadObj:async function(t,e){if(this.setDefaultView(t,this.options),!1===t.clone)return new Promise((async i=>{d(t,e,(async t=>{i(t)}))}));{let i=this.objectsCache.get(t.obj);i?i.promise.then((i=>{e(i.duplicate(t))})).catch((e=>{this.objectsCache.delete(t.obj),console.error("Could not load model file: "+t.obj)})):this.objectsCache.set(t.obj,{promise:new Promise((async(i,n)=>{d(t,e,(async t=>{t.duplicate?i(t.duplicate()):n(t)}))}))})}},material:function(t){return l(t)},initLights:{ambientLight:null,dirLight:null,dirLightBack:null,dirLightHelper:null,hemiLight:null,pointLight:null},utils:r,SunCalc:o,Constants:s,projectToWorld:function(t){return this.utils.projectToWorld(t)},unprojectFromWorld:function(t){return this.utils.unprojectFromWorld(t)},projectedUnitsPerMeter:function(t){return this.utils.projectedUnitsPerMeter(t)},getFeatureCenter:function(t,e,i){return r.getFeatureCenter(t,e,i)},getObjectHeightOnFloor:function(t,e,i){return r.getObjectHeightOnFloor(t,e,i)},queryRenderedFeatures:function(t){let e=new i.Vector2;return e.x=t.x/this.map.transform.width*2-1,e.y=1-t.y/this.map.transform.height*2,this.raycaster.setFromCamera(e,this.camera),this.raycaster.intersectObjects(this.world.children,!0)},findParent3DObject:function(t){var e;return t.object.traverseAncestors((function(t){t.parent&&"Group"==t.parent.type&&t.userData.obj&&(e=t)})),e},setLayoutProperty:function(t,e,i){this.map.setLayoutProperty(t,e,i),null!=i&&"visibility"===e&&this.world.children.filter((e=>e.layer===t)).forEach((t=>{t.visibility=i}))},setLayerZoomRange:function(t,e,i){this.map.getLayer(t)&&(this.map.setLayerZoomRange(t,e,i),this.zoomLayers.includes(t)||this.zoomLayers.push(t),this.toggleLayer(t))},setLayerHeigthProperty:function(t,e){let i=this.map.getLayer(t);if(i)if("fill-extrusion"==i.type){let t=this.map.getStyle().sources[i.source].data;t.features.forEach((function(t){t.properties.level=e})),this.map.getSource(i.source).setData(t)}else"custom"==i.type&&this.world.children.forEach((function(i){let n=i.userData.feature;if(n&&n.layer===t){let t=this.tb.getFeatureCenter(n,i,e);i.setCoords(t)}}))},setObjectsScale:function(){this.world.children.filter((t=>null!=t.fixedZoom)).forEach((t=>{t.setObjectScale(this.map.transform.scale)}))},setStyle:function(t,e){this.clear().then((()=>{this.map.setStyle(t,e)}))},toggleLayer:function(t,e=!0){let i=this.map.getLayer(t);if(i){if(!e)return void this.toggle(i.id,!1);let t=this.map.getZoom();if(i.minzoom&&t<i.minzoom)return void this.toggle(i.id,!1);if(i.maxzoom&&t>=i.maxzoom)return void this.toggle(i.id,!1);this.toggle(i.id,!0)}},toggle:function(t,e){this.setLayoutProperty(t,"visibility",e?"visible":"none"),this.labelRenderer.toggleLabels(t,e)},update:function(){this.map.repaint&&(this.map.repaint=!1);var t=Date.now();this.objects.animationManager.update(t),this.updateLightHelper(),this.renderer.resetState(),this.renderer.render(this.scene,this.camera),this.labelRenderer.render(this.scene,this.camera),!1===this.options.passiveRendering&&this.map.triggerRepaint()},add:function(t,e,i){if(!this.enableTooltips&&t.tooltip&&(t.tooltip.visibility=!1),this.world.add(t),e){t.layer=e,t.source=i;let n=this.map.getLayer(e);if(n){let e=n.visibility,i=void 0===e;t.visibility=!(!i&&"visible"!==e)}}},removeByName:function(t){let e=this.world.getObjectByName(t);e&&this.remove(e)},remove:function(t){this.map.selectedObject&&t.uuid==this.map.selectedObject.uuid&&this.map.unselectObject(),this.map.draggedObject&&t.uuid==this.map.draggedObject.uuid&&(this.map.draggedObject=null),t.dispose&&t.dispose(),this.world.remove(t),t=null},clear:async function(t=null,e=!1){return new Promise(((i,n)=>{let r=[];this.world.children.forEach((function(t){r.push(t)}));for(let e=0;e<r.length;e++){let i=r[e];i.layer!==t&&t||this.remove(i)}e&&this.objectsCache.forEach((t=>{t.promise.then((t=>{t.dispose(),t=null}))})),i("clear")}))},removeLayer:function(t){this.clear(t,!0).then((()=>{this.map.removeLayer(t)}))},getSunPosition:function(t,e){return o.getPosition(t||Date.now(),e[1],e[0])},getSunTimes:function(t,e){return o.getTimes(t,e[1],e[0],e[2]?e[2]:0)},setBuildingShadows:function(t){if(this.map.getLayer(t.buildingsLayerId)){let e=new v(t,this);this.map.addLayer(e,t.buildingsLayerId)}else console.warn("The layer '"+t.buildingsLayerId+"' does not exist in the map.")},setSunlight:function(t=new Date,e){if(!this.lights.dirLight||!this.options.realSunlight)return void console.warn("To use setSunlight it's required to set realSunlight : true in Threebox initial options.");var i=new Date(t.getTime());if(e?e.lng&&e.lat?this.mapCenter=e:this.mapCenter={lng:e[0],lat:e[1]}:this.mapCenter=this.map.getCenter(),this.lightDateTime&&this.lightDateTime.getTime()===i.getTime()&&this.lightLng===this.mapCenter.lng&&this.lightLat===this.mapCenter.lat)return;this.lightDateTime=i,this.lightLng=this.mapCenter.lng,this.lightLat=this.mapCenter.lat,this.sunPosition=this.getSunPosition(i,[this.mapCenter.lng,this.mapCenter.lat]);let n=this.sunPosition.altitude,r=Math.PI+this.sunPosition.azimuth,o=s.WORLD_SIZE/2,a=Math.sin(n),l=Math.cos(n),c=Math.cos(r)*l,u=Math.sin(r)*l;this.lights.dirLight.position.set(u,c,a),this.lights.dirLight.position.multiplyScalar(o),this.lights.dirLight.intensity=Math.max(a,0),this.lights.hemiLight.intensity=Math.max(1*a,.1),this.lights.dirLight.updateMatrixWorld(),this.updateLightHelper(),this.map.loaded()&&(this.updateSunGround(this.sunPosition),this.map.setLight({anchor:"map",position:[3,180+180*this.sunPosition.azimuth/Math.PI,90-180*this.sunPosition.altitude/Math.PI],intensity:Math.cos(this.sunPosition.altitude),color:`hsl(40, ${50*Math.cos(this.sunPosition.altitude)}%, ${Math.max(20,20+96*Math.sin(this.sunPosition.altitude))}%)`},{duration:0}),this.sky&&this.updateSunSky(this.getSunSky(i,this.sunPosition)))},getSunSky:function(t,e){if(!e){var i=this.map.getCenter();e=this.getSunPosition(t||Date.now(),[i.lng,i.lat])}return[180+180*e.azimuth/Math.PI,90-180*e.altitude/Math.PI]},updateSunSky:function(t){this.sky&&this.map.setPaintProperty(this.skyLayerName,"sky-atmosphere-sun",t)},updateSunGround:function(t){""!=this.terrainLayerName&&this.map.setPaintProperty(this.terrainLayerName,"raster-opacity",Math.max(Math.min(1,4*t.altitude),.25))},updateLightHelper:function(){this.lights.dirLightHelper&&(this.lights.dirLightHelper.position.setFromMatrixPosition(this.lights.dirLight.matrixWorld),this.lights.dirLightHelper.updateMatrix(),this.lights.dirLightHelper.update())},dispose:async function(){return console.log(this.memory()),new Promise((t=>{t(this.clear(null,!0).then((t=>(this.map.remove(),this.map={},this.scene.remove(this.world),this.world.children=[],this.world=null,this.objectsCache.clear(),this.labelRenderer.dispose(),console.log(this.memory()),this.renderer.dispose(),t))))}))},defaultLights:function(){this.lights.ambientLight=new i.AmbientLight(new i.Color("hsl(0, 0%, 100%)"),.75),this.scene.add(this.lights.ambientLight),this.lights.dirLightBack=new i.DirectionalLight(new i.Color("hsl(0, 0%, 100%)"),.25),this.lights.dirLightBack.position.set(30,100,100),this.scene.add(this.lights.dirLightBack),this.lights.dirLight=new i.DirectionalLight(new i.Color("hsl(0, 0%, 100%)"),.25),this.lights.dirLight.position.set(-30,100,-100),this.scene.add(this.lights.dirLight)},realSunlight:function(t=!1){this.renderer.shadowMap.enabled=!0,this.lights.dirLight=new i.DirectionalLight(16777215,1),this.scene.add(this.lights.dirLight),t&&(this.lights.dirLightHelper=new i.DirectionalLightHelper(this.lights.dirLight,5),this.scene.add(this.lights.dirLightHelper));this.lights.dirLight.castShadow=!0,this.lights.dirLight.shadow.radius=2,this.lights.dirLight.shadow.mapSize.width=8192,this.lights.dirLight.shadow.mapSize.height=8192,this.lights.dirLight.shadow.camera.top=this.lights.dirLight.shadow.camera.right=1e3,this.lights.dirLight.shadow.camera.bottom=this.lights.dirLight.shadow.camera.left=-1e3,this.lights.dirLight.shadow.camera.near=1,this.lights.dirLight.shadow.camera.visible=!0,this.lights.dirLight.shadow.camera.far=4e8,this.lights.hemiLight=new i.HemisphereLight(new i.Color(16777215),new i.Color(16777215),.6),this.lights.hemiLight.color.setHSL(.661,.96,.12),this.lights.hemiLight.groundColor.setHSL(.11,.96,.14),this.lights.hemiLight.position.set(0,0,50),this.scene.add(this.lights.hemiLight),this.setSunlight(),this.map.once("idle",(()=>{this.setSunlight(),this.repaint()}))},setDefaultView:function(t,e){t.bbox=(t.bbox||null==t.bbox)&&e.enableSelectingObjects,t.tooltip=(t.tooltip||null==t.tooltip)&&e.enableTooltips,t.mapScale=this.map.transform.scale},memory:function(){return this.renderer.info.memory},programs:function(){return this.renderer.info.programs.length},version:"2.2.7"};var x={defaultLights:!1,realSunlight:!1,realSunlightHelper:!1,passiveRendering:!0,preserveDrawingBuffer:!1,enableSelectingFeatures:!1,enableSelectingObjects:!1,enableDraggingObjects:!1,enableRotatingObjects:!1,enableTooltips:!1,enableHelpTooltips:!1,multiLayer:!1,orthographic:!1,fov:s.FOV_DEGREES,sky:!1,terrain:!1};t.exports=_}(sd);var sf=sd.exports;!function(t,e){t.exports={Threebox:sf,THREE:ld}}(od);var af=od.exports,lf=Object.freeze({Linear:Object.freeze({None:function(t){return t},In:function(t){return this.None(t)},Out:function(t){return this.None(t)},InOut:function(t){return this.None(t)}}),Quadratic:Object.freeze({In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}}),Cubic:Object.freeze({In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}}),Quartic:Object.freeze({In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}}),Quintic:Object.freeze({In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}}),Sinusoidal:Object.freeze({In:function(t){return 1-Math.sin((1-t)*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.sin(Math.PI*(.5-t)))}}),Exponential:Object.freeze({In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}}),Circular:Object.freeze({In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}}),Elastic:Object.freeze({In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}}),Back:Object.freeze({In:function(t){var e=1.70158;return 1===t?1:t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return 0===t?0:--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}}),Bounce:Object.freeze({In:function(t){return 1-lf.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*lf.Bounce.In(2*t):.5*lf.Bounce.Out(2*t-1)+.5}}),generatePow:function(t){return void 0===t&&(t=4),t=(t=t<Number.EPSILON?Number.EPSILON:t)>1e4?1e4:t,{In:function(e){return Math.pow(e,t)},Out:function(e){return 1-Math.pow(1-e,t)},InOut:function(e){return e<.5?Math.pow(2*e,t)/2:(1-Math.pow(2-2*e,t))/2+.5}}}}),cf=function(){return performance.now()},uf=function(){function t(){this._tweens={},this._tweensAddedDuringUpdate={}}return t.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map((function(e){return t._tweens[e]}))},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},t.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},t.prototype.update=function(t,e){void 0===t&&(t=cf()),void 0===e&&(e=!1);var i=Object.keys(this._tweens);if(0===i.length)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var n=0;n<i.length;n++){var r=this._tweens[i[n]],o=!e;r&&!1===r.update(t,o)&&!e&&delete this._tweens[i[n]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0},t}(),hf={Linear:function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n),o=hf.Utils.Linear;return e<0?o(t[0],t[1],n):e>1?o(t[i],t[i-1],i-n):o(t[r],t[r+1>i?i:r+1],n-r)},Bezier:function(t,e){for(var i=0,n=t.length-1,r=Math.pow,o=hf.Utils.Bernstein,s=0;s<=n;s++)i+=r(1-e,n-s)*r(e,s)*t[s]*o(n,s);return i},CatmullRom:function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n),o=hf.Utils.CatmullRom;return t[0]===t[i]?(e<0&&(r=Math.floor(n=i*(1+e))),o(t[(r-1+i)%i],t[r],t[(r+1)%i],t[(r+2)%i],n-r)):e<0?t[0]-(o(t[0],t[0],t[1],t[1],-n)-t[0]):e>1?t[i]-(o(t[i],t[i],t[i-1],t[i-1],n-i)-t[i]):o(t[r?r-1:0],t[r],t[i<r+1?i:r+1],t[i<r+2?i:r+2],n-r)},Utils:{Linear:function(t,e,i){return(e-t)*i+t},Bernstein:function(t,e){var i=hf.Utils.Factorial;return i(t)/i(e)/i(t-e)},Factorial:function(){var t=[1];return function(e){var i=1;if(t[e])return t[e];for(var n=e;n>1;n--)i*=n;return t[e]=i,i}}(),CatmullRom:function(t,e,i,n,r){var o=.5*(i-t),s=.5*(n-e),a=r*r;return(2*e-2*i+o+s)*(r*a)+(-3*e+3*i-2*o-s)*a+o*r+e}}},pf=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),df=new uf,ff=function(){function t(t,e){void 0===e&&(e=df),this._object=t,this._group=e,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=lf.Linear.None,this._interpolationFunction=hf.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=pf.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.to=function(t,e){if(void 0===e&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e,this},t.prototype.duration=function(t){return void 0===t&&(t=1e3),this._duration=t,this},t.prototype.dynamic=function(t){return void 0===t&&(t=!1),this._isDynamic=t,this},t.prototype.start=function(t,e){if(void 0===t&&(t=cf()),void 0===e&&(e=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var i in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var n={};for(var r in this._valuesEnd)n[r]=this._valuesEnd[r];this._valuesEnd=n}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},t.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},t.prototype._setupProperties=function(t,e,i,n,r){for(var o in i){var s=t[o],a=Array.isArray(s),l=a?"array":typeof s,c=!a&&Array.isArray(i[o]);if("undefined"!==l&&"function"!==l){if(c){if(0===(g=i[o]).length)continue;for(var u=[s],h=0,p=g.length;h<p;h+=1){var d=this._handleRelativeValue(s,g[h]);if(isNaN(d)){c=!1,console.warn("Found invalid interpolation list. Skipping.");break}u.push(d)}c&&(i[o]=u)}if("object"!==l&&!a||!s||c)(void 0===e[o]||r)&&(e[o]=s),a||(e[o]*=1),n[o]=c?i[o].slice().reverse():e[o]||0;else{e[o]=a?[]:{};var f=s;for(var m in f)e[o][m]=f[m];n[o]=a?[]:{};var g=i[o];if(!this._isDynamic){var y={};for(var m in g)y[m]=g[m];i[o]=g=y}this._setupProperties(f,e[o],g,n[o],r)}}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},t.prototype.pause=function(t){return void 0===t&&(t=cf()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this)),this},t.prototype.resume=function(t){return void 0===t&&(t=cf()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this):this},t.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},t.prototype.group=function(t){return void 0===t&&(t=df),this._group=t,this},t.prototype.delay=function(t){return void 0===t&&(t=0),this._delayTime=t,this},t.prototype.repeat=function(t){return void 0===t&&(t=0),this._initialRepeat=t,this._repeat=t,this},t.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},t.prototype.yoyo=function(t){return void 0===t&&(t=!1),this._yoyo=t,this},t.prototype.easing=function(t){return void 0===t&&(t=lf.Linear.None),this._easingFunction=t,this},t.prototype.interpolation=function(t){return void 0===t&&(t=hf.Linear),this._interpolationFunction=t,this},t.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},t.prototype.onStart=function(t){return this._onStartCallback=t,this},t.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},t.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},t.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},t.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},t.prototype.onStop=function(t){return this._onStopCallback=t,this},t.prototype.update=function(t,e){if(void 0===t&&(t=cf()),void 0===e&&(e=!0),this._isPaused)return!0;var i,n,r=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>r)return!1;e&&this.start(t,!0)}if(this._goToEnd=!1,t<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),!1===this._onEveryStartCallbackFired&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),n=(t-this._startTime)/this._duration,n=0===this._duration||n>1?1:n;var o=this._easingFunction(n);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,o),this._onUpdateCallback&&this._onUpdateCallback(this._object,n),1===n){if(this._repeat>0){for(i in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[i]||(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),void 0!==this._repeatDelayTime?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var s=0,a=this._chainedTweens.length;s<a;s++)this._chainedTweens[s].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},t.prototype._updateProperties=function(t,e,i,n){for(var r in i)if(void 0!==e[r]){var o=e[r]||0,s=i[r],a=Array.isArray(t[r]),l=Array.isArray(s);!a&&l?t[r]=this._interpolationFunction(s,n):"object"==typeof s&&s?this._updateProperties(t[r],o,s,n):"number"==typeof(s=this._handleRelativeValue(o,s))&&(t[r]=o+(s-o)*n)}},t.prototype._handleRelativeValue=function(t,e){return"string"!=typeof e?e:"+"===e.charAt(0)||"-"===e.charAt(0)?t+parseFloat(e):parseFloat(e)},t.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],i=this._valuesEnd[t];this._valuesStartRepeat[t]="string"==typeof i?this._valuesStartRepeat[t]+parseFloat(i):this._valuesEnd[t],this._valuesEnd[t]=e},t}(),mf=pf.nextId,gf=df,yf=gf.getAll.bind(gf),vf=gf.removeAll.bind(gf),_f=gf.add.bind(gf),xf=gf.remove.bind(gf),bf=gf.update.bind(gf),wf={Easing:lf,Group:uf,Interpolation:hf,now:cf,Sequence:pf,nextId:mf,Tween:ff,VERSION:"21.0.0",getAll:yf,removeAll:vf,add:_f,remove:xf,update:bf};class Af extends(m(C)){id;tb;map;_option;constructor(t,e,i){super(),this.id=i||d(0,25),this._option=Object.assign({width:1,color:"#ffffff",labelOption:{},speed:10,type:"VerticalFlyingLine",percent:.2},e),this.init(t)}init(t){cNt.value.addLayer({id:this.id,type:"custom",onAdd:(e,i)=>{this.map=e,this.tb=new af.Threebox(e,i,{defaultLights:!0});const n=this.draw2(t);this.tb.add(n)},render:()=>{this.map&&this.map.triggerRepaint(),this.tb&&this.tb.update(),wf.update()}})}draw2(t){const e=new af.THREE.Group;return e.name=this.id+"lineGroup",t.forEach((t=>{const i=t.position[0],n=t.position[1],r=this.tb.utils.lnglatsToWorld([[...i]]),o=this.tb.utils.lnglatsToWorld([[...n]]),s=[new af.THREE.Vector3(r[0].x,r[0].y,r[0].z),new af.THREE.Vector3((r[0].x+o[0].x)/2,(r[0].y+o[0].y)/2,(r[0].z+o[0].z)/2),new af.THREE.Vector3(o[0].x,o[0].y,o[0].z)],a=this._option.width?this._option.width+1:60,l=new af.THREE.CatmullRomCurve3(s).getSpacedPoints(1e3),c=[];l.forEach(((t,e)=>{c.push(e)}));const u=(new af.THREE.BufferGeometry).setFromPoints(l);u.setAttribute("aIndex",new af.THREE.Float32BufferAttribute(c,1));const h=new af.THREE.ShaderMaterial({uniforms:{uColor:{value:new af.THREE.Color(this._option.color)},uTime:{value:0},uLength:{value:l.length},uWidth:{value:a}},vertexShader:"\n attribute float aIndex;\n \n uniform float uTime;\n uniform vec3 uColor;\n uniform float uWidth;\n \n varying float vSize;\n \n void main(){\n vec4 viewPosition = viewMatrix * modelMatrix *vec4(position,1);\n gl_Position = projectionMatrix * viewPosition;\n \n if(aIndex < uTime + 100.0 && aIndex > uTime - 100.0){\n vSize = (aIndex + 100.0 - uTime) / (300.0/uWidth );\n } \n gl_PointSize =vSize;\n }\n ",fragmentShader:"\n varying float vSize;\n uniform vec3 uColor;\n void main(){\n \n if(vSize<=0.0){\n gl_FragColor = vec4(1,0,0,0);\n }else{\n gl_FragColor = vec4(uColor,1);\n }\n \n }\n ",transparent:!0});e.add(new af.THREE.Points(u,h));new wf.Tween({index:1}).to({index:1e3},this._option.speed?100*this._option.speed:2e3).onUpdate((function(t){const e=Math.ceil(t.index);h.uniforms.uTime.value=e})).repeat(1/0).start()})),e}draw1(){const t=new af.THREE.Group;t.name="lineGroup";const e=this.tb.utils.lnglatsToWorld([[104.807073,29.35702,0]]),i=this.tb.utils.lnglatsToWorld([[104.807073,29.35702,0]]),n=[new af.THREE.Vector3(e[0].x,e[0].y,0),new af.THREE.Vector3((e[0].x+i[0].x)/2,(e[0].y+i[0].y)/2,5e3),new af.THREE.Vector3(e[0].x,e[0].y,1e4)],r=new af.THREE.CatmullRomCurve3(n),o=new af.THREE.TubeBufferGeometry(r,100,1,20,!1),s=(new af.THREE.TextureLoader).load("");s.repeat.set(20,20),s.needsUpdate=!0,s.wrapS=af.THREE.RepeatWrapping,s.wrapT=af.THREE.RepeatWrapping;const a=new af.THREE.MeshBasicMaterial({map:s,transparent:!0});t.add(new af.THREE.Mesh(o,a));return new wf.Tween({x:0}).to({x:100},2e3).onUpdate((function(){s.offset.x-=.01})).repeat(1/0).start(),t}}function Ef(t,e,i){let n;n=p(t)?$p(t,"multiLineString"):t;const r=e.labelOption?JSON.parse(JSON.stringify(e.labelOption)):{};let o;o=e.type&&"VerticalFlyingLine"==e.type?function(t,e,i){return new Af(t,e,i)}(t,e,i):new ed(n,e,i);const s=rd(n,{...r,allShow:!1!==r.allShow},o.id+"label");return!1===r.allShow&&(o.addEventListener("mouseIn",(t=>{s.hoveredPolygonId=t.id,cNt.value.setPaintProperty(s.id,"text-opacity",["case",["boolean",["==",["get","id"],s.hoveredPolygonId],!1],1,0])})),o.addEventListener("mouseOut",(()=>{s.hoveredPolygonId&&cNt.value.setPaintProperty(s.id,"text-opacity",0),s.hoveredPolygonId=null}))),o}class Sf extends(m(C)){options;id;bbox;LABEL;LINE;constructor(t,e,i){super(),this.bbox=[],this.id=i||d(0,3),this.options=Object.assign({color:"#ffffff",labelOption:{},type:"color",minzoom:0,maxzoom:24,opacity:1,isShow:!0},e),t&&(t.features.forEach((t=>{t.properties.imageurl=t.properties.image,t.properties.image=this.id+t.properties.imageurl,t.properties.highlightImageurl=t.properties.highlightImage,t.properties.highlightImage=this.id+t.properties.highlightImageurl})),this.bbox=Kp(t),cNt.value.addSource(this.id+"source",{type:"geojson",lineMetrics:!0,data:t})),"image"==this.options.type&&this.options.image&&this._addImages(t);const n={id:this.id,source:this.options.source?this.options.source:this.id+"source",minzoom:this.options.minzoom,maxzoom:this.options.maxzoom,type:null!=this.options.extrudedHeight?"fill-extrusion":"fill",layout:{visibility:this.options.isShow?"visible":"none"}};if(this.options.sourceLayer&&(n["source-layer"]=this.options.sourceLayer),null!=this.options.extrudedHeight?n.paint={"fill-extrusion-color":this.options.color,"fill-extrusion-height":this.options.extrudedHeight,"fill-extrusion-opacity":this.options.opacity,"fill-extrusion-pattern":this.options.image?Array.isArray(this.options.image)?this.options.image:this.id+this.options.image:""}:(n.paint={"fill-color":this.options.color,"fill-outline-color":this.options.color},uNt.value&&"EPSG:3857"!=uNt.value||(n.paint={...n.paint,"fill-pattern":this.options.image?Array.isArray(this.options.image)?this.options.image:this.id+this.options.image:""})),cNt.value.addLayer(n),this.options.filter&&cNt.value.setFilter(this.id,this.options.filter),(this.options.highlightColor||this.options.highlightImage)&&null==this.options.extrudedHeight&&!cNt.value.getLayer(this.id+"Highlight")){cNt.value.addSource(this.id+"Highlightsource",{type:"geojson",lineMetrics:!0,data:t});let e={};e=this.options.highlightColor?{"fill-color":this.options.highlightColor}:{"fill-pattern":this.options.highlightImage?Array.isArray(this.options.highlightImage)?this.options.highlightImage:this.id+this.options.highlightImage:""},cNt.value.addLayer({id:this.id+"Highlight",source:this.id+"Highlightsource",type:"fill",filter:["in","id",""],layout:{visibility:this.options.isShow?"visible":"none"},paint:e})}}_addImages(t){if(Array.isArray(this.options.image)){const{features:e}=t;e.forEach((t=>{this._addImage(t.properties.imageurl,t.properties.image),this._addImage(t.properties.highlightImageurl,t.properties.highlightImage)}))}else this._addImage(this.options.image,this.id+this.options.image),this._addImage(this.options.highlightImage,this.id+this.options.highlightImage)}_addImage(t,e){cNt.value.loadImage(t,((t,i)=>{if(t)throw t;cNt.value.hasImage(e)||cNt.value.addImage(e,i)}))}getId(){return this.id}highlight(t,e){cNt.value.getLayer(this.id+"Highlight")&&cNt.value.setFilter(this.id+"Highlight",["in","id",t]),this.options.extrudedHeight&&(this.options.highlightColor||this.options.highlightImage)&&(this.options.highlightColor?cNt.value.setPaintProperty(this.id,"fill-extrusion-color",["case",["boolean",["==",["get",e||"id"],t],!1],this.options.highlightColor,this.options.color]):cNt.value.setPaintProperty(this.id,"fill-extrusion-pattern",["case",["boolean",["==",["get",e||"id"],t],!1],this.id+this.options.highlightImage,this.id+this.options.image]))}removeHighlight(){cNt.value.getLayer(this.id+"Highlight")&&cNt.value.setFilter(this.id+"Highlight",["in","id",""])}_update(t){this.bbox=Kp(t),this._updateSource("source",t),this._updateSource("Highlightsource",t)}_updateSource(t,e){const i=cNt.value.getSource(this.id+t);i&&i.setData(e)}_isFeatureCollectionData(t){return t instanceof Array}_addLabel(t){this.LABEL&&(this.LABEL.destroy(),this.LABEL="");const e=this.options.labelOption?JSON.parse(JSON.stringify(this.options.labelOption)):"";this.LABEL=rd(t,{...e,allShow:!1!==e.allShow},this.id+"label"),!1===e.allShow&&(this.addEventListener("mouseIn",(t=>{this.LABEL.hoveredPolygonId=t.id,t.id&&cNt.value.setPaintProperty(this.LABEL.id,"text-opacity",["case",["boolean",["==",["get","id"],this.LABEL.hoveredPolygonId],!1],1,0])})),this.addEventListener("mouseOut",(()=>{this.LABEL.hoveredPolygonId&&cNt.value.setPaintProperty(this.LABEL.id,"text-opacity",0),this.LABEL.hoveredPolygonId=null})))}_addLine(t){if(this.options.outLineColor){const e={width:this.options.outLineWidth?this.options.outLineWidth:1,color:this.options.outLineColor,highlightColor:this.options.highlightColor?this.options.highlightColor:"",isShow:this.options.isShow};this.LINE=Ef(t,e,this.id+"line")}}}class Mf extends Sf{constructor(t,e,i){super(t,e,i)}update(t){let e=t;if(t instanceof Array){e=$p(Tf(t),"multiPolygon");const i=t.map((t=>({position:t.center,text:t.text,id:t.id,userData:t.userData})));this._addLabel(i);const n=Tf(t).map((t=>({position:t.position[0],id:t.id})));this.LINE.update(n)}this._update(e)}}function Tf(t){return t.map((t=>({position:[Z(Up(R(t.center),t.radius,{units:"kilometers",steps:50}))],text:t.text?t.text:"",id:t.id?t.id:"",userData:t.userData?t.userData:{}})))}class If extends Sf{constructor(t,e,i){super(t,e,i)}update(t){let e=t;if(t instanceof Array){e=$p(Cf(t),"multiPolygon");const i=e.map((t=>({position:t.center,text:t.text,id:t.id,userData:t.userData})));this._addLabel(i);const n=e.map((t=>({position:t.position[0],id:t.id})));this.LINE.update(n)}this._update(e)}}function Cf(t){const e=t.map((t=>{const e=[];t.position.forEach((t=>{e.push(R(t))}));const i=N(e),n=Z(vt(i)),r=bt(i);return{position:[n],text:t.text?t.text:"",id:t.id?t.id:"",userData:t.userData?t.userData:{},center:r.geometry.coordinates}}));return e}class Pf extends Sf{constructor(t,e,i){super(t,e,i)}update(t){let e=t;if(t instanceof Array){e=$p(t,"multiPolygon"),this._addLabel(function(t){const e=t.map((t=>({position:t.position[0][0],text:t.text?t.text:null,id:t.id?t.id:null,userData:t.userData?t.userData:null})));return e}(t));const i=[];t.map((t=>{t.position.forEach((t=>{i.push({position:[...t,t[0]]})}))})),this.LINE.update(i)}this._update(e)}}class Lf extends Sf{_featureArr;_flag;_heighConfig;_timeOver;constructor(t,e,i){super(t,e,i),this._featureArr=[],this._heighConfig={key:"id",properties:{},height:0,upSpeed:2e3,downSpeed:400},this._flag=0,this._timeOver=!1}stretchHeight(t){this._heighConfig={...this._heighConfig,...t},this._featureArr.unshift(this._heighConfig.properties[this._heighConfig.key]),this._featureArr=this._featureArr.filter(((t,e)=>e<=1)),(1==this._featureArr.length||this._timeOver)&&(this.animate(),this.tweenDown())}removeStretchHeight(){cNt.value.setPaintProperty(this.id,"fill-extrusion-height",this.options.extrudedHeight)}animate(){this._flag=requestAnimationFrame((()=>this.animate())),bf()}tweenUp(){const t={h:0};new ff(t).to({h:this._heighConfig.height},this._heighConfig.upSpeed).easing(lf.Quadratic.InOut).onUpdate((()=>{cNt.value.getLayer(this.id)&&cNt.value.setPaintProperty(this.id,"fill-extrusion-height",["case",["boolean",["==",["get",this._heighConfig.key],this._featureArr[0]],!1],t.h,this.options.extrudedHeight])})).onComplete((()=>{window.cancelAnimationFrame(this._flag),this._timeOver=!0})).start()}tweenDown(){const t={h:this._heighConfig.height};new ff(t).to({h:0},this._heighConfig.downSpeed).onUpdate((()=>{this._featureArr.length>1&&(this._timeOver=!1,cNt.value.getLayer(this.id)&&cNt.value.setPaintProperty(this.id,"fill-extrusion-height",["case",["boolean",["==",["get",this._heighConfig.key],this._featureArr[1]],!1],t.h,this.options.extrudedHeight]))})).onComplete((()=>{this.tweenUp()})).start()}}function Df(t,e,i){let n,r;if(t&&p(t)?r=$p(t,"multiPolygon"):t&&(r=t),e&&(e.source||null!=e.extrudedHeight)?n=new Lf(r,e,i):r&&(n=new Pf(r,e,i)),r){n&&n._addLabel(r);const t=JSON.parse(JSON.stringify(r.features)).map((t=>{let e=[];return"Polygon"==t.geometry.type?e=t.geometry.coordinates[0]:"MultiPolygon"==t.geometry.type&&(e=t.geometry.coordinates[0][0]),{position:e,id:t.properties.id}}));n&&n._addLine(t)}return n}function Rf(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===i&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}Rf(".mapboxgl-marker {\r\n\tposition: absolute;\r\n\ttop: 0;\r\n\tleft: 0;\r\n\twill-change: transform;\r\n\topacity: 1;\r\n\t-webkit-transition: opacity 0.2s;\r\n\ttransition: opacity 0.2s;\r\n}\r\n/* .mapboxgl-marker-anchor-left {\r\n\tbackground: #333 !important;\r\n\tcolor: #fff;\r\n} */\r\n/* .measure-result {\r\n\ttext-align: left;\r\n\tpadding: 0 10px;\r\n\tbackground: #333 !important;\r\n\tcolor: #fff;\r\n} */\r\n\r\n/* .measure-result-Length {\r\n\tbackground: #333 !important;\r\n\tpadding: 0 10px;\r\n\tcolor: #fff;\r\n} */\r\n\r\n.measure-area {\r\n\tbackground: #333;\r\n\tpadding: 0 10px;\r\n\tcolor: #fff;\r\n}\r\n\r\n.measure-area-html {\r\n\tposition: relative;\r\n\tpadding-right: 14px;\r\n}\r\n\r\n/* .measure-result-close {\r\n\tposition: absolute;\r\n\ttop: 1px;\r\n\tright: 2px;\r\n\tcursor: pointer !important;\r\n} */\r\n\r\n.popup-set-styles {\r\n\tfont-size: 14px;\r\n\tfont-weight: bold;\r\n}\r\n");class Of{option;ele;tooltipDistance;markers;jsonPoint;jsonLine;points;mapClick;mapMousemove;mapDblclick;id;callJson;constructor(t){this.option=t,this.markers={tooltipDistance:null,clearLength:null},this.jsonPoint={type:"FeatureCollection",features:[]},this.jsonLine={type:"FeatureCollection",features:[]},this.callJson={type:"Feature",geometry:{type:"LineString",coordinates:[]},properties:{}},this.points=[[0,0]],this.points.pop(),this.id=d(0,10)}initElement(){this.ele=document.createElement("div"),this.ele.setAttribute("style",`text-align: left;\n\t\t\tpadding: 3px 10px;\n\t\t\tfont-size: ${this.option?this.option.fontSize:"14px"};\n\t\t\tbackground: ${this.option?this.option.backgroundColor:"#333"} !important;\n\t\t\tcolor: ${this.option?this.option.fontColor:"#fff"};\n\t\t\tz-index: 10;`);const t={element:this.ele,anchor:"left",offset:[8,0]};this.tooltipDistance=new cNt.value.mapboxgl.Marker(t).setLngLat([0,0]).addTo(cNt.value),this.markers.tooltipDistance=this.tooltipDistance}initLayer(){cNt.value.getSource(this.id+"pointsMeasure")?(this.id=d(0,10),this.initLayer()):(cNt.value.addSource(this.id+"pointsMeasure",{type:"geojson",data:this.jsonPoint}),cNt.value.addLayer({id:this.id+"pointsMeasure",type:"circle",source:this.id+"pointsMeasure",paint:{"circle-color":"#ffffff","circle-radius":this.option?this.option.pixelSize:3,"circle-stroke-width":2,"circle-stroke-color":this.option?this.option.color:"#ff0000"}}),cNt.value.addSource(this.id+"lineMeasure",{type:"geojson",data:this.jsonLine}),cNt.value.addLayer({id:this.id+"lineMeasure",type:"line",source:this.id+"lineMeasure",paint:{"line-color":this.option?this.option.lineColor:"#ff0000","line-width":this.option?this.option.lineWidth:2}}))}initLineLayer(){cNt.value.getSource(this.id+"lineMoveMeasure")?(this.id=d(0,10),this.initLineLayer()):(this.initLayer(),cNt.value.addSource(this.id+"lineMoveMeasure",{type:"geojson",data:this.jsonLine}),cNt.value.addLayer({id:this.id+"lineMoveMeasure",type:"line",source:this.id+"lineMoveMeasure",paint:{"line-color":this.option?this.option.lineColor:"#ff0000","line-width":this.option?this.option.lineWidth:2,"line-opacity":this.option?this.option.lineOpacity:.65}}))}initAreaLayer(){cNt.value.getSource(this.id+"areaMeasure")?(this.id=d(0,10),this.initAreaLayer()):(this.initLayer(),cNt.value.addSource(this.id+"areaMeasure",{type:"geojson",data:this.jsonPoint}),cNt.value.addLayer({id:this.id+"areaMeasure",type:"fill",source:this.id+"areaMeasure",paint:{"fill-color":this.option?this.option.fillColor:"#ff0000","fill-opacity":this.option?this.option.fillOpacity:.1}}),cNt.value.addLayer({id:this.id+"strokeMeasure",type:"line",source:this.id+"areaMeasure",paint:{"line-color":this.option?this.option.lineColor:"#ff0000","line-width":this.option?this.option.lineWidth:2,"line-opacity":this.option?this.option.lineOpacity:.65}}))}addPoint(t){if(this.jsonPoint.features.length>0){const e=this.jsonPoint.features[this.jsonPoint.features.length-1];this.jsonLine.features.push({type:"Feature",geometry:{type:"LineString",coordinates:[e.geometry.coordinates,t]},properties:null}),cNt.value.getSource(this.id+"lineMeasure").setData(this.jsonLine)}this.jsonPoint.features.push({type:"Feature",geometry:{type:"Point",coordinates:t},properties:null}),cNt.value.getSource(this.id+"pointsMeasure").setData(this.jsonPoint)}clearMapEvent(){cNt.value.off("click",this.mapClick),cNt.value.off("mousemove",this.mapMousemove),cNt.value.off("dblclick",this.mapDblclick),cNt.value.off("contextmenu",this.mapDblclick)}}function kf(t,e){const i=ye(k(t),{units:e&&e.units?e.units:"kilometers"}),n=e&&e.digit?e.digit:2;return i.toFixed(n)}class Nf extends(m(Of)){constructor(t){super(),this.option=t,this.jsonPoint={type:"FeatureCollection",features:[]},this.jsonLine={type:"FeatureCollection",features:[]},this.markers={tooltipDistance:null,clearLength:null},this.points=[[0,0]],this.points.pop(),this.initLineLayer(),this.initElement()}measureLength(t){cNt.value.doubleClickZoom.disable(),cNt.value.getCanvas().style.cursor="crosshair";const e=t=>{const e=[t.lngLat.lng,t.lngLat.lat];this.points.push(e),this.addMeasureRes(e),this.addPoint(e)};this.mapClick=e,cNt.value.on("click",e);const i=t=>{const e=[t.lngLat.lng,t.lngLat.lat];if(this.jsonPoint.features.length>0){const t={type:"Feature",geometry:{type:"LineString",coordinates:[this.jsonPoint.features[this.jsonPoint.features.length-1].geometry.coordinates,e]},properties:{}};cNt.value.getSource(this.id+"lineMoveMeasure").setData(t),this.ele&&(this.ele.innerHTML=this.getLength(e))}else this.ele&&(this.ele.innerHTML="点击地图开始测量");this.tooltipDistance.setLngLat(e)};this.mapMousemove=i,cNt.value.on("mousemove",i);const n=e=>{const i=[e.lngLat.lng,e.lngLat.lat];this.addPoint(i),cNt.value.getCanvas().style.cursor="",this.tooltipDistance.remove();const n=document.createElement("div"),r=document.createElement("span");r.setAttribute("style",`background: ${this.option?this.option.backgroundColor:"#333"} !important;\n\t\t\t\tfont-size: ${this.option?this.option.fontSize:"14px"};\n\t\t\t\tpadding: 3px 18px 3px 10px;\n\t\t\t\tcolor: ${this.option?this.option.fontColor:"#fff"};`);const o=document.createElement("span");o.setAttribute("style",`position: absolute;\n\t\t\t\ttop: 0px;\n\t\t\t\tright: 4px;\n\t\t\t\tcursor: pointer !important;\n\t\t\t\tfont-size: ${this.option?this.option.fontSize:"14px"};\n\t\t\t\tcolor: ${this.option?this.option.fontColor:"#fff"};`),o.innerHTML="×",n.appendChild(r),n.appendChild(o);const s={element:n,anchor:"left",offset:[8,0]},a=this.getLength(i);r.innerHTML=0===this.points.length?"起点":a,t&&t(this.jsonLine,a);const l=new cNt.value.mapboxgl.Marker(s).setLngLat(i).addTo(cNt.value);this.markers.clearLength=l,this.clearMapEvent(),o.onclick=t=>{t.stopPropagation(),cNt.value.doubleClickZoom.enable(),this.clear()}};this.mapDblclick=n,cNt.value.on("dblclick",n),cNt.value.on("contextmenu",n)}addMeasureRes(t){const e=document.createElement("div");e.setAttribute("style",`background: ${this.option?this.option.backgroundColor:"#333"} !important;\n\t\t\tfont-size: ${this.option?this.option.fontSize:"14px"};\n\t\t\tpadding: 3px 10px;\n\t\t\tcolor: ${this.option?this.option.fontColor:"#fff"};`);const i={element:e,anchor:"left",offset:[8,0]};e.innerHTML=0===this.points.length?"起点":this.getLength(t);const n=new cNt.value.mapboxgl.Marker(i).setLngLat(t).addTo(cNt.value);this.markers["markerLength"+this.points.length]=n}getLength(t){const e=this.points.concat([t]),i=Number(kf(e,{units:"meters"}));let n="";return n=i<1e3?i+"m":(i/1e3).toFixed(2)+"km",n}clear(){this.clearMapEvent(),cNt.value.getLayer(this.id+"pointsMeasure")&&(cNt.value.removeLayer(this.id+"pointsMeasure"),cNt.value.removeLayer(this.id+"lineMeasure"),cNt.value.removeLayer(this.id+"lineMoveMeasure"),cNt.value.removeSource(this.id+"pointsMeasure"),cNt.value.removeSource(this.id+"lineMeasure"),cNt.value.removeSource(this.id+"lineMoveMeasure"));for(const t in this.markers)t&&this.markers[t]&&(this.markers[t].remove(),this.markers[t]=null);this.points=[],this.jsonPoint={type:"FeatureCollection",features:[]},this.jsonLine={type:"FeatureCollection",features:[]},this.ele,this.tooltipDistance,this.mapClick,this.mapMousemove,this.mapDblclick}}function Bf(t,e){const i=e||2;return pe(O(t)).toFixed(i)}class zf extends(m(Of)){option;constructor(t){super(),this.option=t,this.jsonPoint={type:"FeatureCollection",features:[]},this.jsonLine={type:"FeatureCollection",features:[]},this.markers={tooltipDistance:null,clearLength:null},this.points=[[0,0]],this.points.pop(),this.initAreaLayer(),this.initElement()}measureArea(t){cNt.value.doubleClickZoom.disable(),cNt.value.getCanvas().style.cursor="crosshair";const e=t=>{const e=[t.lngLat.lng,t.lngLat.lat];this.points.push(e),this.addPoint(e)};this.mapClick=e,cNt.value.on("click",e);const i=t=>{const e=[t.lngLat.lng,t.lngLat.lat],i=this.jsonPoint.features.length;if(0===i)this.ele&&(this.ele.innerHTML="点击地图开始测量");else if(1===i)this.ele&&(this.ele.innerHTML="点击地图继续绘制");else{let t=this.points.concat([e]);t=t.concat([this.points[0]]);const i={type:"Feature",geometry:{type:"Polygon",coordinates:[t]},properties:{}};cNt.value.getSource(this.id+"areaMeasure").setData(i),this.callJson=i,this.ele&&(this.ele.innerHTML=this.getArea(e))}this.tooltipDistance.setLngLat(e)};this.mapMousemove=i,cNt.value.on("mousemove",i);const n=e=>{const i=[e.lngLat.lng,e.lngLat.lat];this.points.push(i);const n=this.getArea(i);this.tooltipDistance.remove();const r=document.createElement("div");r.setAttribute("class","measure-area"),r.setAttribute("style",`background: ${this.option?this.option.backgroundColor:"#333"} !important;\n\t\t\t\tfont-size: ${this.option?this.option.fontSize:"14px"};\n\t\t\t\tcolor: ${this.option?this.option.fontColor:"#fff"};`);const o=document.createElement("div");o.setAttribute("class","measure-area-html"),o.innerHTML=n;const s=document.createElement("div");s.setAttribute("style",`position: absolute;\n\t\t\t\ttop: 0px;\n\t\t\t\tright: 4px;\n\t\t\t\tcursor: pointer !important;\n\t\t\t\tfont-size: ${this.option?this.option.fontSize:"14px"};\n\t\t\t\tcolor: ${this.option?this.option.fontColor:"#fff"};`),this.clearMapEvent(),s.onclick=t=>{t.stopPropagation(),cNt.value.doubleClickZoom.enable(),this.clear()},s.innerHTML="×",o.appendChild(s),r.appendChild(o);const a={element:r,anchor:"bottom-left",offset:[-5,-10]},l={type:"Feature",geometry:{type:"Polygon",coordinates:[this.points]}};t&&t(this.callJson,n);const c=wt(l),u=new cNt.value.mapboxgl.Marker(a).setLngLat(c.geometry.coordinates).addTo(cNt.value);this.markers.lineAreas=u,cNt.value.getCanvas().style.cursor=""};this.mapDblclick=n,cNt.value.on("dblclick",n),cNt.value.on("contextmenu",n)}getArea(t){let e=this.points.concat([t]);e=e.concat([this.points[0]]);const i=Number(Bf([e]));let n="";return n=i<1e4?Math.round(i)+"m²":(i/1e6).toFixed(2)+"km²",n}clear(){this.clearMapEvent(),cNt.value.getLayer(this.id+"areaMeasure")&&(cNt.value.removeLayer(this.id+"pointsMeasure"),cNt.value.removeLayer(this.id+"lineMeasure"),cNt.value.removeLayer(this.id+"strokeMeasure"),cNt.value.removeLayer(this.id+"areaMeasure"),cNt.value.removeSource(this.id+"pointsMeasure"),cNt.value.removeSource(this.id+"lineMeasure"),cNt.value.removeSource(this.id+"areaMeasure"));for(const t in this.markers)t&&this.markers[t]&&(this.markers[t].remove(),this.markers[t]=null);this.points=[],this.jsonPoint={type:"FeatureCollection",features:[]},this.jsonLine={type:"FeatureCollection",features:[]},this.ele,this.tooltipDistance,this.mapClick,this.mapMousemove,this.mapDblclick}}class Ff{distanceObj;areaObj;option;ele;tooltipDistance;markers;jsonPoint;jsonLine;constructor(t){this.option=t,this.markers={tooltipDistance:null,clearLength:null},this.jsonPoint={type:"FeatureCollection",features:[]},this.jsonLine={type:"FeatureCollection",features:[]}}clearAll(){this.clearDistance(),this.clearArea()}measureDistance(t){const e=new Nf(this.option);this.distanceObj||(this.distanceObj=[]),this.distanceObj.push(e),e.measureLength(((e,i)=>{t&&t(e,i)}))}clearDistance(){if(this.distanceObj){for(const t of this.distanceObj)t.clear();this.distanceObj=[]}}measureArea(t){const e=new zf(this.option);this.areaObj||(this.areaObj=[]),this.areaObj.push(e),e.measureArea(((e,i)=>{t&&t(e,i)}))}clearArea(){if(this.areaObj){for(const t of this.areaObj)t.clear();this.areaObj=[]}}}class Vf extends id{id;_clusterOption;imageList;imageFormat;fontFormat;constructor(t,e,i){super(t,i,e),this.id=e,this._clusterOption=Object.assign({size:18,pixelRange:60,gradient:{1:"#00BFFF",10:"#008000",100:"#FFA500",1e3:"#FF0000"},fontSize:12,fontColor:"#fff",style:"circle",image:"./data/image/monitor.png",fontFamily:["Open Sans Regular","Arial Unicode MS Regular"],clustersFly:!0,isShow:!0},i),this.imageList={},this.imageFormat=["step",["get","point_count"]],this.fontFormat=["step",["get","point_count"],this._clusterOption.fontSize],this._addImage()}_addImage(){const t=[];Object.getOwnPropertyNames(this._clusterOption.gradient).forEach(((e,i)=>{const n=new Promise(((t,n)=>{let r;"circle"==this._clusterOption.style&&this._clusterOption.gradient?r=this._drawCircle(this._clusterOption.gradient[e],i):"spiral"==this._clusterOption.style&&this._clusterOption.gradient?r=this._drawClustering(this._clusterOption.gradient[e],i):"custom"==this._clusterOption.style&&this._clusterOption.gradient&&(r=this._clusterOption.gradient[e]),this.fontFormat.push(Number(e),(this._clusterOption.fontSize||12)+3*i);const o=`${this.id}-${e}-custer`;this.imageList[o]=r,0==i&&this.imageFormat.push(o),this.imageFormat.push(Number(e),o),cNt.value.loadImage(r,((e,i)=>{e?n(e):cNt.value.hasImage(o)?n("Image name already exists"):(cNt.value.addImage(o,i),t())}))}));t.push(n)})),Promise.all(t).then((()=>{this.renderCircle()})).catch((t=>{console.error("Error loading images:",t)}))}renderCircle(){cNt.value.addLayer({id:`${this.id}-clusters`,type:"symbol",source:`${this.id}source`,filter:["has","point_count"],layout:{"icon-image":this.imageFormat,"icon-allow-overlap":!0,visibility:this._options.isShow?"visible":"none"}}),cNt.value.addLayer({id:`${this.id}-clusters-count`,type:"symbol",source:`${this.id}source`,filter:["has","point_count"],layout:{"text-field":"{point_count}","text-font":this._clusterOption.fontFamily,"text-size":this.fontFormat,"text-allow-overlap":!0,visibility:this._options.isShow?"visible":"none"},paint:{"text-color":this._clusterOption.fontColor,"text-halo-width":.3,"text-halo-color":this._clusterOption.fontColor}}),this._clusterOption.clustersFly&&cNt.value.on("click",`${this.id}-clusters`,(t=>this.circleClick(t))),cNt.value.on("mouseenter",`${this.id}-clusters`,this.setCursor),cNt.value.on("mouseleave",`${this.id}-clusters`,this.setCursor)}setCursor=t=>{"mouseenter"==t.type?cNt.value.getCanvas().style.cursor="pointer":"mouseleave"==t.type&&(cNt.value.getCanvas().style.cursor="")};circleClick(t){const e=cNt.value.queryRenderedFeatures(t.point,{layers:[`${this.id}-clusters`]}),i=e[0].properties.cluster_id;cNt.value.getSource(`${this.id}source`).getClusterExpansionZoom(i,((t,i)=>{t||cNt.value.easeTo({center:e[0].geometry.coordinates,zoom:i})}))}flyToClusterPoint(t){let e;e=p(t)?$p(t,"point"):t,td(e,!0)}destroy(){cNt.value.getLayer(`${this.id}-clusters`)&&cNt.value.removeLayer(`${this.id}-clusters`),cNt.value.getLayer(`${this.id}-clusters-count`)&&cNt.value.removeLayer(`${this.id}-clusters-count`),cNt.value.off("click",`${this.id}-clusters`,(t=>this.circleClick(t))),cNt.value.off("mouseenter",`${this.id}-clusters`,this.setCursor),cNt.value.off("mouseleave",`${this.id}-clusters`,this.setCursor),this.removeImage(),super.destroy()}show(t){if(!cNt.value.getLayer(this.id))throw new Error(`Layer name "${this.id}" does not exist.`);{const e=t?"visible":"none";cNt.value.setLayoutProperty(`${this.id}-clusters`,"visibility",e),cNt.value.setLayoutProperty(`${this.id}-clusters-count`,"visibility",e),super.show(t)}}update(t){super.update(t)}highlight(t,e=!0){const i=cNt.value.getSource(this.id+"source")._data.features.find((e=>e.properties.id==t));if(e&&td(i,!0),!i||!this._options.highlightImageName)throw new Error(`The highlight id is ${t} does not exist`);{const t=i;cNt.value.addSource(this.id+"Highlightsource",{type:"geojson",data:t});const e="string"==typeof this._options.highlightImageName;cNt.value.addLayer({id:this.id+"Highlight",source:this.id+"Highlightsource",type:"symbol",layout:{visibility:this._options.isShow?"visible":"none","icon-image":e?this._options.highlightImageName:["get","highlightImageName"],"icon-size":this._options.scale},paint:{}})}}removeHighlight(){cNt.value.getLayer(this.id+"Highlight")&&cNt.value.removeLayer(this.id+"Highlight"),cNt.value.getSource(this.id+"Highlightsource")&&cNt.value.removeSource(this.id+"Highlightsource")}removeImage(t){t?cNt.value.hasImage(t+"-custer")&&cNt.value.removeImage(t+"-custer"):Object.keys(this.imageList).forEach((t=>{cNt.value.hasImage(t)&&cNt.value.removeImage(t)}))}_drawCircle(t,e){const i=2.5*(this._clusterOption.size?this._clusterOption.size:0)+15*e,n=document.createElement("canvas");n.width=i,n.height=i;const r=n.getContext("2d");return r&&(r.save(),r.scale(i/24,i/24),r.fillStyle=this._rgbToRgba(t,.2),r.beginPath(),r.arc(12,12,9,0,2*Math.PI),r.closePath(),r.fill(),r.beginPath(),r.arc(12,12,6,0,2*Math.PI),r.fillStyle=this._rgbToRgba(t,1),r.fill(),r.closePath(),r.restore()),n.toDataURL()}_drawClustering(t,e){const i=2.5*(this._clusterOption.size?this._clusterOption.size:0)+15*e;let n=-Math.PI/12;const r=Math.PI/2,o=Math.PI/6,s=document.createElement("canvas");s.width=i,s.height=i;const a=s.getContext("2d");if(a){a.save(),a.scale(i/24,i/24),a.beginPath(),a.arc(12,12,6,0,2*Math.PI),a.fillStyle=this._rgbToRgba(t,1),a.fill(),a.closePath(),a.lineWidth=2;for(let e=0;e<3;e++)a.beginPath(),a.arc(12,12,8,n,n+r,!1),a.strokeStyle=this._rgbToRgba(t,.4),a.stroke(),a.arc(12,12,11,n,n+r,!1),a.strokeStyle=this._rgbToRgba(t,.2),a.stroke(),a.closePath(),n=n+r+o;a.restore()}return s.toDataURL()}_hexTo10(t){if("#"===t.charAt(0)&&(t=t.substr(1)),6!==t.length)throw new Error("输入的不是有效的16进制颜色代码。");return`rgb(${parseInt(t.substr(0,2),16)},${parseInt(t.substr(2,2),16)},${parseInt(t.substr(4,2),16)})`}_rgbToRgba(t,e){const i=this._hexTo10(t).match(/(\d+),(\d+),(\d+)/);if(!i)throw new Error("输入的不是有效的 RGB 颜色值。");const n=parseInt(i[1]),r=parseInt(i[2]),o=parseInt(i[3]);if(e<0||e>1)throw new Error("透明度值必须在0到1之间。");return`rgba(${n},${r},${o},${e})`}}var Uf={exports:{}};!function(t,e){t.exports=function(){var t=function(t,e){var i={drag:[],click:[],mousemove:[],mousedown:[],mouseup:[],mouseout:[],keydown:[],keyup:[],touchstart:[],touchmove:[],touchend:[],tap:[]},n={on:function(t,e,n){if(void 0===i[t])throw new Error("Invalid event type: "+t);i[t].push({selector:e,fn:n})},render:function(t){e.store.featureChanged(t)}},r=function(t,r){for(var o=i[t],s=o.length;s--;){var a=o[s];if(a.selector(r)){a.fn.call(n,r)||e.store.render(),e.ui.updateMapClasses();break}}};return t.start.call(n),{render:t.render,stop:function(){t.stop&&t.stop()},trash:function(){t.trash&&(t.trash(),e.store.render())},combineFeatures:function(){t.combineFeatures&&t.combineFeatures()},uncombineFeatures:function(){t.uncombineFeatures&&t.uncombineFeatures()},drag:function(t){r("drag",t)},click:function(t){r("click",t)},mousemove:function(t){r("mousemove",t)},mousedown:function(t){r("mousedown",t)},mouseup:function(t){r("mouseup",t)},mouseout:function(t){r("mouseout",t)},keydown:function(t){r("keydown",t)},keyup:function(t){r("keyup",t)},touchstart:function(t){r("touchstart",t)},touchmove:function(t){r("touchmove",t)},touchend:function(t){r("touchend",t)},tap:function(t){r("tap",t)}}};function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function i(t){if(t.__esModule)return t;var e=t.default;if("function"==typeof e){var i=function t(){if(this instanceof t){var i=[null];return i.push.apply(i,arguments),new(Function.bind.apply(e,i))}return e.apply(this,arguments)};i.prototype=e.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(i,e,n.get?n:{enumerable:!0,get:function(){return t[e]}})})),i}var n={},r={RADIUS:6378137,FLATTENING:1/298.257223563,POLAR_RADIUS:6356752.3142},o=r;function s(t){var e=0;if(t&&t.length>0){e+=Math.abs(a(t[0]));for(var i=1;i<t.length;i++)e-=Math.abs(a(t[i]))}return e}function a(t){var e,i,n,r,s,a,c=0,u=t.length;if(u>2){for(a=0;a<u;a++)a===u-2?(n=u-2,r=u-1,s=0):a===u-1?(n=u-1,r=0,s=1):(n=a,r=a+1,s=a+2),e=t[n],i=t[r],c+=(l(t[s][0])-l(e[0]))*Math.sin(l(i[1]));c=c*o.RADIUS*o.RADIUS/2}return c}function l(t){return t*Math.PI/180}n.geometry=function t(e){var i,n=0;switch(e.type){case"Polygon":return s(e.coordinates);case"MultiPolygon":for(i=0;i<e.coordinates.length;i++)n+=s(e.coordinates[i]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(i=0;i<e.geometries.length;i++)n+=t(e.geometries[i]);return n}},n.ring=a;var c={CONTROL_BASE:"mapboxgl-ctrl",CONTROL_PREFIX:"mapboxgl-ctrl-",CONTROL_BUTTON:"mapbox-gl-draw_ctrl-draw-btn",CONTROL_BUTTON_LINE:"mapbox-gl-draw_line",CONTROL_BUTTON_POLYGON:"mapbox-gl-draw_polygon",CONTROL_BUTTON_POINT:"mapbox-gl-draw_point",CONTROL_BUTTON_TRASH:"mapbox-gl-draw_trash",CONTROL_BUTTON_COMBINE_FEATURES:"mapbox-gl-draw_combine",CONTROL_BUTTON_UNCOMBINE_FEATURES:"mapbox-gl-draw_uncombine",CONTROL_GROUP:"mapboxgl-ctrl-group",ATTRIBUTION:"mapboxgl-ctrl-attrib",ACTIVE_BUTTON:"active",BOX_SELECT:"mapbox-gl-draw_boxselect"},u={HOT:"mapbox-gl-draw-hot",COLD:"mapbox-gl-draw-cold"},h={ADD:"add",MOVE:"move",DRAG:"drag",POINTER:"pointer",NONE:"none"},p={POLYGON:"polygon",LINE:"line_string",POINT:"point"},d={FEATURE:"Feature",POLYGON:"Polygon",LINE_STRING:"LineString",POINT:"Point",FEATURE_COLLECTION:"FeatureCollection",MULTI_PREFIX:"Multi",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon"},f={DRAW_LINE_STRING:"draw_line_string",DRAW_POLYGON:"draw_polygon",DRAW_POINT:"draw_point",SIMPLE_SELECT:"simple_select",DIRECT_SELECT:"direct_select",STATIC:"static"},m={CREATE:"draw.create",DELETE:"draw.delete",UPDATE:"draw.update",SELECTION_CHANGE:"draw.selectionchange",MODE_CHANGE:"draw.modechange",ACTIONABLE:"draw.actionable",RENDER:"draw.render",COMBINE_FEATURES:"draw.combine",UNCOMBINE_FEATURES:"draw.uncombine"},g={MOVE:"move",CHANGE_COORDINATES:"change_coordinates"},y={FEATURE:"feature",MIDPOINT:"midpoint",VERTEX:"vertex"},v={ACTIVE:"true",INACTIVE:"false"},_=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate"],x=-85,b=Object.freeze({__proto__:null,classes:c,sources:u,cursors:h,types:p,geojsonTypes:d,modes:f,events:m,updateActions:g,meta:y,activeStates:v,interactions:_,LAT_MIN:-90,LAT_RENDERED_MIN:x,LAT_MAX:90,LAT_RENDERED_MAX:85,LNG_MIN:-270,LNG_MAX:270}),w={Point:0,LineString:1,MultiLineString:1,Polygon:2};function A(t,e){var i=w[t.geometry.type]-w[e.geometry.type];return 0===i&&t.geometry.type===d.POLYGON?t.area-e.area:i}function E(t){return t.map((function(t){return t.geometry.type===d.POLYGON&&(t.area=n.geometry({type:d.FEATURE,property:{},geometry:t.geometry})),t})).sort(A).map((function(t){return delete t.area,t}))}function S(t,e){return void 0===e&&(e=0),[[t.point.x-e,t.point.y-e],[t.point.x+e,t.point.y+e]]}function M(t){if(this._items={},this._nums={},this._length=t?t.length:0,t)for(var e=0,i=t.length;e<i;e++)this.add(t[e]),void 0!==t[e]&&("string"==typeof t[e]?this._items[t[e]]=e:this._nums[t[e]]=e)}M.prototype.add=function(t){return this.has(t)||(this._length++,"string"==typeof t?this._items[t]=this._length:this._nums[t]=this._length),this},M.prototype.delete=function(t){return!1===this.has(t)||(this._length--,delete this._items[t],delete this._nums[t]),this},M.prototype.has=function(t){return!("string"!=typeof t&&"number"!=typeof t||void 0===this._items[t]&&void 0===this._nums[t])},M.prototype.values=function(){var t=this,e=[];return Object.keys(this._items).forEach((function(i){e.push({k:i,v:t._items[i]})})),Object.keys(this._nums).forEach((function(i){e.push({k:JSON.parse(i),v:t._nums[i]})})),e.sort((function(t,e){return t.v-e.v})).map((function(t){return t.k}))},M.prototype.clear=function(){return this._length=0,this._items={},this._nums={},this};var T=[y.FEATURE,y.MIDPOINT,y.VERTEX],I={click:function(t,e,i){return C(t,e,i,i.options.clickBuffer)},touch:function(t,e,i){return C(t,e,i,i.options.touchBuffer)}};function C(t,e,i,n){if(null===i.map)return[];var r=t?S(t,n):e,o={};i.options.styles&&(o.layers=i.options.styles.map((function(t){return t.id})).filter((function(t){return null!=i.map.getLayer(t)})));var s=i.map.queryRenderedFeatures(r,o).filter((function(t){return-1!==T.indexOf(t.properties.meta)})),a=new M,l=[];return s.forEach((function(t){var e=t.properties.id;a.has(e)||(a.add(e),l.push(t))})),E(l)}function P(t,e){var i=I.click(t,null,e),n={mouse:h.NONE};return i[0]&&(n.mouse=i[0].properties.active===v.ACTIVE?h.MOVE:h.POINTER,n.feature=i[0].properties.meta),-1!==e.events.currentModeName().indexOf("draw")&&(n.mouse=h.ADD),e.ui.queueMapClasses(n),e.ui.updateMapClasses(),i[0]}function L(t,e){var i=t.x-e.x,n=t.y-e.y;return Math.sqrt(i*i+n*n)}function D(t,e,i){void 0===i&&(i={});var n=null!=i.fineTolerance?i.fineTolerance:4,r=null!=i.grossTolerance?i.grossTolerance:12,o=null!=i.interval?i.interval:500;t.point=t.point||e.point,t.time=t.time||e.time;var s=L(t.point,e.point);return s<n||s<r&&e.time-t.time<o}function R(t,e,i){void 0===i&&(i={});var n=null!=i.tolerance?i.tolerance:25,r=null!=i.interval?i.interval:250;return t.point=t.point||e.point,t.time=t.time||e.time,L(t.point,e.point)<n&&e.time-t.time<r}var O={exports:{}},k=O.exports=function(t,e){if(e||(e=16),void 0===t&&(t=128),t<=0)return"0";for(var i=Math.log(Math.pow(2,t))/Math.log(e),n=2;i===1/0;n*=2)i=Math.log(Math.pow(2,t/n))/Math.log(e)*n;var r=i-Math.floor(i),o="";for(n=0;n<Math.floor(i);n++)o=Math.floor(Math.random()*e).toString(e)+o;if(r){var s=Math.pow(e,r);o=Math.floor(Math.random()*s).toString(e)+o}var a=parseInt(o,e);return a!==1/0&&a>=Math.pow(2,t)?k(t,e):o};k.rack=function(t,e,i){var n=function(n){var o=0;do{if(o++>10){if(!i)throw new Error("too many ID collisions, use more bits");t+=i}var s=k(t,e)}while(Object.hasOwnProperty.call(r,s));return r[s]=n,s},r=n.hats={};return n.get=function(t){return n.hats[t]},n.set=function(t,e){return n.hats[t]=e,n},n.bits=t||128,n.base=e||16,n};var N=e(O.exports),B=function(t,e){this.ctx=t,this.properties=e.properties||{},this.coordinates=e.geometry.coordinates,this.id=e.id||N(),this.type=e.geometry.type};B.prototype.changed=function(){this.ctx.store.featureChanged(this.id)},B.prototype.incomingCoords=function(t){this.setCoordinates(t)},B.prototype.setCoordinates=function(t){this.coordinates=t,this.changed()},B.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.coordinates))},B.prototype.setProperty=function(t,e){this.properties[t]=e},B.prototype.toGeoJSON=function(){return JSON.parse(JSON.stringify({id:this.id,type:d.FEATURE,properties:this.properties,geometry:{coordinates:this.getCoordinates(),type:this.type}}))},B.prototype.internal=function(t){var e={id:this.id,meta:y.FEATURE,"meta:type":this.type,active:v.INACTIVE,mode:t};if(this.ctx.options.userProperties)for(var i in this.properties)e["user_"+i]=this.properties[i];return{type:d.FEATURE,properties:e,geometry:{coordinates:this.getCoordinates(),type:this.type}}};var z=function(t,e){B.call(this,t,e)};(z.prototype=Object.create(B.prototype)).isValid=function(){return"number"==typeof this.coordinates[0]&&"number"==typeof this.coordinates[1]},z.prototype.updateCoordinate=function(t,e,i){this.coordinates=3===arguments.length?[e,i]:[t,e],this.changed()},z.prototype.getCoordinate=function(){return this.getCoordinates()};var F=function(t,e){B.call(this,t,e)};(F.prototype=Object.create(B.prototype)).isValid=function(){return this.coordinates.length>1},F.prototype.addCoordinate=function(t,e,i){this.changed();var n=parseInt(t,10);this.coordinates.splice(n,0,[e,i])},F.prototype.getCoordinate=function(t){var e=parseInt(t,10);return JSON.parse(JSON.stringify(this.coordinates[e]))},F.prototype.removeCoordinate=function(t){this.changed(),this.coordinates.splice(parseInt(t,10),1)},F.prototype.updateCoordinate=function(t,e,i){var n=parseInt(t,10);this.coordinates[n]=[e,i],this.changed()};var V=function(t,e){B.call(this,t,e),this.coordinates=this.coordinates.map((function(t){return t.slice(0,-1)}))};(V.prototype=Object.create(B.prototype)).isValid=function(){return 0!==this.coordinates.length&&this.coordinates.every((function(t){return t.length>2}))},V.prototype.incomingCoords=function(t){this.coordinates=t.map((function(t){return t.slice(0,-1)})),this.changed()},V.prototype.setCoordinates=function(t){this.coordinates=t,this.changed()},V.prototype.addCoordinate=function(t,e,i){this.changed();var n=t.split(".").map((function(t){return parseInt(t,10)}));this.coordinates[n[0]].splice(n[1],0,[e,i])},V.prototype.removeCoordinate=function(t){this.changed();var e=t.split(".").map((function(t){return parseInt(t,10)})),i=this.coordinates[e[0]];i&&(i.splice(e[1],1),i.length<3&&this.coordinates.splice(e[0],1))},V.prototype.getCoordinate=function(t){var e=t.split(".").map((function(t){return parseInt(t,10)})),i=this.coordinates[e[0]];return JSON.parse(JSON.stringify(i[e[1]]))},V.prototype.getCoordinates=function(){return this.coordinates.map((function(t){return t.concat([t[0]])}))},V.prototype.updateCoordinate=function(t,e,i){this.changed();var n=t.split("."),r=parseInt(n[0],10),o=parseInt(n[1],10);void 0===this.coordinates[r]&&(this.coordinates[r]=[]),this.coordinates[r][o]=[e,i]};var U={MultiPoint:z,MultiLineString:F,MultiPolygon:V},G=function(t,e,i,n,r){var o=i.split("."),s=parseInt(o[0],10),a=o[1]?o.slice(1).join("."):null;return t[s][e](a,n,r)},j=function(t,e){if(B.call(this,t,e),delete this.coordinates,this.model=U[e.geometry.type],void 0===this.model)throw new TypeError(e.geometry.type+" is not a valid type");this.features=this._coordinatesToFeatures(e.geometry.coordinates)};function H(t){this.map=t.map,this.drawConfig=JSON.parse(JSON.stringify(t.options||{})),this._ctx=t}(j.prototype=Object.create(B.prototype))._coordinatesToFeatures=function(t){var e=this,i=this.model.bind(this);return t.map((function(t){return new i(e.ctx,{id:N(),type:d.FEATURE,properties:{},geometry:{coordinates:t,type:e.type.replace("Multi","")}})}))},j.prototype.isValid=function(){return this.features.every((function(t){return t.isValid()}))},j.prototype.setCoordinates=function(t){this.features=this._coordinatesToFeatures(t),this.changed()},j.prototype.getCoordinate=function(t){return G(this.features,"getCoordinate",t)},j.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.features.map((function(t){return t.type===d.POLYGON?t.getCoordinates():t.coordinates}))))},j.prototype.updateCoordinate=function(t,e,i){G(this.features,"updateCoordinate",t,e,i),this.changed()},j.prototype.addCoordinate=function(t,e,i){G(this.features,"addCoordinate",t,e,i),this.changed()},j.prototype.removeCoordinate=function(t){G(this.features,"removeCoordinate",t),this.changed()},j.prototype.getFeatures=function(){return this.features},H.prototype.setSelected=function(t){return this._ctx.store.setSelected(t)},H.prototype.setSelectedCoordinates=function(t){var e=this;this._ctx.store.setSelectedCoordinates(t),t.reduce((function(t,i){return void 0===t[i.feature_id]&&(t[i.feature_id]=!0,e._ctx.store.get(i.feature_id).changed()),t}),{})},H.prototype.getSelected=function(){return this._ctx.store.getSelected()},H.prototype.getSelectedIds=function(){return this._ctx.store.getSelectedIds()},H.prototype.isSelected=function(t){return this._ctx.store.isSelected(t)},H.prototype.getFeature=function(t){return this._ctx.store.get(t)},H.prototype.select=function(t){return this._ctx.store.select(t)},H.prototype.deselect=function(t){return this._ctx.store.deselect(t)},H.prototype.deleteFeature=function(t,e){return void 0===e&&(e={}),this._ctx.store.delete(t,e)},H.prototype.addFeature=function(t){return this._ctx.store.add(t)},H.prototype.clearSelectedFeatures=function(){return this._ctx.store.clearSelected()},H.prototype.clearSelectedCoordinates=function(){return this._ctx.store.clearSelectedCoordinates()},H.prototype.setActionableState=function(t){void 0===t&&(t={});var e={trash:t.trash||!1,combineFeatures:t.combineFeatures||!1,uncombineFeatures:t.uncombineFeatures||!1};return this._ctx.events.actionable(e)},H.prototype.changeMode=function(t,e,i){return void 0===e&&(e={}),void 0===i&&(i={}),this._ctx.events.changeMode(t,e,i)},H.prototype.updateUIClasses=function(t){return this._ctx.ui.queueMapClasses(t)},H.prototype.activateUIButton=function(t){return this._ctx.ui.setActiveButton(t)},H.prototype.featuresAt=function(t,e,i){if(void 0===i&&(i="click"),"click"!==i&&"touch"!==i)throw new Error("invalid buffer type");return I[i](t,e,this._ctx)},H.prototype.newFeature=function(t){var e=t.geometry.type;return e===d.POINT?new z(this._ctx,t):e===d.LINE_STRING?new F(this._ctx,t):e===d.POLYGON?new V(this._ctx,t):new j(this._ctx,t)},H.prototype.isInstanceOf=function(t,e){if(t===d.POINT)return e instanceof z;if(t===d.LINE_STRING)return e instanceof F;if(t===d.POLYGON)return e instanceof V;if("MultiFeature"===t)return e instanceof j;throw new Error("Unknown feature class: "+t)},H.prototype.doRender=function(t){return this._ctx.store.featureChanged(t)},H.prototype.onSetup=function(){},H.prototype.onDrag=function(){},H.prototype.onClick=function(){},H.prototype.onMouseMove=function(){},H.prototype.onMouseDown=function(){},H.prototype.onMouseUp=function(){},H.prototype.onMouseOut=function(){},H.prototype.onKeyUp=function(){},H.prototype.onKeyDown=function(){},H.prototype.onTouchStart=function(){},H.prototype.onTouchMove=function(){},H.prototype.onTouchEnd=function(){},H.prototype.onTap=function(){},H.prototype.onStop=function(){},H.prototype.onTrash=function(){},H.prototype.onCombineFeature=function(){},H.prototype.onUncombineFeature=function(){},H.prototype.toDisplayFeatures=function(){throw new Error("You must overwrite toDisplayFeatures")};var W={drag:"onDrag",click:"onClick",mousemove:"onMouseMove",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseout:"onMouseOut",keyup:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",tap:"onTap"},q=Object.keys(W);function X(t){var e=Object.keys(t);return function(i,n){void 0===n&&(n={});var r={},o=e.reduce((function(e,i){return e[i]=t[i],e}),new H(i));return{start:function(){var e=this;r=o.onSetup(n),q.forEach((function(i){var n,s=W[i],a=function(){return!1};t[s]&&(a=function(){return!0}),e.on(i,a,(n=s,function(t){return o[n](r,t)}))}))},stop:function(){o.onStop(r)},trash:function(){o.onTrash(r)},combineFeatures:function(){o.onCombineFeatures(r)},uncombineFeatures:function(){o.onUncombineFeatures(r)},render:function(t,e){o.toDisplayFeatures(r,t,e)}}}}function Z(t){return[].concat(t).filter((function(t){return void 0!==t}))}function Y(){var t=this;if(!t.ctx.map||void 0===t.ctx.map.getSource(u.HOT))return l();var e=t.ctx.events.currentModeName();t.ctx.ui.queueMapClasses({mode:e});var i=[],n=[];t.isDirty?n=t.getAllIds():(i=t.getChangedIds().filter((function(e){return void 0!==t.get(e)})),n=t.sources.hot.filter((function(e){return e.properties.id&&-1===i.indexOf(e.properties.id)&&void 0!==t.get(e.properties.id)})).map((function(t){return t.properties.id}))),t.sources.hot=[];var r=t.sources.cold.length;t.sources.cold=t.isDirty?[]:t.sources.cold.filter((function(t){var e=t.properties.id||t.properties.parent;return-1===i.indexOf(e)}));var o=r!==t.sources.cold.length||n.length>0;function s(i,n){var r=t.get(i).internal(e);t.ctx.events.currentModeRender(r,(function(e){t.sources[n].push(e)}))}if(i.forEach((function(t){return s(t,"hot")})),n.forEach((function(t){return s(t,"cold")})),o&&t.ctx.map.getSource(u.COLD).setData({type:d.FEATURE_COLLECTION,features:t.sources.cold}),t.ctx.map.getSource(u.HOT).setData({type:d.FEATURE_COLLECTION,features:t.sources.hot}),t._emitSelectionChange&&(t.ctx.map.fire(m.SELECTION_CHANGE,{features:t.getSelected().map((function(t){return t.toGeoJSON()})),points:t.getSelectedCoordinates().map((function(t){return{type:d.FEATURE,properties:{},geometry:{type:d.POINT,coordinates:t.coordinates}}}))}),t._emitSelectionChange=!1),t._deletedFeaturesToEmit.length){var a=t._deletedFeaturesToEmit.map((function(t){return t.toGeoJSON()}));t._deletedFeaturesToEmit=[],t.ctx.map.fire(m.DELETE,{features:a})}function l(){t.isDirty=!1,t.clearChangedIds()}l(),t.ctx.map.fire(m.RENDER,{})}function Q(t){var e,i=this;this._features={},this._featureIds=new M,this._selectedFeatureIds=new M,this._selectedCoordinates=[],this._changedFeatureIds=new M,this._deletedFeaturesToEmit=[],this._emitSelectionChange=!1,this._mapInitialConfig={},this.ctx=t,this.sources={hot:[],cold:[]},this.render=function(){e||(e=requestAnimationFrame((function(){e=null,Y.call(i)})))},this.isDirty=!1}function J(t,e){var i=t._selectedCoordinates.filter((function(e){return t._selectedFeatureIds.has(e.feature_id)}));t._selectedCoordinates.length===i.length||e.silent||(t._emitSelectionChange=!0),t._selectedCoordinates=i}Q.prototype.createRenderBatch=function(){var t=this,e=this.render,i=0;return this.render=function(){i++},function(){t.render=e,i>0&&t.render()}},Q.prototype.setDirty=function(){return this.isDirty=!0,this},Q.prototype.featureChanged=function(t){return this._changedFeatureIds.add(t),this},Q.prototype.getChangedIds=function(){return this._changedFeatureIds.values()},Q.prototype.clearChangedIds=function(){return this._changedFeatureIds.clear(),this},Q.prototype.getAllIds=function(){return this._featureIds.values()},Q.prototype.add=function(t){return this.featureChanged(t.id),this._features[t.id]=t,this._featureIds.add(t.id),this},Q.prototype.delete=function(t,e){var i=this;return void 0===e&&(e={}),Z(t).forEach((function(t){i._featureIds.has(t)&&(i._featureIds.delete(t),i._selectedFeatureIds.delete(t),e.silent||-1===i._deletedFeaturesToEmit.indexOf(i._features[t])&&i._deletedFeaturesToEmit.push(i._features[t]),delete i._features[t],i.isDirty=!0)})),J(this,e),this},Q.prototype.get=function(t){return this._features[t]},Q.prototype.getAll=function(){var t=this;return Object.keys(this._features).map((function(e){return t._features[e]}))},Q.prototype.select=function(t,e){var i=this;return void 0===e&&(e={}),Z(t).forEach((function(t){i._selectedFeatureIds.has(t)||(i._selectedFeatureIds.add(t),i._changedFeatureIds.add(t),e.silent||(i._emitSelectionChange=!0))})),this},Q.prototype.deselect=function(t,e){var i=this;return void 0===e&&(e={}),Z(t).forEach((function(t){i._selectedFeatureIds.has(t)&&(i._selectedFeatureIds.delete(t),i._changedFeatureIds.add(t),e.silent||(i._emitSelectionChange=!0))})),J(this,e),this},Q.prototype.clearSelected=function(t){return void 0===t&&(t={}),this.deselect(this._selectedFeatureIds.values(),{silent:t.silent}),this},Q.prototype.setSelected=function(t,e){var i=this;return void 0===e&&(e={}),t=Z(t),this.deselect(this._selectedFeatureIds.values().filter((function(e){return-1===t.indexOf(e)})),{silent:e.silent}),this.select(t.filter((function(t){return!i._selectedFeatureIds.has(t)})),{silent:e.silent}),this},Q.prototype.setSelectedCoordinates=function(t){return this._selectedCoordinates=t,this._emitSelectionChange=!0,this},Q.prototype.clearSelectedCoordinates=function(){return this._selectedCoordinates=[],this._emitSelectionChange=!0,this},Q.prototype.getSelectedIds=function(){return this._selectedFeatureIds.values()},Q.prototype.getSelected=function(){var t=this;return this._selectedFeatureIds.values().map((function(e){return t.get(e)}))},Q.prototype.getSelectedCoordinates=function(){var t=this;return this._selectedCoordinates.map((function(e){return{coordinates:t.get(e.feature_id).getCoordinate(e.coord_path)}}))},Q.prototype.isSelected=function(t){return this._selectedFeatureIds.has(t)},Q.prototype.setFeatureProperty=function(t,e,i){this.get(t).setProperty(e,i),this.featureChanged(t)},Q.prototype.storeMapConfig=function(){var t=this;_.forEach((function(e){t.ctx.map[e]&&(t._mapInitialConfig[e]=t.ctx.map[e].isEnabled())}))},Q.prototype.restoreMapConfig=function(){var t=this;Object.keys(this._mapInitialConfig).forEach((function(e){t._mapInitialConfig[e]?t.ctx.map[e].enable():t.ctx.map[e].disable()}))},Q.prototype.getInitialConfigValue=function(t){return void 0===this._mapInitialConfig[t]||this._mapInitialConfig[t]};var K=function(){for(var t=arguments,e={},i=0;i<arguments.length;i++){var n=t[i];for(var r in n)$.call(n,r)&&(e[r]=n[r])}return e},$=Object.prototype.hasOwnProperty,tt=e(K),et=["mode","feature","mouse"];function it(e){var i=null,n=null,r={onRemove:function(){return e.map.off("load",r.connect),clearInterval(n),r.removeLayers(),e.store.restoreMapConfig(),e.ui.removeButtons(),e.events.removeEventListeners(),e.ui.clearMapClasses(),e.boxZoomInitial&&e.map.boxZoom.enable(),e.map=null,e.container=null,e.store=null,i&&i.parentNode&&i.parentNode.removeChild(i),i=null,this},connect:function(){e.map.off("load",r.connect),clearInterval(n),r.addLayers(),e.store.storeMapConfig(),e.events.addEventListeners()},onAdd:function(o){var s=o.fire;return o.fire=function(t,e){var i=arguments;return 1===s.length&&1!==arguments.length&&(i=[tt({},{type:t},e)]),s.apply(o,i)},e.map=o,e.events=function(e){var i=Object.keys(e.options.modes).reduce((function(t,i){return t[i]=X(e.options.modes[i]),t}),{}),n={},r={},o={},s=null,a=null;o.drag=function(t,i){i({point:t.point,time:(new Date).getTime()})?(e.ui.queueMapClasses({mouse:h.DRAG}),a.drag(t)):t.originalEvent.stopPropagation()},o.mousedrag=function(t){o.drag(t,(function(t){return!D(n,t)}))},o.touchdrag=function(t){o.drag(t,(function(t){return!R(r,t)}))},o.mousemove=function(t){if(1===(void 0!==t.originalEvent.buttons?t.originalEvent.buttons:t.originalEvent.which))return o.mousedrag(t);var i=P(t,e);t.featureTarget=i,a.mousemove(t)},o.mousedown=function(t){n={time:(new Date).getTime(),point:t.point};var i=P(t,e);t.featureTarget=i,a.mousedown(t)},o.mouseup=function(t){var i=P(t,e);t.featureTarget=i,D(n,{point:t.point,time:(new Date).getTime()})?a.click(t):a.mouseup(t)},o.mouseout=function(t){a.mouseout(t)},o.touchstart=function(t){if(e.options.touchEnabled){r={time:(new Date).getTime(),point:t.point};var i=I.touch(t,null,e)[0];t.featureTarget=i,a.touchstart(t)}},o.touchmove=function(t){if(e.options.touchEnabled)return a.touchmove(t),o.touchdrag(t)},o.touchend=function(t){if(t.originalEvent.preventDefault(),e.options.touchEnabled){var i=I.touch(t,null,e)[0];t.featureTarget=i,R(r,{time:(new Date).getTime(),point:t.point})?a.tap(t):a.touchend(t)}};var l=function(t){return!(8===t||46===t||t>=48&&t<=57)};function c(n,r,o){void 0===o&&(o={}),a.stop();var l=i[n];if(void 0===l)throw new Error(n+" is not valid");s=n;var c=l(e,r);a=t(c,e),o.silent||e.map.fire(m.MODE_CHANGE,{mode:n}),e.store.setDirty(),e.store.render()}o.keydown=function(t){(t.srcElement||t.target).classList.contains("mapboxgl-canvas")&&(8!==t.keyCode&&46!==t.keyCode||!e.options.controls.trash?l(t.keyCode)?a.keydown(t):49===t.keyCode&&e.options.controls.point?c(f.DRAW_POINT):50===t.keyCode&&e.options.controls.line_string?c(f.DRAW_LINE_STRING):51===t.keyCode&&e.options.controls.polygon&&c(f.DRAW_POLYGON):(t.preventDefault(),a.trash()))},o.keyup=function(t){l(t.keyCode)&&a.keyup(t)},o.zoomend=function(){e.store.changeZoom()},o.data=function(t){if("style"===t.dataType){var i=e.setup,n=e.map,r=e.options,o=e.store;r.styles.some((function(t){return n.getLayer(t.id)}))||(i.addLayers(),o.setDirty(),o.render())}};var u={trash:!1,combineFeatures:!1,uncombineFeatures:!1};return{start:function(){s=e.options.defaultMode,a=t(i[s](e),e)},changeMode:c,actionable:function(t){var i=!1;Object.keys(t).forEach((function(e){if(void 0===u[e])throw new Error("Invalid action type");u[e]!==t[e]&&(i=!0),u[e]=t[e]})),i&&e.map.fire(m.ACTIONABLE,{actions:u})},currentModeName:function(){return s},currentModeRender:function(t,e){return a.render(t,e)},fire:function(t,e){o[t]&&o[t](e)},addEventListeners:function(){e.map.on("mousemove",o.mousemove),e.map.on("mousedown",o.mousedown),e.map.on("mouseup",o.mouseup),e.map.on("data",o.data),e.map.on("touchmove",o.touchmove),e.map.on("touchstart",o.touchstart),e.map.on("touchend",o.touchend),e.container.addEventListener("mouseout",o.mouseout),e.options.keybindings&&(e.container.addEventListener("keydown",o.keydown),e.container.addEventListener("keyup",o.keyup))},removeEventListeners:function(){e.map.off("mousemove",o.mousemove),e.map.off("mousedown",o.mousedown),e.map.off("mouseup",o.mouseup),e.map.off("data",o.data),e.map.off("touchmove",o.touchmove),e.map.off("touchstart",o.touchstart),e.map.off("touchend",o.touchend),e.container.removeEventListener("mouseout",o.mouseout),e.options.keybindings&&(e.container.removeEventListener("keydown",o.keydown),e.container.removeEventListener("keyup",o.keyup))},trash:function(t){a.trash(t)},combineFeatures:function(){a.combineFeatures()},uncombineFeatures:function(){a.uncombineFeatures()},getMode:function(){return s}}}(e),e.ui=function(t){var e={},i=null,n={mode:null,feature:null,mouse:null},r={mode:null,feature:null,mouse:null};function o(t){r=tt(r,t)}function s(){var e,i;if(t.container){var o=[],s=[];et.forEach((function(t){r[t]!==n[t]&&(o.push(t+"-"+n[t]),null!==r[t]&&s.push(t+"-"+r[t]))})),o.length>0&&(e=t.container.classList).remove.apply(e,o),s.length>0&&(i=t.container.classList).add.apply(i,s),n=tt(n,r)}}function a(t,e){void 0===e&&(e={});var n=document.createElement("button");return n.className=c.CONTROL_BUTTON+" "+e.className,n.setAttribute("title",e.title),e.container.appendChild(n),n.addEventListener("click",(function(n){if(n.preventDefault(),n.stopPropagation(),n.target===i)return l(),void e.onDeactivate();u(t),e.onActivate()}),!0),n}function l(){i&&(i.classList.remove(c.ACTIVE_BUTTON),i=null)}function u(t){l();var n=e[t];n&&n&&"trash"!==t&&(n.classList.add(c.ACTIVE_BUTTON),i=n)}return{setActiveButton:u,queueMapClasses:o,updateMapClasses:s,clearMapClasses:function(){o({mode:null,feature:null,mouse:null}),s()},addButtons:function(){var i=t.options.controls,n=document.createElement("div");return n.className=c.CONTROL_GROUP+" "+c.CONTROL_BASE,i?(i[p.LINE]&&(e[p.LINE]=a(p.LINE,{container:n,className:c.CONTROL_BUTTON_LINE,title:"LineString tool "+(t.options.keybindings?"(l)":""),onActivate:function(){return t.events.changeMode(f.DRAW_LINE_STRING)},onDeactivate:function(){return t.events.trash()}})),i[p.POLYGON]&&(e[p.POLYGON]=a(p.POLYGON,{container:n,className:c.CONTROL_BUTTON_POLYGON,title:"Polygon tool "+(t.options.keybindings?"(p)":""),onActivate:function(){return t.events.changeMode(f.DRAW_POLYGON)},onDeactivate:function(){return t.events.trash()}})),i[p.POINT]&&(e[p.POINT]=a(p.POINT,{container:n,className:c.CONTROL_BUTTON_POINT,title:"Marker tool "+(t.options.keybindings?"(m)":""),onActivate:function(){return t.events.changeMode(f.DRAW_POINT)},onDeactivate:function(){return t.events.trash()}})),i.trash&&(e.trash=a("trash",{container:n,className:c.CONTROL_BUTTON_TRASH,title:"Delete",onActivate:function(){t.events.trash()}})),i.combine_features&&(e.combine_features=a("combineFeatures",{container:n,className:c.CONTROL_BUTTON_COMBINE_FEATURES,title:"Combine",onActivate:function(){t.events.combineFeatures()}})),i.uncombine_features&&(e.uncombine_features=a("uncombineFeatures",{container:n,className:c.CONTROL_BUTTON_UNCOMBINE_FEATURES,title:"Uncombine",onActivate:function(){t.events.uncombineFeatures()}})),n):n},removeButtons:function(){Object.keys(e).forEach((function(t){var i=e[t];i.parentNode&&i.parentNode.removeChild(i),delete e[t]}))}}}(e),e.container=o.getContainer(),e.store=new Q(e),i=e.ui.addButtons(),e.options.boxSelect&&(e.boxZoomInitial=o.boxZoom.isEnabled(),o.boxZoom.disable(),o.dragPan.disable(),o.dragPan.enable()),o.loaded()?r.connect():(o.on("load",r.connect),n=setInterval((function(){o.loaded()&&r.connect()}),16)),e.events.start(),i},addLayers:function(){e.map.addSource(u.COLD,{data:{type:d.FEATURE_COLLECTION,features:[]},type:"geojson"}),e.map.addSource(u.HOT,{data:{type:d.FEATURE_COLLECTION,features:[]},type:"geojson"}),e.options.styles.forEach((function(t){e.map.addLayer(t)})),e.store.setDirty(!0),e.store.render()},removeLayers:function(){e.options.styles.forEach((function(t){e.map.getLayer(t.id)&&e.map.removeLayer(t.id)})),e.map.getSource(u.COLD)&&e.map.removeSource(u.COLD),e.map.getSource(u.HOT)&&e.map.removeSource(u.HOT)}};return e.setup=r,r}var rt=[{id:"gl-draw-polygon-fill-inactive",type:"fill",filter:["all",["==","active","false"],["==","$type","Polygon"],["!=","mode","static"]],paint:{"fill-color":"#3bb2d0","fill-outline-color":"#3bb2d0","fill-opacity":.1}},{id:"gl-draw-polygon-fill-active",type:"fill",filter:["all",["==","active","true"],["==","$type","Polygon"]],paint:{"fill-color":"#fbb03b","fill-outline-color":"#fbb03b","fill-opacity":.1}},{id:"gl-draw-polygon-midpoint",type:"circle",filter:["all",["==","$type","Point"],["==","meta","midpoint"]],paint:{"circle-radius":3,"circle-color":"#fbb03b"}},{id:"gl-draw-polygon-stroke-inactive",type:"line",filter:["all",["==","active","false"],["==","$type","Polygon"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#3bb2d0","line-width":2}},{id:"gl-draw-polygon-stroke-active",type:"line",filter:["all",["==","active","true"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fbb03b","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-line-inactive",type:"line",filter:["all",["==","active","false"],["==","$type","LineString"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#3bb2d0","line-width":2}},{id:"gl-draw-line-active",type:"line",filter:["all",["==","$type","LineString"],["==","active","true"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fbb03b","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-polygon-and-line-vertex-stroke-inactive",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":5,"circle-color":"#fff"}},{id:"gl-draw-polygon-and-line-vertex-inactive",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":3,"circle-color":"#fbb03b"}},{id:"gl-draw-point-point-stroke-inactive",type:"circle",filter:["all",["==","active","false"],["==","$type","Point"],["==","meta","feature"],["!=","mode","static"]],paint:{"circle-radius":5,"circle-opacity":1,"circle-color":"#fff"}},{id:"gl-draw-point-inactive",type:"circle",filter:["all",["==","active","false"],["==","$type","Point"],["==","meta","feature"],["!=","mode","static"]],paint:{"circle-radius":3,"circle-color":"#3bb2d0"}},{id:"gl-draw-point-stroke-active",type:"circle",filter:["all",["==","$type","Point"],["==","active","true"],["!=","meta","midpoint"]],paint:{"circle-radius":7,"circle-color":"#fff"}},{id:"gl-draw-point-active",type:"circle",filter:["all",["==","$type","Point"],["!=","meta","midpoint"],["==","active","true"]],paint:{"circle-radius":5,"circle-color":"#fbb03b"}},{id:"gl-draw-polygon-fill-static",type:"fill",filter:["all",["==","mode","static"],["==","$type","Polygon"]],paint:{"fill-color":"#404040","fill-outline-color":"#404040","fill-opacity":.1}},{id:"gl-draw-polygon-stroke-static",type:"line",filter:["all",["==","mode","static"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#404040","line-width":2}},{id:"gl-draw-line-static",type:"line",filter:["all",["==","mode","static"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#404040","line-width":2}},{id:"gl-draw-point-static",type:"circle",filter:["all",["==","mode","static"],["==","$type","Point"]],paint:{"circle-radius":5,"circle-color":"#404040"}}];function ot(t){return function(e){var i=e.featureTarget;return!!i&&!!i.properties&&i.properties.meta===t}}function st(t){return!!t.originalEvent&&!!t.originalEvent.shiftKey&&0===t.originalEvent.button}function at(t){return!!t.featureTarget&&!!t.featureTarget.properties&&t.featureTarget.properties.active===v.ACTIVE&&t.featureTarget.properties.meta===y.FEATURE}function lt(t){return!!t.featureTarget&&!!t.featureTarget.properties&&t.featureTarget.properties.active===v.INACTIVE&&t.featureTarget.properties.meta===y.FEATURE}function ct(t){return void 0===t.featureTarget}function ut(t){return!!t.featureTarget&&!!t.featureTarget.properties&&t.featureTarget.properties.meta===y.FEATURE}function ht(t){var e=t.featureTarget;return!!e&&!!e.properties&&e.properties.meta===y.VERTEX}function pt(t){return!!t.originalEvent&&!0===t.originalEvent.shiftKey}function dt(t){return 27===t.keyCode}function ft(t){return 13===t.keyCode}var mt=Object.freeze({__proto__:null,isOfMetaType:ot,isShiftMousedown:st,isActiveFeature:at,isInactiveFeature:lt,noTarget:ct,isFeature:ut,isVertex:ht,isShiftDown:pt,isEscapeKey:dt,isEnterKey:ft,isTrue:function(){return!0}}),gt=yt;function yt(t,e){this.x=t,this.y=e}yt.prototype={clone:function(){return new yt(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},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(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,i=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=i,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),i=Math.sin(t),n=e*this.x-i*this.y,r=i*this.x+e*this.y;return this.x=n,this.y=r,this},_rotateAround:function(t,e){var i=Math.cos(t),n=Math.sin(t),r=e.x+i*(this.x-e.x)-n*(this.y-e.y),o=e.y+n*(this.x-e.x)+i*(this.y-e.y);return this.x=r,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},yt.convert=function(t){return t instanceof yt?t:Array.isArray(t)?new yt(t[0],t[1]):t};var vt=e(gt);function _t(t,e){var i=e.getBoundingClientRect();return new vt(t.clientX-i.left-(e.clientLeft||0),t.clientY-i.top-(e.clientTop||0))}function xt(t,e,i,n){return{type:d.FEATURE,properties:{meta:y.VERTEX,parent:t,coord_path:i,active:n?v.ACTIVE:v.INACTIVE},geometry:{type:d.POINT,coordinates:e}}}function bt(t,e,i){var n=e.geometry.coordinates,r=i.geometry.coordinates;if(n[1]>85||n[1]<x||r[1]>85||r[1]<x)return null;var o={lng:(n[0]+r[0])/2,lat:(n[1]+r[1])/2};return{type:d.FEATURE,properties:{meta:y.MIDPOINT,parent:t,lng:o.lng,lat:o.lat,coord_path:i.properties.coord_path},geometry:{type:d.POINT,coordinates:[o.lng,o.lat]}}}function wt(t,e,i){void 0===e&&(e={}),void 0===i&&(i=null);var n,r=t.geometry,o=r.type,s=r.coordinates,a=t.properties&&t.properties.id,l=[];function c(t,i){var n="",r=null;t.forEach((function(t,o){var s=null!=i?i+"."+o:String(o),c=xt(a,t,s,u(s));if(e.midpoints&&r){var h=bt(a,r,c);h&&l.push(h)}r=c;var p=JSON.stringify(t);n!==p&&l.push(c),0===o&&(n=p)}))}function u(t){return!!e.selectedPaths&&-1!==e.selectedPaths.indexOf(t)}return o===d.POINT?l.push(xt(a,s,i,u(i))):o===d.POLYGON?s.forEach((function(t,e){c(t,null!==i?i+"."+e:String(e))})):o===d.LINE_STRING?c(s,i):0===o.indexOf(d.MULTI_PREFIX)&&(n=o.replace(d.MULTI_PREFIX,""),s.forEach((function(i,r){var o={type:d.FEATURE,properties:t.properties,geometry:{type:n,coordinates:i}};l=l.concat(wt(o,e,r))}))),l}var At={enable:function(t){setTimeout((function(){t.map&&t.map.doubleClickZoom&&t._ctx&&t._ctx.store&&t._ctx.store.getInitialConfigValue&&t._ctx.store.getInitialConfigValue("doubleClickZoom")&&t.map.doubleClickZoom.enable()}),0)},disable:function(t){setTimeout((function(){t.map&&t.map.doubleClickZoom&&t.map.doubleClickZoom.disable()}),0)}},Et={exports:{}},St=function(t){if(!t||!t.type)return null;var e=Mt[t.type];return e?"geometry"===e?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]}:"feature"===e?{type:"FeatureCollection",features:[t]}:"featurecollection"===e?t:void 0:null},Mt={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"},Tt=e(St),It=Object.freeze({__proto__:null,default:function t(e){switch(e&&e.type||null){case"FeatureCollection":return e.features=e.features.reduce((function(e,i){return e.concat(t(i))}),[]),e;case"Feature":return e.geometry?t(e.geometry).map((function(t){var i={type:"Feature",properties:JSON.parse(JSON.stringify(e.properties)),geometry:t};return void 0!==e.id&&(i.id=e.id),i})):[e];case"MultiPoint":return e.coordinates.map((function(t){return{type:"Point",coordinates:t}}));case"MultiPolygon":return e.coordinates.map((function(t){return{type:"Polygon",coordinates:t}}));case"MultiLineString":return e.coordinates.map((function(t){return{type:"LineString",coordinates:t}}));case"GeometryCollection":return e.geometries.map(t).reduce((function(t,e){return t.concat(e)}),[]);case"Point":case"Polygon":case"LineString":return[e]}}}),Ct=St,Pt=i(It),Lt=function(t){return function t(e){return Array.isArray(e)&&e.length&&"number"==typeof e[0]?[e]:e.reduce((function(e,i){return Array.isArray(i)&&Array.isArray(i[0])?e.concat(t(i)):(e.push(i),e)}),[])}(t)};Pt instanceof Function||(Pt=Pt.default);var Dt={exports:{}},Rt=Dt.exports=function(t){return new Ot(t)};function Ot(t){this.value=t}function kt(t,e,i){var n=[],r=[],o=!0;return function t(s){var a=i?Nt(s):s,l={},c=!0,u={node:a,node_:s,path:[].concat(n),parent:r[r.length-1],parents:r,key:n.slice(-1)[0],isRoot:0===n.length,level:n.length,circular:null,update:function(t,e){u.isRoot||(u.parent.node[u.key]=t),u.node=t,e&&(c=!1)},delete:function(t){delete u.parent.node[u.key],t&&(c=!1)},remove:function(t){Ft(u.parent.node)?u.parent.node.splice(u.key,1):delete u.parent.node[u.key],t&&(c=!1)},keys:null,before:function(t){l.before=t},after:function(t){l.after=t},pre:function(t){l.pre=t},post:function(t){l.post=t},stop:function(){o=!1},block:function(){c=!1}};if(!o)return u;function h(){if("object"==typeof u.node&&null!==u.node){u.keys&&u.node_===u.node||(u.keys=Bt(u.node)),u.isLeaf=0==u.keys.length;for(var t=0;t<r.length;t++)if(r[t].node_===s){u.circular=r[t];break}}else u.isLeaf=!0,u.keys=null;u.notLeaf=!u.isLeaf,u.notRoot=!u.isRoot}h();var p=e.call(u,u.node);return void 0!==p&&u.update&&u.update(p),l.before&&l.before.call(u,u.node),c?("object"!=typeof u.node||null===u.node||u.circular||(r.push(u),h(),Vt(u.keys,(function(e,r){n.push(e),l.pre&&l.pre.call(u,u.node[e],e);var o=t(u.node[e]);i&&Ut.call(u.node,e)&&(u.node[e]=o.node),o.isLast=r==u.keys.length-1,o.isFirst=0==r,l.post&&l.post.call(u,o),n.pop()})),r.pop()),l.after&&l.after.call(u,u.node),u):u}(t).node}function Nt(t){if("object"==typeof t&&null!==t){var e;if(Ft(t))e=[];else if("[object Date]"===zt(t))e=new Date(t.getTime?t.getTime():t);else if(function(t){return"[object RegExp]"===zt(t)}(t))e=new RegExp(t);else if(function(t){return"[object Error]"===zt(t)}(t))e={message:t.message};else if(function(t){return"[object Boolean]"===zt(t)}(t))e=new Boolean(t);else if(function(t){return"[object Number]"===zt(t)}(t))e=new Number(t);else if(function(t){return"[object String]"===zt(t)}(t))e=new String(t);else if(Object.create&&Object.getPrototypeOf)e=Object.create(Object.getPrototypeOf(t));else if(t.constructor===Object)e={};else{var i=t.constructor&&t.constructor.prototype||t.__proto__||{},n=function(){};n.prototype=i,e=new n}return Vt(Bt(t),(function(i){e[i]=t[i]})),e}return t}Ot.prototype.get=function(t){for(var e=this.value,i=0;i<t.length;i++){var n=t[i];if(!e||!Ut.call(e,n)){e=void 0;break}e=e[n]}return e},Ot.prototype.has=function(t){for(var e=this.value,i=0;i<t.length;i++){var n=t[i];if(!e||!Ut.call(e,n))return!1;e=e[n]}return!0},Ot.prototype.set=function(t,e){for(var i=this.value,n=0;n<t.length-1;n++){var r=t[n];Ut.call(i,r)||(i[r]={}),i=i[r]}return i[t[n]]=e,e},Ot.prototype.map=function(t){return kt(this.value,t,!0)},Ot.prototype.forEach=function(t){return this.value=kt(this.value,t,!1),this.value},Ot.prototype.reduce=function(t,e){var i=1===arguments.length,n=i?this.value:e;return this.forEach((function(e){this.isRoot&&i||(n=t.call(this,n,e))})),n},Ot.prototype.paths=function(){var t=[];return this.forEach((function(e){t.push(this.path)})),t},Ot.prototype.nodes=function(){var t=[];return this.forEach((function(e){t.push(this.node)})),t},Ot.prototype.clone=function(){var t=[],e=[];return function i(n){for(var r=0;r<t.length;r++)if(t[r]===n)return e[r];if("object"==typeof n&&null!==n){var o=Nt(n);return t.push(n),e.push(o),Vt(Bt(n),(function(t){o[t]=i(n[t])})),t.pop(),e.pop(),o}return n}(this.value)};var Bt=Object.keys||function(t){var e=[];for(var i in t)e.push(i);return e};function zt(t){return Object.prototype.toString.call(t)}var Ft=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},Vt=function(t,e){if(t.forEach)return t.forEach(e);for(var i=0;i<t.length;i++)e(t[i],i,t)};Vt(Bt(Ot.prototype),(function(t){Rt[t]=function(e){var i=[].slice.call(arguments,1),n=new Ot(e);return n[t].apply(n,i)}}));var Ut=Object.hasOwnProperty||function(t,e){return e in t},Gt=Dt.exports,jt=Ht;function Ht(t){if(!(this instanceof Ht))return new Ht(t);this._bbox=t||[1/0,1/0,-1/0,-1/0],this._valid=!!t}Ht.prototype.include=function(t){return this._valid=!0,this._bbox[0]=Math.min(this._bbox[0],t[0]),this._bbox[1]=Math.min(this._bbox[1],t[1]),this._bbox[2]=Math.max(this._bbox[2],t[0]),this._bbox[3]=Math.max(this._bbox[3],t[1]),this},Ht.prototype.equals=function(t){var e;return e=t instanceof Ht?t.bbox():t,this._bbox[0]==e[0]&&this._bbox[1]==e[1]&&this._bbox[2]==e[2]&&this._bbox[3]==e[3]},Ht.prototype.center=function(t){return this._valid?[(this._bbox[0]+this._bbox[2])/2,(this._bbox[1]+this._bbox[3])/2]:null},Ht.prototype.union=function(t){var e;return this._valid=!0,e=t instanceof Ht?t.bbox():t,this._bbox[0]=Math.min(this._bbox[0],e[0]),this._bbox[1]=Math.min(this._bbox[1],e[1]),this._bbox[2]=Math.max(this._bbox[2],e[2]),this._bbox[3]=Math.max(this._bbox[3],e[3]),this},Ht.prototype.bbox=function(){return this._valid?this._bbox:null},Ht.prototype.contains=function(t){if(!t)return this._fastContains();if(!this._valid)return null;var e=t[0],i=t[1];return this._bbox[0]<=e&&this._bbox[1]<=i&&this._bbox[2]>=e&&this._bbox[3]>=i},Ht.prototype.intersect=function(t){return this._valid?(e=t instanceof Ht?t.bbox():t,!(this._bbox[0]>e[2]||this._bbox[2]<e[0]||this._bbox[3]<e[1]||this._bbox[1]>e[3])):null;var e},Ht.prototype._fastContains=function(){if(!this._valid)return new Function("return null;");var t="return "+this._bbox[0]+"<= ll[0] &&"+this._bbox[1]+"<= ll[1] &&"+this._bbox[2]+">= ll[0] &&"+this._bbox[3]+">= ll[1]";return new Function("ll",t)},Ht.prototype.polygon=function(){return this._valid?{type:"Polygon",coordinates:[[[this._bbox[0],this._bbox[1]],[this._bbox[2],this._bbox[1]],[this._bbox[2],this._bbox[3]],[this._bbox[0],this._bbox[3]],[this._bbox[0],this._bbox[1]]]]}:null};var Wt=function(t){if(!t)return[];var e=Pt(Ct(t)),i=[];return e.features.forEach((function(t){t.geometry&&(i=i.concat(Lt(t.geometry.coordinates)))})),i},qt=Gt,Xt=jt,Zt={features:["FeatureCollection"],coordinates:["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],geometry:["Feature"],geometries:["GeometryCollection"]},Yt=Object.keys(Zt);function Qt(t){for(var e=Xt(),i=Wt(t),n=0;n<i.length;n++)e.include(i[n]);return e}Et.exports=function(t){return Qt(t).bbox()},Et.exports.polygon=function(t){return Qt(t).polygon()},Et.exports.bboxify=function(t){return qt(t).map((function(t){t&&Yt.some((function(e){return!!t[e]&&-1!==Zt[e].indexOf(t.type)}))&&(t.bbox=Qt(t).bbox(),this.update(t))}))};var Jt=e(Et.exports),Kt=-90;function $t(t,e){var i=Kt,n=90,r=Kt,o=90,s=270,a=-270;t.forEach((function(t){var e=Jt(t),l=e[1],c=e[3],u=e[0],h=e[2];l>i&&(i=l),c<n&&(n=c),c>r&&(r=c),l<o&&(o=l),u<s&&(s=u),h>a&&(a=h)}));var l=e;return i+l.lat>85&&(l.lat=85-i),r+l.lat>90&&(l.lat=90-r),n+l.lat<-85&&(l.lat=-85-n),o+l.lat<Kt&&(l.lat=Kt-o),s+l.lng<=-270&&(l.lng+=360*Math.ceil(Math.abs(l.lng)/360)),a+l.lng>=270&&(l.lng-=360*Math.ceil(Math.abs(l.lng)/360)),l}function te(t,e){var i=$t(t.map((function(t){return t.toGeoJSON()})),e);t.forEach((function(t){var e,n=t.getCoordinates(),r=function(t){var e={lng:t[0]+i.lng,lat:t[1]+i.lat};return[e.lng,e.lat]},o=function(t){return t.map((function(t){return r(t)}))};t.type===d.POINT?e=r(n):t.type===d.LINE_STRING||t.type===d.MULTI_POINT?e=n.map(r):t.type===d.POLYGON||t.type===d.MULTI_LINE_STRING?e=n.map(o):t.type===d.MULTI_POLYGON&&(e=n.map((function(t){return t.map((function(t){return o(t)}))}))),t.incomingCoords(e)}))}var ee={onSetup:function(t){var e=this,i={dragMoveLocation:null,boxSelectStartLocation:null,boxSelectElement:void 0,boxSelecting:!1,canBoxSelect:!1,dragMoving:!1,canDragMove:!1,initiallySelectedFeatureIds:t.featureIds||[]};return this.setSelected(i.initiallySelectedFeatureIds.filter((function(t){return void 0!==e.getFeature(t)}))),this.fireActionable(),this.setActionableState({combineFeatures:!0,uncombineFeatures:!0,trash:!0}),i},fireUpdate:function(){this.map.fire(m.UPDATE,{action:g.MOVE,features:this.getSelected().map((function(t){return t.toGeoJSON()}))})},fireActionable:function(){var t=this,e=this.getSelected(),i=e.filter((function(e){return t.isInstanceOf("MultiFeature",e)})),n=!1;if(e.length>1){n=!0;var r=e[0].type.replace("Multi","");e.forEach((function(t){t.type.replace("Multi","")!==r&&(n=!1)}))}var o=i.length>0,s=e.length>0;this.setActionableState({combineFeatures:n,uncombineFeatures:o,trash:s})},getUniqueIds:function(t){return t.length?t.map((function(t){return t.properties.id})).filter((function(t){return void 0!==t})).reduce((function(t,e){return t.add(e),t}),new M).values():[]},stopExtendedInteractions:function(t){t.boxSelectElement&&(t.boxSelectElement.parentNode&&t.boxSelectElement.parentNode.removeChild(t.boxSelectElement),t.boxSelectElement=null),this.map.dragPan.enable(),t.boxSelecting=!1,t.canBoxSelect=!1,t.dragMoving=!1,t.canDragMove=!1},onStop:function(){At.enable(this)},onMouseMove:function(t,e){return ut(e)&&t.dragMoving&&this.fireUpdate(),this.stopExtendedInteractions(t),!0},onMouseOut:function(t){return!t.dragMoving||this.fireUpdate()}};ee.onTap=ee.onClick=function(t,e){return ct(e)?this.clickAnywhere(t,e):ot(y.VERTEX)(e)?this.clickOnVertex(t,e):ut(e)?this.clickOnFeature(t,e):void 0},ee.clickAnywhere=function(t){var e=this,i=this.getSelectedIds();i.length&&(this.clearSelectedFeatures(),i.forEach((function(t){return e.doRender(t)}))),At.enable(this),this.stopExtendedInteractions(t)},ee.clickOnVertex=function(t,e){this.changeMode(f.DIRECT_SELECT,{featureId:e.featureTarget.properties.parent,coordPath:e.featureTarget.properties.coord_path,startPos:e.lngLat}),this.updateUIClasses({mouse:h.MOVE})},ee.startOnActiveFeature=function(t,e){this.stopExtendedInteractions(t),this.map.dragPan.disable(),this.doRender(e.featureTarget.properties.id),t.canDragMove=!0,t.dragMoveLocation=e.lngLat},ee.clickOnFeature=function(t,e){var i=this;At.disable(this),this.stopExtendedInteractions(t);var n=pt(e),r=this.getSelectedIds(),o=e.featureTarget.properties.id,s=this.isSelected(o);if(!n&&s&&this.getFeature(o).type!==d.POINT)return this.changeMode(f.DIRECT_SELECT,{featureId:o});s&&n?(this.deselect(o),this.updateUIClasses({mouse:h.POINTER}),1===r.length&&At.enable(this)):!s&&n?(this.select(o),this.updateUIClasses({mouse:h.MOVE})):s||n||(r.forEach((function(t){return i.doRender(t)})),this.setSelected(o),this.updateUIClasses({mouse:h.MOVE})),this.doRender(o)},ee.onMouseDown=function(t,e){return at(e)?this.startOnActiveFeature(t,e):this.drawConfig.boxSelect&&st(e)?this.startBoxSelect(t,e):void 0},ee.startBoxSelect=function(t,e){this.stopExtendedInteractions(t),this.map.dragPan.disable(),t.boxSelectStartLocation=_t(e.originalEvent,this.map.getContainer()),t.canBoxSelect=!0},ee.onTouchStart=function(t,e){if(at(e))return this.startOnActiveFeature(t,e)},ee.onDrag=function(t,e){return t.canDragMove?this.dragMove(t,e):this.drawConfig.boxSelect&&t.canBoxSelect?this.whileBoxSelect(t,e):void 0},ee.whileBoxSelect=function(t,e){t.boxSelecting=!0,this.updateUIClasses({mouse:h.ADD}),t.boxSelectElement||(t.boxSelectElement=document.createElement("div"),t.boxSelectElement.classList.add(c.BOX_SELECT),this.map.getContainer().appendChild(t.boxSelectElement));var i=_t(e.originalEvent,this.map.getContainer()),n=Math.min(t.boxSelectStartLocation.x,i.x),r=Math.max(t.boxSelectStartLocation.x,i.x),o=Math.min(t.boxSelectStartLocation.y,i.y),s=Math.max(t.boxSelectStartLocation.y,i.y),a="translate("+n+"px, "+o+"px)";t.boxSelectElement.style.transform=a,t.boxSelectElement.style.WebkitTransform=a,t.boxSelectElement.style.width=r-n+"px",t.boxSelectElement.style.height=s-o+"px"},ee.dragMove=function(t,e){t.dragMoving=!0,e.originalEvent.stopPropagation();var i={lng:e.lngLat.lng-t.dragMoveLocation.lng,lat:e.lngLat.lat-t.dragMoveLocation.lat};te(this.getSelected(),i),t.dragMoveLocation=e.lngLat},ee.onTouchEnd=ee.onMouseUp=function(t,e){var i=this;if(t.dragMoving)this.fireUpdate();else if(t.boxSelecting){var n=[t.boxSelectStartLocation,_t(e.originalEvent,this.map.getContainer())],r=this.featuresAt(null,n,"click"),o=this.getUniqueIds(r).filter((function(t){return!i.isSelected(t)}));o.length&&(this.select(o),o.forEach((function(t){return i.doRender(t)})),this.updateUIClasses({mouse:h.MOVE}))}this.stopExtendedInteractions(t)},ee.toDisplayFeatures=function(t,e,i){e.properties.active=this.isSelected(e.properties.id)?v.ACTIVE:v.INACTIVE,i(e),this.fireActionable(),e.properties.active===v.ACTIVE&&e.geometry.type!==d.POINT&&wt(e).forEach(i)},ee.onTrash=function(){this.deleteFeature(this.getSelectedIds()),this.fireActionable()},ee.onCombineFeatures=function(){var t=this.getSelected();if(!(0===t.length||t.length<2)){for(var e=[],i=[],n=t[0].type.replace("Multi",""),r=0;r<t.length;r++){var o=t[r];if(o.type.replace("Multi","")!==n)return;o.type.includes("Multi")?o.getCoordinates().forEach((function(t){e.push(t)})):e.push(o.getCoordinates()),i.push(o.toGeoJSON())}if(i.length>1){var s=this.newFeature({type:d.FEATURE,properties:i[0].properties,geometry:{type:"Multi"+n,coordinates:e}});this.addFeature(s),this.deleteFeature(this.getSelectedIds(),{silent:!0}),this.setSelected([s.id]),this.map.fire(m.COMBINE_FEATURES,{createdFeatures:[s.toGeoJSON()],deletedFeatures:i})}this.fireActionable()}},ee.onUncombineFeatures=function(){var t=this,e=this.getSelected();if(0!==e.length){for(var i=[],n=[],r=function(r){var o=e[r];t.isInstanceOf("MultiFeature",o)&&(o.getFeatures().forEach((function(e){t.addFeature(e),e.properties=o.properties,i.push(e.toGeoJSON()),t.select([e.id])})),t.deleteFeature(o.id,{silent:!0}),n.push(o.toGeoJSON()))},o=0;o<e.length;o++)r(o);i.length>1&&this.map.fire(m.UNCOMBINE_FEATURES,{createdFeatures:i,deletedFeatures:n}),this.fireActionable()}};var ie=ot(y.VERTEX),ne=ot(y.MIDPOINT),re={fireUpdate:function(){this.map.fire(m.UPDATE,{action:g.CHANGE_COORDINATES,features:this.getSelected().map((function(t){return t.toGeoJSON()}))})},fireActionable:function(t){this.setActionableState({combineFeatures:!1,uncombineFeatures:!1,trash:t.selectedCoordPaths.length>0})},startDragging:function(t,e){this.map.dragPan.disable(),t.canDragMove=!0,t.dragMoveLocation=e.lngLat},stopDragging:function(t){this.map.dragPan.enable(),t.dragMoving=!1,t.canDragMove=!1,t.dragMoveLocation=null},onVertex:function(t,e){this.startDragging(t,e);var i=e.featureTarget.properties,n=t.selectedCoordPaths.indexOf(i.coord_path);pt(e)||-1!==n?pt(e)&&-1===n&&t.selectedCoordPaths.push(i.coord_path):t.selectedCoordPaths=[i.coord_path];var r=this.pathsToCoordinates(t.featureId,t.selectedCoordPaths);this.setSelectedCoordinates(r)},onMidpoint:function(t,e){this.startDragging(t,e);var i=e.featureTarget.properties;t.feature.addCoordinate(i.coord_path,i.lng,i.lat),this.fireUpdate(),t.selectedCoordPaths=[i.coord_path]},pathsToCoordinates:function(t,e){return e.map((function(e){return{feature_id:t,coord_path:e}}))},onFeature:function(t,e){0===t.selectedCoordPaths.length?this.startDragging(t,e):this.stopDragging(t)},dragFeature:function(t,e,i){te(this.getSelected(),i),t.dragMoveLocation=e.lngLat},dragVertex:function(t,e,i){for(var n=t.selectedCoordPaths.map((function(e){return t.feature.getCoordinate(e)})),r=$t(n.map((function(t){return{type:d.FEATURE,properties:{},geometry:{type:d.POINT,coordinates:t}}})),i),o=0;o<n.length;o++){var s=n[o];t.feature.updateCoordinate(t.selectedCoordPaths[o],s[0]+r.lng,s[1]+r.lat)}},clickNoTarget:function(){this.changeMode(f.SIMPLE_SELECT)},clickInactive:function(){this.changeMode(f.SIMPLE_SELECT)},clickActiveFeature:function(t){t.selectedCoordPaths=[],this.clearSelectedCoordinates(),t.feature.changed()},onSetup:function(t){var e=t.featureId,i=this.getFeature(e);if(!i)throw new Error("You must provide a featureId to enter direct_select mode");if(i.type===d.POINT)throw new TypeError("direct_select mode doesn't handle point features");var n={featureId:e,feature:i,dragMoveLocation:t.startPos||null,dragMoving:!1,canDragMove:!1,selectedCoordPaths:t.coordPath?[t.coordPath]:[]};return this.setSelectedCoordinates(this.pathsToCoordinates(e,n.selectedCoordPaths)),this.setSelected(e),At.disable(this),this.setActionableState({trash:!0}),n},onStop:function(){At.enable(this),this.clearSelectedCoordinates()},toDisplayFeatures:function(t,e,i){t.featureId===e.properties.id?(e.properties.active=v.ACTIVE,i(e),wt(e,{map:this.map,midpoints:!0,selectedPaths:t.selectedCoordPaths}).forEach(i)):(e.properties.active=v.INACTIVE,i(e)),this.fireActionable(t)},onTrash:function(t){t.selectedCoordPaths.sort((function(t,e){return e.localeCompare(t,"en",{numeric:!0})})).forEach((function(e){return t.feature.removeCoordinate(e)})),this.fireUpdate(),t.selectedCoordPaths=[],this.clearSelectedCoordinates(),this.fireActionable(t),!1===t.feature.isValid()&&(this.deleteFeature([t.featureId]),this.changeMode(f.SIMPLE_SELECT,{}))},onMouseMove:function(t,e){var i=at(e),n=ie(e),r=ne(e),o=0===t.selectedCoordPaths.length;return i&&o||n&&!o?this.updateUIClasses({mouse:h.MOVE}):this.updateUIClasses({mouse:h.NONE}),(n||i||r)&&t.dragMoving&&this.fireUpdate(),this.stopDragging(t),!0},onMouseOut:function(t){return t.dragMoving&&this.fireUpdate(),!0}};re.onTouchStart=re.onMouseDown=function(t,e){return ie(e)?this.onVertex(t,e):at(e)?this.onFeature(t,e):ne(e)?this.onMidpoint(t,e):void 0},re.onDrag=function(t,e){if(!0===t.canDragMove){t.dragMoving=!0,e.originalEvent.stopPropagation();var i={lng:e.lngLat.lng-t.dragMoveLocation.lng,lat:e.lngLat.lat-t.dragMoveLocation.lat};t.selectedCoordPaths.length>0?this.dragVertex(t,e,i):this.dragFeature(t,e,i),t.dragMoveLocation=e.lngLat}},re.onClick=function(t,e){return ct(e)?this.clickNoTarget(t,e):at(e)?this.clickActiveFeature(t,e):lt(e)?this.clickInactive(t,e):void this.stopDragging(t)},re.onTap=function(t,e){return ct(e)?this.clickNoTarget(t,e):at(e)?this.clickActiveFeature(t,e):lt(e)?this.clickInactive(t,e):void 0},re.onTouchEnd=re.onMouseUp=function(t){t.dragMoving&&this.fireUpdate(),this.stopDragging(t)};var oe={};function se(t,e){return!!t.lngLat&&t.lngLat.lng===e[0]&&t.lngLat.lat===e[1]}oe.onSetup=function(){var t=this.newFeature({type:d.FEATURE,properties:{},geometry:{type:d.POINT,coordinates:[]}});return this.addFeature(t),this.clearSelectedFeatures(),this.updateUIClasses({mouse:h.ADD}),this.activateUIButton(p.POINT),this.setActionableState({trash:!0}),{point:t}},oe.stopDrawingAndRemove=function(t){this.deleteFeature([t.point.id],{silent:!0}),this.changeMode(f.SIMPLE_SELECT)},oe.onTap=oe.onClick=function(t,e){this.updateUIClasses({mouse:h.MOVE}),t.point.updateCoordinate("",e.lngLat.lng,e.lngLat.lat),this.map.fire(m.CREATE,{features:[t.point.toGeoJSON()]}),this.changeMode(f.SIMPLE_SELECT,{featureIds:[t.point.id]})},oe.onStop=function(t){this.activateUIButton(),t.point.getCoordinate().length||this.deleteFeature([t.point.id],{silent:!0})},oe.toDisplayFeatures=function(t,e,i){var n=e.properties.id===t.point.id;if(e.properties.active=n?v.ACTIVE:v.INACTIVE,!n)return i(e)},oe.onTrash=oe.stopDrawingAndRemove,oe.onKeyUp=function(t,e){if(dt(e)||ft(e))return this.stopDrawingAndRemove(t,e)};var ae={onSetup:function(){var t=this.newFeature({type:d.FEATURE,properties:{},geometry:{type:d.POLYGON,coordinates:[[]]}});return this.addFeature(t),this.clearSelectedFeatures(),At.disable(this),this.updateUIClasses({mouse:h.ADD}),this.activateUIButton(p.POLYGON),this.setActionableState({trash:!0}),{polygon:t,currentVertexPosition:0}},clickAnywhere:function(t,e){if(t.currentVertexPosition>0&&se(e,t.polygon.coordinates[0][t.currentVertexPosition-1]))return this.changeMode(f.SIMPLE_SELECT,{featureIds:[t.polygon.id]});this.updateUIClasses({mouse:h.ADD}),t.polygon.updateCoordinate("0."+t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),t.currentVertexPosition++,t.polygon.updateCoordinate("0."+t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat)},clickOnVertex:function(t){return this.changeMode(f.SIMPLE_SELECT,{featureIds:[t.polygon.id]})},onMouseMove:function(t,e){t.polygon.updateCoordinate("0."+t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),ht(e)&&this.updateUIClasses({mouse:h.POINTER})}};ae.onTap=ae.onClick=function(t,e){return ht(e)?this.clickOnVertex(t,e):this.clickAnywhere(t,e)},ae.onKeyUp=function(t,e){dt(e)?(this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(f.SIMPLE_SELECT)):ft(e)&&this.changeMode(f.SIMPLE_SELECT,{featureIds:[t.polygon.id]})},ae.onStop=function(t){this.updateUIClasses({mouse:h.NONE}),At.enable(this),this.activateUIButton(),void 0!==this.getFeature(t.polygon.id)&&(t.polygon.removeCoordinate("0."+t.currentVertexPosition),t.polygon.isValid()?this.map.fire(m.CREATE,{features:[t.polygon.toGeoJSON()]}):(this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(f.SIMPLE_SELECT,{},{silent:!0})))},ae.toDisplayFeatures=function(t,e,i){var n=e.properties.id===t.polygon.id;if(e.properties.active=n?v.ACTIVE:v.INACTIVE,!n)return i(e);if(0!==e.geometry.coordinates.length){var r=e.geometry.coordinates[0].length;if(!(r<3)){if(e.properties.meta=y.FEATURE,i(xt(t.polygon.id,e.geometry.coordinates[0][0],"0.0",!1)),r>3){var o=e.geometry.coordinates[0].length-3;i(xt(t.polygon.id,e.geometry.coordinates[0][o],"0."+o,!1))}if(r<=4){var s=[[e.geometry.coordinates[0][0][0],e.geometry.coordinates[0][0][1]],[e.geometry.coordinates[0][1][0],e.geometry.coordinates[0][1][1]]];if(i({type:d.FEATURE,properties:e.properties,geometry:{coordinates:s,type:d.LINE_STRING}}),3===r)return}return i(e)}}},ae.onTrash=function(t){this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(f.SIMPLE_SELECT)};var le={onSetup:function(t){var e,i,n=(t=t||{}).featureId,r="forward";if(n){if(!(e=this.getFeature(n)))throw new Error("Could not find a feature with the provided featureId");var o=t.from;if(o&&"Feature"===o.type&&o.geometry&&"Point"===o.geometry.type&&(o=o.geometry),o&&"Point"===o.type&&o.coordinates&&2===o.coordinates.length&&(o=o.coordinates),!o||!Array.isArray(o))throw new Error("Please use the `from` property to indicate which point to continue the line from");var s=e.coordinates.length-1;if(e.coordinates[s][0]===o[0]&&e.coordinates[s][1]===o[1])i=s+1,e.addCoordinate.apply(e,[i].concat(e.coordinates[s]));else{if(e.coordinates[0][0]!==o[0]||e.coordinates[0][1]!==o[1])throw new Error("`from` should match the point at either the start or the end of the provided LineString");r="backwards",i=0,e.addCoordinate.apply(e,[i].concat(e.coordinates[0]))}}else e=this.newFeature({type:d.FEATURE,properties:{},geometry:{type:d.LINE_STRING,coordinates:[]}}),i=0,this.addFeature(e);return this.clearSelectedFeatures(),At.disable(this),this.updateUIClasses({mouse:h.ADD}),this.activateUIButton(p.LINE),this.setActionableState({trash:!0}),{line:e,currentVertexPosition:i,direction:r}},clickAnywhere:function(t,e){if(t.currentVertexPosition>0&&se(e,t.line.coordinates[t.currentVertexPosition-1])||"backwards"===t.direction&&se(e,t.line.coordinates[t.currentVertexPosition+1]))return this.changeMode(f.SIMPLE_SELECT,{featureIds:[t.line.id]});this.updateUIClasses({mouse:h.ADD}),t.line.updateCoordinate(t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),"forward"===t.direction?(t.currentVertexPosition++,t.line.updateCoordinate(t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat)):t.line.addCoordinate(0,e.lngLat.lng,e.lngLat.lat)},clickOnVertex:function(t){return this.changeMode(f.SIMPLE_SELECT,{featureIds:[t.line.id]})},onMouseMove:function(t,e){t.line.updateCoordinate(t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),ht(e)&&this.updateUIClasses({mouse:h.POINTER})}};le.onTap=le.onClick=function(t,e){if(ht(e))return this.clickOnVertex(t,e);this.clickAnywhere(t,e)},le.onKeyUp=function(t,e){ft(e)?this.changeMode(f.SIMPLE_SELECT,{featureIds:[t.line.id]}):dt(e)&&(this.deleteFeature([t.line.id],{silent:!0}),this.changeMode(f.SIMPLE_SELECT))},le.onStop=function(t){At.enable(this),this.activateUIButton(),void 0!==this.getFeature(t.line.id)&&(t.line.removeCoordinate(""+t.currentVertexPosition),t.line.isValid()?this.map.fire(m.CREATE,{features:[t.line.toGeoJSON()]}):(this.deleteFeature([t.line.id],{silent:!0}),this.changeMode(f.SIMPLE_SELECT,{},{silent:!0})))},le.onTrash=function(t){this.deleteFeature([t.line.id],{silent:!0}),this.changeMode(f.SIMPLE_SELECT)},le.toDisplayFeatures=function(t,e,i){var n=e.properties.id===t.line.id;if(e.properties.active=n?v.ACTIVE:v.INACTIVE,!n)return i(e);e.geometry.coordinates.length<2||(e.properties.meta=y.FEATURE,i(xt(t.line.id,e.geometry.coordinates["forward"===t.direction?e.geometry.coordinates.length-2:1],""+("forward"===t.direction?e.geometry.coordinates.length-2:1),!1)),i(e))};var ce={simple_select:ee,direct_select:re,draw_point:oe,draw_polygon:ae,draw_line_string:le},ue={defaultMode:f.SIMPLE_SELECT,keybindings:!0,touchEnabled:!0,clickBuffer:2,touchBuffer:25,boxSelect:!0,displayControlsDefault:!0,styles:rt,modes:ce,controls:{},userProperties:!1},he={point:!0,line_string:!0,polygon:!0,trash:!0,combine_features:!0,uncombine_features:!0},pe={point:!1,line_string:!1,polygon:!1,trash:!1,combine_features:!1,uncombine_features:!1};function de(t,e){return t.map((function(t){return t.source?t:tt(t,{id:t.id+"."+e,source:"hot"===e?u.HOT:u.COLD})}))}var fe={exports:{}};!function(t,e){var i="__lodash_hash_undefined__",n=9007199254740991,r="[object Arguments]",o="[object Array]",s="[object Boolean]",a="[object Date]",l="[object Error]",c="[object Function]",u="[object Map]",h="[object Number]",p="[object Object]",d="[object Promise]",f="[object RegExp]",m="[object Set]",g="[object String]",y="[object Symbol]",v="[object WeakMap]",_="[object ArrayBuffer]",x="[object DataView]",b=/^\[object .+?Constructor\]$/,w=/^(?:0|[1-9]\d*)$/,A={};A["[object Float32Array]"]=A["[object Float64Array]"]=A["[object Int8Array]"]=A["[object Int16Array]"]=A["[object Int32Array]"]=A["[object Uint8Array]"]=A["[object Uint8ClampedArray]"]=A["[object Uint16Array]"]=A["[object Uint32Array]"]=!0,A[r]=A[o]=A[_]=A[s]=A[x]=A[a]=A[l]=A[c]=A[u]=A[h]=A[p]=A[f]=A[m]=A[g]=A[v]=!1;var E="object"==typeof nt&&nt&&nt.Object===Object&&nt,S="object"==typeof self&&self&&self.Object===Object&&self,M=E||S||Function("return this")(),T=e&&!e.nodeType&&e,I=T&&t&&!t.nodeType&&t,C=I&&I.exports===T,P=C&&E.process,L=function(){try{return P&&P.binding&&P.binding("util")}catch(t){}}(),D=L&&L.isTypedArray;function R(t,e){for(var i=-1,n=null==t?0:t.length;++i<n;)if(e(t[i],i,t))return!0;return!1}function O(t){var e=-1,i=Array(t.size);return t.forEach((function(t,n){i[++e]=[n,t]})),i}function k(t){var e=-1,i=Array(t.size);return t.forEach((function(t){i[++e]=t})),i}var N,B,z,F=Array.prototype,V=Function.prototype,U=Object.prototype,G=M["__core-js_shared__"],j=V.toString,H=U.hasOwnProperty,W=(N=/[^.]+$/.exec(G&&G.keys&&G.keys.IE_PROTO||""))?"Symbol(src)_1."+N:"",q=U.toString,X=RegExp("^"+j.call(H).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Z=C?M.Buffer:void 0,Y=M.Symbol,Q=M.Uint8Array,J=U.propertyIsEnumerable,K=F.splice,$=Y?Y.toStringTag:void 0,tt=Object.getOwnPropertySymbols,et=Z?Z.isBuffer:void 0,it=(B=Object.keys,z=Object,function(t){return B(z(t))}),rt=Dt(M,"DataView"),ot=Dt(M,"Map"),st=Dt(M,"Promise"),at=Dt(M,"Set"),lt=Dt(M,"WeakMap"),ct=Dt(Object,"create"),ut=Nt(rt),ht=Nt(ot),pt=Nt(st),dt=Nt(at),ft=Nt(lt),mt=Y?Y.prototype:void 0,gt=mt?mt.valueOf:void 0;function yt(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function vt(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function _t(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function xt(t){var e=-1,i=null==t?0:t.length;for(this.__data__=new _t;++e<i;)this.add(t[e])}function bt(t){var e=this.__data__=new vt(t);this.size=e.size}function wt(t,e){var i=Ft(t),n=!i&&zt(t),r=!i&&!n&&Vt(t),o=!i&&!n&&!r&&Wt(t),s=i||n||r||o,a=s?function(t,e){for(var i=-1,n=Array(t);++i<t;)n[i]=e(i);return n}(t.length,String):[],l=a.length;for(var c in t)!e&&!H.call(t,c)||s&&("length"==c||r&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||kt(c,l))||a.push(c);return a}function At(t,e){for(var i=t.length;i--;)if(Bt(t[i][0],e))return i;return-1}function Et(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":$&&$ in Object(t)?function(t){var e=H.call(t,$),i=t[$];try{t[$]=void 0;var n=!0}catch(t){}var r=q.call(t);return n&&(e?t[$]=i:delete t[$]),r}(t):function(t){return q.call(t)}(t)}function St(t){return Ht(t)&&Et(t)==r}function Mt(t,e,i,n,c){return t===e||(null==t||null==e||!Ht(t)&&!Ht(e)?t!=t&&e!=e:function(t,e,i,n,c,d){var v=Ft(t),b=Ft(e),w=v?o:Ot(t),A=b?o:Ot(e),E=(w=w==r?p:w)==p,S=(A=A==r?p:A)==p,M=w==A;if(M&&Vt(t)){if(!Vt(e))return!1;v=!0,E=!1}if(M&&!E)return d||(d=new bt),v||Wt(t)?Ct(t,e,i,n,c,d):function(t,e,i,n,r,o,c){switch(i){case x:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case _:return!(t.byteLength!=e.byteLength||!o(new Q(t),new Q(e)));case s:case a:case h:return Bt(+t,+e);case l:return t.name==e.name&&t.message==e.message;case f:case g:return t==e+"";case u:var p=O;case m:var d=1&n;if(p||(p=k),t.size!=e.size&&!d)return!1;var v=c.get(t);if(v)return v==e;n|=2,c.set(t,e);var b=Ct(p(t),p(e),n,r,o,c);return c.delete(t),b;case y:if(gt)return gt.call(t)==gt.call(e)}return!1}(t,e,w,i,n,c,d);if(!(1&i)){var T=E&&H.call(t,"__wrapped__"),I=S&&H.call(e,"__wrapped__");if(T||I){var C=T?t.value():t,P=I?e.value():e;return d||(d=new bt),c(C,P,i,n,d)}}return!!M&&(d||(d=new bt),function(t,e,i,n,r,o){var s=1&i,a=Pt(t),l=a.length;if(l!=Pt(e).length&&!s)return!1;for(var c=l;c--;){var u=a[c];if(!(s?u in e:H.call(e,u)))return!1}var h=o.get(t);if(h&&o.get(e))return h==e;var p=!0;o.set(t,e),o.set(e,t);for(var d=s;++c<l;){var f=t[u=a[c]],m=e[u];if(n)var g=s?n(m,f,u,e,t,o):n(f,m,u,t,e,o);if(!(void 0===g?f===m||r(f,m,i,n,o):g)){p=!1;break}d||(d="constructor"==u)}if(p&&!d){var y=t.constructor,v=e.constructor;y==v||!("constructor"in t)||!("constructor"in e)||"function"==typeof y&&y instanceof y&&"function"==typeof v&&v instanceof v||(p=!1)}return o.delete(t),o.delete(e),p}(t,e,i,n,c,d))}(t,e,i,n,Mt,c))}function Tt(t){return!(!jt(t)||function(t){return!!W&&W in t}(t))&&(Ut(t)?X:b).test(Nt(t))}function It(t){if(i=(e=t)&&e.constructor,e!==("function"==typeof i&&i.prototype||U))return it(t);var e,i,n=[];for(var r in Object(t))H.call(t,r)&&"constructor"!=r&&n.push(r);return n}function Ct(t,e,i,n,r,o){var s=1&i,a=t.length,l=e.length;if(a!=l&&!(s&&l>a))return!1;var c=o.get(t);if(c&&o.get(e))return c==e;var u=-1,h=!0,p=2&i?new xt:void 0;for(o.set(t,e),o.set(e,t);++u<a;){var d=t[u],f=e[u];if(n)var m=s?n(f,d,u,e,t,o):n(d,f,u,t,e,o);if(void 0!==m){if(m)continue;h=!1;break}if(p){if(!R(e,(function(t,e){if(s=e,!p.has(s)&&(d===t||r(d,t,i,n,o)))return p.push(e);var s}))){h=!1;break}}else if(d!==f&&!r(d,f,i,n,o)){h=!1;break}}return o.delete(t),o.delete(e),h}function Pt(t){return function(t,e,i){var n=e(t);return Ft(t)?n:function(t,e){for(var i=-1,n=e.length,r=t.length;++i<n;)t[r+i]=e[i];return t}(n,i(t))}(t,qt,Rt)}function Lt(t,e){var i,n,r=t.__data__;return("string"==(n=typeof(i=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?r["string"==typeof e?"string":"hash"]:r.map}function Dt(t,e){var i=function(t,e){return null==t?void 0:t[e]}(t,e);return Tt(i)?i:void 0}yt.prototype.clear=function(){this.__data__=ct?ct(null):{},this.size=0},yt.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},yt.prototype.get=function(t){var e=this.__data__;if(ct){var n=e[t];return n===i?void 0:n}return H.call(e,t)?e[t]:void 0},yt.prototype.has=function(t){var e=this.__data__;return ct?void 0!==e[t]:H.call(e,t)},yt.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=ct&&void 0===e?i:e,this},vt.prototype.clear=function(){this.__data__=[],this.size=0},vt.prototype.delete=function(t){var e=this.__data__,i=At(e,t);return!(i<0||(i==e.length-1?e.pop():K.call(e,i,1),--this.size,0))},vt.prototype.get=function(t){var e=this.__data__,i=At(e,t);return i<0?void 0:e[i][1]},vt.prototype.has=function(t){return At(this.__data__,t)>-1},vt.prototype.set=function(t,e){var i=this.__data__,n=At(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this},_t.prototype.clear=function(){this.size=0,this.__data__={hash:new yt,map:new(ot||vt),string:new yt}},_t.prototype.delete=function(t){var e=Lt(this,t).delete(t);return this.size-=e?1:0,e},_t.prototype.get=function(t){return Lt(this,t).get(t)},_t.prototype.has=function(t){return Lt(this,t).has(t)},_t.prototype.set=function(t,e){var i=Lt(this,t),n=i.size;return i.set(t,e),this.size+=i.size==n?0:1,this},xt.prototype.add=xt.prototype.push=function(t){return this.__data__.set(t,i),this},xt.prototype.has=function(t){return this.__data__.has(t)},bt.prototype.clear=function(){this.__data__=new vt,this.size=0},bt.prototype.delete=function(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i},bt.prototype.get=function(t){return this.__data__.get(t)},bt.prototype.has=function(t){return this.__data__.has(t)},bt.prototype.set=function(t,e){var i=this.__data__;if(i instanceof vt){var n=i.__data__;if(!ot||n.length<199)return n.push([t,e]),this.size=++i.size,this;i=this.__data__=new _t(n)}return i.set(t,e),this.size=i.size,this};var Rt=tt?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var i=-1,n=null==t?0:t.length,r=0,o=[];++i<n;){var s=t[i];e(s,i,t)&&(o[r++]=s)}return o}(tt(t),(function(e){return J.call(t,e)})))}:function(){return[]},Ot=Et;function kt(t,e){return!!(e=null==e?n:e)&&("number"==typeof t||w.test(t))&&t>-1&&t%1==0&&t<e}function Nt(t){if(null!=t){try{return j.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Bt(t,e){return t===e||t!=t&&e!=e}(rt&&Ot(new rt(new ArrayBuffer(1)))!=x||ot&&Ot(new ot)!=u||st&&Ot(st.resolve())!=d||at&&Ot(new at)!=m||lt&&Ot(new lt)!=v)&&(Ot=function(t){var e=Et(t),i=e==p?t.constructor:void 0,n=i?Nt(i):"";if(n)switch(n){case ut:return x;case ht:return u;case pt:return d;case dt:return m;case ft:return v}return e});var zt=St(function(){return arguments}())?St:function(t){return Ht(t)&&H.call(t,"callee")&&!J.call(t,"callee")},Ft=Array.isArray,Vt=et||function(){return!1};function Ut(t){if(!jt(t))return!1;var e=Et(t);return e==c||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Gt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function jt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Ht(t){return null!=t&&"object"==typeof t}var Wt=D?function(t){return function(e){return t(e)}}(D):function(t){return Ht(t)&&Gt(t.length)&&!!A[Et(t)]};function qt(t){return null!=(e=t)&&Gt(e.length)&&!Ut(e)?wt(t):It(t);var e}t.exports=function(t,e){return Mt(t,e)}}(fe,fe.exports);var me=e(fe.exports);function ge(t,e){return t.length===e.length&&JSON.stringify(t.map((function(t){return t})).sort())===JSON.stringify(e.map((function(t){return t})).sort())}var ye={Polygon:V,LineString:F,Point:z,MultiPolygon:j,MultiLineString:j,MultiPoint:j},ve=Object.freeze({__proto__:null,CommonSelectors:mt,constrainFeatureMovement:$t,createMidPoint:bt,createSupplementaryPoints:wt,createVertex:xt,doubleClickZoom:At,euclideanDistance:L,featuresAt:I,getFeatureAtAndSetCursors:P,isClick:D,isEventAtCoordinates:se,isTap:R,mapEventToBoundingBox:S,ModeHandler:t,moveFeatures:te,sortFeatures:E,stringSetsAreEqual:ge,StringSet:M,theme:rt,toDenseArray:Z}),_e=function(t,e){var i={options:t=function(t){void 0===t&&(t={});var e=tt(t);return t.controls||(e.controls={}),!1===t.displayControlsDefault?e.controls=tt(pe,t.controls):e.controls=tt(he,t.controls),(e=tt(ue,e)).styles=de(e.styles,"cold").concat(de(e.styles,"hot")),e}(t)};e=function(t,e){return e.modes=f,e.getFeatureIdsAt=function(e){return I.click({point:e},null,t).map((function(t){return t.properties.id}))},e.getSelectedIds=function(){return t.store.getSelectedIds()},e.getSelected=function(){return{type:d.FEATURE_COLLECTION,features:t.store.getSelectedIds().map((function(e){return t.store.get(e)})).map((function(t){return t.toGeoJSON()}))}},e.getSelectedPoints=function(){return{type:d.FEATURE_COLLECTION,features:t.store.getSelectedCoordinates().map((function(t){return{type:d.FEATURE,properties:{},geometry:{type:d.POINT,coordinates:t.coordinates}}}))}},e.set=function(i){if(void 0===i.type||i.type!==d.FEATURE_COLLECTION||!Array.isArray(i.features))throw new Error("Invalid FeatureCollection");var n=t.store.createRenderBatch(),r=t.store.getAllIds().slice(),o=e.add(i),s=new M(o);return(r=r.filter((function(t){return!s.has(t)}))).length&&e.delete(r),n(),o},e.add=function(e){var i=JSON.parse(JSON.stringify(Tt(e))).features.map((function(e){if(e.id=e.id||N(),null===e.geometry)throw new Error("Invalid geometry: null");if(void 0===t.store.get(e.id)||t.store.get(e.id).type!==e.geometry.type){var i=ye[e.geometry.type];if(void 0===i)throw new Error("Invalid geometry type: "+e.geometry.type+".");var n=new i(t,e);t.store.add(n)}else{var r=t.store.get(e.id);r.properties=e.properties,me(r.properties,e.properties)||t.store.featureChanged(r.id),me(r.getCoordinates(),e.geometry.coordinates)||r.incomingCoords(e.geometry.coordinates)}return e.id}));return t.store.render(),i},e.get=function(e){var i=t.store.get(e);if(i)return i.toGeoJSON()},e.getAll=function(){return{type:d.FEATURE_COLLECTION,features:t.store.getAll().map((function(t){return t.toGeoJSON()}))}},e.delete=function(i){return t.store.delete(i,{silent:!0}),e.getMode()!==f.DIRECT_SELECT||t.store.getSelectedIds().length?t.store.render():t.events.changeMode(f.SIMPLE_SELECT,void 0,{silent:!0}),e},e.deleteAll=function(){return t.store.delete(t.store.getAllIds(),{silent:!0}),e.getMode()===f.DIRECT_SELECT?t.events.changeMode(f.SIMPLE_SELECT,void 0,{silent:!0}):t.store.render(),e},e.changeMode=function(i,n){return void 0===n&&(n={}),i===f.SIMPLE_SELECT&&e.getMode()===f.SIMPLE_SELECT?(ge(n.featureIds||[],t.store.getSelectedIds())||(t.store.setSelected(n.featureIds,{silent:!0}),t.store.render()),e):(i===f.DIRECT_SELECT&&e.getMode()===f.DIRECT_SELECT&&n.featureId===t.store.getSelectedIds()[0]||t.events.changeMode(i,n,{silent:!0}),e)},e.getMode=function(){return t.events.getMode()},e.trash=function(){return t.events.trash({silent:!0}),e},e.combineFeatures=function(){return t.events.combineFeatures({silent:!0}),e},e.uncombineFeatures=function(){return t.events.uncombineFeatures({silent:!0}),e},e.setFeatureProperty=function(i,n,r){return t.store.setFeatureProperty(i,n,r),e},e}(i,e),i.api=e;var n=it(i);return e.onAdd=n.onAdd,e.onRemove=n.onRemove,e.types=p,e.options=t,e};function xe(t){_e(t,this)}return xe.modes=ce,xe.constants=b,xe.lib=ve,xe}()}(Uf);var Gf=rt(Uf.exports);function jf(t){return Math.pow(Hf(t),.99)}function Hf(t){let e=0;for(let i=0;i<t.length-1;i++)e+=Wf(t[i],t[i+1]);return e}function Wf(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function qf(t,e,i){const n=Xf(e,t)-Xf(e,i);return n<0?n+im:n}function Xf(t,e){let i;const n=Math.asin(Math.abs(e[1]-t[1])/Wf(t,e));return e[1]>=t[1]&&e[0]>=t[0]?i=n+Math.PI:e[1]>=t[1]&&e[0]<t[0]?i=im-n:e[1]<t[1]&&e[0]<t[0]?i=n:e[1]<t[1]&&e[0]>=t[0]&&(i=Math.PI-n),i}function Zf(t,e,i,n,r){const o=Xf(t,e),s=r?o+i:o-i,a=n*Math.cos(s),l=n*Math.sin(s);return[e[0]+a,e[1]+l]}function Yf(t){if(t.length<=2)return t;const e=[],i=t.length-2-1;e.push(t[0]);for(let n=0;n<=i;n++)for(let i=0;i<=1;i+=.05){let r=0,o=0;for(let e=0;e<=2;e++){const s=Qf(e,i);r+=s*t[n+e][0],o+=s*t[n+e][1]}e.push([r,o])}return e.push(t[t.length-1]),e}function Qf(t,e){return 0==t?Math.pow(e-1,2)/2:1==t?(-2*Math.pow(e,2)+2*e+1)/2:2==t?Math.pow(e,2)/2:0}const Jf=.18,Kf=.3,$f=.85,tm=.15,em=.8,im=2*Math.PI,nm=Math.PI/2;function rm(t,e){const i=[];for(const e in t)-1!=e.indexOf("attackArrowPoint")&&i.push(t[e]);"move"==e&&(i[i.length]=t.movePoint);for(let t=0;t<i.length;t++)for(let e=t+1;e<i.length;e++)i[t][0]===i[e][0]&&i[t][1]===i[e][1]&&i.splice(e,1);let n=i[0],r=i[1];(function(t,e,i){return(i[1]-t[1])*(e[0]-t[0])>(e[1]-t[1])*(i[0]-t[0])})(i[0],i[1],i[2])&&(n=i[1],r=i[0]);const o=function(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}(n,r),s=[o].concat(i.slice(2)),a=function(t,e,i){let n=jf(t),r=n*Jf,o=t[t.length-1];n=Wf(o,t[t.length-2]);const s=Wf(e,i);r>s*em&&(r=s*em);const a=r*Kf,l=r*tm;r=r>n?n:r;const c=r*$f,u=Zf(t[t.length-2],o,0,r,!0),h=Zf(t[t.length-2],o,0,c,!0),p=Zf(o,u,nm,a,!1),d=Zf(o,u,nm,a,!0);return[Zf(o,h,nm,l,!1),p,o,d,Zf(o,h,nm,l,!0)]}(s,n,r),l=a[0],c=a[4];if(window.isNaN(c[0]))return!1;const u=function(t,e,i,n){const r=Hf(t),o=jf(t)*n,s=(o-Wf(e,i))/2,a=[],l=[];let c=0;for(let e=1;e<t.length-1;e++){const i=qf(t[e-1],t[e],t[e+1])/2;c+=Wf(t[e-1],t[e]);const n=(o/2-c/r*s)/Math.sin(i),u=Zf(t[e-1],t[e],Math.PI-i,n,!0),h=Zf(t[e-1],t[e],i,n,!1);a.push(u),l.push(h)}return a.concat(l)}(s,l,c,Wf(n,r)/jf(s)),h=u.length;let p=[n].concat(u.slice(0,h/2));p.push(l);let d=[r].concat(u.slice(h/2,h));d.push(c),p=Yf(p),d=Yf(d);return[p.concat(a,d.reverse(),[p[0]])]}const om={CONTROL_BASE:"mapboxgl-ctrl",CONTROL_PREFIX:"mapboxgl-ctrl-",CONTROL_BUTTON:"mapbox-gl-draw_ctrl-draw-btn",CONTROL_BUTTON_LINE:"mapbox-gl-draw_line",CONTROL_BUTTON_POLYGON:"mapbox-gl-draw_polygon",CONTROL_BUTTON_POINT:"mapbox-gl-draw_point",CONTROL_BUTTON_TRASH:"mapbox-gl-draw_trash",CONTROL_BUTTON_COMBINE_FEATURES:"mapbox-gl-draw_combine",CONTROL_BUTTON_UNCOMBINE_FEATURES:"mapbox-gl-draw_uncombine",CONTROL_GROUP:"mapboxgl-ctrl-group",ATTRIBUTION:"mapboxgl-ctrl-attrib",ACTIVE_BUTTON:"active",BOX_SELECT:"mapbox-gl-draw_boxselect"},sm={ADD:"add",MOVE:"move",DRAG:"drag",POINTER:"pointer",NONE:"none"},am={POLYGON:"polygon",LINE:"line_string",POINT:"point"},lm={FEATURE:"Feature",POLYGON:"Polygon",LINE_STRING:"LineString",POINT:"Point",FEATURE_COLLECTION:"FeatureCollection",MULTI_PREFIX:"Multi",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon"},cm={DRAW_LINE_STRING:"draw_line_string",DRAW_POLYGON:"draw_polygon",DRAW_POINT:"draw_point",SIMPLE_SELECT:"simple_select",DIRECT_SELECT:"direct_select",STATIC:"static"},um={CREATE:"draw.create",DELETE:"draw.delete",UPDATE:"draw.update",SELECTION_CHANGE:"draw.selectionchange",MODE_CHANGE:"draw.modechange",ACTIONABLE:"draw.actionable",RENDER:"draw.render",COMBINE_FEATURES:"draw.combine",UNCOMBINE_FEATURES:"draw.uncombine"},hm={MOVE:"move",CHANGE_COORDINATES:"change_coordinates"},pm={FEATURE:"feature",MIDPOINT:"midpoint",VERTEX:"vertex"},dm={ACTIVE:"true",INACTIVE:"false"},fm=-85,mm=85;var gm=Object.freeze({__proto__:null,classes:om,sources:{HOT:"mapbox-gl-draw-hot",COLD:"mapbox-gl-draw-cold"},cursors:sm,types:am,geojsonTypes:lm,modes:cm,events:um,updateActions:hm,meta:pm,activeStates:dm,interactions:["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate"],LAT_MIN:-90,LAT_RENDERED_MIN:fm,LAT_MAX:90,LAT_RENDERED_MAX:mm,LNG_MIN:-270,LNG_MAX:270});function ym(t,e,i,n,r){return{type:lm.FEATURE,properties:{lineColor:r.lineColor,lineWidth:r.lineWidth+2,meta:pm.VERTEX,parent:t,coord_path:i,active:n?dm.ACTIVE:dm.INACTIVE},geometry:{type:lm.POINT,coordinates:e}}}function vm(t){return function(e){const i=e.featureTarget;return!!i&&(!!i.properties&&i.properties.meta===t)}}function _m(t){return!!t.featureTarget&&(!!t.featureTarget.properties&&(t.featureTarget.properties.active===dm.ACTIVE&&t.featureTarget.properties.meta===pm.FEATURE))}function xm(t){return!!t.featureTarget&&(!!t.featureTarget.properties&&(t.featureTarget.properties.active===dm.INACTIVE&&t.featureTarget.properties.meta===pm.FEATURE))}function bm(t){return void 0===t.featureTarget}function wm(t){return!!t.featureTarget&&(!!t.featureTarget.properties&&t.featureTarget.properties.meta===pm.FEATURE)}function Am(t){const e=t.featureTarget;return!!e&&(!!e.properties&&e.properties.meta===pm.VERTEX)}function Em(t){return!!t.originalEvent&&!0===t.originalEvent.shiftKey}function Sm(t){return 27===t.keyCode}function Mm(t){return 13===t.keyCode}function Tm(t,e){return!!t.lngLat&&(t.lngLat.lng===e[0]&&t.lngLat.lat===e[1])}const Im={enable(t){setTimeout((()=>{t.map&&t.map.doubleClickZoom&&t._ctx&&t._ctx.store&&t._ctx.store.getInitialConfigValue&&t._ctx.store.getInitialConfigValue("doubleClickZoom")&&t.map.doubleClickZoom.enable()}),0)},disable(t){setTimeout((()=>{t.map&&t.map.doubleClickZoom&&t.map.doubleClickZoom.disable()}),0)}},Cm={onSetup(t){const e=this.newFeature({type:lm.FEATURE,properties:{isAttackArrow:!0,lineColor:t.lineColor,lineWidth:t.lineWidth,fillColor:t.fillColor,polygonType:t.polygonType,polygonImage:t.polygonImage||""},geometry:{type:lm.POLYGON,coordinates:[[]]}});return this.addFeature(e),this.clearSelectedFeatures(),Im.disable(this),this.updateUIClasses({mouse:sm.ADD}),this.activateUIButton(am.POLYGON),this.setActionableState({trash:!0}),{attackArrow:e,currentVertexPosition:0,...t}},onTap(t,e){t.attackArrow.properties.attackArrowPoint1&&this.onMouseMove(t,e),this.onClick(t,e)},onKeyUp(t,e){Sm(e)?(this.deleteFeature([t.attackArrow.id],{silent:!0}),this.changeMode(cm.SIMPLE_SELECT)):Mm(e)&&this.changeMode(cm.SIMPLE_SELECT,{featureIds:[t.attackArrow.id]})},onTrash(t){this.deleteFeature([t.attackArrow.id],{silent:!0}),this.changeMode("simple_select")},onStop(t){this.updateUIClasses({mouse:sm.NONE}),Im.enable(this),this.activateUIButton(),this.getFeature(t.attackArrow.id)},onClick(t,e){if(Am(e))return this.changeMode(cm.SIMPLE_SELECT,{featureIds:[t.attackArrow.id]});if(t.currentVertexPosition>0&&Tm(e,t.attackArrow.coordinates[0][t.currentVertexPosition-1]))return this.changeMode(cm.SIMPLE_SELECT,{featureIds:[t.attackArrow.id]});if(this.updateUIClasses({mouse:sm.ADD}),t.attackArrow.updateCoordinate(`0.${t.currentVertexPosition}`,e.lngLat.lng,e.lngLat.lat),t.currentVertexPosition++,t.attackArrow.updateCoordinate(`0.${t.currentVertexPosition}`,e.lngLat.lng,e.lngLat.lat),t.attackArrow.properties["attackArrowPoint"+t.currentVertexPosition]=[e.lngLat.lng,e.lngLat.lat],t.attackArrow.properties.attackArrowPoint3){const e=rm(t.attackArrow.properties);t.attackArrow.incomingCoords(e)}},onMouseMove(t,e){if(t.attackArrow.updateCoordinate(`0.${t.currentVertexPosition}`,e.lngLat.lng,e.lngLat.lat),Am(e)&&this.updateUIClasses({mouse:sm.POINTER}),t.attackArrow.properties.attackArrowPoint1&&(t.attackArrow.properties.attackArrowPoint2||t.attackArrow.updateCoordinate(`0.${t.currentVertexPosition}`,e.lngLat.lng,e.lngLat.lat),t.attackArrow.properties.movePoint=[e.lngLat.lng,e.lngLat.lat],t.attackArrow.properties.attackArrowPoint2)){const e=rm(t.attackArrow.properties,"move");t.attackArrow.incomingCoords(e)}},toDisplayFeatures(t,e,i){const n=e.properties.id===t.attackArrow.id;if(e.properties.active=n?dm.ACTIVE:dm.INACTIVE,!n)return i(e);if(0===e.geometry.coordinates.length)return;const r=e.geometry.coordinates[0].length;if(!(r<3)){if(Object.getOwnPropertyNames(t.attackArrow.properties).forEach((function(e,n){-1!=e.indexOf("attackArrowPoint")&&(console.log(e,t.attackArrow),i(ym(t.attackArrow.id,t.attackArrow.properties[e],`0.${n}`,!1,t)))})),r<=4){const t=[[e.geometry.coordinates[0][0][0],e.geometry.coordinates[0][0][1]],[e.geometry.coordinates[0][1][0],e.geometry.coordinates[0][1][1]]];if(i({type:lm.FEATURE,properties:e.properties,geometry:{coordinates:t,type:lm.LINE_STRING}}),3===r)return}return i(e)}}};var Pm={exports:{}};!function(t,e){t.exports=function(){var t,e,i;function n(n,r){if(t)if(e){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 = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk); self.onerror = null;",s={};t(s),i=r(s),"undefined"!=typeof window&&window&&window.URL&&window.URL.createObjectURL&&(i.workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"})))}else e=r;else t=r}n(["exports"],(function(t){var e="undefined"!=typeof self?self:{},i="2.15.0";let n;const r={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(null==n){const t=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{n=null!=process.env.API_URL_REGEX?new RegExp(process.env.API_URL_REGEX):t}catch(e){n=t}}return n},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(!r.API_URL)return null;try{const t=new URL(r.API_URL);return"api.mapbox.cn"===t.hostname?"https://events.mapbox.cn/events/v2":"api.mapbox.com"===t.hostname?"https://events.mapbox.com/events/v2":null}catch(t){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},o={supported:!1,testSupport:function(t){!l&&a&&(c?u(t):s=t)}};let s,a,l=!1,c=!1;function u(t){const e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,a),t.isContextLost())return;o.supported=!0}catch(t){}t.deleteTexture(e),l=!0}e.document&&(a=e.document.createElement("img"),a.onload=function(){s&&u(s),s=null,c=!0},a.onerror=function(){l=!0,s=null},a.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const h="01";function p(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var d=f;function f(t,e,i,n){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=i,this.p2y=n}f.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var i=t,n=0;n<8;n++){var r=this.sampleCurveX(i)-t;if(Math.abs(r)<e)return i;var o=this.sampleCurveDerivativeX(i);if(Math.abs(o)<1e-6)break;i-=r/o}var s=0,a=1;for(i=t,n=0;n<20&&(r=this.sampleCurveX(i),!(Math.abs(r-t)<e));n++)t>r?s=i:a=i,i=.5*(a-s)+s;return i},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var m=p(d),g=y;function y(t,e){this.x=t,this.y=e}y.prototype={clone:function(){return new y(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},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(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),i=Math.sin(t),n=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=n,this},_rotateAround:function(t,e){var i=Math.cos(t),n=Math.sin(t),r=e.y+n*(this.x-e.x)+i*(this.y-e.y);return this.x=e.x+i*(this.x-e.x)-n*(this.y-e.y),this.y=r,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},y.convert=function(t){return t instanceof y?t:Array.isArray(t)?new y(t[0],t[1]):t};var v=p(g);const _=Math.PI/180,x=180/Math.PI;function b(t){return t*_}function w(t){return t*x}const A=[[0,0],[1,0],[1,1],[0,1]];function E(t){if(t<=0)return 0;if(t>=1)return 1;const e=t*t,i=e*t;return 4*(t<.5?i:3*(t-e)+i-.75)}function S(t,e,i,n){const r=new m(t,e,i,n);return function(t){return r.solve(t)}}const M=S(.25,.1,.25,1);function T(t,e,i){return Math.min(i,Math.max(e,t))}function I(t,e,i){return(i=T((i-t)/(e-t),0,1))*i*(3-2*i)}function C(t,e,i){const n=i-e,r=((t-e)%n+n)%n+e;return r===e?i:r}function P(t,e,i){if(!t.length)return i(null,[]);let n=t.length;const r=new Array(t.length);let o=null;t.forEach(((t,s)=>{e(t,((t,e)=>{t&&(o=t),r[s]=e,0==--n&&i(o,r)}))}))}function L(t){const e=[];for(const i in t)e.push(t[i]);return e}function D(t,...e){for(const i of e)for(const e in i)t[e]=i[e];return t}let R=1;function O(){return R++}function k(){return function t(e){return e?(e^Math.random()*(16>>e/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function N(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function B(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function z(t,e){t.forEach((t=>{e[t]&&(e[t]=e[t].bind(e))}))}function F(t,e){return-1!==t.indexOf(e,t.length-e.length)}function V(t,e,i){const n={};for(const r in t)n[r]=e.call(i||this,t[r],r,t);return n}function U(t,e,i){const n={};for(const r in t)e.call(i||this,t[r],r,t)&&(n[r]=t[r]);return n}function G(t){return Array.isArray(t)?t.map(G):"object"==typeof t&&t?V(t,G):t}const j={};function H(t){j[t]||("undefined"!=typeof console&&console.warn(t),j[t]=!0)}function W(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}function q(t){let e=0;for(let i,n,r=0,o=t.length,s=o-1;r<o;s=r++)i=t[r],n=t[s],e+=(n.x-i.x)*(i.y+n.y);return e}function X(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function Z(t){const e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((t,i,n,r)=>{const o=n||r;return e[i]=!o||o.toLowerCase(),""})),e["max-age"]){const t=parseInt(e["max-age"],10);isNaN(t)?delete e["max-age"]:e["max-age"]=t}return e}let Y=null;function Q(t){if(null==Y){const e=t.navigator?t.navigator.userAgent:null;Y=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return Y}function J(t){try{const i=e[t];return i.setItem("_mapbox_test_",1),i.removeItem("_mapbox_test_"),!0}catch(t){return!1}}function K(t,e){return[t[4*e],t[4*e+1],t[4*e+2],t[4*e+3]]}const $="mapbox-tiles";let tt,et,it=500,nt=50;function rt(){try{return e.caches}catch(t){}}function ot(){rt()&&!tt&&(tt=e.caches.open($))}function st(t){const e=t.indexOf("?");if(e<0)return t;const i=function(t){const e=t.indexOf("?");return e>0?t.slice(e+1).split("&"):[]}(t),n=i.filter((t=>{const e=t.split("=");return"language"===e[0]||"worldview"===e[0]}));return n.length?`${t.slice(0,e)}?${n.join("&")}`:t.slice(0,e)}let at=1/0;const lt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(lt);class ct extends Error{constructor(t,e,i){401===e&&xt(i)&&(t+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(t),this.status=e,this.url=i}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const ut=X()?()=>self.worker&&self.worker.referrer:()=>("blob:"===e.location.protocol?e.parent:e).location.href,ht=function(t,i){if(!(/^file:/.test(n=t.url)||/^file:/.test(ut())&&!/^\w+:/.test(n))){if(e.fetch&&e.Request&&e.AbortController&&e.Request.prototype.hasOwnProperty("signal"))return function(t,i){const n=new e.AbortController,r=new e.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:ut(),referrerPolicy:t.referrerPolicy,signal:n.signal});let o=!1,s=!1;const a=(l=r.url).indexOf("sku=")>0&&xt(l);var l;"json"===t.type&&r.headers.set("Accept","application/json");const c=(n,o,l)=>{if(s)return;if(n&&"SecurityError"!==n.message&&H(n.toString()),o&&l)return u(o);const c=Date.now();e.fetch(r).then((e=>{if(e.ok){const t=a?e.clone():null;return u(e,t,c)}return i(new ct(e.statusText,e.status,t.url))})).catch((e=>{"AbortError"!==e.name&&i(new Error(`${e.message} ${t.url}`))}))},u=(n,a,l)=>{("arrayBuffer"===t.type?n.arrayBuffer():"json"===t.type?n.json():n.text()).then((t=>{s||(a&&l&&function(t,i,n){if(ot(),!tt)return;const r={status:i.status,statusText:i.statusText,headers:new e.Headers};i.headers.forEach(((t,e)=>r.headers.set(e,t)));const o=Z(i.headers.get("Cache-Control")||"");if(o["no-store"])return;o["max-age"]&&r.headers.set("Expires",new Date(n+1e3*o["max-age"]).toUTCString());const s=r.headers.get("Expires");s&&(new Date(s).getTime()-n<42e4||function(t,e){if(void 0===et)try{new Response(new ReadableStream),et=!0}catch(t){et=!1}et?e(t.body):t.blob().then(e)}(i,(i=>{const n=new e.Response(i,r);ot(),tt&&tt.then((e=>e.put(st(t.url),n))).catch((t=>H(t.message)))})))}(r,a,l),o=!0,i(null,t,n.headers.get("Cache-Control"),n.headers.get("Expires")))})).catch((t=>{s||i(new Error(t.message))}))};return a?function(t,e){if(ot(),!tt)return e(null);const i=st(t.url);tt.then((t=>{t.match(i).then((n=>{const r=function(t){if(!t)return!1;const e=new Date(t.headers.get("Expires")||0),i=Z(t.headers.get("Cache-Control")||"");return e>Date.now()&&!i["no-cache"]}(n);t.delete(i),r&&t.put(i,n.clone()),e(null,n,r)})).catch(e)})).catch(e)}(r,c):c(null,null),{cancel:()=>{s=!0,o||n.abort()}}}(t,i);if(X()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,i,void 0,!0)}var n;return function(t,i){const n=new e.XMLHttpRequest;n.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(n.responseType="arraybuffer");for(const e in t.headers)n.setRequestHeader(e,t.headers[e]);return"json"===t.type&&(n.responseType="text",n.setRequestHeader("Accept","application/json")),n.withCredentials="include"===t.credentials,n.onerror=()=>{i(new Error(n.statusText))},n.onload=()=>{if((n.status>=200&&n.status<300||0===n.status)&&null!==n.response){let e=n.response;if("json"===t.type)try{e=JSON.parse(n.response)}catch(t){return i(t)}i(null,e,n.getResponseHeader("Cache-Control"),n.getResponseHeader("Expires"))}else i(new ct(n.statusText,n.status,t.url))},n.send(t.body),{cancel:()=>n.abort()}}(t,i)},pt=function(t,e){return ht(D(t,{type:"arrayBuffer"}),e)};function dt(t){const i=e.document.createElement("a");return i.href=t,i.protocol===e.document.location.protocol&&i.host===e.document.location.host}const ft="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let mt,gt;mt=[],gt=0;const yt=function(t,i){if(o.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),gt>=r.MAX_PARALLEL_IMAGE_REQUESTS){const e={requestParameters:t,callback:i,cancelled:!1,cancel(){this.cancelled=!0}};return mt.push(e),e}gt++;let n=!1;const s=()=>{if(!n)for(n=!0,gt--;mt.length&><r.MAX_PARALLEL_IMAGE_REQUESTS;){const t=mt.shift(),{requestParameters:e,callback:i,cancelled:n}=t;n||(t.cancel=yt(e,i).cancel)}},a=pt(t,((t,n,r,o)=>{s(),t?i(t):n&&(e.createImageBitmap?function(t,i){const n=new e.Blob([new Uint8Array(t)],{type:"image/png"});e.createImageBitmap(n).then((t=>{i(null,t)})).catch((t=>{i(new Error(`Could not load image because of ${t.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))}))}(n,((t,e)=>i(t,e,r,o))):function(t,i){const n=new e.Image,r=e.URL;n.onload=()=>{i(null,n),r.revokeObjectURL(n.src),n.onload=null,e.requestAnimationFrame((()=>{n.src=ft}))},n.onerror=()=>i(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 e.Blob([new Uint8Array(t)],{type:"image/png"});n.src=t.byteLength?r.createObjectURL(o):ft}(n,((t,e)=>i(t,e,r,o))))}));return{cancel:()=>{a.cancel(),s()}}},vt="NO_ACCESS_TOKEN";function _t(t){return 0===t.indexOf("mapbox:")}function xt(t){return r.API_URL_REGEX.test(t)}function bt(t){return r.API_CDN_URL_REGEX.test(t)}function wt(t){return r.API_STYLE_REGEX.test(t)&&!At(t)}function At(t){return r.API_SPRITE_REGEX.test(t)}const Et=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function St(t){const e=t.match(Et);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function Mt(t){const e=t.params.length?`?${t.params.join("&")}`:"";return`${t.protocol}://${t.authority}${t.path}${e}`}const Tt="mapbox.eventData";function It(t){if(!t)return null;const i=t.split(".");if(!i||3!==i.length)return null;try{return JSON.parse(decodeURIComponent(e.atob(i[1]).split("").map((t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2))).join("")))}catch(t){return null}}class Ct{constructor(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(t){const i=It(r.ACCESS_TOKEN);let n="";return n=i&&i.u?e.btoa(encodeURIComponent(i.u).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(Number("0x"+e))))):r.ACCESS_TOKEN||"",t?`${Tt}.${t}:${n}`:`${Tt}:${n}`}fetchEventData(){const t=J("localStorage"),i=this.getStorageKey(),n=this.getStorageKey("uuid");if(t)try{const t=e.localStorage.getItem(i);t&&(this.eventData=JSON.parse(t));const r=e.localStorage.getItem(n);r&&(this.anonId=r)}catch(t){H("Unable to read from LocalStorage")}}saveEventData(){const t=J("localStorage"),i=this.getStorageKey(),n=this.getStorageKey("uuid");if(t)try{e.localStorage.setItem(n,this.anonId),Object.keys(this.eventData).length>=1&&e.localStorage.setItem(i,JSON.stringify(this.eventData))}catch(t){H("Unable to write to LocalStorage")}}processRequests(t){}postEvent(t,e,i,n){if(!r.EVENTS_URL)return;const o=St(r.EVENTS_URL);o.params.push(`access_token=${n||r.ACCESS_TOKEN||""}`);const s={event:this.type,created:new Date(t).toISOString()},a=e?D(s,e):s,l={url:Mt(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([a])};this.pendingRequest=function(t,e){return ht(D(t,{method:"POST"}),e)}(l,(t=>{this.pendingRequest=null,i(t),this.saveEventData(),this.processRequests(n)}))}queueRequest(t,e){this.queue.push(t),this.processRequests(e)}}const Pt=new class extends Ct{constructor(t){super("appUserTurnstile"),this._customAccessToken=t}postTurnstileEvent(t,e){r.EVENTS_URL&&r.ACCESS_TOKEN&&Array.isArray(t)&&t.some((t=>_t(t)||xt(t)))&&this.queueRequest(Date.now(),e)}processRequests(t){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const e=It(r.ACCESS_TOKEN),n=e?e.u:r.ACCESS_TOKEN;let o=n!==this.eventData.tokenU;B(this.anonId)||(this.anonId=k(),o=!0);const s=this.queue.shift();if(this.eventData.lastSuccess){const t=new Date(this.eventData.lastSuccess),e=new Date(s),i=(s-this.eventData.lastSuccess)/864e5;o=o||i>=1||i<-1||t.getDate()!==e.getDate()}else o=!0;o?this.postEvent(s,{sdkIdentifier:"mapbox-gl-js",sdkVersion:i,skuId:h,"enabled.telemetry":!1,userId:this.anonId},(t=>{t||(this.eventData.lastSuccess=s,this.eventData.tokenU=n)}),t):this.processRequests()}},Lt=Pt.postTurnstileEvent.bind(Pt),Dt=new class extends Ct{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(t,e,i,n){this.skuToken=e,this.errorCb=n,r.EVENTS_URL&&(i||r.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},i):this.errorCb(new Error(vt)))}processRequests(t){if(this.pendingRequest||0===this.queue.length)return;const{id:e,timestamp:n}=this.queue.shift();e&&this.success[e]||(this.anonId||this.fetchEventData(),B(this.anonId)||(this.anonId=k()),this.postEvent(n,{sdkIdentifier:"mapbox-gl-js",sdkVersion:i,skuId:h,skuToken:this.skuToken,userId:this.anonId},(t=>{t?this.errorCb(t):e&&(this.success[e]=!0)}),t))}},Rt=Dt.postMapLoadEvent.bind(Dt),Ot=new class extends Ct{constructor(){super("gljs.performance")}postPerformanceEvent(t,e){r.EVENTS_URL&&(t||r.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:e},t)}processRequests(t){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:n,performanceData:r}=this.queue.shift(),o=function(t){const n=e.performance.getEntriesByType("resource"),r=e.performance.getEntriesByType("mark"),o=function(t){const e={};if(t)for(const i in t)if("other"!==i)for(const n of t[i]){const t=`${i}ResolveRangeMin`,r=`${i}ResolveRangeMax`,o=`${i}RequestCount`,s=`${i}RequestCachedCount`;e[t]=Math.min(e[t]||1/0,n.startTime),e[r]=Math.max(e[r]||-1/0,n.responseEnd);const a=t=>{void 0===e[t]&&(e[t]=0),++e[t]};void 0!==n.transferSize&&0===n.transferSize&&a(s),a(o)}return e}(function(t,e){const i={};if(t)for(const n of t){const t=e(n);void 0===i[t]&&(i[t]=[]),i[t].push(n)}return i}(n,Ut)),s=e.devicePixelRatio,a=e.navigator.connection||e.navigator.mozConnection||e.navigator.webkitConnection,l={counters:[],metadata:[],attributes:[]},c=(t,e,i)=>{null!=i&&t.push({name:e,value:i.toString()})};for(const t in o)c(l.counters,t,o[t]);if(t.interactionRange[0]!==1/0&&t.interactionRange[1]!==-1/0&&(c(l.counters,"interactionRangeMin",t.interactionRange[0]),c(l.counters,"interactionRangeMax",t.interactionRange[1])),r)for(const t of Object.keys(Ft)){const e=Ft[t],i=r.find((t=>t.name===e));i&&c(l.counters,e,i.startTime)}return c(l.counters,"visibilityHidden",t.visibilityHidden),c(l.attributes,"style",function(t){if(t)for(const e of t){const t=e.name.split("?")[0];if(wt(t)){const e=t.split("/").slice(-2);if(2===e.length)return`mapbox://styles/${e[0]}/${e[1]}`}}}(n)),c(l.attributes,"terrainEnabled",t.terrainEnabled?"true":"false"),c(l.attributes,"fogEnabled",t.fogEnabled?"true":"false"),c(l.attributes,"projection",t.projection),c(l.attributes,"zoom",t.zoom),c(l.metadata,"devicePixelRatio",s),c(l.metadata,"connectionEffectiveType",a?a.effectiveType:void 0),c(l.metadata,"navigatorUserAgent",e.navigator.userAgent),c(l.metadata,"screenWidth",e.screen.width),c(l.metadata,"screenHeight",e.screen.height),c(l.metadata,"windowWidth",e.innerWidth),c(l.metadata,"windowHeight",e.innerHeight),c(l.metadata,"mapWidth",t.width/s),c(l.metadata,"mapHeight",t.height/s),c(l.metadata,"webglRenderer",t.renderer),c(l.metadata,"webglVendor",t.vendor),c(l.metadata,"sdkVersion",i),c(l.metadata,"sdkIdentifier","mapbox-gl-js"),l}(r);for(const t of o.metadata);for(const t of o.counters);for(const t of o.attributes);this.postEvent(n,o,(()=>{}),t)}},kt=Ot.postPerformanceEvent.bind(Ot),Nt=new class extends Ct{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(t,e,i,n){if(!r.API_URL||!r.SESSION_PATH)return;const o=St(r.API_URL+r.SESSION_PATH);o.params.push(`sku=${e||""}`),o.params.push(`access_token=${n||r.ACCESS_TOKEN||""}`);const s={url:Mt(o),headers:{"Content-Type":"text/plain"}};this.pendingRequest=function(t,e){return ht(D(t,{method:"GET"}),e)}(s,(t=>{this.pendingRequest=null,i(t),this.saveEventData(),this.processRequests(n)}))}getSessionAPI(t,e,i,n){this.skuToken=e,this.errorCb=n,r.SESSION_PATH&&r.API_URL&&(i||r.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},i):this.errorCb(new Error(vt)))}processRequests(t){if(this.pendingRequest||0===this.queue.length)return;const{id:e,timestamp:i}=this.queue.shift();e&&this.success[e]||this.getSession(i,this.skuToken,(t=>{t?this.errorCb(t):e&&(this.success[e]=!0)}),t)}},Bt=Nt.getSessionAPI.bind(Nt),zt=new Set,Ft={create:"create",load:"load",fullLoad:"fullLoad"},Vt={mark(t){e.performance.mark(t)},measure(t,i,n){e.performance.measure(t,i,n)}};function Ut(t){const e=t.name.split("?")[0];return bt(e)&&e.includes("mapbox-gl.js")?"javascript":bt(e)&&e.includes("mapbox-gl.css")?"css":function(t){return r.API_FONTS_REGEX.test(t)}(e)?"fontRange":At(e)?"sprite":wt(e)?"style":function(t){return r.API_TILEJSON_REGEX.test(t)}(e)?"tilejson":"other"}const Gt=e.performance;function jt(t){const e=t?t.url.toString():void 0;return Gt.getEntriesByName(e)}let Ht,Wt,qt,Xt;const Zt={now:()=>void 0!==qt?qt:e.performance.now(),setNow(t){qt=t},restoreNow(){qt=void 0},frame(t){const i=e.requestAnimationFrame(t);return{cancel:()=>e.cancelAnimationFrame(i)}},getImageData(t,i=0){const{width:n,height:r}=t;Xt||(Xt=e.document.createElement("canvas"));const o=Xt.getContext("2d",{willReadFrequently:!0});if(!o)throw new Error("failed to create canvas 2d context");return(n>Xt.width||r>Xt.height)&&(Xt.width=n,Xt.height=r),o.clearRect(-i,-i,n+2*i,r+2*i),o.drawImage(t,0,0,n,r),o.getImageData(-i,-i,n+2*i,r+2*i)},resolveURL:t=>(Ht||(Ht=e.document.createElement("a")),Ht.href=t,Ht.href),get devicePixelRatio(){return e.devicePixelRatio},get prefersReducedMotion(){return!!e.matchMedia&&(null==Wt&&(Wt=e.matchMedia("(prefers-reduced-motion: reduce)")),Wt.matches)}};function Yt(t,e,i){i[t]&&-1!==i[t].indexOf(e)||(i[t]=i[t]||[],i[t].push(e))}function Qt(t,e,i){if(i&&i[t]){const n=i[t].indexOf(e);-1!==n&&i[t].splice(n,1)}}class Jt{constructor(t,e={}){D(this,e),this.type=t}}class Kt extends Jt{constructor(t,e={}){super("error",D({error:t},e))}}class $t{on(t,e){return this._listeners=this._listeners||{},Yt(t,e,this._listeners),this}off(t,e){return Qt(t,e,this._listeners),Qt(t,e,this._oneTimeListeners),this}once(t,e){return e?(this._oneTimeListeners=this._oneTimeListeners||{},Yt(t,e,this._oneTimeListeners),this):new Promise((e=>this.once(t,e)))}fire(t,e){"string"==typeof t&&(t=new Jt(t,e||{}));const i=t.type;if(this.listens(i)){t.target=this;const e=this._listeners&&this._listeners[i]?this._listeners[i].slice():[];for(const i of e)i.call(this,t);const n=this._oneTimeListeners&&this._oneTimeListeners[i]?this._oneTimeListeners[i].slice():[];for(const e of n)Qt(i,e,this._oneTimeListeners),e.call(this,t);const r=this._eventedParent;r&&(D(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),r.fire(t))}else t instanceof Kt&&console.error(t.error);return this}listens(t){return!!(this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t))}setEventedParent(t,e){return this._eventedParent=t,this._eventedParentData=e,this}}var te=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 ee(t,...e){for(const i of e)for(const e in i)t[e]=i[e];return t}function ie(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function ne(t){if(Array.isArray(t))return t.map(ne);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const i in t)e[i]=ne(t[i]);return e}return ie(t)}class re extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}var oe=re;class se{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[t,i]of e)this.bindings[t]=i}concat(t){return new se(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}var ae=se;const le={kind:"null"},ce={kind:"number"},ue={kind:"string"},he={kind:"boolean"},pe={kind:"color"},de={kind:"object"},fe={kind:"value"},me={kind:"collator"},ge={kind:"formatted"},ye={kind:"resolvedImage"};function ve(t,e){return{kind:"array",itemType:t,N:e}}function _e(t){if("array"===t.kind){const e=_e(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const xe=[le,ce,ue,he,pe,ge,de,ve(fe),ye];function be(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!be(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(const t of xe)if(!be(t,e))return null}return`Expected ${_e(t)} but found ${_e(e)} instead.`}function we(t,e){return e.some((e=>e.kind===t.kind))}function Ae(t,e){return e.some((e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t))}var Ee,Se={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 Me(t){return(t=Math.round(t))<0?0:t>255?255:t}function Te(t){return Me("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function Ie(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function Ce(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{Ee={}.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in Se)return Se[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var n=i.indexOf("("),r=i.indexOf(")");if(-1!==n&&r+1===i.length){var o=i.substr(0,n),s=i.substr(n+1,r-(n+1)).split(","),a=1;switch(o){case"rgba":if(4!==s.length)return null;a=Ie(s.pop());case"rgb":return 3!==s.length?null:[Te(s[0]),Te(s[1]),Te(s[2]),a];case"hsla":if(4!==s.length)return null;a=Ie(s.pop());case"hsl":if(3!==s.length)return null;var l=(parseFloat(s[0])%360+360)%360/360,c=Ie(s[1]),u=Ie(s[2]),h=u<=.5?u*(c+1):u+c-u*c,p=2*u-h;return[Me(255*Ce(p,h,l+1/3)),Me(255*Ce(p,h,l)),Me(255*Ce(p,h,l-1/3)),a];default:return null}}return null}}catch(t){}class Pe{constructor(t,e,i,n=1){this.r=t,this.g=e,this.b=i,this.a=n}static parse(t){if(!t)return;if(t instanceof Pe)return t;if("string"!=typeof t)return;const e=Ee(t);return e?new Pe(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3]):void 0}toString(){const[t,e,i,n]=this.toArray();return`rgba(${Math.round(t)},${Math.round(e)},${Math.round(i)},${n})`}toArray(){const{r:t,g:e,b:i,a:n}=this;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*i/n,n]}toArray01(){const{r:t,g:e,b:i,a:n}=this;return 0===n?[0,0,0,0]:[t/n,e/n,i/n,n]}toArray01PremultipliedAlpha(){const{r:t,g:e,b:i,a:n}=this;return[t,e,i,n]}}Pe.black=new Pe(0,0,0,1),Pe.white=new Pe(1,1,1,1),Pe.transparent=new Pe(0,0,0,0),Pe.red=new Pe(1,0,0,1),Pe.blue=new Pe(0,0,1,1);var Le=Pe;class De{constructor(t,e,i){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Re{constructor(t,e,i,n,r){this.text=t.normalize?t.normalize():t,this.image=e,this.scale=i,this.fontStack=n,this.textColor=r}}class Oe{constructor(t){this.sections=t}static fromString(t){return new Oe([new Re(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((t=>0!==t.text.length||t.image&&0!==t.image.name.length))}static factory(t){return t instanceof Oe?t:Oe.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map((t=>t.text)).join("")}serialize(){const t=["format"];for(const e of this.sections){if(e.image){t.push(["image",e.image.name]);continue}t.push(e.text);const i={};e.fontStack&&(i["text-font"]=["literal",e.fontStack.split(",")]),e.scale&&(i["font-scale"]=e.scale),e.textColor&&(i["text-color"]=["rgba"].concat(e.textColor.toArray())),t.push(i)}return t}}class ke{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new ke({name:t,available:!1}):null}serialize(){return["image",this.name]}}function Ne(t,e,i,n){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,i,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[t,e,i,n]:[t,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Be(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof Le)return!0;if(t instanceof De)return!0;if(t instanceof Oe)return!0;if(t instanceof ke)return!0;if(Array.isArray(t)){for(const e of t)if(!Be(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!Be(t[e]))return!1;return!0}return!1}function ze(t){if(null===t)return le;if("string"==typeof t)return ue;if("boolean"==typeof t)return he;if("number"==typeof t)return ce;if(t instanceof Le)return pe;if(t instanceof De)return me;if(t instanceof Oe)return ge;if(t instanceof ke)return ye;if(Array.isArray(t)){const e=t.length;let i;for(const e of t){const t=ze(e);if(i){if(i===t)continue;i=fe;break}i=t}return ve(i||fe,e)}return de}function Fe(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Le||t instanceof Oe||t instanceof ke?t.toString():JSON.stringify(t)}class Ve{constructor(t,e){this.type=t,this.value=e}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Be(t[1]))return e.error("invalid value");const i=t[1];let n=ze(i);const r=e.expectedType;return"array"!==n.kind||0!==n.N||!r||"array"!==r.kind||"number"==typeof r.N&&0!==r.N||(n=r),new Ve(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Le?["rgba"].concat(this.value.toArray()):this.value instanceof Oe?this.value.serialize():this.value}}var Ue=Ve,Ge=class{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}};const je={string:ue,number:ce,boolean:he,object:de};class He{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let i,n=1;const r=t[0];if("array"===r){let r,o;if(t.length>2){const i=t[1];if("string"!=typeof i||!(i in je)||"object"===i)return e.error('The item type argument of "array" must be one of string, number, boolean',1);r=je[i],n++}else r=fe;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],n++}i=ve(r,o)}else i=je[r];const o=[];for(;n<t.length;n++){const i=e.parse(t[n],n,fe);if(!i)return null;o.push(i)}return new He(i,o)}evaluate(t){for(let e=0;e<this.args.length;e++){const i=this.args[e].evaluate(t);if(!be(this.type,ze(i)))return i;if(e===this.args.length-1)throw new Ge(`Expected value to be of type ${_e(this.type)}, but found ${_e(ze(i))} instead.`)}return null}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=this.type,e=[t.kind];if("array"===t.kind){const i=t.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){e.push(i.kind);const n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n)}}return e.concat(this.args.map((t=>t.serialize())))}}var We=He;class qe{constructor(t){this.type=ge,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return e.error("First argument must be an image or text section.");const n=[];let r=!1;for(let i=1;i<=t.length-1;++i){const o=t[i];if(r&&"object"==typeof o&&!Array.isArray(o)){r=!1;let t=null;if(o["font-scale"]&&(t=e.parse(o["font-scale"],1,ce),!t))return null;let i=null;if(o["text-font"]&&(i=e.parse(o["text-font"],1,ve(ue)),!i))return null;let s=null;if(o["text-color"]&&(s=e.parse(o["text-color"],1,pe),!s))return null;const a=n[n.length-1];a.scale=t,a.font=i,a.textColor=s}else{const o=e.parse(t[i],1,fe);if(!o)return null;const s=o.type.kind;if("string"!==s&&"value"!==s&&"null"!==s&&"resolvedImage"!==s)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");r=!0,n.push({content:o,scale:null,font:null,textColor:null})}}return new qe(n)}evaluate(t){return new Oe(this.sections.map((e=>{const i=e.content.evaluate(t);return ze(i)===ye?new Re("",i,null,null,null):new Re(Fe(i),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))}eachChild(t){for(const e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor)}outputDefined(){return!1}serialize(){const t=["format"];for(const e of this.sections){t.push(e.content.serialize());const i={};e.scale&&(i["font-scale"]=e.scale.serialize()),e.font&&(i["text-font"]=e.font.serialize()),e.textColor&&(i["text-color"]=e.textColor.serialize()),t.push(i)}return t}}class Xe{constructor(t){this.type=ye,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,ue);return i?new Xe(i):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),i=ke.fromString(e);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(e)>-1),i}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const Ze={"to-boolean":he,"to-color":pe,"to-number":ce,"to-string":ue};class Ye{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[0];if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return e.error("Expected one argument.");const n=Ze[i],r=[];for(let i=1;i<t.length;i++){const n=e.parse(t[i],i,fe);if(!n)return null;r.push(n)}return new Ye(n,r)}evaluate(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){let e,i;for(const n of this.args){if(e=n.evaluate(t),i=null,e instanceof Le)return e;if("string"==typeof e){const i=t.parseColor(e);if(i)return i}else if(Array.isArray(e)&&(i=e.length<3||e.length>4?`Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:Ne(e[0],e[1],e[2],e[3]),!i))return new Le(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new Ge(i||`Could not parse color from value '${"string"==typeof e?e:String(JSON.stringify(e))}'`)}if("number"===this.type.kind){let e=null;for(const i of this.args){if(e=i.evaluate(t),null===e)return 0;const n=Number(e);if(!isNaN(n))return n}throw new Ge(`Could not convert ${JSON.stringify(e)} to number.`)}return"formatted"===this.type.kind?Oe.fromString(Fe(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?ke.fromString(Fe(this.args[0].evaluate(t))):Fe(this.args[0].evaluate(t))}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new qe([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Xe(this.args[0]).serialize();const t=[`to-${this.type.kind}`];return this.eachChild((e=>{t.push(e.serialize())})),t}}var Qe=Ye;const Je=["Unknown","Point","LineString","Polygon"];var Ke=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?Je[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 t=this.featureDistanceData.center,e=this.featureDistanceData.scale,{x:i,y:n}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(i*e-t[0])+this.featureDistanceData.bearing[1]*(n*e-t[1])}return 0}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Le.parse(t)),e}};class $e{constructor(t,e,i,n){this.name=t,this.type=e,this._evaluate=i,this.args=n}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map((t=>t.serialize())))}static parse(t,e){const i=t[0],n=$e.definitions[i];if(!n)return e.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const r=Array.isArray(n)?n[0]:n.type,o=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=o.filter((([e])=>!Array.isArray(e)||e.length===t.length-1));let a=null;for(const[n,o]of s){a=new Mi(e.registry,e.path,null,e.scope);const s=[];let l=!1;for(let e=1;e<t.length;e++){const i=t[e],r=Array.isArray(n)?n[e-1]:n.type,o=a.parse(i,1+s.length,r);if(!o){l=!0;break}s.push(o)}if(!l)if(Array.isArray(n)&&n.length!==s.length)a.error(`Expected ${n.length} arguments, but found ${s.length} instead.`);else{for(let t=0;t<s.length;t++){const e=Array.isArray(n)?n[t]:n.type,i=s[t];a.concat(t+1).checkSubtype(e,i.type)}if(0===a.errors.length)return new $e(i,r,o,s)}}if(1===s.length)e.errors.push(...a.errors);else{const i=(s.length?s:o).map((([t])=>{return e=t,Array.isArray(e)?`(${e.map(_e).join(", ")})`:`(${_e(e.type)}...)`;var e})).join(" | "),n=[];for(let i=1;i<t.length;i++){const r=e.parse(t[i],1+n.length);if(!r)return null;n.push(_e(r.type))}e.error(`Expected arguments of type ${i}, but found (${n.join(", ")}) instead.`)}return null}static register(t,e){$e.definitions=e;for(const i in e)t[i]=$e}}var ti=$e;class ei{constructor(t,e,i){this.type=me,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=e}static parse(t,e){if(2!==t.length)return e.error("Expected one argument.");const i=t[1];if("object"!=typeof i||Array.isArray(i))return e.error("Collator options argument must be an object.");const n=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,he);if(!n)return null;const r=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,he);if(!r)return null;let o=null;return i.locale&&(o=e.parse(i.locale,1,ue),!o)?null:new ei(n,r,o)}evaluate(t){return new De(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}serialize(){const t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]}}const ii=8192;function ni(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function ri(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function oi(t,e){const i=(180+t[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,r=Math.pow(2,e.z);return[Math.round(i*r*ii),Math.round(n*r*ii)]}function si(t,e,i){const n=t[0]-e[0],r=t[1]-e[1],o=t[0]-i[0],s=t[1]-i[1];return n*s-o*r==0&&n*o<=0&&r*s<=0}function ai(t,e){let i=!1;for(let s=0,a=e.length;s<a;s++){const a=e[s];for(let e=0,s=a.length;e<s-1;e++){if(si(t,a[e],a[e+1]))return!1;(r=a[e])[1]>(n=t)[1]!=(o=a[e+1])[1]>n[1]&&n[0]<(o[0]-r[0])*(n[1]-r[1])/(o[1]-r[1])+r[0]&&(i=!i)}}var n,r,o;return i}function li(t,e){for(let i=0;i<e.length;i++)if(ai(t,e[i]))return!0;return!1}function ci(t,e,i,n){const r=n[0]-i[0],o=n[1]-i[1],s=(t[0]-i[0])*o-r*(t[1]-i[1]),a=(e[0]-i[0])*o-r*(e[1]-i[1]);return s>0&&a<0||s<0&&a>0}function ui(t,e,i){for(const c of i)for(let i=0;i<c.length-1;++i)if(0!=(a=[(s=c[i+1])[0]-(o=c[i])[0],s[1]-o[1]])[0]*(l=[(r=e)[0]-(n=t)[0],r[1]-n[1]])[1]-a[1]*l[0]&&ci(n,r,o,s)&&ci(o,s,n,r))return!0;var n,r,o,s,a,l;return!1}function hi(t,e){for(let i=0;i<t.length;++i)if(!ai(t[i],e))return!1;for(let i=0;i<t.length-1;++i)if(ui(t[i],t[i+1],e))return!1;return!0}function pi(t,e){for(let i=0;i<e.length;i++)if(hi(t,e[i]))return!0;return!1}function di(t,e,i){const n=[];for(let r=0;r<t.length;r++){const o=[];for(let n=0;n<t[r].length;n++){const s=oi(t[r][n],i);ni(e,s),o.push(s)}n.push(o)}return n}function fi(t,e,i){const n=[];for(let r=0;r<t.length;r++){const o=di(t[r],e,i);n.push(o)}return n}function mi(t,e,i,n){if(t[0]<i[0]||t[0]>i[2]){const e=.5*n;let r=t[0]-i[0]>e?-n:i[0]-t[0]>e?n:0;0===r&&(r=t[0]-i[2]>e?-n:i[2]-t[0]>e?n:0),t[0]+=r}ni(e,t)}function gi(t,e,i,n){const r=Math.pow(2,n.z)*ii,o=[n.x*ii,n.y*ii],s=[];if(!t)return s;for(const n of t)for(const t of n){const n=[t.x+o[0],t.y+o[1]];mi(n,e,i,r),s.push(n)}return s}function yi(t,e,i,n){const r=Math.pow(2,n.z)*ii,o=[n.x*ii,n.y*ii],s=[];if(!t)return s;for(const i of t){const t=[];for(const n of i){const i=[n.x+o[0],n.y+o[1]];ni(e,i),t.push(i)}s.push(t)}if(e[2]-e[0]<=r/2){(a=e)[0]=a[1]=1/0,a[2]=a[3]=-1/0;for(const t of s)for(const n of t)mi(n,e,i,r)}var a;return s}class vi{constructor(t,e){this.type=he,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Be(t[1])){const e=t[1];if("FeatureCollection"===e.type)for(let t=0;t<e.features.length;++t){const i=e.features[t].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new vi(e,e.features[t].geometry)}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new vi(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new vi(e,e)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if(!r)return!1;if("Polygon"===e.type){const o=di(e.coordinates,n,r),s=gi(t.geometry(),i,n,r);if(!ri(i,n))return!1;for(const t of s)if(!ai(t,o))return!1}if("MultiPolygon"===e.type){const o=fi(e.coordinates,n,r),s=gi(t.geometry(),i,n,r);if(!ri(i,n))return!1;for(const t of s)if(!li(t,o))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if(!r)return!1;if("Polygon"===e.type){const o=di(e.coordinates,n,r),s=yi(t.geometry(),i,n,r);if(!ri(i,n))return!1;for(const t of s)if(!hi(t,o))return!1}if("MultiPolygon"===e.type){const o=fi(e.coordinates,n,r),s=yi(t.geometry(),i,n,r);if(!ri(i,n))return!1;for(const t of s)if(!pi(t,o))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}var _i=vi;function xi(t){if(t instanceof ti){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof _i)return!1;let e=!0;return t.eachChild((t=>{e&&!xi(t)&&(e=!1)})),e}function bi(t){if(t instanceof ti&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild((t=>{e&&!bi(t)&&(e=!1)})),e}function wi(t,e){if(t instanceof ti&&e.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild((t=>{i&&!wi(t,e)&&(i=!1)})),i}class Ai{constructor(t,e){this.type=e.type,this.name=t,this.boundExpression=e}static parse(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");const i=t[1];return e.scope.has(i)?new Ai(i,e.scope.get(i)):e.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var Ei=Ai;class Si{constructor(t,e=[],i,n=new ae,r=[]){this.registry=t,this.path=e,this.key=e.map((t=>`[${t}]`)).join(""),this.scope=n,this.errors=r,this.expectedType=i}parse(t,e,i,n,r={}){return e?this.concat(e,i,n)._parse(t,r):this._parse(t,r)}_parse(t,e){function i(t,e,i){return"assert"===i?new We(e,[t]):"coerce"===i?new Qe(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const n=t[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 r=this.registry[n];if(r){let n=r.parse(t,this);if(!n)return null;if(this.expectedType){const t=this.expectedType,r=n.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==r.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==r.kind&&"string"!==r.kind){if(this.checkSubtype(t,r))return null}else n=i(n,t,e.typeAnnotation||"coerce");else n=i(n,t,e.typeAnnotation||"assert")}if(!(n instanceof Ue)&&"resolvedImage"!==n.type.kind&&Ti(n)){const e=new Ke;try{n=new Ue(n.type,n.evaluate(e))}catch(t){return this.error(t.message),null}}return n}return this.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,e,i){const n="number"==typeof t?this.path.concat(t):this.path,r=i?this.scope.concat(i):this.scope;return new Si(this.registry,n,e||null,r,this.errors)}error(t,...e){const i=`${this.key}${e.map((t=>`[${t}]`)).join("")}`;this.errors.push(new oe(i,t))}checkSubtype(t,e){const i=be(t,e);return i&&this.error(i),i}}var Mi=Si;function Ti(t){if(t instanceof Ei)return Ti(t.boundExpression);if(t instanceof ti&&"error"===t.name)return!1;if(t instanceof ei)return!1;if(t instanceof _i)return!1;const e=t instanceof Qe||t instanceof We;let i=!0;return t.eachChild((t=>{i=e?i&&Ti(t):i&&t instanceof Ue})),!!i&&xi(t)&&wi(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"])}function Ii(t,e){const i=t.length-1;let n,r,o=0,s=i,a=0;for(;o<=s;)if(a=Math.floor((o+s)/2),n=t[a],r=t[a+1],n<=e){if(a===i||e<r)return a;o=a+1}else{if(!(n>e))throw new Ge("Input is not a number.");s=a-1}return 0}class Ci{constructor(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[t,e]of i)this.labels.push(t),this.outputs.push(e)}static parse(t,e){if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");const i=e.parse(t[1],1,ce);if(!i)return null;const n=[];let r=null;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(let i=1;i<t.length;i+=2){const o=1===i?-1/0:t[i],s=t[i+1],a=i,l=i+1;if("number"!=typeof o)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',a);if(n.length&&n[n.length-1][0]>=o)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',a);const c=e.parse(s,l,r);if(!c)return null;r=r||c.type,n.push([o,c])}return new Ci(r,i,n)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);const r=e.length;return n>=e[r-1]?i[r-1].evaluate(t):i[Ii(e,n)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){const t=["step",this.input.serialize()];for(let e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t}}var Pi=Ci;function Li(t,e,i){return t*(1-i)+e*i}var Di=Object.freeze({__proto__:null,array:function(t,e,i){return t.map(((t,n)=>Li(t,e[n],i)))},color:function(t,e,i){return new Le(Li(t.r,e.r,i),Li(t.g,e.g,i),Li(t.b,e.b,i),Li(t.a,e.a,i))},number:Li});const Ri=.95047,Oi=1.08883,ki=4/29,Ni=6/29,Bi=3*Ni*Ni,zi=Ni*Ni*Ni,Fi=Math.PI/180,Vi=180/Math.PI;function Ui(t){return t>zi?Math.pow(t,1/3):t/Bi+ki}function Gi(t){return t>Ni?t*t*t:Bi*(t-ki)}function ji(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Hi(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Wi(t){const e=Hi(t.r),i=Hi(t.g),n=Hi(t.b),r=Ui((.4124564*e+.3575761*i+.1804375*n)/Ri),o=Ui((.2126729*e+.7151522*i+.072175*n)/1);return{l:116*o-16,a:500*(r-o),b:200*(o-Ui((.0193339*e+.119192*i+.9503041*n)/Oi)),alpha:t.a}}function qi(t){let e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Gi(e),i=Ri*Gi(i),n=Oi*Gi(n),new Le(ji(3.2404542*i-1.5371385*e-.4985314*n),ji(-.969266*i+1.8760108*e+.041556*n),ji(.0556434*i-.2040259*e+1.0572252*n),t.alpha)}function Xi(t,e,i){const n=e-t;return t+i*(n>180||n<-180?n-360*Math.round(n/360):n)}const Zi={forward:Wi,reverse:qi,interpolate:function(t,e,i){return{l:Li(t.l,e.l,i),a:Li(t.a,e.a,i),b:Li(t.b,e.b,i),alpha:Li(t.alpha,e.alpha,i)}}},Yi={forward:function(t){const{l:e,a:i,b:n}=Wi(t),r=Math.atan2(n,i)*Vi;return{h:r<0?r+360:r,c:Math.sqrt(i*i+n*n),l:e,alpha:t.a}},reverse:function(t){const e=t.h*Fi,i=t.c;return qi({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:Xi(t.h,e.h,i),c:Li(t.c,e.c,i),l:Li(t.l,e.l,i),alpha:Li(t.alpha,e.alpha,i)}}};var Qi=Object.freeze({__proto__:null,hcl:Yi,lab:Zi});class Ji{constructor(t,e,i,n,r){this.type=t,this.operator=e,this.interpolation=i,this.input=n,this.labels=[],this.outputs=[];for(const[t,e]of r)this.labels.push(t),this.outputs.push(e)}static interpolationFactor(t,e,i,n){let r=0;if("exponential"===t.name)r=Ki(e,t.base,i,n);else if("linear"===t.name)r=Ki(e,1,i,n);else if("cubic-bezier"===t.name){const o=t.controlPoints;r=new m(o[0],o[1],o[2],o[3]).solve(Ki(e,1,i,n))}return r}static parse(t,e){let[i,n,r,...o]=t;if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const t=n[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:t}}else{if("cubic-bezier"!==n[0])return e.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const t=n.slice(1);if(4!==t.length||t.some((t=>"number"!=typeof t||t<0||t>1)))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(r=e.parse(r,2,ce),!r)return null;const s=[];let a=null;"interpolate-hcl"===i||"interpolate-lab"===i?a=pe:e.expectedType&&"value"!==e.expectedType.kind&&(a=e.expectedType);for(let t=0;t<o.length;t+=2){const i=o[t],n=o[t+1],r=t+3,l=t+4;if("number"!=typeof i)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',r);if(s.length&&s[s.length-1][0]>=i)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',r);const c=e.parse(n,l,a);if(!c)return null;a=a||c.type,s.push([i,c])}return"number"===a.kind||"color"===a.kind||"array"===a.kind&&"number"===a.itemType.kind&&"number"==typeof a.N?new Ji(a,i,n,r,s):e.error(`Type ${_e(a)} is not interpolatable.`)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);const r=e.length;if(n>=e[r-1])return i[r-1].evaluate(t);const o=Ii(e,n),s=Ji.interpolationFactor(this.interpolation,n,e[o],e[o+1]),a=i[o].evaluate(t),l=i[o+1].evaluate(t);return"interpolate"===this.operator?Di[this.type.kind.toLowerCase()](a,l,s):"interpolate-hcl"===this.operator?Yi.reverse(Yi.interpolate(Yi.forward(a),Yi.forward(l),s)):Zi.reverse(Zi.interpolate(Zi.forward(a),Zi.forward(l),s))}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){let t;t="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 e=[this.operator,t,this.input.serialize()];for(let t=0;t<this.labels.length;t++)e.push(this.labels[t],this.outputs[t].serialize());return e}}function Ki(t,e,i,n){const r=n-i,o=t-i;return 0===r?0:1===e?o/r:(Math.pow(e,o)-1)/(Math.pow(e,r)-1)}var $i=Ji;class tn{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expectected at least one argument.");let i=null;const n=e.expectedType;n&&"value"!==n.kind&&(i=n);const r=[];for(const n of t.slice(1)){const t=e.parse(n,1+r.length,i,void 0,{typeAnnotation:"omit"});if(!t)return null;i=i||t.type,r.push(t)}const o=n&&r.some((t=>be(n,t.type)));return new tn(o?fe:i,r)}evaluate(t){let e,i=null,n=0;for(const r of this.args){if(n++,i=r.evaluate(t),i&&i instanceof ke&&!i.available&&(e||(e=i),i=null,n===this.args.length))return e;if(null!==i)break}return i}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=["coalesce"];return this.eachChild((e=>{t.push(e.serialize())})),t}}var en=tn;class nn{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const e of this.bindings)t(e[1]);t(this.result)}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const i=[];for(let n=1;n<t.length-1;n+=2){const r=t[n];if("string"!=typeof r)return e.error(`Expected string, but found ${typeof r} instead.`,n);if(/[^a-zA-Z0-9_]/.test(r))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);const o=e.parse(t[n+1],n+1);if(!o)return null;i.push([r,o])}const n=e.parse(t[t.length-1],t.length-1,e.expectedType,i);return n?new nn(i,n):null}outputDefined(){return this.result.outputDefined()}serialize(){const t=["let"];for(const[e,i]of this.bindings)t.push(e,i.serialize());return t.push(this.result.serialize()),t}}var rn=nn;class on{constructor(t,e,i){this.type=t,this.index=e,this.input=i}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,ce),n=e.parse(t[2],2,ve(e.expectedType||fe));return i&&n?new on(n.type.itemType,i,n):null}evaluate(t){const e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new Ge(`Array index out of bounds: ${e} < 0.`);if(e>=i.length)throw new Ge(`Array index out of bounds: ${e} > ${i.length-1}.`);if(e!==Math.floor(e))throw new Ge(`Array index must be an integer, but found ${e} instead.`);return i[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var sn=on;class an{constructor(t,e){this.type=he,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,fe),n=e.parse(t[2],2,fe);return i&&n?we(i.type,[he,ue,ce,le,fe])?new an(i,n):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${_e(i.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(null==i)return!1;if(!Ae(e,["boolean","string","number","null"]))throw new Ge(`Expected first argument to be of type boolean, string, number or null, but found ${_e(ze(e))} instead.`);if(!Ae(i,["string","array"]))throw new Ge(`Expected second argument to be of type array or string, but found ${_e(ze(i))} instead.`);return i.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var ln=an;class cn{constructor(t,e,i){this.type=ce,this.needle=t,this.haystack=e,this.fromIndex=i}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,fe),n=e.parse(t[2],2,fe);if(!i||!n)return null;if(!we(i.type,[he,ue,ce,le,fe]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${_e(i.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,ce);return r?new cn(i,n,r):null}return new cn(i,n)}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!Ae(e,["boolean","string","number","null"]))throw new Ge(`Expected first argument to be of type boolean, string, number or null, but found ${_e(ze(e))} instead.`);if(!Ae(i,["string","array"]))throw new Ge(`Expected second argument to be of type array or string, but found ${_e(ze(i))} instead.`);if(this.fromIndex){const n=this.fromIndex.evaluate(t);return i.indexOf(e,n)}return i.indexOf(e)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var un=cn;class hn{constructor(t,e,i,n,r,o){this.inputType=t,this.type=e,this.input=i,this.cases=n,this.outputs=r,this.otherwise=o}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let i,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);const r={},o=[];for(let s=2;s<t.length-1;s+=2){let a=t[s];const l=t[s+1];Array.isArray(a)||(a=[a]);const c=e.concat(s);if(0===a.length)return c.error("Expected at least one branch label.");for(const t of a){if("number"!=typeof t&&"string"!=typeof t)return c.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return c.error("Numeric branch labels must be integer values.");if(i){if(c.checkSubtype(i,ze(t)))return null}else i=ze(t);if(void 0!==r[String(t)])return c.error("Branch labels must be unique.");r[String(t)]=o.length}const u=e.parse(l,s,n);if(!u)return null;n=n||u.type,o.push(u)}const s=e.parse(t[1],1,fe);if(!s)return null;const a=e.parse(t[t.length-1],t.length-1,n);return a?"value"!==s.type.kind&&e.concat(1).checkSubtype(i,s.type)?null:new hn(i,n,s,r,o,a):null}evaluate(t){const e=this.input.evaluate(t);return(ze(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["match",this.input.serialize()],e=Object.keys(this.cases).sort(),i=[],n={};for(const t of e){const e=n[this.cases[t]];void 0===e?(n[this.cases[t]]=i.length,i.push([this.cases[t],[t]])):i[e][1].push(t)}const r=t=>"number"===this.inputType.kind?Number(t):t;for(const[e,n]of i)t.push(1===n.length?r(n[0]):n.map(r)),t.push(this.outputs[e].serialize());return t.push(this.otherwise.serialize()),t}}var pn=hn;class dn{constructor(t,e,i){this.type=t,this.branches=e,this.otherwise=i}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return e.error("Expected an odd number of arguments.");let i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);const n=[];for(let r=1;r<t.length-1;r+=2){const o=e.parse(t[r],r,he);if(!o)return null;const s=e.parse(t[r+1],r+1,i);if(!s)return null;n.push([o,s]),i=i||s.type}const r=e.parse(t[t.length-1],t.length-1,i);return r?new dn(i,n,r):null}evaluate(t){for(const[e,i]of this.branches)if(e.evaluate(t))return i.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[e,i]of this.branches)t(e),t(i);t(this.otherwise)}outputDefined(){return this.branches.every((([t,e])=>e.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild((e=>{t.push(e.serialize())})),t}}var fn=dn;class mn{constructor(t,e,i,n){this.type=t,this.input=e,this.beginIndex=i,this.endIndex=n}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,fe),n=e.parse(t[2],2,ce);if(!i||!n)return null;if(!we(i.type,[ve(fe),ue,fe]))return e.error(`Expected first argument to be of type array or string, but found ${_e(i.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,ce);return r?new mn(i.type,i,n,r):null}return new mn(i.type,i,n)}evaluate(t){const e=this.input.evaluate(t),i=this.beginIndex.evaluate(t);if(!Ae(e,["string","array"]))throw new Ge(`Expected first argument to be of type array or string, but found ${_e(ze(e))} instead.`);if(this.endIndex){const n=this.endIndex.evaluate(t);return e.slice(i,n)}return e.slice(i)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var gn=mn;function yn(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function vn(t,e,i,n){return 0===n.compare(e,i)}function _n(t,e,i){const n="=="!==t&&"!="!==t;return class r{constructor(t,e,i){this.type=he,this.lhs=t,this.rhs=e,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");const i=t[0];let o=e.parse(t[1],1,fe);if(!o)return null;if(!yn(i,o.type))return e.concat(1).error(`"${i}" comparisons are not supported for type '${_e(o.type)}'.`);let s=e.parse(t[2],2,fe);if(!s)return null;if(!yn(i,s.type))return e.concat(2).error(`"${i}" comparisons are not supported for type '${_e(s.type)}'.`);if(o.type.kind!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error(`Cannot compare types '${_e(o.type)}' and '${_e(s.type)}'.`);n&&("value"===o.type.kind&&"value"!==s.type.kind?o=new We(s.type,[o]):"value"!==o.type.kind&&"value"===s.type.kind&&(s=new We(o.type,[s])));let a=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error("Cannot use collator to compare non-string types.");if(a=e.parse(t[3],3,me),!a)return null}return new r(o,s,a)}evaluate(r){const o=this.lhs.evaluate(r),s=this.rhs.evaluate(r);if(n&&this.hasUntypedArgument){const e=ze(o),i=ze(s);if(e.kind!==i.kind||"string"!==e.kind&&"number"!==e.kind)throw new Ge(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${i.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const t=ze(o),i=ze(s);if("string"!==t.kind||"string"!==i.kind)return e(r,o,s)}return this.collator?i(r,o,s,this.collator.evaluate(r)):e(r,o,s)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}serialize(){const e=[t];return this.eachChild((t=>{e.push(t.serialize())})),e}}}const xn=_n("==",(function(t,e,i){return e===i}),vn),bn=_n("!=",(function(t,e,i){return e!==i}),(function(t,e,i,n){return!vn(0,e,i,n)})),wn=_n("<",(function(t,e,i){return e<i}),(function(t,e,i,n){return n.compare(e,i)<0})),An=_n(">",(function(t,e,i){return e>i}),(function(t,e,i,n){return n.compare(e,i)>0})),En=_n("<=",(function(t,e,i){return e<=i}),(function(t,e,i,n){return n.compare(e,i)<=0})),Sn=_n(">=",(function(t,e,i){return e>=i}),(function(t,e,i,n){return n.compare(e,i)>=0}));class Mn{constructor(t,e,i,n,r,o){this.type=ue,this.number=t,this.locale=e,this.currency=i,this.unit=n,this.minFractionDigits=r,this.maxFractionDigits=o}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,ce);if(!i)return null;const n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");let r=null;if(n.locale&&(r=e.parse(n.locale,1,ue),!r))return null;let o=null;if(n.currency&&(o=e.parse(n.currency,1,ue),!o))return null;let s=null;if(n.unit&&(s=e.parse(n.unit,1,ue),!s))return null;let a=null;if(n["min-fraction-digits"]&&(a=e.parse(n["min-fraction-digits"],1,ce),!a))return null;let l=null;return n["max-fraction-digits"]&&(l=e.parse(n["max-fraction-digits"],1,ce),!l)?null:new Mn(i,r,o,s,a,l)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(t):void 0,unit:this.unit?this.unit.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.unit&&t(this.unit),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.unit&&(t.unit=this.unit.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]}}class Tn{constructor(t){this.type=ce,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const i=e.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?e.error(`Expected argument of type string or array, but found ${_e(i.type)} instead.`):new Tn(i):null}evaluate(t){const e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new Ge(`Expected value to be of type string or array, but found ${_e(ze(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild((e=>{t.push(e.serialize())})),t}}const In={"==":xn,"!=":bn,">":An,"<":wn,">=":Sn,"<=":En,array:We,at:sn,boolean:We,case:fn,coalesce:en,collator:ei,format:qe,image:Xe,in:ln,"index-of":un,interpolate:$i,"interpolate-hcl":$i,"interpolate-lab":$i,length:Tn,let:rn,literal:Ue,match:pn,number:We,"number-format":Mn,object:We,slice:gn,step:Pi,string:We,"to-boolean":Qe,"to-color":Qe,"to-number":Qe,"to-string":Qe,var:Ei,within:_i};function Cn(t,[e,i,n,r]){e=e.evaluate(t),i=i.evaluate(t),n=n.evaluate(t);const o=r?r.evaluate(t):1,s=Ne(e,i,n,o);if(s)throw new Ge(s);return new Le(e/255*o,i/255*o,n/255*o,o)}function Pn(t,e){return t in e}function Ln(t,e){const i=e[t];return void 0===i?null:i}function Dn(t){return{type:t}}ti.register(In,{error:[{kind:"error"},[ue],(t,[e])=>{throw new Ge(e.evaluate(t))}],typeof:[ue,[fe],(t,[e])=>_e(ze(e.evaluate(t)))],"to-rgba":[ve(ce,4),[pe],(t,[e])=>e.evaluate(t).toArray()],rgb:[pe,[ce,ce,ce],Cn],rgba:[pe,[ce,ce,ce,ce],Cn],has:{type:he,overloads:[[[ue],(t,[e])=>Pn(e.evaluate(t),t.properties())],[[ue,de],(t,[e,i])=>Pn(e.evaluate(t),i.evaluate(t))]]},get:{type:fe,overloads:[[[ue],(t,[e])=>Ln(e.evaluate(t),t.properties())],[[ue,de],(t,[e,i])=>Ln(e.evaluate(t),i.evaluate(t))]]},"feature-state":[fe,[ue],(t,[e])=>Ln(e.evaluate(t),t.featureState||{})],properties:[de,[],t=>t.properties()],"geometry-type":[ue,[],t=>t.geometryType()],id:[fe,[],t=>t.id()],zoom:[ce,[],t=>t.globals.zoom],pitch:[ce,[],t=>t.globals.pitch||0],"distance-from-center":[ce,[],t=>t.distanceFromCenter()],"heatmap-density":[ce,[],t=>t.globals.heatmapDensity||0],"line-progress":[ce,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[ce,[],t=>t.globals.skyRadialProgress||0],accumulated:[fe,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[ce,Dn(ce),(t,e)=>{let i=0;for(const n of e)i+=n.evaluate(t);return i}],"*":[ce,Dn(ce),(t,e)=>{let i=1;for(const n of e)i*=n.evaluate(t);return i}],"-":{type:ce,overloads:[[[ce,ce],(t,[e,i])=>e.evaluate(t)-i.evaluate(t)],[[ce],(t,[e])=>-e.evaluate(t)]]},"/":[ce,[ce,ce],(t,[e,i])=>e.evaluate(t)/i.evaluate(t)],"%":[ce,[ce,ce],(t,[e,i])=>e.evaluate(t)%i.evaluate(t)],ln2:[ce,[],()=>Math.LN2],pi:[ce,[],()=>Math.PI],e:[ce,[],()=>Math.E],"^":[ce,[ce,ce],(t,[e,i])=>Math.pow(e.evaluate(t),i.evaluate(t))],sqrt:[ce,[ce],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[ce,[ce],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[ce,[ce],(t,[e])=>Math.log(e.evaluate(t))],log2:[ce,[ce],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[ce,[ce],(t,[e])=>Math.sin(e.evaluate(t))],cos:[ce,[ce],(t,[e])=>Math.cos(e.evaluate(t))],tan:[ce,[ce],(t,[e])=>Math.tan(e.evaluate(t))],asin:[ce,[ce],(t,[e])=>Math.asin(e.evaluate(t))],acos:[ce,[ce],(t,[e])=>Math.acos(e.evaluate(t))],atan:[ce,[ce],(t,[e])=>Math.atan(e.evaluate(t))],min:[ce,Dn(ce),(t,e)=>Math.min(...e.map((e=>e.evaluate(t))))],max:[ce,Dn(ce),(t,e)=>Math.max(...e.map((e=>e.evaluate(t))))],abs:[ce,[ce],(t,[e])=>Math.abs(e.evaluate(t))],round:[ce,[ce],(t,[e])=>{const i=e.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[ce,[ce],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[ce,[ce],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[he,[ue,fe],(t,[e,i])=>t.properties()[e.value]===i.value],"filter-id-==":[he,[fe],(t,[e])=>t.id()===e.value],"filter-type-==":[he,[ue],(t,[e])=>t.geometryType()===e.value],"filter-<":[he,[ue,fe],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n<r}],"filter-id-<":[he,[fe],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i<n}],"filter->":[he,[ue,fe],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n>r}],"filter-id->":[he,[fe],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>n}],"filter-<=":[he,[ue,fe],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n<=r}],"filter-id-<=":[he,[fe],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i<=n}],"filter->=":[he,[ue,fe],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n>=r}],"filter-id->=":[he,[fe],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>=n}],"filter-has":[he,[fe],(t,[e])=>e.value in t.properties()],"filter-has-id":[he,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[he,[ve(ue)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[he,[ve(fe)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[he,[ue,ve(fe)],(t,[e,i])=>i.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[he,[ue,ve(fe)],(t,[e,i])=>function(t,e,i,n){for(;i<=n;){const r=i+n>>1;if(e[r]===t)return!0;e[r]>t?n=r-1:i=r+1}return!1}(t.properties()[e.value],i.value,0,i.value.length-1)],all:{type:he,overloads:[[[he,he],(t,[e,i])=>e.evaluate(t)&&i.evaluate(t)],[Dn(he),(t,e)=>{for(const i of e)if(!i.evaluate(t))return!1;return!0}]]},any:{type:he,overloads:[[[he,he],(t,[e,i])=>e.evaluate(t)||i.evaluate(t)],[Dn(he),(t,e)=>{for(const i of e)if(i.evaluate(t))return!0;return!1}]]},"!":[he,[he],(t,[e])=>!e.evaluate(t)],"is-supported-script":[he,[ue],(t,[e])=>{const i=t.globals&&t.globals.isSupportedScript;return!i||i(e.evaluate(t))}],upcase:[ue,[ue],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[ue,[ue],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[ue,Dn(fe),(t,e)=>e.map((e=>Fe(e.evaluate(t)))).join("")],"resolved-locale":[ue,[me],(t,[e])=>e.evaluate(t).resolvedLocale()]});var Rn=In;function On(t){return{result:"success",value:t}}function kn(t){return{result:"error",value:t}}function Nn(t){return"data-driven"===t["property-type"]}function Bn(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function zn(t){return!!t.expression&&t.expression.interpolated}function Fn(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Vn(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Un(t){return t}function Gn(t,e){const i="color"===e.type,n=t.stops&&"object"==typeof t.stops[0][0],r=n||!(n||void 0!==t.property),o=t.type||(zn(e)?"exponential":"interval");if(i&&((t=ee({},t)).stops&&(t.stops=t.stops.map((t=>[t[0],Le.parse(t[1])]))),t.default=Le.parse(t.default?t.default:e.default)),t.colorSpace&&"rgb"!==t.colorSpace&&!Qi[t.colorSpace])throw new Error(`Unknown color space: ${t.colorSpace}`);let s,a,l;if("exponential"===o)s=qn;else if("interval"===o)s=Wn;else if("categorical"===o){s=Hn,a=Object.create(null);for(const e of t.stops)a[e[0]]=e[1];l=typeof t.stops[0][0]}else{if("identity"!==o)throw new Error(`Unknown function type "${o}"`);s=Xn}if(n){const i={},n=[];for(let e=0;e<t.stops.length;e++){const r=t.stops[e],o=r[0].zoom;void 0===i[o]&&(i[o]={zoom:o,type:t.type,property:t.property,default:t.default,stops:[]},n.push(o)),i[o].stops.push([r[0].value,r[1]])}const r=[];for(const t of n)r.push([i[t].zoom,Gn(i[t],e)]);const o={name:"linear"};return{kind:"composite",interpolationType:o,interpolationFactor:$i.interpolationFactor.bind(void 0,o),zoomStops:r.map((t=>t[0])),evaluate:({zoom:i},n)=>qn({stops:r,base:t.base},e,i).evaluate(i,n)}}if(r){const i="exponential"===o?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return{kind:"camera",interpolationType:i,interpolationFactor:$i.interpolationFactor.bind(void 0,i),zoomStops:t.stops.map((t=>t[0])),evaluate:({zoom:i})=>s(t,e,i,a,l)}}return{kind:"source",evaluate(i,n){const r=n&&n.properties?n.properties[t.property]:void 0;return void 0===r?jn(t.default,e.default):s(t,e,r,a,l)}}}function jn(t,e,i){return void 0!==t?t:void 0!==e?e:void 0!==i?i:void 0}function Hn(t,e,i,n,r){return jn(typeof i===r?n[i]:void 0,t.default,e.default)}function Wn(t,e,i){if("number"!==Fn(i))return jn(t.default,e.default);const n=t.stops.length;if(1===n)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[n-1][0])return t.stops[n-1][1];const r=Ii(t.stops.map((t=>t[0])),i);return t.stops[r][1]}function qn(t,e,i){const n=void 0!==t.base?t.base:1;if("number"!==Fn(i))return jn(t.default,e.default);const r=t.stops.length;if(1===r)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[r-1][0])return t.stops[r-1][1];const o=Ii(t.stops.map((t=>t[0])),i),s=function(t,e,i,n){const r=n-i,o=t-i;return 0===r?0:1===e?o/r:(Math.pow(e,o)-1)/(Math.pow(e,r)-1)}(i,n,t.stops[o][0],t.stops[o+1][0]),a=t.stops[o][1],l=t.stops[o+1][1];let c=Di[e.type]||Un;if(t.colorSpace&&"rgb"!==t.colorSpace){const e=Qi[t.colorSpace];c=(t,i)=>e.reverse(e.interpolate(e.forward(t),e.forward(i),s))}return"function"==typeof a.evaluate?{evaluate(...t){const e=a.evaluate.apply(void 0,t),i=l.evaluate.apply(void 0,t);if(void 0!==e&&void 0!==i)return c(e,i,s)}}:c(a,l,s)}function Xn(t,e,i){return"color"===e.type?i=Le.parse(i):"formatted"===e.type?i=Oe.fromString(i.toString()):"resolvedImage"===e.type?i=ke.fromString(i.toString()):Fn(i)===e.type||"enum"===e.type&&e.values[i]||(i=void 0),jn(i,t.default,e.default)}class Zn{constructor(t,e){this.expression=t,this._warningHistory={},this._evaluator=new Ke,this._defaultValue=e?function(t){return"color"===t.type&&(Vn(t.default)||Array.isArray(t.default))?new Le(0,0,0,0):"color"===t.type?Le.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,i,n,r,o,s,a){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this._evaluator.canonical=n||null,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=o,this._evaluator.featureTileCoord=s||null,this._evaluator.featureDistanceData=a||null,this.expression.evaluate(this._evaluator)}evaluate(t,e,i,n,r,o,s,a){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null,this._evaluator.canonical=n||null,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=o||null,this._evaluator.featureTileCoord=s||null,this._evaluator.featureDistanceData=a||null;try{const t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new Ge(`Expected value to be one of ${Object.keys(this._enumValues).map((t=>JSON.stringify(t))).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}}}function Yn(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Rn}function Qn(t,e){const i=new Mi(Rn,[],e?function(t){const e={color:pe,string:ue,number:ce,enum:ue,boolean:he,formatted:ge,resolvedImage:ye};return"array"===t.type?ve(e[t.value]||fe,t.length):e[t.type]}(e):void 0),n=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?On(new Zn(n,e)):kn(i.errors)}class Jn{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!bi(e.expression)}evaluateWithoutErrorHandling(t,e,i,n,r,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,n,r,o)}evaluate(t,e,i,n,r,o){return this._styleExpression.evaluate(t,e,i,n,r,o)}}class Kn{constructor(t,e,i,n){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent="camera"!==t&&!bi(e.expression),this.interpolationType=n}evaluateWithoutErrorHandling(t,e,i,n,r,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,n,r,o)}evaluate(t,e,i,n,r,o){return this._styleExpression.evaluate(t,e,i,n,r,o)}interpolationFactor(t,e,i){return this.interpolationType?$i.interpolationFactor(this.interpolationType,t,e,i):0}}function $n(t,e){if("error"===(t=Qn(t,e)).result)return t;const i=t.value.expression,n=xi(i);if(!n&&!Nn(e))return kn([new oe("","data expressions not supported")]);const r=wi(i,["zoom","pitch","distance-from-center"]);if(!r&&!Bn(e))return kn([new oe("","zoom expressions not supported")]);const o=er(i);return o||r?o instanceof oe?kn([o]):o instanceof $i&&!zn(e)?kn([new oe("",'"interpolate" expressions cannot be used with this property')]):On(o?new Kn(n?"camera":"composite",t.value,o.labels,o instanceof $i?o.interpolation:void 0):new Jn(n?"constant":"source",t.value)):kn([new oe("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class tr{constructor(t,e){this._parameters=t,this._specification=e,ee(this,Gn(this._parameters,this._specification))}static deserialize(t){return new tr(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function er(t){let e=null;if(t instanceof rn)e=er(t.result);else if(t instanceof en){for(const i of t.args)if(e=er(i),e)break}else(t instanceof Pi||t instanceof $i)&&t.input instanceof ti&&"zoom"===t.input.name&&(e=t);return e instanceof oe||t.eachChild((t=>{const i=er(t);i instanceof oe?e=i:!e&&i?e=new oe("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new oe("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}class ir{constructor(t,e,i,n){this.message=(t?`${t}: `:"")+i,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)}}function nr(t){const e=t.key,i=t.value,n=t.valueSpec||{},r=t.objectElementValidators||{},o=t.style,s=t.styleSpec;let a=[];const l=Fn(i);if("object"!==l)return[new ir(e,i,`object expected, ${l} found`)];for(const t in i){const l=t.split(".")[0];let c;r[l]?c=r[l]:n[l]?c=Br:r["*"]?c=r["*"]:n["*"]&&(c=Br),c?a=a.concat(c({key:(e?`${e}.`:e)+t,value:i[t],valueSpec:n[l]||n["*"],style:o,styleSpec:s,object:i,objectKey:t},i)):a.push(new ir(e,i[t],`unknown property "${t}"`))}for(const t in n)r[t]||n[t].required&&void 0===n[t].default&&void 0===i[t]&&a.push(new ir(e,i,`missing required property "${t}"`));return a}function rr(t){const e=t.value,i=t.valueSpec,n=t.style,r=t.styleSpec,o=t.key,s=t.arrayElementValidator||Br;if("array"!==Fn(e))return[new ir(o,e,`array expected, ${Fn(e)} found`)];if(i.length&&e.length!==i.length)return[new ir(o,e,`array length ${i.length} expected, length ${e.length} found`)];if(i["min-length"]&&e.length<i["min-length"])return[new ir(o,e,`array length at least ${i["min-length"]} expected, length ${e.length} found`)];let a={type:i.value,values:i.values,minimum:i.minimum,maximum:i.maximum,function:void 0};r.$version<7&&(a.function=i.function),"object"===Fn(i.value)&&(a=i.value);let l=[];for(let t=0;t<e.length;t++)l=l.concat(s({array:e,arrayIndex:t,value:e[t],valueSpec:a,style:n,styleSpec:r,key:`${o}[${t}]`}));return l}function or(t){const e=t.key,i=t.value,n=t.valueSpec;let r=Fn(i);if("number"===r&&i!=i&&(r="NaN"),"number"!==r)return[new ir(e,i,`number expected, ${r} found`)];if("minimum"in n){let r=n.minimum;if("array"===Fn(n.minimum)&&(r=n.minimum[t.arrayIndex]),i<r)return[new ir(e,i,`${i} is less than the minimum value ${r}`)]}if("maximum"in n){let r=n.maximum;if("array"===Fn(n.maximum)&&(r=n.maximum[t.arrayIndex]),i>r)return[new ir(e,i,`${i} is greater than the maximum value ${r}`)]}return[]}function sr(t){const e=t.valueSpec,i=ie(t.value.type);let n,r,o,s={};const a="categorical"!==i&&void 0===t.value.property,l=!a,c="array"===Fn(t.value.stops)&&"array"===Fn(t.value.stops[0])&&"object"===Fn(t.value.stops[0][0]),u=nr({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===i)return[new ir(t.key,t.value,'identity function may not have a "stops" property')];let e=[];const n=t.value;return e=e.concat(rr({key:t.key,value:n,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===Fn(n)&&0===n.length&&e.push(new ir(t.key,n,"array must have at least one stop")),e},default:function(t){return Br({key:t.key,value:t.value,valueSpec:e,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===i&&a&&u.push(new ir(t.key,t.value,'missing required property "property"')),"identity"===i||t.value.stops||u.push(new ir(t.key,t.value,'missing required property "stops"')),"exponential"===i&&t.valueSpec.expression&&!zn(t.valueSpec)&&u.push(new ir(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!Nn(t.valueSpec)?u.push(new ir(t.key,t.value,"property functions not supported")):a&&!Bn(t.valueSpec)&&u.push(new ir(t.key,t.value,"zoom functions not supported"))),"categorical"!==i&&!c||void 0!==t.value.property||u.push(new ir(t.key,t.value,'"property" property is required')),u;function h(t){let i=[];const n=t.value,a=t.key;if("array"!==Fn(n))return[new ir(a,n,`array expected, ${Fn(n)} found`)];if(2!==n.length)return[new ir(a,n,`array length 2 expected, length ${n.length} found`)];if(c){if("object"!==Fn(n[0]))return[new ir(a,n,`object expected, ${Fn(n[0])} found`)];if(void 0===n[0].zoom)return[new ir(a,n,"object stop key must have zoom")];if(void 0===n[0].value)return[new ir(a,n,"object stop key must have value")];const e=ie(n[0].zoom);if("number"!=typeof e)return[new ir(a,n[0].zoom,"stop zoom values must be numbers")];if(o&&o>e)return[new ir(a,n[0].zoom,"stop zoom values must appear in ascending order")];e!==o&&(o=e,r=void 0,s={}),i=i.concat(nr({key:`${a}[0]`,value:n[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:or,value:p}}))}else i=i.concat(p({key:`${a}[0]`,value:n[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},n));return Yn(ne(n[1]))?i.concat([new ir(`${a}[1]`,n[1],"expressions are not allowed in function stops.")]):i.concat(Br({key:`${a}[1]`,value:n[1],valueSpec:e,style:t.style,styleSpec:t.styleSpec}))}function p(t,o){const a=Fn(t.value),l=ie(t.value),c=null!==t.value?t.value:o;if(n){if(a!==n)return[new ir(t.key,c,`${a} stop domain type must match previous stop domain type ${n}`)]}else n=a;if("number"!==a&&"string"!==a&&"boolean"!==a&&"number"!=typeof l&&"string"!=typeof l&&"boolean"!=typeof l)return[new ir(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==a&&"categorical"!==i){let n=`number expected, ${a} found`;return Nn(e)&&void 0===i&&(n+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ir(t.key,c,n)]}return"categorical"!==i||"number"!==a||"number"==typeof l&&isFinite(l)&&Math.floor(l)===l?"categorical"!==i&&"number"===a&&"number"==typeof l&&"number"==typeof r&&void 0!==r&&l<r?[new ir(t.key,c,"stop domain values must appear in ascending order")]:(r=l,"categorical"===i&&l in s?[new ir(t.key,c,"stop domain values must be unique")]:(s[l]=!0,[])):[new ir(t.key,c,`integer expected, found ${String(l)}`)]}}function ar(t){const e=("property"===t.expressionContext?$n:Qn)(ne(t.value),t.valueSpec);if("error"===e.result)return e.value.map((e=>new ir(`${t.key}${e.key}`,t.value,e.message)));const i=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!i.outputDefined())return[new ir(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===t.expressionContext&&"layout"===t.propertyType&&!bi(i))return[new ir(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext)return lr(i,t);if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!wi(i,["zoom","feature-state"]))return[new ir(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!xi(i))return[new ir(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function lr(t,e){const i=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(e.valueSpec&&e.valueSpec.expression)for(const t of e.valueSpec.expression.parameters)i.delete(t);if(0===i.size)return[];const n=[];return t instanceof ti&&i.has(t.name)?[new ir(e.key,e.value,`["${t.name}"] expression is not supported in a filter for a ${e.object.type} layer with id: ${e.object.id}`)]:(t.eachChild((t=>{n.push(...lr(t,e))})),n)}function cr(t){const e=t.key,i=t.value,n=t.valueSpec,r=[];return Array.isArray(n.values)?-1===n.values.indexOf(ie(i))&&r.push(new ir(e,i,`expected one of [${n.values.join(", ")}], ${JSON.stringify(i)} found`)):-1===Object.keys(n.values).indexOf(ie(i))&&r.push(new ir(e,i,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(i)} found`)),r}function ur(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!ur(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}function hr(t,e="fill"){if(null==t)return{filter:()=>!0,needGeometry:!1,needFeature:!1};ur(t)||(t=vr(t));const i=t;let n=!0;try{n=function(t){if(!fr(t))return t;let e=ne(t);return dr(e),e=pr(e),e}(i)}catch(t){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(i,null,2)}\n `)}const r=te[`filter_${e}`],o=Qn(n,r);let s=null;if("error"===o.result)throw new Error(o.value.map((t=>`${t.key}: ${t.message}`)).join(", "));s=(t,e,i)=>o.value.evaluate(t,e,{},i);let a=null,l=null;if(n!==i){const t=Qn(i,r);if("error"===t.result)throw new Error(t.value.map((t=>`${t.key}: ${t.message}`)).join(", "));a=(e,i,n,r,o)=>t.value.evaluate(e,i,{},n,void 0,void 0,r,o),l=!xi(t.value.expression)}return{filter:s,dynamicFilter:a||void 0,needGeometry:yr(n),needFeature:!!l}}function pr(t){if(!Array.isArray(t))return t;const e=function(t){if(mr.has(t[0]))for(let e=1;e<t.length;e++)if(fr(t[e]))return!0;return t}(t);return!0===e?e:e.map((t=>pr(t)))}function dr(t){let e=!1;const i=[];if("case"===t[0]){for(let n=1;n<t.length-1;n+=2)e=e||fr(t[n]),i.push(t[n+1]);i.push(t[t.length-1])}else if("match"===t[0]){e=e||fr(t[1]);for(let e=2;e<t.length-1;e+=2)i.push(t[e+1]);i.push(t[t.length-1])}else if("step"===t[0]){e=e||fr(t[1]);for(let e=1;e<t.length-1;e+=2)i.push(t[e+1])}e&&(t.length=0,t.push("any",...i));for(let e=1;e<t.length;e++)dr(t[e])}function fr(t){if(!Array.isArray(t))return!1;if("pitch"===(e=t[0])||"distance-from-center"===e)return!0;var e;for(let e=1;e<t.length;e++)if(fr(t[e]))return!0;return!1}const mr=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function gr(t,e){return t<e?-1:t>e?1:0}function yr(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(let e=1;e<t.length;e++)if(yr(t[e]))return!0;return!1}function vr(t){if(!t)return!0;const e=t[0];return t.length<=1?"any"!==e:"=="===e?_r(t[1],t[2],"=="):"!="===e?wr(_r(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?_r(t[1],t[2],e):"any"===e?(i=t.slice(1),["any"].concat(i.map(vr))):"all"===e?["all"].concat(t.slice(1).map(vr)):"none"===e?["all"].concat(t.slice(1).map(vr).map(wr)):"in"===e?xr(t[1],t.slice(2)):"!in"===e?wr(xr(t[1],t.slice(2))):"has"===e?br(t[1]):"!has"===e?wr(br(t[1])):"within"!==e||t;var i}function _r(t,e,i){switch(t){case"$type":return[`filter-type-${i}`,e];case"$id":return[`filter-id-${i}`,e];default:return[`filter-${i}`,t,e]}}function xr(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((t=>typeof t!=typeof e[0]))?["filter-in-large",t,["literal",e.sort(gr)]]:["filter-in-small",t,["literal",e]]}}function br(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function wr(t){return["!",t]}function Ar(t){return ur(ne(t.value))?ar(ee({},t,{expressionContext:"filter",valueSpec:t.styleSpec[`filter_${t.layerType||"fill"}`]})):Er(t)}function Er(t){const e=t.value,i=t.key;if("array"!==Fn(e))return[new ir(i,e,`array expected, ${Fn(e)} found`)];const n=t.styleSpec;let r,o=[];if(e.length<1)return[new ir(i,e,"filter array must have at least 1 element")];switch(o=o.concat(cr({key:`${i}[0]`,value:e[0],valueSpec:n.filter_operator,style:t.style,styleSpec:t.styleSpec})),ie(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&"$type"===ie(e[1])&&o.push(new ir(i,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":3!==e.length&&o.push(new ir(i,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(r=Fn(e[1]),"string"!==r&&o.push(new ir(`${i}[1]`,e[1],`string expected, ${r} found`)));for(let s=2;s<e.length;s++)r=Fn(e[s]),"$type"===ie(e[1])?o=o.concat(cr({key:`${i}[${s}]`,value:e[s],valueSpec:n.geometry_type,style:t.style,styleSpec:t.styleSpec})):"string"!==r&&"number"!==r&&"boolean"!==r&&o.push(new ir(`${i}[${s}]`,e[s],`string, number, or boolean expected, ${r} found`));break;case"any":case"all":case"none":for(let n=1;n<e.length;n++)o=o.concat(Er({key:`${i}[${n}]`,value:e[n],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":r=Fn(e[1]),2!==e.length?o.push(new ir(i,e,`filter array for "${e[0]}" operator must have 2 elements`)):"string"!==r&&o.push(new ir(`${i}[1]`,e[1],`string expected, ${r} found`));break;case"within":r=Fn(e[1]),2!==e.length?o.push(new ir(i,e,`filter array for "${e[0]}" operator must have 2 elements`)):"object"!==r&&o.push(new ir(`${i}[1]`,e[1],`object expected, ${r} found`))}return o}function Sr(t,e){const i=t.key,n=t.style,r=t.styleSpec,o=t.value,s=t.objectKey,a=r[`${e}_${t.layerType}`];if(!a)return[];const l=s.match(/^(.*)-transition$/);if("paint"===e&&l&&a[l[1]]&&a[l[1]].transition)return Br({key:i,value:o,valueSpec:r.transition,style:n,styleSpec:r});const c=t.valueSpec||a[s];if(!c)return[new ir(i,o,`unknown property "${s}"`)];let u;if("string"===Fn(o)&&Nn(c)&&!c.tokens&&(u=/^{([^}]+)}$/.exec(o))){const t=`\`{ "type": "identity", "property": ${u?JSON.stringify(u[1]):'"_"'} }\``;return[new ir(i,o,`"${s}" does not support interpolation syntax\nUse an identity property function instead: ${t}.`)]}const h=[];return"symbol"===t.layerType&&("text-field"===s&&n&&!n.glyphs&&h.push(new ir(i,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===s&&Vn(ne(o))&&"identity"===ie(o.type)&&h.push(new ir(i,o,'"text-font" does not support identity functions'))),h.concat(Br({key:t.key,value:o,valueSpec:c,style:n,styleSpec:r,expressionContext:"property",propertyType:e,propertyKey:s}))}function Mr(t){return Sr(t,"paint")}function Tr(t){return Sr(t,"layout")}function Ir(t){let e=[];const i=t.value,n=t.key,r=t.style,o=t.styleSpec;i.type||i.ref||e.push(new ir(n,i,'either "type" or "ref" is required'));let s=ie(i.type);const a=ie(i.ref);if(i.id){const o=ie(i.id);for(let s=0;s<t.arrayIndex;s++){const t=r.layers[s];ie(t.id)===o&&e.push(new ir(n,i.id,`duplicate layer id "${i.id}", previously used at line ${t.id.__line__}`))}}if("ref"in i){let t;["type","source","source-layer","filter","layout"].forEach((t=>{t in i&&e.push(new ir(n,i[t],`"${t}" is prohibited for ref layers`))})),r.layers.forEach((e=>{ie(e.id)===a&&(t=e)})),t?t.ref?e.push(new ir(n,i.ref,"ref cannot reference another ref layer")):s=ie(t.type):"string"==typeof a&&e.push(new ir(n,i.ref,`ref layer "${a}" not found`))}else if("background"!==s&&"sky"!==s)if(i.source){const t=r.sources&&r.sources[i.source],o=t&&ie(t.type);t?"vector"===o&&"raster"===s?e.push(new ir(n,i.source,`layer "${i.id}" requires a raster source`)):"raster"===o&&"raster"!==s?e.push(new ir(n,i.source,`layer "${i.id}" requires a vector source`)):"vector"!==o||i["source-layer"]?"raster-dem"===o&&"hillshade"!==s?e.push(new ir(n,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!i.paint||!i.paint["line-gradient"]&&!i.paint["line-trim-offset"]||"geojson"===o&&t.lineMetrics||e.push(new ir(n,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new ir(n,i,`layer "${i.id}" must specify a "source-layer"`)):e.push(new ir(n,i.source,`source "${i.source}" not found`))}else e.push(new ir(n,i,'missing required property "source"'));return e=e.concat(nr({key:n,value:i,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":()=>[],type:()=>Br({key:`${n}.type`,value:i.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,object:i,objectKey:"type"}),filter:t=>Ar(ee({layerType:s},t)),layout:t=>nr({layer:i,key:t.key,value:t.value,valueSpec:{},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":t=>Tr(ee({layerType:s},t))}}),paint:t=>nr({layer:i,key:t.key,value:t.value,valueSpec:{},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":t=>Mr(ee({layerType:s},t))}})}})),e}function Cr(t){const e=t.value,i=t.key,n=Fn(e);return"string"!==n?[new ir(i,e,`string expected, ${n} found`)]:[]}const Pr={promoteId:function({key:t,value:e}){if("string"===Fn(e))return Cr({key:t,value:e});{const i=[];for(const n in e)i.push(...Cr({key:`${t}.${n}`,value:e[n]}));return i}}};function Lr(t){const e=t.value,i=t.key,n=t.styleSpec,r=t.style;if(!e.type)return[new ir(i,e,'"type" is required')];const o=ie(e.type);let s;switch(o){case"vector":case"raster":case"raster-dem":return s=nr({key:i,value:e,valueSpec:n[`source_${o.replace("-","_")}`],style:t.style,styleSpec:n,objectElementValidators:Pr}),s;case"geojson":if(s=nr({key:i,value:e,valueSpec:n.source_geojson,style:r,styleSpec:n,objectElementValidators:Pr}),e.cluster)for(const t in e.clusterProperties){const[n,r]=e.clusterProperties[t],o="string"==typeof n?[n,["accumulated"],["get",t]]:n;s.push(...ar({key:`${i}.${t}.map`,value:r,expressionContext:"cluster-map"})),s.push(...ar({key:`${i}.${t}.reduce`,value:o,expressionContext:"cluster-reduce"}))}return s;case"video":return nr({key:i,value:e,valueSpec:n.source_video,style:r,styleSpec:n});case"image":return nr({key:i,value:e,valueSpec:n.source_image,style:r,styleSpec:n});case"canvas":return[new ir(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return cr({key:`${i}.type`,value:e.type,valueSpec:{values:Dr(n)},style:r,styleSpec:n})}}function Dr(t){return t.source.reduce(((e,i)=>{const n=t[i];return"enum"===n.type.type&&(e=e.concat(Object.keys(n.type.values))),e}),[])}function Rr(t){const e=t.value,i=t.styleSpec,n=i.light,r=t.style;let o=[];const s=Fn(e);if(void 0===e)return o;if("object"!==s)return o=o.concat([new ir("light",e,`object expected, ${s} found`)]),o;for(const t in e){const s=t.match(/^(.*)-transition$/);o=o.concat(s&&n[s[1]]&&n[s[1]].transition?Br({key:t,value:e[t],valueSpec:i.transition,style:r,styleSpec:i}):n[t]?Br({key:t,value:e[t],valueSpec:n[t],style:r,styleSpec:i}):[new ir(t,e[t],`unknown property "${t}"`)])}return o}function Or(t){const e=t.value,i=t.key,n=t.style,r=t.styleSpec,o=r.terrain;let s=[];const a=Fn(e);if(void 0===e)return s;if("object"!==a)return s=s.concat([new ir("terrain",e,`object expected, ${a} found`)]),s;for(const t in e){const i=t.match(/^(.*)-transition$/);s=s.concat(i&&o[i[1]]&&o[i[1]].transition?Br({key:t,value:e[t],valueSpec:r.transition,style:n,styleSpec:r}):o[t]?Br({key:t,value:e[t],valueSpec:o[t],style:n,styleSpec:r}):[new ir(t,e[t],`unknown property "${t}"`)])}if(e.source){const t=n.sources&&n.sources[e.source],r=t&&ie(t.type);t?"raster-dem"!==r&&s.push(new ir(i,e.source,`terrain cannot be used with a source of type ${String(r)}, it only be used with a "raster-dem" source type`)):s.push(new ir(i,e.source,`source "${e.source}" not found`))}else s.push(new ir(i,e,'terrain is missing required property "source"'));return s}function kr(t){const e=t.value,i=t.style,n=t.styleSpec,r=n.fog;let o=[];const s=Fn(e);if(void 0===e)return o;if("object"!==s)return o=o.concat([new ir("fog",e,`object expected, ${s} found`)]),o;for(const t in e){const s=t.match(/^(.*)-transition$/);o=o.concat(s&&r[s[1]]&&r[s[1]].transition?Br({key:t,value:e[t],valueSpec:n.transition,style:i,styleSpec:n}):r[t]?Br({key:t,value:e[t],valueSpec:r[t],style:i,styleSpec:n}):[new ir(t,e[t],`unknown property "${t}"`)])}return o}const Nr={"*":()=>[],array:rr,boolean:function(t){const e=t.value,i=t.key,n=Fn(e);return"boolean"!==n?[new ir(i,e,`boolean expected, ${n} found`)]:[]},number:or,color:function(t){const e=t.key,i=t.value,n=Fn(i);return"string"!==n?[new ir(e,i,`color expected, ${n} found`)]:null===Ee(i)?[new ir(e,i,`color expected, "${i}" found`)]:[]},enum:cr,filter:Ar,function:sr,layer:Ir,object:nr,source:Lr,light:Rr,terrain:Or,fog:kr,string:Cr,formatted:function(t){return 0===Cr(t).length?[]:ar(t)},resolvedImage:function(t){return 0===Cr(t).length?[]:ar(t)},projection:function(t){const e=t.value,i=t.styleSpec,n=i.projection,r=t.style;let o=[];const s=Fn(e);if("object"===s)for(const t in e)o=o.concat(Br({key:t,value:e[t],valueSpec:n[t],style:r,styleSpec:i}));else"string"!==s&&(o=o.concat([new ir("projection",e,`object or string expected, ${s} found`)]));return o}};function Br(t){const e=t.value,i=t.valueSpec,n=t.styleSpec;return i.expression&&Vn(ie(e))?sr(t):i.expression&&Yn(ne(e))?ar(t):i.type&&Nr[i.type]?Nr[i.type](t):nr(ee({},t,{valueSpec:i.type?n[i.type]:i}))}function zr(t){const e=t.value,i=t.key,n=Cr(t);return n.length||(-1===e.indexOf("{fontstack}")&&n.push(new ir(i,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&n.push(new ir(i,e,'"glyphs" url must include a "{range}" token'))),n}function Fr(t,e=te){return Gr(Br({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:zr,"*":()=>[]}}))}const Vr=t=>Gr(Mr(t)),Ur=t=>Gr(Tr(t));function Gr(t){return t.slice().sort(((t,e)=>t.line&&e.line?t.line-e.line:0))}function jr(t,e){let i=!1;if(e&&e.length)for(const n of e)t.fire(new Kt(new Error(n.message))),i=!0;return i}var Hr=qr,Wr=3;function qr(t,e,i){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var r=new Int32Array(this.arrayBuffer);t=r[0],this.d=(e=r[1])+2*(i=r[2]);for(var o=0;o<this.d*this.d;o++){var s=r[Wr+o],a=r[Wr+o+1];n.push(s===a?null:r.subarray(s,a))}var l=r[Wr+n.length+1];this.keys=r.subarray(r[Wr+n.length],l),this.bboxes=r.subarray(l),this.insert=this._insertReadonly}else{this.d=e+2*i;for(var c=0;c<this.d*this.d;c++)n.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=i,this.scale=e/t,this.uid=0;var u=i/e*t;this.min=-u,this.max=t+u}qr.prototype.insert=function(t,e,i,n,r){this._forEachCell(e,i,n,r,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(r)},qr.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},qr.prototype._insertCell=function(t,e,i,n,r,o){this.cells[r].push(o)},qr.prototype.query=function(t,e,i,n,r){var o=this.min,s=this.max;if(t<=o&&e<=o&&s<=i&&s<=n&&!r)return Array.prototype.slice.call(this.keys);var a=[];return this._forEachCell(t,e,i,n,this._queryCell,a,{},r),a},qr.prototype._queryCell=function(t,e,i,n,r,o,s,a){var l=this.cells[r];if(null!==l)for(var c=this.keys,u=this.bboxes,h=0;h<l.length;h++){var p=l[h];if(void 0===s[p]){var d=4*p;(a?a(u[d+0],u[d+1],u[d+2],u[d+3]):t<=u[d+2]&&e<=u[d+3]&&i>=u[d+0]&&n>=u[d+1])?(s[p]=!0,o.push(c[p])):s[p]=!1}}},qr.prototype._forEachCell=function(t,e,i,n,r,o,s,a){for(var l=this._convertToCellCoord(t),c=this._convertToCellCoord(e),u=this._convertToCellCoord(i),h=this._convertToCellCoord(n),p=l;p<=u;p++)for(var d=c;d<=h;d++){var f=this.d*d+p;if((!a||a(this._convertFromCellCoord(p),this._convertFromCellCoord(d),this._convertFromCellCoord(p+1),this._convertFromCellCoord(d+1)))&&r.call(this,t,e,i,n,f,o,s,a))return}},qr.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},qr.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},qr.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=Wr+this.cells.length+1+1,i=0,n=0;n<this.cells.length;n++)i+=this.cells[n].length;var r=new Int32Array(e+i+this.keys.length+this.bboxes.length);r[0]=this.extent,r[1]=this.n,r[2]=this.padding;for(var o=e,s=0;s<t.length;s++){var a=t[s];r[Wr+s]=o,r.set(a,o),o+=a.length}return r[Wr+t.length]=o,r.set(this.keys,o),r[Wr+t.length+1]=o+=this.keys.length,r.set(this.bboxes,o),o+=this.bboxes.length,r.buffer};var Xr=p(Hr);const Zr={};function Yr(t,e,i={}){Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),Zr[e]={klass:t,omit:i.omit||[]}}Yr(Object,"Object"),Xr.serialize=function(t,e){const i=t.toArrayBuffer();return e&&e.push(i),{buffer:i}},Xr.deserialize=function(t){return new Xr(t.buffer)},Object.defineProperty(Xr,"name",{value:"Grid"}),Yr(Xr,"Grid"),Yr(Le,"Color"),Yr(Error,"Error"),Yr(ct,"AJAXError"),Yr(ke,"ResolvedImage"),Yr(tr,"StylePropertyFunction"),Yr(Zn,"StyleExpression",{omit:["_evaluator"]}),Yr(Kn,"ZoomDependentExpression"),Yr(Jn,"ZoomConstantExpression"),Yr(ti,"CompoundExpression",{omit:["_evaluate"]});for(const t in Rn)Zr[Rn[t]._classRegistryKey]||Yr(Rn[t],`Expression${t}`);function Qr(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function Jr(t){return e.ImageBitmap&&t instanceof e.ImageBitmap}function Kr(t,i){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(Qr(t)||Jr(t))return i&&i.push(t),t;if(ArrayBuffer.isView(t)){const e=t;return i&&i.push(e.buffer),e}if(t instanceof e.ImageData)return i&&i.push(t.data.buffer),t;if(Array.isArray(t)){const e=[];for(const n of t)e.push(Kr(n,i));return e}if("object"==typeof t){const e=t.constructor,n=e._classRegistryKey;if(!n)throw new Error(`can't serialize object of unregistered class ${n}`);const r=e.serialize?e.serialize(t,i):{};if(!e.serialize){for(const e in t)t.hasOwnProperty(e)&&(Zr[n].omit.indexOf(e)>=0||(r[e]=Kr(t[e],i)));t instanceof Error&&(r.message=t.message)}if(r.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==n&&(r.$name=n),r}throw new Error("can't serialize object of type "+typeof t)}function $r(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||Qr(t)||Jr(t)||ArrayBuffer.isView(t)||t instanceof e.ImageData)return t;if(Array.isArray(t))return t.map($r);if("object"==typeof t){const e=t.$name||"Object",{klass:i}=Zr[e];if(!i)throw new Error(`can't deserialize unregistered class ${e}`);if(i.deserialize)return i.deserialize(t);const n=Object.create(i.prototype);for(const e of Object.keys(t))"$name"!==e&&(n[e]=$r(t[e]));return n}throw new Error("can't deserialize object of type "+typeof t)}const to={"Latin-1 Supplement":t=>t>=128&&t<=255,Arabic:t=>t>=1536&&t<=1791,"Arabic Supplement":t=>t>=1872&&t<=1919,"Arabic Extended-A":t=>t>=2208&&t<=2303,"Hangul Jamo":t=>t>=4352&&t<=4607,"Unified Canadian Aboriginal Syllabics":t=>t>=5120&&t<=5759,Khmer:t=>t>=6016&&t<=6143,"Unified Canadian Aboriginal Syllabics Extended":t=>t>=6320&&t<=6399,"General Punctuation":t=>t>=8192&&t<=8303,"Letterlike Symbols":t=>t>=8448&&t<=8527,"Number Forms":t=>t>=8528&&t<=8591,"Miscellaneous Technical":t=>t>=8960&&t<=9215,"Control Pictures":t=>t>=9216&&t<=9279,"Optical Character Recognition":t=>t>=9280&&t<=9311,"Enclosed Alphanumerics":t=>t>=9312&&t<=9471,"Geometric Shapes":t=>t>=9632&&t<=9727,"Miscellaneous Symbols":t=>t>=9728&&t<=9983,"Miscellaneous Symbols and Arrows":t=>t>=11008&&t<=11263,"CJK Radicals Supplement":t=>t>=11904&&t<=12031,"Kangxi Radicals":t=>t>=12032&&t<=12255,"Ideographic Description Characters":t=>t>=12272&&t<=12287,"CJK Symbols and Punctuation":t=>t>=12288&&t<=12351,Hiragana:t=>t>=12352&&t<=12447,Katakana:t=>t>=12448&&t<=12543,Bopomofo:t=>t>=12544&&t<=12591,"Hangul Compatibility Jamo":t=>t>=12592&&t<=12687,Kanbun:t=>t>=12688&&t<=12703,"Bopomofo Extended":t=>t>=12704&&t<=12735,"CJK Strokes":t=>t>=12736&&t<=12783,"Katakana Phonetic Extensions":t=>t>=12784&&t<=12799,"Enclosed CJK Letters and Months":t=>t>=12800&&t<=13055,"CJK Compatibility":t=>t>=13056&&t<=13311,"CJK Unified Ideographs Extension A":t=>t>=13312&&t<=19903,"Yijing Hexagram Symbols":t=>t>=19904&&t<=19967,"CJK Unified Ideographs":t=>t>=19968&&t<=40959,"Yi Syllables":t=>t>=40960&&t<=42127,"Yi Radicals":t=>t>=42128&&t<=42191,"Hangul Jamo Extended-A":t=>t>=43360&&t<=43391,"Hangul Syllables":t=>t>=44032&&t<=55215,"Hangul Jamo Extended-B":t=>t>=55216&&t<=55295,"Private Use Area":t=>t>=57344&&t<=63743,"CJK Compatibility Ideographs":t=>t>=63744&&t<=64255,"Arabic Presentation Forms-A":t=>t>=64336&&t<=65023,"Vertical Forms":t=>t>=65040&&t<=65055,"CJK Compatibility Forms":t=>t>=65072&&t<=65103,"Small Form Variants":t=>t>=65104&&t<=65135,"Arabic Presentation Forms-B":t=>t>=65136&&t<=65279,"Halfwidth and Fullwidth Forms":t=>t>=65280&&t<=65519};function eo(t){for(const e of t)if(ro(e.charCodeAt(0)))return!0;return!1}function io(t){for(const e of t)if(!no(e.charCodeAt(0)))return!1;return!0}function no(t){return!(to.Arabic(t)||to["Arabic Supplement"](t)||to["Arabic Extended-A"](t)||to["Arabic Presentation Forms-A"](t)||to["Arabic Presentation Forms-B"](t))}function ro(t){return!(746!==t&&747!==t&&(t<4352||!(to["Bopomofo Extended"](t)||to.Bopomofo(t)||to["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||to["CJK Compatibility Ideographs"](t)||to["CJK Compatibility"](t)||to["CJK Radicals Supplement"](t)||to["CJK Strokes"](t)||!(!to["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||to["CJK Unified Ideographs Extension A"](t)||to["CJK Unified Ideographs"](t)||to["Enclosed CJK Letters and Months"](t)||to["Hangul Compatibility Jamo"](t)||to["Hangul Jamo Extended-A"](t)||to["Hangul Jamo Extended-B"](t)||to["Hangul Jamo"](t)||to["Hangul Syllables"](t)||to.Hiragana(t)||to["Ideographic Description Characters"](t)||to.Kanbun(t)||to["Kangxi Radicals"](t)||to["Katakana Phonetic Extensions"](t)||to.Katakana(t)&&12540!==t||!(!to["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!to["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||to["Unified Canadian Aboriginal Syllabics"](t)||to["Unified Canadian Aboriginal Syllabics Extended"](t)||to["Vertical Forms"](t)||to["Yijing Hexagram Symbols"](t)||to["Yi Syllables"](t)||to["Yi Radicals"](t))))}function oo(t){return!(ro(t)||function(t){return!!(to["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||to["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||to["Letterlike Symbols"](t)||to["Number Forms"](t)||to["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||to["Control Pictures"](t)&&9251!==t||to["Optical Character Recognition"](t)||to["Enclosed Alphanumerics"](t)||to["Geometric Shapes"](t)||to["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||to["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||to["CJK Symbols and Punctuation"](t)||to.Katakana(t)||to["Private Use Area"](t)||to["CJK Compatibility Forms"](t)||to["Small Form Variants"](t)||to["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function so(t){return t>=1424&&t<=2303||to["Arabic Presentation Forms-A"](t)||to["Arabic Presentation Forms-B"](t)}function ao(t,e){return!(!e&&so(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||to.Khmer(t))}function lo(t){for(const e of t)if(so(e.charCodeAt(0)))return!0;return!1}const co="deferred",uo="loading",ho="loaded";let po=null,fo="unavailable",mo=null;const go=function(t){t&&"string"==typeof t&&t.indexOf("NetworkError")>-1&&(fo="error"),po&&po(t)};function yo(){vo.fire(new Jt("pluginStateChange",{pluginStatus:fo,pluginURL:mo}))}const vo=new $t,_o=function(){return fo},xo=function(){if(fo!==co||!mo)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");fo=uo,yo(),mo&&pt({url:mo},(t=>{t?go(t):(fo=ho,yo())}))},bo={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>fo===ho||null!=bo.applyArabicShaping,isLoading:()=>fo===uo,setState(t){fo=t.pluginStatus,mo=t.pluginURL},isParsed:()=>null!=bo.applyArabicShaping&&null!=bo.processBidirectionalText&&null!=bo.processStyledBidirectionalText,getPluginURL:()=>mo};class wo{constructor(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.transition=e.transition,this.pitch=e.pitch):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0)}isSupportedScript(t){return function(t,e){for(const i of t)if(!ao(i.charCodeAt(0),e))return!1;return!0}(t,bo.isLoaded())}}class Ao{constructor(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Vn(t))return new tr(t,e);if(Yn(t)){const i=$n(t,e);if("error"===i.result)throw new Error(i.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return i.value}{let i=t;return"string"==typeof t&&"color"===e.type&&(i=Le.parse(t)),{kind:"constant",evaluate:()=>i}}}(void 0===e?t.specification.default:e,t.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(t,e,i){return this.property.possiblyEvaluate(this,t,e,i)}}class Eo{constructor(t){this.property=t,this.value=new Ao(t,void 0)}transitioned(t,e){return new Mo(this.property,this.value,e,D({},t.transition,this.transition),t.now)}untransitioned(){return new Mo(this.property,this.value,null,{},0)}}class So{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}getValue(t){return G(this._values[t].value.value)}setValue(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Eo(this._values[t].property)),this._values[t].value=new Ao(this._values[t].property,null===e?void 0:G(e))}getTransition(t){return G(this._values[t].transition)}setTransition(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Eo(this._values[t].property)),this._values[t].transition=G(e)||void 0}serialize(){const t={};for(const e of Object.keys(this._values)){const i=this.getValue(e);void 0!==i&&(t[e]=i);const n=this.getTransition(e);void 0!==n&&(t[`${e}-transition`]=n)}return t}transitioned(t,e){const i=new To(this._properties);for(const n of Object.keys(this._values))i._values[n]=this._values[n].transitioned(t,e._values[n]);return i}untransitioned(){const t=new To(this._properties);for(const e of Object.keys(this._values))t._values[e]=this._values[e].untransitioned();return t}}class Mo{constructor(t,e,i,n,r){const o=n.delay||0,s=n.duration||0;r=r||0,this.property=t,this.value=e,this.begin=r+o,this.end=this.begin+s,t.specification.transition&&(n.delay||n.duration)&&(this.prior=i)}possiblyEvaluate(t,e,i){const n=t.now||0,r=this.value.possiblyEvaluate(t,e,i),o=this.prior;if(o){if(n>this.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(n<this.begin)return o.possiblyEvaluate(t,e,i);{const s=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(t,e,i),r,E(s))}}return r}}class To{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,e,i){const n=new Po(this._properties);for(const r of Object.keys(this._values))n._values[r]=this._values[r].possiblyEvaluate(t,e,i);return n}hasTransition(){for(const t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}}class Io{constructor(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)}getValue(t){return G(this._values[t].value)}setValue(t,e){this._values[t]=new Ao(this._values[t].property,null===e?void 0:G(e))}serialize(){const t={};for(const e of Object.keys(this._values)){const i=this.getValue(e);void 0!==i&&(t[e]=i)}return t}possiblyEvaluate(t,e,i){const n=new Po(this._properties);for(const r of Object.keys(this._values))n._values[r]=this._values[r].possiblyEvaluate(t,e,i);return n}}class Co{constructor(t,e,i){this.property=t,this.value=e,this.parameters=i}isConstant(){return"constant"===this.value.kind}constantOr(t){return"constant"===this.value.kind?this.value.value:t}evaluate(t,e,i,n){return this.property.evaluate(this.value,this.parameters,t,e,i,n)}}class Po{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}}class Lo{constructor(t){this.specification=t}possiblyEvaluate(t,e){return t.expression.evaluate(e)}interpolate(t,e,i){const n=Di[this.specification.type];return n?n(t,e,i):t}}class Do{constructor(t,e){this.specification=t,this.overrides=e}possiblyEvaluate(t,e,i,n){return new Co(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},i,n)}:t.expression,e)}interpolate(t,e,i){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new Co(this,{kind:"constant",value:void 0},t.parameters);const n=Di[this.specification.type];return n?new Co(this,{kind:"constant",value:n(t.value.value,e.value.value,i)},t.parameters):t}evaluate(t,e,i,n,r,o){return"constant"===t.kind?t.value:t.evaluate(e,i,n,r,o)}}class Ro{constructor(t){this.specification=t}possiblyEvaluate(t,e,i,n){return!!t.expression.evaluate(e,null,{},i,n)}interpolate(){return!1}}class Oo{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];const e=new wo(0,{});for(const i in t){const n=t[i];n.specification.overridable&&this.overridableProperties.push(i);const r=this.defaultPropertyValues[i]=new Ao(n,void 0),o=this.defaultTransitionablePropertyValues[i]=new Eo(n);this.defaultTransitioningPropertyValues[i]=o.untransitioned(),this.defaultPossiblyEvaluatedValues[i]=r.possiblyEvaluate(e)}}}function ko(t,e){return 256*(t=T(Math.floor(t),0,255))+T(Math.floor(e),0,255)}Yr(Do,"DataDrivenProperty"),Yr(Lo,"DataConstantProperty"),Yr(Ro,"ColorRampProperty");const No={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Bo{constructor(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class zo{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){const e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}}_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 Fo(t,e=1){let i=0,n=0;return{members:t.map((t=>{const r=No[t.type].BYTES_PER_ELEMENT,o=i=Vo(i,Math.max(e,r)),s=t.components||1;return n=Math.max(n,r),i+=r*s,{name:t.name,type:t.type,components:s,offset:o}})),size:Vo(i,Math.max(n,e)),alignment:e}}function Vo(t,e){return Math.ceil(t/e)*e}class Uo extends zo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e){const i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){const n=2*t;return this.int16[n+0]=e,this.int16[n+1]=i,t}}Uo.prototype.bytesPerElement=4,Yr(Uo,"StructArrayLayout2i4");class Go extends zo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,i)}emplace(t,e,i,n){const r=3*t;return this.int16[r+0]=e,this.int16[r+1]=i,this.int16[r+2]=n,t}}Go.prototype.bytesPerElement=6,Yr(Go,"StructArrayLayout3i6");class jo extends zo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i,n)}emplace(t,e,i,n,r){const o=4*t;return this.int16[o+0]=e,this.int16[o+1]=i,this.int16[o+2]=n,this.int16[o+3]=r,t}}jo.prototype.bytesPerElement=8,Yr(jo,"StructArrayLayout4i8");class Ho extends zo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,n,r,o,s)}emplace(t,e,i,n,r,o,s,a){const l=6*t,c=12*t,u=3*t;return this.int16[l+0]=e,this.int16[l+1]=i,this.uint8[c+4]=n,this.uint8[c+5]=r,this.uint8[c+6]=o,this.uint8[c+7]=s,this.float32[u+2]=a,t}}Ho.prototype.bytesPerElement=12,Yr(Ho,"StructArrayLayout2i4ub1f12");class Wo extends zo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i,n)}emplace(t,e,i,n,r){const o=4*t;return this.float32[o+0]=e,this.float32[o+1]=i,this.float32[o+2]=n,this.float32[o+3]=r,t}}Wo.prototype.bytesPerElement=16,Yr(Wo,"StructArrayLayout4f16");class qo extends zo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,i,n,r)}emplace(t,e,i,n,r,o){const s=6*t,a=3*t;return this.uint16[s+0]=e,this.uint16[s+1]=i,this.uint16[s+2]=n,this.uint16[s+3]=r,this.float32[a+2]=o,t}}qo.prototype.bytesPerElement=12,Yr(qo,"StructArrayLayout4ui1f12");class Xo extends zo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i,n)}emplace(t,e,i,n,r){const o=4*t;return this.uint16[o+0]=e,this.uint16[o+1]=i,this.uint16[o+2]=n,this.uint16[o+3]=r,t}}Xo.prototype.bytesPerElement=8,Yr(Xo,"StructArrayLayout4ui8");class Zo extends zo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,o){const s=this.length;return this.resize(s+1),this.emplace(s,t,e,i,n,r,o)}emplace(t,e,i,n,r,o,s){const a=6*t;return this.int16[a+0]=e,this.int16[a+1]=i,this.int16[a+2]=n,this.int16[a+3]=r,this.int16[a+4]=o,this.int16[a+5]=s,t}}Zo.prototype.bytesPerElement=12,Yr(Zo,"StructArrayLayout6i12");class Yo extends zo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,o,s,a,l,c,u,h){const p=this.length;return this.resize(p+1),this.emplace(p,t,e,i,n,r,o,s,a,l,c,u,h)}emplace(t,e,i,n,r,o,s,a,l,c,u,h,p){const d=12*t;return this.int16[d+0]=e,this.int16[d+1]=i,this.int16[d+2]=n,this.int16[d+3]=r,this.uint16[d+4]=o,this.uint16[d+5]=s,this.uint16[d+6]=a,this.uint16[d+7]=l,this.int16[d+8]=c,this.int16[d+9]=u,this.int16[d+10]=h,this.int16[d+11]=p,t}}Yo.prototype.bytesPerElement=24,Yr(Yo,"StructArrayLayout4i4ui4i24");class Qo extends zo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,o){const s=this.length;return this.resize(s+1),this.emplace(s,t,e,i,n,r,o)}emplace(t,e,i,n,r,o,s){const a=10*t,l=5*t;return this.int16[a+0]=e,this.int16[a+1]=i,this.int16[a+2]=n,this.float32[l+2]=r,this.float32[l+3]=o,this.float32[l+4]=s,t}}Qo.prototype.bytesPerElement=20,Yr(Qo,"StructArrayLayout3i3f20");class Jo extends zo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint32[1*t+0]=e,t}}Jo.prototype.bytesPerElement=4,Yr(Jo,"StructArrayLayout1ul4");class Ko extends zo{_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(t,e,i,n,r,o,s,a,l,c,u,h,p){const d=this.length;return this.resize(d+1),this.emplace(d,t,e,i,n,r,o,s,a,l,c,u,h,p)}emplace(t,e,i,n,r,o,s,a,l,c,u,h,p,d){const f=20*t,m=10*t;return this.int16[f+0]=e,this.int16[f+1]=i,this.int16[f+2]=n,this.int16[f+3]=r,this.int16[f+4]=o,this.float32[m+3]=s,this.float32[m+4]=a,this.float32[m+5]=l,this.float32[m+6]=c,this.int16[f+14]=u,this.uint32[m+8]=h,this.uint16[f+18]=p,this.uint16[f+19]=d,t}}Ko.prototype.bytesPerElement=40,Yr(Ko,"StructArrayLayout5i4f1i1ul2ui40");class $o extends zo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,n,r,o,s)}emplace(t,e,i,n,r,o,s,a){const l=8*t;return this.int16[l+0]=e,this.int16[l+1]=i,this.int16[l+2]=n,this.int16[l+4]=r,this.int16[l+5]=o,this.int16[l+6]=s,this.int16[l+7]=a,t}}$o.prototype.bytesPerElement=16,Yr($o,"StructArrayLayout3i2i2i16");class ts extends zo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,i,n,r)}emplace(t,e,i,n,r,o){const s=4*t,a=8*t;return this.float32[s+0]=e,this.float32[s+1]=i,this.float32[s+2]=n,this.int16[a+6]=r,this.int16[a+7]=o,t}}ts.prototype.bytesPerElement=16,Yr(ts,"StructArrayLayout2f1f2i16");class es extends zo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i,n)}emplace(t,e,i,n,r){const o=12*t,s=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=i,this.float32[s+1]=n,this.float32[s+2]=r,t}}es.prototype.bytesPerElement=12,Yr(es,"StructArrayLayout2ub2f12");class is extends zo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,i)}emplace(t,e,i,n){const r=3*t;return this.float32[r+0]=e,this.float32[r+1]=i,this.float32[r+2]=n,t}}is.prototype.bytesPerElement=12,Yr(is,"StructArrayLayout3f12");class ns extends zo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,i)}emplace(t,e,i,n){const r=3*t;return this.uint16[r+0]=e,this.uint16[r+1]=i,this.uint16[r+2]=n,t}}ns.prototype.bytesPerElement=6,Yr(ns,"StructArrayLayout3ui6");class rs extends zo{_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(t,e,i,n,r,o,s,a,l,c,u,h,p,d,f,m,g,y,v,_,x){const b=this.length;return this.resize(b+1),this.emplace(b,t,e,i,n,r,o,s,a,l,c,u,h,p,d,f,m,g,y,v,_,x)}emplace(t,e,i,n,r,o,s,a,l,c,u,h,p,d,f,m,g,y,v,_,x,b){const w=30*t,A=15*t,E=60*t;return this.int16[w+0]=e,this.int16[w+1]=i,this.int16[w+2]=n,this.float32[A+2]=r,this.float32[A+3]=o,this.uint16[w+8]=s,this.uint16[w+9]=a,this.uint32[A+5]=l,this.uint32[A+6]=c,this.uint32[A+7]=u,this.uint16[w+16]=h,this.uint16[w+17]=p,this.uint16[w+18]=d,this.float32[A+10]=f,this.float32[A+11]=m,this.uint8[E+48]=g,this.uint8[E+49]=y,this.uint8[E+50]=v,this.uint32[A+13]=_,this.int16[w+28]=x,this.uint8[E+58]=b,t}}rs.prototype.bytesPerElement=60,Yr(rs,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class os extends zo{_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(t,e,i,n,r,o,s,a,l,c,u,h,p,d,f,m,g,y,v,_,x,b,w,A,E,S,M,T,I,C){const P=this.length;return this.resize(P+1),this.emplace(P,t,e,i,n,r,o,s,a,l,c,u,h,p,d,f,m,g,y,v,_,x,b,w,A,E,S,M,T,I,C)}emplace(t,e,i,n,r,o,s,a,l,c,u,h,p,d,f,m,g,y,v,_,x,b,w,A,E,S,M,T,I,C,P){const L=38*t,D=19*t;return this.int16[L+0]=e,this.int16[L+1]=i,this.int16[L+2]=n,this.float32[D+2]=r,this.float32[D+3]=o,this.int16[L+8]=s,this.int16[L+9]=a,this.int16[L+10]=l,this.int16[L+11]=c,this.int16[L+12]=u,this.int16[L+13]=h,this.uint16[L+14]=p,this.uint16[L+15]=d,this.uint16[L+16]=f,this.uint16[L+17]=m,this.uint16[L+18]=g,this.uint16[L+19]=y,this.uint16[L+20]=v,this.uint16[L+21]=_,this.uint16[L+22]=x,this.uint16[L+23]=b,this.uint16[L+24]=w,this.uint16[L+25]=A,this.uint16[L+26]=E,this.uint16[L+27]=S,this.uint16[L+28]=M,this.uint32[D+15]=T,this.float32[D+16]=I,this.float32[D+17]=C,this.float32[D+18]=P,t}}os.prototype.bytesPerElement=76,Yr(os,"StructArrayLayout3i2f6i15ui1ul3f76");class ss extends zo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.float32[1*t+0]=e,t}}ss.prototype.bytesPerElement=4,Yr(ss,"StructArrayLayout1f4");class as extends zo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,i,n,r)}emplace(t,e,i,n,r,o){const s=5*t;return this.float32[s+0]=e,this.float32[s+1]=i,this.float32[s+2]=n,this.float32[s+3]=r,this.float32[s+4]=o,t}}as.prototype.bytesPerElement=20,Yr(as,"StructArrayLayout5f20");class ls extends zo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i,n)}emplace(t,e,i,n,r){const o=6*t;return this.uint32[3*t+0]=e,this.uint16[o+2]=i,this.uint16[o+3]=n,this.uint16[o+4]=r,t}}ls.prototype.bytesPerElement=12,Yr(ls,"StructArrayLayout1ul3ui12");class cs extends zo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e){const i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){const n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=i,t}}cs.prototype.bytesPerElement=4,Yr(cs,"StructArrayLayout2ui4");class us extends zo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint16[1*t+0]=e,t}}us.prototype.bytesPerElement=2,Yr(us,"StructArrayLayout1ui2");class hs extends zo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e){const i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){const n=2*t;return this.float32[n+0]=e,this.float32[n+1]=i,t}}hs.prototype.bytesPerElement=8,Yr(hs,"StructArrayLayout2f8");class ps extends Bo{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]}}ps.prototype.size=40;class ds extends Ko{get(t){return new ps(this,t)}}Yr(ds,"CollisionBoxArray");class fs extends Bo{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(t){this._structArray.uint8[this._pos1+49]=t}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(t){this._structArray.uint8[this._pos1+50]=t}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(t){this._structArray.uint32[this._pos4+13]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(t){this._structArray.uint8[this._pos1+58]=t}}fs.prototype.size=60;class ms extends rs{get(t){return new fs(this,t)}}Yr(ms,"PlacedSymbolArray");class gs extends Bo{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(t){this._structArray.uint32[this._pos4+15]=t}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]}}gs.prototype.size=76;class ys extends os{get(t){return new gs(this,t)}}Yr(ys,"SymbolInstanceArray");class vs extends ss{getoffsetX(t){return this.float32[1*t+0]}}Yr(vs,"GlyphOffsetArray");class _s extends Uo{getx(t){return this.int16[2*t+0]}gety(t){return this.int16[2*t+1]}}Yr(_s,"SymbolLineVertexArray");class xs extends Bo{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]}}xs.prototype.size=12;class bs extends ls{get(t){return new xs(this,t)}}Yr(bs,"FeatureIndexArray");class ws extends cs{geta_centroid_pos0(t){return this.uint16[2*t+0]}geta_centroid_pos1(t){return this.uint16[2*t+1]}}Yr(ws,"FillExtrusionCentroidArray");const As=Fo([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),Es=Fo([{name:"a_dash",components:4,type:"Uint16"}]);var Ss={exports:{}},Ms={exports:{}};Ms.exports=function(t,e){var i,n,r,o,s,a,l,c;for(n=t.length-(i=3&t.length),r=e,s=3432918353,a=461845907,c=0;c<n;)l=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24,++c,r=27492+(65535&(o=5*(65535&(r=(r^=l=(65535&(l=(l=(65535&l)*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<13|r>>>19))+((5*(r>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,i){case 3:l^=(255&t.charCodeAt(c+2))<<16;case 2:l^=(255&t.charCodeAt(c+1))<<8;case 1:r^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(c)))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295}return r^=t.length,r=2246822507*(65535&(r^=r>>>16))+((2246822507*(r>>>16)&65535)<<16)&4294967295,r=3266489909*(65535&(r^=r>>>13))+((3266489909*(r>>>16)&65535)<<16)&4294967295,(r^=r>>>16)>>>0};var Ts=Ms.exports,Is={exports:{}};Is.exports=function(t,e){for(var i,n=t.length,r=e^n,o=0;n>=4;)i=1540483477*(65535&(i=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(i>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:r^=(255&t.charCodeAt(o+2))<<16;case 2:r^=(255&t.charCodeAt(o+1))<<8;case 1:r=1540483477*(65535&(r^=255&t.charCodeAt(o)))+((1540483477*(r>>>16)&65535)<<16)}return r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16),(r^=r>>>15)>>>0};var Cs=Ts,Ps=Is.exports;Ss.exports=Cs,Ss.exports.murmur3=Cs,Ss.exports.murmur2=Ps;var Ls=p(Ss.exports);class Ds{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,e,i,n){this.ids.push(Rs(t)),this.positions.push(e,i,n)}getPositions(t){const e=Rs(t);let i=0,n=this.ids.length-1;for(;i<n;){const t=i+n>>1;this.ids[t]>=e?n=t:i=t+1}const r=[];for(;this.ids[i]===e;)r.push({index:this.positions[3*i],start:this.positions[3*i+1],end:this.positions[3*i+2]}),i++;return r}static serialize(t,e){const i=new Float64Array(t.ids),n=new Uint32Array(t.positions);return Os(i,n,0,i.length-1),e&&e.push(i.buffer,n.buffer),{ids:i,positions:n}}static deserialize(t){const e=new Ds;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e}}function Rs(t){const e=+t;return!isNaN(e)&&Number.MIN_SAFE_INTEGER<=e&&e<=Number.MAX_SAFE_INTEGER?e:Ls(String(t))}function Os(t,e,i,n){for(;i<n;){const r=t[i+n>>1];let o=i-1,s=n+1;for(;;){do{o++}while(t[o]<r);do{s--}while(t[s]>r);if(o>=s)break;ks(t,o,s),ks(e,3*o,3*s),ks(e,3*o+1,3*s+1),ks(e,3*o+2,3*s+2)}s-i<n-s?(Os(t,e,i,s),i=s+1):(Os(t,e,s+1,n),n=s)}}function ks(t,e,i){const n=t[e];t[e]=t[i],t[i]=n}Yr(Ds,"FeaturePositionMap");class Ns{constructor(t){this.gl=t.gl,this.initialized=!1}fetchUniformLocation(t,e){return this.location||this.initialized||(this.location=this.gl.getUniformLocation(t,e),this.initialized=!0),!!this.location}}class Bs extends Ns{constructor(t){super(t),this.current=0}set(t,e,i){this.fetchUniformLocation(t,e)&&this.current!==i&&(this.current=i,this.gl.uniform1f(this.location,i))}}class zs extends Ns{constructor(t){super(t),this.current=[0,0,0,0]}set(t,e,i){this.fetchUniformLocation(t,e)&&(i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]&&i[3]===this.current[3]||(this.current=i,this.gl.uniform4f(this.location,i[0],i[1],i[2],i[3])))}}class Fs extends Ns{constructor(t){super(t),this.current=Le.transparent}set(t,e,i){this.fetchUniformLocation(t,e)&&(i.r===this.current.r&&i.g===this.current.g&&i.b===this.current.b&&i.a===this.current.a||(this.current=i,this.gl.uniform4f(this.location,i.r,i.g,i.b,i.a)))}}const Vs=new Float32Array(16),Us=new Float32Array(9),Gs=new Float32Array(4);function js(t){return[ko(255*t.r,255*t.g),ko(255*t.b,255*t.a)]}class Hs{constructor(t,e,i){this.value=t,this.uniformNames=e.map((t=>`u_${t}`)),this.type=i}setUniform(t,e,i,n,r){e.set(t,r,n.constantOr(this.value))}getBinding(t,e){return"color"===this.type?new Fs(t):new Bs(t)}}class Ws{constructor(t,e){this.uniformNames=e.map((t=>`u_${t}`)),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(t){this.pixelRatio=t.pixelRatio||1,this.pattern=t.tl.concat(t.br)}setUniform(t,e,i,n,r){const o="u_pattern"===r||"u_dash"===r?this.pattern:"u_pixel_ratio"===r?this.pixelRatio:null;o&&e.set(t,r,o)}getBinding(t,e){return"u_pattern"===e||"u_dash"===e?new zs(t):new Bs(t)}}class qs{constructor(t,e,i,n){this.expression=t,this.type=i,this.maxValue=0,this.paintVertexAttributes=e.map((t=>({name:`a_${t}`,type:"Float32",components:"color"===i?2:1,offset:0}))),this.paintVertexArray=new n}populatePaintArray(t,e,i,n,r,o){const s=this.paintVertexArray.length,a=this.expression.evaluate(new wo(0),e,{},r,n,o);this.paintVertexArray.resize(t),this._setPaintValue(s,t,a)}updatePaintArray(t,e,i,n,r){const o=this.expression.evaluate({zoom:0},i,n,void 0,r);this._setPaintValue(t,e,o)}_setPaintValue(t,e,i){if("color"===this.type){const n=js(i);for(let i=t;i<e;i++)this.paintVertexArray.emplace(i,n[0],n[1])}else{for(let n=t;n<e;n++)this.paintVertexArray.emplace(n,i);this.maxValue=Math.max(this.maxValue,Math.abs(i))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Xs{constructor(t,e,i,n,r,o){this.expression=t,this.uniformNames=e.map((t=>`u_${t}_t`)),this.type=i,this.useIntegerZoom=n,this.zoom=r,this.maxValue=0,this.paintVertexAttributes=e.map((t=>({name:`a_${t}`,type:"Float32",components:"color"===i?4:2,offset:0}))),this.paintVertexArray=new o}populatePaintArray(t,e,i,n,r,o){const s=this.expression.evaluate(new wo(this.zoom),e,{},r,n,o),a=this.expression.evaluate(new wo(this.zoom+1),e,{},r,n,o),l=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(l,t,s,a)}updatePaintArray(t,e,i,n,r){const o=this.expression.evaluate({zoom:this.zoom},i,n,void 0,r),s=this.expression.evaluate({zoom:this.zoom+1},i,n,void 0,r);this._setPaintValue(t,e,o,s)}_setPaintValue(t,e,i,n){if("color"===this.type){const r=js(i),o=js(n);for(let i=t;i<e;i++)this.paintVertexArray.emplace(i,r[0],r[1],o[0],o[1])}else{for(let r=t;r<e;r++)this.paintVertexArray.emplace(r,i,n);this.maxValue=Math.max(this.maxValue,Math.abs(i),Math.abs(n))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(t,e,i,n,r){const o=this.useIntegerZoom?Math.floor(i.zoom):i.zoom,s=T(this.expression.interpolationFactor(o,this.zoom,this.zoom+1),0,1);e.set(t,r,s)}getBinding(t,e){return new Bs(t)}}class Zs{constructor(t,e,i,n,r){this.expression=t,this.layerId=r,this.paintVertexAttributes=("array"===i?Es:As).members;for(let t=0;t<e.length;++t);this.paintVertexArray=new n}populatePaintArray(t,e,i){const n=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValues(n,t,e.patterns&&e.patterns[this.layerId],i)}updatePaintArray(t,e,i,n,r,o){this._setPaintValues(t,e,i.patterns&&i.patterns[this.layerId],o)}_setPaintValues(t,e,i,n){if(!n||!i)return;const r=n[i];if(!r)return;const{tl:o,br:s,pixelRatio:a}=r;for(let i=t;i<e;i++)this.paintVertexArray.emplace(i,o[0],o[1],s[0],s[1],a)}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Ys{constructor(t,e,i=(()=>!0)){this.binders={},this._buffers=[];const n=[];for(const r in t.paint._values){if(!i(r))continue;const o=t.paint.get(r);if(!(o instanceof Co&&Nn(o.property.specification)))continue;const s=Ks(r,t.type),a=o.value,l=o.property.specification.type,c=!!o.property.useIntegerZoom,u="line-dasharray"===r||r.endsWith("pattern"),h="line-dasharray"===r&&"constant"!==t.layout.get("line-cap").value.kind;if("constant"!==a.kind||h)if("source"===a.kind||h||u){const e=ea(r,l,"source");this.binders[r]=u?new Zs(a,s,l,e,t.id):new qs(a,s,l,e),n.push(`/a_${r}`)}else{const t=ea(r,l,"composite");this.binders[r]=new Xs(a,s,l,c,e,t),n.push(`/z_${r}`)}else this.binders[r]=u?new Ws(a.value,s):new Hs(a.value,s,l),n.push(`/u_${r}`)}this.cacheKey=n.sort().join("")}getMaxValue(t){const e=this.binders[t];return e instanceof qs||e instanceof Xs?e.maxValue:0}populatePaintArrays(t,e,i,n,r,o){for(const s in this.binders){const a=this.binders[s];(a instanceof qs||a instanceof Xs||a instanceof Zs)&&a.populatePaintArray(t,e,i,n,r,o)}}setConstantPatternPositions(t){for(const e in this.binders){const i=this.binders[e];i instanceof Ws&&i.setConstantPatternPositions(t)}}updatePaintArrays(t,e,i,n,r,o){let s=!1;for(const a in t){const l=e.getPositions(a);for(const e of l){const l=i.feature(e.index);for(const i in this.binders){const c=this.binders[i];if((c instanceof qs||c instanceof Xs||c instanceof Zs)&&!0===c.expression.isStateDependent){const u=n.paint.get(i);c.expression=u.value,c.updatePaintArray(e.start,e.end,l,t[a],r,o),s=!0}}}}return s}defines(){const t=[];for(const e in this.binders){const i=this.binders[e];(i instanceof Hs||i instanceof Ws)&&t.push(...i.uniformNames.map((t=>`#define HAS_UNIFORM_${t}`)))}return t}getBinderAttributes(){const t=[];for(const e in this.binders){const i=this.binders[e];if(i instanceof qs||i instanceof Xs||i instanceof Zs)for(let e=0;e<i.paintVertexAttributes.length;e++)t.push(i.paintVertexAttributes[e].name)}return t}getBinderUniforms(){const t=[];for(const e in this.binders){const i=this.binders[e];if(i instanceof Hs||i instanceof Ws||i instanceof Xs)for(const e of i.uniformNames)t.push(e)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t){const e=[];for(const i in this.binders){const n=this.binders[i];if(n instanceof Hs||n instanceof Ws||n instanceof Xs)for(const r of n.uniformNames)e.push({name:r,property:i,binding:n.getBinding(t,r)})}return e}setUniforms(t,e,i,n,r){for(const{name:e,property:o,binding:s}of i)this.binders[o].setUniform(t,s,r,n.get(o),e)}updatePaintBuffers(){this._buffers=[];for(const t in this.binders){const e=this.binders[t];(e instanceof qs||e instanceof Xs||e instanceof Zs)&&e.paintVertexBuffer&&this._buffers.push(e.paintVertexBuffer)}}upload(t){for(const e in this.binders){const i=this.binders[e];(i instanceof qs||i instanceof Xs||i instanceof Zs)&&i.upload(t)}this.updatePaintBuffers()}destroy(){for(const t in this.binders){const e=this.binders[t];(e instanceof qs||e instanceof Xs||e instanceof Zs)&&e.destroy()}}}class Qs{constructor(t,e,i=(()=>!0)){this.programConfigurations={};for(const n of t)this.programConfigurations[n.id]=new Ys(n,e,i);this.needsUpload=!1,this._featureMap=new Ds,this._bufferOffset=0}populatePaintArrays(t,e,i,n,r,o,s){for(const i in this.programConfigurations)this.programConfigurations[i].populatePaintArrays(t,e,n,r,o,s);void 0!==e.id&&this._featureMap.add(e.id,i,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,e,i,n,r){for(const o of i)this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(t,this._featureMap,e,o,n,r)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy()}}const Js={"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 Ks(t,e){return Js[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}const $s={"line-pattern":{source:qo,composite:qo},"fill-pattern":{source:qo,composite:qo},"fill-extrusion-pattern":{source:qo,composite:qo},"line-dasharray":{source:Xo,composite:Xo}},ta={color:{source:hs,composite:Wo},number:{source:ss,composite:hs}};function ea(t,e,i){const n=$s[t];return n&&n[i]||ta[e][i]}Yr(Hs,"ConstantBinder"),Yr(Ws,"PatternConstantBinder"),Yr(qs,"SourceExpressionBinder"),Yr(Zs,"PatternCompositeBinder"),Yr(Xs,"CompositeExpressionBinder"),Yr(Ys,"ProgramConfiguration",{omit:["_buffers"]}),Yr(Qs,"ProgramConfigurationSet");const ia="-transition";class na extends $t{constructor(t,e){if(super(),this.id=t.id,this.type=t.type,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,"custom"!==t.type&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&"sky"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),e.layout&&(this._unevaluatedLayout=new Io(e.layout)),e.paint)){this._transitionablePaint=new So(e.paint);for(const e in t.paint)this.setPaintProperty(e,t.paint[e],{validate:!1});for(const e in t.layout)this.setLayoutProperty(e,t.layout[e],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Po(e.paint)}}getLayoutProperty(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)}setLayoutProperty(t,e,i={}){null!=e&&this._validate(Ur,`layers.${this.id}.layout.${t}`,t,e,i)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)}getPaintProperty(t){return F(t,ia)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,e,i={}){if(null!=e&&this._validate(Vr,`layers.${this.id}.paint.${t}`,t,e,i))return!1;if(F(t,ia))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;{const i=this._transitionablePaint._values[t],n=i.value.isDataDriven(),r=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);const o=this._transitionablePaint._values[t].value,s=o.isDataDriven(),a=F(t,"pattern")||"line-dasharray"===t;return s||n||a||this._handleOverridablePaintPropertyUpdate(t,r,o)}}_handleSpecialPaintPropertyUpdate(t){}getProgramIds(){return null}getProgramConfiguration(t){return null}_handleOverridablePaintPropertyUpdate(t,e,i){return!1}isHidden(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,e){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)}serialize(){const t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),U(t,((t,e)=>!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)))}_validate(t,e,i,n,r={}){return(!r||!1!==r.validate)&&jr(this,t.call(Fr,{key:e,layerType:this.type,objectKey:i,value:n,styleSpec:te,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const t in this.paint._values){const e=this.paint.get(t);if(e instanceof Co&&Nn(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1}compileFilter(){this._filterCompiled||(this._featureFilter=hr(this.filter),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}}const ra=Fo([{name:"a_pos",components:2,type:"Int16"}],4),oa=Fo([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class sa{constructor(t=[]){this.segments=t}prepareSegment(t,e,i,n){let r=this.segments[this.segments.length-1];return t>sa.MAX_VERTEX_ARRAY_LENGTH&&H(`Max vertices per segment is ${sa.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}`),(!r||r.vertexLength+t>sa.MAX_VERTEX_ARRAY_LENGTH||r.sortKey!==n)&&(r={vertexOffset:e.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0},void 0!==n&&(r.sortKey=n),this.segments.push(r)),r}get(){return this.segments}destroy(){for(const t of this.segments)for(const e in t.vaos)t.vaos[e].destroy()}static simpleSegment(t,e,i,n){return new sa([{vertexOffset:t,primitiveOffset:e,vertexLength:i,primitiveLength:n,vaos:{},sortKey:0}])}}sa.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Yr(sa,"SegmentVector");var aa=8192;class la{constructor(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))}setNorthEast(t){return this._ne=t instanceof Gl?new Gl(t.lng,t.lat):Gl.convert(t),this}setSouthWest(t){return this._sw=t instanceof Gl?new Gl(t.lng,t.lat):Gl.convert(t),this}extend(t){const e=this._sw,i=this._ne;let n,r;if(t instanceof Gl)n=t,r=t;else{if(!(t instanceof la))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(la.convert(t)):this.extend(Gl.convert(t)):"object"==typeof t&&null!==t&&t.hasOwnProperty("lat")&&(t.hasOwnProperty("lon")||t.hasOwnProperty("lng"))?this.extend(Gl.convert(t)):this;if(n=t._sw,r=t._ne,!n||!r)return this}return e||i?(e.lng=Math.min(n.lng,e.lng),e.lat=Math.min(n.lat,e.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new Gl(n.lng,n.lat),this._ne=new Gl(r.lng,r.lat)),this}getCenter(){return new Gl((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 Gl(this.getWest(),this.getNorth())}getSouthEast(){return new Gl(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(t){const{lng:e,lat:i}=Gl.convert(t);let n=this._sw.lng<=e&&e<=this._ne.lng;return this._sw.lng>this._ne.lng&&(n=this._sw.lng>=e&&e>=this._ne.lng),this._sw.lat<=i&&i<=this._ne.lat&&n}static convert(t){return!t||t instanceof la?t:new la(t)}}var ca=1e-6,ua="undefined"!=typeof Float32Array?Float32Array:Array;function ha(){var t=new ua(9);return ua!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function pa(t,e,i){var n=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],p=i[0],d=i[1],f=i[2],m=i[3],g=i[4],y=i[5],v=i[6],_=i[7],x=i[8];return t[0]=p*n+d*s+f*c,t[1]=p*r+d*a+f*u,t[2]=p*o+d*l+f*h,t[3]=m*n+g*s+y*c,t[4]=m*r+g*a+y*u,t[5]=m*o+g*l+y*h,t[6]=v*n+_*s+x*c,t[7]=v*r+_*a+x*u,t[8]=v*o+_*l+x*h,t}function da(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function fa(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],p=e[10],d=e[11],f=e[12],m=e[13],g=e[14],y=e[15],v=i*a-n*s,_=i*l-r*s,x=i*c-o*s,b=n*l-r*a,w=n*c-o*a,A=r*c-o*l,E=u*m-h*f,S=u*g-p*f,M=u*y-d*f,T=h*g-p*m,I=h*y-d*m,C=p*y-d*g,P=v*C-_*I+x*T+b*M-w*S+A*E;return P?(t[0]=(a*C-l*I+c*T)*(P=1/P),t[1]=(r*I-n*C-o*T)*P,t[2]=(m*A-g*w+y*b)*P,t[3]=(p*w-h*A-d*b)*P,t[4]=(l*M-s*C-c*S)*P,t[5]=(i*C-r*M+o*S)*P,t[6]=(g*x-f*A-y*_)*P,t[7]=(u*A-p*x+d*_)*P,t[8]=(s*I-a*M+c*E)*P,t[9]=(n*M-i*I-o*E)*P,t[10]=(f*w-m*x+y*v)*P,t[11]=(h*x-u*w-d*v)*P,t[12]=(a*S-s*T-l*E)*P,t[13]=(i*T-n*S+r*E)*P,t[14]=(m*_-f*b-g*v)*P,t[15]=(u*b-h*_+p*v)*P,t):null}function ma(t,e,i){var n=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],p=e[9],d=e[10],f=e[11],m=e[12],g=e[13],y=e[14],v=e[15],_=i[0],x=i[1],b=i[2],w=i[3];return t[0]=_*n+x*a+b*h+w*m,t[1]=_*r+x*l+b*p+w*g,t[2]=_*o+x*c+b*d+w*y,t[3]=_*s+x*u+b*f+w*v,t[4]=(_=i[4])*n+(x=i[5])*a+(b=i[6])*h+(w=i[7])*m,t[5]=_*r+x*l+b*p+w*g,t[6]=_*o+x*c+b*d+w*y,t[7]=_*s+x*u+b*f+w*v,t[8]=(_=i[8])*n+(x=i[9])*a+(b=i[10])*h+(w=i[11])*m,t[9]=_*r+x*l+b*p+w*g,t[10]=_*o+x*c+b*d+w*y,t[11]=_*s+x*u+b*f+w*v,t[12]=(_=i[12])*n+(x=i[13])*a+(b=i[14])*h+(w=i[15])*m,t[13]=_*r+x*l+b*p+w*g,t[14]=_*o+x*c+b*d+w*y,t[15]=_*s+x*u+b*f+w*v,t}function ga(t,e,i){var n,r,o,s,a,l,c,u,h,p,d,f,m=i[0],g=i[1],y=i[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*y+e[12],t[13]=e[1]*m+e[5]*g+e[9]*y+e[13],t[14]=e[2]*m+e[6]*g+e[10]*y+e[14],t[15]=e[3]*m+e[7]*g+e[11]*y+e[15]):(r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],p=e[9],d=e[10],f=e[11],t[0]=n=e[0],t[1]=r,t[2]=o,t[3]=s,t[4]=a,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=p,t[10]=d,t[11]=f,t[12]=n*m+a*g+h*y+e[12],t[13]=r*m+l*g+p*y+e[13],t[14]=o*m+c*g+d*y+e[14],t[15]=s*m+u*g+f*y+e[15]),t}function ya(t,e,i){var n=i[0],r=i[1],o=i[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function va(t,e,i){var n=Math.sin(i),r=Math.cos(i),o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u=e[9],h=e[10],p=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*r+c*n,t[5]=s*r+u*n,t[6]=a*r+h*n,t[7]=l*r+p*n,t[8]=c*r-o*n,t[9]=u*r-s*n,t[10]=h*r-a*n,t[11]=p*r-l*n,t}function _a(t,e,i){var n=Math.sin(i),r=Math.cos(i),o=e[0],s=e[1],a=e[2],l=e[3],c=e[8],u=e[9],h=e[10],p=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*r-c*n,t[1]=s*r-u*n,t[2]=a*r-h*n,t[3]=l*r-p*n,t[8]=o*n+c*r,t[9]=s*n+u*r,t[10]=a*n+h*r,t[11]=l*n+p*r,t}function xa(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ba(t,e,i){var n,r,o,s=i[0],a=i[1],l=i[2],c=Math.hypot(s,a,l);return c<ca?null:(s*=c=1/c,a*=c,l*=c,n=Math.sin(e),r=Math.cos(e),t[0]=s*s*(o=1-r)+r,t[1]=a*s*o+l*n,t[2]=l*s*o-a*n,t[3]=0,t[4]=s*a*o-l*n,t[5]=a*a*o+r,t[6]=l*a*o+s*n,t[7]=0,t[8]=s*l*o+a*n,t[9]=a*l*o-s*n,t[10]=l*l*o+r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var wa=ma;function Aa(){var t=new ua(3);return ua!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ea(t){var e=new ua(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Sa(t){return Math.hypot(t[0],t[1],t[2])}function Ma(t,e,i){var n=new ua(3);return n[0]=t,n[1]=e,n[2]=i,n}function Ta(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t}function Ia(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t}function Ca(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t}function Pa(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t[2]=Math.min(e[2],i[2]),t}function La(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t[2]=Math.max(e[2],i[2]),t}function Da(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function Ra(t,e,i,n){return t[0]=e[0]+i[0]*n,t[1]=e[1]+i[1]*n,t[2]=e[2]+i[2]*n,t}function Oa(t,e){var i=e[0],n=e[1],r=e[2],o=i*i+n*n+r*r;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function ka(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Na(t,e,i){var n=e[0],r=e[1],o=e[2],s=i[0],a=i[1],l=i[2];return t[0]=r*l-o*a,t[1]=o*s-n*l,t[2]=n*a-r*s,t}function Ba(t,e,i){var n=e[0],r=e[1],o=e[2],s=i[3]*n+i[7]*r+i[11]*o+i[15];return t[0]=(i[0]*n+i[4]*r+i[8]*o+i[12])/(s=s||1),t[1]=(i[1]*n+i[5]*r+i[9]*o+i[13])/s,t[2]=(i[2]*n+i[6]*r+i[10]*o+i[14])/s,t}function za(t,e,i){var n=i[0],r=i[1],o=i[2],s=e[0],a=e[1],l=e[2],c=r*l-o*a,u=o*s-n*l,h=n*a-r*s,p=r*h-o*u,d=o*c-n*h,f=n*u-r*c,m=2*i[3];return u*=m,h*=m,d*=2,f*=2,t[0]=s+(c*=m)+(p*=2),t[1]=a+u+d,t[2]=l+h+f,t}var Fa,Va=Ia,Ua=Ca,Ga=Sa;function ja(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t}function Ha(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=i*i+n*n+r*r+o*o;return s>0&&(s=1/Math.sqrt(s)),t[0]=i*s,t[1]=n*s,t[2]=r*s,t[3]=o*s,t}function Wa(t,e,i){var n=e[0],r=e[1],o=e[2],s=e[3];return t[0]=i[0]*n+i[4]*r+i[8]*o+i[12]*s,t[1]=i[1]*n+i[5]*r+i[9]*o+i[13]*s,t[2]=i[2]*n+i[6]*r+i[10]*o+i[14]*s,t[3]=i[3]*n+i[7]*r+i[11]*o+i[15]*s,t}function qa(){var t=new ua(4);return ua!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Xa(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Za(t,e,i){i*=.5;var n=e[0],r=e[1],o=e[2],s=e[3],a=Math.sin(i),l=Math.cos(i);return t[0]=n*l+s*a,t[1]=r*l+o*a,t[2]=o*l-r*a,t[3]=s*l-n*a,t}function Ya(t,e,i){i*=.5;var n=e[0],r=e[1],o=e[2],s=e[3],a=Math.sin(i),l=Math.cos(i);return t[0]=n*l-o*a,t[1]=r*l+s*a,t[2]=o*l+n*a,t[3]=s*l-r*a,t}Aa(),Fa=new ua(4),ua!=Float32Array&&(Fa[0]=0,Fa[1]=0,Fa[2]=0,Fa[3]=0);var Qa=Ha;Aa(),Ma(1,0,0),Ma(0,1,0),qa(),qa(),ha();const Ja=Fo([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:Ka}=Ja,$a=Fo([{name:"a_pos_3",components:3,type:"Int16"}]);var tl=Fo([{name:"a_pos",type:"Int16",components:2}]);class el{constructor(t,e){this.pos=t,this.dir=e}intersectsPlane(t,e,i){const n=ka(e,this.dir);if(Math.abs(n)<1e-6)return!1;const r=((t[0]-this.pos[0])*e[0]+(t[1]-this.pos[1])*e[1]+(t[2]-this.pos[2])*e[2])/n;return i[0]=this.pos[0]+this.dir[0]*r,i[1]=this.pos[1]+this.dir[1]*r,i[2]=this.pos[2]+this.dir[2]*r,!0}closestPointOnSphere(t,e,i){if(function(t,e){var i=t[0],n=t[1],r=t[2],o=e[0],s=e[1],a=e[2];return Math.abs(i-o)<=ca*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(n-s)<=ca*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(r-a)<=ca*Math.max(1,Math.abs(r),Math.abs(a))}(this.pos,t)||0===e)return i[0]=i[1]=i[2]=0,!1;const[n,r,o]=this.dir,s=this.pos[0]-t[0],a=this.pos[1]-t[1],l=this.pos[2]-t[2],c=n*n+r*r+o*o,u=2*(s*n+a*r+l*o),h=u*u-4*c*(s*s+a*a+l*l-e*e);if(h<0){const t=Math.max(-u/2,0),c=s+n*t,h=a+r*t,p=l+o*t,d=Math.hypot(c,h,p);return i[0]=c*e/d,i[1]=h*e/d,i[2]=p*e/d,!1}{const t=(-u-Math.sqrt(h))/(2*c);if(t<0){const t=Math.hypot(s,a,l);return i[0]=s*e/t,i[1]=a*e/t,i[2]=l*e/t,!1}return i[0]=s+n*t,i[1]=a+r*t,i[2]=l+o*t,!0}}}class il{constructor(t,e,i,n,r){this.TL=t,this.TR=e,this.BR=i,this.BL=n,this.horizon=r}static fromInvProjectionMatrix(t,e,i){const n=[-1,1,1],r=[1,1,1],o=[1,-1,1],s=[-1,-1,1],a=Ba(n,n,t),l=Ba(r,r,t),c=Ba(o,o,t),u=Ba(s,s,t);return new il(a,l,c,u,e/i)}}class nl{constructor(t,e){this.points=t,this.planes=e}static fromInvProjectionMatrix(t,e,i,n){const r=Math.pow(2,i),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((i=>{const o=Wa([],i,t),s=1/o[3]/e*r;return function(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t[3]=e[3]*i[3],t}(o,o,[s,s,n?1/o[3]:s,s])})),s=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((t=>{const e=Oa([],Na([],Va([],o[t[0]],o[t[1]]),Va([],o[t[2]],o[t[1]]))),i=-ka(e,o[t[1]]);return e.concat(i)}));return new nl(o,s)}}class rl{static fromPoints(t){const e=[1/0,1/0,1/0],i=[-1/0,-1/0,-1/0];for(const n of t)Pa(e,e,n),La(i,i,n);return new rl(e,i)}static applyTransform(t,e){const i=t.getCorners();for(let t=0;t<i.length;++t)Ba(i[t],i[t],e);return rl.fromPoints(i)}constructor(t,e){this.min=t,this.max=e,this.center=Da([],Ta([],this.min,this.max),.5)}quadrant(t){const e=[t%2==0,t<2],i=Ea(this.min),n=Ea(this.max);for(let t=0;t<e.length;t++)i[t]=e[t]?this.min[t]:this.center[t],n[t]=e[t]?this.center[t]:this.max[t];return n[2]=this.max[2],new rl(i,n)}distanceX(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]}distanceY(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]}distanceZ(t){return Math.max(Math.min(this.max[2],t[2]),this.min[2])-t[2]}getCorners(){const t=this.min,e=this.max;return[[t[0],t[1],t[2]],[e[0],t[1],t[2]],[e[0],e[1],t[2]],[t[0],e[1],t[2]],[t[0],t[1],e[2]],[e[0],t[1],e[2]],[e[0],e[1],e[2]],[t[0],e[1],e[2]]]}intersects(t){const e=this.getCorners();let i=!0;for(let n=0;n<t.planes.length;n++){const r=t.planes[n];let o=0;for(let t=0;t<e.length;t++)o+=ka(r,e[t])+r[3]>=0;if(0===o)return 0;o!==e.length&&(i=!1)}if(i)return 2;for(let e=0;e<3;e++){let i=Number.MAX_VALUE,n=-Number.MAX_VALUE;for(let r=0;r<t.points.length;r++){const o=t.points[r][e]-this.min[e];i=Math.min(i,o),n=Math.max(n,o)}if(n<0||i>this.max[e]-this.min[e])return 0}return 1}}const ol=5,sl=6,al=aa/Math.PI/2,ll=16383,cl=64,ul=[cl,32,16],hl=-al,pl=al,dl=[new rl([hl,hl,hl],[pl,pl,pl]),new rl([hl,hl,hl],[0,0,pl]),new rl([0,hl,hl],[pl,0,pl]),new rl([hl,0,hl],[0,pl,pl]),new rl([0,0,hl],[pl,pl,pl])];function fl(t){return t*al/Fl}function ml(t,e,i,n=!0){const r=Da([],t._camera.position,t.worldSize),o=[e,i,1,1];Wa(o,o,t.pixelMatrixInverse),ja(o,o,1/o[3]);const s=Oa([],Va([],o,r)),a=t.globeMatrix,l=[a[12],a[13],a[14]],c=Va([],l,r),u=Sa(c),h=Oa([],c),p=t.worldSize/(2*Math.PI),d=ka(h,s),f=Math.asin(p/u);if(f<Math.acos(d)){if(!n)return null;const t=[],e=[];Da(t,s,u/d),Oa(e,Va(e,t,c)),Oa(s,Ta(s,c,Da(s,e,Math.tan(f)*u)))}const m=[];new el(r,s).closestPointOnSphere(l,p,m);const g=Oa([],K(a,0)),y=Oa([],K(a,1)),v=Oa([],K(a,2)),_=ka(g,m),x=ka(y,m),b=ka(v,m),A=w(Math.asin(-x/p));let E=w(Math.atan2(_,b));E=t.center.lng+function(t,e){const i=(e-t+180)%360-180;return i<-180?i+360:i}(t.center.lng,E);const S=Hl(E),M=T(Wl(A),0,1);return new Kl(S,M)}class gl{constructor(t,e,i){this.a=Va([],t,i),this.b=Va([],e,i),this.center=i;const n=Oa([],this.a),r=Oa([],this.b);this.angle=Math.acos(ka(n,r))}}function yl(t,e){if(0===t.angle)return null;let i;return i=0===t.a[e]?1/t.angle*.5*Math.PI:1/t.angle*Math.atan(t.b[e]/t.a[e]/Math.sin(t.angle)-1/Math.tan(t.angle)),i<0||i>1?null:function(t,e,i,n){const r=Math.sin(i);return t*(Math.sin((1-n)*i)/r)+e*(Math.sin(n*i)/r)}(t.a[e],t.b[e],t.angle,T(i,0,1))+t.center[e]}function vl(t){if(t.z<=1)return dl[t.z+2*t.y+t.x];const e=El(Al(t));return rl.fromPoints(e)}function _l(t,e,i){return Da(t,t,1-i),Ra(t,t,e,i)}function xl(t,e){const i=Rl(e.zoom);if(0===i)return vl(t);const n=Al(t),r=El(n),o=Hl(n.getWest())*e.worldSize,s=Hl(n.getEast())*e.worldSize,a=Wl(n.getNorth())*e.worldSize,l=Wl(n.getSouth())*e.worldSize,c=[o,a,0],u=[s,a,0],h=[o,l,0],p=[s,l,0],d=fa([],e.globeMatrix);return Ba(c,c,d),Ba(u,u,d),Ba(h,h,d),Ba(p,p,d),r[0]=_l(r[0],h,i),r[1]=_l(r[1],p,i),r[2]=_l(r[2],u,i),r[3]=_l(r[3],c,i),rl.fromPoints(r)}function bl(t,e,i){for(const n of t)Ba(n,n,e),Da(n,n,i)}function wl(t,e,i){const n=e/t.worldSize,r=t.globeMatrix;if(i.z<=1){const t=vl(i).getCorners();return bl(t,r,n),rl.fromPoints(t)}const o=Al(i),s=El(o);bl(s,r,n);const a=Number.MAX_VALUE,l=[-a,-a,-a],c=[a,a,a];if(o.contains(t.center)){for(const t of s)Pa(c,c,t),La(l,l,t);l[2]=0;const e=t.point,i=[e.x*n,e.y*n,0];return Pa(c,c,i),La(l,l,i),new rl(c,l)}const u=[r[12]*n,r[13]*n,r[14]*n],h=o.getCenter(),p=T(t.center.lat,-Ql,Ql),d=T(h.lat,-Ql,Ql),f=Hl(t.center.lng),m=Wl(p);let g=f-Hl(h.lng);const y=m-Wl(d);g>.5?g-=1:g<-.5&&(g+=1);let v=0;Math.abs(g)>Math.abs(y)?v=g>=0?1:3:(v=y>=0?0:2,Ra(u,u,[r[4]*n,r[5]*n,r[6]*n],-Math.sin(b(y>=0?o.getSouth():o.getNorth()))*al));const _=s[v],x=s[(v+1)%4],w=new gl(_,x,u),A=[yl(w,0)||_[0],yl(w,1)||_[1],yl(w,2)||_[2]],E=Rl(t.zoom);if(E>0){const n=function({x:t,y:e,z:i},n,r,o,s){const a=1/(1<<i);let l=t*a,c=l+a,u=e*a,h=u+a,p=0;const d=(l+c)/2-o;return d>.5?p=-1:d<-.5&&(p=1),l=((l+p)*n-(o*=n))*r+o,c=((c+p)*n-o)*r+o,u=(u*n-(s*=n))*r+s,h=(h*n-s)*r+s,[[l,h,0],[c,h,0],[c,u,0],[l,u,0]]}(i,e,t._pixelsPerMercatorPixel,f,m);for(let t=0;t<s.length;t++)_l(s[t],n[t],E);const r=Ta([],n[v],n[(v+1)%4]);Da(r,r,.5),_l(A,r,E)}for(const t of s)Pa(c,c,t),La(l,l,t);return c[2]=Math.min(_[2],x[2]),Pa(c,c,A),La(l,l,A),new rl(c,l)}function Al({x:t,y:e,z:i}){const n=1/(1<<i),r=new Gl(Xl(t*n),Zl((e+1)*n)),o=new Gl(Xl((t+1)*n),Zl(e*n));return new la(r,o)}function El(t){const e=b(t.getNorth()),i=b(t.getSouth()),n=Math.cos(e),r=Math.cos(i),o=Math.sin(e),s=Math.sin(i),a=t.getWest(),l=t.getEast();return[Sl(r,s,a),Sl(r,s,l),Sl(n,o,l),Sl(n,o,a)]}function Sl(t,e,i,n=al){return i=b(i),[t*Math.sin(i)*n,-e*n,t*Math.cos(i)*n]}function Ml(t,e,i){return Sl(Math.cos(b(t)),Math.sin(b(t)),e,i)}function Tl(t,e,i,n){const r=1<<i.z,o=(t/aa+i.x)/r;return Ml(Zl((e/aa+i.y)/r),Xl(o),n)}function Il({min:t,max:e}){return ll/Math.max(e[0]-t[0],e[1]-t[1],e[2]-t[2])}const Cl=new Float64Array(16);function Pl(t){const e=Il(t),i=xa(Cl,[e,e,e]);return ga(i,i,((n=[])[0]=-(r=t.min)[0],n[1]=-r[1],n[2]=-r[2],n));var n,r}function Ll(t){const e=(n=t.min,(i=Cl)[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=n[0],i[13]=n[1],i[14]=n[2],i[15]=1,i);var i,n;const r=1/Il(t);return ya(e,e,[r,r,r])}function Dl(t,e,i,n,r){const o=function(t){const e=aa/(2*Math.PI);return t/(2*Math.PI)/e}(i),s=[t,e,-i/(2*Math.PI)],a=da(new Float64Array(16));return ga(a,a,s),ya(a,a,[o,o,o]),va(a,a,b(-r)),_a(a,a,b(-n)),a}function Rl(t){return I(ol,sl,t)}function Ol(t,e){const i=Ml(e.lat,e.lng),n=function(t){const e=Ml(t._center.lat,t._center.lng);let i=Na([],Ma(0,1,0),e);const n=ba([],-t.angle,e);i=Ba(i,i,n),ba(n,-t._pitch,i);const r=Oa([],e);return Da(r,r,fl(t.cameraToCenterDistance/t.pixelsPerMeter)),Ba(r,r,n),Ta([],e,r)}(t);return s=(r=Ia([],n,i))[0],a=r[1],l=r[2],c=(o=i)[0],u=o[1],h=o[2],d=(p=Math.sqrt(s*s+a*a+l*l)*Math.sqrt(c*c+u*u+h*h))&&ka(r,o)/p,Math.acos(Math.min(Math.max(d,-1),1));var r,o,s,a,l,c,u,h,p,d}function kl(t,e){return Ol(t,e)>Math.PI/2*1.01}const Nl=b(85),Bl=Math.cos(Nl),zl=Math.sin(Nl),Fl=6371008.8,Vl=2*Math.PI*Fl;class Ul{constructor(t,e){if(isNaN(t)||isNaN(e))throw new Error(`Invalid LngLat object: (${t}, ${e})`);if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Ul(C(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){const e=Math.PI/180,i=this.lat*e,n=t.lat*e,r=Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return Fl*Math.acos(Math.min(r,1))}toBounds(t=0){const e=360*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return new la(new Ul(this.lng-i,this.lat-e),new Ul(this.lng+i,this.lat+e))}toEcef(t){const e=fl(t);return Ml(this.lat,this.lng,al+e)}static convert(t){if(t instanceof Ul)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Ul(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Ul(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}var Gl=Ul;function jl(t){return Vl*Math.cos(t*Math.PI/180)}function Hl(t){return(180+t)/360}function Wl(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function ql(t,e){return t/jl(e)}function Xl(t){return 360*t-180}function Zl(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}function Yl(t,e){return t*jl(Zl(e))}const Ql=85.051129;function Jl(t){return 1/Math.cos(t*Math.PI/180)}class Kl{constructor(t,e,i=0){this.x=+t,this.y=+e,this.z=+i}static fromLngLat(t,e=0){const i=Gl.convert(t);return new Kl(Hl(i.lng),Wl(i.lat),ql(e,i.lat))}toLngLat(){return new Gl(Xl(this.x),Zl(this.y))}toAltitude(){return Yl(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Vl*Jl(Zl(this.y))}}function $l(t,e,i,n,r,o,s,a,l){const c=(e+n)/2,u=(i+r)/2,h=new v(c,u);a(h),function(t,e,i,n,r,o){const s=i-r,a=n-o;return Math.abs((n-e)*s-(i-t)*a)/Math.hypot(s,a)}(h.x,h.y,o.x,o.y,s.x,s.y)>=l?($l(t,e,i,c,u,o,h,a,l),$l(t,c,u,n,r,h,s,a,l)):t.push(s)}function tc(t,e,i){let n=t[0],r=n.x,o=n.y;e(n);const s=[n];for(let a=1;a<t.length;a++){const l=t[a],{x:c,y:u}=l;e(l),$l(s,r,o,c,u,n,l,e,i),r=c,o=u,n=l}return s}function ec(t,e,i,n){if(n(e,i)){const r=e.add(i)._mult(.5);ec(t,e,r,n),ec(t,r,i,n)}else t.push(i)}function ic(t,e){let i=t[0];const n=[i];for(let r=1;r<t.length;r++){const o=t[r];ec(n,i,o,e),i=o}return n}const nc=Math.pow(2,14)-1,rc=-nc-1;function oc(t,e){const i=Math.round(t.x*e),n=Math.round(t.y*e);return t.x=T(i,rc,nc),t.y=T(n,rc,nc),(i<t.x||i>t.x+1||n<t.y||n>t.y+1)&&H("Geometry exceeds allowed extent, reduce your vector tile buffer size"),t}function sc(t,e,i){const n=t.loadGeometry(),r=t.extent,o=aa/r;if(e&&i&&i.projection.isReprojectedInTileSpace){const o=1<<e.z,{scale:s,x:a,y:l,projection:c}=i,u=t=>{const i=Xl((e.x+t.x/r)/o),n=Zl((e.y+t.y/r)/o),u=c.project(i,n);t.x=(u.x*s-a)*r,t.y=(u.y*s-l)*r};for(let e=0;e<n.length;e++)if(1!==t.type)n[e]=tc(n[e],u,1);else{const t=[];for(const i of n[e])i.x<0||i.x>=r||i.y<0||i.y>=r||(u(i),t.push(i));n[e]=t}}for(const t of n)for(const e of t)oc(e,o);return n}function ac(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?sc(t):[]}}function lc(t,e,i,n,r){t.emplaceBack(2*e+(n+1)/2,2*i+(r+1)/2)}function cc(t,e,i){const n=16384;t.emplaceBack(e.x,e.y,e.z,i[0]*n,i[1]*n,i[2]*n)}class uc{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.projection=t.projection,this.layoutVertexArray=new Uo,this.indexArray=new ns,this.segments=new sa,this.programConfigurations=new Qs(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,i,n){const r=this.layers[0],o=[];let s=null;"circle"===r.type&&(s=r.layout.get("circle-sort-key"));for(const{feature:e,id:r,index:a,sourceLayerIndex:l}of t){const t=this.layers[0]._featureFilter.needGeometry,c=ac(e,t);if(!this.layers[0]._featureFilter.filter(new wo(this.zoom),c,i))continue;const u=s?s.evaluate(c,{},i):void 0,h={id:r,properties:e.properties,type:e.type,sourceLayerIndex:l,index:a,geometry:t?c.geometry:sc(e,i,n),patterns:{},sortKey:u};o.push(h)}s&&o.sort(((t,e)=>t.sortKey-e.sortKey));let a=null;"globe"===n.projection.name&&(this.globeExtVertexArray=new Zo,a=n.projection);for(const n of o){const{geometry:r,index:o,sourceLayerIndex:s}=n,l=t[o].feature;this.addFeature(n,r,o,e.availableImages,i,a),e.featureIndex.insert(l,r,o,s,this.index)}}update(t,e,i,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i,n)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ra.members),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=t.createVertexBuffer(this.globeExtVertexArray,oa.members))),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(t,e,i,n,r,o){for(const i of e)for(const e of i){const i=e.x,n=e.y;if(i<0||i>=aa||n<0||n>=aa)continue;if(o){const t=o.projectTilePoint(i,n,r),e=o.upVector(r,i,n),s=this.globeExtVertexArray;cc(s,t,e),cc(s,t,e),cc(s,t,e),cc(s,t,e)}const s=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),a=s.vertexLength;lc(this.layoutVertexArray,i,n,-1,-1),lc(this.layoutVertexArray,i,n,1,-1),lc(this.layoutVertexArray,i,n,1,1),lc(this.layoutVertexArray,i,n,-1,1),this.indexArray.emplaceBack(a,a+1,a+2),this.indexArray.emplaceBack(a,a+2,a+3),s.vertexLength+=4,s.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{},n,r)}}function hc(t,e){for(let i=0;i<t.length;i++)if(xc(e,t[i]))return!0;for(let i=0;i<e.length;i++)if(xc(t,e[i]))return!0;return!!mc(t,e)}function pc(t,e,i){return!!xc(t,e)||!!yc(e,t,i)}function dc(t,e){if(1===t.length)return _c(e,t[0]);for(let i=0;i<e.length;i++){const n=e[i];for(let e=0;e<n.length;e++)if(xc(t,n[e]))return!0}for(let i=0;i<t.length;i++)if(_c(e,t[i]))return!0;for(let i=0;i<e.length;i++)if(mc(t,e[i]))return!0;return!1}function fc(t,e,i){if(t.length>1){if(mc(t,e))return!0;for(let n=0;n<e.length;n++)if(yc(e[n],t,i))return!0}for(let n=0;n<t.length;n++)if(yc(t[n],e,i))return!0;return!1}function mc(t,e){if(0===t.length||0===e.length)return!1;for(let i=0;i<t.length-1;i++){const n=t[i],r=t[i+1];for(let t=0;t<e.length-1;t++)if(gc(n,r,e[t],e[t+1]))return!0}return!1}function gc(t,e,i,n){return W(t,i,n)!==W(e,i,n)&&W(t,e,i)!==W(t,e,n)}function yc(t,e,i){const n=i*i;if(1===e.length)return t.distSqr(e[0])<n;for(let i=1;i<e.length;i++)if(vc(t,e[i-1],e[i])<n)return!0;return!1}function vc(t,e,i){const n=e.distSqr(i);if(0===n)return t.distSqr(e);const r=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/n;return t.distSqr(r<0?e:r>1?i:i.sub(e)._mult(r)._add(e))}function _c(t,e){let i,n,r,o=!1;for(let s=0;s<t.length;s++){i=t[s];for(let t=0,s=i.length-1;t<i.length;s=t++)n=i[t],r=i[s],n.y>e.y!=r.y>e.y&&e.x<(r.x-n.x)*(e.y-n.y)/(r.y-n.y)+n.x&&(o=!o)}return o}function xc(t,e){let i=!1;for(let n=0,r=t.length-1;n<t.length;r=n++){const o=t[n],s=t[r];o.y>e.y!=s.y>e.y&&e.x<(s.x-o.x)*(e.y-o.y)/(s.y-o.y)+o.x&&(i=!i)}return i}function bc(t,e,i,n,r){for(const o of t)if(e<=o.x&&i<=o.y&&n>=o.x&&r>=o.y)return!0;const o=[new v(e,i),new v(e,r),new v(n,r),new v(n,i)];if(t.length>2)for(const e of o)if(xc(t,e))return!0;for(let e=0;e<t.length-1;e++)if(wc(t[e],t[e+1],o))return!0;return!1}function wc(t,e,i){const n=i[0],r=i[2];if(t.x<n.x&&e.x<n.x||t.x>r.x&&e.x>r.x||t.y<n.y&&e.y<n.y||t.y>r.y&&e.y>r.y)return!1;const o=W(t,e,i[0]);return o!==W(t,e,i[1])||o!==W(t,e,i[2])||o!==W(t,e,i[3])}function Ac(t,e,i){const n=e.paint.get(t).value;return"constant"===n.kind?n.value:i.programConfigurations.get(e.id).getMaxValue(t)}function Ec(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Sc(t,e,i,n,r){if(!e[0]&&!e[1])return t;const o=v.convert(e)._mult(r);"viewport"===i&&o._rotate(-n);const s=[];for(let e=0;e<t.length;e++)s.push(t[e].sub(o));return s}function Mc(t,e,i,n){const r=v.convert(t)._mult(n);return"viewport"===e&&r._rotate(-i),r}Yr(uc,"CircleBucket",{omit:["layers"]});const Tc=new Oo({"circle-sort-key":new Do(te.layout_circle["circle-sort-key"])});var Ic={paint:new Oo({"circle-radius":new Do(te.paint_circle["circle-radius"]),"circle-color":new Do(te.paint_circle["circle-color"]),"circle-blur":new Do(te.paint_circle["circle-blur"]),"circle-opacity":new Do(te.paint_circle["circle-opacity"]),"circle-translate":new Lo(te.paint_circle["circle-translate"]),"circle-translate-anchor":new Lo(te.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Lo(te.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Lo(te.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Do(te.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Do(te.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Do(te.paint_circle["circle-stroke-opacity"])}),layout:Tc};function Cc(t,e,i,n,r,o,s,a,l){if(o&&t.queryGeometry.isAboveHorizon)return!1;o&&(l*=t.pixelToTileUnitsFactor);const c=t.tileID.canonical,u=i.projection.upVectorScale(c,i.center.lat,i.worldSize).metersToTile;for(const h of e)for(const e of h){const h=e.add(a),p=r&&i.elevation?i.elevation.exaggeration()*r.getElevationAt(h.x,h.y,!0):0,d=i.projection.projectTilePoint(h.x,h.y,c);if(p>0){const t=i.projection.upVector(c,h.x,h.y);d.x+=t[0]*u*p,d.y+=t[1]*u*p,d.z+=t[2]*u*p}const f=o?h:Pc(d.x,d.y,d.z,n),m=o?t.tilespaceRays.map((t=>Rc(t,p))):t.queryGeometry.screenGeometry,g=Wa([],[d.x,d.y,d.z,1],n);if(!s&&o?l*=g[3]/i.cameraToCenterDistance:s&&!o&&(l*=i.cameraToCenterDistance/g[3]),o){const t=Zl((e.y/aa+c.y)/(1<<c.z));l/=i.projection.pixelsPerMeter(t,1)/ql(1,t)}if(pc(m,f,l))return!0}return!1}function Pc(t,e,i,n){const r=Wa([],[t,e,i,1],n);return new v(r[0]/r[3],r[1]/r[3])}const Lc=Ma(0,0,0),Dc=Ma(0,0,1);function Rc(t,e){const i=Aa();return Lc[2]=e,t.intersectsPlane(Lc,Dc,i),new v(i[0],i[1])}class Oc extends uc{}function kc(t,{width:e,height:i},n,r){if(r){if(r instanceof Uint8ClampedArray)r=new Uint8Array(r.buffer);else if(r.length!==e*i*n)throw new RangeError("mismatched image size")}else r=new Uint8Array(e*i*n);return t.width=e,t.height=i,t.data=r,t}function Nc(t,e,i){const{width:n,height:r}=e;n===t.width&&r===t.height||(Bc(t,e,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,r)},i),t.width=n,t.height=r,t.data=e.data)}function Bc(t,e,i,n,r,o){if(0===r.width||0===r.height)return e;if(r.width>t.width||r.height>t.height||i.x>t.width-r.width||i.y>t.height-r.height)throw new RangeError("out of range source coordinates for image copy");if(r.width>e.width||r.height>e.height||n.x>e.width-r.width||n.y>e.height-r.height)throw new RangeError("out of range destination coordinates for image copy");const s=t.data,a=e.data;for(let l=0;l<r.height;l++){const c=((i.y+l)*t.width+i.x)*o,u=((n.y+l)*e.width+n.x)*o;for(let t=0;t<r.width*o;t++)a[u+t]=s[c+t]}return e}Yr(Oc,"HeatmapBucket",{omit:["layers"]});class zc{constructor(t,e){kc(this,t,1,e)}resize(t){Nc(this,new zc(t),1)}clone(){return new zc({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,i,n,r){Bc(t,e,i,n,r,1)}}class Fc{constructor(t,e){kc(this,t,4,e)}resize(t){Nc(this,new Fc(t),4)}replace(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t}clone(){return new Fc({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,i,n,r){Bc(t,e,i,n,r,4)}}Yr(zc,"AlphaImage"),Yr(Fc,"RGBAImage");var Vc={paint:new Oo({"heatmap-radius":new Do(te.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Do(te.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Lo(te.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Ro(te.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Lo(te.paint_heatmap["heatmap-opacity"])})};function Uc(t){const e={},i=t.resolution||256,n=t.clips?t.clips.length:1,r=t.image||new Fc({width:i,height:n}),o=(i,n,o)=>{e[t.evaluationKey]=o;const s=t.expression.evaluate(e);r.data[i+n+0]=Math.floor(255*s.r/s.a),r.data[i+n+1]=Math.floor(255*s.g/s.a),r.data[i+n+2]=Math.floor(255*s.b/s.a),r.data[i+n+3]=Math.floor(255*s.a)};if(t.clips)for(let e=0,r=0;e<n;++e,r+=4*i)for(let n=0,s=0;n<i;n++,s+=4){const a=n/(i-1),{start:l,end:c}=t.clips[e];o(r,s,l*(1-a)+c*a)}else for(let t=0,e=0;t<i;t++,e+=4)o(0,e,t/(i-1));return r}var Gc={paint:new Oo({"hillshade-illumination-direction":new Lo(te.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Lo(te.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Lo(te.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Lo(te.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Lo(te.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Lo(te.paint_hillshade["hillshade-accent-color"])})};const jc=Fo([{name:"a_pos",components:2,type:"Int16"}],4),{members:Hc}=jc;var Wc={exports:{}};function qc(t,e,i){i=i||2;var n,r,o,s,a,l,c,u=e&&e.length,h=u?e[0]*i:t.length,p=Xc(t,0,h,i,!0),d=[];if(!p||p.next===p.prev)return d;if(u&&(p=function(t,e,i,n){var r,o,s,a=[];for(r=0,o=e.length;r<o;r++)(s=Xc(t,e[r]*n,r<o-1?e[r+1]*n:t.length,n,!1))===s.next&&(s.steiner=!0),a.push(ru(s));for(a.sort(tu),r=0;r<a.length;r++)i=eu(a[r],i);return i}(t,e,p,i)),t.length>80*i){n=o=t[0],r=s=t[1];for(var f=i;f<h;f+=i)(a=t[f])<n&&(n=a),(l=t[f+1])<r&&(r=l),a>o&&(o=a),l>s&&(s=l);c=0!==(c=Math.max(o-n,s-r))?32767/c:0}return Yc(p,d,i,n,r,c,0),d}function Xc(t,e,i,n,r){var o,s;if(r===yu(t,e,i,n)>0)for(o=e;o<i;o+=n)s=fu(o,t[o],t[o+1],s);else for(o=i-n;o>=e;o-=n)s=fu(o,t[o],t[o+1],s);return s&&lu(s,s.next)&&(mu(s),s=s.next),s}function Zc(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!lu(n,n.next)&&0!==au(n.prev,n,n.next))n=n.next;else{if(mu(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function Yc(t,e,i,n,r,o,s){if(t){!s&&o&&function(t,e,i,n){var r=t;do{0===r.z&&(r.z=nu(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,i,n,r,o,s,a,l,c=1;do{for(i=t,t=null,o=null,s=0;i;){for(s++,n=i,a=0,e=0;e<c&&(a++,n=n.nextZ);e++);for(l=c;a>0||l>0&&n;)0!==a&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,a--):(r=n,n=n.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;i=n}o.nextZ=null,c*=2}while(s>1)}(r)}(t,n,r,o);for(var a,l,c=t;t.prev!==t.next;)if(a=t.prev,l=t.next,o?Jc(t,n,r,o):Qc(t))e.push(a.i/i|0),e.push(t.i/i|0),e.push(l.i/i|0),mu(t),t=l.next,c=l.next;else if((t=l)===c){s?1===s?Yc(t=Kc(Zc(t),e,i),e,i,n,r,o,2):2===s&&$c(t,e,i,n,r,o):Yc(Zc(t),e,i,n,r,o,1);break}}}function Qc(t){var e=t.prev,i=t,n=t.next;if(au(e,i,n)>=0)return!1;for(var r=e.x,o=i.x,s=n.x,a=e.y,l=i.y,c=n.y,u=r<o?r<s?r:s:o<s?o:s,h=a<l?a<c?a:c:l<c?l:c,p=r>o?r>s?r:s:o>s?o:s,d=a>l?a>c?a:c:l>c?l:c,f=n.next;f!==e;){if(f.x>=u&&f.x<=p&&f.y>=h&&f.y<=d&&ou(r,a,o,l,s,c,f.x,f.y)&&au(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function Jc(t,e,i,n){var r=t.prev,o=t,s=t.next;if(au(r,o,s)>=0)return!1;for(var a=r.x,l=o.x,c=s.x,u=r.y,h=o.y,p=s.y,d=a<l?a<c?a:c:l<c?l:c,f=u<h?u<p?u:p:h<p?h:p,m=a>l?a>c?a:c:l>c?l:c,g=u>h?u>p?u:p:h>p?h:p,y=nu(d,f,e,i,n),v=nu(m,g,e,i,n),_=t.prevZ,x=t.nextZ;_&&_.z>=y&&x&&x.z<=v;){if(_.x>=d&&_.x<=m&&_.y>=f&&_.y<=g&&_!==r&&_!==s&&ou(a,u,l,h,c,p,_.x,_.y)&&au(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,x.x>=d&&x.x<=m&&x.y>=f&&x.y<=g&&x!==r&&x!==s&&ou(a,u,l,h,c,p,x.x,x.y)&&au(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;_&&_.z>=y;){if(_.x>=d&&_.x<=m&&_.y>=f&&_.y<=g&&_!==r&&_!==s&&ou(a,u,l,h,c,p,_.x,_.y)&&au(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;x&&x.z<=v;){if(x.x>=d&&x.x<=m&&x.y>=f&&x.y<=g&&x!==r&&x!==s&&ou(a,u,l,h,c,p,x.x,x.y)&&au(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function Kc(t,e,i){var n=t;do{var r=n.prev,o=n.next.next;!lu(r,o)&&cu(r,n,n.next,o)&&pu(r,o)&&pu(o,r)&&(e.push(r.i/i|0),e.push(n.i/i|0),e.push(o.i/i|0),mu(n),mu(n.next),n=t=o),n=n.next}while(n!==t);return Zc(n)}function $c(t,e,i,n,r,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&su(s,a)){var l=du(s,a);return s=Zc(s,s.next),l=Zc(l,l.next),Yc(s,e,i,n,r,o,0),void Yc(l,e,i,n,r,o,0)}a=a.next}s=s.next}while(s!==t)}function tu(t,e){return t.x-e.x}function eu(t,e){var i=function(t,e){var i,n=e,r=t.x,o=t.y,s=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var a=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=r&&a>s&&(s=a,i=n.x<n.next.x?n:n.next,a===r))return i}n=n.next}while(n!==e);if(!i)return null;var l,c=i,u=i.x,h=i.y,p=1/0;n=i;do{r>=n.x&&n.x>=u&&r!==n.x&&ou(o<h?r:s,o,u,h,o<h?s:r,o,n.x,n.y)&&(l=Math.abs(o-n.y)/(r-n.x),pu(n,t)&&(l<p||l===p&&(n.x>i.x||n.x===i.x&&iu(i,n)))&&(i=n,p=l)),n=n.next}while(n!==c);return i}(t,e);if(!i)return e;var n=du(i,t);return Zc(n,n.next),Zc(i,i.next)}function iu(t,e){return au(t.prev,t,e.prev)<0&&au(e.next,t,t.next)<0}function nu(t,e,i,n,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function ru(t){var e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function ou(t,e,i,n,r,o,s,a){return(r-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(n-a)>=(i-s)*(e-a)&&(i-s)*(o-a)>=(r-s)*(n-a)}function su(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&cu(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(pu(t,e)&&pu(e,t)&&function(t,e){var i=t,n=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&r<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)&&(au(t.prev,t,e.prev)||au(t,e.prev,e))||lu(t,e)&&au(t.prev,t,t.next)>0&&au(e.prev,e,e.next)>0)}function au(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function lu(t,e){return t.x===e.x&&t.y===e.y}function cu(t,e,i,n){var r=hu(au(t,e,i)),o=hu(au(t,e,n)),s=hu(au(i,n,t)),a=hu(au(i,n,e));return r!==o&&s!==a||!(0!==r||!uu(t,i,e))||!(0!==o||!uu(t,n,e))||!(0!==s||!uu(i,t,n))||!(0!==a||!uu(i,e,n))}function uu(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function hu(t){return t>0?1:t<0?-1:0}function pu(t,e){return au(t.prev,t,t.next)<0?au(t,e,t.next)>=0&&au(t,t.prev,e)>=0:au(t,e,t.prev)<0||au(t,t.next,e)<0}function du(t,e){var i=new gu(t.i,t.x,t.y),n=new gu(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,o.next=n,n.prev=o,n}function fu(t,e,i,n){var r=new gu(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function mu(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function gu(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function yu(t,e,i,n){for(var r=0,o=e,s=i-n;o<i;o+=n)r+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return r}Wc.exports=qc,Wc.exports.default=qc,qc.deviation=function(t,e,i,n){var r=e&&e.length,o=Math.abs(yu(t,0,r?e[0]*i:t.length,i));if(r)for(var s=0,a=e.length;s<a;s++)o-=Math.abs(yu(t,e[s]*i,s<a-1?e[s+1]*i:t.length,i));var l=0;for(s=0;s<n.length;s+=3){var c=n[s]*i,u=n[s+1]*i,h=n[s+2]*i;l+=Math.abs((t[c]-t[h])*(t[u+1]-t[c+1])-(t[c]-t[u])*(t[h+1]-t[c+1]))}return 0===o&&0===l?0:Math.abs((l-o)/o)},qc.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},n=0,r=0;r<t.length;r++){for(var o=0;o<t[r].length;o++)for(var s=0;s<e;s++)i.vertices.push(t[r][o][s]);r>0&&i.holes.push(n+=t[r-1].length)}return i};var vu=p(Wc.exports);function _u(t,e,i,n,r){xu(t,e,i||0,n||t.length-1,r||wu)}function xu(t,e,i,n,r){for(;n>i;){if(n-i>600){var o=n-i+1,s=e-i+1,a=Math.log(o),l=.5*Math.exp(2*a/3),c=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1);xu(t,e,Math.max(i,Math.floor(e-s*l/o+c)),Math.min(n,Math.floor(e+(o-s)*l/o+c)),r)}var u=t[e],h=i,p=n;for(bu(t,i,e),r(t[n],u)>0&&bu(t,i,n);h<p;){for(bu(t,h,p),h++,p--;r(t[h],u)<0;)h++;for(;r(t[p],u)>0;)p--}0===r(t[i],u)?bu(t,i,p):bu(t,++p,n),p<=e&&(i=p+1),e<=p&&(n=p-1)}}function bu(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function wu(t,e){return t<e?-1:t>e?1:0}function Au(t,e){const i=t.length;if(i<=1)return[t];const n=[];let r,o;for(let e=0;e<i;e++){const i=q(t[e]);0!==i&&(t[e].area=Math.abs(i),void 0===o&&(o=i<0),o===i<0?(r&&n.push(r),r=[t[e]]):r.push(t[e]))}if(r&&n.push(r),e>1)for(let t=0;t<n.length;t++)n[t].length<=e||(_u(n[t],e,1,n[t].length-1,Eu),n[t]=n[t].slice(0,e));return n}function Eu(t,e){return e.area-t.area}function Su(t,e,i){const n=i.patternDependencies;let r=!1;for(const i of e){const e=i.paint.get(`${t}-pattern`);e.isConstant()||(r=!0);const o=e.constantOr(null);o&&(r=!0,n[o]=!0)}return r}function Mu(t,e,i,n,r){const o=r.patternDependencies;for(const s of e){const e=s.paint.get(`${t}-pattern`).value;if("constant"!==e.kind){let t=e.evaluate({zoom:n},i,{},r.availableImages);t=t&&t.name?t.name:t,o[t]=!0,i.patterns[s.id]=t}}return i}class Tu{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Uo,this.indexArray=new ns,this.indexArray2=new cs,this.programConfigurations=new Qs(t.layers,t.zoom),this.segments=new sa,this.segments2=new sa,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.projection=t.projection}populate(t,e,i,n){this.hasPattern=Su("fill",this.layers,e);const r=this.layers[0].layout.get("fill-sort-key"),o=[];for(const{feature:s,id:a,index:l,sourceLayerIndex:c}of t){const t=this.layers[0]._featureFilter.needGeometry,u=ac(s,t);if(!this.layers[0]._featureFilter.filter(new wo(this.zoom),u,i))continue;const h=r?r.evaluate(u,{},i,e.availableImages):void 0,p={id:a,properties:s.properties,type:s.type,sourceLayerIndex:c,index:l,geometry:t?u.geometry:sc(s,i,n),patterns:{},sortKey:h};o.push(p)}r&&o.sort(((t,e)=>t.sortKey-e.sortKey));for(const n of o){const{geometry:r,index:o,sourceLayerIndex:s}=n;if(this.hasPattern){const t=Mu("fill",this.layers,n,this.zoom,e);this.patternFeatures.push(t)}else this.addFeature(n,r,o,i,{},e.availableImages);e.featureIndex.insert(t[o].feature,r,o,s,this.index)}}update(t,e,i,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i,n)}addFeatures(t,e,i,n,r){for(const t of this.patternFeatures)this.addFeature(t,t.geometry,t.index,e,i,n)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Hc),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,e,i,n,r,o=[]){for(const t of Au(e,500)){let e=0;for(const i of t)e+=i.length;const i=this.segments.prepareSegment(e,this.layoutVertexArray,this.indexArray),n=i.vertexLength,r=[],o=[];for(const e of t){if(0===e.length)continue;e!==t[0]&&o.push(r.length/2);const i=this.segments2.prepareSegment(e.length,this.layoutVertexArray,this.indexArray2),n=i.vertexLength;this.layoutVertexArray.emplaceBack(e[0].x,e[0].y),this.indexArray2.emplaceBack(n+e.length-1,n),r.push(e[0].x),r.push(e[0].y);for(let t=1;t<e.length;t++)this.layoutVertexArray.emplaceBack(e[t].x,e[t].y),this.indexArray2.emplaceBack(n+t-1,n+t),r.push(e[t].x),r.push(e[t].y);i.vertexLength+=e.length,i.primitiveLength+=e.length}const s=vu(r,o);for(let t=0;t<s.length;t+=3)this.indexArray.emplaceBack(n+s[t],n+s[t+1],n+s[t+2]);i.vertexLength+=e,i.primitiveLength+=s.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,r,o,n)}}Yr(Tu,"FillBucket",{omit:["layers","patternFeatures"]});const Iu=new Oo({"fill-sort-key":new Do(te.layout_fill["fill-sort-key"])});var Cu={paint:new Oo({"fill-antialias":new Lo(te.paint_fill["fill-antialias"]),"fill-opacity":new Do(te.paint_fill["fill-opacity"]),"fill-color":new Do(te.paint_fill["fill-color"]),"fill-outline-color":new Do(te.paint_fill["fill-outline-color"]),"fill-translate":new Lo(te.paint_fill["fill-translate"]),"fill-translate-anchor":new Lo(te.paint_fill["fill-translate-anchor"]),"fill-pattern":new Do(te.paint_fill["fill-pattern"])}),layout:Iu};const Pu=Fo([{name:"a_pos_normal_ed",components:4,type:"Int16"}]),Lu=Fo([{name:"a_centroid_pos",components:2,type:"Uint16"}]),Du=Fo([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]),{members:Ru}=Pu;var Ou={},ku=g,Nu=Bu;function Bu(t,e,i,n,r){this.properties={},this.extent=i,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=r,t.readFields(zu,this,e)}function zu(t,e,i){1==t?e.id=i.readVarint():2==t?function(t,e){for(var i=t.readVarint()+t.pos;t.pos<i;){var n=e._keys[t.readVarint()],r=e._values[t.readVarint()];e.properties[n]=r}}(i,e):3==t?e.type=i.readVarint():4==t&&(e._geometry=i.pos)}function Fu(t){for(var e,i,n=0,r=0,o=t.length,s=o-1;r<o;s=r++)n+=((i=t[s]).x-(e=t[r]).x)*(e.y+i.y);return n}Bu.types=["Unknown","Point","LineString","Polygon"],Bu.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,i=t.readVarint()+t.pos,n=1,r=0,o=0,s=0,a=[];t.pos<i;){if(r<=0){var l=t.readVarint();n=7&l,r=l>>3}if(r--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&a.push(e),e=[]),e.push(new ku(o,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&a.push(e),a},Bu.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,i=1,n=0,r=0,o=0,s=1/0,a=-1/0,l=1/0,c=-1/0;t.pos<e;){if(n<=0){var u=t.readVarint();i=7&u,n=u>>3}if(n--,1===i||2===i)(r+=t.readSVarint())<s&&(s=r),r>a&&(a=r),(o+=t.readSVarint())<l&&(l=o),o>c&&(c=o);else if(7!==i)throw new Error("unknown command "+i)}return[s,l,a,c]},Bu.prototype.toGeoJSON=function(t,e,i){var n,r,o=this.extent*Math.pow(2,i),s=this.extent*t,a=this.extent*e,l=this.loadGeometry(),c=Bu.types[this.type];function u(t){for(var e=0;e<t.length;e++){var i=t[e];t[e]=[360*(i.x+s)/o-180,360/Math.PI*Math.atan(Math.exp((180-360*(i.y+a)/o)*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(n=0;n<l.length;n++)h[n]=l[n][0];u(l=h);break;case 2:for(n=0;n<l.length;n++)u(l[n]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var i,n,r=[],o=0;o<e;o++){var s=Fu(t[o]);0!==s&&(void 0===n&&(n=s<0),n===s<0?(i&&r.push(i),i=[t[o]]):i.push(t[o]))}return i&&r.push(i),r}(l),n=0;n<l.length;n++)for(r=0;r<l[n].length;r++)u(l[n][r])}1===l.length?l=l[0]:c="Multi"+c;var p={type:"Feature",geometry:{type:c,coordinates:l},properties:this.properties};return"id"in this&&(p.id=this.id),p};var Vu=Nu,Uu=Gu;function Gu(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(ju,this,e),this.length=this._features.length}function ju(t,e,i){15===t?e.version=i.readVarint():1===t?e.name=i.readString():5===t?e.extent=i.readVarint():2===t?e._features.push(i.pos):3===t?e._keys.push(i.readString()):4===t&&e._values.push(function(t){for(var e=null,i=t.readVarint()+t.pos;t.pos<i;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(i))}Gu.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new Vu(this._pbf,e,this.extent,this._keys,this._values)};var Hu=Uu;function Wu(t,e,i){if(3===t){var n=new Hu(i,i.readVarint()+i.pos);n.length&&(e[n.name]=n)}}var qu=Ou.VectorTile=function(t,e){this.layers=t.readFields(Wu,{},e)},Xu=Ou.VectorTileFeature=Nu;function Zu(t,e,i,n){const r=[],o=0===n?(t,e,i,n,r,o)=>{t.push(new v(o,i+(o-e)/(n-e)*(r-i)))}:(t,e,i,n,r,o)=>{t.push(new v(e+(o-i)/(r-i)*(n-e),o))};for(const s of t){const t=[];for(const r of s){if(r.length<=2)continue;const s=[];for(let t=0;t<r.length-1;t++){const a=r[t].x,l=r[t].y,c=r[t+1].x,u=r[t+1].y,h=0===n?a:l,p=0===n?c:u;h<e?p>e&&o(s,a,l,c,u,e):h>i?p<i&&o(s,a,l,c,u,i):s.push(r[t]),p<e&&h>=e&&o(s,a,l,c,u,e),p>i&&h<=i&&o(s,a,l,c,u,i)}let a=r[r.length-1];const l=0===n?a.x:a.y;l>=e&&l<=i&&s.push(a),s.length&&(a=s[s.length-1],s[0].x===a.x&&s[0].y===a.y||s.push(s[0]),t.push(s))}t.length&&r.push(t)}return r}Ou.VectorTileLayer=Uu;const Yu=Xu.types,Qu=Math.pow(2,13);function Ju(t,e,i,n,r,o,s,a){t.emplaceBack((e<<1)+s,(i<<1)+o,(Math.floor(n*Qu)<<1)+r,Math.round(a))}function Ku(t,e,i){const n=16384;t.emplaceBack(e.x,e.y,e.z,i[0]*n,i[1]*n,i[2]*n)}class $u{constructor(){this.acc=new v(0,0),this.polyCount=[]}startRing(t){this.currentPolyCount={edges:0,top:0},this.polyCount.push(this.currentPolyCount),this.min||(this.min=new v(t.x,t.y),this.max=new v(t.x,t.y))}append(t,e){this.currentPolyCount.edges++,this.acc._add(t);const i=this.min,n=this.max;t.x<i.x?i.x=t.x:t.x>n.x&&(n.x=t.x),t.y<i.y?i.y=t.y:t.y>n.y&&(n.y=t.y),((0===t.x||t.x===aa)&&t.x===e.x)!=((0===t.y||t.y===aa)&&t.y===e.y)&&this.processBorderOverlap(t,e),e.x<0!=t.x<0&&this.addBorderIntersection(0,Li(e.y,t.y,(0-e.x)/(t.x-e.x))),e.x>aa!=t.x>aa&&this.addBorderIntersection(1,Li(e.y,t.y,(aa-e.x)/(t.x-e.x))),e.y<0!=t.y<0&&this.addBorderIntersection(2,Li(e.x,t.x,(0-e.y)/(t.y-e.y))),e.y>aa!=t.y>aa&&this.addBorderIntersection(3,Li(e.x,t.x,(aa-e.y)/(t.y-e.y)))}addBorderIntersection(t,e){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 i=this.borders[t];e<i[0]&&(i[0]=e),e>i[1]&&(i[1]=e)}processBorderOverlap(t,e){if(t.x===e.x){if(t.y===e.y)return;const i=0===t.x?0:1;this.addBorderIntersection(i,e.y),this.addBorderIntersection(i,t.y)}else{const i=0===t.y?2:3;this.addBorderIntersection(i,e.x),this.addBorderIntersection(i,t.x)}}centroid(){const t=this.polyCount.reduce(((t,e)=>t+e.edges),0);return 0!==t?this.acc.div(t)._round():new v(0,0)}span(){return new v(this.max.x-this.min.x,this.max.y-this.min.y)}intersectsCount(){return this.borders.reduce(((t,e)=>t+ +(e[0]!==Number.MAX_VALUE)),0)}}class th{constructor(t){this.zoom=t.zoom,this.canonical=t.canonical,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=t.projection,this.layoutVertexArray=new jo,this.centroidVertexArray=new ws,this.indexArray=new ns,this.programConfigurations=new Qs(t.layers,t.zoom),this.segments=new sa,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.enableTerrain=t.enableTerrain}populate(t,e,i,n){this.features=[],this.hasPattern=Su("fill-extrusion",this.layers,e),this.featuresOnBorder=[],this.borders=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.tileToMeter=function(t){const e=Math.exp(Math.PI*(1-t.y/(1<<t.z)*2));return 80150034*e/(e*e+1)/aa/(1<<t.z)}(i),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter;for(const{feature:r,id:o,index:s,sourceLayerIndex:a}of t){const t=this.layers[0]._featureFilter.needGeometry,l=ac(r,t);if(!this.layers[0]._featureFilter.filter(new wo(this.zoom),l,i))continue;const c={id:o,sourceLayerIndex:a,index:s,geometry:t?l.geometry:sc(r,i,n),properties:r.properties,type:r.type,patterns:{}},u=this.layoutVertexArray.length;this.hasPattern?this.features.push(Mu("fill-extrusion",this.layers,c,this.zoom,e)):this.addFeature(c,c.geometry,s,i,{},e.availableImages,n),e.featureIndex.insert(r,c.geometry,s,a,this.index,u)}this.sortBorders()}addFeatures(t,e,i,n,r){for(const t of this.features){const{geometry:o}=t;this.addFeature(t,o,t.index,e,i,n,r)}this.sortBorders()}update(t,e,i,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i,n)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ru),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=t.createVertexBuffer(this.layoutVertexExtArray,Du.members,!0))),this.programConfigurations.upload(t),this.uploaded=!0}uploadCentroid(t){0!==this.centroidVertexArray.length&&(this.centroidVertexBuffer?this.needsCentroidUpdate&&this.centroidVertexBuffer.updateData(this.centroidVertexArray):this.centroidVertexBuffer=t.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(t,e,i,n,r,o,s){const a=[new v(0,0),new v(aa,aa)],l=s.projection,c="globe"===l.name,u=this.enableTerrain&&!c?new $u:null,h="Polygon"===Yu[t.type];c&&!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new Zo);const p=Au(e,500);for(let t=p.length-1;t>=0;t--){const e=p[t];(0===e.length||(d=e[0]).every((t=>t.x<=0))||d.every((t=>t.x>=aa))||d.every((t=>t.y<=0))||d.every((t=>t.y>=aa)))&&p.splice(t,1)}var d;let f;if(c)f=lh(p,a,n);else{f=[];for(const t of p)f.push({polygon:t,bounds:a})}const m=h?this.edgeRadius:0;for(const{polygon:t,bounds:e}of f){let i=0,r=0;for(const e of t)h&&!e[0].equals(e[e.length-1])&&e.push(e[0]),r+=h?e.length-1:e.length;const o=this.segments.prepareSegment((h?5:4)*r,this.layoutVertexArray,this.indexArray);if(h){const e=[],r=[];i=o.vertexLength;for(const i of t){let s,a;i.length&&i!==t[0]&&r.push(e.length/2),s=i[1].sub(i[0])._perp()._unit();for(let t=1;t<i.length;t++){const r=i[t],u=i[t===i.length-1?1:t+1];let{x:h,y:p}=r;if(m){a=u.sub(r)._perp()._unit();const t=s.add(a)._unit(),e=m*Math.min(4,1/(s.x*t.x+s.y*t.y));h+=e*t.x,p+=e*t.y,s=a}Ju(this.layoutVertexArray,h,p,0,0,1,1,0),o.vertexLength++,e.push(r.x,r.y),c&&Ku(this.layoutVertexExtArray,l.projectTilePoint(h,p,n),l.upVector(n,h,p))}}const s=vu(e,r);for(let t=0;t<s.length;t+=3)this.indexArray.emplaceBack(i+s[t],i+s[t+2],i+s[t+1]),o.primitiveLength++}for(const r of t){u&&r.length&&u.startRing(r[0]);let t,s,a,p=r.length>4&&oh(r[r.length-2],r[0],r[1]),d=m?ih(r[r.length-2],r[0],r[1],m):0;s=r[1].sub(r[0])._perp()._unit();let f=!0;for(let g=1,y=0;g<r.length;g++){let v=r[g-1],_=r[g];const x=r[g===r.length-1?1:g+1];if(u&&h&&u.currentPolyCount.top++,rh(_,v,e)){m&&(s=x.sub(_)._perp()._unit(),f=!f);continue}u&&u.append(_,v);const b=_.sub(v)._perp(),w=b.x/(Math.abs(b.x)+Math.abs(b.y)),A=b.y>0?1:0,E=v.dist(_);if(y+E>32768&&(y=0),m){a=x.sub(_)._perp()._unit();let t=nh(v,_,x,eh(s,a),m);isNaN(t)&&(t=0);const e=_.sub(v)._unit();v=v.add(e.mult(d))._round(),_=_.add(e.mult(-t))._round(),d=t,s=a}const S=o.vertexLength,M=r.length>4&&oh(v,_,x);let T=sh(y,p,f);if(Ju(this.layoutVertexArray,v.x,v.y,w,A,0,0,T),Ju(this.layoutVertexArray,v.x,v.y,w,A,0,1,T),y+=E,T=sh(y,M,!f),p=M,Ju(this.layoutVertexArray,_.x,_.y,w,A,0,0,T),Ju(this.layoutVertexArray,_.x,_.y,w,A,0,1,T),o.vertexLength+=4,this.indexArray.emplaceBack(S+0,S+1,S+2),this.indexArray.emplaceBack(S+1,S+3,S+2),o.primitiveLength+=2,m){const n=i+(1===g?r.length-2:g-2),s=1===g?i:n+1;if(this.indexArray.emplaceBack(S+1,n,S+3),this.indexArray.emplaceBack(n,s,S+3),o.primitiveLength+=2,void 0===t&&(t=S),!rh(x,r[g],e)){const e=g===r.length-1?t:o.vertexLength;this.indexArray.emplaceBack(S+2,S+3,e),this.indexArray.emplaceBack(S+3,e+1,e),this.indexArray.emplaceBack(S+3,s,e+1),o.primitiveLength+=3}f=!f}if(c){const t=this.layoutVertexExtArray,e=l.projectTilePoint(v.x,v.y,n),i=l.projectTilePoint(_.x,_.y,n),r=l.upVector(n,v.x,v.y),o=l.upVector(n,_.x,_.y);Ku(t,e,r),Ku(t,e,r),Ku(t,i,o),Ku(t,i,o)}}h&&(i+=r.length-1)}}if(u&&u.polyCount.length>0){if(u.borders){u.vertexArrayOffset=this.centroidVertexArray.length;const t=u.borders,e=this.featuresOnBorder.push(u)-1;for(let i=0;i<4;i++)t[i][0]!==Number.MAX_VALUE&&this.borders[i].push(e)}this.encodeCentroid(u.borders?void 0:u.centroid(),u)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,r,o,n)}sortBorders(){for(let t=0;t<4;t++)this.borders[t].sort(((e,i)=>this.featuresOnBorder[e].borders[t][0]-this.featuresOnBorder[i].borders[t][0]))}encodeCentroid(t,e,i=!0){let n,r;if(t)if(0!==t.y){const i=e.span()._mult(this.tileToMeter);n=(Math.max(t.x,1)<<3)+Math.min(7,Math.round(i.x/10)),r=(Math.max(t.y,1)<<3)+Math.min(7,Math.round(i.y/10))}else n=Math.ceil(7*(t.x+450)),r=0;else n=0,r=+i;let o=i?this.centroidVertexArray.length:e.vertexArrayOffset;for(const t of e.polyCount){i&&this.centroidVertexArray.resize(this.centroidVertexArray.length+4*t.edges+t.top);for(let e=0;e<t.top;e++)this.centroidVertexArray.emplace(o++,n,r);for(let e=0;e<2*t.edges;e++)this.centroidVertexArray.emplace(o++,0,r),this.centroidVertexArray.emplace(o++,n,r)}}}function eh(t,e){const i=t.add(e)._unit();return t.x*i.x+t.y*i.y}function ih(t,e,i,n){const r=e.sub(t)._perp()._unit(),o=i.sub(e)._perp()._unit();return nh(t,e,i,eh(r,o),n)}function nh(t,e,i,n,r){const o=Math.sqrt(1-n*n);return Math.min(t.dist(e)/3,e.dist(i)/3,r*o/n)}function rh(t,e,i){return t.x<i[0].x&&e.x<i[0].x||t.x>i[1].x&&e.x>i[1].x||t.y<i[0].y&&e.y<i[0].y||t.y>i[1].y&&e.y>i[1].y}function oh(t,e,i){if(t.x<0||t.x>=aa||e.x<0||e.x>=aa||i.x<0||i.x>=aa)return!1;const n=i.sub(e),r=n.perp(),o=t.sub(e);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&&r.x*o.x+r.y*o.y<0}function sh(t,e,i){const n=e?2|t:-3&t;return i?1|n:-2&n}function ah(){const t=Math.PI/32,e=Math.tan(t),i=Fl;return i*Math.sqrt(1+2*e*e)-i}function lh(t,e,i){const n=1<<i.z,r=Xl(i.x/n),o=Xl((i.x+1)/n),s=Zl(i.y/n),a=Zl((i.y+1)/n);return function(t,e,i,n,r=0,o){const s=[];if(!t.length||!i||!n)return s;const a=(t,e)=>{for(const i of t)s.push({polygon:i,bounds:e})},l=Math.ceil(Math.log2(i)),c=Math.ceil(Math.log2(n)),u=l-c,h=[];for(let t=0;t<Math.abs(u);t++)h.push(u>0?0:1);for(let t=0;t<Math.min(l,c);t++)h.push(0),h.push(1);let p=t;if(p=Zu(p,e[0].y-r,e[1].y+r,1),p=Zu(p,e[0].x-r,e[1].x+r,0),!p.length)return s;const d=[];for(h.length?d.push({polygons:p,bounds:e,depth:0}):a(p,e);d.length;){const t=d.pop(),e=t.depth,i=h[e],n=t.bounds[0],s=t.bounds[1],l=0===i?n.x:n.y,c=0===i?s.x:s.y,u=o?o(i,l,c):.5*(l+c),p=Zu(t.polygons,l-r,u+r,i),f=Zu(t.polygons,u-r,c+r,i);if(p.length){const t=[n,new v(0===i?u:s.x,1===i?u:s.y)];h.length>e+1?d.push({polygons:p,bounds:t,depth:e+1}):a(p,t)}if(f.length){const t=[new v(0===i?u:n.x,1===i?u:n.y),s];h.length>e+1?d.push({polygons:f,bounds:t,depth:e+1}):a(f,t)}}return s}(t,e,Math.ceil((o-r)/11.25),Math.ceil((s-a)/11.25),1,((t,e,r)=>{if(0===t)return.5*(e+r);{const t=Zl((i.y+e/aa)/n);return(Wl(.5*(Zl((i.y+r/aa)/n)+t))*n-i.y)*aa}}))}Yr(th,"FillExtrusionBucket",{omit:["layers","features"]}),Yr($u,"PartMetadata");const ch=new Oo({"fill-extrusion-edge-radius":new Lo(te["layout_fill-extrusion"]["fill-extrusion-edge-radius"])});var uh={paint:new Oo({"fill-extrusion-opacity":new Lo(te["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Do(te["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Lo(te["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Lo(te["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Do(te["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Do(te["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Do(te["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Lo(te["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new Lo(te["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new Lo(te["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-rounded-roof":new Lo(te["paint_fill-extrusion"]["fill-extrusion-rounded-roof"])}),layout:ch};function hh(t,e,i){var n=2*Math.PI*6378137/256/Math.pow(2,i);return[t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}class ph{constructor(t,e,i){this.z=t,this.x=e,this.y=i,this.key=mh(0,t,t,e,i)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,e){const i=function(t,e,i){var n=hh(256*t,256*(e=Math.pow(2,i)-e-1),i),r=hh(256*(t+1),256*(e+1),i);return n[0]+","+n[1]+","+r[0]+","+r[1]}(this.x,this.y,this.z),n=function(t,e,i){let n,r="";for(let o=t;o>0;o--)n=1<<o-1,r+=(e&n?1:0)+(i&n?2:0);return r}(this.z,this.x,this.y);return t[(this.x+this.y)%t.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"===e?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",n).replace("{bbox-epsg-3857}",i)}toString(){return`${this.z}/${this.x}/${this.y}`}}class dh{constructor(t,e){this.wrap=t,this.canonical=e,this.key=mh(t,e.z,e.z,e.x,e.y)}}class fh{constructor(t,e,i,n,r){this.overscaledZ=t,this.wrap=e,this.canonical=new ph(i,+n,+r),this.key=0===e&&t===i?this.canonical.key:mh(e,t,i,n,r)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){const e=this.canonical.z-t;return t>this.canonical.z?new fh(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new fh(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)}calculateScaledKey(t,e=!0){if(this.overscaledZ===t&&e)return this.key;if(t>this.canonical.z)return mh(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y);{const i=this.canonical.z-t;return mh(this.wrap*+e,t,t,this.canonical.x>>i,this.canonical.y>>i)}}isChildOf(t){if(t.wrap!==this.wrap)return!1;const e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e}children(t){if(this.overscaledZ>=t)return[new fh(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const e=this.canonical.z+1,i=2*this.canonical.x,n=2*this.canonical.y;return[new fh(e,this.wrap,e,i,n),new fh(e,this.wrap,e,i+1,n),new fh(e,this.wrap,e,i,n+1),new fh(e,this.wrap,e,i+1,n+1)]}isLessThan(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))}wrapped(){return new fh(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new fh(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new dh(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}}function mh(t,e,i,n,r){const o=1<<Math.min(i,22);let s=o*(r%o)+n%o;return t&&i<22&&(s+=o*o*((t<0?-2*t-1:2*t)%(1<<2*(22-i)))),16*(32*s+i)+(e-i)}Yr(ph,"CanonicalTileID"),Yr(fh,"OverscaledTileID",{omit:["projMatrix"]});class gh extends v{constructor(t,e,i){super(t,e),this.z=i}}function yh(t,e){return t.x*e.x+t.y*e.y}function vh(t,e){if(1===t.length){let i=0;const n=e[i++];let r;for(;!r||n.equals(r);)if(r=e[i++],!r)return 1/0;for(;i<e.length;i++){const o=e[i],s=t[0],a=r.sub(n),l=o.sub(n),c=s.sub(n),u=yh(a,a),h=yh(a,l),p=yh(l,l),d=yh(c,a),f=yh(c,l),m=u*p-h*h,g=(p*d-h*f)/m,y=(u*f-h*d)/m,v=n.z*(1-g-y)+r.z*g+o.z*y;if(isFinite(v))return v}return 1/0}{let t=1/0;for(const i of e)t=Math.min(t,i.z);return t}}function _h(t,e,i,n,r,o,s,a){const l=s*r.getElevationAt(t,e,!0,!0),c=0!==o[0],u=c?0===o[1]?s*(o[0]/7-450):s*function(t,e,i){const n=Math.floor(e[0]/8),r=Math.floor(e[1]/8),o=10*(e[0]-8*n),s=10*(e[1]-8*r),a=t.getElevationAt(n,r,!0,!0),l=t.getMeterToDEM(i),c=Math.floor(.5*(o*l-1)),u=Math.floor(.5*(s*l-1)),h=t.tileCoordToPixel(n,r),p=2*c+1,d=2*u+1,f=function(t,e,i,n,r){return[t.getElevationAtPixel(e,i,!0),t.getElevationAtPixel(e+r,i,!0),t.getElevationAtPixel(e,i+r,!0),t.getElevationAtPixel(e+n,i+r,!0)]}(t,h.x-c,h.y-u,p,d),m=Math.abs(f[0]-f[1]),g=Math.abs(f[2]-f[3]),y=Math.abs(f[0]-f[2])+Math.abs(f[1]-f[3]),v=Math.min(.25,.5*l*(m+g)/p),_=Math.min(.25,.5*l*y/d);return a+Math.max(v*o,_*s)}(r,o,a):l;return{base:l+(0===i)?-1:i,top:c?Math.max(u+n,l+i+2):l+n}}const xh=Fo([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_linesofar",components:1,type:"Float32"}],4),{members:bh}=xh,wh=Fo([{name:"a_packed",components:4,type:"Float32"}]),{members:Ah}=wh,Eh=Xu.types,Sh=Math.cos(Math.PI/180*37.5);class Mh{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.projection=t.projection,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((t=>{this.gradients[t.id]={}})),this.layoutVertexArray=new Ho,this.layoutVertexArray2=new Wo,this.indexArray=new ns,this.programConfigurations=new Qs(t.layers,t.zoom),this.segments=new sa,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,i,n){this.hasPattern=Su("line",this.layers,e);const r=this.layers[0].layout.get("line-sort-key"),o=[];for(const{feature:e,id:s,index:a,sourceLayerIndex:l}of t){const t=this.layers[0]._featureFilter.needGeometry,c=ac(e,t);if(!this.layers[0]._featureFilter.filter(new wo(this.zoom),c,i))continue;const u=r?r.evaluate(c,{},i):void 0,h={id:s,properties:e.properties,type:e.type,sourceLayerIndex:l,index:a,geometry:t?c.geometry:sc(e,i,n),patterns:{},sortKey:u};o.push(h)}r&&o.sort(((t,e)=>t.sortKey-e.sortKey));const{lineAtlas:s,featureIndex:a}=e,l=this.addConstantDashes(s);for(const n of o){const{geometry:r,index:o,sourceLayerIndex:c}=n;if(l&&this.addFeatureDashes(n,s),this.hasPattern){const t=Mu("line",this.layers,n,this.zoom,e);this.patternFeatures.push(t)}else this.addFeature(n,r,o,i,s.positions,e.availableImages);a.insert(t[o].feature,r,o,c,this.index)}}addConstantDashes(t){let e=!1;for(const i of this.layers){const n=i.paint.get("line-dasharray").value,r=i.layout.get("line-cap").value;if("constant"!==n.kind||"constant"!==r.kind)e=!0;else{const e=r.value,i=n.value;if(!i)continue;t.addDash(i,e)}}return e}addFeatureDashes(t,e){const i=this.zoom;for(const n of this.layers){const r=n.paint.get("line-dasharray").value,o=n.layout.get("line-cap").value;if("constant"===r.kind&&"constant"===o.kind)continue;let s,a;if("constant"===r.kind){if(s=r.value,!s)continue}else s=r.evaluate({zoom:i},t);a="constant"===o.kind?o.value:o.evaluate({zoom:i},t),e.addDash(s,a),t.patterns[n.id]=e.getKey(s,a)}}update(t,e,i,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i,n)}addFeatures(t,e,i,n,r){for(const t of this.patternFeatures)this.addFeature(t,t.geometry,t.index,e,i,n)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,Ah)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,bh),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&t.properties.hasOwnProperty("mapbox_clip_start")&&t.properties.hasOwnProperty("mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}addFeature(t,e,i,n,r,o){const s=this.layers[0].layout,a=s.get("line-join").evaluate(t,{}),l=s.get("line-cap").evaluate(t,{}),c=s.get("line-miter-limit"),u=s.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(const i of e)this.addLine(i,t,a,l,c,u);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,r,o,n)}addLine(t,e,i,n,r,o){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineSoFar=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let e=0;e<t.length-1;e++)this.totalDistance+=t[e].dist(t[e+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const s="Polygon"===Eh[e.type];let a=t.length;for(;a>=2&&t[a-1].equals(t[a-2]);)a--;let l=0;for(;l<a-1&&t[l].equals(t[l+1]);)l++;if(a<(s?3:2))return;"bevel"===i&&(r=1.05);const c=this.overscaling<=16?15*aa/(512*this.overscaling):0,u=this.segments.prepareSegment(10*a,this.layoutVertexArray,this.indexArray);let h,p,d,f,m;this.e1=this.e2=-1,s&&(h=t[a-2],m=t[l].sub(h)._unit()._perp());for(let e=l;e<a;e++){if(d=e===a-1?s?t[l+1]:void 0:t[e+1],d&&t[e].equals(d))continue;m&&(f=m),h&&(p=h),h=t[e],m=d?d.sub(h)._unit()._perp():f,f=f||m;let g=f.add(m);0===g.x&&0===g.y||g._unit();const y=f.x*m.x+f.y*m.y,v=g.x*m.x+g.y*m.y,_=0!==v?1/v:1/0,x=2*Math.sqrt(2-2*v),b=v<Sh&&p&&d,w=f.x*m.y-f.y*m.x>0;if(b&&e>l){const t=h.dist(p);if(t>2*c){const e=h.sub(h.sub(p)._mult(c/t)._round());this.updateDistance(p,e),this.addCurrentVertex(e,f,0,0,u),p=e}}const A=p&&d;let E=A?i:s?"butt":n;if(A&&"round"===E&&(_<o?E="miter":_<=2&&(E="fakeround")),"miter"===E&&_>r&&(E="bevel"),"bevel"===E&&(_>2&&(E="flipbevel"),_<r&&(E="miter")),p&&this.updateDistance(p,h),"miter"===E)g._mult(_),this.addCurrentVertex(h,g,0,0,u);else if("flipbevel"===E){if(_>100)g=m.mult(-1);else{const t=_*f.add(m).mag()/f.sub(m).mag();g._perp()._mult(t*(w?-1:1))}this.addCurrentVertex(h,g,0,0,u),this.addCurrentVertex(h,g.mult(-1),0,0,u)}else if("bevel"===E||"fakeround"===E){const t=-Math.sqrt(_*_-1),e=w?t:0,i=w?0:t;if(p&&this.addCurrentVertex(h,f,e,i,u),"fakeround"===E){const t=Math.round(180*x/Math.PI/20);for(let e=1;e<t;e++){let i=e/t;if(.5!==i){const t=i-.5;i+=i*t*(i-1)*((1.0904+y*(y*(3.55645-1.43519*y)-3.2452))*t*t+(.848013+y*(.215638*y-1.06021)))}const n=m.sub(f)._mult(i)._add(f)._unit()._mult(w?-1:1);this.addHalfVertex(h,n.x,n.y,!1,w,0,u)}}d&&this.addCurrentVertex(h,m,-e,-i,u)}else if("butt"===E)this.addCurrentVertex(h,g,0,0,u);else if("square"===E){const t=p?1:-1;p||this.addCurrentVertex(h,g,t,t,u),this.addCurrentVertex(h,g,0,0,u),p&&this.addCurrentVertex(h,g,t,t,u)}else"round"===E&&(p&&(this.addCurrentVertex(h,f,0,0,u),this.addCurrentVertex(h,f,1,1,u,!0)),d&&(this.addCurrentVertex(h,m,-1,-1,u,!0),this.addCurrentVertex(h,m,0,0,u)));if(b&&e<a-1){const t=h.dist(d);if(t>2*c){const e=h.add(d.sub(h)._mult(c/t)._round());this.updateDistance(h,e),this.addCurrentVertex(e,m,0,0,u),h=e}}}}addCurrentVertex(t,e,i,n,r,o=!1){const s=e.y*n-e.x,a=-e.y-e.x*n;this.addHalfVertex(t,e.x+e.y*i,e.y-e.x*i,o,!1,i,r),this.addHalfVertex(t,s,a,o,!0,-n,r)}addHalfVertex({x:t,y:e},i,n,r,o,s,a){this.layoutVertexArray.emplaceBack((t<<1)+(r?1:0),(e<<1)+(o?1:0),Math.round(63*i)+128,Math.round(63*n)+128,1+(0===s?0:s<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineClips.start,this.lineClips.end);const l=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,l),a.primitiveLength++),o?this.e2=l:this.e1=l}updateScaledDistance(){if(this.lineClips){const t=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=t*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(t,e){this.distance+=t.dist(e),this.updateScaledDistance()}}Yr(Mh,"LineBucket",{omit:["layers","patternFeatures"]});const Th=new Oo({"line-cap":new Do(te.layout_line["line-cap"]),"line-join":new Do(te.layout_line["line-join"]),"line-miter-limit":new Lo(te.layout_line["line-miter-limit"]),"line-round-limit":new Lo(te.layout_line["line-round-limit"]),"line-sort-key":new Do(te.layout_line["line-sort-key"])});var Ih={paint:new Oo({"line-opacity":new Do(te.paint_line["line-opacity"]),"line-color":new Do(te.paint_line["line-color"]),"line-translate":new Lo(te.paint_line["line-translate"]),"line-translate-anchor":new Lo(te.paint_line["line-translate-anchor"]),"line-width":new Do(te.paint_line["line-width"]),"line-gap-width":new Do(te.paint_line["line-gap-width"]),"line-offset":new Do(te.paint_line["line-offset"]),"line-blur":new Do(te.paint_line["line-blur"]),"line-dasharray":new Do(te.paint_line["line-dasharray"]),"line-pattern":new Do(te.paint_line["line-pattern"]),"line-gradient":new Ro(te.paint_line["line-gradient"]),"line-trim-offset":new Lo(te.paint_line["line-trim-offset"])}),layout:Th};const Ch=new class extends Do{possiblyEvaluate(t,e){return e=new wo(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,i,n){return e=D({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,i,n)}}(Ih.paint.properties["line-width"].specification);function Ph(t,e){return e>0?e+2*t:t}Ch.useIntegerZoom=!0;const Lh=Fo([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Dh=Fo([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),Rh=Fo([{name:"a_projected_pos",components:4,type:"Float32"}],4);Fo([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Oh=Fo([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),kh=Fo([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"}]);Fo([{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 Nh=Fo([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Bh=Fo([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);Fo([{name:"triangle",components:3,type:"Uint16"}]),Fo([{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"}]),Fo([{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"}]),Fo([{type:"Float32",name:"offsetX"}]),Fo([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var zh=24;const Fh=128;function Vh(t,e){const{expression:i}=e;if("constant"===i.kind)return{kind:"constant",layoutSize:i.evaluate(new wo(t+1))};if("source"===i.kind)return{kind:"source"};{const{zoomStops:e,interpolationType:n}=i;let r=0;for(;r<e.length&&e[r]<=t;)r++;r=Math.max(0,r-1);let o=r;for(;o<e.length&&e[o]<t+1;)o++;o=Math.min(e.length-1,o);const s=e[r],a=e[o];return"composite"===i.kind?{kind:"composite",minZoom:s,maxZoom:a,interpolationType:n}:{kind:"camera",minZoom:s,maxZoom:a,minSize:i.evaluate(new wo(s)),maxSize:i.evaluate(new wo(a)),interpolationType:n}}}function Uh(t,{uSize:e,uSizeT:i},{lowerSize:n,upperSize:r}){return"source"===t.kind?n/Fh:"composite"===t.kind?Li(n/Fh,r/Fh,i):e}function Gh(t,e){let i=0,n=0;if("constant"===t.kind)n=t.layoutSize;else if("source"!==t.kind){const{interpolationType:r,minZoom:o,maxZoom:s}=t,a=r?T($i.interpolationFactor(r,e,o,s),0,1):0;"camera"===t.kind?n=Li(t.minSize,t.maxSize,a):i=a}return{uSizeT:i,uSize:n}}var jh=Object.freeze({__proto__:null,SIZE_PACK_FACTOR:Fh,evaluateSizeForFeature:Uh,evaluateSizeForZoom:Gh,getSizeData:Vh});function Hh(t,e,i){return t.sections.forEach((t=>{t.text=function(t,e,i){const n=e.layout.get("text-transform").evaluate(i,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),bo.applyArabicShaping&&(t=bo.applyArabicShaping(t)),t}(t.text,e,i)})),t}const Wh={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂","←":"↑","→":"↓"};function qh(t){return"︶"===t||"﹈"===t||"︸"===t||"﹄"===t||"﹂"===t||"︾"===t||"︼"===t||"︺"===t||"︘"===t||"﹀"===t||"︐"===t||"︓"===t||"︔"===t||"`"===t||" ̄"===t||"︑"===t||"︒"===t}function Xh(t){return"︵"===t||"﹇"===t||"︷"===t||"﹃"===t||"﹁"===t||"︽"===t||"︻"===t||"︹"===t||"︗"===t||"︿"===t}var Zh=Jh,Yh=function(t,e,i,n,r){var o,s,a=8*r-n-1,l=(1<<a)-1,c=l>>1,u=-7,h=i?r-1:0,p=i?-1:1,d=t[e+h];for(h+=p,o=d&(1<<-u)-1,d>>=-u,u+=a;u>0;o=256*o+t[e+h],h+=p,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=n;u>0;s=256*s+t[e+h],h+=p,u-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=c}return(d?-1:1)*s*Math.pow(2,o-n)},Qh=function(t,e,i,n,r,o){var s,a,l,c=8*o-r-1,u=(1<<c)-1,h=u>>1,p=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,f=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+h>=1?p/l:p*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=u?(a=0,s=u):s+h>=1?(a=(e*l-1)*Math.pow(2,r),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,r),s=0));r>=8;t[i+d]=255&a,d+=f,a/=256,r-=8);for(s=s<<r|a,c+=r;c>0;t[i+d]=255&s,d+=f,s/=256,c-=8);t[i+d-f]|=128*m};
|
||
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */function Jh(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Jh.Varint=0,Jh.Fixed64=1,Jh.Bytes=2,Jh.Fixed32=5;var Kh=4294967296,$h=1/Kh,tp="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function ep(t){return t.type===Jh.Bytes?t.readVarint()+t.pos:t.pos+1}function ip(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function np(t,e,i){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(n);for(var r=i.pos-1;r>=t;r--)i.buf[r+n]=i.buf[r]}function rp(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function op(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function sp(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function ap(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function lp(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function cp(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function up(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function hp(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function pp(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function dp(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function fp(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function mp(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}Jh.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var n=this.readVarint(),r=n>>3,o=this.pos;this.type=7&n,t(r,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=dp(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=mp(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=dp(this.buf,this.pos)+dp(this.buf,this.pos+4)*Kh;return this.pos+=8,t},readSFixed64:function(){var t=dp(this.buf,this.pos)+mp(this.buf,this.pos+4)*Kh;return this.pos+=8,t},readFloat:function(){var t=Yh(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Yh(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,n=this.buf;return e=127&(i=n[this.pos++]),i<128?e:(e|=(127&(i=n[this.pos++]))<<7,i<128?e:(e|=(127&(i=n[this.pos++]))<<14,i<128?e:(e|=(127&(i=n[this.pos++]))<<21,i<128?e:function(t,e,i){var n,r,o=i.buf;if(n=(112&(r=o[i.pos++]))>>4,r<128)return ip(t,n,e);if(n|=(127&(r=o[i.pos++]))<<3,r<128)return ip(t,n,e);if(n|=(127&(r=o[i.pos++]))<<10,r<128)return ip(t,n,e);if(n|=(127&(r=o[i.pos++]))<<17,r<128)return ip(t,n,e);if(n|=(127&(r=o[i.pos++]))<<24,r<128)return ip(t,n,e);if(n|=(1&(r=o[i.pos++]))<<31,r<128)return ip(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&tp?function(t,e,i){return tp.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){for(var n="",r=e;r<i;){var o,s,a,l=t[r],c=null,u=l>239?4:l>223?3:l>191?2:1;if(r+u>i)break;1===u?l<128&&(c=l):2===u?128==(192&(o=t[r+1]))&&(c=(31&l)<<6|63&o)<=127&&(c=null):3===u?(s=t[r+2],128==(192&(o=t[r+1]))&&128==(192&s)&&((c=(15&l)<<12|(63&o)<<6|63&s)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(s=t[r+2],a=t[r+3],128==(192&(o=t[r+1]))&&128==(192&s)&&128==(192&a)&&((c=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)<=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),r+=u}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Jh.Bytes)return t.push(this.readVarint(e));var i=ep(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Jh.Bytes)return t.push(this.readSVarint());var e=ep(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Jh.Bytes)return t.push(this.readBoolean());var e=ep(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Jh.Bytes)return t.push(this.readFloat());var e=ep(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Jh.Bytes)return t.push(this.readDouble());var e=ep(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Jh.Bytes)return t.push(this.readFixed32());var e=ep(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Jh.Bytes)return t.push(this.readSFixed32());var e=ep(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Jh.Bytes)return t.push(this.readFixed64());var e=ep(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Jh.Bytes)return t.push(this.readSFixed64());var e=ep(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Jh.Varint)for(;this.buf[this.pos++]>127;);else if(e===Jh.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Jh.Fixed32)this.pos+=4;else{if(e!==Jh.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),fp(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),fp(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),fp(this.buf,-1&t,this.pos),fp(this.buf,Math.floor(t*$h),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),fp(this.buf,-1&t,this.pos),fp(this.buf,Math.floor(t*$h),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var i,n;if(t>=0?(i=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,i.buf[i.pos]=127&(t>>>=7)}(i,0,e),function(t,e){var i=(7&t)<<4;e.buf[e.pos++]|=i|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,i){for(var n,r,o=0;o<e.length;o++){if((n=e.charCodeAt(o))>55295&&n<57344){if(!r){n>56319||o+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):r=n;continue}if(n<56320){t[i++]=239,t[i++]=191,t[i++]=189,r=n;continue}n=r-55296<<10|n-56320|65536,r=null}else r&&(t[i++]=239,t[i++]=191,t[i++]=189,r=null);n<128?t[i++]=n:(n<2048?t[i++]=n>>6|192:(n<65536?t[i++]=n>>12|224:(t[i++]=n>>18|240,t[i++]=n>>12&63|128),t[i++]=n>>6&63|128),t[i++]=63&n|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&np(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),Qh(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Qh(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var n=this.pos-i;n>=128&&np(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,i){this.writeTag(t,Jh.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,rp,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,op,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,lp,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,sp,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,ap,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,cp,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,up,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,hp,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,pp,e)},writeBytesField:function(t,e){this.writeTag(t,Jh.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Jh.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Jh.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Jh.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Jh.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Jh.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Jh.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Jh.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Jh.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Jh.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var gp=p(Zh);const yp=3;function vp(t,e,i){e.glyphs=[],1===t&&i.readMessage(_p,e)}function _p(t,e,i){if(3===t){const{id:t,bitmap:n,width:r,height:o,left:s,top:a,advance:l}=i.readMessage(xp,{});e.glyphs.push({id:t,bitmap:new zc({width:r+2*yp,height:o+2*yp},n),metrics:{width:r,height:o,left:s,top:a,advance:l}})}else 4===t?e.ascender=i.readSVarint():5===t&&(e.descender=i.readSVarint())}function xp(t,e,i){1===t?e.id=i.readVarint():2===t?e.bitmap=i.readBytes():3===t?e.width=i.readVarint():4===t?e.height=i.readVarint():5===t?e.left=i.readSVarint():6===t?e.top=i.readSVarint():7===t&&(e.advance=i.readVarint())}const bp=yp;function wp(t){let e=0,i=0;for(const n of t)e+=n.w*n.h,i=Math.max(i,n.w);t.sort(((t,e)=>e.h-t.h));const n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}];let r=0,o=0;for(const e of t)for(let t=n.length-1;t>=0;t--){const i=n[t];if(!(e.w>i.w||e.h>i.h)){if(e.x=i.x,e.y=i.y,o=Math.max(o,e.y+e.h),r=Math.max(r,e.x+e.w),e.w===i.w&&e.h===i.h){const e=n.pop();t<n.length&&(n[t]=e)}else e.h===i.h?(i.x+=e.w,i.w-=e.w):e.w===i.w?(i.y+=e.h,i.h-=e.h):(n.push({x:i.x+e.w,y:i.y,w:i.w-e.w,h:e.h}),i.y+=e.h,i.h-=e.h);break}}return{w:r,h:o,fill:e/(r*o)||0}}const Ap=1;class Ep{constructor(t,{pixelRatio:e,version:i,stretchX:n,stretchY:r,content:o}){this.paddedRect=t,this.pixelRatio=e,this.stretchX=n,this.stretchY=r,this.content=o,this.version=i}get tl(){return[this.paddedRect.x+Ap,this.paddedRect.y+Ap]}get br(){return[this.paddedRect.x+this.paddedRect.w-Ap,this.paddedRect.y+this.paddedRect.h-Ap]}get displaySize(){return[(this.paddedRect.w-2*Ap)/this.pixelRatio,(this.paddedRect.h-2*Ap)/this.pixelRatio]}}class Sp{constructor(t,e){const i={},n={};this.haveRenderCallbacks=[];const r=[];this.addImages(t,i,r),this.addImages(e,n,r);const{w:o,h:s}=wp(r),a=new Fc({width:o||1,height:s||1});for(const e in t){const n=t[e],r=i[e].paddedRect;Fc.copy(n.data,a,{x:0,y:0},{x:r.x+Ap,y:r.y+Ap},n.data)}for(const t in e){const i=e[t],r=n[t].paddedRect,o=r.x+Ap,s=r.y+Ap,l=i.data.width,c=i.data.height;Fc.copy(i.data,a,{x:0,y:0},{x:o,y:s},i.data),Fc.copy(i.data,a,{x:0,y:c-1},{x:o,y:s-1},{width:l,height:1}),Fc.copy(i.data,a,{x:0,y:0},{x:o,y:s+c},{width:l,height:1}),Fc.copy(i.data,a,{x:l-1,y:0},{x:o-1,y:s},{width:1,height:c}),Fc.copy(i.data,a,{x:0,y:0},{x:o+l,y:s},{width:1,height:c})}this.image=a,this.iconPositions=i,this.patternPositions=n}addImages(t,e,i){for(const n in t){const r=t[n],o={x:0,y:0,w:r.data.width+2*Ap,h:r.data.height+2*Ap};i.push(o),e[n]=new Ep(o,r),r.hasRenderCallback&&this.haveRenderCallbacks.push(n)}}patchUpdatedImages(t,e){this.haveRenderCallbacks=this.haveRenderCallbacks.filter((e=>t.hasImage(e))),t.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const i in t.updatedImages)this.patchUpdatedImage(this.iconPositions[i],t.getImage(i),e),this.patchUpdatedImage(this.patternPositions[i],t.getImage(i),e)}patchUpdatedImage(t,e,i){if(!t||!e)return;if(t.version===e.version)return;t.version=e.version;const[n,r]=t.tl;i.update(e.data,void 0,{x:n,y:r})}}Yr(Ep,"ImagePosition"),Yr(Sp,"ImageAtlas");const Mp={horizontal:1,vertical:2,horizontalOnly:3},Tp=-17;class Ip{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(t,e){const i=new Ip;return i.scale=t||1,i.fontStack=e,i}static forImage(t){const e=new Ip;return e.imageName=t,e}}class Cp{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(t,e){const i=new Cp;for(let n=0;n<t.sections.length;n++){const r=t.sections[n];r.image?i.addImageSection(r):i.addTextSection(r,e)}return i}length(){return this.text.length}getSection(t){return this.sections[this.sectionIndex[t]]}getSections(){return this.sections}getSectionIndex(t){return this.sectionIndex[t]}getCharCode(t){return this.text.charCodeAt(t)}verticalizePunctuation(t){this.text=function(t,e){let i="";for(let n=0;n<t.length;n++){const r=t.charCodeAt(n+1)||null,o=t.charCodeAt(n-1)||null;i+=!e&&(r&&oo(r)&&!Wh[t[n+1]]||o&&oo(o)&&!Wh[t[n-1]])||!Wh[t[n]]?t[n]:Wh[t[n]]}return i}(this.text,t)}trim(){let t=0;for(let e=0;e<this.text.length&&Lp[this.text.charCodeAt(e)];e++)t++;let e=this.text.length;for(let i=this.text.length-1;i>=0&&i>=t&&Lp[this.text.charCodeAt(i)];i--)e--;this.text=this.text.substring(t,e),this.sectionIndex=this.sectionIndex.slice(t,e)}substring(t,e){const i=new Cp;return i.text=this.text.substring(t,e),i.sectionIndex=this.sectionIndex.slice(t,e),i.sections=this.sections,i}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((t,e)=>Math.max(t,this.sections[e].scale)),0)}addTextSection(t,e){this.text+=t.text,this.sections.push(Ip.forText(t.scale,t.fontStack||e));const i=this.sections.length-1;for(let e=0;e<t.text.length;++e)this.sectionIndex.push(i)}addImageSection(t){const e=t.image?t.image.name:"";if(0===e.length)return void H("Can't add FormattedSection with an empty image.");const i=this.getNextImageSectionCharCode();i?(this.text+=String.fromCharCode(i),this.sections.push(Ip.forImage(e)),this.sectionIndex.push(this.sections.length-1)):H("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Pp(t,e,i,n,r,o,s,a,l,c,u,h,p,d,f){const m=Cp.fromFeature(t,r);h===Mp.vertical&&m.verticalizePunctuation(p);let g=[];const y=function(t,e,i,n,r,o){if(!t)return[];const s=[],a=function(t,e,i,n,r,o){let s=0;for(let i=0;i<t.length();i++){const a=t.getSection(i);s+=Rp(t.getCharCode(i),a,n,r,e,o)}return s/Math.max(1,Math.ceil(s/i))}(t,e,i,n,r,o),l=t.text.indexOf("")>=0;let c=0;for(let i=0;i<t.length();i++){const h=t.getSection(i),p=t.getCharCode(i);if(Lp[p]||(c+=Rp(p,h,n,r,e,o)),i<t.length()-1){const e=!((u=p)<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)));(Dp[p]||e||h.imageName)&&s.push(Np(i+1,c,a,s,kp(p,t.getCharCode(i+1),e&&l),!1))}}var u;return Bp(Np(t.length(),c,a,s,0,!0))}(m,c,o,e,n,d),{processBidirectionalText:v,processStyledBidirectionalText:_}=bo;if(v&&1===m.sections.length){const t=v(m.toString(),y);for(const e of t){const t=new Cp;t.text=e,t.sections=m.sections;for(let i=0;i<e.length;i++)t.sectionIndex.push(0);g.push(t)}}else if(_){const t=_(m.text,m.sectionIndex,y);for(const e of t){const t=new Cp;t.text=e[0],t.sectionIndex=e[1],t.sections=m.sections,g.push(t)}}else g=function(t,e){const i=[],n=t.text;let r=0;for(const n of e)i.push(t.substring(r,n)),r=n;return r<n.length&&i.push(t.substring(r,n.length)),i}(m,y);const x=[],b={positionedLines:x,text:m.toString(),top:u[1],bottom:u[1],left:u[0],right:u[0],writingMode:h,iconsInText:!1,verticalizable:!1,hasBaseline:!1};return function(t,e,i,n,r,o,s,a,l,c,u,h){let p=0,d=0,f=0;const m="right"===a?1:"left"===a?0:.5;let g=!1;for(const t of r){const i=t.getSections();for(const t of i){if(t.imageName)continue;const i=e[t.fontStack];if(i&&(g=void 0!==i.ascender&&void 0!==i.descender,!g))break}if(!g)break}let y=0;for(const s of r){s.trim();const r=s.getMaxScale(),a=(r-1)*zh,_={positionedGlyphs:[],lineOffset:0};t.positionedLines[y]=_;const x=_.positionedGlyphs;let b=0;if(!s.length()){d+=o,++y;continue}let w=0,A=0;for(let o=0;o<s.length();o++){const a=s.getSection(o),f=s.getSectionIndex(o),m=s.getCharCode(o);let y=a.scale,_=null,E=null,S=null,M=zh,T=0;const I=!(l===Mp.horizontal||!u&&!ro(m)||u&&(Lp[m]||(v=m,to.Arabic(v)||to["Arabic Supplement"](v)||to["Arabic Extended-A"](v)||to["Arabic Presentation Forms-A"](v)||to["Arabic Presentation Forms-B"](v))));if(a.imageName){const e=n[a.imageName];if(!e)continue;S=a.imageName,t.iconsInText=t.iconsInText||!0,E=e.paddedRect;const i=e.displaySize;y=y*zh/h,_={width:i[0],height:i[1],left:Ap,top:-bp,advance:I?i[1]:i[0],localGlyph:!1},T=g?-_.height*y:Tp+r*zh-i[1]*y,M=_.advance;const o=(I?i[0]:i[1])*y-zh*r;o>0&&o>b&&(b=o)}else{const t=i[a.fontStack];if(!t)continue;t[m]&&(E=t[m]);const n=e[a.fontStack];if(!n)continue;const o=n.glyphs[m];if(!o)continue;if(_=o.metrics,M=8203!==m?zh:0,g){const t=void 0!==n.ascender?Math.abs(n.ascender):0,e=void 0!==n.descender?Math.abs(n.descender):0,i=(t+e)*y;w<i&&(w=i,A=(t-e)/2*y),T=-t*y}else T=Tp+(r-y)*zh}I?(t.verticalizable=!0,x.push({glyph:m,imageName:S,x:p,y:d+T,vertical:I,scale:y,localGlyph:_.localGlyph,fontStack:a.fontStack,sectionIndex:f,metrics:_,rect:E}),p+=M*y+c):(x.push({glyph:m,imageName:S,x:p,y:d+T,vertical:I,scale:y,localGlyph:_.localGlyph,fontStack:a.fontStack,sectionIndex:f,metrics:_,rect:E}),p+=_.advance*y+c)}0!==x.length&&(f=Math.max(p-c,f),g?Fp(x,m,b,A,o*r/2):Fp(x,m,b,0,o/2)),p=0;const E=o*r+b;_.lineOffset=Math.max(b,a),d+=E,++y}var v;const _=d,{horizontalAlign:x,verticalAlign:b}=zp(s);(function(t,e,i,n,r,o){const s=(e-i)*r,a=-o*n;for(const e of t)for(const t of e.positionedGlyphs)t.x+=s,t.y+=a})(t.positionedLines,m,x,b,f,_),t.top+=-b*_,t.bottom=t.top+_,t.left+=-x*f,t.right=t.left+f,t.hasBaseline=g}(b,e,i,n,g,s,a,l,h,c,p,f),!function(t){for(const e of t)if(0!==e.positionedGlyphs.length)return!1;return!0}(x)&&b}const Lp={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Dp={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 Rp(t,e,i,n,r,o){if(e.imageName){const t=n[e.imageName];return t?t.displaySize[0]*e.scale*zh/o+r:0}{const n=i[e.fontStack],o=n&&n.glyphs[t];return o?o.metrics.advance*e.scale+r:0}}function Op(t,e,i,n){const r=Math.pow(t-e,2);return n?t<e?r/2:2*r:r+Math.abs(i)*i}function kp(t,e,i){let n=0;return 10===t&&(n-=1e4),i&&(n+=150),40!==t&&65288!==t||(n+=50),41!==e&&65289!==e||(n+=50),n}function Np(t,e,i,n,r,o){let s=null,a=Op(e,i,r,o);for(const t of n){const n=Op(e-t.x,i,r,o)+t.badness;n<=a&&(s=t,a=n)}return{index:t,x:e,priorBreak:s,badness:a}}function Bp(t){return t?Bp(t.priorBreak).concat(t.index):[]}function zp(t){let e=.5,i=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:e,verticalAlign:i}}function Fp(t,e,i,n,r){if(!(e||i||n||r))return;const o=t.length-1,s=t[o],a=(s.x+s.metrics.advance*s.scale)*e;for(let e=0;e<=o;e++)t[e].x-=a,t[e].y+=i+n+r}function Vp(t,e,i){const{horizontalAlign:n,verticalAlign:r}=zp(i),o=e[0]-t.displaySize[0]*n,s=e[1]-t.displaySize[1]*r;return{image:t,top:s,bottom:s+t.displaySize[1],left:o,right:o+t.displaySize[0]}}function Up(t,e,i,n,r,o){const s=t.image;let a;if(s.content){const t=s.content,e=s.pixelRatio||1;a=[t[0]/e,t[1]/e,s.displaySize[0]-t[2]/e,s.displaySize[1]-t[3]/e]}const l=e.left*o,c=e.right*o;let u,h,p,d;"width"===i||"both"===i?(d=r[0]+l-n[3],h=r[0]+c+n[1]):(d=r[0]+(l+c-s.displaySize[0])/2,h=d+s.displaySize[0]);const f=e.top*o,m=e.bottom*o;return"height"===i||"both"===i?(u=r[1]+f-n[0],p=r[1]+m+n[2]):(u=r[1]+(f+m-s.displaySize[1])/2,p=u+s.displaySize[1]),{image:s,top:u,right:h,bottom:p,left:d,collisionPadding:a}}class Gp extends v{constructor(t,e,i,n,r){super(t,e),this.angle=n,this.z=i,void 0!==r&&(this.segment=r)}clone(){return new Gp(this.x,this.y,this.z,this.angle,this.segment)}}function jp(t,e,i,n,r){if(void 0===e.segment)return!0;let o=e,s=e.segment+1,a=0;for(;a>-i/2;){if(s--,s<0)return!1;a-=t[s].dist(o),o=t[s]}a+=t[s].dist(t[s+1]),s++;const l=[];let c=0;for(;a<i/2;){const e=t[s],i=t[s+1];if(!i)return!1;let o=t[s-1].angleTo(e)-e.angleTo(i);for(o=Math.abs((o+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:a,angleDelta:o}),c+=o;a-l[0].distance>n;)c-=l.shift().angleDelta;if(c>r)return!1;s++,a+=e.dist(i)}return!0}function Hp(t){let e=0;for(let i=0;i<t.length-1;i++)e+=t[i].dist(t[i+1]);return e}function Wp(t,e,i){return t?.6*e*i:0}function qp(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Xp(t,e,i,n,r,o){const s=Wp(i,r,o),a=qp(i,n)*o;let l=0;const c=Hp(t)/2;for(let i=0;i<t.length-1;i++){const n=t[i],r=t[i+1],o=n.dist(r);if(l+o>c){const u=(c-l)/o,h=Li(n.x,r.x,u),p=Li(n.y,r.y,u),d=new Gp(h,p,0,r.angleTo(n),i);return!s||jp(t,d,a,s,e)?d:void 0}l+=o}}function Zp(t,e,i,n,r,o,s,a,l){const c=Wp(n,o,s),u=qp(n,r),h=u*s,p=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-h<e/4&&(e=h+e/4),Yp(t,p?e/2*a%e:(u/2+2*o)*s*a%e,e,c,i,h,p,!1,l)}function Yp(t,e,i,n,r,o,s,a,l){const c=o/2,u=Hp(t);let h=0,p=e-i,d=[];for(let e=0;e<t.length-1;e++){const s=t[e],a=t[e+1],f=s.dist(a),m=a.angleTo(s);for(;p+i<h+f;){p+=i;const g=(p-h)/f,y=Li(s.x,a.x,g),v=Li(s.y,a.y,g);if(y>=0&&y<l&&v>=0&&v<l&&p-c>=0&&p+c<=u){const i=new Gp(y,v,0,m,e);i._round(),n&&!jp(t,i,o,n,r)||d.push(i)}}h+=f}return a||d.length||s||(d=Yp(t,h/2,i,n,r,o,s,!0,l)),d}function Qp(t,e,i,n,r){const o=[];for(let s=0;s<t.length;s++){const a=t[s];let l;for(let t=0;t<a.length-1;t++){let s=a[t],c=a[t+1];s.x<e&&c.x<e||(s.x<e?s=new v(e,s.y+(e-s.x)/(c.x-s.x)*(c.y-s.y))._round():c.x<e&&(c=new v(e,s.y+(e-s.x)/(c.x-s.x)*(c.y-s.y))._round()),s.y<i&&c.y<i||(s.y<i?s=new v(s.x+(i-s.y)/(c.y-s.y)*(c.x-s.x),i)._round():c.y<i&&(c=new v(s.x+(i-s.y)/(c.y-s.y)*(c.x-s.x),i)._round()),s.x>=n&&c.x>=n||(s.x>=n?s=new v(n,s.y+(n-s.x)/(c.x-s.x)*(c.y-s.y))._round():c.x>=n&&(c=new v(n,s.y+(n-s.x)/(c.x-s.x)*(c.y-s.y))._round()),s.y>=r&&c.y>=r||(s.y>=r?s=new v(s.x+(r-s.y)/(c.y-s.y)*(c.x-s.x),r)._round():c.y>=r&&(c=new v(s.x+(r-s.y)/(c.y-s.y)*(c.x-s.x),r)._round()),l&&s.equals(l[l.length-1])||(l=[s],o.push(l)),l.push(c)))))}}return o}Yr(Gp,"Anchor");const Jp=1e20;function Kp(t,e,i,n,r,o,s,a,l){for(let c=e;c<e+n;c++)$p(t,i*o+c,o,r,s,a,l);for(let c=i;c<i+r;c++)$p(t,c*o+e,1,n,s,a,l)}function $p(t,e,i,n,r,o,s){o[0]=0,s[0]=-Jp,s[1]=Jp,r[0]=t[e];for(let a=1,l=0,c=0;a<n;a++){r[a]=t[e+a*i];const n=a*a;do{const t=o[l];c=(r[a]-r[t]+n-t*t)/(a-t)/2}while(c<=s[l]&&--l>-1);l++,o[l]=a,s[l]=c,s[l+1]=Jp}for(let a=0,l=0;a<n;a++){for(;s[l+1]<a;)l++;const n=o[l],c=a-n;t[e+a*i]=r[n]+c*c}}const td=2,ed={none:0,ideographs:1,all:2};class id{constructor(t,e,i){this.requestManager=t,this.localGlyphMode=e,this.localFontFamily=i,this.entries={},this.localGlyphs={200:{},400:{},500:{},900:{}}}setURL(t){this.url=t}getGlyphs(t,e){const i=[];for(const e in t)for(const n of t[e])i.push({stack:e,id:n});P(i,(({stack:t,id:e},i)=>{let n=this.entries[t];n||(n=this.entries[t]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let r=n.glyphs[e];if(void 0!==r)return void i(null,{stack:t,id:e,glyph:r});if(r=this._tinySDF(n,t,e),r)return n.glyphs[e]=r,void i(null,{stack:t,id:e,glyph:r});const o=Math.floor(e/256);if(256*o>65535)return void i(new Error("glyphs > 65535 not supported"));if(n.ranges[o])return void i(null,{stack:t,id:e,glyph:r});let s=n.requests[o];s||(s=n.requests[o]=[],id.loadGlyphRange(t,o,this.url,this.requestManager,((t,e)=>{if(e){n.ascender=e.ascender,n.descender=e.descender;for(const t in e.glyphs)this._doesCharSupportLocalGlyph(+t)||(n.glyphs[+t]=e.glyphs[+t]);n.ranges[o]=!0}for(const i of s)i(t,e);delete n.requests[o]}))),s.push(((n,r)=>{n?i(n):r&&i(null,{stack:t,id:e,glyph:r.glyphs[e]||null})}))}),((t,i)=>{if(t)e(t);else if(i){const t={};for(const{stack:e,id:n,glyph:r}of i)void 0===t[e]&&(t[e]={}),void 0===t[e].glyphs&&(t[e].glyphs={}),t[e].glyphs[n]=r&&{id:r.id,bitmap:r.bitmap.clone(),metrics:r.metrics},t[e].ascender=this.entries[e].ascender,t[e].descender=this.entries[e].descender;e(null,t)}}))}_doesCharSupportLocalGlyph(t){return this.localGlyphMode!==ed.none&&(this.localGlyphMode===ed.all?!!this.localFontFamily:!!this.localFontFamily&&(to["CJK Unified Ideographs"](t)||to["Hangul Syllables"](t)||to.Hiragana(t)||to.Katakana(t)||to["CJK Symbols and Punctuation"](t)))}_tinySDF(t,e,i){const n=this.localFontFamily;if(!n||!this._doesCharSupportLocalGlyph(i))return;let r=t.tinySDF;if(!r){let i="400";/bold/i.test(e)?i="900":/medium/i.test(e)?i="500":/light/i.test(e)&&(i="200"),r=t.tinySDF=new id.TinySDF({fontFamily:n,fontWeight:i,fontSize:24*td,buffer:3*td,radius:8*td}),r.fontWeight=i}if(this.localGlyphs[r.fontWeight][i])return this.localGlyphs[r.fontWeight][i];const o=String.fromCharCode(i),{data:s,width:a,height:l,glyphWidth:c,glyphHeight:u,glyphLeft:h,glyphTop:p,glyphAdvance:d}=r.draw(o);return this.localGlyphs[r.fontWeight][i]={id:i,bitmap:new zc({width:a,height:l},s),metrics:{width:c/td,height:u/td,left:h/td,top:p/td-27,advance:d/td,localGlyph:!0}}}}id.loadGlyphRange=function(t,e,i,n,r){const o=256*e,s=o+255,a=n.transformRequest(n.normalizeGlyphsURL(i).replace("{fontstack}",t).replace("{range}",`${o}-${s}`),lt.Glyphs);pt(a,((t,e)=>{if(t)r(t);else if(e){const t={},i=function(t){return new gp(t).readFields(vp,{})}(e);for(const e of i.glyphs)t[e.id]=e;r(null,{glyphs:t,ascender:i.ascender,descender:i.descender})}}))},id.TinySDF=class{constructor({fontSize:t=24,buffer:e=3,radius:i=8,cutoff:n=.25,fontFamily:r="sans-serif",fontWeight:o="normal",fontStyle:s="normal"}={}){this.buffer=e,this.cutoff=n,this.radius=i;const a=this.size=t+4*e,l=this._createCanvas(a),c=this.ctx=l.getContext("2d",{willReadFrequently:!0});c.font=`${s} ${o} ${t}px ${r}`,c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Uint16Array(a)}_createCanvas(t){const e=document.createElement("canvas");return e.width=e.height=t,e}draw(t){const{width:e,actualBoundingBoxAscent:i,actualBoundingBoxDescent:n,actualBoundingBoxLeft:r,actualBoundingBoxRight:o}=this.ctx.measureText(t),s=Math.ceil(i),a=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(o-r))),l=Math.min(this.size-this.buffer,s+Math.ceil(n)),c=a+2*this.buffer,u=l+2*this.buffer,h=Math.max(c*u,0),p=new Uint8ClampedArray(h),d={data:p,width:c,height:u,glyphWidth:a,glyphHeight:l,glyphTop:s,glyphLeft:0,glyphAdvance:e};if(0===a||0===l)return d;const{ctx:f,buffer:m,gridInner:g,gridOuter:y}=this;f.clearRect(m,m,a,l),f.fillText(t,m,m+s);const v=f.getImageData(m,m,a,l);y.fill(Jp,0,h),g.fill(0,0,h);for(let t=0;t<l;t++)for(let e=0;e<a;e++){const i=v.data[4*(t*a+e)+3]/255;if(0===i)continue;const n=(t+m)*c+e+m;if(1===i)y[n]=0,g[n]=Jp;else{const t=.5-i;y[n]=t>0?t*t:0,g[n]=t<0?t*t:0}}Kp(y,0,0,c,u,c,this.f,this.v,this.z),Kp(g,m,m,a,l,c,this.f,this.v,this.z);for(let t=0;t<h;t++){const e=Math.sqrt(y[t])-Math.sqrt(g[t]);p[t]=Math.round(255-255*(e/this.radius+this.cutoff))}return d}};const nd=Ap;function rd(t,e,i,n){const r=[],o=t.image,s=o.pixelRatio,a=o.paddedRect.w-2*nd,l=o.paddedRect.h-2*nd,c=t.right-t.left,u=t.bottom-t.top,h=o.stretchX||[[0,a]],p=o.stretchY||[[0,l]],d=(t,e)=>t+e[1]-e[0],f=h.reduce(d,0),m=p.reduce(d,0),g=a-f,y=l-m;let _=0,x=f,b=0,w=m,A=0,E=g,S=0,M=y;if(o.content&&n){const t=o.content;_=od(h,0,t[0]),b=od(p,0,t[1]),x=od(h,t[0],t[2]),w=od(p,t[1],t[3]),A=t[0]-_,S=t[1]-b,E=t[2]-t[0]-x,M=t[3]-t[1]-w}const T=(n,r,a,l)=>{const h=ad(n.stretch-_,x,c,t.left),p=ld(n.fixed-A,E,n.stretch,f),d=ad(r.stretch-b,w,u,t.top),g=ld(r.fixed-S,M,r.stretch,m),y=ad(a.stretch-_,x,c,t.left),T=ld(a.fixed-A,E,a.stretch,f),I=ad(l.stretch-b,w,u,t.top),C=ld(l.fixed-S,M,l.stretch,m),P=new v(h,d),L=new v(y,d),D=new v(y,I),R=new v(h,I),O=new v(p/s,g/s),k=new v(T/s,C/s),N=e*Math.PI/180;if(N){const t=Math.sin(N),e=Math.cos(N),i=[e,-t,t,e];P._matMult(i),L._matMult(i),R._matMult(i),D._matMult(i)}const B=n.stretch+n.fixed,z=r.stretch+r.fixed;return{tl:P,tr:L,bl:R,br:D,tex:{x:o.paddedRect.x+nd+B,y:o.paddedRect.y+nd+z,w:a.stretch+a.fixed-B,h:l.stretch+l.fixed-z},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:O,pixelOffsetBR:k,minFontScaleX:E/s/c,minFontScaleY:M/s/u,isSDF:i}};if(n&&(o.stretchX||o.stretchY)){const t=sd(h,g,f),e=sd(p,y,m);for(let i=0;i<t.length-1;i++){const n=t[i],o=t[i+1];for(let t=0;t<e.length-1;t++)r.push(T(n,e[t],o,e[t+1]))}}else r.push(T({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:a+1},{fixed:0,stretch:l+1}));return r}function od(t,e,i){let n=0;for(const r of t)n+=Math.max(e,Math.min(i,r[1]))-Math.max(e,Math.min(i,r[0]));return n}function sd(t,e,i){const n=[{fixed:-nd,stretch:0}];for(const[e,i]of t){const t=n[n.length-1];n.push({fixed:e-t.stretch,stretch:t.stretch}),n.push({fixed:e-t.stretch,stretch:t.stretch+(i-e)})}return n.push({fixed:e+nd,stretch:i}),n}function ad(t,e,i,n){return t/e*i+n}function ld(t,e,i,n){return t-e*i/n}function cd(t,e,i,n){const r=e+t.positionedLines[n].lineOffset;return 0===n?i+r/2:i+(r+(e+t.positionedLines[n-1].lineOffset))/2}class ud{constructor(t=[],e=hd){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:i}=this,n=e[t];for(;t>0;){const r=t-1>>1,o=e[r];if(i(n,o)>=0)break;e[t]=o,t=r}e[t]=n}_down(t){const{data:e,compare:i}=this,n=this.length>>1,r=e[t];for(;t<n;){let n=1+(t<<1),o=e[n];const s=n+1;if(s<this.length&&i(e[s],o)<0&&(n=s,o=e[s]),i(o,r)>=0)break;e[t]=o,t=n}e[t]=r}}function hd(t,e){return t<e?-1:t>e?1:0}function pd(t,e=1,i=!1){let n=1/0,r=1/0,o=-1/0,s=-1/0;const a=t[0];for(let t=0;t<a.length;t++){const e=a[t];(!t||e.x<n)&&(n=e.x),(!t||e.y<r)&&(r=e.y),(!t||e.x>o)&&(o=e.x),(!t||e.y>s)&&(s=e.y)}const l=Math.min(o-n,s-r);let c=l/2;const u=new ud([],dd);if(0===l)return new v(n,r);for(let e=n;e<o;e+=l)for(let i=r;i<s;i+=l)u.push(new fd(e+c,i+c,c,t));let h=function(t){let e=0,i=0,n=0;const r=t[0];for(let t=0,o=r.length,s=o-1;t<o;s=t++){const o=r[t],a=r[s],l=o.x*a.y-a.x*o.y;i+=(o.x+a.x)*l,n+=(o.y+a.y)*l,e+=3*l}return new fd(i/e,n/e,0,t)}(t),p=u.length;for(;u.length;){const n=u.pop();(n.d>h.d||!h.d)&&(h=n,i&&console.log("found best %d after %d probes",Math.round(1e4*n.d)/1e4,p)),n.max-h.d<=e||(c=n.h/2,u.push(new fd(n.p.x-c,n.p.y-c,c,t)),u.push(new fd(n.p.x+c,n.p.y-c,c,t)),u.push(new fd(n.p.x-c,n.p.y+c,c,t)),u.push(new fd(n.p.x+c,n.p.y+c,c,t)),p+=4)}return i&&(console.log(`num probes: ${p}`),console.log(`best distance: ${h.d}`)),h.p}function dd(t,e){return e.max-t.max}class fd{constructor(t,e,i,n){this.p=new v(t,e),this.h=i,this.d=function(t,e){let i=!1,n=1/0;for(let r=0;r<e.length;r++){const o=e[r];for(let e=0,r=o.length,s=r-1;e<r;s=e++){const r=o[e],a=o[s];r.y>t.y!=a.y>t.y&&t.x<(a.x-r.x)*(t.y-r.y)/(a.y-r.y)+r.x&&(i=!i),n=Math.min(n,vc(t,r,a))}}return(i?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}}const md=7,gd=Number.POSITIVE_INFINITY,yd=Math.sqrt(2);function vd(t,[e,i]){let n=0,r=0;if(i===gd){e<0&&(e=0);const i=e/yd;switch(t){case"top-right":case"top-left":r=i-md;break;case"bottom-right":case"bottom-left":r=-i+md;break;case"bottom":r=-e+md;break;case"top":r=e-md}switch(t){case"top-right":case"bottom-right":n=-i;break;case"top-left":case"bottom-left":n=i;break;case"left":n=e;break;case"right":n=-e}}else{switch(e=Math.abs(e),i=Math.abs(i),t){case"top-right":case"top-left":case"top":r=i-md;break;case"bottom-right":case"bottom-left":case"bottom":r=-i+md}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}}return[n,r]}function _d(t,e,i,n,r,o,s,a,l,c){t.createArrays(),t.tilePixelRatio=aa/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;const u=t.layers[0].layout,h=t.layers[0]._unevaluatedLayout._values,p={};if("composite"===t.textSizeData.kind){const{minZoom:e,maxZoom:i}=t.textSizeData;p.compositeTextSizes=[h["text-size"].possiblyEvaluate(new wo(e),a),h["text-size"].possiblyEvaluate(new wo(i),a)]}if("composite"===t.iconSizeData.kind){const{minZoom:e,maxZoom:i}=t.iconSizeData;p.compositeIconSizes=[h["icon-size"].possiblyEvaluate(new wo(e),a),h["icon-size"].possiblyEvaluate(new wo(i),a)]}p.layoutTextSize=h["text-size"].possiblyEvaluate(new wo(l+1),a),p.layoutIconSize=h["icon-size"].possiblyEvaluate(new wo(l+1),a),p.textMaxSize=h["text-size"].possiblyEvaluate(new wo(18),a);const d="map"===u.get("text-rotation-alignment")&&"point"!==u.get("symbol-placement"),f=u.get("text-size");for(const o of t.features){const l=u.get("text-font").evaluate(o,{},a).join(","),h=f.evaluate(o,{},a),m=p.layoutTextSize.evaluate(o,{},a),g=(p.layoutIconSize.evaluate(o,{},a),{horizontal:{},vertical:void 0}),y=o.text;let v,_=[0,0];if(y){const n=y.toString(),s=u.get("text-letter-spacing").evaluate(o,{},a)*zh,c=u.get("text-line-height").evaluate(o,{},a)*zh,p=io(n)?s:0,f=u.get("text-anchor").evaluate(o,{},a),v=u.get("text-variable-anchor");if(!v){const t=u.get("text-radial-offset").evaluate(o,{},a);_=t?vd(f,[t*zh,gd]):u.get("text-offset").evaluate(o,{},a).map((t=>t*zh))}let x=d?"center":u.get("text-justify").evaluate(o,{},a);const b="point"===u.get("symbol-placement"),w=b?u.get("text-max-width").evaluate(o,{},a)*zh:1/0,A=o=>{t.allowVerticalPlacement&&eo(n)&&(g.vertical=Pp(y,e,i,r,l,w,c,f,o,p,_,Mp.vertical,!0,m,h))};if(!d&&v){const t="auto"===x?v.map((t=>xd(t))):[x];let n=!1;for(let o=0;o<t.length;o++){const s=t[o];if(!g.horizontal[s])if(n)g.horizontal[s]=g.horizontal[0];else{const t=Pp(y,e,i,r,l,w,c,"center",s,p,_,Mp.horizontal,!1,m,h);t&&(g.horizontal[s]=t,n=1===t.positionedLines.length)}}A("left")}else{if("auto"===x&&(x=xd(f)),b||u.get("text-writing-mode").indexOf("horizontal")>=0||!eo(n)){const t=Pp(y,e,i,r,l,w,c,f,x,p,_,Mp.horizontal,!1,m,h);t&&(g.horizontal[x]=t)}A(b?"left":x)}}let x=!1;if(o.icon&&o.icon.name){const e=n[o.icon.name];e&&(v=Vp(r[o.icon.name],u.get("icon-offset").evaluate(o,{},a),u.get("icon-anchor").evaluate(o,{},a)),x=e.sdf,void 0===t.sdfIcons?t.sdfIcons=e.sdf:t.sdfIcons!==e.sdf&&H("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(e.pixelRatio!==t.pixelRatio||0!==u.get("icon-rotate").constantOr(1))&&(t.iconsNeedLinear=!0))}const b=Sd(g.horizontal)||g.vertical;t.iconsInText||(t.iconsInText=!!b&&b.iconsInText),(b||v)&&bd(t,o,g,v,n,p,m,0,_,x,s,a,c)}o&&t.generateCollisionDebugBuffers(l,t.collisionBoxArray)}function xd(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function bd(t,e,i,n,r,o,s,a,l,c,u,h,p){let d=o.textMaxSize.evaluate(e,{},h);void 0===d&&(d=s);const f=t.layers[0].layout,m=f.get("icon-offset").evaluate(e,{},h),g=Sd(i.horizontal)||i.vertical,y="globe"===p.name,v=zh,_=s/v,x=t.tilePixelRatio*d/v,w=(P=t.overscaling,t.zoom>18&&P>2&&(P>>=1),Math.max(aa/(512*P),1)*f.get("symbol-spacing")),A=f.get("text-padding")*t.tilePixelRatio,E=f.get("icon-padding")*t.tilePixelRatio,S=b(f.get("text-max-angle")),M="map"===f.get("text-rotation-alignment")&&"point"!==f.get("symbol-placement"),T="map"===f.get("icon-rotation-alignment")&&"point"!==f.get("symbol-placement"),I=f.get("symbol-placement"),C=w/2;var P;const L=f.get("icon-text-fit");let D;n&&"none"!==L&&(t.allowVerticalPlacement&&i.vertical&&(D=Up(n,i.vertical,L,f.get("icon-text-fit-padding"),m,_)),g&&(n=Up(n,g,L,f.get("icon-text-fit-padding"),m,_)));const R=(s,a,d)=>{if(a.x<0||a.x>=aa||a.y<0||a.y>=aa)return;let f=null;if(y){const{x:t,y:e,z:i}=p.projectTilePoint(a.x,a.y,d);f={anchor:new Gp(t,e,i,0,void 0),up:p.upVector(d,a.x,a.y)}}!function(t,e,i,n,r,o,s,a,l,c,u,h,p,d,f,m,g,y,v,_,x,b,w,A,E){const S=t.addToLineVertexArray(e,n);let M,T,I,C,P,L,D,R=0,O=0,k=0,N=0,B=-1,z=-1;const F={};let V=Ls("");const U=i?i.anchor:e;let G=0,j=0;if(void 0===l._unevaluatedLayout.getValue("text-radial-offset")?[G,j]=l.layout.get("text-offset").evaluate(x,{},E).map((t=>t*zh)):(G=l.layout.get("text-radial-offset").evaluate(x,{},E)*zh,j=gd),t.allowVerticalPlacement&&r.vertical){const t=r.vertical;if(f)L=Td(t),a&&(D=Td(a));else{const i=l.layout.get("text-rotate").evaluate(x,{},E)+90;I=Md(c,U,e,u,h,p,t,d,i,m),a&&(C=Md(c,U,e,u,h,p,a,y,i))}}if(o){const n=l.layout.get("icon-rotate").evaluate(x,{},E),r="none"!==l.layout.get("icon-text-fit"),s=rd(o,n,w,r),d=a?rd(a,n,w,r):void 0;T=Md(c,U,e,u,h,p,o,y,n),R=4*s.length;const f=t.iconSizeData;let m=null;"source"===f.kind?(m=[Fh*l.layout.get("icon-size").evaluate(x,{},E)],m[0]>Ad&&H(`${t.layerIds[0]}: Value for "icon-size" is >= ${wd}. Reduce your "icon-size".`)):"composite"===f.kind&&(m=[Fh*b.compositeIconSizes[0].evaluate(x,{},E),Fh*b.compositeIconSizes[1].evaluate(x,{},E)],(m[0]>Ad||m[1]>Ad)&&H(`${t.layerIds[0]}: Value for "icon-size" is >= ${wd}. Reduce your "icon-size".`)),t.addSymbols(t.icon,s,m,_,v,x,!1,i,e,S.lineStartIndex,S.lineLength,-1,A,E),B=t.icon.placedSymbolArray.length-1,d&&(O=4*d.length,t.addSymbols(t.icon,d,m,_,v,x,Mp.vertical,i,e,S.lineStartIndex,S.lineLength,-1,A,E),z=t.icon.placedSymbolArray.length-1)}for(const n in r.horizontal){const o=r.horizontal[n];M||(V=Ls(o.text),f?P=Td(o):M=Md(c,U,e,u,h,p,o,d,l.layout.get("text-rotate").evaluate(x,{},E),m));const a=1===o.positionedLines.length;if(k+=Ed(t,i,e,o,s,l,f,x,m,S,r.vertical?Mp.horizontal:Mp.horizontalOnly,a?Object.keys(r.horizontal):[n],F,B,b,A,E),a)break}r.vertical&&(N+=Ed(t,i,e,r.vertical,s,l,f,x,m,S,Mp.vertical,["vertical"],F,z,b,A,E));let W=-1;const q=(t,e)=>t?Math.max(t,e):e;W=q(P,W),W=q(L,W),W=q(D,W);const X=W>-1?1:0;t.glyphOffsetArray.length>=af.MAX_GLYPHS&&H("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==x.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,x.sortKey),t.symbolInstances.emplaceBack(U.x,U.y,U.z,e.x,e.y,F.right>=0?F.right:-1,F.center>=0?F.center:-1,F.left>=0?F.left:-1,F.vertical>=0?F.vertical:-1,B,z,V,void 0!==M?M:t.collisionBoxArray.length,void 0!==M?M+1:t.collisionBoxArray.length,void 0!==I?I:t.collisionBoxArray.length,void 0!==I?I+1:t.collisionBoxArray.length,void 0!==T?T:t.collisionBoxArray.length,void 0!==T?T+1:t.collisionBoxArray.length,C||t.collisionBoxArray.length,C?C+1:t.collisionBoxArray.length,u,k,N,R,O,X,0,G,j,W)}(t,a,f,s,i,n,r,D,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,A,M,l,0,E,T,m,e,o,c,u,h)};if("line"===I)for(const r of Qp(e.geometry,0,0,aa,aa)){const e=Zp(r,w,S,i.vertical||g,n,v,x,t.overscaling,aa);for(const i of e)g&&Id(t,g.text,C,i)||R(r,i,h)}else if("line-center"===I){for(const t of e.geometry)if(t.length>1){const e=Xp(t,S,i.vertical||g,n,v,x);e&&R(t,e,h)}}else if("Polygon"===e.type)for(const t of Au(e.geometry,0)){const e=pd(t,16);R(t[0],new Gp(e.x,e.y,0,0,void 0),h)}else if("LineString"===e.type)for(const t of e.geometry)R(t,new Gp(t[0].x,t[0].y,0,0,void 0),h);else if("Point"===e.type)for(const t of e.geometry)for(const e of t)R([e],new Gp(e.x,e.y,0,0,void 0),h)}const wd=255,Ad=wd*Fh;function Ed(t,e,i,n,r,o,s,a,l,c,u,h,p,d,f,m,g){const y=function(t,e,i,n,r,o,s,a){const l=[];if(0===e.positionedLines.length)return l;const c=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=function(t){const e=t[0],i=t[1],n=e*i;return n>0?[e,-i]:n<0?[-e,i]:0===e?[i,e]:[i,-e]}(i);let h=Math.abs(e.top-e.bottom);for(const t of e.positionedLines)h-=t.lineOffset;const p=e.positionedLines.length,d=h/p;let f=e.top-i[1];for(let t=0;t<p;++t){const n=e.positionedLines[t];f=cd(e,d,f,t);for(const t of n.positionedGlyphs){if(!t.rect)continue;const n=t.rect||{};let o=bp+1,h=!0,p=1,d=0;if(t.imageName){const e=s[t.imageName];if(!e)continue;if(e.sdf){H("SDF images are not supported in formatted text and will be ignored.");continue}h=!1,p=e.pixelRatio,o=Ap/p}const m=(r||a)&&t.vertical,g=t.metrics.advance*t.scale/2,y=t.metrics,_=t.rect;if(null===_)continue;a&&e.verticalizable&&(d=t.imageName?g-t.metrics.width*t.scale/2:0);const x=r?[t.x+g,t.y]:[0,0];let b=[0,0],w=[0,0],A=!1;r||(m?(w=[t.x+g+u[0],t.y+u[1]-d],A=!0):b=[t.x+g+i[0],t.y+i[1]-d]);const E=_.w*t.scale/(p*(t.localGlyph?td:1)),S=_.h*t.scale/(p*(t.localGlyph?td:1));let M,T,I,C;if(m){const e=t.y-f,i=new v(-g,g-e),n=-Math.PI/2,r=new v(...w);M=new v(-g+b[0],b[1]),M._rotateAround(n,i)._add(r),M.x+=-e+g,M.y-=(y.left-o)*t.scale;const s=t.imageName?y.advance*t.scale:zh*t.scale,a=String.fromCharCode(t.glyph);qh(a)?M.x+=(1-o)*t.scale:Xh(a)?M.x+=s-y.height*t.scale+(-o-1)*t.scale:M.x+=t.imageName||y.width+2*o===_.w&&y.height+2*o===_.h?(s-S)/2:(s-(y.height+2*o)*t.scale)/2,T=new v(M.x,M.y-E),I=new v(M.x+S,M.y),C=new v(M.x+S,M.y-E)}else{const e=(y.left-o)*t.scale-g+b[0],i=(-y.top-o)*t.scale+b[1],n=e+E,r=i+S;M=new v(e,i),T=new v(n,i),I=new v(e,r),C=new v(n,r)}if(c){let t;t=r?new v(0,0):A?new v(u[0],u[1]):new v(i[0],i[1]),M._rotateAround(c,t),T._rotateAround(c,t),I._rotateAround(c,t),C._rotateAround(c,t)}const P=new v(0,0),L=new v(0,0);l.push({tl:M,tr:T,bl:I,br:C,tex:n,writingMode:e.writingMode,glyphOffset:x,sectionIndex:t.sectionIndex,isSDF:h,pixelOffsetTL:P,pixelOffsetBR:L,minFontScaleX:0,minFontScaleY:0})}}return l}(0,n,l,o,s,a,r,t.allowVerticalPlacement),_=t.textSizeData;let x=null;"source"===_.kind?(x=[Fh*o.layout.get("text-size").evaluate(a,{},g)],x[0]>Ad&&H(`${t.layerIds[0]}: Value for "text-size" is >= ${wd}. Reduce your "text-size".`)):"composite"===_.kind&&(x=[Fh*f.compositeTextSizes[0].evaluate(a,{},g),Fh*f.compositeTextSizes[1].evaluate(a,{},g)],(x[0]>Ad||x[1]>Ad)&&H(`${t.layerIds[0]}: Value for "text-size" is >= ${wd}. Reduce your "text-size".`)),t.addSymbols(t.text,y,x,l,s,a,u,e,i,c.lineStartIndex,c.lineLength,d,m,g);for(const e of h)p[e]=t.text.placedSymbolArray.length-1;return 4*y.length}function Sd(t){for(const e in t)return t[e];return null}function Md(t,e,i,n,r,o,s,a,l,c){let u=s.top,h=s.bottom,p=s.left,d=s.right;const f=s.collisionPadding;if(f&&(p-=f[0],u-=f[1],d+=f[2],h+=f[3]),l){const t=new v(p,u),e=new v(d,u),i=new v(p,h),n=new v(d,h),r=b(l);let o=new v(0,0);c&&(o=new v(c[0],c[1])),t._rotateAround(r,o),e._rotateAround(r,o),i._rotateAround(r,o),n._rotateAround(r,o),p=Math.min(t.x,e.x,i.x,n.x),d=Math.max(t.x,e.x,i.x,n.x),u=Math.min(t.y,e.y,i.y,n.y),h=Math.max(t.y,e.y,i.y,n.y)}return t.emplaceBack(e.x,e.y,e.z,i.x,i.y,p,u,d,h,a,n,r,o),t.length-1}function Td(t){t.collisionPadding&&(t.top-=t.collisionPadding[1],t.bottom+=t.collisionPadding[3]);const e=t.bottom-t.top;return e>0?Math.max(10,e):null}function Id(t,e,i,n){const r=t.compareText;if(e in r){const t=r[e];for(let e=t.length-1;e>=0;e--)if(n.dist(t[e])<i)return!0}else r[e]=[];return r[e].push(n),!1}function Cd(t,e){const i=t.fovAboveCenter,n=t.elevation?t.elevation.getMinElevationBelowMSL()*e:0,r=(t._camera.position[2]*t.worldSize-n)/Math.cos(t._pitch),o=Math.sin(i)*r/Math.sin(Math.max(Math.PI/2-t._pitch-i,.01)),s=Math.sin(t._pitch)*o+r;return Math.min(1.01*s,r*(1/t._horizonShift))}function Pd(t,e){if(!e.isReprojectedInTileSpace)return{scale:1<<t.z,x:t.x,y:t.y,x2:t.x+1,y2:t.y+1,projection:e};const i=Math.pow(2,-t.z),n=t.x*i,r=(t.x+1)*i,o=t.y*i,s=(t.y+1)*i,a=Xl(n),l=Xl(r),c=Zl(o),u=Zl(s),h=e.project(a,c),p=e.project(l,c),d=e.project(l,u),f=e.project(a,u);let m=Math.min(h.x,p.x,d.x,f.x),g=Math.min(h.y,p.y,d.y,f.y),y=Math.max(h.x,p.x,d.x,f.x),v=Math.max(h.y,p.y,d.y,f.y);const _=i/16;function x(t,i,n,r,o,s){const a=(n+o)/2,l=(r+s)/2,c=e.project(Xl(a),Zl(l)),u=Math.max(0,m-c.x,g-c.y,c.x-y,c.y-v);m=Math.min(m,c.x),y=Math.max(y,c.x),g=Math.min(g,c.y),v=Math.max(v,c.y),u>_&&(x(t,c,n,r,a,l),x(c,i,a,l,o,s))}x(h,p,n,o,r,o),x(p,d,r,o,r,s),x(d,f,r,s,n,s),x(f,h,n,s,n,o),m-=_,g-=_,y+=_,v+=_;const b=1/Math.max(y-m,v-g);return{scale:b,x:m*b,y:g*b,x2:y*b,y2:v*b,projection:e}}const Ld=da(new Float32Array(16));class Dd{constructor(t){this.spec=t,this.name=t.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(t,e){return{x:0,y:0,z:0}}unproject(t,e){return new Gl(0,0)}projectTilePoint(t,e,i){return{x:t,y:e,z:0}}locationPoint(t,e,i=!0){return t._coordinatePoint(t.locationCoordinate(e),i)}pixelsPerMeter(t,e){return ql(1,t)*e}pixelSpaceConversion(t,e,i){return 1}farthestPixelDistance(t){return Cd(t,t.pixelsPerMeter)}pointCoordinate(t,e,i,n){const r=t.horizonLineFromTop(!1),o=new v(e,Math.max(r,i));return t.rayIntersectionCoordinate(t.pointRayIntersection(o,n))}pointCoordinate3D(t,e,i){const n=new v(e,i);if(t.elevation)return t.elevation.pointCoordinate(n);{const e=this.pointCoordinate(t,n.x,n.y,0);return[e.x,e.y,e.z]}}isPointAboveHorizon(t,e){if(t.elevation)return!this.pointCoordinate3D(t,e.x,e.y);const i=t.horizonLineFromTop();return e.y<i}createInversionMatrix(t,e){return Ld}createTileMatrix(t,e,i){let n,r,o;const s=i.canonical,a=da(new Float64Array(16));if(this.isReprojectedInTileSpace){const l=Pd(s,this);n=1,r=l.x+i.wrap*l.scale,o=l.y,ya(a,a,[n/l.scale,n/l.scale,t.pixelsPerMeter/e])}else n=e/t.zoomScale(s.z),r=(s.x+Math.pow(2,s.z)*i.wrap)*n,o=s.y*n;return ga(a,a,[r,o,0]),ya(a,a,[n/aa,n/aa,1]),a}upVector(t,e,i){return[0,0,1]}upVectorScale(t,e,i){return{metersToTile:1}}}class Rd extends Dd{constructor(t){super(t),this.range=[4,7],this.center=t.center||[-96,37.5];const[e,i]=this.parallels=t.parallels||[29.5,45.5],n=Math.sin(b(e));this.n=(n+Math.sin(b(i)))/2,this.c=1+n*(2*this.n-n),this.r0=Math.sqrt(this.c)/this.n}project(t,e){const{n:i,c:n,r0:r}=this,o=b(t-this.center[0]),s=b(e),a=Math.sqrt(n-2*i*Math.sin(s))/i;return{x:a*Math.sin(o*i),y:a*Math.cos(o*i)-r,z:0}}unproject(t,e){const{n:i,c:n,r0:r}=this,o=r+e;let s=Math.atan2(t,Math.abs(o))*Math.sign(o);o*i<0&&(s-=Math.PI*Math.sign(t)*Math.sign(o));const a=b(this.center[0])*i;s=C(s,-Math.PI-a,Math.PI-a);const l=T(w(s/i)+this.center[0],-180,180),c=Math.asin(T((n-(t*t+o*o)*i*i)/(2*i),-1,1)),u=T(w(c),-Ql,Ql);return new Gl(l,u)}}const Od=1.340264,kd=-.081106,Nd=893e-6,Bd=.003796,zd=Math.sqrt(3)/2;class Fd extends Dd{project(t,e){e=e/180*Math.PI,t=t/180*Math.PI;const i=Math.asin(zd*Math.sin(e)),n=i*i,r=n*n*n;return{x:.5*(t*Math.cos(i)/(zd*(Od+3*kd*n+r*(7*Nd+9*Bd*n)))/Math.PI+.5),y:1-.5*(i*(Od+kd*n+r*(Nd+Bd*n))/Math.PI+1),z:0}}unproject(t,e){t=(2*t-.5)*Math.PI;let i=e=(2*(1-e)-1)*Math.PI,n=i*i,r=n*n*n;for(let t,o,s,a=0;a<12&&(o=i*(Od+kd*n+r*(Nd+Bd*n))-e,s=Od+3*kd*n+r*(7*Nd+9*Bd*n),t=o/s,i=T(i-t,-Math.PI/3,Math.PI/3),n=i*i,r=n*n*n,!(Math.abs(t)<1e-12));++a);const o=zd*t*(Od+3*kd*n+r*(7*Nd+9*Bd*n))/Math.cos(i),s=Math.asin(Math.sin(i)/zd),a=T(180*o/Math.PI,-180,180),l=T(180*s/Math.PI,-Ql,Ql);return new Gl(a,l)}}class Vd extends Dd{constructor(t){super(t),this.wrap=!0,this.supportsWorldCopies=!0}project(t,e){return{x:.5+t/360,y:.5-e/360,z:0}}unproject(t,e){const i=360*(t-.5),n=T(360*(.5-e),-Ql,Ql);return new Gl(i,n)}}const Ud=Math.PI/2;function Gd(t){return Math.tan((Ud+t)/2)}class jd extends Dd{constructor(t){super(t),this.center=t.center||[0,30];const[e,i]=this.parallels=t.parallels||[30,30];let n=b(e),r=b(i);this.southernCenter=n+r<0,this.southernCenter&&(n=-n,r=-r);const o=Math.cos(n),s=Gd(n);this.n=n===r?Math.sin(n):Math.log(o/Math.cos(r))/Math.log(Gd(r)/s),this.f=o*Math.pow(Gd(n),this.n)/this.n}project(t,e){e=b(e),this.southernCenter&&(e=-e),t=b(t-this.center[0]);const i=1e-6,{n:n,f:r}=this;r>0?e<-Ud+i&&(e=-Ud+i):e>Ud-i&&(e=Ud-i);const o=r/Math.pow(Gd(e),n);let s=o*Math.sin(n*t),a=r-o*Math.cos(n*t);return s=.5*(s/Math.PI+.5),a=.5*(a/Math.PI+.5),{x:s,y:this.southernCenter?a:1-a,z:0}}unproject(t,e){t=(2*t-.5)*Math.PI,this.southernCenter&&(e=1-e),e=(2*(1-e)-.5)*Math.PI;const{n:i,f:n}=this,r=n-e,o=Math.sign(r),s=Math.sign(i)*Math.sqrt(t*t+r*r);let a=Math.atan2(t,Math.abs(r))*o;r*i<0&&(a-=Math.PI*Math.sign(t)*o);const l=T(w(a/i)+this.center[0],-180,180),c=T(w(2*Math.atan(Math.pow(n/s,1/i))-Ud),-Ql,Ql);return new Gl(l,this.southernCenter?-c:c)}}class Hd extends Dd{constructor(t){super(t),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(t,e){return{x:Hl(t),y:Wl(e),z:0}}unproject(t,e){const i=Xl(t),n=Zl(e);return new Gl(i,n)}}const Wd=b(Ql);class qd extends Dd{project(t,e){const i=(e=b(e))*e,n=i*i;return{x:.5*((t=b(t))*(.8707-.131979*i+n*(n*(.003971*i-.001529*n)-.013791))/Math.PI+.5),y:1-.5*(e*(1.007226+i*(.015085+n*(.028874*i-.044475-.005916*n)))/Math.PI+1),z:0}}unproject(t,e){t=(2*t-.5)*Math.PI;let i=e=(2*(1-e)-1)*Math.PI,n=25,r=0,o=i*i;do{o=i*i;const t=o*o;r=(i*(1.007226+o*(.015085+t*(.028874*o-.044475-.005916*t)))-e)/(1.007226+o*(.045255+t*(.259866*o-.311325-.005916*11*t))),i=T(i-r,-Wd,Wd)}while(Math.abs(r)>1e-6&&--n>0);o=i*i;const s=T(w(t/(.8707+o*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979))),-180,180),a=w(i);return new Gl(s,a)}}const Xd=b(Ql);class Zd extends Dd{project(t,e){e=b(e),t=b(t);const i=Math.cos(e),n=2/Math.PI,r=Math.acos(i*Math.cos(t/2)),o=Math.sin(r)/r,s=.5*(t*n+2*i*Math.sin(t/2)/o)||0,a=.5*(e+Math.sin(e)/o)||0;return{x:.5*(s/Math.PI+.5),y:1-.5*(a/Math.PI+1),z:0}}unproject(t,e){let i=t=(2*t-.5)*Math.PI,n=e=(2*(1-e)-1)*Math.PI,r=25;const o=1e-6;let s=0,a=0;do{const r=Math.cos(n),o=Math.sin(n),l=2*o*r,c=o*o,u=r*r,h=Math.cos(i/2),p=Math.sin(i/2),d=2*h*p,f=p*p,m=1-u*h*h,g=m?1/m:0,y=m?Math.acos(r*h)*Math.sqrt(1/m):0,v=.5*(2*y*r*p+2*i/Math.PI)-t,_=.5*(y*o+n)-e,x=.5*g*(u*f+y*r*h*c)+1/Math.PI,b=g*(d*l/4-y*o*p),w=.125*g*(l*p-y*o*u*d),A=.5*g*(c*h+y*f*r)+.5,E=b*w-A*x;s=(_*b-v*A)/E,a=(v*w-_*x)/E,i=T(i-s,-Math.PI,Math.PI),n=T(n-a,-Xd,Xd)}while((Math.abs(s)>o||Math.abs(a)>o)&&--r>0);return new Gl(w(i),w(n))}}class Yd extends Dd{constructor(t){super(t),this.center=t.center||[0,0],this.parallels=t.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(b(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(t,e){const{scale:i,cosPhi:n}=this;return{x:b(t)*n*i+.5,y:-Math.sin(b(e))/n*i+.5,z:0}}unproject(t,e){const{scale:i,cosPhi:n}=this,r=-(e-.5)/i,o=T(w((t-.5)/i)/n,-180,180),s=Math.asin(T(r*n,-1,1)),a=T(w(s),-Ql,Ql);return new Gl(o,a)}}class Qd extends Hd{constructor(t){super(t),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(t,e,i){const n=Tl(t,e,i);return Ba(n,n,Pl(vl(i))),{x:n[0],y:n[1],z:n[2]}}locationPoint(t,e){const i=Ml(e.lat,e.lng),n=Oa([],i),r=t.elevation?t.elevation.getAtPointOrZero(t.locationCoordinate(e),t._centerAltitude):t._centerAltitude;Ra(i,i,n,ql(1,0)*aa*r);const o=da(new Float64Array(16));return ma(o,t.pixelMatrix,t.globeMatrix),Ba(i,i,o),new v(i[0],i[1])}pixelsPerMeter(t,e){return ql(1,0)*e}pixelSpaceConversion(t,e,i){const n=ql(1,t)*e,r=Li(ql(1,45)*e,n,i);return this.pixelsPerMeter(t,e)/r}createTileMatrix(t,e,i){const n=Ll(vl(i.canonical));return ma(new Float64Array(16),t.globeMatrix,n)}createInversionMatrix(t,e){const{center:i}=t,n=Pl(vl(e));return _a(n,n,b(i.lng)),va(n,n,b(i.lat)),ya(n,n,[t._pixelsPerMercatorPixel,t._pixelsPerMercatorPixel,1]),Float32Array.from(n)}pointCoordinate(t,e,i,n){return ml(t,e,i,!0)||new Kl(0,0)}pointCoordinate3D(t,e,i){const n=this.pointCoordinate(t,e,i,0);return[n.x,n.y,n.z]}isPointAboveHorizon(t,e){return!ml(t,e.x,e.y,!1)}farthestPixelDistance(t){const e=function(t,e){const i=t.cameraToCenterDistance,n=t._centerAltitude*e,r=t._camera,o=t._camera.forward(),s=Ta([],Da([],o,-i),[0,0,n]),a=t.worldSize/(2*Math.PI),l=[0,0,-a],c=t.width/t.height,u=Math.tan(t.fovAboveCenter),h=Da([],r.up(),u),p=Da([],r.right(),u*c),d=Oa([],Ta([],Ta([],o,h),p)),f=[];let m;if(new el(s,d).closestPointOnSphere(l,a,f)){const e=Ta([],f,l),i=Va([],e,s);m=Math.cos(t.fovAboveCenter)*Sa(i)}else{const t=Va([],s,l),e=Va([],l,s);Oa(e,e);const i=Sa(t)-a;m=Math.sqrt(i*(i+2*a));const n=Math.acos(m/(a+i))-Math.acos(ka(o,e));m*=Math.cos(n)}return 1.01*m}(t,this.pixelsPerMeter(t.center.lat,t.worldSize)),i=Rl(t.zoom);if(i>0){const n=Cd(t,ql(1,t.center.lat)*t.worldSize),r=t.worldSize/(2*Math.PI),o=Math.max(t.width,t.height)/t.worldSize*Math.PI;return Li(e,n+r*(1-Math.cos(o)),Math.pow(i,10))}return e}upVector(t,e,i){return Tl(e,i,t,1)}upVectorScale(t){return{metersToTile:fl(Il(vl(t)))}}}function Jd(t){const e=t.parallels,i=!!e&&Math.abs(e[0]+e[1])<.01;switch(t.name){case"mercator":return new Hd(t);case"equirectangular":return new Vd(t);case"naturalEarth":return new qd(t);case"equalEarth":return new Fd(t);case"winkelTripel":return new Zd(t);case"albers":return i?new Yd(t):new Rd(t);case"lambertConformalConic":return i?new Yd(t):new jd(t);case"globe":return new Qd(t)}throw new Error(`Invalid projection name: ${t.name}`)}const Kd=Xu.types,$d=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function tf(t,e,i,n,r,o,s,a,l,c,u,h,p){const d=a?Math.min(Ad,Math.round(a[0])):0,f=a?Math.min(Ad,Math.round(a[1])):0;t.emplaceBack(e,i,Math.round(32*n),Math.round(32*r),o,s,(d<<1)+(l?1:0),f,16*c,16*u,256*h,256*p)}function ef(t,e,i,n,r,o,s){t.emplaceBack(e,i,n,r,o,s)}function nf(t,e,i,n,r){t.emplaceBack(e,i,n,r),t.emplaceBack(e,i,n,r),t.emplaceBack(e,i,n,r),t.emplaceBack(e,i,n,r)}function rf(t){for(const e of t.sections)if(lo(e.text))return!0;return!1}class of{constructor(t){this.layoutVertexArray=new Yo,this.indexArray=new ns,this.programConfigurations=t,this.segments=new sa,this.dynamicLayoutVertexArray=new Wo,this.opacityVertexArray=new Jo,this.placedSymbolArray=new ms,this.globeExtVertexArray=new Qo}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(t,e,i,n){this.isEmpty()||(i&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Lh.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Rh.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,$d,!0),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=t.createVertexBuffer(this.globeExtVertexArray,Dh.members,!0)),this.opacityVertexBuffer.itemSize=1),(i||n)&&this.programConfigurations.upload(t))}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())}}Yr(of,"SymbolBuffers");class sf{constructor(t,e,i){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new i,this.segments=new sa,this.collisionVertexArray=new es,this.collisionVertexArrayExt=new is}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,Oh.members,!0),this.collisionVertexBufferExt=t.createVertexBuffer(this.collisionVertexArrayExt,kh.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy())}}Yr(sf,"CollisionBuffers");class af{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=da([]),this.placementViewportMatrix=da([]);const e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Vh(this.zoom,e["text-size"]),this.iconSizeData=Vh(this.zoom,e["icon-size"]);const i=this.layers[0].layout,n=i.get("symbol-sort-key"),r=i.get("symbol-z-order");this.canOverlap=i.get("text-allow-overlap")||i.get("icon-allow-overlap")||i.get("text-ignore-placement")||i.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==r&&void 0!==n.constantOr(1),this.sortFeaturesByY=("viewport-y"===r||"auto"===r&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=i.get("text-writing-mode").map((t=>Mp[t])),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.sourceID=t.sourceID,this.projection=t.projection}createArrays(){this.text=new of(new Qs(this.layers,this.zoom,(t=>/^text/.test(t)))),this.icon=new of(new Qs(this.layers,this.zoom,(t=>/^icon/.test(t)))),this.glyphOffsetArray=new vs,this.lineVertexArray=new _s,this.symbolInstances=new ys}calculateGlyphDependencies(t,e,i,n,r){for(let i=0;i<t.length;i++)if(e[t.charCodeAt(i)]=!0,n&&r){const n=Wh[t.charAt(i)];n&&(e[n.charCodeAt(0)]=!0)}}populate(t,e,i,n){const r=this.layers[0],o=r.layout,s="globe"===this.projection.name,a=o.get("text-font"),l=o.get("text-field"),c=o.get("icon-image"),u=("constant"!==l.value.kind||l.value.value instanceof Oe&&!l.value.value.isEmpty()||l.value.value.toString().length>0)&&("constant"!==a.value.kind||a.value.value.length>0),h="constant"!==c.value.kind||!!c.value.value||Object.keys(c.parameters).length>0,p=o.get("symbol-sort-key");if(this.features=[],!u&&!h)return;const d=e.iconDependencies,f=e.glyphDependencies,m=e.availableImages,g=new wo(this.zoom);for(const{feature:e,id:l,index:c,sourceLayerIndex:y}of t){const t=r._featureFilter.needGeometry,v=ac(e,t);if(!r._featureFilter.filter(g,v,i))continue;if(t||(v.geometry=sc(e,i,n)),s&&1!==e.type&&i.z<=5){const t=v.geometry,e=.98078528056,n=(t,n)=>ka(Tl(t.x,t.y,i,1),Tl(n.x,n.y,i,1))<e;for(let e=0;e<t.length;e++)t[e]=ic(t[e],n)}let _,x;if(u){const t=r.getValueAndResolveTokens("text-field",v,i,m),e=Oe.factory(t);rf(e)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===_o()||this.hasRTLText&&bo.isParsed())&&(_=Hh(e,r,v))}if(h){const t=r.getValueAndResolveTokens("icon-image",v,i,m);x=t instanceof ke?t:ke.fromString(t)}if(!_&&!x)continue;const b=this.sortFeaturesByKey?p.evaluate(v,{},i):void 0;if(this.features.push({id:l,text:_,icon:x,index:c,sourceLayerIndex:y,geometry:v.geometry,properties:e.properties,type:Kd[e.type],sortKey:b}),x&&(d[x.name]=!0),_){const t=a.evaluate(v,{},i).join(","),e="map"===o.get("text-rotation-alignment")&&"point"!==o.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(Mp.vertical)>=0;for(const i of _.sections)if(i.image)d[i.image.name]=!0;else{const n=eo(_.toString()),r=i.fontStack||t,o=f[r]=f[r]||{};this.calculateGlyphDependencies(i.text,o,e,this.allowVerticalPlacement,n)}}}"line"===o.get("symbol-placement")&&(this.features=function(t){const e={},i={},n=[];let r=0;function o(e){n.push(t[e]),r++}function s(t,e,r){const o=i[t];return delete i[t],i[e]=o,n[o].geometry[0].pop(),n[o].geometry[0]=n[o].geometry[0].concat(r[0]),o}function a(t,i,r){const o=e[i];return delete e[i],e[t]=o,n[o].geometry[0].shift(),n[o].geometry[0]=r[0].concat(n[o].geometry[0]),o}function l(t,e,i){const n=i?e[0][e[0].length-1]:e[0][0];return`${t}:${n.x}:${n.y}`}for(let c=0;c<t.length;c++){const u=t[c],h=u.geometry,p=u.text?u.text.toString():null;if(!p){o(c);continue}const d=l(p,h),f=l(p,h,!0);if(d in i&&f in e&&i[d]!==e[f]){const t=a(d,f,h),r=s(d,f,n[t].geometry);delete e[d],delete i[f],i[l(p,n[r].geometry,!0)]=r,n[t].geometry=null}else d in i?s(d,f,h):f in e?a(d,f,h):(o(c),e[d]=r-1,i[f]=r-1)}return n.filter((t=>t.geometry))}(this.features)),this.sortFeaturesByKey&&this.features.sort(((t,e)=>t.sortKey-e.sortKey))}update(t,e,i,n){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,i,n),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,i,n))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=Jd(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,e){const i=this.lineVertexArray.length;if(void 0!==t.segment)for(const{x:t,y:i}of e)this.lineVertexArray.emplaceBack(t,i);return{lineStartIndex:i,lineLength:this.lineVertexArray.length-i}}addSymbols(t,e,i,n,r,o,s,a,l,c,u,h,p,d){const f=t.indexArray,m=t.layoutVertexArray,g=t.globeExtVertexArray,y=t.segments.prepareSegment(4*e.length,m,f,this.canOverlap?o.sortKey:void 0),v=this.glyphOffsetArray.length,_=y.vertexLength,x=this.allowVerticalPlacement&&s===Mp.vertical?Math.PI/2:0,b=o.text&&o.text.sections;for(let n=0;n<e.length;n++){const{tl:r,tr:s,bl:c,br:u,tex:h,pixelOffsetTL:v,pixelOffsetBR:_,minFontScaleX:w,minFontScaleY:A,glyphOffset:E,isSDF:S,sectionIndex:M}=e[n],T=y.vertexLength,I=E[1];if(tf(m,l.x,l.y,r.x,I+r.y,h.x,h.y,i,S,v.x,v.y,w,A),tf(m,l.x,l.y,s.x,I+s.y,h.x+h.w,h.y,i,S,_.x,v.y,w,A),tf(m,l.x,l.y,c.x,I+c.y,h.x,h.y+h.h,i,S,v.x,_.y,w,A),tf(m,l.x,l.y,u.x,I+u.y,h.x+h.w,h.y+h.h,i,S,_.x,_.y,w,A),a){const{x:e,y:i,z:n}=a.anchor,[r,o,s]=a.up;ef(g,e,i,n,r,o,s),ef(g,e,i,n,r,o,s),ef(g,e,i,n,r,o,s),ef(g,e,i,n,r,o,s),nf(t.dynamicLayoutVertexArray,e,i,n,x)}else nf(t.dynamicLayoutVertexArray,l.x,l.y,l.z,x);f.emplaceBack(T,T+1,T+2),f.emplaceBack(T+1,T+2,T+3),y.vertexLength+=4,y.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(E[0]),n!==e.length-1&&M===e[n+1].sectionIndex||t.programConfigurations.populatePaintArrays(m.length,o,o.index,{},p,d,b&&b[M])}const w=a?a.anchor:l;t.placedSymbolArray.emplaceBack(w.x,w.y,w.z,l.x,l.y,v,this.glyphOffsetArray.length-v,_,c,u,l.segment,i?i[0]:0,i?i[1]:0,n[0],n[1],s,0,!1,0,h,0)}_commitLayoutVertex(t,e,i,n,r,o,s){t.emplaceBack(e,i,n,r,o,Math.round(s.x),Math.round(s.y))}_addCollisionDebugVertices(t,e,i,n,r,o,s){const a=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray),l=a.vertexLength,c=s.tileAnchorX,u=s.tileAnchorY;for(let t=0;t<4;t++)i.collisionVertexArray.emplaceBack(0,0,0,0);i.collisionVertexArrayExt.emplaceBack(e,-t.padding,-t.padding),i.collisionVertexArrayExt.emplaceBack(e,t.padding,-t.padding),i.collisionVertexArrayExt.emplaceBack(e,t.padding,t.padding),i.collisionVertexArrayExt.emplaceBack(e,-t.padding,t.padding),this._commitLayoutVertex(i.layoutVertexArray,n,r,o,c,u,new v(t.x1,t.y1)),this._commitLayoutVertex(i.layoutVertexArray,n,r,o,c,u,new v(t.x2,t.y1)),this._commitLayoutVertex(i.layoutVertexArray,n,r,o,c,u,new v(t.x2,t.y2)),this._commitLayoutVertex(i.layoutVertexArray,n,r,o,c,u,new v(t.x1,t.y2)),a.vertexLength+=4;const h=i.indexArray;h.emplaceBack(l,l+1),h.emplaceBack(l+1,l+2),h.emplaceBack(l+2,l+3),h.emplaceBack(l+3,l),a.primitiveLength+=4}_addTextDebugCollisionBoxes(t,e,i,n,r,o){for(let s=n;s<r;s++){const n=i.get(s),r=this.getSymbolInstanceTextSize(t,o,e,s);this._addCollisionDebugVertices(n,r,this.textCollisionBox,n.projectedAnchorX,n.projectedAnchorY,n.projectedAnchorZ,o)}}_addIconDebugCollisionBoxes(t,e,i,n,r,o){for(let s=n;s<r;s++){const n=i.get(s),r=this.getSymbolInstanceIconSize(t,e,o.placedIconSymbolIndex);this._addCollisionDebugVertices(n,r,this.iconCollisionBox,n.projectedAnchorX,n.projectedAnchorY,n.projectedAnchorZ,o)}}generateCollisionDebugBuffers(t,e){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new sf($o,Nh.members,cs),this.iconCollisionBox=new sf($o,Nh.members,cs);const i=Gh(this.iconSizeData,t),n=Gh(this.textSizeData,t);for(let r=0;r<this.symbolInstances.length;r++){const o=this.symbolInstances.get(r);this._addTextDebugCollisionBoxes(n,t,e,o.textBoxStartIndex,o.textBoxEndIndex,o),this._addTextDebugCollisionBoxes(n,t,e,o.verticalTextBoxStartIndex,o.verticalTextBoxEndIndex,o),this._addIconDebugCollisionBoxes(i,t,e,o.iconBoxStartIndex,o.iconBoxEndIndex,o),this._addIconDebugCollisionBoxes(i,t,e,o.verticalIconBoxStartIndex,o.verticalIconBoxEndIndex,o)}}getSymbolInstanceTextSize(t,e,i,n){const r=this.text.placedSymbolArray.get(e.rightJustifiedTextSymbolIndex>=0?e.rightJustifiedTextSymbolIndex:e.centerJustifiedTextSymbolIndex>=0?e.centerJustifiedTextSymbolIndex:e.leftJustifiedTextSymbolIndex>=0?e.leftJustifiedTextSymbolIndex:e.verticalPlacedTextSymbolIndex>=0?e.verticalPlacedTextSymbolIndex:n),o=Uh(this.textSizeData,t,r)/zh;return this.tilePixelRatio*o}getSymbolInstanceIconSize(t,e,i){const n=this.icon.placedSymbolArray.get(i),r=Uh(this.iconSizeData,t,n);return this.tilePixelRatio*r}_commitDebugCollisionVertexUpdate(t,e,i){t.emplaceBack(e,-i,-i),t.emplaceBack(e,i,-i),t.emplaceBack(e,i,i),t.emplaceBack(e,-i,i)}_updateTextDebugCollisionBoxes(t,e,i,n,r,o){for(let s=n;s<r;s++){const n=i.get(s),r=this.getSymbolInstanceTextSize(t,o,e,s);this._commitDebugCollisionVertexUpdate(this.textCollisionBox.collisionVertexArrayExt,r,n.padding)}}_updateIconDebugCollisionBoxes(t,e,i,n,r,o){for(let s=n;s<r;s++){const n=i.get(s),r=this.getSymbolInstanceIconSize(t,e,o);this._commitDebugCollisionVertexUpdate(this.iconCollisionBox.collisionVertexArrayExt,r,n.padding)}}updateCollisionDebugBuffers(t,e){if(!this.hasDebugData())return;this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexArrayExt.clear(),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexArrayExt.clear();const i=Gh(this.iconSizeData,t),n=Gh(this.textSizeData,t);for(let r=0;r<this.symbolInstances.length;r++){const o=this.symbolInstances.get(r);this._updateTextDebugCollisionBoxes(n,t,e,o.textBoxStartIndex,o.textBoxEndIndex,o),this._updateTextDebugCollisionBoxes(n,t,e,o.verticalTextBoxStartIndex,o.verticalTextBoxEndIndex,o),this._updateIconDebugCollisionBoxes(i,t,e,o.iconBoxStartIndex,o.iconBoxEndIndex,o.placedIconSymbolIndex),this._updateIconDebugCollisionBoxes(i,t,e,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(t,e,i,n,r,o,s,a,l){const c={};if(e<i){const{x1:i,y1:n,x2:r,y2:o,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:p,featureIndex:d}=t.get(e);c.textBox={x1:i,y1:n,x2:r,y2:o,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:p},c.textFeatureIndex=d}if(n<r){const{x1:e,y1:i,x2:r,y2:o,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:p,featureIndex:d}=t.get(n);c.verticalTextBox={x1:e,y1:i,x2:r,y2:o,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:p},c.verticalTextFeatureIndex=d}if(o<s){const{x1:e,y1:i,x2:n,y2:r,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:p,featureIndex:d}=t.get(o);c.iconBox={x1:e,y1:i,x2:n,y2:r,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:p},c.iconFeatureIndex=d}if(a<l){const{x1:e,y1:i,x2:n,y2:r,padding:o,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:p,featureIndex:d}=t.get(a);c.verticalIconBox={x1:e,y1:i,x2:n,y2:r,padding:o,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:p},c.verticalIconFeatureIndex=d}return c}deserializeCollisionBoxes(t){this.collisionArrays=[];for(let e=0;e<this.symbolInstances.length;e++){const i=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,i.textBoxStartIndex,i.textBoxEndIndex,i.verticalTextBoxStartIndex,i.verticalTextBoxEndIndex,i.iconBoxStartIndex,i.iconBoxEndIndex,i.verticalIconBoxStartIndex,i.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(t,e){const i=t.placedSymbolArray.get(e),n=i.vertexStartIndex+4*i.numGlyphs;for(let e=i.vertexStartIndex;e<n;e+=4)t.indexArray.emplaceBack(e,e+1,e+2),t.indexArray.emplaceBack(e+1,e+2,e+3)}getSortedSymbolIndexes(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const e=Math.sin(t),i=Math.cos(t),n=[],r=[],o=[];for(let t=0;t<this.symbolInstances.length;++t){o.push(t);const s=this.symbolInstances.get(t);n.push(0|Math.round(e*s.tileAnchorX+i*s.tileAnchorY)),r.push(s.featureIndex)}return o.sort(((t,e)=>n[t]-n[e]||r[e]-r[t])),o}addToSortKeyRanges(t,e){const i=this.sortKeyRanges[this.sortKeyRanges.length-1];i&&i.sortKey===e?i.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const t of this.symbolInstanceIndexes){const e=this.symbolInstances.get(t);this.featureSortOrder.push(e.featureIndex);const{rightJustifiedTextSymbolIndex:i,centerJustifiedTextSymbolIndex:n,leftJustifiedTextSymbolIndex:r,verticalPlacedTextSymbolIndex:o,placedIconSymbolIndex:s,verticalPlacedIconSymbolIndex:a}=e;i>=0&&this.addIndicesForPlacedSymbol(this.text,i),n>=0&&n!==i&&this.addIndicesForPlacedSymbol(this.text,n),r>=0&&r!==n&&r!==i&&this.addIndicesForPlacedSymbol(this.text,r),o>=0&&this.addIndicesForPlacedSymbol(this.text,o),s>=0&&this.addIndicesForPlacedSymbol(this.icon,s),a>=0&&this.addIndicesForPlacedSymbol(this.icon,a)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}Yr(af,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),af.MAX_GLYPHS=65535,af.addDynamicAttributes=nf;const lf=new Oo({"symbol-placement":new Lo(te.layout_symbol["symbol-placement"]),"symbol-spacing":new Lo(te.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Lo(te.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Do(te.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Lo(te.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Lo(te.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Lo(te.layout_symbol["icon-ignore-placement"]),"icon-optional":new Lo(te.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Lo(te.layout_symbol["icon-rotation-alignment"]),"icon-size":new Do(te.layout_symbol["icon-size"]),"icon-text-fit":new Lo(te.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Lo(te.layout_symbol["icon-text-fit-padding"]),"icon-image":new Do(te.layout_symbol["icon-image"]),"icon-rotate":new Do(te.layout_symbol["icon-rotate"]),"icon-padding":new Lo(te.layout_symbol["icon-padding"]),"icon-keep-upright":new Lo(te.layout_symbol["icon-keep-upright"]),"icon-offset":new Do(te.layout_symbol["icon-offset"]),"icon-anchor":new Do(te.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Lo(te.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Lo(te.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Lo(te.layout_symbol["text-rotation-alignment"]),"text-field":new Do(te.layout_symbol["text-field"]),"text-font":new Do(te.layout_symbol["text-font"]),"text-size":new Do(te.layout_symbol["text-size"]),"text-max-width":new Do(te.layout_symbol["text-max-width"]),"text-line-height":new Do(te.layout_symbol["text-line-height"]),"text-letter-spacing":new Do(te.layout_symbol["text-letter-spacing"]),"text-justify":new Do(te.layout_symbol["text-justify"]),"text-radial-offset":new Do(te.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Lo(te.layout_symbol["text-variable-anchor"]),"text-anchor":new Do(te.layout_symbol["text-anchor"]),"text-max-angle":new Lo(te.layout_symbol["text-max-angle"]),"text-writing-mode":new Lo(te.layout_symbol["text-writing-mode"]),"text-rotate":new Do(te.layout_symbol["text-rotate"]),"text-padding":new Lo(te.layout_symbol["text-padding"]),"text-keep-upright":new Lo(te.layout_symbol["text-keep-upright"]),"text-transform":new Do(te.layout_symbol["text-transform"]),"text-offset":new Do(te.layout_symbol["text-offset"]),"text-allow-overlap":new Lo(te.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Lo(te.layout_symbol["text-ignore-placement"]),"text-optional":new Lo(te.layout_symbol["text-optional"])});var cf={paint:new Oo({"icon-opacity":new Do(te.paint_symbol["icon-opacity"]),"icon-color":new Do(te.paint_symbol["icon-color"]),"icon-halo-color":new Do(te.paint_symbol["icon-halo-color"]),"icon-halo-width":new Do(te.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Do(te.paint_symbol["icon-halo-blur"]),"icon-translate":new Lo(te.paint_symbol["icon-translate"]),"icon-translate-anchor":new Lo(te.paint_symbol["icon-translate-anchor"]),"text-opacity":new Do(te.paint_symbol["text-opacity"]),"text-color":new Do(te.paint_symbol["text-color"],{runtimeType:pe,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new Do(te.paint_symbol["text-halo-color"]),"text-halo-width":new Do(te.paint_symbol["text-halo-width"]),"text-halo-blur":new Do(te.paint_symbol["text-halo-blur"]),"text-translate":new Lo(te.paint_symbol["text-translate"]),"text-translate-anchor":new Lo(te.paint_symbol["text-translate-anchor"])}),layout:lf};class uf{constructor(t){this.type=t.property.overrides?t.property.overrides.runtimeType:le,this.defaultValue=t}evaluate(t){if(t.formattedSection){const e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Yr(uf,"FormatSectionOverride",{omit:["defaultValue"]});class hf extends na{constructor(t){super(t,cf)}recalculate(t,e){super.recalculate(t,e),"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 i=this.layout.get("text-writing-mode");if(i){const t=[];for(const e of i)t.indexOf(e)<0&&t.push(e);this.layout._values["text-writing-mode"]=t}else this.layout._values["text-writing-mode"]="point"===this.layout.get("symbol-placement")?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getValueAndResolveTokens(t,e,i,n){const r=this.layout.get(t).evaluate(e,{},i,n),o=this._unevaluatedLayout._values[t];return o.isDataDriven()||Yn(o.value)||!r?r:function(t,e){return e.replace(/{([^{}]+)}/g,((e,i)=>i in t?String(t[i]):""))}(e.properties,r)}createBucket(t){return new af(t)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const t of cf.paint.overridableProperties){if(!hf.hasPaintOverride(this.layout,t))continue;const e=this.paint.get(t),i=new uf(e),n=new Zn(i,e.property.specification);let r=null;r="constant"===e.value.kind||"source"===e.value.kind?new Jn("source",n):new Kn("composite",n,e.value.zoomStops,e.value._interpolationType),this.paint._values[t]=new Co(e.property,r,e.parameters)}}_handleOverridablePaintPropertyUpdate(t,e,i){return!(!this.layout||e.isDataDriven()||i.isDataDriven())&&hf.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,e){const i=t.get("text-field"),n=cf.paint.properties[e];let r=!1;const o=t=>{for(const e of t)if(n.overrides&&n.overrides.hasOverride(e))return void(r=!0)};if("constant"===i.value.kind&&i.value.value instanceof Oe)o(i.value.value.sections);else if("source"===i.value.kind){const t=e=>{r||(e instanceof Ue&&ze(e.value)===ge?o(e.value.sections):e instanceof qe?o(e.sections):e.eachChild(t))},e=i.value;e._styleExpression&&t(e._styleExpression.expression)}return r}getProgramConfiguration(t){return new Ys(this,t)}}var pf={paint:new Oo({"background-color":new Lo(te.paint_background["background-color"]),"background-pattern":new Lo(te.paint_background["background-pattern"]),"background-opacity":new Lo(te.paint_background["background-opacity"])})},df={paint:new Oo({"raster-opacity":new Lo(te.paint_raster["raster-opacity"]),"raster-hue-rotate":new Lo(te.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Lo(te.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Lo(te.paint_raster["raster-brightness-max"]),"raster-saturation":new Lo(te.paint_raster["raster-saturation"]),"raster-contrast":new Lo(te.paint_raster["raster-contrast"]),"raster-resampling":new Lo(te.paint_raster["raster-resampling"]),"raster-fade-duration":new Lo(te.paint_raster["raster-fade-duration"])})};class ff extends na{constructor(t){super(t,{}),this.implementation=t}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(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)}onRemove(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)}}var mf={paint:new Oo({"sky-type":new Lo(te.paint_sky["sky-type"]),"sky-atmosphere-sun":new Lo(te.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new Lo(te.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new Lo(te.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new Lo(te.paint_sky["sky-gradient-radius"]),"sky-gradient":new Ro(te.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new Lo(te.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new Lo(te.paint_sky["sky-atmosphere-color"]),"sky-opacity":new Lo(te.paint_sky["sky-opacity"])})};function gf(t,e,i){const n=[0,0,1],r=Xa([]);return Ya(r,r,i?-b(t)+Math.PI:b(t)),Za(r,r,-b(e)),za(n,n,r),Oa(n,n)}const yf={circle:class extends na{constructor(t){super(t,Ic)}createBucket(t){return new uc(t)}queryRadius(t){const e=t;return Ac("circle-radius",this,e)+Ac("circle-stroke-width",this,e)+Ec(this.paint.get("circle-translate"))}queryIntersectsFeature(t,e,i,n,r,o,s,a){const l=Mc(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,t.pixelToTileUnitsFactor),c=this.paint.get("circle-radius").evaluate(e,i)+this.paint.get("circle-stroke-width").evaluate(e,i);return Cc(t,n,o,s,a,"map"===this.paint.get("circle-pitch-alignment"),"map"===this.paint.get("circle-pitch-scale"),l,c)}getProgramIds(){return["circle"]}getProgramConfiguration(t){return new Ys(this,t)}},heatmap:class extends na{createBucket(t){return new Oc(t)}constructor(t){super(t,Vc),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){"heatmap-color"===t&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Uc({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(t){return Ac("heatmap-radius",this,t)}queryIntersectsFeature(t,e,i,n,r,o,s,a){const l=this.paint.get("heatmap-radius").evaluate(e,i);return Cc(t,n,o,s,a,!0,!0,new v(0,0),l)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}getProgramIds(){return["heatmap","heatmapTexture"]}getProgramConfiguration(t){return new Ys(this,t)}},hillshade:class extends na{constructor(t){super(t,Gc)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}getProgramIds(){return["hillshade","hillshadePrepare"]}},fill:class extends na{constructor(t){super(t,Cu)}getProgramIds(){const t=this.paint.get("fill-pattern"),e=t&&t.constantOr(1),i=[e?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&i.push(e&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),i}getProgramConfiguration(t){return new Ys(this,t)}recalculate(t,e){super.recalculate(t,e);const i=this.paint._values["fill-outline-color"];"constant"===i.value.kind&&void 0===i.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new Tu(t)}queryRadius(){return Ec(this.paint.get("fill-translate"))}queryIntersectsFeature(t,e,i,n,r,o){return!t.queryGeometry.isAboveHorizon&&dc(Sc(t.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,t.pixelToTileUnitsFactor),n)}isTileClipped(){return!0}},"fill-extrusion":class extends na{constructor(t){super(t,uh)}createBucket(t){return new th(t)}queryRadius(){return Ec(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}getProgramConfiguration(t){return new Ys(this,t)}queryIntersectsFeature(t,e,i,n,r,o,s,a,l){const c=Mc(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),o.angle,t.pixelToTileUnitsFactor),u=this.paint.get("fill-extrusion-height").evaluate(e,i),h=this.paint.get("fill-extrusion-base").evaluate(e,i),p=[0,0],d=a&&o.elevation,f=o.elevation?o.elevation.exaggeration():1,m=t.tile.getBucket(this);if(d&&m instanceof th){const t=m.centroidVertexArray,e=l+1;e<t.length&&(p[0]=t.geta_centroid_pos0(e),p[1]=t.geta_centroid_pos1(e))}if(0===p[0]&&1===p[1])return!1;"globe"===o.projection.name&&(n=lh([n],[new v(0,0),new v(aa,aa)],t.tileID.canonical).map((t=>t.polygon)).flat());const g=d?a:null,[y,_]=function(t,e,i,n,r,o,s,a,l,c,u){return"globe"===t.projection.name?function(t,e,i,n,r,o,s,a,l,c,u){const h=[],p=[],d=t.projection.upVectorScale(u,t.center.lat,t.worldSize).metersToTile,f=[0,0,0,1],m=[0,0,0,1],g=(t,e,i,n)=>{t[0]=e,t[1]=i,t[2]=n,t[3]=1},y=ah();i>0&&(i+=y),n+=y;for(const y of e){const e=[],v=[];for(const h of y){const p=h.x+r.x,y=h.y+r.y,_=t.projection.projectTilePoint(p,y,u),x=t.projection.upVector(u,h.x,h.y);let b=i,w=n;if(s){const t=_h(p,y,i,n,s,a,l,c);b+=t.base,w+=t.top}0!==i?g(f,_.x+x[0]*d*b,_.y+x[1]*d*b,_.z+x[2]*d*b):g(f,_.x,_.y,_.z),g(m,_.x+x[0]*d*w,_.y+x[1]*d*w,_.z+x[2]*d*w),Ba(f,f,o),Ba(m,m,o),e.push(new gh(f[0],f[1],f[2])),v.push(new gh(m[0],m[1],m[2]))}h.push(e),p.push(v)}return[h,p]}(t,e,i,n,r,o,s,a,l,c,u):s?function(t,e,i,n,r,o,s,a,l){const c=[],u=[],h=[0,0,0,1];for(const p of t){const t=[],d=[];for(const c of p){const u=c.x+n.x,p=c.y+n.y,f=_h(u,p,e,i,o,s,a,l);h[0]=u,h[1]=p,h[2]=f.base,h[3]=1,Wa(h,h,r),h[3]=Math.max(h[3],1e-5);const m=new gh(h[0]/h[3],h[1]/h[3],h[2]/h[3]);h[0]=u,h[1]=p,h[2]=f.top,h[3]=1,Wa(h,h,r),h[3]=Math.max(h[3],1e-5);const g=new gh(h[0]/h[3],h[1]/h[3],h[2]/h[3]);t.push(m),d.push(g)}c.push(t),u.push(d)}return[c,u]}(e,i,n,r,o,s,a,l,c):function(t,e,i,n,r){const o=[],s=[],a=r[8]*e,l=r[9]*e,c=r[10]*e,u=r[11]*e,h=r[8]*i,p=r[9]*i,d=r[10]*i,f=r[11]*i;for(const e of t){const t=[],i=[];for(const o of e){const e=o.x+n.x,s=o.y+n.y,m=r[0]*e+r[4]*s+r[12],g=r[1]*e+r[5]*s+r[13],y=r[2]*e+r[6]*s+r[14],v=r[3]*e+r[7]*s+r[15],_=m+a,x=g+l,b=y+c,w=Math.max(v+u,1e-5),A=m+h,E=g+p,S=y+d,M=Math.max(v+f,1e-5);t.push(new gh(_/w,x/w,b/w)),i.push(new gh(A/M,E/M,S/M))}o.push(t),s.push(i)}return[o,s]}(e,i,n,r,o)}(o,n,h,u,c,s,g,p,f,o.center.lat,t.tileID.canonical),x=t.queryGeometry;return function(t,e,i){let n=1/0;dc(i,e)&&(n=vh(i,e[0]));for(let r=0;r<e.length;r++){const o=e[r],s=t[r];for(let t=0;t<o.length-1;t++){const e=o[t],r=[e,o[t+1],s[t+1],s[t],e];hc(i,r)&&(n=Math.min(n,vh(i,r)))}}return n!==1/0&&n}(y,_,x.isPointQuery()?x.screenBounds:x.screenGeometry)}},line:class extends na{constructor(t){super(t,Ih),this.gradientVersion=0}_handleSpecialPaintPropertyUpdate(t){if("line-gradient"===t){const t=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=t._styleExpression&&t._styleExpression.expression instanceof Pi,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(t,e){super.recalculate(t,e),this.paint._values["line-floorwidth"]=Ch.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new Mh(t)}getProgramIds(){return[this.paint.get("line-pattern").constantOr(1)?"linePattern":"line"]}getProgramConfiguration(t){return new Ys(this,t)}queryRadius(t){const e=t,i=Ph(Ac("line-width",this,e),Ac("line-gap-width",this,e)),n=Ac("line-offset",this,e);return i/2+Math.abs(n)+Ec(this.paint.get("line-translate"))}queryIntersectsFeature(t,e,i,n,r,o){if(t.queryGeometry.isAboveHorizon)return!1;const s=Sc(t.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,t.pixelToTileUnitsFactor),a=t.pixelToTileUnitsFactor/2*Ph(this.paint.get("line-width").evaluate(e,i),this.paint.get("line-gap-width").evaluate(e,i)),l=this.paint.get("line-offset").evaluate(e,i);return l&&(n=function(t,e){const i=[],n=new v(0,0);for(let r=0;r<t.length;r++){const o=t[r],s=[];for(let t=0;t<o.length;t++){const i=o[t],r=o[t+1],a=0===t?n:i.sub(o[t-1])._unit()._perp(),l=t===o.length-1?n:r.sub(i)._unit()._perp(),c=a._add(l)._unit();c._mult(1/(c.x*l.x+c.y*l.y)),s.push(c._mult(e)._add(i))}i.push(s)}return i}(n,l*t.pixelToTileUnitsFactor)),function(t,e,i){for(let n=0;n<e.length;n++){const r=e[n];if(t.length>=3)for(let e=0;e<r.length;e++)if(xc(t,r[e]))return!0;if(fc(t,r,i))return!0}return!1}(s,n,a)}isTileClipped(){return!0}},symbol:hf,background:class extends na{constructor(t){super(t,pf)}getProgramIds(){return[this.paint.get("background-pattern")?"backgroundPattern":"background"]}},raster:class extends na{constructor(t){super(t,df)}getProgramIds(){return["raster"]}},sky:class extends na{constructor(t){super(t,mf),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){"sky-gradient"===t?this._updateColorRamp():"sky-atmosphere-sun"!==t&&"sky-atmosphere-halo-color"!==t&&"sky-atmosphere-color"!==t&&"sky-atmosphere-sun-intensity"!==t||(this._skyboxInvalidated=!0)}_updateColorRamp(){this.colorRamp=Uc({expression:this._transitionablePaint._values["sky-gradient"].value.expression,evaluationKey:"skyRadialProgress"}),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}needsSkyboxCapture(t){if(this._skyboxInvalidated||!this.skyboxTexture||!this.skyboxGeometry)return!0;if(!this.paint.get("sky-atmosphere-sun")){const e=t.style.light.properties.get("position");return this._lightPosition.azimuthal!==e.azimuthal||this._lightPosition.polar!==e.polar}return!1}getCenter(t,e){if("atmosphere"===this.paint.get("sky-type")){const i=this.paint.get("sky-atmosphere-sun"),n=!i,r=t.style.light,o=r.properties.get("position");return n&&"viewport"===r.properties.get("anchor")&&H("The sun direction is attached to a light with viewport anchor, lighting may behave unexpectedly."),n?gf(o.azimuthal,90-o.polar,e):gf(i[0],90-i[1],e)}const i=this.paint.get("sky-gradient-center");return gf(i[0],90-i[1],e)}is3D(){return!1}isSky(){return!0}markSkyboxValid(t){this._skyboxInvalidated=!1,this._lightPosition=t.style.light.properties.get("position")}hasOffscreenPass(){return!0}getProgramIds(){const t=this.paint.get("sky-type");return"atmosphere"===t?["skyboxCapture","skybox"]:"gradient"===t?["skyboxGradient"]:null}}};class vf{constructor(t,e,i,n){this.context=t,this.format=i,this.texture=t.gl.createTexture(),this.update(e,n)}update(t,i,n){const{width:r,height:o}=t,{context:s}=this,{gl:a}=s,{HTMLImageElement:l,HTMLCanvasElement:c,HTMLVideoElement:u,ImageData:h,ImageBitmap:p}=e;if(a.bindTexture(a.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1),s.pixelStoreUnpackPremultiplyAlpha.set(this.format===a.RGBA&&(!i||!1!==i.premultiply)),n||this.size&&this.size[0]===r&&this.size[1]===o){const{x:e,y:i}=n||{x:0,y:0};t instanceof l||t instanceof c||t instanceof u||t instanceof h||p&&t instanceof p?a.texSubImage2D(a.TEXTURE_2D,0,e,i,a.RGBA,a.UNSIGNED_BYTE,t):a.texSubImage2D(a.TEXTURE_2D,0,e,i,r,o,a.RGBA,a.UNSIGNED_BYTE,t.data)}else this.size=[r,o],t instanceof l||t instanceof c||t instanceof u||t instanceof h||p&&t instanceof p?a.texImage2D(a.TEXTURE_2D,0,this.format,this.format,a.UNSIGNED_BYTE,t):a.texImage2D(a.TEXTURE_2D,0,this.format,r,o,0,this.format,a.UNSIGNED_BYTE,t.data);this.useMipmap=Boolean(i&&i.useMipmap&&this.isSizePowerOfTwo()),this.useMipmap&&a.generateMipmap(a.TEXTURE_2D)}bind(t,e){const{context:i}=this,{gl:n}=i;n.bindTexture(n.TEXTURE_2D,this.texture),t!==this.filter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,this.useMipmap?t===n.NEAREST?n.NEAREST_MIPMAP_NEAREST:n.LINEAR_MIPMAP_NEAREST:t),this.filter=t),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}class _f{constructor(t){this._callback=t,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=[],z(["process"],this),this.invoker=new _f(this.process),this.nextId=0}add(t,e){const i=this.nextId++,n=function({type:t,isSymbolTile:e,zoom:i}){return i=i||0,"message"===t?0:"maybePrepare"!==t||e?"parseTile"!==t||e?"parseTile"===t&&e?300-i:"maybePrepare"===t&&e?400-i:500:200-i:100-i}(e);if(0===n){X();try{t()}finally{}return{cancel:()=>{}}}return this.tasks[i]={fn:t,metadata:e,priority:n,id:i},this.taskQueue.push(i),this.invoker.trigger(),{cancel:()=>{delete this.tasks[i]}}}process(){X();try{if(this.taskQueue=this.taskQueue.filter((t=>!!this.tasks[t])),!this.taskQueue.length)return;const t=this.pick();if(null===t)return;const e=this.tasks[t];if(delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),!e)return;e.fn()}finally{}}pick(){let t=null,e=1/0;for(let i=0;i<this.taskQueue.length;i++){const n=this.tasks[this.taskQueue[i]];n.priority<e&&(e=n.priority,t=i)}if(null===t)return null;const i=this.taskQueue[t];return this.taskQueue.splice(t,1),i}remove(){this.invoker.remove()}}class bf{constructor(t){this._stringToNumber={},this._numberToString=[];for(let e=0;e<t.length;e++){const i=t[e];this._stringToNumber[i]=e,this._numberToString[e]=i}}encode(t){return this._stringToNumber[t]}decode(t){return this._numberToString[t]}}const wf=["tile","layer","source","sourceLayer","state"];class Af{constructor(t,e,i,n,r){this.type="Feature",this._vectorTileFeature=t,this._z=e,this._x=i,this._y=n,this.properties=t.properties,this.id=r}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._x,this._y,this._z).geometry),this._geometry}set geometry(t){this._geometry=t}toJSON(){const t={type:"Feature",state:void 0,geometry:this.geometry,properties:this.properties};void 0!==this.id&&(t.id=this.id);for(const e of wf)void 0!==this[e]&&(t[e]=this[e]);return t}}const Ef=32,Sf=33,Mf=new Uint16Array(8184);for(let t=0;t<2046;t++){let e=t+2,i=0,n=0,r=0,o=0,s=0,a=0;for(1&e?r=o=s=Ef:i=n=a=Ef;(e>>=1)>1;){const t=i+r>>1,l=n+o>>1;1&e?(r=i,o=n,i=s,n=a):(i=r,n=o,r=s,o=a),s=t,a=l}const l=4*t;Mf[l+0]=i,Mf[l+1]=n,Mf[l+2]=r,Mf[l+3]=o}const Tf=new Uint16Array(2178),If=new Uint8Array(1089),Cf=new Uint16Array(1089);function Pf(t){return 0===t?-.03125:32===t?.03125:0}var Lf=Fo([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);const Df={type:2,extent:aa,loadGeometry:()=>[[new v(0,0),new v(aa+1,0),new v(aa+1,aa+1),new v(0,aa+1),new v(0,0)]]};class Rf{constructor(t,e,i,n,r){this.tileID=t,this.uid=O(),this.uses=0,this.tileSize=e,this.tileZoom=i,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=r,this.expiredRequestCount=0,this.state="loading",n&&n.transform&&(this.projection=n.transform.projection)}registerFadeDuration(t){const e=t+this.timeAdded;e<Zt.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e)}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}get tileTransform(){return this._tileTransform||(this._tileTransform=Pd(this.tileID.canonical,this.projection)),this._tileTransform}loadVectorData(t,e,i){if(this.unloadVectorData(),this.state="loaded",t){t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){const i={};if(!e)return i;for(const n of t){const t=n.layerIds.map((t=>e.getLayer(t))).filter(Boolean);if(0!==t.length){n.layers=t,n.stateDependentLayerIds&&(n.stateDependentLayers=n.stateDependentLayerIds.map((e=>t.filter((t=>t.id===e))[0])));for(const e of t)i[e.id]=n}}return i}(t.buckets,e.style),this.hasSymbolBuckets=!1;for(const t in this.buckets){const e=this.buckets[t];if(e instanceof af){if(this.hasSymbolBuckets=!0,!i)break;e.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const t in this.buckets){const e=this.buckets[t];if(e instanceof af&&e.hasRTLText){this.hasRTLText=!0,bo.isLoading()||bo.isLoaded()||"deferred"!==_o()||xo();break}}this.queryPadding=0;for(const t in this.buckets){const i=this.buckets[t];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(t).queryRadius(i))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage),t.lineAtlas&&(this.lineAtlas=t.lineAtlas)}else this.collisionBoxArray=new ds}unloadVectorData(){if(this.hasData()){for(const t in this.buckets)this.buckets[t].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(t){return this.buckets[t.id]}upload(t){for(const e in this.buckets){const i=this.buckets[e];i.uploadPending()&&i.upload(t)}const e=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new vf(t,this.imageAtlas.image,e.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new vf(t,this.glyphAtlasImage,e.ALPHA),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new vf(t,this.lineAtlas.image,e.ALPHA),this.lineAtlas.uploaded=!0)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,e,i,n,r,o,s,a){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({tileResult:n,pixelPosMatrix:s,transform:o,params:r,tileTransform:this.tileTransform},t,e,i):{}}querySourceFeatures(t,e){const i=this.latestFeatureIndex;if(!i||!i.rawTileData)return;const n=i.loadVTLayers(),r=e?e.sourceLayer:"",o=n._geojsonTileLayer||n[r];if(!o)return;const s=hr(e&&e.filter),{z:a,x:l,y:c}=this.tileID.canonical,u={z:a,x:l,y:c};for(let e=0;e<o.length;e++){const n=o.feature(e);if(s.needGeometry){const t=ac(n,!0);if(!s.filter(new wo(this.tileID.overscaledZ),t,this.tileID.canonical))continue}else if(!s.filter(new wo(this.tileID.overscaledZ),n))continue;const h=i.getId(n,r),p=new Af(n,a,l,c,h);p.tile=u,t.push(p)}}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return!!this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(t){const e=this.expirationTime;if(t.cacheControl){const e=Z(t.cacheControl);e["max-age"]&&(this.expirationTime=Date.now()+1e3*e["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){const t=Date.now();let i=!1;if(this.expirationTime>t)i=!1;else if(e)if(this.expirationTime<e)i=!0;else{const n=this.expirationTime-e;n?this.expirationTime=t+Math.max(n,3e4):i=!0}else i=!0;i?(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(t,e){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||0===Object.keys(t).length||!e)return;const i=this.latestFeatureIndex.loadVTLayers(),n=e.style.listImages();for(const r in this.buckets){if(!e.style.hasLayer(r))continue;const o=this.buckets[r],s=o.layers[0].sourceLayer||"_geojsonTileLayer",a=i[s],l=t[s];if(!a||!l||0===Object.keys(l).length)continue;if(o.update(l,a,n,this.imageAtlas&&this.imageAtlas.patternPositions||{}),o instanceof Mh||o instanceof Tu){const t=e.style._getSourceCache(o.layers[0].source);e._terrain&&e._terrain.enabled&&t&&o.programConfigurations.needsUpload&&e._terrain._clearRenderCacheForTile(t.id,this.tileID)}const c=e&&e.style&&e.style.getLayer(r);c&&(this.queryPadding=Math.max(this.queryPadding,c.queryRadius(o)))}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<Zt.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(t){this.symbolFadeHoldUntil=Zt.now()+t}setTexture(t,e){const i=e.context,n=i.gl;this.texture=this.texture||e.getTileTexture(t.width),this.texture?this.texture.update(t,{useMipmap:!0}):(this.texture=new vf(i,t,n.RGBA,{useMipmap:!0}),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE))}setDependencies(t,e){const i={};for(const t of e)i[t]=!0;this.dependencies[t]=i}hasDependency(t,e){for(const i of t){const t=this.dependencies[i];if(t)for(const i of e)if(t[i])return!0}return!1}clearQueryDebugViz(){}_makeDebugTileBoundsBuffers(t,e){if(!e||"mercator"===e.name||this._tileDebugBuffer)return;const i=sc(Df,this.tileID.canonical,this.tileTransform)[0],n=new Uo,r=new us;for(let t=0;t<i.length;t++){const{x:e,y:o}=i[t];n.emplaceBack(e,o),r.emplaceBack(t)}r.emplaceBack(0),this._tileDebugIndexBuffer=t.createIndexBuffer(r),this._tileDebugBuffer=t.createVertexBuffer(n,tl.members),this._tileDebugSegments=sa.simpleSegment(0,0,n.length,r.length)}_makeTileBoundsBuffers(t,e){if(this._tileBoundsBuffer||!e||"mercator"===e.name)return;const i=sc(Df,this.tileID.canonical,this.tileTransform)[0];let n,r;if(this.isRaster){const t=function(t,e){const i=Pd(t,e),n=Math.pow(2,t.z);for(let r=0;r<Sf;r++)for(let o=0;o<Sf;o++){const s=Xl((t.x+(o+Pf(o))/Ef)/n),a=Zl((t.y+(r+Pf(r))/Ef)/n),l=e.project(s,a),c=r*Sf+o;Tf[2*c+0]=Math.round((l.x*i.scale-i.x)*aa),Tf[2*c+1]=Math.round((l.y*i.scale-i.y)*aa)}If.fill(0),Cf.fill(0);for(let t=2045;t>=0;t--){const e=4*t,i=Mf[e+0],n=Mf[e+1],r=Mf[e+2],o=Mf[e+3],s=i+r>>1,a=n+o>>1,l=s+a-n,c=a+i-s,u=n*Sf+i,h=o*Sf+r,p=a*Sf+s,d=Math.hypot((Tf[2*u+0]+Tf[2*h+0])/2-Tf[2*p+0],(Tf[2*u+1]+Tf[2*h+1])/2-Tf[2*p+1])>=16;If[p]=If[p]||(d?1:0),t<1022&&(If[p]=If[p]||If[(n+c>>1)*Sf+(i+l>>1)]||If[(o+c>>1)*Sf+(r+l>>1)])}const r=new jo,o=new ns;let s=0;function a(t,e){const i=e*Sf+t;return 0===Cf[i]&&(r.emplaceBack(Tf[2*i+0],Tf[2*i+1],t*aa/Ef,e*aa/Ef),Cf[i]=++s),Cf[i]-1}function l(t,e,i,n,r,s){const c=t+i>>1,u=e+n>>1;if(Math.abs(t-r)+Math.abs(e-s)>1&&If[u*Sf+c])l(r,s,t,e,c,u),l(i,n,r,s,c,u);else{const l=a(t,e),c=a(i,n),u=a(r,s);o.emplaceBack(l,c,u)}}return l(0,0,Ef,Ef,Ef,0),l(Ef,Ef,0,0,0,Ef),{vertices:r,indices:o}}(this.tileID.canonical,e);n=t.vertices,r=t.indices}else{n=new jo,r=new ns;for(const{x:t,y:e}of i)n.emplaceBack(t,e,0,0);const t=vu(n.int16,void 0,4);for(let e=0;e<t.length;e+=3)r.emplaceBack(t[e],t[e+1],t[e+2])}this._tileBoundsBuffer=t.createVertexBuffer(n,Lf.members),this._tileBoundsIndexBuffer=t.createIndexBuffer(r),this._tileBoundsSegments=sa.simpleSegment(0,0,n.length,r.length)}_makeGlobeTileDebugBuffers(t,e){const i=e.projection;if(!i||"globe"!==i.name||e.freezeTileCoverage)return;const n=this.tileID.canonical,r=Pl(xl(n,e)),o=Rl(e.zoom);let s;o>0&&(s=fa(new Float64Array(16),e.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(t,n,e,r,s,o),this._makeGlobeTileDebugTextBuffer(t,n,e,r,s,o)}_globePoint(t,e,i,n,r,o,s){let a=Tl(t,e,i);if(o){const r=1<<i.z,l=Hl(n.center.lng),c=Wl(n.center.lat),u=(i.x+.5)/r-l;let h=0;u>.5?h=-1:u<-.5&&(h=1);let p=(t/aa+i.x)/r+h,d=(e/aa+i.y)/r;p=(p-l)*n._pixelsPerMercatorPixel+l,d=(d-c)*n._pixelsPerMercatorPixel+c;const f=[p*n.worldSize,d*n.worldSize,0];Ba(f,f,o),a=_l(a,f,s)}return Ba(a,a,r)}_makeGlobeTileDebugBorderBuffer(t,e,i,n,r,o){const s=new Uo,a=new us,l=new Go,c=(t,c,u,h,p)=>{const d=(u-t)/(p-1),f=(h-c)/(p-1),m=s.length;for(let u=0;u<p;u++){const h=t+u*d,p=c+u*f;s.emplaceBack(h,p);const g=this._globePoint(h,p,e,i,n,r,o);l.emplaceBack(g[0],g[1],g[2]),a.emplaceBack(m+u)}},u=aa;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=t.createIndexBuffer(a),this._tileDebugBuffer=t.createVertexBuffer(s,tl.members),this._globeTileDebugBorderBuffer=t.createVertexBuffer(l,$a.members),this._tileDebugSegments=sa.simpleSegment(0,0,s.length,a.length)}_makeGlobeTileDebugTextBuffer(t,e,i,n,r,o){const s=aa/4,a=new Uo,l=new ns,c=new Go,u=25;l.reserve(32),a.reserve(u),c.reserve(u);const h=(t,e)=>u*t+e;for(let t=0;t<u;t++){const l=t*s;for(let t=0;t<u;t++){const u=t*s;a.emplaceBack(u,l);const h=this._globePoint(u,l,e,i,n,r,o);c.emplaceBack(h[0],h[1],h[2])}}for(let t=0;t<4;t++)for(let e=0;e<4;e++){const i=h(t,e),n=h(t,e+1),r=h(t+1,e),o=h(t+1,e+1);l.emplaceBack(i,n,r),l.emplaceBack(r,n,o)}this._tileDebugTextIndexBuffer=t.createIndexBuffer(l),this._tileDebugTextBuffer=t.createVertexBuffer(a,tl.members),this._globeTileDebugTextBuffer=t.createVertexBuffer(c,$a.members),this._tileDebugTextSegments=sa.simpleSegment(0,0,u,32)}}class Of{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,e,i){const n=String(e);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][n]=this.stateChanges[t][n]||{},D(this.stateChanges[t][n],i),null===this.deletedStates[t]){this.deletedStates[t]={};for(const e in this.state[t])e!==n&&(this.deletedStates[t][e]=null)}else if(this.deletedStates[t]&&null===this.deletedStates[t][n]){this.deletedStates[t][n]={};for(const e in this.state[t][n])i[e]||(this.deletedStates[t][n][e]=null)}else for(const e in i)this.deletedStates[t]&&this.deletedStates[t][n]&&null===this.deletedStates[t][n][e]&&delete this.deletedStates[t][n][e]}removeFeatureState(t,e,i){if(null===this.deletedStates[t])return;const n=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},i&&void 0!==e)null!==this.deletedStates[t][n]&&(this.deletedStates[t][n]=this.deletedStates[t][n]||{},this.deletedStates[t][n][i]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][n])for(i in this.deletedStates[t][n]={},this.stateChanges[t][n])this.deletedStates[t][n][i]=null;else this.deletedStates[t][n]=null;else this.deletedStates[t]=null}getState(t,e){const i=String(e),n=D({},(this.state[t]||{})[i],(this.stateChanges[t]||{})[i]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){const i=this.deletedStates[t][e];if(null===i)return{};for(const t in i)delete n[t]}return n}initializeTileState(t,e){t.setFeatureState(this.state,e)}coalesceChanges(t,e){const i={};for(const t in this.stateChanges){this.state[t]=this.state[t]||{};const e={};for(const i in this.stateChanges[t])this.state[t][i]||(this.state[t][i]={}),D(this.state[t][i],this.stateChanges[t][i]),e[i]=this.state[t][i];i[t]=e}for(const t in this.deletedStates){this.state[t]=this.state[t]||{};const e={};if(null===this.deletedStates[t])for(const i in this.state[t])e[i]={},this.state[t][i]={};else for(const i in this.deletedStates[t]){if(null===this.deletedStates[t][i])this.state[t][i]={};else if(this.state[t][i])for(const e of Object.keys(this.deletedStates[t][i]))delete this.state[t][i][e];e[i]=this.state[t][i]}i[t]=i[t]||{},D(i[t],e)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(i).length)for(const n in t)t[n].setFeatureState(i,e)}}class kf{constructor(t){this.size=t,this.minimums=[],this.maximums=[],this.leaves=[]}getElevation(t,e){const i=this.toIdx(t,e);return{min:this.minimums[i],max:this.maximums[i]}}isLeaf(t,e){return this.leaves[this.toIdx(t,e)]}toIdx(t,e){return e*this.size+t}}function Nf(t,e,i,n){let r=0,o=Number.MAX_VALUE;for(let s=0;s<3;s++)if(Math.abs(n[s])<1e-15){if(i[s]<t[s]||i[s]>e[s])return null}else{const a=1/n[s];let l=(t[s]-i[s])*a,c=(e[s]-i[s])*a;if(l>c){const t=l;l=c,c=t}if(l>r&&(r=l),c<o&&(o=c),r>o)return null}return r}function Bf(t,e,i,n,r,o,s,a,l,c,u){const h=n-t,p=r-e,d=o-i,f=s-t,m=a-e,g=l-i,y=u[1]*g-u[2]*m,v=u[2]*f-u[0]*g,_=u[0]*m-u[1]*f,x=h*y+p*v+d*_;if(Math.abs(x)<1e-15)return null;const b=1/x,w=c[0]-t,A=c[1]-e,E=c[2]-i,S=(w*y+A*v+E*_)*b;if(S<0||S>1)return null;const M=A*d-E*p,T=E*h-w*d,I=w*p-A*h,C=(u[0]*M+u[1]*T+u[2]*I)*b;return C<0||S+C>1?null:(f*M+m*T+g*I)*b}function zf(t,e,i){return(t-e)/(i-e)}function Ff(t,e,i,n,r,o,s,a,l){const c=1<<i,u=o-n,h=s-r,p=(t+1)/c*u+n,d=(e+0)/c*h+r,f=(e+1)/c*h+r;a[0]=(t+0)/c*u+n,a[1]=d,l[0]=p,l[1]=f}class Vf{constructor(t){if(this.maximums=[],this.minimums=[],this.leaves=[],this.childOffsets=[],this.nodeCount=0,this.dem=t,this._siblingOffset=[[0,0],[1,0],[0,1],[1,1]],!this.dem)return;const e=function(t){const e=Math.ceil(Math.log2(t.dim/8)),i=[];let n=Math.ceil(Math.pow(2,e));const r=1/n,o=(t,e,i,n,r)=>{const o=n?1:0,s=(t+1)*i-o,a=e*i,l=(e+1)*i-o;r[0]=t*i,r[1]=a,r[2]=s,r[3]=l};let s=new kf(n);const a=[];for(let e=0;e<n*n;e++){o(e%n,Math.floor(e/n),r,!1,a);const i=Gf(a[0],a[1],t),l=Gf(a[2],a[1],t),c=Gf(a[2],a[3],t),u=Gf(a[0],a[3],t);s.minimums.push(Math.min(i,l,c,u)),s.maximums.push(Math.max(i,l,c,u)),s.leaves.push(1)}for(i.push(s),n/=2;n>=1;n/=2){const t=i[i.length-1];s=new kf(n);for(let e=0;e<n*n;e++){o(e%n,Math.floor(e/n),2,!0,a);const i=t.getElevation(a[0],a[1]),r=t.getElevation(a[2],a[1]),l=t.getElevation(a[2],a[3]),c=t.getElevation(a[0],a[3]),u=t.isLeaf(a[0],a[1]),h=t.isLeaf(a[2],a[1]),p=t.isLeaf(a[2],a[3]),d=t.isLeaf(a[0],a[3]),f=Math.min(i.min,r.min,l.min,c.min),m=Math.max(i.max,r.max,l.max,c.max),g=u&&h&&p&&d;s.maximums.push(m),s.minimums.push(f),s.leaves.push(m-f<=5&&g?1:0)}i.push(s)}return i}(this.dem),i=e.length-1,n=e[i];this._addNode(n.minimums[0],n.maximums[0],n.leaves[0]),this._construct(e,0,0,i,0)}raycastRoot(t,e,i,n,r,o,s=1){return Nf([t,e,-100],[i,n,this.maximums[0]*s],r,o)}raycast(t,e,i,n,r,o,s=1){if(!this.nodeCount)return null;const a=this.raycastRoot(t,e,i,n,r,o,s);if(null==a)return null;const l=[],c=[],u=[],h=[],p=[{idx:0,t:a,nodex:0,nodey:0,depth:0}];for(;p.length>0;){const{idx:a,t:d,nodex:f,nodey:m,depth:g}=p.pop();if(this.leaves[a]){Ff(f,m,g,t,e,i,n,u,h);const a=1<<g,l=(f+0)/a,c=(f+1)/a,p=(m+0)/a,y=(m+1)/a,v=Gf(l,p,this.dem)*s,_=Gf(c,p,this.dem)*s,x=Gf(c,y,this.dem)*s,b=Gf(l,y,this.dem)*s,w=Bf(u[0],u[1],v,h[0],u[1],_,h[0],h[1],x,r,o),A=Bf(h[0],h[1],x,u[0],h[1],b,u[0],u[1],v,r,o),E=Math.min(null!==w?w:Number.MAX_VALUE,null!==A?A:Number.MAX_VALUE);if(E!==Number.MAX_VALUE)return E;{const t=Ra([],r,o,d);if(Uf(v,_,b,x,zf(t[0],u[0],h[0]),zf(t[1],u[1],h[1]))>=t[2])return d}continue}let y=0;for(let p=0;p<this._siblingOffset.length;p++){Ff((f<<1)+this._siblingOffset[p][0],(m<<1)+this._siblingOffset[p][1],g+1,t,e,i,n,u,h),u[2]=-100,h[2]=this.maximums[this.childOffsets[a]+p]*s;const d=Nf(u,h,r,o);if(null!=d){const t=d;l[p]=t;let e=!1;for(let i=0;i<y&&!e;i++)t>=l[c[i]]&&(c.splice(i,0,p),e=!0);e||(c[y]=p),y++}}for(let t=0;t<y;t++){const e=c[t];p.push({idx:this.childOffsets[a]+e,t:l[e],nodex:(f<<1)+this._siblingOffset[e][0],nodey:(m<<1)+this._siblingOffset[e][1],depth:g+1})}}return null}_addNode(t,e,i){return this.minimums.push(t),this.maximums.push(e),this.leaves.push(i),this.childOffsets.push(0),this.nodeCount++}_construct(t,e,i,n,r){if(1===t[n].isLeaf(e,i))return;this.childOffsets[r]||(this.childOffsets[r]=this.nodeCount);const o=n-1,s=t[o];let a=0,l=0;for(let t=0;t<this._siblingOffset.length;t++){const n=2*e+this._siblingOffset[t][0],r=2*i+this._siblingOffset[t][1],o=s.getElevation(n,r),c=s.isLeaf(n,r),u=this._addNode(o.min,o.max,c);c&&(a|=1<<t),l||(l=u)}for(let n=0;n<this._siblingOffset.length;n++)a&1<<n||this._construct(t,2*e+this._siblingOffset[n][0],2*i+this._siblingOffset[n][1],o,l+n)}}function Uf(t,e,i,n,r,o){return Li(Li(t,i,o),Li(e,n,o),r)}function Gf(t,e,i){const n=i.dim,r=T(t*n-.5,0,n-1),o=T(e*n-.5,0,n-1),s=Math.floor(r),a=Math.floor(o),l=Math.min(s+1,n-1),c=Math.min(a+1,n-1);return Uf(i.get(s,a),i.get(l,a),i.get(s,c),i.get(l,c),r-s,o-a)}const jf={mapbox:[6553.6,25.6,.1,1e4],terrarium:[256,1,1/256,32768]};function Hf(t,e,i){return(256*t*256+256*e+i)/10-1e4}function Wf(t,e,i){return 256*t+e+i/256-32768}class qf{get tree(){return this._tree||this._buildQuadTree(),this._tree}constructor(t,e,i,n=!1,r=!1){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(i&&"mapbox"!==i&&"terrarium"!==i)return H(`"${i}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=e.height;const o=this.dim=e.height-2,s=new Uint32Array(e.data.buffer);if(this.pixels=new Uint8Array(e.data.buffer),this.encoding=i||"mapbox",this.borderReady=n,!n){for(let t=0;t<o;t++)s[this._idx(-1,t)]=s[this._idx(0,t)],s[this._idx(o,t)]=s[this._idx(o-1,t)],s[this._idx(t,-1)]=s[this._idx(t,0)],s[this._idx(t,o)]=s[this._idx(t,o-1)];s[this._idx(-1,-1)]=s[this._idx(0,0)],s[this._idx(o,-1)]=s[this._idx(o-1,0)],s[this._idx(-1,o)]=s[this._idx(0,o-1)],s[this._idx(o,o)]=s[this._idx(o-1,o-1)],r&&this._buildQuadTree()}}_buildQuadTree(){this._tree=new Vf(this)}get(t,e,i=!1){i&&(t=T(t,-1,this.dim),e=T(e,-1,this.dim));const n=4*this._idx(t,e);return("terrarium"===this.encoding?Wf:Hf)(this.pixels[n],this.pixels[n+1],this.pixels[n+2])}static getUnpackVector(t){return jf[t]}get unpackVector(){return jf[this.encoding]}_idx(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)}static pack(t,e){const i=[0,0,0,0],n=qf.getUnpackVector(e);let r=Math.floor((t+n[3])/n[2]);return i[2]=r%256,r=Math.floor(r/256),i[1]=r%256,r=Math.floor(r/256),i[0]=r,i}getPixels(){return new Fc({width:this.stride,height:this.stride},this.pixels)}backfillBorder(t,e,i){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let n=e*this.dim,r=e*this.dim+this.dim,o=i*this.dim,s=i*this.dim+this.dim;switch(e){case-1:n=r-1;break;case 1:r=n+1}switch(i){case-1:o=s-1;break;case 1:s=o+1}const a=-e*this.dim,l=-i*this.dim;for(let e=o;e<s;e++)for(let i=n;i<r;i++){const n=4*this._idx(i,e),r=4*this._idx(i+a,e+l);this.pixels[n+0]=t.pixels[r+0],this.pixels[n+1]=t.pixels[r+1],this.pixels[n+2]=t.pixels[r+2],this.pixels[n+3]=t.pixels[r+3]}}onDeserialize(){this._tree&&(this._tree.dem=this)}}Yr(qf,"DEMData"),Yr(Vf,"DemMinMaxQuadTree",{omit:["dem"]});class Xf{constructor(t,e){this.max=t,this.onRemove=e,this.reset()}reset(){for(const t in this.data)for(const e of this.data[t])e.timeout&&clearTimeout(e.timeout),this.onRemove(e.value);return this.data={},this.order=[],this}add(t,e,i){const n=t.wrapped().key;void 0===this.data[n]&&(this.data[n]=[]);const r={value:e,timeout:void 0};if(void 0!==i&&(r.timeout=setTimeout((()=>{this.remove(t,r)}),i)),this.data[n].push(r),this.order.push(n),this.order.length>this.max){const t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){const e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value}getByKey(t){const e=this.data[t];return e?e[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,e){if(!this.has(t))return this;const i=t.wrapped().key,n=void 0===e?0:this.data[i].indexOf(e),r=this.data[i][n];return this.data[i].splice(n,1),r.timeout&&clearTimeout(r.timeout),0===this.data[i].length&&delete this.data[i],this.onRemove(r.value),this.order.splice(this.order.indexOf(i),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}filter(t){const e=[];for(const i in this.data)for(const n of this.data[i])t(n.value)||e.push(n);for(const t of e)this.remove(t.value.tileID,t)}}class Zf{constructor(t,e,i){this.func=t,this.mask=e,this.range=i}}Zf.ReadOnly=!1,Zf.ReadWrite=!0,Zf.disabled=new Zf(519,Zf.ReadOnly,[0,1]);const Yf=7680;class Qf{constructor(t,e,i,n,r,o){this.test=t,this.ref=e,this.mask=i,this.fail=n,this.depthFail=r,this.pass=o}}Qf.disabled=new Qf({func:519,mask:0},0,0,Yf,Yf,Yf);class Jf{constructor(t,e,i){this.blendFunction=t,this.blendColor=e,this.mask=i}}Jf.Replace=[1,0],Jf.disabled=new Jf(Jf.Replace,Le.transparent,[!1,!1,!1,!1]),Jf.unblended=new Jf(Jf.Replace,Le.transparent,[!0,!0,!0,!0]),Jf.alphaBlended=new Jf([1,771],Le.transparent,[!0,!0,!0,!0]);const Kf=1029,$f=2305;class tm{constructor(t,e,i){this.enable=t,this.mode=e,this.frontFace=i}}tm.disabled=new tm(!1,Kf,$f),tm.backCCW=new tm(!0,Kf,$f),tm.backCW=new tm(!0,Kf,2304),tm.frontCW=new tm(!0,1028,2304),tm.frontCCW=new tm(!0,1028,$f);class em extends $t{constructor(t,e,i){super(),this.id=t,this._onlySymbols=i,e.on("data",(t=>{"source"===t.dataType&&"metadata"===t.sourceDataType&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform))})),e.on("error",(()=>{this._sourceErrored=!0})),this._source=e,this._tiles={},this._cache=new Xf(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=e.minTileCacheSize,this._maxTileCacheSize=e.maxTileCacheSize,this._loadedParentTiles={},this._coveredTiles={},this._state=new Of,this._isRaster="raster"===this._source.type||"raster-dem"===this._source.type||"custom"===this._source.type&&"raster"===this._source._dataType}onAdd(t){this.map=t,this._minTileCacheSize=void 0===this._minTileCacheSize&&t?t._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=void 0===this._maxTileCacheSize&&t?t._maxTileCacheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(const t in this._tiles){const e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(t,e){return t.isSymbolTile=this._onlySymbols,this._source.loadTile(t,e)}_unloadTile(t){if(this._source.unloadTile)return this._source.unloadTile(t,(()=>{}))}_abortTile(t){if(this._source.abortTile)return this._source.abortTile(t,(()=>{}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const e in this._tiles){const i=this._tiles[e];i.upload(t),i.prepare(this.map.style.imageManager)}}getIds(){return L(this._tiles).map((t=>t.tileID)).sort(im).map((t=>t.key))}getRenderableIds(t){const e=[];for(const i in this._tiles)this._isIdRenderable(+i,t)&&e.push(this._tiles[i]);return t?e.sort(((t,e)=>{const i=t.tileID,n=e.tileID,r=new v(i.canonical.x,i.canonical.y)._rotate(this.transform.angle),o=new v(n.canonical.x,n.canonical.y)._rotate(this.transform.angle);return i.overscaledZ-n.overscaledZ||o.y-r.y||o.x-r.x})).map((t=>t.tileID.key)):e.map((t=>t.tileID)).sort(im).map((t=>t.key))}hasRenderableParent(t){const e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)}_isIdRenderable(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const t in this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(+t,"reloading")}}_reloadTile(t,e){const i=this._tiles[t];i&&("loading"!==i.state&&(i.state=e),this._loadTile(i,this._tileLoaded.bind(this,i,t,e)))}_tileLoaded(t,e,i,n){if(n)if(t.state="errored",404!==n.status)this._source.fire(new Kt(n,{tile:t}));else if("raster-dem"===this._source.type&&this.usedForTerrain&&this.map.painter.terrain){const t=this.map.painter.terrain;this.update(this.transform,t.getScaledDemTileSize(),!0),t.resetTileLookupCache(this.id)}else this.update(this.transform);else t.timeAdded=Zt.now(),"expired"===i&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(e,t),"raster-dem"===this._source.type&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),this._source.fire(new Jt("data",{dataType:"source",tile:t,coord:t.tileID,sourceCacheId:this.id}))}_backfillDEM(t){const e=this.getRenderableIds();for(let n=0;n<e.length;n++){const r=e[n];if(t.neighboringTiles&&t.neighboringTiles[r]){const e=this.getTileByID(r);i(t,e),i(e,t)}}function i(t,e){if(!t.dem||t.dem.borderReady)return;t.needsHillshadePrepare=!0,t.needsDEMTextureUpload=!0;let i=e.tileID.canonical.x-t.tileID.canonical.x;const n=e.tileID.canonical.y-t.tileID.canonical.y,r=Math.pow(2,t.tileID.canonical.z),o=e.tileID.key;0===i&&0===n||Math.abs(n)>1||(Math.abs(i)>1&&(1===Math.abs(i+r)?i+=r:1===Math.abs(i-r)&&(i-=r)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,i,n),t.neighboringTiles&&t.neighboringTiles[o]&&(t.neighboringTiles[o].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,e,i,n){for(const r in this._tiles){let o=this._tiles[r];if(n[r]||!o.hasData()||o.tileID.overscaledZ<=e||o.tileID.overscaledZ>i)continue;let s=o.tileID;for(;o&&o.tileID.overscaledZ>e+1;){const t=o.tileID.scaledTo(o.tileID.overscaledZ-1);o=this._tiles[t.key],o&&o.hasData()&&(s=t)}let a=s;for(;a.overscaledZ>e;)if(a=a.scaledTo(a.overscaledZ-1),t[a.key]){n[s.key]=s;break}}}findLoadedParent(t,e){if(t.key in this._loadedParentTiles){const i=this._loadedParentTiles[t.key];return i&&i.tileID.overscaledZ>=e?i:null}for(let i=t.overscaledZ-1;i>=e;i--){const e=t.scaledTo(i),n=this._getLoadedTile(e);if(n)return n}}_getLoadedTile(t){const e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(this._source.reparseOverscaled?t.wrapped().key:t.canonical.key)}updateCacheSize(t,e){e=e||this._source.tileSize;const i=Math.ceil(t.width/e)+1,n=Math.ceil(t.height/e)+1,r=Math.floor(i*n*5),o="number"==typeof this._minTileCacheSize?Math.max(this._minTileCacheSize,r):r,s="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,o):o;this._cache.setMaxSize(s)}handleWrapJump(t){const e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){const t={};for(const i in this._tiles){const n=this._tiles[i];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+e),t[n.tileID.key]=n}this._tiles=t;for(const t in this._timers)clearTimeout(this._timers[t]),delete this._timers[t];for(const t in this._tiles)this._setTileReloadTimer(+t,this._tiles[t])}}update(t,e,i){if(this.transform=t,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage)return;if(this.usedForTerrain&&!i)return;let n;this.updateCacheSize(t,e),"globe"!==this.transform.projection.name&&this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?n=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((t=>new fh(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y))):(n=t.coveringTiles({tileSize:e||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!i,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain}),this._source.hasTile&&(n=n.filter((t=>this._source.hasTile(t))))):n=[];const r=this._updateRetainedTiles(n);if(nm(this._source.type)&&0!==n.length){const t={},e={},i=Object.keys(r);for(const n of i){const i=r[n],o=this._tiles[n];if(!o||o.fadeEndTime&&o.fadeEndTime<=Zt.now())continue;const s=this.findLoadedParent(i,Math.max(i.overscaledZ-em.maxOverzooming,this._source.minzoom));s&&(this._addTile(s.tileID),t[s.tileID.key]=s.tileID),e[n]=i}const o=n[n.length-1].overscaledZ;for(const t in this._tiles){const i=this._tiles[t];if(r[t]||!i.hasData())continue;let n=i.tileID;for(;n.overscaledZ>o;){n=n.scaledTo(n.overscaledZ-1);const o=this._tiles[n.key];if(o&&o.hasData()&&e[n.key]){r[t]=i.tileID;break}}}for(const e in t)r[e]||(this._coveredTiles[e]=!0,r[e]=t[e])}for(const t in r)this._tiles[t].clearFadeHold();const o=function(t,e){const i=[];for(const n in t)n in e||i.push(n);return i}(this._tiles,r);for(const t of o){const e=this._tiles[t];e.hasSymbolBuckets&&!e.holdingForFade()?e.setHoldDuration(this.map._fadeDuration):e.hasSymbolBuckets&&!e.symbolFadeFinished()||this._removeTile(+t)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(+t)}_updateRetainedTiles(t){const e={};if(0===t.length)return e;const i={},n=t.reduce(((t,e)=>Math.min(t,e.overscaledZ)),1/0),r=t[0].overscaledZ,o=Math.max(r-em.maxOverzooming,this._source.minzoom),s=Math.max(r+em.maxUnderzooming,this._source.minzoom),a={};for(const i of t){const t=this._addTile(i);e[i.key]=i,t.hasData()||n<this._source.maxzoom&&(a[i.key]=i)}this._retainLoadedChildren(a,n,s,e);for(const n of t){let t=this._tiles[n.key];if(t.hasData())continue;if(n.canonical.z>=this._source.maxzoom){const t=n.children(this._source.maxzoom)[0],i=this.getTile(t);if(i&&i.hasData()){e[t.key]=t;continue}}else{const t=n.children(this._source.maxzoom);if(e[t[0].key]&&e[t[1].key]&&e[t[2].key]&&e[t[3].key])continue}let r=t.wasRequested();for(let s=n.overscaledZ-1;s>=o;--s){const o=n.scaledTo(s);if(i[o.key])break;if(i[o.key]=!0,t=this.getTile(o),!t&&r&&(t=this._addTile(o)),t&&(e[o.key]=o,r=t.wasRequested(),t.hasData()))break}}return e}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const e=[];let i,n=this._tiles[t].tileID;for(;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){i=this._loadedParentTiles[n.key];break}e.push(n.key);const t=n.scaledTo(n.overscaledZ-1);if(i=this._getLoadedTile(t),i)break;n=t}for(const t of e)this._loadedParentTiles[t]=i}}_addTile(t){let e=this._tiles[t.key];if(e)return e;e=this._cache.getAndRemove(t),e&&(this._setTileReloadTimer(t.key,e),e.tileID=t,this._state.initializeTileState(e,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,e)));const i=Boolean(e);if(!i){const i=this.map?this.map.painter:null;e=new Rf(t,this._source.tileSize*t.overscaleFactor(),this.transform.tileZoom,i,this._isRaster),this._loadTile(e,this._tileLoaded.bind(this,e,t.key,e.state))}return e?(e.uses++,this._tiles[t.key]=e,i||this._source.fire(new Jt("dataloading",{tile:e,coord:e.tileID,dataType:"source"})),e):null}_setTileReloadTimer(t,e){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const i=e.getExpiryTimeout();i&&(this._timers[t]=setTimeout((()=>{this._reloadTile(t,"expired"),delete this._timers[t]}),i))}_removeTile(t){const e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(+t);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(t,e,i){const n=[],r=this.transform;if(!r)return n;const o="globe"===r.projection.name,s=Hl(r.center.lng);for(const a in this._tiles){const l=this._tiles[a];if(i&&l.clearQueryDebugViz(),l.holdingForFade())continue;let c;if(o){const t=l.tileID.canonical;if(0===t.z){const e=[Math.abs(T(s,...rm(t,-1))-s),Math.abs(T(s,...rm(t,1))-s)];c=[0,2*e.indexOf(Math.min(...e))-1]}else{const e=[Math.abs(T(s,...rm(t,-1))-s),Math.abs(T(s,...rm(t,0))-s),Math.abs(T(s,...rm(t,1))-s)];c=[e.indexOf(Math.min(...e))-1]}}else c=[0];for(const i of c){const o=t.containsTile(l,r,e,i);o&&n.push(o)}}return n}getVisibleCoordinates(t){const e=this.getRenderableIds(t).map((t=>this._tiles[t].tileID));for(const t of e)t.projMatrix=this.transform.calculateProjMatrix(t.toUnwrapped());return e}hasTransition(){if(this._source.hasTransition())return!0;if(nm(this._source.type))for(const t in this._tiles){const e=this._tiles[t];if(void 0!==e.fadeEndTime&&e.fadeEndTime>=Zt.now())return!0}return!1}setFeatureState(t,e,i){this._state.updateState(t=t||"_geojsonTileLayer",e,i)}removeFeatureState(t,e,i){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,i)}getFeatureState(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)}setDependencies(t,e,i){const n=this._tiles[t];n&&n.setDependencies(e,i)}reloadTilesForDependencies(t,e){for(const i in this._tiles)this._tiles[i].hasDependency(t,e)&&this._reloadTile(+i,"reloading");this._cache.filter((i=>!i.hasDependency(t,e)))}_preloadTiles(t,e){if(!this._sourceLoaded){const i=()=>{this._sourceLoaded&&(this._source.off("data",i),this._preloadTiles(t,e))};return void this._source.on("data",i)}const i=new Map,n=Array.isArray(t)?t:[t],r=this.map.painter.terrain,o=this.usedForTerrain&&r?r.getScaledDemTileSize():this._source.tileSize;for(const t of n){const e=t.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 t of e)i.set(t.key,t);this.usedForTerrain&&t.updateElevation(!1)}P(Array.from(i.values()),((t,e)=>{const i=new Rf(t,this._source.tileSize*t.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster);this._loadTile(i,(t=>{"raster-dem"===this._source.type&&i.dem&&this._backfillDEM(i),e(t,i)}))}),e)}}function im(t,e){const i=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-i||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function nm(t){return"raster"===t||"image"===t||"video"===t||"custom"===t}function rm(t,e){const i=1<<t.z;return[t.x/i+e,(t.x+1)/i+e]}em.maxOverzooming=10,em.maxUnderzooming=3;class om{constructor(t,e,i){this._demTile=t,this._dem=this._demTile.dem,this._scale=e,this._offset=i}static create(t,e,i){const n=i||t.findDEMTileFor(e);if(!n||!n.dem)return;const r=n.dem,o=n.tileID,s=1<<e.canonical.z-o.canonical.z;return new om(n,n.tileSize/aa/s,[(e.canonical.x/s-o.canonical.x)*r.dim,(e.canonical.y/s-o.canonical.y)*r.dim])}tileCoordToPixel(t,e){const i=e*this._scale+this._offset[1],n=Math.floor(t*this._scale+this._offset[0]),r=Math.floor(i);return new v(n,r)}getElevationAt(t,e,i,n){const r=t*this._scale+this._offset[0],o=e*this._scale+this._offset[1],s=Math.floor(r),a=Math.floor(o),l=this._dem;return n=!!n,i?Li(Li(l.get(s,a,n),l.get(s,a+1,n),o-a),Li(l.get(s+1,a,n),l.get(s+1,a+1,n),o-a),r-s):l.get(s,a,n)}getElevationAtPixel(t,e,i){return this._dem.get(t,e,!!i)}getMeterToDEM(t){return(1<<this._demTile.tileID.canonical.z)*ql(1,t)*this._dem.stride}}class sm{constructor(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Xr(aa,16,0),this.featureIndexArray=new bs,this.promoteId=e}insert(t,e,i,n,r,o=0){const s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(i,n,r,o);const a=this.grid;for(let t=0;t<e.length;t++){const i=e[t],n=[1/0,1/0,-1/0,-1/0];for(let t=0;t<i.length;t++){const e=i[t];n[0]=Math.min(n[0],e.x),n[1]=Math.min(n[1],e.y),n[2]=Math.max(n[2],e.x),n[3]=Math.max(n[3],e.y)}n[0]<aa&&n[1]<aa&&n[2]>=0&&n[3]>=0&&a.insert(s,n[0],n[1],n[2],n[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new qu(new gp(this.rawTileData)).layers,this.sourceLayerCoder=new bf(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const t in this.vtLayers)this.vtFeatures[t]=[]}return this.vtLayers}query(t,e,i,n){this.loadVTLayers();const r=t.params||{},o=hr(r.filter),s=t.tileResult,a=t.transform,l=s.bufferedTilespaceBounds,c=this.grid.query(l.min.x,l.min.y,l.max.x,l.max.y,((t,e,i,n)=>bc(s.bufferedTilespaceGeometry,t,e,i,n)));c.sort(lm);let u=null;a.elevation&&c.length>0&&(u=om.create(a.elevation,this.tileID));const h={};let p;for(let a=0;a<c.length;a++){const l=c[a];if(l===p)continue;p=l;const d=this.featureIndexArray.get(l);let f=null;this.loadMatchingFeature(h,d,o,r.layers,r.availableImages,e,i,n,((e,i,n,r=0)=>(f||(f=sc(e,this.tileID.canonical,t.tileTransform)),i.queryIntersectsFeature(s,e,n,f,this.z,t.transform,t.pixelPosMatrix,u,r))))}return h}loadMatchingFeature(t,e,i,n,r,o,s,a,l){const{featureIndex:c,bucketIndex:u,sourceLayerIndex:h,layoutVertexArrayOffset:p}=e,d=this.bucketLayerIDs[u];if(n&&!function(t,e){for(let i=0;i<t.length;i++)if(e.indexOf(t[i])>=0)return!0;return!1}(n,d))return;const f=this.sourceLayerCoder.decode(h),m=this.vtLayers[f].feature(c);if(i.needGeometry){const t=ac(m,!0);if(!i.filter(new wo(this.tileID.overscaledZ),t,this.tileID.canonical))return}else if(!i.filter(new wo(this.tileID.overscaledZ),m))return;const g=this.getId(m,f);for(let e=0;e<d.length;e++){const i=d[e];if(n&&n.indexOf(i)<0)continue;const u=o[i];if(!u)continue;let h={};void 0!==g&&a&&(h=a.getState(u.sourceLayer||"_geojsonTileLayer",g));const f=D({},s[i]);f.paint=am(f.paint,u.paint,m,h,r),f.layout=am(f.layout,u.layout,m,h,r);const y=!l||l(m,u,h,p);if(!y)continue;const v=new Af(m,this.z,this.x,this.y,g);v.layer=f;let _=t[i];void 0===_&&(_=t[i]=[]),_.push({featureIndex:c,feature:v,intersectionZ:y})}}lookupSymbolFeatures(t,e,i,n,r,o,s,a){const l={};this.loadVTLayers();const c=hr(r);for(const r of t)this.loadMatchingFeature(l,{bucketIndex:i,sourceLayerIndex:n,featureIndex:r,layoutVertexArrayOffset:0},c,o,s,a,e);return l}loadFeature(t){const{featureIndex:e,sourceLayerIndex:i}=t;this.loadVTLayers();const n=this.sourceLayerCoder.decode(i),r=this.vtFeatures[n];if(r[e])return r[e];const o=this.vtLayers[n].feature(e);return r[e]=o,o}hasLayer(t){for(const e of this.bucketLayerIDs)for(const i of e)if(t===i)return!0;return!1}getId(t,e){let i=t.id;if(this.promoteId){const n="string"==typeof this.promoteId?this.promoteId:this.promoteId[e];null!=n&&(i=t.properties[n]),"boolean"==typeof i&&(i=Number(i))}return i}}function am(t,e,i,n,r){return V(t,((t,o)=>{const s=e instanceof Po?e.get(o):null;return s&&s.evaluate?s.evaluate(i,n,r):s}))}function lm(t,e){return e-t}Yr(sm,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});class cm{constructor(t,e){this.width=t,this.height=e,this.nextRow=0,this.image=new zc({width:t,height:e}),this.positions={},this.uploaded=!1}getDash(t,e){const i=this.getKey(t,e);return this.positions[i]}trim(){const t=this.width,e=this.height=N(this.nextRow);this.image.resize({width:t,height:e})}getKey(t,e){return t.join(",")+e}getDashRanges(t,e,i){const n=[];let r=t.length%2==1?-t[t.length-1]*i:0,o=t[0]*i,s=!0;n.push({left:r,right:o,isDash:s,zeroLength:0===t[0]});let a=t[0];for(let e=1;e<t.length;e++){s=!s;const l=t[e];r=a*i,a+=l,o=a*i,n.push({left:r,right:o,isDash:s,zeroLength:0===l})}return n}addRoundDash(t,e,i){const n=e/2;for(let e=-i;e<=i;e++){const r=this.width*(this.nextRow+i+e);let o=0,s=t[o];for(let a=0;a<this.width;a++){a/s.right>1&&(s=t[++o]);const l=Math.abs(a-s.left),c=Math.abs(a-s.right),u=Math.min(l,c);let h;const p=e/i*(n+1);if(s.isDash){const t=n-Math.abs(p);h=Math.sqrt(u*u+t*t)}else h=n-Math.sqrt(u*u+p*p);this.image.data[r+a]=Math.max(0,Math.min(255,h+128))}}}addRegularDash(t,e){for(let e=t.length-1;e>=0;--e){const i=t[e],n=t[e+1];i.zeroLength?t.splice(e,1):n&&n.isDash===i.isDash&&(n.left=i.left,t.splice(e,1))}const i=t[0],n=t[t.length-1];i.isDash===n.isDash&&(i.left=n.left-this.width,n.right=i.right+this.width);const r=this.width*this.nextRow;let o=0,s=t[o];for(let i=0;i<this.width;i++){i/s.right>1&&(s=t[++o]);const n=Math.abs(i-s.left),a=Math.abs(i-s.right),l=Math.min(n,a);this.image.data[r+i]=Math.max(0,Math.min(255,(s.isDash?l:-l)+e+128))}}addDash(t,e){const i=this.getKey(t,e);if(this.positions[i])return this.positions[i];const n="round"===e,r=n?7:0,o=2*r+1;if(this.nextRow+o>this.height)return H("LineAtlas out of space"),null;0===t.length&&t.push(1);let s=0;for(let e=0;e<t.length;e++)t[e]<0&&(H("Negative value is found in line dasharray, replacing values with 0"),t[e]=0),s+=t[e];if(0!==s){const i=this.width/s,o=this.getDashRanges(t,this.width,i);n?this.addRoundDash(o,i,r):this.addRegularDash(o,"square"===e?.5*i:0)}const a=this.nextRow+r;this.nextRow+=o;const l={tl:[a,r],br:[s,0]};return this.positions[i]=l,l}}Yr(cm,"LineAtlas");const um=1*td;class hm{constructor(t){const e={},i=[];for(const n in t){const r=t[n],o=e[n]={};for(const t in r.glyphs){const e=r.glyphs[+t];if(!e||0===e.bitmap.width||0===e.bitmap.height)continue;const n=e.metrics.localGlyph?um:1,s={x:0,y:0,w:e.bitmap.width+2*n,h:e.bitmap.height+2*n};i.push(s),o[t]=s}}const{w:n,h:r}=wp(i),o=new zc({width:n||1,height:r||1});for(const i in t){const n=t[i];for(const t in n.glyphs){const r=n.glyphs[+t];if(!r||0===r.bitmap.width||0===r.bitmap.height)continue;const s=e[i][t],a=r.metrics.localGlyph?um:1;zc.copy(r.bitmap,o,{x:0,y:0},{x:s.x+a,y:s.y+a},r.bitmap)}}this.image=o,this.positions=e}}Yr(hm,"GlyphAtlas");class pm{constructor(t){this.tileID=new fh(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.tileZoom=t.tileZoom,this.uid=t.uid,this.zoom=t.zoom,this.canonical=t.tileID.canonical,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies,this.promoteId=t.promoteId,this.enableTerrain=!!t.enableTerrain,this.isSymbolTile=t.isSymbolTile,this.tileTransform=Pd(t.tileID.canonical,t.projection),this.projection=t.projection}parse(t,e,i,n,r){this.status="parsing",this.data=t,this.collisionBoxArray=new ds;const o=new bf(Object.keys(t.layers).sort()),s=new sm(this.tileID,this.promoteId);s.bucketLayerIDs=[];const a={},l=new cm(256,256),c={featureIndex:s,iconDependencies:{},patternDependencies:{},glyphDependencies:{},lineAtlas:l,availableImages:i},u=e.familiesBySource[this.source];for(const e in u){const n=t.layers[e];if(!n)continue;let r=!1,l=!1;for(const t of u[e])"symbol"===t[0].type?r=!0:l=!0;if(!0===this.isSymbolTile&&!r)continue;if(!1===this.isSymbolTile&&!l)continue;1===n.version&&H(`Vector tile source "${this.source}" layer "${e}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const h=o.encode(e),p=[];for(let t=0;t<n.length;t++){const i=n.feature(t),r=s.getId(i,e);p.push({feature:i,id:r,index:t,sourceLayerIndex:h})}for(const t of u[e]){const e=t[0];void 0!==this.isSymbolTile&&"symbol"===e.type!==this.isSymbolTile||e.minzoom&&this.zoom<Math.floor(e.minzoom)||e.maxzoom&&this.zoom>=e.maxzoom||"none"!==e.visibility&&(dm(t,this.zoom,i),(a[e.id]=e.createBucket({index:s.bucketLayerIDs.length,layers:t,zoom:this.zoom,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:h,sourceID:this.source,enableTerrain:this.enableTerrain,projection:this.projection.spec,availableImages:i})).populate(p,c,this.tileID.canonical,this.tileTransform),s.bucketLayerIDs.push(t.map((t=>t.id))))}}let h,p,d,f;l.trim();const m={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},g=()=>{if(h)return r(h);if(p&&d&&f){const t=new hm(p),e=new Sp(d,f);for(const n in a){const r=a[n];r instanceof af?(dm(r.layers,this.zoom,i),_d(r,p,t.positions,d,e.iconPositions,this.showCollisionBoxes,i,this.tileID.canonical,this.tileZoom,this.projection)):r.hasPattern&&(r instanceof Mh||r instanceof Tu||r instanceof th)&&(dm(r.layers,this.zoom,i),r.addFeatures(c,this.tileID.canonical,e.patternPositions,i,this.tileTransform))}this.status="done",r(null,{buckets:L(a).filter((t=>!t.isEmpty())),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,lineAtlas:l,imageAtlas:e,glyphMap:this.returnDependencies?p:null,iconMap:this.returnDependencies?d:null,glyphPositions:this.returnDependencies?t.positions:null})}},y=V(c.glyphDependencies,(t=>Object.keys(t).map(Number)));Object.keys(y).length?n.send("getGlyphs",{uid:this.uid,stacks:y},((t,e)=>{h||(h=t,p=e,g())}),void 0,!1,m):p={};const v=Object.keys(c.iconDependencies);v.length?n.send("getImages",{icons:v,source:this.source,tileID:this.tileID,type:"icons"},((t,e)=>{h||(h=t,d=e,g())}),void 0,!1,m):d={};const _=Object.keys(c.patternDependencies);_.length?n.send("getImages",{icons:_,source:this.source,tileID:this.tileID,type:"patterns"},((t,e)=>{h||(h=t,f=e,g())}),void 0,!1,m):f={},g()}}function dm(t,e,i){const n=new wo(e);for(const e of t)e.recalculate(n,i)}class fm{constructor(t){this.entries={},this.scheduler=t}request(t,e,i,n){const r=this.entries[t]=this.entries[t]||{callbacks:[]};if(r.result){const[t,i]=r.result;return this.scheduler?this.scheduler.add((()=>{n(t,i)}),e):n(t,i),()=>{}}return r.callbacks.push(n),r.cancel||(r.cancel=i(((i,n)=>{r.result=[i,n];for(const t of r.callbacks)this.scheduler?this.scheduler.add((()=>{t(i,n)}),e):t(i,n);setTimeout((()=>delete this.entries[t]),3e3)}))),()=>{r.result||(r.callbacks=r.callbacks.filter((t=>t!==n)),r.callbacks.length||(r.cancel(),delete this.entries[t]))}}}function mm(t,e,i){const n=JSON.stringify(t.request);return t.data&&(this.deduped.entries[n]={result:[null,t.data]}),this.deduped.request(n,{type:"parseTile",isSymbolTile:t.isSymbolTile,zoom:t.tileZoom},(e=>{const n=pt(t.request,((t,n,r,o)=>{t?e(t):n&&e(null,{vectorTile:i?void 0:new qu(new gp(n)),rawData:n,cacheControl:r,expires:o})}));return()=>{n.cancel(),e()}}),e)}const gm=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class ym{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[e,i]=new Uint8Array(t,0,2);if(219!==e)throw new Error("Data does not appear to be in a KDBush format.");const n=i>>4;if(1!==n)throw new Error(`Got v${n} data when expected v1.`);const r=gm[15&i];if(!r)throw new Error("Unrecognized array type.");const[o]=new Uint16Array(t,2,1),[s]=new Uint32Array(t,4,1);return new ym(s,o,r,t)}constructor(t,e=64,i=Float64Array,n){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const r=gm.indexOf(this.ArrayType),o=2*t*this.ArrayType.BYTES_PER_ELEMENT,s=t*this.IndexArrayType.BYTES_PER_ELEMENT,a=(8-s%8)%8;if(r<0)throw new Error(`Unexpected typed array class: ${i}.`);n&&n instanceof ArrayBuffer?(this.data=n,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+s+a,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+o+s+a),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+s+a,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+r]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}add(t,e){const i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=e,i}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return vm(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,i,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:o,nodeSize:s}=this,a=[0,r.length-1,0],l=[];for(;a.length;){const c=a.pop()||0,u=a.pop()||0,h=a.pop()||0;if(u-h<=s){for(let s=h;s<=u;s++){const a=o[2*s],c=o[2*s+1];a>=t&&a<=i&&c>=e&&c<=n&&l.push(r[s])}continue}const p=h+u>>1,d=o[2*p],f=o[2*p+1];d>=t&&d<=i&&f>=e&&f<=n&&l.push(r[p]),(0===c?t<=d:e<=f)&&(a.push(h),a.push(p-1),a.push(1-c)),(0===c?i>=d:n>=f)&&(a.push(p+1),a.push(u),a.push(1-c))}return l}within(t,e,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:n,coords:r,nodeSize:o}=this,s=[0,n.length-1,0],a=[],l=i*i;for(;s.length;){const c=s.pop()||0,u=s.pop()||0,h=s.pop()||0;if(u-h<=o){for(let i=h;i<=u;i++)wm(r[2*i],r[2*i+1],t,e)<=l&&a.push(n[i]);continue}const p=h+u>>1,d=r[2*p],f=r[2*p+1];wm(d,f,t,e)<=l&&a.push(n[p]),(0===c?t-i<=d:e-i<=f)&&(s.push(h),s.push(p-1),s.push(1-c)),(0===c?t+i>=d:e+i>=f)&&(s.push(p+1),s.push(u),s.push(1-c))}return a}}function vm(t,e,i,n,r,o){if(r-n<=i)return;const s=n+r>>1;_m(t,e,s,n,r,o),vm(t,e,i,n,s-1,1-o),vm(t,e,i,s+1,r,1-o)}function _m(t,e,i,n,r,o){for(;r>n;){if(r-n>600){const s=r-n+1,a=i-n+1,l=Math.log(s),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(s-c)/s)*(a-s/2<0?-1:1);_m(t,e,i,Math.max(n,Math.floor(i-a*c/s+u)),Math.min(r,Math.floor(i+(s-a)*c/s+u)),o)}const s=e[2*i+o];let a=n,l=r;for(xm(t,e,n,i),e[2*r+o]>s&&xm(t,e,n,r);a<l;){for(xm(t,e,a,l),a++,l--;e[2*a+o]<s;)a++;for(;e[2*l+o]>s;)l--}e[2*n+o]===s?xm(t,e,n,l):(l++,xm(t,e,l,r)),l<=i&&(n=l+1),i<=l&&(r=l-1)}}function xm(t,e,i,n){bm(t,i,n),bm(e,2*i,2*n),bm(e,2*i+1,2*n+1)}function bm(t,e,i){const n=t[e];t[e]=t[i],t[i]=n}function wm(t,e,i,n){const r=t-i,o=e-n;return r*r+o*o}t.ARRAY_TYPE=ua,t.AUTH_ERR_MSG=vt,t.Aabb=rl,t.Actor=class{constructor(t,i,n){this.target=t,this.parent=i,this.mapId=n,this.callbacks={},this.cancelCallbacks={},z(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.globalScope=X()?t:e,this.scheduler=new xf}send(t,e,i,n,r=!1,o){const s=Math.round(1e18*Math.random()).toString(36).substring(0,10);i&&(i.metadata=o,this.callbacks[s]=i);const a=Q(this.globalScope)?void 0:[];return this.target.postMessage({id:s,type:t,hasCallback:!!i,targetMapId:n,mustQueue:r,sourceMapId:this.mapId,data:Kr(e,a)},a),{cancel:()=>{i&&delete this.callbacks[s],this.target.postMessage({id:s,type:"<cancel>",targetMapId:n,sourceMapId:this.mapId})}}}receive(t){const e=t.data,i=e.id;if(i&&(!e.targetMapId||this.mapId===e.targetMapId))if("<cancel>"===e.type){const t=this.cancelCallbacks[i];delete this.cancelCallbacks[i],t&&t.cancel()}else if(e.mustQueue||X()){const t=this.callbacks[i];this.cancelCallbacks[i]=this.scheduler.add((()=>this.processTask(i,e)),t&&t.metadata||{type:"message"})}else this.processTask(i,e)}processTask(t,e){if("<response>"===e.type){const i=this.callbacks[t];delete this.callbacks[t],i&&(e.error?i($r(e.error)):i(null,$r(e.data)))}else{const i=Q(this.globalScope)?void 0:[],n=e.hasCallback?(e,n)=>{delete this.cancelCallbacks[t],this.target.postMessage({id:t,type:"<response>",sourceMapId:this.mapId,error:e?Kr(e):null,data:Kr(n,i)},i)}:t=>{},r=$r(e.data);if(this.parent[e.type])this.parent[e.type](e.sourceMapId,r,n);else if(this.parent.getWorkerSource){const t=e.type.split(".");this.parent.getWorkerSource(e.sourceMapId,t[0],r.source)[t[1]](r,n)}else n(new Error(`Could not find function ${e.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}},t.CanonicalTileID=ph,t.Color=Le,t.ColorMode=Jf,t.CullFaceMode=tm,t.DEMData=qf,t.DataConstantProperty=Lo,t.DedupedRequest=fm,t.DepthMode=Zf,t.EXTENT=aa,t.Elevation=class{isDataAvailableAtPoint(t){const e=this._source();if(this.isUsingMockSource()||!e||t.y<0||t.y>1)return!1;const i=e.getSource().maxzoom,n=1<<i,r=Math.floor(t.x),o=Math.floor((t.x-r)*n),s=Math.floor(t.y*n),a=this.findDEMTileFor(new fh(i,r,i,o,s));return!(!a||!a.dem)}getAtPointOrZero(t,e=0){return this.getAtPoint(t,e)||0}getAtPoint(t,e,i=!0){if(this.isUsingMockSource())return null;null==e&&(e=null);const n=this._source();if(!n)return e;if(t.y<0||t.y>1)return e;const r=n.getSource().maxzoom,o=1<<r,s=Math.floor(t.x),a=t.x-s,l=new fh(r,s,r,Math.floor(a*o),Math.floor(t.y*o)),c=this.findDEMTileFor(l);if(!c||!c.dem)return e;const u=c.dem,h=1<<c.tileID.canonical.z,p=(a*h-c.tileID.canonical.x)*u.dim,d=(t.y*h-c.tileID.canonical.y)*u.dim,f=Math.floor(p),m=Math.floor(d);return(i?this.exaggeration():1)*Li(Li(u.get(f,m),u.get(f,m+1),d-m),Li(u.get(f+1,m),u.get(f+1,m+1),d-m),p-f)}getAtTileOffset(t,e,i){const n=1<<t.canonical.z;return this.getAtPointOrZero(new Kl(t.wrap+(t.canonical.x+e/aa)/n,(t.canonical.y+i/aa)/n))}getAtTileOffsetFunc(t,e,i,n){return r=>{const o=this.getAtTileOffset(t,r.x,r.y),s=n.upVector(t.canonical,r.x,r.y);return Da(s,s,o*n.upVectorScale(t.canonical,e,i).metersToTile),s}}getForTilePoints(t,e,i,n){if(this.isUsingMockSource())return!1;const r=om.create(this,t,n);return!!r&&(e.forEach((t=>{t[2]=this.exaggeration()*r.getElevationAt(t[0],t[1],i)})),!0)}getMinMaxForTile(t){if(this.isUsingMockSource())return null;const e=this.findDEMTileFor(t);if(!e||!e.dem)return null;const i=e.dem.tree,n=e.tileID,r=1<<t.canonical.z-n.canonical.z;let o=t.canonical.x/r-n.canonical.x,s=t.canonical.y/r-n.canonical.y,a=0;for(let e=0;e<t.canonical.z-n.canonical.z&&!i.leaves[a];e++){o*=2,s*=2;const t=2*Math.floor(s)+Math.floor(o);a=i.childOffsets[a]+t,o%=1,s%=1}return{min:this.exaggeration()*i.minimums[a],max:this.exaggeration()*i.maximums[a]}}getMinElevationBelowMSL(){throw new Error("Pure virtual method called.")}raycast(t,e,i){throw new Error("Pure virtual method called.")}pointCoordinate(t){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(t){throw new Error("Pure virtual method called.")}get visibleDemTiles(){throw new Error("Getter must be implemented in subclass.")}},t.ErrorEvent=Kt,t.EvaluationParameters=wo,t.Event=Jt,t.Evented=$t,t.FillExtrusionBucket=th,t.Frustum=nl,t.FrustumCorners=il,t.GLOBE_RADIUS=al,t.GLOBE_SCALE_MATCH_LATITUDE=45,t.GLOBE_ZOOM_THRESHOLD_MAX=sl,t.GLOBE_ZOOM_THRESHOLD_MIN=ol,t.GlobeSharedBuffers=class{constructor(t){this._createGrid(t),this._createPoles(t)}destroy(){this._poleIndexBuffer.destroy(),this._gridBuffer.destroy(),this._gridIndexBuffer.destroy(),this._poleNorthVertexBuffer.destroy(),this._poleSouthVertexBuffer.destroy();for(const t of this._poleSegments)t.destroy();for(const t of this._gridSegments)t.withSkirts.destroy(),t.withoutSkirts.destroy();if(this._wireframeIndexBuffer){this._wireframeIndexBuffer.destroy();for(const t of this._wireframeSegments)t.destroy()}}_fillGridMeshWithLods(t,e){const i=new Uo,n=new ns,r=[],o=t+1+2,s=e[0]+1,a=e[0]+1+(1+e.length),l=(t,e,i)=>{let n=t===o-1?t-2:0===t?t:t-1;return n+=i?24575:0,[n,e]};for(let t=0;t<o;++t)i.emplaceBack(...l(t,0,!0));for(let t=0;t<s;++t)for(let e=0;e<o;++e)i.emplaceBack(...l(e,t,(0===e||e===o-1)&&!0));for(let t=0;t<e.length;++t){const n=e[t];for(let t=0;t<o;++t)i.emplaceBack(...l(t,n,!0))}for(let t=0;t<e.length;++t){const s=n.length,l=e[t]+1+2,c=new ns;for(let i=0;i<l-1;i++){const r=i===l-2,s=r?o*(a-e.length+t-i):o;for(let t=0;t<o-1;t++){const e=i*o+t;0===i||r||0===t||t===o-2?(c.emplaceBack(e+1,e,e+s),c.emplaceBack(e+s,e+s+1,e+1)):(n.emplaceBack(e+1,e,e+s),n.emplaceBack(e+s,e+s+1,e+1))}}const u=sa.simpleSegment(0,s,i.length,n.length-s);for(let t=0;t<c.uint16.length;t+=3)n.emplaceBack(c.uint16[t],c.uint16[t+1],c.uint16[t+2]);const h=sa.simpleSegment(0,s,i.length,n.length-s);r.push({withoutSkirts:u,withSkirts:h})}return{vertices:i,indices:n,segments:r}}_createGrid(t){const e=this._fillGridMeshWithLods(cl,ul);this._gridSegments=e.segments,this._gridBuffer=t.createVertexBuffer(e.vertices,tl.members),this._gridIndexBuffer=t.createIndexBuffer(e.indices,!0)}_createPoles(t){const e=new ns;for(let t=0;t<=cl;t++)e.emplaceBack(0,t+1,t+2);this._poleIndexBuffer=t.createIndexBuffer(e,!0);const i=new as,n=new as;this._poleSegments=[];for(let t=0,e=0;t<ol;t++){const r=360/(1<<t);i.emplaceBack(0,-al,0,.5,0),n.emplaceBack(0,-al,0,.5,1);for(let t=0;t<=cl;t++){const e=t/cl,o=Li(0,r,e),[s,a,l]=Sl(Bl,zl,o,al);i.emplaceBack(s,a,l,e,0),n.emplaceBack(s,a,l,e,1)}this._poleSegments.push(sa.simpleSegment(e,0,66,64)),e+=66}this._poleNorthVertexBuffer=t.createVertexBuffer(i,Ka,!1),this._poleSouthVertexBuffer=t.createVertexBuffer(n,Ka,!1)}getGridBuffers(t,e){return[this._gridBuffer,this._gridIndexBuffer,e?this._gridSegments[t].withSkirts:this._gridSegments[t].withoutSkirts]}getPoleBuffers(t){return[this._poleNorthVertexBuffer,this._poleSouthVertexBuffer,this._poleIndexBuffer,this._poleSegments[t]]}getWirefameBuffers(t,e){if(!this._wireframeSegments){const e=new cs,i=cl,n=i+1+2,r=1;this._wireframeSegments=[];for(let t=0,o=0;t<ul.length;t++){const s=ul[t];for(let t=r;t<s+r;t++)for(let o=r;o<i+r;o++){const i=t*n+o;e.emplaceBack(i,i+1),e.emplaceBack(i,i+n),e.emplaceBack(i,i+n+1)}const a=s*i*3;this._wireframeSegments.push(sa.simpleSegment(0,o,(s+1)*n,a)),o+=a}this._wireframeIndexBuffer=t.createIndexBuffer(e)}return[this._gridBuffer,this._wireframeIndexBuffer,this._wireframeSegments[e]]}},t.GlyphManager=id,t.ImagePosition=Ep,t.KDBush=ym,t.LivePerformanceUtils=Vt,t.LngLat=Gl,t.LngLatBounds=la,t.LocalGlyphMode=ed,t.MAX_MERCATOR_LATITUDE=Ql,t.MercatorCoordinate=Kl,t.ONE_EM=zh,t.OverscaledTileID=fh,t.PerformanceMarkers=Ft,t.Point=v,t.Properties=Oo,t.RGBAImage=Fc,t.Ray=el,t.RequestManager=class{constructor(t,e,i){this._transformRequestFn=t,this._customAccessToken=e,this._silenceAuthErrors=!!i,this._createSkuToken()}_createSkuToken(){const t=function(){let t="";for(let e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",h,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt}_isSkuTokenExpired(){return Date.now()>this._skuTokenExpiresAt}transformRequest(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}}normalizeStyleURL(t,e){if(!_t(t))return t;const i=St(t);return i.path=`/styles/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||e)}normalizeGlyphsURL(t,e){if(!_t(t))return t;const i=St(t);return i.path=`/fonts/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||e)}normalizeSourceURL(t,e,i,n){if(!_t(t))return t;const r=St(t);return r.path=`/v4/${r.authority}.json`,r.params.push("secure"),i&&r.params.push(`language=${i}`),n&&r.params.push(`worldview=${n}`),this._makeAPIURL(r,this._customAccessToken||e)}normalizeSpriteURL(t,e,i,n){const r=St(t);return _t(t)?(r.path=`/styles/v1${r.path}/sprite${e}${i}`,this._makeAPIURL(r,this._customAccessToken||n)):(r.path+=`${e}${i}`,Mt(r))}normalizeTileURL(t,e,i){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!_t(t))return t;const n=St(t);n.path=n.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${e||i&&"raster"!==n.authority&&512===i?"@2x":""}${o.supported?".webp":"$1"}`),"raster"===n.authority?n.path=`/${r.RASTER_URL_PREFIX}${n.path}`:(n.path=n.path.replace(/^.+\/v4\//,"/"),n.path=`/${r.TILE_URL_VERSION}${n.path}`);const s=this._customAccessToken||function(t){for(const e of t){const t=e.match(/^access_token=(.*)$/);if(t)return t[1]}return null}(n.params)||r.ACCESS_TOKEN;return r.REQUIRE_ACCESS_TOKEN&&s&&this._skuToken&&n.params.push(`sku=${this._skuToken}`),this._makeAPIURL(n,s)}canonicalizeTileURL(t,e){const i=St(t);if(!i.path.match(/^(\/v4\/|\/raster\/v1\/)/)||!i.path.match(/\.[\w]+$/))return t;let n="mapbox://";i.path.match(/^\/raster\/v1\//)?n+=`raster/${i.path.replace(`/${r.RASTER_URL_PREFIX}/`,"")}`:n+=`tiles/${i.path.replace(`/${r.TILE_URL_VERSION}/`,"")}`;let o=i.params;return e&&(o=o.filter((t=>!t.match(/^access_token=/)))),o.length&&(n+=`?${o.join("&")}`),n}canonicalizeTileset(t,e){const i=!!e&&_t(e),n=[];for(const e of t.tiles||[])xt(e)?n.push(this.canonicalizeTileURL(e,i)):n.push(e);return n}_makeAPIURL(t,e){const i="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",n=St(r.API_URL);if(t.protocol=n.protocol,t.authority=n.authority,"http"===t.protocol){const e=t.params.indexOf("secure");e>=0&&t.params.splice(e,1)}if("/"!==n.path&&(t.path=`${n.path}${t.path}`),!r.REQUIRE_ACCESS_TOKEN)return Mt(t);if(e=e||r.ACCESS_TOKEN,!this._silenceAuthErrors){if(!e)throw new Error(`An API access token is required to use Mapbox GL. ${i}`);if("s"===e[0])throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${i}`)}return t.params=t.params.filter((t=>-1===t.indexOf("access_token"))),t.params.push(`access_token=${e||""}`),Mt(t)}},t.ResourceType=lt,t.SegmentVector=sa,t.SourceCache=em,t.StencilMode=Qf,t.StructArrayLayout1ui2=us,t.StructArrayLayout2f1f2i16=ts,t.StructArrayLayout2i4=Uo,t.StructArrayLayout2ui4=cs,t.StructArrayLayout3f12=is,t.StructArrayLayout3ui6=ns,t.StructArrayLayout4i8=jo,t.StructArrayLayout5f20=as,t.Texture=vf,t.Tile=Rf,t.Transitionable=So,t.Uniform1f=Bs,t.Uniform1i=class extends Ns{constructor(t){super(t),this.current=0}set(t,e,i){this.fetchUniformLocation(t,e)&&this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},t.Uniform2f=class extends Ns{constructor(t){super(t),this.current=[0,0]}set(t,e,i){this.fetchUniformLocation(t,e)&&(i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1])))}},t.Uniform3f=class extends Ns{constructor(t){super(t),this.current=[0,0,0]}set(t,e,i){this.fetchUniformLocation(t,e)&&(i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2])))}},t.Uniform4f=zs,t.UniformColor=Fs,t.UniformMatrix2f=class extends Ns{constructor(t){super(t),this.current=Gs}set(t,e,i){if(this.fetchUniformLocation(t,e))for(let t=0;t<4;t++)if(i[t]!==this.current[t]){this.current=i,this.gl.uniformMatrix2fv(this.location,!1,i);break}}},t.UniformMatrix3f=class extends Ns{constructor(t){super(t),this.current=Us}set(t,e,i){if(this.fetchUniformLocation(t,e))for(let t=0;t<9;t++)if(i[t]!==this.current[t]){this.current=i,this.gl.uniformMatrix3fv(this.location,!1,i);break}}},t.UniformMatrix4f=class extends Ns{constructor(t){super(t),this.current=Vs}set(t,e,i){if(this.fetchUniformLocation(t,e)){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let t=1;t<16;t++)if(i[t]!==this.current[t]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}}},t.UnwrappedTileID=dh,t.ValidationError=ir,t.VectorTileFeature=Xu,t.VectorTileWorkerSource=class extends $t{constructor(t,e,i,n,r){super(),this.actor=t,this.layerIndex=e,this.availableImages=i,this.loadVectorData=r||mm,this.loading={},this.loaded={},this.deduped=new fm(t.scheduler),this.isSpriteLoaded=n,this.scheduler=t.scheduler}loadTile(t,e){const i=t.uid,n=t&&t.request,r=n&&n.collectResourceTiming,o=this.loading[i]=new pm(t);o.abort=this.loadVectorData(t,((s,a)=>{const l=!this.loading[i];if(delete this.loading[i],l||s||!a)return o.status="done",l||(this.loaded[i]=o),e(s);const c=a.rawData,u={};a.expires&&(u.expires=a.expires),a.cacheControl&&(u.cacheControl=a.cacheControl),o.vectorTile=a.vectorTile||new qu(new gp(c));const h=()=>{o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,((t,i)=>{if(t||!i)return e(t);const o={};if(r){const t=jt(n);t.length>0&&(o.resourceTiming=JSON.parse(JSON.stringify(t)))}e(null,D({rawTileData:c.slice(0)},i,u,o))}))};this.isSpriteLoaded?h():this.once("isSpriteLoaded",(()=>{this.scheduler?this.scheduler.add(h,{type:"parseTile",isSymbolTile:t.isSymbolTile,zoom:t.tileZoom}):h()})),this.loaded=this.loaded||{},this.loaded[i]=o}))}reloadTile(t,e){const i=this.loaded,n=t.uid,r=this;if(i&&i[n]){const o=i[n];o.showCollisionBoxes=t.showCollisionBoxes,o.enableTerrain=!!t.enableTerrain,o.projection=t.projection,o.tileTransform=Pd(t.tileID.canonical,t.projection);const s=(t,i)=>{const n=o.reloadCallback;n&&(delete o.reloadCallback,o.parse(o.vectorTile,r.layerIndex,this.availableImages,r.actor,n)),e(t,i)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}}abortTile(t,e){const i=t.uid,n=this.loading[i];n&&(n.abort&&n.abort(),delete this.loading[i]),e()}removeTile(t,e){const i=this.loaded,n=t.uid;i&&i[n]&&delete i[n],e()}},t.WritingMode=Mp,t.ZoomDependentExpression=Kn,t.add=Ta,t.addDynamicAttributes=nf,t.adjoint=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t[0]=s*u-a*c,t[1]=r*c-n*u,t[2]=n*a-r*s,t[3]=a*l-o*u,t[4]=i*u-r*l,t[5]=r*o-i*a,t[6]=o*c-s*l,t[7]=n*l-i*c,t[8]=i*s-n*o,t},t.asyncAll=P,t.bezier=S,t.bindAll=z,t.boundsAttributes=Lf,t.bufferConvexPolygon=function(t,e){const i=[];for(let n=0;n<t.length;n++){const r=C(n-1,-1,t.length-1),o=C(n+1,-1,t.length-1),s=t[n],a=t[o],l=t[r].sub(s).unit(),c=a.sub(s).unit(),u=c.angleWithSep(l.x,l.y),h=l.add(c).unit().mult(-1*e/Math.sin(u/2));i.push(s.add(h))}return i},t.cacheEntryPossiblyAdded=function(t){at++,at>nt&&(t.getActor().send("enforceCacheSizeLimit",it),at=0)},t.calculateGlobeLabelMatrix=function(t,e){const{x:i,y:n}=t.point,r=Dl(i,n,t.worldSize/t._pixelsPerMercatorPixel,0,0);return ma(r,r,Ll(vl(e)))},t.calculateGlobeMatrix=function(t){const{x:e,y:i}=t.point,{lng:n,lat:r}=t._center;return Dl(e,i,t.worldSize,n,r)},t.calculateGlobeMercatorMatrix=function(t){const e=t.pixelsPerMeter,i=e/ql(1,t.center.lat),n=da(new Float64Array(16));return ga(n,n,[t.point.x,t.point.y,0]),ya(n,n,[i,i,e]),Float32Array.from(n)},t.circumferenceAtLatitude=jl,t.clamp=T,t.clearTileCache=function(t){if(!rt())return;const i=e.caches.delete($);t&&i.catch(t).then((()=>t()))},t.clipLine=Qp,t.clone=function(t){var e=new ua(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$1=G,t.collisionCircleLayout=Bh,t.config=r,t.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},t.create=function(){var t=new ua(16);return ua!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=ha,t.createExpression=Qn,t.createLayout=Fo,t.createStyleLayer=function(t){return"custom"===t.type?new ff(t):new yf[t.type](t)},t.cross=Na,t.degToRad=b,t.distance=function(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2])},t.div=function(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t[2]=e[2]/i[2],t},t.dot=ka,t.earthRadius=Fl,t.ease=M,t.easeCubicInOut=E,t.ecefToLatLng=function([t,e,i]){const n=Math.hypot(t,e,i),r=Math.atan2(t,i),o=.5*Math.PI-Math.acos(-e/n);return new Gl(w(r),w(o))},t.emitValidationErrors=jr,t.endsWith=F,t.enforceCacheSizeLimit=function(t){ot(),tt&&tt.then((e=>{e.keys().then((i=>{for(let n=0;n<i.length-t;n++)e.delete(i[n])}))}))},t.evaluateSizeForFeature=Uh,t.evaluateSizeForZoom=Gh,t.evaluateVariableOffset=vd,t.evented=vo,t.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},t.exactEquals$1=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},t.exported=Zt,t.exported$1=o,t.extend=D,t.extend$1=ee,t.fillExtrusionHeightLift=ah,t.filterObject=U,t.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},t.fromQuat=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=i+i,a=n+n,l=r+r,c=i*s,u=n*s,h=n*a,p=r*s,d=r*a,f=r*l,m=o*s,g=o*a,y=o*l;return t[0]=1-h-f,t[1]=u+y,t[2]=p-g,t[3]=0,t[4]=u-y,t[5]=1-c-f,t[6]=d+m,t[7]=0,t[8]=p+g,t[9]=d-m,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.fromRotation=function(t,e){var i=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.fromScaling=xa,t.furthestTileCorner=function(t){const e=Math.round((t+45+360)%360/90)%4;return A[e]},t.getAABBPointSquareDist=function(t,e,i){let n=0;for(let r=0;r<2;++r){const o=i?i[r]:0;t[r]>o&&(n+=(t[r]-o)*(t[r]-o)),e[r]<o&&(n+=(o-e[r])*(o-e[r]))}return n},t.getAnchorAlignment=zp,t.getAnchorJustification=xd,t.getBounds=function(t){let e=1/0,i=1/0,n=-1/0,r=-1/0;for(const o of t)e=Math.min(e,o.x),i=Math.min(i,o.y),n=Math.max(n,o.x),r=Math.max(r,o.y);return{min:new v(e,i),max:new v(n,r)}},t.getColumn=K,t.getDefaultExportFromCjs=p,t.getGridMatrix=function(t,e,i,n){const r=e.getNorth(),o=e.getSouth(),s=e.getWest(),a=e.getEast(),l=1<<t.z,c=a-s,u=r-o,h=c/cl,p=-u/ul[i],d=[0,h,0,p,0,0,r,s,0];if(t.z>0){const t=180/n;pa(d,d,[t/c+1,0,0,0,t/u+1,0,-.5*t/h,.5*t/p,1])}return d[2]=l,d[5]=t.x,d[8]=t.y,d},t.getImage=yt,t.getJSON=function(t,e){return ht(D(t,{type:"json"}),e)},t.getLatitudinalLod=function(t){const e=Ql-5;t=T(t,-e,e)/e*90;const i=Math.pow(Math.abs(Math.sin(b(t))),3);return Math.round(i*(ul.length-1))},t.getMapSessionAPI=Bt,t.getPerformanceMeasurement=jt,t.getProjection=Jd,t.getRTLTextPluginStatus=_o,t.getReferrer=ut,t.getTilePoint=function(t,{x:e,y:i},n=0){return new v(((e-n)*t.scale-t.x)*aa,(i*t.scale-t.y)*aa)},t.getTileVec3=function(t,e,i=0){return Ma(((e.x-i)*t.scale-t.x)*aa,(e.y*t.scale-t.y)*aa,Yl(e.z,e.y))},t.getVideo=function(t,i){const n=e.document.createElement("video");n.muted=!0,n.onloadstart=function(){i(null,n)};for(let i=0;i<t.length;i++){const r=e.document.createElement("source");dt(t[i])||(n.crossOrigin="Anonymous"),r.src=t[i],n.appendChild(r)}return{cancel:()=>{}}},t.globeCenterToScreenPoint=function(t){const e=[0,0,0],i=da(new Float64Array(16));return ma(i,t.pixelMatrix,t.globeMatrix),Ba(e,e,i),new v(e[0],e[1])},t.globeDenormalizeECEF=Ll,t.globeECEFOrigin=function(t,e){const i=[0,0,0];return Ba(i,i,Pl(vl(e.canonical))),Ba(i,i,t),i},t.globeMetersToEcef=fl,t.globeNormalizeECEF=Pl,t.globePixelsToTileUnits=function(t,e){return aa/(512*Math.pow(2,t))*Il(vl(e))},t.globePoleMatrixForTile=function(t,e,i){const n=da(new Float64Array(16)),r=(e/(1<<t)-.5)*Math.PI*2;return _a(n,i.globeMatrix,r),Float32Array.from(n)},t.globeTileBounds=vl,t.globeTiltAtLngLat=Ol,t.globeToMercatorTransition=Rl,t.globeUseCustomAntiAliasing=function(t,e,i){const n=Rl(i.zoom),r=t.style.map._antialias,o=!!e.extStandardDerivatives,s=e.extStandardDerivativesForceOff||t.terrain&&t.terrain.exaggeration()>0;return 0===n&&!r&&!s&&o},t.identity=da,t.identity$1=Xa,t.invert=fa,t.isFullscreen=function(){return!!e.document.fullscreenElement||!!e.document.webkitFullscreenElement},t.isLngLatBehindGlobe=kl,t.isMapAuthenticated=function(t){return zt.has(t)},t.isMapboxURL=_t,t.isSafariWithAntialiasingBug=function(t){const e=t.navigator?t.navigator.userAgent:null;return!!Q(t)&&e&&(e.match("Version/15.4")||e.match("Version/15.5")||e.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/))},t.latFromMercatorY=Zl,t.latLngToECEF=Ml,t.len=Ga,t.length=Sa,t.length$1=function(t){return Math.hypot(t[0],t[1],t[2],t[3])},t.lngFromMercatorX=Xl,t.loadVectorTile=mm,t.makeRequest=ht,t.mapValue=function(t,e,i,n,r){return T((t-e)/(i-e)*(r-n)+n,n,r)},t.mercatorScale=Jl,t.mercatorXfromLng=Hl,t.mercatorYfromLat=Wl,t.mercatorZfromAltitude=ql,t.mul=wa,t.mul$1=Ua,t.multiply=ma,t.multiply$1=pa,t.multiply$2=Ca,t.nextPowerOfTwo=N,t.normalize=Oa,t.normalize$1=Qa,t.normalize$2=Ha,t.number=Li,t.ortho=function(t,e,i,n,r,o,s){var a=1/(e-i),l=1/(n-r),c=1/(o-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+i)*a,t[13]=(r+n)*l,t[14]=(s+o)*c,t[15]=1,t},t.pbf=Zh,t.perspective=function(t,e,i,n,r){var o,s=1/Math.tan(e/2);return t[0]=s/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0?(t[10]=(r+n)*(o=1/(n-r)),t[14]=2*r*n*o):(t[10]=-1,t[14]=-2*n),t},t.pick=function(t,e){const i={};for(let n=0;n<e.length;n++){const r=e[n];r in t&&(i[r]=t[r])}return i},t.plugin=bo,t.pointGeometry=g,t.polesInViewport=function(t){const e=da(new Float64Array(16));ma(e,t.pixelMatrix,t.globeMatrix);const i=[0,hl,0],n=[0,pl,0];return Ba(i,i,e),Ba(n,n,e),[i[0]>0&&i[0]<=t.width&&i[1]>0&&i[1]<=t.height&&!kl(t,new Gl(t.center.lat,90)),n[0]>0&&n[0]<=t.width&&n[1]>0&&n[1]<=t.height&&!kl(t,new Gl(t.center.lat,-90))]},t.polygonContainsPoint=xc,t.polygonIntersectsBox=bc,t.polygonIntersectsPolygon=hc,t.polygonizeBounds=function(t,e,i=0,n=!0){const r=new v(i,i),o=t.sub(r),s=e.add(r),a=[o,new v(s.x,o.y),s,new v(o.x,s.y)];return n&&a.push(o.clone()),a},t.posAttributes=tl,t.postMapLoadEvent=Rt,t.postPerformanceEvent=kt,t.postTurnstileEvent=Lt,t.potpack=wp,t.prevPowerOfTwo=function(t){return t<=1?1:Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},t.radToDeg=w,t.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.registerForPluginStateChange=function(t){return t({pluginStatus:fo,pluginURL:mo}),vo.on("pluginStateChange",t),t},t.removeAuthState=function(t){zt.delete(t)},t.renderColorRamp=Uc,t.resample=tc,t.rotateX=va,t.rotateX$1=Za,t.rotateY=_a,t.rotateY$1=Ya,t.rotateZ=function(t,e,i){var n=Math.sin(i),r=Math.cos(i),o=e[0],s=e[1],a=e[2],l=e[3],c=e[4],u=e[5],h=e[6],p=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*r+c*n,t[1]=s*r+u*n,t[2]=a*r+h*n,t[3]=l*r+p*n,t[4]=c*r-o*n,t[5]=u*r-s*n,t[6]=h*r-a*n,t[7]=p*r-l*n,t},t.rotateZ$1=function(t,e,i){i*=.5;var n=e[0],r=e[1],o=e[2],s=e[3],a=Math.sin(i),l=Math.cos(i);return t[0]=n*l+r*a,t[1]=r*l-n*a,t[2]=o*l+s*a,t[3]=s*l-o*a,t},t.scale=ya,t.scale$1=ja,t.scale$2=Da,t.scaleAndAdd=Ra,t.set=function(t,e,i,n){return t[0]=e,t[1]=i,t[2]=n,t},t.setCacheLimits=function(t,e){it=t,nt=e},t.setColumn=function(t,e,i){t[4*e+0]=i[0],t[4*e+1]=i[1],t[4*e+2]=i[2],t[4*e+3]=i[3]},t.setRTLTextPlugin=function(t,e,i=!1){if(fo===co||fo===uo||fo===ho)throw new Error("setRTLTextPlugin cannot be called multiple times.");mo=Zt.resolveURL(t),fo=co,po=e,yo(),i||xo()},t.smoothstep=I,t.spec=te,t.squaredLength=function(t){var e=t[0],i=t[1],n=t[2];return e*e+i*i+n*n},t.storeAuthState=function(t,e){e?zt.add(t):zt.delete(t)},t.sub=Va,t.subtract=Ia,t.symbolSize=jh,t.tileAABB=function(t,e,i,n,r,o,s,a,l){if("globe"===l.name)return wl(t,e,new ph(i,n,r));const c=Pd({z:i,x:n,y:r},l);return new rl([(o+c.x/c.scale)*e,e*(c.y/c.scale),s],[(o+c.x2/c.scale)*e,e*(c.y2/c.scale),a])},t.tileCornersToBounds=Al,t.tileTransform=Pd,t.transformMat3=function(t,e,i){var n=e[0],r=e[1],o=e[2];return t[0]=n*i[0]+r*i[3]+o*i[6],t[1]=n*i[1]+r*i[4]+o*i[7],t[2]=n*i[2]+r*i[5]+o*i[8],t},t.transformMat4=Ba,t.transformMat4$1=Wa,t.transformQuat=za,t.transitionTileAABBinECEF=xl,t.translate=ga,t.transpose=function(t,e){if(t===e){var i=e[1],n=e[2],r=e[5];t[1]=e[3],t[2]=e[6],t[3]=i,t[5]=e[7],t[6]=n,t[7]=r}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},t.triggerPluginCompletionEvent=go,t.uniqueId=O,t.updateGlobeVertexNormal=function(t,e,i,n,r){const o=5*e+2;t.float32[o+0]=i,t.float32[o+1]=n,t.float32[o+2]=r},t.validateCustomStyleLayer=function(t){const e=[],i=t.id;return void 0===i&&e.push({message:`layers.${i}: missing required property "id"`}),void 0===t.render&&e.push({message:`layers.${i}: missing required method "render"`}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),e},t.validateFilter=t=>Gr(Ar(t)),t.validateFog=t=>Gr(kr(t)),t.validateLayer=t=>Gr(Ir(t)),t.validateLight=t=>Gr(Rr(t)),t.validateSource=t=>Gr(Lr(t)),t.validateStyle=Fr,t.validateTerrain=t=>Gr(Or(t)),t.values=L,t.vectorTile=Ou,t.version=i,t.warnOnce=H,t.window=e,t.wrap=C})),n(["./shared"],(function(t){function e(t){if("number"==typeof t||"boolean"==typeof t||"string"==typeof t||null==t)return JSON.stringify(t);if(Array.isArray(t)){let i="[";for(const n of t)i+=`${e(n)},`;return`${i}]`}let i="{";for(const n of Object.keys(t).sort())i+=`${n}:${e(t[n])},`;return`${i}}`}function i(i){let n="";for(const r of t.refProperties)n+=`/${e(i[r])}`;return n}class n{constructor(t){this.keyCache={},t&&this.replace(t)}replace(t){this._layerConfigs={},this._layers={},this.update(t,[])}update(e,n){for(const i of e)this._layerConfigs[i.id]=i,(this._layers[i.id]=t.createStyleLayer(i)).compileFilter(),this.keyCache[i.id]&&delete this.keyCache[i.id];for(const t of n)delete this.keyCache[t],delete this._layerConfigs[t],delete this._layers[t];this.familiesBySource={};const r=function(t,e){const n={};for(let r=0;r<t.length;r++){const o=e&&e[t[r].id]||i(t[r]);e&&(e[t[r].id]=o);let s=n[o];s||(s=n[o]=[]),s.push(t[r])}const r=[];for(const t in n)r.push(n[t]);return r}(t.values(this._layerConfigs),this.keyCache);for(const t of r){const e=t.map((t=>this._layers[t.id])),i=e[0];if("none"===i.visibility)continue;const n=i.source||"";let r=this.familiesBySource[n];r||(r=this.familiesBySource[n]={});const o=i.sourceLayer||"_geojsonTileLayer";let s=r[o];s||(s=r[o]=[]),s.push(e)}}}class r{loadTile(e,i){const{uid:n,encoding:r,rawImageData:o,padding:s,buildQuadTree:a}=e,l=t.window.ImageBitmap&&o instanceof t.window.ImageBitmap?this.getImageData(o,s):o;i(null,new t.DEMData(n,l,r,s<1,a))}getImageData(t,e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(t.width,t.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=t.width,this.offscreenCanvas.height=t.height,this.offscreenCanvasContext.drawImage(t,0,0,t.width,t.height);const i=this.offscreenCanvasContext.getImageData(-e,-e,t.width+2*e,t.height+2*e);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),i}}function o(t,e){if(0!==t.length){s(t[0],e);for(var i=1;i<t.length;i++)s(t[i],!e)}}function s(t,e){for(var i=0,n=0,r=0,o=t.length,s=o-1;r<o;s=r++){var a=(t[r][0]-t[s][0])*(t[s][1]+t[r][1]),l=i+a;n+=Math.abs(i)>=Math.abs(a)?i-l+a:a-l+i,i=l}i+n>=0!=!!e&&t.reverse()}var a=t.getDefaultExportFromCjs((function t(e,i){var n,r=e&&e.type;if("FeatureCollection"===r)for(n=0;n<e.features.length;n++)t(e.features[n],i);else if("GeometryCollection"===r)for(n=0;n<e.geometries.length;n++)t(e.geometries[n],i);else if("Feature"===r)t(e.geometry,i);else if("Polygon"===r)o(e.coordinates,i);else if("MultiPolygon"===r)for(n=0;n<e.coordinates.length;n++)o(e.coordinates[n],i);return e}));const l=t.VectorTileFeature.prototype.toGeoJSON;var c={exports:{}},u=t.pointGeometry,h=t.vectorTile.VectorTileFeature,p=d;function d(t,e){this.options=e||{},this.features=t,this.length=t.length}function f(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}d.prototype.feature=function(t){return new f(this.features[t],this.options.extent)},f.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var i=t[e],n=[],r=0;r<i.length;r++)n.push(new u(i[r][0],i[r][1]));this.geometry.push(n)}return this.geometry},f.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,i=-1/0,n=1/0,r=-1/0,o=0;o<t.length;o++)for(var s=t[o],a=0;a<s.length;a++){var l=s[a];e=Math.min(e,l.x),i=Math.max(i,l.x),n=Math.min(n,l.y),r=Math.max(r,l.y)}return[e,n,i,r]},f.prototype.toGeoJSON=h.prototype.toGeoJSON;var m=t.pbf,g=p;function y(t){var e=new m;return function(t,e){for(var i in t.layers)e.writeMessage(3,v,t.layers[i])}(t,e),e.finish()}function v(t,e){var i;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var n={keys:[],values:[],keycache:{},valuecache:{}};for(i=0;i<t.length;i++)n.feature=t.feature(i),e.writeMessage(2,_,n);var r=n.keys;for(i=0;i<r.length;i++)e.writeStringField(3,r[i]);var o=n.values;for(i=0;i<o.length;i++)e.writeMessage(4,E,o[i])}function _(t,e){var i=t.feature;void 0!==i.id&&e.writeVarintField(1,i.id),e.writeMessage(2,x,t),e.writeVarintField(3,i.type),e.writeMessage(4,A,i)}function x(t,e){var i=t.feature,n=t.keys,r=t.values,o=t.keycache,s=t.valuecache;for(var a in i.properties){var l=i.properties[a],c=o[a];if(null!==l){void 0===c&&(n.push(a),o[a]=c=n.length-1),e.writeVarint(c);var u=typeof l;"string"!==u&&"boolean"!==u&&"number"!==u&&(l=JSON.stringify(l));var h=u+":"+l,p=s[h];void 0===p&&(r.push(l),s[h]=p=r.length-1),e.writeVarint(p)}}}function b(t,e){return(e<<3)+(7&t)}function w(t){return t<<1^t>>31}function A(t,e){for(var i=t.loadGeometry(),n=t.type,r=0,o=0,s=i.length,a=0;a<s;a++){var l=i[a],c=1;1===n&&(c=l.length),e.writeVarint(b(1,c));for(var u=3===n?l.length-1:l.length,h=0;h<u;h++){1===h&&1!==n&&e.writeVarint(b(2,u-1));var p=l[h].x-r,d=l[h].y-o;e.writeVarint(w(p)),e.writeVarint(w(d)),r+=p,o+=d}3===n&&e.writeVarint(b(7,1))}}function E(t,e){var i=typeof t;"string"===i?e.writeStringField(1,t):"boolean"===i?e.writeBooleanField(7,t):"number"===i&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}c.exports=y,c.exports.fromVectorTileJs=y,c.exports.fromGeojsonVt=function(t,e){e=e||{};var i={};for(var n in t)i[n]=new g(t[n].features,e),i[n].name=n,i[n].version=e.version,i[n].extent=e.extent;return y({layers:i})},c.exports.GeoJSONWrapper=g;var S=t.getDefaultExportFromCjs(c.exports);const M={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},T=Math.fround||(I=new Float32Array(1),t=>(I[0]=+t,I[0]));var I;const C=3,P=5,L=6;class D{constructor(t){this.options=Object.assign(Object.create(M),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){const{log:e,minZoom:i,maxZoom:n}=this.options;e&&console.time("total time");const r=`prepare ${t.length} points`;e&&console.time(r),this.points=t;const o=[];for(let e=0;e<t.length;e++){const i=t[e];if(!i.geometry)continue;const[n,r]=i.geometry.coordinates,s=T(k(n)),a=T(N(r));o.push(s,a,1/0,e,-1,1),this.options.reduce&&o.push(0)}let s=this.trees[n+1]=this._createTree(o);e&&console.timeEnd(r);for(let t=n;t>=i;t--){const i=+Date.now();s=this.trees[t]=this._createTree(this._cluster(s,t)),e&&console.log("z%d: %d clusters in %dms",t,s.numItems,+Date.now()-i)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let i=((t[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,t[1]));let r=180===t[2]?180:((t[2]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)i=-180,r=180;else if(i>r){const t=this.getClusters([i,n,180,o],e),s=this.getClusters([-180,n,r,o],e);return t.concat(s)}const s=this.trees[this._limitZoom(e)],a=s.range(k(i),N(o),k(r),N(n)),l=s.data,c=[];for(const t of a){const e=this.stride*t;c.push(l[e+P]>1?R(l,e,this.clusterProps):this.points[l[e+C]])}return c}getChildren(t){const e=this._getOriginId(t),i=this._getOriginZoom(t),n="No cluster with the specified id.",r=this.trees[i];if(!r)throw new Error(n);const o=r.data;if(e*this.stride>=o.length)throw new Error(n);const s=this.options.radius/(this.options.extent*Math.pow(2,i-1)),a=r.within(o[e*this.stride],o[e*this.stride+1],s),l=[];for(const e of a){const i=e*this.stride;o[i+4]===t&&l.push(o[i+P]>1?R(o,i,this.clusterProps):this.points[o[i+C]])}if(0===l.length)throw new Error(n);return l}getLeaves(t,e,i){const n=[];return this._appendLeaves(n,t,e=e||10,i=i||0,0),n}getTile(t,e,i){const n=this.trees[this._limitZoom(t)],r=Math.pow(2,t),{extent:o,radius:s}=this.options,a=s/o,l=(i-a)/r,c=(i+1+a)/r,u={features:[]};return this._addTileFeatures(n.range((e-a)/r,l,(e+1+a)/r,c),n.data,e,i,r,u),0===e&&this._addTileFeatures(n.range(1-a/r,l,1,c),n.data,r,i,r,u),e===r-1&&this._addTileFeatures(n.range(0,l,a/r,c),n.data,-1,i,r,u),u.features.length?u:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const i=this.getChildren(t);if(e++,1!==i.length)break;t=i[0].properties.cluster_id}return e}_appendLeaves(t,e,i,n,r){const o=this.getChildren(e);for(const e of o){const o=e.properties;if(o&&o.cluster?r+o.point_count<=n?r+=o.point_count:r=this._appendLeaves(t,o.cluster_id,i,n,r):r<n?r++:t.push(e),t.length===i)break}return r}_createTree(e){const i=new t.KDBush(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let t=0;t<e.length;t+=this.stride)i.add(e[t],e[t+1]);return i.finish(),i.data=e,i}_addTileFeatures(t,e,i,n,r,o){for(const s of t){const t=s*this.stride,a=e[t+P]>1;let l,c,u;if(a)l=O(e,t,this.clusterProps),c=e[t],u=e[t+1];else{const i=this.points[e[t+C]];l=i.properties;const[n,r]=i.geometry.coordinates;c=k(n),u=N(r)}const h={type:1,geometry:[[Math.round(this.options.extent*(c*r-i)),Math.round(this.options.extent*(u*r-n))]],tags:l};let p;p=a||this.options.generateId?e[t+C]:this.points[e[t+C]].id,void 0!==p&&(h.id=p),o.features.push(h)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,e){const{radius:i,extent:n,reduce:r,minPoints:o}=this.options,s=i/(n*Math.pow(2,e)),a=t.data,l=[],c=this.stride;for(let i=0;i<a.length;i+=c){if(a[i+2]<=e)continue;a[i+2]=e;const n=a[i],u=a[i+1],h=t.within(a[i],a[i+1],s),p=a[i+P];let d=p;for(const t of h){const i=t*c;a[i+2]>e&&(d+=a[i+P])}if(d>p&&d>=o){let t,o=n*p,s=u*p,f=-1;const m=((i/c|0)<<5)+(e+1)+this.points.length;for(const n of h){const l=n*c;if(a[l+2]<=e)continue;a[l+2]=e;const u=a[l+P];o+=a[l]*u,s+=a[l+1]*u,a[l+4]=m,r&&(t||(t=this._map(a,i,!0),f=this.clusterProps.length,this.clusterProps.push(t)),r(t,this._map(a,l)))}a[i+4]=m,l.push(o/d,s/d,1/0,m,-1,d),r&&l.push(f)}else{for(let t=0;t<c;t++)l.push(a[i+t]);if(d>1)for(const t of h){const i=t*c;if(!(a[i+2]<=e)){a[i+2]=e;for(let t=0;t<c;t++)l.push(a[i+t])}}}}return l}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e,i){if(t[e+P]>1){const n=this.clusterProps[t[e+L]];return i?Object.assign({},n):n}const n=this.points[t[e+C]].properties,r=this.options.map(n);return i&&r===n?Object.assign({},r):r}}function R(t,e,i){return{type:"Feature",id:t[e+C],properties:O(t,e,i),geometry:{type:"Point",coordinates:[(n=t[e],360*(n-.5)),B(t[e+1])]}};var n}function O(t,e,i){const n=t[e+P],r=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?Math.round(n/100)/10+"k":n,o=t[e+L],s=-1===o?{}:Object.assign({},i[o]);return Object.assign(s,{cluster:!0,cluster_id:t[e+C],point_count:n,point_count_abbreviated:r})}function k(t){return t/360+.5}function N(t){const e=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return i<0?0:i>1?1:i}function B(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function z(t,e,i,n){for(var r,o=n,s=i-e>>1,a=i-e,l=t[e],c=t[e+1],u=t[i],h=t[i+1],p=e+3;p<i;p+=3){var d=F(t[p],t[p+1],l,c,u,h);if(d>o)r=p,o=d;else if(d===o){var f=Math.abs(p-s);f<a&&(r=p,a=f)}}o>n&&(r-e>3&&z(t,e,r,n),t[r+2]=o,i-r>3&&z(t,r,i,n))}function F(t,e,i,n,r,o){var s=r-i,a=o-n;if(0!==s||0!==a){var l=((t-i)*s+(e-n)*a)/(s*s+a*a);l>1?(i=r,n=o):l>0&&(i+=s*l,n+=a*l)}return(s=t-i)*s+(a=e-n)*a}function V(t,e,i,n){var r={id:void 0===t?null:t,type:e,geometry:i,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,i=t.type;if("Point"===i||"MultiPoint"===i||"LineString"===i)U(t,e);else if("Polygon"===i||"MultiLineString"===i)for(var n=0;n<e.length;n++)U(t,e[n]);else if("MultiPolygon"===i)for(n=0;n<e.length;n++)for(var r=0;r<e[n].length;r++)U(t,e[n][r])}(r),r}function U(t,e){for(var i=0;i<e.length;i+=3)t.minX=Math.min(t.minX,e[i]),t.minY=Math.min(t.minY,e[i+1]),t.maxX=Math.max(t.maxX,e[i]),t.maxY=Math.max(t.maxY,e[i+1])}function G(t,e,i,n){if(e.geometry){var r=e.geometry.coordinates,o=e.geometry.type,s=Math.pow(i.tolerance/((1<<i.maxZoom)*i.extent),2),a=[],l=e.id;if(i.promoteId?l=e.properties[i.promoteId]:i.generateId&&(l=n||0),"Point"===o)j(r,a);else if("MultiPoint"===o)for(var c=0;c<r.length;c++)j(r[c],a);else if("LineString"===o)H(r,a,s,!1);else if("MultiLineString"===o){if(i.lineMetrics){for(c=0;c<r.length;c++)H(r[c],a=[],s,!1),t.push(V(l,"LineString",a,e.properties));return}W(r,a,s,!1)}else if("Polygon"===o)W(r,a,s,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(c=0;c<e.geometry.geometries.length;c++)G(t,{id:l,geometry:e.geometry.geometries[c],properties:e.properties},i,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(c=0;c<r.length;c++){var u=[];W(r[c],u,s,!0),a.push(u)}}t.push(V(l,o,a,e.properties))}}function j(t,e){e.push(q(t[0])),e.push(X(t[1])),e.push(0)}function H(t,e,i,n){for(var r,o,s=0,a=0;a<t.length;a++){var l=q(t[a][0]),c=X(t[a][1]);e.push(l),e.push(c),e.push(0),a>0&&(s+=n?(r*c-l*o)/2:Math.sqrt(Math.pow(l-r,2)+Math.pow(c-o,2))),r=l,o=c}var u=e.length-3;e[2]=1,z(e,0,u,i),e[u+2]=1,e.size=Math.abs(s),e.start=0,e.end=e.size}function W(t,e,i,n){for(var r=0;r<t.length;r++){var o=[];H(t[r],o,i,n),e.push(o)}}function q(t){return t/360+.5}function X(t){var e=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return i<0?0:i>1?1:i}function Z(t,e,i,n,r,o,s,a){if(n/=e,o>=(i/=e)&&s<n)return t;if(s<i||o>=n)return null;for(var l=[],c=0;c<t.length;c++){var u=t[c],h=u.geometry,p=u.type,d=0===r?u.minX:u.minY,f=0===r?u.maxX:u.maxY;if(d>=i&&f<n)l.push(u);else if(!(f<i||d>=n)){var m=[];if("Point"===p||"MultiPoint"===p)Y(h,m,i,n,r);else if("LineString"===p)Q(h,m,i,n,r,!1,a.lineMetrics);else if("MultiLineString"===p)K(h,m,i,n,r,!1);else if("Polygon"===p)K(h,m,i,n,r,!0);else if("MultiPolygon"===p)for(var g=0;g<h.length;g++){var y=[];K(h[g],y,i,n,r,!0),y.length&&m.push(y)}if(m.length){if(a.lineMetrics&&"LineString"===p){for(g=0;g<m.length;g++)l.push(V(u.id,p,m[g],u.tags));continue}"LineString"!==p&&"MultiLineString"!==p||(1===m.length?(p="LineString",m=m[0]):p="MultiLineString"),"Point"!==p&&"MultiPoint"!==p||(p=3===m.length?"Point":"MultiPoint"),l.push(V(u.id,p,m,u.tags))}}}return l.length?l:null}function Y(t,e,i,n,r){for(var o=0;o<t.length;o+=3){var s=t[o+r];s>=i&&s<=n&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function Q(t,e,i,n,r,o,s){for(var a,l,c=J(t),u=0===r?tt:et,h=t.start,p=0;p<t.length-3;p+=3){var d=t[p],f=t[p+1],m=t[p+2],g=t[p+3],y=t[p+4],v=0===r?d:f,_=0===r?g:y,x=!1;s&&(a=Math.sqrt(Math.pow(d-g,2)+Math.pow(f-y,2))),v<i?_>i&&(l=u(c,d,f,g,y,i),s&&(c.start=h+a*l)):v>n?_<n&&(l=u(c,d,f,g,y,n),s&&(c.start=h+a*l)):$(c,d,f,m),_<i&&v>=i&&(l=u(c,d,f,g,y,i),x=!0),_>n&&v<=n&&(l=u(c,d,f,g,y,n),x=!0),!o&&x&&(s&&(c.end=h+a*l),e.push(c),c=J(t)),s&&(h+=a)}var b=t.length-3;d=t[b],f=t[b+1],m=t[b+2],(v=0===r?d:f)>=i&&v<=n&&$(c,d,f,m),b=c.length-3,o&&b>=3&&(c[b]!==c[0]||c[b+1]!==c[1])&&$(c,c[0],c[1],c[2]),c.length&&e.push(c)}function J(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function K(t,e,i,n,r,o){for(var s=0;s<t.length;s++)Q(t[s],e,i,n,r,o,!1)}function $(t,e,i,n){t.push(e),t.push(i),t.push(n)}function tt(t,e,i,n,r,o){var s=(o-e)/(n-e);return t.push(o),t.push(i+(r-i)*s),t.push(1),s}function et(t,e,i,n,r,o){var s=(o-i)/(r-i);return t.push(e+(n-e)*s),t.push(o),t.push(1),s}function it(t,e){for(var i=[],n=0;n<t.length;n++){var r,o=t[n],s=o.type;if("Point"===s||"MultiPoint"===s||"LineString"===s)r=nt(o.geometry,e);else if("MultiLineString"===s||"Polygon"===s){r=[];for(var a=0;a<o.geometry.length;a++)r.push(nt(o.geometry[a],e))}else if("MultiPolygon"===s)for(r=[],a=0;a<o.geometry.length;a++){for(var l=[],c=0;c<o.geometry[a].length;c++)l.push(nt(o.geometry[a][c],e));r.push(l)}i.push(V(o.id,s,r,o.tags))}return i}function nt(t,e){var i=[];i.size=t.size,void 0!==t.start&&(i.start=t.start,i.end=t.end);for(var n=0;n<t.length;n+=3)i.push(t[n]+e,t[n+1],t[n+2]);return i}function rt(t,e){if(t.transformed)return t;var i,n,r,o=1<<t.z,s=t.x,a=t.y;for(i=0;i<t.features.length;i++){var l=t.features[i],c=l.geometry,u=l.type;if(l.geometry=[],1===u)for(n=0;n<c.length;n+=2)l.geometry.push(ot(c[n],c[n+1],e,o,s,a));else for(n=0;n<c.length;n++){var h=[];for(r=0;r<c[n].length;r+=2)h.push(ot(c[n][r],c[n][r+1],e,o,s,a));l.geometry.push(h)}}return t.transformed=!0,t}function ot(t,e,i,n,r,o){return[Math.round(i*(t*n-r)),Math.round(i*(e*n-o))]}function st(t,e,i,n,r){for(var o=e===r.maxZoom?0:r.tolerance/((1<<e)*r.extent),s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:i,y:n,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},a=0;a<t.length;a++){s.numFeatures++,at(s,t[a],o,r);var l=t[a].minX,c=t[a].minY,u=t[a].maxX,h=t[a].maxY;l<s.minX&&(s.minX=l),c<s.minY&&(s.minY=c),u>s.maxX&&(s.maxX=u),h>s.maxY&&(s.maxY=h)}return s}function at(t,e,i,n){var r=e.geometry,o=e.type,s=[];if("Point"===o||"MultiPoint"===o)for(var a=0;a<r.length;a+=3)s.push(r[a]),s.push(r[a+1]),t.numPoints++,t.numSimplified++;else if("LineString"===o)lt(s,r,t,i,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(a=0;a<r.length;a++)lt(s,r[a],t,i,"Polygon"===o,0===a);else if("MultiPolygon"===o)for(var l=0;l<r.length;l++){var c=r[l];for(a=0;a<c.length;a++)lt(s,c[a],t,i,!0,0===a)}if(s.length){var u=e.tags||null;if("LineString"===o&&n.lineMetrics){for(var h in u={},e.tags)u[h]=e.tags[h];u.mapbox_clip_start=r.start/r.size,u.mapbox_clip_end=r.end/r.size}var p={geometry:s,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:u};null!==e.id&&(p.id=e.id),t.features.push(p)}}function lt(t,e,i,n,r,o){var s=n*n;if(n>0&&e.size<(r?s:n))i.numPoints+=e.length/3;else{for(var a=[],l=0;l<e.length;l+=3)(0===n||e[l+2]>s)&&(i.numSimplified++,a.push(e[l]),a.push(e[l+1])),i.numPoints++;r&&function(t,e){for(var i=0,n=0,r=t.length,o=r-2;n<r;o=n,n+=2)i+=(t[n]-t[o])*(t[n+1]+t[o+1]);if(i>0===e)for(n=0,r=t.length;n<r/2;n+=2){var s=t[n],a=t[n+1];t[n]=t[r-2-n],t[n+1]=t[r-1-n],t[r-2-n]=s,t[r-1-n]=a}}(a,o),t.push(a)}}function ct(t,e){var i=(e=this.options=function(t,e){for(var i in e)t[i]=e[i];return t}(Object.create(this.options),e)).debug;if(i&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var i=[];if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)G(i,t.features[n],e,n);else G(i,"Feature"===t.type?t:{geometry:t},e);return i}(t,e);this.tiles={},this.tileCoords=[],i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),n=function(t,e){var i=e.buffer/e.extent,n=t,r=Z(t,1,-1-i,i,0,-1,2,e),o=Z(t,1,1-i,2+i,0,-1,2,e);return(r||o)&&(n=Z(t,1,-i,1+i,0,-1,2,e)||[],r&&(n=it(r,1).concat(n)),o&&(n=n.concat(it(o,-1)))),n}(n,e),n.length&&this.splitTile(n,0,0,0),i&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function ut(t,e,i){return 32*((1<<t)*i+e)+t}function ht(e,i){const n=e.tileID.canonical;if(!this._geoJSONIndex)return i(null,null);const r=this._geoJSONIndex.getTile(n.z,n.x,n.y);if(!r)return i(null,null);const o=new class{constructor(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.EXTENT,this.length=e.length,this._features=e}feature(e){return new class{constructor(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))}loadGeometry(){if(1===this._feature.type){const e=[];for(const i of this._feature.geometry)e.push([new t.Point(i[0],i[1])]);return e}{const e=[];for(const i of this._feature.geometry){const n=[];for(const e of i)n.push(new t.Point(e[0],e[1]));e.push(n)}return e}}toGeoJSON(t,e,i){return l.call(this,t,e,i)}}(this._features[e])}}(r.features);let s=S(o);0===s.byteOffset&&s.byteLength===s.buffer.byteLength||(s=new Uint8Array(s)),i(null,{vectorTile:o,rawData:s.buffer})}ct.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},ct.prototype.splitTile=function(t,e,i,n,r,o,s){for(var a=[t,e,i,n],l=this.options,c=l.debug;a.length;){n=a.pop(),i=a.pop(),e=a.pop(),t=a.pop();var u=1<<e,h=ut(e,i,n),p=this.tiles[h];if(!p&&(c>1&&console.time("creation"),p=this.tiles[h]=st(t,e,i,n,l),this.tileCoords.push({z:e,x:i,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,i,n,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var d="z"+e;this.stats[d]=(this.stats[d]||0)+1,this.total++}if(p.source=t,r){if(e===l.maxZoom||e===r)continue;var f=1<<r-e;if(i!==Math.floor(o/f)||n!==Math.floor(s/f))continue}else if(e===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue;if(p.source=null,0!==t.length){c>1&&console.time("clipping");var m,g,y,v,_,x,b=.5*l.buffer/l.extent,w=.5-b,A=.5+b,E=1+b;m=g=y=v=null,_=Z(t,u,i-b,i+A,0,p.minX,p.maxX,l),x=Z(t,u,i+w,i+E,0,p.minX,p.maxX,l),t=null,_&&(m=Z(_,u,n-b,n+A,1,p.minY,p.maxY,l),g=Z(_,u,n+w,n+E,1,p.minY,p.maxY,l),_=null),x&&(y=Z(x,u,n-b,n+A,1,p.minY,p.maxY,l),v=Z(x,u,n+w,n+E,1,p.minY,p.maxY,l),x=null),c>1&&console.timeEnd("clipping"),a.push(m||[],e+1,2*i,2*n),a.push(g||[],e+1,2*i,2*n+1),a.push(y||[],e+1,2*i+1,2*n),a.push(v||[],e+1,2*i+1,2*n+1)}}},ct.prototype.getTile=function(t,e,i){var n=this.options,r=n.extent,o=n.debug;if(t<0||t>24)return null;var s=1<<t,a=ut(t,e=(e%s+s)%s,i);if(this.tiles[a])return rt(this.tiles[a],r);o>1&&console.log("drilling down to z%d-%d-%d",t,e,i);for(var l,c=t,u=e,h=i;!l&&c>0;)c--,u=Math.floor(u/2),h=Math.floor(h/2),l=this.tiles[ut(c,u,h)];return l&&l.source?(o>1&&console.log("found parent tile z%d-%d-%d",c,u,h),o>1&&console.time("drilling down"),this.splitTile(l.source,c,u,h,t,e,i),o>1&&console.timeEnd("drilling down"),this.tiles[a]?rt(this.tiles[a],r):null):null};class pt extends t.VectorTileWorkerSource{constructor(t,e,i,n,r){super(t,e,i,n,ht),r&&(this.loadGeoJSON=r)}loadData(e,i){const n=e&&e.request,r=n&&n.collectResourceTiming;this.loadGeoJSON(e,((o,s)=>{if(o||!s)return i(o);if("object"!=typeof s)return i(new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`));{a(s,!0);try{if(e.filter){const i=t.createExpression(e.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===i.result)throw new Error(i.value.map((t=>`${t.key}: ${t.message}`)).join(", "));const n=s.features.filter((t=>i.value.evaluate({zoom:0},t)));s={type:"FeatureCollection",features:n}}this._geoJSONIndex=e.cluster?new D(function({superclusterOptions:e,clusterProperties:i}){if(!i||!e)return e;const n={},r={},o={accumulated:null,zoom:0},s={properties:null},a=Object.keys(i);for(const e of a){const[o,s]=i[e],a=t.createExpression(s),l=t.createExpression("string"==typeof o?[o,["accumulated"],["get",e]]:o);n[e]=a.value,r[e]=l.value}return e.map=t=>{s.properties=t;const e={};for(const t of a)e[t]=n[t].evaluate(o,s);return e},e.reduce=(t,e)=>{s.properties=e;for(const e of a)o.accumulated=t[e],t[e]=r[e].evaluate(o,s)},e}(e)).load(s.features):function(t,e){return new ct(t,e)}(s,e.geojsonVtOptions)}catch(o){return i(o)}this.loaded={};const l={};if(r){const i=t.getPerformanceMeasurement(n);i&&(l.resourceTiming={},l.resourceTiming[e.source]=JSON.parse(JSON.stringify(i)))}i(null,l)}}))}reloadTile(t,e){const i=this.loaded;return i&&i[t.uid]?super.reloadTile(t,e):this.loadTile(t,e)}loadGeoJSON(e,i){if(e.request)t.getJSON(e.request,i);else{if("string"!=typeof e.data)return i(new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`));try{return i(null,JSON.parse(e.data))}catch(t){return i(new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(t,e){try{e(null,this._geoJSONIndex.getClusterExpansionZoom(t.clusterId))}catch(t){e(t)}}getClusterChildren(t,e){try{e(null,this._geoJSONIndex.getChildren(t.clusterId))}catch(t){e(t)}}getClusterLeaves(t,e){try{e(null,this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset))}catch(t){e(t)}}}class dt{constructor(e){this.self=e,this.actor=new t.Actor(e,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.projections={},this.defaultProjection=t.getProjection({name:"mercator"}),this.workerSourceTypes={vector:t.VectorTileWorkerSource,geojson:pt},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(t,e)=>{if(this.workerSourceTypes[t])throw new Error(`Worker source with name "${t}" already registered.`);this.workerSourceTypes[t]=e},this.self.registerRTLTextPlugin=e=>{if(t.plugin.isParsed())throw new Error("RTL text plugin already registered.");t.plugin.applyArabicShaping=e.applyArabicShaping,t.plugin.processBidirectionalText=e.processBidirectionalText,t.plugin.processStyledBidirectionalText=e.processStyledBidirectionalText}}clearCaches(t,e,i){delete this.layerIndexes[t],delete this.availableImages[t],delete this.workerSources[t],delete this.demWorkerSources[t],i()}checkIfReady(t,e,i){i()}setReferrer(t,e){this.referrer=e}spriteLoaded(e,i){this.isSpriteLoaded[e]=i;for(const n in this.workerSources[e]){const r=this.workerSources[e][n];for(const e in r)r[e]instanceof t.VectorTileWorkerSource&&(r[e].isSpriteLoaded=i,r[e].fire(new t.Event("isSpriteLoaded")))}}setImages(t,e,i){this.availableImages[t]=e;for(const i in this.workerSources[t]){const n=this.workerSources[t][i];for(const t in n)n[t].availableImages=e}i()}enableTerrain(t,e,i){this.terrain=e,i()}setProjection(e,i){this.projections[e]=t.getProjection(i)}setLayers(t,e,i){this.getLayerIndex(t).replace(e),i()}updateLayers(t,e,i){this.getLayerIndex(t).update(e.layers,e.removedIds),i()}loadTile(e,i,n){const r=this.enableTerrain?t.extend({enableTerrain:this.terrain},i):i;r.projection=this.projections[e]||this.defaultProjection,this.getWorkerSource(e,i.type,i.source).loadTile(r,n)}loadDEMTile(e,i,n){const r=this.enableTerrain?t.extend({buildQuadTree:this.terrain},i):i;this.getDEMWorkerSource(e,i.source).loadTile(r,n)}reloadTile(e,i,n){const r=this.enableTerrain?t.extend({enableTerrain:this.terrain},i):i;r.projection=this.projections[e]||this.defaultProjection,this.getWorkerSource(e,i.type,i.source).reloadTile(r,n)}abortTile(t,e,i){this.getWorkerSource(t,e.type,e.source).abortTile(e,i)}removeTile(t,e,i){this.getWorkerSource(t,e.type,e.source).removeTile(e,i)}removeSource(t,e,i){if(!this.workerSources[t]||!this.workerSources[t][e.type]||!this.workerSources[t][e.type][e.source])return;const n=this.workerSources[t][e.type][e.source];delete this.workerSources[t][e.type][e.source],void 0!==n.removeSource?n.removeSource(e,i):i()}loadWorkerSource(t,e,i){try{this.self.importScripts(e.url),i()}catch(t){i(t.toString())}}syncRTLPluginState(e,i,n){try{t.plugin.setState(i);const e=t.plugin.getPluginURL();if(t.plugin.isLoaded()&&!t.plugin.isParsed()&&null!=e){this.self.importScripts(e);const i=t.plugin.isParsed();n(i?void 0:new Error(`RTL Text Plugin failed to import scripts from ${e}`),i)}}catch(t){n(t.toString())}}getAvailableImages(t){let e=this.availableImages[t];return e||(e=[]),e}getLayerIndex(t){let e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new n),e}getWorkerSource(t,e,i){if(this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),!this.workerSources[t][e][i]){const n={send:(e,i,n,r,o,s)=>{this.actor.send(e,i,n,t,o,s)},scheduler:this.actor.scheduler};this.workerSources[t][e][i]=new this.workerSourceTypes[e](n,this.getLayerIndex(t),this.getAvailableImages(t),this.isSpriteLoaded[t])}return this.workerSources[t][e][i]}getDEMWorkerSource(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new r),this.demWorkerSources[t][e]}enforceCacheSizeLimit(e,i){t.enforceCacheSizeLimit(i)}getWorkerPerformanceMetrics(t,e,i){i(void 0,void 0)}}return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new dt(self)),dt})),n(["./shared"],(function(t){function e(t,i){if(Array.isArray(t)){if(!Array.isArray(i)||t.length!==i.length)return!1;for(let n=0;n<t.length;n++)if(!e(t[n],i[n]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==i){if("object"!=typeof i)return!1;if(Object.keys(t).length!==Object.keys(i).length)return!1;for(const n in t)if(!e(t[n],i[n]))return!1;return!0}return t===i}var i=n;function n(t){return!function(t){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 t,e,i=new Blob([""],{type:"text/javascript"}),n=URL.createObjectURL(i);try{e=new Worker(n),t=!0}catch(e){t=!1}return e&&e.terminate(),URL.revokeObjectURL(n),t}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var t=document.createElement("canvas");t.width=t.height=1;var e=t.getContext("2d");if(!e)return!1;var i=e.getImageData(0,0,1,1);return i&&i.width===t.width}()?(void 0===r[e=t&&t.failIfMajorPerformanceCaveat]&&(r[e]=function(t){var e,i=function(t){var e=document.createElement("canvas"),i=Object.create(n.webGLContextAttributes);return i.failIfMajorPerformanceCaveat=t,e.getContext("webgl",i)||e.getContext("experimental-webgl",i)}(t);if(!i)return!1;try{e=i.createShader(i.VERTEX_SHADER)}catch(t){return!1}return!(!e||i.isContextLost())&&(i.shaderSource(e,"void main() {}"),i.compileShader(e),!0===i.getShaderParameter(e,i.COMPILE_STATUS))}(e)),r[e]?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 e}(t)}var r={};function o(e,i,n){const r=t.window.document.createElement(e);return void 0!==i&&(r.className=i),n&&n.appendChild(r),r}function s(e,i,n){const r=t.window.document.createElementNS("http://www.w3.org/2000/svg",e);for(const t of Object.keys(i))r.setAttributeNS(null,t,i[t]);return n&&n.appendChild(r),r}n.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};const a=t.window.document&&t.window.document.documentElement.style,l=a&&void 0!==a.userSelect?"userSelect":"WebkitUserSelect";let c;function u(){a&&l&&(c=a[l],a[l]="none")}function h(){a&&l&&(a[l]=c)}function p(e){e.preventDefault(),e.stopPropagation(),t.window.removeEventListener("click",p,!0)}function d(){t.window.addEventListener("click",p,!0),t.window.setTimeout((()=>{t.window.removeEventListener("click",p,!0)}),0)}function f(t,e){const i=t.getBoundingClientRect();return y(t,i,e)}function m(t,e){const i=t.getBoundingClientRect(),n=[];for(let r=0;r<e.length;r++)n.push(y(t,i,e[r]));return n}function g(e){return void 0!==t.window.InstallTrigger&&2===e.button&&e.ctrlKey&&t.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:e.button}function y(e,i,n){const r=e.offsetWidth===i.width?1:e.offsetWidth/i.width;return new t.Point((n.clientX-i.left)*r,(n.clientY-i.top)*r)}function v(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=i*o-r*n;return s?(t[0]=o*(s=1/s),t[1]=-n*s,t[2]=-r*s,t[3]=i*s,t):null}function _(t){const{userImage:e}=t;return!!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}class x extends t.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(const{ids:t,callback:e}of this.requestors)this._notify(t,e);this.requestors=[]}}hasImage(t){return!!this.getImage(t)}getImage(t){return this.images[t]}addImage(t,e){this._validate(t,e)&&(this.images[t]=e)}_validate(e,i){let n=!0;return this._validateStretch(i.stretchX,i.data&&i.data.width)||(this.fire(new t.ErrorEvent(new Error(`Image "${e}" has invalid "stretchX" value`))),n=!1),this._validateStretch(i.stretchY,i.data&&i.data.height)||(this.fire(new t.ErrorEvent(new Error(`Image "${e}" has invalid "stretchY" value`))),n=!1),this._validateContent(i.content,i)||(this.fire(new t.ErrorEvent(new Error(`Image "${e}" has invalid "content" value`))),n=!1),n}_validateStretch(t,e){if(!t)return!0;let i=0;for(const n of t){if(n[0]<i||n[1]<n[0]||e<n[1])return!1;i=n[1]}return!0}_validateContent(t,e){return!(t&&(4!==t.length||t[0]<0||e.data.width<t[0]||t[1]<0||e.data.height<t[1]||t[2]<0||e.data.width<t[2]||t[3]<0||e.data.height<t[3]||t[2]<t[0]||t[3]<t[1]))}updateImage(t,e){e.version=this.images[t].version+1,this.images[t]=e,this.updatedImages[t]=!0}removeImage(t){const e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(t,e){let i=!0;if(!this.isLoaded())for(const e of t)this.images[e]||(i=!1);this.isLoaded()||i?this._notify(t,e):this.requestors.push({ids:t,callback:e})}_notify(e,i){const n={};for(const i of e){this.images[i]||this.fire(new t.Event("styleimagemissing",{id:i}));const e=this.images[i];e?n[i]={data:e.data.clone(),pixelRatio:e.pixelRatio,sdf:e.sdf,version:e.version,stretchX:e.stretchX,stretchY:e.stretchY,content:e.content,hasRenderCallback:Boolean(e.userImage&&e.userImage.render)}:t.warnOnce(`Image "${i}" 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.`)}i(null,n)}getPixelSize(){const{width:t,height:e}=this.atlasImage;return{width:t,height:e}}getPattern(e){const i=this.patterns[e],n=this.getImage(e);if(!n)return null;if(i&&i.position.version===n.version)return i.position;if(i)i.position.version=n.version;else{const i={w:n.data.width+2,h:n.data.height+2,x:0,y:0},r=new t.ImagePosition(i,n);this.patterns[e]={bin:i,position:r}}return this._updatePatternAtlas(),this.patterns[e].position}bind(e){const i=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new t.Texture(e,this.atlasImage,i.RGBA),this.atlasTexture&&this.atlasTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)}_updatePatternAtlas(){const e=[];for(const t in this.patterns)e.push(this.patterns[t].bin);const{w:i,h:n}=t.potpack(e),r=this.atlasImage;r.resize({width:i||1,height:n||1});for(const e in this.patterns){const{bin:i}=this.patterns[e],n=i.x+1,o=i.y+1,s=this.images[e].data,a=s.width,l=s.height;t.RGBAImage.copy(s,r,{x:0,y:0},{x:n,y:o},{width:a,height:l}),t.RGBAImage.copy(s,r,{x:0,y:l-1},{x:n,y:o-1},{width:a,height:1}),t.RGBAImage.copy(s,r,{x:0,y:0},{x:n,y:o+l},{width:a,height:1}),t.RGBAImage.copy(s,r,{x:a-1,y:0},{x:n-1,y:o},{width:1,height:l}),t.RGBAImage.copy(s,r,{x:0,y:0},{x:n+a,y:o},{width:1,height:l})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(const e of t){if(this.callbackDispatchedThisFrame[e])continue;this.callbackDispatchedThisFrame[e]=!0;const t=this.images[e];_(t)&&this.updateImage(e,t)}}}const b=new t.Properties({anchor:new t.DataConstantProperty(t.spec.light.anchor),position:new class{constructor(){this.specification=t.spec.light.position}possiblyEvaluate(e,i){return function([e,i,n]){const r=t.degToRad(i+90),o=t.degToRad(n);return{x:e*Math.cos(r)*Math.sin(o),y:e*Math.sin(r)*Math.sin(o),z:e*Math.cos(o),azimuthal:i,polar:n}}(e.expression.evaluate(i))}interpolate(e,i,n){return{x:t.number(e.x,i.x,n),y:t.number(e.y,i.y,n),z:t.number(e.z,i.z,n),azimuthal:t.number(e.azimuthal,i.azimuthal,n),polar:t.number(e.polar,i.polar,n)}}},color:new t.DataConstantProperty(t.spec.light.color),intensity:new t.DataConstantProperty(t.spec.light.intensity)});class w extends t.Evented{constructor(e){super(),this._transitionable=new t.Transitionable(b),this.setLight(e),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(e,i={}){if(!this._validate(t.validateLight,e,i))for(const i in e){const n=e[i];t.endsWith(i,"-transition")?this._transitionable.setTransition(i.slice(0,-11),n):this._transitionable.setValue(i,n)}}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(e,i,n){return(!n||!1!==n.validate)&&t.emitValidationErrors(this,e.call(t.validateStyle,t.extend({value:i,style:{glyphs:!0,sprite:!0},styleSpec:t.spec})))}}const A=new t.Properties({source:new t.DataConstantProperty(t.spec.terrain.source),exaggeration:new t.DataConstantProperty(t.spec.terrain.exaggeration)});let E=class extends t.Evented{constructor(e,i){super(),this._transitionable=new t.Transitionable(A),this.set(e),this._transitioning=this._transitionable.untransitioned(),this.drapeRenderMode=i}get(){return this._transitionable.serialize()}set(e){for(const i in e){const n=e[i];t.endsWith(i,"-transition")?this._transitionable.setTransition(i.slice(0,-11),n):this._transitionable.setValue(i,n)}}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}};function S(e,i,n,r){const o=t.smoothstep(45,65,n),[s,a]=M(e,r),l=t.length(i);let c=1-Math.min(1,Math.exp((l-s)/(a-s)*-6));return c*=c*c,c=Math.min(1,1.00747*c),c*o*e.alpha}function M(t,e){const i=.5/Math.tan(.5*e);return[t.range[0]+i,t.range[1]+i]}const T=new t.Properties({range:new t.DataConstantProperty(t.spec.fog.range),color:new t.DataConstantProperty(t.spec.fog.color),"high-color":new t.DataConstantProperty(t.spec.fog["high-color"]),"space-color":new t.DataConstantProperty(t.spec.fog["space-color"]),"horizon-blend":new t.DataConstantProperty(t.spec.fog["horizon-blend"]),"star-intensity":new t.DataConstantProperty(t.spec.fog["star-intensity"])});class I extends t.Evented{constructor(e,i){super(),this._transitionable=new t.Transitionable(T),this.set(e),this._transitioning=this._transitionable.untransitioned(),this._transform=i}get state(){const e=this._transform,i="globe"===e.projection.name,n=t.globeToMercatorTransition(e.zoom),r=this.properties.get("range"),o=[.5,3];return{range:i?[t.number(o[0],r[0],n),t.number(o[1],r[1],n)]:r,horizonBlend:this.properties.get("horizon-blend"),alpha:this.properties.get("color").a}}get(){return this._transitionable.serialize()}set(e,i={}){if(!this._validate(t.validateFog,e,i)){for(const i of Object.keys(t.spec.fog))e&&void 0===e[i]&&(e[i]=t.spec.fog[i].default);for(const i in e){const n=e[i];t.endsWith(i,"-transition")?this._transitionable.setTransition(i.slice(0,-11),n):this._transitionable.setValue(i,n)}}}getOpacity(e){if(!this._transform.projection.supportsFog)return 0;const i=this.properties&&this.properties.get("color")||1;return("globe"===this._transform.projection.name?1:t.smoothstep(45,65,e))*i.a}getOpacityAtLatLng(e,i){return this._transform.projection.supportsFog?function(e,i,n){const r=t.MercatorCoordinate.fromLngLat(i),o=n.elevation?n.elevation.getAtPointOrZero(r):0,s=[r.x,r.y,o];return t.transformMat4(s,s,n.mercatorFogMatrix),S(e,s,n.pitch,n._fov)}(this.state,e,i):0}getFovAdjustedRange(t){return this._transform.projection.supportsFog?M(this.state,t):[0,1]}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(e,i,n){return(!n||!1!==n.validate)&&t.emitValidationErrors(this,e.call(t.validateStyle,t.extend({value:i,style:{glyphs:!0,sprite:!0},styleSpec:t.spec})))}}class C{constructor(e,i){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=t.uniqueId();const n=this.workerPool.acquire(this.id);for(let t=0;t<n.length;t++){const e=new C.Actor(n[t],i,this.id);e.name=`Worker ${t}`,this.actors.push(e)}this.ready=!1,this.broadcast("checkIfReady",null,(()=>{this.ready=!0}))}broadcast(e,i,n){t.asyncAll(this.actors,((t,n)=>{t.send(e,i,n)}),n=n||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach((t=>{t.remove()})),this.actors=[],this.workerPool.release(this.id)}}function P(e,i,n){return i*(t.EXTENT/(e.tileSize*Math.pow(2,n-e.tileID.overscaledZ)))}C.Actor=t.Actor;class L{constructor(t,e,i,n){this.screenBounds=t,this.cameraPoint=e,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=i,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,n)}static createFromScreenPoints(e,i){let n,r;if(e instanceof t.Point||"number"==typeof e[0]){const o=t.Point.convert(e);n=[o],r=i.isPointAboveHorizon(o)}else{const o=t.Point.convert(e[0]),s=t.Point.convert(e[1]);n=[o,s],r=t.polygonizeBounds(o,s).every((t=>i.isPointAboveHorizon(t)))}return new L(n,i.getCameraPoint(),r,i)}isPointQuery(){return 1===this.screenBounds.length}bufferedScreenGeometry(e){return t.polygonizeBounds(this.screenBounds[0],1===this.screenBounds.length?this.screenBounds[0]:this.screenBounds[1],e)}bufferedCameraGeometry(e){const i=this.screenBounds[0],n=1===this.screenBounds.length?this.screenBounds[0].add(new t.Point(1,1)):this.screenBounds[1],r=t.polygonizeBounds(i,n,0,!1);return this.cameraPoint.y>n.y&&(this.cameraPoint.x>i.x&&this.cameraPoint.x<n.x?r.splice(3,0,this.cameraPoint):this.cameraPoint.x>=n.x?r[2]=this.cameraPoint:this.cameraPoint.x<=i.x&&(r[3]=this.cameraPoint)),t.bufferConvexPolygon(r,e)}bufferedCameraGeometryGlobe(e){const i=this.screenBounds[0],n=1===this.screenBounds.length?this.screenBounds[0].add(new t.Point(1,1)):this.screenBounds[1],r=t.polygonizeBounds(i,n,e),o=this.cameraPoint.clone();switch(3*((o.y>i.y)+(o.y>n.y))+((o.x>i.x)+(o.x>n.x))){case 0:r[0]=o,r[4]=o.clone();break;case 1:r.splice(1,0,o);break;case 2:r[1]=o;break;case 3:r.splice(4,0,o);break;case 5:r.splice(2,0,o);break;case 6:r[3]=o;break;case 7:r.splice(3,0,o);break;case 8:r[2]=o}return r}containsTile(e,i,n,r=0){const o=e.queryPadding/i._pixelsPerMercatorPixel+1,s=n?this._bufferedCameraMercator(o,i):this._bufferedScreenMercator(o,i);let a=e.tileID.wrap+(s.unwrapped?r:0);const l=s.polygon.map((i=>t.getTilePoint(e.tileTransform,i,a)));if(!t.polygonIntersectsBox(l,0,0,t.EXTENT,t.EXTENT))return;a=e.tileID.wrap+(this.screenGeometryMercator.unwrapped?r:0);const c=this.screenGeometryMercator.polygon.map((i=>t.getTileVec3(e.tileTransform,i,a))),u=c.map((e=>new t.Point(e[0],e[1]))),h=i.getFreeCameraOptions().position||new t.MercatorCoordinate(0,0,0),p=t.getTileVec3(e.tileTransform,h,a),d=c.map((e=>{const i=t.sub(e,e,p);return t.normalize(i,i),new t.Ray(p,i)})),f=P(e,1,i.zoom)*i._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:u,tilespaceRays:d,bufferedTilespaceGeometry:l,bufferedTilespaceBounds:(m=t.getBounds(l),m.min.x=t.clamp(m.min.x,0,t.EXTENT),m.min.y=t.clamp(m.min.y,0,t.EXTENT),m.max.x=t.clamp(m.max.x,0,t.EXTENT),m.max.y=t.clamp(m.max.y,0,t.EXTENT),m),tile:e,tileID:e.tileID,pixelToTileUnitsFactor:f};var m}_bufferedScreenMercator(t,e){const i=O(t);if(this._screenRaycastCache[i])return this._screenRaycastCache[i];{let n;return n="globe"===e.projection.name?this._projectAndResample(this.bufferedScreenGeometry(t),e):{polygon:this.bufferedScreenGeometry(t).map((t=>e.pointCoordinate3D(t))),unwrapped:!0},this._screenRaycastCache[i]=n,n}}_bufferedCameraMercator(t,e){const i=O(t);if(this._cameraRaycastCache[i])return this._cameraRaycastCache[i];{let n;return n="globe"===e.projection.name?this._projectAndResample(this.bufferedCameraGeometryGlobe(t),e):{polygon:this.bufferedCameraGeometry(t).map((t=>e.pointCoordinate3D(t))),unwrapped:!0},this._cameraRaycastCache[i]=n,n}}_projectAndResample(e,i){const n=function(e,i){const n=t.multiply([],i.pixelMatrix,i.globeMatrix),r=[0,-t.GLOBE_RADIUS,0,1],o=[0,t.GLOBE_RADIUS,0,1],s=[0,0,0,1];t.transformMat4$1(r,r,n),t.transformMat4$1(o,o,n),t.transformMat4$1(s,s,n);const a=new t.Point(r[0]/r[3],r[1]/r[3]),l=new t.Point(o[0]/o[3],o[1]/o[3]),c=t.polygonContainsPoint(e,a)&&r[3]<s[3],u=t.polygonContainsPoint(e,l)&&o[3]<s[3];if(!c&&!u)return null;const h=function(t,e,i){for(let n=1;n<t.length;n++){const r=R(e.pointCoordinate3D(t[n-1]).x),o=R(e.pointCoordinate3D(t[n]).x);if(i<0){if(r<o)return{idx:n,t:-r/(o-1-r)}}else if(o<r)return{idx:n,t:(1-r)/(o+1-r)}}return null}(e,i,c?-1:1);if(!h)return null;const{idx:p,t:d}=h;let f=p>1?D(e.slice(0,p),i):[],m=p<e.length?D(e.slice(p),i):[];f=f.map((e=>new t.Point(R(e.x),e.y))),m=m.map((e=>new t.Point(R(e.x),e.y)));const g=[...f];0===g.length&&g.push(m[m.length-1]);const y=t.number(g[g.length-1].y,(0===m.length?f[0]:m[0]).y,d);let v;return v=c?[new t.Point(0,y),new t.Point(0,0),new t.Point(1,0),new t.Point(1,y)]:[new t.Point(1,y),new t.Point(1,1),new t.Point(0,1),new t.Point(0,y)],g.push(...v),0===m.length?g.push(f[0]):g.push(...m),{polygon:g.map((e=>new t.MercatorCoordinate(e.x,e.y))),unwrapped:!1}}(e,i);if(n)return n;const r=function(e,i){let n=!1,r=-1/0,o=0;for(let t=0;t<e.length-1;t++)e[t].x>r&&(r=e[t].x,o=t);for(let t=0;t<e.length-1;t++){const i=(o+t)%(e.length-1),r=e[i],s=e[i+1];Math.abs(r.x-s.x)>.5&&(r.x<s.x?(r.x+=1,0===i&&(e[e.length-1].x+=1)):(s.x+=1,i+1===e.length-1&&(e[0].x+=1)),n=!0)}const s=t.mercatorXfromLng(i.center.lng);return n&&s<Math.abs(s-1)&&e.forEach((t=>{t.x-=1})),{polygon:e,unwrapped:n}}(D(e,i).map((e=>new t.Point(R(e.x),e.y))),i);return{polygon:r.polygon.map((e=>new t.MercatorCoordinate(e.x,e.y))),unwrapped:r.unwrapped}}}function D(e,i){return t.resample(e,(t=>{const e=i.pointCoordinate3D(t);t.x=e.x,t.y=e.y}),1/256)}function R(t){return t<0?1+t%1:t%1}function O(t){return 100*t|0}function k(e,i,n,r,o){const s=function(n,r){if(n)return o(n);if(r){e.url&&r.tiles&&e.tiles&&delete e.tiles;const n=t.pick(t.extend(r,e),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);r.vector_layers&&(n.vectorLayers=r.vector_layers,n.vectorLayerIds=n.vectorLayers.map((t=>t.id))),n.tiles=i.canonicalizeTileset(n,e.url),o(null,n)}};return e.url?t.getJSON(i.transformRequest(i.normalizeSourceURL(e.url,null,n,r),t.ResourceType.Source),s):t.exported.frame((()=>s(null,e)))}class N{constructor(e,i,n){this.bounds=t.LngLatBounds.convert(this.validateBounds(e)),this.minzoom=i||0,this.maxzoom=n||24}validateBounds(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(e){const i=Math.pow(2,e.z),n=Math.floor(t.mercatorXfromLng(this.bounds.getWest())*i),r=Math.floor(t.mercatorYfromLat(this.bounds.getNorth())*i),o=Math.ceil(t.mercatorXfromLng(this.bounds.getEast())*i),s=Math.ceil(t.mercatorYfromLat(this.bounds.getSouth())*i);return e.x>=n&&e.x<o&&e.y>=r&&e.y<s}}class B{constructor(t,e,i){this.context=t;const n=t.gl;this.buffer=n.createBuffer(),this.dynamicDraw=Boolean(i),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||e.destroy()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){const e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const z={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class F{constructor(t,e,i,n){this.length=e.length,this.attributes=i,this.itemSize=e.bytesPerElement,this.dynamicDraw=n,this.context=t;const r=t.gl;this.buffer=r.createBuffer(),t.bindVertexBuffer.set(this.buffer),r.bufferData(r.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||e.destroy()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){const e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,e){for(let i=0;i<this.attributes.length;i++){const n=e.attributes[this.attributes[i].name];void 0!==n&&t.enableVertexAttribArray(n)}}setVertexAttribPointers(t,e,i){for(let n=0;n<this.attributes.length;n++){const r=this.attributes[n],o=e.attributes[r.name];void 0!==o&&t.vertexAttribPointer(o,r.components,t[z[r.type]],!1,this.itemSize,r.offset+this.itemSize*(i||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class V{constructor(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(t){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class U extends V{getDefault(){return t.Color.transparent}set(t){const e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class G extends V{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}}class j extends V{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}}class H extends V{getDefault(){return[!0,!0,!0,!0]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class W extends V{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}}class q extends V{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}}class X extends V{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){const e=this.current;(t.func!==e.func||t.ref!==e.ref||t.mask!==e.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)}}class Z extends V{getDefault(){const t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)}}class Y extends V{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1}}class Q extends V{getDefault(){return[0,1]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)}}class J extends V{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1}}class K extends V{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}}class $ extends V{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1}}class tt extends V{getDefault(){const t=this.gl;return[t.ONE,t.ZERO]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)}}class et extends V{getDefault(){return t.Color.transparent}set(t){const e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class it extends V{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)}}class nt extends V{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}}class rt extends V{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}}class ot extends V{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}}let st,at=class extends V{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)}};class lt extends V{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}}class ct extends V{getDefault(){const t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class ut extends V{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1}}class ht extends V{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class pt extends V{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}}class dt extends V{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class ft extends V{getDefault(){return null}set(t){const e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class mt extends V{constructor(t){super(t),this.vao=t.extVertexArrayObject}getDefault(){return null}set(t){this.vao&&(t!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(t),this.current=t,this.dirty=!1)}}class gt extends V{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}}class yt extends V{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}}class vt extends V{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}}class _t extends V{constructor(t,e){super(t),this.context=t,this.parent=e}getDefault(){return null}}class xt extends _t{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class bt extends _t{attachment(){return this.gl.DEPTH_ATTACHMENT}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,this.attachment(),e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class wt extends bt{attachment(){return this.gl.DEPTH_STENCIL_ATTACHMENT}}class At{constructor(t,e,i,n){this.context=t,this.width=e,this.height=i;const r=this.framebuffer=t.gl.createFramebuffer();this.colorAttachment=new xt(t,r),n&&(this.depthAttachment=new bt(t,r))}destroy(){const t=this.context.gl,e=this.colorAttachment.get();if(e&&t.deleteTexture(e),this.depthAttachment){const e=this.depthAttachment.get();e&&t.deleteRenderbuffer(e)}t.deleteFramebuffer(this.framebuffer)}}class Et{constructor(t,e=!1){if(this.gl=t,this.isWebGL2=e,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),e){const e=t;this.extVertexArrayObject={createVertexArrayOES:e.createVertexArray.bind(t),deleteVertexArrayOES:e.deleteVertexArray.bind(t),bindVertexArrayOES:e.bindVertexArray.bind(t)}}this.clearColor=new U(this),this.clearDepth=new G(this),this.clearStencil=new j(this),this.colorMask=new H(this),this.depthMask=new W(this),this.stencilMask=new q(this),this.stencilFunc=new X(this),this.stencilOp=new Z(this),this.stencilTest=new Y(this),this.depthRange=new Q(this),this.depthTest=new J(this),this.depthFunc=new K(this),this.blend=new $(this),this.blendFunc=new tt(this),this.blendColor=new et(this),this.blendEquation=new it(this),this.cullFace=new nt(this),this.cullFaceSide=new rt(this),this.frontFace=new ot(this),this.program=new at(this),this.activeTexture=new lt(this),this.viewport=new ct(this),this.bindFramebuffer=new ut(this),this.bindRenderbuffer=new ht(this),this.bindTexture=new pt(this),this.bindVertexBuffer=new dt(this),this.bindElementBuffer=new ft(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new mt(this),this.pixelStoreUnpack=new gt(this),this.pixelStoreUnpackPremultiplyAlpha=new yt(this),this.pixelStoreUnpackFlipY=new vt(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureFilterAnisotropicForceOff=!1,this.extStandardDerivativesForceOff=!1,this.extDebugRendererInfo=t.getExtension("WEBGL_debug_renderer_info"),this.extDebugRendererInfo&&(this.renderer=t.getParameter(this.extDebugRendererInfo.UNMASKED_RENDERER_WEBGL),this.vendor=t.getParameter(this.extDebugRendererInfo.UNMASKED_VENDOR_WEBGL)),e||(this.extTextureHalfFloat=t.getExtension("OES_texture_half_float")),(e||this.extTextureHalfFloat&&t.getExtension("OES_texture_half_float_linear"))&&(this.extRenderToTextureHalfFloat=t.getExtension("EXT_color_buffer_half_float")),this.extStandardDerivatives=e||t.getExtension("OES_standard_derivatives"),this.extTimerQuery=t.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=t.getParameter(t.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(t,e){return new B(this,t,e)}createVertexBuffer(t,e,i){return new F(this,t,e,i)}createRenderbuffer(t,e,i){const n=this.gl,r=n.createRenderbuffer();return this.bindRenderbuffer.set(r),n.renderbufferStorage(n.RENDERBUFFER,t,e,i),this.bindRenderbuffer.set(null),r}createFramebuffer(t,e,i){return new At(this,t,e,i)}clear({color:t,depth:e,stencil:i}){const n=this.gl;let r=0;t&&(r|=n.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),void 0!==e&&(r|=n.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(e),this.depthMask.set(!0)),void 0!==i&&(r|=n.STENCIL_BUFFER_BIT,this.clearStencil.set(i),this.stencilMask.set(255)),n.clear(r)}setCullFace(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))}setDepthMode(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)}setStencilMode(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)}setColorMode(i){e(i.blendFunction,t.ColorMode.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(i.blendFunction),this.blendColor.set(i.blendColor)),this.colorMask.set(i.mask)}unbindVAO(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)}}class St extends t.Evented{constructor(e,i,n,r){if(super(),this.id=e,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,t.extend(this,t.pick(i,["url","scheme","tileSize","promoteId"])),this._options=t.extend({type:"vector"},i),this._collectResourceTiming=i.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(r),this._tileWorkers={},this._deduped=new t.DedupedRequest}load(e){this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"}));const i=Array.isArray(this.map._language)?this.map._language.join():this.map._language,n=this.map._worldview;this._tileJSONRequest=k(this._options,this.map._requestManager,i,n,((r,o)=>{this._tileJSONRequest=null,this._loaded=!0,r?(i&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${i}`),n&&2!==n.length&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${n}`),this.fire(new t.ErrorEvent(r))):o&&(t.extend(this,o),o.bounds&&(this.tileBounds=new N(o.bounds,this.minzoom,this.maxzoom)),t.postTurnstileEvent(o.tiles,this.map._requestManager._customAccessToken),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"}))),e&&e(r)}))}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}reload(){this.cancelTileJSONRequest(),this.load((()=>this.map.style._clearSource(this.id)))}setTiles(t){return this._options.tiles=t,this.reload(),this}setUrl(t){return this.url=t,this._options.url=t,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return t.extend({},this._options)}loadTile(e,i){const n=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme)),r={request:this.map._requestManager.transformRequest(n,t.ResourceType.Tile),data:void 0,uid:e.uid,tileID:e.tileID,tileZoom:e.tileZoom,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:t.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:e.isSymbolTile};if(r.request.collectResourceTiming=this._collectResourceTiming,e.actor&&"expired"!==e.state)"loading"===e.state?e.reloadCallback=i:e.request=e.actor.send("reloadTile",r,o.bind(this));else if(e.actor=this._tileWorkers[n]=this._tileWorkers[n]||this.dispatcher.getActor(),this.dispatcher.ready)e.request=e.actor.send("loadTile",r,o.bind(this),void 0,!0);else{const i=t.loadVectorTile.call({deduped:this._deduped},r,((t,i)=>{t||!i?o.call(this,t):(r.data={cacheControl:i.cacheControl,expires:i.expires,rawData:i.rawData.slice(0)},e.actor&&e.actor.send("loadTile",r,o.bind(this),void 0,!0))}),!0);e.request={cancel:i}}function o(n,r){return delete e.request,e.aborted?i(null):n&&404!==n.status?i(n):(r&&r.resourceTiming&&(e.resourceTiming=r.resourceTiming),this.map._refreshExpiredTiles&&r&&e.setExpiryData(r),e.loadVectorData(r,this.map.painter),t.cacheEntryPossiblyAdded(this.dispatcher),i(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id})}unloadTile(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class Mt extends t.Evented{constructor(e,i,n,r){super(),this.id=e,this.dispatcher=n,this.setEventedParent(r),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.extend({type:"raster"},i),t.extend(this,t.pick(i,["url","scheme","tileSize"]))}load(e){this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=k(this._options,this.map._requestManager,null,null,((i,n)=>{this._tileJSONRequest=null,this._loaded=!0,i?this.fire(new t.ErrorEvent(i)):n&&(t.extend(this,n),n.bounds&&(this.tileBounds=new N(n.bounds,this.minzoom,this.maxzoom)),t.postTurnstileEvent(n.tiles),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"}))),e&&e(i)}))}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}reload(){this.cancelTileJSONRequest(),this.load((()=>this.map.style._clearSource(this.id)))}setTiles(t){return this._options.tiles=t,this.reload(),this}setUrl(t){return this.url=t,this._options.url=t,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return t.extend({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(e,i){const n=t.exported.devicePixelRatio>=2,r=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),n,this.tileSize);e.request=t.getImage(this.map._requestManager.transformRequest(r,t.ResourceType.Tile),((n,r,o,s)=>(delete e.request,e.aborted?(e.state="unloaded",i(null)):n?(e.state="errored",i(n)):r?(this.map._refreshExpiredTiles&&e.setExpiryData({cacheControl:o,expires:s}),e.setTexture(r,this.map.painter),e.state="loaded",t.cacheEntryPossiblyAdded(this.dispatcher),void i(null)):i(null))))}static loadTileData(t,e,i){t.setTexture(e,i)}static unloadTileData(t,e){t.texture&&e.saveTileTexture(t.texture)}abortTile(t,e){t.request&&(t.request.cancel(),delete t.request),e()}unloadTile(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}function Tt(e,i,n,r,o,s,a,l){const c=[e,n,o,i,r,s,1,1,1],u=[a,l,1],h=t.adjoint([],c),[p,d,f]=t.transformMat3(u,u,t.transpose(h,h));return t.multiply$1(c,[p,0,0,0,d,0,0,0,f],c)}class It extends t.Evented{constructor(t,e,i,n){super(),this.id=t,this.dispatcher=i,this.coordinates=e.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(n),this.options=e,this._dirty=!1}load(e,i){this._loaded=i||!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,this._imageRequest=t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),((i,n)=>{if(this._imageRequest=null,this._loaded=!0,i)this.fire(new t.ErrorEvent(i));else if(n){const{HTMLImageElement:i}=t.window;this.image=n instanceof i?t.exported.getImageData(n):n,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,e&&(this.coordinates=e),this._finishLoading()}}))}loaded(){return this._loaded}updateImage(t){return this.image&&t.url?(this._imageRequest&&t.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=t.url,this.load(t.coordinates,this._loaded),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),this.texture&&this.texture.destroy()}setCoordinates(e){this.coordinates=e,this._boundsArray=void 0;const i=e.map(t.MercatorCoordinate.fromLngLat);return this.tileID=function(e){let i=1/0,n=1/0,r=-1/0,o=-1/0;for(const t of e)i=Math.min(i,t.x),n=Math.min(n,t.y),r=Math.max(r,t.x),o=Math.max(o,t.y);const s=Math.max(r-i,o-n),a=Math.max(0,Math.floor(-Math.log(s)/Math.LN2)),l=Math.pow(2,a);return new t.CanonicalTileID(a,Math.floor((i+r)/2*l),Math.floor((n+o)/2*l))}(i),this.minzoom=this.maxzoom=this.tileID.z,this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0}_prepareData(e){for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture)}if(this._boundsArray)return;const i=t.tileTransform(this.tileID,this.map.transform.projection),[n,r,o,s]=this.coordinates.map((e=>{const n=i.projection.project(e[0],e[1]);return t.getTilePoint(i,n)._round()}));this.perspectiveTransform=function(e,i,n,r,o,s,a,l,c,u){const h=Tt(0,0,e,0,0,i,e,i),p=Tt(n,r,o,s,a,l,c,u);return t.multiply$1(p,t.adjoint(h,h),p),[p[6]/p[8]*e/t.EXTENT,p[7]/p[8]*i/t.EXTENT]}(this.width,this.height,n.x,n.y,r.x,r.y,s.x,s.y,o.x,o.y);const a=this._boundsArray=new t.StructArrayLayout4i8;a.emplaceBack(n.x,n.y,0,0),a.emplaceBack(r.x,r.y,t.EXTENT,0),a.emplaceBack(s.x,s.y,0,t.EXTENT),a.emplaceBack(o.x,o.y,t.EXTENT,t.EXTENT),this.boundsBuffer&&this.boundsBuffer.destroy(),this.boundsBuffer=e.createVertexBuffer(a,t.boundsAttributes.members),this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;const e=this.map.painter.context,i=e.gl;this._dirty&&(this.texture?this.texture.update(this.image):(this.texture=new t.Texture(e,this.image,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE)),this._dirty=!1),this._prepareData(e)}loadTile(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},e(null)):(t.state="errored",e(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}const Ct={vector:St,raster:Mt,"raster-dem":class extends Mt{constructor(e,i,n,r){super(e,i,n,r),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({type:"raster-dem"},i),this.encoding=i.encoding||"mapbox"}loadTile(e,i){const n=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function r(t,n){t&&(e.state="errored",i(t)),n&&(e.dem=n,e.dem.onDeserialize(),e.needsHillshadePrepare=!0,e.needsDEMTextureUpload=!0,e.state="loaded",i(null))}e.request=t.getImage(this.map._requestManager.transformRequest(n,t.ResourceType.Tile),function(n,o,s,a){if(delete e.request,e.aborted)e.state="unloaded",i(null);else if(n)e.state="errored",i(n);else if(o){this.map._refreshExpiredTiles&&e.setExpiryData({cacheControl:s,expires:a});const i=t.window.ImageBitmap&&o instanceof t.window.ImageBitmap&&(null==st&&(st=t.window.OffscreenCanvas&&new t.window.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof t.window.createImageBitmap),st),n=1-(o.width-t.prevPowerOfTwo(o.width))/2;n<1||e.neighboringTiles||(e.neighboringTiles=this._getNeighboringTiles(e.tileID));const l=i?o:t.exported.getImageData(o,n),c={uid:e.uid,coord:e.tileID,source:this.id,rawImageData:l,encoding:this.encoding,padding:n};e.actor&&"expired"!==e.state||(e.actor=this.dispatcher.getActor(),e.actor.send("loadDEMTile",c,r.bind(this),void 0,!0))}}.bind(this))}_getNeighboringTiles(e){const i=e.canonical,n=Math.pow(2,i.z),r=(i.x-1+n)%n,o=0===i.x?e.wrap-1:e.wrap,s=(i.x+1+n)%n,a=i.x+1===n?e.wrap+1:e.wrap,l={};return l[new t.OverscaledTileID(e.overscaledZ,o,i.z,r,i.y).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,a,i.z,s,i.y).key]={backfilled:!1},i.y>0&&(l[new t.OverscaledTileID(e.overscaledZ,o,i.z,r,i.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,i.z,i.x,i.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,a,i.z,s,i.y-1).key]={backfilled:!1}),i.y+1<n&&(l[new t.OverscaledTileID(e.overscaledZ,o,i.z,r,i.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,i.z,i.x,i.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,a,i.z,s,i.y+1).key]={backfilled:!1}),l}unloadTile(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded"}},geojson:class extends t.Evented{constructor(e,i,n,r){super(),this.id=e,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(r),this._data=i.data,this._options=t.extend({},i),this._collectResourceTiming=i.collectResourceTiming,void 0!==i.maxzoom&&(this.maxzoom=i.maxzoom),i.type&&(this.type=i.type),i.attribution&&(this.attribution=i.attribution),this.promoteId=i.promoteId;const o=t.EXTENT/this.tileSize;this.workerOptions=t.extend({source:this.id,cluster:i.cluster||!1,geojsonVtOptions:{buffer:(void 0!==i.buffer?i.buffer:128)*o,tolerance:(void 0!==i.tolerance?i.tolerance:.375)*o,extent:t.EXTENT,maxZoom:this.maxzoom,lineMetrics:i.lineMetrics||!1,generateId:i.generateId||!1},superclusterOptions:{maxZoom:void 0!==i.clusterMaxZoom?i.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,i.clusterMinPoints||2),extent:t.EXTENT,radius:(void 0!==i.clusterRadius?i.clusterRadius:50)*o,log:!1,generateId:i.generateId||!1},clusterProperties:i.clusterProperties,filter:i.filter},i.workerOptions)}onAdd(t){this.map=t,this.setData(this._data)}setData(t){return this._data=t,this._updateWorkerData(),this}getClusterExpansionZoom(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this}getClusterChildren(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this}getClusterLeaves(t,e,i,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:i},n),this}_updateWorkerData(){if(this._pendingLoad)return void(this._coalesce=!0);this.fire(new t.Event("dataloading",{dataType:"source"})),this._loaded=!1;const e=t.extend({},this.workerOptions),i=this._data;"string"==typeof i?(e.request=this.map._requestManager.transformRequest(t.exported.resolveURL(i),t.ResourceType.Source),e.request.collectResourceTiming=this._collectResourceTiming):e.data=JSON.stringify(i),this._pendingLoad=this.actor.send(`${this.type}.loadData`,e,((e,i)=>{if(this._loaded=!0,this._pendingLoad=null,e)this.fire(new t.ErrorEvent(e));else{const e={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&i&&i.resourceTiming&&i.resourceTiming[this.id]&&(e.resourceTiming=i.resourceTiming[this.id]),this.fire(new t.Event("data",e)),this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(),this._coalesce=!1)}))}loaded(){return this._loaded}loadTile(e,i){const n=e.actor?"reloadTile":"loadTile";e.actor=this.actor,e.request=this.actor.send(n,{type:this.type,uid:e.uid,tileID:e.tileID,tileZoom:e.tileZoom,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},((t,r)=>(delete e.request,e.unloadVectorData(),e.aborted?i(null):t?i(t):(e.loadVectorData(r,this.map.painter,"reloadTile"===n),i(null)))),void 0,"loadTile"===n)}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0}unloadTile(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})}onRemove(){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return t.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends It{constructor(t,e,i,n){super(t,e,i,n),this.roundZoom=!0,this.type="video",this.options=e}load(){this._loaded=!1;const e=this.options;this.urls=[];for(const i of e.urls)this.urls.push(this.map._requestManager.transformRequest(i,t.ResourceType.Source).url);t.getVideo(this.urls,((e,i)=>{this._loaded=!0,e?this.fire(new t.ErrorEvent(e)):i&&(this.video=i,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(e){if(this.video){const i=this.video.seekable;e<i.start(0)||e>i.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${i.start(0)} and ${i.end(0)}-second mark.`))):this.video.currentTime=e}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,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 e=this.map.painter.context,i=e.gl;this.texture?this.video.paused||(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(e)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:It,canvas:class extends It{constructor(e,i,n,r){super(e,i,n,r),i.coordinates?Array.isArray(i.coordinates)&&4===i.coordinates.length&&!i.coordinates.some((t=>!Array.isArray(t)||2!==t.length||t.some((t=>"number"!=typeof t))))||this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${e}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${e}`,null,'missing required property "coordinates"'))),i.animate&&"boolean"!=typeof i.animate&&this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${e}`,null,'optional "animate" property must be a boolean value'))),i.canvas?"string"==typeof i.canvas||i.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${e}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${e}`,null,'missing required property "canvas"'))),this.options=i,this.animate=void 0===i.animate||i.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),this._hasInvalidDimensions())return;if(0===Object.keys(this.tiles).length)return;const i=this.map.painter.context;this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(i,this.canvas,i.gl.RGBA,{premultiply:!0}),this._prepareData(i)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}},custom:class extends t.Evented{constructor(e,i,n,r){super(),this.id=e,this.type="custom",this._dataType="raster",this._dispatcher=n,this._implementation=i,this.setEventedParent(r),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new t.ErrorEvent(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new t.ErrorEvent(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new N(this._implementation.bounds,this.minzoom,this.maxzoom)),i.update=this._update.bind(this),i.clearTiles=this._clearTiles.bind(this),i.coveringTiles=this._coveringTiles.bind(this),t.extend(this,t.pick(i,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]))}serialize(){return t.pick(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(e){this._map=e,this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(e),this.load()}onRemove(t){this._implementation.onRemove&&this._implementation.onRemove(t)}hasTile(t){if(this._implementation.hasTile){const{x:e,y:i,z:n}=t.canonical;return this._implementation.hasTile({x:e,y:i,z:n})}return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(e,i){const{x:n,y:r,z:o}=e.tileID.canonical,s=new t.window.AbortController;e.request=Promise.resolve(this._implementation.loadTile({x:n,y:r,z:o},{signal:s.signal})).then(function(n){return delete e.request,e.aborted?(e.state="unloaded",i(null)):void 0===n?(e.state="errored",i(null)):null===n?(this.loadTileData(e,{width:this.tileSize,height:this.tileSize,data:null}),e.state="loaded",i(null)):function(e){return e instanceof t.window.ImageData||e instanceof t.window.HTMLCanvasElement||e instanceof t.window.ImageBitmap||e instanceof t.window.HTMLImageElement}(n)?(this.loadTileData(e,n),e.state="loaded",void i(null)):(e.state="errored",i(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)))}.bind(this)).catch((t=>{20!==t.code&&(e.state="errored",i(t))})),e.request.cancel=()=>s.abort()}loadTileData(t,e){Mt.loadTileData(t,e,this._map.painter)}unloadTileData(t){Mt.unloadTileData(t,this._map.painter)}unloadTile(t,e){if(this.unloadTileData(t),this._implementation.unloadTile){const{x:e,y:i,z:n}=t.tileID.canonical;this._implementation.unloadTile({x:e,y:i,z:n})}e()}abortTile(t,e){t.request&&t.request.cancel&&(t.request.cancel(),delete t.request),e()}hasTransition(){return!1}_coveringTiles(){return this._map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map((t=>({x:t.canonical.x,y:t.canonical.y,z:t.canonical.z})))}_clearTiles(){this._map.style._clearSource(this.id)}_update(){this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"}))}}},Pt=function(e,i,n,r){const o=new Ct[i.type](e,i,n,r);if(o.id!==e)throw new Error(`Expected Source id to be ${e} instead of ${o.id}`);return t.bindAll(["load","abort","unload","serialize","prepare"],o),o};function Lt(e,i){const n=t.identity([]);return t.scale(n,n,[.5*e.width,.5*-e.height,1]),t.translate(n,n,[1,-1,0]),t.multiply(n,n,e.calculateProjMatrix(i.toUnwrapped())),Float32Array.from(n)}function Dt(t,e,i,n,r,o,s,a=!1){const l=t.tilesIn(n,s,a);l.sort(Ot);const c=[];for(const n of l)c.push({wrappedTileID:n.tile.tileID.wrapped().key,queryResults:n.tile.queryRenderedFeatures(e,i,t._state,n,r,o,Lt(t.transform,n.tile.tileID),a)});const u=function(t){const e={},i={};for(const n of t){const t=n.queryResults,r=n.wrappedTileID,o=i[r]=i[r]||{};for(const i in t){const n=t[i],r=o[i]=o[i]||{},s=e[i]=e[i]||[];for(const t of n)r[t.featureIndex]||(r[t.featureIndex]=!0,s.push(t))}}return e}(c);for(const e in u)u[e].forEach((e=>{const i=e.feature,n=i.layer;n&&"background"!==n.type&&"sky"!==n.type&&(i.source=n.source,n["source-layer"]&&(i.sourceLayer=n["source-layer"]),i.state=void 0!==i.id?t.getFeatureState(n["source-layer"],i.id):{})}));return u}function Rt(t,e){const i=t.getRenderableIds().map((e=>t.getTileByID(e))),n=[],r={};for(let t=0;t<i.length;t++){const o=i[t],s=o.tileID.canonical.key;r[s]||(r[s]=!0,o.querySourceFeatures(n,e))}return n}function Ot(t,e){const i=t.tileID,n=e.tileID;return i.overscaledZ-n.overscaledZ||i.canonical.y-n.canonical.y||i.wrap-n.wrap||i.canonical.x-n.canonical.x}function kt(){return null!=po.workerClass?new po.workerClass:new t.window.Worker(po.workerUrl)}const Nt="mapboxgl_preloaded_worker_pool";class Bt{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length<Bt.workerCount;)this.workers.push(new kt);return this.active[t]=!0,this.workers.slice()}release(t){delete this.active[t],0===this.numActive()&&(this.workers.forEach((t=>{t.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[Nt]}numActive(){return Object.keys(this.active).length}}let zt;function Ft(){return zt||(zt=new Bt),zt}function Vt(e,i){const n={};for(const t in e)"ref"!==t&&(n[t]=e[t]);return t.refProperties.forEach((t=>{t in i&&(n[t]=i[t])})),n}function Ut(t){t=t.slice();const e=Object.create(null);for(let i=0;i<t.length;i++)e[t[i].id]=t[i];for(let i=0;i<t.length;i++)"ref"in t[i]&&(t[i]=Vt(t[i],e[t[i].ref]));return t}Bt.workerCount=2;const Gt={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 jt(t,e,i){i.push({command:Gt.addSource,args:[t,e[t]]})}function Ht(t,e,i){e.push({command:Gt.removeSource,args:[t]}),i[t]=!0}function Wt(t,e,i,n){Ht(t,i,n),jt(t,e,i)}function qt(t,i,n){let r;for(r in t[n])if(t[n].hasOwnProperty(r)&&"data"!==r&&!e(t[n][r],i[n][r]))return!1;for(r in i[n])if(i[n].hasOwnProperty(r)&&"data"!==r&&!e(t[n][r],i[n][r]))return!1;return!0}function Xt(t,i,n,r,o,s){let a;for(a in i=i||{},t=t||{})t.hasOwnProperty(a)&&(e(t[a],i[a])||n.push({command:s,args:[r,a,i[a],o]}));for(a in i)i.hasOwnProperty(a)&&!t.hasOwnProperty(a)&&(e(t[a],i[a])||n.push({command:s,args:[r,a,i[a],o]}))}function Zt(t){return t.id}function Yt(t,e){return t[e.id]=e,t}class Qt{constructor(t,e){this.reset(t,e)}reset(t,e){this.points=t||[],this._distances=[0];for(let t=1;t<this.points.length;t++)this._distances[t]=this._distances[t-1]+this.points[t].dist(this.points[t-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(e||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(e){if(1===this.points.length)return this.points[0];e=t.clamp(e,0,1);let i=1,n=this._distances[i];const r=e*this.paddedLength+this.padding;for(;n<r&&i<this._distances.length;)n=this._distances[++i];const o=i-1,s=this._distances[o],a=n-s,l=a>0?(r-s)/a:0;return this.points[o].mult(1-l).add(this.points[i].mult(l))}}class Jt{constructor(t,e,i){const n=this.boxCells=[],r=this.circleCells=[];this.xCellCount=Math.ceil(t/i),this.yCellCount=Math.ceil(e/i);for(let t=0;t<this.xCellCount*this.yCellCount;t++)n.push([]),r.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(t,e,i,n,r){this._forEachCell(e,i,n,r,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(r)}insertCircle(t,e,i,n){this._forEachCell(e-n,i-n,e+n,i+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(i),this.circles.push(n)}_insertBoxCell(t,e,i,n,r,o){this.boxCells[r].push(o)}_insertCircleCell(t,e,i,n,r,o){this.circleCells[r].push(o)}_query(t,e,i,n,r,o){if(i<0||t>this.width||n<0||e>this.height)return!r&&[];const s=[];if(t<=0&&e<=0&&this.width<=i&&this.height<=n){if(r)return!0;for(let t=0;t<this.boxKeys.length;t++)s.push({key:this.boxKeys[t],x1:this.bboxes[4*t],y1:this.bboxes[4*t+1],x2:this.bboxes[4*t+2],y2:this.bboxes[4*t+3]});for(let t=0;t<this.circleKeys.length;t++){const e=this.circles[3*t],i=this.circles[3*t+1],n=this.circles[3*t+2];s.push({key:this.circleKeys[t],x1:e-n,y1:i-n,x2:e+n,y2:i+n})}return o?s.filter(o):s}return this._forEachCell(t,e,i,n,this._queryCell,s,{hitTest:r,seenUids:{box:{},circle:{}}},o),r?s.length>0:s}_queryCircle(t,e,i,n,r){const o=t-i,s=t+i,a=e-i,l=e+i;if(s<0||o>this.width||l<0||a>this.height)return!n&&[];const c=[];return this._forEachCell(o,a,s,l,this._queryCellCircle,c,{hitTest:n,circle:{x:t,y:e,radius:i},seenUids:{box:{},circle:{}}},r),n?c.length>0:c}query(t,e,i,n,r){return this._query(t,e,i,n,!1,r)}hitTest(t,e,i,n,r){return this._query(t,e,i,n,!0,r)}hitTestCircle(t,e,i,n){return this._queryCircle(t,e,i,!0,n)}_queryCell(t,e,i,n,r,o,s,a){const l=s.seenUids,c=this.boxCells[r];if(null!==c){const r=this.bboxes;for(const u of c)if(!l.box[u]){l.box[u]=!0;const c=4*u;if(t<=r[c+2]&&e<=r[c+3]&&i>=r[c+0]&&n>=r[c+1]&&(!a||a(this.boxKeys[u]))){if(s.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[u],x1:r[c],y1:r[c+1],x2:r[c+2],y2:r[c+3]})}}}const u=this.circleCells[r];if(null!==u){const r=this.circles;for(const c of u)if(!l.circle[c]){l.circle[c]=!0;const u=3*c;if(this._circleAndRectCollide(r[u],r[u+1],r[u+2],t,e,i,n)&&(!a||a(this.circleKeys[c]))){if(s.hitTest)return o.push(!0),!0;{const t=r[u],e=r[u+1],i=r[u+2];o.push({key:this.circleKeys[c],x1:t-i,y1:e-i,x2:t+i,y2:e+i})}}}}}_queryCellCircle(t,e,i,n,r,o,s,a){const l=s.circle,c=s.seenUids,u=this.boxCells[r];if(null!==u){const t=this.bboxes;for(const e of u)if(!c.box[e]){c.box[e]=!0;const i=4*e;if(this._circleAndRectCollide(l.x,l.y,l.radius,t[i+0],t[i+1],t[i+2],t[i+3])&&(!a||a(this.boxKeys[e])))return o.push(!0),!0}}const h=this.circleCells[r];if(null!==h){const t=this.circles;for(const e of h)if(!c.circle[e]){c.circle[e]=!0;const i=3*e;if(this._circlesCollide(t[i],t[i+1],t[i+2],l.x,l.y,l.radius)&&(!a||a(this.circleKeys[e])))return o.push(!0),!0}}}_forEachCell(t,e,i,n,r,o,s,a){const l=this._convertToXCellCoord(t),c=this._convertToYCellCoord(e),u=this._convertToXCellCoord(i),h=this._convertToYCellCoord(n);for(let p=l;p<=u;p++)for(let l=c;l<=h;l++)if(r.call(this,t,e,i,n,this.xCellCount*l+p,o,s,a))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,e,i,n,r,o){const s=n-t,a=r-e,l=i+o;return l*l>s*s+a*a}_circleAndRectCollide(t,e,i,n,r,o,s){const a=(o-n)/2,l=Math.abs(t-(n+a));if(l>a+i)return!1;const c=(s-r)/2,u=Math.abs(e-(r+c));if(u>c+i)return!1;if(l<=a||u<=c)return!0;const h=l-a,p=u-c;return h*h+p*p<=i*i}}const Kt={unknown:0,flipRequired:1,flipNotRequired:2},$t=Math.tan(85*Math.PI/180);function te(e,i,n,r,o,s,a){const l=t.create();if(n)if("globe"===s.name){const e=t.calculateGlobeLabelMatrix(o,i);t.multiply(l,l,e)}else{const e=v([],a);l[0]=e[0],l[1]=e[1],l[4]=e[2],l[5]=e[3],r||t.rotateZ(l,l,o.angle)}else t.multiply(l,o.labelPlaneMatrix,e);return l}function ee(t,e,i,n,r,o,s){const a=te(t,e,i,n,r,o,s);return"globe"===o.name&&i||(a[2]=a[6]=a[10]=a[14]=0),a}function ie(e,i,n,r,o,s,a){if(n){if("globe"===s.name){const l=te(e,i,n,r,o,s,a);return t.invert(l,l),t.multiply(l,e,l),l}{const i=t.clone(e),n=t.identity([]);return n[0]=a[0],n[1]=a[1],n[4]=a[2],n[5]=a[3],t.multiply(i,i,n),r||t.rotateZ(i,i,-o.angle),i}}return o.glCoordMatrix}function ne(e,i,n,r){const o=[e,i,n,1];n?t.transformMat4$1(o,o,r):fe(o,o,r);const s=o[3];return o[0]/=s,o[1]/=s,o[2]/=s,o}function re(t,e){return Math.min(.5+t/e*.5,1.5)}function oe(t,e){const i=t[0]/t[3],n=t[1]/t[3];return i>=-e[0]&&i<=e[0]&&n>=-e[1]&&n<=e[1]}function se(e,i,n,r,o,s,a,l,c,u){const h=n.transform,p=r?e.textSizeData:e.iconSizeData,d=t.evaluateSizeForZoom(p,n.transform.zoom),f="globe"===h.projection.name,m=[256/n.width*2+1,256/n.height*2+1],g=r?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;g.clear();let y=null;f&&(y=r?e.text.globeExtVertexArray:e.icon.globeExtVertexArray);const v=e.lineVertexArray,_=r?e.text.placedSymbolArray:e.icon.placedSymbolArray,x=n.transform.width/n.transform.height;let b,w=!1;for(let r=0;r<_.length;r++){const f=_.get(r),{numGlyphs:A,writingMode:E}=f;if(E!==t.WritingMode.vertical||w||b===t.WritingMode.horizontal||(w=!0),b=E,(f.hidden||E===t.WritingMode.vertical)&&!w){de(A,g);continue}w=!1;const S=new t.Point(f.tileAnchorX,f.tileAnchorY);let{x:M,y:T,z:I}=h.projection.projectTilePoint(S.x,S.y,u.canonical);if(c){const[t,e,i]=c(S);M+=t,T+=e,I+=i}const C=[M,T,I,1];if(t.transformMat4$1(C,C,i),!oe(C,m)){de(A,g);continue}const P=re(n.transform.cameraToCenterDistance,C[3]),L=t.evaluateSizeForFeature(p,d,f),D=a?L/P:L*P,R=ne(M,T,I,o);if(R[3]<=0){de(A,g);continue}let O={};const k=a?null:c,N=ce(f,D,!1,l,i,o,s,e.glyphOffsetArray,v,g,y,R,S,O,x,k,h.projection,u,a);w=N.useVertical,k&&N.needsFlipping&&(O={}),(N.notEnoughRoom||w||N.needsFlipping&&ce(f,D,!0,l,i,o,s,e.glyphOffsetArray,v,g,y,R,S,O,x,k,h.projection,u,a).notEnoughRoom)&&de(A,g)}r?(e.text.dynamicLayoutVertexBuffer.updateData(g),y&&e.text.globeExtVertexBuffer.updateData(y)):(e.icon.dynamicLayoutVertexBuffer.updateData(g),y&&e.icon.globeExtVertexBuffer.updateData(y))}function ae(t,e,i,n,r,o,s,a,l,c,u,h,p,d,f,m){const{lineStartIndex:g,glyphStartIndex:y,segment:v}=a,_=y+a.numGlyphs,x=g+a.lineLength,b=e.getoffsetX(y),w=e.getoffsetX(_-1),A=pe(t*b,i,n,r,o,s,v,g,x,l,c,u,h,p,!0,d,f,m);if(!A)return null;const E=pe(t*w,i,n,r,o,s,v,g,x,l,c,u,h,p,!0,d,f,m);return E?{first:A,last:E}:null}function le(e,i,n,r){return e===t.WritingMode.horizontal&&Math.abs(r)>Math.abs(n)?{useVertical:!0}:e===t.WritingMode.vertical?r>0?{needsFlipping:!0}:null:i!==Kt.unknown&&function(t,e){return 0===t||Math.abs(e/t)>$t}(n,r)?i===Kt.flipRequired?{needsFlipping:!0}:null:n<0?{needsFlipping:!0}:null}function ce(e,i,n,r,o,s,a,l,c,u,h,p,d,f,m,g,y,v,_){const x=i/24,b=e.lineOffsetX*x,w=e.lineOffsetY*x,{lineStartIndex:A,glyphStartIndex:E,numGlyphs:S,segment:M,writingMode:T,flipState:I}=e,C=A+e.lineLength,P=e=>{if(h){const[i,n,r]=e.up,o=u.length;t.updateGlobeVertexNormal(h,o+0,i,n,r),t.updateGlobeVertexNormal(h,o+1,i,n,r),t.updateGlobeVertexNormal(h,o+2,i,n,r),t.updateGlobeVertexNormal(h,o+3,i,n,r)}const[i,n,r]=e.point;t.addDynamicAttributes(u,i,n,r,e.angle)};if(S>1){const t=ae(x,l,b,w,n,p,d,e,c,s,f,g,!1,y,v,_);if(!t)return{notEnoughRoom:!0};if(r&&!n){let[i,n,r]=t.first.point,[o,s,l]=t.last.point;[i,n]=ne(i,n,r,a),[o,s]=ne(o,s,l,a);const c=le(T,I,(o-i)*m,s-n);if(e.flipState=c&&c.needsFlipping?Kt.flipRequired:Kt.flipNotRequired,c)return c}P(t.first);for(let t=E+1;t<E+S-1;t++){const e=pe(x*l.getoffsetX(t),b,w,n,p,d,M,A,C,c,s,f,g,!1,!1,y,v,_);if(!e)return u.length-=4*(t-E),{notEnoughRoom:!0};P(e)}P(t.last)}else{if(r&&!n){const i=ne(d.x,d.y,0,o),n=A+M+1,r=new t.Point(c.getx(n),c.gety(n)),s=ne(r.x,r.y,0,o),a=s[3]>0?s:he(d,r,i,1,o,void 0,y,v.canonical),l=le(T,I,(a[0]-i[0])*m,a[1]-i[1]);if(e.flipState=l&&l.needsFlipping?Kt.flipRequired:Kt.flipNotRequired,l)return l}const i=pe(x*l.getoffsetX(E),b,w,n,p,d,M,A,C,c,s,f,g,!1,!1,y,v,_);if(!i)return{notEnoughRoom:!0};P(i)}return{}}function ue(t,e,i,n,r){const{x:o,y:s,z:a}=n.projectTilePoint(t.x,t.y,e);if(!r)return ne(o,s,a,i);const[l,c,u]=r(t);return ne(o+l,s+c,a+u,i)}function he(e,i,n,r,o,s,a,l){const c=ue(e.sub(i)._unit()._add(e),l,o,a,s);return t.sub(c,n,c),t.normalize(c,c),t.scaleAndAdd(c,n,c,r)}function pe(e,i,n,r,o,s,a,l,c,u,h,p,d,f,m,g,y,v){const _=r?e-i:e+i;let x=_>0?1:-1,b=0;r&&(x*=-1,b=Math.PI),x<0&&(b+=Math.PI);let w=l+a+(x>0?0:1)|0,A=o,E=o,S=0,M=0;const T=Math.abs(_),I=[],C=[];let P=s,L=P;const D=()=>he(L,P,E,T-S+1,h,d,g,y.canonical);for(;S+M<=T;){if(w+=x,w<l||w>=c)return null;if(E=A,L=P,I.push(E),f&&C.push(L),P=new t.Point(u.getx(w),u.gety(w)),A=p[w],!A){const t=ue(P,y.canonical,h,g,d);A=t[3]>0?p[w]=t:D()}S+=M,M=t.distance(E,A)}m&&d&&(p[w]&&(A=D(),M=t.distance(E,A)),p[w]=A);const R=(T-S)/M,O=P.sub(L)._mult(R)._add(L),k=t.sub([],A,E),N=t.scaleAndAdd([],E,k,R);let B=[0,0,1],z=k[0],F=k[1];if(v&&(B=g.upVector(y.canonical,O.x,O.y),0!==B[0]||0!==B[1]||1!==B[2])){const e=[B[2],0,-B[0]],i=t.cross([],B,e);t.normalize(e,e),t.normalize(i,i),z=t.dot(k,e),F=t.dot(k,i)}if(n){const e=t.cross([],B,k);t.normalize(e,e),t.scaleAndAdd(N,N,e,n*x)}const V=b+Math.atan2(F,z);return I.push(N),f&&C.push(O),{point:N,angle:V,path:I,tilePath:C,up:B}}function de(t,e){const i=e.length,n=i+4*t;e.resize(n),e.float32.fill(-1/0,4*i,4*n)}function fe(t,e,i){const n=e[0],r=e[1];return t[0]=i[0]*n+i[4]*r+i[12],t[1]=i[1]*n+i[5]*r+i[13],t[3]=i[3]*n+i[7]*r+i[15],t}const me=100;class ge{constructor(t,e,i=new Jt(t.width+200,t.height+200,25),n=new Jt(t.width+200,t.height+200,25)){this.transform=t,this.grid=i,this.ignoredGrid=n,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+me,this.screenBottomBoundary=t.height+me,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200,this.fogState=e}placeCollisionBox(t,e,i,n,r,o,s,a){let l=i.projectedAnchorX,c=i.projectedAnchorY,u=i.projectedAnchorZ;const h=i.elevation,p=i.tileID,d=t.getProjection();if(h&&p){const[t,e,n]=d.upVector(p.canonical,i.tileAnchorX,i.tileAnchorY),r=d.upVectorScale(p.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;l+=t*h*r,c+=e*h*r,u+=n*h*r}const f=this.projectAndGetPerspectiveRatio(s,l,c,u,i.tileID,"globe"===d.name||!!h||this.transform.pitch>0,d),m=o*f.perspectiveRatio,g=(i.x1*e+n.x-i.padding)*m+f.point.x,y=(i.y1*e+n.y-i.padding)*m+f.point.y,v=(i.x2*e+n.x+i.padding)*m+f.point.x,_=(i.y2*e+n.y+i.padding)*m+f.point.y,x=f.perspectiveRatio<=.55||f.occluded;return!this.isInsideGrid(g,y,v,_)||!r&&this.grid.hitTest(g,y,v,_,a)||x?{box:[],offscreen:!1,occluded:f.occluded}:{box:[g,y,v,_],offscreen:this.isOffscreen(g,y,v,_),occluded:!1}}placeCollisionCircles(e,i,n,r,o,s,a,l,c,u,h,p,d,f,m){const g=[],y=this.transform.elevation,v=e.getProjection(),_=y?y.getAtTileOffsetFunc(m,this.transform.center.lat,this.transform.worldSize,v):null,x=new t.Point(n.tileAnchorX,n.tileAnchorY);let{x:b,y:w,z:A}=v.projectTilePoint(x.x,x.y,m.canonical);if(_){const[t,e,i]=_(x);b+=t,w+=e,A+=i}const E="globe"===v.name,S=this.projectAndGetPerspectiveRatio(a,b,w,A,m,E||!!y||this.transform.pitch>0,v),{perspectiveRatio:M}=S,T=(h?s/M:s*M)/t.ONE_EM,I=ne(b,w,A,l),C=S.signedDistanceFromCamera>0?ae(T,o,n.lineOffsetX*T,n.lineOffsetY*T,!1,I,x,n,r,l,{},y&&!h?_:null,h&&!!y,v,m,h):null;let P=!1,L=!1,D=!0;if(C&&!S.occluded){const e=.5*d*M+f,n=new t.Point(-100,-100),r=new t.Point(this.screenRightBoundary,this.screenBottomBoundary),o=new Qt,{first:s,last:a}=C,l=s.path.length;let h=[];for(let t=l-1;t>=1;t--)h.push(s.path[t]);for(let t=1;t<a.path.length;t++)h.push(a.path[t]);const m=2.5*e;c&&(h=h.map((([t,e,i],n)=>(_&&!E&&(i=_(n<l-1?s.tilePath[l-1-n]:a.tilePath[n-l+2])[2]),ne(t,e,i,c)))),h.some((t=>t[3]<=0))&&(h=[]));let y=[];if(h.length>0){let e=1/0,i=-1/0,o=1/0,s=-1/0;for(const t of h)e=Math.min(e,t[0]),o=Math.min(o,t[1]),i=Math.max(i,t[0]),s=Math.max(s,t[1]);i>=n.x&&e<=r.x&&s>=n.y&&o<=r.y&&(y=[h.map((e=>new t.Point(e[0],e[1])))],(e<n.x||i>r.x||o<n.y||s>r.y)&&(y=t.clipLine(y,n.x,n.y,r.x,r.y)))}for(const t of y){o.reset(t,.25*e);let n=0;n=o.length<=.5*e?1:Math.ceil(o.paddedLength/m)+1;for(let t=0;t<n;t++){const r=t/Math.max(n-1,1),s=o.lerp(r),a=s.x+me,l=s.y+me;g.push(a,l,e,0);const c=a-e,h=l-e,d=a+e,f=l+e;if(D=D&&this.isOffscreen(c,h,d,f),L=L||this.isInsideGrid(c,h,d,f),!i&&this.grid.hitTestCircle(a,l,e,p)&&(P=!0,!u))return{circles:[],offscreen:!1,collisionDetected:P,occluded:!1}}}}return{circles:!u&&P||!L?[]:g,offscreen:D,collisionDetected:P,occluded:S.occluded}}queryRenderedSymbols(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};const i=[];let n=1/0,r=1/0,o=-1/0,s=-1/0;for(const a of e){const e=new t.Point(a.x+me,a.y+me);n=Math.min(n,e.x),r=Math.min(r,e.y),o=Math.max(o,e.x),s=Math.max(s,e.y),i.push(e)}const a=this.grid.query(n,r,o,s).concat(this.ignoredGrid.query(n,r,o,s)),l={},c={};for(const e of a){const n=e.key;if(void 0===l[n.bucketInstanceId]&&(l[n.bucketInstanceId]={}),l[n.bucketInstanceId][n.featureIndex])continue;const r=[new t.Point(e.x1,e.y1),new t.Point(e.x2,e.y1),new t.Point(e.x2,e.y2),new t.Point(e.x1,e.y2)];t.polygonIntersectsPolygon(i,r)&&(l[n.bucketInstanceId][n.featureIndex]=!0,void 0===c[n.bucketInstanceId]&&(c[n.bucketInstanceId]=[]),c[n.bucketInstanceId].push(n.featureIndex))}return c}insertCollisionBox(t,e,i,n,r){(e?this.ignoredGrid:this.grid).insert({bucketInstanceId:i,featureIndex:n,collisionGroupID:r},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,e,i,n,r){const o=e?this.ignoredGrid:this.grid,s={bucketInstanceId:i,featureIndex:n,collisionGroupID:r};for(let e=0;e<t.length;e+=4)o.insertCircle(s,t[e],t[e+1],t[e+2])}projectAndGetPerspectiveRatio(e,i,n,r,o,s,a){const l=[i,n,r,1];let c=!1;if(r||this.transform.pitch>0){if(t.transformMat4$1(l,l,e),this.fogState&&o&&"globe"!==a.name){const e=function(e,i,n,r,o,s){const a=s.calculateFogTileMatrix(o),l=[i,n,r];return t.transformMat4(l,l,a),S(e,l,s.pitch,s._fov)}(this.fogState,i,n,r,o.toUnwrapped(),this.transform);c=e>.9}}else fe(l,l,e);const u=l[3];return{point:new t.Point((l[0]/u+1)/2*this.transform.width+me,(-l[1]/u+1)/2*this.transform.height+me),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(a)/u*.5,1.5),signedDistanceFromCamera:u,occluded:s&&l[2]>u||c}}isOffscreen(t,e,i,n){return i<me||t>=this.screenRightBoundary||n<me||e>this.screenBottomBoundary}isInsideGrid(t,e,i,n){return i>=0&&t<this.gridRightBoundary&&n>=0&&e<this.gridBottomBoundary}getViewportMatrix(){const e=t.identity([]);return t.translate(e,e,[-100,-100,0]),e}}function ye(e,i,n){const r=i.createTileMatrix(e,e.worldSize,n.toUnwrapped());return t.multiply(new Float32Array(16),e.projMatrix,r)}function ve(t,e,i){if(e.projection.name===i.projection.name)return t.projMatrix;const n=i.clone();return n.setProjection(e.projection),ye(n,e.getProjection(),t)}function _e(t,e,i){return e.name===i.projection.name?t.projMatrix:ye(i,e,t)}class xe{constructor(t,e,i,n){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):n&&i?1:0,this.placed=i}isHidden(){return 0===this.opacity&&!this.placed}}class be{constructor(t,e,i,n,r,o=!1){this.text=new xe(t?t.text:null,e,i,r),this.icon=new xe(t?t.icon:null,e,n,r),this.clipped=o}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class we{constructor(t,e,i,n=!1){this.text=t,this.icon=e,this.skipFade=i,this.clipped=n}}class Ae{constructor(){this.invProjMatrix=t.create(),this.viewportMatrix=t.create(),this.circles=[]}}class Ee{constructor(t,e,i,n,r){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=i,this.bucketIndex=n,this.tileID=r}}class Se{constructor(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}get(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){const e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:t=>t.collisionGroupID===e}}return this.collisionGroups[t]}}function Me(e,i,n,r,o){const{horizontalAlign:s,verticalAlign:a}=t.getAnchorAlignment(e),l=-(s-.5)*i,c=-(a-.5)*n,u=t.evaluateVariableOffset(e,r);return new t.Point(l+u[0]*o,c+u[1]*o)}function Te(e,i,n,r,o){const s=new t.Point(e,i);return n&&s._rotate(r?o:-o),s}class Ie{constructor(t,e,i,n,r){this.transform=t.clone(),this.projection=t.projection.name,this.collisionIndex=new ge(this.transform,r),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new Se(i),this.collisionCircleArrays={},this.prevPlacement=n,n&&(n.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(e,i,n,r){const o=n.getBucket(i),s=n.latestFeatureIndex;if(!o||!s||i.id!==o.layerIds[0])return;const a=o.layers[0].layout,l=n.collisionBoxArray,c=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),u=n.tileSize/t.EXTENT,h=n.tileID.toUnwrapped();this.transform.setProjection(o.projection);const p=(d=n.tileID,f=o.getProjection(),m=this.transform,f.name===this.projection?m.calculateProjMatrix(d.toUnwrapped()):ye(m,f,d));var d,f,m;const g="map"===a.get("text-pitch-alignment"),y="map"===a.get("text-rotation-alignment");i.compileFilter();const v=i.dynamicFilter(),_=i.dynamicFilterNeedsFeature(),x=this.transform.calculatePixelsToTileUnitsMatrix(n),b=ee(p,n.tileID.canonical,g,y,this.transform,o.getProjection(),x);let w=null;if(g){const e=ie(p,n.tileID.canonical,g,y,this.transform,o.getProjection(),x);w=t.multiply([],this.transform.labelPlaneMatrix,e)}let A=null;v&&n.latestFeatureIndex&&(A={unwrappedTileID:h,dynamicFilter:v,dynamicFilterNeedsFeature:_,featureIndex:n.latestFeatureIndex}),this.retainedQueryData[o.bucketInstanceId]=new Ee(o.bucketInstanceId,s,o.sourceLayerIndex,o.index,n.tileID);const E={bucket:o,layout:a,posMatrix:p,textLabelPlaneMatrix:b,labelToScreenMatrix:w,clippingData:A,scale:c,textPixelRatio:u,holdingForFade:n.holdingForFade(),collisionBoxArray:l,partiallyEvaluatedTextSize:t.evaluateSizeForZoom(o.textSizeData,this.transform.zoom),partiallyEvaluatedIconSize:t.evaluateSizeForZoom(o.iconSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(o.sourceID)};if(r)for(const t of o.sortKeyRanges){const{sortKey:i,symbolInstanceStart:n,symbolInstanceEnd:r}=t;e.push({sortKey:i,symbolInstanceStart:n,symbolInstanceEnd:r,parameters:E})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:o.symbolInstances.length,parameters:E})}attemptAnchorPlacement(t,e,i,n,r,o,s,a,l,c,u,h,p,d,f,m,g,y){const{textOffset0:v,textOffset1:_,crossTileID:x}=h,b=[v,_],w=Me(t,i,n,b,r),A=this.collisionIndex.placeCollisionBox(d,r,e,Te(w.x,w.y,o,s,this.transform.angle),u,a,l,c.predicate);if(m){const t=d.getSymbolInstanceIconSize(y,this.transform.zoom,h.placedIconSymbolIndex);if(0===this.collisionIndex.placeCollisionBox(d,t,m,Te(w.x,w.y,o,s,this.transform.angle),u,a,l,c.predicate).box.length)return}if(A.box.length>0){let e;return this.prevPlacement&&this.prevPlacement.variableOffsets[x]&&this.prevPlacement.placements[x]&&this.prevPlacement.placements[x].text&&(e=this.prevPlacement.variableOffsets[x].anchor),this.variableOffsets[x]={textOffset:b,width:i,height:n,anchor:t,textScale:r,prevAnchor:e},this.markUsedJustification(d,t,h,f),d.allowVerticalPlacement&&(this.markUsedOrientation(d,f,h),this.placedOrientations[x]=f),{shift:w,placedGlyphBoxes:A}}}placeLayerBucketPart(e,i,n,r){const{bucket:o,layout:s,posMatrix:a,textLabelPlaneMatrix:l,labelToScreenMatrix:c,clippingData:u,textPixelRatio:h,holdingForFade:p,collisionBoxArray:d,partiallyEvaluatedTextSize:f,partiallyEvaluatedIconSize:m,collisionGroup:g}=e.parameters,y=s.get("text-optional"),v=s.get("icon-optional"),_=s.get("text-allow-overlap"),x=s.get("icon-allow-overlap"),b="map"===s.get("text-rotation-alignment"),w="map"===s.get("text-pitch-alignment"),A="none"!==s.get("icon-text-fit"),E="viewport-y"===s.get("symbol-z-order");this.transform.setProjection(o.projection);let S=_&&(x||!o.hasIconData()||v),M=x&&(_||!o.hasTextData()||y);!o.collisionArrays&&d&&o.deserializeCollisionBoxes(d),n&&r&&o.updateCollisionDebugBuffers(this.transform.zoom,d);const T=(e,r,d)=>{const{crossTileID:E,numVerticalGlyphVertices:T}=e;if(u){const n={zoom:this.transform.zoom,pitch:this.transform.pitch};let r=null;if(u.dynamicFilterNeedsFeature){const t=this.retainedQueryData[o.bucketInstanceId];r=u.featureIndex.loadFeature({featureIndex:e.featureIndex,bucketIndex:t.bucketIndex,sourceLayerIndex:t.sourceLayerIndex,layoutVertexArrayOffset:0})}if(!(0,u.dynamicFilter)(n,r,this.retainedQueryData[o.bucketInstanceId].tileID.canonical,new t.Point(e.tileAnchorX,e.tileAnchorY),this.transform.calculateDistanceTileData(u.unwrappedTileID)))return this.placements[E]=new we(!1,!1,!1,!0),void i.add(E)}if(i.has(E))return;if(p)return void(this.placements[E]=new we(!1,!1,!1));let I=!1,C=!1,P=!0,L=!1,D=!1,R=null,O={box:null,offscreen:null,occluded:null},k={box:null,offscreen:null,occluded:null},N=null,B=null,z=null,F=0,V=0,U=0;d.textFeatureIndex?F=d.textFeatureIndex:e.useRuntimeCollisionCircles&&(F=e.featureIndex),d.verticalTextFeatureIndex&&(V=d.verticalTextFeatureIndex);const G=t=>{t.tileID=this.retainedQueryData[o.bucketInstanceId].tileID;const e=this.transform.elevation;(e||t.elevation)&&(t.elevation=e?e.getAtTileOffset(t.tileID,t.tileAnchorX,t.tileAnchorY):0)},j=d.textBox;if(j){G(j);const i=i=>{let n=t.WritingMode.horizontal;if(o.allowVerticalPlacement&&!i&&this.prevPlacement){const t=this.prevPlacement.placedOrientations[E];t&&(this.placedOrientations[E]=t,n=t,this.markUsedOrientation(o,n,e))}return n},n=(e,i)=>{if(o.allowVerticalPlacement&&T>0&&d.verticalTextBox){for(const n of o.writingModes)if(n===t.WritingMode.vertical?(O=i(),k=O):O=e(),O&&O.box&&O.box.length)break}else O=e()};if(s.get("text-variable-anchor")){let l=s.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[E]){const t=this.prevPlacement.variableOffsets[E];l.indexOf(t.anchor)>0&&(l=l.filter((e=>e!==t.anchor)),l.unshift(t.anchor))}const c=(t,i,n)=>{const s=o.getSymbolInstanceTextSize(f,e,this.transform.zoom,r),c=(t.x2-t.x1)*s+2*t.padding,u=(t.y2-t.y1)*s+2*t.padding,p=A&&!x?i:null;p&&G(p);let d={box:[],offscreen:!1,occluded:!1};const y=_?2*l.length:l.length;for(let i=0;i<y;++i){const y=this.attemptAnchorPlacement(l[i%l.length],t,c,u,s,b,w,h,a,g,i>=l.length,e,r,o,n,p,f,m);if(y&&(d=y.placedGlyphBoxes,d&&d.box&&d.box.length)){I=!0,R=y.shift;break}}return d};n((()=>c(j,d.iconBox,t.WritingMode.horizontal)),(()=>{const e=d.verticalTextBox;return e&&G(e),o.allowVerticalPlacement&&!(O&&O.box&&O.box.length)&&T>0&&e?c(e,d.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null,occluded:null}})),O&&(I=O.box,P=O.offscreen,L=O.occluded);const u=i(!(!O||!O.box));if(!I&&this.prevPlacement){const t=this.prevPlacement.variableOffsets[E];t&&(this.variableOffsets[E]=t,this.markUsedJustification(o,t.anchor,e,u))}}else{const s=(i,n)=>{const s=o.getSymbolInstanceTextSize(f,e,this.transform.zoom,r),l=this.collisionIndex.placeCollisionBox(o,s,i,new t.Point(0,0),_,h,a,g.predicate);return l&&l.box&&l.box.length&&(this.markUsedOrientation(o,n,e),this.placedOrientations[E]=n),l};n((()=>s(j,t.WritingMode.horizontal)),(()=>{const e=d.verticalTextBox;return o.allowVerticalPlacement&&T>0&&e?(G(e),s(e,t.WritingMode.vertical)):{box:null,offscreen:null,occluded:null}})),i(!!(O&&O.box&&O.box.length))}}if(N=O,I=N&&N.box&&N.box.length>0,P=N&&N.offscreen,L=N&&N.occluded,e.useRuntimeCollisionCircles){const i=o.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex>=0?e.centerJustifiedTextSymbolIndex:e.verticalPlacedTextSymbolIndex),r=t.evaluateSizeForFeature(o.textSizeData,f,i),u=s.get("text-padding");B=this.collisionIndex.placeCollisionCircles(o,_,i,o.lineVertexArray,o.glyphOffsetArray,r,a,l,c,n,w,g.predicate,e.collisionCircleDiameter*r/t.ONE_EM,u,this.retainedQueryData[o.bucketInstanceId].tileID),I=_||B.circles.length>0&&!B.collisionDetected,P=P&&B.offscreen,L=B.occluded}if(d.iconFeatureIndex&&(U=d.iconFeatureIndex),d.iconBox){const i=i=>{G(i);const n=A&&R?Te(R.x,R.y,b,w,this.transform.angle):new t.Point(0,0),r=o.getSymbolInstanceIconSize(m,this.transform.zoom,e.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(o,r,i,n,x,h,a,g.predicate)};k&&k.box&&k.box.length&&d.verticalIconBox?(z=i(d.verticalIconBox),C=z.box.length>0):(z=i(d.iconBox),C=z.box.length>0),P=P&&z.offscreen,D=z.occluded}const H=y||0===e.numHorizontalGlyphVertices&&0===T,W=v||0===e.numIconVertices;if(H||W?W?H||(C=C&&I):I=C&&I:C=I=C&&I,I&&N&&N.box&&this.collisionIndex.insertCollisionBox(N.box,s.get("text-ignore-placement"),o.bucketInstanceId,k&&k.box&&V?V:F,g.ID),C&&z&&this.collisionIndex.insertCollisionBox(z.box,s.get("icon-ignore-placement"),o.bucketInstanceId,U,g.ID),B&&(I&&this.collisionIndex.insertCollisionCircles(B.circles,s.get("text-ignore-placement"),o.bucketInstanceId,F,g.ID),n)){const t=o.bucketInstanceId;let e=this.collisionCircleArrays[t];void 0===e&&(e=this.collisionCircleArrays[t]=new Ae);for(let t=0;t<B.circles.length;t+=4)e.circles.push(B.circles[t+0]),e.circles.push(B.circles[t+1]),e.circles.push(B.circles[t+2]),e.circles.push(B.collisionDetected?1:0)}const q="globe"!==o.projection.name;S=S&&(q||!L),M=M&&(q||!D),this.placements[E]=new we(I||S,C||M,P||o.justReloaded),i.add(E)};if(E){const t=o.getSortedSymbolIndexes(this.transform.angle);for(let e=t.length-1;e>=0;--e){const i=t[e];T(o.symbolInstances.get(i),i,o.collisionArrays[i])}}else for(let t=e.symbolInstanceStart;t<e.symbolInstanceEnd;t++)T(o.symbolInstances.get(t),t,o.collisionArrays[t]);if(n&&o.bucketInstanceId in this.collisionCircleArrays){const e=this.collisionCircleArrays[o.bucketInstanceId];t.invert(e.invProjMatrix,a),e.viewportMatrix=this.collisionIndex.getViewportMatrix()}o.justReloaded=!1}markUsedJustification(e,i,n,r){const{leftJustifiedTextSymbolIndex:o,centerJustifiedTextSymbolIndex:s,rightJustifiedTextSymbolIndex:a,verticalPlacedTextSymbolIndex:l,crossTileID:c}=n,u=t.getAnchorJustification(i),h=r===t.WritingMode.vertical?l:"left"===u?o:"center"===u?s:"right"===u?a:-1;o>=0&&(e.text.placedSymbolArray.get(o).crossTileID=h>=0&&o!==h?0:c),s>=0&&(e.text.placedSymbolArray.get(s).crossTileID=h>=0&&s!==h?0:c),a>=0&&(e.text.placedSymbolArray.get(a).crossTileID=h>=0&&a!==h?0:c),l>=0&&(e.text.placedSymbolArray.get(l).crossTileID=h>=0&&l!==h?0:c)}markUsedOrientation(e,i,n){const r=i===t.WritingMode.horizontal||i===t.WritingMode.horizontalOnly?i:0,o=i===t.WritingMode.vertical?i:0,{leftJustifiedTextSymbolIndex:s,centerJustifiedTextSymbolIndex:a,rightJustifiedTextSymbolIndex:l,verticalPlacedTextSymbolIndex:c}=n,u=e.text.placedSymbolArray;s>=0&&(u.get(s).placedOrientation=r),a>=0&&(u.get(a).placedOrientation=r),l>=0&&(u.get(l).placedOrientation=r),c>=0&&(u.get(c).placedOrientation=o)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const e=this.prevPlacement;let i=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;const n=e?e.symbolFadeChange(t):1,r=e?e.opacities:{},o=e?e.variableOffsets:{},s=e?e.placedOrientations:{};for(const t in this.placements){const e=this.placements[t],o=r[t];o?(this.opacities[t]=new be(o,n,e.text,e.icon,null,e.clipped),i=i||e.text!==o.text.placed||e.icon!==o.icon.placed):(this.opacities[t]=new be(null,n,e.text,e.icon,e.skipFade,e.clipped),i=i||e.text||e.icon)}for(const t in r){const e=r[t];if(!this.opacities[t]){const r=new be(e,n,!1,!1);r.isHidden()||(this.opacities[t]=r,i=i||e.text.placed||e.icon.placed)}}for(const t in o)this.variableOffsets[t]||!this.opacities[t]||this.opacities[t].isHidden()||(this.variableOffsets[t]=o[t]);for(const t in s)this.placedOrientations[t]||!this.opacities[t]||this.opacities[t].isHidden()||(this.placedOrientations[t]=s[t]);i?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)}updateLayerOpacities(t,e){const i=new Set;for(const n of e){const e=n.getBucket(t);e&&n.latestFeatureIndex&&t.id===e.layerIds[0]&&this.updateBucketOpacities(e,i,n.collisionBoxArray)}}updateBucketOpacities(e,i,n){e.hasTextData()&&e.text.opacityVertexArray.clear(),e.hasIconData()&&e.icon.opacityVertexArray.clear(),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();const r=e.layers[0].layout,o=!!e.layers[0].dynamicFilter(),s=new be(null,0,!1,!1,!0),a=r.get("text-allow-overlap"),l=r.get("icon-allow-overlap"),c=r.get("text-variable-anchor"),u="map"===r.get("text-rotation-alignment"),h="map"===r.get("text-pitch-alignment"),p="none"!==r.get("icon-text-fit"),d=new be(null,0,a&&(l||!e.hasIconData()||r.get("icon-optional")),l&&(a||!e.hasTextData()||r.get("text-optional")),!0);!e.collisionArrays&&n&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(n);const f=(t,e,i)=>{for(let n=0;n<e/4;n++)t.opacityVertexArray.emplaceBack(i)};let m=0;for(let n=0;n<e.symbolInstances.length;n++){const r=e.symbolInstances.get(n),{numHorizontalGlyphVertices:a,numVerticalGlyphVertices:l,crossTileID:g,numIconVertices:y}=r,v=i.has(g);let _=this.opacities[g];v?_=s:_||(_=d,this.opacities[g]=_),i.add(g);const x=a>0||l>0,b=y>0,w=this.placedOrientations[g],A=w===t.WritingMode.vertical,E=w===t.WritingMode.horizontal||w===t.WritingMode.horizontalOnly;if(!x&&!b||_.isHidden()||m++,x){const t=Be(_.text);f(e.text,a,A?ze:t),f(e.text,l,E?ze:t);const i=_.text.isHidden(),{leftJustifiedTextSymbolIndex:n,centerJustifiedTextSymbolIndex:o,rightJustifiedTextSymbolIndex:s,verticalPlacedTextSymbolIndex:c}=r,u=e.text.placedSymbolArray,h=i||A?1:0;n>=0&&(u.get(n).hidden=h),o>=0&&(u.get(o).hidden=h),s>=0&&(u.get(s).hidden=h),c>=0&&(u.get(c).hidden=i||E?1:0);const p=this.variableOffsets[g];p&&this.markUsedJustification(e,p.anchor,r,w);const d=this.placedOrientations[g];d&&(this.markUsedJustification(e,"left",r,d),this.markUsedOrientation(e,d,r))}if(b){const t=Be(_.icon),{placedIconSymbolIndex:i,verticalPlacedIconSymbolIndex:n}=r,o=e.icon.placedSymbolArray,s=_.icon.isHidden()?1:0;i>=0&&(f(e.icon,y,A?ze:t),o.get(i).hidden=s),n>=0&&(f(e.icon,r.numVerticalIconVertices,E?ze:t),o.get(n).hidden=s)}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){const i=e.collisionArrays[n];if(i){let n=new t.Point(0,0),r=!0;if(i.textBox||i.verticalTextBox){if(c){const t=this.variableOffsets[g];t?(n=Me(t.anchor,t.width,t.height,t.textOffset,t.textScale),u&&n._rotate(h?this.transform.angle:-this.transform.angle)):r=!1}o&&(r=!_.clipped),i.textBox&&Ce(e.textCollisionBox.collisionVertexArray,_.text.placed,!r||A,n.x,n.y),i.verticalTextBox&&Ce(e.textCollisionBox.collisionVertexArray,_.text.placed,!r||E,n.x,n.y)}const s=r&&Boolean(!E&&i.verticalIconBox);i.iconBox&&Ce(e.iconCollisionBox.collisionVertexArray,_.icon.placed,s,p?n.x:0,p?n.y:0),i.verticalIconBox&&Ce(e.iconCollisionBox.collisionVertexArray,_.icon.placed,!s,p?n.x:0,p?n.y:0)}}}if(e.fullyClipped=0===m,e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.bucketInstanceId in this.collisionCircleArrays){const t=this.collisionCircleArrays[e.bucketInstanceId];e.placementInvProjMatrix=t.invProjMatrix,e.placementViewportMatrix=t.viewportMatrix,e.collisionCircleArray=t.circles,delete this.collisionCircleArrays[e.bucketInstanceId]}}symbolFadeChange(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(t,e){const i=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*i>t}setStale(){this.stale=!0}}function Ce(t,e,i,n,r){t.emplaceBack(e?1:0,i?1:0,n||0,r||0),t.emplaceBack(e?1:0,i?1:0,n||0,r||0),t.emplaceBack(e?1:0,i?1:0,n||0,r||0),t.emplaceBack(e?1:0,i?1:0,n||0,r||0)}const Pe=Math.pow(2,25),Le=Math.pow(2,24),De=Math.pow(2,17),Re=Math.pow(2,16),Oe=Math.pow(2,9),ke=Math.pow(2,8),Ne=Math.pow(2,1);function Be(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;const e=t.placed?1:0,i=Math.floor(127*t.opacity);return i*Pe+e*Le+i*De+e*Re+i*Oe+e*ke+i*Ne+e}const ze=0;class Fe{constructor(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(t,e,i,n,r){const o=this._bucketParts;for(;this._currentTileIndex<t.length;)if(e.getBucketParts(o,n,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,r())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,o.sort(((t,e)=>t.sortKey-e.sortKey)));this._currentPartIndex<o.length;){const t=o[this._currentPartIndex];if(e.placeLayerBucketPart(t,this._seenCrossTileIDs,i,0===t.symbolInstanceStart),this._currentPartIndex++,r())return!0}return!1}}class Ve{constructor(t,e,i,n,r,o,s,a){this.placement=new Ie(t,r,o,s,a),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=i,this._showCollisionBoxes=n,this._done=!1}isDone(){return this._done}continuePlacement(e,i,n){const r=t.exported.now(),o=()=>{const e=t.exported.now()-r;return!this._forceFullPlacement&&e>2};for(;this._currentPlacementIndex>=0;){const t=i[e[this._currentPlacementIndex]],r=this.placement.collisionIndex.transform.zoom;if("symbol"===t.type&&(!t.minzoom||t.minzoom<=r)&&(!t.maxzoom||t.maxzoom>r)){if(this._inProgressLayer||(this._inProgressLayer=new Fe(t)),this._inProgressLayer.continuePlacement(n[t.source],this.placement,this._showCollisionBoxes,t,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const Ue=512/t.EXTENT/2;class Ge{constructor(e,i,n){this.tileID=e,this.bucketInstanceId=n,this.index=new t.KDBush(i.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const r=e.canonical.x*t.EXTENT,o=e.canonical.y*t.EXTENT;for(let t=0;t<i.length;t++){const{key:e,crossTileID:n,tileAnchorX:s,tileAnchorY:a}=i.get(t),l=Math.floor((r+s)*Ue),c=Math.floor((o+a)*Ue);this.index.add(l,c),this.keys.push(e),this.crossTileIDs.push(n)}this.index.finish()}findMatches(e,i,n){const r=this.tileID.canonical.z<i.canonical.z?1:Math.pow(2,this.tileID.canonical.z-i.canonical.z),o=Ue/Math.pow(2,i.canonical.z-this.tileID.canonical.z),s=i.canonical.x*t.EXTENT,a=i.canonical.y*t.EXTENT;for(let t=0;t<e.length;t++){const i=e.get(t);if(i.crossTileID)continue;const{key:l,tileAnchorX:c,tileAnchorY:u}=i,h=Math.floor((s+c)*o),p=Math.floor((a+u)*o),d=this.index.range(h-r,p-r,h+r,p+r);for(const t of d){const e=this.crossTileIDs[t];if(this.keys[t]===l&&!n.has(e)){n.add(e),i.crossTileID=e;break}}}}}class je{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class He{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const e=Math.round((t-this.lng)/360);if(0!==e)for(const t in this.indexes){const i=this.indexes[t],n={};for(const t in i){const r=i[t];r.tileID=r.tileID.unwrapTo(r.tileID.wrap+e),n[r.tileID.key]=r}this.indexes[t]=n}this.lng=t}addBucket(t,e,i){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let t=0;t<e.symbolInstances.length;t++)e.symbolInstances.get(t).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]=new Set);const n=this.usedCrossTileIDs[t.overscaledZ];for(const i in this.indexes){const r=this.indexes[i];if(Number(i)>t.overscaledZ)for(const i in r){const o=r[i];o.tileID.isChildOf(t)&&o.findMatches(e.symbolInstances,t,n)}else{const o=r[t.scaledTo(Number(i)).key];o&&o.findMatches(e.symbolInstances,t,n)}}for(let t=0;t<e.symbolInstances.length;t++){const r=e.symbolInstances.get(t);r.crossTileID||(r.crossTileID=i.generate(),n.add(r.crossTileID))}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new Ge(t,e.symbolInstances,e.bucketInstanceId),!0}removeBucketCrossTileIDs(t,e){for(const i of e.crossTileIDs)this.usedCrossTileIDs[t].delete(i)}removeStaleBuckets(t){let e=!1;for(const i in this.indexes){const n=this.indexes[i];for(const r in n)t[n[r].bucketInstanceId]||(this.removeBucketCrossTileIDs(i,n[r]),delete n[r],e=!0)}return e}}class We{constructor(){this.layerIndexes={},this.crossTileIDs=new je,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(t,e,i,n){let r=this.layerIndexes[t.id];void 0===r&&(r=this.layerIndexes[t.id]=new He);let o=!1;const s={};"globe"!==n.name&&r.handleWrapJump(i);for(const i of e){const e=i.getBucket(t);e&&t.id===e.layerIds[0]&&(e.bucketInstanceId||(e.bucketInstanceId=++this.maxBucketInstanceId),r.addBucket(i.tileID,e,this.crossTileIDs)&&(o=!0),s[e.bucketInstanceId]=!0)}return r.removeStaleBuckets(s)&&(o=!0),o}pruneUnusedLayers(t){const e={};t.forEach((t=>{e[t]=!0}));for(const t in this.layerIndexes)e[t]||delete this.layerIndexes[t]}}const qe=(e,i)=>t.emitValidationErrors(e,i&&i.filter((t=>"source.canvas"!==t.identifier))),Xe=t.pick(Gt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setProjection"]),Ze=t.pick(Gt,["setCenter","setZoom","setBearing","setPitch"]),Ye={version:8,layers:[],sources:{}},Qe={fill:!0,line:!0,background:!0,hillshade:!0,raster:!0};class Je extends t.Evented{constructor(e,i={}){super(),this.map=e,this.dispatcher=new C(Ft(),this),this.imageManager=new x,this.imageManager.setEventedParent(this),this.glyphManager=new t.GlyphManager(e._requestManager,i.localFontFamily?t.LocalGlyphMode.all:i.localIdeographFontFamily?t.LocalGlyphMode.ideographs:t.LocalGlyphMode.none,i.localFontFamily||i.localIdeographFontFamily),this.crossTileSymbolIndex=new We,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",t.getReferrer());const n=this;this._rtlTextPluginCallback=Je.registerForPluginStateChange((e=>{n.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:e.pluginStatus,pluginURL:e.pluginURL},((e,i)=>{if(t.triggerPluginCompletionEvent(e),i&&i.every((t=>t)))for(const t in n._sourceCaches){const e=n._sourceCaches[t],i=e.getSource().type;"vector"!==i&&"geojson"!==i||e.reload()}}))})),this.on("data",(t=>{if("source"!==t.dataType||"metadata"!==t.sourceDataType)return;const e=this.getSource(t.sourceId);if(e&&e.vectorLayerIds)for(const t in this._layers){const i=this._layers[t];i.source===e.id&&this._validateLayer(i)}}))}loadURL(e,i={}){this.fire(new t.Event("dataloading",{dataType:"style"}));const n="boolean"==typeof i.validate?i.validate:!t.isMapboxURL(e);e=this.map._requestManager.normalizeStyleURL(e,i.accessToken);const r=this.map._requestManager.transformRequest(e,t.ResourceType.Style);this._request=t.getJSON(r,((e,i)=>{this._request=null,e?this.fire(new t.ErrorEvent(e)):i&&this._load(i,n)}))}loadJSON(e,i={}){this.fire(new t.Event("dataloading",{dataType:"style"})),this._request=t.exported.frame((()=>{this._request=null,this._load(e,!1!==i.validate)}))}loadEmpty(){this.fire(new t.Event("dataloading",{dataType:"style"})),this._load(Ye,!1)}_updateLayerCount(t,e){const i=e?1:-1;t.is3D()&&(this._num3DLayers+=i),"circle"===t.type&&(this._numCircleLayers+=i),"symbol"===t.type&&(this._numSymbolLayers+=i)}_load(e,i){if(i&&qe(this,t.validateStyle(e)))return;this._loaded=!0,this.stylesheet=t.clone$1(e),this._updateMapProjection();for(const t in e.sources)this.addSource(t,e.sources[t],{validate:!1});this._changed=!1,e.sprite?this._loadSprite(e.sprite):(this.imageManager.setLoaded(!0),this.dispatcher.broadcast("spriteLoaded",!0)),this.glyphManager.setURL(e.glyphs);const n=Ut(this.stylesheet.layers);this._order=n.map((t=>t.id)),this._layers={},this._serializedLayers={};for(const e of n){const i=t.createStyleLayer(e);i.setEventedParent(this,{layer:{id:i.id}}),this._layers[i.id]=i,this._serializedLayers[i.id]=i.serialize(),this._updateLayerCount(i,!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 t.Event("data",{dataType:"style"})),this.fire(new t.Event("style.load"))}terrainSetForDrapingOnly(){return!!this.terrain&&0===this.terrain.drapeRenderMode}setProjection(t){t?this.stylesheet.projection=t: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(e){this._spriteRequest=function(e,i,n){let r,o,s;const a=t.exported.devicePixelRatio>1?"@2x":"";let l=t.getJSON(i.transformRequest(i.normalizeSpriteURL(e,a,".json"),t.ResourceType.SpriteJSON),((t,e)=>{l=null,s||(s=t,r=e,u())})),c=t.getImage(i.transformRequest(i.normalizeSpriteURL(e,a,".png"),t.ResourceType.SpriteImage),((t,e)=>{c=null,s||(s=t,o=e,u())}));function u(){if(s)n(s);else if(r&&o){const e=t.exported.getImageData(o),i={};for(const n in r){const{width:o,height:s,x:a,y:l,sdf:c,pixelRatio:u,stretchX:h,stretchY:p,content:d}=r[n],f=new t.RGBAImage({width:o,height:s});t.RGBAImage.copy(e,f,{x:a,y:l},{x:0,y:0},{width:o,height:s}),i[n]={data:f,pixelRatio:u,sdf:c,stretchX:h,stretchY:p,content:d}}n(null,i)}}return{cancel(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null)}}}(e,this.map._requestManager,((e,i)=>{if(this._spriteRequest=null,e)this.fire(new t.ErrorEvent(e));else if(i)for(const t in i)this.imageManager.addImage(t,i[t]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.dispatcher.broadcast("spriteLoaded",!0),this.fire(new t.Event("data",{dataType:"style"}))}))}_validateLayer(e){const i=this.getSource(e.source);if(!i)return;const n=e.sourceLayer;n&&("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new t.ErrorEvent(new Error(`Source layer "${n}" does not exist on source "${i.id}" as specified by style layer "${e.id}"`)))}loaded(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(const t in this._sourceCaches)if(!this._sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(t){const e=[];for(const i of t){const t=this._layers[i];"custom"!==t.type&&e.push(t.serialize())}return e}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;if(this.fog&&this.fog.hasTransition())return!0;for(const t in this._sourceCaches)if(this._sourceCaches[t].hasTransition())return!0;for(const t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}get order(){return this.map._optimizeForTerrain&&this.terrain?this._drapedFirstOrder:this._order}isLayerDraped(t){return!!this.terrain&&("function"==typeof t.isLayerDraped?t.isLayerDraped():Qe[t.type])}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}update(e){if(!this._loaded)return;const i=this._changed;if(this._changed){const t=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);(t.length||i.length)&&this._updateWorkerLayers(t,i);for(const t in this._updatedSources){const e=this._updatedSources[t];"reload"===e?this._reloadSource(t):"clear"===e&&this._clearSource(t)}this._updateTilesForChangedImages();for(const t in this._updatedPaintProps)this._layers[t].updateTransitions(e);this.light.updateTransitions(e),this.fog&&this.fog.updateTransitions(e),this._resetUpdates()}const n={};for(const t in this._sourceCaches){const e=this._sourceCaches[t];n[t]=e.used,e.used=!1}for(const t of this._order){const i=this._layers[t];if(i.recalculate(e,this._availableImages),!i.isHidden(e.zoom)){const t=this._getLayerSourceCache(i);t&&(t.used=!0)}const n=this.map.painter;if(n){const t=i.getProgramIds();if(!t)continue;const r=i.getProgramConfiguration(e.zoom);for(const e of t)n.useProgram(e,r)}}for(const e in n){const i=this._sourceCaches[e];n[e]!==i.used&&i.getSource().fire(new t.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:i.getSource().id}))}this.light.recalculate(e),this.terrain&&this.terrain.recalculate(e),this.fog&&this.fog.recalculate(e),this.z=e.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),i&&this.fire(new t.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const e in this._sourceCaches)this._sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateWorkerLayers(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setState(i){if(this._checkLoaded(),qe(this,t.validateStyle(i)))return!1;(i=t.clone$1(i)).layers=Ut(i.layers);const n=function(t,i){if(!t)return[{command:Gt.setStyle,args:[i]}];let n=[];try{if(!e(t.version,i.version))return[{command:Gt.setStyle,args:[i]}];e(t.center,i.center)||n.push({command:Gt.setCenter,args:[i.center]}),e(t.zoom,i.zoom)||n.push({command:Gt.setZoom,args:[i.zoom]}),e(t.bearing,i.bearing)||n.push({command:Gt.setBearing,args:[i.bearing]}),e(t.pitch,i.pitch)||n.push({command:Gt.setPitch,args:[i.pitch]}),e(t.sprite,i.sprite)||n.push({command:Gt.setSprite,args:[i.sprite]}),e(t.glyphs,i.glyphs)||n.push({command:Gt.setGlyphs,args:[i.glyphs]}),e(t.transition,i.transition)||n.push({command:Gt.setTransition,args:[i.transition]}),e(t.light,i.light)||n.push({command:Gt.setLight,args:[i.light]}),e(t.fog,i.fog)||n.push({command:Gt.setFog,args:[i.fog]}),e(t.projection,i.projection)||n.push({command:Gt.setProjection,args:[i.projection]});const r={},o=[];!function(t,i,n,r){let o;for(o in i=i||{},t=t||{})t.hasOwnProperty(o)&&(i.hasOwnProperty(o)||Ht(o,n,r));for(o in i){if(!i.hasOwnProperty(o))continue;const s=i[o];t.hasOwnProperty(o)?e(t[o],s)||("geojson"===t[o].type&&"geojson"===s.type&&qt(t,i,o)?n.push({command:Gt.setGeoJSONSourceData,args:[o,s.data]}):Wt(o,i,n,r)):jt(o,i,n)}}(t.sources,i.sources,o,r);const s=[];t.layers&&t.layers.forEach((t=>{t.source&&r[t.source]?n.push({command:Gt.removeLayer,args:[t.id]}):s.push(t)}));let a=t.terrain;a&&r[a.source]&&(n.push({command:Gt.setTerrain,args:[void 0]}),a=void 0),n=n.concat(o),e(a,i.terrain)||n.push({command:Gt.setTerrain,args:[i.terrain]}),function(t,i,n){i=i||[];const r=(t=t||[]).map(Zt),o=i.map(Zt),s=t.reduce(Yt,{}),a=i.reduce(Yt,{}),l=r.slice(),c=Object.create(null);let u,h,p,d,f,m,g;for(u=0,h=0;u<r.length;u++)p=r[u],a.hasOwnProperty(p)?h++:(n.push({command:Gt.removeLayer,args:[p]}),l.splice(l.indexOf(p,h),1));for(u=0,h=0;u<o.length;u++)p=o[o.length-1-u],l[l.length-1-u]!==p&&(s.hasOwnProperty(p)?(n.push({command:Gt.removeLayer,args:[p]}),l.splice(l.lastIndexOf(p,l.length-h),1)):h++,m=l[l.length-u],n.push({command:Gt.addLayer,args:[a[p],m]}),l.splice(l.length-u,0,p),c[p]=!0);for(u=0;u<o.length;u++)if(p=o[u],d=s[p],f=a[p],!c[p]&&!e(d,f))if(e(d.source,f.source)&&e(d["source-layer"],f["source-layer"])&&e(d.type,f.type)){for(g in Xt(d.layout,f.layout,n,p,null,Gt.setLayoutProperty),Xt(d.paint,f.paint,n,p,null,Gt.setPaintProperty),e(d.filter,f.filter)||n.push({command:Gt.setFilter,args:[p,f.filter]}),e(d.minzoom,f.minzoom)&&e(d.maxzoom,f.maxzoom)||n.push({command:Gt.setLayerZoomRange,args:[p,f.minzoom,f.maxzoom]}),d)d.hasOwnProperty(g)&&"layout"!==g&&"paint"!==g&&"filter"!==g&&"metadata"!==g&&"minzoom"!==g&&"maxzoom"!==g&&(0===g.indexOf("paint.")?Xt(d[g],f[g],n,p,g.slice(6),Gt.setPaintProperty):e(d[g],f[g])||n.push({command:Gt.setLayerProperty,args:[p,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.")?Xt(d[g],f[g],n,p,g.slice(6),Gt.setPaintProperty):e(d[g],f[g])||n.push({command:Gt.setLayerProperty,args:[p,g,f[g]]}))}else n.push({command:Gt.removeLayer,args:[p]}),m=l[l.lastIndexOf(p)+1],n.push({command:Gt.addLayer,args:[f,m]})}(s,i.layers,n)}catch(t){console.warn("Unable to compute style diff:",t),n=[{command:Gt.setStyle,args:[i]}]}return n}(this.serialize(),i).filter((t=>!(t.command in Ze)));if(0===n.length)return!1;const r=n.filter((t=>!(t.command in Xe)));if(r.length>0)throw new Error(`Unimplemented: ${r.map((t=>t.command)).join(", ")}.`);return n.forEach((t=>{"setTransition"!==t.command&&"setProjection"!==t.command&&this[t.command].apply(this,t.args)})),this.stylesheet=i,this._updateMapProjection(),!0}addImage(e,i){return this.getImage(e)?this.fire(new t.ErrorEvent(new Error("An image with this name already exists."))):(this.imageManager.addImage(e,i),this._afterImageUpdated(e),this)}updateImage(t,e){this.imageManager.updateImage(t,e)}getImage(t){return this.imageManager.getImage(t)}removeImage(e){return this.getImage(e)?(this.imageManager.removeImage(e),this._afterImageUpdated(e),this):this.fire(new t.ErrorEvent(new Error("No image with this name exists.")))}_afterImageUpdated(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addSource(e,i,n={}){if(this._checkLoaded(),void 0!==this.getSource(e))throw new Error("There is already a source with this ID");if(!i.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(i).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(i.type)>=0&&this._validate(t.validateSource,`sources.${e}`,i,null,n))return;this.map&&this.map._collectResourceTiming&&(i.collectResourceTiming=!0);const r=Pt(e,i,this.dispatcher,this);r.setEventedParent(this,(()=>({isSourceLoaded:this._isSourceCacheLoaded(e),source:r.serialize(),sourceId:e})));const o=i=>{const n=(i?"symbol:":"other:")+e,o=this._sourceCaches[n]=new t.SourceCache(n,r,i);(i?this._symbolSourceCaches:this._otherSourceCaches)[e]=o,o.style=this,o.onAdd(this.map)};o(!1),"vector"!==i.type&&"geojson"!==i.type||o(!0),r.onAdd&&r.onAdd(this.map),this._changed=!0}removeSource(e){this._checkLoaded();const i=this.getSource(e);if(!i)throw new Error("There is no source with this ID");for(const i in this._layers)if(this._layers[i].source===e)return this.fire(new t.ErrorEvent(new Error(`Source "${e}" cannot be removed while layer "${i}" is using it.`)));if(this.terrain&&this.terrain.get().source===e)return this.fire(new t.ErrorEvent(new Error(`Source "${e}" cannot be removed while terrain is using it.`)));const n=this._getSourceCaches(e);for(const e of n)delete this._sourceCaches[e.id],delete this._updatedSources[e.id],e.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e.getSource().id})),e.setEventedParent(null),e.clearTiles();return delete this._otherSourceCaches[e],delete this._symbolSourceCaches[e],i.setEventedParent(null),i.onRemove&&i.onRemove(this.map),this._changed=!0,this}setGeoJSONSourceData(t,e){this._checkLoaded(),this.getSource(t).setData(e),this._changed=!0}getSource(t){const e=this._getSourceCache(t);return e&&e.getSource()}_getSources(){const t=[];for(const e in this._otherSourceCaches){const i=this._getSourceCache(e);i&&t.push(i.getSource())}return t}addLayer(e,i,n={}){this._checkLoaded();const r=e.id;if(this.getLayer(r))return void this.fire(new t.ErrorEvent(new Error(`Layer with id "${r}" already exists on this map`)));let o;if("custom"===e.type){if(qe(this,t.validateCustomStyleLayer(e)))return;o=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(r,e.source),e=t.clone$1(e),e=t.extend(e,{source:r})),this._validate(t.validateLayer,`layers.${r}`,e,{arrayIndex:-1},n))return;o=t.createStyleLayer(e),this._validateLayer(o),o.setEventedParent(this,{layer:{id:r}}),this._serializedLayers[o.id]=o.serialize(),this._updateLayerCount(o,!0)}const s=i?this._order.indexOf(i):this._order.length;if(i&&-1===s)return void this.fire(new t.ErrorEvent(new Error(`Layer with id "${i}" does not exist on this map.`)));this._order.splice(s,0,r),this._layerOrderChanged=!0,this._layers[r]=o;const a=this._getLayerSourceCache(o);if(this._removedLayers[r]&&o.source&&a&&"custom"!==o.type){const t=this._removedLayers[r];delete this._removedLayers[r],t.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",a.pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map),this._updateDrapeFirstLayers()}moveLayer(e,i){if(this._checkLoaded(),this._changed=!0,!this._layers[e])return void this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style and cannot be moved.`)));if(e===i)return;const n=this._order.indexOf(e);this._order.splice(n,1);const r=i?this._order.indexOf(i):this._order.length;i&&-1===r?this.fire(new t.ErrorEvent(new Error(`Layer with id "${i}" does not exist on this map.`))):(this._order.splice(r,0,e),this._layerOrderChanged=!0,this._updateDrapeFirstLayers())}removeLayer(e){this._checkLoaded();const i=this._layers[e];if(!i)return void this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style and cannot be removed.`)));i.setEventedParent(null),this._updateLayerCount(i,!1);const n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=i,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],i.onRemove&&i.onRemove(this.map),this._updateDrapeFirstLayers()}getLayer(t){return this._layers[t]}hasLayer(t){return t in this._layers}hasLayerType(t){for(const e in this._layers)if(this._layers[e].type===t)return!0;return!1}setLayerZoomRange(e,i,n){this._checkLoaded();const r=this.getLayer(e);r?r.minzoom===i&&r.maxzoom===n||(null!=i&&(r.minzoom=i),null!=n&&(r.maxzoom=n),this._updateLayer(r)):this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style and cannot have zoom extent.`)))}setFilter(i,n,r={}){this._checkLoaded();const o=this.getLayer(i);if(o){if(!e(o.filter,n))return null==n?(o.filter=void 0,void this._updateLayer(o)):void(this._validate(t.validateFilter,`layers.${o.id}.filter`,n,{layerType:o.type},r)||(o.filter=t.clone$1(n),this._updateLayer(o)))}else this.fire(new t.ErrorEvent(new Error(`The layer '${i}' does not exist in the map's style and cannot be filtered.`)))}getFilter(e){const i=this.getLayer(e);return i&&t.clone$1(i.filter)}setLayoutProperty(i,n,r,o={}){this._checkLoaded();const s=this.getLayer(i);s?e(s.getLayoutProperty(n),r)||(s.setLayoutProperty(n,r,o),this._updateLayer(s)):this.fire(new t.ErrorEvent(new Error(`The layer '${i}' does not exist in the map's style and cannot be styled.`)))}getLayoutProperty(e,i){const n=this.getLayer(e);if(n)return n.getLayoutProperty(i);this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style.`)))}setPaintProperty(i,n,r,o={}){this._checkLoaded();const s=this.getLayer(i);s?e(s.getPaintProperty(n),r)||(s.setPaintProperty(n,r,o)&&this._updateLayer(s),this._changed=!0,this._updatedPaintProps[i]=!0):this.fire(new t.ErrorEvent(new Error(`The layer '${i}' does not exist in the map's style and cannot be styled.`)))}getPaintProperty(t,e){const i=this.getLayer(t);return i&&i.getPaintProperty(e)}setFeatureState(e,i){this._checkLoaded();const n=e.source,r=e.sourceLayer,o=this.getSource(n);if(!o)return void this.fire(new t.ErrorEvent(new Error(`The source '${n}' does not exist in the map's style.`)));const s=o.type;if("geojson"===s&&r)return void this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if("vector"===s&&!r)return void this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided.")));const a=this._getSourceCaches(n);for(const t of a)t.setFeatureState(r,e.id,i)}removeFeatureState(e,i){this._checkLoaded();const n=e.source,r=this.getSource(n);if(!r)return void this.fire(new t.ErrorEvent(new Error(`The source '${n}' does not exist in the map's style.`)));const o=r.type,s="vector"===o?e.sourceLayer:void 0;if("vector"===o&&!s)return void this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));if(i&&"string"!=typeof e.id&&"number"!=typeof e.id)return void this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));const a=this._getSourceCaches(n);for(const t of a)t.removeFeatureState(s,e.id,i)}getFeatureState(e){this._checkLoaded();const i=e.source,n=e.sourceLayer,r=this.getSource(i);if(r){if("vector"!==r.type||n)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),this._getSourceCaches(i)[0].getFeatureState(n,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error(`The source '${i}' does not exist in the map's style.`)))}getTransition(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){const e={};for(const t in this._sourceCaches){const i=this._sourceCaches[t].getSource();e[i.id]||(e[i.id]=i.serialize())}return t.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:e,layers:this._serializeLayers(this._order)},(t=>void 0!==t))}_updateLayer(t){this._updatedLayers[t.id]=!0;const e=this._getLayerSourceCache(t);t.source&&!this._updatedSources[t.source]&&e&&"raster"!==e.getSource().type&&(this._updatedSources[t.source]="reload",e.pause()),this._changed=!0,t.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(t){const e=t=>"fill-extrusion"===this._layers[t].type,i={},n=[];for(let r=this._order.length-1;r>=0;r--){const o=this._order[r];if(e(o)){i[o]=r;for(const e of t){const t=e[o];if(t)for(const e of t)n.push(e)}}}n.sort(((t,e)=>e.intersectionZ-t.intersectionZ));const r=[];for(let o=this._order.length-1;o>=0;o--){const s=this._order[o];if(e(s))for(let t=n.length-1;t>=0;t--){const e=n[t].feature;if(i[e.layer.id]<o)break;r.push(e),n.pop()}else for(const e of t){const t=e[s];if(t)for(const e of t)r.push(e.feature)}}return r}queryRenderedFeatures(e,i,n){i&&i.filter&&this._validate(t.validateFilter,"queryRenderedFeatures.filter",i.filter,null,i);const r={};if(i&&i.layers){if(!Array.isArray(i.layers))return this.fire(new t.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(const e of i.layers){const i=this._layers[e];if(!i)return this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style and cannot be queried for features.`))),[];r[i.source]=!0}}const o=[];i.availableImages=this._availableImages;const s=i&&i.layers?i.layers.some((t=>{const e=this.getLayer(t);return e&&e.is3D()})):this.has3DLayers(),a=L.createFromScreenPoints(e,n);for(const t in this._sourceCaches){const e=this._sourceCaches[t].getSource().id;i.layers&&!r[e]||o.push(Dt(this._sourceCaches[t],this._layers,this._serializedLayers,a,i,n,s,!!this.map._showQueryGeometry))}return this.placement&&o.push(function(t,e,i,n,r,o,s){const a={},l=o.queryRenderedSymbols(n),c=[];for(const t of Object.keys(l).map(Number))c.push(s[t]);c.sort(Ot);for(const i of c){const n=i.featureIndex.lookupSymbolFeatures(l[i.bucketInstanceId],e,i.bucketIndex,i.sourceLayerIndex,r.filter,r.layers,r.availableImages,t);for(const t in n){const e=a[t]=a[t]||[],r=n[t];r.sort(((t,e)=>{const n=i.featureSortOrder;if(n){const i=n.indexOf(t.featureIndex);return n.indexOf(e.featureIndex)-i}return e.featureIndex-t.featureIndex}));for(const t of r)e.push(t)}}for(const e in a)a[e].forEach((n=>{const r=n.feature,o=i(t[e]);if(!o)return;const s=o.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=s}));return a}(this._layers,this._serializedLayers,this._getLayerSourceCache.bind(this),a.screenGeometry,i,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(o)}querySourceFeatures(e,i){i&&i.filter&&this._validate(t.validateFilter,"querySourceFeatures.filter",i.filter,null,i);const n=this._getSourceCaches(e);let r=[];for(const t of n)r=r.concat(Rt(t,i));return r}addSourceType(t,e,i){return Je.getSourceType(t)?i(new Error(`A source type called "${t}" already exists.`)):(Je.setSourceType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},i):i(null,null))}getLight(){return this.light.getLight()}setLight(t,i={}){this._checkLoaded();const n=this.light.getLight();let r=!1;for(const i in t)if(!e(t[i],n[i])){r=!0;break}if(!r)return;const o=this._setTransitionParameters({duration:300,delay:0});this.light.setLight(t,i),this.light.updateTransitions(o)}getTerrain(){return this.terrain&&1===this.terrain.drapeRenderMode?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}setTerrain(i,n=1){if(this._checkLoaded(),!i)return delete this.terrain,delete this.stylesheet.terrain,this.dispatcher.broadcast("enableTerrain",!1),this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);let r=i;if(1===n){if("object"==typeof r.source){const e="terrain-dem-src";this.addSource(e,r.source),r=t.clone$1(r),r=t.extend(r,{source:e})}if(this._validate(t.validateTerrain,"terrain",r))return}if(!this.terrain||this.terrain&&n!==this.terrain.drapeRenderMode){if(!r)return;this._createTerrain(r,n)}else{const i=this.terrain,n=i.get();for(const e of Object.keys(t.spec.terrain))!r.hasOwnProperty(e)&&t.spec.terrain[e].default&&(r[e]=t.spec.terrain[e].default);for(const t in r)if(!e(r[t],n[t])){i.set(r),this.stylesheet.terrain=r;const t=this._setTransitionParameters({duration:0});i.updateTransitions(t);break}}this._updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(t){const e=this.fog=new I(t,this.map.transform);this.stylesheet.fog=t;const i=this._setTransitionParameters({duration:0});e.updateTransitions(i)}_updateMarkersOpacity(){0!==this.map._markers.length&&this.map._requestDomTask((()=>{for(const t of this.map._markers)t._evaluateOpacity()}))}getFog(){return this.fog?this.fog.get():null}setFog(t){if(this._checkLoaded(),!t)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const i=this.fog,n=i.get();0===Object.keys(t).length&&i.set(t);for(const r in t)if(!e(t[r],n[r])){i.set(t),this.stylesheet.fog=t;const e=this._setTransitionParameters({duration:0});i.updateTransitions(e);break}}else this._createFog(t);this._markersNeedUpdate=!0}_setTransitionParameters(e){return{now:t.exported.now(),transition:t.extend(e,this.stylesheet.transition)}}_updateDrapeFirstLayers(){if(!this.map._optimizeForTerrain||!this.terrain)return;const t=this._order.filter((t=>this.isLayerDraped(this._layers[t]))),e=this._order.filter((t=>!this.isLayerDraped(this._layers[t])));this._drapedFirstOrder=[],this._drapedFirstOrder.push(...t),this._drapedFirstOrder.push(...e)}_createTerrain(t,e){const i=this.terrain=new E(t,e);this.stylesheet.terrain=t,this.dispatcher.broadcast("enableTerrain",!this.terrainSetForDrapingOnly()),this._force3DLayerUpdate();const n=this._setTransitionParameters({duration:0});i.updateTransitions(n)}_force3DLayerUpdate(){for(const t in this._layers){const e=this._layers[t];"fill-extrusion"===e.type&&this._updateLayer(e)}}_forceSymbolLayerUpdate(){for(const t in this._layers){const e=this._layers[t];"symbol"===e.type&&this._updateLayer(e)}}_validate(e,i,n,r,o={}){return(!o||!1!==o.validate)&&qe(this,e.call(t.validateStyle,t.extend({key:i,style:this.serialize(),value:n,styleSpec:t.spec},r)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),t.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(const t in this._layers)this._layers[t].setEventedParent(null);for(const t in this._sourceCaches)this._sourceCaches[t].clearTiles(),this._sourceCaches[t].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}_clearSource(t){const e=this._getSourceCaches(t);for(const t of e)t.clearTiles()}_reloadSource(t){const e=this._getSourceCaches(t);for(const t of e)t.resume(),t.reload()}_reloadSources(){for(const t of this._getSources())t.reload&&t.reload()}_updateSources(t){for(const e in this._sourceCaches)this._sourceCaches[e].update(t)}_generateCollisionBoxes(){for(const t in this._sourceCaches){const e=this._sourceCaches[t];e.resume(),e.reload()}}_updatePlacement(e,i,n,r,o=!1){let s=!1,a=!1;const l={};for(const t of this._order){const i=this._layers[t];if("symbol"!==i.type)continue;if(!l[i.source]){const t=this._getLayerSourceCache(i);if(!t)continue;l[i.source]=t.getRenderableIds(!0).map((e=>t.getTileByID(e))).sort(((t,e)=>e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)))}const n=this.crossTileSymbolIndex.addLayer(i,l[i.source],e.center.lng,e.projection);s=s||n}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),o=o||this._layerOrderChanged||0===n,this._layerOrderChanged&&this.fire(new t.Event("neworder")),(o||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.exported.now(),e.zoom))&&(this.pauseablePlacement=new Ve(e,this._order,o,i,n,r,this.placement,this.fog&&e.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(t.exported.now()),a=!0),s&&this.pauseablePlacement.placement.setStale()),a||s)for(const t of this._order){const e=this._layers[t];"symbol"===e.type&&this.placement.updateLayerOpacities(e,l[e.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(t.exported.now())}_releaseSymbolFadeTiles(){for(const t in this._sourceCaches)this._sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,e,i){this.imageManager.getImages(e.icons,i),this._updateTilesForChangedImages();const n=t=>{t&&t.setDependencies(e.tileID.key,e.type,e.icons)};n(this._otherSourceCaches[e.source]),n(this._symbolSourceCaches[e.source])}getGlyphs(t,e,i){this.glyphManager.getGlyphs(e.stacks,i)}getResource(e,i,n){return t.makeRequest(i,n)}_getSourceCache(t){return this._otherSourceCaches[t]}_getLayerSourceCache(t){return"symbol"===t.type?this._symbolSourceCaches[t.source]:this._otherSourceCaches[t.source]}_getSourceCaches(t){const e=[];return this._otherSourceCaches[t]&&e.push(this._otherSourceCaches[t]),this._symbolSourceCaches[t]&&e.push(this._symbolSourceCaches[t]),e}_isSourceCacheLoaded(e){const i=this._getSourceCaches(e);return 0===i.length?(this.fire(new t.ErrorEvent(new Error(`There is no source with ID '${e}'`))),!1):i.every((t=>t.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)}}Je.getSourceType=function(t){return Ct[t]},Je.setSourceType=function(t,e){Ct[t]=e},Je.registerForPluginStateChange=t.registerForPluginStateChange;var Ke="\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",$e="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;}",ti="\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",ei="#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",ii="#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 ni={},ri={};const oi=[];ui(Ke,oi),ui(ti,oi),ui(ei,oi),ui(ii,oi),ni=hi("",ti),ri=hi(ii,ei);const si=hi("\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."),ai=Ke,li="\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 ci={background:hi("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:hi("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:hi("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:hi("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:hi("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:hi("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:hi("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:hi("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:hi("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:hi("#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:hi("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:hi("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:hi("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:hi("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:hi("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:hi("#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:hi("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:hi("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:hi("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:hi("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:hi("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:hi("#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:hi("#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:hi("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:hi("#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:hi("\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}",$e),skyboxGradient:hi("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}",$e),skyboxCapture:hi("\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:hi("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:hi("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 ui(t,e){const i=t.replace(/\s*\/\/[^\n]*\n/g,"\n").split("\n");for(let t of i)if(t=t.trim(),"#"===t[0]&&t.includes("if")&&!t.includes("endif")){t=t.replace("#","").replace(/ifdef|ifndef|elif|if/g,"").replace(/!|defined|\(|\)|\|\||&&/g,"").replace(/\s+/g," ").trim();const i=t.split(" ");for(const t of i)e.includes(t)||e.push(t)}}function hi(t,e){const i=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=e.match(/attribute (highp |mediump |lowp )?([\w]+) ([\w]+)/g),r={},o=[...oi];return ui(t,o),ui(e,o),{fragmentSource:t=t.replace(i,((t,e,i,n,o)=>(r[o]=!0,"define"===e?`\n#ifndef HAS_UNIFORM_u_${o}\nvarying ${i} ${n} ${o};\n#else\nuniform ${i} ${n} u_${o};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${o}\n ${i} ${n} ${o} = u_${o};\n#endif\n`))),vertexSource:e=e.replace(i,((t,e,i,n,o)=>{const s="float"===n?"vec2":"vec4",a=o.match(/color/)?"color":s;return r[o]?"define"===e?`\n#ifndef HAS_UNIFORM_u_${o}\nuniform lowp float u_${o}_t;\nattribute ${i} ${s} a_${o};\nvarying ${i} ${n} ${o};\n#else\nuniform ${i} ${n} u_${o};\n#endif\n`:"vec4"===a?`\n#ifndef HAS_UNIFORM_u_${o}\n ${o} = a_${o};\n#else\n ${i} ${n} ${o} = u_${o};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${o}\n ${o} = unpack_mix_${a}(a_${o}, u_${o}_t);\n#else\n ${i} ${n} ${o} = u_${o};\n#endif\n`:"define"===e?`\n#ifndef HAS_UNIFORM_u_${o}\nuniform lowp float u_${o}_t;\nattribute ${i} ${s} a_${o};\n#else\nuniform ${i} ${n} u_${o};\n#endif\n`:"vec4"===a?`\n#ifndef HAS_UNIFORM_u_${o}\n ${i} ${n} ${o} = a_${o};\n#else\n ${i} ${n} ${o} = u_${o};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${o}\n ${i} ${n} ${o} = unpack_mix_${a}(a_${o}, u_${o}_t);\n#else\n ${i} ${n} ${o} = u_${o};\n#endif\n`})),staticAttributes:n,usedDefines:o}}class pi{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(t,e,i,n,r,o,s){this.context=t;let a=this.boundPaintVertexBuffers.length!==n.length;for(let t=0;!a&&t<n.length;t++)this.boundPaintVertexBuffers[t]!==n[t]&&(a=!0);let l=this.boundDynamicVertexBuffers.length!==s.length;for(let t=0;!l&&t<s.length;t++)this.boundDynamicVertexBuffers[t]!==s[t]&&(l=!0);if(!t.extVertexArrayObject||!this.vao||this.boundProgram!==e||this.boundLayoutVertexBuffer!==i||a||l||this.boundIndexBuffer!==r||this.boundVertexOffset!==o)this.freshBind(e,i,n,r,o,s);else{t.bindVertexArrayOES.set(this.vao);for(const t of s)t&&t.bind();r&&r.dynamicDraw&&r.bind()}}freshBind(t,e,i,n,r,o){let s;const a=t.numAttributes,l=this.context,c=l.gl;if(l.extVertexArrayObject)this.vao&&this.destroy(),this.vao=l.extVertexArrayObject.createVertexArrayOES(),l.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=i,this.boundIndexBuffer=n,this.boundVertexOffset=r,this.boundDynamicVertexBuffers=o;else{s=l.currentNumAttributes||0;for(let t=a;t<s;t++)c.disableVertexAttribArray(t)}e.enableAttributes(c,t),e.bind(),e.setVertexAttribPointers(c,t,r);for(const e of i)e.enableAttributes(c,t),e.bind(),e.setVertexAttribPointers(c,t,r);for(const e of o)e&&(e.enableAttributes(c,t),e.bind(),e.setVertexAttribPointers(c,t,r));n&&n.bind(),l.currentNumAttributes=a}destroy(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)}}function di(e,i){const n=Math.pow(2,i.canonical.z),r=i.canonical.y;return[new t.MercatorCoordinate(0,r/n).toLngLat().lat,new t.MercatorCoordinate(0,(r+1)/n).toLngLat().lat]}function fi(e,i,n,r,o,s,a){const l=e.context,c=l.gl,u=n.fbo;if(!u)return;e.prepareDrawTile();const h=e.useProgram("hillshade");l.activeTexture.set(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,u.colorAttachment.get());const p=((t,e,i,n)=>{const r=i.paint.get("hillshade-shadow-color"),o=i.paint.get("hillshade-highlight-color"),s=i.paint.get("hillshade-accent-color");let a=i.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===i.paint.get("hillshade-illumination-anchor")&&(a-=t.transform.angle);const l=!t.options.moving;return{u_matrix:n||t.transform.calculateProjMatrix(e.tileID.toUnwrapped(),l),u_image:0,u_latrange:di(0,e.tileID),u_light:[i.paint.get("hillshade-exaggeration"),a],u_shadow:r,u_highlight:o,u_accent:s}})(e,n,r,e.terrain?i.projMatrix:null);e.prepareDrawProgram(l,h,i.toUnwrapped());const{tileBoundsBuffer:d,tileBoundsIndexBuffer:f,tileBoundsSegments:m}=e.getTileBoundsBuffers(n);h.draw(l,c.TRIANGLES,o,s,a,t.CullFaceMode.disabled,p,r.id,d,f,m)}function mi(e,i,n){if(!i.needsDEMTextureUpload)return;const r=e.context,o=r.gl;r.pixelStoreUnpackPremultiplyAlpha.set(!1),i.demTexture=i.demTexture||e.getTileTexture(n.stride);const s=n.getPixels();i.demTexture?i.demTexture.update(s,{premultiply:!1}):i.demTexture=new t.Texture(r,s,o.RGBA,{premultiply:!1}),i.needsDEMTextureUpload=!1}function gi(e,i,n,r,o,s){const a=e.context,l=a.gl;if(!i.dem)return;const c=i.dem;if(a.activeTexture.set(l.TEXTURE1),mi(e,i,c),!i.demTexture)return;i.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);const u=c.dim;a.activeTexture.set(l.TEXTURE0);let h=i.fbo;if(!h){const e=new t.Texture(a,{width:u,height:u,data:null},l.RGBA);e.bind(l.LINEAR,l.CLAMP_TO_EDGE),h=i.fbo=a.createFramebuffer(u,u,!0),h.colorAttachment.set(e.texture)}a.bindFramebuffer.set(h.framebuffer),a.viewport.set([0,0,u,u]);const{tileBoundsBuffer:p,tileBoundsIndexBuffer:d,tileBoundsSegments:f}=e.getMercatorTileBoundsBuffers();e.useProgram("hillshadePrepare").draw(a,l.TRIANGLES,r,o,s,t.CullFaceMode.disabled,((e,i)=>{const n=i.stride,r=t.create();return t.ortho(r,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(r,r,[0,-t.EXTENT,0]),{u_matrix:r,u_image:1,u_dimension:[n,n],u_zoom:e.overscaledZ,u_unpack:i.unpackVector}})(i.tileID,c),n.id,p,d,f),i.needsHillshadePrepare=!1}const yi=e=>({u_matrix:new t.UniformMatrix4f(e),u_image0:new t.Uniform1i(e),u_skirt_height:new t.Uniform1f(e)}),vi=(t,e)=>({u_matrix:t,u_image0:0,u_skirt_height:e}),_i=(t,e,i,n,r,o,s,a,l,c,u,h,p,d,f)=>({u_proj_matrix:Float32Array.from(t),u_globe_matrix:e,u_normalize_matrix:Float32Array.from(n),u_merc_matrix:i,u_zoom_transition:r,u_merc_center:o,u_image0:0,u_frustum_tl:s,u_frustum_tr:a,u_frustum_br:l,u_frustum_bl:c,u_globe_pos:u,u_globe_radius:h,u_viewport:p,u_grid_matrix:f?Float32Array.from(f):new Float32Array(9),u_skirt_height:d});function xi(t,e){return null!=t&&null!=e&&!(!t.hasData()||!e.hasData())&&null!=t.demTexture&&null!=e.demTexture&&t.tileID.key!==e.tileID.key}const bi=new class{constructor(){this.operations={}}newMorphing(t,e,i,n,r){if(t in this.operations){const e=this.operations[t];e.to.tileID.key!==i.tileID.key&&(e.queued=i)}else this.operations[t]={startTime:n,phase:0,duration:r,from:e,to:i,queued:null}}getMorphValuesForProxy(t){if(!(t in this.operations))return null;const e=this.operations[t];return{from:e.from,to:e.to,phase:e.phase}}update(t){for(const e in this.operations){const i=this.operations[e];for(i.phase=(t-i.startTime)/i.duration;i.phase>=1||!this._validOp(i);)if(!this._nextOp(i,t)){delete this.operations[e];break}}}_nextOp(t,e){return!!t.queued&&(t.from=t.to,t.to=t.queued,t.queued=null,t.phase=0,t.startTime=e,!0)}_validOp(t){return t.from.hasData()&&t.to.hasData()}},wi={0:null,1:"TERRAIN_VERTEX_MORPHING",2:"TERRAIN_WIREFRAME"};function Ai(t){return 6*Math.pow(1.5,22-t)}function Ei(t,e){const i=1<<t.z;return!e&&(0===t.x||t.x===i-1)||0===t.y||t.y===i-1}const Si=t=>({u_matrix:t});function Mi(e,i,n,r,o){if(o>0){const s=t.exported.now(),a=(s-e.timeAdded)/o,l=i?(s-i.timeAdded)/o:-1,c=n.getSource(),u=r.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),h=!i||Math.abs(i.tileID.overscaledZ-u)>Math.abs(e.tileID.overscaledZ-u),p=h&&e.refreshedUponExpiration?1:t.clamp(h?a:1-l,0,1);return e.refreshedUponExpiration&&a>=1&&(e.refreshedUponExpiration=!1),i?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}class Ti extends t.SourceCache{constructor(t){const e={type:"raster-dem",maxzoom:t.transform.maxZoom},i=new C(Ft(),null),n=Pt("mock-dem",e,i,t.style);super("mock-dem",n,!1),n.setEventedParent(this),this._sourceLoaded=!0}_loadTile(t,e){t.state="loaded",e(null)}}class Ii extends t.SourceCache{constructor(t){const e=Pt("proxy",{type:"geojson",maxzoom:t.transform.maxZoom},new C(Ft(),null),t.style);super("proxy",e,!1),e.setEventedParent(this),this.map=this.getSource().map=t,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(e,i,n){if(e.freezeTileCoverage)return;this.transform=e;const r=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce(((i,n)=>{if(i[n.key]="",!this._tiles[n.key]){const i=new t.Tile(n,this._source.tileSize*n.overscaleFactor(),e.tileZoom);i.state="loaded",this._tiles[n.key]=i}return i}),{});for(const t in this._tiles)t in r||(this.freeFBO(t),this._tiles[t].unloadVectorData(),delete this._tiles[t])}freeFBO(t){const e=this.proxyCachedFBO[t];if(void 0!==e){const i=Object.values(e);this.renderCachePool.push(...i),delete this.proxyCachedFBO[t]}}deallocRenderCache(){this.renderCache.forEach((t=>t.fb.destroy())),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class Ci extends t.OverscaledTileID{constructor(t,e,i){super(t.overscaledZ,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y),this.proxyTileKey=e,this.projMatrix=i}}class Pi extends t.Elevation{constructor(e,i){super(),this.painter=e,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[n,r,o]=function(e){const i=new t.StructArrayLayout2i4,n=new t.StructArrayLayout3ui6,r=131;i.reserve(17161),n.reserve(33800);const o=t.EXTENT/128,s=t.EXTENT+o/2,a=s+o;for(let e=-o;e<a;e+=o)for(let n=-o;n<a;n+=o){const r=n<0||n>s||e<0||e>s?24575:0,o=t.clamp(Math.round(n),0,t.EXTENT),a=t.clamp(Math.round(e),0,t.EXTENT);i.emplaceBack(o+r,a)}const l=(t,e)=>{const i=e*r+t;n.emplaceBack(i+1,i,i+r),n.emplaceBack(i+r,i+r+1,i+1)};for(let t=1;t<129;t++)for(let e=1;e<129;e++)l(e,t);return[0,129].forEach((t=>{for(let e=0;e<130;e++)l(e,t),l(t,e)})),[i,n,32768]}(),s=e.context;this.gridBuffer=s.createVertexBuffer(n,t.posAttributes.members),this.gridIndexBuffer=s.createIndexBuffer(r),this.gridSegments=t.SegmentVector.simpleSegment(0,0,n.length,r.length),this.gridNoSkirtSegments=t.SegmentVector.simpleSegment(0,0,n.length,o),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new Ii(i.map),this.orthoMatrix=t.create(),t.ortho(this.orthoMatrix,"globe"===this.painter.transform.projection.name?.015:0,t.EXTENT,0,t.EXTENT,0,1);const a=s.gl;this._overlapStencilMode=new t.StencilMode({func:a.GEQUAL,mask:255},0,255,a.KEEP,a.KEEP,a.REPLACE),this._previousZoom=e.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=i,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new Ti(i.map)}set style(t){t.on("data",this._onStyleDataEvent.bind(this)),t.on("neworder",this._checkRenderCacheEfficiency.bind(this)),this._style=t,this._checkRenderCacheEfficiency(),this._style.map.on("moveend",(()=>{this._clearLineLayersFromRenderCache()}))}update(e,i,n){if(e&&e.terrain){this._style!==e&&(this.style=e),this.enabled=!0;const r=e.terrain.properties;this.sourceCache=0===e.terrain.drapeRenderMode?this._mockSourceCache:e._getSourceCache(r.get("source")),this._exaggeration=r.get("exaggeration");const o=()=>{this.sourceCache.used&&t.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 e=this.getScaledDemTileSize();this.sourceCache.update(i,e,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,o(),this._initializing=!0),o(),i.updateElevation(!0,n),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(i),this._emptyDEMTextureDirty=!0}else this._disable()}resetTileLookupCache(t){this._findCoveringTileCache[t]={}}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_checkRenderCacheEfficiency(){const e=this.renderCacheEfficiency(this._style);this._style.map._optimizeForTerrain||100!==e.efficiency&&t.warnOnce(`Terrain render cache efficiency is not optimal (${e.efficiency}%) and performance\n may be affected negatively, consider placing all background, fill and line layers before layer\n with id '${e.firstUndrapedLayer}' or create a map using optimizeForTerrain: true option.`)}_onStyleDataEvent(t){t.coord&&"source"===t.dataType?this._clearRenderCacheForTile(t.sourceCacheId,t.coord):"style"===t.dataType&&(this._invalidateRenderCache=!0)}_disable(){if(this.enabled&&(this.enabled=!1,this._sharedDepthStencil=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const t in this._style._sourceCaches)this._style._sourceCaches[t].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this._emptyDepthBufferTexture&&this._emptyDepthBufferTexture.destroy(),this.pool.forEach((t=>t.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 t=2*this.proxySourceCache.getSource().tileSize;return[t,t]}set useVertexMorphing(t){this._useVertexMorphing=t}updateTileBinding(e){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const i=this.proxySourceCache,n=this.painter.transform;this._initializing&&(this._initializing=0===n._centerAltitude&&-1===this.getAtPointOrZero(t.MercatorCoordinate.fromLngLat(n.center),-1),this._emptyDEMTextureDirty=!this._initializing);const r=this.proxyCoords=i.getIds().map((t=>{const e=i.getTileByID(t).tileID;return e.projMatrix=n.calculateProjMatrix(e.toUnwrapped()),e}));!function(e,i){const n=i.transform.pointCoordinate(i.transform.getCameraPoint()),r=new t.Point(n.x,n.y);e.sort(((e,i)=>{if(i.overscaledZ-e.overscaledZ)return i.overscaledZ-e.overscaledZ;const n=new t.Point(e.canonical.x+(1<<e.canonical.z)*e.wrap,e.canonical.y),o=new t.Point(i.canonical.x+(1<<i.canonical.z)*i.wrap,i.canonical.y),s=r.mult(1<<e.canonical.z);return s.x-=.5,s.y-=.5,s.distSqr(n)-s.distSqr(o)}))}(r,this.painter),this._previousZoom=n.zoom;const o=this.proxyToSource||{};this.proxyToSource={},r.forEach((t=>{this.proxyToSource[t.key]={}})),this.terrainTileForTile={};const s=this._style._sourceCaches;for(const t in s){const i=s[t];if(!i.used)continue;if(i!==this.sourceCache&&this.resetTileLookupCache(i.id),this._setupProxiedCoordsForOrtho(i,e[t],o),i.usedForTerrain)continue;const n=e[t];i.getSource().reparseOverscaled&&this._assignTerrainTiles(n)}this.proxiedCoords[i.id]=r.map((t=>new Ci(t,t.key,this.orthoMatrix))),this._assignTerrainTiles(r),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(o),this.renderingToTexture=!1,this._updateTimestamp=t.exported.now();const a={};this._visibleDemTiles=[];for(const t of this.proxyCoords){const e=this.terrainTileForTile[t.key];if(!e)continue;const i=e.tileID.key;i in a||(this._visibleDemTiles.push(e),a[i]=i)}}_assignTerrainTiles(t){this._initializing||t.forEach((t=>{if(this.terrainTileForTile[t.key])return;const e=this._findTileCoveringTileID(t,this.sourceCache);e&&(this.terrainTileForTile[t.key]=e)}))}_prepareDEMTextures(){const t=this.painter.context,e=t.gl;for(const i in this.terrainTileForTile){const n=this.terrainTileForTile[i],r=n.dem;!r||n.demTexture&&!n.needsDEMTextureUpload||(t.activeTexture.set(e.TEXTURE1),mi(this.painter,n,r))}}_prepareDemTileUniforms(t,e,i,n){if(!e||null==e.demTexture)return!1;const r=t.tileID.canonical,o=Math.pow(2,e.tileID.canonical.z-r.z),s=n||"";return i[`u_dem_tl${s}`]=[r.x*o%1,r.y*o%1],i[`u_dem_scale${s}`]=o,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}get emptyDepthBufferTexture(){const e=this.painter.context,i=e.gl;if(!this._emptyDepthBufferTexture){const n=new t.RGBAImage({width:1,height:1},Uint8Array.of(255,255,255,255));this._emptyDepthBufferTexture=new t.Texture(e,n,i.RGBA,{premultiply:!1})}return this._emptyDepthBufferTexture}_getLoadedAreaMinimum(){let t=0;const e=this._visibleDemTiles.reduce(((e,i)=>{if(!i.dem)return e;const n=i.dem.tree.minimums[0];return n>0&&t++,e+n}),0);return t?e/t:0}_updateEmptyDEMTexture(){const e=this.painter.context,i=e.gl;e.activeTexture.set(i.TEXTURE2);const n=this._getLoadedAreaMinimum(),r=new t.RGBAImage({width:1,height:1},new Uint8Array(t.DEMData.pack(n,this.sourceCache.getSource().encoding)));this._emptyDEMTextureDirty=!1;let o=this._emptyDEMTexture;return o?o.update(r,{premultiply:!1}):o=this._emptyDEMTexture=new t.Texture(e,r,i.RGBA,{premultiply:!1}),o}setupElevationDraw(e,i,n){const r=this.painter.context,o=r.gl,s=(a=this.sourceCache.getSource().encoding,{u_dem:2,u_dem_prev:4,u_dem_unpack:t.DEMData.getUnpackVector(a),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 a;s.u_dem_size=this.sourceCache.getSource().tileSize,s.u_exaggeration=this.exaggeration();let l=null,c=null,u=1;if(n&&n.morphing&&this._useVertexMorphing){const t=n.morphing.srcDemTile,i=n.morphing.dstDemTile;u=n.morphing.phase,t&&i&&(this._prepareDemTileUniforms(e,t,s,"_prev")&&(c=t),this._prepareDemTileUniforms(e,i,s)&&(l=i))}if(c&&l?(r.activeTexture.set(o.TEXTURE2),l.demTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE,o.NEAREST),r.activeTexture.set(o.TEXTURE4),c.demTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE,o.NEAREST),s.u_dem_lerp=u):(l=this.terrainTileForTile[e.tileID.key],r.activeTexture.set(o.TEXTURE2),(this._prepareDemTileUniforms(e,l,s)?l.demTexture:this.emptyDEMTexture).bind(o.NEAREST,o.CLAMP_TO_EDGE)),r.activeTexture.set(o.TEXTURE3),n&&n.useDepthForOcclusion?(this._depthTexture&&this._depthTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE),this._depthFBO&&(s.u_depth_size_inv=[1/this._depthFBO.width,1/this._depthFBO.height])):(this.emptyDepthBufferTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE),s.u_depth_size_inv=[1,1]),n&&n.useMeterToDem&&l){const e=(1<<l.tileID.canonical.z)*t.mercatorZfromAltitude(1,this.painter.transform.center.lat)*this.sourceCache.getSource().tileSize;s.u_meter_to_dem=e}if(n&&n.labelPlaneMatrixInv&&(s.u_label_plane_matrix_inv=n.labelPlaneMatrixInv),i.setTerrainUniformValues(r,s),"globe"===this.painter.transform.projection.name){const t=this.globeUniformValues(this.painter.transform,e.tileID.canonical,n&&n.useDenormalizedUpVectorScale);i.setGlobeUniformValues(r,t)}}globeUniformValues(e,i,n){const r=e.projection;return{u_tile_tl_up:r.upVector(i,0,0),u_tile_tr_up:r.upVector(i,t.EXTENT,0),u_tile_br_up:r.upVector(i,t.EXTENT,t.EXTENT),u_tile_bl_up:r.upVector(i,0,t.EXTENT),u_tile_up_scale:n?t.globeMetersToEcef(1):r.upVectorScale(i,e.center.lat,e.worldSize).metersToTile}}renderToBackBuffer(e){const i=this.painter,n=this.painter.context;0!==e.length&&(n.bindFramebuffer.set(null),n.viewport.set([0,0,i.width,i.height]),i.gpuTimingDeferredRenderStart(),this.renderingToTexture=!1,function(e,i,n,r,o){if("globe"===e.transform.projection.name)!function(e,i,n,r,o){const s=e.context,a=s.gl;let l,c;const u=e.options.showTerrainWireframe?2:0,h=e.transform,p=t.globeUseCustomAntiAliasing(e,s,h),d=(t,i)=>{if(c===t)return;const n=[wi[t],"PROJECTION_GLOBE_VIEW"];p&&n.push("CUSTOM_ANTIALIASING"),i&&n.push(wi[u]),l=e.useProgram("globeRaster",null,n),c=t},f=e.colorModeForRenderPass(),m=new t.DepthMode(a.LEQUAL,t.DepthMode.ReadWrite,e.depthRangeFor3D);bi.update(o);const g=t.calculateGlobeMercatorMatrix(h),y=[t.mercatorXfromLng(h.center.lng),t.mercatorYfromLat(h.center.lat)],v=u?[!1,!0]:[!1],_=e.globeSharedBuffers,x=[h.width*t.exported.devicePixelRatio,h.height*t.exported.devicePixelRatio],b=Float32Array.from(h.globeMatrix),w={useDenormalizedUpVectorScale:!0};if(v.forEach((u=>{const h=e.transform,p=Ai(h.zoom)*i.exaggeration();c=-1;const v=u?a.LINES:a.TRIANGLES;for(const c of r){const r=n.getTile(c),A=t.StencilMode.disabled,E=i.prevTerrainTileForTile[c.key],S=i.terrainTileForTile[c.key];xi(E,S)&&bi.newMorphing(c.key,E,S,o,250),s.activeTexture.set(a.TEXTURE0),r.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE);const M=bi.getMorphValuesForProxy(c.key),T=M?1:0;M&&t.extend$1(w,{morphing:{srcDemTile:M.from,dstDemTile:M.to,phase:t.easeCubicInOut(M.phase)}});const I=t.tileCornersToBounds(c.canonical),C=t.getLatitudinalLod(I.getCenter().lat),P=t.getGridMatrix(c.canonical,I,C,h.worldSize/h._pixelsPerMercatorPixel),L=t.globeNormalizeECEF(t.globeTileBounds(c.canonical)),D=_i(h.projMatrix,b,g,L,t.globeToMercatorTransition(h.zoom),y,h.frustumCorners.TL,h.frustumCorners.TR,h.frustumCorners.BR,h.frustumCorners.BL,h.globeCenterInViewSpace,h.globeRadius,x,p,P);if(d(T,u),i.setupElevationDraw(r,l,w),e.prepareDrawProgram(s,l,c.toUnwrapped()),_){const[i,n,r]=u?_.getWirefameBuffers(e.context,C):_.getGridBuffers(C,0!==p);l.draw(s,v,m,A,f,t.CullFaceMode.backCCW,D,"globe_raster",i,n,r)}}})),_){const o=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];p&&o.push("CUSTOM_ANTIALIASING"),l=e.useProgram("globeRaster",null,o);for(const o of r){const{x:r,y:c,z:u}=o.canonical,p=0===c,d=c===(1<<u)-1,[g,v,b,A]=_.getPoleBuffers(u);if(A&&(p||d)){const c=n.getTile(o);s.activeTexture.set(a.TEXTURE0),c.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE);let _=t.globePoleMatrixForTile(u,r,h);const E=t.globeNormalizeECEF(t.globeTileBounds(o.canonical)),S=(e,i)=>e.draw(s,a.TRIANGLES,m,t.StencilMode.disabled,f,t.CullFaceMode.disabled,_i(h.projMatrix,_,_,E,0,y,h.frustumCorners.TL,h.frustumCorners.TR,h.frustumCorners.BR,h.frustumCorners.BL,h.globeCenterInViewSpace,h.globeRadius,x,0),"globe_pole_raster",i,b,A);i.setupElevationDraw(c,l,w),e.prepareDrawProgram(s,l,o.toUnwrapped()),p&&S(l,g),d&&(_=t.scale(t.create(),_,[1,-1,1]),S(l,v))}}}}(e,i,n,r,o);else{const s=e.context,a=s.gl;let l,c;const u=e.options.showTerrainWireframe?2:0,h=(t,i)=>{if(c===t)return;const n=[wi[t]];i&&n.push(wi[u]),l=e.useProgram("terrainRaster",null,n),c=t},p=e.colorModeForRenderPass(),d=new t.DepthMode(a.LEQUAL,t.DepthMode.ReadWrite,e.depthRangeFor3D);bi.update(o);const f=e.transform,m=Ai(f.zoom)*i.exaggeration();(u?[!1,!0]:[!1]).forEach((u=>{c=-1;const g=u?a.LINES:a.TRIANGLES,[y,v]=u?i.getWirefameBuffer():[i.gridIndexBuffer,i.gridSegments];for(const c of r){const r=n.getTile(c),_=t.StencilMode.disabled,x=i.prevTerrainTileForTile[c.key],b=i.terrainTileForTile[c.key];xi(x,b)&&bi.newMorphing(c.key,x,b,o,250),s.activeTexture.set(a.TEXTURE0),r.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST);const w=bi.getMorphValuesForProxy(c.key),A=w?1:0;let E;w&&(E={morphing:{srcDemTile:w.from,dstDemTile:w.to,phase:t.easeCubicInOut(w.phase)}});const S=vi(c.projMatrix,Ei(c.canonical,f.renderWorldCopies)?m/10:m);h(A,u),i.setupElevationDraw(r,l,E),e.prepareDrawProgram(s,l,c.toUnwrapped()),l.draw(s,g,d,_,p,t.CullFaceMode.backCCW,S,"terrain_raster",i.gridBuffer,y,v)}}))}}(i,this,this.proxySourceCache,e,this._updateTimestamp),this.renderingToTexture=!0,i.gpuTimingDeferredRenderEnd(),e.splice(0,e.length))}renderBatch(e){if(0===this._drapedRenderBatches.length)return e+1;this.renderingToTexture=!0;const i=this.painter,n=this.painter.context,r=this.proxySourceCache,o=this.proxiedCoords[r.id],s=this._drapedRenderBatches.shift(),a=[],l=i.style.order;let c=0;for(const u of o){const o=r.getTileByID(u.proxyTileKey),h=r.proxyCachedFBO[u.key]?r.proxyCachedFBO[u.key][e]:void 0,p=void 0!==h?r.renderCache[h]:this.pool[c++],d=void 0!==h;if(o.texture=p.tex,d&&!p.dirty){a.push(o.tileID);continue}let f;n.bindFramebuffer.set(p.fb.framebuffer),this.renderedToTile=!1,p.dirty&&(n.clear({color:t.Color.transparent,stencil:0}),p.dirty=!1);for(let t=s.start;t<=s.end;++t){const e=i.style._layers[l[t]];if(e.isHidden(i.transform.zoom))continue;const r=i.style._getLayerSourceCache(e),o=r?this.proxyToSource[u.key][r.id]:[u];if(!o)continue;const s=o;n.viewport.set([0,0,p.fb.width,p.fb.height]),f!==(r?r.id:null)&&(this._setupStencil(p,o,e,r),f=r?r.id:null),i.renderLayer(i,r,e,s)}this.renderedToTile?(p.dirty=!0,a.push(o.tileID)):d||--c,5===c&&(c=0,this.renderToBackBuffer(a))}return this.renderToBackBuffer(a),this.renderingToTexture=!1,n.bindFramebuffer.set(null),n.viewport.set([0,0,i.width,i.height]),s.end+1}postRender(){}renderCacheEfficiency(t){const e=t.order.length;if(0===e)return{efficiency:100};let i,n=0,r=0,o=!1;for(let s=0;s<e;++s){const e=t._layers[t.order[s]];this._style.isLayerDraped(e)?(o&&++n,++r):o||(o=!0,i=e.id)}return 0===r?{efficiency:100}:{efficiency:100*(1-n/r),firstUndrapedLayer:i}}getMinElevationBelowMSL(){let t=0;return this._visibleDemTiles.filter((t=>t.dem)).forEach((e=>{t=Math.min(t,e.dem.tree.minimums[0])})),0===t?t:(t-30)*this._exaggeration}raycast(t,e,i){if(!this._visibleDemTiles)return null;const n=this._visibleDemTiles.filter((t=>t.dem)).map((n=>{const r=n.tileID,o=1<<r.overscaledZ,{x:s,y:a}=r.canonical,l=s/o,c=(s+1)/o,u=a/o,h=(a+1)/o;return{minx:l,miny:u,maxx:c,maxy:h,t:n.dem.tree.raycastRoot(l,u,c,h,t,e,i),tile:n}}));n.sort(((t,e)=>(null!==t.t?t.t:Number.MAX_VALUE)-(null!==e.t?e.t:Number.MAX_VALUE)));for(const r of n){if(null==r.t)return null;const n=r.tile.dem.tree.raycast(r.minx,r.miny,r.maxx,r.maxy,t,e,i);if(null!=n)return n}return null}_createFBO(){const e=this.painter.context,i=e.gl,n=this.drapeBufferSize;e.activeTexture.set(i.TEXTURE0);const r=new t.Texture(e,{width:n[0],height:n[1],data:null},i.RGBA);r.bind(i.LINEAR,i.CLAMP_TO_EDGE);const o=e.createFramebuffer(n[0],n[1],!1);return o.colorAttachment.set(r.texture),o.depthAttachment=new wt(e,o.framebuffer),void 0===this._sharedDepthStencil?(this._sharedDepthStencil=e.createRenderbuffer(e.gl.DEPTH_STENCIL,n[0],n[1]),this._stencilRef=0,o.depthAttachment.set(this._sharedDepthStencil),e.clear({stencil:0})):o.depthAttachment.set(this._sharedDepthStencil),e.extTextureFilterAnisotropic&&!e.extTextureFilterAnisotropicForceOff&&i.texParameterf(i.TEXTURE_2D,e.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.extTextureFilterAnisotropicMax),{fb:o,tex:r,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 t in this._style._sourceCaches)if(this._style._sourceCaches[t].hasTransition())return!0;return this._style.order.some((t=>{const e=this._style._layers[t],i=e.isHidden(this.painter.transform.zoom);return"custom"===e.type?!i&&e.shouldRedrape():!i&&e.hasTransition()}))}_clearLineLayersFromRenderCache(){let e=!1;for(const t of this._style._getSources())if(t instanceof St){e=!0;break}if(!e)return;const i={};for(let e=0;e<this._style.order.length;++e){const n=this._style._layers[this._style.order[e]],r=this._style._getLayerSourceCache(n);if(r&&!i[r.id]&&!n.isHidden(this.painter.transform.zoom)&&"line"===n.type&&n.widthExpression()instanceof t.ZoomDependentExpression){i[r.id]=!0;for(const t of this.proxyCoords){const e=this.proxyToSource[t.key][r.id];if(e)for(const t of e)this._clearRenderCacheForTile(r.id,t)}}}}_clearRasterLayersFromRenderCache(){let t=!1;for(const e in this._style._sourceCaches)if(this._style._sourceCaches[e]._source instanceof Mt){t=!0;break}if(!t)return;const e={};for(let t=0;t<this._style.order.length;++t){const i=this._style._layers[this._style.order[t]],n=this._style._getLayerSourceCache(i);if(!n||e[n.id])continue;if(i.isHidden(this.painter.transform.zoom)||"raster"!==i.type)continue;const r=i.paint.get("raster-fade-duration");for(const t of this.proxyCoords){const e=this.proxyToSource[t.key][n.id];if(e)for(const t of e){const e=Mi(n.getTile(t),n.findLoadedParent(t,0),n,this.painter.transform,r);(1!==e.opacity||0!==e.mix)&&this._clearRenderCacheForTile(n.id,t)}}}}_setupDrapedRenderBatches(){const t=this._style.order,e=t.length;if(0===e)return;const i=[];let n,r=0,o=this._style._layers[t[r]];for(;!this._style.isLayerDraped(o)&&o.isHidden(this.painter.transform.zoom)&&++r<e;)o=this._style._layers[t[r]];for(;r<e;++r){const e=this._style._layers[t[r]];e.isHidden(this.painter.transform.zoom)||(this._style.isLayerDraped(e)?void 0===n&&(n=r):void 0!==n&&(i.push({start:n,end:r-1}),n=void 0))}void 0!==n&&i.push({start:n,end:r-1}),this._drapedRenderBatches=i}_setupRenderCache(t){const e=this.proxySourceCache;if(this._shouldDisableRenderCache()||this._invalidateRenderCache){if(this._invalidateRenderCache=!1,e.renderCache.length>e.renderCachePool.length){const t=Object.values(e.proxyCachedFBO);e.proxyCachedFBO={};for(let i=0;i<t.length;++i){const n=Object.values(t[i]);e.renderCachePool.push(...n)}}return}this._clearRasterLayersFromRenderCache();const i=this.proxyCoords,n=this._tilesDirty;for(let r=i.length-1;r>=0;r--){const o=i[r];if(e.getTileByID(o.key),void 0!==e.proxyCachedFBO[o.key]){const i=t[o.key],r=this.proxyToSource[o.key];let s=0;for(const t in r){const e=r[t],o=i[t];if(!o||o.length!==e.length||e.some(((e,i)=>e!==o[i]||n[t]&&n[t].hasOwnProperty(e.key)))){s=-1;break}++s}for(const t in e.proxyCachedFBO[o.key])e.renderCache[e.proxyCachedFBO[o.key][t]].dirty=s<0||s!==Object.values(i).length}}const r=[...this._drapedRenderBatches];r.sort(((t,e)=>e.end-e.start-(t.end-t.start)));for(const t of r)for(const n of i){if(e.proxyCachedFBO[n.key])continue;let i=e.renderCachePool.pop();void 0===i&&e.renderCache.length<50&&(i=e.renderCache.length,e.renderCache.push(this._createFBO())),void 0!==i&&(e.proxyCachedFBO[n.key]={},e.proxyCachedFBO[n.key][t.start]=i,e.renderCache[i].dirty=!0)}this._tilesDirty={}}_setupStencil(t,e,i,n){if(!n||!this._sourceTilesOverlap[n.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const r=this.painter.context,o=r.gl;if(e.length<=1)return void(this._overlapStencilType=!1);let s;if(i.isTileClipped())s=e.length,this._overlapStencilMode.test={func:o.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(e[0].overscaledZ>e[e.length-1].overscaledZ))return void(this._overlapStencilType=!1);s=1,this._overlapStencilMode.test={func:o.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+s>255&&(r.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=s,this._overlapStencilMode.ref=this._stencilRef,i.isTileClipped()&&this._renderTileClippingMasks(e,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return"Clip"===this._overlapStencilType||"Mask"===this._overlapStencilType}stencilModeForRTTOverlap(e){return this.renderingToTexture&&this._overlapStencilType?("Clip"===this._overlapStencilType&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[e.key]),this._overlapStencilMode):t.StencilMode.disabled}_renderTileClippingMasks(e,i){const n=this.painter,r=this.painter.context,o=r.gl;n._tileClippingMaskIDs={},r.setColorMode(t.ColorMode.disabled),r.setDepthMode(t.DepthMode.disabled);const s=n.useProgram("clippingMask");for(const a of e){const e=n._tileClippingMaskIDs[a.key]=--i;s.draw(r,o.TRIANGLES,t.DepthMode.disabled,new t.StencilMode({func:o.ALWAYS,mask:0},e,255,o.KEEP,o.KEEP,o.REPLACE),t.ColorMode.disabled,t.CullFaceMode.disabled,Si(a.projMatrix),"$clipping",n.tileExtentBuffer,n.quadTriangleIndexBuffer,n.tileExtentSegments)}}pointCoordinate(e){const i=this.painter.transform;if(e.x<0||e.x>i.width||e.y<0||e.y>i.height)return null;const n=[e.x,e.y,1,1];t.transformMat4$1(n,n,i.pixelMatrixInverse),t.scale$1(n,n,1/n[3]),n[0]/=i.worldSize,n[1]/=i.worldSize;const r=i._camera.position,o=t.mercatorZfromAltitude(1,i.center.lat),s=[r[0],r[1],r[2]/o,0],a=t.subtract([],n.slice(0,3),s);t.normalize(a,a);const l=this.raycast(s,a,this._exaggeration);return null!==l&&l?(t.scaleAndAdd(s,s,a,l),s[3]=s[2],s[2]*=o,s):null}drawDepth(){const e=this.painter,i=e.context,n=this.proxySourceCache,r=Math.ceil(e.width),o=Math.ceil(e.height);if(!this._depthFBO||this._depthFBO.width===r&&this._depthFBO.height===o||(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0),!this._depthFBO){const e=i.gl,n=i.createFramebuffer(r,o,!0);i.activeTexture.set(e.TEXTURE0);const s=new t.Texture(i,{width:r,height:o,data:null},e.RGBA);s.bind(e.NEAREST,e.CLAMP_TO_EDGE),n.colorAttachment.set(s.texture);const a=i.createRenderbuffer(i.gl.DEPTH_COMPONENT16,r,o);n.depthAttachment.set(a),this._depthFBO=n,this._depthTexture=s}i.bindFramebuffer.set(this._depthFBO.framebuffer),i.viewport.set([0,0,r,o]),function(e,i,n,r){if("globe"===e.transform.projection.name)return;const o=e.context,s=o.gl;o.clear({depth:1});const a=e.useProgram("terrainDepth"),l=new t.DepthMode(s.LESS,t.DepthMode.ReadWrite,e.depthRangeFor3D);for(const e of r){const r=n.getTile(e),c=vi(e.projMatrix,0);i.setupElevationDraw(r,a),a.draw(o,s.TRIANGLES,l,t.StencilMode.disabled,t.ColorMode.unblended,t.CullFaceMode.backCCW,c,"terrain_depth",i.gridBuffer,i.gridIndexBuffer,i.gridNoSkirtSegments)}}(e,this,n,this.proxyCoords)}_setupProxiedCoordsForOrtho(t,e,i){if(t.getSource()instanceof It)return this._setupProxiedCoordsForImageSource(t,e,i);this._findCoveringTileCache[t.id]=this._findCoveringTileCache[t.id]||{};const n=this.proxiedCoords[t.id]=[],r=this.proxyCoords;for(let e=0;e<r.length;e++){const o=r[e],s=this._findTileCoveringTileID(o,t);if(s){const e=this._createProxiedId(o,s,i[o.key]&&i[o.key][t.id]);n.push(e),this.proxyToSource[o.key][t.id]=[e]}}let o=!1;for(let r=0;r<e.length;r++){const s=t.getTile(e[r]);if(!s||!s.hasData())continue;const a=this._findTileCoveringTileID(s.tileID,this.proxySourceCache);if(a&&a.tileID.canonical.z!==s.tileID.canonical.z){const e=this.proxyToSource[a.tileID.key][t.id],r=this._createProxiedId(a.tileID,s,i[a.tileID.key]&&i[a.tileID.key][t.id]);e?e.splice(e.length-1,0,r):this.proxyToSource[a.tileID.key][t.id]=[r],n.push(r),o=!0}}this._sourceTilesOverlap[t.id]=o}_setupProxiedCoordsForImageSource(e,i,n){if(!e.getSource().loaded())return;const r=this.proxiedCoords[e.id]=[],o=this.proxyCoords,s=e.getSource(),a=new t.Point(s.tileID.x,s.tileID.y)._div(1<<s.tileID.z),l=s.coordinates.map(t.MercatorCoordinate.fromLngLat).reduce(((t,e)=>(t.min.x=Math.min(t.min.x,e.x-a.x),t.min.y=Math.min(t.min.y,e.y-a.y),t.max.x=Math.max(t.max.x,e.x-a.x),t.max.y=Math.max(t.max.y,e.y-a.y),t)),{min:new t.Point(Number.MAX_VALUE,Number.MAX_VALUE),max:new t.Point(-Number.MAX_VALUE,-Number.MAX_VALUE)}),c=(e,i)=>{const n=e.wrap+e.canonical.x/(1<<e.canonical.z),r=e.canonical.y/(1<<e.canonical.z),o=t.EXTENT/(1<<e.canonical.z),s=i.wrap+i.canonical.x/(1<<i.canonical.z),a=i.canonical.y/(1<<i.canonical.z);return n+o<s+l.min.x||n>s+l.max.x||r+o<a+l.min.y||r>a+l.max.y};for(let t=0;t<o.length;t++){const s=o[t];for(let t=0;t<i.length;t++){const o=e.getTile(i[t]);if(!o||!o.hasData())continue;if(c(s,o.tileID))continue;const a=this._createProxiedId(s,o,n[s.key]&&n[s.key][e.id]),l=this.proxyToSource[s.key][e.id];l?l.push(a):this.proxyToSource[s.key][e.id]=[a],r.push(a)}}}_createProxiedId(e,i,n){let r=this.orthoMatrix;if(n){const t=n.find((t=>t.key===i.tileID.key));if(t)return t}if(i.tileID.key!==e.key){const n=e.canonical.z-i.tileID.canonical.z;let o,s,a;r=t.create();const l=i.tileID.wrap-e.wrap<<e.overscaledZ;n>0?(o=t.EXTENT>>n,s=o*((i.tileID.canonical.x<<n)-e.canonical.x+l),a=o*((i.tileID.canonical.y<<n)-e.canonical.y)):(o=t.EXTENT<<-n,s=t.EXTENT*(i.tileID.canonical.x-(e.canonical.x+l<<-n)),a=t.EXTENT*(i.tileID.canonical.y-(e.canonical.y<<-n))),t.ortho(r,0,o,0,o,0,1),t.translate(r,r,[s,a,0])}return new Ci(i.tileID,e.key,r)}_findTileCoveringTileID(e,i){let n=i.getTile(e);if(n&&n.hasData())return n;const r=this._findCoveringTileCache[i.id],o=r[e.key];if(n=o?i.getTileByID(o):null,n&&n.hasData()||null===o)return n;let s=n?n.tileID:e,a=s.overscaledZ;const l=i.getSource().minzoom,c=[];if(!o){const r=i.getSource().maxzoom;if(e.canonical.z>=r){const n=e.canonical.z-r;i.getSource().reparseOverscaled?(a=Math.max(e.canonical.z+2,i.transform.tileZoom),s=new t.OverscaledTileID(a,e.wrap,r,e.canonical.x>>n,e.canonical.y>>n)):0!==n&&(a=r,s=new t.OverscaledTileID(a,e.wrap,r,e.canonical.x>>n,e.canonical.y>>n))}s.key!==e.key&&(c.push(s.key),n=i.getTile(s))}const u=t=>{c.forEach((e=>{r[e]=t})),c.length=0};for(a-=1;a>=l&&(!n||!n.hasData());a--){n&&u(n.tileID.key);const t=s.calculateScaledKey(a);if(n=i.getTileByID(t),n&&n.hasData())break;const e=r[t];if(null===e)break;void 0===e?c.push(t):n=i.getTileByID(e)}return u(n?n.tileID.key:null),n&&n.hasData()?n:null}findDEMTileFor(t){return this.enabled?this._findTileCoveringTileID(t,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(t,e){let i=this._tilesDirty[t];i||(i=this._tilesDirty[t]={}),i[e.key]=!0}getWirefameBuffer(){if(!this.wireframeSegments){const e=function(e){let i=0;const n=new t.StructArrayLayout2ui4,r=131;for(let t=1;t<129;t++){for(let e=1;e<129;e++)i=t*r+e,n.emplaceBack(i,i+1),n.emplaceBack(i,i+r),n.emplaceBack(i+1,i+r),128===t&&n.emplaceBack(i+r,i+r+1);n.emplaceBack(i+1,i+1+r)}return n}();this.wireframeIndexBuffer=this.painter.context.createIndexBuffer(e),this.wireframeSegments=t.SegmentVector.simpleSegment(0,0,this.gridBuffer.length,e.length)}return[this.wireframeIndexBuffer,this.wireframeSegments]}}class Li{static cacheKey(t,e,i,n){let r=`${e}${n?n.cacheKey:""}`;for(const e of i)t.usedDefines.includes(e)&&(r+=`/${e}`);return r}constructor(e,i,n,r,o,s){const a=e.gl;this.program=a.createProgram();const l=function(t){const e=[];for(let i=0;i<t.length;i++){if(null===t[i])continue;const n=t[i].split(" ");e.push(n.pop())}return e}(n.staticAttributes),c=r?r.getBinderAttributes():[],u=l.concat(c);let h=r?r.defines():[];h=h.concat(s.map((t=>`#define ${t}`)));const p=e.isWebGL2?"#version 300 es\n":"",d=p+h.concat(e.extStandardDerivatives&&0===p.length?"#extension GL_OES_standard_derivatives : enable\n".concat(li):li,li,ai,si.fragmentSource,ri.fragmentSource,n.fragmentSource).join("\n"),f=p+h.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",ai,si.vertexSource,ri.vertexSource,ni.vertexSource,n.vertexSource).join("\n"),m=a.createShader(a.FRAGMENT_SHADER);if(a.isContextLost())return void(this.failedToCreate=!0);a.shaderSource(m,d),a.compileShader(m),a.attachShader(this.program,m);const g=a.createShader(a.VERTEX_SHADER);if(a.isContextLost())this.failedToCreate=!0;else{a.shaderSource(g,f),a.compileShader(g),a.attachShader(this.program,g),this.attributes={},this.numAttributes=u.length;for(let t=0;t<this.numAttributes;t++)u[t]&&(a.bindAttribLocation(this.program,t,u[t]),this.attributes[u[t]]=t);a.linkProgram(this.program),a.deleteShader(g),a.deleteShader(m),this.fixedUniforms=o(e),this.binderUniforms=r?r.getUniforms(e):[],s.includes("TERRAIN")&&(this.terrainUniforms=(e=>({u_dem:new t.Uniform1i(e),u_dem_prev:new t.Uniform1i(e),u_dem_unpack:new t.Uniform4f(e),u_dem_tl:new t.Uniform2f(e),u_dem_scale:new t.Uniform1f(e),u_dem_tl_prev:new t.Uniform2f(e),u_dem_scale_prev:new t.Uniform1f(e),u_dem_size:new t.Uniform1f(e),u_dem_lerp:new t.Uniform1f(e),u_exaggeration:new t.Uniform1f(e),u_depth:new t.Uniform1i(e),u_depth_size_inv:new t.Uniform2f(e),u_meter_to_dem:new t.Uniform1f(e),u_label_plane_matrix_inv:new t.UniformMatrix4f(e)}))(e)),s.includes("GLOBE")&&(this.globeUniforms=(e=>({u_tile_tl_up:new t.Uniform3f(e),u_tile_tr_up:new t.Uniform3f(e),u_tile_br_up:new t.Uniform3f(e),u_tile_bl_up:new t.Uniform3f(e),u_tile_up_scale:new t.Uniform1f(e)}))(e)),s.includes("FOG")&&(this.fogUniforms=(e=>({u_fog_matrix:new t.UniformMatrix4f(e),u_fog_range:new t.Uniform2f(e),u_fog_color:new t.Uniform4f(e),u_fog_horizon_blend:new t.Uniform1f(e),u_fog_temporal_offset:new t.Uniform1f(e),u_frustum_tl:new t.Uniform3f(e),u_frustum_tr:new t.Uniform3f(e),u_frustum_br:new t.Uniform3f(e),u_frustum_bl:new t.Uniform3f(e),u_globe_pos:new t.Uniform3f(e),u_globe_radius:new t.Uniform1f(e),u_globe_transition:new t.Uniform1f(e),u_is_globe:new t.Uniform1i(e),u_viewport:new t.Uniform2f(e)}))(e))}}setTerrainUniformValues(t,e){if(!this.terrainUniforms)return;const i=this.terrainUniforms;if(!this.failedToCreate){t.program.set(this.program);for(const t in e)i[t]&&i[t].set(this.program,t,e[t])}}setGlobeUniformValues(t,e){if(!this.globeUniforms)return;const i=this.globeUniforms;if(!this.failedToCreate){t.program.set(this.program);for(const t in e)i[t]&&i[t].set(this.program,t,e[t])}}setFogUniformValues(t,e){if(!this.fogUniforms)return;const i=this.fogUniforms;if(!this.failedToCreate){t.program.set(this.program);for(const t in e)i[t].set(this.program,t,e[t])}}draw(t,e,i,n,r,o,s,a,l,c,u,h,p,d,f){const m=t.gl;if(this.failedToCreate)return;t.program.set(this.program),t.setDepthMode(i),t.setStencilMode(n),t.setColorMode(r),t.setCullFace(o);for(const t of Object.keys(this.fixedUniforms))this.fixedUniforms[t].set(this.program,t,s[t]);d&&d.setUniforms(this.program,t,this.binderUniforms,h,{zoom:p});const g={[m.LINES]:2,[m.TRIANGLES]:3,[m.LINE_STRIP]:1}[e];for(const i of u.get()){const n=i.vaos||(i.vaos={});(n[a]||(n[a]=new pi)).bind(t,this,l,d?d.getPaintVertexBuffers():[],c,i.vertexOffset,f||[]),m.drawElements(e,i.primitiveLength*g,m.UNSIGNED_SHORT,i.primitiveOffset*g*2)}}}function Di(t,e){const i=Math.pow(2,e.tileID.overscaledZ),n=e.tileSize*Math.pow(2,t.transform.tileZoom)/i,r=n*(e.tileID.canonical.x+e.tileID.wrap*i),o=n*e.tileID.canonical.y;return{u_image:0,u_texsize:e.imageAtlasTexture.size,u_tile_units_to_pixels:1/P(e,1,t.transform.tileZoom),u_pixel_coord_upper:[r>>16,o>>16],u_pixel_coord_lower:[65535&r,65535&o]}}const Ri=t.create(),Oi=(e,i,n,r,o,s,a,l,c,u,h)=>{const p=i.style.light,d=p.properties.get("position"),f=[d.x,d.y,d.z],m=t.create$1();"viewport"===p.properties.get("anchor")&&(t.fromRotation(m,-i.transform.angle),t.transformMat3(f,f,m));const g=p.properties.get("color"),y=i.transform,v={u_matrix:e,u_lightpos:f,u_lightintensity:p.properties.get("intensity"),u_lightcolor:[g.r,g.g,g.b],u_vertical_gradient:+n,u_opacity:r,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:Ri,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_ao:o,u_edge_radius:s};return"globe"===y.projection.name&&(v.u_tile_id=[a.canonical.x,a.canonical.y,1<<a.canonical.z],v.u_zoom_transition=c,v.u_inv_rot_matrix=h,v.u_merc_center=u,v.u_up_dir=y.projection.upVector(new t.CanonicalTileID(0,0,0),u[0]*t.EXTENT,u[1]*t.EXTENT),v.u_height_lift=l),v},ki=(e,i,n,r,o,s,a,l,c,u,h,p)=>{const d=Oi(e,i,n,r,o,s,a,c,u,h,p),f={u_height_factor:-Math.pow(2,a.overscaledZ)/l.tileSize/8};return t.extend(d,Di(i,l),f)},Ni=t=>({u_matrix:t}),Bi=(e,i,n)=>t.extend(Ni(e),Di(i,n)),zi=(t,e)=>({u_matrix:t,u_world:e}),Fi=(e,i,n,r)=>t.extend(Bi(e,i,n),{u_world:r}),Vi=t.create(),Ui=(e,i,n,r,o,s)=>{const a=e.transform,l="globe"===a.projection.name;let c;if("map"===s.paint.get("circle-pitch-alignment"))if(l){const e=t.globePixelsToTileUnits(a.zoom,i.canonical)*a._pixelsPerMercatorPixel;c=Float32Array.from([e,0,0,e])}else c=a.calculatePixelsToTileUnitsMatrix(n);else c=new Float32Array([a.pixelsToGLUnits[0],0,0,a.pixelsToGLUnits[1]]);const u={u_camera_to_center_distance:a.cameraToCenterDistance,u_matrix:e.translatePosMatrix(i.projMatrix,n,s.paint.get("circle-translate"),s.paint.get("circle-translate-anchor")),u_device_pixel_ratio:t.exported.devicePixelRatio,u_extrude_scale:c,u_inv_rot_matrix:Vi,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=r,u.u_merc_center=o,u.u_tile_id=[i.canonical.x,i.canonical.y,1<<i.canonical.z],u.u_zoom_transition=t.globeToMercatorTransition(a.zoom);const e=o[0]*t.EXTENT,n=o[1]*t.EXTENT;u.u_up_dir=a.projection.upVector(new t.CanonicalTileID(0,0,0),e,n)}return u},Gi=t=>{const e=[];return"map"===t.paint.get("circle-pitch-alignment")&&e.push("PITCH_WITH_MAP"),"map"===t.paint.get("circle-pitch-scale")&&e.push("SCALE_WITH_MAP"),e},ji=(e,i,n,r)=>{const o=t.EXTENT/n.tileSize;return{u_matrix:e,u_camera_to_center_distance:i.getCameraToCenterDistance(r),u_extrude_scale:[i.pixelsToGLUnits[0]/o,i.pixelsToGLUnits[1]/o]}},Hi=(t,e,i=1)=>({u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:i}),Wi=t.create(),qi=(e,i,n,r,o,s,a)=>{const l=e.transform,c="globe"===l.projection.name,u=c?t.globePixelsToTileUnits(l.zoom,i.canonical)*l._pixelsPerMercatorPixel:P(n,1,s),h={u_matrix:i.projMatrix,u_extrude_scale:u,u_intensity:a,u_inv_rot_matrix:Wi,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(c){h.u_inv_rot_matrix=r,h.u_merc_center=o,h.u_tile_id=[i.canonical.x,i.canonical.y,1<<i.canonical.z],h.u_zoom_transition=t.globeToMercatorTransition(l.zoom);const e=o[0]*t.EXTENT,n=o[1]*t.EXTENT;h.u_up_dir=l.projection.upVector(new t.CanonicalTileID(0,0,0),e,n)}return h},Xi=(t,e,i,n,r,o,s)=>{const a=t.transform,l=a.calculatePixelsToTileUnitsMatrix(e);return{u_matrix:Qi(t,e,i,n),u_pixels_to_tile_units:l,u_device_pixel_ratio:o,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:r,u_texsize:Ji(i)?e.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:Yi(e,t.transform),u_alpha_discard_threshold:0,u_trim_offset:s}},Zi=(t,e,i,n,r)=>{const o=t.transform;return{u_matrix:Qi(t,e,i,n),u_texsize:e.imageAtlasTexture.size,u_pixels_to_tile_units:o.calculatePixelsToTileUnitsMatrix(e),u_device_pixel_ratio:r,u_image:0,u_tile_units_to_pixels:Yi(e,o),u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]],u_alpha_discard_threshold:0}};function Yi(t,e){return 1/P(t,1,e.tileZoom)}function Qi(t,e,i,n){return t.translatePosMatrix(n||e.tileID.projMatrix,e,i.paint.get("line-translate"),i.paint.get("line-translate-anchor"))}function Ji(t){const e=t.paint.get("line-dasharray").value;return e.value||"constant"!==e.kind}const Ki=(t,e,i,n,r,o)=>{return{u_matrix:t,u_tl_parent:e,u_scale_parent:i,u_fade_t:n.mix,u_opacity:n.opacity*r.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:r.paint.get("raster-brightness-min"),u_brightness_high:r.paint.get("raster-brightness-max"),u_saturation_factor:(a=r.paint.get("raster-saturation"),a>0?1-1/(1.001-a):-a),u_contrast_factor:(s=r.paint.get("raster-contrast"),s>0?1/(1-s):1+s),u_spin_weights:$i(r.paint.get("raster-hue-rotate")),u_perspective_transform:o};var s,a};function $i(t){t*=Math.PI/180;const e=Math.sin(t),i=Math.cos(t);return[(2*i+1)/3,(-Math.sqrt(3)*e-i+1)/3,(Math.sqrt(3)*e-i+1)/3]}const tn=t.create(),en=(e,i,n,r,o,s,a,l,c,u,h,p,d,f,m,g)=>{const y=o.transform,v={u_is_size_zoom_constant:+("constant"===e||"source"===e),u_is_size_feature_constant:+("constant"===e||"camera"===e),u_size_t:i?i.uSizeT:0,u_size:i?i.uSize:0,u_camera_to_center_distance:y.cameraToCenterDistance,u_rotate_symbol:+n,u_aspect_ratio:y.width/y.height,u_fade_change:o.options.fadeDuration?o.symbolFadeChange:1,u_matrix:s,u_label_plane_matrix:a,u_coord_matrix:l,u_is_text:+c,u_pitch_with_map:+r,u_texsize:u,u_texture:0,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:tn,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:tn,u_up_vector:[0,-1,0]};return"globe"===g.name&&(v.u_tile_id=[h.canonical.x,h.canonical.y,1<<h.canonical.z],v.u_zoom_transition=p,v.u_inv_rot_matrix=f,v.u_merc_center=d,v.u_camera_forward=y._camera.forward(),v.u_ecef_origin=t.globeECEFOrigin(y.globeMatrix,h.toUnwrapped()),v.u_tile_matrix=Float32Array.from(y.globeMatrix),v.u_up_vector=m),v},nn=(e,i,n,r,o,s,a,l,c,u,h,p,d,f,m,g,y)=>t.extend(en(e,i,n,r,o,s,a,l,c,u,p,d,f,m,g,y),{u_gamma_scale:r?o.transform.cameraToCenterDistance*Math.cos(o.terrain?0:o.transform._pitch):1,u_device_pixel_ratio:t.exported.devicePixelRatio,u_is_halo:+h}),rn=(e,i,n,r,o,s,a,l,c,u,h,p,d,f,m,g)=>t.extend(nn(e,i,n,r,o,s,a,l,!0,c,!0,h,p,d,f,m,g),{u_texsize_icon:u,u_texture_icon:1}),on=(t,e,i)=>({u_matrix:t,u_opacity:e,u_color:i}),sn=(e,i,n,r,o)=>t.extend(function(t,e,i){const n=e.imageManager.getPattern(t.toString()),{width:r,height:o}=e.imageManager.getPixelSize(),s=Math.pow(2,i.tileID.overscaledZ),a=i.tileSize*Math.pow(2,e.transform.tileZoom)/s,l=a*(i.tileID.canonical.x+i.tileID.wrap*s),c=a*i.tileID.canonical.y;return{u_image:0,u_pattern_tl:n.tl,u_pattern_br:n.br,u_texsize:[r,o],u_pattern_size:n.displaySize,u_tile_units_to_pixels:1/P(i,1,e.transform.tileZoom),u_pixel_coord_upper:[l>>16,c>>16],u_pixel_coord_lower:[65535&l,65535&c]}}(r,n,o),{u_matrix:e,u_opacity:i}),an={fillExtrusion:e=>({u_matrix:new t.UniformMatrix4f(e),u_lightpos:new t.Uniform3f(e),u_lightintensity:new t.Uniform1f(e),u_lightcolor:new t.Uniform3f(e),u_vertical_gradient:new t.Uniform1f(e),u_opacity:new t.Uniform1f(e),u_edge_radius:new t.Uniform1f(e),u_ao:new t.Uniform2f(e),u_tile_id:new t.Uniform3f(e),u_zoom_transition:new t.Uniform1f(e),u_inv_rot_matrix:new t.UniformMatrix4f(e),u_merc_center:new t.Uniform2f(e),u_up_dir:new t.Uniform3f(e),u_height_lift:new t.Uniform1f(e)}),fillExtrusionPattern:e=>({u_matrix:new t.UniformMatrix4f(e),u_lightpos:new t.Uniform3f(e),u_lightintensity:new t.Uniform1f(e),u_lightcolor:new t.Uniform3f(e),u_vertical_gradient:new t.Uniform1f(e),u_height_factor:new t.Uniform1f(e),u_edge_radius:new t.Uniform1f(e),u_ao:new t.Uniform2f(e),u_tile_id:new t.Uniform3f(e),u_zoom_transition:new t.Uniform1f(e),u_inv_rot_matrix:new t.UniformMatrix4f(e),u_merc_center:new t.Uniform2f(e),u_up_dir:new t.Uniform3f(e),u_height_lift:new t.Uniform1f(e),u_image:new t.Uniform1i(e),u_texsize:new t.Uniform2f(e),u_pixel_coord_upper:new t.Uniform2f(e),u_pixel_coord_lower:new t.Uniform2f(e),u_tile_units_to_pixels:new t.Uniform1f(e),u_opacity:new t.Uniform1f(e)}),fill:e=>({u_matrix:new t.UniformMatrix4f(e)}),fillPattern:e=>({u_matrix:new t.UniformMatrix4f(e),u_image:new t.Uniform1i(e),u_texsize:new t.Uniform2f(e),u_pixel_coord_upper:new t.Uniform2f(e),u_pixel_coord_lower:new t.Uniform2f(e),u_tile_units_to_pixels:new t.Uniform1f(e)}),fillOutline:e=>({u_matrix:new t.UniformMatrix4f(e),u_world:new t.Uniform2f(e)}),fillOutlinePattern:e=>({u_matrix:new t.UniformMatrix4f(e),u_world:new t.Uniform2f(e),u_image:new t.Uniform1i(e),u_texsize:new t.Uniform2f(e),u_pixel_coord_upper:new t.Uniform2f(e),u_pixel_coord_lower:new t.Uniform2f(e),u_tile_units_to_pixels:new t.Uniform1f(e)}),circle:e=>({u_camera_to_center_distance:new t.Uniform1f(e),u_extrude_scale:new t.UniformMatrix2f(e),u_device_pixel_ratio:new t.Uniform1f(e),u_matrix:new t.UniformMatrix4f(e),u_inv_rot_matrix:new t.UniformMatrix4f(e),u_merc_center:new t.Uniform2f(e),u_tile_id:new t.Uniform3f(e),u_zoom_transition:new t.Uniform1f(e),u_up_dir:new t.Uniform3f(e)}),collisionBox:e=>({u_matrix:new t.UniformMatrix4f(e),u_camera_to_center_distance:new t.Uniform1f(e),u_extrude_scale:new t.Uniform2f(e)}),collisionCircle:e=>({u_matrix:new t.UniformMatrix4f(e),u_inv_matrix:new t.UniformMatrix4f(e),u_camera_to_center_distance:new t.Uniform1f(e),u_viewport_size:new t.Uniform2f(e)}),debug:e=>({u_color:new t.UniformColor(e),u_matrix:new t.UniformMatrix4f(e),u_overlay:new t.Uniform1i(e),u_overlay_scale:new t.Uniform1f(e)}),clippingMask:e=>({u_matrix:new t.UniformMatrix4f(e)}),heatmap:e=>({u_extrude_scale:new t.Uniform1f(e),u_intensity:new t.Uniform1f(e),u_matrix:new t.UniformMatrix4f(e),u_inv_rot_matrix:new t.UniformMatrix4f(e),u_merc_center:new t.Uniform2f(e),u_tile_id:new t.Uniform3f(e),u_zoom_transition:new t.Uniform1f(e),u_up_dir:new t.Uniform3f(e)}),heatmapTexture:e=>({u_image:new t.Uniform1i(e),u_color_ramp:new t.Uniform1i(e),u_opacity:new t.Uniform1f(e)}),hillshade:e=>({u_matrix:new t.UniformMatrix4f(e),u_image:new t.Uniform1i(e),u_latrange:new t.Uniform2f(e),u_light:new t.Uniform2f(e),u_shadow:new t.UniformColor(e),u_highlight:new t.UniformColor(e),u_accent:new t.UniformColor(e)}),hillshadePrepare:e=>({u_matrix:new t.UniformMatrix4f(e),u_image:new t.Uniform1i(e),u_dimension:new t.Uniform2f(e),u_zoom:new t.Uniform1f(e),u_unpack:new t.Uniform4f(e)}),line:e=>({u_matrix:new t.UniformMatrix4f(e),u_pixels_to_tile_units:new t.UniformMatrix2f(e),u_device_pixel_ratio:new t.Uniform1f(e),u_units_to_pixels:new t.Uniform2f(e),u_dash_image:new t.Uniform1i(e),u_gradient_image:new t.Uniform1i(e),u_image_height:new t.Uniform1f(e),u_texsize:new t.Uniform2f(e),u_tile_units_to_pixels:new t.Uniform1f(e),u_alpha_discard_threshold:new t.Uniform1f(e),u_trim_offset:new t.Uniform2f(e)}),linePattern:e=>({u_matrix:new t.UniformMatrix4f(e),u_texsize:new t.Uniform2f(e),u_pixels_to_tile_units:new t.UniformMatrix2f(e),u_device_pixel_ratio:new t.Uniform1f(e),u_image:new t.Uniform1i(e),u_units_to_pixels:new t.Uniform2f(e),u_tile_units_to_pixels:new t.Uniform1f(e),u_alpha_discard_threshold:new t.Uniform1f(e)}),raster:e=>({u_matrix:new t.UniformMatrix4f(e),u_tl_parent:new t.Uniform2f(e),u_scale_parent:new t.Uniform1f(e),u_fade_t:new t.Uniform1f(e),u_opacity:new t.Uniform1f(e),u_image0:new t.Uniform1i(e),u_image1:new t.Uniform1i(e),u_brightness_low:new t.Uniform1f(e),u_brightness_high:new t.Uniform1f(e),u_saturation_factor:new t.Uniform1f(e),u_contrast_factor:new t.Uniform1f(e),u_spin_weights:new t.Uniform3f(e),u_perspective_transform:new t.Uniform2f(e)}),symbolIcon:e=>({u_is_size_zoom_constant:new t.Uniform1i(e),u_is_size_feature_constant:new t.Uniform1i(e),u_size_t:new t.Uniform1f(e),u_size:new t.Uniform1f(e),u_camera_to_center_distance:new t.Uniform1f(e),u_rotate_symbol:new t.Uniform1i(e),u_aspect_ratio:new t.Uniform1f(e),u_fade_change:new t.Uniform1f(e),u_matrix:new t.UniformMatrix4f(e),u_label_plane_matrix:new t.UniformMatrix4f(e),u_coord_matrix:new t.UniformMatrix4f(e),u_is_text:new t.Uniform1i(e),u_pitch_with_map:new t.Uniform1i(e),u_texsize:new t.Uniform2f(e),u_tile_id:new t.Uniform3f(e),u_zoom_transition:new t.Uniform1f(e),u_inv_rot_matrix:new t.UniformMatrix4f(e),u_merc_center:new t.Uniform2f(e),u_camera_forward:new t.Uniform3f(e),u_tile_matrix:new t.UniformMatrix4f(e),u_up_vector:new t.Uniform3f(e),u_ecef_origin:new t.Uniform3f(e),u_texture:new t.Uniform1i(e)}),symbolSDF:e=>({u_is_size_zoom_constant:new t.Uniform1i(e),u_is_size_feature_constant:new t.Uniform1i(e),u_size_t:new t.Uniform1f(e),u_size:new t.Uniform1f(e),u_camera_to_center_distance:new t.Uniform1f(e),u_rotate_symbol:new t.Uniform1i(e),u_aspect_ratio:new t.Uniform1f(e),u_fade_change:new t.Uniform1f(e),u_matrix:new t.UniformMatrix4f(e),u_label_plane_matrix:new t.UniformMatrix4f(e),u_coord_matrix:new t.UniformMatrix4f(e),u_is_text:new t.Uniform1i(e),u_pitch_with_map:new t.Uniform1i(e),u_texsize:new t.Uniform2f(e),u_texture:new t.Uniform1i(e),u_gamma_scale:new t.Uniform1f(e),u_device_pixel_ratio:new t.Uniform1f(e),u_tile_id:new t.Uniform3f(e),u_zoom_transition:new t.Uniform1f(e),u_inv_rot_matrix:new t.UniformMatrix4f(e),u_merc_center:new t.Uniform2f(e),u_camera_forward:new t.Uniform3f(e),u_tile_matrix:new t.UniformMatrix4f(e),u_up_vector:new t.Uniform3f(e),u_ecef_origin:new t.Uniform3f(e),u_is_halo:new t.Uniform1i(e)}),symbolTextAndIcon:e=>({u_is_size_zoom_constant:new t.Uniform1i(e),u_is_size_feature_constant:new t.Uniform1i(e),u_size_t:new t.Uniform1f(e),u_size:new t.Uniform1f(e),u_camera_to_center_distance:new t.Uniform1f(e),u_rotate_symbol:new t.Uniform1i(e),u_aspect_ratio:new t.Uniform1f(e),u_fade_change:new t.Uniform1f(e),u_matrix:new t.UniformMatrix4f(e),u_label_plane_matrix:new t.UniformMatrix4f(e),u_coord_matrix:new t.UniformMatrix4f(e),u_is_text:new t.Uniform1i(e),u_pitch_with_map:new t.Uniform1i(e),u_texsize:new t.Uniform2f(e),u_texsize_icon:new t.Uniform2f(e),u_texture:new t.Uniform1i(e),u_texture_icon:new t.Uniform1i(e),u_gamma_scale:new t.Uniform1f(e),u_device_pixel_ratio:new t.Uniform1f(e),u_is_halo:new t.Uniform1i(e)}),background:e=>({u_matrix:new t.UniformMatrix4f(e),u_opacity:new t.Uniform1f(e),u_color:new t.UniformColor(e)}),backgroundPattern:e=>({u_matrix:new t.UniformMatrix4f(e),u_opacity:new t.Uniform1f(e),u_image:new t.Uniform1i(e),u_pattern_tl:new t.Uniform2f(e),u_pattern_br:new t.Uniform2f(e),u_texsize:new t.Uniform2f(e),u_pattern_size:new t.Uniform2f(e),u_pixel_coord_upper:new t.Uniform2f(e),u_pixel_coord_lower:new t.Uniform2f(e),u_tile_units_to_pixels:new t.Uniform1f(e)}),terrainRaster:yi,terrainDepth:yi,skybox:e=>({u_matrix:new t.UniformMatrix4f(e),u_sun_direction:new t.Uniform3f(e),u_cubemap:new t.Uniform1i(e),u_opacity:new t.Uniform1f(e),u_temporal_offset:new t.Uniform1f(e)}),skyboxGradient:e=>({u_matrix:new t.UniformMatrix4f(e),u_color_ramp:new t.Uniform1i(e),u_center_direction:new t.Uniform3f(e),u_radius:new t.Uniform1f(e),u_opacity:new t.Uniform1f(e),u_temporal_offset:new t.Uniform1f(e)}),skyboxCapture:e=>({u_matrix_3f:new t.UniformMatrix3f(e),u_sun_direction:new t.Uniform3f(e),u_sun_intensity:new t.Uniform1f(e),u_color_tint_r:new t.Uniform4f(e),u_color_tint_m:new t.Uniform4f(e),u_luminance:new t.Uniform1f(e)}),globeRaster:e=>({u_proj_matrix:new t.UniformMatrix4f(e),u_globe_matrix:new t.UniformMatrix4f(e),u_normalize_matrix:new t.UniformMatrix4f(e),u_merc_matrix:new t.UniformMatrix4f(e),u_zoom_transition:new t.Uniform1f(e),u_merc_center:new t.Uniform2f(e),u_image0:new t.Uniform1i(e),u_grid_matrix:new t.UniformMatrix3f(e),u_skirt_height:new t.Uniform1f(e),u_frustum_tl:new t.Uniform3f(e),u_frustum_tr:new t.Uniform3f(e),u_frustum_br:new t.Uniform3f(e),u_frustum_bl:new t.Uniform3f(e),u_globe_pos:new t.Uniform3f(e),u_globe_radius:new t.Uniform1f(e),u_viewport:new t.Uniform2f(e)}),globeAtmosphere:e=>({u_frustum_tl:new t.Uniform3f(e),u_frustum_tr:new t.Uniform3f(e),u_frustum_br:new t.Uniform3f(e),u_frustum_bl:new t.Uniform3f(e),u_horizon:new t.Uniform1f(e),u_transition:new t.Uniform1f(e),u_fadeout_range:new t.Uniform1f(e),u_color:new t.Uniform4f(e),u_high_color:new t.Uniform4f(e),u_space_color:new t.Uniform4f(e),u_star_intensity:new t.Uniform1f(e),u_star_density:new t.Uniform1f(e),u_star_size:new t.Uniform1f(e),u_temporal_offset:new t.Uniform1f(e),u_horizon_angle:new t.Uniform1f(e),u_rotation_matrix:new t.UniformMatrix4f(e)})};let ln;function cn(e,i,n,r,o,s,a){const l=e.context,c=l.gl,u=e.transform,h=e.useProgram("collisionBox"),p=[];let d=0,f=0;for(let m=0;m<r.length;m++){const g=r[m],y=i.getTile(g),v=y.getBucket(n);if(!v)continue;const _=ve(g,v,u);let x=_;0===o[0]&&0===o[1]||(x=e.translatePosMatrix(_,y,o,s));const b=a?v.textCollisionBox:v.iconCollisionBox,w=v.collisionCircleArray;if(w.length>0){const e=t.create(),i=x;t.mul(e,v.placementInvProjMatrix,u.glCoordMatrix),t.mul(e,e,v.placementViewportMatrix),p.push({circleArray:w,circleOffset:f,transform:i,invTransform:e,projection:v.getProjection()}),d+=w.length/4,f=d}b&&(e.terrain&&e.terrain.setupElevationDraw(y,h),h.draw(l,c.LINES,t.DepthMode.disabled,t.StencilMode.disabled,e.colorModeForRenderPass(),t.CullFaceMode.disabled,ji(x,u,y,v.getProjection()),n.id,b.layoutVertexBuffer,b.indexBuffer,b.segments,null,u.zoom,null,[b.collisionVertexBuffer,b.collisionVertexBufferExt]))}if(!a||!p.length)return;const m=e.useProgram("collisionCircle"),g=new t.StructArrayLayout2f1f2i16;g.resize(4*d),g._trim();let y=0;for(const t of p)for(let e=0;e<t.circleArray.length/4;e++){const i=4*e,n=t.circleArray[i+0],r=t.circleArray[i+1],o=t.circleArray[i+2],s=t.circleArray[i+3];g.emplace(y++,n,r,o,s,0),g.emplace(y++,n,r,o,s,1),g.emplace(y++,n,r,o,s,2),g.emplace(y++,n,r,o,s,3)}(!ln||ln.length<2*d)&&(ln=function(e){const i=2*e,n=new t.StructArrayLayout3ui6;n.resize(i),n._trim();for(let t=0;t<i;t++){const e=6*t;n.uint16[e+0]=4*t+0,n.uint16[e+1]=4*t+1,n.uint16[e+2]=4*t+2,n.uint16[e+3]=4*t+2,n.uint16[e+4]=4*t+3,n.uint16[e+5]=4*t+0}return n}(d));const v=l.createIndexBuffer(ln,!0),_=l.createVertexBuffer(g,t.collisionCircleLayout.members,!0);for(const i of p){const r={u_matrix:i.transform,u_inv_matrix:i.invTransform,u_camera_to_center_distance:(x=u).getCameraToCenterDistance(i.projection),u_viewport_size:[x.width,x.height]};m.draw(l,c.TRIANGLES,t.DepthMode.disabled,t.StencilMode.disabled,e.colorModeForRenderPass(),t.CullFaceMode.disabled,r,n.id,_,v,t.SegmentVector.simpleSegment(0,2*i.circleOffset,i.circleArray.length,i.circleArray.length/2),null,u.zoom)}var x;_.destroy(),v.destroy()}const un=t.create();function hn({width:e,height:i,anchor:n,textOffset:r,textScale:o},s){const{horizontalAlign:a,verticalAlign:l}=t.getAnchorAlignment(n),c=-(a-.5)*e,u=-(l-.5)*i,h=t.evaluateVariableOffset(n,r);return new t.Point((c/o+h[0])*s,(u/o+h[1])*s)}function pn(e,i,n,r,o,s,a,l,c,u,h){const p=e.text.placedSymbolArray,d=e.text.dynamicLayoutVertexArray,f=e.icon.dynamicLayoutVertexArray,m={},g=e.getProjection(),y=_e(l,g,s),v=s.elevation,_=g.upVectorScale(l.canonical,s.center.lat,s.worldSize).metersToTile;d.clear();for(let f=0;f<p.length;f++){const x=p.get(f),{tileAnchorX:b,tileAnchorY:w,numGlyphs:A}=x,E=x.hidden||!x.crossTileID||e.allowVerticalPlacement&&!x.placedOrientation?null:r[x.crossTileID];if(E){let r=0,p=0,f=0;if(v){const t=v?v.getAtTileOffset(l,b,w):0,[e,i,n]=g.upVector(l.canonical,b,w);r=t*e*_,p=t*i*_,f=t*n*_}let[S,M,T,I]=ne(x.projectedAnchorX+r,x.projectedAnchorY+p,x.projectedAnchorZ+f,n?y:a);const C=re(s.getCameraToCenterDistance(g),I);let P=o.evaluateSizeForFeature(e.textSizeData,u,x)*C/t.ONE_EM;n&&(P*=e.tilePixelRatio/c);const L=hn(E,P);n?(({x:S,y:M,z:T}=g.projectTilePoint(b+L.x,w+L.y,l.canonical)),[S,M,T]=ne(S+r,M+p,T+f,a)):(i&&L._rotate(-s.angle),S+=L.x,M+=L.y,T=0);const D=e.allowVerticalPlacement&&x.placedOrientation===t.WritingMode.vertical?Math.PI/2:0;for(let e=0;e<A;e++)t.addDynamicAttributes(d,S,M,T,D);h&&x.associatedIconIndex>=0&&(m[x.associatedIconIndex]={x:S,y:M,z:T,angle:D})}else de(A,d)}if(h){f.clear();const i=e.icon.placedSymbolArray;for(let e=0;e<i.length;e++){const n=i.get(e),{numGlyphs:r}=n,o=m[e];if(n.hidden||!o)de(r,f);else{const{x:e,y:i,z:n,angle:s}=o;for(let o=0;o<r;o++)t.addDynamicAttributes(f,e,i,n,s)}}e.icon.dynamicLayoutVertexBuffer.updateData(f)}e.text.dynamicLayoutVertexBuffer.updateData(d)}function dn(t,e,i){return i.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function fn(e,i,n,r,o,s,a,l,c,u,h,p){const d=e.context,f=d.gl,m=e.transform,g="map"===l,y="map"===c,v=g&&"point"!==n.layout.get("symbol-placement"),_=g&&!y&&!v,x=void 0!==n.layout.get("symbol-sort-key").constantOr(1);let b=!1;const w=e.depthModeForSublayer(0,t.DepthMode.ReadOnly),A=[t.mercatorXfromLng(m.center.lng),t.mercatorYfromLat(m.center.lat)],E=n.layout.get("text-variable-anchor"),S="globe"===m.projection.name,M=[],T=[0,-1,0];let I=T;!S&&!m.mercatorFromTransition||g||(I=function(e){const i=e._camera.getWorldToCamera(e.worldSize,1),n=t.multiply([],i,e.globeMatrix);t.invert(n,n);const r=[0,0,0],o=[0,1,0,0];return t.transformMat4$1(o,o,n),r[0]=o[0],r[1]=o[1],r[2]=o[2],t.normalize(r,r),r}(m));for(const l of r){const r=i.getTile(l),c=r.getBucket(n);if(!c)continue;if("mercator"===c.projection.name&&S)continue;const h=o?c.text:c.icon;if(!h||c.fullyClipped||!h.segments.get().length)continue;const p=h.programConfigurations.get(n.id),d=o||c.sdfIcons,w=o?c.textSizeData:c.iconSizeData,C=y||0!==m.pitch,P=t.evaluateSizeForZoom(w,m.zoom);let L,D,R,O,k=[0,0],N=null;if(o)D=r.glyphAtlasTexture,R=f.LINEAR,L=r.glyphAtlasTexture.size,c.iconsInText&&(k=r.imageAtlasTexture.size,N=r.imageAtlasTexture,O=C||e.options.rotating||e.options.zooming||"composite"===w.kind||"camera"===w.kind?f.LINEAR:f.NEAREST);else{const t=1!==n.layout.get("icon-size").constantOr(0)||c.iconsNeedLinear;D=r.imageAtlasTexture,R=d||e.options.rotating||e.options.zooming||t||C?f.LINEAR:f.NEAREST,L=r.imageAtlasTexture.size}const B="globe"===c.projection.name,z=B?I:T,F=B?t.globeToMercatorTransition(m.zoom):0,V=_e(l,c.getProjection(),m),U=m.calculatePixelsToTileUnitsMatrix(r),G=te(V,r.tileID.canonical,y,g,m,c.getProjection(),U),j=e.terrain&&y&&v?t.invert(t.create(),G):un,H=ie(V,r.tileID.canonical,y,g,m,c.getProjection(),U),W=E&&c.hasTextData(),q="none"!==n.layout.get("icon-text-fit")&&W&&c.hasIconData();if(v){const t=m.elevation,i=t?t.getAtTileOffsetFunc(l,m.center.lat,m.worldSize,c.getProjection()):null,n=ee(V,r.tileID.canonical,y,g,m,c.getProjection(),U);se(c,V,e,o,n,H,y,u,i,l)}const X=v||o&&E||q,Z=e.translatePosMatrix(V,r,s,a),Y=X?un:G,Q=e.translatePosMatrix(H,r,s,a,!0),J=c.getProjection().createInversionMatrix(m,l.canonical),K=[];e.terrainRenderModeElevated()&&y&&K.push("PITCH_WITH_MAP_TERRAIN"),B&&K.push("PROJECTION_GLOBE_VIEW"),X&&K.push("PROJECTED_POS_ON_VIEWPORT");const $=d&&0!==n.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1);let tt;tt=d?c.iconsInText?rn(w.kind,P,_,y,e,Z,Y,Q,L,k,l,F,A,J,z,c.getProjection()):nn(w.kind,P,_,y,e,Z,Y,Q,o,L,!0,l,F,A,J,z,c.getProjection()):en(w.kind,P,_,y,e,Z,Y,Q,o,L,l,F,A,J,z,c.getProjection());const et={program:e.useProgram(dn(d,o,c),p,K),buffers:h,uniformValues:tt,atlasTexture:D,atlasTextureIcon:N,atlasInterpolation:R,atlasInterpolationIcon:O,isSDF:d,hasHalo:$,tile:r,labelPlaneMatrixInv:j};if(x&&c.canOverlap){b=!0;const e=h.segments.get();for(const i of e)M.push({segments:new t.SegmentVector([i]),sortKey:i.sortKey,state:et})}else M.push({segments:h.segments,sortKey:0,state:et})}b&&M.sort(((t,e)=>t.sortKey-e.sortKey));for(const t of M){const i=t.state;if(e.terrain&&e.terrain.setupElevationDraw(i.tile,i.program,{useDepthForOcclusion:!S,labelPlaneMatrixInv:i.labelPlaneMatrixInv}),d.activeTexture.set(f.TEXTURE0),i.atlasTexture.bind(i.atlasInterpolation,f.CLAMP_TO_EDGE),i.atlasTextureIcon&&(d.activeTexture.set(f.TEXTURE1),i.atlasTextureIcon&&i.atlasTextureIcon.bind(i.atlasInterpolationIcon,f.CLAMP_TO_EDGE)),i.isSDF){const r=i.uniformValues;i.hasHalo&&(r.u_is_halo=1,mn(i.buffers,t.segments,n,e,i.program,w,h,p,r)),r.u_is_halo=0}mn(i.buffers,t.segments,n,e,i.program,w,h,p,i.uniformValues)}}function mn(e,i,n,r,o,s,a,l,c){const u=r.context,h=[e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer,e.globeExtVertexBuffer];o.draw(u,u.gl.TRIANGLES,s,a,l,t.CullFaceMode.disabled,c,n.id,e.layoutVertexBuffer,e.indexBuffer,i,n.paint,r.transform.zoom,e.programConfigurations.get(n.id),h)}function gn(e,i,n,r,o,s,a){const l=e.context.gl,c=n.paint.get("fill-pattern"),u=c&&c.constantOr(1);let h,p,d,f,m;a?(p=u&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",h=l.LINES):(p=u?"fillPattern":"fill",h=l.TRIANGLES);for(const g of r){const r=i.getTile(g);if(u&&!r.patternsLoaded())continue;const y=r.getBucket(n);if(!y)continue;e.prepareDrawTile();const v=y.programConfigurations.get(n.id),_=e.useProgram(p,v);u&&(e.context.activeTexture.set(l.TEXTURE0),r.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),v.updatePaintBuffers());const x=c.constantOr(null);if(x&&r.imageAtlas){const t=r.imageAtlas.patternPositions[x.toString()];t&&v.setConstantPatternPositions(t)}const b=e.translatePosMatrix(g.projMatrix,r,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(a){f=y.indexBuffer2,m=y.segments2;const t=e.terrain&&e.terrain.renderingToTexture?e.terrain.drapeBufferSize:[l.drawingBufferWidth,l.drawingBufferHeight];d="fillOutlinePattern"===p&&u?Fi(b,e,r,t):zi(b,t)}else f=y.indexBuffer,m=y.segments,d=u?Bi(b,e,r):Ni(b);e.prepareDrawProgram(e.context,_,g.toUnwrapped()),_.draw(e.context,h,o,e.stencilModeForClipping(g),s,t.CullFaceMode.disabled,d,n.id,y.layoutVertexBuffer,f,m,n.paint,e.transform.zoom,v)}}function yn(e,i,n,r,o,s,a){const l=e.context,c=l.gl,u=e.transform,h=n.paint.get("fill-extrusion-pattern"),p=h.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"),y=g?0:m,v="globe"===u.projection.name?t.fillExtrusionHeightLift():0,_="globe"===u.projection.name,x=_?t.globeToMercatorTransition(u.zoom):0,b=[t.mercatorXfromLng(u.center.lng),t.mercatorYfromLat(u.center.lat)],w=[];_&&w.push("PROJECTION_GLOBE_VIEW"),f[0]>0&&w.push("FAUX_AO"),g&&w.push("ZERO_ROOF_RADIUS");for(const m of r){const r=i.getTile(m),g=r.getBucket(n);if(!g||g.projection.name!==u.projection.name)continue;const A=g.programConfigurations.get(n.id),E=e.useProgram(p?"fillExtrusionPattern":"fillExtrusion",A,w);if(e.terrain){const t=e.terrain;if(e.style.terrainSetForDrapingOnly())t.setupElevationDraw(r,E,{useMeterToDem:!0});else{if(!g.enableTerrain)continue;if(t.setupElevationDraw(r,E,{useMeterToDem:!0}),vn(l,i,m,g,n,t),!g.centroidVertexBuffer){const t=E.attributes.a_centroid_pos;void 0!==t&&c.vertexAttrib2f(t,0,0)}}}p&&(e.context.activeTexture.set(c.TEXTURE0),r.imageAtlasTexture.bind(c.LINEAR,c.CLAMP_TO_EDGE),A.updatePaintBuffers());const S=h.constantOr(null);if(S&&r.imageAtlas){const t=r.imageAtlas.patternPositions[S.toString()];t&&A.setConstantPatternPositions(t)}const M=e.translatePosMatrix(m.projMatrix,r,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),T=u.projection.createInversionMatrix(u,m.canonical),I=n.paint.get("fill-extrusion-vertical-gradient"),C=p?ki(M,e,I,d,f,y,m,r,v,x,b,T):Oi(M,e,I,d,f,y,m,v,x,b,T);e.prepareDrawProgram(l,E,m.toUnwrapped());const P=[];e.terrain&&P.push(g.centroidVertexBuffer),_&&P.push(g.layoutVertexExtBuffer),E.draw(l,l.gl.TRIANGLES,o,s,a,t.CullFaceMode.backCCW,C,n.id,g.layoutVertexBuffer,g.indexBuffer,g.segments,n.paint,e.transform.zoom,A,P)}}function vn(e,i,n,r,o,s){const a=[e=>{let i=e.canonical.x-1,n=e.wrap;return i<0&&(i=(1<<e.canonical.z)-1,n--),new t.OverscaledTileID(e.overscaledZ,n,e.canonical.z,i,e.canonical.y)},e=>{let i=e.canonical.x+1,n=e.wrap;return i===1<<e.canonical.z&&(i=0,n++),new t.OverscaledTileID(e.overscaledZ,n,e.canonical.z,i,e.canonical.y)},e=>new t.OverscaledTileID(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,(0===e.canonical.y?1<<e.canonical.z:e.canonical.y)-1),e=>new t.OverscaledTileID(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y===(1<<e.canonical.z)-1?0:e.canonical.y+1)],l=t=>{const e=i.getSource().minzoom,n=t=>{const e=i.getTileByID(t);if(e&&e.hasData())return e.getBucket(o)},r=[0,-1,1];for(const i of r){if(t.overscaledZ+i<e)continue;const r=n(t.calculateScaledKey(t.overscaledZ+i));if(r)return r}},c=[0,0,0],u=(e,i)=>(c[0]=Math.min(e.min.y,i.min.y),c[1]=Math.max(e.max.y,i.max.y),c[2]=t.EXTENT-i.min.x>e.max.x?i.min.x-t.EXTENT:e.max.x,c),h=(e,i)=>(c[0]=Math.min(e.min.x,i.min.x),c[1]=Math.max(e.max.x,i.max.x),c[2]=t.EXTENT-i.min.y>e.max.y?i.min.y-t.EXTENT:e.max.y,c),p=[(t,e)=>u(t,e),(t,e)=>u(e,t),(t,e)=>h(t,e),(t,e)=>h(e,t)],d=new t.Point(0,0);let f,m,g;const y=(e,i,r,o,a)=>{const l=[[o?r:e,o?e:r,0],[o?r:i,o?i:r,0]],c=a<0?t.EXTENT+a:a,u=[o?c:(e+i)/2,o?(e+i)/2:c,0];return 0===r&&a<0||0!==r&&a>0?s.getForTilePoints(g,[u],!0,m):l.push(u),s.getForTilePoints(n,l,!0,f),Math.max(l[0][2],l[1][2],u[2])/s.exaggeration()};for(let e=0;e<4;e++){const i=(e<2?1:5)-e,o=r.borders[e];if(0===o.length)continue;const c=g=a[e](n),u=l(c);if(!(u&&u instanceof t.FillExtrusionBucket&&u.enableTerrain))continue;if(r.borderDoneWithNeighborZ[e]===u.canonical.z&&u.borderDoneWithNeighborZ[i]===r.canonical.z)continue;if(m=s.findDEMTileFor(c),!m||!m.dem)continue;if(!f){const t=s.findDEMTileFor(n);if(!t||!t.dem)return;f=t}const h=u.borders[i];let v=0;const _=u.borderDoneWithNeighborZ[i]!==r.canonical.z;if(r.canonical.z===u.canonical.z){for(let n=0;n<o.length;n++){const s=r.featuresOnBorder[o[n]],a=s.borders[e];let l;for(;v<h.length&&(l=u.featuresOnBorder[h[v]],!(l.borders[i][1]>a[0]+3));)_&&u.encodeCentroid(void 0,l,!1),v++;if(l&&v<h.length){const n=v;let o=0;for(;!(l.borders[i][0]>a[1]-3)&&(o++,++v!==h.length);)l=u.featuresOnBorder[h[v]];if(l=u.featuresOnBorder[h[n]],s.intersectsCount()>1||l.intersectsCount()>1||1!==o){1!==o&&(v=n),r.encodeCentroid(void 0,s,!1),_&&u.encodeCentroid(void 0,l,!1);continue}const c=p[e](s,l),f=e%2?t.EXTENT-1:0;d.x=y(c[0],Math.min(t.EXTENT-1,c[1]),f,e<2,c[2]),d.y=0,r.encodeCentroid(d,s,!1),_&&u.encodeCentroid(d,l,!1)}else r.encodeCentroid(void 0,s,!1)}r.borderDoneWithNeighborZ[e]=u.canonical.z,r.needsCentroidUpdate=!0,_&&(u.borderDoneWithNeighborZ[i]=r.canonical.z,u.needsCentroidUpdate=!0)}else{for(const t of o)r.encodeCentroid(void 0,r.featuresOnBorder[t],!1);if(_){for(const t of h)u.encodeCentroid(void 0,u.featuresOnBorder[t],!1);u.borderDoneWithNeighborZ[i]=r.canonical.z,u.needsCentroidUpdate=!0}r.borderDoneWithNeighborZ[e]=u.canonical.z,r.needsCentroidUpdate=!0}}(r.needsCentroidUpdate||!r.centroidVertexBuffer&&0!==r.centroidVertexArray.length)&&r.uploadCentroid(e)}const _n=new t.Color(1,0,0,1),xn=new t.Color(0,1,0,1),bn=new t.Color(0,0,1,1),wn=new t.Color(1,0,1,1),An=new t.Color(0,1,1,1);function En(e,i,n){const r=e.context,o=e.transform,s=r.gl,a="globe"===o.projection.name,l=a?["PROJECTION_GLOBE_VIEW"]:null;let c=n.projMatrix;if(a&&t.globeToMercatorTransition(o.zoom)>0){const e=t.transitionTileAABBinECEF(n.canonical,o),i=t.globeDenormalizeECEF(e);c=t.multiply(new Float32Array(16),o.globeMatrix,i),t.multiply(c,o.projMatrix,c)}const u=e.useProgram("debug",null,l),h=i.getTileByID(n.key);e.terrain&&e.terrain.setupElevationDraw(h,u);const p=t.DepthMode.disabled,d=t.StencilMode.disabled,f=e.colorModeForRenderPass(),m="$debug";r.activeTexture.set(s.TEXTURE0),e.emptyTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE),a?h._makeGlobeTileDebugBuffers(e.context,o):h._makeDebugTileBoundsBuffers(e.context,o.projection);const g=h._tileDebugBuffer||e.debugBuffer,y=h._tileDebugIndexBuffer||e.debugIndexBuffer,v=h._tileDebugSegments||e.debugSegments;u.draw(r,s.LINE_STRIP,p,d,f,t.CullFaceMode.disabled,Hi(c,t.Color.red),m,g,y,v,null,null,null,[h._globeTileDebugBorderBuffer]);const _=h.latestRawTileData,x=Math.floor((_&&_.byteLength||0)/1024),b=i.getTile(n).tileSize,w=512/Math.min(b,512)*(n.overscaledZ/o.zoom)*.5;let A=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(A+=` => ${n.overscaledZ}`),A+=` ${x}kb`,function(t,e){t.initDebugOverlayCanvas();const i=t.debugOverlayCanvas,n=t.context.gl,r=t.debugOverlayCanvas.getContext("2d");r.clearRect(0,0,i.width,i.height),r.shadowColor="white",r.shadowBlur=2,r.lineWidth=1.5,r.strokeStyle="white",r.textBaseline="top",r.font="bold 36px Open Sans, sans-serif",r.fillText(e,5,5),r.strokeText(e,5,5),t.debugOverlayTexture.update(i),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(e,A);const E=h._tileDebugTextBuffer||e.debugBuffer,S=h._tileDebugTextIndexBuffer||e.quadTriangleIndexBuffer,M=h._tileDebugTextSegments||e.debugSegments;u.draw(r,s.TRIANGLES,p,d,t.ColorMode.alphaBlended,t.CullFaceMode.disabled,Hi(c,t.Color.transparent,w),m,E,S,M,null,null,null,[h._globeTileDebugTextBuffer])}function Sn(t,e,i,n){Tn(t,0,e+i/2,t.transform.width,i,n)}function Mn(t,e,i,n){Tn(t,e-i/2,0,i,t.transform.height,n)}function Tn(e,i,n,r,o,s){const a=e.context,l=a.gl;l.enable(l.SCISSOR_TEST),l.scissor(i*t.exported.devicePixelRatio,n*t.exported.devicePixelRatio,r*t.exported.devicePixelRatio,o*t.exported.devicePixelRatio),a.clear({color:s}),l.disable(l.SCISSOR_TEST)}const In=t.createLayout([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:Cn}=In;function Pn(t,e,i,n){t.emplaceBack(e,i,n)}class Ln{constructor(e){this.vertexArray=new t.StructArrayLayout3f12,this.indices=new t.StructArrayLayout3ui6,Pn(this.vertexArray,-1,-1,1),Pn(this.vertexArray,1,-1,1),Pn(this.vertexArray,-1,1,1),Pn(this.vertexArray,1,1,1),Pn(this.vertexArray,-1,-1,-1),Pn(this.vertexArray,1,-1,-1),Pn(this.vertexArray,-1,1,-1),Pn(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=e.createVertexBuffer(this.vertexArray,Cn),this.indexBuffer=e.createIndexBuffer(this.indices),this.segment=t.SegmentVector.simpleSegment(0,0,36,12)}}function Dn(e,i,n,r,o,s){const a=e.gl,l=i.paint.get("sky-atmosphere-color"),c=i.paint.get("sky-atmosphere-halo-color"),u=i.paint.get("sky-atmosphere-sun-intensity"),h=((t,e,i,n,r)=>({u_matrix_3f:t,u_sun_direction:e,u_sun_intensity:i,u_color_tint_r:[n.r,n.g,n.b,n.a],u_color_tint_m:[r.r,r.g,r.b,r.a],u_luminance:5e-5}))(t.fromMat4(t.create$1(),r),o,u,l,c);a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_CUBE_MAP_POSITIVE_X+s,i.skyboxTexture,0),n.draw(e,a.TRIANGLES,t.DepthMode.disabled,t.StencilMode.disabled,t.ColorMode.unblended,t.CullFaceMode.frontCW,h,"skyboxCapture",i.skyboxGeometry.vertexBuffer,i.skyboxGeometry.indexBuffer,i.skyboxGeometry.segment)}const Rn=t.createLayout([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class On{constructor(e){const i=new t.StructArrayLayout5f20;i.emplaceBack(-1,1,1,0,0),i.emplaceBack(1,1,1,1,0),i.emplaceBack(1,-1,1,1,1),i.emplaceBack(-1,-1,1,0,1);const n=new t.StructArrayLayout3ui6;n.emplaceBack(0,1,2),n.emplaceBack(2,3,0),this.vertexBuffer=e.createVertexBuffer(i,Rn.members),this.indexBuffer=e.createIndexBuffer(n),this.segments=t.SegmentVector.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}const kn={symbol:function(e,i,n,r,o){if("translucent"!==e.renderPass)return;const s=t.StencilMode.disabled,a=e.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(e,i,n,r,o,s,a){const l=i.transform,c="map"===o,u="map"===s;for(const i of e){const e=r.getTile(i),o=e.getBucket(n);if(!o||!o.text||!o.text.segments.get().length)continue;const s=t.evaluateSizeForZoom(o.textSizeData,l.zoom),h=_e(i,o.getProjection(),l),p=l.calculatePixelsToTileUnitsMatrix(e),d=te(h,e.tileID.canonical,u,c,l,o.getProjection(),p),f="none"!==n.layout.get("icon-text-fit")&&o.hasIconData();if(s){const n=Math.pow(2,l.zoom-e.tileID.overscaledZ);pn(o,c,u,a,t.symbolSize,l,d,i,n,s,f)}}}(r,e,n,i,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),o),0!==n.paint.get("icon-opacity").constantOr(1)&&fn(e,i,n,r,!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"),s,a),0!==n.paint.get("text-opacity").constantOr(1)&&fn(e,i,n,r,!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"),s,a),i.map.showCollisionBoxes&&(cn(e,i,n,r,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),cn(e,i,n,r,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))},circle:function(e,i,n,r){if("translucent"!==e.renderPass)return;const o=n.paint.get("circle-opacity"),s=n.paint.get("circle-stroke-width"),a=n.paint.get("circle-stroke-opacity"),l=void 0!==n.layout.get("circle-sort-key").constantOr(1);if(0===o.constantOr(1)&&(0===s.constantOr(1)||0===a.constantOr(1)))return;const c=e.context,u=c.gl,h=e.transform,p=e.depthModeForSublayer(0,t.DepthMode.ReadOnly),d=t.StencilMode.disabled,f=e.colorModeForRenderPass(),m="globe"===h.projection.name,g=[t.mercatorXfromLng(h.center.lng),t.mercatorYfromLat(h.center.lat)],y=[];for(let o=0;o<r.length;o++){const s=r[o],a=i.getTile(s),c=a.getBucket(n);if(!c||c.projection.name!==h.projection.name)continue;const u=c.programConfigurations.get(n.id),p=Gi(n);m&&p.push("PROJECTION_GLOBE_VIEW");const d=e.useProgram("circle",u,p),f=c.layoutVertexBuffer,v=c.globeExtVertexBuffer,_=c.indexBuffer,x=h.projection.createInversionMatrix(h,s.canonical),b={programConfiguration:u,program:d,layoutVertexBuffer:f,globeExtVertexBuffer:v,indexBuffer:_,uniformValues:Ui(e,s,a,x,g,n),tile:a};if(l){const e=c.segments.get();for(const i of e)y.push({segments:new t.SegmentVector([i]),sortKey:i.sortKey,state:b})}else y.push({segments:c.segments,sortKey:0,state:b})}l&&y.sort(((t,e)=>t.sortKey-e.sortKey));const v={useDepthForOcclusion:!m};for(const i of y){const{programConfiguration:r,program:o,layoutVertexBuffer:s,globeExtVertexBuffer:a,indexBuffer:l,uniformValues:m,tile:g}=i.state,y=i.segments;e.terrain&&e.terrain.setupElevationDraw(g,o,v),e.prepareDrawProgram(c,o,g.tileID.toUnwrapped()),o.draw(c,u.TRIANGLES,p,d,f,t.CullFaceMode.disabled,m,n.id,s,l,y,n.paint,h.zoom,r,[a])}},heatmap:function(e,i,n,r){if(0!==n.paint.get("heatmap-opacity"))if("offscreen"===e.renderPass){const o=e.context,s=o.gl,a=t.StencilMode.disabled,l=new t.ColorMode([s.ONE,s.ONE],t.Color.transparent,[!0,!0,!0,!0]);!function(t,e,i,n){const r=t.gl,o=e.width*n,s=e.height*n;t.activeTexture.set(r.TEXTURE1),t.viewport.set([0,0,o,s]);let a=i.heatmapFbo;if(!a||a&&(a.width!==o||a.height!==s)){a&&a.destroy();const e=r.createTexture();r.bindTexture(r.TEXTURE_2D,e),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),a=i.heatmapFbo=t.createFramebuffer(o,s,!1),function(t,e,i,n,r,o){const s=t.gl;s.texImage2D(s.TEXTURE_2D,0,t.isWebGL2&&t.extRenderToTextureHalfFloat?s.RGBA16F:s.RGBA,r,o,0,s.RGBA,t.extRenderToTextureHalfFloat?t.isWebGL2?s.HALF_FLOAT:t.extTextureHalfFloat.HALF_FLOAT_OES:s.UNSIGNED_BYTE,null),n.colorAttachment.set(i)}(t,0,e,a,o,s)}else r.bindTexture(r.TEXTURE_2D,a.colorAttachment.get()),t.bindFramebuffer.set(a.framebuffer)}(o,e,n,"globe"===e.transform.projection.name?.5:.25),o.clear({color:t.Color.transparent});const c=e.transform,u="globe"===c.projection.name,h=u?["PROJECTION_GLOBE_VIEW"]:null,p=u?t.CullFaceMode.frontCCW:t.CullFaceMode.disabled,d=[t.mercatorXfromLng(c.center.lng),t.mercatorYfromLat(c.center.lat)];for(let f=0;f<r.length;f++){const m=r[f];if(i.hasRenderableParent(m))continue;const g=i.getTile(m),y=g.getBucket(n);if(!y||y.projection.name!==c.projection.name)continue;const v=y.programConfigurations.get(n.id),_=e.useProgram("heatmap",v,h),{zoom:x}=e.transform;e.terrain&&e.terrain.setupElevationDraw(g,_),e.prepareDrawProgram(o,_,m.toUnwrapped());const b=c.projection.createInversionMatrix(c,m.canonical);_.draw(o,s.TRIANGLES,t.DepthMode.disabled,a,l,p,qi(e,m,g,b,d,x,n.paint.get("heatmap-intensity")),n.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,n.paint,e.transform.zoom,v,u?[y.globeExtVertexBuffer]:null)}o.viewport.set([0,0,e.width,e.height])}else"translucent"===e.renderPass&&(e.context.setColorMode(e.colorModeForRenderPass()),function(e,i){const n=e.context,r=n.gl,o=i.heatmapFbo;if(!o)return;n.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,o.colorAttachment.get()),n.activeTexture.set(r.TEXTURE1);let s=i.colorRampTexture;s||(s=i.colorRampTexture=new t.Texture(n,i.colorRamp,r.RGBA)),s.bind(r.LINEAR,r.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(n,r.TRIANGLES,t.DepthMode.disabled,t.StencilMode.disabled,e.colorModeForRenderPass(),t.CullFaceMode.disabled,((t,e,i,n)=>({u_image:0,u_color_ramp:1,u_opacity:e.paint.get("heatmap-opacity")}))(0,i),i.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,i.paint,e.transform.zoom)}(e,n))},line:function(e,i,n,r){if("translucent"!==e.renderPass)return;const o=n.paint.get("line-opacity"),s=n.paint.get("line-width");if(0===o.constantOr(1)||0===s.constantOr(1))return;const a=e.depthModeForSublayer(0,t.DepthMode.ReadOnly),l=e.colorModeForRenderPass(),c=e.terrain&&e.terrain.renderingToTexture?1:t.exported.devicePixelRatio,u=n.paint.get("line-dasharray"),h=u.constantOr(1),p=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",y=e.context,v=y.gl,_=(t=>{const e=[];Ji(t)&&e.push("RENDER_LINE_DASH"),t.paint.get("line-gradient")&&e.push("RENDER_LINE_GRADIENT");const i=t.paint.get("line-trim-offset");0===i[0]&&0===i[1]||e.push("RENDER_LINE_TRIM_OFFSET");const n=t.paint.get("line-pattern").constantOr(1),r=1!==t.paint.get("line-opacity").constantOr(1);return!n&&r&&e.push("RENDER_LINE_ALPHA_DISCARD"),e})(n);let x=_.includes("RENDER_LINE_ALPHA_DISCARD");e.terrain&&e.terrain.clipOrMaskOverlapStencilType()&&(x=!1);for(const o of r){const r=i.getTile(o);if(f&&!r.patternsLoaded())continue;const s=r.getBucket(n);if(!s)continue;e.prepareDrawTile();const b=s.programConfigurations.get(n.id),w=e.useProgram(g,b,_),A=d.constantOr(null);if(A&&r.imageAtlas){const t=r.imageAtlas.patternPositions[A.toString()];t&&b.setConstantPatternPositions(t)}const E=u.constantOr(null),S=p.constantOr(null);if(!f&&E&&S&&r.lineAtlas){const t=r.lineAtlas.getDash(E,S);t&&b.setConstantPatternPositions(t)}let[M,T]=n.paint.get("line-trim-offset");if("round"===S||"square"===S){const t=1;M!==T&&(0===M&&(M-=t),1===T&&(T+=t))}const I=e.terrain?o.projMatrix:null,C=f?Zi(e,r,n,I,c):Xi(e,r,n,I,s.lineClipsArray.length,c,[M,T]);if(m){const r=s.gradients[n.id];let a=r.texture;if(n.gradientVersion!==r.version){let l=256;if(n.stepInterpolant){const n=i.getSource().maxzoom,r=o.canonical.z===n?Math.ceil(1<<e.transform.maxZoom-o.canonical.z):1;l=t.clamp(t.nextPowerOfTwo(s.maxLineLength/t.EXTENT*1024*r),256,y.maxTextureSize)}r.gradient=t.renderColorRamp({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:l,image:r.gradient||void 0,clips:s.lineClipsArray}),r.texture?r.texture.update(r.gradient):r.texture=new t.Texture(y,r.gradient,v.RGBA),r.version=n.gradientVersion,a=r.texture}y.activeTexture.set(v.TEXTURE1),a.bind(n.stepInterpolant?v.NEAREST:v.LINEAR,v.CLAMP_TO_EDGE)}h&&(y.activeTexture.set(v.TEXTURE0),r.lineAtlasTexture.bind(v.LINEAR,v.REPEAT),b.updatePaintBuffers()),f&&(y.activeTexture.set(v.TEXTURE0),r.imageAtlasTexture.bind(v.LINEAR,v.CLAMP_TO_EDGE),b.updatePaintBuffers()),e.prepareDrawProgram(y,w,o.toUnwrapped());const P=i=>{w.draw(y,v.TRIANGLES,a,i,l,t.CullFaceMode.disabled,C,n.id,s.layoutVertexBuffer,s.indexBuffer,s.segments,n.paint,e.transform.zoom,b,[s.layoutVertexBuffer2])};if(x){const i=e.stencilModeForClipping(o).ref;0===i&&e.terrain&&y.clear({stencil:0});const n={func:v.EQUAL,mask:255};C.u_alpha_discard_threshold=.8,P(new t.StencilMode(n,i,255,v.KEEP,v.KEEP,v.INVERT)),C.u_alpha_discard_threshold=0,P(new t.StencilMode(n,i,255,v.KEEP,v.KEEP,v.KEEP))}else P(e.stencilModeForClipping(o))}x&&(e.resetStencilClippingMasks(),e.terrain&&y.clear({stencil:0}))},fill:function(e,i,n,r){const o=n.paint.get("fill-color"),s=n.paint.get("fill-opacity");if(0===s.constantOr(1))return;const a=e.colorModeForRenderPass(),l=n.paint.get("fill-pattern"),c=e.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===o.constantOr(t.Color.transparent).a&&1===s.constantOr(0)?"opaque":"translucent";if(e.renderPass===c){const o=e.depthModeForSublayer(1,"opaque"===e.renderPass?t.DepthMode.ReadWrite:t.DepthMode.ReadOnly);gn(e,i,n,r,o,a,!1)}if("translucent"===e.renderPass&&n.paint.get("fill-antialias")){const o=e.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,t.DepthMode.ReadOnly);gn(e,i,n,r,o,a,!0)}},"fill-extrusion":function(e,i,n,r){const o=n.paint.get("fill-extrusion-opacity");if(0!==o&&"translucent"===e.renderPass){const s=new t.DepthMode(e.context.gl.LEQUAL,t.DepthMode.ReadWrite,e.depthRangeFor3D);if(1!==o||n.paint.get("fill-extrusion-pattern").constantOr(1))yn(e,i,n,r,s,t.StencilMode.disabled,t.ColorMode.disabled),yn(e,i,n,r,s,e.stencilModeFor3D(),e.colorModeForRenderPass()),e.resetStencilClippingMasks();else{const o=e.colorModeForRenderPass();yn(e,i,n,r,s,t.StencilMode.disabled,o)}}},hillshade:function(e,i,n,r){if("offscreen"!==e.renderPass&&"translucent"!==e.renderPass)return;const o=e.context,s=e.depthModeForSublayer(0,t.DepthMode.ReadOnly),a=e.colorModeForRenderPass(),l=e.terrain&&e.terrain.renderingToTexture,[c,u]="translucent"!==e.renderPass||l?[{},r]:e.stencilConfigForOverlap(r);for(const r of u){const o=i.getTile(r);if(o.needsHillshadePrepare&&"offscreen"===e.renderPass)gi(e,o,n,s,t.StencilMode.disabled,a);else if("translucent"===e.renderPass){const t=l&&e.terrain?e.terrain.stencilModeForRTTOverlap(r):c[r.overscaledZ];fi(e,r,o,n,s,t,a)}}o.viewport.set([0,0,e.width,e.height]),e.resetStencilClippingMasks()},raster:function(e,i,n,r,o,s){if("translucent"!==e.renderPass)return;if(0===n.paint.get("raster-opacity"))return;if(!r.length)return;const a=e.context,l=a.gl,c=i.getSource(),u=e.useProgram("raster"),h=e.colorModeForRenderPass(),p=e.terrain&&e.terrain.renderingToTexture,[d,f]=c instanceof It||p?[{},r]:e.stencilConfigForOverlap(r),m=f[f.length-1].overscaledZ,g=!e.options.moving;for(const r of f){const o=p?t.DepthMode.disabled:e.depthModeForSublayer(r.overscaledZ-m,1===n.paint.get("raster-opacity")?t.DepthMode.ReadWrite:t.DepthMode.ReadOnly,l.LESS),f=r.toUnwrapped(),y=i.getTile(r);if(p&&(!y||!y.hasData()))continue;const v=p?r.projMatrix:e.transform.calculateProjMatrix(f,g),_=e.terrain&&p?e.terrain.stencilModeForRTTOverlap(r):d[r.overscaledZ],x=s?0:n.paint.get("raster-fade-duration");y.registerFadeDuration(x);const b=i.findLoadedParent(r,0),w=Mi(y,b,i,e.transform,x);let A,E;e.terrain&&e.terrain.prepareDrawTile();const S="nearest"===n.paint.get("raster-resampling")?l.NEAREST:l.LINEAR;a.activeTexture.set(l.TEXTURE0),y.texture.bind(S,l.CLAMP_TO_EDGE),a.activeTexture.set(l.TEXTURE1),b?(b.texture.bind(S,l.CLAMP_TO_EDGE),A=Math.pow(2,b.tileID.overscaledZ-y.tileID.overscaledZ),E=[y.tileID.canonical.x*A%1,y.tileID.canonical.y*A%1]):y.texture.bind(S,l.CLAMP_TO_EDGE),y.texture.useMipmap&&a.extTextureFilterAnisotropic&&e.transform.pitch>20&&l.texParameterf(l.TEXTURE_2D,a.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,a.extTextureFilterAnisotropicMax);const M=Ki(v,E||[0,0],A||1,w,n,c instanceof It?c.perspectiveTransform:[0,0]);if(e.prepareDrawProgram(a,u,f),c instanceof It)c.boundsBuffer&&c.boundsSegments&&u.draw(a,l.TRIANGLES,o,t.StencilMode.disabled,h,t.CullFaceMode.disabled,M,n.id,c.boundsBuffer,e.quadTriangleIndexBuffer,c.boundsSegments);else{const{tileBoundsBuffer:i,tileBoundsIndexBuffer:r,tileBoundsSegments:s}=e.getTileBoundsBuffers(y);u.draw(a,l.TRIANGLES,o,_,h,t.CullFaceMode.disabled,M,n.id,i,r,s)}}e.resetStencilClippingMasks()},background:function(e,i,n,r){const o=n.paint.get("background-color"),s=n.paint.get("background-opacity");if(0===s)return;const a=e.context,l=a.gl,c=e.transform,u=c.tileSize,h=n.paint.get("background-pattern");if(e.isPatternMissing(h))return;const p=!h&&1===o.a&&1===s&&e.opaquePassEnabledForLayer()?"opaque":"translucent";if(e.renderPass!==p)return;const d=t.StencilMode.disabled,f=e.depthModeForSublayer(0,"opaque"===p?t.DepthMode.ReadWrite:t.DepthMode.ReadOnly),m=e.colorModeForRenderPass(),g=e.useProgram(h?"backgroundPattern":"background");let y,v=r;v||(y=e.getBackgroundTiles(),v=Object.values(y).map((t=>t.tileID))),h&&(a.activeTexture.set(l.TEXTURE0),e.imageManager.bind(e.context));for(const p of v){const v=p.toUnwrapped(),_=r?p.projMatrix:e.transform.calculateProjMatrix(v);e.prepareDrawTile();const x=i?i.getTile(p):y?y[p.key]:new t.Tile(p,u,c.zoom,e),b=h?sn(_,s,e,h,{tileID:p,tileSize:u}):on(_,s,o);e.prepareDrawProgram(a,g,v);const{tileBoundsBuffer:w,tileBoundsIndexBuffer:A,tileBoundsSegments:E}=e.getTileBoundsBuffers(x);g.draw(a,l.TRIANGLES,f,d,m,t.CullFaceMode.disabled,b,n.id,w,A,E)}},sky:function(e,i,n){const r=e.transform,o="mercator"===r.projection.name||"globe"===r.projection.name?1:t.smoothstep(7,8,r.zoom),s=n.paint.get("sky-opacity")*o;if(0===s)return;const a=e.context,l=n.paint.get("sky-type"),c=new t.DepthMode(a.gl.LEQUAL,t.DepthMode.ReadOnly,[0,1]),u=e.frameCounter/1e3%1;"atmosphere"===l?"offscreen"===e.renderPass?n.needsSkyboxCapture(e)&&(function(e,i,n,r){const o=e.context,s=o.gl;let a=i.skyboxFbo;if(!a){a=i.skyboxFbo=o.createFramebuffer(32,32,!1),i.skyboxGeometry=new Ln(o),i.skyboxTexture=o.gl.createTexture(),s.bindTexture(s.TEXTURE_CUBE_MAP,i.skyboxTexture),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MIN_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MAG_FILTER,s.LINEAR);for(let t=0;t<6;++t)s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,s.RGBA,32,32,0,s.RGBA,s.UNSIGNED_BYTE,null)}o.bindFramebuffer.set(a.framebuffer),o.viewport.set([0,0,32,32]);const l=i.getCenter(e,!0),c=e.useProgram("skyboxCapture"),u=new Float64Array(16);t.identity(u),t.rotateY(u,u,.5*-Math.PI),Dn(o,i,c,u,l,0),t.identity(u),t.rotateY(u,u,.5*Math.PI),Dn(o,i,c,u,l,1),t.identity(u),t.rotateX(u,u,.5*-Math.PI),Dn(o,i,c,u,l,2),t.identity(u),t.rotateX(u,u,.5*Math.PI),Dn(o,i,c,u,l,3),t.identity(u),Dn(o,i,c,u,l,4),t.identity(u),t.rotateY(u,u,Math.PI),Dn(o,i,c,u,l,5),o.viewport.set([0,0,e.width,e.height])}(e,n),n.markSkyboxValid(e)):"sky"===e.renderPass&&function(e,i,n,r,o){const s=e.context,a=s.gl,l=e.transform,c=e.useProgram("skybox");s.activeTexture.set(a.TEXTURE0),a.bindTexture(a.TEXTURE_CUBE_MAP,i.skyboxTexture);const u=((t,e,i,n,r)=>({u_matrix:t,u_sun_direction:e,u_cubemap:0,u_opacity:n,u_temporal_offset:r}))(l.skyboxMatrix,i.getCenter(e,!1),0,r,o);e.prepareDrawProgram(s,c),c.draw(s,a.TRIANGLES,n,t.StencilMode.disabled,e.colorModeForRenderPass(),t.CullFaceMode.backCW,u,"skybox",i.skyboxGeometry.vertexBuffer,i.skyboxGeometry.indexBuffer,i.skyboxGeometry.segment)}(e,n,c,s,u):"gradient"===l&&"sky"===e.renderPass&&function(e,i,n,r,o){const s=e.context,a=s.gl,l=e.transform,c=e.useProgram("skyboxGradient");i.skyboxGeometry||(i.skyboxGeometry=new Ln(s)),s.activeTexture.set(a.TEXTURE0);let u=i.colorRampTexture;u||(u=i.colorRampTexture=new t.Texture(s,i.colorRamp,a.RGBA)),u.bind(a.LINEAR,a.CLAMP_TO_EDGE);const h=((e,i,n,r,o)=>({u_matrix:e,u_color_ramp:0,u_center_direction:i,u_radius:t.degToRad(n),u_opacity:r,u_temporal_offset:o}))(l.skyboxMatrix,i.getCenter(e,!1),i.paint.get("sky-gradient-radius"),r,o);e.prepareDrawProgram(s,c),c.draw(s,a.TRIANGLES,n,t.StencilMode.disabled,e.colorModeForRenderPass(),t.CullFaceMode.backCW,h,"skyboxGradient",i.skyboxGeometry.vertexBuffer,i.skyboxGeometry.indexBuffer,i.skyboxGeometry.segment)}(e,n,c,s,u)},debug:function(t,e,i){for(let n=0;n<i.length;n++)En(t,e,i[n])},custom:function(e,i,n,r){const o=e.context,s=n.implementation;if(!e.transform.projection.unsupportedLayers||!e.transform.projection.unsupportedLayers.includes("custom")||e.terrain&&(e.terrain.renderingToTexture||"offscreen"===e.renderPass)&&n.isLayerDraped()){if("offscreen"===e.renderPass){const i=s.prerender;if(i){if(e.setCustomLayerDefaults(),o.setColorMode(e.colorModeForRenderPass()),"globe"===e.transform.projection.name){const n=e.transform.pointMerc;i.call(s,o.gl,e.transform.customLayerMatrix(),e.transform.getProjection(),e.transform.globeToMercatorMatrix(),t.globeToMercatorTransition(e.transform.zoom),[n.x,n.y],e.transform.pixelsPerMeterRatio)}else i.call(s,o.gl,e.transform.customLayerMatrix());o.setDirty(),e.setBaseState()}}else if("translucent"===e.renderPass){if(e.terrain&&e.terrain.renderingToTexture){const i=s.renderToTile;if(i){const n=r[0].canonical,a=new t.MercatorCoordinate(n.x+r[0].wrap*(1<<n.z),n.y,n.z);o.setDepthMode(t.DepthMode.disabled),o.setStencilMode(t.StencilMode.disabled),o.setColorMode(e.colorModeForRenderPass()),e.setCustomLayerDefaults(),i.call(s,o.gl,a),o.setDirty(),e.setBaseState()}return}e.setCustomLayerDefaults(),o.setColorMode(e.colorModeForRenderPass()),o.setStencilMode(t.StencilMode.disabled);const i="3d"===s.renderingMode?new t.DepthMode(e.context.gl.LEQUAL,t.DepthMode.ReadWrite,e.depthRangeFor3D):e.depthModeForSublayer(0,t.DepthMode.ReadOnly);if(o.setDepthMode(i),"globe"===e.transform.projection.name){const i=e.transform.pointMerc;s.render(o.gl,e.transform.customLayerMatrix(),e.transform.getProjection(),e.transform.globeToMercatorMatrix(),t.globeToMercatorTransition(e.transform.zoom),[i.x,i.y],e.transform.pixelsPerMeterRatio)}else s.render(o.gl,e.transform.customLayerMatrix());o.setDirty(),e.setBaseState(),o.bindFramebuffer.set(null)}}else t.warnOnce("Custom layers are not yet supported with this projection. Use mercator or globe to enable usage of custom layers.")}};class Nn{constructor(e,i,n=!1){this.context=new Et(e,n),this.transform=i,this._tileTextures={},this.frameCopies=[],this.loadTimeStamps=[],this.setup(),this.numSublayers=t.SourceCache.maxUnderzooming+t.SourceCache.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.deferredRenderGpuTimeQueries=[],this.gpuTimers={},this.frameCounter=0,this._backgroundTiles={}}updateTerrain(t,e){const i=!!t&&!!t.terrain&&this.transform.projection.supportsTerrain;if(!(i||this._terrain&&this._terrain.enabled))return;this._terrain||(this._terrain=new Pi(this,t));const n=this._terrain;this.transform.elevation=i?n:null,n.update(t,this.transform,e)}_updateFog(t){const e=t.fog;if(!e||"globe"===this.transform.projection.name||e.getOpacity(this.transform.pitch)<1||e.properties.get("horizon-blend")<.03)return void(this.transform.fogCullDistSq=null);const[i,n]=e.getFovAdjustedRange(this.transform._fov);if(i>n)return void(this.transform.fogCullDistSq=null);const r=i+.78*(n-i);this.transform.fogCullDistSq=r*r}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled?this._terrain:null}resize(e,i){if(this.width=e*t.exported.devicePixelRatio,this.height=i*t.exported.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const t of this.style.order)this.style._layers[t].resize()}setup(){const e=this.context,i=new t.StructArrayLayout2i4;i.emplaceBack(0,0),i.emplaceBack(t.EXTENT,0),i.emplaceBack(0,t.EXTENT),i.emplaceBack(t.EXTENT,t.EXTENT),this.tileExtentBuffer=e.createVertexBuffer(i,t.posAttributes.members),this.tileExtentSegments=t.SegmentVector.simpleSegment(0,0,4,2);const n=new t.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(t.EXTENT,0),n.emplaceBack(0,t.EXTENT),n.emplaceBack(t.EXTENT,t.EXTENT),this.debugBuffer=e.createVertexBuffer(n,t.posAttributes.members),this.debugSegments=t.SegmentVector.simpleSegment(0,0,4,5);const r=new t.StructArrayLayout2i4;r.emplaceBack(-1,-1),r.emplaceBack(1,-1),r.emplaceBack(-1,1),r.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(r,t.posAttributes.members),this.viewportSegments=t.SegmentVector.simpleSegment(0,0,4,2);const o=new t.StructArrayLayout4i8;o.emplaceBack(0,0,0,0),o.emplaceBack(t.EXTENT,0,t.EXTENT,0),o.emplaceBack(0,t.EXTENT,0,t.EXTENT),o.emplaceBack(t.EXTENT,t.EXTENT,t.EXTENT,t.EXTENT),this.mercatorBoundsBuffer=e.createVertexBuffer(o,t.boundsAttributes.members),this.mercatorBoundsSegments=t.SegmentVector.simpleSegment(0,0,4,2);const s=new t.StructArrayLayout3ui6;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(s);const a=new t.StructArrayLayout1ui2;for(const t of[0,1,3,2,0])a.emplaceBack(t);this.debugIndexBuffer=e.createIndexBuffer(a),this.emptyTexture=new t.Texture(e,new t.RGBAImage({width:1,height:1},Uint8Array.of(0,0,0,0)),e.gl.RGBA),this.identityMat=t.create();const l=this.context.gl;this.stencilClearMode=new t.StencilMode({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO),this.loadTimeStamps.push(t.window.performance.now()),this.atmosphereBuffer=new On(this.context)}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(t){return t._makeTileBoundsBuffers(this.context,this.transform.projection),t._tileBoundsBuffer?{tileBoundsBuffer:t._tileBoundsBuffer,tileBoundsIndexBuffer:t._tileBoundsIndexBuffer,tileBoundsSegments:t._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const e=this.context,i=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.useProgram("clippingMask").draw(e,i.TRIANGLES,t.DepthMode.disabled,this.stencilClearMode,t.ColorMode.disabled,t.CullFaceMode.disabled,Si(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(e,i,n){if(!i||this.currentStencilSource===i.id||!e.isTileClipped()||!n||0===n.length)return;if(this._tileClippingMaskIDs&&!this.terrain){let t=!1;for(const e of n)if(void 0===this._tileClippingMaskIDs[e.key]){t=!0;break}if(!t)return}this.currentStencilSource=i.id;const r=this.context,o=r.gl;this.nextStencilID+n.length>256&&this.clearStencil(),r.setColorMode(t.ColorMode.disabled),r.setDepthMode(t.DepthMode.disabled);const s=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const e of n){const n=i.getTile(e),a=this._tileClippingMaskIDs[e.key]=this.nextStencilID++,{tileBoundsBuffer:l,tileBoundsIndexBuffer:c,tileBoundsSegments:u}=this.getTileBoundsBuffers(n);s.draw(r,o.TRIANGLES,t.DepthMode.disabled,new t.StencilMode({func:o.ALWAYS,mask:0},a,255,o.KEEP,o.KEEP,o.REPLACE),t.ColorMode.disabled,t.CullFaceMode.disabled,Si(e.projMatrix),"$clipping",l,c,u)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const e=this.nextStencilID++,i=this.context.gl;return new t.StencilMode({func:i.NOTEQUAL,mask:255},e,255,i.KEEP,i.KEEP,i.REPLACE)}stencilModeForClipping(e){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(e);const i=this.context.gl;return new t.StencilMode({func:i.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,i.KEEP,i.KEEP,i.REPLACE)}stencilConfigForOverlap(e){const i=this.context.gl,n=e.sort(((t,e)=>e.overscaledZ-t.overscaledZ)),r=n[n.length-1].overscaledZ,o=n[0].overscaledZ-r+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();const e={};for(let n=0;n<o;n++)e[n+r]=new t.StencilMode({func:i.GEQUAL,mask:255},n+this.nextStencilID,255,i.KEEP,i.KEEP,i.REPLACE);return this.nextStencilID+=o,[e,n]}return[{[r]:t.StencilMode.disabled},n]}colorModeForRenderPass(){const e=this.context.gl;if(this._showOverdrawInspector){const i=1/8;return new t.ColorMode([e.CONSTANT_COLOR,e.ONE],new t.Color(i,i,i,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?t.ColorMode.unblended:t.ColorMode.alphaBlended}depthModeForSublayer(e,i,n){if(!this.opaquePassEnabledForLayer())return t.DepthMode.disabled;const r=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new t.DepthMode(n||this.context.gl.LEQUAL,i,[r,r])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(e,i){this.style=e,this.options=i,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(t.exported.now()),this.imageManager.beginFrame();const n=this.style.order,r=this.style._sourceCaches;for(const t in r){const e=r[t];e.used&&e.prepare(this.context)}const o={},s={},a={};for(const t in r){const e=r[t];o[t]=e.getVisibleCoordinates(),s[t]=o[t].slice().reverse(),a[t]=e.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let t=0;t<n.length;t++)if(this.style._layers[n[t]].is3D()){this.opaquePassCutoff=t;break}if(this.terrain&&(this.terrain.updateTileBinding(a),this.opaquePassCutoff=0),"globe"!==this.transform.projection.name||this.globeSharedBuffers||(this.globeSharedBuffers=new t.GlobeSharedBuffers(this.context)),!t.isMapAuthenticated(this.context.gl))return;this.renderPass="offscreen";for(const t of n){const i=this.style._layers[t],n=e._getLayerSourceCache(i);if(!i.hasOffscreenPass()||i.isHidden(this.transform.zoom))continue;const r=n?s[n.id]:void 0;("custom"===i.type||i.isSky()||r&&r.length)&&this.renderLayer(this,n,i,r)}this.depthRangeFor3D=[0,1-(e.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:i.showOverdrawInspector?t.Color.black:t.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=i.showOverdrawInspector,this.renderPass="opaque",!this.terrain)for(this.currentLayer=n.length-1;this.currentLayer>=0;this.currentLayer--){const t=this.style._layers[n[this.currentLayer]],i=e._getLayerSourceCache(t);if(t.isSky())continue;const r=i?s[i.id]:void 0;this._renderTileClippingMasks(t,i,r),this.renderLayer(this,i,t,r)}if(this.style.fog&&this.transform.projection.supportsFog&&function(e,i){const n=e.context,r=n.gl,o=e.transform,s=new t.DepthMode(r.LEQUAL,t.DepthMode.ReadOnly,[0,1]),a=e.useProgram("globeAtmosphere",null,"globe"===o.projection.name?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"]),l=t.globeToMercatorTransition(o.zoom),c=i.properties.get("color").toArray01(),u=i.properties.get("high-color").toArray01(),h=i.properties.get("space-color").toArray01PremultipliedAlpha(),p=t.identity$1([]);t.rotateY$1(p,p,-t.degToRad(o._center.lng)),t.rotateX$1(p,p,t.degToRad(o._center.lat)),t.rotateZ$1(p,p,o.angle),t.rotateX$1(p,p,-o._pitch);const d=t.fromQuat(new Float32Array(16),p),f=t.mapValue(i.properties.get("star-intensity"),0,1,0,.25),m=5e-4,g=t.mapValue(i.properties.get("horizon-blend"),0,1,m,.25),y=t.globeUseCustomAntiAliasing(e,n,o)&&g===m?o.worldSize/(2*Math.PI*1.025)-1:o.globeRadius,v=e.frameCounter/1e3%1,_=t.length(o.globeCenterInViewSpace),x=Math.sqrt(Math.pow(_,2)-Math.pow(y,2)),b=Math.acos(x/_),w=((e,i,n,r,o,s,a,l,c,u,h,p,d,f)=>({u_frustum_tl:e,u_frustum_tr:i,u_frustum_br:n,u_frustum_bl:r,u_horizon:o,u_transition:s,u_fadeout_range:a,u_color:l,u_high_color:c,u_space_color:u,u_star_intensity:h,u_star_size:5*t.exported.devicePixelRatio,u_star_density:0,u_temporal_offset:p,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,h,f,v,b,d);e.prepareDrawProgram(n,a);const A=e.atmosphereBuffer;A&&a.draw(n,r.TRIANGLES,s,t.StencilMode.disabled,t.ColorMode.alphaBlended,t.CullFaceMode.backCW,w,"skybox",A.vertexBuffer,A.indexBuffer,A.segments)}(this,this.style.fog),this.renderPass="sky",(t.globeToMercatorTransition(this.transform.zoom)>0||"globe"!==this.transform.projection.name)&&this.transform.isHorizonVisible())for(this.currentLayer=0;this.currentLayer<n.length;this.currentLayer++){const t=this.style._layers[n[this.currentLayer]],i=e._getLayerSourceCache(t);t.isSky()&&this.renderLayer(this,i,t,i?s[i.id]:void 0)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<n.length;){const t=this.style._layers[n[this.currentLayer]],i=e._getLayerSourceCache(t);if(t.isSky()){++this.currentLayer;continue}if(this.terrain&&this.style.isLayerDraped(t)){if(t.isHidden(this.transform.zoom)){++this.currentLayer;continue}this.currentLayer=this.terrain.renderBatch(this.currentLayer);continue}const r=i?("symbol"===t.type?a:s)[i.id]:void 0;this._renderTileClippingMasks(t,i,i?o[i.id]:void 0),this.renderLayer(this,i,t,r),++this.currentLayer}if(this.terrain&&this.terrain.postRender(),this.options.showTileBoundaries||this.options.showQueryGeometry||this.options.showTileAABBs){let i=null;t.values(this.style._layers).forEach((t=>{const n=e._getLayerSourceCache(t);n&&!t.isHidden(this.transform.zoom)&&(!i||i.getSource().maxzoom<n.getSource().maxzoom)&&(i=n)})),i&&this.options.showTileBoundaries&&kn.debug(this,i,i.getVisibleCoordinates())}this.options.showPadding&&function(t){const e=t.transform.padding;Sn(t,t.transform.height-(e.top||0),3,_n),Sn(t,e.bottom||0,3,xn),Mn(t,e.left||0,3,bn),Mn(t,t.transform.width-(e.right||0),3,wn);const i=t.transform.centerPoint;!function(t,e,i,n){Tn(t,e-1,i-10,2,20,n),Tn(t,e-10,i-1,20,2,n)}(t,i.x,t.transform.height-i.y,An)}(this),this.context.setDefault(),this.frameCounter=(this.frameCounter+1)%Number.MAX_SAFE_INTEGER,this.tileLoaded&&this.options.speedIndexTiming&&(this.loadTimeStamps.push(t.window.performance.now()),this.saveCanvasCopy())}renderLayer(t,e,i,n){i.isHidden(this.transform.zoom)||("background"===i.type||"sky"===i.type||"custom"===i.type||n&&n.length)&&(this.id=i.id,this.gpuTimingStart(i),(!t.transform.projection.unsupportedLayers||!t.transform.projection.unsupportedLayers.includes(i.type)||t.terrain&&"custom"===i.type)&&kn[i.type](t,e,i,n,this.style.placement.variableOffsets,this.options.isInitialLoad),this.gpuTimingEnd())}gpuTimingStart(t){if(!this.options.gpuTiming)return;const e=this.context.extTimerQuery;let i=this.gpuTimers[t.id];i||(i=this.gpuTimers[t.id]={calls:0,cpuTime:0,query:e.createQueryEXT()}),i.calls++,e.beginQueryEXT(e.TIME_ELAPSED_EXT,i.query)}gpuTimingDeferredRenderStart(){if(this.options.gpuTimingDeferredRender){const t=this.context.extTimerQuery,e=t.createQueryEXT();this.deferredRenderGpuTimeQueries.push(e),t.beginQueryEXT(t.TIME_ELAPSED_EXT,e)}}gpuTimingDeferredRenderEnd(){if(!this.options.gpuTimingDeferredRender)return;const t=this.context.extTimerQuery;t.endQueryEXT(t.TIME_ELAPSED_EXT)}gpuTimingEnd(){if(!this.options.gpuTiming)return;const t=this.context.extTimerQuery;t.endQueryEXT(t.TIME_ELAPSED_EXT)}collectGpuTimers(){const t=this.gpuTimers;return this.gpuTimers={},t}collectDeferredRenderGpuQueries(){const t=this.deferredRenderGpuTimeQueries;return this.deferredRenderGpuTimeQueries=[],t}queryGpuTimers(t){const e={};for(const i in t){const n=t[i],r=this.context.extTimerQuery,o=r.getQueryObjectEXT(n.query,r.QUERY_RESULT_EXT)/1e6;r.deleteQueryEXT(n.query),e[i]=o}return e}queryGpuTimeDeferredRender(t){if(!this.options.gpuTimingDeferredRender)return 0;const e=this.context.extTimerQuery;let i=0;for(const n of t)i+=e.getQueryObjectEXT(n,e.QUERY_RESULT_EXT)/1e6,e.deleteQueryEXT(n);return i}translatePosMatrix(e,i,n,r,o){if(!n[0]&&!n[1])return e;const s=o?"map"===r?this.transform.angle:0:"viewport"===r?-this.transform.angle:0;if(s){const t=Math.sin(s),e=Math.cos(s);n=[n[0]*e-n[1]*t,n[0]*t+n[1]*e]}const a=[o?n[0]:P(i,n[0],this.transform.zoom),o?n[1]:P(i,n[1],this.transform.zoom),0],l=new Float32Array(16);return t.translate(l,e,a),l}saveTileTexture(t){const e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]}getTileTexture(t){const e=this._tileTextures[t];return e&&e.length>0?e.pop():null}isPatternMissing(t){return null===t||void 0!==t&&!this.imageManager.getPattern(t.toString())}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture}currentGlobalDefines(){const t=this.terrain&&this.terrain.renderingToTexture,e=this.terrain&&0===this.terrain.exaggeration(),i=this.style&&this.style.fog,n=[];return this.terrainRenderModeElevated()&&n.push("TERRAIN"),"globe"===this.transform.projection.name&&n.push("GLOBE"),e&&n.push("ZERO_EXAGGERATION"),i&&!t&&0!==i.getOpacity(this.transform.pitch)&&n.push("FOG"),t&&n.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&n.push("OVERDRAW_INSPECTOR"),n}useProgram(t,e,i){this.cache=this.cache||{};const n=i||[],r=this.currentGlobalDefines().concat(n),o=Li.cacheKey(ci[t],t,r,e);return this.cache[o]||(this.cache[o]=new Li(this.context,t,ci[t],e,an[t],r)),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 t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new t.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(e,i,n){if(this.terrain&&this.terrain.renderingToTexture)return;const r=this.style.fog;if(r){const o=r.getOpacity(this.transform.pitch),s=((e,i,n,r,o,s,a,l,c,u,h)=>{const p=e.transform,d=i.properties.get("color").toArray01();d[3]=r;const f=e.frameCounter/1e3%1;return{u_fog_matrix:n?p.calculateFogTileMatrix(n):e.identityMat,u_fog_range:i.getFovAdjustedRange(p._fov),u_fog_color:d,u_fog_horizon_blend:i.properties.get("horizon-blend"),u_fog_temporal_offset:f,u_frustum_tl:o,u_frustum_tr:s,u_frustum_br:a,u_frustum_bl:l,u_globe_pos:c,u_globe_radius:u,u_viewport:h,u_globe_transition:t.globeToMercatorTransition(p.zoom),u_is_globe:+("globe"===p.projection.name)}})(this,r,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*t.exported.devicePixelRatio,this.transform.height*t.exported.devicePixelRatio]);i.setFogUniformValues(e,s)}}setTileLoadedFlag(t){this.tileLoaded=t}saveCanvasCopy(){const t=this.canvasCopy();t&&(this.frameCopies.push(t),this.tileLoaded=!1)}canvasCopy(){const t=this.context.gl,e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.copyTexImage2D(t.TEXTURE_2D,0,t.RGBA,0,0,t.drawingBufferWidth,t.drawingBufferHeight,0),e}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const t=this.style&&this.style.fog;return!!t&&0!==t.getOpacity(this.transform.pitch)}getBackgroundTiles(){const e=this._backgroundTiles,i=this._backgroundTiles={},n=this.transform.coveringTiles({tileSize:512});for(const r of n)i[r.key]=e[r.key]||new t.Tile(r,512,this.transform.tileZoom,this);return i}clearBackgroundTiles(){this._backgroundTiles={}}}class Bn{constructor(t=0,e=0,i=0,n=0){if(isNaN(t)||t<0||isNaN(e)||e<0||isNaN(i)||i<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=i,this.right=n}interpolate(e,i,n){return null!=i.top&&null!=e.top&&(this.top=t.number(e.top,i.top,n)),null!=i.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,i.bottom,n)),null!=i.left&&null!=e.left&&(this.left=t.number(e.left,i.left,n)),null!=i.right&&null!=e.right&&(this.right=t.number(e.right,i.right,n)),this}getCenter(e,i){const n=t.clamp((this.left+e-this.right)/2,0,e),r=t.clamp((this.top+i-this.bottom)/2,0,i);return new t.Point(n,r)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.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 zn(e,i){const n=t.getColumn(e,3);t.fromQuat(e,i),t.setColumn(e,3,n)}function Fn(e,i){const n=t.identity$1([]);return t.rotateZ$1(n,n,-i),t.rotateX$1(n,n,-e),n}function Vn(e,i){const n=[e[0],e[1],0],r=[i[0],i[1],0];if(t.length(n)>=1e-15){const e=t.normalize([],n);t.scale$2(r,e,t.dot(r,e)),i[0]=r[0],i[1]=r[1]}const o=t.cross([],i,e);if(t.len(o)<1e-15)return null;const s=Math.atan2(-o[1],o[0]);return Fn(Math.atan2(Math.sqrt(e[0]*e[0]+e[1]*e[1]),-e[2]),s)}class Un{constructor(t,e){this.position=t,this.orientation=e}get position(){return this._position}set position(e){if(e){const i=e instanceof t.MercatorCoordinate?e:new t.MercatorCoordinate(e[0],e[1],e[2]);this._renderWorldCopies&&(i.x=t.wrap(i.x,0,1)),this._position=i}else this._position=null}lookAtPoint(e,i){if(this.orientation=null,!this.position)return;const n=this.position,r=this._elevation?this._elevation.getAtPointOrZero(t.MercatorCoordinate.fromLngLat(e)):0,o=t.MercatorCoordinate.fromLngLat(e,r),s=[o.x-n.x,o.y-n.y,o.z-n.z];i||(i=[0,0,1]),i[2]=Math.abs(i[2]),this.orientation=Vn(s,i)}setPitchBearing(e,i){this.orientation=Fn(t.degToRad(e),t.degToRad(-i))}}class Gn{constructor(e,i){this._transform=t.identity([]),this.orientation=i,this.position=e}get mercatorPosition(){const e=this.position;return new t.MercatorCoordinate(e[0],e[1],e[2])}get position(){const e=t.getColumn(this._transform,3);return[e[0],e[1],e[2]]}set position(e){var i;e&&t.setColumn(this._transform,3,[(i=e)[0],i[1],i[2],1])}get orientation(){return this._orientation}set orientation(e){this._orientation=e||t.identity$1([]),e&&zn(this._transform,this._orientation)}getPitchBearing(){const t=this.forward(),e=this.right();return{bearing:Math.atan2(-e[1],e[0]),pitch:Math.atan2(Math.sqrt(t[0]*t[0]+t[1]*t[1]),-t[2])}}setPitchBearing(t,e){this._orientation=Fn(t,e),zn(this._transform,this._orientation)}forward(){const e=t.getColumn(this._transform,2);return[-e[0],-e[1],-e[2]]}up(){const e=t.getColumn(this._transform,1);return[-e[0],-e[1],-e[2]]}right(){const e=t.getColumn(this._transform,0);return[e[0],e[1],e[2]]}getCameraToWorld(e,i){const n=new Float64Array(16);return t.invert(n,this.getWorldToCamera(e,i)),n}getWorldToCameraPosition(e,i,n){const r=this.position;t.scale$2(r,r,-e);const o=new Float64Array(16);return t.fromScaling(o,[n,n,n]),t.translate(o,o,r),o[10]*=i,o}getWorldToCamera(e,i){const n=new Float64Array(16),r=new Float64Array(4),o=this.position;return t.conjugate(r,this._orientation),t.scale$2(o,o,-e),t.fromQuat(n,r),t.translate(n,n,o),n[1]*=-1,n[5]*=-1,n[9]*=-1,n[13]*=-1,n[8]*=i,n[9]*=i,n[10]*=i,n[11]*=i,n}getCameraToClipPerspective(e,i,n,r){const o=new Float64Array(16);return t.perspective(o,e,i,n,r),o}getDistanceToElevation(e,i=!1){const n=0===e?0:t.mercatorZfromAltitude(e,i?t.latFromMercatorY(this.position[1]):this.position[1]),r=this.forward();return(n-this.position[2])/r[2]}clone(){return new Gn([...this.position],[...this.orientation])}}function jn(e,i){const n=Wn(e.projection,e.zoom,e.width,e.height),r=function(e,i,n,r,o){const s=new t.LngLat(n.lng-180*qn,n.lat),a=new t.LngLat(n.lng+180*qn,n.lat),l=e.project(s.lng,s.lat),c=e.project(a.lng,a.lat),u=-Math.atan2(c.y-l.y,c.x-l.x),h=t.MercatorCoordinate.fromLngLat(n);h.y=t.clamp(h.y,-1+qn,1-qn);const p=h.toLngLat(),d=e.project(p.lng,p.lat),f=t.MercatorCoordinate.fromLngLat(p);f.x+=qn;const m=f.toLngLat(),g=e.project(m.lng,m.lat),y=Zn(g.x-d.x,g.y-d.y,u),v=t.MercatorCoordinate.fromLngLat(p);v.y+=qn;const _=v.toLngLat(),x=e.project(_.lng,_.lat),b=Zn(x.x-d.x,x.y-d.y,u),w=Math.abs(y.x)/Math.abs(b.y),A=t.identity([]);t.rotateZ(A,A,-u*(1-(o?0:r)));const E=t.identity([]);return t.scale(E,E,[1,1-(1-w)*r,1]),E[4]=-b.x/b.y*r,t.rotateZ(E,E,u),t.multiply(E,A,E),E}(e.projection,0,e.center,n,i),o=Hn(e);return t.scale(r,r,[o,o,1]),r}function Hn(e){const i=e.projection,n=Wn(e.projection,e.zoom,e.width,e.height),r=Xn(i,e.center),o=Xn(i,t.LngLat.convert(i.center));return Math.pow(2,r*n+(1-n)*o)}function Wn(e,i,n,r,o=1/0){const s=e.range;if(!s)return 0;const a=Math.min(o,Math.max(n,r)),l=Math.log(a/1024)/Math.LN2;return t.smoothstep(s[0]+l,s[1]+l,i)}const qn=1/4e4;function Xn(e,i){const n=t.clamp(i.lat,-t.MAX_MERCATOR_LATITUDE,t.MAX_MERCATOR_LATITUDE),r=new t.LngLat(i.lng-180*qn,n),o=new t.LngLat(i.lng+180*qn,n),s=e.project(r.lng,n),a=e.project(o.lng,n),l=t.MercatorCoordinate.fromLngLat(r),c=t.MercatorCoordinate.fromLngLat(o),u=a.x-s.x,h=a.y-s.y,p=c.x-l.x,d=c.y-l.y,f=Math.sqrt((p*p+d*d)/(u*u+h*h));return Math.log(f)/Math.LN2}function Zn(t,e,i){const n=Math.cos(i),r=Math.sin(i);return{x:t*n-e*r,y:t*r+e*n}}class Yn{constructor(e,i,n,r,o,s,a){this.tileSize=512,this._renderWorldCopies=void 0===o||o,this._minZoom=e||0,this._maxZoom=i||22,this._minPitch=null==n?0:n,this._maxPitch=null==r?60:r,this.setProjection(s),this.setMaxBounds(a),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new Bn,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._distanceTileDataCache={},this._camera=new Gn,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 t=new Yn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection());return t._elevation=this._elevation,t._centerAltitude=this._centerAltitude,t._centerAltitudeValidForExaggeration=this._centerAltitudeValidForExaggeration,t.tileSize=this.tileSize,t.mercatorFromTransition=this.mercatorFromTransition,t.width=this.width,t.height=this.height,t.cameraElevationReference=this.cameraElevationReference,t._center=this._center,t._setZoom(this.zoom),t._seaLevelZoom=this._seaLevelZoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._nearZ=this._nearZ,t._farZ=this._farZ,t._averageElevation=this._averageElevation,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._camera=this._camera.clone(),t._calcMatrices(),t.freezeTileCoverage=this.freezeTileCoverage,t.frustumCorners=this.frustumCorners,t}get elevation(){return this._elevation}set elevation(t){this._elevation!==t&&(this._elevation=t,this._updateCameraOnTerrain(),this._calcMatrices())}updateElevation(t,e=!1){const i=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForExaggeration;(null==this._seaLevelZoom||i)&&this._updateCameraOnTerrain(),(t||i)&&this._constrainCamera(e),this._calcMatrices()}getProjection(){return t.pick(this.projection,["name","center","parallels"])}setProjection(i){this.projectionOptions=i||{name:"mercator"};const n=this.projection?this.getProjection():void 0;this.projection=t.getProjection(this.projectionOptions);const r=!e(n,this.getProjection());return r&&this._calcMatrices(),this.mercatorFromTransition=!1,r}setMercatorFromTransition(){const e=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=t.getProjection({name:"mercator"});const i=e!==this.projection.name;return i&&this._calcMatrices(),i}get minZoom(){return this._minZoom}set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))}get maxZoom(){return this._maxZoom}set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))}get minPitch(){return this._minPitch}set minPitch(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))}get maxPitch(){return this._maxPitch}set maxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))}get renderWorldCopies(){return this._renderWorldCopies&&!0===this.projection.supportsWorldCopies}set renderWorldCopies(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){const t=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(t))}get cameraWorldSize(){const t=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(t))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return t.mercatorZfromAltitude(this.center.lat,this.cameraWorldSizeForFog)}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new t.Point(this.width,this.height)}get bearing(){return t.wrap(this.rotation,-180,180)}set bearing(t){this.rotation=t}get rotation(){return-this.angle/Math.PI*180}set rotation(e){const i=-e*Math.PI/180;var n;this.angle!==i&&(this._unmodified=!1,this.angle=i,this._calcMatrices(),this.rotationMatrix=(n=new t.ARRAY_TYPE(4),t.ARRAY_TYPE!=Float32Array&&(n[1]=0,n[2]=0),n[0]=1,n[3]=1,n),function(t,e,i){var n=e[0],r=e[1],o=e[2],s=e[3],a=Math.sin(i),l=Math.cos(i);t[0]=n*l+o*a,t[1]=r*l+s*a,t[2]=n*-a+o*l,t[3]=r*-a+s*l}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(e){const i=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==i&&(this._unmodified=!1,this._pitch=i,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 t=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/t)}set fov(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=t.degToRad(e),this._calcMatrices())}get averageElevation(){return this._averageElevation}set averageElevation(t){this._averageElevation=t,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(t){const e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._setZoom(e),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(t){this._zoom=t,this.scale=this.zoomScale(t),this.tileZoom=Math.floor(t),this.zoomFraction=t-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 t=this._elevation;this._centerAltitude=t.getAtPointOrZero(this.locationCoordinate(this.center)),this._centerAltitudeValidForExaggeration=t.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 e=this._elevation,i=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],n=this.horizonLineFromTop();let r=0,o=0;for(let s=0;s<i.length;s++){const a=new t.Point(i[s][0]*this.width,n+i[s][1]*(this.height-n)),l=e.pointCoordinate(a);if(!l)continue;const c=1/Math.hypot(l[0]-this._camera.position[0],l[1]-this._camera.position[1]);r+=l[3]*c,o+=c}return 0===o?NaN:r/o}get center(){return this._center}set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._terrainEnabled()&&("ground"===this.cameraElevationReference?this._updateCameraOnTerrain():this._updateZoomFromElevation()),this._constrain(),this._calcMatrices())}_updateZoomFromElevation(){if(null==this._seaLevelZoom||!this._elevation)return;const t=this._seaLevelZoom,e=this._elevation.getAtPointOrZero(this.locationCoordinate(this.center)),i=this.pixelsPerMeter/this.worldSize*e,n=this._mercatorZfromZoom(t),r=this._mercatorZfromZoom(this._maxZoom),o=Math.max(n-i,r);this._setZoom(this._zoomFromMercatorZ(o))}get padding(){return this._edgeInsets.toJSON()}set padding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}computeZoomRelativeTo(e){const i=this.rayIntersectionCoordinate(this.pointRayIntersection(this.centerPoint,e.toAltitude()));let n;n=e.z<this._camera.position[2]?[i.x,i.y,i.z]:[e.x,e.y,e.z];const r=t.length(t.sub([],this._camera.position,n));return t.clamp(this._zoomFromMercatorZ(r),this._minZoom,this._maxZoom)}setFreeCameraOptions(e){if(!this.height)return;if(!e.position&&!e.orientation)return;this._updateCameraState();let i=!1;if(e.orientation&&!t.exactEquals(e.orientation,this._camera.orientation)&&(i=this._setCameraOrientation(e.orientation)),e.position){const n=[e.position.x,e.position.y,e.position.z];t.exactEquals$1(n,this._camera.position)||(this._setCameraPosition(n),i=!0)}i&&(this._updateStateFromCamera(),this.recenterOnTerrain())}getFreeCameraOptions(){this._updateCameraState();const e=this._camera.position,i=new Un;return i.position=new t.MercatorCoordinate(e[0],e[1],e[2]),i.orientation=this._camera.orientation,i._elevation=this.elevation,i._renderWorldCopies=this.renderWorldCopies,i}_setCameraOrientation(e){if(!t.length$1(e))return!1;t.normalize$1(e,e);const i=t.transformQuat([],[0,0,-1],e),n=t.transformQuat([],[0,-1,0],e);if(n[2]<0)return!1;const r=Vn(i,n);return!!r&&(this._camera.orientation=r,!0)}_setCameraPosition(e){const i=this.zoomScale(this.minZoom)*this.tileSize,n=this.zoomScale(this.maxZoom)*this.tileSize,r=this.cameraToCenterDistance;e[2]=t.clamp(e[2],r/n,r/i),this._camera.position=e}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}get fovAboveCenter(){return this._fov*(.5+this.centerOffset.y/this.height)}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,e,i){this._unmodified=!1,this._edgeInsets.interpolate(t,e,i),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){const e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)}getVisibleUnwrappedCoordinates(e){const i=[new t.UnwrappedTileID(0,e)];if(this.renderWorldCopies){const n=this.pointCoordinate(new t.Point(0,0)),r=this.pointCoordinate(new t.Point(this.width,0)),o=this.pointCoordinate(new t.Point(this.width,this.height)),s=this.pointCoordinate(new t.Point(0,this.height)),a=Math.floor(Math.min(n.x,r.x,o.x,s.x)),l=Math.floor(Math.max(n.x,r.x,o.x,s.x)),c=1;for(let n=a-c;n<=l+c;n++)0!==n&&i.push(new t.UnwrappedTileID(n,e))}return i}coveringTiles(e){let i=this.coveringZoomLevel(e);const n=i,r=this.elevation&&!e.isTerrainDEM,o="mercator"===this.projection.name;if(void 0!==e.minzoom&&i<e.minzoom)return[];void 0!==e.maxzoom&&i>e.maxzoom&&(i=e.maxzoom);const s=this.locationCoordinate(this.center),a=this.center.lat,l=1<<i,c=[l*s.x,l*s.y,0],u="globe"===this.projection.name,h=!u,p=t.Frustum.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,i,h),d=u?this._camera.mercatorPosition:this.pointCoordinate(this.getCameraPoint()),f=l*t.mercatorZfromAltitude(1,this.center.lat),m=this._camera.position[2]/t.mercatorZfromAltitude(1,this.center.lat),g=[l*d.x,l*d.y,m*(h?1:f)],y=this.cameraToCenterDistance/e.tileSize*(e.roundZoom?1:.502),v=this.pitch<=60&&this._edgeInsets.top<=this._edgeInsets.bottom&&!this._elevation&&!this.projection.isReprojectedInTileSpace?i:0,_=e.isTerrainDEM&&this._elevation?1e4*this._elevation.exaggeration():this._centerAltitude,x=e.isTerrainDEM?-_:this._elevation?this._elevation.getMinElevationBelowMSL():0,b=this.projection.isReprojectedInTileSpace?Hn(this):1,w=e=>{const i=1/4e4,n=new t.MercatorCoordinate(e.x+i,e.y,e.z),r=new t.MercatorCoordinate(e.x,e.y+i,e.z),o=e.toLngLat(),s=n.toLngLat(),a=r.toLngLat(),l=this.locationCoordinate(o),c=this.locationCoordinate(s),u=this.locationCoordinate(a),h=Math.hypot(c.x-l.x,c.y-l.y),p=Math.hypot(u.x-l.x,u.y-l.y);return Math.sqrt(h*p)*b/i},A=e=>{const i=_,n=x;return{aabb:t.tileAABB(this,l,0,0,0,e,n,i,this.projection),zoom:0,x:0,y:0,minZ:n,maxZ:i,wrap:e,fullyVisible:!1}},E=[];let S=[];const M=i,T=e.reparseOverscaled?n:i,I=t=>t*t,C=I((m-this._centerAltitude)*f),P=t=>{if(!this._elevation||!t.tileID||!o)return;const e=this._elevation.getMinMaxForTile(t.tileID),i=t.aabb;e?(i.min[2]=e.min,i.max[2]=e.max,i.center[2]=(i.min[2]+i.max[2])/2):(t.shouldSplit=L(t),t.shouldSplit||(i.min[2]=i.max[2]=i.center[2]=this._centerAltitude))},L=e=>{if(e.zoom<v)return!0;if(e.zoom===M)return!1;if(null!=e.shouldSplit)return e.shouldSplit;const i=e.aabb.distanceX(g),o=e.aabb.distanceY(g);let s=C,l=1;if(u){s=I(e.aabb.distanceZ(g));const i=Math.pow(2,e.zoom),n=t.latFromMercatorY((e.y+1)/i),r=t.latFromMercatorY(e.y/i),o=Math.min(Math.max(a,n),r),c=t.circumferenceAtLatitude(o)/t.circumferenceAtLatitude(a);if(l=o===a?1/Math.max(1,this._mercatorScaleRatio-.3):Math.min(1,c/this._mercatorScaleRatio),this.zoom<=t.GLOBE_ZOOM_THRESHOLD_MIN&&e.zoom===M-1&&c>=.9)return!0}else if(r&&(s=I(e.aabb.distanceZ(g)*f)),this.projection.isReprojectedInTileSpace&&n<=5){const i=Math.pow(2,e.zoom),n=w(new t.MercatorCoordinate((e.x+.5)/i,(e.y+.5)/i));l=n>.85?1:n}const c=i*i+o*o+s,h=I((1<<M-e.zoom)*y*l*((t,e)=>{if(e*I(.707)<t)return 1;const i=Math.sqrt(e/t);return i/(1.4144271570014144+(Math.pow(1.1,i-1.4144271570014144+1)-1)/(1.1-1)-1)})(Math.max(s,C),c));return c<h};if(this.renderWorldCopies)for(let t=1;t<=3;t++)E.push(A(-t)),E.push(A(t));for(E.push(A(0));E.length>0;){const n=E.pop(),s=n.x,a=n.y;let h=n.fullyVisible;if(!h){const t=n.aabb.intersects(p);if(0===t)continue;h=2===t}if(n.zoom!==M&&L(n))for(let e=0;e<4;e++){const i=(s<<1)+e%2,c=(a<<1)+(e>>1),p={aabb:o?n.aabb.quadrant(e):t.tileAABB(this,l,n.zoom+1,i,c,n.wrap,n.minZ,n.maxZ,this.projection),zoom:n.zoom+1,x:i,y:c,wrap:n.wrap,fullyVisible:h,tileID:void 0,shouldSplit:void 0,minZ:n.minZ,maxZ:n.maxZ};r&&!u&&(p.tileID=new t.OverscaledTileID(n.zoom+1===M?T:n.zoom+1,n.wrap,n.zoom+1,i,c),P(p)),E.push(p)}else{const r=n.zoom===M?T:n.zoom;if(e.minzoom&&e.minzoom>r)continue;const o=c[0]-(.5+s+(n.wrap<<n.zoom))*(1<<i-n.zoom),l=c[1]-.5-a,u=n.tileID?n.tileID:new t.OverscaledTileID(r,n.wrap,n.zoom,s,a);S.push({tileID:u,distanceSq:o*o+l*l})}}if(this.fogCullDistSq){const i=this.fogCullDistSq,n=this.horizonLineFromTop();S=S.filter((r=>{const o=[0,0,0,1],s=[t.EXTENT,t.EXTENT,0,1],a=this.calculateFogTileMatrix(r.tileID.toUnwrapped());t.transformMat4$1(o,o,a),t.transformMat4$1(s,s,a);const l=t.getAABBPointSquareDist(o,s);if(0===l)return!0;let c=!1;const u=this._elevation;if(u&&l>i&&0!==n){const i=this.calculateProjMatrix(r.tileID.toUnwrapped());let o;e.isTerrainDEM||(o=u.getMinMaxForTile(r.tileID)),o||(o={min:x,max:_});const s=t.furthestTileCorner(this.rotation),a=[s[0]*t.EXTENT,s[1]*t.EXTENT,o.max];t.transformMat4(a,a,i),c=(1-a[1])*this.height*.5<n}return l<i||c}))}return S.sort(((t,e)=>t.distanceSq-e.distanceSq)).map((t=>t.tileID))}resize(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(t){return Math.pow(2,t)}scaleZoom(t){return Math.log(t)/Math.LN2}project(e){const i=t.clamp(e.lat,-t.MAX_MERCATOR_LATITUDE,t.MAX_MERCATOR_LATITUDE),n=this.projection.project(e.lng,i);return new t.Point(n.x*this.worldSize,n.y*this.worldSize)}unproject(t){return this.projection.unproject(t.x/this.worldSize,t.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/t.mercatorZfromAltitude(1,this.center.lat)/this.worldSize}setLocationAtPoint(e,i){let n,r;const o=this.centerPoint;if("globe"===this.projection.name){const t=this.worldSize;n=(i.x-o.x)/t,r=(i.y-o.y)/t}else{const t=this.pointCoordinate(i),e=this.pointCoordinate(o);n=t.x-e.x,r=t.y-e.y}const s=this.locationCoordinate(e);this.setLocation(new t.MercatorCoordinate(s.x-n,s.y-r))}setLocation(t){this.center=this.coordinateLocation(t),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(t){return this.projection.locationPoint(this,t)}locationPoint3D(t){return this.projection.locationPoint(this,t,!0)}pointLocation(t){return this.coordinateLocation(this.pointCoordinate(t))}pointLocation3D(t){return this.coordinateLocation(this.pointCoordinate3D(t))}locationCoordinate(e,i){const n=i?t.mercatorZfromAltitude(i,e.lat):void 0,r=this.projection.project(e.lng,e.lat);return new t.MercatorCoordinate(r.x,r.y,n)}coordinateLocation(t){return this.projection.unproject(t.x,t.y)}pointRayIntersection(e,i){const n=null!=i?i:this._centerAltitude,r=[e.x,e.y,0,1],o=[e.x,e.y,1,1];t.transformMat4$1(r,r,this.pixelMatrixInverse),t.transformMat4$1(o,o,this.pixelMatrixInverse);const s=o[3];t.scale$1(r,r,1/r[3]),t.scale$1(o,o,1/s);const a=r[2],l=o[2];return{p0:r,p1:o,t:a===l?0:(n-a)/(l-a)}}screenPointToMercatorRay(e){const i=[e.x,e.y,0,1],n=[e.x,e.y,1,1];return t.transformMat4$1(i,i,this.pixelMatrixInverse),t.transformMat4$1(n,n,this.pixelMatrixInverse),t.scale$1(i,i,1/i[3]),t.scale$1(n,n,1/n[3]),i[2]=t.mercatorZfromAltitude(i[2],this._center.lat)*this.worldSize,n[2]=t.mercatorZfromAltitude(n[2],this._center.lat)*this.worldSize,t.scale$1(i,i,1/this.worldSize),t.scale$1(n,n,1/this.worldSize),new t.Ray([i[0],i[1],i[2]],t.normalize([],t.sub([],n,i)))}rayIntersectionCoordinate(e){const{p0:i,p1:n,t:r}=e,o=t.mercatorZfromAltitude(i[2],this._center.lat),s=t.mercatorZfromAltitude(n[2],this._center.lat);return new t.MercatorCoordinate(t.number(i[0],n[0],r)/this.worldSize,t.number(i[1],n[1],r)/this.worldSize,t.number(o,s,r))}pointCoordinate(t,e=this._centerAltitude){return this.projection.pointCoordinate(this,t.x,t.y,e)}pointCoordinate3D(e){if(!this.elevation)return this.pointCoordinate(e);let i=this.projection.pointCoordinate3D(this,e.x,e.y);if(i)return new t.MercatorCoordinate(i[0],i[1],i[2]);let n=0,r=this.horizonLineFromTop();if(e.y>r)return this.pointCoordinate(e);const o=.02*r,s=e.clone();for(let e=0;e<10&&r-n>o;e++){s.y=t.number(n,r,.66);const e=this.projection.pointCoordinate3D(this,s.x,s.y);e?(r=s.y,i=e):n=s.y}return i?new t.MercatorCoordinate(i[0],i[1],i[2]):this.pointCoordinate(e)}isPointAboveHorizon(t){return this.projection.isPointAboveHorizon(this,t)}isPointOnSurface(e){if(e.y<0||e.y>this.height||e.x<0||e.x>this.width)return!1;if(this.elevation||this.zoom>=t.GLOBE_ZOOM_THRESHOLD_MAX)return!this.isPointAboveHorizon(e);const i=this.pointCoordinate(e);return i.y>=0&&i.y<=1}_coordinatePoint(e,i){const n=i&&this.elevation?this.elevation.getAtPointOrZero(e,this._centerAltitude):this._centerAltitude,r=[e.x*this.worldSize,e.y*this.worldSize,n+e.toAltitude(),1];return t.transformMat4$1(r,r,this.pixelMatrix),r[3]>0?new t.Point(r[0]/r[3],r[1]/r[3]):new t.Point(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:e,left:i}=this._edgeInsets,n=this.height-this._edgeInsets.bottom,r=this.width-this._edgeInsets.right,o=this.pointLocation3D(new t.Point(i,e)),s=this.pointLocation3D(new t.Point(r,e)),a=this.pointLocation3D(new t.Point(r,n)),l=this.pointLocation3D(new t.Point(i,n));let c=Math.min(o.lng,s.lng,a.lng,l.lng),u=Math.max(o.lng,s.lng,a.lng,l.lng),h=Math.min(o.lat,s.lat,a.lat,l.lat),p=Math.max(o.lat,s.lat,a.lat,l.lat);const d=Math.pow(2,-this.zoom)/16*270,f="globe"===this.projection.name?1:4,m=(e,i,n,r,o)=>{const s=(e+n)/2,a=(i+r)/2,l=new t.Point(s,a),{lng:g,lat:y}=this.pointLocation3D(l),v=Math.max(0,c-g,h-y,g-u,y-p);c=Math.min(c,g),u=Math.max(u,g),h=Math.min(h,y),p=Math.max(p,y),(o<f||v>d)&&(m(e,i,s,a,o+1),m(s,a,n,r,o+1))};if(m(i,e,r,e,1),m(r,e,r,n,1),m(r,n,i,n,1),m(i,n,i,e,1),"globe"===this.projection.name){const[e,i]=t.polesInViewport(this);e?(p=90,u=180,c=-180):i&&(h=-90,u=180,c=-180)}return new t.LngLatBounds(new t.LngLat(c,h),new t.LngLat(u,p))}_getBoundsRectangular(e,i){const{top:n,left:r}=this._edgeInsets,o=this.height-this._edgeInsets.bottom,s=this.width-this._edgeInsets.right,a=new t.Point(r,n),l=new t.Point(s,n),c=new t.Point(s,o),u=new t.Point(r,o);let h=this.pointCoordinate(a,e),p=this.pointCoordinate(l,e);const d=this.pointCoordinate(c,i),f=this.pointCoordinate(u,i),m=(t,e)=>(e.y-t.y)/(e.x-t.x);return h.y>1&&p.y>=0?h=new t.MercatorCoordinate((1-f.y)/m(f,h)+f.x,1):h.y<0&&p.y<=1&&(h=new t.MercatorCoordinate(-f.y/m(f,h)+f.x,0)),p.y>1&&h.y>=0?p=new t.MercatorCoordinate((1-d.y)/m(d,p)+d.x,1):p.y<0&&h.y<=1&&(p=new t.MercatorCoordinate(-d.y/m(d,p)+d.x,0)),(new t.LngLatBounds).extend(this.coordinateLocation(h)).extend(this.coordinateLocation(p)).extend(this.coordinateLocation(f)).extend(this.coordinateLocation(d))}_getBoundsRectangularTerrain(){const t=this.elevation;if(!t.visibleDemTiles.length||t.isUsingMockSource())return this._getBoundsRectangular(0,0);const e=t.visibleDemTiles.reduce(((t,e)=>{if(e.dem){const i=e.dem.tree;t.min=Math.min(t.min,i.minimums[0]),t.max=Math.max(t.max,i.maximums[0])}return t}),{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(e.min*t.exaggeration(),e.max*t.exaggeration())}getBounds(){return"mercator"===this.projection.name||"equirectangular"===this.projection.name?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(t=!0){const e=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))+this.centerOffset.y,i=this.height/2-e*(1-this._horizonShift);return t?Math.max(0,i):i}getMaxBounds(){return this.maxBounds}setMaxBounds(e){this.maxBounds=e,this.minLat=-t.MAX_MERCATOR_LATITUDE,this.maxLat=t.MAX_MERCATOR_LATITUDE,this.minLng=-180,this.maxLng=180,e&&(this.minLat=e.getSouth(),this.maxLat=e.getNorth(),this.minLng=e.getWest(),this.maxLng=e.getEast(),this.maxLng<this.minLng&&(this.maxLng+=360)),this.worldMinX=t.mercatorXfromLng(this.minLng)*this.tileSize,this.worldMaxX=t.mercatorXfromLng(this.maxLng)*this.tileSize,this.worldMinY=t.mercatorYfromLat(this.maxLat)*this.tileSize,this.worldMaxY=t.mercatorYfromLat(this.minLat)*this.tileSize,this._constrain()}calculatePosMatrix(t,e){return this.projection.createTileMatrix(this,e,t)}calculateDistanceTileData(e){const i=e.key,n=this._distanceTileDataCache;if(n[i])return n[i];const r=e.canonical,o=1/this.height,s=this.cameraWorldSize,a=s/this.zoomScale(r.z),l=(r.x+Math.pow(2,r.z)*e.wrap)*a,c=r.y*a,u=this.point;u.x*=s/this.worldSize,u.y*=s/this.worldSize;const h=this.angle,p=Math.sin(-h),d=-Math.cos(-h);return n[i]={bearing:[p,d],center:[(u.x-l)*o,(u.y-c)*o],scale:a/t.EXTENT*o},n[i]}calculateFogTileMatrix(e){const i=e.key,n=this._fogTileMatrixCache;if(n[i])return n[i];const r=this.projection.createTileMatrix(this,this.cameraWorldSizeForFog,e);return t.multiply(r,this.worldToFogMatrix,r),n[i]=new Float32Array(r),n[i]}calculateProjMatrix(e,i=!1){const n=e.key,r=i?this._alignedProjMatrixCache:this._projMatrixCache;if(r[n])return r[n];const o=this.calculatePosMatrix(e,this.worldSize);return t.multiply(o,this.projection.isReprojectedInTileSpace?this.mercatorMatrix:i?this.alignedProjMatrix:this.projMatrix,o),r[n]=new Float32Array(o),r[n]}calculatePixelsToTileUnitsMatrix(e){const i=e.tileID.key,n=this._pixelsToTileUnitsCache;if(n[i])return n[i];const r=function(e,i){const{scale:n}=e.tileTransform,r=n*t.EXTENT/(e.tileSize*Math.pow(2,i.zoom-e.tileID.overscaledZ+e.tileID.canonical.z));return o=new Float32Array(4),l=(s=i.inverseAdjustmentMatrix)[1],c=s[2],u=s[3],p=(a=[r,r])[1],o[0]=s[0]*(h=a[0]),o[1]=l*h,o[2]=c*p,o[3]=u*p,o;var o,s,a,l,c,u,h,p}(e,this);return n[i]=r,n[i]}customLayerMatrix(){return this.mercatorMatrix.slice()}globeToMercatorMatrix(){if("globe"===this.projection.name){const e=1/this.worldSize,i=t.fromScaling([],[e,e,e]);return t.multiply(i,i,this.globeMatrix),i}}recenterOnTerrain(){if(!this._elevation||"globe"===this.projection.name)return;const e=this._elevation;this._updateCameraState();const i=t.mercatorZfromAltitude(1,this._center.lat)*this.worldSize,n=this._computeCameraPosition(i),r=this._camera.forward(),o=t.mercatorZfromAltitude(1,this._center.lat);n[2]/=o,r[2]/=o,t.normalize(r,r);const s=e.raycast(n,r,e.exaggeration());if(s){const e=t.scaleAndAdd([],n,r,s),i=new t.MercatorCoordinate(e[0],e[1],t.mercatorZfromAltitude(e[2],t.latFromMercatorY(e[1]))),a=(i.z+t.length([i.x-n[0],i.y-n[1],i.z-n[2]*o]))*this._pixelsPerMercatorPixel;this._seaLevelZoom=this._zoomFromMercatorZ(a),this._centerAltitude=i.toAltitude(),this._center=this.coordinateLocation(i),this._updateZoomFromElevation(),this._constrain(),this._calcMatrices()}}_constrainCamera(e=!1){if(!this._elevation)return;const i=this._elevation,n=t.mercatorZfromAltitude(1,this._center.lat)*this.worldSize,r=this._computeCameraPosition(n),o=i.getAtPointOrZero(new t.MercatorCoordinate(...r)),s=this.pixelsPerMeter/this.worldSize*o,a=this._minimumHeightOverTerrain(),l=r[2]-s;if(l<=a)if(l<0||e){const e=this.locationCoordinate(this._center,this._centerAltitude),i=[r[0],r[1],e.z-r[2]],n=t.length(i);i[2]-=(a-l)/this._pixelsPerMercatorPixel;const o=t.length(i);if(0===o)return;t.scale$2(i,i,n/o*this._pixelsPerMercatorPixel),this._camera.position=[r[0],r[1],e.z*this._pixelsPerMercatorPixel-i[2]],this._updateStateFromCamera()}else this._isCameraConstrained=!0}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const e="globe"===this.projection.name||this.mercatorFromTransition;if(this.projection.isReprojectedInTileSpace||e){const i=this.center;return i.lat=t.clamp(i.lat,this.minLat,this.maxLat),(this.maxBounds||!this.renderWorldCopies&&!e)&&(i.lng=t.clamp(i.lng,this.minLng,this.maxLng)),this.center=i,void(this._constraining=!1)}const i=this._unmodified,{x:n,y:r}=this.point;let o=0,s=n,a=r;const l=this.width/2,c=this.height/2,u=this.worldMinY*this.scale,h=this.worldMaxY*this.scale;if(r-c<u&&(a=u+c),r+c>h&&(a=h-c),h-u<this.height&&(o=Math.max(o,this.height/(h-u)),a=(h+u)/2),this.maxBounds||!this._renderWorldCopies||!this.projection.wrap){const t=this.worldMinX*this.scale,e=this.worldMaxX*this.scale,i=this.worldSize/2-(t+e)/2;s=(n+i+this.worldSize)%this.worldSize-i,s-l<t&&(s=t+l),s+l>e&&(s=e-l),e-t<this.width&&(o=Math.max(o,this.width/(e-t)),s=(e+t)/2)}s===n&&a===r||(this.center=this.unproject(new t.Point(s,a))),o&&(this.zoom+=this.scaleZoom(o)),this._constrainCamera(),this._unmodified=i,this._constraining=!1}_minZoomForBounds(){let t=Math.max(0,this.scaleZoom(this.height/(this.worldMaxY-this.worldMinY)));return this.maxBounds&&(t=Math.max(t,this.scaleZoom(this.width/(this.worldMaxX-this.worldMinX)))),t}_maxCameraBoundsDistance(){return this._mercatorZfromZoom(this._minZoomForBounds())}_calcMatrices(){if(!this.height)return;const e=this.centerOffset,i=this.pixelsPerMeter;"globe"===this.projection.name&&(this._mercatorScaleRatio=t.mercatorZfromAltitude(1,this.center.lat)/t.mercatorZfromAltitude(1,t.GLOBE_SCALE_MATCH_LATITUDE));const n=Wn(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 r="meters"===this.projection.zAxisUnit?i:1,o=this._camera.getWorldToCamera(this.worldSize,r),s=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,this._farZ);s[8]=2*-e.x/this.width,s[9]=2*e.y/this.height;let a=t.mul([],s,o);if(this.projection.isReprojectedInTileSpace){const e=this.locationCoordinate(this.center),i=t.identity([]);t.translate(i,i,[e.x*this.worldSize,e.y*this.worldSize,0]),t.multiply(i,i,jn(this)),t.translate(i,i,[-e.x*this.worldSize,-e.y*this.worldSize,0]),t.multiply(a,a,i),this.inverseAdjustmentMatrix=function(t){const e=jn(t,!0);return v([],[e[0],e[1],e[4],e[5]])}(this)}else this.inverseAdjustmentMatrix=[1,0,0,1];this.mercatorMatrix=t.scale([],a,[this.worldSize,this.worldSize,this.worldSize/r,1]),this.projMatrix=a,this.invProjMatrix=t.invert(new Float64Array(16),this.projMatrix);const l=t.invert([],s);this.frustumCorners=t.FrustumCorners.fromInvProjectionMatrix(l,this.horizonLineFromTop(),this.height);const c=new Float32Array(16);t.identity(c),t.scale(c,c,[1,-1,1]),t.rotateX(c,c,this._pitch),t.rotateZ(c,c,this.angle);const u=t.perspective(new Float32Array(16),this._fov,this.width/this.height,this._nearZ,this._farZ),h=(Math.PI/2-this._pitch)*(this.height/this._fov)*this._horizonShift;u[8]=2*-e.x/this.width,u[9]=2*(e.y+h)/this.height,this.skyboxMatrix=t.multiply(c,u,c);const p=this.point,d=p.x,f=p.y,m=this.width%2/2,g=this.height%2/2,y=Math.cos(this.angle),_=Math.sin(this.angle),x=d-Math.round(d)+y*m+_*g,b=f-Math.round(f)+y*g+_*m,w=new Float64Array(a);if(t.translate(w,w,[x>.5?x-1:x,b>.5?b-1:b,0]),this.alignedProjMatrix=w,a=t.create(),t.scale(a,a,[this.width/2,-this.height/2,1]),t.translate(a,a,[1,-1,0]),this.labelPlaneMatrix=a,a=t.create(),t.scale(a,a,[1,-1,1]),t.translate(a,a,[-1,-1,0]),t.scale(a,a,[2/this.width,2/this.height,1]),this.glCoordMatrix=a,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),this._calcFogMatrices(),this._distanceTileDataCache={},a=t.invert(new Float64Array(16),this.pixelMatrix),!a)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=a,"globe"===this.projection.name||this.mercatorFromTransition){this.globeMatrix=t.calculateGlobeMatrix(this);const e=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=t.transformMat4(e,e,o),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=a;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const e=this.cameraWorldSizeForFog,i=this.cameraPixelsPerMeter,n=this._camera.position,r=1/this.height/this._pixelsPerMercatorPixel,o=[e,e,i];t.scale$2(o,o,r),t.scale$2(n,n,-1),t.multiply$2(n,n,o);const s=t.create();t.translate(s,s,n),t.scale(s,s,o),this.mercatorFogMatrix=s,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(e,i,r)}_computeCameraPosition(t){const e=(t=t||this.pixelsPerMeter)/this.pixelsPerMeter,i=this._camera.forward(),n=this.point,r=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*e-t/this.worldSize*this._centerAltitude;return[n.x/this.worldSize-i[0]*r,n.y/this.worldSize-i[1]*r,t/this.worldSize*this._centerAltitude-i[2]*r]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(e){const i=this._maxCameraBoundsDistance()*Math.cos(this._pitch),n=this._camera.position[2],r=e[2];let o=1;this.projection.wrap&&(this.center=this.center.wrap()),r>0&&(o=Math.min((i-n)/r,1)),this._camera.position=t.scaleAndAdd([],this._camera.position,e,o),this._updateStateFromCamera()}_updateStateFromCamera(){const e=this._camera.position,i=this._camera.forward(),{pitch:n,bearing:r}=this._camera.getPitchBearing(),o=t.mercatorZfromAltitude(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,s=this._mercatorZfromZoom(this._maxZoom)*Math.cos(t.degToRad(this._maxPitch)),a=Math.max((e[2]-o)/Math.cos(n),s),l=this._zoomFromMercatorZ(a);t.scaleAndAdd(e,e,i,a),this._pitch=t.clamp(n,t.degToRad(this.minPitch),t.degToRad(this.maxPitch)),this.angle=t.wrap(r,-Math.PI,Math.PI),this._setZoom(t.clamp(l,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new t.MercatorCoordinate(e[0],e[1],e[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(t){return Math.pow(2,t)*this.tileSize}_mercatorZfromZoom(t){return this.cameraToCenterDistance/this._worldSizeFromZoom(t)}_minimumHeightOverTerrain(){const t=Math.min((null!=this._seaLevelZoom?this._seaLevelZoom:this._zoom)+4,this._maxZoom);return this._mercatorZfromZoom(t)}_zoomFromMercatorZ(t){return this.scaleZoom(this.cameraToCenterDistance/(t*this.tileSize))}zoomFromMercatorZAdjusted(e){let i=0,n=t.GLOBE_ZOOM_THRESHOLD_MAX,r=0,o=1/0;for(;n-i>1e-6&&n>i;){const t=i+.5*(n-i),s=this.tileSize*Math.pow(2,t),a=this.getCameraToCenterDistance(this.projection,t,s),l=this.scaleZoom(a/(e*this.tileSize)),c=Math.abs(t-l);c<o&&(o=c,r=t),t<l?i=t:n=t}return r}_terrainEnabled(){return!(!this._elevation||!this.projection.supportsTerrain&&(t.warnOnce("Terrain is not yet supported with alternate projections. Use mercator or globe to enable terrain."),1))}anyCornerOffEdge(e,i){const n=Math.min(e.x,i.x),r=Math.max(e.x,i.x),o=Math.min(e.y,i.y),s=Math.max(e.y,i.y);if(o<this.horizonLineFromTop(!1))return!0;if("mercator"!==this.projection.name)return!1;const a=[new t.Point(n,o),new t.Point(r,s),new t.Point(n,s),new t.Point(r,o)],l=this.renderWorldCopies?-3:0,c=this.renderWorldCopies?4:1;for(const t of a){const e=this.pointRayIntersection(t);if(e.t<0)return!0;const i=this.rayIntersectionCoordinate(e);if(i.x<l||i.y<0||i.x>c||i.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+t.radToDeg(this.fovAboveCenter)>88||this.anyCornerOffEdge(new t.Point(0,0),new t.Point(this.width,this.height))}zoomDeltaToMovement(e,i){const n=t.length(t.sub([],this._camera.position,e)),r=this._zoomFromMercatorZ(n)+i;return n-this._mercatorZfromZoom(r)}getCameraPoint(){if("globe"===this.projection.name){const e=function([e,i,n],r){const o=[e,i,n,1];t.transformMat4$1(o,o,r);const s=o[3]=Math.max(o[3],1e-6);return o[0]/=s,o[1]/=s,o[2]/=s,o}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new t.Point(e[0],e[1])}{const e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,e))}}getCameraToCenterDistance(t,e=this.zoom,i=this.worldSize){const n=Wn(t,e,this.width,this.height,1024),r=t.pixelSpaceConversion(this.center.lat,i,n);return.5/Math.tan(.5*this._fov)*this.height*r}getWorldToCameraMatrix(){const e=this._camera.getWorldToCamera(this.worldSize,"meters"===this.projection.zAxisUnit?this.pixelsPerMeter:1);return"globe"===this.projection.name&&t.multiply(e,e,this.globeMatrix),e}}function Qn(t,e){let i=!1,n=null;const r=()=>{n=null,i&&(t(),n=setTimeout(r,e),i=!1)};return()=>(i=!0,n||r(),n)}class Jn{constructor(e){this._hashName=e&&encodeURIComponent(e),t.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=Qn(this._updateHashUnthrottled.bind(this),300)}addTo(e){return this._map=e,t.window.addEventListener("hashchange",this._onHashChange,!1),e.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),t.window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const e=this._map;if(!e)return"";const i=Kn(e);if(this._hashName){const e=this._hashName;let n=!1;const r=t.window.location.hash.slice(1).split("&").map((t=>{const r=t.split("=")[0];return r===e?(n=!0,`${r}=${i}`):t})).filter((t=>t));return n||r.push(`${e}=${i}`),`#${r.join("&")}`}return`#${i}`}_getCurrentHash(){const e=t.window.location.hash.replace("#","");if(this._hashName){let t;return e.split("&").map((t=>t.split("="))).forEach((e=>{e[0]===this._hashName&&(t=e)})),(t&&t[1]||"").split("/")}return e.split("/")}_onHashChange(){const t=this._map;if(!t)return!1;const e=this._getCurrentHash();if(e.length>=3&&!e.some((t=>isNaN(t)))){const i=t.dragRotate.isEnabled()&&t.touchZoomRotate.isEnabled()?+(e[3]||0):t.getBearing();return t.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:i,pitch:+(e[4]||0)}),!0}return!1}_updateHashUnthrottled(){const e=t.window.location.href.replace(/(#.+)?$/,this.getHashString());t.window.history.replaceState(t.window.history.state,null,e)}}function Kn(t,e){const i=t.getCenter(),n=Math.round(100*t.getZoom())/100,r=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),o=Math.pow(10,r),s=Math.round(i.lng*o)/o,a=Math.round(i.lat*o)/o,l=t.getBearing(),c=t.getPitch();let u=e?`/${s}/${a}/${n}`:`${n}/${a}/${s}`;return(l||c)&&(u+="/"+Math.round(10*l)/10),c&&(u+=`/${Math.round(c)}`),u}const $n={linearity:.3,easing:t.bezier(0,0,.3,1)},tr=t.extend({deceleration:2500,maxSpeed:1400},$n),er=t.extend({deceleration:20,maxSpeed:1400},$n),ir=t.extend({deceleration:1e3,maxSpeed:360},$n),nr=t.extend({deceleration:1e3,maxSpeed:90},$n);class rr{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:t.exported.now(),settings:e})}_drainInertiaBuffer(){const e=this._inertiaBuffer,i=t.exported.now();for(;e.length>0&&i-e[0].time>160;)e.shift()}_onMoveEnd(e){if(this._map._prefersReducedMotion())return;if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const i={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0};for(const{settings:t}of this._inertiaBuffer)i.zoom+=t.zoomDelta||0,i.bearing+=t.bearingDelta||0,i.pitch+=t.pitchDelta||0,t.panDelta&&i.pan._add(t.panDelta),t.around&&(i.around=t.around),t.pinchAround&&(i.pinchAround=t.pinchAround);const n=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,r={};if(i.pan.mag()){const o=sr(i.pan.mag(),n,t.extend({},tr,e||{}));r.offset=i.pan.mult(o.amount/i.pan.mag()),r.center=this._map.transform.center,or(r,o)}if(i.zoom){const t=sr(i.zoom,n,er);r.zoom=this._map.transform.zoom+t.amount,or(r,t)}if(i.bearing){const e=sr(i.bearing,n,ir);r.bearing=this._map.transform.bearing+t.clamp(e.amount,-179,179),or(r,e)}if(i.pitch){const t=sr(i.pitch,n,nr);r.pitch=this._map.transform.pitch+t.amount,or(r,t)}if(r.zoom||r.bearing){const t=void 0===i.pinchAround?i.around:i.pinchAround;r.around=t?this._map.unproject(t):this._map.getCenter()}return this.clear(),r.noMoveStart=!0,r}}function or(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function sr(e,i,n){const{maxSpeed:r,linearity:o,deceleration:s}=n,a=t.clamp(e*o/(i/1e3),-r,r),l=Math.abs(a)/(s*o);return{easing:n.easing,duration:1e3*l,amount:a*(l/2)}}class ar extends t.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,i,n,r={}){const o=f(i.getCanvasContainer(),n),s=i.unproject(o);super(e,t.extend({point:o,lngLat:s,originalEvent:n},r)),this._defaultPrevented=!1,this.target=i}}class lr extends t.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,i,n){const r="touchend"===e?n.changedTouches:n.touches,o=m(i.getCanvasContainer(),r),s=o.map((t=>i.unproject(t))),a=o.reduce(((t,e,i,n)=>t.add(e.div(n.length))),new t.Point(0,0));super(e,{points:o,point:a,lngLats:s,lngLat:i.unproject(a),originalEvent:n}),this._defaultPrevented=!1}}class cr extends t.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,e,i){super(t,{originalEvent:i}),this._defaultPrevented=!1}}class ur{constructor(t,e){this._map=t,this._clickTolerance=e.clickTolerance}reset(){this._mousedownPos=void 0}wheel(t){return this._firePreventable(new cr(t.type,this._map,t))}mousedown(t,e){return this._mousedownPos=e,this._firePreventable(new ar(t.type,this._map,t))}mouseup(t){this._map.fire(new ar(t.type,this._map,t))}preclick(e){const i=t.extend({},e);i.type="preclick",this._map.fire(new ar(i.type,this._map,i))}click(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||(this.preclick(t),this._map.fire(new ar(t.type,this._map,t)))}dblclick(t){return this._firePreventable(new ar(t.type,this._map,t))}mouseover(t){this._map.fire(new ar(t.type,this._map,t))}mouseout(t){this._map.fire(new ar(t.type,this._map,t))}touchstart(t){return this._firePreventable(new lr(t.type,this._map,t))}touchmove(t){this._map.fire(new lr(t.type,this._map,t))}touchend(t){this._map.fire(new lr(t.type,this._map,t))}touchcancel(t){this._map.fire(new lr(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class hr{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(t){this._map.fire(new ar(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new ar("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new ar(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class pr{constructor(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(u(),this._startPos=this._lastPos=e,this._active=!0)}mousemoveWindow(t,e){if(!this._active)return;const i=e,n=this._startPos,r=this._lastPos;if(!n||!r||r.equals(i)||!this._box&&i.dist(n)<this._clickTolerance)return;this._lastPos=i,this._box||(this._box=o("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));const s=Math.min(n.x,i.x),a=Math.max(n.x,i.x),l=Math.min(n.y,i.y),c=Math.max(n.y,i.y);this._map._requestDomTask((()=>{this._box&&(this._box.style.transform=`translate(${s}px,${l}px)`,this._box.style.width=a-s+"px",this._box.style.height=c-l+"px")}))}mouseupWindow(e,i){if(!this._active)return;const n=this._startPos,r=i;if(n&&0===e.button){if(this.reset(),d(),n.x!==r.x||n.y!==r.y)return this._map.fire(new t.Event("boxzoomend",{originalEvent:e})),{cameraAnimation:t=>t.fitScreenCoordinates(n,r,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",e)}}keydown(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),h(),delete this._startPos,delete this._lastPos}_fireEvent(e,i){return this._map.fire(new t.Event(e,{originalEvent:i}))}}function dr(t,e){const i={};for(let n=0;n<t.length;n++)i[t[n].identifier]=e[n];return i}class fr{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){this.centroid=void 0,this.startTime=0,this.touches={},this.aborted=!1}touchstart(e,i,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){const i=new t.Point(0,0);for(const t of e)i._add(t);return i.div(e.length)}(i),this.touches=dr(n,i)))}touchmove(t,e,i){if(this.aborted||!this.centroid)return;const n=dr(i,e);for(const t in this.touches){const e=n[t];(!e||e.dist(this.touches[t])>30)&&(this.aborted=!0)}}touchend(t,e,i){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===i.length){const t=!this.aborted&&this.centroid;if(this.reset(),t)return t}}}class mr{constructor(t){this.singleTap=new fr(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(t,e,i){this.singleTap.touchstart(t,e,i)}touchmove(t,e,i){this.singleTap.touchmove(t,e,i)}touchend(t,e,i){const n=this.singleTap.touchend(t,e,i);if(n){const e=t.timeStamp-this.lastTime<500,i=!this.lastTap||this.lastTap.dist(n)<30;if(e&&i||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}}}class gr{constructor(){this._zoomIn=new mr({numTouches:1,numTaps:2}),this._zoomOut=new mr({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,e,i){this._zoomIn.touchstart(t,e,i),this._zoomOut.touchstart(t,e,i)}touchmove(t,e,i){this._zoomIn.touchmove(t,e,i),this._zoomOut.touchmove(t,e,i)}touchend(t,e,i){const n=this._zoomIn.touchend(t,e,i),r=this._zoomOut.touchend(t,e,i);return n?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(n)},{originalEvent:t})}):r?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(r)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const yr={0:1,2:2};class vr{constructor(t){this.reset(),this._clickTolerance=t.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(t,e){return!1}_move(t,e){return{}}mousedown(t,e){if(this._lastPoint)return;const i=g(t);this._correctButton(t,i)&&(this._lastPoint=e,this._eventButton=i)}mousemoveWindow(t,e){const i=this._lastPoint;if(i)if(t.preventDefault(),null!=this._eventButton&&function(t,e){const i=yr[e];return void 0===t.buttons||(t.buttons&i)!==i}(t,this._eventButton))this.reset();else if(this._moved||!(e.dist(i)<this._clickTolerance))return this._moved=!0,this._lastPoint=e,this._move(i,e)}mouseupWindow(t){this._lastPoint&&g(t)===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 _r extends vr{mousedown(t,e){super.mousedown(t,e),this._lastPoint&&(this._active=!0)}_correctButton(t,e){return 0===e&&!t.ctrlKey}_move(t,e){return{around:e,panDelta:e.sub(t)}}}class xr extends vr{_correctButton(t,e){return 0===e&&t.ctrlKey||2===e}_move(t,e){const i=.8*(e.x-t.x);if(i)return this._active=!0,{bearingDelta:i}}contextmenu(t){t.preventDefault()}}class br extends vr{_correctButton(t,e){return 0===e&&t.ctrlKey||2===e}_move(t,e){const i=-.5*(e.y-t.y);if(i)return this._active=!0,{pitchDelta:i}}contextmenu(t){t.preventDefault()}}class wr{constructor(e,i){this._map=e,this._el=e.getCanvasContainer(),this._minTouches=1,this._clickTolerance=i.clickTolerance||1,this.reset(),t.bindAll(["_addTouchPanBlocker","_showTouchPanBlockerAlert"],this)}reset(){this._active=!1,this._touches={},this._sum=new t.Point(0,0)}touchstart(t,e,i){return this._calculateTransform(t,e,i)}touchmove(e,i,n){if(this._active&&!(n.length<this._minTouches)){if(this._map._cooperativeGestures&&!this._map.isMoving()){if(1===n.length&&!t.isFullscreen())return void this._showTouchPanBlockerAlert();"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}return e.cancelable&&e.preventDefault(),this._calculateTransform(e,i,n)}}touchend(t,e,i){this._calculateTransform(t,e,i),this._active&&i.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,i,n){n.length>0&&(this._active=!0);const r=dr(n,i),o=new t.Point(0,0),s=new t.Point(0,0);let a=0;for(const t in r){const e=r[t],i=this._touches[t];i&&(o._add(e),s._add(e.sub(i)),a++,r[t]=e)}if(this._touches=r,a<this._minTouches||!s.mag())return;const l=s.div(a);return this._sum._add(l),this._sum.mag()<this._clickTolerance?void 0:{around:o.div(a),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 Ar{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(t){}_move(t,e,i){return{}}touchstart(t,e,i){this._firstTwoTouches||i.length<2||(this._firstTwoTouches=[i[0].identifier,i[1].identifier],this._start([e[0],e[1]]))}touchmove(t,e,i){const n=this._firstTwoTouches;if(!n)return;t.preventDefault();const[r,o]=n,s=Er(i,e,r),a=Er(i,e,o);if(!s||!a)return;const l=this._aroundCenter?null:s.add(a).div(2);return this._move([s,a],l,t)}touchend(t,e,i){if(!this._firstTwoTouches)return;const[n,r]=this._firstTwoTouches,o=Er(i,e,n),s=Er(i,e,r);o&&s||(this._active&&d(),this.reset())}touchcancel(){this.reset()}enable(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function Er(t,e,i){for(let n=0;n<t.length;n++)if(t[n].identifier===i)return e[n]}function Sr(t,e){return Math.log(t/e)/Math.LN2}class Mr extends Ar{reset(){super.reset(),this._distance=0,this._startDistance=0}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,e){const i=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(Sr(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Sr(this._distance,i),pinchAround:e}}}function Tr(t,e){return 180*t.angleWith(e)/Math.PI}class Ir extends Ar{reset(){super.reset(),this._minDiameter=0,this._startVector=void 0,this._vector=void 0}_start(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])}_move(t,e){const i=this._vector;if(this._vector=t[0].sub(t[1]),i&&(this._active||!this._isBelowThreshold(this._vector)))return this._active=!0,{bearingDelta:Tr(this._vector,i),pinchAround:e}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());const e=25/(Math.PI*this._minDiameter)*360,i=this._startVector;if(!i)return!1;const n=Tr(t,i);return Math.abs(n)<e}}function Cr(t){return Math.abs(t.y)>Math.abs(t.x)}class Pr extends Ar{constructor(t){super(),this._map=t}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(t){this._lastPoints=t,Cr(t[0].sub(t[1]))&&(this._valid=!1)}_move(e,i,n){const r=this._lastPoints;if(!r)return;const o=e[0].sub(r[0]),s=e[1].sub(r[1]);return this._map._cooperativeGestures&&!t.isFullscreen()&&n.touches.length<3||(this._valid=this.gestureBeginsVertically(o,s,n.timeStamp),!this._valid)?void 0:(this._lastPoints=e,this._active=!0,{pitchDelta:(o.y+s.y)/2*-.5})}gestureBeginsVertically(t,e,i){if(void 0!==this._valid)return this._valid;const n=t.mag()>=2,r=e.mag()>=2;if(!n&&!r)return;if(!n||!r)return null==this._firstMove&&(this._firstMove=i),i-this._firstMove<100&&void 0;const o=t.y>0==e.y>0;return Cr(t)&&Cr(e)&&o}}const Lr={panStep:100,bearingStep:15,pitchStep:10};class Dr{constructor(){const t=Lr;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let e=0,i=0,n=0,r=0,o=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?i=-1:(t.preventDefault(),r=-1);break;case 39:t.shiftKey?i=1:(t.preventDefault(),r=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),o=-1);break;case 40:t.shiftKey?n=-1:(t.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(i=0,n=0),{cameraAnimation:s=>{const a=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:Rr,zoom:e?Math.round(a)+e*(t.shiftKey?2:1):a,bearing:s.getBearing()+i*this._bearingStep,pitch:s.getPitch()+n*this._pitchStep,offset:[-r*this._panStep,-o*this._panStep],center:s.getCenter()},{originalEvent:t})}}}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 Rr(t){return t*(2-t)}const Or=4.000244140625;class kr{constructor(e,i){this._map=e,this._el=e.getCanvasContainer(),this._handler=i,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,t.bindAll(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around,this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(e){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(e.ctrlKey||e.metaKey||this.isZooming()||t.isFullscreen()))return void this._showBlockerAlert();"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let i=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY;const n=t.exported.now(),r=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==i&&i%Or==0?this._type="wheel":0!==i&&Math.abs(i)<4?this._type="trackpad":r>400?(this._type=null,this._lastValue=i,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(r*i)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,i+=this._lastValue)),e.shiftKey&&i&&(i/=4),this._type&&(this._lastWheelEvent=e,this._delta-=i,this._active||this._start(e)),e.preventDefault()}_onTimeout(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)}_start(t){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 e=f(this._el,t);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:e,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 e=this._map.transform;"wheel"===this._type&&e.projection.wrap&&(e._center.lng>=180||e._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const i=()=>e._terrainEnabled()&&this._aroundCoord?e.computeZoomRelativeTo(this._aroundCoord):e.zoom;if(0!==this._delta){const t="wheel"===this._type&&Math.abs(this._delta)>Or?this._wheelZoomRate:this._defaultZoomRate;let n=2/(1+Math.exp(-Math.abs(this._delta*t)));this._delta<0&&0!==n&&(n=1/n);const r=i(),o=Math.pow(2,r),s="number"==typeof this._targetZoom?e.zoomScale(this._targetZoom):o;this._targetZoom=Math.min(e.maxZoom,Math.max(e.minZoom,e.scaleZoom(s*n))),"wheel"===this._type&&(this._startZoom=r,this._easing=this._smoothOutEasing(200)),this._delta=0}const n="number"==typeof this._targetZoom?this._targetZoom:i(),r=this._startZoom,o=this._easing;let s,a=!1;if("wheel"===this._type&&r&&o){const e=Math.min((t.exported.now()-this._lastWheelEventTime)/200,1),i=o(e);s=t.number(r,n,i),e<1?this._frameId||(this._frameId=!0):a=!0}else s=n,a=!0;return this._active=!0,a&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!a,zoomDelta:s-i(),around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let i=t.ease;if(this._prevEase){const e=this._prevEase,n=(t.exported.now()-e.start)/e.duration,r=e.easing(n+.01)-e.easing(n),o=.27/Math.sqrt(r*r+1e-4)*.01,s=Math.sqrt(.0729-o*o);i=t.bezier(o,s,.25,1)}return this._prevEase={start:t.exported.now(),duration:e,easing:i},i}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(t.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 Nr{constructor(t,e){this._clickZoom=t,this._tapZoom=e}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 Br{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(t,e){return t.preventDefault(),{cameraAnimation:i=>{i.easeTo({duration:300,zoom:i.getZoom()+(t.shiftKey?-1:1),around:i.unproject(e)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class zr{constructor(){this._tap=new mr({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(t,e,i){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?i.length>0&&(this._swipePoint=e[0],this._swipeTouch=i[0].identifier):this._tap.touchstart(t,e,i))}touchmove(t,e,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;const n=e[0],r=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:r/128}}}else this._tap.touchmove(t,e,i)}touchend(t,e,i){this._tapTime?this._swipePoint&&0===i.length&&this.reset():this._tap.touchend(t,e,i)&&(this._tapTime=t.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Fr{constructor(t,e,i){this._el=t,this._mousePan=e,this._touchPan=i}enable(t){this._inertiaOptions=t||{},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 Vr{constructor(t,e,i){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=i}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 Ur{constructor(t,e,i,n){this._el=t,this._touchZoom=e,this._touchRotate=i,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),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 Gr=t=>t.zoom||t.drag||t.pitch||t.rotate;class jr extends t.Event{}class Hr{constructor(){this.constants=[1,1,.01],this.radius=0}setup(e,i){const n=t.sub([],i,e);this.radius=t.length(n[2]<0?t.div([],n,this.constants):[n[0],n[1],0])}projectRay(e){t.div(e,e,this.constants),t.normalize(e,e),t.mul$1(e,e,this.constants);const i=t.scale$2([],e,this.radius);if(i[2]>0){const e=t.scale$2([],[0,0,1],t.dot(i,[0,0,1])),n=t.scale$2([],t.normalize([],[i[0],i[1],0]),this.radius),r=t.add([],i,t.scale$2([],t.sub([],t.add([],n,e),i),2));i[0]=r[0],i[1]=r[1]}return i}}function Wr(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}class qr{constructor(e,i){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new rr(e),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new Hr,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(i),t.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],[t.window.document,"mousemove",{capture:!0}],[t.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],[t.window,"blur",void 0]];for(const[e,i,n]of this._listeners)e.addEventListener(i,e===t.window.document?this.handleWindowEvent:this.handleEvent,n)}destroy(){for(const[e,i,n]of this._listeners)e.removeEventListener(i,e===t.window.document?this.handleWindowEvent:this.handleEvent,n)}_addDefaultHandlers(t){const e=this._map,i=e.getCanvasContainer();this._add("mapEvent",new ur(e,t));const n=e.boxZoom=new pr(e,t);this._add("boxZoom",n);const r=new gr,o=new Br;e.doubleClickZoom=new Nr(o,r),this._add("tapZoom",r),this._add("clickZoom",o);const s=new zr;this._add("tapDragZoom",s);const a=e.touchPitch=new Pr(e);this._add("touchPitch",a);const l=new xr(t),c=new br(t);e.dragRotate=new Vr(t,l,c),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",c,["mouseRotate"]);const u=new _r(t),h=new wr(e,t);e.dragPan=new Fr(i,u,h),this._add("mousePan",u),this._add("touchPan",h,["touchZoom","touchRotate"]);const p=new Ir,d=new Mr;e.touchZoomRotate=new Ur(i,d,p,s),this._add("touchRotate",p,["touchPan","touchZoom"]),this._add("touchZoom",d,["touchPan","touchRotate"]),this._add("blockableMapEvent",new hr(e));const f=e.scrollZoom=new kr(e,this);this._add("scrollZoom",f,["mousePan"]);const m=e.keyboard=new Dr;this._add("keyboard",m);for(const i of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])t.interactive&&t[i]&&e[i].enable(t[i])}_add(t,e,i){this._handlers.push({handlerName:t,handler:e,allowed:i}),this._handlersById[t]=e}stop(t){if(!this._updatingCamera){for(const{handler:t}of this._handlers)t.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(const{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Gr(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(t,e,i){for(const n in t)if(n!==i&&(!e||e.indexOf(n)<0))return!0;return!1}handleWindowEvent(t){this.handleEvent(t,`${t.type}Window`)}_getMapTouches(t){const e=[];for(const i of t)this._el.contains(i.target)&&e.push(i);return e}handleEvent(t,e){this._updatingCamera=!0;const i="renderFrame"===t.type,n=i?void 0:t,r={needsRenderFrame:!1},o={},s={},a=t.touches?this._getMapTouches(t.touches):void 0,l=a?m(this._el,a):i?void 0:f(this._el,t);for(const{handlerName:i,handler:c,allowed:u}of this._handlers){if(!c.isEnabled())continue;let h;this._blockedByActive(s,u,i)?c.reset():c[e||t.type]&&(h=c[e||t.type](t,l,a),this.mergeHandlerResult(r,o,h,i,n),h&&h.needsRenderFrame&&this._triggerRenderFrame()),(h||c.isActive())&&(s[i]=c)}const c={};for(const t in this._previousActiveHandlers)s[t]||(c[t]=n);this._previousActiveHandlers=s,(Object.keys(c).length||Wr(r))&&(this._changes.push([r,o,c]),this._triggerRenderFrame()),(Object.keys(s).length||Wr(r))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:u}=r;u&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],u(this._map))}mergeHandlerResult(e,i,n,r,o){if(!n)return;t.extend(e,n);const s={handlerName:r,originalEvent:n.originalEvent||o};void 0!==n.zoomDelta&&(i.zoom=s),void 0!==n.panDelta&&(i.drag=s),void 0!==n.pitchDelta&&(i.pitch=s),void 0!==n.bearingDelta&&(i.rotate=s)}_applyChanges(){const e={},i={},n={};for(const[r,o,s]of this._changes)r.panDelta&&(e.panDelta=(e.panDelta||new t.Point(0,0))._add(r.panDelta)),r.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+r.zoomDelta),r.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+r.bearingDelta),r.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+r.pitchDelta),void 0!==r.around&&(e.around=r.around),void 0!==r.aroundCoord&&(e.aroundCoord=r.aroundCoord),void 0!==r.pinchAround&&(e.pinchAround=r.pinchAround),r.noInertia&&(e.noInertia=r.noInertia),t.extend(i,o),t.extend(n,s);this._updateMapTransform(e,i,n),this._changes=[]}_updateMapTransform(e,i,n){const r=this._map,o=r.transform,s=t=>[t.x,t.y,t.z];if((t=>{const e=this._eventsInProgress.drag;return e&&!this._handlersById[e.handlerName].isActive()})()&&!Wr(e)){const t=o.zoom;o.cameraElevationReference="sea",o.recenterOnTerrain(),o.cameraElevationReference="ground",t!==o.zoom&&this._map._update(!0)}if(o._isCameraConstrained&&r._stop(!0),!Wr(e))return void this._fireEvents(i,n,!0);let{panDelta:a,zoomDelta:l,bearingDelta:c,pitchDelta:u,around:h,aroundCoord:p,pinchAround:d}=e;o._isCameraConstrained&&(l>0&&(l=0),o._isCameraConstrained=!1),void 0!==d&&(h=d),(l||(t=>i[t]&&!this._eventsInProgress[t])("drag"))&&h&&(this._dragOrigin=s(o.pointCoordinate3D(h)),this._trackingEllipsoid.setup(o._camera.position,this._dragOrigin)),o.cameraElevationReference="sea",r._stop(!0),h=h||r.transform.centerPoint,c&&(o.bearing+=c),u&&(o.pitch+=u),o._updateCameraState();const f=[0,0,0];if(a)if("mercator"===o.projection.name){const t=this._trackingEllipsoid.projectRay(o.screenPointToMercatorRay(h).dir),e=this._trackingEllipsoid.projectRay(o.screenPointToMercatorRay(h.sub(a)).dir);f[0]=e[0]-t[0],f[1]=e[1]-t[1]}else{const e=o.pointCoordinate(h);if("globe"===o.projection.name){a=a.rotate(-o.angle);const i=o._pixelsPerMercatorPixel/o.worldSize;f[0]=-a.x*t.mercatorScale(t.latFromMercatorY(e.y))*i,f[1]=-a.y*t.mercatorScale(o.center.lat)*i}else{const t=o.pointCoordinate(h.sub(a));e&&t&&(f[0]=t.x-e.x,f[1]=t.y-e.y)}}const m=o.zoom,g=[0,0,0];if(l){const e=s(p||o.pointCoordinate3D(h)),i={dir:t.normalize([],t.sub([],e,o._camera.position))};if(i.dir[2]<0){const n=o.zoomDeltaToMovement(e,l);t.scale$2(g,i.dir,n)}}const y=t.add(f,f,g);o._translateCameraConstrained(y),l&&Math.abs(o.zoom-m)>1e-4&&o.recenterOnTerrain(),o.cameraElevationReference="ground",this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(i,n,!0)}_fireEvents(e,i,n){const r=Gr(this._eventsInProgress),o=Gr(e),s={};for(const t in e){const{originalEvent:i}=e[t];this._eventsInProgress[t]||(s[`${t}start`]=i),this._eventsInProgress[t]=e[t]}!r&&o&&this._fireEvent("movestart",o.originalEvent);for(const t in s)this._fireEvent(t,s[t]);o&&this._fireEvent("move",o.originalEvent);for(const t in e){const{originalEvent:i}=e[t];this._fireEvent(t,i)}const a={};let l;for(const t in this._eventsInProgress){const{handlerName:e,originalEvent:n}=this._eventsInProgress[t];this._handlersById[e].isActive()||(delete this._eventsInProgress[t],l=i[e]||n,a[`${t}end`]=l)}for(const t in a)this._fireEvent(t,a[t]);const c=Gr(this._eventsInProgress);if(n&&(r||o)&&!c){this._updatingCamera=!0;const e=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),i=t=>0!==t&&-this._bearingSnap<t&&t<this._bearingSnap;e?(i(e.bearing||this._map.getBearing())&&(e.bearing=0),this._map.easeTo(e,{originalEvent:l})):(this._map.fire(new t.Event("moveend",{originalEvent:l})),i(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(e,i){this._map.fire(new t.Event(e,i?{originalEvent:i}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((t=>{this._frameId=void 0,this.handleEvent(new jr("renderFrame",{timeStamp:t})),this._applyChanges()}))}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}const Xr="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class Zr extends t.Evented{constructor(e,i){super(),this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=i.bearingSnap,this._respectPrefersReducedMotion=!1!==i.respectPrefersReducedMotion,t.bindAll(["_renderFrameCallback"],this)}getCenter(){return new t.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(t,e){return this.jumpTo({center:t},e)}panBy(e,i,n){return e=t.Point.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},i),n)}panTo(e,i,n){return this.easeTo(t.extend({center:e},i),n)}getZoom(){return this.transform.zoom}setZoom(t,e){return this.jumpTo({zoom:t},e),this}zoomTo(e,i,n){return this.easeTo(t.extend({zoom:e},i),n)}zoomIn(t,e){return this.zoomTo(this.getZoom()+1,t,e),this}zoomOut(t,e){return this.zoomTo(this.getZoom()-1,t,e),this}getBearing(){return this.transform.bearing}setBearing(t,e){return this.jumpTo({bearing:t},e),this}getPadding(){return this.transform.padding}setPadding(t,e){return this.jumpTo({padding:t},e),this}rotateTo(e,i,n){return this.easeTo(t.extend({bearing:e},i),n)}resetNorth(e,i){return this.rotateTo(0,t.extend({duration:1e3},e),i),this}resetNorthPitch(e,i){return this.easeTo(t.extend({bearing:0,pitch:0,duration:1e3},e),i),this}snapToNorth(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this}getPitch(){return this.transform.pitch}setPitch(t,e){return this.jumpTo({pitch:t},e),this}cameraForBounds(e,i){e=t.LngLatBounds.convert(e);const n=i&&i.bearing||0,r=i&&i.pitch||0,o=e.getNorthWest(),s=e.getSouthEast();return this._cameraForBounds(this.transform,o,s,n,r,i)}_extendCameraOptions(e){const i={top:0,bottom:0,right:0,left:0};if("number"==typeof(e=t.extend({padding:i,offset:[0,0],maxZoom:this.transform.maxZoom},e)).padding){const t=e.padding;e.padding={top:t,bottom:t,right:t,left:t}}return e.padding=t.extend(i,e.padding),e}_minimumAABBFrustumDistance(t,e){const i=e.max[0]-e.min[0],n=e.max[1]-e.min[1];return i/n>t.aspect?i/(2*Math.tan(.5*t.fovX)*t.aspect):n/(2*Math.tan(.5*t.fovY)*t.aspect)}_cameraForBoundsOnGlobe(e,i,n,r,o,s){const a=e.clone(),l=this._extendCameraOptions(s);a.bearing=r,a.pitch=o;const c=t.LngLat.convert(i),u=t.LngLat.convert(n),h=.5*(c.lat+u.lat),p=.5*(c.lng+u.lng),d=t.latLngToECEF(h,p),f=t.normalize([],d),m=t.normalize([],t.cross([],f,[0,1,0])),g=t.cross([],m,f),y=[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],v=[d,t.latLngToECEF(c.lat,c.lng),t.latLngToECEF(u.lat,c.lng),t.latLngToECEF(u.lat,u.lng),t.latLngToECEF(c.lat,u.lng),t.latLngToECEF(h,c.lng),t.latLngToECEF(h,u.lng),t.latLngToECEF(c.lat,p),t.latLngToECEF(u.lat,p)];let _=t.Aabb.fromPoints(v.map((e=>[t.dot(m,e),t.dot(g,e),t.dot(f,e)])));const x=t.transformMat4([],_.center,y);0===t.squaredLength(x)&&t.set(x,0,0,1),t.normalize(x,x),t.scale$2(x,x,t.GLOBE_RADIUS),a.center=t.ecefToLatLng(x);const b=a.getWorldToCameraMatrix(),w=t.invert(new Float64Array(16),b);_=t.Aabb.applyTransform(_,t.multiply([],b,y)),t.transformMat4(x,x,b);const A=.5*(_.max[2]-_.min[2]),E=this._minimumAABBFrustumDistance(a,_),S=t.scale$2([],[0,0,1],A),M=t.add(S,x,S),T=E+(0===a.pitch?0:t.distance(x,M)),I=a.globeCenterInViewSpace,C=t.sub([],x,[I[0],I[1],I[2]]);t.normalize(C,C),t.scale$2(C,C,T);const P=t.add([],x,C);t.transformMat4(P,P,w);const L=t.earthRadius/t.GLOBE_RADIUS,D=t.length(P),R=t.mercatorZfromAltitude(Math.max(D*L-t.earthRadius,Number.EPSILON),0),O=Math.min(a.zoomFromMercatorZAdjusted(R),l.maxZoom);return O>.5*(t.GLOBE_ZOOM_THRESHOLD_MIN+t.GLOBE_ZOOM_THRESHOLD_MAX)?(a.setProjection({name:"mercator"}),a.zoom=O,this._cameraForBounds(a,i,n,r,o,s)):{center:a.center,zoom:O,bearing:r,pitch:o}}queryTerrainElevation(e,i){const n=this.transform.elevation;return n?(i=t.extend({},{exaggerated:!0},i),n.getAtPoint(t.MercatorCoordinate.fromLngLat(e),null,i.exaggerated)):null}_cameraForBounds(e,i,n,r,o,s){if("globe"===e.projection.name)return this._cameraForBoundsOnGlobe(e,i,n,r,o,s);const a=e.clone(),l=this._extendCameraOptions(s),c=a.padding;a.bearing=r,a.pitch=o;const u=t.LngLat.convert(i),h=t.LngLat.convert(n),p=new t.LngLat(u.lng,h.lat),d=new t.LngLat(h.lng,u.lat),f=a.project(u),m=a.project(h),g=this.queryTerrainElevation(u),y=this.queryTerrainElevation(h),v=this.queryTerrainElevation(p),_=this.queryTerrainElevation(d),x=[[f.x,f.y,Math.min(g||0,y||0,v||0,_||0)],[m.x,m.y,Math.max(g||0,y||0,v||0,_||0)]];let b=t.Aabb.fromPoints(x);const w=a.getWorldToCameraMatrix(),A=t.invert(new Float64Array(16),w);b=t.Aabb.applyTransform(b,w);const E=t.sub([],b.max,b.min),S=c.left||0,M=c.right||0,T=c.bottom||0,I=c.top||0,{left:C,right:P,top:L,bottom:D}=l.padding,R=.5*(S+M),O=.5*(I+T),k=Math.min(a.scaleZoom(a.scale*Math.min((a.width-(S+M+C+P))/E[0],(a.height-(T+I+D+L))/E[1])),l.maxZoom),N=a.scale/a.zoomScale(k);b=new t.Aabb([b.min[0]-(C+R)*N,b.min[1]-(D+O)*N,b.min[2]],[b.max[0]+(P+R)*N,b.max[1]+(L+O)*N,b.max[2]]);const B=.5*E[2],z=this._minimumAABBFrustumDistance(a,b),F=[0,0,1,0];t.transformMat4$1(F,F,w),t.normalize$2(F,F);const V=t.scale$2([],F,z+B),U=t.add([],b.center,V),G=("number"==typeof l.offset.x&&"number"==typeof l.offset.y?new t.Point(l.offset.x,l.offset.y):t.Point.convert(l.offset)).rotate(-t.degToRad(r));b.center[0]-=G.x*N,b.center[1]+=G.y*N,t.transformMat4(b.center,b.center,A),t.transformMat4(U,U,A);const j=[b.center[0],b.center[1],U[2]*a.pixelsPerMeter];t.scale$2(j,j,1/a.worldSize);const H=t.lngFromMercatorX(j[0]),W=t.latFromMercatorY(j[1]),q=Math.min(a._zoomFromMercatorZ(j[2]),l.maxZoom),X=new t.LngLat(H,W);return a.mercatorFromTransition&&q<.5*(t.GLOBE_ZOOM_THRESHOLD_MIN+t.GLOBE_ZOOM_THRESHOLD_MAX)?(a.setProjection({name:"globe"}),a.zoom=q,this._cameraForBounds(a,i,n,r,o,s)):{center:X,zoom:q,bearing:r,pitch:o}}fitBounds(t,e,i){const n=this.cameraForBounds(t,e);return this._fitInternal(n,e,i)}fitScreenCoordinates(e,i,n,r,o){const s=t.Point.convert(e),a=t.Point.convert(i),l=new t.Point(Math.min(s.x,a.x),Math.min(s.y,a.y)),c=new t.Point(Math.max(s.x,a.x),Math.max(s.y,a.y));if("mercator"===this.transform.projection.name&&this.transform.anyCornerOffEdge(s,a))return this;const u=this.transform.pointLocation3D(l),h=this.transform.pointLocation3D(c),p=this.transform.pointLocation3D(new t.Point(l.x,c.y)),d=this.transform.pointLocation3D(new t.Point(c.x,l.y)),f=[Math.min(u.lng,h.lng,p.lng,d.lng),Math.min(u.lat,h.lat,p.lat,d.lat)],m=[Math.max(u.lng,h.lng,p.lng,d.lng),Math.max(u.lat,h.lat,p.lat,d.lat)],g=r&&r.pitch?r.pitch:this.getPitch(),y=this._cameraForBounds(this.transform,f,m,n,g,r);return this._fitInternal(y,r,o)}_fitInternal(e,i,n){return e?(delete(i=t.extend(e,i)).padding,i.linear?this.easeTo(i,n):this.flyTo(i,n)):this}jumpTo(e,i){this.stop();const n=e.preloadOnly?this.transform.clone():this.transform;let r=!1,o=!1,s=!1;return"zoom"in e&&n.zoom!==+e.zoom&&(r=!0,n.zoom=+e.zoom),void 0!==e.center&&(n.center=t.LngLat.convert(e.center)),"bearing"in e&&n.bearing!==+e.bearing&&(o=!0,n.bearing=+e.bearing),"pitch"in e&&n.pitch!==+e.pitch&&(s=!0,n.pitch=+e.pitch),null==e.padding||n.isPaddingEqual(e.padding)||(n.padding=e.padding),e.preloadOnly?(this._preloadTiles(n),this):(this.fire(new t.Event("movestart",i)).fire(new t.Event("move",i)),r&&this.fire(new t.Event("zoomstart",i)).fire(new t.Event("zoom",i)).fire(new t.Event("zoomend",i)),o&&this.fire(new t.Event("rotatestart",i)).fire(new t.Event("rotate",i)).fire(new t.Event("rotateend",i)),s&&this.fire(new t.Event("pitchstart",i)).fire(new t.Event("pitch",i)).fire(new t.Event("pitchend",i)),this.fire(new t.Event("moveend",i)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||t.warnOnce(Xr),this.transform.getFreeCameraOptions()}setFreeCameraOptions(e,i){const n=this.transform;if(!n.projection.supportsFreeCamera)return t.warnOnce(Xr),this;this.stop();const r=n.zoom,o=n.pitch,s=n.bearing;n.setFreeCameraOptions(e);const a=r!==n.zoom,l=o!==n.pitch,c=s!==n.bearing;return this.fire(new t.Event("movestart",i)).fire(new t.Event("move",i)),a&&this.fire(new t.Event("zoomstart",i)).fire(new t.Event("zoom",i)).fire(new t.Event("zoomend",i)),c&&this.fire(new t.Event("rotatestart",i)).fire(new t.Event("rotate",i)).fire(new t.Event("rotateend",i)),l&&this.fire(new t.Event("pitchstart",i)).fire(new t.Event("pitch",i)).fire(new t.Event("pitchend",i)),this.fire(new t.Event("moveend",i)),this}easeTo(e,i){this._stop(!1,e.easeId),(!1===(e=t.extend({offset:[0,0],duration:500,easing:t.ease},e)).animate||this._prefersReducedMotion(e))&&(e.duration=0);const n=this.transform,r=this.getZoom(),o=this.getBearing(),s=this.getPitch(),a=this.getPadding(),l="zoom"in e?+e.zoom:r,c="bearing"in e?this._normalizeBearing(e.bearing,o):o,u="pitch"in e?+e.pitch:s,h="padding"in e?e.padding:n.padding,p=t.Point.convert(e.offset);let d,f,m;if("globe"===n.projection.name){const i=t.MercatorCoordinate.fromLngLat(n.center),r=p.rotate(-n.angle);i.x+=r.x/n.worldSize,i.y+=r.y/n.worldSize;const o=i.toLngLat(),s=t.LngLat.convert(e.center||o);this._normalizeCenter(s),d=n.centerPoint.add(r),f=new t.Point(i.x,i.y).mult(n.worldSize),m=new t.Point(t.mercatorXfromLng(s.lng),t.mercatorYfromLat(s.lat)).mult(n.worldSize).sub(f)}else{d=n.centerPoint.add(p);const i=n.pointLocation(d),r=t.LngLat.convert(e.center||i);this._normalizeCenter(r),f=n.project(i),m=n.project(r).sub(f)}const g=n.zoomScale(l-r);let y,v;e.around&&(y=t.LngLat.convert(e.around),v=n.locationPoint(y));const _=this._zooming||l!==r,x=this._rotating||o!==c,b=this._pitching||u!==s,w=!n.isPaddingEqual(h),A=n=>A=>{if(_&&(n.zoom=t.number(r,l,A)),x&&(n.bearing=t.number(o,c,A)),b&&(n.pitch=t.number(s,u,A)),w&&(n.interpolatePadding(a,h,A),d=n.centerPoint.add(p)),y)n.setLocationAtPoint(y,v);else{const t=n.zoomScale(n.zoom-r),e=l>r?Math.min(2,g):Math.max(.5,g),i=Math.pow(e,1-A),o=n.unproject(f.add(m.mult(A*i)).mult(t));n.setLocationAtPoint(n.renderWorldCopies?o.wrap():o,d)}return e.preloadOnly||this._fireMoveEvents(i),n};if(e.preloadOnly){const t=this._emulate(A,e.duration,n);return this._preloadTiles(t),this}const E={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=_,this._rotating=x,this._pitching=b,this._padding=w,this._easeId=e.easeId,this._prepareEase(i,e.noMoveStart,E),this._ease(A(n),(t=>{n.recenterOnTerrain(),this._afterEase(i,t)}),e),this}_prepareEase(e,i,n={}){this._moving=!0,this.transform.cameraElevationReference="sea",i||n.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!n.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new t.Event("pitchstart",e))}_fireMoveEvents(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))}_afterEase(e,i){if(this._easeId&&i&&this._easeId===i)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const n=this._zooming,r=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new t.Event("zoomend",e)),r&&this.fire(new t.Event("rotateend",e)),o&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}flyTo(e,i){if(this._prefersReducedMotion(e)){const n=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(n,i)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);const n=this.transform,r=this.getZoom(),o=this.getBearing(),s=this.getPitch(),a=this.getPadding(),l="zoom"in e?t.clamp(+e.zoom,n.minZoom,n.maxZoom):r,c="bearing"in e?this._normalizeBearing(e.bearing,o):o,u="pitch"in e?+e.pitch:s,h="padding"in e?e.padding:n.padding,p=n.zoomScale(l-r),d=t.Point.convert(e.offset);let f=n.centerPoint.add(d);const m=n.pointLocation(f),g=t.LngLat.convert(e.center||m);this._normalizeCenter(g);const y=n.project(m),v=n.project(g).sub(y);let _=e.curve;const x=Math.max(n.width,n.height),b=x/p,w=v.mag();if("minZoom"in e){const i=t.clamp(Math.min(e.minZoom,r,l),n.minZoom,n.maxZoom),o=x/n.zoomScale(i-r);_=Math.sqrt(o/w*2)}const A=_*_;function E(t){const e=(b*b-x*x+(t?-1:1)*A*A*w*w)/(2*(t?b:x)*A*w);return Math.log(Math.sqrt(e*e+1)-e)}function S(t){return(Math.exp(t)-Math.exp(-t))/2}function M(t){return(Math.exp(t)+Math.exp(-t))/2}const T=E(0);let I=function(t){return M(T)/M(T+_*t)},C=function(t){return x*((M(T)*(S(e=T+_*t)/M(e))-S(T))/A)/w;var e},P=(E(1)-T)/_;if(Math.abs(w)<1e-6||!isFinite(P)){if(Math.abs(x-b)<1e-6)return this.easeTo(e,i);const t=b<x?-1:1;P=Math.abs(Math.log(b/x))/_,C=function(){return 0},I=function(e){return Math.exp(t*_*e)}}e.duration="duration"in e?+e.duration:1e3*P/("screenSpeed"in e?+e.screenSpeed/_:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0);const L=o!==c,D=u!==s,R=!n.isPaddingEqual(h),O=n=>p=>{const m=p*P,_=1/I(m);n.zoom=1===p?l:r+n.scaleZoom(_),L&&(n.bearing=t.number(o,c,p)),D&&(n.pitch=t.number(s,u,p)),R&&(n.interpolatePadding(a,h,p),f=n.centerPoint.add(d));const x=1===p?g:n.unproject(y.add(v.mult(C(m))).mult(_));return n.setLocationAtPoint(n.renderWorldCopies?x.wrap():x,f),n._updateCameraOnTerrain(),e.preloadOnly||this._fireMoveEvents(i),n};if(e.preloadOnly){const t=this._emulate(O,e.duration,n);return this._preloadTiles(t),this}return this._zooming=!0,this._rotating=L,this._pitching=D,this._padding=R,this._prepareEase(i,!1),this._ease(O(n),(()=>this._afterEase(i)),e),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const t=this._onEaseEnd;this._onEaseEnd=void 0,t.call(this,e)}if(!t){const t=this.handlers;t&&t.stop(!1)}return this}_ease(e,i,n){!1===n.animate||0===n.duration?(e(1),i()):(this._easeStart=t.exported.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=i,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const e=Math.min((t.exported.now()-this._easeStart)/this._easeOptions.duration,1),i=this._onEaseFrame;i&&i(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(e,i){e=t.wrap(e,-180,180);const n=Math.abs(e-i);return Math.abs(e-360-i)<n&&(e-=360),Math.abs(e+360-i)<n&&(e+=360),e}_normalizeCenter(t){const e=this.transform;if(!e.renderWorldCopies||e.maxBounds)return;const i=t.lng-e.center.lng;t.lng+=i>180?-360:i<-180?360:0}_prefersReducedMotion(e){return this._respectPrefersReducedMotion&&t.exported.prefersReducedMotion&&!(e&&e.essential)}_emulate(t,e,i){const n=Math.ceil(15*e/1e3),r=[],o=t(i.clone());for(let t=0;t<=n;t++){const e=o(t/n);r.push(e.clone())}return r}}class Yr{constructor(e={}){this.options=e,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(t){const e=this.options&&this.options.compact;return this._map=t,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"),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}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(t,e){const i=this._map._getUIString(`AttributionControl.${e}`);t.setAttribute("aria-label",i),t.removeAttribute("title"),t.firstElementChild&&t.firstElementChild.setAttribute("title",i)}_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 e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));const i=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){const n=i.reduce(((t,e,n)=>(e.value&&(t+=`${e.key}=${e.value}${n<i.length-1?"&":""}`),t)),"?");e.href=`${t.config.FEEDBACK_URL}/${n}#${Kn(this._map,!0)}`,e.rel="noopener nofollow",this._setElementTitle(e,"MapFeedback")}}_updateData(t){!t||"metadata"!==t.sourceDataType&&"visibility"!==t.sourceDataType&&"style"!==t.dataType||(this._updateAttributions(),this._updateEditLink())}_updateAttributions(){if(!this._map.style)return;let t=[];if(this._map.style.stylesheet){const t=this._map.style.stylesheet;this.styleOwner=t.owner,this.styleId=t.id}const e=this._map.style._sourceCaches;for(const i in e){const n=e[i];if(n.used){const e=n.getSource();e.attribution&&t.indexOf(e.attribution)<0&&t.push(e.attribution)}}t.sort(((t,e)=>t.length-e.length)),t=t.filter(((e,i)=>{for(let n=i+1;n<t.length;n++)if(t[n].indexOf(e)>=0)return!1;return!0})),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=[...this.options.customAttribution,...t]:t.unshift(this.options.customAttribution));const i=t.join(" | ");i!==this._attribHTML&&(this._attribHTML=i,t.length?(this._innerContainer.innerHTML=i,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 Qr{constructor(){t.bindAll(["_updateLogo","_updateCompact"],this)}onAdd(t){this._map=t,this._container=o("div","mapboxgl-ctrl");const e=o("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const t=this._map.style._sourceCaches;if(0===Object.entries(t).length)return!0;for(const e in t){const i=t[e].getSource();if(i.hasOwnProperty("mapbox_logo")&&!i.mapbox_logo)return!1}return!0}_updateCompact(){const t=this._container.children;if(t.length){const e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}}}class Jr{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e}remove(t){const e=this._currentlyRunning,i=e?this._queue.concat(e):this._queue;for(const e of i)if(e.id===t)return void(e.cancelled=!0)}run(t=0){const e=this._currentlyRunning=this._queue;this._queue=[];for(const i of e)if(!i.cancelled&&(i.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}function Kr(e,i,n){if(e=new t.LngLat(e.lng,e.lat),i){const r=new t.LngLat(e.lng-360,e.lat),o=new t.LngLat(e.lng+360,e.lat),s=360*Math.ceil(Math.abs(e.lng-n.center.lng)/360),a=n.locationPoint(e).distSqr(i),l=i.x<0||i.y<0||i.x>n.width||i.y>n.height;n.locationPoint(r).distSqr(i)<a&&(l||Math.abs(r.lng-n.center.lng)<s)?e=r:n.locationPoint(o).distSqr(i)<a&&(l||Math.abs(o.lng-n.center.lng)<s)&&(e=o)}for(;Math.abs(e.lng-n.center.lng)>180;){const t=n.locationPoint(e);if(t.x>=0&&t.y>=0&&t.x<=n.width&&t.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e}const $r={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 to extends t.Evented{constructor(e,i){if(super(),(e instanceof t.window.HTMLElement||i)&&(e=t.extend({element:e},i)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this),this._anchor=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",this._scale=e&&e.scale||1,this._draggable=e&&e.draggable||!1,this._clickTolerance=e&&e.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=e&&e.rotation||0,this._rotationAlignment=e&&e.rotationAlignment||"auto",this._pitchAlignment=e&&e.pitchAlignment&&e.pitchAlignment||"auto",this._updateMoving=()=>this._update(!0),this._occludedOpacity=e&&e.occludedOpacity||.2,e&&e.element)this._element=e.element,this._offset=t.Point.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=o("div");const i=41,n=27,r=s("svg",{display:"block",height:i*this._scale+"px",width:n*this._scale+"px",viewBox:`0 0 ${n} ${i}`},this._element),a=s("radialGradient",{id:"shadowGradient"},s("defs",{},r));s("stop",{offset:"10%","stop-opacity":.4},a),s("stop",{offset:"100%","stop-opacity":.05},a),s("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},r),s("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},r),s("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},r),s("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},r),this._offset=t.Point.convert(e&&e.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",(t=>{t.preventDefault()})),this._element.addEventListener("mousedown",(t=>{t.preventDefault()}));const n=this._element.classList;for(const t in $r)n.remove(`mapboxgl-marker-anchor-${t}`);n.add(`mapboxgl-marker-anchor-${this._anchor}`),this._popup=null}addTo(t){return t===this._map||(this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._updateMoving),t.on("moveend",this._update),t.on("remove",this._clearFadeTimer),t._addMarker(this),this.setDraggable(this._draggable),this._update(),t.on("click",this._onMapClick)),this}remove(){const t=this._map;return t&&(t.off("click",this._onMapClick),t.off("move",this._updateMoving),t.off("moveend",this._update),t.off("mousedown",this._addDragHandler),t.off("touchstart",this._addDragHandler),t.off("mouseup",this._onUp),t.off("touchend",this._onUp),t.off("mousemove",this._onMove),t.off("touchmove",this._onMove),t.off("remove",this._clearFadeTimer),t._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}getElement(){return this._element}setPopup(t){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")),t){if(!("offset"in t.options)){const e=38.1,i=13.5,n=Math.sqrt(Math.pow(i,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-e],"bottom-left":[n,-1*(e-i+n)],"bottom-right":[-n,-1*(e-i+n)],left:[i,-1*(e-i)],right:[-i,-1*(e-i)]}:this._offset}this._popup=t,t._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(t){const e=t.code,i=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==i&&13!==i||this.togglePopup()}_onMapClick(t){const e=t.originalEvent.target,i=this._element;this._popup&&(e===i||i.contains(e))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const t=this._popup;return t?(t.isOpen()?(t.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(t.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const t=this._map,e=this._pos;if(!t||!e)return!1;const i=t.unproject(e),n=t.getFreeCameraOptions();if(!n.position)return!1;const r=n.position.toLngLat();return r.distanceTo(i)<.9*r.distanceTo(this._lngLat)}_evaluateOpacity(){const e=this._map;if(!e)return;const i=this._pos;if(!i||i.x<0||i.x>e.transform.width||i.y<0||i.y>e.transform.height)return void this._clearFadeTimer();const n=e.unproject(i);let r;e._showingGlobe()&&t.isLngLatBehindGlobe(e.transform,this._lngLat)?r=0:(r=1-e._queryFogOpacity(n),e.transform._terrainEnabled()&&e.getTerrain()&&this._behindTerrain()&&(r*=this._occludedOpacity)),this._element.style.opacity=`${r}`,this._element.style.pointerEvents=r>0?"auto":"none",this._popup&&this._popup._setOpacity(r),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const t=this._pos;if(!t||!this._map)return;const e=this._offset.mult(this._scale);this._element.style.transform=`\n translate(${t.x}px,${t.y}px)\n ${$r[this._anchor]}\n ${this._calculateXYTransform()} ${this._calculateZTransform()}\n translate(${e.x}px,${e.y}px)\n `}_calculateXYTransform(){const e=this._pos,i=this._map,n=this.getPitchAlignment();if(!i||!e||"map"!==n)return"";if(!i._showingGlobe()){const t=i.getPitch();return t?`rotateX(${t}deg)`:""}const r=t.radToDeg(t.globeTiltAtLngLat(i.transform,this._lngLat)),o=e.sub(t.globeCenterToScreenPoint(i.transform)),s=Math.abs(o.x)+Math.abs(o.y);if(0===s)return"";const a=r/s;return`rotateX(${-o.y*a}deg) rotateY(${o.x*a}deg)`}_calculateZTransform(){const e=this._pos,i=this._map;if(!i||!e)return"";let n=0;const r=this.getRotationAlignment();if("map"===r)if(i._showingGlobe()){const e=i.project(new t.LngLat(this._lngLat.lng,this._lngLat.lat+.001)),r=i.project(new t.LngLat(this._lngLat.lng,this._lngLat.lat-.001)).sub(e);n=t.radToDeg(Math.atan2(r.y,r.x))-90}else n=-i.getBearing();else if("horizon"===r){const r=t.smoothstep(4,6,i.getZoom()),o=t.globeCenterToScreenPoint(i.transform);o.y+=r*i.transform.height;const s=e.sub(o),a=t.radToDeg(Math.atan2(s.y,s.x));n=(a>90?a-270:a+90)*(1-r)}return n+=this._rotation,n?`rotateZ(${n}deg)`:""}_update(e){t.window.cancelAnimationFrame(this._updateFrameId);const i=this._map;i&&(i.transform.renderWorldCopies&&(this._lngLat=Kr(this._lngLat,this._pos,i.transform)),this._pos=i.project(this._lngLat),!0===e?this._updateFrameId=t.window.requestAnimationFrame((()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())})):this._pos=this._pos.round(),i._requestDomTask((()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(i._showingGlobe()||i.getTerrain()||i.getFog())&&!this._fadeTimer&&(this._fadeTimer=setTimeout(this._evaluateOpacity.bind(this),60)))})))}getOffset(){return this._offset}setOffset(e){return this._offset=t.Point.convert(e),this._update(),this}_onMove(e){const i=this._map;if(!i)return;const n=this._pointerdownPos,r=this._positionDelta;if(n&&r){if(!this._isDragging){const t=this._clickTolerance||i._clickTolerance;if(e.point.dist(n)<t)return;this._isDragging=!0}this._pos=e.point.sub(r),this._lngLat=i.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag"))}}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1;const e=this._map;e&&(e.off("mousemove",this._onMove),e.off("touchmove",this._onMove)),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive"}_addDragHandler(t){const e=this._map,i=this._pos;e&&i&&this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(i),this._pointerdownPos=t.point,this._state="pending",e.on("mousemove",this._onMove),e.on("touchmove",this._onMove),e.once("mouseup",this._onUp),e.once("touchend",this._onUp))}setDraggable(t){this._draggable=!!t;const e=this._map;return e&&(t?(e.on("mousedown",this._addDragHandler),e.on("touchstart",this._addDragHandler)):(e.off("mousedown",this._addDragHandler),e.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return"auto"===this._rotationAlignment||"horizon"===this._rotationAlignment&&this._map&&!this._map._showingGlobe()?"viewport":this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t||"auto",this._update(),this}getPitchAlignment(){return"auto"===this._pitchAlignment?this.getRotationAlignment():this._pitchAlignment}setOccludedOpacity(t){return this._occludedOpacity=t||.2,this._update(),this}getOccludedOpacity(){return this._occludedOpacity}}const eo={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",},io=["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(e=new t.Point(0,0),i="bottom"){if("number"==typeof e){const n=Math.round(Math.sqrt(.5*Math.pow(e,2)));switch(i){case"top":return new t.Point(0,e);case"top-left":return new t.Point(n,n);case"top-right":return new t.Point(-n,n);case"bottom":return new t.Point(0,-e);case"bottom-left":return new t.Point(n,-n);case"bottom-right":return new t.Point(-n,-n);case"left":return new t.Point(e,0);case"right":return new t.Point(-e,0)}return new t.Point(0,0)}return e instanceof t.Point||Array.isArray(e)?t.Point.convert(e):t.Point.convert(e[i]||[0,0])}class ro{constructor(t){this.jumpTo(t)}getValue(e){if(e<=this._startTime)return this._start;if(e>=this._endTime)return this._end;const i=t.easeCubicInOut((e-this._startTime)/(this._endTime-this._startTime));return this._start*(1-i)+this._end*i}isEasing(t){return t>=this._startTime&&t<=this._endTime}jumpTo(t){this._startTime=-1/0,this._endTime=-1/0,this._start=t,this._end=t}easeTo(t,e,i){this._start=this.getValue(e),this._end=t,this._startTime=e,this._endTime=e+i}}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"},so={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},ao={showCompass:!0,showZoom:!0,visualizePitch:!1};class lo{constructor(e,i,n=!1){this._clickTolerance=10,this.element=i,this.mouseRotate=new xr({clickTolerance:e.dragRotate._mouseRotate._clickTolerance}),this.map=e,n&&(this.mousePitch=new br({clickTolerance:e.dragRotate._mousePitch._clickTolerance})),t.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),i.addEventListener("mousedown",this.mousedown),i.addEventListener("touchstart",this.touchstart,{passive:!1}),i.addEventListener("touchmove",this.touchmove),i.addEventListener("touchend",this.touchend),i.addEventListener("touchcancel",this.reset)}down(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),u()}move(t,e){const i=this.map,n=this.mouseRotate.mousemoveWindow(t,e),r=n&&n.bearingDelta;if(r&&i.setBearing(i.getBearing()+r),this.mousePitch){const n=this.mousePitch.mousemoveWindow(t,e),r=n&&n.pitchDelta;r&&i.setPitch(i.getPitch()+r)}}off(){const t=this.element;t.removeEventListener("mousedown",this.mousedown),t.removeEventListener("touchstart",this.touchstart,{passive:!1}),t.removeEventListener("touchmove",this.touchmove),t.removeEventListener("touchend",this.touchend),t.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){h(),t.window.removeEventListener("mousemove",this.mousemove),t.window.removeEventListener("mouseup",this.mouseup)}mousedown(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:()=>e.preventDefault()}),f(this.element,e)),t.window.addEventListener("mousemove",this.mousemove),t.window.addEventListener("mouseup",this.mouseup)}mousemove(t){this.move(t,f(this.element,t))}mouseup(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()}touchstart(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=m(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>t.preventDefault()},this._startPos))}touchmove(t){1!==t.targetTouches.length?this.reset():(this._lastPos=m(this.element,t.targetTouches)[0],this.move({preventDefault:()=>t.preventDefault()},this._lastPos))}touchend(t){0===t.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"},ho={kilometer:"km",meter:"m",mile:"mi",foot:"ft","nautical-mile":"nm"},po={version:t.version,supported:i,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:class extends Zr{constructor(e){if(t.LivePerformanceUtils.mark(t.PerformanceMarkers.create),null!=(e=t.extend({},so,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(e.antialias&&t.isSafariWithAntialiasingBug(t.window)&&(e.antialias=!1,t.warnOnce("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new Yn(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies),e),this._interactive=e.interactive,this._minTileCacheSize=e.minTileCacheSize,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._useWebGL2=e.useWebGL2,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=e.crossSourceCollisions,this._collectResourceTiming=e.collectResourceTiming,this._optimizeForTerrain=e.optimizeForTerrain,this._language=this._parseLanguage(e.language),this._worldview=e.worldview,this._renderTaskQueue=new Jr,this._domRenderTaskQueue=new Jr,this._controls=[],this._markers=[],this._popups=[],this._mapId=t.uniqueId(),this._locale=t.extend({},oo,e.locale),this._clickTolerance=e.clickTolerance,this._cooperativeGestures=e.cooperativeGestures,this._performanceMetricsCollection=e.performanceMetricsCollection,this._containerWidth=0,this._containerHeight=0,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new ro(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken,e.testMode),this._silenceAuthErrors=!!e.testMode,"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error(`Container '${e.container}' not found.`)}else{if(!(e.container instanceof t.window.HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(this._container.childNodes.length>0&&t.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."),e.maxBounds&&this.setMaxBounds(e.maxBounds),t.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!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1),t.window.addEventListener("webkitfullscreenchange",this._onWindowResize,!1),t.window.addEventListener("visibilitychange",this._onVisibilityChange,!1)),this.handlers=new qr(this,e),this._localFontFamily=e.localFontFamily,this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),e.projection&&this.setProjection(e.projection),this._hash=e.hash&&new Jn("string"==typeof e.hash&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),e.attributionControl&&this.addControl(new Yr({customAttribution:e.customAttribution})),this._logoControl=new Qr,this.addControl(this._logoControl,e.logoPosition),this.on("style.load",(()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)})),this.on("data",(e=>{this._update("style"===e.dataType),this.fire(new t.Event(`${e.dataType}data`,e))})),this.on("dataloading",(e=>{this.fire(new t.Event(`${e.dataType}dataloading`,e))}))}_getMapId(){return this._mapId}addControl(e,i){if(void 0===i&&(i=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=e.onAdd(this);this._controls.push(e);const r=this._controlPositions[i];return-1!==i.indexOf("bottom")?r.insertBefore(n,r.firstChild):r.appendChild(n),this}removeControl(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const i=this._controls.indexOf(e);return i>-1&&this._controls.splice(i,1),e.onRemove(this),this}hasControl(t){return this._controls.indexOf(t)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(e){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 i=!this._moving;return i&&this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e)),this.fire(new t.Event("resize",e)),i&&this.fire(new t.Event("moveend",e)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()}setMinZoom(e){if((e=null==e?-2:e)>=-2&&e<=this.transform.maxZoom)return this.transform.minZoom=e,this._update(),this.getZoom()<e?this.setZoom(e):this.fire(new t.Event("zoomstart")).fire(new t.Event("zoom")).fire(new t.Event("zoomend")),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(e){if((e=null==e?22:e)>=this.transform.minZoom)return this.transform.maxZoom=e,this._update(),this.getZoom()>e?this.setZoom(e):this.fire(new t.Event("zoomstart")).fire(new t.Event("zoom")).fire(new t.Event("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(e){if((e=null==e?0:e)<0)throw new Error("minPitch must be greater than or equal to 0");if(e>=0&&e<=this.transform.maxPitch)return this.transform.minPitch=e,this._update(),this.getPitch()<e?this.setPitch(e):this.fire(new t.Event("pitchstart")).fire(new t.Event("pitch")).fire(new t.Event("pitchend")),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(e){if((e=null==e?85:e)>85)throw new Error("maxPitch must be less than or equal to 85");if(e>=this.transform.minPitch)return this.transform.maxPitch=e,this._update(),this.getPitch()>e?this.setPitch(e):this.fire(new t.Event("pitchstart")).fire(new t.Event("pitch")).fire(new t.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(t){return this.transform.renderWorldCopies=t,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(e){return"auto"===e?t.window.navigator.language:Array.isArray(e)?0===e.length?void 0:e.map((e=>"auto"===e?t.window.navigator.language:e)):e}setLanguage(t){const e=this._parseLanguage(t);if(!this.style||e===this._language)return this;this._language=e,this.style._reloadSources();for(const t of this._controls)t._setLanguage&&t._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(t){return this.style&&t!==this._worldview?(this._worldview=t,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(t){return this._lazyInitEmptyStyle(),t?"string"==typeof t&&(t={name:t}):t=null,this._useExplicitProjection=!!t,this._prioritizeAndUpdateProjection(t,this.style.stylesheet?this.style.stylesheet.projection:null)}_updateProjectionTransition(){if("globe"!==this.getProjection().name)return;const e=this.transform,i=e.projection.name;let n;"globe"===i&&e.zoom>=t.GLOBE_ZOOM_THRESHOLD_MAX?(e.setMercatorFromTransition(),n=!0):"mercator"===i&&e.zoom<t.GLOBE_ZOOM_THRESHOLD_MAX&&(e.setProjection({name:"globe"}),n=!0),n&&(this.style.applyProjectionUpdate(),this.style._forceSymbolLayerUpdate())}_prioritizeAndUpdateProjection(t,e){return this._updateProjection(t||e||{name:"mercator"})}_updateProjection(e){let i;if(i="globe"===e.name&&this.transform.zoom>=t.GLOBE_ZOOM_THRESHOLD_MAX?this.transform.setMercatorFromTransition():this.transform.setProjection(e),this.style.applyProjectionUpdate(),i){this.painter.clearBackgroundTiles();for(const t in this.style._sourceCaches)this.style._sourceCaches[t].clearTiles();this._update(!0),this._forceMarkerAndPopupUpdate(!0)}return this}project(e){return this.transform.locationPoint3D(t.LngLat.convert(e))}unproject(e){return this.transform.pointLocation3D(t.Point.convert(e))}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(t,e,i){if("mouseenter"===t||"mouseover"===t){let n=!1;const r=r=>{const o=e.filter((t=>this.getLayer(t))),s=o.length?this.queryRenderedFeatures(r.point,{layers:o}):[];s.length?n||(n=!0,i.call(this,new ar(t,this,r.originalEvent,{features:s}))):n=!1},o=()=>{n=!1};return{layers:new Set(e),listener:i,delegates:{mousemove:r,mouseout:o}}}if("mouseleave"===t||"mouseout"===t){let n=!1;const r=r=>{const o=e.filter((t=>this.getLayer(t)));(o.length?this.queryRenderedFeatures(r.point,{layers:o}):[]).length?n=!0:n&&(n=!1,i.call(this,new ar(t,this,r.originalEvent)))},o=e=>{n&&(n=!1,i.call(this,new ar(t,this,e.originalEvent)))};return{layers:new Set(e),listener:i,delegates:{mousemove:r,mouseout:o}}}{const n=t=>{const n=e.filter((t=>this.getLayer(t))),r=n.length?this.queryRenderedFeatures(t.point,{layers:n}):[];r.length&&(t.features=r,i.call(this,t),delete t.features)};return{layers:new Set(e),listener:i,delegates:{[t]:n}}}}on(t,e,i){if(void 0===i)return super.on(t,e);Array.isArray(e)||(e=[e]);const n=this._createDelegatedListener(t,e,i);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(n);for(const t in n.delegates)this.on(t,n.delegates[t]);return this}once(t,e,i){if(void 0===i)return super.once(t,e);Array.isArray(e)||(e=[e]);const n=this._createDelegatedListener(t,e,i);for(const t in n.delegates)this.once(t,n.delegates[t]);return this}off(t,e,i){if(void 0===i)return super.off(t,e);e=new Set(Array.isArray(e)?e:[e]);const n=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0},r=this._delegatedListeners?this._delegatedListeners[t]:void 0;return r&&(t=>{for(let r=0;r<t.length;r++){const o=t[r];if(o.listener===i&&n(o.layers,e)){for(const t in o.delegates)this.off(t,o.delegates[t]);return t.splice(r,1),this}}})(r),this}queryRenderedFeatures(e,i){return this.style?(void 0!==i||void 0===e||e instanceof t.Point||Array.isArray(e)||(i=e,e=void 0),this.style.queryRenderedFeatures(e=e||[[0,0],[this.transform.width,this.transform.height]],i=i||{},this.transform)):[]}querySourceFeatures(t,e){return this.style.querySourceFeatures(t,e)}isPointOnSurface(e){const{name:i}=this.transform.projection;return"globe"!==i&&"mercator"!==i&&t.warnOnce(`${i} projection does not support isPointOnSurface, this API may behave unexpectedly.`),this.transform.isPointOnSurface(t.Point.convert(e))}setStyle(e,i){return!1!==(i=t.extend({},{localIdeographFontFamily:this._localIdeographFontFamily,localFontFamily:this._localFontFamily},i)).diff&&i.localIdeographFontFamily===this._localIdeographFontFamily&&i.localFontFamily===this._localFontFamily&&this.style&&e?(this._diffStyle(e,i),this):(this._localIdeographFontFamily=i.localIdeographFontFamily,this._localFontFamily=i.localFontFamily,this._updateStyle(e,i))}_getUIString(t){const e=this._locale[t];if(null==e)throw new Error(`Missing UI string '${t}'`);return e}_updateStyle(t,e){return this.style&&(this.style.setEventedParent(null),this.style._remove(),this.style=void 0),t&&(this.style=new Je(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t):this.style.loadJSON(t)),this._updateTerrain(),this}_lazyInitEmptyStyle(){this.style||(this.style=new Je(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(e,i){if("string"==typeof e){const n=this._requestManager.normalizeStyleURL(e),r=this._requestManager.transformRequest(n,t.ResourceType.Style);t.getJSON(r,((e,n)=>{e?this.fire(new t.ErrorEvent(e)):n&&this._updateDiff(n,i)}))}else"object"==typeof e&&this._updateDiff(e,i)}_updateDiff(e,i){try{this.style.setState(e)&&this._update(!0)}catch(n){t.warnOnce(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(e,i)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(t.warnOnce("There is no style added to the map."),!1)}addSource(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)}isSourceLoaded(t){return!!this.style&&this.style._isSourceCacheLoaded(t)}areTilesLoaded(){const t=this.style&&this.style._sourceCaches;for(const e in t){const i=t[e]._tiles;for(const t in i){const e=i[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}}return!0}addSourceType(t,e,i){this._lazyInitEmptyStyle(),this.style.addSourceType(t,e,i)}removeSource(t){return this.style.removeSource(t),this._updateTerrain(),this._update(!0)}getSource(t){return this.style.getSource(t)}addImage(e,i,{pixelRatio:n=1,sdf:r=!1,stretchX:o,stretchY:s,content:a}={}){if(this._lazyInitEmptyStyle(),i instanceof t.window.HTMLImageElement||t.window.ImageBitmap&&i instanceof t.window.ImageBitmap){const{width:l,height:c,data:u}=t.exported.getImageData(i);this.style.addImage(e,{data:new t.RGBAImage({width:l,height:c},u),pixelRatio:n,stretchX:o,stretchY:s,content:a,sdf:r,version:0})}else if(void 0===i.width||void 0===i.height)this.fire(new t.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}=i,u=i;this.style.addImage(e,{data:new t.RGBAImage({width:l,height:c},new Uint8Array(u.data)),pixelRatio:n,stretchX:o,stretchY:s,content:a,sdf:r,version:0,userImage:u}),u.onAdd&&u.onAdd(this,e)}}updateImage(e,i){const n=this.style.getImage(e);if(!n)return void this.fire(new t.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const r=i instanceof t.window.HTMLImageElement||t.window.ImageBitmap&&i instanceof t.window.ImageBitmap?t.exported.getImageData(i):i,{width:o,height:s}=r;void 0!==o&&void 0!==s?o===n.data.width&&s===n.data.height?(n.data.replace(r.data,!(i instanceof t.window.HTMLImageElement||t.window.ImageBitmap&&i instanceof t.window.ImageBitmap)),this.style.updateImage(e,n)):this.fire(new t.ErrorEvent(new Error(`The width and height of the updated image (${o}, ${s})\n must be that same as the previous version of the image\n (${n.data.width}, ${n.data.height})`))):this.fire(new t.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(e){return e?!!this.style.getImage(e):(this.fire(new t.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(t)}loadImage(e,i){t.getImage(this._requestManager.transformRequest(e,t.ResourceType.Image),((e,n)=>{i(e,n instanceof t.window.HTMLImageElement?t.exported.getImageData(n):n)}))}listImages(){return this.style.listImages()}addLayer(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)}moveLayer(t,e){return this.style.moveLayer(t,e),this._update(!0)}removeLayer(t){return this.style.removeLayer(t),this._update(!0)}getLayer(t){return this.style.getLayer(t)}setLayerZoomRange(t,e,i){return this.style.setLayerZoomRange(t,e,i),this._update(!0)}setFilter(t,e,i={}){return this.style.setFilter(t,e,i),this._update(!0)}getFilter(t){return this.style.getFilter(t)}setPaintProperty(t,e,i,n={}){return this.style.setPaintProperty(t,e,i,n),this._update(!0)}getPaintProperty(t,e){return this.style.getPaintProperty(t,e)}setLayoutProperty(t,e,i,n={}){return this.style.setLayoutProperty(t,e,i,n),this._update(!0)}getLayoutProperty(t,e){return this.style.getLayoutProperty(t,e)}setLight(t,e={}){return this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)}getLight(){return this.style.getLight()}setTerrain(t){return this._lazyInitEmptyStyle(),!t&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(t),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(t){return this._lazyInitEmptyStyle(),this.style.setFog(t),this._update(!0)}getFog(){return this.style?this.style.getFog():null}_queryFogOpacity(e){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(t.LngLat.convert(e),this.transform):0}setFeatureState(t,e){return this.style.setFeatureState(t,e),this._update()}removeFeatureState(t,e){return this.style.removeFeatureState(t,e),this._update()}getFeatureState(t){return this.style.getFeatureState(t)}_updateContainerDimensions(){if(!this._container)return;const e=this._container.getBoundingClientRect().width||400,i=this._container.getBoundingClientRect().height||300;let n,r,o,s=this._container;for(;s&&(!r||!o);){const e=t.window.getComputedStyle(s).transform;e&&"none"!==e&&(n=e.match(/matrix.*\((.+)\)/)[1].split(", "),n[0]&&"0"!==n[0]&&"1"!==n[0]&&(r=n[0]),n[3]&&"0"!==n[3]&&"1"!==n[3]&&(o=n[3])),s=s.parentElement}this._containerWidth=r?Math.abs(e/r):e,this._containerHeight=o?Math.abs(i/o):i}_detectMissingCSS(){"rgb(250, 128, 114)"!==t.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&t.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 t=this._container;t.classList.add("mapboxgl-map"),(this._missingCSSCanary=o("div","mapboxgl-canary",t)).style.visibility="hidden",this._detectMissingCSS();const e=this._canvasContainer=o("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=o("canvas","mapboxgl-canvas",e),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 i=this._controlContainer=o("div","mapboxgl-control-container",t),n=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((t=>{n[t]=o("div",`mapboxgl-ctrl-${t}`,i)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(e,i){const n=t.exported.devicePixelRatio||1;this._canvas.width=n*Math.ceil(e),this._canvas.height=n*Math.ceil(i),this._canvas.style.width=`${e}px`,this._canvas.style.height=`${i}px`}_addMarker(t){this._markers.push(t)}_removeMarker(t){const e=this._markers.indexOf(t);-1!==e&&this._markers.splice(e,1)}_addPopup(t){this._popups.push(t)}_removePopup(t){const e=this._popups.indexOf(t);-1!==e&&this._popups.splice(e,1)}_setupPainter(){const e=t.extend({},i.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),n=this._useWebGL2&&this._canvas.getContext("webgl2",e),r=n||this._canvas.getContext("webgl",e)||this._canvas.getContext("experimental-webgl",e);r?(this._useWebGL2&&!n&&t.warnOnce("Failed to create WebGL 2 context. Using WebGL 1."),t.storeAuthState(r,!0),this.painter=new Nn(r,this.transform,!!n),this.on("data",(t=>{"source"===t.dataType&&this.painter.setTileLoadedFlag(!0)})),t.exported$1.testSupport(r)):this.fire(new t.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(e){e.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new t.Event("webglcontextlost",{originalEvent:e}))}_contextRestored(e){this._setupPainter(),this.resize(),this._update(),this.fire(new t.Event("webglcontextrestored",{originalEvent:e}))}_onMapScroll(t){if(t.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(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(t){return this._update(),this._renderTaskQueue.add(t)}_cancelRenderFrame(t){this._renderTaskQueue.remove(t)}_requestDomTask(t){!this.loaded()||this.loaded()&&!this.isMoving()?t():this._domRenderTaskQueue.add(t)}_render(e){let i;const n=this.painter.context.extTimerQuery,r=t.exported.now();if(this.listens("gpu-timing-frame")&&(i=n.createQueryEXT(),n.beginQueryEXT(n.TIME_ELAPSED_EXT,i)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],t.window.performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],t.window.performance.now())),this._renderTaskQueue.run(e),this._domRenderTaskQueue.run(e),this._removed)return;this._updateProjectionTransition();const o=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const e=this.transform.zoom,i=this.transform.pitch,n=t.exported.now(),r=new t.EvaluationParameters(e,{now:n,fadeDuration:o,pitch:i,transition:this.style.getTransition()});this.style.update(r)}this.style&&this.style.fog&&this.style.fog.hasTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let s=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),s=this._updateAverageElevation(r),this.style._updateSources(this.transform),this._forceMarkerAndPopupUpdate()):s=this._updateAverageElevation(r),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 t.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new t.Event("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),i){const e=t.exported.now()-r;n.endQueryEXT(n.TIME_ELAPSED_EXT,i),setTimeout((()=>{const o=n.getQueryObjectEXT(i,n.QUERY_RESULT_EXT)/1e6;n.deleteQueryEXT(i),this.fire(new t.Event("gpu-timing-frame",{cpuTime:e,gpuTime:o})),t.window.performance.mark("frame-gpu",{startTime:r,detail:{gpuTime:o}})}),50)}if(this.listens("gpu-timing-layer")){const e=this.painter.collectGpuTimers();setTimeout((()=>{const i=this.painter.queryGpuTimers(e);this.fire(new t.Event("gpu-timing-layer",{layerTimes:i}))}),50)}if(this.listens("gpu-timing-deferred-render")){const e=this.painter.collectDeferredRenderGpuQueries();setTimeout((()=>{const i=this.painter.queryGpuTimeDeferredRender(e);this.fire(new t.Event("gpu-timing-deferred-render",{gpuTime:i}))}),50)}const a=this._sourcesDirty||this._styleDirty||this._placementDirty||s;if(a||this._repaint)this.triggerRepaint();else{const e=!this.isMoving()&&this.loaded();if(e&&(s=this._updateAverageElevation(r,!0)),s)this.triggerRepaint();else if(this._triggerFrame(!1),e&&(this.fire(new t.Event("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const e=this._calculateSpeedIndex();this.fire(new t.Event("speedindexcompleted",{speedIndex:e})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||a||(this._fullyLoaded=!0,t.LivePerformanceUtils.mark(t.PerformanceMarkers.fullLoad),this._performanceMetricsCollection&&t.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(t){for(const e of this._markers)t&&!this.getRenderWorldCopies()&&(e._lngLat=e._lngLat.wrap()),e._update();for(const e of this._popups)!t||this.getRenderWorldCopies()||e._trackPointer||(e._lngLat=e._lngLat.wrap()),e._update()}_updateAverageElevation(t,e=!1){const i=t=>(this.transform.averageElevation=t,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return 0!==this.transform.averageElevation&&i(0);if((e||t-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(t)){const e=this.transform.averageElevation;let n=this.transform.sampleAverageElevation(),r=!1;this.transform.elevation&&(r=this.transform.elevation.exaggeration()!==this._averageElevationExaggeration,this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(n)?n=0:this._averageElevationLastSampledAt=t;const o=Math.abs(e-n);if(o>1){if(this._isInitialLoad||r)return this._averageElevation.jumpTo(n),i(n);this._averageElevation.easeTo(n,t,300)}else if(o>1e-4)return this._averageElevation.jumpTo(n),i(n)}return!!this._averageElevation.isEasing(t)&&i(this._averageElevation.getValue(t))}_authenticate(){t.getMapSessionAPI(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,(e=>{if(e&&(e.message===t.AUTH_ERR_MSG||401===e.status)){const e=this.painter.context.gl;t.storeAuthState(e,!1),this._logoControl instanceof Qr&&this._logoControl._updateLogo(),e&&e.clear(e.DEPTH_BUFFER_BIT|e.COLOR_BUFFER_BIT|e.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new t.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/")))}})),t.postMapLoadEvent(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,(()=>{}))}_updateTerrain(){const t=this._isDragging();this.painter.updateTerrain(this.style,t)}_calculateSpeedIndex(){const t=this.painter.canvasCopy(),e=this.painter.getCanvasCopiesAndTimestamps();e.timeStamps.push(performance.now());const i=this.painter.context.gl,n=i.createFramebuffer();function r(t){i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,t,0);const e=new Uint8Array(i.drawingBufferWidth*i.drawingBufferHeight*4);return i.readPixels(0,0,i.drawingBufferWidth,i.drawingBufferHeight,i.RGBA,i.UNSIGNED_BYTE,e),e}return i.bindFramebuffer(i.FRAMEBUFFER,n),this._canvasPixelComparison(r(t),e.canvasCopies.map(r),e.timeStamps)}_canvasPixelComparison(t,e,i){let n=i[1]-i[0];const r=t.length/4;for(let o=0;o<e.length;o++){const s=e[o];let a=0;for(let e=0;e<s.length;e+=4)s[e]===t[e]&&s[e+1]===t[e+1]&&s[e+2]===t[e+2]&&s[e+3]===t[e+3]&&(a+=1);n+=(i[o+2]-i[o+1])*(1-a/r)}return n}remove(){this._hash&&this._hash.remove();for(const t of this._controls)t.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!==t.window&&(t.window.removeEventListener("resize",this._onWindowResize,!1),t.window.removeEventListener("orientationchange",this._onWindowResize,!1),t.window.removeEventListener("webkitfullscreenchange",this._onWindowResize,!1),t.window.removeEventListener("online",this._onWindowOnline,!1),t.window.removeEventListener("visibilitychange",this._onVisibilityChange,!1));const e=this.painter.context.gl.getExtension("WEBGL_lose_context");e&&e.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),t.removeAuthState(this.painter.context.gl),this._removed=!0,this.fire(new t.Event("remove"))}triggerRepaint(){this._triggerFrame(!0)}_triggerFrame(e){this._renderNextFrame=this._renderNextFrame||e,this.style&&!this._frame&&(this._frame=t.exported.frame((t=>{const e=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,e&&this._render(t)})))}_preloadTiles(e){const i=this.style?Object.values(this.style._sourceCaches):[];return t.asyncAll(i,((t,i)=>t._preloadTiles(e,i)),(()=>{this.triggerRepaint()})),this}_onWindowOnline(){this._update()}_onWindowResize(t){this._trackResize&&this.resize({originalEvent:t})._update()}_onVisibilityChange(){"hidden"===t.window.document.visibilityState&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(t){this._showTerrainWireframe!==t&&(this._showTerrainWireframe=t,this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(t){this._speedIndexTiming!==t&&(this._speedIndexTiming=t,this._update())}get showPadding(){return!!this._showPadding}set showPadding(t){this._showPadding!==t&&(this._showPadding=t,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())}get repaint(){return!!this._repaint}set repaint(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(t){this._vertices=t,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(t){this._showTileAABBs!==t&&(this._showTileAABBs=t,t&&this._update())}_setCacheLimits(e,i){t.setCacheLimits(e,i)}get version(){return t.version}},NavigationControl:class{constructor(e){this.options=t.extend({},ao,e),this._container=o("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(t=>t.preventDefault())),this.options.showZoom&&(t.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(t=>{this._map&&this._map.zoomIn({},{originalEvent:t})})),o("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(t=>{this._map&&this._map.zoomOut({},{originalEvent:t})})),o("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(t.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",(t=>{const e=this._map;e&&(this.options.visualizePitch?e.resetNorthPitch({},{originalEvent:t}):e.resetNorth({},{originalEvent:t}))})),this._compassIcon=o("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const t=this._map;if(!t)return;const e=t.getZoom(),i=e===t.getMaxZoom(),n=e===t.getMinZoom();this._zoomInButton.disabled=i,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute("aria-disabled",i.toString()),this._zoomOutButton.setAttribute("aria-disabled",n.toString())}_rotateCompassArrow(){const t=this._map;if(!t)return;const e=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(t.transform.pitch*(Math.PI/180)),.5)}) rotateX(${t.transform.pitch}deg) rotateZ(${t.transform.angle*(180/Math.PI)}deg)`:`rotate(${t.transform.angle*(180/Math.PI)}deg)`;t._requestDomTask((()=>{this._compassIcon&&(this._compassIcon.style.transform=e)}))}onAdd(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),t.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&t.on("pitch",this._rotateCompassArrow),t.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new lo(t,this._compass,this.options.visualizePitch)),this._container}onRemove(){const t=this._map;t&&(this._container.remove(),this.options.showZoom&&t.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&t.off("pitch",this._rotateCompassArrow),t.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(t,e){const i=o("button",t,this._container);return i.type="button",i.addEventListener("click",e),i}_setButtonTitle(t,e){if(!this._map)return;const i=this._map._getUIString(`NavigationControl.${e}`);t.setAttribute("aria-label",i),t.firstElementChild&&t.firstElementChild.setAttribute("title",i)}},GeolocateControl:class extends t.Evented{constructor(e){super(),this.options=t.extend({geolocation:t.window.navigator.geolocation},co,e),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=Qn(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(t){return this._map=t,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(e){const i=(t=!!this.options.geolocation)=>{this._supportsGeolocation=t,e(t)};void 0!==this._supportsGeolocation?e(this._supportsGeolocation):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((t=>i("denied"!==t.state))).catch((()=>i())):i()}_isOutOfMapMaxBounds(t){const e=this._map.getMaxBounds(),i=t.coords;return!!e&&(i.longitude<e.getWest()||i.longitude>e.getEast()||i.latitude<e.getSouth()||i.latitude>e.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(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}}_updateCamera(e){const i=new t.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,r=this._map.getBearing(),o=t.extend({bearing:r},this.options.fitBoundsOptions);this._map.fitBounds(i.toBounds(n),o,{geolocateSource:!0})}_updateMarker(e){if(e){const i=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const e=this._map.transform,i=t.mercatorZfromAltitude(1,e._center.lat)*e.worldSize,n=Math.ceil(2*this._accuracy*i);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(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",t),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",t),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&this._noTimeout)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(e){if(void 0!==this._map){if(this._container.addEventListener("contextmenu",(t=>t.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===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",e),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",e)}else{const t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",t),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",t)}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 to({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=o("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new to({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",(e=>{e.geolocateSource||"ACTIVE_LOCK"!==this._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new t.Event("trackuserlocationend")))}))}}_onDeviceOrientation(t){this._userLocationDotMarker&&(t.webkitCompassHeading?this._heading=t.webkitCompassHeading:!0===t.absolute&&(this._heading=-1*t.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._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 t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let t;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(t={maximumAge:6e5,timeout:0},this._noTimeout=!0):(t=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,t),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 e=()=>{t.window.addEventListener("ondeviceorientationabsolute"in t.window?"deviceorientationabsolute":"deviceorientation",this._onDeviceOrientation)};void 0!==t.window.DeviceMotionEvent&&"function"==typeof t.window.DeviceMotionEvent.requestPermission?DeviceOrientationEvent.requestPermission().then((t=>{"granted"===t&&e()})).catch(console.error):e()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),t.window.removeEventListener("deviceorientation",this._onDeviceOrientation),t.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:Yr,ScaleControl:class{constructor(e){this.options=t.extend({},uo,e),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch(t){return!1}}(),t.bindAll(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const t=this.options.maxWidth||100,e=this._map,i=e._containerHeight/2,n=e._containerWidth/2-t/2,r=e.unproject([n,i]),o=e.unproject([n+t,i]),s=r.distanceTo(o);if("imperial"===this.options.unit){const e=3.2808*s;e>5280?this._setScale(t,e/5280,"mile"):this._setScale(t,e,"foot")}else"nautical"===this.options.unit?this._setScale(t,s/1852,"nautical-mile"):s>=1e3?this._setScale(t,s/1e3,"kilometer"):this._setScale(t,s,"meter")}_setScale(t,e,i){this._map._requestDomTask((()=>{const n=function(t){const e=Math.pow(10,`${Math.floor(t)}`.length-1);let i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:i>=1?1:function(t){const e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(i),e*i}(e),r=n/e;this._container.innerHTML=this._isNumberFormatSupported&&"nautical-mile"!==i?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:i}).format(n):`${n} ${ho[i]}`,this._container.style.width=t*r+"px"}))}onAdd(t){return this._map=t,this._language=t.getLanguage(),this._container=o("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.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(t){this._language=t,this._update()}setUnit(t){this.options.unit=t,this._update()}},FullscreenControl:class{constructor(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in t.window.document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(e){return this._map=e,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",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!t.window.document.fullscreenEnabled&&!t.window.document.webkitFullscreenEnabled)}_setupUI(){const e=this._fullscreenButton=o("button","mapboxgl-ctrl-fullscreen",this._controlContainer);o("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden","true"),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",t)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(t.window.document.fullscreenElement||t.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()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends t.Evented{constructor(e){super(),this.options=t.extend(Object.create(eo),e),t.bindAll(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(e&&e.className?e.className.trim().split(/\s+/):[])}addTo(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&e.on("preclick",this._onClose),this.options.closeOnMove&&e.on("move",this._onClose),e.on("remove",this.remove),this._update(),e._addPopup(this),this._focusFirstElement(),this._trackPointer?(e.on("mousemove",this._onMouseEvent),e.on("mouseup",this._onMouseEvent),e._canvasContainer.classList.add("mapboxgl-track-pointer")):e.on("move",this._update),this.fire(new t.Event("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const e=this._map;return e&&(e.off("move",this._update),e.off("move",this._onClose),e.off("preclick",this._onClose),e.off("click",this._onClose),e.off("remove",this.remove),e.off("mousemove",this._onMouseEvent),e.off("mouseup",this._onMouseEvent),e.off("drag",this._onMouseEvent),e._canvasContainer&&e._canvasContainer.classList.remove("mapboxgl-track-pointer"),e._removePopup(this),this._map=void 0),this.fire(new t.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(e){this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update();const i=this._map;return i&&(i.on("move",this._update),i.off("mousemove",this._onMouseEvent),i._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const t=this._map;return t&&(t.off("move",this._update),t.on("mousemove",this._onMouseEvent),t.on("drag",this._onMouseEvent),t._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(e){return this.setDOMContent(t.window.document.createTextNode(e))}setHTML(e){const i=t.window.document.createDocumentFragment(),n=t.window.document.createElement("body");let r;for(n.innerHTML=e;r=n.firstChild,r;)i.appendChild(r);return this.setDOMContent(i)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(t){return this.options.maxWidth=t,this._update(),this}setDOMContent(t){let e=this._content;if(e)for(;e.hasChildNodes();)e.firstChild&&e.removeChild(e.firstChild);else e=this._content=o("div","mapboxgl-popup-content",this._container||void 0);if(e.appendChild(t),this.options.closeButton){const t=this._closeButton=o("button","mapboxgl-popup-close-button",e);t.type="button",t.setAttribute("aria-label","Close popup"),t.setAttribute("aria-hidden","true"),t.innerHTML="×",t.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(t){return this._classList.add(t),this._updateClassList(),this}removeClassName(t){return this._classList.delete(t),this._updateClassList(),this}setOffset(t){return this.options.offset=t,this._update(),this}toggleClassName(t){let e;return this._classList.delete(t)?e=!1:(this._classList.add(t),e=!0),this._updateClassList(),e}_onMouseEvent(t){this._update(t.point)}_getAnchor(t){if(this.options.anchor)return this.options.anchor;const e=this._map,i=this._container,n=this._pos;if(!e||!i||!n)return"bottom";const r=i.offsetWidth,o=i.offsetHeight,s=n.x<r/2,a=n.x>e.transform.width-r/2;if(n.y+t<o)return s?"top-left":a?"top-right":"top";if(n.y>e.transform.height-o){if(s)return"bottom-left";if(a)return"bottom-right"}return s?"left":a?"right":"bottom"}_updateClassList(){const t=this._container;if(!t)return;const e=[...this._classList];e.push("mapboxgl-popup"),this._anchor&&e.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&e.push("mapboxgl-popup-track-pointer"),t.className=e.join(" ")}_update(e){const i=this._map,n=this._content;if(!i||!this._lngLat&&!this._trackPointer||!n)return;let r=this._container;if(r||(r=this._container=o("div","mapboxgl-popup",i.getContainer()),this._tip=o("div","mapboxgl-popup-tip",r),r.appendChild(n)),this.options.maxWidth&&r.style.maxWidth!==this.options.maxWidth&&(r.style.maxWidth=this.options.maxWidth),i.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Kr(this._lngLat,this._pos,i.transform)),!this._trackPointer||e){const t=this._pos=this._trackPointer&&e?e:i.project(this._lngLat),n=no(this.options.offset),r=this._anchor=this._getAnchor(n.y),o=no(this.options.offset,r),s=t.add(o).round();i._requestDomTask((()=>{this._container&&r&&(this._container.style.transform=`${$r[r]} translate(${s.x}px,${s.y}px)`)}))}if(!this._marker&&i._showingGlobe()){const e=t.isLngLatBehindGlobe(i.transform,this._lngLat)?0:1;this._setOpacity(e)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const t=this._container.querySelector(io);t&&t.focus()}_onClose(){this.remove()}_setOpacity(t){this._container&&(this._container.style.opacity=`${t}`),this._content&&(this._content.style.pointerEvents=t?"auto":"none")}},Marker:to,Style:Je,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,FreeCameraOptions:Un,Evented:t.Evented,config:t.config,prewarm:function(){Ft().acquire(Nt)},clearPrewarmedResources:function(){const t=zt;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(Nt),zt=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Bt.workerCount},set workerCount(t){Bt.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage(e){t.clearTileCache(e)},workerUrl:"",workerClass:null,setNow:t.exported.setNow,restoreNow:t.exported.restoreNow};return po}));var r=i;return r}()}(Pm);var Lm=Pm.exports,Dm=rt(Lm);function Rm(t,e,i){const n=Om(t,e);return function(t,e,i){void 0===i&&(i={});for(var n=i.steps||64,r=i.properties?i.properties:!Array.isArray(t)&&"Feature"===t.type&&t.properties?t.properties:{},o=[],s=0;s<n;s++)o.push(_t(t,e,-360*s/n,i).geometry.coordinates);return o.push(o[0]),O([o],r)}(t,n,{properties:{isCircle:!0,center:t,radiusInKm:n,lineColor:i.lineColor,lineWidth:i.lineWidth,fillColor:i.fillColor,polygonType:i.polygonType,polygonImage:i.polygonImage||""}})}function Om(t,e){return pt(R(t),R(e),{units:"kilometers"})}function km(t,e){const i=new Lm.Popup({closeButton:!1,closeOnClick:!1,className:"draw_popup",anchor:"left",offset:{left:[10,0]}});return i.setLngLat(e).setHTML(t).addTo(cNt.value),i}Rf(".draw_popup {\n color: #fff;\n font-size: 14px;\n background-color: rgba(0, 0, 0, 0.5) !important;\n padding: 10px 10px !important;\n}");const Nm={onSetup:function(t){return{clickState:!1,text:"点击拖拽开始绘制",popup:null,opts:t||{}}},onClick:function(t,e){if(t.clickState=!t.clickState,!t.clickState){t.popup&&t.popup.remove(),this.deleteFeature("draw_circle_temp");const i=this.newFeature(Rm(t.coordinates,[e.lngLat.lng,e.lngLat.lat],t.opts));this.addFeature(i);const n=JSON.parse(JSON.stringify(i.coordinates));n[0].push(n[0][0]);const r=JSON.parse(JSON.stringify({id:i.id,type:"Feature",geometry:{type:"Polygon",properties:{lineColor:t.opts.lineColor,lineWidth:t.opts.lineWidth,fillColor:t.opts.fillColor,polygonType:t.opts.polygonType,polygonImage:t.opts.polygonImage||""},coordinates:n}}));return this.map.fire("draw.create",{features:[r]}),this.changeMode("simple_select")}t.coordinates=[e.lngLat.lng,e.lngLat.lat]},onMouseMove:function(t,e){if(t.clickState){const i=this.getFeature("draw_circle_temp");if(i){const n=Rm(t.coordinates,[e.lngLat.lng,e.lngLat.lat],t.opts);i.setProperty("radiusInKm",n.properties.radiusInKm),i.setCoordinates(n.geometry.coordinates)}else this.addFeature(this.newFeature(Object.assign(Rm(t.coordinates,[e.lngLat.lng,e.lngLat.lat],t.opts),{id:"draw_circle_temp"})))}const{lngLat:i}=e;if(t.coordinates){const e=Om([+i.lng,+i.lat],t.coordinates).toFixed(2);t.text=`半径:${e}千米 <br>\n 再次点击结束绘制`}else t.text="点击拖拽开始绘制";t.popup?t.popup.setLngLat([+i.lng,+i.lat]).setHTML(t.text):t.popup=km(t.text,[+i.lng,+i.lat])},toDisplayFeatures:function(t,e,i){i(e)}},Bm={onSetup:function(t){const e={};return e.pointIcon=t.pointIcon,e.iconSize=t.iconSize,e.iconOffset=t.iconOffset,e},onClick:function(t,e){const i=this.newFeature({type:"Feature",properties:{pointIcon:t.pointIcon,iconSize:t.iconSize,iconOffset:t.iconOffset},geometry:{type:"Point",coordinates:[e.lngLat.lng,e.lngLat.lat]}});this.addFeature(i);const n=JSON.parse(JSON.stringify(i.coordinates)),r=JSON.parse(JSON.stringify({id:i.id,type:"Feature",geometry:{type:"Point",properties:{pointIcon:t.pointIcon,iconSize:t.iconSize,iconOffset:t.iconOffset},coordinates:n}}));return this.map.fire("draw.create",{features:[r]}),this.changeMode("simple_select")},toDisplayFeatures:function(t,e,i){i(e)}};var zm={enable(t){setTimeout((()=>{t.map&&t.map.doubleClickZoom&&t._ctx&&t._ctx.store&&t._ctx.store.getInitialConfigValue&&t._ctx.store.getInitialConfigValue("doubleClickZoom")&&t.map.doubleClickZoom.enable()}),0)},disable(t){setTimeout((()=>{t.map&&t.map.doubleClickZoom&&t.map.doubleClickZoom.disable()}),0)}};const Fm={onSetup:function(t){const e=(t=t||{}).featureId;let i,n,r="forward";if(e){if(i=this.getFeature(e),!i)throw new Error("Could not find a feature with the provided featureId");let o=t.from;if(o&&"Feature"===o.type&&o.geometry&&"Point"===o.geometry.type&&(o=o.geometry),o&&"Point"===o.type&&o.coordinates&&2===o.coordinates.length&&(o=o.coordinates),!o||!Array.isArray(o))throw new Error("Please use the `from` property to indicate which point to continue the line from");const s=i.coordinates.length-1;if(i.coordinates[s][0]===o[0]&&i.coordinates[s][1]===o[1])n=s+1,i.addCoordinate(n,...i.coordinates[s]);else{if(i.coordinates[0][0]!==o[0]||i.coordinates[0][1]!==o[1])throw new Error("`from` should match the point at either the start or the end of the provided LineString");r="backwards",n=0,i.addCoordinate(n,...i.coordinates[0])}}else i=this.newFeature({type:lm.FEATURE,properties:{lineColor:t.lineColor,lineWidth:t.lineWidth},geometry:{type:lm.LINE_STRING,coordinates:[]}}),n=0,this.addFeature(i);return this.clearSelectedFeatures(),zm.disable(this),this.updateUIClasses({mouse:sm.ADD}),this.activateUIButton(am.LINE),this.setActionableState({trash:!0}),{line:i,currentVertexPosition:n,direction:r,text:"点击开始绘制",popup:null,opts:t}},clickAnywhere:function(t,e){if(t.currentVertexPosition>0&&Tm(e,t.line.coordinates[t.currentVertexPosition-1])||"backwards"===t.direction&&Tm(e,t.line.coordinates[t.currentVertexPosition+1]))return this.changeMode(cm.SIMPLE_SELECT,{featureIds:[t.line.id]});this.updateUIClasses({mouse:sm.ADD}),t.line.updateCoordinate(t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),"forward"===t.direction?(t.currentVertexPosition++,t.line.updateCoordinate(t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat)):t.line.addCoordinate(0,e.lngLat.lng,e.lngLat.lat)},clickOnVertex:function(t){return this.changeMode(cm.SIMPLE_SELECT,{featureIds:[t.line.id]})},onMouseMove:function(t,e){t.line.updateCoordinate(t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),Am(e)&&this.updateUIClasses({mouse:sm.POINTER});const{lngLat:i}=e;t.currentVertexPosition?t.text="双击结束绘制":t.text="点击开始绘制",t.popup?t.popup.setLngLat([+i.lng,+i.lat]).setHTML(t.text):t.popup=km(t.text,[+i.lng,+i.lat])}};Fm.onTap=Fm.onClick=function(t,e){if(Am(e))return this.clickOnVertex(t,e);this.clickAnywhere(t,e)},Fm.onKeyUp=function(t,e){Mm(e)?this.changeMode(cm.SIMPLE_SELECT,{featureIds:[t.line.id]}):Sm(e)&&(this.deleteFeature([t.line.id],{silent:!0}),this.changeMode(cm.SIMPLE_SELECT))},Fm.onStop=function(t){t.popup&&t.popup.remove(),zm.enable(this),this.activateUIButton(),void 0!==this.getFeature(t.line.id)&&(t.line.removeCoordinate(`${t.currentVertexPosition}`),t.line.isValid()?this.map.fire(um.CREATE,{features:[t.line.toGeoJSON()]}):(this.deleteFeature([t.line.id],{silent:!0}),this.changeMode(cm.SIMPLE_SELECT,{},{silent:!0})))},Fm.onTrash=function(t){this.deleteFeature([t.line.id],{silent:!0}),this.changeMode(cm.SIMPLE_SELECT)},Fm.toDisplayFeatures=function(t,e,i){const n=e.properties.id===t.line.id;if(e.properties.active=n?dm.ACTIVE:dm.INACTIVE,!n)return i(e);e.geometry.coordinates.length<2||(e.properties.meta=pm.FEATURE,i(ym(t.line.id,e.geometry.coordinates["forward"===t.direction?e.geometry.coordinates.length-2:1],""+("forward"===t.direction?e.geometry.coordinates.length-2:1),!1,t.opts)),i(e))};const Vm={onSetup:function(t){const e=t||{},i=this.newFeature({type:lm.FEATURE,properties:{lineColor:e.lineColor,lineWidth:e.lineWidth,fillColor:e.fillColor,polygonType:e.polygonType,polygonImage:e.polygonImage||""},geometry:{type:lm.POLYGON,coordinates:[[]]}});return this.addFeature(i),this.clearSelectedFeatures(),zm.disable(this),this.updateUIClasses({mouse:sm.ADD}),this.activateUIButton(am.POLYGON),this.setActionableState({trash:!0}),{polygon:i,currentVertexPosition:0,text:"点击开始绘制",popup:null,opts:e}},clickAnywhere:function(t,e){if(t.currentVertexPosition>0&&Tm(e,t.polygon.coordinates[0][t.currentVertexPosition-1]))return this.changeMode(cm.SIMPLE_SELECT,{featureIds:[t.polygon.id]});this.updateUIClasses({mouse:sm.ADD}),t.polygon.updateCoordinate(`0.${t.currentVertexPosition}`,e.lngLat.lng,e.lngLat.lat),t.currentVertexPosition++,t.polygon.updateCoordinate(`0.${t.currentVertexPosition}`,e.lngLat.lng,e.lngLat.lat)},clickOnVertex:function(t){return this.changeMode(cm.SIMPLE_SELECT,{featureIds:[t.polygon.id]})},onMouseMove:function(t,e){t.polygon.updateCoordinate(`0.${t.currentVertexPosition}`,e.lngLat.lng,e.lngLat.lat),Am(e)&&this.updateUIClasses({mouse:sm.POINTER});const{lngLat:i}=e;t.currentVertexPosition?t.text="双击结束绘制":t.text="点击开始绘制",t.popup?t.popup.setLngLat([+i.lng,+i.lat]).setHTML(t.text):t.popup=km(t.text,[+i.lng,+i.lat])}};Vm.onTap=Vm.onClick=function(t,e){return Am(e)?this.clickOnVertex(t,e):this.clickAnywhere(t,e)},Vm.onKeyUp=function(t,e){Sm(e)?(this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(cm.SIMPLE_SELECT)):Mm(e)&&this.changeMode(cm.SIMPLE_SELECT,{featureIds:[t.polygon.id]})},Vm.onStop=function(t){t.popup&&t.popup.remove(),this.updateUIClasses({mouse:sm.NONE}),zm.enable(this),this.activateUIButton(),void 0!==this.getFeature(t.polygon.id)&&(t.polygon.removeCoordinate(`0.${t.currentVertexPosition}`),t.polygon.isValid()?this.map.fire(um.CREATE,{features:[t.polygon.toGeoJSON()]}):(this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(cm.SIMPLE_SELECT,{},{silent:!0})))},Vm.toDisplayFeatures=function(t,e,i){const n=e.properties.id===t.polygon.id;if(e.properties.active=n?dm.ACTIVE:dm.INACTIVE,!n)return i(e);if(0===e.geometry.coordinates.length)return;const r=e.geometry.coordinates[0].length;if(!(r<3)){if(e.properties.meta=pm.FEATURE,i(ym(t.polygon.id,e.geometry.coordinates[0][0],"0.0",!1,t.opts)),r>3){const n=e.geometry.coordinates[0].length-3;i(ym(t.polygon.id,e.geometry.coordinates[0][n],`0.${n}`,!1,t.opts))}if(r<=4){const t=[[e.geometry.coordinates[0][0][0],e.geometry.coordinates[0][0][1]],[e.geometry.coordinates[0][1][0],e.geometry.coordinates[0][1][1]]];if(i({type:lm.FEATURE,properties:e.properties,geometry:{coordinates:t,type:lm.LINE_STRING}}),3===r)return}return i(e)}},Vm.onTrash=function(t){this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(cm.SIMPLE_SELECT)};const Um={enable:t=>{setTimeout((()=>{t.map&&t.map.doubleClickZoom&&t._ctx&&t._ctx.store&&t._ctx.store.getInitialConfigValue&&t._ctx.store.getInitialConfigValue("doubleClickZoom")&&t.map.doubleClickZoom.enable()}),0)},disable(t){setTimeout((()=>{t.map&&t.map.doubleClickZoom&&t.map.doubleClickZoom.disable()}),0)}},Gm={onSetup(t){const e=t||{},i=this.newFeature({type:"Feature",properties:{lineColor:e.lineColor,lineWidth:e.lineWidth,fillColor:e.fillColor,polygonType:e.polygonType,polygonImage:e.polygonImage||""},geometry:{type:"Polygon",coordinates:[[]]}});return this.addFeature(i),this.clearSelectedFeatures(),Um.disable(this),this.updateUIClasses({mouse:"add"}),this.setActionableState({trash:!0}),{rectangle:i,text:"点击开始绘制",popup:null}},onTap(t,e){t.startPoint&&this.onMouseMove(t,e),this.onClick(t,e)},onClick(t,e){t.startPoint&&t.startPoint[0]!==e.lngLat.lng&&t.startPoint[1]!==e.lngLat.lat&&(this.updateUIClasses({mouse:"pointer"}),t.endPoint=[e.lngLat.lng,e.lngLat.lat],this.changeMode("simple_select",{featuresId:t.rectangle.id}));const i=[e.lngLat.lng,e.lngLat.lat];t.startPoint=i},onMouseMove(t,e){t.startPoint&&(t.rectangle.updateCoordinate("0.0",t.startPoint[0],t.startPoint[1]),t.rectangle.updateCoordinate("0.1",e.lngLat.lng,t.startPoint[1]),t.rectangle.updateCoordinate("0.2",e.lngLat.lng,e.lngLat.lat),t.rectangle.updateCoordinate("0.3",t.startPoint[0],e.lngLat.lat),t.rectangle.updateCoordinate("0.4",t.startPoint[0],t.startPoint[1]));const{lngLat:i}=e;t.startPoint?t.text="再次点击结束绘制":t.text="点击开始绘制",t.popup?t.popup.setLngLat([+i.lng,+i.lat]).setHTML(t.text):t.popup=km(t.text,[+i.lng,+i.lat])},onKeyUp(t,e){if(27===e.keyCode)return this.changeMode("simple_select")},onStop(t){t.popup&&t.popup.remove(),Um.enable(this),this.updateUIClasses({mouse:"none"}),this.activateUIButton(),void 0!==this.getFeature(t.rectangle.id)&&(t.rectangle.removeCoordinate("0.4"),t.rectangle.isValid()?this.map.fire("draw.create",{features:[t.rectangle.toGeoJSON()]}):(this.deleteFeature([t.rectangle.id],{silent:!0}),this.changeMode("simple_select",{},{silent:!0})))},toDisplayFeatures(t,e,i){const n=e.properties.id===t.rectangle.id;return e.properties.active=n?"true":"false",n?t.startPoint?i(e):void 0:i(e)},onTrash(t){this.deleteFeature([t.rectangle.id],{silent:!0}),this.changeMode("simple_select")}},jm={};function Hm(t,e,i=null){e=e||{};const{type:n,coordinates:r}=t.geometry,o=t.properties&&t.properties.id;let s=[];const a={lineColor:t.properties.user_lineColor,lineWidth:t.properties.user_lineWidth};function l(t,i,n){let r="",a=null;t.forEach(((t,l)=>{const u=null!=i?`${i}.${l}`:String(l),h=ym(o,t,u,c(u),n);if(e.midpoints&&a){const t=function(t,e,i,n){const r=e.geometry.coordinates,o=i.geometry.coordinates;if(r[1]>mm||r[1]<fm||o[1]>mm||o[1]<fm)return null;const s={lng:(r[0]+o[0])/2,lat:(r[1]+o[1])/2};return{type:lm.FEATURE,properties:{lineColor:n.lineColor,lineWidth:n.lineWidth+2,meta:pm.MIDPOINT,parent:t,lng:s.lng,lat:s.lat,coord_path:i.properties.coord_path},geometry:{type:lm.POINT,coordinates:[s.lng,s.lat]}}}(o,a,h,n);t&&s.push(t)}a=h;const p=JSON.stringify(t);r!==p&&s.push(h),0===l&&(r=p)}))}function c(t){return!!e.selectedPaths&&-1!==e.selectedPaths.indexOf(t)}return n===lm.POINT?s.push(ym(o,r,i,c(i),a)):n===lm.POLYGON?r.forEach(((t,e)=>{l(t,null!==i?`${i}.${e}`:String(e),a)})):n===lm.LINE_STRING?l(r,i,a):0===n.indexOf(lm.MULTI_PREFIX)&&function(){const i=n.replace(lm.MULTI_PREFIX,"");r.forEach(((n,r)=>{const o={type:lm.FEATURE,properties:t.properties,geometry:{type:i,coordinates:n}};s=s.concat(Hm(o,e,r))}))}(),s}jm.onSetup=function(t){const e=this.newFeature({type:lm.FEATURE,properties:{pixelSize:t.pixelSize,color:t.color},geometry:{type:lm.POINT,coordinates:[]}});return this.addFeature(e),this.clearSelectedFeatures(),this.updateUIClasses({mouse:sm.ADD}),this.activateUIButton(am.POINT),this.setActionableState({trash:!0}),{point:e}},jm.stopDrawingAndRemove=function(t){this.deleteFeature([t.point.id],{silent:!0}),this.changeMode(cm.SIMPLE_SELECT)},jm.onTap=jm.onClick=function(t,e){this.updateUIClasses({mouse:sm.MOVE}),t.point.updateCoordinate("",e.lngLat.lng,e.lngLat.lat),this.map.fire(um.CREATE,{features:[t.point.toGeoJSON()]}),this.changeMode(cm.SIMPLE_SELECT,{featureIds:[t.point.id]})},jm.onStop=function(t){this.activateUIButton(),t.point.getCoordinate().length||this.deleteFeature([t.point.id],{silent:!0})},jm.toDisplayFeatures=function(t,e,i){const n=e.properties.id===t.point.id;if(e.properties.active=n?dm.ACTIVE:dm.INACTIVE,!n)return i(e)},jm.onTrash=jm.stopDrawingAndRemove,jm.onKeyUp=function(t,e){if(Sm(e)||Mm(e))return this.stopDrawingAndRemove(t,e)};var Wm={exports:{}},qm=function(t){if(!t||!t.type)return null;var e=Xm[t.type];if(!e)return null;if("geometry"===e)return{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]};if("feature"===e)return{type:"FeatureCollection",features:[t]};if("featurecollection"===e)return t},Xm={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"};var Zm=Object.freeze({__proto__:null,default:function t(e){switch(e&&e.type||null){case"FeatureCollection":return e.features=e.features.reduce((function(e,i){return e.concat(t(i))}),[]),e;case"Feature":return e.geometry?t(e.geometry).map((function(t){var i={type:"Feature",properties:JSON.parse(JSON.stringify(e.properties)),geometry:t};return void 0!==e.id&&(i.id=e.id),i})):[e];case"MultiPoint":return e.coordinates.map((function(t){return{type:"Point",coordinates:t}}));case"MultiPolygon":return e.coordinates.map((function(t){return{type:"Polygon",coordinates:t}}));case"MultiLineString":return e.coordinates.map((function(t){return{type:"LineString",coordinates:t}}));case"GeometryCollection":return e.geometries.map(t).reduce((function(t,e){return t.concat(e)}),[]);case"Point":case"Polygon":case"LineString":return[e]}}}),Ym=qm,Qm=ot(Zm),Jm=function(t){return function t(e){if(Array.isArray(e)&&e.length&&"number"==typeof e[0])return[e];return e.reduce((function(e,i){return Array.isArray(i)&&Array.isArray(i[0])?e.concat(t(i)):(e.push(i),e)}),[])}(t)};Qm instanceof Function||(Qm=Qm.default);function Km(t){return Object.prototype.toString.call(t)}var $m=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function tg(t,e){if(t.forEach)return t.forEach(e);for(var i=0;i<t.length;i++)e(t[i],i,t)}var eg=Object.keys||function(t){var e=[];for(var i in t)e.push(i);return e},ig=Object.prototype.hasOwnProperty||function(t,e){return e in t};function ng(t){if("object"==typeof t&&null!==t){var e;if($m(t))e=[];else if("[object Date]"===Km(t))e=new Date(t.getTime?t.getTime():t);else if(function(t){return"[object RegExp]"===Km(t)}(t))e=new RegExp(t);else if(function(t){return"[object Error]"===Km(t)}(t))e={message:t.message};else if(function(t){return"[object Boolean]"===Km(t)}(t)||function(t){return"[object Number]"===Km(t)}(t)||function(t){return"[object String]"===Km(t)}(t))e=Object(t);else if(Object.create&&Object.getPrototypeOf)e=Object.create(Object.getPrototypeOf(t));else if(t.constructor===Object)e={};else{var i=t.constructor&&t.constructor.prototype||t.__proto__||{},n=function(){};n.prototype=i,e=new n}return tg(eg(t),(function(i){e[i]=t[i]})),e}return t}function rg(t,e,i){var n=[],r=[],o=!0;return function t(s){var a=i?ng(s):s,l={},c=!0,u={node:a,node_:s,path:[].concat(n),parent:r[r.length-1],parents:r,key:n[n.length-1],isRoot:0===n.length,level:n.length,circular:null,update:function(t,e){u.isRoot||(u.parent.node[u.key]=t),u.node=t,e&&(c=!1)},delete:function(t){delete u.parent.node[u.key],t&&(c=!1)},remove:function(t){$m(u.parent.node)?u.parent.node.splice(u.key,1):delete u.parent.node[u.key],t&&(c=!1)},keys:null,before:function(t){l.before=t},after:function(t){l.after=t},pre:function(t){l.pre=t},post:function(t){l.post=t},stop:function(){o=!1},block:function(){c=!1}};if(!o)return u;function h(){if("object"==typeof u.node&&null!==u.node){u.keys&&u.node_===u.node||(u.keys=eg(u.node)),u.isLeaf=0===u.keys.length;for(var t=0;t<r.length;t++)if(r[t].node_===s){u.circular=r[t];break}}else u.isLeaf=!0,u.keys=null;u.notLeaf=!u.isLeaf,u.notRoot=!u.isRoot}h();var p=e.call(u,u.node);return void 0!==p&&u.update&&u.update(p),l.before&&l.before.call(u,u.node),c?("object"!=typeof u.node||null===u.node||u.circular||(r.push(u),h(),tg(u.keys,(function(e,r){n.push(e),l.pre&&l.pre.call(u,u.node[e],e);var o=t(u.node[e]);i&&ig.call(u.node,e)&&(u.node[e]=o.node),o.isLast=r===u.keys.length-1,o.isFirst=0===r,l.post&&l.post.call(u,o),n.pop()})),r.pop()),l.after&&l.after.call(u,u.node),u):u}(t).node}function og(t){this.value=t}function sg(t){return new og(t)}og.prototype.get=function(t){for(var e=this.value,i=0;i<t.length;i++){var n=t[i];if(!e||!ig.call(e,n))return;e=e[n]}return e},og.prototype.has=function(t){for(var e=this.value,i=0;i<t.length;i++){var n=t[i];if(!e||!ig.call(e,n))return!1;e=e[n]}return!0},og.prototype.set=function(t,e){for(var i=this.value,n=0;n<t.length-1;n++){var r=t[n];ig.call(i,r)||(i[r]={}),i=i[r]}return i[t[n]]=e,e},og.prototype.map=function(t){return rg(this.value,t,!0)},og.prototype.forEach=function(t){return this.value=rg(this.value,t,!1),this.value},og.prototype.reduce=function(t,e){var i=1===arguments.length,n=i?this.value:e;return this.forEach((function(e){this.isRoot&&i||(n=t.call(this,n,e))})),n},og.prototype.paths=function(){var t=[];return this.forEach((function(){t.push(this.path)})),t},og.prototype.nodes=function(){var t=[];return this.forEach((function(){t.push(this.node)})),t},og.prototype.clone=function(){var t=[],e=[];return function i(n){for(var r=0;r<t.length;r++)if(t[r]===n)return e[r];if("object"==typeof n&&null!==n){var o=ng(n);return t.push(n),e.push(o),tg(eg(n),(function(t){o[t]=i(n[t])})),t.pop(),e.pop(),o}return n}(this.value)},tg(eg(og.prototype),(function(t){sg[t]=function(e){var i=[].slice.call(arguments,1),n=new og(e);return n[t].apply(n,i)}}));var ag=sg,lg=cg;function cg(t){if(!(this instanceof cg))return new cg(t);this._bbox=t||[1/0,1/0,-1/0,-1/0],this._valid=!!t}cg.prototype.include=function(t){return this._valid=!0,this._bbox[0]=Math.min(this._bbox[0],t[0]),this._bbox[1]=Math.min(this._bbox[1],t[1]),this._bbox[2]=Math.max(this._bbox[2],t[0]),this._bbox[3]=Math.max(this._bbox[3],t[1]),this},cg.prototype.equals=function(t){var e;return e=t instanceof cg?t.bbox():t,this._bbox[0]==e[0]&&this._bbox[1]==e[1]&&this._bbox[2]==e[2]&&this._bbox[3]==e[3]},cg.prototype.center=function(t){return this._valid?[(this._bbox[0]+this._bbox[2])/2,(this._bbox[1]+this._bbox[3])/2]:null},cg.prototype.union=function(t){var e;return this._valid=!0,e=t instanceof cg?t.bbox():t,this._bbox[0]=Math.min(this._bbox[0],e[0]),this._bbox[1]=Math.min(this._bbox[1],e[1]),this._bbox[2]=Math.max(this._bbox[2],e[2]),this._bbox[3]=Math.max(this._bbox[3],e[3]),this},cg.prototype.bbox=function(){return this._valid?this._bbox:null},cg.prototype.contains=function(t){if(!t)return this._fastContains();if(!this._valid)return null;var e=t[0],i=t[1];return this._bbox[0]<=e&&this._bbox[1]<=i&&this._bbox[2]>=e&&this._bbox[3]>=i},cg.prototype.intersect=function(t){return this._valid?(e=t instanceof cg?t.bbox():t,!(this._bbox[0]>e[2]||this._bbox[2]<e[0]||this._bbox[3]<e[1]||this._bbox[1]>e[3])):null;var e},cg.prototype._fastContains=function(){if(!this._valid)return new Function("return null;");var t="return "+this._bbox[0]+"<= ll[0] &&"+this._bbox[1]+"<= ll[1] &&"+this._bbox[2]+">= ll[0] &&"+this._bbox[3]+">= ll[1]";return new Function("ll",t)},cg.prototype.polygon=function(){return this._valid?{type:"Polygon",coordinates:[[[this._bbox[0],this._bbox[1]],[this._bbox[2],this._bbox[1]],[this._bbox[2],this._bbox[3]],[this._bbox[0],this._bbox[3]],[this._bbox[0],this._bbox[1]]]]}:null};var ug=function(t){if(!t)return[];var e=Qm(Ym(t)),i=[];return e.features.forEach((function(t){t.geometry&&(i=i.concat(Jm(t.geometry.coordinates)))})),i},hg=ag,pg=lg,dg={features:["FeatureCollection"],coordinates:["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],geometry:["Feature"],geometries:["GeometryCollection"]},fg=Object.keys(dg);function mg(t){for(var e=pg(),i=ug(t),n=0;n<i.length;n++)e.include(i[n]);return e}Wm.exports=function(t){return mg(t).bbox()},Wm.exports.polygon=function(t){return mg(t).polygon()},Wm.exports.bboxify=function(t){return hg(t).map((function(t){t&&(fg.some((function(e){return!!t[e]&&-1!==dg[e].indexOf(t.type)}))&&(t.bbox=mg(t).bbox(),this.update(t)))}))};var gg=rt(Wm.exports);const{LAT_MIN:yg,LAT_MAX:vg,LAT_RENDERED_MIN:_g,LAT_RENDERED_MAX:xg,LNG_MIN:bg,LNG_MAX:wg}=gm;function Ag(t,e){let i=yg,n=vg,r=yg,o=vg,s=wg,a=bg;t.forEach((t=>{const e=gg(t),l=e[1],c=e[3],u=e[0],h=e[2];l>i&&(i=l),c<n&&(n=c),c>r&&(r=c),l<o&&(o=l),u<s&&(s=u),h>a&&(a=h)}));const l=e;return i+l.lat>xg&&(l.lat=xg-i),r+l.lat>vg&&(l.lat=vg-r),n+l.lat<_g&&(l.lat=_g-n),o+l.lat<yg&&(l.lat=yg-o),s+l.lng<=bg&&(l.lng+=360*Math.ceil(Math.abs(l.lng)/360)),a+l.lng>=wg&&(l.lng-=360*Math.ceil(Math.abs(l.lng)/360)),l}function Eg(t,e){const i=Ag(t.map((t=>t.toGeoJSON())),e);t.forEach((t=>{const e=t.getCoordinates(),n=t=>{const e={lng:t[0]+i.lng,lat:t[1]+i.lat};return[e.lng,e.lat]},r=t=>t.map((t=>n(t))),o=t=>t.map((t=>r(t)));let s;t.type===lm.POINT?s=n(e):t.type===lm.LINE_STRING||t.type===lm.MULTI_POINT?s=e.map(n):t.type===lm.POLYGON||t.type===lm.MULTI_LINE_STRING?s=e.map(r):t.type===lm.MULTI_POLYGON&&(s=e.map(o)),t.incomingCoords(s)}))}const Sg=vm(pm.VERTEX),Mg=vm(pm.MIDPOINT),Tg={fireUpdate:function(){this.map.fire(um.UPDATE,{action:hm.CHANGE_COORDINATES,features:this.getSelected().map((t=>t.toGeoJSON()))})},fireActionable:function(t){this.setActionableState({combineFeatures:!1,uncombineFeatures:!1,trash:t.selectedCoordPaths.length>0})},startDragging:function(t,e){this.map.dragPan.disable(),t.canDragMove=!0,t.dragMoveLocation=e.lngLat},stopDragging:function(t){this.map.dragPan.enable(),t.dragMoving=!1,t.canDragMove=!1,t.dragMoveLocation=null},onVertex:function(t,e){this.startDragging(t,e);const i=e.featureTarget.properties,n=t.selectedCoordPaths.indexOf(i.coord_path);Em(e)||-1!==n?Em(e)&&-1===n&&t.selectedCoordPaths.push(i.coord_path):t.selectedCoordPaths=[i.coord_path];const r=this.pathsToCoordinates(t.featureId,t.selectedCoordPaths);this.setSelectedCoordinates(r)},onMidpoint:function(t,e){this.startDragging(t,e);const i=e.featureTarget.properties;t.feature.addCoordinate(i.coord_path,i.lng,i.lat),this.fireUpdate(),t.selectedCoordPaths=[i.coord_path]},pathsToCoordinates:function(t,e){return e.map((e=>({feature_id:t,coord_path:e})))},onFeature:function(t,e){0===t.selectedCoordPaths.length?this.startDragging(t,e):this.stopDragging(t)},dragFeature:function(t,e,i){Eg(this.getSelected(),i),t.dragMoveLocation=e.lngLat},dragVertex:function(t,e,i){const n=t.selectedCoordPaths.map((e=>t.feature.getCoordinate(e))),r=Ag(n.map((t=>({type:lm.FEATURE,properties:{},geometry:{type:lm.POINT,coordinates:t}}))),i);for(let e=0;e<n.length;e++){const i=n[e];t.feature.updateCoordinate(t.selectedCoordPaths[e],i[0]+r.lng,i[1]+r.lat)}},clickNoTarget:function(){this.changeMode(cm.SIMPLE_SELECT)},clickInactive:function(){this.changeMode(cm.SIMPLE_SELECT)},clickActiveFeature:function(t){t.selectedCoordPaths=[],this.clearSelectedCoordinates(),t.feature.changed()},onSetup:function(t){const e=t.featureId,i=this.getFeature(e);if(!i)throw new Error("You must provide a featureId to enter direct_select mode");if(i.type===lm.POINT)throw new TypeError("direct_select mode doesn't handle point features");const n={featureId:e,feature:i,dragMoveLocation:t.startPos||null,dragMoving:!1,canDragMove:!1,selectedCoordPaths:t.coordPath?[t.coordPath]:[]};return this.setSelectedCoordinates(this.pathsToCoordinates(e,n.selectedCoordPaths)),this.setSelected(e),zm.disable(this),this.setActionableState({trash:!0}),n},onStop:function(){zm.enable(this),this.clearSelectedCoordinates()},toDisplayFeatures:function(t,e,i){t.featureId===e.properties.id?(e.properties.active=dm.ACTIVE,i(e),Hm(e,{map:this.map,midpoints:!0,selectedPaths:t.selectedCoordPaths}).forEach(i)):(e.properties.active=dm.INACTIVE,i(e)),this.fireActionable(t)},onTrash:function(t){t.selectedCoordPaths.sort(((t,e)=>e.localeCompare(t,"en",{numeric:!0}))).forEach((e=>t.feature.removeCoordinate(e))),this.fireUpdate(),t.selectedCoordPaths=[],this.clearSelectedCoordinates(),this.fireActionable(t),!1===t.feature.isValid()&&(this.deleteFeature([t.featureId]),this.changeMode(cm.SIMPLE_SELECT,{}))},onMouseMove:function(t,e){const i=_m(e),n=Sg(e),r=Mg(e),o=0===t.selectedCoordPaths.length;i&&o||n&&!o?this.updateUIClasses({mouse:sm.MOVE}):this.updateUIClasses({mouse:sm.NONE});return(n||i||r)&&t.dragMoving&&this.fireUpdate(),this.stopDragging(t),!0},onMouseOut:function(t){return t.dragMoving&&this.fireUpdate(),!0}};Tg.onTouchStart=Tg.onMouseDown=function(t,e){return Sg(e)?this.onVertex(t,e):_m(e)?this.onFeature(t,e):Mg(e)?this.onMidpoint(t,e):void 0},Tg.onDrag=function(t,e){if(!0!==t.canDragMove)return;t.dragMoving=!0,e.originalEvent.stopPropagation();const i={lng:e.lngLat.lng-t.dragMoveLocation.lng,lat:e.lngLat.lat-t.dragMoveLocation.lat};t.selectedCoordPaths.length>0?this.dragVertex(t,e,i):this.dragFeature(t,e,i),t.dragMoveLocation=e.lngLat},Tg.onClick=function(t,e){return bm(e)?this.clickNoTarget(t,e):_m(e)?this.clickActiveFeature(t,e):xm(e)?this.clickInactive(t,e):void this.stopDragging(t)},Tg.onTap=function(t,e){return bm(e)?this.clickNoTarget(t,e):_m(e)?this.clickActiveFeature(t,e):xm(e)?this.clickInactive(t,e):void 0},Tg.onTouchEnd=Tg.onMouseUp=function(t){t.dragMoving&&this.fireUpdate(),this.stopDragging(t)};var Ig=Cg;function Cg(t,e){this.x=t,this.y=e}Cg.prototype={clone:function(){return new Cg(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},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(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,i=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=i,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),i=Math.sin(t),n=e*this.x-i*this.y,r=i*this.x+e*this.y;return this.x=n,this.y=r,this},_rotateAround:function(t,e){var i=Math.cos(t),n=Math.sin(t),r=e.x+i*(this.x-e.x)-n*(this.y-e.y),o=e.y+n*(this.x-e.x)+i*(this.y-e.y);return this.x=r,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Cg.convert=function(t){return t instanceof Cg?t:Array.isArray(t)?new Cg(t[0],t[1]):t};var Pg=rt(Ig);function Lg(t,e){const i=e.getBoundingClientRect();return new Pg(t.clientX-i.left-(e.clientLeft||0),t.clientY-i.top-(e.clientTop||0))}function Dg(t){if(this._items={},this._nums={},this._length=t?t.length:0,t)for(let e=0,i=t.length;e<i;e++)this.add(t[e]),void 0!==t[e]&&("string"==typeof t[e]?this._items[t[e]]=e:this._nums[t[e]]=e)}Dg.prototype.add=function(t){return this.has(t)||(this._length++,"string"==typeof t?this._items[t]=this._length:this._nums[t]=this._length),this},Dg.prototype.delete=function(t){return!1===this.has(t)||(this._length--,delete this._items[t],delete this._nums[t]),this},Dg.prototype.has=function(t){return("string"==typeof t||"number"==typeof t)&&(void 0!==this._items[t]||void 0!==this._nums[t])},Dg.prototype.values=function(){const t=[];return Object.keys(this._items).forEach((e=>{t.push({k:e,v:this._items[e]})})),Object.keys(this._nums).forEach((e=>{t.push({k:JSON.parse(e),v:this._nums[e]})})),t.sort(((t,e)=>t.v-e.v)).map((t=>t.k))},Dg.prototype.clear=function(){return this._length=0,this._items={},this._nums={},this};const Rg={onSetup:function(t){const e={dragMoveLocation:null,boxSelectStartLocation:null,boxSelectElement:void 0,boxSelecting:!1,canBoxSelect:!1,dragMoving:!1,canDragMove:!1,initiallySelectedFeatureIds:t.featureIds||[]};return this.setSelected(e.initiallySelectedFeatureIds.filter((t=>void 0!==this.getFeature(t)))),this.fireActionable(),this.setActionableState({combineFeatures:!0,uncombineFeatures:!0,trash:!0}),e},fireUpdate:function(){this.map.fire(um.UPDATE,{action:hm.MOVE,features:this.getSelected().map((t=>t.toGeoJSON()))})},fireActionable:function(){const t=this.getSelected(),e=t.filter((t=>this.isInstanceOf("MultiFeature",t)));let i=!1;if(t.length>1){i=!0;const e=t[0].type.replace("Multi","");t.forEach((t=>{t.type.replace("Multi","")!==e&&(i=!1)}))}const n=e.length>0,r=t.length>0;this.setActionableState({combineFeatures:i,uncombineFeatures:n,trash:r})},getUniqueIds:function(t){if(!t.length)return[];const e=t.map((t=>t.properties.id)).filter((t=>void 0!==t)).reduce(((t,e)=>(t.add(e),t)),new(Dg()));return e.values()},stopExtendedInteractions:function(t){t.boxSelectElement&&(t.boxSelectElement.parentNode&&t.boxSelectElement.parentNode.removeChild(t.boxSelectElement),t.boxSelectElement=null),this.map.dragPan.enable(),t.boxSelecting=!1,t.canBoxSelect=!1,t.dragMoving=!1,t.canDragMove=!1},onStop:function(){zm.enable(this)},onMouseMove:function(t,e){return wm(e)&&t.dragMoving&&this.fireUpdate(),this.stopExtendedInteractions(t),!0},onMouseOut:function(t){return!t.dragMoving||this.fireUpdate()}};Rg.onTap=Rg.onClick=function(t,e){return bm(e)?this.clickAnywhere(t,e):vm(pm.VERTEX)(e)?this.clickOnVertex(t,e):wm(e)?this.clickOnFeature(t,e):void 0},Rg.clickAnywhere=function(t){const e=this.getSelectedIds();e.length&&(this.clearSelectedFeatures(),e.forEach((t=>this.doRender(t)))),zm.enable(this),this.stopExtendedInteractions(t)},Rg.clickOnVertex=function(t,e){this.changeMode(cm.DIRECT_SELECT,{featureId:e.featureTarget.properties.parent,coordPath:e.featureTarget.properties.coord_path,startPos:e.lngLat}),this.updateUIClasses({mouse:sm.MOVE})},Rg.startOnActiveFeature=function(t,e){this.stopExtendedInteractions(t),this.map.dragPan.disable(),this.doRender(e.featureTarget.properties.id),t.canDragMove=!0,t.dragMoveLocation=e.lngLat},Rg.clickOnFeature=function(t,e){zm.disable(this),this.stopExtendedInteractions(t);const i=Em(e),n=this.getSelectedIds(),r=e.featureTarget.properties.id,o=this.isSelected(r);if(!i&&o&&this.getFeature(r).type!==lm.POINT)return this.changeMode(cm.DIRECT_SELECT,{featureId:r});o&&i?(this.deselect(r),this.updateUIClasses({mouse:sm.POINTER}),1===n.length&&zm.enable(this)):!o&&i?(this.select(r),this.updateUIClasses({mouse:sm.MOVE})):o||i||(n.forEach((t=>this.doRender(t))),this.setSelected(r),this.updateUIClasses({mouse:sm.MOVE})),this.doRender(r)},Rg.onMouseDown=function(t,e){return _m(e)?this.startOnActiveFeature(t,e):this.drawConfig.boxSelect&&function(t){return!!t.originalEvent&&!!t.originalEvent.shiftKey&&0===t.originalEvent.button}(e)?this.startBoxSelect(t,e):void 0},Rg.startBoxSelect=function(t,e){this.stopExtendedInteractions(t),this.map.dragPan.disable(),t.boxSelectStartLocation=Lg(e.originalEvent,this.map.getContainer()),t.canBoxSelect=!0},Rg.onTouchStart=function(t,e){if(_m(e))return this.startOnActiveFeature(t,e)},Rg.onDrag=function(t,e){return t.canDragMove?this.dragMove(t,e):this.drawConfig.boxSelect&&t.canBoxSelect?this.whileBoxSelect(t,e):void 0},Rg.whileBoxSelect=function(t,e){t.boxSelecting=!0,this.updateUIClasses({mouse:sm.ADD}),t.boxSelectElement||(t.boxSelectElement=document.createElement("div"),t.boxSelectElement.classList.add(om.BOX_SELECT),this.map.getContainer().appendChild(t.boxSelectElement));const i=Lg(e.originalEvent,this.map.getContainer()),n=Math.min(t.boxSelectStartLocation.x,i.x),r=Math.max(t.boxSelectStartLocation.x,i.x),o=Math.min(t.boxSelectStartLocation.y,i.y),s=Math.max(t.boxSelectStartLocation.y,i.y),a=`translate(${n}px, ${o}px)`;t.boxSelectElement.style.transform=a,t.boxSelectElement.style.WebkitTransform=a,t.boxSelectElement.style.width=r-n+"px",t.boxSelectElement.style.height=s-o+"px"},Rg.dragMove=function(t,e){t.dragMoving=!0,e.originalEvent.stopPropagation();const i={lng:e.lngLat.lng-t.dragMoveLocation.lng,lat:e.lngLat.lat-t.dragMoveLocation.lat};Eg(this.getSelected(),i),t.dragMoveLocation=e.lngLat},Rg.onTouchEnd=Rg.onMouseUp=function(t,e){if(t.dragMoving)this.fireUpdate();else if(t.boxSelecting){const i=[t.boxSelectStartLocation,Lg(e.originalEvent,this.map.getContainer())],n=this.featuresAt(null,i,"click"),r=this.getUniqueIds(n).filter((t=>!this.isSelected(t)));r.length&&(this.select(r),r.forEach((t=>this.doRender(t))),this.updateUIClasses({mouse:sm.MOVE}))}this.stopExtendedInteractions(t)},Rg.toDisplayFeatures=function(t,e,i){e.properties.active=this.isSelected(e.properties.id)?dm.ACTIVE:dm.INACTIVE,i(e),this.fireActionable(),e.properties.active===dm.ACTIVE&&e.geometry.type!==lm.POINT&&Hm(e,{}).forEach(i)},Rg.onTrash=function(){this.deleteFeature(this.getSelectedIds()),this.fireActionable()},Rg.onCombineFeatures=function(){const t=this.getSelected();if(0===t.length||t.length<2)return;const e=[],i=[],n=t[0].type.replace("Multi","");for(let r=0;r<t.length;r++){const o=t[r];if(o.type.replace("Multi","")!==n)return;o.type.includes("Multi")?o.getCoordinates().forEach((t=>{e.push(t)})):e.push(o.getCoordinates()),i.push(o.toGeoJSON())}if(i.length>1){const t=this.newFeature({type:lm.FEATURE,properties:i[0].properties,geometry:{type:`Multi${n}`,coordinates:e}});this.addFeature(t),this.deleteFeature(this.getSelectedIds(),{silent:!0}),this.setSelected([t.id]),this.map.fire(um.COMBINE_FEATURES,{createdFeatures:[t.toGeoJSON()],deletedFeatures:i})}this.fireActionable()},Rg.onUncombineFeatures=function(){const t=this.getSelected();if(0===t.length)return;const e=[],i=[];for(let n=0;n<t.length;n++){const r=t[n];this.isInstanceOf("MultiFeature",r)&&(r.getFeatures().forEach((t=>{this.addFeature(t),t.properties=r.properties,e.push(t.toGeoJSON()),this.select([t.id])})),this.deleteFeature(r.id,{silent:!0}),i.push(r.toGeoJSON()))}e.length>1&&this.map.fire(um.UNCOMBINE_FEATURES,{createdFeatures:e,deletedFeatures:i}),this.fireActionable()};Rg.dragMove=function(t,e){t.dragMoving=!0,e.originalEvent.stopPropagation();const i={lng:e.lngLat.lng-t.dragMoveLocation.lng,lat:e.lngLat.lat-t.dragMoveLocation.lat},n=this.getSelected();n.forEach((t=>{if(t.properties&&t.properties.isCircle){const e=t.properties.center;t.setProperty("center",[e[0]+i.lng,e[1]+i.lat])}})),Eg(n,i),t.dragMoveLocation=e.lngLat};const Og=Tg;Og.dragVertex=function(t,e,i){const n=t.selectedCoordPaths.map((e=>t.feature.getCoordinate(e))),r=t.feature.properties;if(t.feature.properties&&t.feature.properties.isCircle){const i=Rm(t.feature.properties.center,[e.lngLat.lng,e.lngLat.lat],r);t.feature.setProperty("radiusInKm",i.properties.radiusInKm),t.feature.setCoordinates(i.geometry.coordinates)}else{const e=Ag(n.map((t=>({type:"Feature",properties:r,geometry:{type:"Point",coordinates:t}}))),i);for(let i=0;i<n.length;i++){const r=n[i];t.feature.updateCoordinate(t.selectedCoordPaths[i],r[0]+e.lng,r[1]+e.lat)}}},Og.dragFeature=function(t,e,i){const n=this.getSelected();n.forEach((t=>{if(t.properties&&t.properties.isCircle){const e=t.properties.center;t.setProperty("center",[e[0]+i.lng,e[1]+i.lat])}})),Eg(n,i),t.dragMoveLocation=e.lngLat};var kg={exports:{}},Ng=kg.exports={};Ng.onSetup=function(){return this.setActionableState(),{}},Ng.toDisplayFeatures=function(t,e,i){i(e)};var Bg=rt(kg.exports);class zg{_map;_draw;drawType;_option;_featureObj={};_callback={};constructor(t){const e=t&&t.lineWidth?t.lineWidth/5:1;this._option=Object.assign({color:"rgba(223,168,32,1)",lineColor:"rgba(223,168,32,1)",fillColor:"rgba(223,168,32,0.1)",lineWidth:2,pixelSize:4,pointType:"circle",dash:e,iconSize:1,iconOffset:[0,0],polygonType:"color"},t),this._map=cNt.value;let i=[];this._option.pointType&&(i=this._setPointStyle(this._option.pointType));let n={};n="image"==this._option.polygonType?{"fill-pattern":["get","user_polygonImage"]}:{"fill-color":["get","user_fillColor"]},this._draw=new Gf({userProperties:!0,displayControlsDefault:!1,modes:{...Gf.modes,direct_select:Tg,simple_select:Rg,static:Bg,drawRectangle:Gm,radiusCircleMode:Nm,drawSymbol:Bm,drawLineString:Fm,drawPolygon:Vm,drawPoint:jm,drawAttackArrow:Cm},styles:[{id:"gl-draw-polygon-fill",type:"fill",filter:["all",["==","$type","Polygon"],["!=","mode","static"]],paint:n},{id:"gl-draw-line",type:"line",filter:["all",["==","$type","LineString"],["!=","mode","static"]],layout:{},paint:{"line-color":["get","user_lineColor"],"line-width":["get","user_lineWidth"]}},...i,{id:"gl-draw-polygon-midpoint",type:"circle",filter:["all",["==","$type","Point"],["==","meta","midpoint"]],paint:{"circle-radius":["get","lineWidth"],"circle-color":["get","lineColor"]}},{id:"gl-draw-polygon-stroke-active",type:"line",filter:["all",["==","$type","Polygon"],["!=","mode","static"]],layout:{},paint:{"line-color":["get","user_lineColor"],"line-width":["get","user_lineWidth"]}},{id:"gl-draw-polygon-and-line-vertex-halo-active",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":["get","lineWidth"],"circle-color":["get","lineColor"],"circle-stroke-width":1,"circle-stroke-color":"#ffffff"}},{id:"gl-draw-polygon-and-line-vertex-active",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":["get","lineWidth"],"circle-color":["get","lineColor"],"circle-stroke-width":1,"circle-stroke-color":"#ffffff"}},{id:"gl-draw-line-static",type:"line",filter:["all",["==","$type","LineString"],["==","mode","static"]],layout:{},paint:{"line-color":["get","user_lineColor"],"line-width":["get","user_lineWidth"]}},{id:"gl-draw-polygon-fill-static",type:"fill",filter:["all",["==","$type","Polygon"],["==","mode","static"]],paint:n},{id:"gl-draw-polygon-stroke-static",type:"line",filter:["all",["==","$type","Polygon"],["==","mode","static"]],layout:{},paint:{"line-color":["get","user_lineColor"],"line-width":["get","user_lineWidth"]}}]}),this.drawType="multiple",this._map.addControl(this._draw),"view"===this.drawType&&this.enableEdit(!1)}initListener(t,e){this._map._listeners["draw.create"]&&(this._map._listeners["draw.create"]=void 0),this._map._listeners["draw.update"]&&(this._map._listeners["draw.update"]=void 0),this._map._listeners["draw.delete"]&&(this._map._listeners["draw.delete"]=void 0),this._map.on("draw.create",(i=>{if("function"==typeof t){const n=i.features[0].geometry.coordinates,r=i.features[0].id,o={id:r,positionData:n};if(this._featureObj[r]=i.features,this._callback[r]=t,"circle"===e){const{centerPoint:t,radius:e}=this._getCenterAndRadius(n);o.centerPoint=t,o.radius=e}t(o)}const n=i.features[0].id;this.singleClear(n)})),this._map.on("draw.update",(i=>{if("function"==typeof t){const n=i.features[0].geometry.coordinates,r=i.features[0].id,o={id:r,positionData:n};if(this._featureObj[r]=i.features,this._callback[r]=t,"circle"===e){const{centerPoint:t,radius:e}=this._getCenterAndRadius(n);o.centerPoint=t,o.radius=e}t(o)}}))}_getCenterAndRadius(t){const e=wt(O(t)),i=pt(R(t[0][0]),R(e.geometry.coordinates),{units:"kilometers"});return{centerPoint:e.geometry.coordinates,radius:i}}addRectangle(t,e){if(e=e||{},this._draw){const t=this._setPolygonStyle(e);this._draw.changeMode("drawRectangle",t),console.log("开始绘制")}this.initListener(t)}addCircle(t,e){if(e=e||{},this._draw){const t=this._setPolygonStyle(e);this._draw.changeMode("radiusCircleMode",t)}this.initListener(t,"circle")}addPolygon(t,e){e=e||{};if(this._draw){const t=this._setPolygonStyle(e);this._draw.changeMode("drawPolygon",t)}this.initListener(t)}addPoint(t,e){e=e||{};let i="drawPoint",n={};if("icon"==this._option.pointType&&e.color)throw new Error("'pointType' is 'icon'. need to get 'pointIcon', but get 'color'");if("circle"==this._option.pointType&&e.pointIcon)throw new Error("'polygonType' is 'circle'. need to get 'color', but get 'pointIcon'");if("icon"==this._option.pointType){if(i="drawSymbol",n={pointIcon:"",iconSize:e.iconSize||this._option.iconSize,iconOffset:e.iconOffset||this._option.iconOffset},e.pointIcon||this._option.pointIcon){const t=d(0,25);this._option.pointIcon&&this.initImage(this._option.pointIcon,t),e.pointIcon&&this.initImage(e.pointIcon,t),n.pointIcon=t}}else n={pixelSize:e.pixelSize||this._option.pixelSize,color:e.color||this._option.color};this._draw&&this._draw.changeMode(i,n),this.initListener(t)}addLine(t,e){e=e||{},this._draw&&this._draw.changeMode("drawLineString",{featureId:"",from:[],lineColor:e.lineColor||this._option.lineColor,lineWidth:e.lineWidth||this._option.lineWidth}),this.initListener(t)}addGeoJson(t,e){let i=[];Array.isArray(t)?t.forEach((t=>{this._draw&&(t&&t.features.length&&t.features.forEach((i=>{const n=JSON.parse(JSON.stringify(this._option));this._featureObj[i.id]=[t],this._callback[i.id]=e;const r=Object.assign(n,i.properties);if(r.pointIcon){const t=d(0,25);r.pointIcon&&this.initImage(r.pointIcon,t),r.pointIcon=t}if(r.polygonImage){const t=d(0,25);r.polygonImage&&this.initImage(r.polygonImage,t),r.polygonImage=t}i.properties={...r}})),i=i.concat(this._draw.add(t)))})):(t&&t.features.length&&t.features.forEach((t=>{const i=JSON.parse(JSON.stringify(this._option)),n=Object.assign(i,t.properties);if(this._featureObj[t.id]=[t],this._callback[t.id]=e,n.pointIcon){const t=d(0,25);n.pointIcon&&this.initImage(n.pointIcon,t),n.pointIcon=t}if(n.polygonImage){const t=d(0,25);n.polygonImage&&this.initImage(n.polygonImage,t),n.polygonImage=t}t.properties={...n}})),this._draw&&(i=this._draw.add(t))),this.singleClear(i),this.initListener(e)}stopDraw(){this._draw&&this._draw.changeMode("simpleSelect",{featureIds:[]})}enableEdit(t){t?this._draw&&this._draw.changeMode("simpleSelect",{featureIds:[]}):this._draw&&this._draw.changeMode("static")}singleClear(t){if("single"===this.drawType){this._draw.getAll().features.forEach((e=>{if(-1===t.indexOf(e.id)){const t=[e.id];this._draw.delete(t)}}))}}updateStyle(t,e){if(!t||!this._featureObj[t])throw new Error(`ID '${t}' does not exist. `);this.clear(t);const i=this._featureObj[t];i&&(i.map((t=>{t.properties={...t.properties,...e}})),this.addGeoJson({type:"FeatureCollection",features:i},this._callback[t]))}clear(t){t?this._draw.delete([t]):this.clearAll()}clearAll(){this._draw.deleteAll(),this._featureObj={}}destroy(){this._draw&&(this.clearAll(),this._draw.onRemove(this._map))}initImage(t,e){cNt.value.loadImage(t,((t,i)=>{if(t)throw t;cNt.value.hasImage(e)?(cNt.value.removeImage(e),cNt.value.addImage(e,i)):cNt.value.addImage(e,i)}))}_setPointStyle(t){let e=[];return e="circle"==t?[{id:"gl-draw-point",type:"circle",filter:["all",["==","$type","Point"],["!=","meta","midpoint"],["!=","meta","vertex"],["!=","mode","static"]],layout:{},paint:{"circle-radius":["get","user_pixelSize"],"circle-color":["get","user_color"]}},{id:"gl-draw-point-static",type:"circle",filter:["all",["==","$type","Point"],["==","mode","static"]],layout:{},paint:{"circle-radius":["get","user_pixelSize"],"circle-color":["get","user_color"]}}]:[{id:"gl-draw-point",type:"symbol",filter:["all",["==","$type","Point"],["!=","meta","midpoint"],["!=","meta","vertex"],["!=","mode","static"]],layout:{"icon-image":["get","user_pointIcon"],"icon-size":["get","user_iconSize"],"icon-offset":["get","user_iconOffset"],"icon-anchor":"bottom","icon-allow-overlap":!0,"icon-ignore-placement":!0},paint:{}},{id:"gl-draw-point-static",type:"symbol",filter:["all",["==","$type","Point"],["!=","meta","midpoint"],["!=","meta","vertex"],["!=","mode","static"]],layout:{"icon-image":["get","user_pointIcon"],"icon-size":["get","user_iconSize"],"icon-offset":["get","user_iconOffset"],"icon-anchor":"bottom","icon-allow-overlap":!0,"icon-ignore-placement":!0},paint:{}}],e}_setPolygonStyle(t){if("image"==this._option.polygonType&&t.fillColor)throw new Error("'polygonType' is 'image'. need to get 'polygonImage', but get 'fillColor'");if("color"==this._option.polygonType&&t.polygonImage)throw new Error("'polygonType' is 'color'. need to get 'fillColor', but get 'polygonImage'");const e={fillColor:t.fillColor||this._option.fillColor,lineColor:t.lineColor||this._option.lineColor,lineWidth:t.lineWidth||this._option.lineWidth,polygonType:t.polygonType||this._option.polygonType,polygonImage:""};if(("image"==t.polygonType||"image"==this._option.polygonType)&&(t.polygonImage||this._option.polygonImage)){const i=d(0,25);this._option.polygonImage&&this.initImage(this._option.polygonImage,i),t.polygonImage&&this.initImage(t.polygonImage,i),e.polygonImage=i}return e}}Rf(".ePopup {\n border-radius: 6px;\n width: 418px;\n height: 318px;\n display: flex;\n justify-content: center;\n}\n.ePopup-light-triangle {\n background-size: 100% 100%;\n}\n.ePopup-light-notriangle {\n background-size: 100% 100%;\n}\n.ePopup-dark-triangle {\n background-size: 100% 100%;\n}\n.ePopup-dark-notriangle {\n background-size: 100% 100%;\n}\n.ePopup-content {\n width: 400px;\n height: 280px;\n margin-top: 6px;\n border-radius: 6px;\n padding: 0 10px;\n box-sizing: border-box;\n}\n.ePopup-content-title {\n width: 100%;\n height: 40px;\n padding-left: 35px;\n padding-right: 14px;\n padding-top: 10px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n font-family: Source Han Sans CN;\n font-size: 18px;\n font-weight: bold;\n line-height: normal;\n box-sizing: border-box;\n}\n.ePopup-content-title--text {\n width: calc(100% - 50px);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.ePopup-content-title--close {\n width: 16px;\n height: 16px;\n cursor: pointer;\n}\n.ePopup-content-title--close-light {\n background-size: cover;\n}\n.ePopup-content-title--close-dark {\n background-size: cover;\n}\n.ePopup-content-main {\n width: 100%;\n height: calc(100% - 50px);\n padding: 25px;\n padding-right: 16px;\n box-sizing: border-box;\n}\n.ePopup-content-main-light {\n overflow: auto;\n width: 100%;\n height: 100%;\n}\n.ePopup-content-main-dark {\n overflow: auto;\n width: 100%;\n height: 100%;\n}\n.ePopup-content-main-item {\n display: flex;\n justify-content: space-between;\n font-family: Source Han Sans CN;\n margin-bottom: 16px;\n}\n.ePopup-content-main-item--label {\n font-size: 14px;\n}\n.ePopup-content-main-item--text {\n font-size: 14px;\n font-weight: 600;\n}\n\n.ePopup-content-main::-webkit-scrollbar {\n width: 4px;\n}\n\n.ePopup-content-main-light::-webkit-scrollbar-thumb {\n background: #66A2FE;\n border-radius: 4px;\n -webkit-box-shadow: none;\n}\n\n.ePopup-content-main-light::-webkit-scrollbar-track {\n background: #E0EDFF;\n border-radius: 4px;\n -webkit-box-shadow: none;\n}\n\n.ePopup-content-main-dark::-webkit-scrollbar-thumb {\n background: #FFFFFF;\n border-radius: 4px;\n -webkit-box-shadow: none;\n}\n\n.ePopup-content-main-dark::-webkit-scrollbar-track {\n background: #5076B2;\n border-radius: 4px;\n -webkit-box-shadow: none;\n}");function Fg(t,e){const i=Object.create(null),n=t.split(",");for(let t=0;t<n.length;t++)i[n[t]]=!0;return e?t=>!!i[t.toLowerCase()]:t=>!!i[t]}const Vg="production"!==process.env.NODE_ENV?Object.freeze({}):{},Ug="production"!==process.env.NODE_ENV?Object.freeze([]):[],Gg=()=>{},jg=()=>!1,Hg=/^on[^a-z]/,Wg=t=>Hg.test(t),qg=t=>t.startsWith("onUpdate:"),Xg=Object.assign,Zg=(t,e)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1)},Yg=Object.prototype.hasOwnProperty,Qg=(t,e)=>Yg.call(t,e),Jg=Array.isArray,Kg=t=>"[object Map]"===sy(t),$g=t=>"[object Set]"===sy(t),ty=t=>"function"==typeof t,ey=t=>"string"==typeof t,iy=t=>"symbol"==typeof t,ny=t=>null!==t&&"object"==typeof t,ry=t=>(ny(t)||ty(t))&&ty(t.then)&&ty(t.catch),oy=Object.prototype.toString,sy=t=>oy.call(t),ay=t=>sy(t).slice(8,-1),ly=t=>"[object Object]"===sy(t),cy=t=>ey(t)&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,uy=Fg(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),hy=Fg("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),py=t=>{const e=Object.create(null);return i=>e[i]||(e[i]=t(i))},dy=/-(\w)/g,fy=py((t=>t.replace(dy,((t,e)=>e?e.toUpperCase():"")))),my=/\B([A-Z])/g,gy=py((t=>t.replace(my,"-$1").toLowerCase())),yy=py((t=>t.charAt(0).toUpperCase()+t.slice(1))),vy=py((t=>t?`on${yy(t)}`:"")),_y=(t,e)=>!Object.is(t,e),xy=(t,e)=>{for(let i=0;i<t.length;i++)t[i](e)},by=(t,e,i)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:i})},wy=t=>{const e=parseFloat(t);return isNaN(e)?t:e};let Ay;const Ey=()=>Ay||(Ay="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});function Sy(t){if(Jg(t)){const e={};for(let i=0;i<t.length;i++){const n=t[i],r=ey(n)?Cy(n):Sy(n);if(r)for(const t in r)e[t]=r[t]}return e}if(ey(t)||ny(t))return t}const My=/;(?![^(]*\))/g,Ty=/:([^]+)/,Iy=/\/\*[^]*?\*\//g;function Cy(t){const e={};return t.replace(Iy,"").split(My).forEach((t=>{if(t){const i=t.split(Ty);i.length>1&&(e[i[0].trim()]=i[1].trim())}})),e}function Py(t){let e="";if(ey(t))e=t;else if(Jg(t))for(let i=0;i<t.length;i++){const n=Py(t[i]);n&&(e+=n+" ")}else if(ny(t))for(const i in t)t[i]&&(e+=i+" ");return e.trim()}const Ly=Fg("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"),Dy=Fg("svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"),Ry=Fg("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function Oy(t){return!!t||""===t}function ky(t,...e){console.warn(`[Vue warn] ${t}`,...e)}let Ny;class By{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=Ny,!t&&Ny&&(this.index=(Ny.scopes||(Ny.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const e=Ny;try{return Ny=this,t()}finally{Ny=e}}else"production"!==process.env.NODE_ENV&&ky("cannot run an inactive effect scope.")}on(){Ny=this}off(){Ny=this.parent}stop(t){if(this._active){let e,i;for(e=0,i=this.effects.length;e<i;e++)this.effects[e].stop();for(e=0,i=this.cleanups.length;e<i;e++)this.cleanups[e]();if(this.scopes)for(e=0,i=this.scopes.length;e<i;e++)this.scopes[e].stop(!0);if(!this.detached&&this.parent&&!t){const t=this.parent.scopes.pop();t&&t!==this&&(this.parent.scopes[this.index]=t,t.index=this.index)}this.parent=void 0,this._active=!1}}}const zy=t=>{const e=new Set(t);return e.w=0,e.n=0,e},Fy=t=>(t.w&jy)>0,Vy=t=>(t.n&jy)>0,Uy=new WeakMap;let Gy=0,jy=1;const Hy=30;let Wy;const qy=Symbol("production"!==process.env.NODE_ENV?"iterate":""),Xy=Symbol("production"!==process.env.NODE_ENV?"Map key iterate":"");class Zy{constructor(t,e=null,i){this.fn=t,this.scheduler=e,this.active=!0,this.deps=[],this.parent=void 0,function(t,e=Ny){e&&e.active&&e.effects.push(t)}(this,i)}run(){if(!this.active)return this.fn();let t=Wy,e=Qy;for(;t;){if(t===this)return;t=t.parent}try{return this.parent=Wy,Wy=this,Qy=!0,jy=1<<++Gy,Gy<=Hy?(({deps:t})=>{if(t.length)for(let e=0;e<t.length;e++)t[e].w|=jy})(this):Yy(this),this.fn()}finally{Gy<=Hy&&(t=>{const{deps:e}=t;if(e.length){let i=0;for(let n=0;n<e.length;n++){const r=e[n];Fy(r)&&!Vy(r)?r.delete(t):e[i++]=r,r.w&=~jy,r.n&=~jy}e.length=i}})(this),jy=1<<--Gy,Wy=this.parent,Qy=e,this.parent=void 0,this.deferStop&&this.stop()}}stop(){Wy===this?this.deferStop=!0:this.active&&(Yy(this),this.onStop&&this.onStop(),this.active=!1)}}function Yy(t){const{deps:e}=t;if(e.length){for(let i=0;i<e.length;i++)e[i].delete(t);e.length=0}}let Qy=!0;const Jy=[];function Ky(){Jy.push(Qy),Qy=!1}function $y(){const t=Jy.pop();Qy=void 0===t||t}function tv(t,e,i){if(Qy&&Wy){let n=Uy.get(t);n||Uy.set(t,n=new Map);let r=n.get(i);r||n.set(i,r=zy());ev(r,"production"!==process.env.NODE_ENV?{effect:Wy,target:t,type:e,key:i}:void 0)}}function ev(t,e){let i=!1;Gy<=Hy?Vy(t)||(t.n|=jy,i=!Fy(t)):i=!t.has(Wy),i&&(t.add(Wy),Wy.deps.push(t),"production"!==process.env.NODE_ENV&&Wy.onTrack&&Wy.onTrack(Xg({effect:Wy},e)))}function iv(t,e,i,n,r,o){const s=Uy.get(t);if(!s)return;let a=[];if("clear"===e)a=[...s.values()];else if("length"===i&&Jg(t)){const t=Number(n);s.forEach(((e,i)=>{("length"===i||!iy(i)&&i>=t)&&a.push(e)}))}else switch(void 0!==i&&a.push(s.get(i)),e){case"add":Jg(t)?cy(i)&&a.push(s.get("length")):(a.push(s.get(qy)),Kg(t)&&a.push(s.get(Xy)));break;case"delete":Jg(t)||(a.push(s.get(qy)),Kg(t)&&a.push(s.get(Xy)));break;case"set":Kg(t)&&a.push(s.get(qy))}const l="production"!==process.env.NODE_ENV?{target:t,type:e,key:i,newValue:n,oldValue:r,oldTarget:o}:void 0;if(1===a.length)a[0]&&("production"!==process.env.NODE_ENV?nv(a[0],l):nv(a[0]));else{const t=[];for(const e of a)e&&t.push(...e);"production"!==process.env.NODE_ENV?nv(zy(t),l):nv(zy(t))}}function nv(t,e){const i=Jg(t)?t:[...t];for(const t of i)t.computed&&rv(t,e);for(const t of i)t.computed||rv(t,e)}function rv(t,e){(t!==Wy||t.allowRecurse)&&("production"!==process.env.NODE_ENV&&t.onTrigger&&t.onTrigger(Xg({effect:t},e)),t.scheduler?t.scheduler():t.run())}const ov=Fg("__proto__,__v_isRef,__isVue"),sv=new Set(Object.getOwnPropertyNames(Symbol).filter((t=>"arguments"!==t&&"caller"!==t)).map((t=>Symbol[t])).filter(iy)),av=lv();function lv(){const t={};return["includes","indexOf","lastIndexOf"].forEach((e=>{t[e]=function(...t){const i=Kv(this);for(let t=0,e=this.length;t<e;t++)tv(i,"get",t+"");const n=i[e](...t);return-1===n||!1===n?i[e](...t.map(Kv)):n}})),["push","pop","shift","unshift","splice"].forEach((e=>{t[e]=function(...t){Ky();const i=Kv(this)[e].apply(this,t);return $y(),i}})),t}function cv(t){const e=Kv(this);return tv(e,"has",t),e.hasOwnProperty(t)}class uv{constructor(t=!1,e=!1){this._isReadonly=t,this._shallow=e}get(t,e,i){const n=this._isReadonly,r=this._shallow;if("__v_isReactive"===e)return!n;if("__v_isReadonly"===e)return n;if("__v_isShallow"===e)return r;if("__v_raw"===e&&i===(n?r?jv:Gv:r?Uv:Vv).get(t))return t;const o=Jg(t);if(!n){if(o&&Qg(av,e))return Reflect.get(av,e,i);if("hasOwnProperty"===e)return cv}const s=Reflect.get(t,e,i);return(iy(e)?sv.has(e):ov(e))?s:(n||tv(t,"get",e),r?s:i_(s)?o&&cy(e)?s:s.value:ny(s)?n?Wv(s):Hv(s):s)}}class hv extends uv{constructor(t=!1){super(!1,t)}set(t,e,i,n){let r=t[e];if(Yv(r)&&i_(r)&&!i_(i))return!1;if(!this._shallow&&(Qv(i)||Yv(i)||(r=Kv(r),i=Kv(i)),!Jg(t)&&i_(r)&&!i_(i)))return r.value=i,!0;const o=Jg(t)&&cy(e)?Number(e)<t.length:Qg(t,e),s=Reflect.set(t,e,i,n);return t===Kv(n)&&(o?_y(i,r)&&iv(t,"set",e,i,r):iv(t,"add",e,i)),s}deleteProperty(t,e){const i=Qg(t,e),n=t[e],r=Reflect.deleteProperty(t,e);return r&&i&&iv(t,"delete",e,void 0,n),r}has(t,e){const i=Reflect.has(t,e);return iy(e)&&sv.has(e)||tv(t,"has",e),i}ownKeys(t){return tv(t,"iterate",Jg(t)?"length":qy),Reflect.ownKeys(t)}}class pv extends uv{constructor(t=!1){super(!0,t)}set(t,e){return"production"!==process.env.NODE_ENV&&ky(`Set operation on key "${String(e)}" failed: target is readonly.`,t),!0}deleteProperty(t,e){return"production"!==process.env.NODE_ENV&&ky(`Delete operation on key "${String(e)}" failed: target is readonly.`,t),!0}}const dv=new hv,fv=new pv,mv=new hv(!0),gv=new pv(!0),yv=t=>t,vv=t=>Reflect.getPrototypeOf(t);function _v(t,e,i=!1,n=!1){const r=Kv(t=t.__v_raw),o=Kv(e);i||(_y(e,o)&&tv(r,"get",e),tv(r,"get",o));const{has:s}=vv(r),a=n?yv:i?e_:t_;return s.call(r,e)?a(t.get(e)):s.call(r,o)?a(t.get(o)):void(t!==r&&t.get(e))}function xv(t,e=!1){const i=this.__v_raw,n=Kv(i),r=Kv(t);return e||(_y(t,r)&&tv(n,"has",t),tv(n,"has",r)),t===r?i.has(t):i.has(t)||i.has(r)}function bv(t,e=!1){return t=t.__v_raw,!e&&tv(Kv(t),"iterate",qy),Reflect.get(t,"size",t)}function wv(t){t=Kv(t);const e=Kv(this);return vv(e).has.call(e,t)||(e.add(t),iv(e,"add",t,t)),this}function Av(t,e){e=Kv(e);const i=Kv(this),{has:n,get:r}=vv(i);let o=n.call(i,t);o?"production"!==process.env.NODE_ENV&&Fv(i,n,t):(t=Kv(t),o=n.call(i,t));const s=r.call(i,t);return i.set(t,e),o?_y(e,s)&&iv(i,"set",t,e,s):iv(i,"add",t,e),this}function Ev(t){const e=Kv(this),{has:i,get:n}=vv(e);let r=i.call(e,t);r?"production"!==process.env.NODE_ENV&&Fv(e,i,t):(t=Kv(t),r=i.call(e,t));const o=n?n.call(e,t):void 0,s=e.delete(t);return r&&iv(e,"delete",t,void 0,o),s}function Sv(){const t=Kv(this),e=0!==t.size,i="production"!==process.env.NODE_ENV?Kg(t)?new Map(t):new Set(t):void 0,n=t.clear();return e&&iv(t,"clear",void 0,void 0,i),n}function Mv(t,e){return function(i,n){const r=this,o=r.__v_raw,s=Kv(o),a=e?yv:t?e_:t_;return!t&&tv(s,"iterate",qy),o.forEach(((t,e)=>i.call(n,a(t),a(e),r)))}}function Tv(t,e,i){return function(...n){const r=this.__v_raw,o=Kv(r),s=Kg(o),a="entries"===t||t===Symbol.iterator&&s,l="keys"===t&&s,c=r[t](...n),u=i?yv:e?e_:t_;return!e&&tv(o,"iterate",l?Xy:qy),{next(){const{value:t,done:e}=c.next();return e?{value:t,done:e}:{value:a?[u(t[0]),u(t[1])]:u(t),done:e}},[Symbol.iterator](){return this}}}}function Iv(t){return function(...e){if("production"!==process.env.NODE_ENV){const i=e[0]?`on key "${e[0]}" `:"";console.warn(`${yy(t)} operation ${i}failed: target is readonly.`,Kv(this))}return"delete"!==t&&this}}function Cv(){const t={get(t){return _v(this,t)},get size(){return bv(this)},has:xv,add:wv,set:Av,delete:Ev,clear:Sv,forEach:Mv(!1,!1)},e={get(t){return _v(this,t,!1,!0)},get size(){return bv(this)},has:xv,add:wv,set:Av,delete:Ev,clear:Sv,forEach:Mv(!1,!0)},i={get(t){return _v(this,t,!0)},get size(){return bv(this,!0)},has(t){return xv.call(this,t,!0)},add:Iv("add"),set:Iv("set"),delete:Iv("delete"),clear:Iv("clear"),forEach:Mv(!0,!1)},n={get(t){return _v(this,t,!0,!0)},get size(){return bv(this,!0)},has(t){return xv.call(this,t,!0)},add:Iv("add"),set:Iv("set"),delete:Iv("delete"),clear:Iv("clear"),forEach:Mv(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((r=>{t[r]=Tv(r,!1,!1),i[r]=Tv(r,!0,!1),e[r]=Tv(r,!1,!0),n[r]=Tv(r,!0,!0)})),[t,i,e,n]}const[Pv,Lv,Dv,Rv]=Cv();function Ov(t,e){const i=e?t?Rv:Dv:t?Lv:Pv;return(e,n,r)=>"__v_isReactive"===n?!t:"__v_isReadonly"===n?t:"__v_raw"===n?e:Reflect.get(Qg(i,n)&&n in e?i:e,n,r)}const kv={get:Ov(!1,!1)},Nv={get:Ov(!1,!0)},Bv={get:Ov(!0,!1)},zv={get:Ov(!0,!0)};function Fv(t,e,i){const n=Kv(i);if(n!==i&&e.call(t,n)){const e=ay(t);console.warn(`Reactive ${e} contains both the raw and reactive versions of the same object${"Map"===e?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const Vv=new WeakMap,Uv=new WeakMap,Gv=new WeakMap,jv=new WeakMap;function Hv(t){return Yv(t)?t:Xv(t,!1,dv,kv,Vv)}function Wv(t){return Xv(t,!0,fv,Bv,Gv)}function qv(t){return Xv(t,!0,gv,zv,jv)}function Xv(t,e,i,n,r){if(!ny(t))return"production"!==process.env.NODE_ENV&&console.warn(`value cannot be made reactive: ${String(t)}`),t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const o=r.get(t);if(o)return o;const s=(a=t).__v_skip||!Object.isExtensible(a)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(ay(a));var a;if(0===s)return t;const l=new Proxy(t,2===s?n:i);return r.set(t,l),l}function Zv(t){return Yv(t)?Zv(t.__v_raw):!(!t||!t.__v_isReactive)}function Yv(t){return!(!t||!t.__v_isReadonly)}function Qv(t){return!(!t||!t.__v_isShallow)}function Jv(t){return Zv(t)||Yv(t)}function Kv(t){const e=t&&t.__v_raw;return e?Kv(e):t}function $v(t){return by(t,"__v_skip",!0),t}const t_=t=>ny(t)?Hv(t):t,e_=t=>ny(t)?Wv(t):t;function i_(t){return!(!t||!0!==t.__v_isRef)}const n_={get:(t,e,i)=>{return i_(n=Reflect.get(t,e,i))?n.value:n;var n},set:(t,e,i,n)=>{const r=t[e];return i_(r)&&!i_(i)?(r.value=i,!0):Reflect.set(t,e,i,n)}};function r_(t){return Zv(t)?t:new Proxy(t,n_)}class o_{constructor(t,e,i,n){this._setter=e,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new Zy(t,(()=>{this._dirty||(this._dirty=!0,function(t,e){const i=(t=Kv(t)).dep;i&&("production"!==process.env.NODE_ENV?nv(i,{target:t,type:"set",key:"value",newValue:e}):nv(i))}(this))})),this.effect.computed=this,this.effect.active=this._cacheable=!n,this.__v_isReadonly=i}get value(){const t=Kv(this);var e;return e=t,Qy&&Wy&&(e=Kv(e),"production"!==process.env.NODE_ENV?ev(e.dep||(e.dep=zy()),{target:e,type:"get",key:"value"}):ev(e.dep||(e.dep=zy()))),!t._dirty&&t._cacheable||(t._dirty=!1,t._value=t.effect.run()),t._value}set value(t){this._setter(t)}}const s_=[];function a_(t){s_.push(t)}function l_(){s_.pop()}function c_(t,...e){if("production"===process.env.NODE_ENV)return;Ky();const i=s_.length?s_[s_.length-1].component:null,n=i&&i.appContext.config.warnHandler,r=function(){let t=s_[s_.length-1];if(!t)return[];const e=[];for(;t;){const i=e[0];i&&i.vnode===t?i.recurseCount++:e.push({vnode:t,recurseCount:0});const n=t.component&&t.component.parent;t=n&&n.vnode}return e}();if(n)d_(n,i,11,[t+e.join(""),i&&i.proxy,r.map((({vnode:t})=>`at <${Ow(i,t.type)}>`)).join("\n"),r]);else{const i=[`[Vue warn]: ${t}`,...e];r.length&&i.push("\n",...function(t){const e=[];return t.forEach(((t,i)=>{e.push(...0===i?[]:["\n"],...function({vnode:t,recurseCount:e}){const i=e>0?`... (${e} recursive calls)`:"",n=!!t.component&&null==t.component.parent,r=` at <${Ow(t.component,t.type,n)}`,o=">"+i;return t.props?[r,...u_(t.props),o]:[r+o]}(t))})),e}(r)),console.warn(...i)}$y()}function u_(t){const e=[],i=Object.keys(t);return i.slice(0,3).forEach((i=>{e.push(...h_(i,t[i]))})),i.length>3&&e.push(" ..."),e}function h_(t,e,i){return ey(e)?(e=JSON.stringify(e),i?e:[`${t}=${e}`]):"number"==typeof e||"boolean"==typeof e||null==e?i?e:[`${t}=${e}`]:i_(e)?(e=h_(t,Kv(e.value),!0),i?e:[`${t}=Ref<`,e,">"]):ty(e)?[`${t}=fn${e.name?`<${e.name}>`:""}`]:(e=Kv(e),i?e:[`${t}=`,e])}const p_={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core"};function d_(t,e,i,n){let r;try{r=n?t(...n):t()}catch(t){m_(t,e,i)}return r}function f_(t,e,i,n){if(ty(t)){const r=d_(t,e,i,n);return r&&ry(r)&&r.catch((t=>{m_(t,e,i)})),r}const r=[];for(let o=0;o<t.length;o++)r.push(f_(t[o],e,i,n));return r}function m_(t,e,i,n=!0){const r=e?e.vnode:null;if(e){let n=e.parent;const r=e.proxy,o="production"!==process.env.NODE_ENV?p_[i]:i;for(;n;){const e=n.ec;if(e)for(let i=0;i<e.length;i++)if(!1===e[i](t,r,o))return;n=n.parent}const s=e.appContext.config.errorHandler;if(s)return void d_(s,null,10,[t,r,o])}!function(t,e,i,n=!0){if("production"!==process.env.NODE_ENV){const r=p_[e];if(i&&a_(i),c_("Unhandled error"+(r?` during execution of ${r}`:"")),i&&l_(),n)throw t;console.error(t)}else console.error(t)}(t,i,r,n)}let g_=!1,y_=!1;const v_=[];let __=0;const x_=[];let b_=null,w_=0;const A_=Promise.resolve();let E_=null;const S_=100;function M_(t){const e=E_||A_;return t?e.then(this?t.bind(this):t):e}function T_(t){v_.length&&v_.includes(t,g_&&t.allowRecurse?__+1:__)||(null==t.id?v_.push(t):v_.splice(function(t){let e=__+1,i=v_.length;for(;e<i;){const n=e+i>>>1,r=v_[n],o=D_(r);o<t||o===t&&r.pre?e=n+1:i=n}return e}(t.id),0,t),I_())}function I_(){g_||y_||(y_=!0,E_=A_.then(O_))}function C_(t){Jg(t)?x_.push(...t):b_&&b_.includes(t,t.allowRecurse?w_+1:w_)||x_.push(t),I_()}function P_(t,e=(g_?__+1:0)){for("production"!==process.env.NODE_ENV&&(t=t||new Map);e<v_.length;e++){const i=v_[e];if(i&&i.pre){if("production"!==process.env.NODE_ENV&&k_(t,i))continue;v_.splice(e,1),e--,i()}}}function L_(t){if(x_.length){const e=[...new Set(x_)];if(x_.length=0,b_)return void b_.push(...e);for(b_=e,"production"!==process.env.NODE_ENV&&(t=t||new Map),b_.sort(((t,e)=>D_(t)-D_(e))),w_=0;w_<b_.length;w_++)"production"!==process.env.NODE_ENV&&k_(t,b_[w_])||b_[w_]();b_=null,w_=0}}const D_=t=>null==t.id?1/0:t.id,R_=(t,e)=>{const i=D_(t)-D_(e);if(0===i){if(t.pre&&!e.pre)return-1;if(e.pre&&!t.pre)return 1}return i};function O_(t){y_=!1,g_=!0,"production"!==process.env.NODE_ENV&&(t=t||new Map),v_.sort(R_);const e="production"!==process.env.NODE_ENV?e=>k_(t,e):Gg;try{for(__=0;__<v_.length;__++){const t=v_[__];if(t&&!1!==t.active){if("production"!==process.env.NODE_ENV&&e(t))continue;d_(t,null,14)}}}finally{__=0,v_.length=0,L_(t),g_=!1,E_=null,(v_.length||x_.length)&&O_(t)}}function k_(t,e){if(t.has(e)){const i=t.get(e);if(i>S_){const t=e.ownerInstance,i=t&&Rw(t.type);return c_(`Maximum recursive updates exceeded${i?` in component <${i}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`),!0}t.set(e,i+1)}else t.set(e,1)}let N_=!1;const B_=new Set;"production"!==process.env.NODE_ENV&&(Ey().__VUE_HMR_RUNTIME__={createRecord:G_(F_),rerender:G_((function(t,e){const i=z_.get(t);if(!i)return;i.initialDef.render=e,[...i.instances].forEach((t=>{e&&(t.render=e,V_(t.type).render=e),t.renderCache=[],N_=!0,t.update(),N_=!1}))})),reload:G_((function(t,e){const i=z_.get(t);if(!i)return;e=V_(e),U_(i.initialDef,e);const n=[...i.instances];for(const t of n){const n=V_(t.type);B_.has(n)||(n!==i.initialDef&&U_(n,e),B_.add(n)),t.appContext.propsCache.delete(t.type),t.appContext.emitsCache.delete(t.type),t.appContext.optionsCache.delete(t.type),t.ceReload?(B_.add(n),t.ceReload(e.styles),B_.delete(n)):t.parent?T_(t.parent.update):t.appContext.reload?t.appContext.reload():"undefined"!=typeof window?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required.")}C_((()=>{for(const t of n)B_.delete(V_(t.type))}))}))});const z_=new Map;function F_(t,e){return!z_.has(t)&&(z_.set(t,{initialDef:V_(e),instances:new Set}),!0)}function V_(t){return kw(t)?t.__vccOpts:t}function U_(t,e){Xg(t,e);for(const i in t)"__file"===i||i in e||delete t[i]}function G_(t){return(e,i)=>{try{return t(e,i)}catch(t){console.error(t),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let j_,H_=[],W_=!1;function q_(t,...e){j_?j_.emit(t,...e):W_||H_.push({event:t,args:e})}function X_(t,e){var i,n;if(j_=t,j_)j_.enabled=!0,H_.forEach((({event:t,args:e})=>j_.emit(t,...e))),H_=[];else if("undefined"!=typeof window&&window.HTMLElement&&!(null==(n=null==(i=window.navigator)?void 0:i.userAgent)?void 0:n.includes("jsdom"))){(e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push((t=>{X_(t,e)})),setTimeout((()=>{j_||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,W_=!0,H_=[])}),3e3)}else W_=!0,H_=[]}const Z_=K_("component:added"),Y_=K_("component:updated"),Q_=K_("component:removed"),J_=t=>{j_&&"function"==typeof j_.cleanupBuffer&&!j_.cleanupBuffer(t)&&Q_(t)};function K_(t){return e=>{q_(t,e.appContext.app,e.uid,e.parent?e.parent.uid:void 0,e)}}const $_=ex("perf:start"),tx=ex("perf:end");function ex(t){return(e,i,n)=>{q_(t,e.appContext.app,e.uid,e,i,n)}}function ix(t,e,...i){if(t.isUnmounted)return;const n=t.vnode.props||Vg;if("production"!==process.env.NODE_ENV){const{emitsOptions:n,propsOptions:[r]}=t;if(n)if(e in n){const t=n[e];if(ty(t)){t(...i)||c_(`Invalid event arguments: event validation failed for event "${e}".`)}}else r&&vy(e)in r||c_(`Component emitted event "${e}" but it is neither declared in the emits option nor as an "${vy(e)}" prop.`)}let r=i;const o=e.startsWith("update:"),s=o&&e.slice(7);if(s&&s in n){const t=`${"modelValue"===s?"model":s}Modifiers`,{number:e,trim:o}=n[t]||Vg;o&&(r=i.map((t=>ey(t)?t.trim():t))),e&&(r=i.map(wy))}if(("production"!==process.env.NODE_ENV||__VUE_PROD_DEVTOOLS__)&&function(t,e,i){q_("component:emit",t.appContext.app,t,e,i)}(t,e,r),"production"!==process.env.NODE_ENV){const i=e.toLowerCase();i!==e&&n[vy(i)]&&c_(`Event "${i}" is emitted in component ${Ow(t,t.type)} but the handler is registered for "${e}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${gy(e)}" instead of "${e}".`)}let a,l=n[a=vy(e)]||n[a=vy(fy(e))];!l&&o&&(l=n[a=vy(gy(e))]),l&&f_(l,t,6,r);const c=n[a+"Once"];if(c){if(t.emitted){if(t.emitted[a])return}else t.emitted={};t.emitted[a]=!0,f_(c,t,6,r)}}function nx(t,e,i=!1){const n=e.emitsCache,r=n.get(t);if(void 0!==r)return r;const o=t.emits;let s={},a=!1;if(__VUE_OPTIONS_API__&&!ty(t)){const n=t=>{const i=nx(t,e,!0);i&&(a=!0,Xg(s,i))};!i&&e.mixins.length&&e.mixins.forEach(n),t.extends&&n(t.extends),t.mixins&&t.mixins.forEach(n)}return o||a?(Jg(o)?o.forEach((t=>s[t]=null)):Xg(s,o),ny(t)&&n.set(t,s),s):(ny(t)&&n.set(t,null),null)}function rx(t,e){return!(!t||!Wg(e))&&(e=e.slice(2).replace(/Once$/,""),Qg(t,e[0].toLowerCase()+e.slice(1))||Qg(t,gy(e))||Qg(t,e))}let ox=null,sx=null;function ax(t){const e=ox;return ox=t,sx=t&&t.type.__scopeId||null,e}let lx=!1;function cx(){lx=!0}function ux(t){const{type:e,vnode:i,proxy:n,withProxy:r,props:o,propsOptions:[s],slots:a,attrs:l,emit:c,render:u,renderCache:h,data:p,setupState:d,ctx:f,inheritAttrs:m}=t;let g,y;const v=ax(t);"production"!==process.env.NODE_ENV&&(lx=!1);try{if(4&i.shapeFlag){const t=r||n;g=cw(u.call(t,t,h,o,d,p,f)),y=l}else{const t=e;"production"!==process.env.NODE_ENV&&l===o&&cx(),g=cw(t.length>1?t(o,"production"!==process.env.NODE_ENV?{get attrs(){return cx(),l},slots:a,emit:c}:{attrs:l,slots:a,emit:c}):t(o,null)),y=e.props?l:dx(l)}}catch(e){m_(e,t,1),g=rw(Zb)}let _,x=g;if("production"!==process.env.NODE_ENV&&g.patchFlag>0&&2048&g.patchFlag&&([x,_]=hx(g)),y&&!1!==m){const t=Object.keys(y),{shapeFlag:e}=x;if(t.length)if(7&e)s&&t.some(qg)&&(y=fx(y,s)),x=sw(x,y);else if("production"!==process.env.NODE_ENV&&!lx&&x.type!==Zb){const t=Object.keys(l),e=[],i=[];for(let n=0,r=t.length;n<r;n++){const r=t[n];Wg(r)?qg(r)||e.push(r[2].toLowerCase()+r.slice(3)):i.push(r)}i.length&&c_(`Extraneous non-props attributes (${i.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`),e.length&&c_(`Extraneous non-emits event listeners (${e.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`)}}return i.dirs&&("production"===process.env.NODE_ENV||mx(x)||c_("Runtime directive used on component with non-element root node. The directives will not function as intended."),x=sw(x),x.dirs=x.dirs?x.dirs.concat(i.dirs):i.dirs),i.transition&&("production"===process.env.NODE_ENV||mx(x)||c_("Component inside <Transition> renders non-element root node that cannot be animated."),x.transition=i.transition),"production"!==process.env.NODE_ENV&&_?_(x):g=x,ax(v),g}const hx=t=>{const e=t.children,i=t.dynamicChildren,n=px(e);if(!n)return[t,void 0];const r=e.indexOf(n),o=i?i.indexOf(n):-1;return[cw(n),n=>{e[r]=n,i&&(o>-1?i[o]=n:n.patchFlag>0&&(t.dynamicChildren=[...i,n]))}]};function px(t){let e;for(let i=0;i<t.length;i++){const n=t[i];if(!$b(n))return;if(n.type!==Zb||"v-if"===n.children){if(e)return;e=n}}return e}const dx=t=>{let e;for(const i in t)("class"===i||"style"===i||Wg(i))&&((e||(e={}))[i]=t[i]);return e},fx=(t,e)=>{const i={};for(const n in t)qg(n)&&n.slice(9)in e||(i[n]=t[n]);return i},mx=t=>7&t.shapeFlag||t.type===Zb;function gx(t,e,i){const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!0;for(let r=0;r<n.length;r++){const o=n[r];if(e[o]!==t[o]&&!rx(i,o))return!0}return!1}const yx={};function vx(t,e,i){return"production"===process.env.NODE_ENV||ty(e)||c_("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),_x(t,e,i)}function _x(t,e,{immediate:i,deep:n,flush:r,onTrack:o,onTrigger:s}=Vg){var a;"production"===process.env.NODE_ENV||e||(void 0!==i&&c_('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),void 0!==n&&c_('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'));const l=t=>{c_("Invalid watch source: ",t,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},c=Ny===(null==(a=yw)?void 0:a.scope)?yw:null;let u,h,p=!1,d=!1;if(i_(t)?(u=()=>t.value,p=Qv(t)):Zv(t)?(u=()=>t,n=!0):Jg(t)?(d=!0,p=t.some((t=>Zv(t)||Qv(t))),u=()=>t.map((t=>i_(t)?t.value:Zv(t)?Ax(t):ty(t)?d_(t,c,2):void("production"!==process.env.NODE_ENV&&l(t))))):ty(t)?u=e?()=>d_(t,c,2):()=>{if(!c||!c.isUnmounted)return h&&h(),f_(t,c,3,[m])}:(u=Gg,"production"!==process.env.NODE_ENV&&l(t)),e&&n){const t=u;u=()=>Ax(t())}let f,m=t=>{h=_.onStop=()=>{d_(t,c,4)}};if(Sw){if(m=Gg,e?i&&f_(e,c,3,[u(),d?[]:void 0,m]):u(),"sync"!==r)return Gg;{const t=Fw();f=t.__watcherHandles||(t.__watcherHandles=[])}}let g=d?new Array(t.length).fill(yx):yx;const y=()=>{if(_.active)if(e){const t=_.run();(n||p||(d?t.some(((t,e)=>_y(t,g[e]))):_y(t,g)))&&(h&&h(),f_(e,c,3,[t,g===yx?void 0:d&&g[0]===yx?[]:g,m]),g=t)}else _.run()};let v;y.allowRecurse=!!e,"sync"===r?v=y:"post"===r?v=()=>Gb(y,c&&c.suspense):(y.pre=!0,c&&(y.id=c.uid),v=()=>T_(y));const _=new Zy(u,v);"production"!==process.env.NODE_ENV&&(_.onTrack=o,_.onTrigger=s),e?i?y():g=_.run():"post"===r?Gb(_.run.bind(_),c&&c.suspense):_.run();const x=()=>{_.stop(),c&&c.scope&&Zg(c.scope.effects,_)};return f&&f.push(x),x}function xx(t,e,i){const n=this.proxy,r=ey(t)?t.includes(".")?bx(n,t):()=>n[t]:t.bind(n,n);let o;ty(e)?o=e:(o=e.handler,i=e);const s=yw;_w(this);const a=_x(r,o.bind(n),i);return s?_w(s):xw(),a}function bx(t,e){const i=e.split(".");return()=>{let e=t;for(let t=0;t<i.length&&e;t++)e=e[i[t]];return e}}function Ax(t,e){if(!ny(t)||t.__v_skip)return t;if((e=e||new Set).has(t))return t;if(e.add(t),i_(t))Ax(t.value,e);else if(Jg(t))for(let i=0;i<t.length;i++)Ax(t[i],e);else if($g(t)||Kg(t))t.forEach((t=>{Ax(t,e)}));else if(ly(t))for(const i in t)Ax(t[i],e);return t}function Ex(t){hy(t)&&c_("Do not use built-in directive ids as custom directive id: "+t)}function Sx(t,e,i,n){const r=t.dirs,o=e&&e.dirs;for(let s=0;s<r.length;s++){const a=r[s];o&&(a.oldValue=o[s].value);let l=a.dir[n];l&&(Ky(),f_(l,i,8,[t.el,a,t,e]),$y())}}const Mx=t=>!!t.type.__asyncLoader,Tx=t=>t.type.__isKeepAlive;function Ix(t,e){Px(t,"a",e)}function Cx(t,e){Px(t,"da",e)}function Px(t,e,i=yw){const n=t.__wdc||(t.__wdc=()=>{let e=i;for(;e;){if(e.isDeactivated)return;e=e.parent}return t()});if(Dx(e,n,i),i){let t=i.parent;for(;t&&t.parent;)Tx(t.parent.vnode)&&Lx(n,e,i,t),t=t.parent}}function Lx(t,e,i,n){const r=Dx(e,t,n,!0);Fx((()=>{Zg(n[e],r)}),i)}function Dx(t,e,i=yw,n=!1){if(i){const r=i[t]||(i[t]=[]),o=e.__weh||(e.__weh=(...n)=>{if(i.isUnmounted)return;Ky(),_w(i);const r=f_(e,i,t,n);return xw(),$y(),r});return n?r.unshift(o):r.push(o),o}if("production"!==process.env.NODE_ENV){c_(`${vy(p_[t].replace(/ hook$/,""))} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`)}}const Rx=t=>(e,i=yw)=>(!Sw||"sp"===t)&&Dx(t,((...t)=>e(...t)),i),Ox=Rx("bm"),kx=Rx("m"),Nx=Rx("bu"),Bx=Rx("u"),zx=Rx("bum"),Fx=Rx("um"),Vx=Rx("sp"),Ux=Rx("rtg"),Gx=Rx("rtc");function jx(t,e=yw){Dx("ec",t,e)}const Hx=Symbol.for("v-ndc"),Wx=t=>t?Aw(t)?Pw(t)||t.proxy:Wx(t.parent):null,qx=Xg(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>"production"!==process.env.NODE_ENV?qv(t.props):t.props,$attrs:t=>"production"!==process.env.NODE_ENV?qv(t.attrs):t.attrs,$slots:t=>"production"!==process.env.NODE_ENV?qv(t.slots):t.slots,$refs:t=>"production"!==process.env.NODE_ENV?qv(t.refs):t.refs,$parent:t=>Wx(t.parent),$root:t=>Wx(t.root),$emit:t=>t.emit,$options:t=>__VUE_OPTIONS_API__?ib(t):t.type,$forceUpdate:t=>t.f||(t.f=()=>T_(t.update)),$nextTick:t=>t.n||(t.n=M_.bind(t.proxy)),$watch:t=>__VUE_OPTIONS_API__?xx.bind(t):Gg}),Xx=t=>"_"===t||"$"===t,Zx=(t,e)=>t!==Vg&&!t.__isScriptSetup&&Qg(t,e),Yx={get({_:t},e){const{ctx:i,setupState:n,data:r,props:o,accessCache:s,type:a,appContext:l}=t;if("production"!==process.env.NODE_ENV&&"__isVue"===e)return!0;let c;if("$"!==e[0]){const a=s[e];if(void 0!==a)switch(a){case 1:return n[e];case 2:return r[e];case 4:return i[e];case 3:return o[e]}else{if(Zx(n,e))return s[e]=1,n[e];if(r!==Vg&&Qg(r,e))return s[e]=2,r[e];if((c=t.propsOptions[0])&&Qg(c,e))return s[e]=3,o[e];if(i!==Vg&&Qg(i,e))return s[e]=4,i[e];__VUE_OPTIONS_API__&&!Jx||(s[e]=0)}}const u=qx[e];let h,p;return u?("$attrs"===e?(tv(t,"get",e),"production"!==process.env.NODE_ENV&&cx()):"production"!==process.env.NODE_ENV&&"$slots"===e&&tv(t,"get",e),u(t)):(h=a.__cssModules)&&(h=h[e])?h:i!==Vg&&Qg(i,e)?(s[e]=4,i[e]):(p=l.config.globalProperties,Qg(p,e)?p[e]:void("production"===process.env.NODE_ENV||!ox||ey(e)&&0===e.indexOf("__v")||(r!==Vg&&Xx(e[0])&&Qg(r,e)?c_(`Property ${JSON.stringify(e)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`):t===ox&&c_(`Property ${JSON.stringify(e)} was accessed during render but is not defined on instance.`))))},set({_:t},e,i){const{data:n,setupState:r,ctx:o}=t;return Zx(r,e)?(r[e]=i,!0):"production"!==process.env.NODE_ENV&&r.__isScriptSetup&&Qg(r,e)?(c_(`Cannot mutate <script setup> binding "${e}" from Options API.`),!1):n!==Vg&&Qg(n,e)?(n[e]=i,!0):Qg(t.props,e)?("production"!==process.env.NODE_ENV&&c_(`Attempting to mutate prop "${e}". Props are readonly.`),!1):"$"===e[0]&&e.slice(1)in t?("production"!==process.env.NODE_ENV&&c_(`Attempting to mutate public property "${e}". Properties starting with $ are reserved and readonly.`),!1):("production"!==process.env.NODE_ENV&&e in t.appContext.config.globalProperties?Object.defineProperty(o,e,{enumerable:!0,configurable:!0,value:i}):o[e]=i,!0)},has({_:{data:t,setupState:e,accessCache:i,ctx:n,appContext:r,propsOptions:o}},s){let a;return!!i[s]||t!==Vg&&Qg(t,s)||Zx(e,s)||(a=o[0])&&Qg(a,s)||Qg(n,s)||Qg(qx,s)||Qg(r.config.globalProperties,s)},defineProperty(t,e,i){return null!=i.get?t._.accessCache[e]=0:Qg(i,"value")&&this.set(t,e,i.value,null),Reflect.defineProperty(t,e,i)}};function Qx(t){return Jg(t)?t.reduce(((t,e)=>(t[e]=null,t)),{}):t}"production"!==process.env.NODE_ENV&&(Yx.ownKeys=t=>(c_("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(t)));let Jx=!0;function Kx(t){const e=ib(t),i=t.proxy,n=t.ctx;Jx=!1,e.beforeCreate&&$x(e.beforeCreate,t,"bc");const{data:r,computed:o,methods:s,watch:a,provide:l,inject:c,created:u,beforeMount:h,mounted:p,beforeUpdate:d,updated:f,activated:m,deactivated:g,beforeDestroy:y,beforeUnmount:v,destroyed:_,unmounted:x,render:b,renderTracked:w,renderTriggered:A,errorCaptured:E,serverPrefetch:S,expose:M,inheritAttrs:T,components:I,directives:C,filters:P}=e,L="production"!==process.env.NODE_ENV?function(){const t=Object.create(null);return(e,i)=>{t[i]?c_(`${e} property "${i}" is already defined in ${t[i]}.`):t[i]=e}}():null;if("production"!==process.env.NODE_ENV){const[e]=t.propsOptions;if(e)for(const t in e)L("Props",t)}if(c&&function(t,e,i=Gg){Jg(t)&&(t=sb(t));for(const n in t){const r=t[n];let o;o=ny(r)?"default"in r?fb(r.from||n,r.default,!0):fb(r.from||n):fb(r),i_(o)?Object.defineProperty(e,n,{enumerable:!0,configurable:!0,get:()=>o.value,set:t=>o.value=t}):e[n]=o,"production"!==process.env.NODE_ENV&&i("Inject",n)}}(c,n,L),s)for(const t in s){const e=s[t];ty(e)?("production"!==process.env.NODE_ENV?Object.defineProperty(n,t,{value:e.bind(i),configurable:!0,enumerable:!0,writable:!0}):n[t]=e.bind(i),"production"!==process.env.NODE_ENV&&L("Methods",t)):"production"!==process.env.NODE_ENV&&c_(`Method "${t}" has type "${typeof e}" in the component definition. Did you reference the function correctly?`)}if(r){"production"===process.env.NODE_ENV||ty(r)||c_("The data option must be a function. Plain object usage is no longer supported.");const e=r.call(i,i);if("production"!==process.env.NODE_ENV&&ry(e)&&c_("data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>."),ny(e)){if(t.data=Hv(e),"production"!==process.env.NODE_ENV)for(const t in e)L("Data",t),Xx(t[0])||Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:()=>e[t],set:Gg})}else"production"!==process.env.NODE_ENV&&c_("data() should return an object.")}if(Jx=!0,o)for(const t in o){const e=o[t],r=ty(e)?e.bind(i,i):ty(e.get)?e.get.bind(i,i):Gg;"production"!==process.env.NODE_ENV&&r===Gg&&c_(`Computed property "${t}" has no getter.`);const s=!ty(e)&&ty(e.set)?e.set.bind(i):"production"!==process.env.NODE_ENV?()=>{c_(`Write operation failed: computed property "${t}" is readonly.`)}:Gg,a=Nw({get:r,set:s});Object.defineProperty(n,t,{enumerable:!0,configurable:!0,get:()=>a.value,set:t=>a.value=t}),"production"!==process.env.NODE_ENV&&L("Computed",t)}if(a)for(const t in a)eb(a[t],n,i,t);if(l){const t=ty(l)?l.call(i):l;Reflect.ownKeys(t).forEach((e=>{!function(t,e){if(yw){let i=yw.provides;const n=yw.parent&&yw.parent.provides;n===i&&(i=yw.provides=Object.create(n)),i[t]=e}else"production"!==process.env.NODE_ENV&&c_("provide() can only be used inside setup().")}(e,t[e])}))}function D(t,e){Jg(e)?e.forEach((e=>t(e.bind(i)))):e&&t(e.bind(i))}if(u&&$x(u,t,"c"),D(Ox,h),D(kx,p),D(Nx,d),D(Bx,f),D(Ix,m),D(Cx,g),D(jx,E),D(Gx,w),D(Ux,A),D(zx,v),D(Fx,x),D(Vx,S),Jg(M))if(M.length){const e=t.exposed||(t.exposed={});M.forEach((t=>{Object.defineProperty(e,t,{get:()=>i[t],set:e=>i[t]=e})}))}else t.exposed||(t.exposed={});b&&t.render===Gg&&(t.render=b),null!=T&&(t.inheritAttrs=T),I&&(t.components=I),C&&(t.directives=C)}function $x(t,e,i){f_(Jg(t)?t.map((t=>t.bind(e.proxy))):t.bind(e.proxy),e,i)}function eb(t,e,i,n){const r=n.includes(".")?bx(i,n):()=>i[n];if(ey(t)){const i=e[t];ty(i)?vx(r,i):"production"!==process.env.NODE_ENV&&c_(`Invalid watch handler specified by key "${t}"`,i)}else if(ty(t))vx(r,t.bind(i));else if(ny(t))if(Jg(t))t.forEach((t=>eb(t,e,i,n)));else{const n=ty(t.handler)?t.handler.bind(i):e[t.handler];ty(n)?vx(r,n,t):"production"!==process.env.NODE_ENV&&c_(`Invalid watch handler specified by key "${t.handler}"`,n)}else"production"!==process.env.NODE_ENV&&c_(`Invalid watch option: "${n}"`,t)}function ib(t){const e=t.type,{mixins:i,extends:n}=e,{mixins:r,optionsCache:o,config:{optionMergeStrategies:s}}=t.appContext,a=o.get(e);let l;return a?l=a:r.length||i||n?(l={},r.length&&r.forEach((t=>nb(l,t,s,!0))),nb(l,e,s)):l=e,ny(e)&&o.set(e,l),l}function nb(t,e,i,n=!1){const{mixins:r,extends:o}=e;o&&nb(t,o,i,!0),r&&r.forEach((e=>nb(t,e,i,!0)));for(const r in e)if(n&&"expose"===r)"production"!==process.env.NODE_ENV&&c_('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const n=rb[r]||i&&i[r];t[r]=n?n(t[r],e[r]):e[r]}return t}const rb={data:ob,props:cb,emits:cb,methods:lb,computed:lb,beforeCreate:ab,created:ab,beforeMount:ab,mounted:ab,beforeUpdate:ab,updated:ab,beforeDestroy:ab,beforeUnmount:ab,destroyed:ab,unmounted:ab,activated:ab,deactivated:ab,errorCaptured:ab,serverPrefetch:ab,components:lb,directives:lb,watch:function(t,e){if(!t)return e;if(!e)return t;const i=Xg(Object.create(null),t);for(const n in e)i[n]=ab(t[n],e[n]);return i},provide:ob,inject:function(t,e){return lb(sb(t),sb(e))}};function ob(t,e){return e?t?function(){return Xg(ty(t)?t.call(this,this):t,ty(e)?e.call(this,this):e)}:e:t}function sb(t){if(Jg(t)){const e={};for(let i=0;i<t.length;i++)e[t[i]]=t[i];return e}return t}function ab(t,e){return t?[...new Set([].concat(t,e))]:e}function lb(t,e){return t?Xg(Object.create(null),t,e):e}function cb(t,e){return t?Jg(t)&&Jg(e)?[...new Set([...t,...e])]:Xg(Object.create(null),Qx(t),Qx(null!=e?e:{})):e}function ub(){return{app:null,config:{isNativeTag:jg,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let hb=0;function pb(t,e){return function(i,n=null){ty(i)||(i=Xg({},i)),null==n||ny(n)||("production"!==process.env.NODE_ENV&&c_("root props passed to app.mount() must be an object."),n=null);const r=ub();"production"!==process.env.NODE_ENV&&Object.defineProperty(r.config,"unwrapInjectedRef",{get:()=>!0,set(){c_("app.config.unwrapInjectedRef has been deprecated. 3.3 now always unwraps injected refs in Options API.")}});const o=new WeakSet;let s=!1;const a=r.app={_uid:hb++,_component:i,_props:n,_container:null,_context:r,_instance:null,version:Uw,get config(){return r.config},set config(t){"production"!==process.env.NODE_ENV&&c_("app.config cannot be replaced. Modify individual options instead.")},use:(t,...e)=>(o.has(t)?"production"!==process.env.NODE_ENV&&c_("Plugin has already been applied to target app."):t&&ty(t.install)?(o.add(t),t.install(a,...e)):ty(t)?(o.add(t),t(a,...e)):"production"!==process.env.NODE_ENV&&c_('A plugin must either be a function or an object with an "install" function.'),a),mixin:t=>(__VUE_OPTIONS_API__?r.mixins.includes(t)?"production"!==process.env.NODE_ENV&&c_("Mixin has already been applied to target app"+(t.name?`: ${t.name}`:"")):r.mixins.push(t):"production"!==process.env.NODE_ENV&&c_("Mixins are only available in builds supporting Options API"),a),component:(t,e)=>("production"!==process.env.NODE_ENV&&ww(t,r.config),e?("production"!==process.env.NODE_ENV&&r.components[t]&&c_(`Component "${t}" has already been registered in target app.`),r.components[t]=e,a):r.components[t]),directive:(t,e)=>("production"!==process.env.NODE_ENV&&Ex(t),e?("production"!==process.env.NODE_ENV&&r.directives[t]&&c_(`Directive "${t}" has already been registered in target app.`),r.directives[t]=e,a):r.directives[t]),mount(o,l,c){if(!s){"production"!==process.env.NODE_ENV&&o.__vue_app__&&c_("There is already an app instance mounted on the host container.\n If you want to mount another app on the same host container, you need to unmount the previous app by calling `app.unmount()` first.");const u=rw(i,n);return u.appContext=r,"production"!==process.env.NODE_ENV&&(r.reload=()=>{t(sw(u),o,c)}),l&&e?e(u,o):t(u,o,c),s=!0,a._container=o,o.__vue_app__=a,("production"!==process.env.NODE_ENV||__VUE_PROD_DEVTOOLS__)&&(a._instance=u.component,function(t,e){q_("app:init",t,e,{Fragment:qb,Text:Xb,Comment:Zb,Static:Yb})}(a,Uw)),Pw(u.component)||u.component.proxy}"production"!==process.env.NODE_ENV&&c_("App has already been mounted.\nIf you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. `const createMyApp = () => createApp(App)`")},unmount(){s?(t(null,a._container),("production"!==process.env.NODE_ENV||__VUE_PROD_DEVTOOLS__)&&(a._instance=null,function(t){q_("app:unmount",t)}(a)),delete a._container.__vue_app__):"production"!==process.env.NODE_ENV&&c_("Cannot unmount an app that is not mounted.")},provide:(t,e)=>("production"!==process.env.NODE_ENV&&t in r.provides&&c_(`App already provides property with key "${String(t)}". It will be overwritten with the new value.`),r.provides[t]=e,a),runWithContext(t){db=a;try{return t()}finally{db=null}}};return a}}let db=null;function fb(t,e,i=!1){const n=yw||ox;if(n||db){const r=n?null==n.parent?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:db._context.provides;if(r&&t in r)return r[t];if(arguments.length>1)return i&&ty(e)?e.call(n&&n.proxy):e;"production"!==process.env.NODE_ENV&&c_(`injection "${String(t)}" not found.`)}else"production"!==process.env.NODE_ENV&&c_("inject() can only be used inside setup() or functional components.")}function mb(t,e,i,n=!1){const r={},o={};by(o,ew,1),t.propsDefaults=Object.create(null),gb(t,e,r,o);for(const e in t.propsOptions[0])e in r||(r[e]=void 0);"production"!==process.env.NODE_ENV&&Ab(e||{},r,t),i?t.props=n?r:Xv(r,!1,mv,Nv,Uv):t.type.props?t.props=r:t.props=o,t.attrs=o}function gb(t,e,i,n){const[r,o]=t.propsOptions;let s,a=!1;if(e)for(let l in e){if(uy(l))continue;const c=e[l];let u;r&&Qg(r,u=fy(l))?o&&o.includes(u)?(s||(s={}))[u]=c:i[u]=c:rx(t.emitsOptions,l)||l in n&&c===n[l]||(n[l]=c,a=!0)}if(o){const e=Kv(i),n=s||Vg;for(let s=0;s<o.length;s++){const a=o[s];i[a]=yb(r,e,a,n[a],t,!Qg(n,a))}}return a}function yb(t,e,i,n,r,o){const s=t[i];if(null!=s){const t=Qg(s,"default");if(t&&void 0===n){const t=s.default;if(s.type!==Function&&!s.skipFactory&&ty(t)){const{propsDefaults:o}=r;i in o?n=o[i]:(_w(r),n=o[i]=t.call(null,e),xw())}else n=t}s[0]&&(o&&!t?n=!1:!s[1]||""!==n&&n!==gy(i)||(n=!0))}return n}function vb(t,e,i=!1){const n=e.propsCache,r=n.get(t);if(r)return r;const o=t.props,s={},a=[];let l=!1;if(__VUE_OPTIONS_API__&&!ty(t)){const n=t=>{l=!0;const[i,n]=vb(t,e,!0);Xg(s,i),n&&a.push(...n)};!i&&e.mixins.length&&e.mixins.forEach(n),t.extends&&n(t.extends),t.mixins&&t.mixins.forEach(n)}if(!o&&!l)return ny(t)&&n.set(t,Ug),Ug;if(Jg(o))for(let t=0;t<o.length;t++){"production"===process.env.NODE_ENV||ey(o[t])||c_("props must be strings when using array syntax.",o[t]);const e=fy(o[t]);_b(e)&&(s[e]=Vg)}else if(o){"production"===process.env.NODE_ENV||ny(o)||c_("invalid props options",o);for(const t in o){const e=fy(t);if(_b(e)){const i=o[t],n=s[e]=Jg(i)||ty(i)?{type:i}:Xg({},i);if(n){const t=wb(Boolean,n.type),i=wb(String,n.type);n[0]=t>-1,n[1]=i<0||t<i,(t>-1||Qg(n,"default"))&&a.push(e)}}}}const c=[s,a];return ny(t)&&n.set(t,c),c}function _b(t){return"$"!==t[0]||("production"!==process.env.NODE_ENV&&c_(`Invalid prop name: "${t}" is a reserved property.`),!1)}function xb(t){const e=t&&t.toString().match(/^\s*(function|class) (\w+)/);return e?e[2]:null===t?"null":""}function bb(t,e){return xb(t)===xb(e)}function wb(t,e){return Jg(e)?e.findIndex((e=>bb(e,t))):ty(e)&&bb(e,t)?0:-1}function Ab(t,e,i){const n=Kv(e),r=i.propsOptions[0];for(const e in r){let i=r[e];null!=i&&Eb(e,n[e],i,!Qg(t,e)&&!Qg(t,gy(e)))}}function Eb(t,e,i,n){const{type:r,required:o,validator:s,skipCheck:a}=i;if(o&&n)c_('Missing required prop: "'+t+'"');else if(null!=e||o){if(null!=r&&!0!==r&&!a){let i=!1;const n=Jg(r)?r:[r],o=[];for(let t=0;t<n.length&&!i;t++){const{valid:r,expectedType:s}=Mb(e,n[t]);o.push(s||""),i=r}if(!i)return void c_(function(t,e,i){let n=`Invalid prop: type check failed for prop "${t}". Expected ${i.map(yy).join(" | ")}`;const r=i[0],o=ay(e),s=Tb(e,r),a=Tb(e,o);1===i.length&&Ib(r)&&!function(...t){return t.some((t=>"boolean"===t.toLowerCase()))}(r,o)&&(n+=` with value ${s}`);n+=`, got ${o} `,Ib(o)&&(n+=`with value ${a}.`);return n}(t,e,o))}s&&!s(e)&&c_('Invalid prop: custom validator check failed for prop "'+t+'".')}}const Sb=Fg("String,Number,Boolean,Function,Symbol,BigInt");function Mb(t,e){let i;const n=xb(e);if(Sb(n)){const r=typeof t;i=r===n.toLowerCase(),i||"object"!==r||(i=t instanceof e)}else i="Object"===n?ny(t):"Array"===n?Jg(t):"null"===n?null===t:t instanceof e;return{valid:i,expectedType:n}}function Tb(t,e){return"String"===e?`"${t}"`:"Number"===e?`${Number(t)}`:`${t}`}function Ib(t){return["string","number","boolean"].some((e=>t.toLowerCase()===e))}const Cb=t=>"_"===t[0]||"$stable"===t,Pb=t=>Jg(t)?t.map(cw):[cw(t)],Lb=(t,e,i)=>{if(e._n)return e;const n=function(t,e=ox,i){if(!e)return t;if(t._n)return t;const n=(...i)=>{n._d&&Kb(-1);const r=ax(e);let o;try{o=t(...i)}finally{ax(r),n._d&&Kb(1)}return("production"!==process.env.NODE_ENV||__VUE_PROD_DEVTOOLS__)&&Y_(e),o};return n._n=!0,n._c=!0,n._d=!0,n}(((...i)=>("production"!==process.env.NODE_ENV&&yw&&c_(`Slot "${t}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`),Pb(e(...i)))),i);return n._c=!1,n},Db=(t,e,i)=>{const n=t._ctx;for(const i in t){if(Cb(i))continue;const r=t[i];if(ty(r))e[i]=Lb(i,r,n);else if(null!=r){"production"!==process.env.NODE_ENV&&c_(`Non-function value encountered for slot "${i}". Prefer function slots for better performance.`);const t=Pb(r);e[i]=()=>t}}},Rb=(t,e)=>{"production"===process.env.NODE_ENV||Tx(t.vnode)||c_("Non-function value encountered for default slot. Prefer function slots for better performance.");const i=Pb(e);t.slots.default=()=>i},Ob=(t,e)=>{if(32&t.vnode.shapeFlag){const i=e._;i?(t.slots=Kv(e),by(e,"_",i)):Db(e,t.slots={})}else t.slots={},e&&Rb(t,e);by(t.slots,ew,1)},kb=(t,e,i)=>{const{vnode:n,slots:r}=t;let o=!0,s=Vg;if(32&n.shapeFlag){const n=e._;n?"production"!==process.env.NODE_ENV&&N_?(Xg(r,e),iv(t,"set","$slots")):i&&1===n?o=!1:(Xg(r,e),i||1!==n||delete r._):(o=!e.$stable,Db(e,r)),s=e}else e&&(Rb(t,e),s={default:1});if(o)for(const t in r)Cb(t)||null!=s[t]||delete r[t]};function Nb(t,e,i,n,r=!1){if(Jg(t))return void t.forEach(((t,o)=>Nb(t,e&&(Jg(e)?e[o]:e),i,n,r)));if(Mx(n)&&!r)return;const o=4&n.shapeFlag?Pw(n.component)||n.component.proxy:n.el,s=r?null:o,{i:a,r:l}=t;if("production"!==process.env.NODE_ENV&&!a)return void c_("Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.");const c=e&&e.r,u=a.refs===Vg?a.refs={}:a.refs,h=a.setupState;if(null!=c&&c!==l&&(ey(c)?(u[c]=null,Qg(h,c)&&(h[c]=null)):i_(c)&&(c.value=null)),ty(l))d_(l,a,12,[s,u]);else{const e=ey(l),n=i_(l);if(e||n){const a=()=>{if(t.f){const i=e?Qg(h,l)?h[l]:u[l]:l.value;r?Jg(i)&&Zg(i,o):Jg(i)?i.includes(o)||i.push(o):e?(u[l]=[o],Qg(h,l)&&(h[l]=u[l])):(l.value=[o],t.k&&(u[t.k]=l.value))}else e?(u[l]=s,Qg(h,l)&&(h[l]=s)):n?(l.value=s,t.k&&(u[t.k]=s)):"production"!==process.env.NODE_ENV&&c_("Invalid template ref type:",l,`(${typeof l})`)};s?(a.id=-1,Gb(a,i)):a()}else"production"!==process.env.NODE_ENV&&c_("Invalid template ref type:",l,`(${typeof l})`)}}let Bb,zb;function Fb(t,e){t.appContext.config.performance&&Ub()&&zb.mark(`vue-${e}-${t.uid}`),("production"!==process.env.NODE_ENV||__VUE_PROD_DEVTOOLS__)&&$_(t,e,Ub()?zb.now():Date.now())}function Vb(t,e){if(t.appContext.config.performance&&Ub()){const i=`vue-${e}-${t.uid}`,n=i+":end";zb.mark(n),zb.measure(`<${Ow(t,t.type)}> ${e}`,i,n),zb.clearMarks(i),zb.clearMarks(n)}("production"!==process.env.NODE_ENV||__VUE_PROD_DEVTOOLS__)&&tx(t,e,Ub()?zb.now():Date.now())}function Ub(){return void 0!==Bb||("undefined"!=typeof window&&window.performance?(Bb=!0,zb=window.performance):Bb=!1),Bb}const Gb=function(t,e){e&&e.pendingBranch?Jg(t)?e.effects.push(...t):e.effects.push(t):C_(t)};function jb(t){return function(t,e){!function(){const t=[];if("boolean"!=typeof __VUE_OPTIONS_API__&&("production"!==process.env.NODE_ENV&&t.push("__VUE_OPTIONS_API__"),Ey().__VUE_OPTIONS_API__=!0),"boolean"!=typeof __VUE_PROD_DEVTOOLS__&&("production"!==process.env.NODE_ENV&&t.push("__VUE_PROD_DEVTOOLS__"),Ey().__VUE_PROD_DEVTOOLS__=!1),"production"!==process.env.NODE_ENV&&t.length){const e=t.length>1;console.warn(`Feature flag${e?"s":""} ${t.join(", ")} ${e?"are":"is"} not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle.\n\nFor more details, see https://link.vuejs.org/feature-flags.`)}}();const i=Ey();i.__VUE__=!0,"production"===process.env.NODE_ENV&&!__VUE_PROD_DEVTOOLS__||X_(i.__VUE_DEVTOOLS_GLOBAL_HOOK__,i);const{insert:n,remove:r,patchProp:o,createElement:s,createText:a,createComment:l,setText:c,setElementText:u,parentNode:h,nextSibling:p,setScopeId:d=Gg,insertStaticContent:f}=t,m=(t,e,i,n=null,r=null,o=null,s=!1,a=null,l=("production"===process.env.NODE_ENV||!N_)&&!!e.dynamicChildren)=>{if(t===e)return;t&&!tw(t,e)&&(n=H(t),F(t,r,o,!0),t=null),-2===e.patchFlag&&(l=!1,e.dynamicChildren=null);const{type:c,ref:u,shapeFlag:h}=e;switch(c){case Xb:g(t,e,i,n);break;case Zb:y(t,e,i,n);break;case Yb:null==t?v(e,i,n,s):"production"!==process.env.NODE_ENV&&_(t,e,i,s);break;case qb:C(t,e,i,n,r,o,s,a,l);break;default:1&h?w(t,e,i,n,r,o,s,a,l):6&h?P(t,e,i,n,r,o,s,a,l):64&h||128&h?c.process(t,e,i,n,r,o,s,a,l,q):"production"!==process.env.NODE_ENV&&c_("Invalid VNode type:",c,`(${typeof c})`)}null!=u&&r&&Nb(u,t&&t.ref,o,e||t,!e)},g=(t,e,i,r)=>{if(null==t)n(e.el=a(e.children),i,r);else{const i=e.el=t.el;e.children!==t.children&&c(i,e.children)}},y=(t,e,i,r)=>{null==t?n(e.el=l(e.children||""),i,r):e.el=t.el},v=(t,e,i,n)=>{[t.el,t.anchor]=f(t.children,e,i,n,t.el,t.anchor)},_=(t,e,i,n)=>{if(e.children!==t.children){const r=p(t.anchor);b(t),[e.el,e.anchor]=f(e.children,i,r,n)}else e.el=t.el,e.anchor=t.anchor},x=({el:t,anchor:e},i,r)=>{let o;for(;t&&t!==e;)o=p(t),n(t,i,r),t=o;n(e,i,r)},b=({el:t,anchor:e})=>{let i;for(;t&&t!==e;)i=p(t),r(t),t=i;r(e)},w=(t,e,i,n,r,o,s,a,l)=>{s=s||"svg"===e.type,null==t?A(e,i,n,r,o,s,a,l):M(t,e,r,o,s,a,l)},A=(t,e,i,r,a,l,c,h)=>{let p,d;const{type:f,props:m,shapeFlag:g,transition:y,dirs:v}=t;if(p=t.el=s(t.type,l,m&&m.is,m),8&g?u(p,t.children):16&g&&S(t.children,p,null,r,a,l&&"foreignObject"!==f,c,h),v&&Sx(t,null,r,"created"),E(p,t,t.scopeId,c,r),m){for(const e in m)"value"===e||uy(e)||o(p,e,null,m[e],l,t.children,r,a,j);"value"in m&&o(p,"value",null,m.value),(d=m.onVnodeBeforeMount)&&pw(d,r,t)}("production"!==process.env.NODE_ENV||__VUE_PROD_DEVTOOLS__)&&(Object.defineProperty(p,"__vnode",{value:t,enumerable:!1}),Object.defineProperty(p,"__vueParentComponent",{value:r,enumerable:!1})),v&&Sx(t,null,r,"beforeMount");const _=function(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}(a,y);_&&y.beforeEnter(p),n(p,e,i),((d=m&&m.onVnodeMounted)||_||v)&&Gb((()=>{d&&pw(d,r,t),_&&y.enter(p),v&&Sx(t,null,r,"mounted")}),a)},E=(t,e,i,n,r)=>{if(i&&d(t,i),n)for(let e=0;e<n.length;e++)d(t,n[e]);if(r){let i=r.subTree;if("production"!==process.env.NODE_ENV&&i.patchFlag>0&&2048&i.patchFlag&&(i=px(i.children)||i),e===i){const e=r.vnode;E(t,e,e.scopeId,e.slotScopeIds,r.parent)}}},S=(t,e,i,n,r,o,s,a,l=0)=>{for(let c=l;c<t.length;c++){const l=t[c]=a?uw(t[c]):cw(t[c]);m(null,l,e,i,n,r,o,s,a)}},M=(t,e,i,n,r,s,a)=>{const l=e.el=t.el;let{patchFlag:c,dynamicChildren:h,dirs:p}=e;c|=16&t.patchFlag;const d=t.props||Vg,f=e.props||Vg;let m;i&&Hb(i,!1),(m=f.onVnodeBeforeUpdate)&&pw(m,i,e,t),p&&Sx(e,t,i,"beforeUpdate"),i&&Hb(i,!0),"production"!==process.env.NODE_ENV&&N_&&(c=0,a=!1,h=null);const g=r&&"foreignObject"!==e.type;if(h?(T(t.dynamicChildren,h,l,i,n,g,s),"production"!==process.env.NODE_ENV&&Wb(t,e)):a||k(t,e,l,null,i,n,g,s,!1),c>0){if(16&c)I(l,e,d,f,i,n,r);else if(2&c&&d.class!==f.class&&o(l,"class",null,f.class,r),4&c&&o(l,"style",d.style,f.style,r),8&c){const s=e.dynamicProps;for(let e=0;e<s.length;e++){const a=s[e],c=d[a],u=f[a];u===c&&"value"!==a||o(l,a,c,u,r,t.children,i,n,j)}}1&c&&t.children!==e.children&&u(l,e.children)}else a||null!=h||I(l,e,d,f,i,n,r);((m=f.onVnodeUpdated)||p)&&Gb((()=>{m&&pw(m,i,e,t),p&&Sx(e,t,i,"updated")}),n)},T=(t,e,i,n,r,o,s)=>{for(let a=0;a<e.length;a++){const l=t[a],c=e[a],u=l.el&&(l.type===qb||!tw(l,c)||70&l.shapeFlag)?h(l.el):i;m(l,c,u,null,n,r,o,s,!0)}},I=(t,e,i,n,r,s,a)=>{if(i!==n){if(i!==Vg)for(const l in i)uy(l)||l in n||o(t,l,i[l],null,a,e.children,r,s,j);for(const l in n){if(uy(l))continue;const c=n[l],u=i[l];c!==u&&"value"!==l&&o(t,l,u,c,a,e.children,r,s,j)}"value"in n&&o(t,"value",i.value,n.value)}},C=(t,e,i,r,o,s,l,c,u)=>{const h=e.el=t?t.el:a(""),p=e.anchor=t?t.anchor:a("");let{patchFlag:d,dynamicChildren:f,slotScopeIds:m}=e;"production"!==process.env.NODE_ENV&&(N_||2048&d)&&(d=0,u=!1,f=null),m&&(c=c?c.concat(m):m),null==t?(n(h,i,r),n(p,i,r),S(e.children,i,p,o,s,l,c,u)):d>0&&64&d&&f&&t.dynamicChildren?(T(t.dynamicChildren,f,i,o,s,l,c),"production"!==process.env.NODE_ENV?Wb(t,e):(null!=e.key||o&&e===o.subTree)&&Wb(t,e,!0)):k(t,e,i,p,o,s,l,c,u)},P=(t,e,i,n,r,o,s,a,l)=>{e.slotScopeIds=a,null==t?512&e.shapeFlag?r.ctx.activate(e,i,n,s,l):L(e,i,n,r,o,s,l):D(t,e,l)},L=(t,e,i,n,r,o,s)=>{const a=t.component=function(t,e,i){const n=t.type,r=(e?e.appContext:t.appContext)||dw,o={uid:fw++,vnode:t,type:n,parent:e,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,scope:new By(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(r.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:vb(n,r),emitsOptions:nx(n,r),emit:null,emitted:null,propsDefaults:Vg,inheritAttrs:n.inheritAttrs,ctx:Vg,data:Vg,props:Vg,attrs:Vg,slots:Vg,refs:Vg,setupState:Vg,setupContext:null,attrsProxy:null,slotsProxy:null,suspense:i,suspenseId:i?i.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};"production"!==process.env.NODE_ENV?o.ctx=function(t){const e={};return Object.defineProperty(e,"_",{configurable:!0,enumerable:!1,get:()=>t}),Object.keys(qx).forEach((i=>{Object.defineProperty(e,i,{configurable:!0,enumerable:!1,get:()=>qx[i](t),set:Gg})})),e}(o):o.ctx={_:o};o.root=e?e.root:o,o.emit=ix.bind(null,o),t.ce&&t.ce(o);return o}(t,n,r);if("production"!==process.env.NODE_ENV&&a.type.__hmrId&&function(t){const e=t.type.__hmrId;let i=z_.get(e);i||(F_(e,t.type),i=z_.get(e)),i.instances.add(t)}(a),"production"!==process.env.NODE_ENV&&(a_(t),Fb(a,"mount")),Tx(t)&&(a.ctx.renderer=q),"production"!==process.env.NODE_ENV&&Fb(a,"init"),function(t,e=!1){Sw=e;const{props:i,children:n}=t.vnode,r=Aw(t);mb(t,i,r,e),Ob(t,n);const o=r?function(t,e){var i;const n=t.type;if("production"!==process.env.NODE_ENV){if(n.name&&ww(n.name,t.appContext.config),n.components){const e=Object.keys(n.components);for(let i=0;i<e.length;i++)ww(e[i],t.appContext.config)}if(n.directives){const t=Object.keys(n.directives);for(let e=0;e<t.length;e++)Ex(t[e])}n.compilerOptions&&Tw()&&c_('"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.')}t.accessCache=Object.create(null),t.proxy=$v(new Proxy(t.ctx,Yx)),"production"===process.env.NODE_ENV||function(t){const{ctx:e,propsOptions:[i]}=t;i&&Object.keys(i).forEach((i=>{Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>t.props[i],set:Gg})}))}(t);const{setup:r}=n;if(r){const o=t.setupContext=r.length>1?function(t){const e=e=>{if("production"!==process.env.NODE_ENV&&(t.exposed&&c_("expose() should be called only once per setup()."),null!=e)){let t=typeof e;"object"===t&&(Jg(e)?t="array":i_(e)&&(t="ref")),"object"!==t&&c_(`expose() should be passed a plain object, received ${t}.`)}t.exposed=e||{}};return"production"!==process.env.NODE_ENV?Object.freeze({get attrs(){return Cw(t)},get slots(){return function(t){return t.slotsProxy||(t.slotsProxy=new Proxy(t.slots,{get:(e,i)=>(tv(t,"get","$slots"),e[i])}))}(t)},get emit(){return(e,...i)=>t.emit(e,...i)},expose:e}):{get attrs(){return Cw(t)},slots:t.slots,emit:t.emit,expose:e}}(t):null;_w(t),Ky();const s=d_(r,t,0,["production"!==process.env.NODE_ENV?qv(t.props):t.props,o]);if($y(),xw(),ry(s)){if(s.then(xw,xw),e)return s.then((i=>{Mw(t,i,e)})).catch((e=>{m_(e,t,0)}));if(t.asyncDep=s,"production"!==process.env.NODE_ENV&&!t.suspense){c_(`Component <${null!=(i=n.name)?i:"Anonymous"}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`)}}else Mw(t,s,e)}else Iw(t,e)}(t,e):void 0;Sw=!1}(a),"production"!==process.env.NODE_ENV&&Vb(a,"init"),a.asyncDep){if(r&&r.registerDep(a,R),!t.el){const t=a.subTree=rw(Zb);y(null,t,e,i)}}else R(a,t,e,i,r,o,s),"production"!==process.env.NODE_ENV&&(l_(),Vb(a,"mount"))},D=(t,e,i)=>{const n=e.component=t.component;if(function(t,e,i){const{props:n,children:r,component:o}=t,{props:s,children:a,patchFlag:l}=e,c=o.emitsOptions;if("production"!==process.env.NODE_ENV&&(r||a)&&N_)return!0;if(e.dirs||e.transition)return!0;if(!(i&&l>=0))return!(!r&&!a||a&&a.$stable)||n!==s&&(n?!s||gx(n,s,c):!!s);if(1024&l)return!0;if(16&l)return n?gx(n,s,c):!!s;if(8&l){const t=e.dynamicProps;for(let e=0;e<t.length;e++){const i=t[e];if(s[i]!==n[i]&&!rx(c,i))return!0}}return!1}(t,e,i)){if(n.asyncDep&&!n.asyncResolved)return"production"!==process.env.NODE_ENV&&a_(e),O(n,e,i),void("production"!==process.env.NODE_ENV&&l_());n.next=e,function(t){const e=v_.indexOf(t);e>__&&v_.splice(e,1)}(n.update),n.update()}else e.el=t.el,n.vnode=e},R=(t,e,i,n,r,o,s)=>{const a=()=>{if(t.isMounted){let e,{next:i,bu:n,u:a,parent:l,vnode:c}=t,u=i;"production"!==process.env.NODE_ENV&&a_(i||t.vnode),Hb(t,!1),i?(i.el=c.el,O(t,i,s)):i=c,n&&xy(n),(e=i.props&&i.props.onVnodeBeforeUpdate)&&pw(e,l,i,c),Hb(t,!0),"production"!==process.env.NODE_ENV&&Fb(t,"render");const p=ux(t);"production"!==process.env.NODE_ENV&&Vb(t,"render");const d=t.subTree;t.subTree=p,"production"!==process.env.NODE_ENV&&Fb(t,"patch"),m(d,p,h(d.el),H(d),t,r,o),"production"!==process.env.NODE_ENV&&Vb(t,"patch"),i.el=p.el,null===u&&function({vnode:t,parent:e},i){for(;e&&e.subTree===t;)(t=e.vnode).el=i,e=e.parent}(t,p.el),a&&Gb(a,r),(e=i.props&&i.props.onVnodeUpdated)&&Gb((()=>pw(e,l,i,c)),r),("production"!==process.env.NODE_ENV||__VUE_PROD_DEVTOOLS__)&&Y_(t),"production"!==process.env.NODE_ENV&&l_()}else{let s;const{el:a,props:l}=e,{bm:c,m:u,parent:h}=t,p=Mx(e);if(Hb(t,!1),c&&xy(c),!p&&(s=l&&l.onVnodeBeforeMount)&&pw(s,h,e),Hb(t,!0),a&&Z){const i=()=>{"production"!==process.env.NODE_ENV&&Fb(t,"render"),t.subTree=ux(t),"production"!==process.env.NODE_ENV&&Vb(t,"render"),"production"!==process.env.NODE_ENV&&Fb(t,"hydrate"),Z(a,t.subTree,t,r,null),"production"!==process.env.NODE_ENV&&Vb(t,"hydrate")};p?e.type.__asyncLoader().then((()=>!t.isUnmounted&&i())):i()}else{"production"!==process.env.NODE_ENV&&Fb(t,"render");const s=t.subTree=ux(t);"production"!==process.env.NODE_ENV&&Vb(t,"render"),"production"!==process.env.NODE_ENV&&Fb(t,"patch"),m(null,s,i,n,t,r,o),"production"!==process.env.NODE_ENV&&Vb(t,"patch"),e.el=s.el}if(u&&Gb(u,r),!p&&(s=l&&l.onVnodeMounted)){const t=e;Gb((()=>pw(s,h,t)),r)}(256&e.shapeFlag||h&&Mx(h.vnode)&&256&h.vnode.shapeFlag)&&t.a&&Gb(t.a,r),t.isMounted=!0,("production"!==process.env.NODE_ENV||__VUE_PROD_DEVTOOLS__)&&Z_(t),e=i=n=null}},l=t.effect=new Zy(a,(()=>T_(c)),t.scope),c=t.update=()=>l.run();c.id=t.uid,Hb(t,!0),"production"!==process.env.NODE_ENV&&(l.onTrack=t.rtc?e=>xy(t.rtc,e):void 0,l.onTrigger=t.rtg?e=>xy(t.rtg,e):void 0,c.ownerInstance=t),c()},O=(t,e,i)=>{e.component=t;const n=t.vnode.props;t.vnode=e,t.next=null,function(t,e,i,n){const{props:r,attrs:o,vnode:{patchFlag:s}}=t,a=Kv(r),[l]=t.propsOptions;let c=!1;if("production"!==process.env.NODE_ENV&&function(t){for(;t;){if(t.type.__hmrId)return!0;t=t.parent}}(t)||!(n||s>0)||16&s){let n;gb(t,e,r,o)&&(c=!0);for(const o in a)e&&(Qg(e,o)||(n=gy(o))!==o&&Qg(e,n))||(l?!i||void 0===i[o]&&void 0===i[n]||(r[o]=yb(l,a,o,void 0,t,!0)):delete r[o]);if(o!==a)for(const t in o)e&&Qg(e,t)||(delete o[t],c=!0)}else if(8&s){const i=t.vnode.dynamicProps;for(let n=0;n<i.length;n++){let s=i[n];if(rx(t.emitsOptions,s))continue;const u=e[s];if(l)if(Qg(o,s))u!==o[s]&&(o[s]=u,c=!0);else{const e=fy(s);r[e]=yb(l,a,e,u,t,!1)}else u!==o[s]&&(o[s]=u,c=!0)}}c&&iv(t,"set","$attrs"),"production"!==process.env.NODE_ENV&&Ab(e||{},r,t)}(t,e.props,n,i),kb(t,e.children,i),Ky(),P_(),$y()},k=(t,e,i,n,r,o,s,a,l=!1)=>{const c=t&&t.children,h=t?t.shapeFlag:0,p=e.children,{patchFlag:d,shapeFlag:f}=e;if(d>0){if(128&d)return void B(c,p,i,n,r,o,s,a,l);if(256&d)return void N(c,p,i,n,r,o,s,a,l)}8&f?(16&h&&j(c,r,o),p!==c&&u(i,p)):16&h?16&f?B(c,p,i,n,r,o,s,a,l):j(c,r,o,!0):(8&h&&u(i,""),16&f&&S(p,i,n,r,o,s,a,l))},N=(t,e,i,n,r,o,s,a,l)=>{e=e||Ug;const c=(t=t||Ug).length,u=e.length,h=Math.min(c,u);let p;for(p=0;p<h;p++){const n=e[p]=l?uw(e[p]):cw(e[p]);m(t[p],n,i,null,r,o,s,a,l)}c>u?j(t,r,o,!0,!1,h):S(e,i,n,r,o,s,a,l,h)},B=(t,e,i,n,r,o,s,a,l)=>{let c=0;const u=e.length;let h=t.length-1,p=u-1;for(;c<=h&&c<=p;){const n=t[c],u=e[c]=l?uw(e[c]):cw(e[c]);if(!tw(n,u))break;m(n,u,i,null,r,o,s,a,l),c++}for(;c<=h&&c<=p;){const n=t[h],c=e[p]=l?uw(e[p]):cw(e[p]);if(!tw(n,c))break;m(n,c,i,null,r,o,s,a,l),h--,p--}if(c>h){if(c<=p){const t=p+1,h=t<u?e[t].el:n;for(;c<=p;)m(null,e[c]=l?uw(e[c]):cw(e[c]),i,h,r,o,s,a,l),c++}}else if(c>p)for(;c<=h;)F(t[c],r,o,!0),c++;else{const d=c,f=c,g=new Map;for(c=f;c<=p;c++){const t=e[c]=l?uw(e[c]):cw(e[c]);null!=t.key&&("production"!==process.env.NODE_ENV&&g.has(t.key)&&c_("Duplicate keys found during update:",JSON.stringify(t.key),"Make sure keys are unique."),g.set(t.key,c))}let y,v=0;const _=p-f+1;let x=!1,b=0;const w=new Array(_);for(c=0;c<_;c++)w[c]=0;for(c=d;c<=h;c++){const n=t[c];if(v>=_){F(n,r,o,!0);continue}let u;if(null!=n.key)u=g.get(n.key);else for(y=f;y<=p;y++)if(0===w[y-f]&&tw(n,e[y])){u=y;break}void 0===u?F(n,r,o,!0):(w[u-f]=c+1,u>=b?b=u:x=!0,m(n,e[u],i,null,r,o,s,a,l),v++)}const A=x?function(t){const e=t.slice(),i=[0];let n,r,o,s,a;const l=t.length;for(n=0;n<l;n++){const l=t[n];if(0!==l){if(r=i[i.length-1],t[r]<l){e[n]=r,i.push(n);continue}for(o=0,s=i.length-1;o<s;)a=o+s>>1,t[i[a]]<l?o=a+1:s=a;l<t[i[o]]&&(o>0&&(e[n]=i[o-1]),i[o]=n)}}o=i.length,s=i[o-1];for(;o-- >0;)i[o]=s,s=e[s];return i}(w):Ug;for(y=A.length-1,c=_-1;c>=0;c--){const t=f+c,h=e[t],p=t+1<u?e[t+1].el:n;0===w[c]?m(null,h,i,p,r,o,s,a,l):x&&(y<0||c!==A[y]?z(h,i,p,2):y--)}}},z=(t,e,i,r,o=null)=>{const{el:s,type:a,transition:l,children:c,shapeFlag:u}=t;if(6&u)return void z(t.component.subTree,e,i,r);if(128&u)return void t.suspense.move(e,i,r);if(64&u)return void a.move(t,e,i,q);if(a===qb){n(s,e,i);for(let t=0;t<c.length;t++)z(c[t],e,i,r);return void n(t.anchor,e,i)}if(a===Yb)return void x(t,e,i);if(2!==r&&1&u&&l)if(0===r)l.beforeEnter(s),n(s,e,i),Gb((()=>l.enter(s)),o);else{const{leave:t,delayLeave:r,afterLeave:o}=l,a=()=>n(s,e,i),c=()=>{t(s,(()=>{a(),o&&o()}))};r?r(s,a,c):c()}else n(s,e,i)},F=(t,e,i,n=!1,r=!1)=>{const{type:o,props:s,ref:a,children:l,dynamicChildren:c,shapeFlag:u,patchFlag:h,dirs:p}=t;if(null!=a&&Nb(a,null,i,t,!0),256&u)return void e.ctx.deactivate(t);const d=1&u&&p,f=!Mx(t);let m;if(f&&(m=s&&s.onVnodeBeforeUnmount)&&pw(m,e,t),6&u)G(t.component,i,n);else{if(128&u)return void t.suspense.unmount(i,n);d&&Sx(t,null,e,"beforeUnmount"),64&u?t.type.remove(t,e,i,r,q,n):c&&(o!==qb||h>0&&64&h)?j(c,e,i,!1,!0):(o===qb&&384&h||!r&&16&u)&&j(l,e,i),n&&V(t)}(f&&(m=s&&s.onVnodeUnmounted)||d)&&Gb((()=>{m&&pw(m,e,t),d&&Sx(t,null,e,"unmounted")}),i)},V=t=>{const{type:e,el:i,anchor:n,transition:o}=t;if(e===qb)return void("production"!==process.env.NODE_ENV&&t.patchFlag>0&&2048&t.patchFlag&&o&&!o.persisted?t.children.forEach((t=>{t.type===Zb?r(t.el):V(t)})):U(i,n));if(e===Yb)return void b(t);const s=()=>{r(i),o&&!o.persisted&&o.afterLeave&&o.afterLeave()};if(1&t.shapeFlag&&o&&!o.persisted){const{leave:e,delayLeave:n}=o,r=()=>e(i,s);n?n(t.el,s,r):r()}else s()},U=(t,e)=>{let i;for(;t!==e;)i=p(t),r(t),t=i;r(e)},G=(t,e,i)=>{"production"!==process.env.NODE_ENV&&t.type.__hmrId&&function(t){z_.get(t.type.__hmrId).instances.delete(t)}(t);const{bum:n,scope:r,update:o,subTree:s,um:a}=t;n&&xy(n),r.stop(),o&&(o.active=!1,F(s,t,e,i)),a&&Gb(a,e),Gb((()=>{t.isUnmounted=!0}),e),e&&e.pendingBranch&&!e.isUnmounted&&t.asyncDep&&!t.asyncResolved&&t.suspenseId===e.pendingId&&(e.deps--,0===e.deps&&e.resolve()),("production"!==process.env.NODE_ENV||__VUE_PROD_DEVTOOLS__)&&J_(t)},j=(t,e,i,n=!1,r=!1,o=0)=>{for(let s=o;s<t.length;s++)F(t[s],e,i,n,r)},H=t=>6&t.shapeFlag?H(t.component.subTree):128&t.shapeFlag?t.suspense.next():p(t.anchor||t.el),W=(t,e,i)=>{null==t?e._vnode&&F(e._vnode,null,null,!0):m(e._vnode||null,t,e,null,null,null,i),P_(),L_(),e._vnode=t},q={p:m,um:F,m:z,r:V,mt:L,mc:S,pc:k,pbc:T,n:H,o:t};let X,Z;e&&([X,Z]=e(q));return{render:W,hydrate:X,createApp:pb(W,X)}}(t)}function Hb({effect:t,update:e},i){t.allowRecurse=e.allowRecurse=i}function Wb(t,e,i=!1){const n=t.children,r=e.children;if(Jg(n)&&Jg(r))for(let t=0;t<n.length;t++){const e=n[t];let o=r[t];1&o.shapeFlag&&!o.dynamicChildren&&((o.patchFlag<=0||32===o.patchFlag)&&(o=r[t]=uw(r[t]),o.el=e.el),i||Wb(e,o)),o.type===Xb&&(o.el=e.el),"production"===process.env.NODE_ENV||o.type!==Zb||o.el||(o.el=e.el)}}const qb=Symbol.for("v-fgt"),Xb=Symbol.for("v-txt"),Zb=Symbol.for("v-cmt"),Yb=Symbol.for("v-stc");let Qb=null,Jb=1;function Kb(t){Jb+=t}function $b(t){return!!t&&!0===t.__v_isVNode}function tw(t,e){return"production"!==process.env.NODE_ENV&&6&e.shapeFlag&&B_.has(e.type)?(t.shapeFlag&=-257,e.shapeFlag&=-513,!1):t.type===e.type&&t.key===e.key}const ew="__vInternal",iw=({key:t})=>null!=t?t:null,nw=({ref:t,ref_key:e,ref_for:i})=>("number"==typeof t&&(t=""+t),null!=t?ey(t)||i_(t)||ty(t)?{i:ox,r:t,k:e,f:!!i}:t:null);const rw="production"!==process.env.NODE_ENV?(...t)=>ow(...t):ow;function ow(t,e=null,i=null,n=0,r=null,o=!1){if(t&&t!==Hx||("production"===process.env.NODE_ENV||t||c_(`Invalid vnode type when creating vnode: ${t}.`),t=Zb),$b(t)){const n=sw(t,e,!0);return i&&hw(n,i),Jb>0&&!o&&Qb&&(6&n.shapeFlag?Qb[Qb.indexOf(t)]=n:Qb.push(n)),n.patchFlag|=-2,n}if(kw(t)&&(t=t.__vccOpts),e){e=function(t){return t?Jv(t)||ew in t?Xg({},t):t:null}(e);let{class:t,style:i}=e;t&&!ey(t)&&(e.class=Py(t)),ny(i)&&(Jv(i)&&!Jg(i)&&(i=Xg({},i)),e.style=Sy(i))}const s=ey(t)?1:(t=>t.__isSuspense)(t)?128:(t=>t.__isTeleport)(t)?64:ny(t)?4:ty(t)?2:0;return"production"!==process.env.NODE_ENV&&4&s&&Jv(t)&&c_("Vue received a Component which was made a reactive object. This can lead to unnecessary performance overhead, and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.","\nComponent that was made reactive: ",t=Kv(t)),function(t,e=null,i=null,n=0,r=null,o=(t===qb?0:1),s=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&iw(e),ref:e&&nw(e),scopeId:sx,slotScopeIds:null,children:i,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:n,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:ox};return a?(hw(l,i),128&o&&t.normalize(l)):i&&(l.shapeFlag|=ey(i)?8:16),"production"!==process.env.NODE_ENV&&l.key!=l.key&&c_("VNode created with invalid key (NaN). VNode type:",l.type),Jb>0&&!s&&Qb&&(l.patchFlag>0||6&o)&&32!==l.patchFlag&&Qb.push(l),l}(t,e,i,n,r,s,o,!0)}function sw(t,e,i=!1){const{props:n,ref:r,patchFlag:o,children:s}=t,a=e?function(...t){const e={};for(let i=0;i<t.length;i++){const n=t[i];for(const t in n)if("class"===t)e.class!==n.class&&(e.class=Py([e.class,n.class]));else if("style"===t)e.style=Sy([e.style,n.style]);else if(Wg(t)){const i=e[t],r=n[t];!r||i===r||Jg(i)&&i.includes(r)||(e[t]=i?[].concat(i,r):r)}else""!==t&&(e[t]=n[t])}return e}(n||{},e):n;return{__v_isVNode:!0,__v_skip:!0,type:t.type,props:a,key:a&&iw(a),ref:e&&e.ref?i&&r?Jg(r)?r.concat(nw(e)):[r,nw(e)]:nw(e):r,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:"production"!==process.env.NODE_ENV&&-1===o&&Jg(s)?s.map(aw):s,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==qb?-1===o?16:16|o:o,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:t.transition,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&sw(t.ssContent),ssFallback:t.ssFallback&&sw(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce}}function aw(t){const e=sw(t);return Jg(t.children)&&(e.children=t.children.map(aw)),e}function lw(t=" ",e=0){return rw(Xb,null,t,e)}function cw(t){return null==t||"boolean"==typeof t?rw(Zb):Jg(t)?rw(qb,null,t.slice()):"object"==typeof t?uw(t):rw(Xb,null,String(t))}function uw(t){return null===t.el&&-1!==t.patchFlag||t.memo?t:sw(t)}function hw(t,e){let i=0;const{shapeFlag:n}=t;if(null==e)e=null;else if(Jg(e))i=16;else if("object"==typeof e){if(65&n){const i=e.default;return void(i&&(i._c&&(i._d=!1),hw(t,i()),i._c&&(i._d=!0)))}{i=32;const n=e._;n||ew in e?3===n&&ox&&(1===ox.slots._?e._=1:(e._=2,t.patchFlag|=1024)):e._ctx=ox}}else ty(e)?(e={default:e,_ctx:ox},i=32):(e=String(e),64&n?(i=16,e=[lw(e)]):i=8);t.children=e,t.shapeFlag|=i}function pw(t,e,i,n=null){f_(t,e,7,[i,n])}const dw=ub();let fw=0;let mw,gw,yw=null,vw="__VUE_INSTANCE_SETTERS__";(gw=Ey()[vw])||(gw=Ey()[vw]=[]),gw.push((t=>yw=t)),mw=t=>{gw.length>1?gw.forEach((e=>e(t))):gw[0](t)};const _w=t=>{mw(t),t.scope.on()},xw=()=>{yw&&yw.scope.off(),mw(null)},bw=Fg("slot,component");function ww(t,e){const i=e.isNativeTag||jg;(bw(t)||i(t))&&c_("Do not use built-in or reserved HTML elements as component id: "+t)}function Aw(t){return 4&t.vnode.shapeFlag}let Ew,Sw=!1;function Mw(t,e,i){ty(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:ny(e)?("production"!==process.env.NODE_ENV&&$b(e)&&c_("setup() should not return VNodes directly - return a render function instead."),("production"!==process.env.NODE_ENV||__VUE_PROD_DEVTOOLS__)&&(t.devtoolsRawSetupState=e),t.setupState=r_(e),"production"!==process.env.NODE_ENV&&function(t){const{ctx:e,setupState:i}=t;Object.keys(Kv(i)).forEach((t=>{if(!i.__isScriptSetup){if(Xx(t[0]))return void c_(`setup() return property ${JSON.stringify(t)} should not start with "$" or "_" which are reserved prefixes for Vue internals.`);Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:()=>i[t],set:Gg})}}))}(t)):"production"!==process.env.NODE_ENV&&void 0!==e&&c_("setup() should return an object. Received: "+(null===e?"null":typeof e)),Iw(t,i)}const Tw=()=>!Ew;function Iw(t,e,i){const n=t.type;if(!t.render){if(!e&&Ew&&!n.render){const e=n.template||ib(t).template;if(e){"production"!==process.env.NODE_ENV&&Fb(t,"compile");const{isCustomElement:i,compilerOptions:r}=t.appContext.config,{delimiters:o,compilerOptions:s}=n,a=Xg(Xg({isCustomElement:i,delimiters:o},r),s);n.render=Ew(e,a),"production"!==process.env.NODE_ENV&&Vb(t,"compile")}}t.render=n.render||Gg}if(__VUE_OPTIONS_API__){_w(t),Ky();try{Kx(t)}finally{$y(),xw()}}"production"===process.env.NODE_ENV||n.render||t.render!==Gg||e||(n.template?c_('Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".'):c_("Component is missing template or render function."))}function Cw(t){return t.attrsProxy||(t.attrsProxy=new Proxy(t.attrs,"production"!==process.env.NODE_ENV?{get:(e,i)=>(cx(),tv(t,"get","$attrs"),e[i]),set:()=>(c_("setupContext.attrs is readonly."),!1),deleteProperty:()=>(c_("setupContext.attrs is readonly."),!1)}:{get:(e,i)=>(tv(t,"get","$attrs"),e[i])}))}function Pw(t){if(t.exposed)return t.exposeProxy||(t.exposeProxy=new Proxy(r_($v(t.exposed)),{get:(e,i)=>i in e?e[i]:i in qx?qx[i](t):void 0,has:(t,e)=>e in t||e in qx}))}const Lw=/(?:^|[-_])(\w)/g,Dw=t=>t.replace(Lw,(t=>t.toUpperCase())).replace(/[-_]/g,"");function Rw(t,e=!0){return ty(t)?t.displayName||t.name:t.name||e&&t.__name}function Ow(t,e,i=!1){let n=Rw(e);if(!n&&e.__file){const t=e.__file.match(/([^/\\]+)\.\w+$/);t&&(n=t[1])}if(!n&&t&&t.parent){const i=t=>{for(const i in t)if(t[i]===e)return i};n=i(t.components||t.parent.type.components)||i(t.appContext.components)}return n?Dw(n):i?"App":"Anonymous"}function kw(t){return ty(t)&&"__vccOpts"in t}const Nw=(t,e)=>function(t,e,i=!1){let n,r;const o=ty(t);o?(n=t,r="production"!==process.env.NODE_ENV?()=>{console.warn("Write operation failed: computed value is readonly")}:Gg):(n=t.get,r=t.set);const s=new o_(n,r,o||!r,i);return"production"!==process.env.NODE_ENV&&e&&!i&&(s.effect.onTrack=e.onTrack,s.effect.onTrigger=e.onTrigger),s}(t,e,Sw);function Bw(t,e,i){const n=arguments.length;return 2===n?ny(e)&&!Jg(e)?$b(e)?rw(t,null,[e]):rw(t,e):rw(t,null,e):(n>3?i=Array.prototype.slice.call(arguments,2):3===n&&$b(i)&&(i=[i]),rw(t,e,i))}const zw=Symbol.for("v-scx"),Fw=()=>{{const t=fb(zw);return t||"production"!==process.env.NODE_ENV&&c_("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),t}};function Vw(t){return!(!t||!t.__v_isShallow)}const Uw="3.3.7",Gw="undefined"!=typeof document?document:null,jw=Gw&&Gw.createElement("template"),Hw={insert:(t,e,i)=>{e.insertBefore(t,i||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,i,n)=>{const r=e?Gw.createElementNS("http://www.w3.org/2000/svg",t):Gw.createElement(t,i?{is:i}:void 0);return"select"===t&&n&&null!=n.multiple&&r.setAttribute("multiple",n.multiple),r},createText:t=>Gw.createTextNode(t),createComment:t=>Gw.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Gw.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,i,n,r,o){const s=i?i.previousSibling:e.lastChild;if(r&&(r===o||r.nextSibling))for(;e.insertBefore(r.cloneNode(!0),i),r!==o&&(r=r.nextSibling););else{jw.innerHTML=n?`<svg>${t}</svg>`:t;const r=jw.content;if(n){const t=r.firstChild;for(;t.firstChild;)r.appendChild(t.firstChild);r.removeChild(t)}e.insertBefore(r,i)}return[s?s.nextSibling:e.firstChild,i?i.previousSibling:e.lastChild]}},Ww=Symbol("_vtc");const qw=Symbol("_vod");const Xw=/[^\\];\s*$/,Zw=/\s*!important$/;function Yw(t,e,i){if(Jg(i))i.forEach((i=>Yw(t,e,i)));else if(null==i&&(i=""),"production"!==process.env.NODE_ENV&&Xw.test(i)&&c_(`Unexpected semicolon at the end of '${e}' style value: '${i}'`),e.startsWith("--"))t.setProperty(e,i);else{const n=function(t,e){const i=Jw[e];if(i)return i;let n=fy(e);if("filter"!==n&&n in t)return Jw[e]=n;n=yy(n);for(let i=0;i<Qw.length;i++){const r=Qw[i]+n;if(r in t)return Jw[e]=r}return e}(t,e);Zw.test(i)?t.setProperty(gy(n),i.replace(Zw,""),"important"):t[n]=i}}const Qw=["Webkit","Moz","ms"],Jw={};const Kw="http://www.w3.org/1999/xlink";const $w=Symbol("_vei");function tA(t,e,i,n,r=null){const o=t[$w]||(t[$w]={}),s=o[e];if(n&&s)s.value=n;else{const[i,a]=function(t){let e;if(eA.test(t)){let i;for(e={};i=t.match(eA);)t=t.slice(0,t.length-i[0].length),e[i[0].toLowerCase()]=!0}const i=":"===t[2]?t.slice(3):gy(t.slice(2));return[i,e]}(e);if(n){const s=o[e]=function(t,e){const i=t=>{if(t._vts){if(t._vts<=i.attached)return}else t._vts=Date.now();f_(function(t,e){if(Jg(e)){const i=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{i.call(t),t._stopped=!0},e.map((t=>e=>!e._stopped&&t&&t(e)))}return e}(t,i.value),e,5,[t])};return i.value=t,i.attached=rA(),i}(n,r);!function(t,e,i,n){t.addEventListener(e,i,n)}(t,i,s,a)}else s&&(!function(t,e,i,n){t.removeEventListener(e,i,n)}(t,i,s,a),o[e]=void 0)}}const eA=/(?:Once|Passive|Capture)$/;let iA=0;const nA=Promise.resolve(),rA=()=>iA||(nA.then((()=>iA=0)),iA=Date.now());const oA=/^on[a-z]/;const sA=Xg({patchProp:(t,e,i,n,r=!1,o,s,a,l)=>{"class"===e?function(t,e,i){const n=t[Ww];n&&(e=(e?[e,...n]:[...n]).join(" ")),null==e?t.removeAttribute("class"):i?t.setAttribute("class",e):t.className=e}(t,n,r):"style"===e?function(t,e,i){const n=t.style,r=ey(i);if(i&&!r){if(e&&!ey(e))for(const t in e)null==i[t]&&Yw(n,t,"");for(const t in i)Yw(n,t,i[t])}else{const o=n.display;r?e!==i&&(n.cssText=i):e&&t.removeAttribute("style"),qw in t&&(n.display=o)}}(t,i,n):Wg(e)?qg(e)||tA(t,e,0,n,s):("."===e[0]?(e=e.slice(1),1):"^"===e[0]?(e=e.slice(1),0):function(t,e,i,n){if(n)return"innerHTML"===e||"textContent"===e||!!(e in t&&oA.test(e)&&ty(i));if("spellcheck"===e||"draggable"===e||"translate"===e)return!1;if("form"===e)return!1;if("list"===e&&"INPUT"===t.tagName)return!1;if("type"===e&&"TEXTAREA"===t.tagName)return!1;if(oA.test(e)&&ey(i))return!1;return e in t}(t,e,n,r))?function(t,e,i,n,r,o,s){if("innerHTML"===e||"textContent"===e)return n&&s(n,r,o),void(t[e]=null==i?"":i);const a=t.tagName;if("value"===e&&"PROGRESS"!==a&&!a.includes("-")){t._value=i;const n=null==i?"":i;return("OPTION"===a?t.getAttribute("value"):t.value)!==n&&(t.value=n),void(null==i&&t.removeAttribute(e))}let l=!1;if(""===i||null==i){const n=typeof t[e];"boolean"===n?i=Oy(i):null==i&&"string"===n?(i="",l=!0):"number"===n&&(i=0,l=!0)}try{t[e]=i}catch(t){"production"===process.env.NODE_ENV||l||c_(`Failed setting prop "${e}" on <${a.toLowerCase()}>: value ${i} is invalid.`,t)}l&&t.removeAttribute(e)}(t,e,n,o,s,a,l):("true-value"===e?t._trueValue=n:"false-value"===e&&(t._falseValue=n),function(t,e,i,n,r){if(n&&e.startsWith("xlink:"))null==i?t.removeAttributeNS(Kw,e.slice(6,e.length)):t.setAttributeNS(Kw,e,i);else{const n=Ry(e);null==i||n&&!Oy(i)?t.removeAttribute(e):t.setAttribute(e,n?"":i)}}(t,e,n,r))}},Hw);let aA;const lA=(...t)=>{const e=(aA||(aA=jb(sA))).createApp(...t);"production"!==process.env.NODE_ENV&&(function(t){Object.defineProperty(t.config,"isNativeTag",{value:t=>Ly(t)||Dy(t),writable:!1})}(e),function(t){{const e=t.config.isCustomElement;Object.defineProperty(t.config,"isCustomElement",{get:()=>e,set(){c_("The `isCustomElement` config option is deprecated. Use `compilerOptions.isCustomElement` instead.")}});const i=t.config.compilerOptions,n='The `compilerOptions` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, `compilerOptions` must be passed to `@vue/compiler-dom` in the build setup instead.\n- For vue-loader: pass it via vue-loader\'s `compilerOptions` loader option.\n- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader\n- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc';Object.defineProperty(t.config,"compilerOptions",{get:()=>(c_(n),i),set(){c_(n)}})}}(e));const{mount:i}=e;return e.mount=t=>{const n=function(t){if(ey(t)){const e=document.querySelector(t);return"production"===process.env.NODE_ENV||e||c_(`Failed to mount app: mount target selector "${t}" returned null.`),e}"production"!==process.env.NODE_ENV&&window.ShadowRoot&&t instanceof window.ShadowRoot&&"closed"===t.mode&&c_('mounting on a ShadowRoot with `{mode: "closed"}` may lead to unpredictable bugs');return t}(t);if(!n)return;const r=e._component;ty(r)||r.render||r.template||(r.template=n.innerHTML),n.innerHTML="";const o=i(n,!1,n instanceof SVGElement);return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),o},e};"production"!==process.env.NODE_ENV&&function(){if("production"===process.env.NODE_ENV||"undefined"==typeof window)return;const t={style:"color:#3ba776"},e={style:"color:#0b1bc9"},i={style:"color:#b62e24"},n={style:"color:#9d288c"},r={header:e=>ny(e)?e.__isVue?["div",t,"VueInstance"]:i_(e)?["div",{},["span",t,u(e)],"<",a(e.value),">"]:Zv(e)?["div",{},["span",t,Vw(e)?"ShallowReactive":"Reactive"],"<",a(e),">"+(Yv(e)?" (readonly)":"")]:Yv(e)?["div",{},["span",t,Vw(e)?"ShallowReadonly":"Readonly"],"<",a(e),">"]:null:null,hasBody:t=>t&&t.__isVue,body(t){if(t&&t.__isVue)return["div",{},...o(t.$)]}};function o(t){const e=[];t.type.props&&t.props&&e.push(s("props",Kv(t.props))),t.setupState!==Vg&&e.push(s("setup",t.setupState)),t.data!==Vg&&e.push(s("data",Kv(t.data)));const i=l(t,"computed");i&&e.push(s("computed",i));const r=l(t,"inject");return r&&e.push(s("injected",r)),e.push(["div",{},["span",{style:n.style+";opacity:0.66"},"$ (internal): "],["object",{object:t}]]),e}function s(t,e){return e=Xg({},e),Object.keys(e).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},t],["div",{style:"padding-left:1.25em"},...Object.keys(e).map((t=>["div",{},["span",n,t+": "],a(e[t],!1)]))]]:["span",{}]}function a(t,r=!0){return"number"==typeof t?["span",e,t]:"string"==typeof t?["span",i,JSON.stringify(t)]:"boolean"==typeof t?["span",n,t]:ny(t)?["object",{object:r?Kv(t):t}]:["span",i,String(t)]}function l(t,e){const i=t.type;if(ty(i))return;const n={};for(const r in t.ctx)c(i,r,e)&&(n[r]=t.ctx[r]);return n}function c(t,e,i){const n=t[i];return!!(Jg(n)&&n.includes(e)||ny(n)&&e in n)||!(!t.extends||!c(t.extends,e,i))||!(!t.mixins||!t.mixins.some((t=>c(t,e,i))))||void 0}function u(t){return Vw(t)?"ShallowRef":t.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(r):window.devtoolsFormatters=[r]}();class cA extends Lm.Popup{position;popupOption;id;constructor(t,e,i){super(e),this.position=t,this.popupOption=Object.assign({style:"Light",size:"small",labelWidth:"100px",data:[],title:"",pixelOffset:[0,0],isCloseButton:!0,triangle:!0},e),this.id=i||d(0,10),this._init()}_init(){let t;if("Custom"==this.popupOption.style||this.popupOption.container)if("string"==typeof this.popupOption.container)super.setHTML(this.popupOption.container);else{const t=A(this.popupOption.container);super.setDOMContent(t)}else t=this._createDefaultHtml(),super.setDOMContent(t);super.setLngLat(this.position),this.popupOption.pixelOffset&&super.setOffset(this.popupOption.pixelOffset),super.addTo(cNt.value)}_createDefaultHtml(){const t=[];if(!this.popupOption.size)return;const e="Light"==this.popupOption.style;this.popupOption.data&&this.popupOption.data.forEach((i=>{const n=Bw("div",{class:"ePopup-content-main-item"},[Bw("div",{class:"ePopup-content-main-item--label",style:{color:e?"#666666":"#CCE0FF",width:this.popupOption.labelWidth}},i.label),Bw("div",{class:"ePopup-content-main-item--text",style:{color:e?"#333333":"#FFFFFF",width:`calc(100% - ${this.popupOption.labelWidth})`}},i.value)]);t.push(n)}));const i=e?this.popupOption.triangle?"ePopup-light-triangle":"ePopup-light-notriangle":this.popupOption.triangle?"ePopup-dark-triangle":"ePopup-dark-notriangle",n=e?this.popupOption.triangle?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA0QAAAJ8CAYAAADeR2FaAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAACAASURBVHic7L1NzCVLmt/1xKn71dN96R632+oZ92g8ohczA8JYgLDZcA0bLxALpBY7xALBwuyQEJIXCCQkhMRqkCwkJCMWbJBYIBuxMRpW9ghZQiAYFr2wxxiPukdMt6s/btWtOsEiMyKer8hz3rci61b1+/t11833nJMZT/yfiHgyIyMjQwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4BeQ8gtqCwAAAAAA3m/q2zBydieFThAAAAAAALwpp3WOzuqw0BECAAAAAIDVLO8Yre64HKVHJwkAAAAAAO7lqPOzrGO0qpMyS2fy/ffoHAEAAAAAgOO/m3V0Hvr93bxpx+TOjlDWAfqh/e6zN8wJAAAAAAC8P/yu/+JbSecmdJCWd4zepEOUHau+852gH5be6Xn+nBEiAAAAAACwfPrp1rH5XZHYQTKdo6wD9KhO0WM7Jv64vCP02TYK9Nf/8//hL5QPv/rvPv+8/EuvX9dPnr+8fG3LbxGpVaQU4TOf+cxnPvOZz3zmM5/5/LQ/f/qx/OTZpX7+6SfyP9cvfvpf/Cv/3r/6t0RE5Hd15+iwY+Q/36Q89IDkGPV57wypjtAX8rX/8gc/Lb/1CDsAAAAAAPCE+VNfrb//ofzk34kdo3Wdood2iCadoTYqtD8W9/x5+Z/+67/9H/6/P/7gP/jitTx7oA0AAAAAAAAREfnwmbz+1a+/+k//0r/55/8j+fTTah+n6x2jR3eKLg/Iy3Fn6LMfFvlnnhd5/rz8jb/2e7/z9/6/D/7KF9e9M1RcCmzZsmXLli1btmzZsmV7x/aL1/Ls7/3xB3/lb/y13/sdef5863N81l7Q9j1/hEw+T7l7R7evzcBnPyzy/HmRn/+8/I//7f/2O3//H334b//op3Xba3808Ksfy6s/8Uvy6htfkS+++kl5/WG5Ville2Zw7Da2peyf9S9xxxIk5J3BUrb92iOKtVYppUitcf+2bzRoP5ZLUebsfvrTs8ul9s8jAybZ3HaiZzhIpOmQIlXG1qbn1elnNW3yme4tXavnUorxYyok1aL0uMMu+75X2XrpV6lykSJXl+7Fp5mU3248sVv2dJWdKvKs6ZGkvukkL5f4ZeJHnUetI9Uj3txx/fV6tnqsHr2V4sprrmc7UP1cJPWntq3rWdnt9/bQ0gv5PNCj7e7tUWdHSnG5v7c9zu1fVDnqOKDCUctkkvO8Pe6uD/HAt5+gZxIP8rg2b2cmrk3iwb3tcb5frscer/TYTCZpKvs7l3Kptni1Hrt3ms8srk3t2nRbXIvtIfp91h6N/Ul7TPUEP2r7lsPyUfX4cinJ4VGPSe9WOUqx8dPEty2eShF55srRGvB6suwl8aCU5OgYD8qzojM41S0iIpdJ+VyrlItI3Y8vl/vqb4xr1r6pb3Kg51p7/nPbiZ7dP7b65PUtr0NRz6WUg3Ic6cY43XaL9eio/vp6GcNj1BNjpbevkp/uO9FzIx4c+9HGg3IpITvZ+Tlvj9r+xrNLyU+u6sBrrXJpcShrzqHE/PWVsqsS6NfTPnv+vKPPyzfigdb9+Su5/PFP6wc/eF4++gc/Lh//+GfyoTMkv/4nXv4nf+lf/3P/sXzlK3UbLTocKTrw1VT9Xfvtf8fO0H//X/0vf+FH9U/+zVev5dkf/0zkUkSutcqf/nr5/De+df15CwC11rndVmPaVcZUxrgSmdZX9cXlsPKo9Go1BZhV4FbglyxAJ/bnjSY7sPltbGf7HSe3VeCLy6E+T4QT2qwhOvt36dn9GP2X65ldX/gTSugPSV4+0sr7ZjOoNwKq7PVglPctPdOAliRcXLXMTmgtON/DoR/NdUPtFxiHelx7OGqPWS7NCW33Y1reE8wJObGvyz0tnzdpj0mHcXZC8+WYZLDHqhtW+z5ex+yE9pD2OPefaj9pR0NS/98y3dtjKdXWg7w63ZRyoxzzeHBbx122ZeS/7T/TMU1z1uAmtrN4cF97FLl5Hb2fn59N4kCW/EWO22Nj5sssHtwbC9yJy3V4mry6dQSPs9ePf9O4evf1tqfVo5tXJTGuafvm+Htti/Troaw9Wj33XTbdL9vpecP26P14VI+LiIQrz0mFv7tOiq/Px/tl+ff2D/tDavvBxd2PfkR7vH1+u5HeHfZv9e/sDV193Fb5XrySy//xD8pXv/9D+ao+/sNn8vob5Y/+5X/t3/oX/9aqTtFDHpmLqM7Qd1++LOWTb/7VV/ucoSJVahX5zW/LT37jW9ef11rLtdbSO0M9u9X8q/tvZivtwmPb1j3tuu9Qq4ytOTjziaU2u1W6/bon0dLTlu03Woc4u0qP282kUZWePb+tE3TNDVg9xo9Kz/7dVcT8E6l2W7dO0dxMNf+u+qfuo6Zj3yo/Ru3OUCxo8/eekvG8/qe1jvpQbToGp6fnX21VGlvZxJwP9/gDfQa1jkSPqmtdR6uL1WUulaMrf/UfVdqjzZj623UoPf2gtADNh65HZVX/G78pPVnBmAo1ErB5067N2qXbN/8iN6vao/Gjc4kkdo2e8JUujDweGD26Hrtsdz3mSKen76v0OD/a6un0zDLYv7MphN27r5TNnheXx8yQSzBrj96PRk8SD5zgpB4rb/g89qoY67FvHnnGrYlRDkqPJHr6vlk8yHQ4PfpcUtV2/+4qKvbJwTY2aLNDOx+0ke+r11OVnu4/68dDdDy47qbNdngwzf/IoBavnOLM9e1exld9vaFcIUpPPyLRkzaQURlmza2n1rSqujNvj4n5Xh3r2NZqi9MU653xYDS40B6tXHVdMHbXVfSwPfoE8/Nz4hav5554oPyZFVvXU8fW/iYJTqyzP8pW6cmy1/dVemZOV2TtsW+N/+bXOVaOynhiP7Qfr6e6rYx4EE1t/YWPntX6z/56ff4v/OPyx/pm4avX8qx88s2/+t2XL4v8/OdbX+SzHz6gKxu55+AS//5eEdnnDO2dof/sv/lf//wfvfrG77Ydf/wzkV/5hnz+Z755/bzfwZU77tz0PW7uuO1S7FF9W22P/fYI0bB/dId/fJyMEIXk8juzM9pdPf1IVx8xknBD7HZ6Ug/9qEeKnmV6Esfed4c93jnJ70Rtf917B+PeG8hyKTXcgUr9cN8IkVTZHqEI+U+2JT8+v8N+XDGa30Ru34Fq+9zSMXa+oUO28umPwt1oj4dlsx9v9BwnJyKq3d4sR8mfAPS7P6Q93rqjpz7K7MmSLMl77ugl5rI7avWB7fGWH6ts8eaguTyoPXbb2R3ppD7fP0K0tcdbDq+yxUDtv5n+B90V3v+TxQOz373tcbJflt1nRQ6eIBhMn/JyCd+6I23TPBjSVtweORzlcXlWpV7viAfZ7dtkpKio/W7pMe3xgHtHvHRyt5It92RQbpSP/uKO9tCYxVVfn28OCOo4cE8A9HoO4sGDR4gm8cz8XGbnBfvFvbHAj5QcxYPDNO+MazrdDy6q+G9eZ9ynZ3Z+C+HqAdcZR7Z9+rf4O3//8rXv/0C+qr/7kx/86LN//9/45/729z/6qMpXvlLl73xatxctPHyU6IM78uBoj8qJyHOR7758WV69+k755Guf/mX50ajYv/RxffVnvnn9XOeg7v+poUXb3Bap2xyiKvpUpnewNdwojb3hjdK/0xcS+hnlHJ1h+7GaA/OaWEV2HeMCM7QcxVVViz6SU/XnlnBxyeTPCl+DjWjfj/oEPfs+l337TP9ac90bw+dj6+6+dAcVZ1U9i6oPCM/MxUi6Jak6d6HiDbY5RNaPQU+3X+zH3X4dbjK6jType55uRexof5Po5wPsLaVWd0I5mEMUiqgk9Tkd9+hfhPIxZ4CSH+Tsdz3m502An0Nk9LR44Nqjt2/zn9y31UWbxAPjn0CsR6YKu3ig2+MWrsqIBzq+hXjg45rSY9qTMWf1iK9vJUkw1sfq/Bj06PwXV99mPR0dp108CPuZ4k3mRLn2aI9X9l21z+KBLR83Z6EcxDdV1308mJ2fRH8d4kHxO/R24fPfzhG2MxTjgZRy8Mj1cMxF1/MkHjjh5tNVqlyqmiO567+4crT27V9tno6Vk8SDa3ZDtSYnuWI6SiMOJBm6jLpu4tp1f+S7OfBgDpGuz3qek63eWTwodh8bELfvrrKfoLRFvc3bg26P2XWOmbXg7OuPOq4dxgMV1+xusT36OtSvC8L5OW+PMR64uOYSt/XZlY/WY+LBfXOIjBYTD/aU3PkxuyFcxMZV8WUziwfueiSrR20OUa1Hc4icnmp/7tcFJgF/vRbj2ki1RDPKQP/qjl7bP/mr9ac/fF4++tHP5MOWnU++9ulffvXqO7/3Xfl/5Ptf+UqVz2RfzPV7xb2S+ya3OkQl/Vs9Kvfq1XfKq1cvyk8+v/xFremXf0lejYaoHFRcas4JZa/5Zd+n+AP6x93DxdeX8IXsJ4puSA9/isRArO84bCMz1T66XNuJIGtUYuyX2quE2pqWM47tTdHGEYs9ofl0g3tmHU5RF+rqwsnG7yGwuGNt9tNIJKWUGgOAq/SqHIcOkTZqU9yJ1TeZfkHWL8y6nhLjV8xne7RzqsfUoywA+GSdDX1Cyc4Y+rtqfexPaDGg7Hnq9VmklFmHU9zxSk+1W5v/ut3d7/Vpz3Yrn35btE1G9Ye3QFzMCa3tOpq3TU811hJvQEQfN+cdnr9UOTqJ+9b/FuvBVgy6m6kck7ZVlb29PU7bT1a2KtvzeOCS6cnp30JDtOkrPaUXpsa2x1EP3FYPZ9p0i9eRnh8TP+rHL6xDYgJbPbbxLe7Qd+x1xthxfszrQQ0j932gQhWwH1AZcXn7UGY29m2YMuPOT77OlGZXWltzuHjQ+x0tueK3NoXq7riMc8jYzoOJK/+StTm3s3aHnhaaOlyVf8ubuRxQtaEd726kya6jlbEKRIkfs2Z1oEecHsl9ZPSomOGL3cc3/YCHb48hrsY7kOHjVv6zPO57J3Et7lb17u78puJasJW3xxgPatChU7A3cO6LB6auVLfV5RNuSOpsVHe8L//dJ83uwfktl1n7S0xm8UCkjSbX5NzhHbTFl3k8GwnouelDR8ur1Rn84LI7TstjhzJ5dObjZ7X+6W/Iix//vHy47SfykxeXv/jq1Ysi8h2Rn/9gq9efiV7AVXsmPe00HjhC9L3RnvZH5V6JyPX6snz+Wj7VzvjHvlJfxQqs2ZPKetx1V2oqgL/jOU7Q9g6GKZlhJ54advPVVeQiV3fHYcy5Kft2S6/2vGpx1v5Vih1R8XpMRG29a+WatKa372LC5o5alXBCG7Jqz3+/c+Lv8CeNc8u1nRSZ32Ev4Q7GqAU6AvszsM9rdYHA6VF3LuydbT9C5H3Xgm3poy+2Hvg70kV8clWMA+ZNTR0QRgyScjTl002UPG0dbIpIHCFSFy3hjrQqn14PlJ6238EdOHtHrcTmLOPOXzXn4Mnjps6PcUTlKB7o+tyyPYsHmR/9iJsblatW8aiL8/ZoEtjbY37+6gUY2sNxPBjlmNkf8aCM2OLaw9Cz203jmhahP/kRInWh29rlnk+rYxYPvP90LpMRKp+9Hteqimc+ZuitTiGLa/qgUSBFjb7oaSppOSYutCMr23kifSS6xvPO4R1xrycLT7bBjziTuieLB2OHrD2G6j+NByOfU9zIgn60rly1WpuTnv+rSL3orcrQVcLIT9DT3jaX3WEP8UAkPH59FA90ffNuat9cq9RnLq5p8/qHxI/Z+XnE66QJeD3TZ8xUPqtIvAHiy1/HA1ffQntM9PhmZeJBFtecnlr7dU6yi7Mv3XYaD5QwXSfijdVETxbuqigdTVd+1aevd/x16lE86PGlupd2ad17ejae+eSaI/IM5m+fzM9P44mUWN56AMN3jv7U1+oX/2eVXv6vrvLx9fqyiHxcv/vyZfm+iMinn+7HPGyU6KhDVPK/99EhEWmjQ69ff1FefFE+LmUEhK99JK9Lqf0C7Vqv5VJKDSfQfsHuLi72j+GOtGv0/vCRvhvynInsd1BaMtXGyJFREbEnrva1bWc2Q5e9Bcc7qs1uMT/EJ8L8HXYvwG79naDS/hMq8N7g+whLtXra7u6LMOLl7SoB4U5m0yGqfHzxO/3mjnQJP+sMOD3JCTkx2NqaS2aUj9JfsrvXfoSqRA3bjnv+a1I+B1/oGU75CEFef4Jbux9t5rRbrA51wkzKUUK7tPZnwlo91slaOTf0BD+q+qZ2DHpMPKhBx6gPLh74snQd+Fafu57geJtAy6MZKUgEF6+jpf8m8UDZnbWHOEIw0y+mPc7igS/AOEJgy2c29OTjf/Sfc4CPB0r29oPXP9MRfhGR8br8OEK0nx9KGa/UT2iPlF2qSk9tR4as3ev+VXp9bfKZ6yh+v1q2OQvqsTVbPUY8yJi1x9b9vR0PpL/e+q54cHGpdMeXvtU5rfub5MZ21DfjClefuo7LffEgi2t3xQNtN4sHl/G0jDKXnJ9L6sDZ+VkN7KcZ1u3xrngg4vzn5CoHahfEDkeoMOZjOD+7eBDOzxLPz0vigfOj6bC1reh65hpg+Nh0lNSPPZuqPbYOjV9GJDuv9fhS8u2oYGIcFOLb7AKjpb8fp+Ob2cUdp8/PluHYWmvRnaJvfLV80d6IXKTIT1/Ip69ff1H6KNFHP6itjzIWbTVeSUONyGPmEH0mY+6QbKND12++Kv5Z6w+eXftgwXVvtXZEwj6TaMuhjoqcdqllWoHbESK+sqsAXCQZ0RjYnnHPcP/YHlm2IxI2n7qiPtPXX7efGYl6munqdDcdou8sJBHROES3XFH599stxeyOrA1gk0gkKrg5+y0b1RxW+i6t3O+eQxQ8tqVnyn83mN3B9CNDQU+oUNa+v3OnyzDeyfIR25/Icj1f6hwiVY7hTpYZ4SyJjaxe7HqGjC4gzCGS4kojtseZ/VGPvR6VlL5zOsLR8E/Mva0Pe3b0SLXOWKhvasRrO34WD3Qdajr2EtXxYN/XxLVpPMjbo8ru7pNidgt6dDwoxR2v9BiUHpN/Wz7+wiYbeRgJJeWTxFV/R7pbC/HAjXA2PUl8u6q6Zp4gqLWfH657nJ4uc1D1uSa/IMnj27x82pwBvb6aP9rrqddifvbn52qOjvHFzBkI+c/su2+uSs9RPLhmo8p1nJCvLZFyOIfI6LnEOX1mZKgV0NE6RKo+67h2Ox4czCEyV6LWttczjk9GnOqs/RSfoI0HonySnj5cPNBxzeyWxYOJnuorzPGTG2NvF9ecfXt+ewtziHpcc3G95HOIYsByaTr7bc82QhRGdFQ9aue1ay0Hy7ho3PVib151j3lWd7qMyz7y3Y6/zEaUpPmpJZm1sT02qE7Rx8/qftk+Erx+81W5/kiNEpm5RPfzgA7R/rjcPndIRKSNDtXXv1wuF3crQbY7AdfrtVzkIlcZP286i9n2r9uIyv7lqjlEjfmIxr7ffkIZcam4O3/7Ca04Pb1RbvZHT9k02emd05FhCRe4Bj/nRvWU9bYl4KtYvGOiLpz0zm5EYZRCTf0YLh71hbro9jAvR/u1tT9OIc5MuAO869GHqZTjiIbTI05Prxb+Ql26H61860evY6S/6wnm/CNI9TBQzEY0vB99x6uKba56RMXgCjDcCVa3GlubtYcXV59te1QFYfXon4uoC2XrsJHv+0Y4/RXi7M5pL0dX4KHD6YcuXTyYjXCO3WzBuRuuRkcaDybtMYsHRZX/ONrdOS0uDvQdZ/HA/eH19AsYH9dcPOjpVJPe/E5wvKe4ZdPfCQ6CTT26OcLpvtDN0c4hyhtgvxO7p2JGhsp+njD67baNNOk5RKFeqgPandOLy45ykGnwIa6pOJDFgzii4eNBs2vLsZtP40GmP4kHF1EjQm3r48GuR40MuYS3jVuHaGx3e21kqI1IZc0uiQdRh/3i7hHO3X69VDsi2O2rcjwwG+OB1ZO1R6NnNlTh45uX23dL4oHWM4nrk8PTeKDjWnZ+tvXa5c9V/BDfbsSD9lXs9+Xx4J7zs85idn5u+noH5yAeFBcPQr/enR/jiJDT7eNbv85t293eCOB7PUrNzZ90CBTTKfL9jfr6l8vr18/Lq1cvygcfSG19lG2E6P7H5u5Zh0i5cHvH92/L9rhcGx26vn7VaruMO/pVrtctt22NApOj3gut5l/t6aitjBNbbf9TttrISQ0HV2cskq1D1JYqaOsAjTuAWzpGjzZh7G7bsG6P11OVnjZa1hp3bsDqMX5UemToqeboaremzDIzNoWgo+d1t1Wr+jvT7gzFgjZ/V2M30WO0ah9YN1mHKT3G17roarfPOkROuPrQ9ais6n/jN6UnKxhToUYCNm+2Jo4cKD163/yL3GxLw/vRuUQSu0ZP+EoXRtJ+vB5dj1225/FAme/7Kj3Oj7Z6Oj2zDPbvbAph9+4rZTONa8O+MeQSzNqj96PRk8QDJzipx8obPo+9KsZ6nL79M2TcmvBrv7V1QubL5ewTp2vdOkPeZQHVfoz/VHZ2P86Ss8Vd7T+3Q2g/vl5om91/1o+HaAGsQ3SjPSbme3WsY1urLU7XHo2eeQZVxia+3+1VtTV18Y72eE888Kd7u31APFD+zIqt66lja3+TBCfW2R9lq/Rk2ev7Dj3XNP/e+pZSbwZVbav09ci27fbjzTlE2o/OfrYuWagueisjHtzGvhxN++36+tXWF7lub73+7b6TWZco9Nc9D3tk7jMReS7y8uVLk3C9vipZD76UqkZY4p2obcd+q2LvSG579JGiqpW4u4J13Inq6e5p1Op77LnDww2AxIYeCx52ht2jsmxvvMlji2v06kO3s2vc3aF2rf4Qc2zbXkSqPdAqzuYQGfycgd2h8caBu4OwH6zLYdyJqtaPtRgfW/tihrz9W/O2fYYfdbr2DpR4B3YD+YlhNLZxvC2H8XV11cSVTc9/7XnsP7m3zLk/lN+yR7rc7lXksr/+JdzHmtwi0+3R3oEaj6xW/yyGM9zNTy9whh+Nnjw582V/6EvVg3Ggt2fLwcSDvktoSKE9jnqQ1TWRWTwI2UoON/Fg5gB1xgjVV8eDXi/UzAPXHh8zh0hqLU6m0z+26VvzRoUI2rJ4YAs8tgffHof/ZjHDx4Nq/DePB678U/EtmzW/o+oy7t9qpULJFnOTPGpzW7r2LaelPamaxgN7Bzfcke5pq3ig38B65B7ng6Fx36p4kL6lSx1k6vOlHq9D1L7Ub5lrW70eRPe7ip/t1FJ0+rrx34gHpsCSrGXtUZz/pvHA12e/z2a/iPSLkqMR8B6nkzxuW1s+6kPfhvOzrqMH8eDoOic2KFU+aTwQu9+NeHDzLXP6vFCS8vF+UMcYezHABT9k1wdGbEKrIy2elYvEU08vf/2ETx0DpgcNt0pci03vetQe4iNxKq8Jva3t8SCkrz+q2Ce3FmT0dnpc2y1cX5nQ+fLlyyKPeGxu1iEqk+8le1xO5PNQ1td67S3VjJKYhl/DQ879BFBKf721KSFX8Bd1gdeae6zAQ5K7kMgvzAwuUk0DWN4iY3tNWo4h0eMCwfahuGTyZ4XDm+MS+3m8VnomcWdrXJNIpLTYeOgCzYhUzuoD5hC5SFp32zZ+hQILh5vy8RFFbW3+44nAl2H+lre2QzjDBftbHr/EOUTKZCgfE119XRv51Pa7HvNz7Vd6Nv9Kz+7HW3OIbP6Tbo0u2iQeGP8EYj3a8vbwOURdTxoPfBxI4oHOqk6mX5g9YA6RkWf9GPTo/PtHVqdX6kqPiweJGVW8yZyoEdwkEBu0hNOyige2fNychTKPb3EO0RjRcQVuj5PkWXvtH1Oft/T8Hds+xyuJBw+aQ5TUtSweWKweHddiPJBJPLB/mTlE/cckHjzRdYiqW0jax4OsPej2mF/n2DLX9vXHpXOIegZK2GXzYyzHrD3GeODimkvc1ue3MIdImh+d7pLPISpi42pYI8rZb5bzuUNtu5dPvWcOkdNT7c+PnUM0vi+H8WDLbu3zB2av3G52a635ffHssbn+trkkoSQ3d44QqflDCfX6uojYiitS5FL2AC3FziHSJe4ucC97Au0NPaPDU8xm9RyivkdVz9oXUReY8Vl7e75rjdLaj+sQ9QxYPeL09ADgXT72s8kUu7W7qaPnc4jM9awbURj5d3qSZ2q7JR8PdvuG2RyirkP5M7NSnJ4WYJQfbUHZFO6dQyTJnb9m1yZbjQnzrH3bGvvOnB+h2U9ofR93EfPYOUQ9bPuf0w7nEBzewtQN3ppDVMwJrcsZFcnq0SqL86PeQ8UDL3MeDwazeGDSbu7K4oFrj+OY4/Z4Kx6033W25/FAHef19Ipl49o4eWdzopx2rafXY6/D2h1zBlz9CtdHWTzQfvB+HAnpuQPdGz4e+HOry9BszkAY+fbxQPwcose/hcnqt9vz5xD5eHYrHog5YDan8NFziLqcJB7oOT+zOUQte/7tcjLarYgMh5qjlY6L22bNzsSDpMkY/c5P7dsg3+lp+fdhrG1DXHepzOJqCDDt48lziIqEOUQ9rjWh88NDXCvtOnpywf1lzCEy9czHdR8etN2yudtksYUd1R6bzEs5WofIlvvtOUTb9sFziPafZ3OILm1X5zZ9PdjqQc9Se1rsxqiR8fveBwk8f14eMo/onjlEO+NZvD5/6DrmD3l/iehnrFufOaH2bvHwihoSyZ5J3P6N57Bbh7jfcbRfzCzvpqqI7M8z1zqyYrMh7dJn2yo92kRi3+dgbGu3P56DrSbbNTdg9bivhg6lJz1aPYrk/Gh3tCkEHdpu01OrLU5n1+gxPgvmlI5h3+ip1W2bD2bFbw2FKlddGnvdyLxf0wN9Bu126HB6fLWtNfh20oD0QSr/3r1KjyR6+r5KT16AzrqrF1Xp2RO2W1X3UzlKgC5TvTVpOD1hX+/YGaP+yl7m2g1Nk7VsjzV/GocMTVkdMjXCxAOb7Xk8CDL6Np1DVPXRLq7NM+grqPGBltvstvrk26OPq8bQxH46h6gm2RNlN82/AnDXjQAAIABJREFU3/qjvY72b8To2Rwi+7ic0pPYvzmHqKVXHzmHqNfnJDtdh/LX1D3OEW6H8af2/r3xIBXg5Iy2IyLbW9/cXCLdfoKeMO+oPngO0cizqg8izn9VWU4TdAm0+hx3M3quSQw0LlE/zNwnYs7P/dxi6oNrPy0H8wy6DB3I3e22+uSK1J2nJ5Xb12MTD6KOoKcqPXYHX+GNba0j6Knxt5hzZ8T5cRSh0hN3U9kbeu6ZQ9RSSOcQiZ5WVyfxzCeX62h/35pDZM5rTc9B/c0peX/j9autT7LPIxq//DDvLCU8/LXbmm+JyEtJe2cXaT1ON4eoVtuhDz3u/ZfWA60qPbVtxBt4/g67uC63JVuHyNwNGhl16cc7alZHu4NRe8/f/mp78P4OQjcf7rB7AXbLOkTujpCz7w2yDpGvx37ETZz/1FaUn1Qej4SxDlHLv9omgovX0dJ/k3ig7M7aQxwhmOkX0x5n8cAXYK2jHncdour5ZOhpOgI+bQ8uHijZ2w9e/0xH+EVEWIeopzJpj6xDdGc80HazeMA6ROZjOD+7eBD7UfH8vCQeOD+O6xsV30TXM9cAw8emo6R+7NlU7fFS7NzCX6x1iET8+kNH9D7It0TkR/cckfNmHSKHrmj9PeSinn3e/7M/Nid6HSJbsHWcWHzVdQUWHjkQd4eoH6MCcBE5WofIpzefQ1RkyLT5NNnU11+xxSRedHqa6dbNVi371jpEZg5R74lb+95fTUEV+2yr1TH8OBEippEp+7Ye2H1Hag+YQxQ8tqVnyn83OJ4R9jqG3aAnVChrvzo/6jLUOt7bdYhUOWod988hct/UXc+Q0QWwDlG0rdtjiAf7viauTeNB3h5Vdnd5xewW9Oh4UIo7XukxKD0m/7Z8/IWNaT8+TyH2S+LHAz0hHrwn6xDVefk8Zh0iYR2iUZ9bfXuH1iHynVGvZxzPOkQBfX4uw0dxdx8P3mAOUY9rLq6X+9Yheuwcol/MdYjmaLes4sEdot8WkZ+pz+3tDu0/+g7HVgDJHCIR8V3u8SziVmPe9hyifkC9NYeozVE5nkM07viYJju9c6qL1l/gGvycm34H2G5bAr6yHM0hMjvPnqltIcjZD9VSX6iLbg/zcrRfW/vjFOLMhDvAYw5RP0ylHEc0nB5xeno9eOwcIu9HpyeYc3paRQjY+jurVqxDlMUDZX5y57SXoytw1iFKysd84fT0Cxgf11w86OlUk978TnB2T1HHtREPnGBTj26OcLovdHNkHaIsHjS7thy7+TQeZPqTeMA6RKp/pcrxwCzrEL39OUTmdxcP7jk/6yxm5+emb+0cou2Qd3cdIktLU7cf/6a53xaR/+thyT5kDtGGf+V2R9eTIiJS4xwi9w7x/Uvzb6zToLYqjT6HqKo5RHtPtD+L2LfVGYtk6xC15xztHcz4lHLt/9m3xm7t6fndTBpVzRmo7TtR22DA6jF+VHpE6TFHOxV1/2tqxqYQdPS8qjkQyo9RuzNkyizat8+kJ3qMVu0D6ybrMKXH+FoXXe32WYfICVcfuh6VVf1v/Kb0ZAVjKtRIwObN1sSRA6VH75t/kZttaXg/OpdIYtfoCV/pwsjjgdGj67HL9jweKPN9X6XH+dFWT6dnlsH+nU0h7N59pWymcW3YN4Zcgll79H40epJ44AQn9Vh5w+exV8VYj1mHKGk/vl5om91/1o+HaAGsQ3SjPSbme3WsY1urLU7XHo2eeQZVxg6uc/R1wdhdV9HD9nhPPPCne7t9QDxQ/syKreupY2t/kwQn1tkfZav0ZNnr+w49T2EdohrvAG6E/kZk2lc54P4Ros9E5Ln9qr1yu6F7ftM5RDJ6vNtBNs+XfY8xQtS+jz1PfXhPt93huLPnGe9I+zlE9tbCsONHvMT/sX2q1fRkx+62Bz/Vo+4MmxsA3tzsTlD7Tw0H7PLiHCKDnzOwOzTeOHACJN45sTqG3aNbTA+fQ+TuqIwCS28RPXQO0V6cKrkbc4i638rYJv6bfdH8pv2Z608/jqxMbpFptxgdrXzECxaTcrwz7PLnbg0ZPTG5uZ7uR3E6VH2TpPxl6NnyUY3hWXssezkGOZN4oO2nevTXRZI7xFZwjwO2+UmcQ2QrxGwE3NtNAnGQl1SXGA9mcid3FLN4YPXbgpm1x+kd9lk86P6b6Z9ku/9s83k0hyjT3UhHivT3ztwYIRojRfkdaXfgA+KBzmJ0T2gB1pqOb6LKSWxcFedH/UjS3XOIshEdNXeo/WL0JG+bcxk6jgf+LXPOHb496uTuigcurj1+DpGkDpzGg5YNV+DZnL574oGJL0ZubFDaBfN44P3mklHxoBzof+wcolmx+SdivB/D9YFrj77+9K/V9UE2kj/KfzKHKDRc66fpHCKfMXd8HJDN41ojGykyu3pzxZ2fH4CW2/B9EhGRh6xFtGQOUb1+rfi7BLfnEIk6Qw1YhyjRU/Xn9mNxyeTPCrMOkTJUk/LRAbnnzu3nHGTzX2/MIWp+u2MOUW8P1v6WR9YhYh2iXY9pT8ac1SO+vhWdkGqAXp71Y9Cj819cfZteqSs9Lh4kZlTxJnOiRnCTQGzQEuYQqXhgy4d1iLJ4YLF6dFyL8UAm8cD+xTpE/gB7Rco6RHlcG/HAxTWXuK3PrEPkHBT1VPvzW1mHSCRe2x3hrlPq9WtF5OX9x094VIeoLcoq8sn4Moi5NYcoP451iMz1YbxjovazyRS7tbupo+dziMz1rLslNPLv9MxunbX0QgBw+7EOkTXnR2j2E1rfx13EsA5RFxpkzuPBYBYPTNrNXVk8cO1xHHPcHm/Fg/a7zvY8HqjjvJ5esWxcGyfvbE6U06716BEaSfT4EZqertdxFA+0H7wfR0LZnVTWIWpbq0M5yOjP+m/H8UDMAaxDNJlD5BP29bh9G+Q7PaxD5LYxHhyOEPmRoUk5rpxDZOqZj+s+PGi7ZXO3yWILO6o9Npm/qOsQ3cVB5+n16y/G4qwP5MFziGbYZ4i3v1iH6ODZ2pZG1c8oV5PtmhuwetxXrEPUfDArfmsoVLnq0tjrRub9mh7oM2i39ol3pcdX21qDbycNSB+k8u/dq/RIoqfvq/TkBeisu3pRlZ49YbtVdT+VowToMtVbk4bTE/b1jp0x6q/sZa7d0DRZy/ZY86dxyNCU1SFTI0w8sNmex4Mgo29ZhyjsECu+OdrraP9GjGYdorHD+FN7/954kApwckbbERHWIVLNL1zvzNwnYs7P/dxi6oNrPy0H8wy6DB3I3e22+uSK1J2nJ5Xb12MTD6KOoKcqPXYHX+GNba0j6Knxt5hzZ8T5cRSh0hN3U9kbep7uOkTKT/fEkAew7LXbrUc4nllsPc7JHCIZPV7Zj9zYf2k90GrTZx0iL8BuWYfI3RGKFc4YYh0iX4/9iJs4/6mtKD+pPB4JYx2iln+1TQQXr6Ol/ybxQNmdtYc4QjDTL6Y9zuKBL8BaRz3uOkTVc9YhcnKsXdYhcqmwDpFrsDZ7s/OzGthPM/zQOUQty6xDpOKb6HrmGmD42HSU1I89m6o9/qKvQ3RE728cjBQ9hmUdouquPM9eh+iDIuXXv3X5+Fe+Xj4+ytc//HF98Qd/dH1x3Z+dGBU2mzOQKmsZDh9Zh8iX+0SLs2/rgd13pPaAOUTBY1t6JtjtBqvvmIfiSPR4Bzn71flRl6HWwTpE+zd11zNkdAGsQxRt6/YY4sG+r4lr03iQt0eV3V1eMbsFPToelOKOV3oMSo/Jvy0f1iHK7HuJ8/JhHSLZEmAdon69kbef4hO08UCUT9LTh4sHOq6Z3bJ4MNFTfYVhHaIsHrQ9n/I6RL6/sYplHaISenrnrUN0KVJ+/VvlZmdIRGTb55n83R9eP7dmi9l2x9Zbc4jaHJXjOUSsQ3RjDlE/zOnpX1v74xTizIQ7wGMOUT9MpRxHNJwecXp6PXjsHCLvR6cnmHN6WkUI2Po7q1asQxS+sF6c3Dnt5egKnHWIkvIxXzg9/QLGxzUXD3o61aQ3vxOc31NkHaK2ddkfDjINnnWI/K+7PdYh2mNvXo4hvnm5fbckHmg9k7g+OTyNBzquZednW69d/lzFZx2i92QdokeOLN1i2RyifgdhtNjjOUS9F1rNv3vWIZJS5Z7OUONXvi7TfVmHaP9rasamEHT0vKo5EMqPUbszNDKR2rfPpCd6jFbtA+sm6zClx/haF13t9lmHyAlXH7oelVX9b/ym9GQFYyrUSMDmzdbEkQOlR++bf5GbbWl4PzqXSGLX6Alf6cLI44HRo+uxy/Y8HijzfV+lx/nRVk+nZ5bB/p1NIezefaVspnFt2DeGXIJZe/R+NHqSeOAEJ/VYecPnsVfFWI9ZhyhpP75eaJvdf9aPh2gBrEN0oz0m5nt1rGNbqy1O1x6NnnkGVcYOrnP0dcHYXVfRw/Z4Tzzwp3u7fUA8UP7Miq3rqWNrf5MEJ9bZH2Wr9GTZ6/sOPU9hHaIpuj0sZNkIkb9FcOY6RNfrOjewDlGcQ2Twcwb2RhNvHDgBEu+cWB3D7tEtJtYhsnkLQffWHaiej5Lq124xOvqdQi9YTMrxzrDLn7s1ZPTE5OZ6uh/F6VD1TZLyF3cnSReg8ZNtj2UvxyBnEg+0/VSP/rpIcofYCu5xwDY/iXOIbIWYjYB7u0kgDvKS6hLjwUzu5I5iFg+sflsws/bIOkSTeCDW7j3xQGcxuie0AGtNxzdR5SQ2rorzo34kiXWIDuIB6xCZbRYPyoH+x84hmhUb6xDlca3x1tYhmvjzTVnXIRJbwU5fh+iRjIan5g5IrH/qCJVh+7GaA/MWWUXcHO6k5RiKOVZE3YkwCReXTP6sMOsQKUM1KR8dkHvu3H7OQTb/9cYcoua3O+YQ9fZg7W95ZB0i1iHa9Zj2ZMxZPeLrW9EJqQbo5Vk/Bj06/8XVt+mVutLj4kFiRhVvMidqBDcJxAYtYQ6Rige2fFiHKIsHFqtHx7UYD2QSD+xfrEPkD7BXpKxDlMe1EQ9cXHOJ2/rMOkTOQVFPtT+/k+sQzZJ7Q9bNIXJbkZPXIXpsPlsy2R1UEZF6aw5RO88dzyFqx7MOkQ8Abj/WIbLm/AjNfkLr+7iLGNYh6kKDzLLbjye0wSwemLSbu7J44NrjOOa4Pd6KB+13ne15PFDHeT29Ytm4Nk7e2Zwop13r0SM0kujxIzQ9Xa/jKB5oP3g/joSyO6msQ9S2VodykNGf9d+O44GYA1iHaDKHyCfs63H7Nsh3eliHyG1jPDgcIfIjQ5NyXDmHyNQzH9d9eNB2y+Zuk8UWdlR7bDKf8jpE0/r2hqybQyTicnnuOkSrYB0iZTc1Y1MIOrTdpqe6Z5SdXaPH+CyYUzqGfaOn+bgqPdX60VYXayhUuerS2OtG5v2aHugzaLf2iXelx1abTY/z7aQB6YNU/r17lR5J9PR9lZ68AJ11Vy+q0rMnbLeq7qdylABdpnpr0nB6wr7esTNG/ZW9zLUbmiZr2R5r/jQOGZqyOmRqhIkHNtvzeBBk9C3rEIUdYsU3R3sd7d+I0axDNHYYf2rv3xsPUgFOzmg7IsI6RKr5Vf/DzH0i5vzczy2mPrj203Iwz6DL0IHc3W6rT65I3Xl6Url9PTbxIOoIeqrSY3fwFd7Y1jqCnhp/izl3RpwfRxEqPXE3lb2h5ymvQyQip/SKls4h0j3xt7UO0Rtn299hFz+HSIYwEYl3VP2dB6uHdYisfdYhSsrn4IsxniJ5+feC9/l328kIVazHfsRNnP/UVpSfVB6PhLEOUcu/2iaCi9fR0n+TeKDsztpDHCGY6RfTHmfxwBdgraMedx2i6jnrEDk51i7rELlUWIfINVibvdn5WQ3spxl+6ByilmXWIVLxTXQ9cw0wfGw6SurHnk3VHp/yOkTt3KOr3woWPjJna+LZ6xA9llFhszkD6REtw+Ej6xDtenIhYhqZsm/rgd13pPaAOUTBY1t6JtjtBsczwl7HsBv0eAc5+9X5UZehfUaYdYhEWl5Zh2g7fhYPdB1qOvYS1fFg39fEtWk8yNujyu4ur5jdgh4dD0pxxys9BqXH5N+WD+sQZfa9xHn5sA6RbAmwDlG/3sjbT/EJ2nggyifp6cPFAx3XzG5ZPJjoqb7CsA5RFg/ank95HaIsEqxg6UsVRHT1OG8dojfKXzdbzLaXWL01h6jNUTmeQ8Q6RDfmEPXDnJ7+tbU/TiHOTLgDPOYQ9cNUynFEw+kRp6fXg8fOIfJ+dHqCOaenVYSArb+zasU6ROEL68XJndNejq7AWYcoKR/zhdPTL2B8XHPxoKdTTXrzO8H5PUXWIWpbl/3hINPgWYfI/7rbYx2iPfbm5Rjim5fbd0vigdYzieuTw9N4oONadn629drlz1V81iF6P9YhsirXsWwO0XhOfDwTeNY6RMvnELU81/Ycv/TtOKXGp5Sr0aG+aEM5yd32sa3dfp8zUNt3orbBgNrqr4b/u92mxxztVNT9r6kZm0LQ0fOq5kAoP0btztDIRGrfPpOe6DFatQ+sm6zDlB7ja110tdtnHSInXH3oelRW9b/xm9KTFYypUCMBmzdbE0cOlB69b/5Fbral4f3oXCKJXaMnfKULI48HRo+uxy7b83igzPd9lR7nR1s9nZ5ZBvt3NoWwe/eVspnGtWHfGHIJZu3R+9HoSeKBE5zUY+UNn8deFWM9Zh2ipP34eqFtdv9ZPx6iBbAO0Y32mJjv1bGOba22OF17NHrmGVQZO7jO0dcFY3ddRQ/b4z3xwJ/u7fYB8UD5Myu2rqeOrf1NEpxYZ3+UrdKTZa/vO/Q85XWIYn9jDctGiC6XSx097FrOXIdoJaxDFOcQGfycgb32xRsHToDEOydWh34L1PwWE+sQ2byFxn/rDlTPR0n1a7cYHf1OoRcsJuV4Z9jlz90aMnpicnM93Y/idKj6Jkn5y9Cz5aMaw7P2WPZyDHIm8UDbT/Xor4skd4it4B4HbPOTOIfIVojZCLi3mwTiIC+pLjEezORO7ihm8cDqtwUza4+sQzSJB2Lt3hMPdBaje0ILsNZ0fBNVTmLjqjg/6keSWIfoIB6wDpHZZvGgHOh/7ByiWbGxDlEe1xpvax2iSykil1L79dkilnWIth7u7sl6zxwiUWeowZuuQ/SzlyJ//X8X+Zu/H2rU1/Wn3/y2vPinf62++PhZfHLVK5vPIdIH5i2yirg53EnLsfk0x4qoOxEm4eKSyZ8VZh0iZSgpaROQe+7cfs5BNv/1xhyi5rc75hD19mDtb3lkHSLWIdr1mPZkzFk94utb0QmpBujlWT8GPTr/xdW36ZW60uPiQWJGFW8yJ2oENwnEBi1hDpGKB7Z8WIcoiwcWq0fHtRgPZBIP7F+sQ+QPsFekrEOUx7URD1xcc4nb+sw6RM5BUU+1P7+L6xD1cu/lsYaFb5lrmSr7tejbX4foxatZZyjyf/+hfFzkIv/8b1w/N8nWW3OI2nnueA5RO551iHwAcPuxDpE150do9hNa38ddxLAOURcaZJbdfjyhDWZ3UE3azV1ZPHDtcRxz3B5vxYP2u872PB6o47yeXrFsXBsn72xOlNOu9egRGkn0+BGanq7XcRQPtB+8H0dC2Z1U1iFqW6tDOcjoz/pvx/FAzAGsQzSZQ+QT9vW4fRvkOz2sQ+S2MR4cjhD5kaFJOa6cQ2TqmY/rPjxou2Vzt8liCzuqPTaZT3kdIrlc7IXbItatQ1TdP3n76xC9vt7XGWr8/h/Wj1mHSNlNzdgUgg5tt+mp7hllZ9foMT4L5pSOYd9Ws+q2zQeqkZkqYQ2FKlddGnvdyLxf0wN9Bu3WPvGu9Nhqs+lxvp00IH2Qyr93r9IjiZ6+r9KTF6Cz7upFVXr2hO1W1f1UjhKgy1RvTRpOT9jXO3bGqL+yl7l2Q9NkLdtjzZ/GIUNTVodMjTDxwGZ7Hg+CjL5lHaKwQ6z45mivo/0bMZp1iMYO40/t/XvjQSrAyRltR0RYh0g1v+p/mLlPxJyf+7nF1AfXfloO5hl0GTqQu9tt9ckVqTtPTyq3r8cmHkQdQU9VeuwOvsIb21pH0FPjbzHnzojz4yhCpSfuprI39DzpdYiyclzA2rfMqZ7ql7EO0S999Igs+zvs4ucQyehBi0i8o+rvPFg9rENk7bMOUVI+B1+M8RTJy78XvM+/205GqGI99iNu4vyntqL8pPJ4JIx1iFr+1TYRXLyOlv6bxANld9Ye4gjBTL+Y9jiLB74Aax31uOsQVc9Zh8jJsXZZh8ilwjpErsHa7M3Oz2pgP83wQ+cQtSyzDpGKb6LrmWuA4WPTUVI/9myq9vik1yFqabT8LmL5a7cb7+o6RB7WIXI/KwVV7LOtrEOUSKz1xhwi/Yww6xCJtLyyDtF2/Cwe6DrUdOwlquPBvq9uj/N4kLdHld1dXjG7BT06HpTijld6DEqPyb8tH9Yhyux7ifPyYR0i2RJgHaJ+vZG3n+ITtPFAlE/S04eLBzqumd2yeDDRU32FYR2iLB60PZ/yOkRnsXAOkblOF5F3cx2ikO2ki69HNliHqKXbsltt9uMtwG7fX+c1P9oEnZ7+tbU/TiHOTLgDPOYQ9cNUynFEw+kRp6fXg8fOIfJ+dHqCOaenVYRAqyujzlgd1r7veFXVHu02lqPOEOsQZXNuisvw+IN1iFp88XHNxYOeTjXpze8E5/cUWYeobV32h4NMg2cdIv/rbo91iPbYm5djiG9ebt8tiQdazySuTw5P44GOa9n52dZrlz9X8VmH6D1Zh8j5ZRXL5hCVvTfYtiKsQ5TdbR/b2u33OQO1fSdqGwyorf6q7iaV3abHHO1U1P2vqRmbQtDR86rmQCg/Ru3O0MhEat8+k57oMVq1D6ybrMOUHuNrXXS122cdIidcfeh6VFb1v/GbnjOQ6DEVaiRg82Zr4siB0qP3zb/IzbY0vB+dSySxa/SEr3Rh5PHA6NH12GV7Hg+U+b6v0uP8aKun0zPLYP/OphB2775SNtO4NuwbQy7BrD16Pxo9STxwgpN6rLzh89irYqzHrEOUtB9fL7TN7j/rx0O0ANYhutEeE/O9OtaxrdUWp2uPRs88gypjB9c5+rpg7K6r6GF7vCce+NO93T4gHih/ZsXW9dSxtb9JghPr7I+yVXqy7PV9h56nvA5R7G+s4bRH5liHaP9Uq7kTFO5ETe4gdDt6zoAkZe/8GO4Etf/UcMAuL84hMvg5A3ujiTcOnACJd06sDv0WqPktJtYhsnkLQffWHaiej5Lq124xOvqdQi9YTMrxzrDLn7s1ZPTE5OZ6uh/F6VD1TZLyl6Fny0c1hmftsezlGORM4oG2n+rRXxdJ7hBbwT0O2OYncQ6RrRBhpEjHN+O/PMPxjuRMv/VPrL55hczigdVvC2bWHlmHaBIPxNq9Jx7oLEb3hBZgren4JqqcxMZVcX7UjySxDtFBPGAdIrPN4kE50P/YOUSzYmMdojyuNd7WOkRnsbRDpCv2l7UO0UOJ7+cPe6gM24/VHJi3yCri5nAnLcdQzLEi6k6ESbi4ZPJnhVmHSBmqSfnogNxz5/ZzDrL5rzfmEDW/3TGHqLcHa3/LI+sQsQ7Rrse0J2PO6hFf34pOSDVAL8/6MejR+S+uvk2v1JUeFw8SM6p4kzlRI7hJIDZoCXOIVDyw5cM6RFk8sFg9Oq7FeCCTeGD/Yh0if4C9ImUdojyujXjg4ppL3NZn1iFyDop6qv35XVyHqO2ub7CuYFmHKLujdtY6RM8WDhP5ESKpt+YQtfPc8RyidjzrEPkA4PZjHSJrzo/Q7Ce0vo+7iGEdoi40yCy7/XhCG8zuoJq0m7uyeODa4zjmuD3eigftd53teTxQx3k9vWLZuDZO3tmcKKdd69EjNJLo8SM0PV2v4ygeaD94P46EsjuprEPUtlaHcpDRn/XfjuOBmANYh2gyh8gn7Otx+zbId3pYh8htYzw4HCHyI0OTclw5h8jUMx/XfXjQdsvmbpPFFnZUe2wyn/I6RDcGqh7NsjlE9tnKKiInrkNUq/zDH9cXq/Itsue51pEVmw1plz7bVunRvfL2Rd8ePFvb0qj6GeXaDlNuCAbUNn7FOkTNB6qRmYpnDYUqV10ae93IvF/TA30G7dY+8a702Gqz6XG+nTQgfZDKv3ev0iOJnr6v0pMXoLPu6kVVevaE7VbV/VSOEqDLVG9NGk5P2Nc7dsaovyJVRn22mqxle6z50zhkaMrqkKkRJh7YbM/jQZDRt6xDFHaIFd8c7XW0fyNGsw7R2GH8qb1/bzxIBTg5o+2ICOsQqeZX/Q8z94mY83M/t5j64NpPy8E8gy5DB3J3u60+uSJ15+lJ5fb12MSDqCPoqUqP3cFXeGNb6wh6avwt5twZcX4cRaj0xN1U9oaep7wOURaPV7BwhMjeOT1zHaJapf7BH9UXIkV+5evy8Zvme9u2XPg5RDJ60Eqf/treebB6WIfI2mcdoqR8Dr4Y4ymSl38veJ9/t52MUMV67EfcxPlPbUX5SeXxSBjrELX8q20iuHgdLf03iQfK7qw9xBGCmX4x7XEWD3wB1jrqcdchqp6zDpGTY+2yDpFLhXWIXIO12Zudn9XAfprhh84hallmHSIV30TXM9cAw8emo6R+7NlU7fEpr0Pk+xurWDeHqI6nL6vcM4eoypusQ3R9LfXv/vD1iz/4o/LitXntXPn6w7J9q3fZMxw+sg5R818qREwjU/ZtPbD7jtQeMIcoeGxLzwS73eCopV6HqNrr9HgHOfvV+VGXodbBOkT7N3XXM2R0AaxDFG3r9hjiwb6vbo/zeJC3R5XdXV4xuwU9Oh6U4o5XegxKj8m/LR/WIcrse4nz8mEdItkSYB2ifr2Rt5/iE7TxQJRP0tOHiwc6rpndsngw0VN9hWEdoiwetD2f9DpENW/Pb8rSESJ9oS5y8jpEpUqtpb6WcR30AHfafItIT6HemkPU5qgczyFiHaIbc4hUORo9/Wtrf5xCnJlwB3iUTVedAAAgAElEQVTMIeqHqZTjiIbTI05PrwePnUPk/ej0BHNOT6sIgVZXRp2xOqx93/Gqqj3abSxHnSHWIcrm3BSX4fEH6xC1+OLjmosHPZ1q0pvfCc7vKbIOUdu67A8HmQbPOkT+190e6xDtsTcvxxDfvNy+WxIPtJ5JXJ8cnsYDHdey87Ot1y5/ruKzDtH7sQ5R7G+sYd0cov0/447+uesQteceZT+0bx+a793ulkZ7jl/6dpxS41PKtf9n33YnjAzpn+22dvt9zkBt34naBgNqq79qvlB2mx5ztFNhyiwzY1MIOnpem++q+jvT7gyNTKT27TPpiR6jVfvAusk6TOkxvtZFV7t91iFywtWHrkdlVf8bv+lnfRM9pkKNBGzebE0cOVB69L75F7nZlob3o3OJJHaNnvCVLow8Hhg9uh67bM/jgTLf91V6nB9t9XR6Zhns39kUwu7dV8pmGteGfWPIJZi1R+9HoyeJB05wUo+VN3wee1WM9Zh1iJL24+uFttn9Z/14iBbAOkQ32mNivlfHOra12uJ07dHomWdQZezgOkdfF4zddRU9bI/3xAN/urfbB8QD5c+s2LqeOrb2N0lwYp39UbZKT5a9vu/Q85TXIfJ+W8WyEaJ+R0pUD7EczCEKPe49nX2Pm+sQuQ5rlcd1FFmHKM4hMvg5A3ujiTcOnACJd06sjmH36BYT6xDZvIWge+sOVM9HSfVrtxgd/U6hFywm5Xhn2OXP3RoyemJycz3dj+J0qPomSfnL0LPloxrDs/ZY9nIMcibxQNtP9eiviyR3iK3gHgds85M4h8hWiDBSpOOb8V+e4XhHcqbf+idW37xCZvHA6rcFM2uPrEM0iQdi7d4TD3QWo3tCC7DWdHwTVU5i46o4P+pHkliH6CAesA6R2WbxoBzof+wcolmxsQ5RHtcab2sdIt/fWMWyDpEPzKevQ+QcLxLr0H35Tp5Nt3uoDNuP1RyYt8gq4uZwJy3H4PXEO3nbh+KSyZ8VZh0iZagm5aMDcs+d2885yOa/3phD1Px2xxyi3h6s/S2PrEPEOkS7HtOejDmrR3x9Kzoh1QC9POvHoEfnv7j6Nr1SV3pcPEjMqOJN5kSN4CaB2KAlzCFS8cCWD+sQZfHAYvXouBbjgUzigf2LdYj8AfaKlHWI8rg24oGLay5xW59Zh8g5KOqp9ud3cR2iewaXH8PShVlNwcl56xBt292Qu558cJbdCJHUW3OI2nnueA5RO551iHwAcPuxDpE150do9hNa38ddxLAOURcaZJbdfjyhDWZ3UE3azV1ZPHDtcRxz3B5vxYP2u872PB6o47yeXrFsXBsn72xOlNOu9egRGkn0+BGanq7XcRQPtB+8H0dC2Z1U1iFqW6tDOcjoz/pvx/FAzAGsQzSZQ+QT9vW4fRvkOz2sQ+S2MR4cjhD5kaFJOa6cQ2TqmY/rPjxou2Vzt8liCzuqPTaZT3kdop7W4o7RsjlEsUWcuA6R1P2R4O3Y1iF+jFNZh0jZTc3YFIIObbfpqe4ZZWfX6DE+C+aUjmHf6Gk+rkpPtX60Fc8aClWuujT2upF5v6YH+gzarX3iXenx9bjW4NtJA9IHqfx79yo9kujp+yo9eQE6665eVKVnT9huVd1P5SgBukz11qTh9IR9vWNnjPore5lrNzRN1rI91vxpHDI0ZXXI1AgTD2y25/EgyOhb1iEKO8SKb472Otq/EaNZh2jsMP7U3r83HqQCnJzRdkSEdYhU86v+h5n7RMz5uZ9bTH1w7aflYJ5Bl6EDubvdVp9ckbrz9KRy+3ps4kHUEfRUpcfu4Cu8sa11BD01/hZz7ow4P44iVHribip7Q89TXofI9DfSOxGPY+0IkeLMdYg00wGKO2EdojiHyOx+a8TL21UCwp2bpkP7MdyBcfL8nAEnP96BcneEYoUzhliHyNdjP+Imzn9qK8pPKo9HwliHqOVfbRPBxeto6b9JPFB2Z+0hjhDM9Itpj7N44Auw1lGPuw5R9Zx1iJwca5d1iFwqrEPkGqzN3uz8rAb20ww/dA5RyzLrEKn4JrqeuQYYPjYdJfVjz6Zqj095HaKzWNghsjXx7HWIRDv+TXJ98y5Vz3D4yDpEzX+pEDGNTNm39cDuO1J7wByi4LEtPRPsdoPjGWGvY9gNeryDnP3q/KjL0D4jzDpEIi2vrEO0HT+LB7oONR17iep4sO+r2+M8HuTtUWV3l1fMbkGPjgeluOOVHoPSY/Jvy4d1iDL7XuK8fFiHSLYEWIeoX2/k7af4BG08EOWT9PTh4oGOa2a3LB5M9FRfYViHKIsHbc8nvQ5RWthvztIRIl1uIuevQyRS2v+lisiLV+kVzHGeky6+HtlgHaKWbstutdmfDdHpC3XR7WFejvZra3+cQpyZcAd4zCHqh6mU44iG0yNOT68Hj51D5P3o9ARzTk+rCIFWV0adsTqsfd/xqqo92m0sR50h1iHK5twUl+HxB+sQtfji45qLBz2datKb3wnO7ymyDlHbuuwPB5kGzzpE/tfdHusQ7bE3L8cQ37zcvlsSD7SeSVyfHJ7GAx3XsvOzrdcuf67isw7R+7EOUUsytLs3ZNkcolLEiX/76xBdROQ3vy0v7s3zb327vGAdov2vqRmbQtDR86rmQCg/Ru3O0MhEat8+k57oMVq1D6ybrMOUHuNrXXS122cdIidcfeh6VFb1v/GbnjOQ6DEVaiRg82Zr4siB0qP3zb/IzbY0vB+dSySxa/SEr3Rh5PHA6NH12GV7Hg+U+b6v0uP8aKun0zPLYP/OphB2775SNtO4NuwbQy7BrD16Pxo9STxwgpN6rLzh89irYqzHrEOUtB9fL7TN7j/rx0O0ANYhutEeE/O9OtaxrdUWp2uPRs88gypjB9c5+rpg7K6r6GF7vCce+NO93T4gHih/ZsXW9dSxtb9JghPr7I+yVXqy7PV9h56nvA5R7G+sYf0cotZz3HP7Ntch+ugDqX/21+qLIhf5/T+sHx9l87e+XV782V+7vmAdojiHyODnDOyNJt44cAIk3jmxOvRboIrP1khjcofdGFHbcEdlFFh6i4h1iGZ3oNrWCxaTcrwz7PLnbg0ZPTG5uZ7uR3E6VH2TpPxl6NnyUY3hWXs0Adc4LI8H2n6qR39dJLlDbAX3OGCbn8Q5RLZChJEiHd+M//IMxzuSM/3WP7H65hUyiwdWvy2YWXtkHaJJPBBr9554oLMY3RNagLWm45uochIbV8X5UT+SxDpEB/GAdYjMNosH5UD/Y+cQzYqNdYjyuNZ4W+sQhfQWsXAdItvh+bLWIfrkWa1/7tdev/inviMvPvlAXW+1E2QVefFaykWu8tEHpbIOkdo35rzvEHW04ptEIqXF3+E29nrCxVl9wBwid2Wwn4pt0cQCC4eb8tH7OQfZ/Ncbc4ia3+6YQ9Tbg7W/5ZF1iFiHaNdj2pMxZ/WIr29FJ6QaoJdn/Rj06PwXV9+mV+pKj4sHiRlVvMmcqBHcJBAbtIQ5RCoe2PJhHaIsHlisHh3XYjyQSTywf7EOkT/AXpGyDlEe10Y8cHHNJW7rM+sQOQdFPdX+/G6uQ2TPq6tY1iF6pp6G3qvgl7IOUa1FPvxA6oehAg9zW0ep7J+LSVbqrTlE7Tx3PIeoHc86RD4AuP1Yh8ia8yM0+wmt7+MuYliHqAsNMls8iCe0wewOqkm7uSuLB649jmOO2+OteNB+19mexwN1nNfTK5aNa+Pknc2Jctq1Hj1CI4keP0LT0/U6juKB9oP340gou5PKOkRta3UoBxn9Wf/tOB6IOYB1iCZziHzCvh63b4N8p4d1iNw2xoPDESI/MjQpx5VziEw983Hdhwdtt2zuNllsYUe1xybzKa9DtI08xdbzpiybQxSeFZUvax2i8MXMcs+3yP48c9cwsjSOns9Z6B8S+z4HY1uV39pzsNVku+YGrB73FesQNR/Mit8aClWuujT2upF5v6YH+gzarX3iXenx1bbW4NtJA9IHqfx79yo9kujp+yo9eQE6665eVKVnT9huVd1P5SgBukz11qTh9IR9vWNnjPore5lrNzRN1rI91vxpHDI0ZXXI1AgTD2y25/EgyOhb1iEKO8SKb472Otq/EaNZh2jsMP7U3r83HqQCnJzRdkSEdYhU8wvXOzP3iZjzcz+3mPrg2k/LwTyDLkMHcne7rT65InXn6Unl9vXYxIOoI+ipSo/dwVd4Y1vrCHpq/C3m3BlxfhxFqPTE3VT2hp6nvA5R7G+sYdkIUbmMO3MXkfplrUOk7wT1nmd666Ydb+8AsQ7RwR2oIjfnELEOUdSw7Sj5HShxf7gvxniK5OXfC97n320nI1SxHvsRN3H+U1tRflJ5PBLGOkQt/2qbCC5eR0v/TeKBsjtrD3GEYKZfTHucxQNfgLWOetx1iKrnrEPk5Fi7rEPkUmEdItdgbfZm52c1sJ9m+KFziFqWWYdIxTfR9cw1wPCx6SipH3s2VXt8yusQXS6Xqst1FeteqlDH05dV1HvIZTaHqMo56xDFO17bvioAF5F8zkAqrGU4fGQdol1PLkRMI1P2bT2w+47UHjCHKHhsS8+U/25w1FKvY9gNekKFsvar86MuQ62DdYj2b+quZ8joAliHKNrW7THEg31fE9em8SBvjyq7u7xidgt6dDwoxR2v9BiUHpN/Wz6sQ5TZ9xLn5cM6RLIlwDpE/Xojbz/FJ2jjgSifpKcPFw90XDO7ZfFgoqf6CsM6RFk8aHs+6XWIXH9jFetGiMKtoLe/DtFWbuEL0ZV2PqKx71dvzSFqc1SO5xCxDtGNOURJOdqvrf1xCnFmwh3gMYeoH6ZSjiMaTo84Pb0ePHYOkfej0xPMOT2tIgRs/Z1VK9YhyuKBMj+5c9rL0RU46xAl5WO+cHr6BYyPay4e9HSqSW9+Jzg/DbIOUdu67A8HmQbPOkT+190e6xDtsTcvxxDfvNy+WxIPtJ5JXJ8cnsYDHdey87Ot1y5/ruKzDtH7sQ7RfO76m7FwDpGI1LEVefvrEPVnEfu2OmNZvrf9tjTac4nSt+OUGp9Srv0/+9bYrT09v5tJo6o5A7V9p3waDVg9xo9Kjyg95minou5/Tc3YFIKOnlf1TKfyY9TuDJkyi/btM+mJHqNV+8C6yTpM6TG+1kVXu33WIXLC1YeuR2VV/xu/KT1ZwZgKNRKwebM1ceRA6dH75l/kZlsa3o/OJZLYNXrCV7ow8nhg9Oh67LI9jwfKfN9X6XF+tNXT6ZllsH9nUwi7d18pm2lcG/aNIZdg1h69H42eJB44wUk9Vt7weexVMdZj1iFK2o+vF9pm95/14yFaAOsQ3WiPifleHevY1mqL07VHo2eeQZWxg+scfV0wdtdV9LA93hMP/Onebh8QD5Q/s2LreurY2t8kwYl19kfZKj1Z9vq+Q89TXofIX3atYt0I0f6fdufjy1iHyNzhuLPnyTpEcQ6Rwc8Z2B0abxw4ARLvnFgdw+7RLSbWIbJ5C/X51h2ono+S6tduMTr6nUIvWEzK8c6wy5+7NWT0xOTmerofxelQ9U2S8pehZ8tHNYZn7bHs5RjkTOKBtp/q0V8XSe4QW8E9DtjmJ3EOka0QsxFwbzcJxEFeUl1iPJjJndxRzOKB1W8LZtYeWYdoEg/E2r0nHugsRveEFmCt6fgmqpzExlVxftSPJLEO0UE8YB0is83iQTnQ/9g5RLNiYx2iPK413tY6RCaZhx16yLo5RE7ol7UOkejevUm69O/ahUT+fn6PzrD9WM2BeYusIm4Od9JyDImeqj+3H4tLJn9WmHWIlKGalI8OyD13bj/nIJv/emMOUfPbHXOIenuw9rc8sg4R6xDtekx7MuasHvH1reiEVAP08qwfgx6d/+Lq2/RKXelx8SAxo4o3mRM1gpsEYoOWMIdIxQNbPqxDlMUDi9Wj41qMBzKJB/Yv1iHyB6h8sg5RaI8xHri45hK39Zl1iJyDop5qf34X1yHqbn/AIfewrkMUuDWHqG2tohXrEOUV2JqbvZ9f6q05RO08dzyHqB3POkQ+ALj9WIfImvMjNPsJre/jLmJYh6gLDTLn8WAwiwcm7eauLB649jiOOW6Pt+JB+11nex4P1HFeT69YNq6Nk3c2J8pp13r0CI0kevwITU/X6ziKB9oP3o8joexOKusQta3VoRxk9Gf9t+N4IOYA1iGazCHyCft63L4N8p0e1iFy2xgPDkeI/MjQpBxXziEy9czHdR8etN2yudtksYUd1R6bzKe8DtFZLJtDFGEdouxu+9jWbn88B1tNtmtuwOpxX7EOUfPBrPitoVDlqktjrxuZ92t6oM+g3don3pUeX21rDb6dNCB9kMq/d6/SI4mevq/Skxegs+7qRVV69oTtVtX9VI4SoMtUb00aTk/Y1zt2xqi/spe5dkPTZC3bY82fxiFDU1aHTI0w8cBmex4Pgoy+ZR2isEOs+OZor6P9GzGadYjGDuNP7f1740EqwMkZbUdEWIdINb9wvTNzn4g5P/dzi6kPrv20HMwz6DJ0IHe32+qTK1J3np5Ubl+PTTyIOoKeqvTYHXyFN7a1jqCnxt9izp0R58dRhEpP3E1lb+h5yusQncXaESLVU2UdonYHo/aev/3V9uD9HYRuPtxh9wLslnWI3B2hWOGMIdYh8vXYj7iJ85/aivKTyuORMNYhavlX20Rw8Tpa+m8SD5TdWXuIIwQz/WLa4ywe+AKsddTjrkNUPWcdIifH2mUdIpcK6xC5BmuzNzs/q4H9NMMPnUPUssw6RCq+ia5nrgGGj01HSf3Ys6na41Neh6inceP6/qGc9sgc6xCpbOrrr9hiHImeZrrqhFsgTp6p1Ue3s2d3iG65ovLvt1uK+tlW1iFKJNZ6Yw6RfkaYdYhEWl5Zh2g7fhYPdB1qOvYS1fFg39fEtWk8yNujyu4ur5jdgh4dD0pxxys9BqXH5N+WD+sQZfa9xHn5sA6RbAmwDlG/3sjbT/EJ2nggyifp6cPFAx3XzG5ZPJjoqb7CsA5RFg/ank96HaKTWPpShb2+7a5iHaJta5rs9M7pyLCEC1zr56Hb6BC7bQn4KnY0h8jsPHumtoUgZz9cPOoLddHtYV6O9mtrf5xCnJlwB3jMIeqHqZTjiIbTI05PrwePnUPk/ej0BHNOT6sIAVt/Z9WKdYiyeKDMT+6c9nJ0Bc46REn5mC+cnn4B4+Oaiwc9nWrSm98Jzu8psg5R27rsDweZBs86RP7X3R7rEO2xNy/HEN+83L5bEg+0nklcnxyexgMd17Lzs63XLn+u4rMO0fuxDpE4v6xi3Ryi9iygeiaQdYiOns+u3X6fM1Dbd6K2wYDVY/yo9IjSY452Kur+19SMTSHo6Hltvqvq70y7M2TKLNq3z6QneoxW7QPrJuswpcf4Whdd7fZZh8gJVx+6HpVV/W/8pvRkBWMq1EjA5s3WxJEDpUfvm3+Rm21peD86l0hi1+gJX+nCyOOB0aPrscv2PB4o831fpcf50VZPp2eWwf6dTSHs3n2lbKZxbdg3hlyCWXv0fjR6knjgBCf1WHnD57FXxViPWYcoaT++Xmib3X/Wj4doAaxDdKM9JuZ7daxjW6stTtcejZ55BlXGDq5z9HXB2F1X0cP2eE888Kd7u31APFD+zIqt66lja3+TBCfW2R9lq/Rk2ev7Dj1PeR0ie530sEOPWLcOkes5sw7R/qlWcydo7G578FM96s6wuQHgzc3uBLX/1HDALi/OITL4OQO7Q+ONAydA4p0Tq2PYPbrFxDpENm+hPt+6A9XzUVL92i1GR79T6AWLSTneGXb5c7eGjJ6Y3FxP96M4Haq+SVL+MvRs+ajG8Kw9lr0cg5xJPND2Uz366yLJHWIruMcB2/wkziGyFWI2Au7tJoE4yEuqS4wHM7mTO4pZPLD6bcHM2iPrEE3igVi798QDncXontACrDUd30SVk9i4Ks6P+pEk1iE6iAesQ2S2WTwoB/ofO4doVmysQ5THtcZbW4do1iDfkGUdIvssvnqGUGZziESdoQasQ5Toqfpz+7G4ZPJnhVmHSBmqSfnogNxz5/ZzDrL5rzfmEDW/3TGHqLcHa3/LI+sQsQ7Rrse0J2PO6hFf34pOSDVAL8/6MejR+S+uvk2v1JUeFw8SM6p4kzlRI7hJIDZoCXOIVDyw5cM6RFk8sFg9Oq7FeCCTeGD/Yh0if4C9ImUdojyujXjg4ppL3NZn1iFyDop6qv35XVyHyPc3VrGsQ3Rpd1Jkv8AT1iGSInFEpetwesTp6QHAF/bYzyZT7Nbupo6ezyEy17PultDIv9Mz7anfmEPUYB0ia86P0OgGbwKKq7+TasU6RFk8GMzigUm7uSuLB649jmOO2+OteNB+19mexwN1nNfTK5aNa+Pknc2Jctq1Hj1CI4keP0LT0/U6juKB9oP340gou5PKOkRta3UoBxn9Wf/tOB6IOYB1iCZziHzCvh63b4N8p4d1iNw2xoPDESI/MjQpx5VziEw983Hdhwdtt2zuNllsYUe1xybzKa9DFPsba1g2h6jW/Z80caxDlN1tH9va7Y/nYKvJds0NWD3uK9Yhaj6YFb81FKpcdWnsdSPzfk0P9Bm0W/vEu9Ljq22twbeTBqQPUvn37lV6JNHT91V68gJ01l29qErPnrDdqrqfylECdJnqrUnD6Qn7esfOGPVX9jLXbmiarGV7rPnTOGRoyuqQqREmHthsz+NBkNG3rEMUdogV3xztdbR/I0azDtHYYfypvX9vPEgFODmj7YgI6xCp5heud2buEzHn535uMfXBtZ+Wg3kGXYYO5O52W31yRerO05PK7euxiQdRR9BTlR67g6/wxrbWEfTU+FvMuTPi/DiKUOmJu6nsDT1PeR2i2A7XsPS127qjyjpE7Q5G7T1/+6vtwfs7CN18uMPuBdgt6xC5O0KxwhlDrEPk67EfcRPnP7UV5SeVxyNhrEPU8q+2ieDidbT03yQeKLuz9hBHCGb6xbTHWTzwBVjrqMddh6h6zjpETo61yzpELhXWIXIN1mZvdn5WA/tphh86h6hlmXWIVHwTXc9cAwwfm46S+rFnU7XHp74OkS7HVax7qYK7UP4nflVeuD2kxuc9Jizs8j2KL9v+Sh6i5d59f5H8I/KLpecXSQvcB2X+tKC8nxaU99Oi3n2V/8xvJx2Vu3HHt/S8nXuPv5WPx2bX9zdWse612yKPVwcAAAAAAHCLE/ob6zpEbeS00B8CAAAAAIDFnNTfWNYhYnAIAAAAAADO4qz+xtpH5gAAAAAAAN4jzplDBAAAAAAAsJoT+hsLO0TqBeO8FQUAAAAAAJZyTn9j3Wu3L5f+5vTt9dp0igAAAAAAYBGlSCnl/veT38myDlFVK2DetQI1AAAAAADAnej+xkrWjRC5FeEZIQIAAAAAgFWUUuRSdH9jDevmEPVH+ipdIQAAAAAAWMtJ/Y2Fc4jaH0XKyC4AAAAAAMAbc3lWtg5GeWfnEJ3xRB8AAAAAAMB5/Y11I0RuCwAAAAAAsIqz+hsszAoAAAAAAO8H7/TCrEX12ugYAQAAAADASlR/Y2XHaO0IkQijRAAAAAAAcB5lbZdjWYeIOUQAAAAAAHAWZ/U3lr1UgdfLAQAAAADAaZzU31j6yFybO8QcIgAAAAAAWM0Z/Y2FI0T7irEsyQoAAAAAAKs5qb+xbh2iS+uutW/oFgEAAAAAwBpif2MNyx6Zq3XrqrUtAAAAAADAKs7qbywbIdo6bHXvsNEjAgAAAACAdZzV31jWIaq1brObahVevg0AAAAAACs5q7+x7qUKpa2QtHilJAAAAAAAgJP6G0tfu91HrnhiDgAAAAAAVnNCf2NthwgAAAAAAOA9gg4RAAAAAAA8WZZ2iM5YORYAAAAAAEDknP7Gsg4RnSEAAAAAADiLs/obPDIHAAAAAABPlpWv3a5F9hc+1Mo4EQAAAAAALKWUUle/0HpZh6i4LQAAAAAAwCrK5O83Zdkjc7VWqWoLAAAAAACwit7PWNzfWDdCdClyEZFrKSLLB7IAAAAAAOApUy5FLmXvbyxk6QjRtW5bhogAAAAAAGAlZ/U3lo0QPVOziHhoDgAAAAAAVnKRsvc41o4QLesQXatseaMvBAAAAAAAi6lVpL/W+l1cmFXKnljhTXMAAAAAALCWUkbnZeViqsvS0pkrpTBOBAAAAAAAy2h9jMvi0ZeVnSsAAAAAAID3imUdoqvbAgAAAAAArOKs/sbaR+bUPCIAAAAAAIBVnNXf4JE5AAAAAAB4six9y5zZAgAAAAAArOKk/saydYikshARAAAAAACcxN7fuEpd+pjbsg5RKb7LRscIAAAAAADW0PobzxYPES3rENVat9WSKh0hAAAAAABYy1n9jYUjRCKl1G1ciHlEAAAAAACwkLP6G0vfMrd11ipPywEAAAAAwHLO6G8sHSHa/1qVJAAAAAAAgIic199YOIdoVUoAAAAAAACWs/obSx+Za722wiARAAAAAAAs5oz+xrIOEZ0hAAAAAAA4i7P6G0tHiAAAAAAAAN4nls0hkrpNb9rWjwUAAAAAAFjISf2NdY/MuS0AAAAAAMAqzupvrHvLXCm1d9mk0i8CAAAAAIBlVBGRy74y67v4UgUpe74Ko0QAAAAAALCYk/obC+cQbZ21uv8NAAAAAACwDN3fWMiyDlHZ3383emt0igAAAAAAYA2lFJFS3uE5RLVuLwVndAgAAAAAABZj+xvrukXLOkSXsj3MV6VIYXQIAAAAAAAWcrmo/sbCYaJ1I0RS95fLVQaJAAAAAABgKbWNDNUq9V0cISpFvRm8SGUOEQAAAAAArKJcLlsHY+XwkCydQ3TOyrEAAAAAAABn9TeWrUPEGkQAAAAAAHAWZ/U31i3MqqFXBAAAAAAAZ7Gwv7GuQ1TcFgAAAAAAYBUn9TeWPjJHnwgAAAAAAM7grP7G8kfm6AwBAAAAAMBZrO5vLHvLHK/ZBgAAAACA8zinv/tIxwAAACAASURBVLF2hIhn5gAAAAAA4CTKCf2NhR2ithYra7ICAAAAAMBqqtQT+hsLO0QMDwEAAAAAwFmc099YNoeo1rZm7Oq1YwEAAAAA4KlzVn9jWYeolLJnr9AdAgAAAACApZzV31j6UoXqtgAAAAAAAKs445UFy9chAgAAAAAAOI3Fj6PRIQIAAAAAgPeCM6bmLOsQFeE9cwAAAAAAcA5l8vebsnxh1rJvAQAAAAAAlnJCf2Ndh4hOEAAAAAAAnMVJ/Y2lI0Stt0bfCAAAAAAAVnNGf2PpHCK9BQAAAAAAWMVZ/Y1lC7PalWMBAAAAAADWcVZ/Y1mH6HK51FJEai0iUgsdIwAAAAAAWEUpRS6XUmstUhYOEy3rEEmtUreN0BkCAAAAAICl1Cq1ln2kaB3LOkTlsnXTtlEiETpFAAAAAACwinLZRobKyuEhWTqHqP8lizttAAAAAADwxNH9jZWvVlj3yFxpU5yKFEaHAAAAAABgJWV/Gk3K0jfNLZxDNB6SY4QIAAAAAACWovsbC5NdujArixEBAAAAAMBpnNDfWNohKrUlWhgjAgAAAACAZZRSautlrOxtLOsQMTgEAAAAAABncVZ/Y90cIl6kAAAAAAAAp3FOf2PtHCIAAAAAAID3iHUdov01eCJjCwAAAAAAsIST+hvr5xDRGQIAAAAAgMWc1d9YNoeosvgQAAAAAACcxFn9jWUdohK6anSQAAAAAABgDbG/sYZ1c4haj42RIgAAAAAAWM1J/Y11I0QX9WZw5hEBAAAAAMBCzupvLJ5DVESkilR6RAAAAAAAsI6z+htL5xBt2aMzBAAAAAAAazmrv7GsQySV1ygAAAAAAMBJnNTfWPdSBRHmDgEAAAAAwHmc0N9YN4dIf6BjBAAAAAAACzmrv7FuhKi97IGXzAEAAAAAwGpO6m8s6xAVtwUAAAAAAFjFWf2NtXOIAAAAAAAA3iPWvXZbSn+sr1YWIgIAAAAAgIVUkVLK8hfNLR0hKsVuAQAAAAAAVnFGf2Nhh6hKrXoLAAAAAACwinP6G+semSt6mhM9IgAAAAAAWEcpZR8ZWvs42rIRolq3pWPbFgAAAAAAYBVn9TeWjRBd9hGiIkUqPSIAAAAAAFjIZR8hKotHiJZ1iGqV/rQc3SEAAAAAAFiJ7m+s7BOte6mCWjkWAAAAAABgKSf1N5aNEOlxoUthkAgAAAAAANZRyngWbWWfaNkIUXFbAAAAAACAVZzV31i6MCsAAAAAAMD7xNIO0RkrxwIAAAAAAIic099YN4eobE/0MXkIAAAAAACWc1J/Y/kjc4wOAQAAAADAWazubyxch0i/GBwAAAAAAGAdZ/U3lnWISil79trasXSMAAAAAABgDbG/sYZ1c4hqlVrKtl2WKAAAAAAAgPT+xjZStI6lI0R96dgiwggRAAAAAACsovU3Su9vrGHdHCL9n8qbFQAAAAAAYB1n9TfWjRCJnPJMHwAAAAAAQHs99js8h2g8JMfDcgAAAAAAsBI9dWhlf2PtOkQMDQEAAAAAwFmc0N9Y1yHS71SgYwQAAAAAACs5qb+xrENU3BYAAAAAAGAVZ/U31j4yBwAAAAAA8B5BhwgAAAAAAJ4sKxdmraW0tz+wEBEAAAAAAKzlcim11rWPzTGHCAAAAAAA3nnaixRK/88alo0QVbUQUa2sRAQAAAAAAOuoJy1EtG5h1vDuOzpFAAAAAACwiHLO+j7LHpmrdRshalsAAAAAAIBVnNXfWDZCdCkiUqqUuj8+BwAAAAAAsIhLESmXrb+xske0bg5RrSKyvWaO7hAAAAAAAKxkGxnaX2u98NG5da/dvuj3zNElAgAAAACAdZRL2ftB5d18y1x/w5z6GwAAAAAAYAmqv1EW9jeWvVShwTpEAAAAAABwFqv7G8s7RCIipazsswEAAAAAwFPnrD7G2g5RcVsAAAAAAIBVnNDPWPdSBZExd4jxIQAAAAAAWIjpbyzklEfmAAAAAAAA3gfoEAEAAAAAwJOFDhEAAAAAALwXnPGqgnUdolrtFgAAAAAAYBW17mueru1vrHupwkW9Yo63zAEAAAAAwELO6m8s6xDVWmXLWRWp9IgAAAAAAGAdZ/U3lnWIpJQ9e4UBIgAAAAAAWMtJ/Y11HaLKMkQAAAAAAHASJ/U31r5lrrgtAAAAAADAKk7ob/DabQAAAAAAeLKs6xAVBogAAAAAAOAkTupvLOsQ9czRGwIAAAAAgMWc1d/gkTkAAAAAAHiyrFuYtZT+sodaWYgIAAAAAADWovscq1g6QtSGr3hsDgAAAAAAVnNGf2Nhh6hKrW3LSkQAAAAAALCSc/obKx+Za3/tWzpFAAAAAACwhlLKPjK09nG0ZR0i3UtjhAgAAAAAAFay9TGKrB54WTdCJCN7TCECAAAAAICVFBG5SF3e31g3h6jufbVaeVgOAAAAAADWclJ/Y90IUe9arR/GAgAAAACAp025yJhDtHCIaOEcovxvAAAAAACAN8X0MRb2N9auQ+S2AAAAAAAAK2jvLBBZ299YNkIkMjpqDBABAAAAAMBKThogWjtCxBARAAAAAACcxgn9jLUdop1SCoNEAAAAAACwDNPHWNgxWtchKgwQAQAAAADAOZST+hvLOkQ9c/SGAAAAAADgJFb3N055ZA4AAAAAAOB9YOE6RJUlWQEAAAAA4BTO6m8s6xBd2kN9tT0+R9cIAAAAAADWEPsbi9JdlVCVuq8eW+kKAQAAAADAUs7qbywbISqFd8wBAAAAAMA5nNXfWDyHqOz9NTpFAAAAAACwjrP6G2vnEImISKE7BAAAAAAASzmrv7FuDlHdX6NQeZ0CAAAAAACsxfQ3FnY4WIcIAAAAAADeLxYOES3tEJVqtwAAAAAAAKs4o7+xrEPEO+YAAAAAAOAszupvLHupgpTRT6u10i8CAAAAAIBlVBEpZf2zaMwhAgAAAACA94MThl3WjRBJlVK2Nz4U3jMHAAAAAABLqVJElq96es4cIh6YAwAAAACAhZTphzdj3TpEUvd3g9el7wUHAAAAAAAY/Yy1/Y1lj8yVoseI6BEBAAAAAMA6SilSTngcbd0I0b50bO1LyAIAAAAAAKzhrP7GshGiyz5CVKRIpUcEAAAAAAALuewjRGXxCNGyDlFVf9AdAgAAAACAlej+xjv5UoUOb5gDAAAAAICzWNzfWNohKm4LAAAAAACwijP6G+esQwQAAAAAALCQs/ob6x+ZE5FSCtOIAAAAAABgGWf1MdZ2iBgmAgAAAACAszihv8EcIgAAAAAAeC94t+cQFbsFAAAAAABYxVn9jXXrENX2QnCmDwEAAAAAwFrO6m8s6xDFASw6RgAAAAAAsIpzJugsHSEqUqRKZQ4RAAAAAAAs5az+xrIO0aUUkSJSatk7bYwQAQAAAADAGmJ/Yw3rRoj0fypjRAAAAAAAsI6z+hvLOkTjbQ90hgAAAAAAYC1n9TcWziEa73ygSwQAAAAAACs5q7+xbh0itwUAAAAAAFjFWf2NZR0iEaFXBAAAAAAA53FCf2Ndh4jOEAAAAAAAnMVJ/Y2VL1Wofd3YymvmAAAAAABgJVUupfz/7d1/kGVpeR/253nv7Z6ZnWktyw+ViyJIRiuIpHKlXAjLfwgzKmG8LIpKKIDtWK5SSWWVnFTJ5VKVHTCsQGBSSZSkHKeS/O+q2NKqQEjLYmCJxyvZwo6JE0cBSbsswqwl5PHuMPTM9kx33/Pmj3vP7dO3b/fM7rxnd4b5fNiee7pv9+kz88c9fO/zPs9bW2/u07yHCAAAoLU85vhWte0hCsEIAAAYz50xVAEAAKC1EfJGw32I6nwu+HILWekIAABoo9YaWRd5o2HUaBaISplf1XKwAgAAQCOlZGQuMsftGIjqMqrVaD76AQAAuKsdzhvtElHDsdvDweASEQAA0E5mLipDbVtzGvcQZVQVIgAAoLFh3mgZihpOmTuoEBmnAAAAtJQj5Y12gaguFspVC+YAAIC2aoyTN9oFolx5BAAAaK1x3mi6MassBAAAjGWMvNE0EPUEIwAAoKU85vhWNQtEwxVzmamNCAAAaKbPGK2LL20rRPqIAACAsYyQN0ZZMgcAAHAnaDplLoePAAAArYyUN6bNzlRr1MiI6B8BAAAaGSlvNAtEmRqIAACAcYyVN5oFolprxCKxCUUAAEBLY+WNphWizIha548AAACtjJU3mk6Zq/XwIwAAQCtj5A1jtwEAgLtWuylzoSwEAACMZZy80bRCZM4cAAAwljHyRsuhCjUyImtEjSoTAQAAbZWs2bhQpIcIAAC4szQsvzTsIYqDZX3aiQAAgNZqNM8aeogAAIA7Qi7+uC17iKLWqIudYw92kQUAAGhgmDcanrblUIX+qNUpAQAAImKeN7IvETXULBAdVIVUiAAAgLaGeaOlphWizIhaGy/qAwAA7nqZGaW0zxtNhyrUGhFRTZkDAACaGyNvNKwQLY9CIgIAAFrKjNu9h2j9MQAAwK0aK2M0XTIHAAAwljFGFbRbMtf/YcAcAADQ2HJT1sZ5o12FyDZEAADAWEbKG6MsmctMXUQAAEAzY2UMPUQAAMBdq3kgUhoCAADG0jpvNA9EWogAAICxtM4bDfchqqbMAQAAoziUNxpqN3Y7c2Xyg8VzAABAG0fzRhvNlszVqDH/r8pCAABAU2PljWYVonmyqouwJhEBAADtjJU32vYQaSICAABGMFbeaNtDND9qdUoAAICIGC9vtOshqocfAQAAWhkrbzQLRH1gSwUiAACgsbHyRsslc8usVmsViwAAgKaGmaOVZhUiAACAO03TQGSsAgAAMJYx8ka7HqLFH8IQAADQWi7/aGucJXNSEQAAMILWUUMPEQAAcGdpmIqaTZmrUSPqfOdYexEBAAAtDfNGNBxq3SwQRWbMLy8jQyICAAAayozMPm+00y4Q1Ro1VIgAAIARDPNGw0jUcmPW/ihChQgAAGgoFxWi1mMV2vUQ1VhmIXEIAABoaZg3WmaidlPm0l5EAADASEbKG8ZuAwAAd61mgShXHgEAAFoZK280nDJ3zDEAAMCtGiljNF0yl8pDAADASMbIG6P0EJWSakQAAEAzmQcZo2UwatdDtLgoRSIAAKC1sfJGw32IbEQEAACMY6y80SwQZa7OfZCKAACANo7mjTaaVogyMqogBAAANDZW3mhYIYrIxcXpIwIAAFoqGREj5I12U+b6pXxVjQgAAGirjpQ32m3M2kcrmxEBAACtjZQ3GvYQtToTAADAYWPljaYbs44z9wEAAGCcvNGsQlQWO8dmRNRaZSIAAKCZjIjMbB40mlaIlIYAAIDRjJA32gainmAEAADcAUbpIQIAAGgtjxzcuqYbsy4fTZwDAAAaOpQ3GhpnyRwAAMAdoOE+RHXl2AI6AACgjTrSRkTtlswJQAAAwEhy8b/W2i2Z6xPbWFvIAgAAd6+R8ka7ClEZdDkJRQAAQENZcj5QofFUhcY9RPMRc/IQAADQ0jBvtJxX0HDsdn9R5m4DAABtZS4qRI37iBpWiAZRSB4CAAAaGuaNlpGo2VCFXHkEAABoZay80a5CFLGMbFUqAgAAGhrmjZbajd0GAAB4MTQswLQLRLm4rrRsDgAAaGykvNG8hwgAAKC1sfJGsx6ifjHfIrWZMwcAADSTGTWiNg9GeogAAIC7VrNAVGuNOngEAABoZay80WzJXJZcTMHrd5AFAABoY6y80W7JXK1Ra0SN+SMAAEAzI+WNdhWiRUxL8+YAAIDGxsobzQKRqhAAADCWsfJG0ylzakMAAMBYxsgb7ZbMRdblBdYqGwEAAO3UiMysEW2DUbMK0WJD1uUjAABAK2PljXZL5nLlEQAAoJWR8kbTHiIAAIA7Sbspc8ccAwAA3KoasdiYta1RpsxZNQcAAIzlthyqELXO01qtUdWIAACAlkbKG+3GbqcRcwAAwDgyM/LQqLk22vUQ1cWqvmViE4wAAIA2aq0RdZ43WmpXISo5b3LKNFUBAABoKktGyUXeaKhZIIra56AqEAEAAG0N80bD1WgNe4iWRyERAQAALWXGQQ9RQw17iNYfAwAA3KqxMkbTfYhsRAQAAIxmhJzRLBANp27LQwAAQEuH8kbDwNG2QhTCEAAAMJ7WeaPdlLlDgxTsQwQAALQ0ThNR8woRAADAnaLpPkT9wO0Sac4cAADQTEbWrO3XorUbqrD8I6yWAwAAmhorbzTch2hRFFruICsVAQAAbRzNG220WzJXFgFIDgIAAFobKW80rhD1XURSEQAA0M5YeaNZIMrMxeWlOAQAADQ1Vt5oXiGqKkQAAEBjY+WNZoFoUsqitymj1ioRAQAAzZTMyMzauvjSsEIUyyV9NiECAABaGmtkQbN9iOxBBAAAjGakvNEuEIVMBAAAjGeMvNEsEAlBAADAWMbKG00rRBGCEQAAMJ7WeaNtIJKGAACAsYyQN5pXiAAAAO4U4wxVUCkCAAAaGyNvNAxEdT4bfPkIAADQyjh5o9nGrJnDIXgSEQAA0E5mLipDbZejNQtEdbB1rAoRAADQ0jBvtAxFDZfM2ZYVAAAYyzh5o10gWlSFVIcAAIDmRsobNmYFAABuf3nooZlmPUSHBym0XdcHAADc5Wq9zTdm1UIEAACMZaS8Mc7GrC1PCgAAEOPkjWaBSAgCAADGMlbeMFQBAAC4Y7TOG20DkTQEAACMZYS80WzKXI0aUXNxZMocAADQzjJvNJ421ywQZWbM41BGybQ9KwAA0EwpZV5+WeSOVtpViOq8KlSX+xGpEAEAAG0czRttNAtEJecBqG1eAwAAGC9vNKwQLY9CdQgAAGhprLzRsIco5tdVhSEAAKCtsfJGs7HbtUZEnT+aqAAAALQ0Vt5ovjFrhAVzAABAY7n28Ja1WzJX5qO2MyNqtW4OAABoLLNm46QxSoUIAADgTtCsQnRoIZ8mIgAAoKWRMoYKEQAAcEcYoy+nXQ9R/4dtiAAAgMb6vJGN84YKEQAAcPsbqejSrEJU42AgeK3KRAAAQDvzjBHNe4naLZlrPf8OAABgITPnmeN2HbtdF1vG1tZbxwIAAHe9sfJGswpRyYiIupirYMkcAADQTsmIzLpIGe0SUbseomXfUI2qQgQAADQ0zBstiy9te4gyImp/kQAAAG1kZmSJRd5op+GUucUfWogAAIDGhnnjtt2HaLlZUsuTAgAAxDh5w8asAADAXatZIMqVRwAAgFbGyhtte4jWHAMAANyqsTJG2yVzykQAAMBYRsgbo/QQZaYiEQAA0MxYGaP9lLlQIAIAANobI280DEQ1ah0+AgAAtDJO3mg2VCHVhwAAgJGMlTfaTZmr/ZaxjbeOBQAA7npj5Y12FaJUIQIAAMYxVt5o10NUVx4BAABaWeSM1vMK2gUihSEAAGAseeihmZZDFWp/dTWqeAQAADS13IvottyYVQsRAAAwtsZ5Y5SNWQEAAFobI280DUQ9wQgAAGgpjzm+Vc0CkRVzAADA2FrnjbYVImkIAAAYywh5o9mUuRo1omZErfNj6QgAAGhkmDdaRo1mgSgyIyOiZtqcFQAAaCszMhd5o6F2FaI6rwrNk5sKEQAA0E6tNeoib7RMGs0CUckIpSEAAGAMJSNG2Je1ZYVoeTQ4BgAAuHWH8kbDSNQsEB0s5ctQKQIAAFrK7DPHbdtDFMsspEIEAAC0NMwbLTXdh2i5Oat5CgAAQGN55ODWNQtE/UwFsxUAAIDWhnkjG+aNphUiAACAO4lABAAA3LUEIgAA4K41zlCFlicFAACIg+FtLfNG26EKEhEAADCCPPaTW9NwH6LFqIc63ztWKgIAAFqptc6nWde2Q62bBaIsB/WrbDoIDwAAuNuVSZlnjMZ1l8YVon7rWNUhAACgnbHyRrsKUebi8lIcAgAAmhorbzSvEOkfAgAAWhsrbzQLRKUs1vRFRtQqEQEAAM1kZmRmjcYVomZjt/uhD62nPgAAAIyVN9ptzKomBAAAjGWkvNEuEPUEIwAAYCyN80bTQJQrjwAAAK2MkTeaBSJhCAAAGMtYeaP9kjkAAIA7RLOx21HryrFaEQAA0EgdZ5a1ChEAAHBnGKHm0m4fosU08DpScgMAAO5edbEBUeu80WzJXMlFXMscrZwFAADcnUpmZEZEZtNCUbNAVJd9Q1UeAgAAmjqUNxpGomaBKHM4CE8iAgAA2sm+QtS4kahhhWj9MQAAwK0aK2M0nTJn0DYAADCWvJ2nzA0JRgAAQHOLKlHLvNEsEB1azicRAQAADY2VN9r1EA0uTg8RAADQ0qG80fC8oyyZAwAAuBMIRAAAwF3LlDkAAOCOMEbeaNZDFLXfMbYumojEIwAAoJFh3mioWSDKzHkGqikLAQAATWVmZInmeaPdlLm+KlRr1FAhAgAA2qm1zsNQ45HW7StEkZGZBm8DAADNlFLqcjOihrWXZkMV6uKPGtU+RAAAQFNj5Y1mFaKSWUtEdJGRtVovBwAANJMRMcmsXWTTUdkNp8xFdPOHqDVi0uzEAADAXW+QN7qGp22+MavSEAAAMJbWeaNtIMqVRwAAgFZGyBvNK0QAAAB3inY9RId2jLUPEQAA0NI4o6zbVYhycbJUdgIAABobKW80zS7dyiMAAEArY+QNxRwAAOCu1ayHqA62i50f6yECAADaGOaNlpoFokwBCAAAGEdmjpI5mi2Z6xPbWMkNAAC4e42VN15QhWg6PVW7brfOBl+blEVayxSKAACApiYlY14gyiPdOZPJRp1OT72gENJkyVyWK7Xr+4ZqjRoREyvoAACARrpaIxd5IyIjy5UasXnL572lJXM5ubRMYd2sfr1kRCkZJcNMBQAAoI2MKDnPGaVkdPvdE8unBpnkhbj5QHRh/rC5ubn2F9Zu9oddjVh+zOqRSJSZ1tIBAADHWpcZulnkMGvUOtte97PLrHLh5n/f864QffGYr29f3f7c8GRd2uIIAAC4dd1iulyfMLavbn9u3fcdl1VOcsupJcu0RkT85m//688OT1przVotnAMAAF64WiOzHl599pu//TufjTjIIreiSRkny6T+3N98/9d2dnYeGZ64izgSiiybAwAA1lnNCrVG7i/yRImIyIjrOzuP/Nzf/NtfyzJpkituMhA9XCNeVWNrq0ZETKdP11I2a3lmWstknsoyJ/Wxxx//+7WLK/O/yPy/rovsOqEIAAA43mpG6LrIrkaWGhFRIzPrrIsrjz3++N/PnIehMpnOM0nZrNPp0/Of39qaZ5d4+KYyx3GB6HkFliyTmuVKfe/7PvC1r3zlqYcOPxlRI3K1WiQUAQAAEYezQVcX2aGfWz0orXzlqaceeu/7PvC1LFfqC6gQrf3+578P0ZkzNXZ3s9+ctZtcqjnbqhG7sX11Un/0Xe/59Kc++cgHv+PVf+KDtdblrkm1i+zD3cHJtBgB3C4yo+bzez/sjtXVNbv6AfDSWZ09UFeezKxf/cOvf/BH3/WeT1/d2ahlMu8fysmlOpmcOdiU9cyZ530ju5klcwcnvTB/eHLN6O0sk5o5qaWU+sCDb//VLz3x1M9H5NpxeADcfmZ31SCcu+ivCnCH6yK3f/+Jp37+gQff/qullJo5WVsdenL9yO0bBqTJCc/l4ePvy4izEa++lLG/n6+sl2I2+7asV2YZ95zJWruMupOnrm9m3aj5j/7RJ5565bd/22df+9rveNmpjc3XdzHfWbZ/nF/bweee97znPe/5l/b5GouW0G/xrNDVyKi337+/5z3vec97/ujzV5+7+smP/8Yn/tbP/pd/6/8qpdby3LTuTZ6rZbJRJ9PNOrm0X6fTM3Vz8+v12ckkYmMj4o9eswhBNzeE+6TbXh49fnfG+YsZ29t5/+XLZX//Nbm7u132XrZTZrtbpdu/Xrr9M+XcPbtlNtsr3exUqbXL97/vb7z2h86/9Ydf9Yp7z5ecbm1ubnzXTV0dAC+q+VLnGuVbdO1cF5FRUx8rwG1qd2/vy93+/vbFS5cv/JMLj33uIx/9e/82s9Qyud5NJhvdlec2uzLd6cr0VDfZ3O42vnGm29zc6qbTp+uT997bxdZWjQuHBioMX+/XvvY//0AUFzPeuJ2xs5Pf+dy3l/3967m3d7XMXrZVZnvXSre/W7rZmbJ1dpbDUBRdl/VMl7U7nVG7jIioi8fVYwAaW+zfcHr56ebyNfe3fuvRX7zv3pf/hf6duYgaJWrmt1go6mpkjVKHf89Lly99+gd/8MHlMKDM3RoRce3gC99S/wYAt5NczI87dJylZrlWc6fUKKUOw9D21Uktk52uTDe7ycbpbvKN7W5j42w3nZ6qf3DPv+/izJkaXzgyYe6GgeikoQr9HWPl+FU1tiJiZyfno+1eE8PhCmUaXcRObF89U7bORhdxPWp3Jmt2Gde7zG53vrzunojoTvcTF3L4DwJAO7V2GYtwc335+V6NWvN0RLz5zW/9wP/9hX/+3Zubp183zwk5DwK1e0mvu615VSiXf7+I69evP/XmN7/1A5mLAJTzgUaZ5dDuf+5PACNavMZmuVbjucVrbpnWnMzDUJaduhqGVocpzDPJ5mDc9tINw1DE854y93CdV4ki4syZ+mREfOd+5HxPor0ar9juZrtbZTUUdbmbtc5yGYxql3E9IrtdFSKAVu455uv9m08Rh96AqrXLPiD9V7/wob/23370w79eYnp2/n0RERmTjBoru4PfcTJrrZFdxMHtsNu/+t5f+NBfu5ZZ+wB0KPgM37Us19bfRJ8b75IB7gaHXnfLtMZk/rU+CM0Htm3U1TA02dzuyjPTWjbmew89ublZD0+Xu7n9h3o3CkTrq0QXXlXj/OIEu/MqUUR0e89cLauh6Mpz53KrzrKeLTkMRhERNQ9C0PKXCEYAL8z19V9e9+ZTPX16HowWn3/i0ccu/7k3v/lnf+zBB/9BF/MRpF1k1FqzZNZ6h4aizKzDEdvzv1fEr3/qMz/7iUcfu5xZ5jfk/h3K0YPEZwAAEixJREFUa9cWkyVWbtLrnDSWCIBjrau857JSdBCE8uqkbueklsmVuhqG+qVyETEftb3sHVq6qepQxMk9ROu+Z20v0f27u7m//5rs+4m6V+xnnd2Xs71rpXaznH+cy1pnuXV2lhERXdf3Ec3uyJsswO2if5PpxO9Z17PZdVlrl/X0vLez1i4f+fgv/9gbXvcn398Hh35vhpJxx4WiXFSGZnEQhEpEfOmpr3zkR975F3+tD0J57VqdL9EoR8LQzSyXy7JjSR3ALcicj9Aui9fh7auTxWjt+earWSZ1snG6y8mlOgxDh6pDL6B3aPn7b+Ya139+MHFuNRR13W7uvWyn1Nl92c32s3b72QejiIjanTsUhr5tK6J/DoC2+jegIuavu8sq/SIErQajL/zWYx++99y5B4fnyHmN5Y4JRX0YWr0DXr5y5dE3/uBbP7AahPolGhEH7072P9PfoAFoK8ukfnOxa2n/upvlSu2fm39Ma5nMe4Y2vnGmK2WzHglDJ0+WW/f54eu42es9erzoJTohFM1me9lXi7rZ/iIM7ecw/AhCAG30bzatfW7xBtSwSr/s7RwGozNd1tlm+eK/ePxXNk9tHtoioZSoUfvR3LevzKyREV13+B63e/36l7/3B97ynpzsdsPpRYfXqh+8Ozk/19GN/5a/Z3HTBuDWDDdZ7UNQREQfhMoz0zqZbNSTw1DEC6kORdx8IFr93hNDUUTEkWDU7We8KqLO7pvfjBcBaXml3f5tfYMFuBOtewNquIR5GIy6br/0oehd/+k77/3wQ+/75LRMzg7PlxF1PqbtdpY1MrIOboFdnV39Ox/66Dt+9Tc+frkPQ6VMu2EQGi7RiDh6g37x/x4A39pypUezTOaf5+RSjYsRpRwNQhERLcNQxAsPRIPPV0JRRAyrRRERfTCKiJjN9pbn6V6xPgT1oQmAWzd8A2q4hHk1GHWzzVJrl3W2X2rt8n/6e//N97z9bX/+f4+IftueiDqvFN2uVaL5EIWakXnoNvipz3z2P/+5v/G3v5RZak6m3Xxfi91uNQgNl2j0P9vfoAG4dTm5tPY1tTxz8Fo7mWwseormQSgi4sg0uRuHoXWfr7+m53H9677/cCiKixnnI/pqUUTEsGI0f7x+EIgGk48AuHXDN52G+jegVpcwd/u7pXbzaaCzM3ul1ln2G2rX2X559NGPv/O7/+R3PJQZUQ/2M70thywcTJSb9zz11/vEU1/9xQcffOfHD4LQ9S5zUic7G932Igj104siDpZoRBy+QQ/1N2sA2ihlc/m6OgxBEYuKUMRgmlzEwX5DtxaGIp5/IFr3M4PP1wSjiFgNRxEHAQmAdoZvOg0Nq/TDJczDaaDd7EzZOjvL2WyvLEPRqf3yr/7phb9777lve3B4b8nIyNsoFB2Eof4a58nt8pXtR7//Lef/Tl4/CEPDDf5WpxcNl2hEHL5BDy1HvQLQTB+AIlZCUEScEIQibiEMRbywQLTu59aEoogjwShiGY5WfW9E7O6qGAG0NnwDariEeW9vp9SXH0wD7fZ3y5FQNNsv9UyXX/z8v3x4c3N6//C8ffp4qUNR5nyYXF25N+3u7j/5vX/2z7w7d+bL5FbDUF8VKpNpzWcv1Y2NM13E4SUaEYdv0AC0sbm5Wb943JPDTVaPBKGIlmEo4oUHouN+9phgFLEMR71hSAKgvZU3oI4devOK/ZztbpWTQtF7/vKP3/uh97/3k5OMc/OzzdeklZIvaSjqw1DXRQ6HbNcaVz7wkf/6Hb/yDz92+aQw1G/wd2zT7tChXdABaG5r6+B19kLE4RAUcYMgdNzXbqjFDeyEalFvNRz1Lh7++vkGVwPAYStV+tVg1G+ovRqKzg57imb75X/9X/7773nr+bf8w+Gpa7y0/UT9UrnVX/7YhX/6l//6f/HzX+rDUOakXt3Z6NaFoeEGfxGD6UW94Q0agDYurH5hNfz0Hr6Z4HNLr9OtbmDHneeE8x8XkgBoa1ChXzMNdLih9rpQ1M02Sz+S+1Of/vg7v+s1/9EvzE82n1qQGS9JP9Gyb2h5G5xfz5f/7dc+9Pa3v/Pj/WjtMtnt1oWhYzf4izgIQRcijr9JA9DW2vDTO+65W36NbnnzuplzCUEAL6pjli8fs6H2aig6NztTZoNQVGf75V/9n49/5GVb595R68E07hd709bMrHUxUa7GwVS5y1eufPL73/Tn3p+TadeHocnORnflZsPQ2rXqETe4SQPQ3s287jZ5bR7jxiX0ALy0bqI6fzHjjfNQ9L0R8dxz315Wl891+9dLt3+mnLtnt8xme6XfvLXO9sv/9/98/uHpxub9JSO6+RjuyJzv2Dp2KOr7hva7yOHv393dffL7/pM/++4+DGXZqZPJRnfluc2uTHe6Mj3VrS6Tu+eef999MWLeH/SFrXrM9KJVwhHAS6vp6/Ck5cmOISABvPQWr8VfjIjvy4izEX+0H/HaLi5ubMQr9y5mxMsjs0S9MsvcuhZR74mIa3H9+uk4fSqixvWMupFRa/7h5a9/+m0/dP5dUfNUHpw9IyMyB19p/ZfIrDUiat83lItfNKnb7/27H/5Lv/c7T17LMqllcu2GYWg6fbr+3rlzNTY24oQwJPwAvPRGfS1+MQLRkHAE8NLKeSj6YkS8aR6KXr2bz9Yar6yXYhiK4p4zWWuXmbvLUBSxGxGb8bv/5vd2X//6//jz97/uO981fGXPg9f5kV7v82C89uA3ffqzj//k//jf/c9PDyfK9WEoy6ROppt1cmn/UBh6cnNzJQw9XOf/LhEhCAG81F601+EXOxAB8OI4KZAMqkVvWlaKhqGo1v2MnZ2Is2ej1i6j7uT165u5uVEz6jQjMx599B8/8+CP/IU/fvnLXnZ+5eS5WNbWNBQtqkNHzvnlr371Q3/lJ376N3Oy2Hy11HrluWktk+dqmWzUycbpbvKN7W4y2agbG/cc7hk6FIaWLJcDuIuUl/oCABhFXflY91zMg8Cr5sMEzpypT25u1un06bq5udVNJhs1J5fqZON0V6abXZnsdJOdja5MdrvMUqOU+sAD7/y1b17ZfmT15ItU1Cw8zMPQ0dN988r2Iw888M5fi1JqZqn9EIV+otxk43SXk0t1Mtmom5tb3ZEBCofD0En/VuueA+BbgCVsAHePE/aNe3fG+Ys5nD537dqrynDy3HDIQtd1OZw896X/91/+ynQ6/e7hiXMxEPtWhywM+4aG59/b33/ie/7Un3nPcKJcKaWu9g31E+VOn77YHZ4md8PKkAAEcBdQIQK4e6xWOQ7/H/4LhytFp09f7ErZrOWZxSam01Ndme7Me3NKqVl2aua8MvP+j3zwp2vU7YyDlNUtAsytVIr6n+2HKPQfXdTt93/kgz/d//4sO3VdGCrPTOvxYejIv81x/04AfAvTQwRwd8rDx4vpc39wNuIN+xFdF3+i1pjN7s3hkIXIEsPJc/2QhS/9zu/vvuEN93/+/u963bv6My5+wWLo3AtbkZDzMlN/juVZPv3Y//GT/8Mv/W//bt0QhTI91ZXJ9NAQhdOnr9WLR8LQoaVyseYYgLuAQARw9zomFD2X8erdHI7jXg5ZWEyeWx2yUKPmpx797H94+4+87esvv/fe8xGx2DE1+n6i1d9344vrq0PdYsndIqo8+dWvfvAnfuJnfitKqaVMjg5RmG7W1SEKv3fu3Pynf/tURJwNYQiAniVzAESsDln4wlaNiLjZIQulTLsopb79gR//xDevXnkkM6P/iJrPe+ncMgzNJ9Ytz/XNq1ceefsDP/6JeRia9w3d1BCFiFgzUU4AAkAgAriLHdNHs37yXCmbdeMbZ7qcXKpZpjXLpG7npPb9RKVMu5xMuze+6S0f2L2++0SNGrVGLB7nM7NvIhT139PVmv3PR424vnv9iTd+/1s+0A9R6PuGtnNSs0zm1zS5VPshCjcxUe6kfwsA7hICEcDd7fhgcGE1FJ2qxw1ZmEw2uuGQhQ989Bd/OkpsT0rUUrKWEjUXd5yTQtHyuYwoJWv/87XU7Yc++uFDQxRW+4aGQxSm01P1hCEKwhAAS3qIAIi4iSELfT/RcMhCrV1m7q4dsvD619//+ftf97r/rC6aiWrUyMWvGS6DO7S8bmD4c5/+7PFDFLJM5n1DgyEK0+nT9dlz544bonD41wBwVxOIAIhYu0fRYMjCG07Fs9eu5SvrpTg0ZOHs2ThpyMLbfuRtf/zt9913PrMPQQezFo69kOw/5t//u1/+6of+6l89YYjCxuludYjCk5ubNV7+8hoXIk4YogAAlswBEBE36ie6EDHsJ1oOWXj25CEL73jgxz9x6ZvffKTWiP7jRqPmht976ZvffOQd77jBEIVn1wxROHNmEYb0DQFwMoEIgN4xG7eeMGRhY/2QhT4UzYcsnH9ob2/viYg4SEPHpaLB87t7e0+88U3nH+qHKMzPuWaIwsbzHqJg41UAliyZA2DV+uVzf/CmZT/Rs7XGy2f3zqfAXZllbl2LqPdEv2nrqc0ua1zPqBsZmfFH/+7pz7z1z//Qu6LmqbjR4rUaEaVuv+99v/CXfveJr1zLLLVMrtXJZFrXDVGYTs/U6fRUfer0tZUhCpbJAXBjKkQArDo+QAwmz02nT9fp9FTd2Dg7n+42mdbVyXNlcr3LLPVjv/GZy5/65Od+JiLmG7UuTnfQLzT4HRnxqX/8uZ/52G985vI8DB0eolCmp7oymdbyzPTQEIVjJsrd/N8NgLuSChEAxzlm8txzGa/ezWdrjSNDFhaT5/ohC6dPZUTsRtSN/NRnHvsPb3/gh//4lS+/73zESghafJ4R8cSXn/rQT/zkX//NYRjavjo5GKIw3axrhyhsbET89qk4YYiCMATAETfqbQXg7rVm6VxExLsz4mLGG7czdnby/t3d3N9/Te7ubpe9l+2UOrsvZ3vXSre/W7rZmXL2zF6pdZbd7FSptct//S8+94tb58796NHT19i+cuXX//QP/PBDfRjKnNSrq0MUFpuvHhmi8AWbrwLw/FkyB8BxTp48t27IwjfmQxaGk+eu7mx0mZPaL5/70z/www/t7e39/sFsg/nH3t7e799sGHqeQxTWfQ4AESEQAXCy44PFhcOh6PTpi90wFGWZ1mEo6nuKSpl2H/7oL/1UrbGdmTUza62x/eGP/tJPzafJzZfJDcPQcqLcIgydPn2xOxSGDvcNCUMA3DSBCIAbWRMoFpWYQSja3Nys0+mpWspmLc9M62Rzu+vHcZfJTrd9dVLnoWi3++WPPXz58cf/2U/N9xuq8fjj/+ynfvljD18uk91Bz9BO14/X7ifKzStDp+rm2jD08LrgIwwBcCI9RADcrDx6vOgnOh8R29t5/+XLZX//Nbm/fz339q6W7hX7OdvdKrXbz25/t9TuXG7VWdazs+y6Lj/zyV//sYiIt73jR3+tlFLz6mSxz9CV2leG+jA0nCj35L33dvMwFHGD/YYA4EQCEQA363kNWVgXimo3W3ycy1pnh86XiyA0rwodrgwdCkOGKADQkLHbADwf6zdtjTdF/NF+xGvnm7b247gzy3Lj1sytiCyRmZG5O/8o+7X/KJNZLZONWiabdTLdrGXj8pG9hoQhAFoTiAB4vo4PRW/Yj+iOhqKyU6Lfp6hMpnUZjJbVoMkyCGUpMfnGdjfdPVWn0zP1SBja2qrxB8IQAG1MX+oLAOCOU+O4JdcXXlXj/PzwyYi4P56OiNfE/v7i+W9sd123n5NXRa2z+w4vmZtcqnExopRpnUw2lgMUjoShwxPl1l0bANw0PUQAvBAn9BNFxPmLGdsHPUUREX1fUdfNP5/N9g6dYzLZqBERwyAUEbE+DKkOAdCGQATAC3VzoSgihsMWIiL296+vvf9Mp6fq/HFQFYoIYQiAsQhEANyqY8ZxRwxHcsfOTkZEDCtGw5McqghFxEFVKGI+QCHCeG0AWhOIALhVJ1eKhqEoIvpgdKxDVaGIG4ShdZ8DwE0TiABo4ZhQFHEkGEUchKNVW1vzcHMhYk0QihCGAGhMIAKgpRtUi3oXF31Gi08v9F9fnSCnKgTAuAQiAFpad19Z+dpqOFr18M2EH4EIgCYEIgBaO+7e8nzvOceFHmEIgGYEIgDGctI95rjnbLoKwItKIAJgbLd6rxGEABiNQATAi+GF3m+EIQBGJRAB8FJ4IUvmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYOn/B76Y9qo2Tn7XAAAAAElFTkSuQmCC":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA0QAAAJkCAYAAAAxwuGsAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAACAASURBVHic7L1LzG1Jlt+14mRWZlW7q8umXe1q6JZ5NNhuCz9kIQuQoGYWHhlQIwsZi6cYMjaSGQJzRhZPWQhZILAHyMgDJDMAD5BlZAS2kQdN21KbrnbTTZar6t6691sM9o6I9YpzzndvnMyb9f1+VTf3d86JHSv+8Vh7R8SOHSIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD+CtB9xewAAAAAA8OVDPy9Dj+6g0AECAAAAAID35WEdpEd1WOgIAQAAAADAbrZ3jHZ3XK7FRycJAAAAAADu5VrnZ1vHaFcnZRXP4vtfoHMEAAAAAACB/2bV0Xnu93fzvh2TOztCVQfoO/m7b79nagAAAAAA4MPnL1ZffrPo3KQO0vaO0ft0iKpzzXe2E3R2fr59fvzsM2aIAAAAAADA8/WvHx2bv9i/sJ0k1zmqOkDv1Cl6145JPK/oCH2n9Q7Q//Sn/sK/+NkPvvLH/95r+f3f+2H7ra/fyFdU9ThNVaQ1OdLPZz7zmc985jOf+cxnPvP5JX5uIvLJV+SHP/YV/dXf9In8la9/9Yd/+p/9t//QfysiZwepd46udozi55u0555QnGM+n52hb3+nyWeftf/5z/ylP/rLn3387/7d77bf+Q52AAAAAADgBfNbf1z/+re+/ubf/6f/6D/5Z+TrX1f5i/s7Rc/tEC06Q2FW6LPP2v/wn/2l//Rv/cZX/pjqO3W6AAAAAAAApDXRn/3G2//yn/vX/+C/cXSKRIrZonfuFD2ns3K9M3TOComI/Pn//H/9c3/719sflj4TZs+wSW4cOXLkyJEjR44cOXLkKAf9s+TPP/Ob9c//4X/tn/gjIiKL2SJ7ZvW5pN0OUoY9/w6doe9/v/2F//p//49/8dcuf/zX/56eAlSkNfmJT+XNT/2EvP7NP9Z++LWv6NN4dlB1pNbly/kcobpfcsCWJNS6WzvCTbMqrTVRzeF72GzQf2yXZsz5cPbTR5eLjs9WdyzwZLvQMzNIpOuQJirz6OOL6s4ICvuV7iNer+fSmsvHUkipxegJp13OsE8ichGRJ1G5SJOnEO8lxlmU32m8sNvOeI0dFfmo65GivtkoL5f8ZZGPNo1WR6lHornr9TfqOerxrNe9RUwVaz3Hiebn3l6v2Lb1rJ32R3vo8aV0XtFj7Z7t0fnF1kLq722Pa/sXU47WDxh31BNZpLxuj2fWJ38Q20/Ss/AHtV9btzPn1xb+4N72uA5X6/Hne79ujBdxGvsnl3ZRX7xWT7g+VnFWfm1p18fb/VpuDznfV+3R2V+0x1JPykdr33O1fEw9vlxacXrW4+K7VY7SvP90/u3wp9JEPgrl6A1EPVXyCn/QWnF29gfto2YTuNQtIiKXRfk8qbSLiJ7nt8t99Tf7NW/f1Te5oudJR/pr24WeM3989anrW12Hsp5La1fKccab/XQPluvRtfob62V2j1lP9pXRvol+GXah54Y/uJ6P3h+0S0vJqa7PdXu09g8+urT64mpOfFKVS/dDVXNOJRbvr4xdE8G4n47Ji9cde12+4Q9iXv5/r9pHv/zrT5/+0q9dvvqr35VPfDpE/sGffPrTf+hf+sf/Lfna1/SOTtGVvFqqvyvc+XfuDP0vf/Yv/9H/4//56n8hTdr/+z2RSxN5elL5R74p3/vWN/RVdwCqurbba0y/y1jKmHciy/pqvrhcrTwmPlVXgFUF7gV+qRx0YX/daKoTz3zTeVyFux7dUXEuIYX2OpEuaKuGGOzfpefMx5x/tZ7V/UW8oKT+kNTlI728bzYDveFQ5awHs7xv6Vk6tCLiFqpldUHrzvkeruaju2/QcYNxVU9oD9faY5VKd0E787Es7wXuglzYt+Vels/7tMeiw7i6oMVyLBI4fNUNqyNM1LG6oD2nPa7zz7SfsqMhZf7fMj3aY2vq60FdnW5KuVGOtT+4reMu2zLT38OvdCzjXDW4he3KH9zXHkVu3kc3kSfVY0CoSFYV/UWut8fOKi8rf3CvLwgXrtDh6fL06AheT944/3396t3325Fej27elWS/Zu278++1LTLuh6r26PXcd9t0v+yg5z3bY8zHa/W4iUi681xU+LvrpMT6fD1clf5o/2p/yBw/voTx6Hdoj7evbzfiu8P+rf6dH9C1583K9zd+RX7sf/tb7SdMf0iaiP7un/rBv/pP/fN/4M/s6hRdbgW4iukM/dzr1+2Xv/vpn1CRpnoofXoS+fl/QD771jf0laq2J9U2OkMjuer+6fmbO0q/8TiOKnoEPwMc9npltCdXeeLRbvdMs/YkyYzPWvbfWB0S7Bo9IZiLQ42eM729E/RUG/B6XD4aPed3TyLun4j6ox6dorUZdf+e7E8jj7qO82jyMWsPhnJBu7/PmFzO239W66wP6uNxBD0j/eZo4jjKJqd8Zk88MSbQ6ij0mLo2dPS6qCFxpRxb+TV+NHHPNuPq79Bh9IyTygJ0H4Yek1T7b/5m9FQF4yrUjMCnzWZt1S5D2PqL2qxpjy4fQ5ZIYdfpSV/Zwqj9gdNj63FI9tDjzgx6RlijJ+Sjr55BzyqB4zsfQwo+8srYHGkJaawMhQir9hjz0ekp/EEQXNRjkxsxjaMq5nocm0edcG9iloPRI4WeEbbyB5WOoMdeS9Qcz++exPg+uXLMDdoF6NeDPvP9FPWo0TPyz+fjVaw/eDpNu+PMwTL9M4FWvMmUYG4czzJ+svcbJivE6BlnFHrKBjIrw6q5jdi6VlN31u2xMD+qo86jqi9OV6x3+oPZ4FJ79HLNfcEMbqvo1fYYI6yvz0W2RD33+AOTn1WxDT06j/43KQhig/1ZtkZPlbwR1uhZZbqhao/j6PJvfZ/j5ZiEF/ZT+4l6NBxl+oNs6ugvqGr7HT8l3/tn/lH5NZcElfbLn336J37u9esm3//+0Rf5drG/6TO45+SW//6FJvKdJn9gdob+kz/3V/+Fv/F3v/pf9VG73/ieyD/8U/q93/Z1fT1GcOWOkZsR4mbAI0jzZ42j+h777Rmiaf/aCP/8uJghStHVI7Mr+qiefaRrzBhJGhC7HZ/o1Xy0M0UfVXqKjL1vhD2PnNQjUcdf945g3DuALJemaQSqzIf7ZohE5XiEIqW/OLb6/HqE/XrF6PkmcnsEqoe5pWMGvqFDjvJprV3JPxfdFSEyR6Dub96z3d4sRzdytA7+nPZ4a0TPfJTVkyVVlPeM6BXmqhE1fWZ7vJWPKoe/udJcntUeh+1qRLqoz/fPEB3t8VaGqxw+0ObfSv+zRoXP/1T+wIW7tz0uwlXJ/ajJlScIJsunvELEt0akfZxXprQNt2cOZ3lcPlLRpzv8QTV8W8wUNRPulh7XHq9w74yXje5WtO2eBMqN8rFf3NEeOiu/GuvzzQlB6wfucYBRzxV/8OwZooU/cz+31XXBf3GvL4gzJdf8wdU47/RrNt6PL6b4b95n3KdndX1L7uoZ9xnXbMf4b/F//Ur72l/5W+0nxvmq8jt+8gf/8r/5R37Pf/c3P/lE5WtfU/nLX9fjRQvPnyX6+I40BPqjciLymcjPvX7d3rz5mfa9t5/8sWNNwSHsN32qb37b159e2xTo+R9NLdqntokea4hU7KXMBvA13CnNveGDNr6zNxL2GeUam2D/Ud2JdU1UkVPHvMFMLcfwZKrFmMlR+7lH3EI09bPCT8lGth9nfZKeM8zlPH5kf9Va98HM83kMoy8jg1qwap5FtSekZ+ayJz2iNJ27VPEmxxoin49Jz7Df/MfTvs5scrqdPNEzTbc8drZ/SIzrAc6WohouKFfWEKUiakV9Luc9xhepfNwVoNUnBftDj/v5EBDXEDk93R+E9hjt+/QX47a2aAt/4PInkeuRq8LBH9j2eLirNv2B9W/JH0S/ZvS49uTMeT0S61srIsz1UUM+Jj02/S3Ut1VPx/rp4A9SOFe8xZqo0B79+cZ+qPaVP/DlE9YstCv+zdT16A9W1yexXyd/0GKA0S5i+vs1wneGsj+Q1q48cj0z5mLreeEPgnD36UlULmrWSJ76L6EcvX3/V1+n4+UU/uCpGlDV4iLXXEdp+oEiQZdZ151fezof+e4ZeGUNka3Pdp2Tr96VP2g+jHeIx3dPcl6grEV7rNuDbY/VfY5btRDs24/Wr131B8av+WC5PcY6NO4L0vW5bo/ZHwS/FiL39TmUj9Xj/MF9a4icFucPzpjC9bEaEG7i/arEsln5g3A/UtWjvoZI9doaoqBH/c/jvsBFEO/Xsl+bsbZsxhgYX93Ra/vHfkq//3//Wvvq3/2ufNLOuL/39pM/9ubNz/zZn5O/LX/za19T+bacexX9Qguv5L7JrQ5RK/82j8q9efMz7c2bV+27P7z8PmlHA5Im8lNfl9ezIZoMaiG2kAntrPntDNPiCePjaajF+pK+kPNCMQzZ6U+R7IjtiMMxM6P+0WXtF4KqUYmz33RUCXN0LWeeO5qi9yMef0GL8absWXU4Zd6Q2Rsn77+nwBbO9ckvPZG01jQ7gFDpTTlOHSJ91qaFC2tsMuOGbNyYDT0t+6+czmYvaJUeV48qBxCjDTbsBaW6Ytjv1OdxvKBlh3KmadRnkdZWHU4J5xs96o8+/XqM7o/6dCa7l88YFu2LUePpbXbUzAWtB53N28dnGmvLAxA5j3vmXb1+mXIMEs9j/C3Xg6MYbDfTZEzZVk3yzva4bD9V2Zpkr/1BiGZEZ39LDdHHb/S0UZgW3x5nPQhHO53p421RR3l9LPLRPn7hMyRHcNRj799ygBFw1BlnJ+RjXQ80zdyPiQpTwHFCZfrl40Nb2TiPaclMuD7FOtO6XeltLRD8weh39OhaPPoYNIy4zGvIPK6dSSj/VrW5ENhmh10WWma4Kf+eNnc7YGpDPz8MpMmpo5excURFPlbN6ooeCXqkziOnx/iMWOzRv9kHPGJ7TH41j0Cmj0f5r9J4hi78Wg6mNni4vhm/lmzV7TH7A006bAx+AOc+f+DqioajLZ80IGmToeH8WP5nnnS7V65vtUwdLzFZ+QORPpusxbUjZtDhX9b+bEZg16ZPHT2tXmfKh5DceVmeAdqVR2d++9+nP/i177ZPuv/57g8vv+/Nm1dN5GdEvv8rR73+tshcT+RyprzsdJ45Q/QLsz2dj8q9EZGnp9fte6/lm8OciHzjx/RNrsCWM2DV41YRO9obbnTd+U1bGMFwJTPt5EvDaV5DRW7yFEYc5pqbdh6P+HSk1Yrz9p+k+RmVqMd51N67NllT1vT+XY7YjaippAvalKUj/WPkJI7wF43zSLVfFFmPsLc0gjFrgfXA8Qoc06rBEQQ9ZuTCj2zHGaKYd93ZtjH74utBHJFuEqNTcRmwbmrmhDRjUJSjK59hotVxW2fTRPIMkblpSSPSpnxGPTB6ergrI3B+RK3l5ixz5E/dNXjxuGnIxzyjcs0f2Prck73yB1U+xhm3MCunXvGsi+v26CI422N9/RoFmNrDdX8wy7GyP/1Bm74ltIep57Rb+jUrwn6KM0TmRre3yzOdXsfKH8T8s6ksZqhi8oZfU+PPos+wRxtD5dfsSbNAmpl9sctUynIsstDPrBzXifKRaM3Xnasj4lFP5Z58g59+psyeyh/MAFV7TNV/6Q9mOpeEmQX7aF17smp9Skb6n0T0Yo8mQU+SZn6Snv62uWqEPfkDkfT49TV/YOtbzKb+zZOKfhT8mjVvfyjysbo+T39dNIGoZ/mMmUmniuQBkFj+1h+E+pbaY6EnNivnDyq/FvSojvucIkiwL8N26Q+MMFsn8sBqoadydypGR9dV3/XZ+514n3rNHwz/ouGlXVb3GZ/3ZzG6nhF1Auu3T9bXp/lESi5vO4ERO0c//Q19/VfM86nffy3ffHp63UQ+1Z97/br9TZHjVdwi8txZomsdolb+bfYb6rNDf/JP/js//vapfWxl/dhXDj/eb9Ce9KldWtN0AR037OHmouvV/mtzx5GwcPqMP0x5rkSOEZQejXofORMqIv7C1b/27cwn6HK24Dyi2u0290N+IiyOsEcB/hhHglr/T6rAZ4MfMyzq9fTg4Ys04xXtGgFpJNPUh1E+sfiDfjci3dLPNgFBT3FBLgz2thaimeVj9Ldq9DrOULWs4Qh4pl+L8rnyhV3hVM8Q1PUnZevIR584my1eh7lgFuUoqV16+ythvR7baL2cG3pSPpr6ZgImPc4faNIx60PwB7EsQwe+1+ehJ2W8j6Cn0c0UFIJb1NHjfx9/YOyu2kOeIVjpF9ceV/4gFmCeIfDls5p6iv4/51/IgOgPjOzjh6h/pSP9IiLzdfl5hui8PrQ2X6lf0B8pu6iJzxxngrzdp/Or8v7apbPW0WI4bceaBfPYmq8e0x9UrNpj7/7e9gcyXm99lz+4hFhGxrdxtCnV801y8zjrm8uKUJ+Gjst9/qDya3f5A2u38geX+bSMMVdcn1uZgavrs5nYLxNs2+Nd/kAk5F+QazLQZkHucKQK4z6m63PwB+n6LPn6vMUfhHx0HbZ+FFvPQgNMH7uOVubjSKZpj71DE7cRqa5rw7+0+jgrmLgMSv5tdYPR4z/Ps/7NBQnn2euzZ2asqjbbKfr6p/K2h1ARefPUPn779odtzBJ98it6vGBBnj1L9A5riCTNDv17/9F/+L3/4E/9K9Javx9UsdPBT2er9TMS/plEXw46K3LZpZZlBe5niMTKbhxwk2JGY+J7xiPB42N/ZNnPSPh02or6kb3/uv3MSNbTTWvQ3XWIHVkoPKLLENtyxaQ/Ho8YqxFZ78AWnkiMcwv2ezLUndZGkF7ud68hSjl2xOfK/zRYjWDGmaGkJ1Uobz+O3NkyzCNZ0WPHC1mt5wtdQ2TKMY1kuRnOVtio6sWpZ8oYAtIaImmhNHJ7XNmf9TjqMVHZkdPpjmb+5NT7+nAmx85U24Sl+mZmvI7zV/7A1qGu4yxR6w/OsM6vLf1B3R5Ncs88aS5Y0mP9QWvhfKPHYfS49PvyiTc21czDjKgon8KvxhHpYS35gzDD2fUU/u3J1DX3BIHquD48nX56uc2B2mtNfUNS+7d1+fQ1A3Z/tXh21KNPzf0cr8/qzs7+xa0ZSOmv7Idvnoyea/7gqZpV1nlBfuqRtKtriJyeS17T52aGegFd24fI1Gfr1277gytriNydqLcd9czzixknXbWfFiP0/kBMnpSXj+APrF9zwSp/sNCjscJcf3Jjhg5+Ldj317fPYQ3R8GvBr7d6DVF2WCHOYL+H7DNEaUbH1KN+XXvSdmUbF0u4XxzNS0+f53WX27icM9/9/MtqRkl6PvUoqzZ2+obQKboca2tGkTz95Jv29OurWaL7eUaH6Hyz3Dk7JCLy5s2r9vbtD5u+/S1OyTGqcowEPD09tYtc5KlXtB4ydLnH131G5fxy1xqikbZhtrnjOOG8oEy/1MLI33lBa0HPaJSH/dlTdk12OXI6EyzpBtcR19yM/PPHHkGsYnnExNw42cBhRmGWgpb5mG4e7Y262PawLkf/tbc/LyHBTBoBPvXY00zMeUYj6JGgZ1SLeKMuIx+9fJ+PUceM/9STzMVHkPSqo1jNaMR8jB0vNe3RH3M52gSlkWAz1NjbrD+9hfrs26MpCK/H/tzE3Cj7DJvpvm+GM94hrkZORzmGAk8dzjh1GfzBaoZzBvMFFwZcnY7SHyzaY+UPmin/eXYYOW3BD4yAK38Q/oh6xg1M9GvBH4x41MW3Hgku1seI9WvTHwTBrh7dnOEMX9jm6NcQ1Q1wjMSesbiZoXZeJ5x+f+wzTXYNUaqX5oS+l9wlJMdkkGvwya8ZP1D5gzyjEf1Bt+vLcZgv/UGlv/AHFzEzQv0Y/cGpx8wMhYiPQ9iHaB5Pe31mqM9IVc2u8AdZh//i7hnO075e1M8IDvumHK+Yzf7A66nao9OzmqqI/i3KHcEKf2D1LPz64vTSH1i/Vl2ffb0O6QsVP/m3G/6gf5X7fbU/uOf6bJNYXZ+7vtHBueIPWvAHqV8fro95Rijojv5t3Of242lvOvCzHpXm1k86JJrrFF2af2GMvv0t7e3bz9qbN6/axx+fuTD6Kr8g9z42d88+RKmO/7wcj8s9Pb1uTz/5pj29fdOk+UYmovL0dMjvexS4FI1eqLp/vXPrjjIvbNr/p+d356nj6E7WYCxT7UPUtyro+wDNEcAjHqfHmnB2j2PatyfqUaOnz5b1xl0b8HpcPho9MvWoO1v90eRjbcbHkHSMtJ62VM3flfZgKBe0+1ud3UKP02rzwGeTzzCjx+W1LTod9tmHKAg3H4Yek1T7b/5m9FQF4yrUjMCnzdfEmQKjx4atv6jN9jhiPoYskcKu05O+soVRtJ+ox9bjkOy1PzDmR1ijJ+Sjr55BzyqB4zsfQwo+8srYLP3atO8MhQir9hjz0ekp/EEQXNRjkxsxjaMq5npcvv0zJdybiHu/9X1C1tvlnAunVY/OUMyyhGk/Lv9Mcs58XEXni1v9vxAgtZ9YL6zNkX8+H69iBbAP0Y32WJgf1VHnUdUXZ2iPTs86gSZhi7w/7ak5urp4R3u8xx/Ey70/PsMfmPysim3o0Xn0v0lBEBvsz7I1eqrkjbBTz1OZ/mj9iGk0AzVHlbEf2XE8fry5hsjmY7Bf7UuWqos9yvQHt5kvR+sda5Gj3/H09s3RF3k63nr986sIbvC8R+a+LSKfibx+/fp8Xu9An94025Fs7ejBt6ZmhiWPRI0TREROoX3Sd8wUqVUSRgV1jkSNeM84VGOPvc7wPEKUbdi54Gln2r1Wlv2NN7VvCY3efBh2To1ndpigGk9x5/bjRUT9iV5xtYbIEdcMnBmaBw7CCMJ5si2HORKlPh+1uTz29sVNece35h1hZj7aeP0IlMQMHAbqC8N0UvN8Xw7zaw3VJJTNSL+ONI6fwlvmwh8m36pHukJwFbmcr39J41iLITLbHv0I1HxkVeOzGMHwML+8wZn56PTU0bkvx0Nfph7ME6M9Xw7OH4wgqSGl9jjrQVXXRFb+ICWrON35g1UGmCtGqr7WH4x6YVYehPb4LmuIRLUFmUH/PJZvzZsVImmr/IEv8NweYnuc+bfyGdEfqMu/tT8I5V+K78nUekQ1JDy+1cq4ksPnFmm05o54/VtOW39StfQHfgQ3jUiPuI0/sG9gvZY9IQ+mxvNo/EH5li5zkqvPF72+D1H/0r5lrh/tfhAj343/7JeWZuO3jf+GP3AFViStao8S8m/pD2J9jmEO+01k3JRcmwEffrpI43H05WM+jGO6Pts6esUfXLvPyQ3KlE/pD8SHu+EPbr5lzl4XWlE+MR/MOc5ednApH6r7Aye2oNeR7s/aRfKlZ5S/fcJH54TplYarkvdis0GvtYf8SJxJa8Foa6c/SPHbj8b3ya0NGZOhduRVz5enN8OHvXnzqr1+/bqJewX3faw6RG3xvcj3vz9+m4/L/cAFUT1eotBz1s2SuIav6SHncQFobbze2pVQKPiLucHrzT1X4Ckp3EjUN2ZejfdUSwdWt8jcXouW4yj0BEdwfGghmvpZ4fTmuMJ+7a+NnoXfORrXwhMZLd4fBkczPVWw+ow1RMGT6mnb+69UYOl0Vz7Ro5ijT3++EMQyrN/y1gOkK1yyf6TxC1xDZEym8nHeNda1mU5rf+hxP+u40/PpN3rOfLy1hsinv+jW2KIt/IHLn0SuR0fanr+GaOgp/UH0A4U/sEm10Ywbs2esIXLyfD4mPTb98ZHV5Z260RP8QWHGFG+xJmo6N0nkBi3psmz8gS+fsGahrf1bXkM0Z3RCgfvzpHjW3uaPq89HfHHEdqzxKvzBs9YQFXWt8gcer8f6tewPZOEP/F9uDdH4sfAHL3QfIg0bSUd/ULUH2x7r+xxf5ta+/bh1DdFIQEtBjnzM5Vi1x+wPgl8Lkfv6/DmsIZKej0F3q9cQNfF+Ne0RFex3y/XaoX48y0fvWUMU9Kj/+V3XEM3v21V/cCRXx/qBa6/cPjWZxZ4mpvOxucvlk+P873+/XVlHVKbmzhmi83XbZv2QS8jTW/f9oaudz/nNRaT++tAf1vRRXs6a39/QMzs8zR12ryGayTLP2jcxN5j5WXuvpzdKbz/vQzQS4PVI0DMcQMzyGc5H0/zRBzNnr9cQufvZMKMw0x/0FM/UDkvRH5z2Has1REOHyc/KSgt6uoMx+egLysdw7xoiKUb+ul0frToT7ln7fnT2g7k4Q3Ne0EaYcBPzrmuIhtuOP5cdzik4vYVpGLy1hqi5C9qQMyuS12NVtpCPNoTxB1Hm2h9MVv7Axd2zq/IHoT3Oc663x1v+oP9uk732B+a8qGdULO/X5sW7WhMVtFs9ox5HHd7uXDMQ6le6P6r8gc2HmI8zIrt2YORG9Afx2hoStFozkGa+oz+QuIbo3d/C5PX74+PXEEV/dssfiDthtabwndcQDTmFP7BrflZriHry4tvlZLZbEZkZ6s42Oi7hWDU75w+KJuP0h3zq3yb5QU9Pf3Rj/Zj8eohl5VeTg+kfH7yGqMm4z0h+rQtdn578Wuv30Ysb7i9iDZGrZ9GvR/dg7bYju10Su9sx7bHLvLRr+xD5cr+9hug4PnsN0fnzag3RpQcN2WbvB3s9GEkKL1CoGIMJ/ZzQBxl89lkT+abe+/rte9YQnXxnGEzrh0SmItVRKPMZ695n7qm3QxmjW+zjOE+onkk8/s3nsHuHeIw4+i+s5cRcM3CEH0nxyZB+63McjR5rorAfUzCPOuzP52DVJVtrA15P+GrqMHrKs82jSCEffUAfQ9Jh7XY9qr44g12nx+VZMmd0TPtOj2o49jxYFb83lKqchjjOulHlvpYnxgT649QR9MRqq5rytq7Gak8y6Y/Za/RIoWeENXrqAgzWQ71Qo+eM2B9N3S/lGAG2TO3RxRH0pLAxY1fM+itnmdts6Jq8ZX+u+9NlyNRU1SFXI5w/8Mle+4MkYxzLNURqzw5+bZ3AWEFdHli53W6vAnqvNwAAIABJREFUT7E9Rr/qDC3sl2uItEieGLtl+uMxnh119H/TR6/WEPnH5Yyewv7NNUQ9Pn3HNUSjPhfJGTpMfi2zJ2RECDD/tLl/rz8oBQQ5s+2IyPHWt7CWyLafpCetO9JnryGaaTb1QSTknxrLZYQhgl6fczCn56nwgS5LzA+r7BNx1+dxbXH1IbSfnoJ1AkOCrsg97fb6FIo0XKcXlTvWY+cPso6kR40eHyBWeGfb6kh6NP+WUx6MhHycRWj05GAmeVPPPWuIegzlGiKxy+p04c9idLWO/vetNUTuutb1FPVX88ifwT79MxMQ1xHN8N+5Epfn3V67HdCnt63ZISk9e4hN8hoiVd+hTz3u85feAz2Vzx5nPYIwe55xhF1Cl9tT7UPkRoNmQkP8eUTN6+gjGDp6/v5X34OPIwjDfBphjwL8kX2IwohQsB8Nsg9RrMdxxk1C/pmjmHwyabwmjH2IevrNsRDcoo4e//v4A2N31R7yDMFKv7j2uPIHsQBVZz0eOsTU88XU03IGfNkegj8wso8fov6VjvSLiLAP0Yhl0R7Zh+hOf2DtVv6AfYjcx3R9Dv4g96Py9XmLPwj5OO9vjH8TW89CA0wfu45W5uNIpmmPl+bXFv5o7UMkcm2maLSJ7udXM0TPZEuHSETcaE8T8x5yMc8+n//RswXYfYh8weq8sMSqGwosPXIgYYRonGMccDvSu9qHKMa3XkPUZMr06XTJtPdfucUECj3ddO8Mm5Z9ax8it4aoF4B4+zG/ugIV/2yr1zHzcSFkagn2fT3wYWdsz1hDlHLsiM+V/2lwPiMcdUy7SU+qUN6+hny0ZWh1fGn3ITLlaHXcv4YofKOnniljCGAfomzbtsfkD86wzq8t/UHdHk1yT3nNBUt6rD9oLZxv9DiMHpd+Xz7xxsa1n5imahCx8KtLPckffEn2IdJ1+bzLPkTCPkSzPvf69gHtQxQ7o1HPPJ99iBL2+txmHuXg0R+8xxqi4deCX2/37UP0rmuIfjT3IVpz1wzzM3l2h+jnReR75nN/u0OzI8qnUzoKYLGGKHS557OIR435vNcQjRP01hqivkbl+hqiOeLjmuxy5HQmWNINriOuuRkjwP7YI4hV7NoaIhd49Uxtd0HBfrp5tDfqYtvDuhz9197+vIQEM2kEeK4hGqeZmPOMRtAjQc+oB++6hijmY9CTzAU9vSIkfP1dVSv2Iar8gTG/GDkd5RgKnH2IivJxXwQ94wYm+rXgD0Y86uJbjwRXY4rWr01/EAS7enRzhjN8YZsj+xBV/qDb9eU4zJf+oNJf+AP2ITL9K1OOV8yyD9Hnv4bI/R78wT3XZ5vE6vrc9e1dQ3Sc8uHuQ5S5tObanX3TnMjRV/k/nxvncxPx+vXrVOeP1PRnQ/sjZ5rXELm1Q/M8+2/u02COJo6xhkjNGqKzJzqeRRxHDcaqZKtLu/YkyYzvTL37a8RqTTi7OuKLwVwcatYMaP9OzDEZ8HpcPho9YvS4s4MKPf9amvExJB0jrWYNhMnHrD0YcmWW7ftn0gs9TqvNA59NPsOMHpfXtuh02GcfoiDcfBh6TFLtv/mb0VMVjKtQMwKfNl8TZwqMHhu2/qI22+OI+RiyRAq7Tk/6yhZG7Q+cHluPQ7LX/sCYH2GNnpCPvnoGPasEju98DCn4yCtjs/Rr074zFCKs2mPMR6en8AdBcFGPTW7ENI6qmOsx+xAV7SfWC2tz5J/Px6tYAexDdKM9FuZHddR5VPXFGdqj07NOoEnYlfsce18wg9sqerU93uMP4uXeH5/hD0x+VsU29Og8+t+kIIgN9mfZGj1V8kbYqecl7EO0Wks0OtOmHCLLvsoV7p8h+raIfOa/cq/cbr4LvlxDJHFAwKf5coaYM0Qy4xPf87Snj3j7CMedPc88Ih3XEHld006c8ZL4x/FJ1Y0EzeC+B7/UY0aG3QBANLcaCer/0XTCKS+vIXLENQNnhuaBgyBA8siJ1zHtXhtiev4aojCiMgusHlF75hqiszhNdDfWEI18a/NY5N/qi55vNj9r/eXHmZTFEJnNFqdjjBRGweJiziPDIX1haMjpydGt9Yx8lKDD1Dcpyl+mniMd6gyv2mM7yzHJWfgDa7/UY79uUowQe8HDD/jmJ3kNka8QqxnwaLdwxEleUV2yP1jJXYwoVv7A6/cFs2qPyxH2lT8Y+bfSv0j2+Nmn89oaokp3p5wpst8Hc3OGaM4U1SPS4cRn+AObxJw9qQV4a9a/iSkn8X5VQj7aR5LuXkNUzeiYtUP9F6eneNtcSNB1fxDfMheyI7ZHG91d/iD4tXdfQyRlBi79QU9GKPBqTd89/sD5Fyc3NyibBWt/EPMtRGP8Qbui/13XEK2KLT4RE/Mx3R+E9hjrz/ja3B+0Qscs/8UaotRwfT4t1xDFhIXz84Rs7dc61UyRCxrNtXB9vpcms7xsfSq2AXrOXkSbXqrw4208q6rHM/m31xCJuUJN2Ieo0KP2c/+xhWjqZ4XZh8gY0qJ8rEMeqQvhQgb59OuNNUQ93+5YQzTag7d/pJF9iNiH6NTj2pMz5/VIrG/NRmQaYJTn8zHpselvob4t79SNnuAPCjOmeIs1UdO5SSI3aElriIw/8OXDPkSVP/B4PdavZX8gC3/g/2IfoniCSSf7EKX2mP1B8Gshcl+f2YcoZFDWo/7nz2UfIpF8b3cLNfXh6cebyOvnnV/wTh2iN29etbdvf9hEvjq+688u97VEIrfWEPWjzwT2IXL3h3nExITz0TR/9MHM2es1RO5+NgwJzfQHPauhsx5fcgAhHPsQeXNxhua8oI0w4SaGfYiG0CRz7Q8mK3/g4u7ZVfmD0B7nOdfb4y1/0H+3yV77A3Ne1DMqlvdr8+JdrYkK2q0eO0MjhZ44QzPijTqu+QObDzEfZ0TVSCr7EPWj12EyyOmv+m/X/YG4E9iHaLGGKEYc63H/NskPetiHKByzP7g6QxRnhhbluHMNkatn0a9H92DttiO7XRK72zHtscv8Ud2H6B5i/ba8ffvD9ubNq/bxx2UX+SrPXkO0QnX+OxpRsYZoeaKJoH93nsA+RMmA1xO+Yh+inger4veGUpXTEMdZN6rc1/LEmEB/9E+8Gz2x2qqmvF00IHuSSX/MXqNHCj0jrNFTF2CwHuqFGj1nxP5o6n4pxwiwZWqPLo6gJ4WNGbti1l85y9xmQ9fkLftz3Z8uQ6amqg65GuH8gU/22h8kGePIPkQpQK747uyoo/+bPpp9iGaA+afN/Xv9QSkgyJltR0TYh8g0v3S/s8o+EXd9HtcWVx9C++kpWCcwJOiK3NNur0+hSMN1elG5Yz12/iDrSHrU6PEBYoV3tq2OpEfzbznlwUjIx1mERk8OZpI39fwo70N0m3mPeY8buZdtr91uYaDi5hoimT3eM4bzeP7Se6Bq4jNHa9eebkeCRs+zHLrp5/sRIPYhujIC1eTmGiL2IcoajoBSj0BJ+CN8MedTpC7/UfAx/eG4mKHK9TjOuEnIP3MUk08mjdeEsQ9RT785FoJb1NHjfx9/YOyu2kOeIVjpF9ceV/4gFqDqrMdDh5h6zj5EQY63yz5EIRb2IQoN1idvdX02E/tlgp+7hqgnmX2IjH8TW89CA0wfu45W5uNIpmmPP+r7EF2lnU+76tLFvhPbOkSiMp7VbG2OgIms1hCpvM8+RB83ab/9m5dPf/ob7dNryfrl39BXv/SrT6+ezmcnZoWt1gzcEBY+sg/RqacWIq6RGfu+HviwM7ZnrCFKOXbE55zdaXA+Ixx1TLtJT8ygYF9DPtoytDrYh+j8Rk89U8YQwD5E2bZtj8kfnGGdX1v6g7o9muSe8poLlvRYf9BaON/ocRg9Lv2+fNiHqLIfJa7Lh32I5IiAfYjG/UbdflqM0PsDMXlSXj6CP7B+zQWr/MFCj8YKwz5ElT/oIdmHSIp6+X7s6xAlHrcP0aVJ++3fbDc7QyIiR5iP5Be/8/QDb7a54ygxvbWGqK9Rub6GiH2IbqwhGqcFPeNrb39eQoKZNAI81xCN00zMeUYj6JGgZ9SDd11DFPMx6Enmgp5eERK+/q6qFfsQpS98Li5GTkc5hgJnH6KifNwXQc+4gYl+LfiDEY+6+NYjwfWYIvsQ9WNI/swg1+DZhyj+etpjH6LT99blmPxblDuCFf7A6ln49cXppT+wfq26Pvt6HdIXKj77EH059iEqpG5h2xoiK7w/h391DdHohar7d88+RNJU7ukMdX76G7IMyz5E519LMz6GpGOk1ayBMPmYtQdDMxGlff9MeqHHabV54LPJZ5jR4/LaFp0O++xDFISbD0OPSar9N38zeqqCcRVqRuDT5mviTIHRY8PWX9RmexwxH0OWSGHX6Ulf2cKo/YHTY+txSPbaHxjzI6zRE/LRV8+gZ5XA8Z2PIQUfeWVsln5t2neGQoRVe4z56PQU/iAILuqxyY2YxlEVcz1mH6Ki/cR6YW2O/PP5eBUrgH2IbrTHwvyojjqPqr44Q3t0etYJNAm7cp9j7wtmcFtFr7bHe/xBvNz74zP8gcnPqtiGHp1H/5sUBLHB/ixbo6dK3gg79byEfYhW9IEc2xnfwb41RObYPrroRZ7OHuf+fYienp6Ze9fSnUak4xoiP7Qw0i9xxkviH8cnVTcSNIP7HnwcQRh27JoBKapNyMc0EtT/o+mEU15eQ+SIawbORpMHDoIAySMnXse0e22IiX2IfNqS0701AjXS0Ur9NlucjjFSGAWLizmPDIf0haEhpydHt9Yz8lGCDlPfpCh/mXqOdKgzvGqP7SzHJGfhD6z9Uo/9ukkxQuwFDz/gm5/kNUS+QqxmwKPdwhEneUV1yf5gJXcxolj5A6/fF8yqPbIP0cIfiLd7jz+wSczZk1qAt2b9m5hyEu9XJeSjfSSJfYiu+AP2IXLHyh+0K/rfdQ3RqtjYh6j2a53Pax+idrmoPhW3G+/JQx6ZU9U71hCJuUJN7t6H6J3T1hueWTsguf6ZM0yC/Ud1J9YtUkXCGu6i5TiaO1fEjES4iFuIpn5WmH2IjCEtysc65JG6EC5kkE+/3lhD1PPtjjVEoz14+0ca2YeIfYhOPa49OXNej8T61mxEpgFGeT4fkx6b/hbq2/JO3egJ/qAwY4q3WBM1nZskcoOWtIbI+ANfPuxDVPkDj9dj/Vr2B7LwB/4v9iGKJ/g7UvYhqv3a9AfBr4XIfX1mH6KQQVmP+p8/xH2I0qP3m9jbIToFt3N49aH7EL1rEns01QiqiIjeWkPUr3PX1xD189mHKDqAEI59iLy5OENzXtBGmHATwz5EQ2iS2U77+YI2WfkDF3fPrsofhPY4z7neHm/5g/67TfbaH5jzop5Rsbxfmxfvak1U0G712BkaKfTEGZoRb9RxzR/YfIj5OCOqRlLZh6gfvQ6TQU5/1X+77g/EncA+RIs1RDHiWI/7t0l+0MM+ROGY/cHVGaI4M7Qox51riFw9i349ugdrtx3Z7ZLY3Y5pj13mi96H6NKOF55s7hdtW0PUmsrxuNnZzZXH7kO0C/YhMnZLMz6GpMPa7Xo0PKMc7Do9Ls+SOaNj2nd6eh6r0aM+H3118YZSldMQx1k3qtzX8sSYQH/0T7wbPb7aHHpC3i4akD3JpD9mr9EjhZ4R1uipCzBYD/VCjZ4zYn80db+UYwTYMrVHF0fQk8LGjF0x66+cZW6zoWvylv257k+XIVNTVYdcjXD+wCd77Q+SjHFkH6IUIFd8d3bU0f9NH80+RDPA/NPm/r3+oBQQ5My2IyLsQ2San8YfVtkn4q7P49ri6kNoPz0F6wSGBF2Re9rt9SkUabhOLyp3rMfOH2QdSY8aPT5ArPDOttWR9Gj+Lac8GAn5OIvQ6MnBTPKmnpe8D5GqjP5G9e7Jd+Uhj8w1+fz2IXrvtMYRdolriGT2oEUkj6jGkQevh32IvH32ISrK58oXcz5F6vIfBR/TH46LGapcj+OMm4T8M0cx+WTSeE0Y+xD19JtjIbhFHT3+9/EHxu6qPeQZgpV+ce1x5Q9iAarOejx0iKnn7EMU5Hi77EMUYmEfotBgffJW12czsV8m+LlriHqS2YfI+Dex9Sw0wPSx62hlPo5kmvb4kvchukgq6i3s6xC12ZRV5wiYyGoNkcr77EP0rswKW60ZKM/oCU4f2Yfo1FMLEdfIjH1fD3zYGdsz1hClHDvic87uNDifEY46pt2kJ2ZQsK8hH20Z+meE2YdIpKeVfYiO81f+wNahruMsUesPzrDOry39Qd0eTXJPec0FS3qsP2gtnG/0OIwel35fPuxDVNmPEtflwz5EckTAPkTjfqNuPy1G6P2BmDwpLx/BH1i/5oJV/mChR2OFYR+iyh/0kC95H6LzProq8fdi6wzRKLdzaOxR+xC9VxqH2eaOo8T01hqivkbl+hoi9iG6sYZonBb0jK+9/XkJCWbSCPBcQzROMzHnGY2gR4KeUQ/edQ1RzMegJ5kLenpFSPj6u6pW7EOUvvC5uBg5HeUYCpx9iIrycV8EPeMGJvq14A9GPOriW48E12OK7EPUjyH5M4Ncg2cfovjraY99iE7fW5dj8m9R7ghW+AOrZ+HXF6eX/sD6ter67Ot1SF+o+OxD9CXZh2jUp6LOvQf79iESU9nOHuqj9iHavoaoP8eo/Tl+Gcd5Sc1PKavTYb7oUznFaPs86rA/1gxo/07MMRkwR/uVniaN3a7HnR1U6PnX0oyPIekYaTVrIEw+Zu3B0ExEad8/k17ocVptHvhs8hlm9Li8tkWnwz77EAXh5sPQY5Jq/83f7JqBQo+rUDMCnzZfE2cKjB4btv6iNtvjiPkYskQKu05P+soWRu0PnB5bj0Oy1/7AmB9hjZ6Qj756Bj2rBI7vfAwp+MgrY7P0a9O+MxQirNpjzEenp/AHQXBRj01uxDSOqpjrMfsQFe0n1gtrc+Sfz8erWAHsQ3SjPRbmR3XUeVT1xRnao9OzTqBJ2JX7HHtfMIPbKnq1Pd7jD+Ll3h+f4Q9MflbFNvToPPrfpCCIDfZn2Ro9VfJG2KnnJe9DJCKjv1E9KPCubHxkzhz1jjVEqcd9cM8+RDthH6K8hsgR1wycjSYPHAQBkkdOvA77FqgWkzXjWIywOyPmmEZUZoHVI2rsQ7QYgerHKFhczHlkOKQvDA05PTm6tZ6RjxJ0mPomRfnL1HOkQ53hVXtsZzkmOQt/YO2XeuzXTYoRYi94+AHf/CSvIfIVYjUDHu0WjjjJK6pL9gcruYsRxcofeP2+YFbtkX2IFv5AvN17/IFNYs6e1AK8NevfxJSTeL8qIR/tI0nsQ3TFH7APkTtW/qBd0f+ua4hWxcY+RLVf63xe+xCl+DaxrUPkp97NM4SyWkMk5go1ed99iL73WuS//6si/+NfSzXqG/bT7/yWvPp9P6uvPv0oP7kalJkE+4/+xLpFqkhYw120HJ9Od66IGYlwEbcQTf2sMPsQGUNFSTuHPFIXwoUM8unXG2uIer7dsYZotAdv/0gj+xCxD9Gpx7UnZ87rkVjfmo3INMAoz+dj0mPT30J9W96pGz3BHxRmTPEWa6Kmc5NEbtCS1hAZf+DLh32IKn/g8XqsX8v+QBb+wP/FPkTxBH9Hyj5EtV+b/iD4tRC5r8/sQxQyKOtR//OHuA/RcWo5J/tebOsQ9WeXm/Ss+vz3IXr1ZtUZyvz1vyOfNrnIH/yHnn7gotVba4j6de76GqJ+PvsQRQcQwrEPkTcXZ2jOC9oIE25i2IdoCE0y22k/X9AmqxFUF3fPrsofhPY4z7neHm/5g/67TfbaH5jzop5Rsbxfmxfvak1U0G712BkaKfTEGZoRb9RxzR/YfIj5OCOqRlLZh6gfvQ6TQU5/1X+77g/EncA+RIs1RDHiWI/7t0l+0MM+ROGY/cHVGaI4M7Qox51riFw9i349ugdrtx3Z7ZLY3Y5pj13mi96H6ExL2ebeg21riOyzouc3n/s+RG+f7usMdf7a39FP2YfI2C3N+BiSDmu369HwjHKw6/S4PEvmjI5p3+npeaxGj/p89NXFG0pVTkMcZ92ocl/LE2MC/dE/8W70+Gpz6Al5u2hA9iST/pi9Ro8UekZYo6cuwGA91As1es6I/dHU/VKOEWDL1B5dHEFPChszdsWsv3KWuc2Grslb9ue6P12GTE1VHXI1wvkDn+y1P0gyxpF9iFKAXPHd2VFH/zd9NPsQzQDzT5v79/qDUkCQM9uOiLAPkWl+Gn9YZZ+Iuz6Pa4urD6H99BSsExgSdEXuabfXp1Ck4Tq9qNyxHjt/kHUkPWr0+ACxwjvbVkfSo/m3nPJgJOTjLEKjJwczyZt6XvI+RNJyOexg2wxRCyMwX8Q+RD/2yTukO46wS1xDJLMHfepr4Ws/8uD1sA+Rt88+REX5XPlizqdIXf6j4GP6w3ExQ5XrcZxxk5B/5igmn0warwljH6KefnMsBLeoo8f/Pv7A2F21hzxDsNIvrj2u/EEsQNVZj4cOMfWcfYiCHG+XfYhCLOxDFBqsT97q+mwm9ssEP3cNUU8y+xAZ/ya2noUGmD52Ha3Mx5FM0x5f8j5EXZNKy23yPdi3hkhURI9nFi/tnjVEKl/EPkQp3Te7lyPB6SP7EPX8K4WIa2TGvq8HPuyM7RlriFKOHfE5Z9frZ+yYp+Io9MQMCvY15KMtQ6uDfYjOb/TUM2UMAexDlG3b9pj8wRnWtse1P6jbo0nuKa+5YEmP9QethfONHofR49Lvy4d9iCr7UeK6fNiHSI4I2Ido3G/U7afFCL0/EJMn5eUj+APr11ywyh8s9GisMOxDVPmDHvIl70MkR5LuuH9/HvvXEJkhoQ9xH6II+xCZGycbePVMbXdBwX4qGHujLrY9BN3sQxTMBT29IiR8e1tVK/YhSl/4XFyMnI5yDAXOPkRF+bgvgp5xAxP9WvAHIx518a1HgusxRfYh6seQ/JlBrsGzD1H89bTHPkSn763LMfm3KHcEK/yB1bPw64vTS39g/Vp1ffb1OqQvVHz2IfqS7EPU4945PSRb1xD1f2ePXNiHqBptn0cd9seaAe3fiTkmA+Zov9LTpLHb9bizgwo9/1qa8TEkHSOtPe/U/F1pD4ZmIkr7/pn0Qo/TavPAZ5PPMKPH5bUtOh322YcoCDcfhh6TVPtv/mb0VAXjKtSMwKfN18SZAqPHhq2/qM32OGI+hiyRwq7Tk76yhVH7A6fH1uOQ7LU/MOZHWKMn5KOvnkHPKoHjOx9DCj7yytgs/dq07wyFCKv2GPPR6Sn8QRBc1GOTGzGNoyrmesw+REX7ifXC2hz55/PxKlYA+xDdaI+F+VEddR5VfXGG9uj0rBNoEnblPsfeF8zgtopebY/3+IN4uffHZ/gDk59VsQ09Oo/+NykIYoP9WbZGT5W8EXbqecn7EM22qIt8fzc2zhCJGzFhH6Lzk6obCZrBfQ8+jiAMO3bNgBTVJuRjGgnq/9F0wikvryFyxDUDZ+3LAwdBgOSRE69j2r02xMQ+RD5tqfHfGoEa6WilfpstTscYKYyCxcWcR4ZD+sLQkNOTo1vrGfkoQYepb1KUv0w9RzrUGV61x3aWY5Kz8AfWfqnHft2kGCH2gocf8M1P8hoiXyHSTJH1by7/6gTnEcmVfp8/ufrWFbLyB16/L5hVe2QfooU/EG/3Hn9gk5izJ7UAb836NzHlJN6vSshH+0gS+xBd8QfsQ+SOlT9oV/S/6xqiVbGxD1Ht1zqf2z5E7XxjfvBf78vGfYjmHypzBExktYZIzBVq8r77ED0/3cWz6T6ESbD/qO7EukWqSFjDXbQcR3PnipiRCBdxC9HUzwqzD5ExpEX5WIc8UhfChQzy6dcba4h6vt2xhmi0B2//SCP7ELEP0anHtSdnzuuRWN+ajcg0wCjP52PSY9PfQn1b3qkbPcEfFGZM8RZroqZzk0Ru0JLWEBl/4MuHfYgqf+Dxeqxfy/5AFv7A/8U+RPEEf0fKPkS1X5v+IPi1ELmvz+xDFDIo61H/8we5D5HO/L01aPMc9r1lrndBTXf9UfsQfbRxmijOEIneWkPUr3PX1xD189mHKDqAEI59iLy5OENzXtBGmHATwz5EQ2iS2U77+YI2WY2gurh7dlX+ILTHec719njLH/TfbbLX/sCcF/WMiuX92rx4V2uignarx87QSKEnztCMeKOOa/7A5kPMxxlRNZLKPkT96HWYDHL6q/7bdX8g7gT2IVqsIYoRx3rcv03ygx72IQrH7A+uzhDFmaFFOe5cQ+TqWfTr0T1Yu+3IbpfE7nZMe+wyX/Q+RKk89rB1DZHoPIo8cB8iVfnl39BXe9J9JJh9iIweF9DHkHRYu12PhmeUg12nx+VZMmd0TPtOT89jNXrU56OveN5QqnIa4jjrRpX7Wp4YE+iP/ol3o8dXm0NPyNtFA7InpXaYy1iNdauj0FMXYLAe6oUaPWfE/mjqfinHCLBlao8ujqAnhY0Zu2LWXznL3GZD1+Qt+3Pdny5DpqaqDrka4fyBT/baHyQZ48g+RClArvju7Kij/5s+mn2IZoD5p839e/1BKSDImW1HRNiHyDQ/jT+ssk/EXZ/HtcXVh9B+egrWCQwJuiL3tNvrUyjScJ1eVO5Yj50/yDqSHjV6fIBY4Z1tqyPp0fxbTnkwEvJxFqHRk4OZ5E09L3kfIndNed6pV9m4D9E8tstj9yFSFf2lX9VXIk1++hvy6XulO46wS1xDJLMHLSJ5RDWOPHg97EPk7bMPUVE+V76Y8ylSl/8o+Jj+cFzMUOV6HGfcJOSfOYrJJ5PGa8LYh6in3xwLwS3q6PG/jz8wdlftIc8QrPSLa48rfxALUHXW46FDTD1nH6Igx9tlH6IQC/sQhQbrk7e6PpuJ/TLBz11D1JPMPkTGv4mtZ6EBpo9dRyvzcSTTtMeXvA/R5dKGz9jJtg6RRVUfvg/R01vRX/zO21e/9Kvt1Vv32rn2jeem9UakJuFlAAAgAElEQVSInuD0kX2Iev6VQsQ1MmPf1wMfdsb2jDVEKceO+JyzOw1q7Jin4ij0xAwK9jXkoy1Dq4N9iM5v9NQzZQwB7EOUbdv2mPzBGda2x7U/qNujSe4pr7lgSY/1B62F840eh9Hj0u/Lh32IKvtR4rp82IdIjgjYh2jcb9Ttp8UIvT8Qkyfl5SP4A+vXXLDKHyz0aKww7ENU+YMe8iXvQ5S279jE3g7RKbj3CR+6D1FTUW36VuZ90LtkD/sQmRsnG3j1TG13QcF+yn17oy62PeRydHrG197+vIQEM2kEeK4hGqeZmPOMRtAjQc+oB++6hijmY9CTzAU9vSIkel2Zdcbr8PZjx0tNe/THXI42QexDVK25aSHB8w/2Ier+Jfq14A9GPOriW48E12OK7EPUjyH5M4Ncg2cfovjraY99iE7fW5dj8m9R7ghW+AOrZ+HXF6eX/sD6ter67Ot1SF+o+OxD9GXZh8gMQKZK9+5sW0PkWsTZQ33kPkT9uUc5Tx3HZ8I+ROdfSzM+hqRjpNWsgTD5mLUHQzMRpX3/THqhx2m1eeCzyWeY0ePy2hadDvvsQxSEmw9Dj0mq/Td/M3qqgnEVakbg0+Zr4kyB0WPD1l/UZnscMR9Dlkhh1+lJX9nCqP2B02PrcUj22h8Y8yOs0RPy0VfPoGeVwPGdjyEFH3llbJZ+bdp3hkKEVXuM+ej0FP4gCC7qscmNmMZRFXM9Zh+iov3EemFtjvzz+XgVK4B9iG60x8L8qI46j6q+OEN7dHrWCTQJu3KfY+8LZnBbRa+2x3v8Qbzc++Mz/IHJz6rYhh6dR/+bFASxwf4sW6OnSt4IO/W85H2IRvCNnSGRBz0yd2lNH74PUeiwqrxb3rAPUV5D5IhrBs5GkwcOggDJIydeh30LVIvJmnEsRtidEXNMIyqzwOoRNfYhWoxA9WMULC7mPDIc0heGhpyeHN1az8hHCTpMfZOi/GXqOdKhzvCqPbazHJOchT+w9ks99usmxQixFzz8gG9+ktcQ+QqRZoqsf3P5Vyc4j0iu9Pv8ydW3rpCVP/D6fcGs2iP7EC38gXi79/gDm8ScPakFeGvWv4kpJ/F+VUI+2keS2Ifoij9gHyJ3rPxBu6L/XdcQrYqNfYhqv9b5vPYhurSmb5epeHc2dojU/GWeIZTVGiIxV6jJ3fsQhYz3KXhGqrV4Nj3qUm+/f1R3Yt0iVSSs4S5ajiPqySN5x4cWoqmfFWYfImNIi/KxDnmkLoQLGeTTrzfWEPV8u2MN0WgP3v6RRvYhYh+iU49rT86c1yOxvjUbkWmAUZ7Px6THpr+F+ra8Uzd6gj8ozJjiLdZETecmidygJa0hMv7Alw/7EFX+wOP1WL+W/YEs/IH/i32I4gn+jpR9iGq/Nv1B8Gshcl+f2YcoZFDWo/7nD3EfIu2VczNbZ4i63sN3PG4fouN45nC4n3x2msMMkeitNUT9Ond9DVE/n32IogMI4diHyJuLMzTnBW2ECTcx7EM0hCaZ7bSfL2iT1Qiqi7tnV+UPQnuc51xvj7f8Qf/dJnvtD8x5Uc+oWN6vzYt3tSYqaLd67AyNFHriDM2IN+q45g9sPsR8nBFVI6nsQ9SPXofJIKe/6r9d9wfiTmAfosUaohhxrMf92yQ/6GEfonDM/uDqDFGcGVqU4841RK6eRb8e3YO1247sdknsbse0xy7zRe9DdBE3QL+LbWuIuugp7oH7EImejwQf5/YO8XMz9TClInI+z6w6k+KTIf3W5zgaPd2mmi9MguzP/qjD/nwOVp0OrQ2YY/6KfYh6Hpj64OqFN5SqnIY4zrpR5b6WJ8YE+qN/4t3oifVYNeXtogHZk0z6Y/YaPVLoGWGNnroAg/VQL9ToOSP2R1P3SzlGgC1Te3RxBD0pbMzYFbP+ylnmNhu6Jm/Zn+v+dBkyNVV1yNUI5w98stf+IMkYR/YhSgFyxXdnRx393/TR7EM0A8w/be7f6w9KAUHObDsiwj5Epvlp/GGVfSLu+jyuLa4+hPbTU7BOYEjQFbmn3V6fQpGG6/Sicsd67PxB1pH0qNHjA8QK72xbHUmP5t9yyoORkI+zCI2eHMwkb+p5yfsQicrsiG/sEe2bIbI9QH3sPkTO7HJo4s5kxxF2iWuIZPagRSSPqMaRB58g9iHy9tmHqCifK1/M+RSpy38UfEx/OC5mqHI9jjNuEvLPHMXkk0njNWHsQ9TTb46F4BZ19Pjfxx8Yu6v2kGcIVvrFtceVP4gFqDrr8dAhpp6zD1GQ4+2yD1GIhX2IQoP1yVtdn83Efpng564h6klmHyLj38TWs9AA08euo5X5OJJp2uNL3ocoxbeJfRuzanNPgD56HyKxGf8esA9R+NkoUCnWDAwdXcbCE1ktwb6vBz7sjO0Za4hSjh3xOWd3GpzPCEcd027SEzMo2NeQj7YM/TPC7EMk0tPKPkTH+St/YOtQ13GWqPUHZ1jbHtf+oG6PJrmnvOaCJT3WH7QWzjd6HEaPS78vH/YhquxHievyYR8iOSJgH6Jxv1G3nxYj9P5ATJ6Ul4/gD6xfc8Eqf7DQo7HCsA9R5Q96yJe8D5GIyEXbKI1d7OsQmeOh69YaouaO77IPkUjr/xcVkVdvnp837ENkbpxs4NUztd0FBfupWtobdbHtYV2O/mtvf15Cgpk0AjzXEI3TTMx5RiPokaBn1IN3XUMU8zHoSeaCnl4REr2uzDrjdXj7seOlpj36Yy5HmyD2IarW3LSQ4PkH+xB1/xL9WvAHIx518a1HgusxRfYh6seQ/JlBrsGzD1H89bTHPkSn763LMfm3KHcEK/yB1bPw64vTS39g/Vp1ffb1OqQvVHz2Ifqy7ENUtLkNbFtDNNeOzKcgP+99iC4i8ju/Ja/uTfPv+lZ7xT5E519LMz6GpGOkteedmr8r7cHQTERp3z+TXuhxWm0e+GzyGWb0uLy2RafDPvsQBeHmw9Bjkmr/zd+MnqpgXIWaEfi0+Zo4U2D02LD1F7XZHkfMx5AlUth1etJXtjBqf+D02Hockr32B8b8CGv0hHz01TPoWSVwfOdjSMFHXhmbpV+b9p2hEGHVHmM+Oj2FPwiCi3psciOmcVTFXI/Zh6hoP7FeWJsj/3w+XsUKYB+iG+2xMD+qo86jqi/O0B6dnnUCTcKu3OfY+4IZ3FbRq+3xHn8QL/f++Ax/YPKzKrahR+fR/yYFQWywP8vW6KmSN8JOPS95HyJtvezv9CN3sm+GqPme3hexD9EnH4v+3p/VV00u8tf+jn56Lb2/61vt1e/92adX7EOU1xA54pqBs4DzwEEQIHnkxOuwb4FqMVkzjsUIuzNijmlEZRZYPaLGPkSLEah+jILFxZxHhkP6wtCQ05OjW+sZ+ShBh6lvUpS/TD1HOtQZXrXHdpZjkrPwB9Z+qcd+3aQYIfaChx/wzU/yGiJfIdJMkfVvLv/qBOcRyZV+nz+5+tYVsvIHXr8vmFV7ZB+ihT8Qb/cef2CTmLMntQBvzfo3MeUk3q9KyEf7SBL7EF3xB+xD5I6VP2hX9L/rGqJVsbEPUe3XOp/XPkSHhvnkwS627kPURx0u7Yvbh+irH6n+/p99++r3/Iy8+urH5n6rXyBV5NVbaRd5kk8+bso+RCZsTvkIkHX04lt4IqMljnA7eyPiFqw+Yw1RuDM4L8W+aHKBpdNd+dhwIYN8+vXGGqKeb3esIRrtwds/0sg+ROxDdOpx7cmZ83ok1rdmIzINMMrz+Zj02PS3UN+Wd+pGT/AHhRlTvMWaqOncJJEbtKQ1RMYf+PJhH6LKH3i8HuvXsj+QhT/wf7EPUTzB35GyD1Ht16Y/CH4tRO7rM/sQhQzKetT//CHuQ9Tr9sbJIRHZPEN0HMc3X8g+RKpNvvKx6FdSBZ7mjo5ST29z0YreWkPUr3PX1xD189mHKDqAEI59iLy5OENzXtBGmHATwz5EQ2iS2f1BvqBNViOoLu6eXZU/CO1xnnO9Pd7yB/13m+y1PzDnRT2jYnm/Ni/e1ZqooN3qsTM0UuiJMzQj3qjjmj+w+RDzcUZUjaSyD1E/eh0mg5z+qv923R+IO4F9iBZriGLEsR73b5P8oId9iMIx+4OrM0RxZmhRjjvXELl6Fv16dA/Wbjuy2yWxux3THrvMl7wPUde2c3ZIZPMaIlGZI0TyRe1DlL5YWZ7plvM5RNWZFJ8M6bc+x9HosSYK+zEF86jD/nwOVl2ytTbg9YSv2IfI1sWcXdFQqnIa4jjrRpX7Wp4YE+iP/ol3oydWW9WUt4sGZE8y6Y/Za/RIoWeENXrqAgzWQ71Qo+eM2B9N3S/lGAG2TO3RxRH0pLAxY1fM+isyn0vuOromb9mf6/50GTI1VXXI1QjnD3yy1/4gyRhH9iFKAXLFd2dHHf3f9NHsQzQDzD9t7t/rD0oBQc5sOyLCPkSm+aX7nVX2ibjr87i2uPoQ2k9PwTqBIUFX5J52e30KRRqu04vKHeux8wdZR9KjRo8PECu8s211JD2af8spD0ZCPs4iNHpyMJO8qedF70N0dv52zxJtmyG6NN/D/qL2IbIjQaPneaUXyT5EeQ2RC35rxivaNQLSyE3XYfMxjcAEeXZEuqWfixGoMCKUK5wzxD5EsR7HGTcJ+WeOYvLJpPGaMPYh6uk3x0Jwizp6/O/jD4zdVXvIMwQr/eLa48ofxAJUnfV46BBTz9mHKMjxdtmHKMTCPkShwfrkra7PZmK/TPBz1xD1JLMPkfFvYutZaIDpY9fRynwcyTTt8SXvQ9S6qBj/e7KtQzSete6jZ6MLuFpDpPKYfYjyiNcR1jjgdqQ3rxkolfUEp4/sQ2TKvezhNxvhsO/rgQ87Y3vGGqKUY0d8rvxPgxo75qk4Cj2pQnn7GvLRlqHVwT5E5zd66pkyhgD2Icq2bXtM/uAM6/za0h/U7dEk95TXXLCkx/qD1sL5Ro/D6HHp9+XDPkSV/ShxXT7sQyRHBOxDNO436vbTYoTeH4jJk/LyEfyB9WsuWOUPFno0Vhj2Iar8QQ/5kvchsv2Nd3khw4p9L1U4Z4hE+gjA578P0VFu6QuxlXY9ozEz2M5ssA9Rj7cnV8t8TDeP9kZdbHtYl6P/2tufl5BgJo0AzzVE4zQTc57RCHok6Bn14F3XEMV8DHqSuaCnV4SEr7+rasU+RJU/MOYXI6ejHEOBsw9RUT7ui6Bn3MBEvxb8wYhHXXzrkeD6Msg+RP0Ykj8zyDV49iGKv5722Ifo9L11OSb/FuWOYIU/sHoWfn1xeukPrF+rrs++Xof0hYrPPkTPXEN0nve570PUxp1oUenenX1riM7/mH7u574PkbpEqMnldW6zD9H519KMjyHpGGnteafm70p7MBQrTrDvn0kv9DitNg98NvkMM3pcXtui02GffYiCcPNh6DFJtf/mb0ZPVTCuQs0IfNp8TZwpMHps2PqL2myPI+ZjyBIp7Do96StbGLU/cHpsPQ7JXvsDY36ENXpCPvrqGfSsEji+8zGk4COvjM3Sr037zlCIsGqPMR+dnsIfBMFFPTa5EdM4qmKux+xDVLSfWC+szZF/Ph+vYgWwD9GN9liYH9VR51HVF2doj07POoEmYVfuc+x9wQxuq+jV9niPP4iXe398hj8w+VkV29Cj8+h/k4IgNtifZWv0VMkbYaeeF70P0Sj/Z596lY1riI5jE5Em+oXsQ+RGOO7sebIPUV5D5IhrBs4MzQMHQYDkkROvY9q9NsTEPkQ+bak+3xqBGulopX6bLU7HGCmMgsXFnEeGQ/rC0JDTk6Nb6xn5KEGHqW9SlL9MPUc61Bletcd2lmOSs/AH1n6px37dpBgh9oKHH/DNT/IaIl8hVjPg0W7hiJO8orpkf7CSuxhRrPyB1+8LZtUe2Ydo4Q/E273HH9gk5uxJLcBbs/5NTDmJ96sS8tE+ksQ+RFf8AfsQuWPlD9oV/e+6hmhVbOxDVPu1zue1D1F/E/3zzrrNxjVE/vMXtQ+R2N69i7qN7/qNRP1+/qTMJNh/VHdi3SJVJKzhLlqOo9Cj9nP/sYVo6meF2YfIGNKifKxDHqkL4UIG+fTrjTVEPd/uWEM02oO3f6SRfYjYh+jU49qTM+f1SKxvzUZkGmCU5/Mx6bHpb6G+Le/UjZ7gDwozpniLNVHTuUkiN2hJa4iMP/Dlwz5ElT/weD3Wr2V/IAt/4P9iH6J4gr8jZR+i2q9NfxD8Wojc12f2IQoZlPWo//lD3IfomHG8P/y9bNyYVYbgQ9cXtw9RXYG9udX7+UVvrSHq17nra4j6+exDFB1ACMc+RN5cnKE5L2gjTLiJYR+iITTJXPuDycofuLh7dlX+ILTHec719njLH/TfbbLX/sCcF/WMiuX92rx4V2uignarx87QSKEnztCMeKOOa/7A5kPMxxlRNZLKPkT96HWYDHL6q/7bdX8g7gT2IVqsIYoRx3rcv03ygx72IQrH7A+uzhDFmaFFOe5cQ+TqWfTr0T1Yu+3IbpfE7nZMe+wyX/I+RG5AdSPb1hC1M1/nRYp9iKrR9nnUYX8+B6su2Vob8HrCV+xD1PNgVfzeUKpyGuI460aV+1qeGBPoj/6Jd6MnVlvVlLeLBmRPMumP2Wv0SKFnhDV66gIM1kO9UKPnjNgfTd0v5RgBtkzt0cUR9KSwMWNXzPorZ5nbbOiavGV/rvvTZcjUVNUhVyOcP/DJXvuDJGMc2YcoBcgV350ddfR/00ezD9EMMP+0uX+vPygFBDmz7YgI+xCZ5pfud1bZJ+Kuz+Pa4upDaD89BesEhgRdkXva7fUpFGm4Ti8qd6zHzh9kHUmPGj0+QKzwzrbVkfRo/i2nPBgJ+TiL0OjJwUzypp4XvQ+Rzv7GMyaWbrJ3huikXdiHaI6g6Oj5+199Dz6OIAzzaYQ9CvBH9iEKI0K5wjlD7EMU63GccZOQf+YoJp9MGq8JYx+inn5zLAS3qKPH/z7+wNhdtYc8Q7DSL649rvxBLEDVWY+HDjH1nH2Ighxvl32IQizsQxQarE/e6vpsJvbLBD93DVFPMvsQGf8mtp6FBpg+dh2tzMeRTNMeX/Q+RK3wFRt4SIdI9Z41RCrsQyRFqRZ6umm1EXdHXDxTa8+2NWf0xL39mF9dgYp/tpV9iAqJqjfWENlnhNmHSKSnlX2IjvNX/sDWoa7jLFHrD86wzq8t/UHdHk1yT3nNBUt6rD9oLZxv9DiMHpd+Xz7sQ1TZjxLX5cM+RHJEwD5E436jbj8tRuj9gZg8KS8fwR9Yv+aCVf5goUdjhWEfosof9JAvex8iidVoC1s7RPa+RIR9iI6ja7LLkdOZYEk3uD6Tp26nQ/yxRxDrzLU1RC7w6pna7oKC/VQ77Y262PawLkf/tbc/LyHBTBoBnmuIxmkm5jyjEfRI0DPqwbuuIYr5GPQkc0FPrwgJX39X1Yp9iCp/YMwvRk5HOYYCZx+ionzcF0HPuIGJfi34gxGPuvjWI8H1mCL7EPVjSP7MINfg2Yco/nraYx+i0/fW5Zj8W5Q7ghX+wOpZ+PXF6aU/sH6tuj77eh3SFyo++xB9OfYhkou4Afpd7FtDdE5fNPNMIPsQXXs+W4f9sWZA+3dijsmA1+Py0egRo8edHVTo+dfSjI8h6RhpNWsgTD5m7cGQK7Ns3z+TXuhxWm0e+GzyGWb0uLy2RafDPvsQBeHmw9Bjkmr/zd+MnqpgXIWaEfi0+Zo4U2D02LD1F7XZHkfMx5AlUth1etJXtjBqf+D02Hockr32B8b8CGv0hHz01TPoWSVwfOdjSMFHXhmbpV+b9p2hEGHVHmM+Oj2FPwiCi3psciOmcVTFXI/Zh6hoP7FeWJsj/3w+XsUKYB+iG+2xMD+qo86jqi/O0B6dnnUCTcKu3OfY+4IZ3FbRq+3xHn8QL/f++Ax/YPKzKrahR+fR/yYFQWywP8vW6KmSN8JOPS95H6IeSe937GLfDFHoOLMP0flJ1Y0EzeC+B7/UY9cMSFH0IR/TSFD/j6YTTnl5DZEjrhk4MzQPHAQBkkdOvI5p99oQE/sQ+bSl+nxrBGqko5X6bbY4HWOkMAoWF3MeGQ7pC0NDTk+Obq1n5KMEHaa+SVH+MvUc6VBneNUe21mOSc7CH1j7pR77dZNihNgLHn7ANz/Ja4h8hVjNgEe7hSNO8orqkv3BSu5iRLHyB16/L5hVe2QfooU/EG/3Hn9gk5izJ7UAb836NzHlJN6vSshH+0gS+xBd8QfsQ+SOlT9oV/S/6xqiVbGxD1Ht1zqf1z5EKb5NPOSROZF71hD1E3zJsw9RoUft5/5jC9HUzwqzD5ExpEX5WIc8UhfChQzy6dcba4h6vt2xhmi0B2//SCP7ELEP0anHtSdnzuuRWN+ajcg0wCjP52PSY9PfQn1b3qkbPcEfFGZM8RZroqZzk0Ru0JLWEBl/4MuHfYgqf+Dxeqxfy/5AFv7A/8U+RPEEf0fKPkS1X5v+IPi1ELmvz+xDFDIo61H/84e4D1FPQVXk78O2DlGzx/M/7EMkeUZl6Ah6JOgZDiBWkhnOR9P80QczZ6/XELn72TAkNNMf9KyGznp8yQGEcOxD5M3FGZrzgjbChJsY9iEaQpPMtT+YrPyBi7tnV+UPQnuc51xvj7f8Qf/dJnvtD8x5Uc+oWN6vzYt3tSYqaLd67AyNFHriDM2IN+q45g9sPsR8nBFVI6nsQ9SPXofJIKe/6r9d9wfiTmAfosUaohhxrMf92yQ/6GEfonDM/uDqDFGcGVqU4841RK6eRb8e3YO1247sdknsbse0xy7zRe9DFI672LaGyNLO9xOzD9GVZ2t7HGqfUVaXbK0NeD3hK/Yh6nmwKn5vKFU5DXGcdaPKfS1PjAn0R//Eu9ETq61qyttFA7InmfTH7DV6pNAzwho9dQEG66FeqNFzRuyPpu6XcowAW6b26OIIelLYmLErZv2Vs8xtNnRN3rI/1/3pMmRqquqQqxHOH/hkr/1BkjGO7EOUAuSK786OOvq/6aPZh2gGmH/a3L/XH5QCgpzZdkSEfYhM80v3O6vsE3HX53FtcfUhtJ+egnUCQ4KuyD3t9voUijRcpxeVO9Zj5w+yjqRHjR4fIFZ4Z9vqSHo0/5ZTHoyEfJxFaPTkYCZ5U89L3oeoXfJQwg72PjLXZn6xD1EfwdDR8/e/+h58HEEY5tMIexTgj+xDFEaEcoVzhtiHKNbjOOMmIf/MUUw+mTReE8Y+RD395lgIblFHj/99/IGxu2oPeYZgpV9ce1z5g1iAqrMeDx1i6jn7EAU53i77EIVY2IcoNFifvNX12Uzslwl+7hqinmT2ITL+TWw9Cw0wfew6WpmPI5mmPb7kfYhEZj6/w6lLtnWI7IjqRZr87r9fXvkQTTQ/77GKbVey3pEv2v5OnqPl3rA/Svkj8qOl50dJC9wHZf6yoLxfFpT3y0Lvvsn/KB4XHZW7Cef3+KKde8+/lY73SW6fpdvYH9rXIbp8dBmDyQAAAAAAADtpIiKXtALzvdk8Q3ROfi3fyAIAAAAAAPAOtOMx292zp/veMhee1QcAAAAAANjJ8Tb6vf2NfS9V0PkGd554BQAAAACArejct2pnf2PrDFF/S0d/TwkAAAAAAMAOmrTjtXf2LYcb2LYP0Xy3OB0hAAAAAADYi98ncl+8+94yZ94PzxoiAAAAAADYyeXSzq2S9vY2HvKWOV6+DQAAAAAAO1HzzoKd/Y29a4iOv8Yu1QAAAAAAADsY3Y3Nky/71hCpOdIfAgAAAACAjbj+xka2dYh6j6014Yk5AAAAAADYiutvbGTjPkTmTzpEAAAAAACwkd0zQ51tM0QAAAAAAAAP40GTLvteqtD/w/ohAAAAAADYzKP6G8wQAQAAAADAl4uNs0X71hAxNQQAAAAAAA9lf59j3wxRm9NYu9/8AAAAAAAAMPobG+Pc+sgcc0QAAAAAAPAIWpv9jZ39DtYQAQAAAADAi2Vvh4hH5QAAAAAA4FE8oL+xtUPUwhEAAAAAAGAHTUx/Y2OHY1uHqCeKFyoAAAAAAMB2zoVDu/sbrCECAAAAAIAPnwdNvGzbh0hVx8axTBIBAAAAAMBOVI8pot1vtt7WIbpcLipydIaOaaenXVEDAAAAAMAL56PLRZ9k/+TLtkfmVFRUjp7bExsSAQAAAADARp509jd2dje2zRC11uQiIk/nEQAAAAAAYButyUft6G/sZOsaoidponIcAQAAAAAAtmH6G21jf2Nbh+gjuwsR/SEAAAAAANjI5dLONyp8oDNET/31cqwfAgAAAACAzYz3FGzub+x7y1w7NklSYXNWAAAAAADYy0dnH2N3f2Nbh0hERI/XPojyzBwAAAAAAGxEdf6xs7+xr0M0lhDRGQIAAAAAgAfQZHt/Y9sbsp9URPQ4NhYSAQAAAADATpqO/sbOfU+3dYjYewgAAAAAAB6FnRfa2ffY249pdIwAAAAAAOBBPKC/Qf8FAAAAAAC+XGxcRrSvQ9T3Y228VwEAAAAAAPbSbH9jY7zbOkQtHAEAAAAAAHazu7+xcR8iLf8EAAAAAAB4b3T8ZyusIQIAAAAAgBfL3jVEff5KmSICAAAAAICNqI7+xs53FuxfQ9RE5MJKIgAAAAAA2MjZC9r9AreHPDKnzBABAAAAAMBG9EEvKnhIh+jCe7cBAAAAAGAj7UF9jH0doj4rpMoSIgAAAAAA2Ivpb+zscGx77XazOxExQQQAAAAAABuZM0R7+xvbOkRj3ZCK0CMCAAAAAICd+P7GPvZtzPrRRZsc6TteMsdzcwAAAAAAsId2uTxka9Z9HSJVUTm6RMoMEQAAAAAAbEZHl2hff2PfGiLzTB8vmQMAAAAAgJ3MPsbezsbmNUTHDFFjhggAAAAAADaiej4upx/wDFFrIqp0hgAAAAAAYC9Njlki3fxE2taNWcfrwOkTAQAAAADATprfimgXG2eIdsUEAAAAAACQeUSfY+Maovn3pfHKbQAAABclCzsAACAASURBVAAA2Ik+ZHnO1kfmmCQCAAAAAIBH0GT2N3b2O7Z1iNr5nyZ7n+kDAAAAAADoL5fr/Y5d7NuY1XTXmCkCAAAAAICHsLmzwSNzAAAAAADwwdPal+GROaFTBAAAAAAAj2N3f2PfI3MyFw4pi4gAAAAAAGAjqvqQ127vfWTuTOCFTYkAAAAAAGAjl9Zmh+hDfKmC3zWWGSIAAAAAANiHnq+ZU/1Q1xC1eWwXZogAAAAAAGAf7exw7H4Ybesjcx2WEAEAAAAAwE70QU+hPeS120wQAQAAAADATi6tPeTN1vveMqdHn+34R48IAAAAAAD2oaqiuv9tBds6RO3cKanp/uf6AAAAAADgZWP7GzvnX7Y9MqfSe2wsIAIAAAAAgL2oyOhv7HxnwdYZoibH43LMEAEAAAAAwE4ubS7P+YDXEB1dItYQAQAAAADATlTlIU+k7V1DdPy1K0oAAAAAAIDBsYxob39j3xoi7c/1sYYIAAAAAAD2Mt5orXvniLbNEF0+atpERLWJijJNBAAAAAAA22gicrk0Vd37zoJ9G7Oez/Sdy5yYJgIAAAAAgG201rT3Nz7Qt8yNv7YmEAAAAAAAQKT3OfY+jLatQ6Qq5zvmRBp7EQEAAAAAwEaaqIju72lse2SOd8wBAAAAAMBDaUd/44Pch0hFxhQRnSIAAAAAANjNI55D2/dSBQs9IgAAAAAAeBQf5FvmROa75XirAgAAAAAAbEVHf2PnO60fsoao7XwxOAAAAAAAvHh6H2N3T2PbGiL7RJ8yQwQAAAAAABt5VB/jIWuILswQAQAAAADARh71FNreNURnGpkfAgAAAACArejsb+zsG+1bQ2QSxwQRAAAAAADspJ09l919jYc8MscSIgAAAAAA2MmXag0RM0QAAAAAALCVB3Uytr1lTlWlSV8/RI8IAAAAAAA2oiKiKip7exvbOkSX1kTasUmS0h8CAAAAAIDNtEs7NmXd2N/YOkN0/CE8MwcAAAAAANtR1e2vtN7WIWqX/pq5XTECAAAAAACcNJF2/Gcr2zpEx6vlmqjokVAAAAAAAIBNtPFA2t7+xr4O0fmYXJPGzqwAAAAAALCfPku0kc1riI73zDFDBAAAAAAAuzleW7D3rQr71hCdb5kTbWM6CwAAAAAAYBftIttfab13Y9b+0gcmiAAAAAAAYCPt3PR099zLzn2IRtpU2YkIAAAAAAD2Yvscu9i4hmj+fWm8VgEAAAAAAPbR2tz6dCd7H5kDAAAAAAB4AI96BG3fSxX6fx7wXB8AAAAAALxsVPV4kdvmzsZDZogaK4gAAAAAAGAjzXYyNvY3HvPI3CMe7gMAAAAAgBeLPug5tH0domaOTBEBAAAAAMBGxgzR5q7GxjVEs8fGBBEAAAAAAOxE1fc5dsEaIgAAAAAA+OB5VB/jQWuIHhIrAAAAAAC8UB71FNrWDtF4rI/djQAAAAAAYCOXZmaJNs4WbVtDJP2V4I01RAAAAAAAsJfRxdj86BxzOQAAAAAA8GLZNkOkZlrosrvbBgAAAAAALxt9zF5E+1673Zo0OaeyeGQOAAAAAAA2cmx3uv/F2/semdOzv3a8IBwAAAAAAGAro7+xsVu0dYbo6AjRGwIAAAAAgM2Mt8y1D/MtcyoqosdDc6whAgAAAACA3Whfn7Pxubl9M0TS1xDRGQIAAAAAgL2089/u/sa+fYhGR03NjkkAAAAAAAB7GDNEGztFG9cQjb/oDwEAAAAAwHbaA95ZsHkfovHibQAAAAAAgG34/sYHOUN0zAyp9rc+0DECAAAAAIA9tMv5zgL9QN8yJ9Kf6ZtHAAAAAACAHcwZItk697JvY1YbaaNHBAAAAAAA+3jUewp2PjI3ekGqymsVAAAAAABgH6rS2mX7zMvWGaLeC+ItcwAAAAAAsJPW2uxvbIx3a4dI9z/SBwAAAAAAICqmv7GxR7SvQ2S6ax+xiAgAAAAAADZy6X2MzU+jbXzL3OwD8ZY5AAAAAADYio7/bOUxa4h2RgoAAAAAAC+eJo/pZ2zrENnOEDNEAAAAAACwk97H2N0xesg+RLxlDgAAAAAAvgzs7RDREQIAAAAAgAfQxn/28pA1RAAAAAAAAFtpj9n3dO8aIqVTBAAAAAAAD0Jnv2MXj1lD9IhIAQAAAAAANrNtHyK1r5bjrQoAAAAAALAZfcDrrLd1iFprxyu3d0UIAAAAAABguLS2vb+x75E51XPzWBYSAQAAAADAZprM/sZG9s0QXc5eEI/LAQAAAADAA2j93dsbuxyb1xDx0BwAAAAAADwAVdHe39B9PaJtHSIZa4ja2WGjYwQAAAAAAHtorfcy9j6Rtq9DpLMLtLHDBgAAAAAAYJ5I28vGt8zVfwMAAAAAALwvrbWHrNDZuIZIzgQ+pucGAAAAAAAvGRXVtr2/sXeG6HzrAzNEAAAAAACwk2beWfBBvmVORMb01QM2kAUAAAAAgBeM62Ns7G/s25jVRUqPCAAAAAAA9tEe1MfY+MhcGynUJ94zBwAAAAAAG1GRdmnbe0VbZ4h6L6g9ZN4JAAAAAABeKm3v0qHBtq7L+T6F+aI5AAAAAACATajI6G/sfInbvrmcNo88LwcAAAAAAF8G9r1lzkwLMUEEAAAAAADb6X2OD/0tcwAAAAAAAF8G9r1lzn64NGWeCAAAAAAAdtFa02Nj1r1LdB4yQ8QaIgAAAAAAeAS7+xrbZoj6Wx9E6RABAAAAAMBeWjv7HJsfRGMNEQAAAAAAfLn4IF+7LfqYLhsAAAAAAIDI2eXQrRuf7nupQpsbEfHIHAAAAAAA7Ka1/b2NfWuINvbSAAAAAAAALI/qbzxghujoufHoHAAAAAAA7OLS2kN6GNvWEPUem6rufKQPAAAAAADgWDsk+2eKts0QXY4H+o5n+lhEBAAAAAAAG+lPpO3ub2zch0hFzr1jjz1kAQAAAAAA9nDMDLXzDXP7+huPecscj8wBAAAAAMBGLtKO+Zf2wb5l7uin0RcCAAAAAIDd9KVDe+eHtq4hOo50igAAAAAAYDuXo6+xe3HO1hkiAAAAAACAR/Co/sa2126LCG+XAwAAAACAh9DGf2Rrv2Nrh2i+TIHpIgAAAAAA2ImO/sbOl7ht6xA9oLMGAAAAAADg+GDXEEmb/bSmbEQEAAAAAACbafs3+Nm7hqhDdwgAAAAAADbyqC7Gxg6Rnh021g8BAAAAAMBmmoz+RtvY52ANEQAAAAAAfGlwb5vbwEMemaNTBAAAAAAAXwb2dYiYIgIAAAAAgAfR0h972LsPUT8+4O0PAAAAAADwcmmtPeRV1rxlDgAAAAAAvlTs7G7s24dIdbzrgekhAAAAAADYiYqOjsbO/sa2DlFr7eiqqUhrInSLAAAAAABgF5fWRM/+xk62dYiOHtuZwoc83QcAAAAAAC8VVRWVJqJjBmYLW2eIju5QY3IIAAAAAAA20+TSRPTsd+xi8xqiZmaKAAAAAAAA9qCqIr2/sZG9a4hEZG9/DQAAAAAA4Hwire3vb+xbQzQ6akfPDQAAAAAAYCdHn2Nvf2PvxqxNRKTtXOMEAAAAAABwzA71/sbGeLfPEPVn+wAAAAAAAHbh+hsf4lvmLudcE2uIAAAAAADgEYw1RBu7HA9YQ8T8EAAAAAAA7KWJ6XNsfNHc3jVE6Q8AAAAAAIA9PKKbsbVDNGFnVgAAAAAA2MnsY+zsGG3rELVwBAAAAAAA2EZzh23snSF6UCIBAAAAAOBl08Z/ZGuHY1+HiCkiAAAAAAD4krHtLXOtiTY5n+xTukUAAAAAALCXSxPVvW/d3r+GCAAAAAAA4MvC9rfMHR0j3jIHAAD/f3v382JZet4H/HnOra5WzagVK8ooJDhgsDb5sYoDgRCSQQ7IBAQCIa9E7EWwsvIfk1W0MSZY2YhsIyfEYgIBLxw5i0Q2JhKy0EBidZQR7l+a6qrzeHHOufdUTfV09/RznOq5nw/UvefW7Tp9tl++7/u8ANBpyhi3e6jCLFNfBAAA9NkqY2wSiKo0RAAAQJ+tMkZrIDqENg0RAADQKfd5o7MsapsyF1GxD20KIgAAoFPVNGJunTsaNI7dXsW0QSICAAD6ZC4NUe9qtLZAtF7TZwsRAADQqao2WYnWuGQuYzmYdRhim6cFAACO0rAbakkZt/Jg1qiaItBGyQ0AADhe+5hRt3kP0bymzzFEAABApyFXR7Pexilz0x6inDcQSUQAAECfdUPUmTf6GqJhNRTckjkAAKBZZvQeQhSdQxVWIciSOQAAoN1tnjInBAEAAFvZKm807iE6XAtHAABAty3OO+0buw0AAPCa6QtEuW6GTFUAAAA61T5vdK5IawtEyzNl71hwAACAK3mj0yZL5vRDAABAp60yxjZ7iFREAADAa6DvHKKoyJiSWzWfHgsAABy3ioohprzRmTT6ziFavacwBAAANFoyRnfS6GuIMvcVUY2j0QoAAECfqojdUN2biTbZQ5ROZgUAABpdyRi3cex2RETOac2UOQAAoFNV7fNGZ+DYqCHa4q4AAMCxWjdEt3KoQtS0nM98OQAAoNs0ybp/NVrflLlcT32waA4AAOgzDNvMs24LRFU1rZUrYQgAAOi1P+q0OW+0NkSZ0/GsJRQBAADNhjlvdM4s6G2IhCEAAGAjVdGeN9oC0bSmb2qKahSKAACAPhnTDp3uM08bG6L9VeSQZbACAADQJYecy6HeudaNe4j2V123BAAA2JsyR2/eaDuYtWoqhWo+jwgAAKDLUg5VVeugud4pc9NV1y0BAAD2loaoM3G0NURRh9QGAADQKWPVEjXety8Q5bV3AACAbs15o2/K3Oo61UQAAECnqqjmkdsRnQ1RKIcAAICN5DaL0toC0ZWHaz49FgAAOHJzxuguYVobokX36bEAAMBx2ypjtO0hWrdC1Xx6LAAAcNxqo1VovQ3RnIE0RAAAQKfMbTYR9e0hmp9PFgIAALpVVcznst7OoQprQhEAANBpGKaQ0R012vYQZeZ+UV9ViUQAAECbqorMoX0jkYYIAAC49baaU9AWiKapDzW9O4YIAABoNA2ZW/JGX+BoWzI3zFMVMrYbiQcAABynaYBb7gcrdGkLRPsQpCACAACaTQVRf9joG6owHGKahggAAOi230d0exuijIjqn4UHAAActzlqVFRE41DrtkAU83q+iozUEAEAAN3mDUSd/UtfIKqKWmIbAABAo2l4W8TUEd3ChugwFzztIQIAANpl94i5aN1DFPt1fUoiAACg1bJ1aMkdTRqnzM15KCNq7LorAADAZMg5D93GQLQ/hqgqhkynEQEAAG0ys6rW0617tAWiYX7PzrgGAAAQhwjUnTfaG6L5U9dtAQAA2s8fWgzP/ycvT0sEAAB02ipjbBKITN0GAAA6VXWePnTQGoiW0DakRAQAAPTJjP1Gos5g1BaIljCUaQcRAADQbA4Z3WezbrJkbpMuCwAAOF77sda9t22bMrfuhewhAgAAOr0We4gWhswBAACdMvP1CUQ2EQEAAK1qm5ixTSACAAB4DbTtIcrMaVFfRVRtcIQsAABw1HLI6q6JNEQAAMDr5TaO3a55UV9FGaoAAAD0WlajTUvS2m7btmRumFNQRkaZuw0AADTKmKZZd8+aawtEV0KQPAQAAHRa2qFmnUMV9tcaIgAAoFtusDenuSGaF/YBAAA0m3qXJXf0aBuqkJExzGv6zFQAAAC6LXljuI1T5qIqajqDaJO1fQAAwBFb543GuNG3h2hYTZnruikAAEBM+4f2U+YaG6LGPUQ3XwMAALyq6fyhXD60aZwyd7iWhwAAgFY57R3qzhqtDdF+xlz1Tn4AAACO2zSroH97Tt9QhZUt5oMDAADHa1hljM600RqI9kv6rJkDAAAa1XoL0a0cu72+6c42IgAAoM8wbJMx+gLReqiCOAQAADTaKmO0NkQ5v3SeHAsAAJDDIW906hu7PTdYGRoiAACg2TTOun2W9SZ7iAAAAF4HAhEAAHC0BCIAAOBo9Q5VmBf0makAAAB0ylrljdt4DtEWDwcAABAR+9alO2+0TZmr1Wi51BEBAADNaoNx1m2BaMhh/3RVJREBAACt1pmjS3NDlDEPCAcAAGhTV176+pe+g1kz5ziUm1RZAADA8cqIGHLKG53L0doboopatUUAAACvrqqm8qV5RVprQxQZkbYPAQAAzTIzYujPG30N0fJS3ZkNAAA4dhUVURlR1Tp7u7EhWl3YQwQAADTKzClzNB9E1LiHaJkxVwbNAQAAraqmcQp1e6fMLY9l9DYAANBrWBqi2zplbl0MWTEHAAB0WmeMzrgxNN5rr3lZHwAAcOS2yhibBCINEQAA0GmrjNEbiObUpiECAADa5bX3Bm2BaD9UISMMVQAAADpl1j5vdPYv7UvmlEMAAMBWuvNG35S5VSuUkSoiAACgzZQx+mPGJkMVAAAAXget5xA5khUAANjK0hHdyj1Eh4EKYSMRAADQb4Oc0dYQ1epdHgIAALpV9K9IM2UOAAC4/XL11hg6Ghuiw9CHFIsAAIBmVXPgaKyJ2gJR5iEEiUMAAEC3debo0tcQVV2bMicWAQAATeZ2qHtmQVsg2g1DRcyBqEoaAgAA2mRmZGbd2kBU+0crZxEBAACtruaNvkjUu4coI6IczwoAAPTKzMghprxxK6fMLYmtNEQAAECvqprCUPOiuf6GKDJSJAIAABrlkDFkTMvlGhui3oNZl7Hg8hAAANCpppxxmOTWo7Eh6roTAADAVZnzT/N9G/cQ3XwNAADwqrbKGL1L5gAAAF4jrYHIsjkAAGATdcgbnbGjLRDJQgAAwGbyGdevqH0PUe3HPohIAABAl4qqbN9L1L6HSAwCAAC2cmunzEXOUS0PlwAAAH2qPRGZMgcAANx6W61E650y13kzAACAlS3yhoYIAAB4rdzesds5vedgFxEAANAnh6wlb3TSEAEAAK+X23kO0XIQ0fJ8dhQBAAA91nmjU1sgyuEQgFIWAgAAGg2ZhyzUmDfalsxVVURFVFT76bEAAMBxW+eNzsDR1hANuSyUUw8BAAC9cqO80byHKGNa1CcUAQAAfa7mjT59e4j2G4eye58TAABw7DI3Gd7WuIdoeReHAACAbVT1zizonDJXmRFRGVFlzRwAANAmYz6ctbJ1qnX7HqJl+gMAAECXqpimzFXvzIJNpsyNEhEAANAs41ZPmTtcWy8HAAB022eOxv6lbagCAADA60YgAgAAbr2tVqG1BqL8wAUAAECPvPbeoS0Q5fwyPZyhCgAAQKOsQ95oTESWzAEAAEerbcqcVggAANhWf+boa4jyxksAAIBbq3+oQi6nxwIAADSpuja3oEfvUIXlOnVEAABAn60yRvtQhQwNEQAA0GvJGN2xaJspc4OGCAAAaLRRQ9Q2Za6q5nqo644AAACLmqJGc97oG7udGZnT8w0pFgEAAH2GYTjkocayqLchiojqfkIAAODoXc0bfdoCUQ65j0HiEAAA0ClX87Y7txP1DVWomtNatac2AADguFXFJnmjryFa9UOOIQIAADodMkZv2GjeQ7SMmZOIAACAPodWqDdv9DVEaQcRAACwjbz60qZtD9GS2OwfAgAA2s05qCpazyJqa4h2Q9ayYm6sUhMBAACthiGre4dO4x6i6xcAAAB9pnbo1u4hisOaPqEIAABolkveuJUN0f4FAACgV8Z6VVrfffsOZg3z5QAAgO1sMde6NRAtjFQAAAA6bbUYrS0QOYUIAADYWnfe6DuHKKZmaNpLZDMRAADQp6L2eaMzbWyyZC7VRAAAQKNhnTFu45S5dU6r5tngAADAcauqyOxfibZRQyQMAQAAfbbKGH1DFdK5rAAAwDaqKjY4l7VzydxENwQAAHTLOWl0542+QFQ3XgIAALyyqorc4MDTTfYQDWoiAACg0VZ7iNoaosNkOf0QAADQb5pV0Js32gJRZkZmRFXO4QgAAKDPMEx5o7Msam6ITJgDAAC2UVVT3mjMHG2BaJjnbmdEjFIRAADQbNlH1NkQtQ1VqJjSWkXFsMURsgAAwNHKzFr2EHX2L617iOYrcxUAAIBWefWlzSZT5rYaiQcAAByvw5S5vrzRO2UuIqr97FgAAIDpvNPuvNEWiKIOK+U2OEAWAAA4YjUfedrbD3U2REPWci5rlUgEAAD0yl1W9/i2xj1Esa+IpCEAAKBb9xlEEY1jtyNCEgIAALZ3G88hivXUbQezAgAAnWqb5WitDdE+Exm7DQAANFqmWkf0ZqLeJXMzDREAANBpq4zRN2Vu/a4gAgAAGm3RDkW0nkO0SmwKIgAAoFFFRG7QEm2yZM4WIgAAoNOwUcbYaA/RFncFAACO1VZ7iDY5h0hDBAAAdMrMTWYVtJ5DtDyfhggAAOhUtT7mp+++bYFoi4cDAABY684bbVPm1mv6ZCIAAKDbFvuI+s4hWkW1MncbAABolHE1c3RpbogyxCEAAKBbTVFjfukLRo1DFXJaz2cTEQAAsIF93miMHO0NkX4IAADYQlX/erTWPURTUMvNDk0CAACO17QYLVuHuPUtmatlSV+ZMgcAALRb8kZn/dLXEC3RKjNq1BABAAB9DuMKbu0eov1VZKZEBAAAtMnMeWdOzSPnejTuIdpfdd0SAABgb98QNWptiPajwSPkIgAAoE1FRVY2n0LU2RBdewcAAOhymGndqzEQHfYNjTX27nQCAACOWlXFkEP7rIK+sdsruxSGAACAPrlRxugNRPMzmroNAAC0Wm8easxGmzREg6nbAABAo60yRmMgqv2PhggAAOg0LmcQ7X969AWinG+WYZ4CAADQa5U3Ope5tS6ZGztvBgAAMKs45I3O3LHJHiIAAIBOWy1CE4gAAICjJRABAABH66TrRlUVGZ3zHgAAAFaq2vNGWyDKzBhyGodXJRYBAAC9hiFjrIihcUNRa0M0RoQsBAAAbGGsiqreKXNtgWiXuR/9oCECAAC6DTkHjtvYEI1RETXtIkoHswIAAI2GmLbnxD539GgLRPu0FqkhAgAAeuWyd6i3felriKoi5jlzVTUtoQMAAGgwVkXu51rfxoYoVg1R100BAABiyhtT4ugtXtoOZh0rImp6HyUiAACg0Vi1zxudDUzjlLn5PRzOCgAA9BoyI3PKG50azyG6+RoAAOBVHfYQ9WpbMhcR++V8OaRIBAAAtNkNQ63GFrTpmzJ37eF6kxYAAHDMxmW4XHNJtEluGUzcBgAAGg25TXhpa4gyD8vkxqoUigAAgC5jReyGrO6Y0RqylpvZQgQAAHQahkPG6AwxjQez1vw+T5nTEAEAAF0qIrLal82ZfQAAABwtgQgAADhaAhEAAHC0WgNR2jcEAABsJDc4mLUvEOUzrgEAABp1xo22KXPjWDHkNB9cUwQAAHSrqhjrlo7d3s0nse5yelAAAIBOmRm75vKlLRDV/vChmmeEd90ZAAA4dhnzeafRW760BaKMww6nan5IAACAXL122aQhqqpIG4kAAIAmV1akNWoLRJvMwAMAAIiY8kZGdOeNtgENYy3v1R3aAACAIzfOg9u680bflLmMiIzY2UMEAAA0GzIj57zRWRL17yGqinIWEQAA0GisiqycR831hY2+KXPrNX2pIQIAAPrs5oYobm1DtH8JDREAANDqyhFEjf1L21CFNWEIAADotFXG2CQQlRVzAABAo60yRmsgUgwBAABb2eLk076hCtfeAQAAumyVNz5SQ3Rycrd2uzsWxgEAAP/f7XZ36uTk7kfKJy1L5v7Vv/zSGxXxNDNq+em4LwAAQETEOmtUxNMcHrZkjhcPRO/c8FC79yoi4uu/9TuPxhjf63ggAACAG83r5WqVPZZMcsU7L37Ll26ITk9Pb0xil+dPv7te2HfTFIhMJ7YCAADPdlNmuJ4tLs6ffvemv31WVvkwLx2I/uja5xxOKiLi8c8e/4/l4NgIZxEBAAA9MiMi56iRU/aIOGSRxfWs8iLaxm5//wfv/sEY40+rIqJaD48FAACOXNX0cxnjT7//g3f/oOu+LYEoh1196Vd/4zuPH/3s28/9t5bNAQAAN7hxudy1z+8/+tm3v/Srv/GdHHZ/yUMV4q39f3hy8m4Nw2kNPzmpYTfVVJm7+uEPfvity8vLH0VERY1RzzhOVigCAADWnpkRqqJqjIyoi8vLH/3pD374rcwpDA27kymTDKd1cvLu6u/feuG88YKB6JvTDe/du/HGOewqh4f15a/+2u//2f0ffyMjLzMzcrWR6PofCkUAAEDEh2eDJVdU5Hj//o+/8eWv/trv5/CwntkQ7TPLN18ob5w84/cVzzoE9uys4vw8I6YDkMbdexVPzyIi4sGjXX3+C1/8xn/5vf/0qc/+1U9/LWI8Wd/mhifa/6qqjGEAAIAjsQ5Bz1pZNn8bkXnxf+//v6+//YUvfuPRkzs17OZ77N6r3e7s8MdnZ8+50Qc9KxDd7J2I+KVpnN3Fxd06n4NRDieVw2XluKthuKx/8vlf/je/97v/4c//+ltvffXOycnfepFba4wAAIDrnl5e/ujPfnz/d375V/75v9vt7lTmrqYVaierLT13az9y+52Xu//uQ77Lq9d/NyMeZ/zN87x/cZF/rd6Ly8tPZT28zHjjLKvGjHqSd98/zbpT+dv/9t9/95/+o3/4gzfe/MTFycmdv5GZn4hcDijKiKip+lp99r3vfe973/ve9773ve997/uIjMu6+OmDBw++9Sd//L3f+uKX/8W3hqFqeHxST3ePa9jdqd3Jae3eu6iTk7M6Pf0/9Se7XcSdOxH/+25EvBnzEO6K58gX/G6+/krG2/czfvzj4XPn53lx8fN5fv5gePpzT4bL83vDePH+MF6cDZ9843y4vHw6jJd3h6oxf/vr//rv/+Iv/sI/uPepe3/vE2d3//aQu08PmS/XTgEAAB9bY9XFWJfv/ezJ+3/84OGD//n9//Wn/+3Xv/abf5g51LB7f9zt7owPH5+OJgZArwAABPxJREFUw8mTcTi5O+5OH4x3fno2np7eG09O3q3vnZ5WfPazY7zzVq32D60D0Y3h6KOFkrOz+l5E/MJF5DRt7mnVz51UjReVw8N68Ois3jwba9i9P46Xd4df/9pv/mGM43+vszFr/ER+4fP/+JO/+5/febx/sho/LJgBAAAfQ5nDPqT8yj97+43/+O3/+jCHn1U+GSqGoZYwlLmrB492NeweVg6ntZ8ud2daJve909N6zv6hZz/DS3yfEV+ZPn9IS1TjRY4X58N4eTa8efZ0qLrMGs9yHC+GGKfgswSj/Z0FIgAAOD6rQLQPQhERw1DDcDLm8KQyd/XoyZ1x2D0Zh5PTMYeT+vB2KGJuiJ7bDkW8dEP0zdqHohtaovjMg/Hy/N6Qw2UN8WR89OQs7r055JjnGXEalXPweX/MHM/3IehKQ/TGyz0RAADwGnl8uFw3RDGcVO6mz1MzdD4Ow525GXoyLoMUdqcPxg9vh15s3PbieYFo2eF09fqdtyrenm9w/m5F/HxExPj0J4+G+MyDMeJe1HiREU/i4eNP5r26zOHNixrHMZfGKIZDEMpYhaL3X+bxAQCA18oyMnvdDs3XSyM0DEPlozv1IKdlcutmaPjJSd258+Z4cnJ3Ooz17K9U3LtXh3YoIl6wHYp4/pK56//mMFwh7mf80oOMJ09yvXTu8vJpjp+5yGX5XI2X888UjOrNyxzHcdUOXV55hhrPLJ8DAICPqRyeXAkomYcDVqcgtKsHuavl8NXrzdBud6euLJU7O6v4zr2KeLlhCvv//0Wf+4PX88S5B1dD0cXF+/n06aNh/MxF1uWnc7y8yOvBKOIQhD51L6LGSyEIAACOTA67+vMH8/UcjK4HoWF3Url7r643Q/swtG+HXj4MRXzUKXOL1dK570XE5+LdWJbPjT89z8vLB5nXglHE+T4A1XiZDx9fveUSmAAAgI+fHB5eCSnDbgpG03e7ijiN60Fotzur4c5pPTsMvcLzfMR/u1o6F3FTUxQRcXHxfo7jeS7L6CIi6vLTGRExXl4cls2NF0IQAAAcmRxODsvldtN17t6riIhledwwTEEoIuLZYeijtUMRHz0QrT5fC0UR8axgFBFxefl0CkTjRcZbV2+4hCUAAODjawk9e/cjhjkc7XZ3pkD0rCAUES8Qhm76fPOzvOyz3/x5DkVxP+PtiKUtioj43Pn5HIoO4SgiYlyN3b5uCU0AAMDHxxJ2bjIMp3P4OYSgiHmsdkQcWqGIaYBCxKuGoYiXD0Q3/c3q881tUUTE34mI8/NDCFoC0nVLYAIAAD5+lsDzwd+/u//96elp/dHy4cNboYhXCEMRHy0Q3fR3HwxFS1sUEftwFLEPSGvXwxIAAPDxdiX0rK0PWb13b7p+J+KGVijiFcNQxEcPRM/62xuCUUTE/bk5mj+uAxIAAEDEtQAUcQhBEc8JQs/63XO9ajB51t9f+/1Xbvh39z/4u7df8WkAAIDb752bfnnT+OxvvmgD9JFHb3c1NS8YjBY3BSQAAOC4fSAALdqD0KI7mHzY/YQgAADgRX1Y2HnlILTYKqQIPwAAQLe2ILTYOrgIRgAAwKtqD0KLv+zAIiABAADPs1kAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADYxF8AbuWhys8yDUYAAAAASUVORK5CYII=":this.popupOption.triangle?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA0QAAAJ8CAYAAADeR2FaAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAACAASURBVHic7L1L7G9Ldt+16ndv39tPt2N3d0zSJND4Ad3YEYnBsYhQ2xZigsOAGAlPmAFCTCIxYICEQCAYwCgoIniChMQAjOTIA4SQLYOUOIofwjZxnMYkxvK7/ej0TT/Ouef8FoNdj7W+a9Xe+/c/tfve7v5+js6/fr/927uq1qpVq3ZV7dolQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEPI1SPkaTYsQQgghhBDy1Y1+JRK5upPCThAhhBBCCCHkVbmsc3RVh4UdIUIIIYQQQshqlneMVndc9uJjJ4kQQgghhBBylr3Oz7KO0apOyiyeyfEfYueIEEIIIYQQAvzPs47Oo8dP86odk5MdoawD9Fl/7NOvmBNCCCGEEELIVw8/hQc+mnRuQgdpecfoVTpE2bXmGHaCPlt6p+ettzhDRAghhBBCCPF86ENbx+anRGIHyXWOsg7QkzpFT+2Y4HV5R+jT2yzQD/zz/9H3fuAb//i//4EPfuT7b6+//t4PfOgjHxRRkVJEVOvlScjf+Tt/5+/8nb/zd/7O3/k7f/+6+f2Lb/3hP3r59vMvf+ELf/CTX/jc7/43P/Ez/9lPi4jIT9nO0W7HCL8fUh69ILnGfK+dIdMR+uaPfuKvfeM/9k/8M09IhxBCCCGEEPJ1zOd+59f+7h/83t//d2LHaF2n6NEO0aQz1GaF6mNxb71VfvAH/9v/+GN/6jv/w9def+O1B9MghBBCCCGEEBERefHi+cvP/vov/Zc//uP/7n8iH/qQ+sfpesfoyZ2iRzor+52hT3+2yDe/VeT58/Kv/cUf+Svf8ok/+5dfe+21m8g2M8aQIUOGDBkyZMiQIUOGj4a322u3b/imP/Evffxj/8LH/t4v/ej/Kn/ieZHveCHyax8QkU8VkV8Wkb2n2PY5fSKcWz+bztBbbxX50pfKX/w3/oe/8i3/1D/3b2/PBg6+/MXPv3jr93/rxRf+4e++/aUvfO7ly7e/rFKKtPPiE4SlhvaX9ERg1hncsqr90UWVUoqoxvOL08rZ9P0Bf9ptPCk5MjDJP3KP4hURkZtIEVG9S5GbqIxwnxpBmn4J56lo/oSn0eNMkFIy80r0mIin1QL0SEFJ+UVZduRRkXKz6pjLI3KLBw/K0cqRyVOkJHZ0hiqPjmq0hQXKa08eyQsWMeUY5LHyp8kc2CMYlCraW4Fo5/Wx3LL098vR+gHjjg4ynOU/K8fE3sJpM3+Q2++sHJ1fm9hbSd39xK+l5+X+wF9/rxUKy/2W5jv6t6K+eK086K6SjJ72q5k8JXmkPdd7TDnxq8XbL/q1afN1VB/35HH+oCSXJ/JEt+/t0v18IE/9oewKCNhyPPQHB/Joje+gfc6OOnnQH6Rt2USeNLmD+oMXGjua19tYjtF8ZvZ2Up4DQx0/o59upyV2tONffAwlcY9RnpkkI/1J9HvylBKr/44/mMrj0i9y180T3qWFT2+fSyk7mcj8QeZO0K+V+POuP5jUH1sfb1l9zNNvvP7G+24f+qZvef0b//gn3vjox7/jzfd/+KPvwXN++//9uf/8x/+nf+s/lfe9T7fZot2ZolOOdNeWJufVz7Ez9C//K//V9/6p7/z+n3jtPW+8JqaB/qPf/vtf/s1f/dkvNT8lqvN0uwHhnUM4UWY3uOmBXeMZ8YnquLGK7dsTG7Qzan7EgMtxlE8yYBPpqLFJ+mfEUSmvle3+CNJN5YmO+NUatFJPPMyu7uuy20HT0xl59uTwP2A7mzVoJ+/Ud/Mf7xsmHV28/q4ir+05NJtQctTcH2/h2QbFRLyTQVvu6Hf3G7TjZCGBqT/YjQ/TP5A7K4+d9ugwvnHa1vHbM88uz8n7rzPpjxvMoujXcit4rAO9l81RPmfkOEdP1vrpvegwi9MKN6k/ePrpG7wJ1q/fRO53ldstHJ66/2I7rDvpl5k8tvyLiDbHcDbzBw5rtGenbh/O+9VJOeY3uCdQESl6WH4qKq9JieWRFVAyXjejyHY/lNXH3fqTyiGn7fBe/XTP/ivWR1GRW7n36/fsOC2fmT2dvDM+vl87IK1wI5JpeyAit1vxzekT2ucs4r36H+I7k77R5X67dofLNht9/Y333T7xXT/wgT/57X/uAzb6l28/f/nrv/STP/C//2//wU+v6hSdfWSuxM+fKrYz9K3Pn5dPfN9f/vH3f8M3fWycXeTXf+Vv/qPf/41feVY7QaVfP3FIQ2HzkSg4EZj8MBnheXgE6vDnTJ7sRjoZYT+XgJfH6fGBEaju0evXe43zbi7SmTyZQWce4cSd1akGbq+4E48+TTuRJzTQE3ubxXlyxm8+slV27uBPgCPSYYbIyr0Tb7cDFdEqT28c5uXY5blXNTT7af+lxicHjb8zqJHNPlJ3Rp7pjSbKPeTJ6uN+cc70iPWxHQJ7w+LGeA8HhPbLMZsBH+llt6kQX2sJd/1rfnWzg25H1p9MR9itA9IQ4e7IcEnkeXgG3ttF5g+ipHv3S5BxODNrz/bN9kF/YMuxFLnfRYrW4tCqZd3Sb+OSbXhSJQnv6uozzvrP5GmSx+xDeYvs2IZUx6K9IGJzESqcOJ2f8geDkbtNnrvq5g6lOLfY3ZspwTTGkOGD+oO/mHZZQW3dvzay5qn75eoP7lpvM/fax/PtcztwlzJuI2yoKlr9kNYBGbQzj21Ayo4/uFd7u/e4Uvtt5VPL8aw/CO2O8avR3o7jC/dX9b9KNW9RKbrzREzMyKbPw9STJ2LAr3q/VoIefYT7fnXEZsonnQGuobOYQBGRcn/5tvzhb/0/z77w+c++/bF//JPva9ffXnvtVsp7vufZ3/7v/9ofqorc7zIen/vlQ93MEnzknPr5h4rIZ4v8udEZ+id/8K/++U/82R/4qS6nFvnD3/nVL//mZ37+y11BYN85SUXYZeIosUE7nCEa8Tk7m/qHyQxRiK5l5FzqQZ5Z+36m5Hr684zGBg0IIxinBYGZARNCuiczmDYo09NL9X9nHPqeLqcOeR66RA7SP/Jp/gb3UPxzcpiDe3L08jlXcfd/rPZjZ4pO1R8707dbjlsV3y8XebA+Jic9er+QRfDABXt+bTTQ5ygnMqwS9XiYoXOpq6T5x/POzhDJ6Lgdnq4+u48VWEqpjuBwwubkfecsI7k969NHpBvOr2t+WJIZIoF2dObXDhTr7PkmR82Uyd0sooN0Zqed7ThPyvGu2xNBI9STI+w1dyfs0c6fhfKxB17T0/bcy/GwfTsakDzOf0zc2FvQ37n82/T7DFGSfjZDlJYPXn/2/goagidP4GJ9nBiOc3+3oulM27SgjrnB9XN/cKLCNXZ06U4Pj1lHvuO7/9UPtpmidt0/+Pmf+PQ/+PF/72/96htvqLzvfSo/9yHdXrTw+CzRmRki6BC1R+W+WOT58/KtX/zi7cWLj5c//Rd+6L/4wIc/9ql28pe+8PkX/9///X9+cUtfR0wHDer4efEaonrnuTeCmnM2/TxD21E7Q5TUnF1mJxSI5uBRPpTnXi90IxbFfFaxI/sq0mf4ffHtVf3iRdBEnql6H1hDlN4ZYC2clI+5PLW33ThFjsrxWJ6S1IczhrGd98priOKQnrGBFtGQO8hj7SjYkwQ76pGECDcB7rU+3ns6B/I8yR8YeRJ/sM8koSesIdr3B3t30vNsOXmCvWVxQnx2hihJYO9RyyJS7aFEO5rKkw2ZjvT31+DN6uMZ/5rJk80Qna2PNn2jEMjjoT+IDvZcuvWC+33zB/e7SKkzRKr2/zYztM0QRbdvZyI08Qe4xuBpawqDg0nE2UaWtzWymtpdVFijJIf3yzGbGSrVH225LCHX2jUwUgjhkT+Igvtf6syC1nIUhdD61ZLEAjND2jN+0r/s+tVS9eVniLz7tzNEksywtXDEZO0i1scx85DNEIXyMTNDe81QKJ9Va4hc+1jchGep9bHNDPUnKDVGk/mDNkOU56Tp7+QSDGNEXn/SR5Y1iSBkT2z5bPV2f0DVlvcxn//933j7I3/yO9544833vyY1yrff/tIHfutn/8aPfUT/SP7wve9V+Y438SULp3n94PeSfjaPyr148fHy4sWz8v5v+Mj3WcW/9Qe/+aKUm/hF/9Kn53tsMEReagSlKrDgBf1rLXB8pDnccdQP9fmAIlId+/YbZkeqAUm/rFUTE62KN+COBgsp1YB8Oio2GF/KGMHQ2YhJjzhE01yzmtNyA96cRFGp+ks6UkNQd21oAIoIaqH9Wm5F44wQOOJi5BGrp1J/zm40TSrNcZXRga4d0GKLPxpe+6bDHky6/choWdrZUR6XJXgO1opXFMdXt4lLo9DhllvxmRv14FAU7LnlEKsJ2KXR473UASkTOrb0e4Za/nv53OoFbZQZlgPovdQZoWJmhmzD0xWxXd7Ckf8y9Jf4gy6KTjrsmT8YDL2VEfqIx8cictdSR8pKH3F0tuJjll4itmFxsRt5kmpks906vJ67P9mI6G62JzeqQV+bwkM1bfls9XHYAUjR7WF4ulovS6tGfqY4GJzTQ7ez4A80HYK/S6kDrC0EpVp/UENfHkZ/w8GJK+Oy1cs+si12BNWUozENJ15L11WA4GirKvDRnbwce/mUeBPp0y9O/k2NOkaabxj6CHRUgC74aHeGURUox8ZdS5hRyduP0p33fvsWW1bfTg87c/YG/mCotIww+AOriJbFbMAmA+y4RhKfWwF5ejsdiz34N+PcsD72cAiwfYSh/9i+5eXYzu55053VlMMhJe2b8WstMht/vc75aVuaWkYbGtrHemb7WZPyAX/Q2hdXCs5BQPkkHQ5nZ9AZaPWxx2LT7X7VOcAtnV5tjb0VFbXlF/yh1Z8OPQb5rf6SDjs6xqEMI4cY/bXysbXSixXqZZQ7tbq3n39Rf/83fuXZBz75F97T9P3+b/jI97148ayIfFzkS7+3JflpsRu4WstIrGRw1CECfmjosz4q90JE7vfn5T1vvv9DTShVkS987ndfjHowevGDesujWJK+QbEVM46oqWlY2mW9xQEDzrlnDRs8VD3cvXV540bHq9inv904+UWRY+p2G4HCBrpp4p4mkDfQtqH2DUKU38kTGmg8UcO1bsarOwIcYS99BtT5E5SnZ7Skpmo7ns7R9BPGyIV/Rrm4IkEJem60HK8hUpGt1Fz1Hm2QuzBZIGwuuMvd2YH2ejCytZ0+Jvf7jVlajdVdH2/QpN8Y3rTADeJoE0VrZygMJRUQGFOHEfbkWQS9FxMm5eMiVGcH48Z2PEng6o+pF7cauRsRTP1B5hM2CZw/KMUPSNT6UId2auh1ifXRNSIqx2uikhte3x5lLZ+xueAPWm7HjQHWB+fXrK2lTYe6Y+GG3TwS2RSJ5e39AvqDEuTfpB7l3Ts89yLQH5JeLqpynz0a6Suw+SHza/aiUSDbLELLmw2TckxVaEaGQY/+3Nju7NXHIE/wa+aPejv2ctQwjMwVd8LQih/o6AMGwY5U7i3d3fo45Dd3gP6rM0Wfk0TM+Ax1T18msRyMsNcEQvnkEUZ/YO0N1WTsqLdr6A/aX7UxQPL2EeVbMY8qG3uDm2jvD/L66AQ0ekzFhQrlyseqRLMYgjqivam5F4saEL+GKLG11B+APLb8nWAj/6bfB5FbhyxOj8OOrT/IXwqiNZF+v9NGL7HiJsLZjoezZyu3eh+Uq9NcmGQw8wdZOdr6qGl5m4KCW4XP/c6vvf2nP/kv1lNUXnv99Tfv9+dF5E391ufPy6+KiHzoQ/WaHyqwcesuex2ipLUXEamzQyLSZodevny7vPd9H3zTaufLX/jcy03xt+og7/VR4ZuvMP0NMy30DX4YkcZKX3xoR4JChUzoI9Kl5WK2hqhVEHsDoG7ALcvQrdZgHEC/td/jkIHL3xhRK/mMEcjfFr2O6GwLIqaIqjx9hmWM2HuH5g+EGS9M1yivJK950TuUD+Q/FK8dOTHpjxOKC7PFkGBwLqG2tAyiGfZ20CCEGaoi8aR2qIjcaoepz4AIfOgHbvWyWl/0Ppny9vZzq/JgrbpVOW7QIPTiKS0sPmxxT1puPxIkEqozCOZnihJNQX2IcoiT4zYUtvnN5gd6vZz5A4Hy9PXxVssRBsjFVfhWL0GPXmwfQcsjTIyOC7r86pNr2dWbdL+a2UPwBzfz9d7TndUHEC/ePxz5g1sLu0H6y8OaQvQH3bBc2P1l96sichO5hZsAr8fNjnVnzQCWj7vcFJ/PUPPr2QyRr0d5u+NGhqO45kQoH6ntTsv+zB9M5Ch4nh1hl+Cu5X4r6UxRj6WeWO5NjlZO1Q8FwfyBu8r2lrv7ZM2Ny7gGOYotx6Q8oz3jTJFvH8P9Rm/XfDuBCbiBNZlWL8GbC/8EQe4Pivk6b5/rxdg8Qn3EmaISCrzZ2eS+4NAfTMS1hmjqROxwTGpCsGNrb+r9ms2eYPs8eWTxUX+AhmA7bM4OQJ7p1ypPLUfUY0/G3m/ckmY5OLqmp8l9DtRLbB+iPedy9Fi6HXj/Nk7woauPMFhQz2iF2H/8/B/99tvDG4q8/4Pf9KGXL98ufZbojd/T1kcZm7a64k4sZePBGSLZpqLeErGzQ/dvflFwf50Xbz/rCd67O9tKUGvJqdmvwpeDfTs7mO60QW/EZ3qt6G7xY31GGPFj/D3D4WuYmTL5zNbIbSNmocYcoGMkUkHuIrK374gVYYTR0lFfTR5t8dZzYGb18Bn7fARjjET7Galh4q3c/QzNRFdJ+bVbNF/+W4KPvnXFKwZtbYsAR+4s24zQbQt1Cy03vUFy2Zh3JmqtKW5GI7tBM/JkN0/aZobGDFEYcDIzpmEkyyVYkuxndmF+gYKIi5IL3CjF+tjEu6XFlvmDIY/1A+cW9YI9dr2VrkebsXQNkRrZT/iD5lH8jKG1h5uJ5sS+ZMEfiNNjf/tYuCj3BzV7Y3Xv7siNKX/rD2x2jB7czJCAeYXnOyXVYz6AmvmDknSYc//WZlVHvHZmSrpdxPEoO7JtYx02GdMHESG0Fz5lHyJ3zl3kXsvxXsvx7q6Oj4iVu9Fj/WH+OuUoz72WY9ep8Qen3gJrHbCK4Aj28APDwzttOHuOM0P7jEJsM/mmuTn2B1YltgI4O/Z2jvLY64P54CPKPRYTJ7TPLh1Qr8+FteOS9ce8f5vQ5QmPqGQznDN58MtIP79fS+TJZmxP+gMbYX9SKvQoSuoPpvcb4k7s6ff8uycuwBen/iArhsRP2wi73s6uIRr3B7P6iOnvV7HmF7V3it5+/kXF/sb9m1+U++fMLNH73qfbY3O7kQce6BDVx+Xq2iERkTY7pC//WJHXbvD04K2urb2XfM3AzYX9cH24/PwaIrSXcEBsSYyBy+JC64j8GqI4glnErF3qfqUV3Jb+GMmu6YpPNw7ZbRfEG1xo9LtiWjSlRuPDWQ3IR0yyxb3F6X+UgvrswwjmuF4nb5XLy1EED/v0ZzUqPoIEwwn9A+qp5R/kEZCn20FsyJoevfg+f63DM2aG/Ewoqi/MoE43uvT2O+wa7C0MkbbUFWaGxgyRI4yggh5PryESSfchGgXh5en5F1efcMh15PvcDCfWB/QDYyBcR2CujzNCvj4OO6j6wRnOVn/6ad4fjOxix33MDHnuEE3zpz6UOsMYqnn3B029GqqyzdjMHxgH58LRcRbJ3zaZ+beRQDozlJRj10afmbEDAk5gZ0fRH3TB0gPNrYrio9a+HMdXX975mgErvw/jjHe4o3IXjBkNyH6X3/sDxQEIs3YomxkaM0ItBD2CH8LizdcQZfKDPFvmT8xwzmY0gqOt+ofymegxFFS4P0iLI/qD7he2P9M1RAXkwfjTKZswH2FmhLyd9yuS+ujVm5dj6t/S00AeUX9/PCnHyeWC9zlFxc1wZu1z8G9OASb9zL8d+oNZh2PmDyC6tH0eeZzPcI5yy9cQoR37+5yYwFBcXr3QodT4ej0S0B8KOknOzKyGxsnRK9t2EvQ39OUfKy9fvlVevHhWXn9dtPVRthmi84/NJQsespw0PltERD4p2+NybXbo/vLFtmZLRUS1CneXu7YHiLa8uBy1L3p3/5teXOjiqP9Uei90S9cotYcKiUXuup13r3m/b4HUryHlII9NwqWrPb5NGxhqT/8uW/qtcXAzQjEBL08/1HSxpav1mJorMfdDXbqTjI8BczBGq2taquPzdA2RiTcWtPusLt1EHier1YFXk1eYkafn34Qmjs3WYs6HevBCzOAWtpmhLRzfrK1t8dUZAL1vnSExikzFscavfRaxh7J97jYmOmyvRtHXELX4eoaabCC4+dLLx2TV/h+/ae0MhYggDSNPqz/q87j9HysT7z0v4k0qP+DI6qPTY9ffqI+Ybl4fzQEjU2ZDzcKDHUO2m18dOU9mE/u59xGCX/XmCf5tlsF+DOoPnl7XlWhbO3SXXu5ozrFWxfSHPWstD2MXYu1h2O8I5/XRaMxrI/EHWv1Bbw/QT9voxEYQ0x/loCMEPXp/oKZd3auPII8aeRSyU9NVyH8abg3T+A8njKxYazLlY+tQqz89TAUAcYwATn8tHBrMTHdHsaOQbXIoj9r7DWMPLWtYf+YRDnlMYcyq2/AHUeZ5fUyS73VOR3hX459jfXTyzDPo9JjqXpr+Ruhs8UR9xAjz9jlRC8pj/GpQWaLPrNi6PDpC/5skgLCQvrVjb88xW0OOGs4qrksd5EE9dv3N73N8hCbjif5C/UF50J5l+NVjiohZgGb7G/eXL7a+yP15efHi4+WT/ZrPFh/BPo89MvdpEXlL5Pnz5y5ivb8ofpsf3UYmi5oRlPjoyJbFtlZiPMfiF8E1VcHYaj7gI2Oqs0CPPVd429xv5E292mAkZpyLM16CH7ZvVY74Bqya7mSGoZ/b5ZgsuoUefBjxDO8VhxEOfLb2YAThaA2RG4Io2l4a6EZQ3DPw+PB0SF9gyhs0ULvccQTCP8LhlO+ur1W3iA9lOKlxvdb8ezuOa8lMIl28OquoYG/pQ9faDwy9TR7hAPu51QIKS3kmD4HbR8f92qHxFjUVyLQTzuhNNZZfO0PbOUYeGx3Woy6WNtX3epSNpLV0sgE3N/9pC1CgLMWMXpZhQyiKpCOSE38AEczXENXYRsXdjhTIo25rPoZf8IoIM0VPWEMkqgXEBPldhny7CL8Fv5b4A5cK1Af/tIU6O9BshD31B+qyNPcHGgZC/YjqOHl/H6JYji577bBbK+D96jT/Yqpa5g+gfZw+8m8rilnAHM0jrdBGD9L92xZ/C++9HvmEt1SciYBfzcRp5RqqlzNUZ4lBTFc+/YToD0Zo1hNP2ieXf/Brx/5gbw1RzeeW77HkKfEHxh+GN9W05qTUioRrjKNhZU/ETJuP/sOsGQ/3BaXINr1o9Yf+wMtvI/T2rH6GKDGg7v97/o/WELX4fX30Ylg78w1B7g9aRLF9TP1BtvKhl795wqcYdz7xa6M+aiLH+L0lgGuxpv5gujZSUn8QBQZ52s3VSbC/ofcXLqHnz58XecJjc7MO0dwLZo/LyZeDLHe5F6vUHmprdEW0aHjI2dpDe6b3oITctWJsKdOvv8H0zyjnmAyH/NsL8xpp/XURI8+0BfDXujUD7scbRAOvN+8nltDoY/qxGQF5NJOjVcSJJ7IxqQ3hBqpHXPqxpqfTa4jAkzZX5oomFli43JWPazRbWPzXGkH+jPU4pz+bromnO3jEs+XRhiZmwSn7S9YQmSRD+bgWAG1t5NOm7+zZyg310TXMRo+zNUS5PSfjtrZoE3+wT7SjTQ58S+PwZOiucM3CkT8I8mT2YKMpInYt0X6EaI8iuKN8kOfIH+Q99xET+IMkGVO8yRpJqI/++lCho/sw/sCXT3xl9a5/Ux9v8wf5HRGKh/6g4Am9XmD++yDpoT84WEM0cVi+fUP7wRW2dylq1qzFZ6ST9EEe8KtduNQfBO8Y6mNv85yYtqQTmcWUS9fjOX/g7Rle437kD5wiBH+RzK+iP4gG7utjfp9T/MkmfcxO3r5tLYzWQRaV22QAJTyTF+j3BUk5ZvVx7g9i3K59Prrfcf7gFdYQ1b9n1xCFNYUKZTP1B1BvEjt6yj5ETrSuNz25hsj6gxbVLSbT6c9ZGKEnva2ePw3v1hKR/LG5/ra5LKKYm5MzRGb9UILeXybjSCUx4E25Kmo6pv7KsQ+Rup5m11f/Wgs83E/u32DijEYcMTlaQ9RubPbXELXrZ88oh6E7dJjdgLM1AzeJ0cDaASf/YG8NkbMQGBIa+Qd58iHALSX0BzIqcQfXRIGeXmEfIij+PJ9n1xA1PQYHMJnhC+LBM8ojfUiugL3ZhtnpAey3Xn92DVH78PgaIq+nMQIY3dp2uZnhnPgDK0B8S6JJ98AfoJhzfzCY+QOro/4x8wfi7XfI3+RodtxOe8Qf+Gw3PXq83sMMUbaGyNjBq68ZmPiDGmb3E94vZP7AyBP0WExEIlDdoj944pqBMPOd+IPUv4Upmcf8QXA/Bcpnfwg6+IPQMIM/2KJTVIsJcVGguPSLQrvTZybvXp52uXlyw8xwRlJ/oF6t3oH47AW3h2+Xayfm9TH4g0fXEHU5/Af/BMfOGqJ2RpBjx7+Z1LE+hvsckONxf9DuM27gD1Acv1Zcy2YbqV9z5dnyj2H0B7szRN0PgDxB/n1/MDtwah8ic310DyZdo8ehgCbH8C+9fIq9v0H50Y79fY5RUDAwX/4gd48A6s3MH4Acofr1t+iKjCHYluq8YxTEuL8Mpicitc9yfh3RmTVElfEsXl8/dK/rh2SUg/bPZuTENO4BrcasOm5WzBDyiLfHKuO5RB3n9MvDgVnKNakaU02/Z8VnI+SgHw+C+/QxB0EerfKokcepIVszYEbtIOKxZmCsHbD/gzw2XclO9DEEOXq6Rh5VX5yQrlOY01lIrubNlbiXp+lYjTzq9eiL3ycUTE4hjmobUX8jfX8hZtCHQw6QB81WNeh2UoHsRekazWmoXQAAIABJREFUoi3UHrb1N9M1RC3MCxBSB7swdWeM/NnQ1qRMHCOPLVMbujisP8jORcXOGPYrtcytGppMPmV/rfvoFDJkymzIWYTzBz7b3b+5K1MxepiuIVJ7Nfi1eQbRQJ0OrLjS5ZBqx5rIYcrHJjRJ39ZHtAuXPTHppvnHEK9GOdr/4aOtbUSVWyHTDBo5Wm69Hr261fiDNEEA5Mmy0+Uw+pqqBxYHwgnj492EZnWdTbOl18NUABBn1B2Uw6s31kt7zgjtgZj+uLalpybPxh5EQH9qUk4jhAh05AlOc/JkPtCpxPwwU1+XQ8Z9TrAHqD8tB/MM1mPGLmbiioh2H3THIoV2emLcaMfOH0Q5gjxq5PEnoMG7tK0cXp7JvUPIOSQCehxFaOSJp5nsWb+aJ+Fp1jTPq/cHR9HlcrTP46Nfadv/O5ll2EP2JMOUkiZ/f/li65PUdUTj/M/mnaWEx1+7bfmoiDwXN0PkRlrcCMrWZ77XMTSV0eP1V/ZftqNq4jNhJ/Q8cYS9RZc7jDCiJup70SOjEH8dWQsDGz5DY6Yr0Y9Jfzai+Gr7joz0Qa39jEv3IUqeqclm3DI5ehzhGWVQAI5IhxFVAYGgfHCGqBdHKz9UiE/+0X2IpvuOTA74maLMjL39XLMPUSxH6fYM8hwI5meKEk3hiBrGEvRo7E10Z0Rt9giEz6f3B3o4ohZGiEOGfQSvvg8Rzrih/jC6r/A+ROAPUH5VgRHVuGYhlQP8f77mwgleszveoemKO8gPyYbsg9+ofjW614MZqhbLbEQ6nAjlI5DeTP6JHAXPs89wZvGXWw9zOaTKgSPD/u2Hc39g7EGO/IEGOdxMUVKe0Z5xpsgX4GwG/Kt2HyKoj7MZ+Ol9zuEaottEfyCunSkqvgPV7NjPgENCwY6tP4C3D9rsJfXR11fMyEl/EJ6kkOEPnB0ERzb52vxKSfXYk7H3G2XiD5xgTU+T+xyol2gP0Z5zOXos1h8YvzBO8GH3L5K9SVeNJnajGTNEHxWRz2VXnOPVOkQGHO2xowu2Nycq6TOJvhxsAwYlPG3QXcouXVtJhsE+cc2A+eqfSfX5dNm095OHLQAC+470iNoaoqN9R0osALB01FeTQOXV9iGyKrTpezsw+XR6e2ANUZrcu2MfIivH4RqiiZA9ecWj78QaoiHH+TVEcMT6BSiIvTVEIxN7/gBTzvxB6QfcM/YFdZwB9tiz8/gaou36Y39g66NIHJnc7KBFs2AfIlMX/UU7+xBlFcox6o7PfxzR9+5+8kivyLQ+TqsvyhP8wfl9iGyErnysP8huKJw/sLEOm4zpY7I75eP8wbl9iFxE3Z7HPoH+Z9gWANcM7NTHmFg9okaeQ3+QxGcdsPVD0D73+oPacPZs1xA95g+2c99l+xDprP4UjBAyI0EOr4onrCGa0OVRLOGv132IoGwg/ZF/7wecqaX+ILPnxE/bCLve/P36NHvGH4z6eGoN0UOcml1+Ag93iD4pIl8039vbHdyjhdsRMxI8XzPQnxVuh+2MSpGv2Boi64jsFNZT9yHCGY0htpd7+KWZAWMPG9cQzfcd2QwRDXi+hsif2OSA8pnoEZ22WDnE1oe8HEXwsE9/VqPe7fsQxZFgLw+qLzzDfXCD+dQ1RMv2IYIZjWgG2ZoBkxHwB0driOYzGk9dQ5TrcbRu4q6PM0Itgy5b/cO6fYjGzBBoGKJ5h/YhgnLs8rT6aG9snF+AxA7XEHWFJJm0fm3oEQR2dnQ4w4kzNDX/0b95ucdX8P8n1wyM5uTqNURJh11kOjMUZzRwDVFL94lriHb9AcwEpP5gNqOBim35h/KZ6PHhNUQzf+DseGcNUQF5MP50yibMR0hYcwOpZfUx+rfkwqeuIZK7769OyrFfHqpV1OPX3j5EJnv4s/UHxepP4Hq0Y99OxATG9Xn1QodS4zvwB9GfQfzuyafzj83F/oaEN819UkR++XSMGw93iPCV2w10qCIqY+RnU97d1t5Jw1b9hA/FNKzO8lW2Xv04JKNLa73HVB7fIJjnznsYR5bcc57RU7nrM3t18riRoBpvE7EbCe7R3o7ZCM2ITVfPPd5wOHlKVZcmcvg82UPeoE3Dhjfu6gKjteJ/rOWYpe9vDJOntM3IxSh2U0sCII9tEFzDEGeoVJLwzIyf+vicPMkNexjJ3BsNgRukOEPUMzrqRSWsIfItVFSZy8YoEW8HUfg28jd+S+RxBjVOUSn5jISrSSbWUP0zf5Aka+pjKM4DfzBicRHWQ+APYvvj49gb0cwdjpenl8NdSrnVGaNMfyNdJ0/msGwWT/gDbxCjPuLM1twfOHWE+rizhjr1B4nIky95xw0z1vOkSXQx4/HX5g+yEemQXOYPMjngRxXJR6TNHzszMwuzt8xZe+7xxrec5u4k8wc7BH+A9wehwgV/MFHsaX9wVB98+ZRZhPF+R5Of8ULrB07UxyBPt2MzEy4i9r4A6+NpfyAibTOqOHPYxLVvmbt5fyb4Ab+UU/4gq2NBnjP+QO1V8dH7OKBXvP5O1Mcz/gBtyFVX699sm2NDd+2JJ2JMQ2MHk3NxEr924A/cqwrQnuVeB/1nnaH8sbmezuw2T8yrtx/gfIfo0yLyFmSqvnJbauakZb1sit3s0K8hCoJAl7W9HyyuvSku7DYT7kPaVCc+Y5/rJYxIC64hKi7D3mFaOQQ/bN+CHCDPZIZhGLBZQ5RJ0SPM3+5RggH7DF+5D5Hfn6GF2ZqBEsqzxzGZcTOJuHB3gjAR8NE1RKF97PqbrCHq+S4jTPQ3O+AbtMTpgv3M1hDlI4rn9iHKG0RfH6cj0r2ClqG/Jk+MLsgz7FicHWQjirimz9lZz4evD7P6WGo5BnGm/mCSrcy/FZDHCdxC9cm1+M1MUTbCHmaK3qE1RDODyPyBl98XzKw+TtcQpf5AH/AHs+z7fO6tIfIRQPm0cDrj5j+ENXBGjnwAAuoP1qN2mivgEUlUz/57l566hsg+krQ7nuQESGZAgqGCvSX+wJ130h8cz4C/02uIah6nzaOXZ9iBuAgf34foluZ/iOtniMIaoqk/QL2BPMYf7O9D9LQ1RLNimz8RIwf+IL8s9QdZRUB/UGANUai4oCfZv88Zfs1fH/1B7td6Nif+IArc5NlbQzSn1Ql4wMj1STqfltN7ES1ZQ6T3Dxb3TLSK67k31fXf0LPbuERGA9bi2S8hd227QmLU/Vg+YjKVzjca5qtvS/Iaaf1UESPP3oyCk4f7EE0yOCKFO4Na9X3RxAILl7vywU6NiMvjiPZoDdGwY+5DBPK4nzcBuA9RmqKXJ7MHG00R4T5EO/7N+INsDZG/Qdvxb+rjbf4gv+NC8dAfFDyh1wvMf187cOgPuA/REDNddTKiEFMuXY/ch8jZg5Ob+xDFtGxwfg1RWFOoUDZTfwD1JrGjr6J9iB4i9DfuHywiz58Qk+dJHaK2KavIe/uxAqHI0RqiFvpGjfsQ4SNI3IcIMuZTwRma7mCw+PN8ch8i7kPk9WgFiHcY3Ieo2XE7OvEHbYbGJOfl2PMHRp6gx2IiEoHqlszY4gldUGdPYIbzEWEjSD4jEO0yiLfjD4L7KVA+0w5X7g/CjC34gy06RbWYkPsQjQSjHrgPEfchwg6HszPwB9E9mHSNHocCmhzDv/TyKfb+BuVHO/b3OUZBwcB8+YPcPQKoNzN/AHKE6pfuQ3QMFovl5cu3x+asD7L0LXPjbU2bqLiGKM1d1uM2Q8jjV1hD1E8YI7NqjpkDs5RNvqF9VX9ZizeuJZLEEH36mb06eVwDpy7bw0jOrCGS6qBxzUA0GSePVidhsu1P1HCtd8ijYZuNqHl1Bg8s0zVELZdzfyd25GKMbG9n58XvY4ojUIm9JT50qCdcGDEXxBHC4CHA3mToNK9A7vpsDdFN60sUtKTjMWENEY4EQX3wqcdnlLE+jDUDJ/0BNtCt/A/9gfjqV/BAlqAV8mBETb3Eo261XFlFWIX4vKXt16jA4QTvD6Y1IU0/XUME9eGxNQNej3v+oClwO72AHHv+IDucrCFKi9SuGSiH9dGfUBI5EknVF23q3w78weEaon7uE9cQNXky99T+qI83DcNbwt7BNURYPVz5e8+QiNlHukPFAu1h+3zeH4iEW7Q9f5D9jL/Ydg39QfubPPng1Aftc7C3V/IH9W1i0l6akIhbxNlRsLNQH20MQR3B/+d+DeQxM0XJKZC+9LRTf+AEM34A/IH4GKoA4vQ47Nj6g4Knmew9toYIvFK837Fyq/dBeXTmwiSDmT/ANUS9+lW70HB/e0zsb6xhWYfoVm8+SgulVAOerCFqYeiCe01P1xAJXNZtA0fYxRhwhPsQTZ4VbqcfzXj1dEEekThy4+yheL1h2PNfhv5M+iYRF3Ifou0E7kMkvlyCPxAoT2+/3Y+hrw0j7Diiihn2EaxfQ4T6w+i4D5GbAekZQfkh2ZB98BvVr2Yz4N4fTNqd2Yh0OBHKRyC9mfwTOQqep0VszyKaB/ch2kLfTmAC7/waIl+OQX2TmaKZP7D1cd8fcB8ie/18BhwNF782v1JSPfZk7P1GmfgDJ1jT0+Q+B+ol2sPxDLjPn/MHxi+ME3z41DVE2N9YxdoZItP0HK8h8s8k+nKwDRiUcP365nveU/78d/+ZN7/rU9/+5l6+fvHvfObZ3/rZX3j27PnbW/LdYJ+4ZsB8DTNTJp9OHns/eWZGwcF9iEIGXdzxYLtFc86uJnjqrSsoT08f3ZOIHXlKs2fk4D5EXg5rjk0A7kOUpihiYsIRyc0OWjTch2hafVGe4A9K0mHe8W/WjltM1h9kNxTOH9hYh03G9DHZnfJx/uBgDREqaKhFuA/R4/5gO7d0OU75A6sSqwBnx97OUR57fTSfWf0pGCFkRoIcXhXch2giiPFr6ADyNUSxPkLZQPoj/94POFNL/UFmz4mfthF2vT2+hmjUx2v2IfJDXWtY1iFqM0L2Gf8xEjxfM9DCftjOqEB8LXjP66+V7/3uP/Pmdx50hkREtg5Tkf/jb/7Ml32yxYXWEZViv8YRzCJFuA8RyINGaeUQWx9AbnhNyDiM9pTXKO5D1MLtKPchwvYjHPBaxHSxHKHAuQ9R7g+wHLs8rT7aGxvnFyCxwzVEXSFJJq1fG3oEgZ0dHc5w4gxNzX/0b17u8RX8v9VjGeIO+X3IfYhs+cBMQOoPZjMaqNiWfyifiR4fXkM08wfOjvXEDOdsRiMIKLY2DTXmdt6vSOpj9G/JhdyHaLt82uGY+QOIbtI+9+zhz9YfFKs/gevRjn07ERMY1+fVCx1Kje/AH0R/BvE/dR8i8eW1iv13aj6A1j9qjoyRYB3nuAtk04T57+Ix8Y04VMqtyJnOUOO7PvVt03O1pavS09earh/BVPfJyty/9ExrD+3PPtSevlZdtcbBj6Da8fpk7L5HWPcD0Lv0Ub0a2v+CUmj9FOSwAo7/QY6e16Y7NZ8z2SGhWNDus7p0FXIjxma0y6G9ACUB5HG6tkWnPf1eLih7eiFm0MqRyGNsrcvRbDFOBSTiDFsTUbnXrz2U7fO9/nYX7WMyYR+iFl/PUFqA7kuXx2TV/h+/GXmygnEGNSJw5uHUm9VLODc/kCdr6mPPM5TNzB84ecKhUTYzf+DksXYM2e7yuCtBnn7ufYTdH2TmCfLMMtiPQf3B07uuTNmlfm2k7xKCCLP6iHp08iT+IKuPRmNeG5jHborRjrF65Bn3SYxyMPJIIk8/N/MHmRwgj82jQnZqurPofHHf/X84YXy8m9CsE7Fpdv15Pe7i/IHVXwuHBvP8e7UYxY4CtMn1sOnPtM9GjvbZnGlykEZoFDIKI8uzkyeReV4fk+S7OQ55mk3N6qOTZ57Besz4l1Tceg9ifZA3Ucg6yAPn5O1zohaU54w/MPrMiq3pz/uDqEcPCAvpWzv29hyzNeSQXoaZjnzqIA/qsetvfp/jIzQZT9IfH4c/cPKgPfcnoB5cQwTprWLhDBGGbQRqsoYo9LjbddsZe/sQPX/+YpkeuA9RfFbY8QprBrgPkdXbU0egmt4mj3CA/XAfIhhRk2FvWz58fZjVx1LLMYgz9QeTbGX+rYA8TuAWqk+uxW9mirIR9jBTxH2IhPsQJfG7Ah6RRPVwH6IhaIg+qY+P+IOVa4hqHqfNo5dn2IG4CLkPUV4fw31OMAQ58Af5Zak/yCoC+oMCa4hCxQU9yf59zvBr/vroD3K/1rM58QdR4CbPK+xDJEGdr8y6NUQCU4em+6ZiQjU+uJekjUdGA6ZimzJ7wtPz6W4wuQ+R79Un59UTohyt+CaeyMakNoTRlx5xgVQfWEMEdwbtFs0VTSywcLkrH+zUiLg8jmh18oz1OAffIuNPCC1cSD8fgao1RX294z5EaC7JuK0t2sQf7BPtaJOD+xB1f5D33EdM4A+SZEzx2keuuQ/RFpYuKsbMfYhEepvnxLQlncgsply6HrkPkbMHJzf3IYpp2aDGBO1jdA/JmkKFspn6A6g3iR19Te9DZNS7inUzRMWHIkdriAQv2L7Wkjvch+iV81l82E7QozVE7cZmfw1Ru577EGGFgfNghgj1xH2ITMPs9AD2W6/nPkTYfoQDLn8zf2B11D9m/kC8/Q75mxzNjttpj/gDn+10BFW83sMMEfchiuoyhsJ9iES4D1Gsj9yH6MgfcB8ikdY+7/g18AfRPZh0jR6HApocw7/08in2/gblRzv29zlGQcHAfPmD3D0CqDczfwByhOr31H2IZv7tFVnWIbK941bZr9+HaEG2k4bN97THrYn2nJjjIfsqdigis1cnj2vgxjVDDdyHaMffiR254D5E3IfIVb+CB7IErZDchyh1WJgAmMbMHzQFbqdzHyKbvp0han5g6t+g3dmrj0GezD21P+rjTUPuQ/SAPxAxt4AYYfQH2c/4i23X0B+0v8mTD0590D4He3slf8B9iPwMISYB8mTuLvgD7kN0iNXfY1fusq5DJFJ7iDXc/sh0DVELQxfcazpbQ7Q0yziiJriGqGe0frUjKH7NgpejxttnuvDXlm6BH6A6cR8ib1eoAByRDiOqAgJB+Ty4hgi9BPchAnkOBOM+RMYfGL9gKrARNK+PfsYN9YfRcR8i7kMUqtX4ZJ/hzOLnPkQ19O0EJvDOryHy5RjUN5kpmvmDR9cQRf2BuNyHCCLEr82vlFSPPRl7v1Em/sAJ1vQ0uc+Beon2cDwD7vPn/IHxC+MEHz51DVGLo+d3EWvXELX7Jt2+Wyfbw94z9M8k+nKwDRiU8Csq4MyMBkrmhhbMVz9i4/Pp5LH3k2dmFBzchyhk0MUdD7ZbNOfsaoLZjAbODAV5evqJ4ZmRpzR7Rg7uQ+TlsObYBOA+RGmKIiYmHJHc7KBFw32IptUX5Qn+gPsQDXvmPkSP+oPtXO5D5DPLfYhs+5j5g1gfoWwg/ZF/7wecqaX+ILPnxE/bCLveHl9DNOrjRWuITL1dxWVvmRM5t2aghf2wnVEp8hVbQ2QdUSn2a/bWFe5DFEaCsWCsHGLrA8gNXfxx2Kc/q1Hch6iF21HuQ4TtRzjgtYjpYjlCgXMfotwfYDl2eVp9tDc2zi9AYodriLpCkkxavzb0CAI7Ozqc4cQZmpr/6N+83OMr+H+rxyKxMUd/gP7tYMaf+xDNZjRQsS3/UD4TPT68hmjmD5wd64kZztmMRhBQbG0aasztvF+R1Mfo35ILuQ/Rdvm0wzHzBxDdpH3u2cOfrT8oVn8C16Md+3YiJjCuz6sXOpQa34E/iP4M4n/yPkQ+XMXCNUSbRbQRV5GDNQOThq31+FwopmF9Un9yL9vW4ZjnZnuYrR1S+zN6Knd9Zq9OHjcSVONtlbsbyZk1RGbEph3We7zhcPJsnkmLJnL4PNlD3qBNw4Y37uoCo7Xif5ytIVKbW8lL34xcjBGglkYGyDO9UYszVCpJeGbGT318Tp7khj2uGdixebhBytYQ9XKEEbiwD5FvoaLKkgrcc5sUfzsvrhlI5HEGNU5RiWuI4AKsrnHmdmcKL6uPoTgP/MGIxUVYD4E/iO2Pj2NvRDN3OF6eXg53KeUm6Roi0MDpNQMn/YE3iFEfcWZr7g+cOkJ9PL+mcKKmYMeNvOOGGet50iS6mPH4a/MH2Yh0SO6Ja4hUJB+RNn/szMwszN4yZ+25x/sVWEMkVn9Dj1Dhgj+YKPa0PziqD758yizCeL+jyc94ofUDJ+pjkKfbsZkJFxF7X4D18bQ/EJG2hijOHDZx7Vvmbt6fCX7AL+WUP8jqWJDnjD9Qe1V89D4O6BWvvxP18Yw/QBty1dX6N9vm2NBde+KJGNPQ2MHkXJzErx34A1xD5OxZ7nXQ/9E1RAr9jTUsfMvcTbdwW1lzuIao9At9PPWMvX2IVsJ9iOKzwg64g+M+RBjdwRqinu8ywkR/swO+QUucLtgP9yEaPzs76/nw9WFWH0stxyDO1B9MspX5twLyOIFbqD65Fr+ZKcpG2MNMEfchEvcI9qE/mGXf55P7EBnxijy8hsg+krQ7nuQESGZAgqGCvSX+wJ130h8cz4C/02uIah6nzaOXZ9iBuAi5D1FeH8N9TjAEOfAH+WWpP8gqAvqDAmuIQsUFPcn+fc7wa/766A9yv9azOfEHUeAmzxPXEJUiRYqu7AyJrFxDpH4G53gNkZiSNPGIjAZMRRRLuH2d8MZrIv/sx0X+6W/xx3/4e374w/b7j/7EZ579yF//hWf/8AvPpwMHPUH16ecjNnmNtH5q+zWpOfOUhfsQTTM4IoU7g3aL5oomFli43JUPdmpEXB5HtEdriIYdcx8ikMf9vAnAfYjSFL08mT3YaIoI9yHa8W/GH2RriPwN2o5/Ux9v8wf5HReKh/6g4Am9XmD++9qBQ39wsIZo4rB8+8Z9iPbB+ggj7Ef+wClC8BfJ/Cr6g2jgvj5yH6JcjuDfshnbpD6e8wfn1xCFNYUKZTP1B1BvEjv6mt2HCOxgFWv3IWrPxNZh0GjApqyLvdDEU0vuKfsQvX7LO0MZf+kHvv1NKSL/9f/4s1920erRGqJ2Y7O/hqhdz32IsMLAeTBDhHriPkSmYXZ6qPpxMxrch2h/BFVCfZiNoFod9Y+ZPxBvv0P+Jkez43baI/7AZzsdQRWv9zBDxH2IorqMoXAfIhE3g4bugvsQmQSjHrgPEfchwg6HszPwB9E9mHSNHocCmhzDv/TyKfb+BuVHO/b3OUZBwcB8+YPcPQKoNzN/AHKE6vfEfYhuZetstLV4q9ifD38UtaEZOTGNe7ymGrPquFkxQ8gjSu3hbB3RrZzrDDX+0vd/+5ubQ9bNMdfet83SyLfPgRFznNQO9DAb3QN5tEqk9VhQgx2vT8buIWLVu2xvBmqhuP9BHpuuZCf6GIIcPV0jj6ovTkjXKczpLCRX89Z0rvjz0LEaedTr0ZuLTyiYnEIc1Tai/kb6/kLMoA+HHCCPN5tNHtDtpALZi+Rev/ZQWqg9rNYR1xChPHkBQupgF6bujJE/G9qalIlj5LFlakMXx/AI+bmo2BnDfqWWuVVDk8mn7K91H51ChkyZDTmLcP7AZ7ul769Mxejh8AdDFV0eJ0fNwTyDaKBOB1Zc6XJItWNN5DDlYxOapG/rI9qFy56YdNP8Y4hXoxzt//DR1jaiyq2QaQaNHC23Xo9e3Wr8QZogAPJk2elyGH1N1VO9RLUjPGF8vJvQ7DVj02zp9TAVAMQZdQfl8OqN9dKeM0J7IKY/rm3pqcmzsQcR0N/kviSrICaSibmP2DIf6FRifpipr8sh4z4n2APUn5aDeQbrMWMXM3FFRLsPumORQjs9MW60Y+cPohxBHjXy+BPQ4F3aVg4vz+TeIeQcEgE9jiI08sTTTPasX82T8DRrmufV+4Oj6HI52ufxcfgDp3Inswx7eHQN0WFGn8bafYgMh2uIZPR42xUb9gyJI9JxDKLz/OUT8okjaoJriMR1lf0IiibP1np5uA+RuOu5DxGMQAl8gAN+pigp/17wW8B9iLbPcURt9giEzyf3IXLiPXkNEfchmsxQtVhmI9LhRCgfgfRm8k/kKHiefYYzi5/7ENXQtxOYwDu/hsiXY1DfwQz89D7n5BqiqD8Ql/sQQYT4tfmVkuqxJ2PvN8rEHzjBmp4m9zlQL9Eeoj3ncvRYrD8wfmGc4MNX2ofoAha+ZU58Q2e6i64jp5I+k+jLwTZgUMLt66psH45S9QyHr/6ZVJ9PJ4+9nzxsARDuQxQy6OKOB9stmnN2NcHQMQ/FkcjT008MT/VgDZF9Rpj7EFk5rDk2AbgPUZqiiIkpjKwK9yFykc+qL8oT/AH3IRr2zH2IHvUH27nch8hnlvsQ2fYx8wexPkLZQPoj/94POFNL/UFmz4mfthF2vfn79Wn2vkL7EAnYxSrWriEyoci5NQP9WeF22M6oFHloDdHT8t0iHI6oFPs1e+sK9yEKI8FYMFYOsfUB5O5DEnjYpz+rUdyHqIXbUe5DhO1HOOC1iOliOUKBcx+i3B9gOXZ5Wn20DZjzC5DY4RqirpAkk9avDT2CwM6ODmc4cYam5j/6Ny/3+Ar+/+SagdGcXL2GKOmwi0xnhuKMBvch2imO6A+cHe+sISogD8afTtmE+QgJa24gtaw+Rv+WXMh9iLbLpx2OmT+A6Cbtc88e/mz9QbH6E7ge7di3EzGBcX1evdCh1PgO/EH0ZxD/U/chmvm3V2TtPkT+gBn50Rq6n02NgMMKoZiG9Wn9yZ1sW4djnjvvYRxZcvJET+Wuz+zVyeNGgmq8rXJ3I+E+RK58XIbGyMUYAWppZIA80xu1OEOlkoRnZvzUx+fkSW7Yw0jm3jAl3CBxHyIxdpAeyJM19TEU54E/GLG4COsh8Aex/fFx7I1o5g7Hy9PLgfsQhQFnJ0f2hfsQhZD7EB3WB18+ZRZhvN/R5Ge80PqBE/UxyNPt2MyEi4i9L8D6eNofiAj3IZLg19LIa3084w/Qhlx1tf6/yqApAAAgAElEQVTNtjk2dNeeeCLGNDR2MDkXJ/FrB/7gsn2ILmDtGiKj+cM1RK3MoYvHfYi0/90MmPsQdf2Z9E0iLkwnBFLDG3lMohnlAxGG9rHrb7KGqOe7jDDR3+yAb9ASPwD2w32Ixs/Ozno+fH2Y1cdSyzGIM/UHk2xl/q2APE7gFqpPrsVvZoqyEfYwU8R9iIT7ECXxuwIekUT1cB+iIWiIPqmPj/iDlWuIah6nzaOXZ9iBuAi5D1FeH8N9TjAEOfAH+WWpP8gqAvqDAmuIQsUFPcn+fc7wa/766A9yv9azOfEHUeAmzyusIbIZW8S6fYgEny1Xp9Qemh7iKEkbj4wGrMWTldCqfOONWTzDNxrmq29L8hpp/dT2a1Jz5ikL9yGaZnBECncG7RbNFU0ssHC5Kx/s1Ii4PI5oj9YQDTvmPkQgj/t5E4D7EKUpenkye7DRFBHuQ7Tj34w/yNYQ+Ru0Hf+mPt7mD/I7LhQP/UHBE3q9wPz3tQOH/oD7EA0x01UnIwox5dL1yH2InD04ubkPUUzLBufXEIU1hQplM/UHUG8SO/pa3YeoFaTKtG/2JNatIYJQ5GgNUQt9o3ZmH6L3vvGepCV8Yr7DiMnRGqJ2Y7O/hqhdz32IsMLAeTBDhHriPkSmYXZ6qPpxMxrch2h/BFVCfZiNoFod9Y+ZPxBvv0P+Jkez43baI/7AZzsdQRWv9zBDxH2IorqMoXAfIhHuQxTrI/chOvIH3IdIpLXPO34N/EF0DyZdo8ehgCbH8C+9fIq9v0H50Y79fY5RUDAwX/4gd48A6s3MH4Acofo9cR8ijHYV6/YhcsMk2/8xEjwa9/Q6baGNY7ugXTPiUHlxfym/+Hc+82xNtltet/R7Vnw2IAdGnpHBcaCH2egeyKNbfFua2i4zauA+RKJN54o/Dx2rkUe9Hr3h+YSCySnEUW0j6m+k7y/EDPpwyAHyeLPZ5AHdTiqQvYj7EIVzUbEzhv1KLXOrhiaTT9lf6z46hQyZMhtyFuH8gc92S99fmYrRQ+5DFE6AEK9GOdr/4aO5D5GVo33kPkTJXHSiVHWRTMx9xJb5QKcS88NMfV0OGfc5wR6g/rQczDNYj3EfotyvTTQCehxFaOSJp5nsWb+aJ+Fp1jTPq/cHR9HlcrTP4+PF+xChY1vEujVEN9+DPFxDJKPHWy+soT1D4oi0FHnx4q5/++d+8VmRIt/5qW9781WyzX2IJs8Kt9NPrhngPkSTNUT9xJZ/GIES+AAH/ExRUv694LeA+xBtn+OI2uwRCJ9P7kPkxHvyGiLuQzSZoWqxzEakw4lQPgLpzeSfyFHwPPsMZxY/9yGqoW8nMIF3fg2RL8egvoMZ+Ol9zsk1RFF/IC73IYII8WvzKyXVY0/G3m+UiT9wgjU9Te5zoF6iPUR7zuXosVh/YPzCOMGHT15DdAsCLGHdGiLFR6+8k+2hSvpMoi8H24BBCdevX3r2XP/Gz/z8s5/+2V949uz52734f/h7/s0PP5rvgzNahsNX/0yqz6eTx95PHrYACPchChl0cceD7RbNObuaYOiYh+JI5OnpJ5VP9WANkX1GmPsQWTmsOTYBuA9RmqKIiSmMrAr3IXKRz6ovyhP8AfchGvbMfYge9QfbudyHyGeW+xDZ9jHzB7E+QtlA+iP/3g84U0v9QWbPiZ+2EXa9+fv1afa+QvsQoV2vYu0aomJ66nJuzcCYUapf7YxKkd01Ay9e3BXfa/9wvt0zkVuBl2K/Zm9d4T5EYSQYtW/lEFsfYjnaa8dhn/6sRnEfohZuR7kPEbYf4YDXIqaL5QgFzn2Icn+A5djlafXR3tg4vwCJHa4h6gpJMmn92tAjCOzs6HCGE2doav6jf/Nyj6/g/0+uGRjNydVriJIOu8h0ZijOaHAfop3iiP7A2fHOGqIC8mD86ZRNmI+QsOYGUsvqY/RvyYXch2i7fNrhmPkDiG7SPvfs4c/WHxSrP4Hr0Y59OxETGNfn1QsdSo3vwB9EfwbxP3Ufopr4yhcqiKx+7bbWP7Urfuk+RP2Eg/emH2XZNQjmuXMjD44sOXmip3LXZ/bq5HEjQTXeJmI3Eu5D5MrHZWiMXIwRoJZGBsgzvVGLM1RoZxoiCNGDHNyHKInIRhf0qFLyGQlXk0ysRsxubztTeFl9DMV54A9GLC7Cegj8QWx/fBx7I5q5w/Hy9HLgPkRhwNnJkX3hPkQh5D5Eh/XBl0+ZRRjvdzT5GS+0fuBEfQzydDs2M+EiYu8LsD6e9gciwn2IJPi1NPJaH8/4A7QhV12tf7Ntjg3dtSeeiDENjR1MzsVJ/NqBP7hkH6KebtTXq7C2QyQiLXOHa4iaDNBlPb0PUb9+C56qFu5DFJ8VdsAdHPchwugO1hD1fJcRJvqbHfANWuJ0wX64D9H42dlZz4evD7P6WGo5BnGm/mCSrcy/FZDHCdxC9cm1+M1MUTbCHmaKuA+RcB+iJH5XwCOSqB7uQzQEDdEn9fERf6DBrz19DVHN47R59PIMOxAXIfchyutjuM8JhiAH/iC/LPUHWUVAf1BgDVGouKAn2b/PGX7NXx/9Qe7XejYn/iAK3OR5hX2IXIRrWLiGCAzb9NxNB1JsD3GUpIlHZDRgKqJYwjsNWl5ER/lOnkXFHKlPPx+xyWuk9VPbr0nNmacs3IdomsERKdwZtFs0VzSxwMLlrnywUyPi8jiiPVpDNOyY+xCBPO7nTQDuQ5Sm6OXJ7MFGU0S4D9GOfzP+IFtD5G/Qdvyb+nibP8jvuFA89AcFT+j1AvPf1w4c+gPuQzTETFedjCjElEvXI/chcvbg5OY+RDEtG5xfQxTWFCqUzdQfQL1J7Ohrdh+iGl+TaxXr1hAVH4ocrSESvGD7WiXc24eonigiJdxPPp7v4qIVPVpD1G5s9tcQteu5DxFWGDgPZohQT9yHyDTMTg9VP25Gg/sQ7Y+gSqgPsxFUq6P+MfMH4u13yN/kaHbcTnvEH/hspyOo4vUeZoi4D1FUlzEU7kMkwn2IYn3kPkRH/oD7EIm09nnHr4E/iO7BpGv0OBTQ5Bj+pZdPsfc3KD/asb/PMQoKBubLH+TuEUC9mfkDkCNUv6fuQzTzb6/IukfmgmM7WEPkrgNLNkPI41dYQ9RPGCOzE9d6kO2jNQPj1iSuJZLEEFVshjJ7dfK4Bk6dHMNIzqwhkuqgcc1AtBgnj1YnYbLtT9RwrXfIo2Gbjah5dQYPLNM1RC2Xc38nduRijGxvZ9siySUAR+bs4OQzyofPfPgL4ghh8BBgbzJ0mlcgd322huim9SUKWtLxmLCGCEeCoD741OMzylgfxpqBk/4AG+hW/of+QHz1K3ggS9AKeTCipl7iUbdarqwirEJ83tL2a1TgcIL3B9OakKafriGC+vDYmgGvxz1/0BS4nV5Ajj1/kB1O1hClRWrXDJTD+uhPKIkciaTqizb1bwf+4HANUT/3iWuImjyZe2p/1MebhuEtYe/gGiKsHq78vWdIxOwj3aFigfawfT7vD0TMLSBGGP1B9jP+Yts19Aftb/Lkg1MftM/B3l7JH9S3iUl7aUIibhFnR8HOQn20MQR1BP+f+zWQx8wUJadA+tLTTv2BE8z4AfAH4mOoAojT47Bj6w8Knmay99gaIvBK8X7Hyq3eB+XRmQuTDGb+ANcQ9epX7ULD/e0JTjmPx1m7hsiU++EaohaGLrjX9HQNkcBlcPh0lnFETXANUc9o/WpHUPyahSxD3IdI3PXch6jZMYg7OeBnijI/4O2H+xBtn+OI2uwRCJ9P7kPkxEvWDDzmD1D+OACRrSlM5AD/P11DBHrkPkQQ4nn2Gc4sfu5DVEPfTmAC7/waIl+OQX2TmaKZP3h0DVHUH4jLfYggQvza/EpJ9diTsfcbZeIPnGBNT5P7HKiXaA/HM+A+f84fGL8wTvDhK60hshlbxLo1ROh4ZFRO1+PsPUP/TKIvB9uAQQlPG/Qn5vuwp9kzHL76ERufT5dNez95ZkbBwX2IQgZd3PFgu0Vzzq4meOqtKyhPTz+xNTPylGZP7EjWwRqiiZA9ecWj78QaIhjJch6zJGkk8li/AAXBfYjSFEVMTDgiudlBi4b7EE2rL8oT/EFJOsw7/s3acYvJ+oPshsL5AxvrsMmYPia7Uz7OHxysIUIFDbUI9yF63B9s55Yuxyl/YFViFeDs2Ns5ymOvj+Yzqz8FI4TMSJDDq4L7EE0EMX4NHUC+hijWRygbSH/k3/sBZ2qpP8jsOfHTNsKut8fXEI36eME+RO22qSztDy3eh0hs5s6tGWhhP2xnVIo8tIbow+9/z8O64T5Es0ePitP/KAX12Y9DgPX6yTP2k3IUwcM+/VmN4j5ELdyOch8ibD/CAa9FTBfLEQqc+xDl/gDLscvT6qO9sXF+ARI7XEPUFZJk0vq1oUcQ2NnR4QwnztDU/Ef/5uUeX8H/Wz2WIe6Q34fch8iWD8wEpP5gNqOBim35h/KZ6PHhNUQzf+DsWE/McM5mNIKAYmvTUGNu5/2KpD5G/5ZcyH2ItsunHY6ZP4DoJu1zzx7+bP1BsfoTuB7t2LcTMYFxfV690KHU+A78QfRnEP+r7ENkwlXsv1PzAYpu8wktFDEjmVV5rqzbF1X3X+tvLnRx1H9aj9VLRUXefnGXH/3Jzzw7m+cf/cnPPNOWrkpPX2u6fgRT3acuwsigybT20P7swxqHGnnabFnTmzOSO3zGCOt+AHqXPqpXQ/tfUAqjRy+HFXD8D3L0vDbdqfmcyQ4JxYJ2n9Wlq5AbMTajxh7Ux+MAeZyubdFpT7+XC8qeXogZtHIk8hhb63I0W4xTAYk4w9ZEVO71aw9l+3yvv91F+5hM2IeoxdczlBag+9LlMVm1/8dvRp6sYJxBjQiceTj1ZvUSzs0P5Mma+tjzDGUz8wdOnnBolM3MHzh5rB1Dtrs87kqQp597H2H3B5l5gjyzDPZjUH/w9K4rU3apXxvpu4Qgwqw+oh6dPIk/yOqj0ZjXBuaxm2K0Y6weecZ9EqMcjDySyNPPzfxBJgfIY/OokJ2a7iw6X9x3/x9OGB/vJjTrRGyaXX9ej7s4f2D118KhwTz/Xi1GsaMAbXI9bPqz9xvGHsTI069I5EkryCiMLM9OnkTmeX1Mku/mOORpNjWrj06eeQbrMeNfUnHrPYj1Qd5EIesgD5yTt8+JWlCeM/7A6DMrtqY/7w+iHj0gLKRv7djbc8zWkEN6GWY68qmDPKjHrr/5fY6P0GQ8SX98HP7AyYP23J+Aeuxxud7PaOEi1q0hgi7b4Rqi0ONu121nPGUfoi89f6k/8td/8VmRIv/693/bm3vZ/dGf/MyzH/mxX3jGfYjis8KOV1gzwH2IrN6eOgLV9DZ5hAPsh/sQjZ+dnfV8+Powq4+llmMQZ+oPJtnK/FsBeZzALVSfXIvfzBRlI+xhpoj7EAn3IUridwU8Ionq4T5EQ9AQfVIfH/EHK9cQ1TxOm0cvz7ADcRFyH6K8Pob7nGAIcuAP8stSf5BVBPQHBdYQhYoLepL9+5zh1/z10R/kfq1nc+IPosBNnieuIQI5VrFwHyI0NHVK7aEaH9xL0sQjMhowFduU2RPSBk1F5PNfeK5/9X/5+Wf/3Y/9X88+/8W3Q6mpinz4A+8pb794KV96flfuQwTlg+fVE6IcrfgmnsjGpDaE0ZcecYFUH1hDBHcG7RbNFU0ssHC5Kx/s1Ii4PI5odfKM9TgH3yLjTwgtXEg/H4GqNUX9lD33IUJzScZtbdH28h9rifaJdrTJwX2Iuj/Ie+4jJvAHSTKmeO0j19yHaAtLFxVj5j5EIr3Nc2Lakk5kFlMuXY/ch8jZg5Ob+xDFtGxQY4L2MbqHZE2hQtlM/QHUm8SOvlb3IUK/sIqF+xDdVGpj34YtogGbsu6hF+dV9yFSLfLF53fdKmArwFESpYjYjhL3IZosUoQhoZF/kGc2YiIHa4gaMEOEeuI+RKZhdnqo+nEzGtyHaH8EVUJ9mI2gWh31j5k/EG+/Q/4mR7Pjdtoj/sBnOx1BFa/3MEPEfYiiuoyhcB8iEe5DFOsj9yE68gfch0iktc87fg38QXQPJl2jx6GAJsfwL718ir2/QfnRjv19jlFQMDBf/iB3jwDqzcwfgByh+j1xH6IiReRWZi/xfDILX7utYnvYIipj5Gc07vGyxJLNEPL4NVv8X9Ms49x2zByYpVyTig1bP11tMLoM7ueQfZ9+Zq9OHtfAqcv2MBLuQzRtcMzIBfch4j5ErvoVPJAlaIXkPkSpw8IEwDRm/qApcDud+xDZ9O0MUfMDU/8G7c5efQzyZO6p/VEfbxpyH6IH/IGIuQXECKM/yH7GX2y7hv6g/U2efHDqg/Y52Nsr+QPuQ+RnCDEJkCdzd8EfcB+iY7YImr5WsXgNUS2iUlVbRKZriFoYuuBe09M1RAKXddvAEXYxBpxkG0fURH0vemQU4t/OjQMbPkPch0jc9dyHqNkxiDs54GeKMjP29sN9iLbPcURt9giEzyf3IXLixafSHvQHKH8cgMjWFCZygP+friECPXIfIgjxPC1iexbRPLgP0Rb6dgITeOfXEPlyDOqbzBTN/MGja4ii/kBc7kMEEeLX5ldKqseejL3fKBN/4ARreprc50C9RHs4ngH3+XP+wPiFcYIPn7yG6GaH+3Mf+xQWryHKn+1s2dX6p43UXLMPURzxsvo6M6OB8bmhBfM1zEyZfLps2vvJMzMKDu5DFAvUxh0Ptls0X/5bgtmMBs4MBXl6+mhrInbkKc2ekYP7EHk5rDk2AbgPUZqiiIkJRyQ3O2jRcB+iafVFeYI/4D5Ew565D9Gj/mA7l/sQ+cxyHyLbPmb+INZHKBtIf+Tf+wFnaqk/yOw58dM2wq63x9cQjfp41Rqid/EMUR95aDd4cm7NQAv7YTujUuRJa4j2DHg+ozEcUSn2axzBLMJ9iMJIMBqllUNsfcjLUQQP+/RnNYr7ELVwO8p9iM74A6NFTBfLEQqc+xDl/gDLscvT6qO9sXF+ARI7XEPUFZJk0vq1oUcQ2NnR4QwnztDU/Ef/5uUeX8H/Wz2WIe6Q34fch8iWD8wEpP5gNqOBim35h/KZ6PHhNUQzf+DsWE/McM5mNIKAYmvTUGNu5/2KpD5G/5ZcyH2ItsunHY6ZP4DoJu1zzx7+bP1BsfoTuB7t2LcTMYFxfV690KHU+A78QfRnEP9T9yEK/Y01LJwhMoKqiMjBmoFJw9aud6GYhtVZvsrWqx+HZHRprffYybd1OOa52R5ma4fU/oyeyl2f2auTx40EadflCM+uITIjNl0993jD4eQpVV2ayOHzZA95gzYNG964qwuM1or/cbaGSG1uRZJum9iRi1HsLY0MkMc2CK5hOJjp7OoJF6ZJZiNbpdURUGhcMzC3X+ywZGuIejnCCFzYh8i3UFFlSQXuuU2Kv50X1wwk8jiDGqeoxDVEcAFW1zhzuzOFl9XHUJwH/mDE4iKsh8AfxPbHx7E3opk7HC9PL4e7lHKTdA0RaOD0moGT/sAbxKiPOLM19wdOHaE+nl9TOFFTsONG3nHDjPU8aRJdzHj8tfmDbEQ6JPfENUQqko9Imz92ZmYWZm+Zs/bc4/0KrCESq7+hR6hwwR9MFHvaHxzVB18+ZRZhvN/R5Ge80PqBE/UxyNPt2MyEi4i9L8D6eNofiEhbQxRnDpu49i1zN+/PBD/gl3LKH2R1LMhzxh+ovSo+eh8H9IrX34n6eMYfoA256mr9m21zbOiuPfFEjGlo7GByLk7i1w78Aa4hcvYs9zro/9gaotjfWMO6GaL6Z4yElmrAkzVErcyhy9qWkz1lHyLXsJiRqHFGkm8ckRZYNwAjMd5hWjkEP2zfghwgz2SGYRgw9yFydhVGFH26uxOEiYDch4j7EHk5rDxxOGHuDybZyvxbAXmcwC1Un1yL38wUZSPsYaaI+xCJewT70B/Msu/zyX2IjHhFHl5DZB9J2h1PcgIkMyDBUMHeEn/gzjvpD45nwN/pNUQ1j9Pm0csz7EBchNyHKK+P4T4nGIIc+IP8stQfZBUB/UGBNUSh4oKeZP8+Z/g1f330B7lf69mc+IMocJPnaWuIWp1Y2RkSWTlDVCu373m230zYeoauJG08MhowFVEs4Z0GrXUlenqJsuYjJnPJXKNhvvq2JK+R1k91vWDNmacs3IdomsERKdwZ1KrviyYWWLjclQ92akRcHke0R2uIhh1zHyKQx/28CcB9iNIUvTyZPdhoigj3Idrxb8YfZGuI/A3ajn9TH2/zB/kdF4qH/qDgCb1eYP772oFDf3CwhmjisHz7xn2I9sH6CCPsR/7AKULwF8n8KvqDaOC+PnIfolyO4N+yGdukPp7zB+fXEIU1hQplM/UHUG8SO/qa3Yeo6avKtYq1M0RiM3e0hihcsH2tEr7KPkR7Bnw8YnK0hqjd2OyvIWrXcx8irDBwHswQoZ64D5FpmJ0ewH7r9dyH6Iw/GMz8gdVR/5j5A/H2O+RvcjQ7bqc94g98ttMRVPF6DzNE3IcoqssYCvchEnEzaOguuA+RSTDqgfsQcR8i7HA4OwN/EN2DSdfocSigyTH8Sy+fYu9vUH60Y3+fYxQUDMyXP8jdI4B6M/MHIEeofk/ehwiys4i1b5kzhiFysIZoXCjBks0Q8vgV1hD1E8bIrJpj5sAs5Zjvdqb6y1q8cS2RJIbo08/s1cnjGjh12R5Gwn2Ipg2OGbngPkTch8hVv4IHsgStkAcjauolHnWr5coqwirE5y1tv0YFDid4fzCtCWn63IdooqMe2hNKIkciqfqiTf3bgT84XEPUz33iGqImT+ae2h/18aYh9yF6wB+ImFtAjDD6g+xn/MW2a+gP2t/kyQenPmifg729kj/gPkR+hhCTAHkydxf8QcHTTPYeW0MEXine71i51fugPDpzYZLBzB9csQ9R7G+sYeFb5iCUUg14soaohaEL7jU9XUMkcFm3DRxhF2PAWb4L5BvXEPWMQvzbuXFgw2eI+xCJu577EDU7BnEnB/xMUWbG3n64D9H2OY6ozR6B8PnkPkROvPhU2oP+AOWPAxDZmsJEDvD/0zVEoEfuQwQhnqdFbM8imgf3IdpC305gAu/8GiJfjkF9k5mimT94dA1R1B+Iy32IIEL82vxKSfXYk7H3G2XiD5xgTU+T+xyol2gPxzPgPn/OHxi/ME7w4ZPXEIX8r2HhGiL87p1sD3vP0D+T6MvBNmBQwtMG3aXs82Qyd2ZGI0imPn0/4tR+8fl02bT3k2dmFBzchygWqI07Hmy3aL78twRPvXUF5enpJ7XPjDyl2TNycB8iL4c1xyYA9yFKUxQxMeGI5GYHLRruQzStvihP8Acl6TDv+Ddrxy0m6w+yGwrnD2yswyZj+pjsTvk4f3CwhggVNNQi3IfocX+wnVu6HKf8gVWJVYCzY2/nKI+9PprPrP4UjBAyI0EOrwruQzQRxPg1dAD5GqJYH6FsIP2Rf+8HnKml/iCz58RP2wi73h5fQzTq4xVriE7ePj/I8jVE9sgYCZ6vGWhhP2xnVIp8xdYQWUdUiv0aRzCLFOE+RCAPWoCVQ6wB5+Uogod9+rMqwH2IWrgd5T5EZ/yB0SKmi+UIBc59iHJ/gOXY5Wn10d7YOL8AiR2uIeoKSTJp/drQIwjs7OhwhhNnaGr+o3/zco+v4P+tHssQd8jvQ+5DZMsHZgJSfzCb0UDFtvxD+Uz0+PAaopk/cHasJ2Y4ZzMaQUCxtWmoMbfzfkVSH6N/Sy7kPkTb5dMOx8wfQHST9rlnD3+2/qBY/Qlcj3bs24mYwLg+r17oUGp8B/4g+jOI/6n7EEG4irVvmZMxcixysGZg0rBVP+FDiN+fiO9NV4lDGnnjKYINgnlutofZ2iG1P6Onctdn9urkcSNBNd4mYjcS7kPkysdlyK4hGtfMqwrIM71RizNUKkl4ZsZPfXxOnuSGPa4ZmNsvdli4DxFW/8wfJMma+hiK88AfjFhchPUQ+IPY/vg49kY0c4fj5enlwH2IwoCzkyP7knfcMGM9T5pEFzMef23+IBuRDsk9cQ2RiuQj0uaPnZmZhdyH6LA++PIpswjj/Y4mP+OF1g+cqI9Bnm7HZiZcROx9AdbH0/5ARLgPkQS/lkZe6+MZf4A25Kqr9W+2zbGhu/bEEzGmobGDybk4iV878AeX7EMktr2e3es9zrIOUev/lx6WasCTNURNBhCmLSfjPkTNgLkPUdefSd8k4sLdCcJEQO5DxH2IvBxWnjicMPcHk2xl/q2APE7gFqpPrsVvZoqyEfYwU8R9iMQ9gn3oD2bZ9/nkPkRGvCIPryGyjyTtjic5AZIZkGCoYG+JP3DnnfQHxzPg7/QaoprHafPo5Rl2IC5C7kOU18dwnxMMQQ78QX5Z6g+yioD+oMAaolBxQU+yf58z/Jq/PvqD3K/1bE78QRS4yfO0NUS9v1FaLtew9C1zVnXHa4jElKSJZ1ydjABJVkLu2naFxKj7sXzEZCqZbzTMV9+W5DXS+qkiRp69GQUnD/chmmRwRAp3BrXq+6KJBRYud+WDnRoRl8cR7dEaomHH3IcI5HE/bwJwH6I0RS9PZg82miLCfYh2/JvxB9kaIn+DtuPf1Mfb/EF+x4XioT8oeEKvF5j/Pux46A8O1hBNHJZv37gP0T5YH2GE/cgfOEUI/iKZX0V/EA3c10fuQ5TLEfxbNmOb1Mdz/uD8GqKwplChbKb+AOpNYkdfs/sQJTN1K1i4hqjd2NVQjtYQtdALw32I8BEk7kMEGfOp4AxNdzBY/Hk+uQ8R9yHyerQCxDsM7kPU7LgdnfiDNkNjkvNy7PkDI0/QYzERiUB1S2Zs8YQuqLMnMMP5iLARJJ8RiHYZxNvxB8H9FCifaYcr9wdhxhb8wRadolpMyH2IRoJRD9yHiPsQYYfD2Rn4g+geTLpGj0MBTY7hX3r5FHt/g/KjHfv7HKOgYOEcud0AACAASURBVGC+/EHuHgHUm5k/ADlC9XvyPkSQ70Usfcvc6OFuf7gPUeLAUB7XwKnL9jAS7kM0bXDMyAX3IeI+RK76FTyQJWiFPBhRa37N5MBe6z46hfi8pe3XqMDhBO8PpjUhTZ/7EE101EN7QknkSCRVX7SpfzvwB4driPq5T1xD1OTJ3FP7oz7eNOQ+RA/4A5Fwd7bnD7Kf8RfbrqE/aH+TJx+c+qB9Dvb2Sv6A+xD5GUJMAuTJ3F3wBwVPM9l7bA0ReKV4v2PlVu+D8ujMhUkGM39wyT5EMmvPXo3lb5kbYakGPFlD1MLQBfeanq4hmiRsR4J8hcy1xn2IJs8Kt9OPZrx6uiCPSBy5cfZQvN4w7PkvQ38mfZOIC7kP0XYC9yESXy7BHwiUp7ffUsvxeIQdR1Qxwz6C9WuIUH8YHfchcjMgPSMoPyQbsg9+o/rVbAbc+4NJuzMbkQ4nQvkIpDeTfyJHwfO0iO1ZRPPgPkRb6NsJTOCdX0PkyzGobzJTNPMHj64hivoDcbkPEUSIX5tfKakeezL2fqNM/IETrOlpcp8D9RLt4XgG3OfP+QPjF8YJPnzyPkR58q/M2jVERnOf/Y1feZactTr/hBBCCCGEfM2jB+Erxw0RPhz/gxl7Sr7Do8OLWDdDdFWXjRBCCCGEEPJ1z1X9jaVriAghhBBCCCHkCq7qb6xdQ3TBFBYhhBBCCCGEXNXfWDhDpGsfZiSEEEIIIYSQylX9jf1tqB+Ey4gIIYQQQgghV1Dkmv7Gug5R229CVZK94QkhhBBCCCHkyehF/Y1lj8zdbrf+onON26kTQgghhBBCyJMppUgpJdko8NVYuw9RXeWkp7agJoQQQgghhJBzaNyBdgmL1xD5XcsJIYQQQgghZBVX9DeWdoi0/uX8ECGEEEIIIWQ1V/Q3lj0yJ0X7BNatsE9ECCGEEEIIWUe5iZbaGVrZ3VjXIeI2RIQQQgghhJCruKi/sXYNETciIoQQQgghhFzEFf2NZTNERURER0gIIYQQQgghq7iqv7H4LXM+JIQQQgghhJBVXNHfWNchutcdY+9rd44lhBBCCCGEkKv6G+s6RDcICSGEEEIIIWQVF/U31r1l7r4sJkIIIYQQQgjxXNTfWNu/4iwRIYQQQggh5Cou6G+smyESFblvL3wonC0ihBBCCCGELOWa/sa6DlHtpfENc4QQQgghhJDlXNTfWPqWORcSQgghhBBCyCou6m8sfMtc8SEhhBBCCCGErOKi/sayR+b0rlKkiMoWEkIIIYQQQsgqrupvLJsh2rKkPSSEEEIIIYSQVVzV31jWIVIICSGEEEIIIWQVV/U3Fs8Q8S1zhBBCCCGEkPVc1d9Yt4aIU0OEEEIIIYSQi7iqv7GsQ1TaHxVOExFCCCGEEEKWclV/Y93GrGVb4KTsDBFCCCGEEEJWc1F/Y+0MkXByiBBCCCGEELKed/8aot5lE+E8ESGEEEIIIWQlqiJyK7r6NXPL3jInZTzXx94QIYQQQgghZCm2v/GuXEOkKm2KiG+cI4QQQgghhCzF9jcWTsGsmyESkVLUhYQQQgghhBCygiLX9DcWdojazBBniAghhBBCCCFr0dbP0LX9jbUzRHWFU1m90okQQgghhBDydU8RrQuJ3o0zRNpeMHfdLrKEEEIIIYSQr1NMf2Pl/Ms1b5nja+YIIYQQQgghK7mov7H0kbnWUVO+VYEQQgghhBCyklL6g2grOxtLO0SEEEIIIYQQ8tXE0n2I6mvBuTMrIYQQQgghZC0X9TeWriFyISGEEEIIIYSs4qL+xrIZIk4QEUIIIYQQQq7iqv7Gshmi/saHVRESQgghhBBCSOWq/sayDpHKvb4b/C4i91XREkIIIYQQQshl/Y21M0Ry5wwRIYQQQgghZDlX9TcWriFqT/NxCyJCCCGEEELIWq7qbyzrEN1KfaBPuZCIEEIIIYQQspar+hvrZojsH2WPiBBCCCGEELKOq/obyzpExU1d8bE5QgghhBBCyDqu6m8s3YeIGxERQgghhBBCruCq/sayt8z1d4JzCREhhBBCCCFkNRf1N5bNEG3vBO8fCSGEEEIIIWQdF/U31s0QiUgpPiSEEEIIIYSQVVzR31g3QyTKGSJCCCGEEELINZRr+htL1xC5kBBCCCGEEEJWs7i/sfC126V31FS5EREhhBBCCCFkISpSSln+MNraGSLOEhFCCCGEEEKu4KL+xsK3zG2dNTWfCSGEEEIIIWQJpr+xcp5o6VvmRDg5RAghhBBCCLmO1f2NdR2i1mPj7BAhhBBCCCFkNRf1Nxa/ZU7rO8HZKSKEEEIIIYQs5KL+xrI1RFtPrYiIcgkRIYQQQgghZCm2v7HywbllHaJbMa98KJwiIoQQQgghhKzjtdut9jHWriJaN0NkP/DNCoQQQgghhJCFXNXfWLgxK34ghBBCCCGEkDVc1d9YvIaIEEIIIYQQQtZzVX9j6T5EbRlR4SwRIYQQQgghZDFX9DeWdohap42TRYQQQgghhJDVXNHfWDtDBCEhhBBCCCGErOKK/sayNUSi2t/8wAkiQgghhBBCyFIu6m8snSHiFBEhhBBCCCHkMi7obyzsEGntqimniAghhBBCCCGLuaa/se6RucLpIUIIIYQQQshFXNTfWDZD1N4Lzv2ICCGEEEIIIau5qr+xrEO0ddi0h4QQQgghhBCyiqv6G8semVPdJq9U+NAcIYQQQgghZC1X9TfWzRDVP6V/IYQQQgghhJA1XNXfWDpDtH1YFSMhhBBCCCGEbFzV31i6hsj12gghhBBCCCFkEVf1NxbOEI2uGieJCCGEEEIIISu5qr+xcGPW8WrwwikiQgghhBBCyGKu6G8smyEqRWu4KkZCCCGEEEII2biqv7F0hogQQgghhBBCvppY1yFqz/SpClcREUIIIYQQQpZi+xv6LtyYVcrNzGEpH5wjhBBCCCGErKMUESm6+pm5pW+ZGzvHcoaIEEIIIYQQso6tv1FERZe+dnvdPkQQEkIIIYQQQsgqtn7G2s6QyMIO0Xikj7NDhBBCCCGEkLVc1d9YN0PU3wnOOSJCCCGEEELIWq7qbyxcQ7QqJkIIIYQQQgjxXNXfWLqGiOuICCGEEEIIIVdwVX9j3QxRGV025UZEhBBCCCGEkIVoqd0MXbvJz7qNWYUzRIQQQgghhJBr6DNE5V06Q2SnhTg9RAghhBBCCFmJXUO0sr+xdIaIEEIIIYQQQr6aWDdDxHkhQgghhBBCyGVc09/gDBEhhBBCCCHk65aF+xCpFNn6bXypAiGEEEIIIWQlV/U3lnWIbvV1D4U9IkIIIYQQQshirupvLHtkTvtrwbkLESGEEEIIIWQtV/U3ls0QlSIiorWzxh4RIYQQQgghZB1X9TeWriESriIihBBCCCGEXMBV/Y2Fb5krtdfWQkIIIYQQQghZxTX9jaWv3W67xyqfmCOEEEIIIYQs5or+xtIOUYGQEEIIIYQQQlZxRX9j2RoiURWtj/Qpe0SEEEIIIYSQldj+xsJo13WIOD1ECCGEEEIIuYqL+htLZ4gIIYQQQggh5BIu6m8sXUNECCGEEEIIIZdxwdNo6/YhKkVLaR03riIihBBCCCGErENFpJSydTcW9jaWdYjau8BL2yuJEEIIIYQQQhbh+hsLWTdDZHeOZYeIEEIIIYQQshDX31g4RbRuhkhEpLTOEHtEhBBCCCGEkHVc1d9YP0PEt80RQgghhBBCFqNaNzxVXfrc3Lq3zJVSe218nwIhhBBCCCFkMRf1NxbuQ2QmrjhJRAghhBBCCFnJRa8qWLsP0UW7xxJCCCGEEELIFf2NdTNERcc7HwrniAghhBBCCCELuYkW0cXvmFs4Q9Q7a5wdIoQQQgghhCzmqv7GwrfMXfFWcEIIIYQQQgi5rr+xdoaojJAQQgghhBBCVnFVf2PdDJF97QNXEBFCCCGEEEIWclV/Y+lb5viSOUIIIYQQQshVXNHfWNch0u2ND6K67SJLCCGEEEIIIau4qL+xrkPUdo6VIoWvmiOEEEIIIYSs5KL+xrp9iFSl7UTECSJCCCGEEELIUi7qbyzcmFWEb1MghBBCCCGEXMJF/Y1lj8y1XhrXDxFCCCGEEEJW4/ob78YZolK0hiKcKSKEEEIIIYSs5Kr+xrp9iNgHIoQQQgghhFzEVf2NdTNEqyIihBBCCCGEEKD1N1TepfsQtUf5Fj/SRwghhBBCCCGjn7G4v7FwH6LaUyucLSKEEEIIIYQs5qL+xrpH5upDfewMEUIIIYQQQlZzVX9j3QwRIYQQQgghhHyVsfKlCm3jWNHCiSJCCCGEEELIWkoRXf1WhaVriFxICCGEEEIIIau4qL+xcB+i8a4HvmWOEEIIIYQQshLV/kDaUrgPESGEEEIIIeRdz1UPpC3ch0jrPkTKGSJCCCGEEELIUq7qbyzrEJVS36RQ+EYFQgghhBBCyFqu6m8sXkO0PdWn7BIRQgghhBBCFnJVf2PxPkQKISGEEEIIIYSsYn1/Y12HiH0hQgghhBBCyFVc1N/gPkSEEEIIIYSQdz8X9TfWvWXOh5wnIoQQQgghhKxE25+VnY3l+xBxgogQQgghhBCymqv6G+veMmfnhtgrIoQQQgghhCzkqv7Gun2I6n8p7A8RQgghhBBC1nJVf2PhPkTm86pICSGEEEIIIUSu628s3oeIEEIIIYQQQr56WNghas/0cX6IEEIIIYQQsppr+huL3zKn9QM7RYQQQgghhJB1XNXfWLiGSKVIqW9/4GsVCCGEEEIIIeu4qr+xboao9tR6z40QQgghhBBCFnFVf2PhPkSEEEIIIYQQcg1X9TeWvmXuqt1jCSGEEEIIIV/f9H2I5F26D5Ho6LVxtogQQgghhBCyEu5DRAghhBBCCCGLWTdD1N8LLnxmjhBCCCGEELKYrb+h2l6wsIb1M0TsDBFCCCGEEEIuYmVnSGTpW+bKeJRPld0iQgghhBBCyDJURaSU5a8rWLcP0aqICCGEEEIIIQRo/Y3VK3QWzhC1rKnwPXOEEEIIIYSQldj+xsrexrqXKhSRYrJJCCGEEEIIIcso2xNz79oZItHRU1PlDBEhhBBCCCFkIaqi7+oZIs4LEUIIIYQQQi6jQLiGZa/d5uwQIYQQQggh5Cqu6m8smyG61SyWIvWdeIQQQgghhBCyBtffWPjQ3Lq3zNk8sT9ECCGEEEIIWchVcy7LHpkTueqpPkIIIYQQQgi5pr+xtEOkEBJCCCGEEELIKrT+Wdnf4AwRIYQQQggh5KuC0v+sY+Frt7f3gavItkMrIYQQQgghhKyibDsRrd6YdekMkQhnhwghhJD/v727+5HsTu/D/jznVFV3z8tyl1xqN7uUbMjr3ZUEx3YEA7lJQFiAg0gGHMW7ge0rQ4INw7k0kJtYiuTYf4Ev7PsACZBVohfsaiEJQiaWERuyVooki/tCStgXcknuLDkc9sz0THfVeXxRVd1VPd0zQ87vkDOczwcYnqqu7tNn5qIOv/X8nucHwHha540R9iFqdUYAAIClsfJGs0B03D+kRAQAADQ2Vt5ouA+R0hAAADCOsfKGKXMAAMBjYYyc0TAQ1WoueBkxBwAANHaSN1pqN3Y7IyLq5AgAANDKSHmj3ZS5Wm4Zuz4CAAC0MlbeaDhlLreOAAAArYyVNxpOmYtl+ar11rEAAMATb6y80a5ClKvrSnkIAABoa6y8Mco+RFqIAACAlsbKG033IQIAAHicNKsQdZW1XtNXWVbNAQAAzWRFZGY9sj1ExxclCgEAAK2NlDfa9RBFnfkYAADgYY2VMZr2ECkSAQAAYxkjb7QLRLXKbKU+BAAANDZS3mjYQ7TaMzbVhwAAgMZGyhvNeoiWSS31DwEAAO1t5I1suGiu8T5Etbo0oQgAAGitfd5oFojWG8eWLAQAADQ2Vt5oFojWS/m0EAEAAK2NlTfa7UO0kdQUiQAAgJbGWonWuIcIAADg8dFuylwMx49SkQgAAGgooyqymieNthWiMbaOBQAA2NQwbzSrEA1R0dWqTqQ+BAAANDRW3mgWiLpTRwAAgFbGyhvtKkRVsaxdKQ8BAABtjZU3GlaIMjIjqtJeRAAAQFNj5Y2GU+YqqjKiSo0IAABobJy80XgJXpkwBwAAjKR93mgWiIaKiFqt7VMiAgAAGhorb7TrIcqIyIiuUpUIAABoaqy80XDK3OqB6hAAANDYWHmjXQ9Rrk6mOgQAALQ2Ut5oN2WuarlrLAAAQGsj5Y22U+ZUhwAAgLGMkDca7kOUx6v5Kko0AgAAmqmK6DKrIh7NoQrHu8VmGKwAAAA0tZk3WlZfmgWiqjrzMQAAwMPayhsNz9u0hyhPHQEAAFoZI2+06yEaKqqLiCGiUoUIAABoqFaTCoa2FaJ2gahf5bS2c+sAAAAiulw2EnXRtETULL5UVURF1PI/AAAAzYyVN5oFomVIq+MjAABAK2PljXZT5oaK9cxtcQgAAGhpWSFa7/HTbs1cwwpRRnarozFzAABAQ1t5o+HcgrYjEIbVUYkIAABobTh1bMBMOAAA4InVrodoa+dYJSIAAKCdzbzRUtMK0bp3SA8RAADQUsY4eaPdxqy5qguZuw0AALSWURUVkW3DRtsKUcuTAQAAbBgjbzTsIVodQzACAADaGitvNNyHaPsIAADQylh5o1kgqtVsuSoz5gAAgLbGyhuNe4iWTU4pEgEAAA1ljJM32k2Zq4qKjGV2s3AOAABoZ7kPUfu80bBCpIsIAAAYyzh5o10PUW0fAQAAWhkrb7SbMjfCrrEAAAAR4+WNdvsQGaQAAACMZKy80XjKHAAAwDjGyBvNKkQZWZERuRwOLhsBAADNZEVEl5WPag/RVlwThwAAgJZGyhvteog2xz0YNQcAADS0nTfanbfdlLmwExEAADCOsfJG4wrRaudYFSIAAKChrbzR8LwNp8zlaiZ42owIAABobJy80bxCVFWR9iQCAAAaqqqIWueNdtqN3e4iImoZ1uQhAACgoewiIqv5YrSGFaL1oyHCNkQAAEBDW3mjYedPs0AUMcS6OGTJHAAA0NayNWeZN4ZmZ20XrWq1Uq6smAMAABobKW+0C0Q2IQIAAMYyUt5o2kN0vGROiQgAAGhoK280PG+zCpECEQAAMJax8ka7CtHmSj5TFQAAgIYqa5SM0a6HKEKZCAAAGM8IeaNtIKpTRwAAgFZGyBttAxEAAMBjpOGUOWUhAABgHGPljWaBKCMi82QcHgAAQCtj5Y2GS+YqarV1rFoRAADQ1jh5o2EgMmIOAAAYyzh5o2kPUUau8ppQBAAAtDNW3mjXQ5QREbW6NIvmAACAdsbKGw0rRLEMagpEAABAY2PljXY9RLm6LmEIAABobaS80bBClKuZDxEZJRYBAADNLCfMZbVekNasQmTGHAAAMJax8kbTKXPHa/oMVQAAABrazhvtNNyHaCO1KRMBAAANZYyTN5pViCJW6/pKfQgAAGjreCFa47zRtEIUEZqIAACA8TTOG80CUdUyqq2PAAAArYyVN5otmcuMiKxIQxUAAIDGxsobbafMRS4biSybAwAAGtrOG+0CR9sKUazDkAoRAADQzlh5o92UuTo5KBABAABNjZQ3mk+ZE4YAAICxtM4bDXuIWp0JAABg21h5o22FKE8dAQAAWhkhb7TrIdrcMla5CAAAaGozb7Q7a/MeIgAAgMdFux6irWepRAQAADRTI2WMphUiLUQAAMBYxsgbDQNRLatEVetHAAAAjYyTNxr3EJXyEAAAMJL2eaPhPkTrPWNVhwAAgLbGyhsNK0S5Cmt5/AgAAKCNcfJGu0C0HgteZRsiAACgrZHyRtuNWddM3QYAAJoaJ280qxDV6j91/AQAAKCNsfJGs0BkDyIAAGAsY+WNdlPmtnOaXAQAADRTW4d2mu5DlKsYJA0BAACt5QhBo91QhdrIbBIRAADQ0kbeaBmM2vUQqQ4BAAAjGStvtOsh2lzNZ8ocAADQ0Fh5o20P0akjAABAK2PkjaY9RBWKQwAAwAhGyhtNK0SRq7SmRAQAALQ2Qt5ouA9RRVRGHB8BAADaGCtvtFsylxG5vMxIC+cAAICWRsobjXuIlomtrJkDAABaqiEqumidNxr2EJkxBwAAjGUdXdrmjWaB6Hjj2DJpDgAAaGusvNEsEOVGgUiNCAAAaGmsvNFuytzG1rGlRgQAADRUNcQ6Cj2SFSIAAIDHTcMKUaxmzFkyBwAAtDVW3mjXQ7T6T+udYwEAAMbKG+32IdpeyaeJCAAAaGmUedbteohsQwQAAIxlpLzRcB+iZWArGxEBAACNjZU3GvYQ5dYRAACglbHyRuN9iMyZAwAA2hsrb7Tdhyhr+wgAANDKCHmjXQ/R6j91/AQAAKCNsfJG232IwmI5AACgvbHyRrt9iPKkblVVchEAANBMRURm+96ctj1EAAAAj5FmgWioiog6PgIAALRSI+WNZoGoy+0jAABAKzlS3mjWQ7RMaiulQgQAALRTVaOsQ9NDBAAAPLHaTZkbljvGVlSkHiIAAKClqoha5412GlaIMqKLyMiTBX4AAABNbOSNho1EzSpEVRUx5Kp/SIUIAABoZytvDO3O227JXB9xHITkIQAAoKUuInIVhhquc2tXIRoiMqL5mj4AAIBYLUSrqMjhEVwytw5puYpFAAAAreTxsW35pWEPUaszAQAAbBsrb7TdhyhPHQEAAFoZIW+0G6qwXNAXFRGpXAQAADS1mTfanbVthSgUhwAAgPG0zht6iAAAgEfe49FDBAAA8BhpVyGKIXK1cWymudsAAEBLVZG1zBsNz9qsQmTAHAAAMLY8/k8bDStEdbIfq/oQAADQ0Fh5o+HYbbUhAABgLOPkjXZDFWo1F7xKhQgAAGhrpLzReMpcrXKbRAQAALTWPm803IeoYlnGWh8BAADaqNU466i2eaNZIMrslnGtMipKIgIAABrKyMzl0O2GaaPZkrla/aeOnwAAALQxVt6wDxEAAPDIGytvNBy7Xec8BgAAeFjjZIzGU+YAAAAeH+16iKoioo6PAAAArYyVN9r1EOX2EQAAoJWx8kbDfYjOfgwAAPCwxsoYeogAAIAnVrNANNRyKPj6CAAA0EqNlDeaBaIuIiJrdUKJCAAAaCcjRskbzXqIhqqISA1EAABAc1UVVau80XCyQruNWbvNvWOFIgAAoKEu12Wi1bHRaVudaD0OvCLkIQAAoKnNvNFyUVq7fYhanQgAAOCUPOfxw2q4D1Gd+RgAAOBhbeWNhue1DxEAAPDEatdDNKzW8w1aiAAAgLbW2w+1zhvtKkTdai1fp58IAABoLMfJG+3Gbg91nNRKjQgAAGip6ni63KNZIQIAAHjMNJ4yt96UVYUIAABoZztvtNMsEGVmZBdRQ0Z2KREBAADNZHZ1kjfanbdthWjI1bHVWQEAAMbLG82yVWZERJkwBwAANDdW3mhYITp+FFFiEQAA0M5YeaPd2O2t5iYtRAAAQEu1MVKhXd5oWiFaX6D6EAAA0NLmHkQt80a7HqJTRwAAgFbGyhvtKkTbNSy5CAAAaKYiIjKqdYmo3QRvJSIAAGBsjfNGwwqRQQoAAMA4xsobDfd4VSQCAADGM0beaDd2u06G35ViEQAA0NJm3mh42qYVIqUhAABgNCPkjYb7EG0MBtdPBAAANFQ1RFQ234hIDxEAAPDoy3HyRsNAVKveodJDBAAAtFXj5I1mS+YyN/OaRAQAALSTuS4RtV2P1riHaBWG5CEAAKChrbzRMBS1nTI3yiA8AACAiDHyRrtAtB4yJwsBAACtjZQ32gWi3DoAAAC0M1LeaNhDtPmk1VkBAADGyxuNe4gAAAAeH+0qRENtzHxQIgIAANqpqshqPWOuYYVojF1jAQAAIsbLG+0qRFvPUokIAABopkbKGG17iLpTRwAAgFZGyBsNK0QVMay6iAYL5wAAgHbGyhtNaznrYQqGKgAAAK2NkTeaVYiiKipymdyMVgAAAFoaKW807vap1aWpEAEAAK21zxvteojWQU0WAgAAGhsrbzTuITr9AAAAoI0x8kbLfYhqdYwskQgAAGhnVSGq1hMLmlWIcqytYwEAgCfeWHmj3ZS54xF4AAAArY2TNxpPmQMAAHh8tJ0yd/yk1VkBAABO5Y2GRpkyZ9kcAADQ2hh5o2EgqtWYuVo/AgAAaGScvNG4h6iUhwAAgJG0zxsNe4g2to5VIAIAABrayhsNNRy7rYMIAAAYyzh5o12FaFjntYoUigAAgIaqIrLa541mgSi7jY2SxpqJBwAAPJEyl/1DyyjULm80rRBFFxFDqzMCAAAsHbcQNc4bjafMrVgxBwAAjKVhiml2qoqIGJZHK+YAAICWtvJGwyrRKBUiBSIAAGAsLfNG432I1u1NSkQAAEBDNURFNk8azSpEdiECAADG1jpvtNuYVVEIAAAYy3rKXOPc0baHSJkIAAAYW8O80bSHKGM9YU65CAAAaGc7b7TTbsncutaUERkpEQEAAO10q4yRj+iUuaiKVWZbHQEAABoZKW803oeoTh0BAABaaZ83Gu9DtB77oEIEAAC0M1beaLdkLrtVTMuIKokIAABoKCMyq3Xxpd2SuVUcaj31AQAAYKy80S4Q5dYBAACgnZHyRsMeomHjSauzAgAArHuI1mWidudtPGUOAADg8dEsEG0OwFMgAgAAWhorb4xSIdJHBAAAjKVl3mjXQzQsc5rqEAAA0FxVVLXPG80qRHnqCAAA0FTXPm807CGq5Xq+KlUiAACgqYqKGtrnjYY9ROvB4GpEAABAa+PkjYb7EFVk5KpOJBQBAADtjJU3mgWijIhcFa/SojkAAKChsfJGs0AUtT0bHAAAoJmR8sYo+xABAAA8Dtr1ELU6EQAAwClj5Y22FSKbEQEAAGMZIW80rBBV5GpdXyoXAQAADQ1R0Y2QN5pViBSHAACAsayDS+u80XQfouPHrU4KAAAQEUPVKMUXU+YAAIAn59QirgAAGlRJREFUVuMKUcaym0iNCAAAaKdqiGU9p23WaFghyshcHxWeAACAlrrjvLF60ETzClFVRZQKEQAA0E7VEBVdVFXTKXPNAlFkHM+/yzR4GwAAaKfLPElCDacrNF3btiwMlQIRAADQVMU4eaNhhWgjrlXZjggAAGgrs1rvRNSuh2jYeNzqpAAAABExVDTtHVozDg4AAHhitVsyt9o5tiKiUyMCAAAa6qpW3TltF801qxAdjwQ/fgIAANBW67zRrofonMcAAAAPa4hx6i56iAAAgCdWwwrRcFwasg8RAADQUkWdBI2GeaNphUjrEAAAMJYx8kazCtFQFV2Mt7YPAAB4clVVVCzzRsuqTrNA1IlBAADASHKkvNEsXA1VMUREVOkhAgAAmqqNvDG83z1Ek8lO9f30jMtYfSklIgAAoLWz80bfT2sy2XlXIaRJhSi7G1WrytD6mGkJHQAA8PAyM+7KG92NJlWYhwpE2V87uYiM1yIjIjMiIyYTWxwBAAAPbzLpIrplzojMyKgX169tZZJ34cFTy5XlYTabnf0Lq74btSpiVcQkuzNKRNbSAQAA93J3Zpj0fVZFrPNGVe2f9ZPHWeXKg/+2d1zGeeGcry+Ojn474mTk9mQ2sWwOAAB4KJkZk0l/nDMyTrLHaedllXt56HVt2U0qImL/2qu/tVzPt/zTdV3u7UwlIgAA4F3b3Zlm13W5mTX2r73xWxEnWeRhNBqq0NdrL/7ed2K++OLm16ezaU4m/alQZNkcAABwlu2sMJn0OZttF1mG+eKLr734/30nu/69HKrwhYp4tuLy5Vpe2MvVdbPq3phU1y9TWWZft97+9r+MihtVVVVDVFRc2NvJvd1Zbi+fE4oAAIBNJxkhM2Nvd5YXLuysKkNDVFVFxI3bb3/7X2Yuw1DXT5aZpJvVZPLy8ucvX15ml/jCA2WO8wLROwos2fWV3Y1669v/4TtHt67//HqB3zoCTWeTvHhhJ3d3p9lP+lVvkVAEAABERGRlZvSTPnZ3p3nxwk5Op5OTisrq0dHt6z//1rf/w3eyu1HvokJ05vdP3vG17u1VHB7mZLJTw3BYQ3+tcnG5Ig5j/2Zfw9e//Bsf/5G/+Qv9zsVfiKiMWl59l13Opl3MJpGRy8vJjKha/QXPOHrd6173utffu9dv3bpT88U8ngTTyST3dnceqX9/r3vd615/wl/PM1+PWH0hanH75i+8/tUv/8bNg2l1fUR2k8r+WvX93smmrHt76596YA+yZO7kpFeWh5fOGL2dXV+ZfXVdV6++8Ku/NL+1/08icj9Wf5+zjnHO173uda973evv/et7e7Psuz4+6Pquj729WUQ8Wv/+Xve6173u9fNez/35zf1/8uoLv/pLXddVZn9mdeils0du3zcg3evOl9uPfywjLkZ84lrGfJ4frWuxWHwo68Yi48JeVg0ZdZA7d2ZZ08r9733rz3ISvzXZeerD2fWfPjMiOjo6Ojo+MseMiL7rc74YVl/74Mns4sLeTmZ28X7/ezs6Ojo63v+4mB996eYb3/ifvv+nv/v7XVfV3ZrUUX+run5a/WRW/bV5TSZ7NZu9Vm/2fcR0GvHqcxUR8aBDuPMBX1s9/nzG81cz9vfzU9evd/P5c3l4uN8dffigWxxe7ob5nW6Y73WXLhx2i8VRNyx2uqohP/KDP/pDex/54Z+YTmfPV3aXs8u/8EBXB8B7LY+OFnFw+0693xcyhgt7OzmZ9BHLuy0Aj5ga6k+zhv2jo8MrB9f+7LevfeeFb2d21fV3hr6fDjduzYZucjB0k52hn+0P07f2htns8jCZvFwvPfXUEJcvV1zZGqiw+X5/5nv/Ow9EcTXjx/czDg7yz9/6gW4+v5NHRze7xYcvd4uj290wP+yGxV53+eIiN0NRDEPW3pA17GbUkBERtTqefgxAY7Vs6Nw9fjo7fs/9+F/+yX/Wz3b/m81P5O4cHuXh4fwDFRp2ZtOczaa19cnj4Z3feO0Pf/3n19+TeVgREbdPvvCB+jcAeJRkdnXX4+wqu9uVB11F19VmGNq/2VfXHwzdZDb0092hf2t/mE4vDpPJTn3zwveG2Nur+MpdE+buG4juNVRhfcc49fjZissRcXCQy9F2z8XmcIVuEkPEQezf3OsuX4wh4k7UsJeVQ8adIXM4XC6vuxARw+7ynDXk5j8IAO1UDatW1Yg7x8+PKqpyNyJe/6Nf+blP/hef/4vV9T+8/ImMndmsFkPEYv7BGLIwmUxiGYYijm9nw/Bnr//Rr/xc5ioAZVZERmZXW58Iuj8BjGf1Hpvd7Ypbq/fcblLZL8NQdgd1OgydHqawzCSzjXHbx+4bhiLe8ZS5L9SyShQRe3v1UkT8+Xnkck+io4pn9ofF4eXudCga8jCrFnkcjGrIuBORw6EKEUArF875+vrDp4itD6CqhlwHpNe/9bv/4KN/7r/8tS7zYkVEZsTubBq3h6rFsHis35/7rq/dnWlWnaxMj6ibV7/1u//gdmatA9BW8Nn81LK7ffZN9Naolw3wgbf1vttNKvrl19ZBaDmwbVqnw1A/2x+6NybVTZd7D700m9X2dLkH239o7X6B6Owq0ZVnK55fneBwWSWKiOHojZvd6VB049alvFyLrItdbgajiIjKkxB0/EsEI4B3587ZXz7rw6fa3V0Go9Xzm9devn7pQ6/8owvPPPe/rT9Dy8zY2Z3mwUHV4/renNnV7mpz8M0xrgdvvvKPbl57+Xpmt7whrz+hvL0MP3fdpM/ywR/IBzCKsyrveVwpOglCebOv/eyr62/U6TC0XioXEctR28e9Q8ceqDoUce8eorO+58xeok8dHuZ8/lyu+4mGZ+ZZi4/k4uh2V8Mil38uZdUiL19cftI4DOs+osf7k0eA99v6Q6Z7fs9ZPZvDkFVD1u6yt7NqyE9+9m/8d5PdD/3T9T4QmRGLo0UcHB5VRD1m79dZe7uz7LouNv8+Rwdv//NXvvabv7IOQnn7di2XaHR3haEHWS6X3YEldQAPIXM5QrtbvQ/v3+xXo7WXm69m11c/3R2yv1abYWirOvQueoeOf/+DXOPZz08mzp0ORcNwmEcfPuhq8ZEcFvOsYZ7rYBQRUcOlrTD0ocsR9ZgvyQB4VK0/gIpYvu8eV+lXIeh0MHrux/7m/9pPZz+5Of30ztE8jo7mj1EoytqZTXI6nWxNcV0Mh7/+8h9/8edOB6H1Eo2Ik08n12da36ABaCu7vt7eXz1eve9md6PWry3/TKrrlz1D07f2hq6b1V1h6N6T5c56vn0dD3q9dz9e9RLdIxQtFke5rhYNi/kqDM1zM/wIQgBtrD9sOvO11QdQm1X6497OzWC0N2QtZt2f+8//1v9Z2W9tkXD78LAW8yEe/VCUNZ32MZtOt64zF/M//dZ//LX/IfvDYXN60fZa9ZNPJyNObtBn/pbVTRuAh7O5yeo6BEVErINQ98ak+n5a9w5DEe+mOhTx4IHo9PfeMxRFRNwVjIZ5xrMRtfjI8ma8CkjHVzrMH/EbLMDj56wPoDaXMG8Go2GYd+tQdPEjn37qI5/8K1/K6C4e/3xU3D44quERX+rcZV97e9Pcvm0NN9985f//qZvXvnF9HYa6bjJsBqHNJRoRd9+g3/O/CMAHXJ7q0ez65fPsr1Vcjei6u4NQRETLMBTx7gPRxvNToSgiNqtFERHrYBQRsVgcHZ9neObsELQOTQA8vM0PoDaXMJ8ORsNi1lUNWYt5VzXk05/6r3/kwtP/2f++ea4aKm7fOXpkhyxkdrW7M83sti/v1puv/r03X/o3X83sKvvJsNzX4nA4HYQ2l2isf3Z9gwbg4WV/7cz31O6Nk/favp+ueoqWQSgi4q5pcvcPQ2c9P/ua3sH1n/X926EormY8H7GuFkVEbFaMlsc7J4FoY/IRAA9v80OnTesPoE4vYR7mh10Ny2mgi72jrmqR6w21azHvPvZX/tufns4+9PNb55oPcfuRHLKQtTebZk66ra8eHbz9z17/4y//8kkQujNk9tUfTIf9VRBaTy+KOFmiEbF9g960vlkD0EbXzY7fVzdDUMSqIhSxMU0u4mS/oYcLQxHvPBCd9TMbz88IRhFxOhxFnAQkANrZ/NBp02aVfnMJ8+Y00GGx112+uMjF4qg7DkU78+4Tn/3v/0XXT3+yoo7f8A+PFjGfLx6hUJQ1nUxyOl2HoYyKilrMf/27X/u//+e8cxKGNjf4Oz29aHOJRsT2DXrT8ahXAJpZB6CIUyEoIu4RhCIeIgxFvLtAdNbPnRGKIu4KRhHH4ei0H42Iw0MVI4DWNj+A2lzCfHR00NXTJ9NAh/lhd1coWsy72hvyB3/0c1+o7D91vLNpRtw+PKrhkRiykNVP+tiZTnLz+nJYvPSdF37p83mwXCZ3Ogytq0JdP6l881pNp3tDxPYSjYjtGzQAbcxms3rhvBc3N1m9KwhFtAxDEe8+EJ33s+cEo4jjcLS2GZIAaO/UB1DnDr15Zp6Lw8vdvULRxU9++qmnPv6XvhSRlyJiuaFPDXHnzryGqnj/QlFWlxk7O9NTv79uXH/tj3/q5ivfuH6vMLTe4O/cpt1NW7ugA9Dc5csn77NXIrZDUMR9gtB5X7uvFjewe1SL1k6Ho7Wr219/vsHVALDtVJX+dDBab6h9OhRd3OwpWsy7pz/1X/3I3oc/9n9s7uszRMWdO/P3bchCZle700lmn1v7DR1cf/3vvvnS73x1HYYy+7p5MB3OCkObG/xFbEwvWtu8QQPQxpXTXzgdfta+8CDB56Hep1vdwM47zz3Of15IAqCtjQr9GdNANzfUPisUDYtZtx7J/exf/hs/PZ186H9ZnmyZQOaL4X3atDVrZzrJrl/3DS2v52j+9i9e/cPf/OX1aO2uPxzOCkPnbvAXcRKCrkScf5MGoK0zw8/aea899Ht0y5vXg5xLCAJ4T52zfPmcDbVPh6JLi71usRGKajHvPv5Xf/qf9/3kpzbPOl8MdXS0iPcuFGVN+n5jiMLSYjH/0mt/8Mv/NPvJsA5D/cF0uPGgYejMteoR97lJA9Deg7zvNnlvHuPGJfQAvL8eoDp/NePHl6HoRyPi1q0f6E4vnxvmd7phvtddunDYLRZH3Xrz1lrMu0/81b/9hcjuU5tnPpovajG8F0MWsrqui9mk3/49Nbz03T/4vz6/DkPZHVTfT4cbt2ZDNzkYusnOcHqZ3IUL3xteiFj2B33lcp0zveg04Qjg/dX0fbhvebJzCEgA77/Ve/ELEfFjGXEx4tV5xA8NcXU6jY8eXc2IpyOzi7qxyLx8O6IuRMTtuHNnN3Z3IiruZNQ0oyqrv/0bO5c/8bms2FmfvOu6HIZa36VGeu9fDlGY7UwyauOX9LH/9uu//3eO9q/fzq6vrr993zA0mbxcX790qWI6jXuEIeEH4P036nvxexGINglHAO+vXIaiFyLiry1D0ScO882q+Ghdi81QFBf2smrIzMPjUBRxGBGzOLz+5mF38aP/frpz8XNbZ+8yR506l8vKUJ66ndx8+3t//8a3/ujlzYly6zCUXV/9ZFb9tflWGHppNjsVhr5Qy3+XiBCEAN5v79n78HsdiAB4b9wrkGxUi/7acaVoMxRVzTMODiIuXoyqIaMO8s6dWc6mlVGTjMy488Y339h79pOvd93u8+sTd5kRGTksU1HjULTcfLXrtk87n1//xWtfu/I72a82X+2qbtyaVNffqq6fVj/dHfq39oe+n9Z0emG7Z2grDB2zXA7gCSIQATwZztk7bhWKPjOPGE5CUeazUTXP4cJ+Zl6OZQ64E7uHOxGzo4iaZEXlzdde/PqFj33muYz89PqkXWZEF1HDub/33Vx+9ZMu+syt8w21+OL3/vBL/yr7vrqur/UQhaPVEIV+ujtkf60mhzs1m10e7hqg8M2tMNRsTwsAHh8CEcCT45x9416I+ObdoWix+FB2B10MF/azhr2MGvJOzXJnNmTkPCKmERlx49UXrlz+xGd/IiKfWZ+x6zKrWT9RVt91Mem6k5VyGRE5vPjaH/zyP96cKNd1Xd2YT6vrF9X1s+qm12s9UW42e+3UNLm7KkOnCUMAT4Du/t8CwAdExfb/5G//D/+VZ5dBYW+vXprNanf36tB1s+reWG1iOtkZusnBsjen6yq7g8rsKrOrN1/5vZ+tqP2hIoaIGCqi7/tcFnTyIYJFVmYuBzbU8rxDRFTV/puv/N7Prn9/dgfVdV2dNUSh65Z/l7vD0F3/Nuf9OwHwAaZCBPBkyu3Hq+lz37x4XCn6eFUsFk/l5pCFyC42J8+thywsbrx12O8+/e8nu5c+F7H8tK0yIjNzGOr073tHlzmZ9Nlnbo1puP3W63//1it/8spZQxS6yc7Q9ZOtIQq7u7fr6l1h6MylcoIQwBNGIAJ4cp0Tim5lfOIwN8dxHw9ZWE2eOz1koaLyzrVvf3/nmedey272fMQyWWREZJfvsp8oq5/0kaufW59vPr/xC2+9+P/+2+i6Zd/Q6SEKk1mdHqLw9UuXlkHn3+1ExMUQhgBYE4gAnlxn9BSdPY77vkMWYhoVlbdef/EbF37g089ldp8++QWZGRlVZ/7O8y6t+q6LbjVE4bh1aJh/8eofr4coLPuGHmiIwl3jtSNCAAIgBCKAJ935oegdDFmouJMZOxEZcfO1r165+LHP/kREPLM8fUVmbjYS3ScULTdf7VYzvE9qQ4sXv/dHv3o8RCG7g+r7yYMPUbj3RDnhCOAJZagCwJPt/GBwasjCZLJT5w1Z6PvpsDlk4fprX/nZ7GI/u6jssrKLmky6uP+QheUQhX7Sxfrnlsfav/7a728NUTjdN7Q5RGEy2TljotwD/J0BeOKoEAEQ8QBDFtb9RJtDFqqGzDw8d8hCt3Ppb1dUVGTUqtJTx3u2nvUnopt0y+/b+Lk717937hCF7Ppl39DGEIXJ5OV689Kl84YobBKGAJ5wAhEAEecunVsNWfjMTrx5+3Z+tK7F1pCFixfjXkMWdj/6g6+vhyxERCz3bF2Horv1XRd56krm85u/eP1eQxSmu8PpIQovzWYVTz9dcSXiHkMUAEAgAuDY+f1E37yV8UMn/UTHQxZu7mdeus+QhWf+wiej7z8dQxy3BK07gzZ1mRF9xvH3DRExP/zim3/y5X99zyEKb16ryeTUEIW9vVpOlNM3BMC9CUQAnHbG8rlzhix0Zw9ZiJxHxDQiI269/rUrl3/gs3+9Ip/J1cq47HIrjmTm6s/q9Yjoq168+h9/7X9cD1Ho+sOh67q7hygcveMhCoIQAMcEIgBOO7tS9M3tUPT04qmsiqgbi8zLtyPqQqw3bV1PnouaZmTG0Z0bv7nz1Cc+lxU7UeuxCuvNVjO6bjWguyKiIrqI/evf+crfGY5u3s7squtvLyfKnTFEYTLZq8lkp/5s9/apIQqWyQFwf6bMAXDa+QFiY/LcZPJyTSY7NZ1eXE536yd1evJc198ZMrs6fPu7129//9V/GLGRtnJ5E+ryrpJUHF579R8evv3d68swtD1EoZvsDF0/qe6NydYQhXMmyj343w2AJ5IKEQDnOWfy3K3c3LR1a8jCavLcesjC7k5GxGFETfPwxivfnz31sdez33n+Xr90cXj9F69/69/9zmYY2r/ZnwxRmMzqzCEK02ks+4bOHaIgDAFwF4EIgPOcP2Th1XmcOWThwn5mngxZWE+eyzyKqGnefvObX9t75oc/kdl95u7TV9Qw/7Vr3/jtf7UOQ5n9aqLcxhCF/lpNDs8YovCVy3WfIQoAcBeBCIB7OT8UnTVk4WA5ZGEzFB0e7sRmKDr4/otXLjz7F/96RTyzfeL6xptf/fI/3gxDNw+mw+kwNH3rHQ9ROOs5AESEHiIA7u38YLHRT/TSbFa7u1eHrpvV9K29Iftrld2kusls6PqD4ebB9LinqOsmw81X/+RnInI/MisyKyL3b776Jz+znCa3XCa3GYaym9RmGNrdvTpshaHtviFhCIAHJhABcD9nBIpVJWYjFM1ms5pMdqrrZtW9Mal+tr8MMl1fXX8w7N/saxmKDoej/RevH12/+jNVEVVDHF2/+jNH+y9e7/rDjZ6hgyG7vrJbnqt7Y1JdN1vtOXRWGPrCWcFHGALgniyZA+BBnT9k4TM7cXUY4qNHVzPi6cjstsZxZ2Ysl8/txe5RRu5kHN349venH3ru1RqO/p9br/ybf9v3k+puTVb7DN1aVZdmx2Foc6Lc1y9dWoWhCEMUAHgYp9eGA8B5zugnioj4fEZczfjx/YyDg/zU4WHO58/lfH4nj45udsMz81wcXu5qmGcNi9WfS1m12DpfZl/Z3ahlVWi7MrQZht7BEAWBCID7UiEC4J144MlzpytFmZcjsovMjMzD5Z9uXus/Xb+orp9W18+qn8yqm16/a68hYQiA1gQiAN6pB548tw5F3UEX632Kun5Sx8HouBrUHweh7Lro39ofJoc7NZns1V1hyEQ5ABqavN8XAMBjp+K8JddXnq14fvnwpYj4VLwcEc/FfL56/a39YRjm2T8bVYuPbC+Z669VXI3oukn1/fR4gMJdYWh7otxZ1wYAD0wPEQDvxj36iSLi+asZ+yc9RRER676iYVg+XyyOts7R99OKiNgMQhERZ4ch1SEA2hCIAHi3HiwURcTmsIWIiPn8zpn3n8lkp5bHjapQRAhDAIxFIALgYeXdj1ehKK5mPB+xrhZFRGxWjDZPslURioiTqlDEcoBChPHaALQmEAHwsO5dKdoMRRGxDkbn2qoKRdwnDJ31HAAemEAEQAvnhKKIu4JRxEk4Ou3y5WW4uRJxRhCKEIYAaEwgAqCl+1SL1q6u+oxWT6+sv356gpyqEADjEogAaOms+8qpr50OR6d94UHCj0AEQBMCEQCtnXdveaf3nPNCjzAEQDMCEQBjudc95rzXbLoKwHtKIAJgbA97rxGEABiNQATAe+Hd3m+EIQBGJRAB8H54N0vmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4Nh/Ast0kbKxrpoEAAAAAElFTkSuQmCC":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA0QAAAJkCAYAAAAxwuGsAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAACAASURBVHic7L3vz21Jdh606vRM97THM0M8M8RxTEwszzixE8cmgQQhwRAkBFEUUBxLjhVZSCjiPwAJ5WPgAxIf+IJELASyArKIjewI+IZxhAwJdvxLsjGTQDIWjn9MZjKeZrrn3n7vWXzY9WOtZ63ae5/z1jv3uvt5ut9b5+yzd1WtVaue2lW1114iBEEQBEEQBEEQBEEQBEEQBEEQBEEQBEEQBEEQBEEQBEEQBEEQBEEQBEEQBEEQBEEQ70GU93h5BEEQBEEQBEH87oN+rQp66gkKJ0AEQRAEQRAEQTwWTzZBeqoJCydCBEEQBEEQBEGsxvKJ0eqJy15+nCQRBEEQBEEQBHEWe5OfZROjVZOUWT6T49/HyRFBEARBEARBEIC/MZvo3Hr8NB47MTk5EcomQJ+Pxz7zyNoQBEEQBEEQBPHq46eyg59MJjdhgrR8YvSYCVF2rTlmJ0F18vOZ+vWtt7hDRBAEQRAEQRCEx0c+sk1sfqodsJMkNznKJkB3TYrunZjgdclE6POlTYA+88/9+9/7T33iW37w6z78Dd/zxtd99BMfeONDHyxS6mXKlClTpkyZMmXKlCnT93mqepWHd7/67le/8uV//M5XvvjzX/qtz/3wT/3if/JjIlInSG1ytDsxwu+HKLdekFxjvtfJ0Gc+X+Stt8q/8i/9le//xm/5nv/wY//0H/hDd5RDEARBEARBEMT7GL/z27/2q7/5uZ//j//WT//VH5GPfETlp9ZPim6dEE0mQ7Ar9NZb5c/+ub/2X/6+b/2ev1T0rkkXQRAEQRAEQRCEqIj+xj/4hb/+P/zNv/zvbpMikWS36O5J0S2Tlf3JUN0VEhH589/7wz/+iX/mD/+ZUkRURTAVEZHr9YaiCYIgCIIgCIJ4T+NyCfMGm37+1/7P/+m//7Ef/LdFRCa7RXdNiu6dEOWToXfeKX/u+//6D33jH/zuHxwznw1vv/XFhy/99uee/39f/K13nz/78hVnSPFJwlJT+0t6ImAm91bVUaxKKUVU4/nFaeVs+f6AP+2i/btr2Z3qdsDEsWUkF5EionqVIhdRGek+agZp+SWcp6L5k55GjzNBSsnMK9FjIp5WC9AjBSXtF2XZkUdFysWqYy6PyCUePGhHK0cmT5GS2NEZtGdtFQijQHvtySN5wyJMOwZ5rPxpMQf2CAalivZWINt5fyyXrPz9drQ84BZsdiuc1T9rx8TewmkzPsjtd9aOjtcm9lZSup/wWnpezgf++mvtUNjul7Tekd+K+ua18iBdJRU9zauZPEUU9TDht1hywqvF2y/y2nT4OuqPe/I4PijJ5Yk8kfa9XbqfD+SpP5RdAQG2HQ/54EAerfkdjM/ZUScP8kE6lk3kSYs76D94obGjeb+N7RjNZ2ZvJ+U5MNTxM/J0Oy2xox1+8TmUhB6jPDNJRvmT7PfkKSV2/x0+mMrjyi9y1Y0Jr9LS+8fnUspOJTI+yOgEea3En3f5YNJ/bH+8ZP0xL9/izY9+4rVv+L3f+sY3fut3fegjH//9r/sSRX7zH/zCD//NH/lLf1nefFNPTIpOEemuLU3Oq5/jZOhf/cxf/f5P/al/67/eNFL6AP2b//fPv/2P/9Hfe9Z4SlTn5XYDwjuHcKLMbnDTA7vGM/IT1XFjFce3Owe0M2q+xYDLcZZ3GbDJdPTYpPwz4qiU18p2fwTlpvJEIn7cgFbqiYfV1X1ddjtoejojz54c/gccZ7MB7eSd+m79433DZKKL119V5LU9QrMFJUfN/fGWnh1QTMY7FbTtjry7P6AdFwsFTPlgNz8s/0DurD12xqPD/MZp28Rvzzy7PCfvv86UP24wi4aVvvTq2ybQe9Uc7XNGjnPoxVqe3ssOqzjtcJP+g6efvsGbwPL6ReR6VblcwuEp/Rc7Yd0pv8zkse1fRLQRw9nKHxDWGM9O3T6c59VJO+Y3uCegIlL0sP1UVF6TEtsja6BkvW6GItv9UNYfd/tPKoectsNr5ele/Uf2R1GRS7n26/fsOG2fmT2dvDM+vl87QNrhRibT8UBELpfih9M7xucs473+H/I7U77R5f64doXLxj377//2f+HrPvXH/42PQhX07/3tn/h3/pef+is/smpS9NrRCVGk9vk7i50Mfdvz5+XT//p/8N+88eGPfXKcXeRzv/y/vvWl3/7cu3USVPr1E0IaCpuvRMGJgMkPkxWem1egDn/O5MlupJMV9nMFeHmcHm9YgeqMXr9ea55Xc5HO5MkMOmOEE3dWpwa4veae3WHNGA3kCQP0xN5meZ7c8ZuvbJWdO/gTwBXpsENk5d7Jt9uBimiVpw8O83bs8lyrGpr9tD+p+cnB4O8MalSzr9SdkWd6o4lyD3my/rjfnDM9Yn9sh8DesLkx38MFof12zHbAR3nZbSrk10bCXX7Nr2520O3I8sl0hd0SkIYMd1eGSyLPzTvw3i4yPoiS7t0vQcXhzGw82zfbG/nAtmMpcr2KFK3NoVXLupXf1iXb8qRKkl7V9Wfc9Z/J0ySP1Yf2FtmxDanEor0h4nAROpw4nZ/ig4FRu02eq+pGh1IcLXZ6My2Y5hgqfNB/8BczLiuorfNrQzY8dV6ufHDVepu5Nz6eH5/bgauUcRthU1XRykNaF2TQzjzsAFJ2+OBa7e3a80rtt7VPbcezfBDGHcOr0d6O8wv3V/VPpZq3qBTdeSImVmTT52HpyRMxwKue10rQo89wn1dHbqZ90h3gmjqLCSjt760v/KN33/rCbzz/vd/yR960A9oHX//wH/7q3/mv/osvqm5uON/+IPIPPywiv3KomwxnJkQlfv6+IvL5Ih8fk6E/8G/+Z3/+mz79x/+9dn9XpMhv/j8/9/aXfuvXHupeUdeLGydKcX+lbMfaOYPiSk+LFCmlpVXfPW2r7qWSt/0xEa6XO8p3f62M+p/0FOVofyCPGHkkkacYeUoijxh5xMqDGZZ6DcgzfnK171LU8qXKaIvYDK/ULc8tbXN2W+yQQ4wcpe+0+dS3ZNLQ7q9IMXUsoXqu3HZO10VQeijA69rqfujE2lrMDvUIOuziGR3bVmin97TZwLDfdhOSmrA3fvw6teNhxdAEtg/aylnBzZchx6ij/6vlapFS7ajUrZwku1Dx/tXUccgB8uC5XQ5TMVDk0EGrv5EnyBL1aHrSMC+UJ/AByGMtwvKak6NVG/ktMYcuR7Njwy1df7keM517e/YVSsXtcgw7buX7OqLCiiDBZP2x97VLrF7OB1Z/2EZOuLSOzo6bLPYcly1W3BcxDht5oC/aNor9MerRwws75QPd+LmosQvZ7jMuNkX7BX4bdtykB3msrRk99ryk9A2iXBxbcY3yuP5oU1s3ew1UCAoe7dD05/sj8oFKqTvTRS6lJPrDjG0GSR173YcdX0y1YTjeJrX9wER9NZ+e7vCBb8m8jhkfuHOcuLY/2n7U9DeeqGp6NJmHDDM+uNRNSzDNas+l2/FFStRfwTKq9rF4o0fPB6g/rLI12Ki/Lk9tv9Ev4dSu/3G/cbkYeRJdjdYsiRxDj5bXrK1t+kv4wBuql6fbgbGiEuXI+O1gtlrefusL1xfvfvX68W/6tjdaWW98/cc+8eLrPvUrr/1f/+Ov9knRbzyIyD8vdVJUbB57BYjcNSFqj8q9XeT58/Jtb799eXj45vIH/+W/+B99+GOf/FQ7+Stf/uLDr3/2Z95xc/cms0tnKyalpvetWEQptprtraDmOFt+XqE6kY0rWnetYDqBIJuDR/lQnmu90K1YFPNZxa7sj5UMbL69FbfiRcAVLVOdqN4bfIhKCXYUbX/SPgcrJvt5ipxfMZnJU5L+cMYwtvMe7UMUl/TcCtZ2+ZA7yGPtKNiTBDvqmYQMNwGutT9eezkH8tzFB0aehA/2MSnoDh+ifT6Ycfe+oTl5gr1leUJ+docoKWDvUcsiUu2hRDuaypMtmY7y933wZv3xDL9m8mQ7RGf7oy3fKATqeMgHkWDPlVsvuF43Prhet5uc67V2wf637QxtO0SR9u1OhCZ8UII89/gUBoJJxNlWljcfWU3tLiqsoSSH99sx2xkqlY+2WpZQa+0aGCWE9IgPouD+l7qzoLUdRSG1vFqSXGBnSHvFT/LLLq+Wqi+/Q+Tp3+4QSbLD1tKRk7WL7BHLzd7yHaLQPmZnaG8YCu1TJx7zR66P+mU9z42PxW14ltof285Qf4JSYzYZH7QdorwmTX8nXTCMEXn9Nb21Hb5Maza17bP12z7zPeSDY3z5C7/+8PHf9+nXP/TmR16TmuX1xfM3f/1nf/q/+4T+E/nihz6k8u1v1F2i7yy37hR94OD3kn42j8o9PHxzeXh4Vt786Dd8tx2Hfufzn3teykW807/kKya2kNpypSqw4AX9a21wfKQ53HHUD/X5gCJSiX37Dasj1YCkX9a6iclWxRtwhwYLKdWAfDkqNhlfNoJpz9Zean/y6BmHbBo1qzktN+CNJIpK1V8ykRqCumvDAFBEUAvt13IpGn2IgIiLkUesnkr9ObvRNKU04ipjAl0noMXzV2jp+k2HPZhy+5ExsrSzozyuSvAcrBWvqBRQVbE6VtM+LX97ox4IRcGeWw2xm4BdGj1ey/bouU0dtvJ7hcYCfm2fS72gPb8Oq5R6LdV3qHQfImdvwAOXlo76l6G/hA+6KDqZsGd8MDD0VkbqMx4fi8hVS322uphn0ks43VpUGFhc7kaepBvZarcJr8fVn2xEdDfbkxvVoK9N4aGbtnq2/jjsAKTo9jCYrvbL0rpR9ymThA9aJ+ilFp/29tT0IferlM2OewpKtXxQU98eRn+D4MS1cdn6ZeNn/8y9aUdjGk68Vq7rAIFoqypgQWA64aj6KfEm0pdfnPybGlV7/S+Y+gx0dIAu+Bh3hlEVaMeGq5aht7I9UpWPH6WT9/74FkdWP04PO3P2BnwwVFpGGvjAKqJVMVuwyQB2XDOJns0gTx+nY7MHfjPkhv2xp0OA7SM4i8TxLW/Hdnavm+54Uw5CSsY3w2stM5t/vc7xtG1NLWMMDeNjPbP9rEn7AB+08cW1giMIaJ9kwuHsDCYDYRfJltt51RHgVk7vtsbeiora9gt8aPWnQ49Bfqu/ZMKOxDiUYeQQo7/WPrZXerFCv4xyT63ut/7hL331ox//ptebvt/86Dd898PDsyLyzSLv/PZW5GdEhj+Rs4zESgaOJkSA7xv6rI/KPYjI9fq8vP7mRz/ZVldVRL78T37jYfSDMYsfqLc8ii3pBxTbMeOKmpqBpV3WRxww4BzXbGCDh6oH3VvKGzc6XsW+/O3GyTtFthupi2wrUDhAN01c0wLyAdoO1H5AiPI7ecIAjSdquNbteHUiwBX20l805fgE5ekVLamp2omnI5p+wli58M8oF9ckKEGvTX/5BxKasTcV2VrNde8xBrkLk+cWzAVXuTo70N4PRrW20/vUeNyYpd1Y3fXxBk36jeFFC9wgjjFRtE6GwlJSAYGxdFhhD8Ssotdi0qR9XIbq7GDc2MpIxfQf0y8uNXO3IpjyQcYJmwSOD0rxCxK1P9SlnZp6XWJ/dIOIyrFPVHLD68ej1JsaxTDZtdqOGwPsD47XrK2lQ4e6Y+GG3b48oyoS29vzAvJBCfJvUo/27hOeaxGYD0lvF1W5tpuRRISR+v4Qec1eNBpk20VodbNp0o6pCs3KMOjRnxvHnb3+GOQJvGb+UW/HXo6ahpW54k4YWvELHX3BINiRyrWVu9sfh/zmDtB/daboa5KI2RckfMfyZQd59lbYawGhffIMIx9Ye0M1GTvq4xryQftXbQ5QvOmP5VJ3igTsDW6iPR/k/dEJaPSYigsdyrWPVYlmOQR1RHtTcy8WNSDehyixtZQPQB7b/k6wUX8z74PMLSGL0+OwY8sH+UtBtBbS73fa6iV23EQ4O/Fw9mzlVs9BuTrNhUkFMz7I2tH2R03b2zQU3Cp84Tf//vNPiXZ9v/7mRz95vT4vIm/otz1/Xv6+yPYqbhHZ5ix/IxUlw96EKBntxcUb6rtD/+x3fP0H33jzA/aCh7e/so1HeqkEea1vN774DtPfMNNSP+CHFWns9MWndiUodMgEfUW6tFqoX1UbFYX8t3ayC25ZhS61B+MC+qX9HpcMXP3GilrJd4xA/v6scM/OjiBiDLjK03dYxoq9JzR/IOx4YblGeSV5zYteoX2g/qF57cqJKX+cUFyaOUOCwbmC2ssHIZthbwcDQtihKhJPaoeKyKVOmPoOiMCHfuBSL6v9Ra+TLW9vP5cqD/aqS5XjAgNCb57S0uLTlvdk5PYrQSKhO4Ngfqco0RT0hyiHODkuQ2EbbzYe6P1yxgcC7en746W2IyyQi+vwrV+CHr3YPoNWR9gYHRd0+dUX16qrLT7DJbeHwAcX8/Xay531BxAv3j8c8UHzB4Gdon653SFK+aAblks7X3ZeFZGLyCXcBHg9bnascRoZ5IdioTlmvJ7tEPl+lI87bmU4imtOhPaROu606s/4YCJHwfPsCrsEupbrpaQ7RT2XemK5NjlaO1UeCoL5A1eV7S1318lbrVzFNchRbDsm7RntGXeK/PgY7jf6uObHCSzALazJtHsJ3lz4JwhyPijm63x8rhfj8Aj9EXeKSmjwZmeT+4JDPpiIaw3R9Ik44Zj0hGDH1t7U85qtnuD4PHlk8VY+QEOwEzZnByDP9GuVp7Yj6rEXY+83LsmwHIiu6WlynwP9EseHaM+5HD2Xbgee38YJPnX9ERYL6hmtEfuPb3/5Cy9srq9/6M0PvHjxbum7RK//tspbb5V7dolu3CGqgN2hL3/p775dSn3VsYro9cU2BA2SrXS2taDWllMTr8K3g307O5judEBviM/0WtHtVv2lPiOM8Gv8vcLha9iZMvWMK/TtNZOhxxxAx0qkgtxFZC/uiBVhpNHSUV9NHm351nNgZ/XwGft8BWOsRPsdqUbEo939Ds1EV0n7tVs03/5bgbe+dcUrBm1tywBX7iy2HaHLluqWWlz0AsVla96ZqLWnuB2N7AbNyJPdPGnbGRo7RGHByeyYhpUsV2BJqp/ZhfkFGuKqmt9g2vygPzbxLmmzZXww5LE8kD+imshjM+x6K12PtmKpD5Ea2U/wQWMUv2No7eFisjkRlyzwgTg99rePhYtyPqjVawQ3edZ39J3e/pYPbHWMHtzOkIB5hec7JdVjvoCa8UFJJsw5v7Vd1ZGv3ZmSbhdxPcqubNtch03G8kFESO2F98QhcudcRa61Ha+1Ha/u6viIWLkaPdYf5q9TjvJcazt2nRo+OPUWWEvAKoIr2IMHBsM7bTh7jjtD+xiN2HbyzXBzzAdWJbYDODv2do7y2OuD+eAjyj0XkyeMz64cUK+vhbXjks3HPL9N0OUJj6hkO5wzefDLKD+/X0vkyXZsT/KBzbA9/qXYjrjDKc0aJ/cb4k7s5ff6uycugItTPsiaIeFpm2HX21kfonF/MOuPWP5+F2u8qG5SdNWrltde6/ldP/5Qrl+a7RKdxw0Tovpmubo7JCLy8PCsvHjxbtEXv6dvDGiROu28VN/aa8l9Bi4u7Yfrw+XnfYjQXsIBsS0xFi6LSy0ReR+iuIJZxPgudW0YBRS7kl3LFV9uXLLbLog3uDDod8W0bErNxqezHpCvmGTOvcXpf7SC+urDCua4XsFXQLoefYbqrh2HffmzHhUfQYLlhP4B9dTqD/IIyNPtIA5kTY9efF+/NuEZO0N+JxTVF3ZQp4Euvf0OuwZ7C0ukrXSFnaGxQ+QQVlBBj6d9iGQ8SmUrMhrCy9PrL64/4ZLrqPe5HU7sD8gDYyFcR2KujztCvj8OO6j6wR3O1n/6aZ4PRnVx4j52hjyukE3jU59K3WEM3bzzQVOvhq5sKzbjA0NwLh0TZwE7AD7o+vB2ke4MJe3YtdF3ZuyCgBPY2VHkgy5YeqDRqig+au3bcXz17Z37DFj5fRp3vMMdlbsA30g529GwC2p+R2h/Z2jsCLUU9Ag8hM2b+xBl8oM8W+VP7HDOdjQC0Vb9Q/tM9BgaKtwfpM0R+aDzwvbP1IeogDyYf7plE/YjzI6Qt/N+RdIfvXrzdkz5LT0N5BH198eTdpxcLnifU1TcDmc2Pgd+cwow5Wf8dsgHswnHjA8gu3R8HnWc73COdst9iNCO/X1OLGAoLu9eSCg1v96PBPSHgk6KMzurYXBy6J2tC+L08uL3lBcv3ioPD8/KBz5Qz+lzle+Ts4/NJQ4PWU08vkO2x+Wu1+fl+vGHcn3xULa316ixiKtctT1AtB1zNWpf9Or+ml5c6vKo/6n0WaiqjNRdrFBYxLXWedt92VbDtGYxZvqj5CCPLcKVqz2/TRuYai//Klv5bXBwO0KxAC9PP9R0sZWr9ZiaK7H2Q126U4zPAWswVqtrWdUOVGTHh8jkGxvafVZXbiKPk9XqwKvJK8zI0+tvUpPHZmux5kM9eCFWcEvbztCWjm/W1rb86g6AXrfJkBhFpuJY49e+i9hT2T53GxMdtlez6D5ELb9eoSYbCG6+9PYxVbV/4zetk6GQEZRh5Gn9R30dt7/hmXjtdRFvUvkBh6w/Oj12/Y3+iOXm/dEcMDJlNtQsPNgxVHtLbaslu4n93OtIgVe9eQK/zSrYj0H/wdPrgwHafIeu0tsdzTn2qlj+sGet7WHsQqw9DPsd6bw/Go15bSR8oJUP+niAPG2zE5tBLH+0g44U9Oj5oJaro9xcDpBHjTwK1anlKtQ/TbeBafzBCaMq1ppM+9g+1PpPT1MBQBwjgNNfS4cGM9PdUexoZFscyqP2fsPYQ6sa9p95hkMe0xiz7jb4IMo8749J8b3P6Uivavg59kcnz7yCTo+p7qXpb6TOFk/0R8wwH58TtaA8hleDyhJ9Zs3W5dGR+t8kAQgL5Vs79vYcqzXkqOms47rSQR7UY9ff/D7HZ2gqnugv9B+UB+1ZBq8eo4iYt6L0e11Vub542OYi1+fl4eGby3dMM9jHbY/MfUZE3hJ5/vx5fV6vVu36sM0b69RvWxW8iBQ1Kyjx0ZGtis1XYjzH4p3gmqpgbTVf8JGx1Vlgxp4rvAX3G3VTrzZYiRnn4o6X4IftW5UjvgGrljvZYejndjkmTrcwgw8rnuG94rDCgc/WHqwgHPkQuSWIou2lgW4FxT0Djw9Ph/IFtrxBA3XKHVcg/CMcTvnu+tp1i/hUBkmN67XW39tx9CUzhXTx6q6igr2lD11rPzD0NnmEA+znUhsouPJMHgK3j45736HxFjUVqLQTzuhNNbZfO0PbOUYemx32oy6WNtX3fpStpLVysgU3t/9pG1CgLcWsXpZhQyiKpCuSEz6ADOY+RDW30XG3IwXqqJvPx+AFr4iwU3SHD5GoFhAT5HcV8uMi/BZ4LeEDVwr0B/+0hTo70GyFPeUDdVWa84GGhVC/ojpObr6ZgQ/aedCOrnrtsPMV8Lw6rb+YrpbxAYyP00f+bUcxDszRPNIObfQgnd+2/Ft67f3IF7yV4kwEeDUTp7Vr6F7OUJ0lBjFd+/QTIh+M1PgTT8YnV3/gtWM+2PMhqvXc6j1uAxM+MHwY3lTThpNSOxL6GEfDyp6ImQ4f/YfZMB7uC0qRbXvR6g/5wMtvM/T2rH6HKDGgzv+9/kc+RC1/3x+9GNbO/ECQ80HLKI6PKR9kng+9/c0TPsXQ+YTXRn/URI7xeysAfbGmfDD1jZSUD6LAIE+7uboB7kmu60Mv6OHhWXn+/HmRN9/UzY/ofJ6zCdGcBd95p//WHpcT+Wq4P7nKtVil9lTboCuiRcNDztYe2jO9By3krhVjS5l+/Q2mf0Y5h6lwqL+9MO+Rlq+LGHmmI4C/1vkMuB8vkA283ryfWMKgj+XHYQTk0UyO1hEnTGRzUpvCDVTPuPRjTU+nfYiASRuVuaaJDRYud+3jBs2WFv+1ZpA/Yz3OwbfI+BPCCBfKz1egak8xE6XtEdUn8CEyRYb2cSMA2tqopy3f2bOVG/qjG5iNHmc+RLk9J+u2tmkTPthHtKNNDnxL42AypCv0WTjigyBPZg82myJifYn2M0R7FMGI8kGeIz7IZ+4jJ+CDpBjTvImPJPRHf33o0JE+DB/49omvrN7lN/X5Nj7I74hQPOSDgif0foH1b3fHx3xw4EM0ISw/vqH9oIftVYoan7X4jHRSPsgDvNqFS/kgsGPoj33Mc2Lalk5kFtMuXY/n+MDbM7zG/YgPnCIEf5GMV5EPooH7/pjf5xR/sikfq5OPb9sIo3WRReUyWUAJz+QF9PuCpB2z/jjng5i3G5+P7nccHzzCh6j+e9aHKPgUKrTNlA+g3yR2dE8cIida15ue9CGyfNCyusRiOvpzFkboyWyr12+bN6iTV/pjc5fL69uRd94pO35EaW1O7hDV120b/yELvb6AdaQ6vAQDHm2tfQrprxxxiDbLWe1DhDsaccXkyIeo3djs+xC162fPKIelOyTMbsCZz8BFYjbgO+DkH9jzIXIWAktCo/4gT74EuJWEfCCjE3egTxTo6RFxiKD583qe9SFqegwEMNnhC+LBM8qjfCiugL3ZgdnpAey3Xn/Wh6h9uN2HyOtprABGWtsuNzucO3yQ+wxY/QnoL/IBijnng4EZH1gd9Y8ZH4i33yF/k6PZcTvtFj7w1W569PB6DztEmQ+RsYPH+wxM+KCm2f2E54WMD4w8QY/FZCQC3S3ywZ0+A2HnO+GDlN/ClsxtfBDop0D77C9BBz4IGzzAB1t2imoxKToFiiu/KIw7fWfy6uVpl5snN8wOZ0TKB+rV6gnEVy/QHr5drp2Y98fAB7f6EHU5/Af/BMeOD1E7I8ixw2+mdOyP4T4H5LidD9p9xgX4AMXxvuJaNttIec21Z6s/ppEPdneIOg+APEH+fT6YHTgVh8hcH+nBlGv0OBTQ5Bj80tun2PsblB/t2N/nGAUFA/PtD3L3DKDfzPgA5Ajdr79FV2QswWqmCa+W4m1Nry9QTjaJmQAAIABJREFUsg1vvVVEPqlnX799xoeo4vO9QPQfEhnE1v03xKycmMG9fh+Vb+erjpsVs4RsrunpeC5Rxzn98nDAlByx1ds8jwhVGlfjU5HAQWoOmPKxBkEerfKokcepIfMZMKt2kPHwGRi+A/YvyGPLlexEn0OQo5dr5FH1zQnlOoU5nYXiat1ci3t5mo7VyKNej775fUHB5BTyqLYR9TfK9xdiBX065AB50GxVg25zM1Z7UepDtKXa0+Z/M/UhamnegFA62IXpO2Plz6a2J2XiGHlsm9rU5WH5IDsXFTvDsF+pbW7V0GTyJftr3UenkCFTZkPOIhwf+Gp3fnNXpmL0NPUhUns18Nq8gmigTgdWXOlySLVjTeQw7WMLmpRv+yPahauemHLT+mOKV6Mc7W9wtLWNqHIrZFpBI0errdejV7caPkgLBIA8WXW6HEZfU/WAcyCcMD5eTWq862yZrbyepgKAOKPvoBxevbFf2nNGag/E8se1rTw1dTb2IAL6U1NymiFkoKNOcJqTJ+NApxLzw0x9XQ4Z9znBHqD/tBrMK1iPGbuYiSsi2jnoik0K4/TEuNGOHR9EOYI8auTxJ6DBu7KtHF6eyb1DqDkUAnocTWjkiaeZ6llezYvwaNY0r6vng6Pscjna5/HRe9r2PyezDHsITzJk2/8NxdjD6HfoRzTO//xOXh73vXYboNcXpT1b6Vba3QrKNme+1jU0lTHjbVfU3MROdcOKdFhR9KldCeozT7MShAgrakYGX52+pmNm0Jo8W+srNHa68Fc/g5+tKD4u7sgoH9Taz3jSOETJMzXZjlsmR88jPKMMCsAV6bCiKiAQtA/uEFn7NeVH/Qnoz8qT2Fqvf7NjEHdywO8UZWbs7edp4hDFdpRuzyDPgWB+pyjRFK6oYS5Bj8beRHdW1GaPQPh6ej7QwxW1sEIcKuwzeHwcItxxQ/1hdl/jOETAByi/qsCKavRZSOUA/s99LpzgtbrjHZquuYP8UGyoPvBG5dVIrwc7VC2X2Yp0OBHaR6C8mfwTOQqeZ5/hzPIvl57mckiVA1eG/dsP53xg7EGO+ECDHG6nKGnPaM+4U+QbcLYD/rs2DhH0x9kO/PQ+59CH6DLRH4hrd4qKn0A1O/Y74FBQsGPLB/D2QVu9pD/6/ooVOckH4UkKGXzg7CAQ2eRr45WS6rEXY+83yoQPnGBNT5P7HOiXaA/RnnM5ei6WDwwvjBN82vlFsjfpHu0UDT6Y7hDdiCUTIhHxqz0qYlcXVEyqkj6T6NvBDmDQwtMBfRTuynMfrMHe6TNgvvpnUn09XTXt/eThCICAuCM9o+ZDdBR3pMQGAEtHfTUJVB4Xh8iq0Jbv7cDU0+ntBh+itLhXIw6RlePQh2giZC9e8ejL8CEacpz3IYIjlhegIfZ8iEYl9vgAS874oPQD7hn7gjrOAPbYq3O7D9F2/TEf2P4oElcmNzto2SyIQ2T6or9oJw5R1qEcRt/x9Y8r+p7uJ4/0ikz747T7ojyBD87HIbIZuvaxfJDdUDg+sLkOm4zlY7E77eP44FwcIpdRt+cRJ9D/DGEB0Gdgpz/GwuoRNfIc8kGSnyVgy0MwPvf+g9pw9mx9iG7jg+3cVywOkc76T8EMoTIS5PCquMOHaIIuj2ILv1/jEEHbQPmj/p4HnKmlfJDZc8LTNsOuN3+/Pq2e4YPRH0/5EN2MUzvMN+LmCdF3iMjb5nt7u0NpD/Vpq+g5n4H+rHA7bHdUinzNfIgsEdktrHvjEOGOxhDbyz14aWbAOMNGH6J53JHNENGA5z5E/sQmB7TPRI9I2mLlENsf8nYUwcO+/FmPetXjEMWVYC8Pqi88w31wg3mvD9GyOESwoxHNIPMZMBUBPjjyIZrvaNzrQ5TrcYxu4q6PO0Ktgq5a/cO6OERjZwg0DNm8pDhE0I5dntYf7Y2N4wUo7NCHqCskqaTltaFHENjZ0eEOJ+7Q1PpHfvNyj6/A/yd9BsZw8tQ+RMmEXWS6MxR3NNCHqJV7pw/RLh/ATkDKB7MdDVRsqz+0z0SPN/sQzfjA2fGOD1EBeTD/dMsm7EdI8LmB0rL+GPktufBeHyK5+vnqpB375aFbRT2+9+IQmerhz5YPitWfwPVox36ciAWM6/PuhYRS8zvgg8hnkL978mknvEiCcilOX/ZNcyLbXOVXbsrxjgnR8+fPg82L1IGvrYAX3Y70lZ+t1lfbeycDW+UJn7b8xdy49xPgrS5jSmvZYyqPHxDMc+c9jStL7jnPyFTu+sxenTxuJajm20TsRoIx2tsxm6FZsenqucYbDidPqerSRA5fJ3vIG7QZ2PDGXV1itFb8j7Uds/L9jWHylLZZuRjN3srIAPLYAcENDHGHSiVJz+z4qc/PyZPcsIeVzL2VELhBijtEvaKjX1QEHyI/QkWVuWqMFvF2EIVvK3/jt0QeZ1DjFJWS70i4nmRyDd0/44OkWNMfQ3Me8MHIxWVYDwEfxPHH57G3opkTjpent8NVSrnUHaNMf6NcJ09GWLaKJ/jAG8Toj7izNecDp47QH3d8qFM+SESefMknblixXidNsosVj782PshWpENxGR9kcsCPKpKvSJt/7M7MLM3eMmftuecb33Ka00nGBzsIfID3B6HDBT6YKPY0Hxz1B98+ZZZhvN/R5Ge80PLAif4Y5Ol2bHbCRcTeF2B/PM0HItKCUcWdwyaufcvcxfOZ4Af8Uk7xQdbHgjxn+EDtVfHR+7igV7z+TvTHM3yANuS6q+U3O+bY1F174okYM9DYxeRcnITXDvjAvaoA7VmuddF/NhmaPTan9f/WUhH91ds34PyE6DMi8hZUqb5yW2RQUavazIeoK6yf6IVp7weLvjfFpaagWnJriLbVic/Y53oJK9ICfgOwEuMJ08oh+GH7FuQAeSY7DMOAjQ9RJkXPMH+7RwkG7Cv8lHGIfHyGlmY+AyW0Z89jsuNmCnHp7gZhIuCtPkRhfOz6m/gQ9XqXkSb6mx3wA1pCumA/Mx+ifEXxXByifED0/XG6It07aBn6a/LE7II8w47F2UG2oog+fc7Oej18f5j1x1LbMYgz5YNJtTJ+KyCPE7il6otr+ZudomyFPewUvSQfoplBZHzg5fcNM+uPUx+ilA/0Bj6YVd/Xc8+HyGcA7dPS6Y6b/xB84Iwc+QIE9B/sR+0018Ajk6ie/fcu3etDZB9J2l1PcgIkOyDBUMHeEj5w553kg+Md8JftQ1TrOB0evTzDDsRleHscokta/yGu3yEKPkRTPkC9gTyGD/bjEN3nQzRrtvkTMXLAB/llKR9kHQH5oIAPUei4oCfZv88ZvOavj3yQ81qv5oQPosBNnj0foh04PjD8ZeYkHZ+R07GIFr1U4euL88mpMzer1J62maFrSZOXyBjAWj77LeSubVdIzLofy1dMptL5QcN89WNJ3iMtTxUx8uztKDh5GIdoUsGRKdwZ1K7vmyY2WLjctQ9OakRcHUe2Rz5Ew44ZhwjkcT9vAjAOUVqilyezB5tNEWEcoh1+M3yQ+RD5G7QdflOfb+OD/I4LxUM+KHhC7xdY/34bcMgHjEM0xEy9TkYWYtql65FxiJw9OLkZhyiWZZPzPkTBp1ChbaZ8AP0msaPfRXGIbkPNr/GzXr++iDy/JyeHuyZEDw/PyosX7xaRD/Vjl7LVcvTdIx+ilvpBjXGI8BEkxiGCivlScIemEww2f15PxiFiHCKvRytAvMNgHKJmx+3ohA/aDo0pzsuxxwdGnqDHYjISge6W7NjiCV1QZ09ghvMVYSNIviMQ7TKIt8MHgX4KtM90wpXzQdixBT7YslNUi0kZh2gUGPXAOESMQ4QTDmdnwAeRHky5Ro9DAU2OwS+9fYq9v0H50Y79fY5RUDAw3/4gd88A+s2MD0CO0P3SOETnMJ7m8kp78eLd8vDwrHzgA7fPtRa+ZW4ocry7v3X7MbinF6IlmyXk8Sv4EPUTxsqsmmPmwKzkWtSRz8DIN/oSSWKIvvzMXp08boBTV+1hJGd8iKQSNPoMBIry8mglCVNtf6KGaz0hj4FttqLm1RkYWKY+RK2Wc74Tu3IxVra3s/Pm9znFFajE3hIOHeoJF0aYC+IKYWAIsDcZOs07kLs+8yG6aH2JgpZ0PSb4EOFKEPQHX3p8Rhn7w/AZOMkHOEC39j/kA/Hdr+CBrEAr5MGKmnqJR99qtbKKsArxdUvHr9GBwwmeD6Y9IS0/9SGC/nCbz4DX4x4fNAVupxeQY48PssOJD1HapNZnoBz2R39CSeRIJFXftCm/HfDBoQ9RP/dOH6ImT0ZP7R/1+aZpeEvYS/Qhwu7h2t8zQyJmX+kOHQu0h+PzeT4QMbeAmGHkg+xn/MWOa8gH7d/kyQenPhifg709ig/q28SkvTQhEbeIs6NgZ6E/2hyCOgL/57wG8pidouQUKF962SkfOMEMDwAfiM+hCiBOj8OOLR8UPM1U7zYfImCleL9j5VbPQXl25sKkghkfoA9R737VLjTc357BlgFYyaOxbEJU6j9uBbmITH2IWhqm4F7TUx8igcu6beAKuxgDTuqNK2qCPkS9opD/dm5c2PAVYhwicdczDlGzYxB3csDvFGVm7O2HcYi2z3FFbfYIhK8n4xA58eJTaTfyAcofFyAyn8JEDuD/qQ8R6JFxiCDF87SInVlE82Acoi314wQW8PJ9iHw7BvVNdopmfHCrD1HUH4jLOESQIX5tvFJSPfZi7P1GmfCBE6zpaXKfA/0S7eF4B9zXz/GB4YVxgk/v9iESGXpCJT0C63aIZPRHVZFjHyL/TKJvBzuAQQvXr2988IPlT/2JP/bGd33np9/Yq9cv/fJnn/3tn/3FZ8+ev7sV3w32Tp8B8zXsTJl6Onns/eSZHQUHxiEKFXR5x4PtFs2RXS3w1FtXUJ5eftLzzMpTWj0jB+MQeTmsOTYBGIcoLVHE5IQrkpsdtGwYh2jafVGewAclmTDv8Ju145aT5YPshsLxgc112GQsH4vdaR/HBwc+RKigoRZhHKLb+WA7t3Q5TvGBVYlVgLNjb+coj70+ms+s/xTMECojQQ6vCsYhmghieA0JIPchiv0R2gbKH/X3POBMLeWDzJ4TnrYZdr3d7kM0+uMT+RCZfrsKa3eIWlr/GSvBc5+BlvbDdkelSOoz8MEPvFb+xT/xx974oweTIRGRbcJU5G/9bz/zVV9scaklolLs17iCWaQI4xCBPEDaYuUQ2x9Abpjij8O+/FmPYhyilm5HGYcIx49wwGsRy8V2hAZnHKKcD7AduzytP9obG8cLUNihD1FXSFJJy2tDjyCws6PDHU7coan1j/zm5R5fgf+tHovEwRz5APntYMefcYhmOxqo2FZ/aJ+JHm/2IZrxgbNjPbHDOdvRCAKK7U1Djbmd9yuS/hj5LbmQcYi2y6cTjhkfQHaT8blXD3+2fFCs/gSuRzv240QsYFyfdy8klJrfAR9EPoP8741DBHpchf13at4AFRUpKioqw4fI/CbQ1u2LqvvT+ptLXR4q5VLkzGSo4bu+81PTc7WVq9LL11quX8FU96mLMCpoKq09tT/7VHv5WnXVBge/gmrX65O1+55hjQegV+mrejW1f4JSaP0U5LACjr8gR69r052az5nsUFBsaPdZXbkKtRFjM9rl0N6AkgDkcbq2Tae9/N4uKHt6IVbQypHIY2yty9FsMW4FJOIMWxNRudavPZXt87X+dhXtazIhDlHLr1cobUD3pctjqmr/xm9GnqxhnEGNDJx5OPVm/RLOzQ/kxZr+2OsMbTPjAydPODTaZsYHTh5rx1DtLo+7EuTp515H2vkgM0+QZ1bBfgz6D57edWXaLuW1Ub4rCDLM+iPq0cmT8EHWH43GvDawjt0Uox1j98gr7osY7WDkkUSefm7GB5kcII+to0J1armz7HxzX/0fnDA+Xk1q/ERsmV1/Xo+7cHxg9dfSocG8/l4tRrGjAW1xPW36M+OzkaN9NmeaGqQZGoWMxsjq7ORJZJ73x6T4bo5DnmZTs/7o5JlXsB4z/JKKW+9BLAd5E4WqgzxwTj4+J2pBec7wgdFn1mxNf54Poh49QFgo39qxt+dYrSGH9DbMdORLB3lQj11/8/scn6GpeFL++Dj4wMmD9tyfgLrxcTnVPt9YuUW0bofITCDLpeihD1GYcdev9Yy9OETPnz8s0wDjEMVnhR0e4TPAOERWb/euQDW9TR7hAPthHKLxs7OzXg/fH2b9sdR2DOJM+WBSrYzfCsjjBG6p+uJa/manKFthDztFjEMkjEOU5O8aeGQS1cM4REPQkH3SH2/hg5U+RLWO0+HRyzPsQFyGjEOU98dwnxMMQQ74IL8s5YOsIyAfFPAhCh0X9CT79zmD1/z1kQ9yXuvVnPBBFLjJc58PUdlu3PxLYRfgSd4y52bjMtq2zwyR2W0+ImMAU7FDmT3hcfUs9YasMA6Rn9Un59UTohyt+SZMZHNSm8LqS8+4QKk3+BDBnUG7RXNNExssXO7aByc1Iq6OI1udPGM9zsG3yPgTwggXys9XoGpPUb9lzzhEaC7Juq1t2oQP9hHtaJODcYg6H+Qz95ET8EFSjGle+8g14xBtaemiYs6MQyTSxzwnpm3pRGYx7dL1yDhEzh6c3IxDFMuySc0JxsdID4lPoULbTPkA+k1iR+/ZOES9vR41HQh4krfMbaZ05EPUUi/O6ThE99azZTNdMTnyIWo3Nvs+RO16xiHCDgPnwQ4R6olxiMzA7PQA9luvZxwiHD/CAVe/GR9YHfWPGR+It98hf5Oj2XE77RY+8NVOV1DF6z3sEDEOUVSXMRTGIRJhHKLYHxmH6IgPGIdIpI3PO7wGfBDpwZRr9DgU0OQY/NLbp9j7G5Qf7djf5xgFBQPz7Q9y9wyg38z4AOQI3e/OOETtCbSVL1QQWTghElHTqbZ/nz4O0YJaJwObn2kbeXpNzPFQfRW7FJHZq5PHDXBq1WiMhHGIpgOOWblgHCLGIXLdr+CBrEArJOMQpYSFBYBpzPigKXA7nXGIbPl2h6jxwJTfYNzZ649Bnoye2j/q801TxiG6gQ9EzC0gZhj5IPsZf7HjGvJB+zd58sGpD8bnYG+P4gPGIfI7hFgEyJPRXeADxiE6hIq0saUcnXsDFk6IBkrrbkVk6kPU0jAF95rOfIiW1hVX1AR9iHpF61e7guJ9FrwcNd++04W/tnIL/ADdiXGIhv5M+aYQlzIO0XYC4xCJb5eux1yOYQ+WD4ALfMZgz6l5CWbAOEQCN5iZT2EiB/D/1IcI9Mg4RJDiefYZzix/xiGqqR8nsICX70Pk2zGob7JTNOODW32Iov5AXMYhggzxa+OVkuqxF2PvN8qED5xgTU+T+xzol2gPxzvgvn6ODwwvjBN8er8Pkfa2XYl1EyItfQLe3sxiSbanfWbon0n07WAHMGjhR04Jz+xowBWtwuGrX7Hx9XTy2PvJMzsKDoxDFCro8o4H2y2aI7taYLajgTtDQZ5efmJ4ZuUprZ6Rg3GIvBzWHJsAjEOUlihicsIVyc0OWjaMQzTtvihP4APGIRr2zDhEt/LBdi7jEPnKMg6RHR8zPoj9EdoGyh/19zzgTC3lg8yeE562GXa93e5DNPrjeh+iza4vZp9uDda/Zc40xlgJXhuHaEk9w47GIKJS7Ne4glmEcYjCSjA2jJVDbH8AuYs36XHYlz/rUYxD1NLtKOMQ4fgRDngtYrnYjtDgjEOU8wG2Y5en9Ud7Y+N4AQo79CHqCkkqaXlt6BEEdnZ0uMOJOzS1/pHfvNzjK/C/1WMZ4g75fco4RLZ9YCcg5YPZjgYqttUf2meix5t9iGZ84OxYT+xwznY0goBie9NQY27n/YqkP0Z+Sy5kHKLt8umEY8YHkN1kfO7Vw58tHxSrP4Hr0Y79OBELGNfn3QsJpeZ3wAeRzyD/e+MQiS93Fdb6EIlUkti+7/oMTAa2yhM+FTOw3jWf3Km1GxDMc7M9zXyH1P6MTOWuz+zVyeNWgmq+rXN3IznjQ2RWbNphvcYbDifPxkxaNJHD18ke8gZtBja8cVeXGK0V/+PMh0htbSVvfbNyMVaA9noJyDO9UYs7VCpJembHT31+Tp7khj36DOzYPNwgZT5EvR1hBS7EIfIjVFRZ0oF7bZPmb+dFn4FEHmdQ4xSV6EMEF2B3jTu3O1t4WX8MzXnAByMXl2E9BHwQxx+fx96KZk44Xp7eDlcp5SKpDxFo4LTPwEk+8AYx+iPubM35wKkj9MfzPoUTNQU7bsgnblixXidNsosVj782PshWpENxd/oQqUi+Im3+sTszszR7y5y1557v18CHSKz+hh6hwwU+mCj2NB8c9QffPmWWYbzf0eRnvNDywIn+GOTpdmx2wkXE3hdgfzzNByLSfIjizmET175l7uL5TPADfimn+CDrY0GeM3yg9qr46H1c0Ctefyf64xk+QBty3dXymx1zbOquPfFEjBlo7GJyLk7Cawd8gD5Ezp7lWhf9b5wMNenK0vnQYh+iKmiRTbGbHU58iJoUMGVt7mR7cYiWVhlXpAX8BmAlxhOmlUPww/YtyNHS4sofl2n/dzNgxiHq+jPlm0Jcmm4IpIY36phkM9oHMgzjY9ffxIeo17uMNNHf7IAf0BLSBfthHKLxs7OzXg/fH2b9sdR2DOJM+WBSrYzfCsjjBG6p+uJa/manKFthDztFjEMk7hHsQz6YVd/Xk3GIjHhFbvYhso8k7a4nOQGSHZBgqGBvCR+4807ywfEO+Mv2Iap1nA6PXp5hB+IyZByivD+G+5xgCHLAB/llKR9kHQH5oIAPUei4oCfZv88ZvOavj3yQ81qv5oQPosBNnjt9iKSVc/qSU1gXh6h27rHaoE6pPTUzxNGSNh8ZA5iKKLZw+zrB66+J/JFvFvlD3+iP/8Cf/IGP2e8/+j9/9tkP/cQvPvudrzyfLhz0AtWXn6/Y5D3S8tT2a9Jz5iUL4xBNKzgyhTuDdovmmiY2WLjctQ9OakRcHUe2Rz5Ew44ZhwjkcT9vAjAOUVqilyezB5tNEWEcoh1+M3yQ+RD5G7QdflOfb+OD/I4LxUM+KHhC7xdY/+47cMgHBz5EE8Ly4xvjEO0D+yOssB/xgVOE4C+S8SryQTRw3x8ZhyiXI/BbtmOb9MdzfHDehyj4FCq0zZQPoN8kdvRejUOkIlJ0LLivwrIJ0aU2ztZ36/ASDNi0dU+9NI+JQ/SBSz4ZyvAX/rVPvyFF5D/9b3/2qy5bPfIhajc2+z5E7XrGIcIOA+fBDhHqiXGIzMDs9ND6W3H5MA4Rjh/hgKvfbAXV6qh/zPhAvP0O+ZsczY7babfwga92uoIqXu9hh4hxiKK6jKEwDpGI20FDumAcIlNg1APjEDEOEU44nJ0BH0R6MOUaPQ4FNDkGv/T2Kfb+BuVHO/b3OUZBwcB8+4PcPQPoNzM+ADlC97szDpGUzQZWToZEcLnnMTDLJBvJmZUTM7in12lLRx7tgnbNyENF85zkUs5Nhhr+wp/+9Bujrlv5vSq+GqEG/fio4DjQ02x1D+TRKpHWY0ENdr0+WbuHjFWvsr0ZqKXi/oI8tlzJTvQ5BDl6uUaeOnPHnS0N36yuQI/956bHUb6Tp+lYjTzq9ejNxRcUTE4hj2obUX+jfH8hVtCnQw6Qx5tN7Udet5MOZC+Sa/3aU2mp9rRaR/QhQnnyBoTSwS5M3xkrfza1PSkTx8hj29SmLo/BCPm5qNgZhv2KqAx79jL5kv217qNTyJApsyFnEY4PfLVb+f7KVIyeDj4YqujyODlqDeYVRAN1OrDiSpdDpI8HQQ7TPragSfm2P6JduOqJKTetP6Z4NcrR/gZHW9uIKrdCphU0crTaej16davhg7RAAMiTVafLYfQ1VU9liWpHeML4eDWpiTVjy2zl9TQVAMQZfQfl8OqN/dKeM1J7IJY/rm3lqamzsQcR0N/kviTrICaTibmP3DIOdCoxP8zU1+WQcZ8T7AH6T6vBvIL1mLGLmbgiop2DrtikME5PjBvt2PFBlCPIo0YefwIavCvbyuHlmdw7hJpDIaDH0YRGnniaqZ7l1bwIj2ZN87p6PjjKLpejfR4fBx84lTuZZdjDzXGIoEEWYZ0PURER0TpzqzN4t4Iy2foOU3B7hsQV6bgG0fH8xR3VxhU1QR8icVNlv4KiybO1Xh7GIRJ3PeMQwQqUwAc44HeKkvbvDb8ljEO0fY4rarNHIHw9GYfIiXe3DxHjEE12qFousxXpcCK0j0B5M/knchQ8zz7DmeXPOEQ19eMEFvDyfYh8Owb1HezAT+9zTvoQRf2BuIxDBBni18YrJdVjL8beb5QJHzjBmp4m9znQL9Eeoj3ncvRcLB8YXhgn+PRRPkR9vF83I1rnQ6TjUZg248wmxaKSPpPo28EOYNDC7evCeh+c0SocvvpnUn09nTz2fvJwBEAwDlGooMs7Hmy3aI7saoFhYh6aI5Gnl58YnuqBD5F9RphxiKwc1hybAIxDlJYoYnIKK6vCOEQu81n3RXkCHzAO0bBnxiG6lQ+2cxmHyFeWcYjs+JjxQeyP0DZQ/qi/5wFnaikfZPac8LTNsOvN369Pq/e1ikMktr+uw7o4RCIirnLnfAb6s8LtsN1RKXKTD9Fd9XbPRG4NXor9mr11hXGIwkowNoyVQ2x/ALn7kgQe9uXPehTjELV0O8o4RDh+hANei1gutiM0OOMQ5XyA7djlaf3R3tg4XoDCDn2IukKSSlpeG3oEgZ0dHe5w4g5NrX/kNy/3+Ar8f9JnYAwnT+1DlEzYRaY7Q3FHg3GIdpoj8oGz4x0fogLyYP7plk3Yj5DgcwOlZf0x8ltyIeMQbZdPJxwzPoDsJuNzrx7+bPmgWP0JXI927MeJWMC4Pu9eSCg1vwM+iHwG+T8mDtHiyZDI6tdui4hIezZYZaz8aE3daaZHwGGFVMzAetd8cqe2bkAwz533NK4sOXkiU7k+8ohbAAAgAElEQVTrM3t18riVoJpv69zdSBiHyLWPq9BYuRgrQK2MDCDP9EYt7lCpJOmZHT/1+Tl5khv2sJK5t0wJN0iMQyTGDtIDebGmP4bmPOCDkYvLsB4CPojjj89jb0UzJxwvT28HxiEKC85OjuwL4xCFlHGIDvuDb58yyzDe72jyM15oeeBEfwzydDs2O+EiYu8LsD+e5gMRYRwiCbyWZl774xk+QBty3dXymx1zbOquPfFEjBlo7GJyLk7Cawd88CRxiJCoF2GxD9H2odRdh80OJz5E7XwQhnGItP+7GTDjEHX9mfJNIS5NNwRSwxt1TLIZ7QMZhvGx62/iQ9TrXUaa6G92wA9oCemC/TAO0fjZ2Vmvh+8Ps/5YajsGcaZ8MKlWxm8F5HECt1R9cS1/s1OUrbCHnSLGIRLGIUrydw08MonqYRyiIWjIPumPt/CBBl6734eo1nE6PHp5hh2Iy5BxiPL+GO5zgiHIAR/kl6V8kHUE5IMCPkSh44KeZP8+Z/Cavz7yQc5rvZoTPogCN3nu9CEqNY+FkyGRpT5ETXHbDtGxD5GYljT5iIwBTEUUW7h9XVbv5FlUrJH68vMVm7xHWp5q+gk9Z16yMA7RtIIjU7gzaLdormlig4XLXfvgpEbE1XFke+RDNOyYcYhAHvfzJgDjEKUlenkye7DZFBHGIdrhN8MHmQ+Rv0Hb4Tf1+TY+yO+4UDzkg4In9H6B9e++A4d8wDhEQ8zU62RkIaZduh4Zh8jZg5ObcYhiWTY570MUfAoV2mbKB9BvEjt6z8YhUh33VQsnBAt9iLTODKVP36IBm7buqRfmTByiD73+wWUaiCsmRz5E7cZm34eoXc84RNhh4DzYIUI9MQ6RGZidHqp+3I4G4xDtr6BK6A+zFVSro/4x4wPx9jvkb3I0O26n3cIHvtrpCqp4vYcdIsYhiuoyhsI4RCKMQxT7I+MQHfEB4xCJtPF5h9eADyI9mHKNHocCmhyDX3r7FHt/g/KjHfv7HKOgYGC+/UHungH0mxkfgByh+90Zh6iUTVnNF28V1sUhEjGdavt3rASr/RmuqcasOm5WzBJyu2bkofJwfSG/9Muffbakyqq1rlv5vSq+GlADI8+o4DjQ02x1D+Spu2lbmdouM2pgHCJpO479X6tuhbTWxZTvDc8XFExOIQ9pO55ZG2YXYgV9OuQAebzZbPKAbicdyF7EOEThXFTsDMN+pba5VUOTyZfsr3UfnUKGTJkNOYtwfOCr3cr3V6Zi9JRxiMIJkOLVKEf7GxzNOERWjvaRcYiSvehEqeoymZj7yC3jQKcS88NMfV0OGfc5wR6g/7QazCtYjzEOUc5rE42AHkcTGnniaaZ6llfzIjyaNc3r6vngKLtcjvZ5fHzaOESHO4N34gleqrBtpB76EMmY8W6wM88x1c18iB4ervp//N1felakyB/9zk+98Zi6Mg7R5FnhdvpJnwHGIZr4EPUTW/1hBUrgAxzwO0VJ+/eG3xLGIdo+xxW12SMQvp6MQ+TEu9uHiHGIJjtULZfZinQ4EdpHoLyZ/BM5Cp5nn+HM8mccopr6cQILePk+RL4dg/oOduCn9zknfYii/kBcxiGCDPFr45WS6rEXY+83yoQPnGBNT5P7HOiXaA/RnnM5ei6WDwwvjBN8eq8P0dqdnIG1PkRVgW42LqNt+sywttxj4hC98+y5/vTP/Nyz//1nf/HZs+fv9ub/gT/5Fz92W73zAcuc0SocvvpnUn09nTz2fvJwBEAwDlGooMs7Hmy3aI7saoFhYh6aI5Gnl4/0JNWOxenR18U+I8w4RFYOa45NAMYhSksUMTmFlVVhHCKX+az7ojyBDxiHaNgz4xDdygfbuYxD5CvLOER2fMz4IPZHaBsof9Tf84AztZQPMntOeNpm2PXm79en1ftaxSECuVZhnQ9RsWkRkXM+A/1Z4XbY7qgU2fUZeHi4Kr7X/vZ6t6sGEZViv2ZvXWEcorASjNq3cojtD7Ed7bXjsC9/1qMYh6il21HGIcLxIxzwWsRysR2hwRmHKOcDbMcuT+uP9sbG8QIUduhD1BWSVNLy2tAjCOzs6HCHE3do2gAc+M3LPb4C/5/0GRjDyVP7ECUTdpHpzlDc0WAcop3miHzg7HjHh6iAPJh/umUT9iMk+NxAaVl/jPyWXMg4RNvl0wnHjA8gu8n43KuHP1s+KFZ/AtejHftxIhYwrs+7FxJKze+ADyKfQf53xyGC/rkI6x6ZM8TWZ8h95Udras8X0yPgsEIqZmB1lq+yzerHodurbQnHPHfe07iy5OSJTOWuz+zVyeNWgmq+TcRuJIxD5NrHVWisXIwVoFZGBpBneqMWd6jQzjRkELIHORiHKMnIZhf0qFLyHQnXk0yuRsxubztbeFl/DM15wAcjF5dhPQR8EMcfn8feimZOOF6e3g6MQxQWnJ0c2RfGIQop4xAd9gffPmWWYbzf0eRnvNDywIn+GOTpdmx2wkXE3hdgfzzNByLCOEQSeC3NvPbHM3yANuS6q+U3O+bY1F174okYM9DYxeRcnITXDvjgSeIQtbosxlofoipouYge+hC1Nocp3uk4RP36LYlmdLLKuCIt6ENUXIU9YVo5BD9s34IcIM9kh2EYMOMQdf2Z8k0hLk03BFLDG3VMshntAxmG8bHrb+JD1OtdRprob3bAD2gJB4D9MA7R+NnZWa+H7w+z/lhqOwZxpnwwqVbGbwXkcQK3VH1xLX+zU5StsIedIsYhEsYhSvJ3DTwyiephHKIhaMg+6Y+38MFKH6Jax+nw6OUZdiAuQ8YhyvtjuM8JhiAHfJBflvJB1hGQDwr4EIWOC3qS/fucwWv++sgHOa/1ak74IArc5LkzDtGlVuneG/8J1vkQQYc59iES05ImH5ExgKmIYgvvDGh5Ex3UG2/M4hl+0DBf/ViS90jLU9uvSc+ZlyyMQzSt4MgU7gzaLZprmthg4XLXPjipEXF1HNke+RANO2YcIpDH/bwJwDhEaYlenswebDZFhHGIdvjN8EHmQ+Rv0Hb4TX2+jQ/yOy4UD/mg4Am9X2D9u+/AIR8wDtEQM/U6GVmIaZeuR8Yhcvbg5GYcoliWTc77EAWfQoW2mfIB9JvEjt67cYiqPGXpfGhlHCKfihz5ELXUi3MmDlE9UURKuJ+8ud5hxeTIh6jd2Oz7ELXrGYcIOwycBztEqCfGITIDs9ND1Y/b0WAcov0VVAn9YbaCanXUP2Z8IN5+h/xNjmbH7bRb+MBXO11BFa/3sEPEOERRXcZQGIdIhHGIYn9kHKIjPmAcIpE2Pu/wGvBBpAdTrtHjUECTY/BLb59i729QfrRjf59jFBQMzLc/yN0zgH4z4wOQI3S/O+MQCehxFdZNiAxRtzeQ7/oQNWQzbrOEPH4FH6J+wliZnVDrLo59BsatSfQlksQQVWyFMnt18rgBTp0cw0jO+BBJJWj0GYgm4+TRShKm2v5EDdd6Qh4D22xFzaszMLBMfYhaLed8J3blYqxsb2fbJsklACJzdnDyGeXDZz78BXGFMDAE2JsMneYdyF2f+RBdtL5EQUu6HhN8iHAlCPqDLz0+o4z9YfgMnOQDHKBb+x/ygfjuV/BAVqAV8mBFTb3Eo2+1WllFWIX4uqXj1+jA4QTPB9OekJaf+hBBf7jNZ8DrcY8PmgK30wvIsccH2eHEhyhtUuszUA77oz+hJHIkkqpv2pTfDvjg0Ieon3unD1GTJ6On9o/6fNM0vCXsJfoQYfdw7e+ZIRGzr3SHjgXaw/H5PB+IhFu0PT7IfsZf7LiGfND+TZ58cOqD8TnY26P4oL5NTNpLExJxizg7CnYW+qPNIagj8H/OayCP2SlKToHypZed8oETzPAA8IH4HKoA4vQ47NjyQcHTTPVu8yECVor3O1Zu9RyUZ2cuTCqY8QH6EPXuV+1Cw/3tCaj4ifAirPMhKiMtInLoQ9TSMAX3mp76ECXl3lVtXFET9CHqFa1f7QqK91nIKsQ4ROKuZxyiZscg7uSA3ylK2r83/JYwDtH2Oa6ozR6B8PVkHCInXnwq7UY+QPnjAkTmU5jIAfw/9SECPTIOEaR4nn2GM8ufcYhq6scJLODl+xD5dgzqm+wUzfjgVh+iqD8Ql3GIIEP82nilpHrsxdj7jTLhAydY09PkPgf6JdrD8Q64r5/jA8ML4wSf3u1DFD6swTofokrtKiJbVGJPsj3tM0P/TKJvBzuAQQtPB/Q76324TNUrHL76FRtfT1dNez95ZkfBgXGIQgVd3vFgu0VzZFcLPPXWFZSnl5/Ymll5SqsndiXrwIdoImQvXvHoy/AhgpUsx5glKSORx/ICNATjEKUlipiccEVys4OWDeMQTbsvyhP4oCQT5h1+s3bccrJ8kN1QOD6wuQ6bjOVjsTvt4/jgwIcIFTTUIoxDdDsfbOeWLscpPrAqsQpwduztHOWx10fzmfWfghlCZSTI4VXBOEQTQQyvIQHkPkSxP0LbQPmj/p4HnKmlfJDZc8LTNsOut9t9iEZ/fAIfIlEpcjH7dGvwEn2Iikv7YbujUuQmH6KPfd0Hb9YN4xDNHj0qTv+jFdRXPy4B1usnz9hP2lEED/vyZz2KcYhauh1lHCIcP8IBr0UsF9sRGpxxiHI+wHbs8rT+aG9sHC9AYYc+RF0hSSUtrw09gsDOjg53OHGHptY/8puXe3wF/rd6LEPcIb9PGYfItg/sBKR8MNvRQMW2+kP7TPR4sw/RjA+cHeuJHc7ZjkYQUGxvGmrM7bxfkfTHyG/JhYxDtF0+nXDM+ACym4zPvXr4s+WDYvUncD3asR8nYgHj+rx7IaHU/A74IPIZ5H93HCKf/Srsv1PzJmzTwfafiFnJrMpTPF1k04T50/qbS10e9T+tx+qloiLvPlzlR3/ys8/O1vhHf/Kzz7SVq9LL11quX8FU96mLMCpoKq09tT/7tOahRp62W9b05ozkCp8xwxoPQK/SV/Vqav8EpTB69HJYAcdfkKPXtelOzedMdigoNrT7rK5chdqIsRk19qA+HweQx+naNp328nu7oOzphVhBK0cij7G1LkezxbgVkIgzbE1E5Vq/9lS2z9f621W0r8mEOEQtv16htAHdl9DX1f+N34w8WcM4gxoZOPNw6s36JZybH8iLNf2x1xnaZsYHTp5waLTNjA+cPNaOodpdHnclyNPPvY6080FmniDPrIL9GPQfPL3ryrRdymujfFcQZJj1R9Sjkyfhg6w/Go15bWAduylGO8bukVfcFzHawcgjiTz93IwPMjlAHltHherUcmfZ+ea++j84YXy8mtT4idgyu/68Hnfh+MDqr6VDg3n9vVqMYkcD2uJ62vRn7zeMPYiRp1+RyJN2kNEYWZ2dPInM8/6YFN/NccjTbGrWH5088wrWY4ZfUnHrPYjlIG+iUHWQB87Jx+dELSjPGT4w+syarenP80HUowcIC+VbO/b2HKs15JDehpmOfOkgD+qx629+n+MzNBVPyh8fBx84edCe+xNQt/oQ2V6S2/49WO5DVEREtM7g3QpKXInaLoAVgXrGPXGI3nn+Qn/oJ37pWZEi3/unP/XGXnV/9Cc/++yHfvwXnzEOUXxW2OERPgOMQ2T1du8KVNPb5BEOsB/GIYIVNRn2ttXD94dZfyy1HYM4Uz6YVCvjtwLyOIFbqr64lr/ZKcpW2MNOEeMQCeMQJfm7Bh6ZRPUwDtEQNGSf9Mdb+GClD1Gt43R49PIMOxCXIeMQ5f0x3OcEQ5ADPsgvS/kg6wjIBwV8iELHBT3J/n3O4DV/feSDnNd6NSd8EAVu8tzpQ1RqOaevOId1PkTmBqfN3axSe6qGg3tLmnxExgCmYocye0I6oKmIfPkrz/U//7Gfe/bXfvwXnn357XdDq6mKfOzDHyzvPryQd55flXGIoH3wvHpClKM134SJbE5qU1h96RkXKPUGHyK4M2i3aK5pYoOFy1374KRGxNVxZKuTZ6zHOfgWGX9CGOFC+fkKVO0p6rfsGYcIzSVZt7VN29t/+BLtI9rRJgfjEHU+yGfuIyfgg6QY07z2kWvGIdrS0kXFnBmHSKSPeU5M29KJzGLapeuRcYicPTi5GYcolmWTmhOMj5EeEp9ChbaZ8gH0m8SO3rNxiESk6LhbW4WFPkSlzgxFmvTRgE1b99SL89g4RKpF3n5+1a0DtgYcLVGKiJ0oMQ7RxEkRloRG/UGe2YqJHPgQNcAOEeqJcYjMwOz0UPXjdjQYh2h/BVVCf5itoFod9Y8ZH4i33yF/k6PZcTvtFj7w1U5XUMXrPewQMQ5RVJcxFMYhEmEcotgfGYfoiA8Yh0ikjc87vAZ8EOnBlGv0OBTQ5Bj80tun2PsblB/t2N/nGAUFA/PtD3L3DKDfzPgA5Ajd7944RLUu4IL+aCx8y5xd8dr+Xk4cIpW4pDEhXQGDbmeqv6zlq70m5niovi8/s1cnjxvg1FV7GAnjEE0HHLNywThEjEPkul/BA1mBVkjGIUoJCwsA05jxQVPgdjrjENny7XjZeGDKbzDu7PXHIE9GT+0f9fmmKeMQ3cAHIuHubI8Psp/xFzuuIR+0f5MnH5z6YHwO9vYoPmAcIr9DiEWAPBndBT5gHKIjlFpY09sqLH7LnH1Ct1QDnvgQtTRMwb2mpz5EApd128AVdjEGnNQbV9QEfYh6RSH/7dy4sOErxDhE4q5nHKJmxyDu5IDfKcrM2NsP4xBtn+OK2uwRCF9PxiFy4sWn0m7kA5Q/LkBkPoWJHMD/Ux8i0CPjEEGK52kRO7OI5sE4RFvqxwks4OX7EPl2DOqb7BTN+OBWH6KoPxCXcYggQ/zaeKWkeuzF2PuNMuEDJ1jT0+Q+B/ol2sPxDrivn+MDwwvjBJ/e60NUrzasuAZrfYjaDoHWtz8Yku1pnxn6ZxJ9O9gBDFp4OqD3msQZrtHXmR0NzM8tLZivYWfK1NNV095PntlRcGAcotigNu94sN2i+fbfCsx2NHBnKMjTy0dbE7ErT2n1jByMQ+TlsObYBGAcorREEZMTrkhudtCyYRyiafdFeQIfMA7RsGfGIbqVD7ZzGYfIV5ZxiOz4mPFB7I/QNlD+qL/nAWdqKR9k9pzwtM2w6+12H6LRH9f7EDVF9vvpRVi3Q1RERKrypYjIOZ+BlvbDdkelyF0+RHsGPN/RGERUiv0aVzCLMA5RWAkG0hYrh9j+kLejCB725c96FOMQtXQ7yjhEZ/jAaBHLxXaEBmccopwPsB27PK0/2hsbxwtQ2KEPUVdIUknLa0OPILCzo8MdTtyhaeNv4Dcv9/gK/G/1WIa4Q36fMg6RbR/YCUj5YLajgYpt9Yf2mejxZh+iGR84O9YTO5yzHY0goNjeNNSY23m/IumPkd+SCxmHaLt8OuGY8QFkNxmfe/XwZ8sHxepP4Hq0Yz9OxALG9Xn3QkKp+R3wQeQzyP/uOETVWsuoywos3CEy7VH/2fUZmAxslSd8KmZgdZavss3qxyEZU1rLHjv1toRjnpu1csDQ6uSJTOWuz+zVyRMVByuoZ32IzIpNV8813nA4eUpVlyZy+DrZQ96gzcCGN+7qEqO14n+c+RCpra1IMm0Tu3Ixmr2VkQHksQOCGxjiDpVKkp7Z8VOfn5MnuWGPPgM7HR5ukDIfot6OsAIX4hD5ESqqLOnAvbZJ87fzos9AIo8zqHGKSvQhgguwu8ad250tvKw/huY84IORi8uwHgI+iOOPz2NvRTMnHC9Pb4erlHKR1IcINHDaZ+AkH3iDGP0Rd7bmfODUEfrjeZ/CiZqCHTfkEzesWK+TJtnFisdfGx9kK9KhuDt9iFQkX5E2/9idmVmavWXO2nPP92vgQyRWf0OP0OECH0wUe5oPjvqDb58yyzDe72jyM15oeeBEfwzydDs2O+EiYu8LsD+e5gMRaT5EceewiWvfMnfxfCb4Ab+UU3yQ9bEgzxk+UHtVfPQ+LugVr78T/fEMH6ANue5q+c2OOTZ11554IsYMNHYxORcn4bUDPkAfImfPcq2L/rc/Ltfu/Wd3evdg7Q5R2RpX6q7QZocTH6JiLzT51DPuiUPkBhazEjXOyOrd8h3luyrBSownTCuH4IftW5AD5JnsMAwDZhyirj9TvinEpbsbhImAjEPEOEReDitPXE6Y88GkWhm/FZDHCdxS9cW1/M1OUbbCHnaKGIdI3CPYh3wwq76vJ+MQGfGK3OxDZB9J2l1PcgIkOyDBUMHeEj5w553kg+Md8JftQ1TrOB0evTzDDsRlyDhEeX8M9znBEOSAD/LLUj7IOgLyQQEfotBxQU+yf58zeM1fH/kg57VezQkfRIGbPI/wIbqY+i7CwrfM+f547EMkpiUhnzaAqYhiC+8MaG0q0ctL2my+YrIjmfry8xWbvEdavRQx8uztKDh5GIdoUsGRKdwZ1K7vmyY2WLjctQ9OakRcHUe2Rz5Ew44ZhwjkcT9vAjAOUVqilyezB5tNEWEcoh1+M3yQ+RD5G7QdflOfb+OD/I4LxUM+KHhC7xdY/+47cMgHBz5EE8Ly4xvjEO0D+yOssB/xgVOE4C+S8SryQTRw3x8ZhyiXI/BbtmOb9MdzfHDehyj4FCq0zZQPoN8kdvRejUMkqqMt78ogx+K3zNk5ypEPUUv9oLYiDtGeAR+vmBz5EDUZ932I2vWMQ4QdBs6DHSLUE+MQmYHZ6QHst17POERn+GBgxgdWR/1jxgfi7XfI3+RodtxOu4UPfLXTFVTxeg87RIxDFNVlDIVxiETcDhrSBeMQmQKjHhiHiHGIcMLh7Az4INKDKdfocSigyTH4pbdPsfc3KD/asb/PMQoKBubbH+TuGUC/mfEByBG6371xiC4Te34klk2I7ADROifjECUEhvK4AU5dtYeRMA7RdMAxKxeMQ8Q4RK77FTyQFWiFPFhRa7xmamCvdR+dQnzd0vFrdOBwgueDaU9Iy2ccoomOempPKIkciaTqmzbltwM+OPQh6ufe6UPU5Mnoqf2jPt80ZRyiG/hAJNyi7fFB9jP+Ysc15IP2b/Lkg1MfjM/B3h7FB4xD5HcIsQiQJ6O7wAcFTzPVu82HCFgp3u9YudVzUJ6duTCpYMYHTxGHSFTEumSswuK3zLX0hA9RS8MU3Gt66kMkcFm3DVxhF2PAWb2Lr7+gD1GvKOS/nRsXNnyFGIdI3PWMQ9TsGMSdHPA7RZkZe/thHKLtc1xRmz0C4evJOEROvPhU2o18gPLHBYjMpzCRA/h/6kMEemQcIkjxPC1iZxbRPBiHaEv9OIEFvHwfIt+OQX2TnaIZH9zqQxT1B+IyDhFkiF8br5RUj70Ye79RJnzgBGt6mtznQL9EezjeAff1c3xgeGGc4NP7fYi2glZOhkQWv2XOfj72IfLPJPp2sAMYtPB0QO+lxxku1O1oRwPzc0sL5mvYmTL1dNW095NndhQcGIcoNqjNOx5st2i+/bcCT711BeXp5Se9z6w8pdUzcjAOkZfDmmMTgHGI0hJFTE64IrnZQcuGcYim3RflCXxQkgnzDr9ZO245WT7IbigcH9hch03G8rHYnfZxfHDgQ4QKGmoRxiG6nQ+2c0uX4xQfWJVYBTg79naO8tjro/nM+k/BDKEyEuTwqmAcookghteQAHIfotgfoW2g/FF/zwPO1FI+yOw54WmbYdfb7T5Eoz8+gQ+RnOmbt2O5D5FIk/mcz0BL+2G7o1Lka+ZDZImoFPs1rmAWKcI4RCAPkLZYOcT2h7wdRfCwL3/WoxiHqKXbUcYhOsMHRotYLrYjNDjjEOV8gO3Y5Wn90d7YOF6Awg59iLpCkkpaXht6BIGdHR3ucOIOTa1/5Dcv9/gK/G/1WIa4Q36fMg6RbR/YCUj5YLajgYpt9Yf2mejxZh+iGR84O9YTO5yzHY0goNjeNNSY23m/IumPkd+SCxmHaLt8OuGY8QFkNxmfe/XwZ8sHxepP4Hq0Yz9OxALG9Xn3QkKp+R3wQeQzyP/uOESJrS3AwrfMYc8+8BmYDGyVJ3wqZmB1lq+yzerHIRlTWsse83q7AcE8N9vTzHdI7c/IVO76zF6dPG4lqObbROxGwjhErn1chawP0bhm3l1AHjsguIEh7lCpJOmZHT/1+Tl5khv26DMwt1+csDAOEXb/jA+SYk1/DM15wAcjF5dhPQR8EMcfn8feimZOOF6e3g6MQxQWnJ0c2Zd84oYV63XSJLtY8fhr44NsRToUd6cPkYrkK9LmH7szM0sZh+iwP/j2KbMM4/2OJj/jhZYHTvTHIE+3Y7MTLiL2vgD742k+EBHGIZLAa2nmtT+e4QO0IdddLb/ZMcem7toTT8SYgcYuJufiJLx2wAdPEodIxd+3LsKT7RAd+hC1C2DK2tzJGIeoGTDjEHX9mfJNIS7d3SBMBGQcIsYh8nJYeeJywpwPJtXK+K2APE7glqovruVvdoqyFfawU8Q4ROIewT7kg1n1fT0Zh8iIV+RmHyL7SNLuepITINkBCYYK9pbwgTvvJB8c74C/bB+iWsfp8OjlGXYgLkPGIcr7Y7jPCYYgB3yQX5byQdYRkA8K+BCFjgt6kv37nMFr/vrIBzmv9WpO+CAK3OS504eoqgn1+VgsjUM0vqibuas9x8wQR0v6fPoApiKKLbwzoLWpRC8vabP5ismOZOrLz1ds8h5peaqIkWdvR8HJwzhEkwqOTOHOoN2iuaaJDRYud+2DkxoRV8eR7ZEP0bBjxiECedzPmwCMQ5SW6OXJ7MFmU0QYh2iH3wwfZD5E/gZth9/U59v4IL/jQvGQDwqe0PsF1r/7DhzywYEP0YSw/PjGOET7wP4IK+xHfOAUIfiLZLyKfBAN3PdHxiHK5Qj8lu3YJv3xHB+c9yEKPoUKbTPlA+g3iR29l+MQjReyrcPaHSJncEc+RC31QjEOET6CxDhEUDFfCu7QdILB5s/ryThEjEPk9WgFiHcYjEPU7LgdnfBB26ExxXk59vjAyBP0WExGIj7dbpIAACAASURBVNDdkh1bPKEL6uwJzHC+ImwEyXcEol0G8Xb4INBPgfaZTrhyPgj3DMAHW3aKajEp4xCNAqMeGIeIcYhwwuHsDPgg0oMp1+hxKKDJMfilt0+x9zcoP9qxv88xCgoG5tsf5O4ZQL+Z8QHIEbrfvXGIRJzeV2GtD1HrFJftC+MQJQSG8rgBTl21h5EwDtF0wDErF4xDxDhErvsVPJAVaIU8WFFTL/HoW61WVhFWIb5u6fg1OnA4wfPBtCek5TMO0URHPbUnlESORFL1TZvy2wEfHPoQ9XPv9CFq8mT01P5Rn2+aMg7RDXwgYm4BMcPIB9nP+Isd15AP2r/Jkw9OfTA+B3t7FB8wDpHfIcQiQJ6M7gIfFDzNVO82HyJgpXi/Y+VWz0F5dubCpIIZHzxFHKJyEdV6Q3GKR07i5fkQtTRMwb2mpz5EWHC3DVxhF2PASb1xRU3Qh6hXFPLfzo0LG75CjEMk7nrGIWp2DOJODvidosyMvf0wDtH2Oa6ozR6B8PVkHCInXnwq7UY+QPnjAkTmU5jIAfw/9SECPTIOEaR4nhaxM4toHoxDtKV+nMACXr4PkW/HoL7JTtGMD271IYr6A3EZhwgyxK+NV0qqx16Mvd8oEz5wgjU9Te5zoF+iPRzvgPv6OT4wvDBO8On9cYgSrlyAhXGIhiUWFfn8//urz5KznkIGgiAIgiAIgnhPQw/SR+cNGd6c/40Vu6veVxG9xAWAx2LdDtHlYnakb3yFHkEQBEEQBEEQxA6KiJRy2aYbC7dZlk2I7LPOcl08bSMIgiAIgiAI4n2O5oN40hfxJPaDDNyIMnlemiAIgiAIgiAI4rHofn0L81w3IbrWmdpVZfmDfQRBEARBEARBvK+hOuYbSaTBu7FuQvRanbG9JvI0738gCIIgCIIgCOL9ilJKn2+8oj5EbV9o/ZsfCIIgCIIgCIJ4f0NVZcRRWzcjWrZDVIrIpdT3qb/GGRFBEARBEARBEOtg5xuXhTtE6x6ZU/PWB751myAIgiAIgiCIhdDfDW+Za8/K0YOIIAiCIAiCIIiVKC3Ej4is9NFZ+Ja5ka6csREEQRAEQRAEQfQ5xuKn0dZNiC4jZTwigiAIgiAIgiBWos8xFj/jtu4tc2amxh0igiAIgiAIgiBWQlWkPMG7ChbPrzbQh4ggCIIgCIIgiJV4qjnGuh2iy9gW0hfLciUIgiAIgiAIgth2iJ4gvA93iAiCIAiCIAiCeOVRnmiSsWyHSK9iXoRHJyKCIAiCIAiCIFZCRa5FVNZuwCzbISo1tyLcISIIgiAIgiAI4glwWT/XWLdDJCrlyr0hgiAIgiAIgiCeCFddvkO0bEJUICUIgiAIgiAIgliNV3eHSGdfCIIgCIIgCIIgHgnd9oZWzzTW7RC1qZqKKLeJCIIgCIIgCIJYjSJSFj8zty4Okej2lrkiIlfuEBEEQRAEQRAEsRIqRXT55svat8wJfYgIgiAIgiAIgng6rH6r9UIfIh2BiOhDRBAEQRAEQRDESqiKisrq18yte2TuctH+yBy3iQiCIAiCIAiCWInXLlrKRbS8ojtE24ytbhFxg4ggCIIgCIIgiJVQrdOMNu9Yg2U+RCIipbSZEGdEBEEQBEEQBEGsRZtvjHnH47FwQqSb6xD9hwiCIAiCIAiCWAzVa59vrJxyrN0hEqX/EEEQBEEQBEEQy1HKxcw31s2IFvoQmWpxk4ggCIIgCIIgiIVQrS9wWzzXWLdDdBEpF6kvBr8uy5YgCIIgCIIgCKLIVUp9o3VZ+Jzbuqy0uQ+tfaaPIAiCIAiCIAhivK5g7Xxj3SNzZu+KbkQEQRAEQRAEQazENsdY/1brpTtEPeWMiCAIgiAIgiCIp8Ar60NURsr5EEEQBEEQBEEQK1HMfGMllj0yp/UNeNq+EARBEARBEARBLIKq9vnGyjnRsgnRE03YCIIgCIIgCIIgOlbPN9btEMl1m7Fxc4ggCIIgCIIgiCfBdXsybeGsaJkPUd8hog8RQRAEQRAEQRBPhJWTIZGVL1Uw0NWvfiAIgiAIgiAI4n2Op5ljLPchEnmqqhIEQRAEQRAE8X7GUzyJttCHSN03giAIgiAIgiCIddAneRLtiXaI6EVEEARBEARBEMRKlFd8h0hnXwiCIAiCIAiCIB4J1SfZeFn6UoWnih5LEARBEARBEATR5huv5Gu3RbRuDCldiAiCIAiCIAiCWAo18w1d+ETaskfmpIiU5ubER+YIgiAIgiAIgliIIiKlbPONlQ+krZsQ6XjnA+dDBEEQBEEQBEGshOrYGVo53Vj3lrly2XycVOS1166rsiUIgiAIgiAIgpDXLheVy0VWbxEt9SGS/kzfulwJgiAIgiAIgiDU/rNwvrH0LXOtZoVvVSAIgiAIgiAIYiG2OUZ30lmW77IJUX+eT58ifixBEARBEARBEO9ntKfQVr5hTmThhGh7F7hKKQxDRBAEQRAEQRDEYpj5xsodomUvVVCV9k4FxiEiCIIgCIIgCGItdCSv5Gu3L0W2WESMy0oQBEEQBEEQxBOgXLb5xkos3SHaPqx/ro8gCIIgCIIgiPc5VEW1vLqv3e6+Q3QgIgiCIAiCIAhiNcx845V8ZI67QgRBEARBEARBPCX6m60X5rk0DlFpUzXuEhEEQRAEQRAEsRhtvlFexUfmRKwfEXeLCIIgCIIgCIJYBxXdphm6drqxdodoZWYEQRAEQRAEQRAV9aXWyycdy3yIRHU8y8cdIoIgCIIgCIIgFkJVRZ8gwM/SHaI+W1v5UB9BEARBEARBEO97lGJeL/cq+hBpGSnfOEcQBEEQBEEQxEr0N8y9qo/M8QVzBEEQBEEQBEE8NVbPN5bGISplcx/i/hBBEARBEARBEEtRXzGn+ooGZu3vBBeRUjglIgiCIAiCIAhiHUp19ln9prmlO0Tjy6pcCYIgCIIgCIIgpL7Vuk40Fs43FvoQjWnaU7wOjyAIgiAIgiCI9zOKm3Oswrq3zNU4RHzDHEEQBEEQBEEQy1HfVaC6dvtlsQ/R5uHESRFBEARBEARBEEtRVIq0Nyqsm28s9iEq0qduBEEQBEEQBEEQizD2XNZONtbvEImtLEEQBEEQBEEQxONRRORS1r+tYJkPUa8ZZ0MEQRAEQRAEQSyG1r/V841lO0Q9+FApInpd//oHgiAIgiAIgiDet9gmGEV7ANRFWDch6q8EV3oREQRBEARBEASxFCqiRbf5xsrXb6+bENU5ELeGCIIgCIIgCIJYjW2eoT1dhXVxiFrK7SGCIAiCIAiCIBbjqV5ZsGxC1HaGSuEuEUEQBEEQBEEQT4PFLkQr4xDZz9wjIgiCIAiCIAhiIVT7A3MrsXSHiDtDBEEQBEEQBEE8FQqkK7Buh6j018wJvYgIgiAIgiAIglgLba+ZE104I1oXmFXqTK3I0tfgEQRBEARBEARBlDbLWPzOgqVxiPq+EH2ICIIgCIIgCIJYCNWxNbRytrF0h+iJcyUIgiAIgiAI4n2K8kQvLVgemBU/EgRBEARBEARBPBYqIuUJnkTjXg5BEARBEARBEK88nuotBUt9iMqW0IWIIAiCIAiCIIilUFW5SNl2ihbmuzQOUXvjQymcEREEQRAEQRAEsRiL3zAnsjIOkajU14Jzh4ggCIIgCIIgiPVQXf66gmUTolKnakU4ISIIgiAIgiAI4gnwSu8Q2VkQZ0QEQRAEQRAEQayE6pNMMxa+Za5IaS8Hf6pXQBAEQRAEQRAE8b5Fm2+Usm7CsXBC1GZs3B0iCIIgCIIgCGIxivT5xsqdoqVxiAonQwRBEARBEARBPBHafGPlvGNhHCIVrZGIlD5EBEEQBEEQBEEshNb5hi6ORLR0h0hq/KGFj/QRBEEQBEEQBEHUuKfa01VYNiFq7kOMQ0QQBEEQBEEQxGrY+cZKT511cYgu2zStiIi8UO4REQRBEARBEASxFpeyfKKxMA6R+cK3KxAEQRAEQRAEsRClPM2rCpY9Mldk8x0q7QtBEARBEARBEMQqlPGugpXvLFi3Q9Qf6BOGIiIIgiAIgiAIYi1U6xvm1r6zYHEcIoIgCIIgCIIgiKdA6fONlfOOhXGIzMYQXzNHEARBEARBEMRCbA5E21Ro5WxjcRwiSAmCIAiCIAiCIBagFHmS+ca612634EhF5HpdlStBEARBEARBEMT2ENql6PLNl7U7RBXcICIIgiAIgiAIYiWeao6xNA5Rke15PnoQEQRBEARBEASxEqoiRdfPNZbGIZIeh4hTIoIgCIIgCIIgFuKifb7BOEQEQRAEQRAEQby/oNLjEK2cb6x7qYL5zPkQQRAEQRAEQRCr8RR+RAt9iOw0iFMigiAIgiAIgiDWQVWfZJaxLjBre6BPRTghIgiCIAiCIAhiJUpzHhrxWZdg4Wu3dUyGOB8iCIIgCIIgCGIhtL/OWuuXNVi3Q1RE5AmcnAiCIAiCIAiCIJ7qbdZLfYiKlPrmB86ICIIgCIIgCIJYCFUR3eYbK1+usDgO0Va5p4oiSxAEQRAEQRDE+xRF+nxj5YRjYRwi4QsVCIIgCIIgCIJ4OrRYRLpuRvQEcYiKPM0L8QiCIAiCIAiCeL+jLH4ebXEcovbebU6ICIIgCIIgCIJYBz/feFV3iIryrdsEQRAEQRAEQSxHKSKlzjdWvm1uYRwiGTMhzogIgiAIgiAIglgIVX2S+cbaCRFBEARBEARBEMQTYLXvUMPKCZGW6kDEDSKCIAiCIAiCIFZii3u6zTfKwj2ixXGI6uvB+cwcQRAEQRAEQRArUQOevsJxiMYzfdwiIgiCIAiCIAhiKeqzaKtDnz5BHCKRwi0igiAIgiAIgiAWos0xVnsSLYxDtCongiAIgiAIgiAIwBOF91n7lrk+XePsiCAIgiAIgiCIhSi6fntIFu4QuSkb50MEQRAEQRAEQSyE6tO8vI1xiAiCIAiCIAiCeOXxNFGIFk6I7OYQN4gIgiAIgiAIgliJ9s6C1XONJ4pDRBAEQRAEQRAEsRA2DtFCPEkcIr5yjiAIgiAIgiCIlSiqTzLNWLpDxN0hgiAIgiAIgiCeCgXSFVgYh8hO17hDRBAEQRAEQRDEOtgn0lbONha+dtvM0wonRARBEARBEARBrENpLy1YjIWv3W7Ttad5to8gCIIgCIIgiPcv9IneV7Bsh2ibq9XosZwQEQRBEARBEASxENv7Cup8Y+GEY6kPUZEiKgr+RARBEARBEARBEI+DnW+sfHRu3Q5Rnalxg4ggCIIgCIIgiCdB0fFk2iIsjENkPnBGRBAEQRAEQRDEUui2/bJ2g2jlSxVqvRiIiCAIgiAIgiCI5Sh9vvFKxiEarwVX7hARBEEQBEEQBLEUqiqqm4OOvoo+RG4WdOGMiCAIgiAIgiCIdSju7XLr5hvLHpnTEYaIcYgIgiAIgiAIgliKJwpDtG5CVMpI6UZEEARBEARBEMRKtDlGWTzZWPiWuTJeNLc93EcQBEEQBPH/t3cHvZWk13mAz6nLZoszbtmSMAGSOECCCAiQrZG9VkH+gHbZ54/4RySrbKI4gBZeGQ5gwBgngA3HUAIksDaZQQxrZAUZSzMjdg/VbLJOFlV1b5FN9nQ3T8ns4fNgxHsvu7t0ty/e75wPoEVVRGS2n0Xr3zIXm3xPAADgAcvVKoX7uWUuKmq5lVUeAgAAmlVOG607z6P1NUTpHiIAAGA7W+SN9nuIKkJDBAAAtKo5bFTc2yNzEwURAADQbYv5oYjWhqgic76HaNARAQAAfWqYYkbVPW2I9vcQdT0QAADgmu45or57iOrm9wAAAHdWq1UFjXljk3uIAAAAum2RN1pniKarklxEBAAA9KqoqP3Fp336AlFGRJY8BAAAtMuIiKF/73bfDFHUlIcqogwRAQAAjaoOeaNT35a5OaZN2+YEIgAAoNG8Xi6bB4kat8wt3VWJQwAAQLOa26HeM3O9W+ZSFAIAALaQ+7zRmTv6t8yZHwIAAJrVKm9UY0PUF4iGiIia2qtRKAIAAPpMI0Rz3mgc0mlsiA4v4hAAANCp6nDLT+dehdYZoojpy7U/FAAAeNCGjIjsDUMRrVvmYlkypyICAABa1ZIzmrNGX5mzQVoDAABYLHmj8y6i5i1zM+u3AQCAVrVfaN252Nq4DwAAcP9tdBytrSHKylpGiMYop+cAAIA2VRG7yLq3W+Zy/pFhlggAAOi1zhudgaNvy9wyN5QR5WJWAACgUVVNmaO5fWltiHL9AQAAoFFee+3Qew/R/kPXUwEAACb7LXONz+zdMqcZAgAAtrJB3ui7hyhq+W+1IRwAAODuKqqWu0/v5Za5RUbEoCkCAAAaLcGlO2o0zhCN+/ejISIAAKDRWBVDjF/9F99Q45G5IZaLWSMu+x4LAACQERnDfT4yN/dCNdoyBwAA9Jrnh6J6z6P1NUQZETFGZMTQ32QBAAAP2BAZkeMhd7Q9t8lY04q5sWqDk30AAMBDts4bnUut2xqiKVnV/hUAAKBNRhzyRp+2QDQu001zcgMAAGhTEeOSN7JvrUJfQ5RzHsq0dhsAAOiVEbuY8kbnlrm+pQr7YkhDBAAANFvljWqMRI33EK1SUPf1sQAAAPvM0dfANG6Zi3nrQ0Q1bn0AAACYbyHa544ubYFoiJjuIAoFEQAA0GvJGMP6Q4O+LXOrL6UgAgAAOlVdzRxdWtd4d6c1AACAxRZ5o3HLXMV4+ND2WAAAgIia5oea9V70qh0CAAC2skHeaFy7nZUxdUMVJRoBAABtKiKGyGldQWPaaGuIMg+v0hAAALCF7rzR1hCt7x4qM0QAAECnqk3uO22dIdIMAQAAm1g1Q/ezIVq/uogIAABoVDVtKuhOGn0zRPOPjIjUFQEAAI2GOWwsuaNLY0NU+7imIAIAADpVVWRdzR0d2gLRlZCWEhEAANAoI5YkdD9niFbXxmqIAACAVlX7zNEZNxobolVOS5EIAADok5mVQ0aMvc9tXLu9pLXeM30AAABVETH233naeg9RRLVvfQAAAJgiRu1fu/TNEFXF9DW7MxsAAPDQHYZyltzRoy0QTTvB5zAkEQEAAJ0yIrOie61C35G5ZXSowpo5AACgV21TvvQForz2CgAAcM81zhDd/B4AAOCuqiJyfSqtSVtDlLEqibREAADARjrjRvOWufm9rQoAAECnrP1JtM600XoPkWYIAADYSm6wt6B9hsj8EAAA0K4OC607e5i+GaI8vCqKAACATlvtK+hriK6c5FMTAQAAfbbaU9A7Q3TtFQAAoMsWeaOtIcrIipx3g9coEwEAAH2qIoahsrkoam2IDuQhAACgU9749q5aZ4iWm2NNEAEAAJ2qKrKmSaLOlqjxyNzqtbvHAgAAHrScz7Z1n0VrvIeoVu+7ngoAALDkjf6g0RaIrma1se+xAAAAEbHFroLGpQpTWqsqQ0QAAECr5RRad1PU1xBlRERFZkQpiAAAgEbLroJsLokaZ4jGmAqn0QwRAADQqvY/etuX1nuI0uwQAACwkS3yRl8gWkaHqiJSRwQAADTKea91c9ToC0T50hsAAIBmvXmj+R6ijIgyQwQAALQ6ZIyKqL5Q1LplLqNiiUUAAACdMpe8cR/Xbq+vH1IRAQAAjTIqam6GOtNG65Y51RAAALCZDfJGWyBaLoytUhABAAC91nmjU1sgWm6MzVQUAQAAvfLaa5fGGaJDVKvWU30AAMBDV1GRtf/QpnWGyFVEAADAJjY6idZ4D9H8uvoJAADQoaqi5oXbncGob4Zo/pGHTwAAAC1yDhv3doaolgN9acscAADQq6qmNNSciDaZIeq8ORYAAGDdDnVmosYtc7kvhmq5QhYAAKBDVVQMFdG7saC1IQIAANjGNp1LWyCq+erYqjJDBAAAtKq5G5q2zfUFjrYjc5lXXwEAALrkLe/vqvEeokNK60xsAAAAFbUfHuo8kda3VOFKThOIAACARrn/0aq1IcrIONwfCwAA0GSuhaa80ReMemeIsiKn3QoAAABtMiJimPPGfVyqMM0Q5ZTcBCIAAKBRLcVLVesmt+Ytc3ONZdMcAADQ7DCa09fANN5DFLFf/OAiIgAAoNGyZa75xFxfIMprrwAAAF22yhuNM0T7d7GMOgEAAHSoyDrUQ/dwhsgmBQAAYFv3eIZoUd2H+gAAAJZ7iJqjRnsgatyABwAAMJlzRnfe6JshWr9XEAEAAI2q+f6hRXtDBAAA0C832Wjdt1ShaqqxlhtkAQAAulREZbVnjW0aIlu3AQCAVquM0VgV9d9D1B/aAACAB66qIirvcUOUc1DL6L8+FgAAeNiGPOSNRq0zRJohAABgExWxReKwZQ4AAHiwOu8hOsS1KofmAACAPlVR2b+9rbUhWu5JkoYAAIBu+7zRGDgaA1HNm+bMEgEAAP32eaP6EkfbkbkppNXqJwAAQJ/cIGk03kO0HiHqeioAAEC0tkJrfWu3Y9oLXrFNcgMAAB62nJNG586Cvhmi5R6iKlNEAABAs3Xe6NMXiDJiPz1kzRwAANCurr3eXfMM0XRormrseiwAAEBUjBG1i+kG1L4Gpm+GKKfZoYqIrNbrjQAAgAdviMxq31nQF4hqVWAZIQIAADrVGDVP/NzPGaIrHJkDAACabbCroHGGKJYRos12hAMAAA9T1XwkrTlqtDZES2DLtGYOAADolKu80ffUxotZaz87pCACAAC6LSfROvPGJjNE2bn2AQAAePC2yhi9M0QAAAAb2CpvbDND1PlQAADgwcvYJm+0BaKMisjaX84KAADQZdpqXfvc0aWvIVIPAQAAW9kob2wyQ+QeIgAAoFPtLz7tZYYIAAB4J2yRN/ruIarD7JB+CAAA6La/h6jxmZvcQwQAAPAuaJwhqqm7Kg0RAADQa503OrUFohyGypyXK9RojAgAAGg1DMOUixrTRuORuZo3zZUtcwAAQLN13uh7avMMkSAEAABspX+NW9uRuXG/F1xDBAAA9KqqGOeGqFNrQzTMXy7dRAQAALTKfd7o1BeIxogxImIsB+cAAIBeVfu80akvEO2flBEpEgEAAI3WeaNR3z1E4/5d69YHAACAquXC04povOWnLRDFUPt7kobxq/4yAADA68vIyGEZz7mHW+ZiXC3B0xABAACdan0qrU/zPUQLiQgAAOi0Tcboa4hW309DBAAAdKrqXqcw6W2I5m+YriECAAC65bXXBn0NUdTynxNzAABAv5qWKnTe8tM+Q6QcAgAAttKdN/ruIVrPEJkiAgAAGlVURfXXL5tsmdMSAQAA74K+hijGyLRhDgAA2EBFxDC2b5tra4g2WPgAAAAwydXLfdwyt2+GKqKsmQMAABpVVURk+0brvhkiFREAALC15rzR2BBVZLiHCAAA2MAcNOaeqI0ZIgAA4J1xj+8hqtX7rqcCAABczRud2gJR5nD4hjkqigAAgDaZ1zJHk7Yjc8tmuaoyQwQAADQ75I3OuNHYEEVkTLck1SgRAQAAvTKnvJGNkagtEEVVLHvmzBABAACdqqac0b1nru8eoohwVg4AANjGVL5MUegeNkRXWiG5CAAAaFS1zTbr1oZoX1ylRAQAAPTJfTt0Ty9mHeflcuNGyQ0AAHi4aqO80RaIhmuvAAAAbeZaaFi979A2QzTG4f4hBREAANBpaof6A8cmhU7nmT4AAICMbcJL2zNr9VqGiAAAgEZVFWPMeaPxuW2BSCsEAAD8OnRmj8Z7iGq5K8kMEQAA0Go6hFbtecMMEQAAcP/lLe/vqK8hGmOKV2OEjggAAOhUVRGVU95orHX6HjXMQc1FRAAAQLOMQ964lzNEMdaqF0oVEQAA0Cirxilm3PsZIgAAgHdB75Y5AACADWyVN9oCUeb6JJ9wBAAA9MmIiOzfZ913ZG5ObFUVyiIAAKDTsrFgaor6AkdfIMqIiJo3PkhEAABAt2q/87R5higjQkMEAAD0WueNzv6lecvc9M36T/YBAAAP2xyGmjU2RPt+aLpBFgAAoEstLxXZWMG0BaIhp6+YkTGmRAQAADTKisyszjAU0RiIxvUMUddDAQAAYjqRNk7vonNIpy0QRUZEzgNOEhEAANApI2JYFir0BY6+GaLlh0AEAAB0q/nq096CqHfLXO5/AAAA9FryRmfkaN0yF7E0RWPXYwEAAKJqjKih/TBaW0OU114BAAC6deeNxobokNVSKgIAAJqtM0eX1hkiAACALWTGJsfRNglEWyQ3AADg4aqqTbZZ926Zc1QOAADYyJI3OnNH38WsUYdNcxoiAACg0dQQ1fy+77kbzRCpigAAgE7bZIz2e4he/gAAAHA3U0PUH4psmQMAAO69rc6g9c0QjfN5vrYHAgAATCoqcqyo6A1HvQ3RMH+5IeUiAACgzzDUPm80apwhqogxIiqiRksVAACAPjUuK617n9t3ZC5z6pvGiHRwDgAA6DbkVMI0nnPra4iiIsaMqSLqeioAAEBMGWNc544erTNEh2ZIIgIAADpVLDmj80Ra35G5qqjIKbHJQwAAQKPajxD17plrvoeopq9mpwIAANBuzhv3sSEqrRAAALCR2v/o1bhlbo5r09E+HREAANBmuu+0/cTcBg1RSUMAAEC3iqqcg0df4mgLRJkVmdtVWQAAwMM25FwQ5T2cIYpYbX4QiAAAgEZ12Lrdmjeat8xNHJkDAADeBdtsmVMRAQAAjaoqovqrl00aIhURAADQaauI0dgQHbZua4gAAIBOtdzyU73hqK0hyvlHHj4BAAA0WSWNe3kP0RhTvBpjvi0JAACgx36GaMkdTbbZMqcgAgAAOm2UMfoaomFuheaWCAAAoE2NUTm0Vzqtj1MMAQAA2xg2yRu9M0QRpocAAIB2VWPEOETFfd4yt391Zg4AAOjX3RK13kMUh5uIAAAA2tTVH216R5JSGAIAAPpN9w/V6kOP5oYoIppvjgUAAIia7zutaC2J2gJRXolBmiIAAKDXPnM0NjCNR+Zqn9pKIgIAABodCqLetNHWEE0prnJqwQAADP9JREFUraa1CuIQAADQLWsuh/oCxyZb5uQhAACg09Wt1n1n5nq3zM1RyFIFAACgX117vbvGhqjrSQAAAC/bInM0zhBlZc5fskpJBAAAtMohq5qv+WlviOZA1PVYAACAaYaosj1qtM0QqYQAAIBfi8bw0dcQxbiacdIQAQAAfaaGaJzf9z23ecvcLPVFAABAn9woYzQ2ROsPGiIAAKDPtE2hPxRt1BBt8lQAAIBWfWu3x6kV0g0BAADdKiJyrOm18bntDZFyCAAA2Ep33mi/hyhCSwQAAPSq6u6GJr0NUS4PFYkAAIA+uf/Rq2+GKGqqhkpDBAAANKv5R3NR1NoQbZXaAAAAtsgbjTNE6y1zUhEAANBnKoj6t8z1HZnb6OZYAACAiNgkc/QFoqqoyDBBBAAAdBujYqgpb1RjR9R8D5EwBAAA9JuCy5I3+nJH8wzRktgAAAD6jFWRG5xI0xABAADviP680RaI5iVzUVX79wAAAB3WeaNTX0OUL70BAABo1ps3GrfMTQVWVUWks3MAAECnqqpc7S7o0XgP0Xwlq83bAADAFrLmq4ju5Za5ricBAABcV1HVP57TvGUOAABgC9vsKmhsiHLfEVWMNisAAABtpnuIhvZzaZs0RGonAACg01YZo3HLXO3vjR3bHgoAABAxVsSQ052nncfR2oJWzj8yIgYH5gAAgE65emnMG30zROv3Ns4BAACNqiI2WDK31VE8iQgAAOiTG2WMxoZo3OcgcQgAAOg0nUKbtxU0Bg4L4QAAgHfCFqsK2hqiUS0EAABspCricoPntjZE6iYAAGATecgbnbmj9R4i9w8BAABbqFXe6MwdSh0AAODB6tsyt758KN3MCgAA9KoNLjztOzKXOa19sFwBAADYwpDteaO5IcplQTgAAECbK3mj8URa3wxRzrfHZmyzIBwAAHjQlryRjTVRe0O0xbk+AADgYVvnjWpsiPpmiCIiloYIAACg3T1uiKLsUwAAALZRURGV8/s+bYFIMQQAAGxl2ChxNM4QdT0JAADgqv2WuWZ9W+bWUjwCAAAadQ4OrfQ1RMtChQrDRAAAQKvp+qFqP5nW2hCZIwIAALbWuHW7c4Yoa3qN2K9/AAAAaDDljJxGiRpbom1miJyZAwAAWq0yxn1siCL6z/MBAABExHzv6RQ4OnPHRg0RAABAo42GctxDBAAA3Htb5Q0NEQAA8GD13kO0+gQAANClovbXnnZyDxEAAPBO6cwdjTNE4/QaEaIRAADQaZohGtsbosa12+uyyZE5AACgW/8KhL4n1pzWaoy0cg4AAGiUVfu8UTG2PbetIZoOyfV9MQAAgLXcIG80zhBVROR0uE9BBAAANKqxIoZsv5Co+RBebfJUAACALZqXxnuIVj9GW+YAAIA+FRVR801E1Zc3+rbMZcwXJaWt2wAAQK8hD3mjUfsMUTUnNgAAgBorIue80RiKtpkhslUBAABoN+WMbMwbfUfm1svl5CEAAKBTbVO/2AcHAAA8WI0zRDe/BwAAuKuxttndpiECAAAerN4tc8ta8K6HAgAAxNW80VkVvVVDdHT0uHa7R3IPAADwd263e1RHR4/fKp+0NERP/uHff2+MfJHz8yplJQAAoE9lVMQUNCriIoenFXF85+e+fkP04cu/yt1nFRHx9Gf/+1nG+NmVP0uXswIAAHe3ZIslYWQdsseSSa748PWf/cZH5o6Pj2+sf4Zx/Muomm6OvXXNnOoIAAB4lZszQ0VFzXljGMe/vOnv3JZVXuWNA9GPr33O4agiIi7y4n9FHFLboCECAAAaDJmHdihW2WPOIovrWeW1nn3H77Z3fnr6FxXxeVREjNPvHJsDAADuYp8pxlg2Wn9+fnr6F13PbwlEOezqbz/+8x/l5Ys/vvLwzBtCkWNzAADATa5mhcx86eRZXr7447/9+M9/lMOuJVe8QSD6YP9/eHT0SQ3DcQ0/P6phN9VUmbt68eUXfzjG+JOIqKoxqioybmqKhCIAAGDt5TCUMd0/VDVGRNQY409efPnFH2ZOYWjYHU2ZZDiuo6NPVv/+g9fOG68ZiH44PfDJkxsfnMOucnhaX/7sT//s8uLsB1VxeeXP46a2SCgCAAAi1tlgaYWuVypVMV5enP3gy5/96Z/l8LRubYj2meWHr5U3bruH6Pb7X09OKs7PM2K6AGncfVbx4iQiIk6f7Wr8+I9+8M1/+q++GXn8byLGo+uPufZp9SXLwBEAADwYtxQkVXH1Dyoi8mKs5//u6cd/9INnZ49q2M1P2H1Wu93J4a+fnLwqBN34Z292MeuHEfE70zq7i4vHdT4HoxyOKofLynFXw3BZX3z0B//2/X/yL3+5O37vX2flP3q9h2uMAACAqyrrJ5fnZ//h2f/5z/9xt3tUmbuaTqgdrUZ6Htd+5faHb/b81zky91JQ+XG8PEe0HJvLZ7vK3NXTj//r742nv/jdunj++2PW5zXfTVRz4vPZZ5999tlnn3322Weffb7t8xjj53Xx/PfH01/87tOP/+T3MndT1piPy12fH7pl5Xbd/OuD3Sv+LK++/3FE/IuIf3YR8exZfvvyMiO+HVUXOb53mjWeZNSYz+s4Hx+PWfE8f/X5//3p2c8/+pPj49/6n7WLn2bEWWW+l5GPo3HlNwAA8M67qBh/nuPFjy4vz/6gnn7+77/4q//yn85/+TefDLtf1W53VE8vHtWwu6xhd1zDoy/q6PxxPXr0Xg3DL+MXu13Et79d8Vcf1OvOD0W86ZG5xclJfRQR//gicmqJXlT91lHVeFE5PK3TZyf1/slYw+75OF4+Hn750//232Mc/0edjFnjN/Ibv/n3fuPss7/5cnlc1Wh+CAAAHpjMYR9cTr71D9771Rf/72kOv6o8GyqGoTKHGnbPx8xdnT7b1bB7WjkcH9qhR9MxuY+Oj+sr5odu9apAVHFoiQ7vP/yg4nsRcXaW02q7345xPK9x91nl5ZMajmKMOItnZyfx/kkMw+75WONJjnEx5FlExnk9P/3r0xy+sQ9BKRABAMDDswpEz0//+nR4PlTEEDEMNQxHYw5nlbmrZ2ePxmF3Ng5Hx2MOR7UsUzg6ejyv2z6etst9eGXd9m3vr3jDhuiHFfH9Kbzc0BLFd07Hy/MnQw6XNcTZ+OzsJJ68P+SY5xlxHJVz8Hk+Zo7n+xB0pSF6782+EQAA8A758vB23RDFcFS5mz5PzdD5OAyP5mbobFwWKeyOT8dXt0Ovf1wu4qsD0atboog4Op9aoogYX/z82RDfOR0jnkSNFxlxFk+//I18Upc5vH9R4zhm1eU0bzQcgtB04dISlt7k6wMAAO+UZWX2Kgwt75dGaBiGymeP6jSnY3JLM7SEoUeP3h/37dDJb9bbtkMRt901dPvfmd9/PyM+zfid04yzs/zu+XleXPx2np+fDpeXL3L8zkVenj8ZarzIGi/n/03BqN6/zHEcV+3Q5ZXvUOOJ43MAAPA1lcPZlYCSebhgdQpCuzrNwza5683Qbveojo+fjEdHn9S+HfrRk4q4skyhNRBd/3uHUPS9TzNOr4aii4vn+eLFs2H8zkXW5bdyvLzI68Eo4hCEvvkkosZLIQgAAB6YHHb1y9P5/RyMrgehYTfNDF1vhvZhaN8OvXkYinjbLXOL1dG5jyLiu/FJLMfnxs/P8/LyNPNaMIo43wegGi/z6ZdXH7kEJgAA4Osnh6dXQsqwm4LR9Ge7ijiO60Fotzup4dFx3R6G7vB93vLvro7ORdzUFEVEXFw8z3E8z+UYXUREXX4rIyLGy4vDsbnxQggCAIAHJoejw3G53fQ+d59VRMRyPG66ePVxRUTcHoberh2KePtAtPp8LRRFxG3BKCLi8vLFFIjGi4wPrj5wCUsAAMDX1xJ69j6NGOZwtNs9mgLRbUEoIl4jDN30+ebv8qbf/ebPcyiKTzO+F7G0RRER3z0/n0PRIRxFRIyrtdvXLaEJAAD4+ljCzk2G4XgOP4cQFDGv1Y6IQysUMS1QiLhrGIp480B0079Zfb65LYqI+OcRcX5+CEFLQLpuCUwAAMDXzxJ4Xv79J/vfHx8f14+XD69uhSLuEIYi3i4Q3fTvXg5FS1sUEftwFLEPSGvXwxIAAPD1diX0rK0vWX3yZHr/YcQNrVDEHcNQxNsHotv+7Q3BKCLi07k5mj+uAxIAAEDEtQAUcQhBEV8RhG773Ve6azC57d9f+/33b/h7n778u+/d8dsAAAD334c3/fKm9dk/fN0G6K1Xb3c1Na8ZjBY3BSQAAOBheykALdqD0KI7mLzqeUIQAADwul4Vdu4chBZbhRThBwAA6NYWhBZbBxfBCAAAuKv2ILT4dQcWAQkAAPgqmwUgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBN/H8et79FLJzjtwAAAABJRU5ErkJggg==",r=e?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAHGSURBVFiF7ZYxT9tAFMd/zzBmqjIQJR+AKYMv2YJUNpC6UJWhGx8Bhg79BIxlYERqtw5QqQtiaCWWIqEm56lqMzDbWYqolBHldSCRrOjO+AxM5D/a7+730/Pz2bDIIs894rthjDkGXgJb1tofVTbvdrsrk8lkH7iw1h65aqKC9T2grqpnxpheRfg5sAN88NUVCWwDYxGphUrk4KsAqvo+WGDa9s1QCQd8L0mSw2CBnEQXGIlIDfjW6XTeBMIPihjeIczHGLMKnAMrwK2IvB0MBicPhcM9HZjFWjsE1oERsKyqn/OdaLfbrRz8tiwcSnZgFlcnVPXX/LX57jyagEsCuAHqVeCVBBwSVIVDyRl4yiyFLnA8gmugBrxuNpt/0jT9HbJfUAdcQwisAVdM3444jneeRMB3Flhrh1EUrQFDYFlEPsZxvFt231KP4L6DKE3TcavV+qKqr4C6iGw0Go1/WZZdPlhgev6fTuFjVd221n6dr6sqUShgjOmp6pmIvADGwGaSJN999VUkvAI5eG0GL/Nj4pH4m2XZT1d90RAeh8Jn6ff7oyiK1rkbTERk31frFVDVC+4+PkFwh8Qn4F3o+kUWeT75D9neE4JyQKTaAAAAAElFTkSuQmCC":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAADJSURBVFiF7Za7DcIwFEUjpqBgAIbICJQMQEFBQcFGDAD7UDAARUoKihSHIkZ6QrEVv/iD0LtlPu8c2VGum8ZisXgCXIAOaGfMWAJnYK95+cGQp0bCwW+fGRqB1sGjJb7gAMdoAa3ECPykgouBa7EdL2BbDO6R6MckssGnSAArAe+Tw0MSU1Ynt0RXDO6RmAVfpJbLnqpbEPgI7+Larhhc3Kv3D8guwdAHshk3gWeT90C9MtLAAxLxdcwPHEiuTiLFkeygnWGx/H/e2lBveuPagG8AAAAASUVORK5CYII=",o=Bw("div",{class:["ePopup",i],style:{"background-image":`url(${n})`}},[Bw("div",{class:"ePopup-content"},[Bw("div",{class:"ePopup-content-title",style:{color:e?"#334766":"#FFFFFF"}},[Bw("div",{class:"ePopup-content-title--text"},this.popupOption.title),Bw("div",{class:[this.popupOption.isCloseButton?"ePopup-content-title--close":"",e?"ePopup-content-title--close-light":"ePopup-content-title--close-dark"],style:{"background-image":`url(${r})`},onClick:()=>this.destroy()})]),Bw("div",{class:"ePopup-content-main"},[Bw("div",{class:e?"ePopup-content-main-light":"ePopup-content-main-dark"},t)])])]),s=document.createElement("div"),a=lA({render:()=>o}).mount(s).$el;return super.setMaxWidth("500px"),a}destroy(){super.remove()}}function uA(t,e,i){const n=R(t),r=ue(k(e),n,{units:i&&i.units?i.units:"kilometers"}),o=i&&i.digit?i.digit:2;return{point:r.geometry.coordinates,distance:r.properties.dist?r.properties.dist.toFixed(o):"0"}}function hA(t,e,i){return _e(R(t),k(e),i)}function pA(t,e,i){return ut(R(t),O(e),i)}function dA(t,e,i){const n=i?i.type:"grid";let r={};if("grid"==n&&!gA(t)&&yA(t)){r=Qp(t,e,Object.assign({gridType:"points",property:"solRad"},i))}else"pointGrid"==n&&gA(t)?r=Se(t,e,i):"line"!=n||gA(t)||"Feature"!=t.type||(r=fA(t,e,i?i.units:"kilometers"));return r}const fA=(t,e,i)=>{const n={type:"Feature",geometry:{type:"LineString",coordinates:[]},properties:t.properties},r=ye(t)/e;for(let e=0;e<t.geometry.coordinates.length-1;e++){const o=R(t.geometry.coordinates[e]),s=R(t.geometry.coordinates[e+1]),a=pt(o,s,{units:i});if(0===e&&n.geometry.coordinates.push(t.geometry.coordinates[0]),a>r){const t=mA(o,s,a,r,i);n.geometry.coordinates=n.geometry.coordinates.concat(t)}else n.geometry.coordinates.push(t.geometry.coordinates[e+1])}return n},mA=(t,e,i,n,r)=>{const o=parseInt(String(i/n)),s=i-o*n,a=[],l=k([t.geometry.coordinates,e.geometry.coordinates]);for(let t=1;t<=o;t++){const e=ge(l,t*n,{units:r});a.push(e.geometry.coordinates)}return s>0&&a.push(e.geometry.coordinates),a},gA=t=>!!Array.isArray(t)&&(4===t.length&&t.every((t=>"number"==typeof t))||6===t.length&&t.every((t=>"number"==typeof t))),yA=t=>"FeatureCollection"==t.type?t.features.some((t=>"Point"===it(t.geometry))):"Feature"==t.type&&"Point"===it(t.geometry);class vA{cb;fu;constructor(t){this.cb=t,this.fu=t=>{const e=t.lngLat.lng+","+t.lngLat.lat;this.cb&&this.cb(e)},cNt.value.on("click",this.fu)}close(){cNt.value.off("click",this.fu)}}var _A={exports:{}};!function(t,e){t.exports=function(){var t,e,i;function n(n,r){if(t)if(e){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/api/#transpiling-v2'); }; var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk); self.onerror = null;",s={};t(s),i=r(s),"undefined"!=typeof window&&(i.workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"})))}else e=r;else t=r}n(["exports"],(function(t){var e="2.3.0",i=n;function n(t,e,i,n){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=i,this.p2y=n}n.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},n.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},n.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},n.prototype.solveCurveX=function(t,e){var i,n,r,o,s;for(void 0===e&&(e=1e-6),r=t,s=0;s<8;s++){if(o=this.sampleCurveX(r)-t,Math.abs(o)<e)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=o/a}if((r=t)<(i=0))return i;if(r>(n=1))return n;for(;i<n;){if(o=this.sampleCurveX(r),Math.abs(o-t)<e)return r;t>o?i=r:n=r,r=.5*(n-i)+i}return r},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var r=o;function o(t,e){this.x=t,this.y=e}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},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(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),i=Math.sin(t),n=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=n,this},_rotateAround:function(t,e){var i=Math.cos(t),n=Math.sin(t),r=e.y+n*(this.x-e.x)+i*(this.y-e.y);return this.x=e.x+i*(this.x-e.x)-n*(this.y-e.y),this.y=r,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(t){return t instanceof o?t:Array.isArray(t)?new o(t[0],t[1]):t};var s="undefined"!=typeof self?self:{};const a=Math.pow(2,53)-1,l=Math.PI/180,c=180/Math.PI;function u(t){return t*l}const h=[[0,0],[1,0],[1,1],[0,1]];function p(t){if(t<=0)return 0;if(t>=1)return 1;const e=t*t,i=e*t;return 4*(t<.5?i:3*(t-e)+i-.75)}function d(t,e,n,r){const o=new i(t,e,n,r);return function(t){return o.solve(t)}}const f=d(.25,.1,.25,1);function m(t,e,i){return Math.min(i,Math.max(e,t))}function g(t,e,i){const n=i-e,r=((t-e)%n+n)%n+e;return r===e?i:r}function y(t,e,i){if(!t.length)return i(null,[]);let n=t.length;const r=new Array(t.length);let o=null;t.forEach(((t,s)=>{e(t,((t,e)=>{t&&(o=t),r[s]=e,0==--n&&i(o,r)}))}))}function v(t){const e=[];for(const i in t)e.push(t[i]);return e}function _(t,...e){for(const i of e)for(const e in i)t[e]=i[e];return t}let x=1;function b(){return x++}function w(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function A(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function E(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function S(t,e){t.forEach((t=>{e[t]&&(e[t]=e[t].bind(e))}))}function M(t,e){return-1!==t.indexOf(e,t.length-e.length)}function T(t,e,i){const n={};for(const r in t)n[r]=e.call(i||this,t[r],r,t);return n}function I(t,e,i){const n={};for(const r in t)e.call(i||this,t[r],r,t)&&(n[r]=t[r]);return n}function C(t){return Array.isArray(t)?t.map(C):"object"==typeof t&&t?T(t,C):t}const P={};function L(t){P[t]||("undefined"!=typeof console&&console.warn(t),P[t]=!0)}function D(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}function R(t){let e=0;for(let i,n,r=0,o=t.length,s=o-1;r<o;s=r++)i=t[r],n=t[s],e+=(n.x-i.x)*(i.y+n.y);return e}function O(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function k(t){const e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((t,i,n,r)=>{const o=n||r;return e[i]=!o||o.toLowerCase(),""})),e["max-age"]){const t=parseInt(e["max-age"],10);isNaN(t)?delete e["max-age"]:e["max-age"]=t}return e}let N,B,z,F=null;function V(t){if(null==F){const e=t.navigator?t.navigator.userAgent:null;F=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return F}function U(t){try{const e=s[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}const G={now:()=>void 0!==z?z:s.performance.now(),setNow(t){z=t},restoreNow(){z=void 0},frame(t){const e=s.requestAnimationFrame(t);return{cancel:()=>s.cancelAnimationFrame(e)}},getImageData(t,e=0){const i=s.document.createElement("canvas"),n=i.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return i.width=t.width,i.height=t.height,n.drawImage(t,0,0,t.width,t.height),n.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:t=>(N||(N=s.document.createElement("a")),N.href=t,N.href),get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return!!s.matchMedia&&(null==B&&(B=s.matchMedia("(prefers-reduced-motion: reduce)")),B.matches)}};let j;const H={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(null==j){const t=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{j=null!=process.env.API_URL_REGEX?new RegExp(process.env.API_URL_REGEX):t}catch(e){j=t}}return j},get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},W={supported:!1,testSupport:function(t){!Z&&X&&(Y?Q(t):q=t)}};let q,X,Z=!1,Y=!1;function Q(t){const e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,X),t.isContextLost())return;W.supported=!0}catch(t){}t.deleteTexture(e),Z=!0}s.document&&(X=s.document.createElement("img"),X.onload=function(){q&&Q(q),q=null,Y=!0},X.onerror=function(){Z=!0,q=null},X.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const J="01",K="NO_ACCESS_TOKEN";function $(t){return 0===t.indexOf("mapbox:")}function tt(t){return H.API_URL_REGEX.test(t)}const et=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function it(t){const e=t.match(et);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function nt(t){const e=t.params.length?`?${t.params.join("&")}`:"";return`${t.protocol}://${t.authority}${t.path}${e}`}function rt(t){if(!t)return null;const e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(s.atob(e[1]).split("").map((t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2))).join("")))}catch(t){return null}}class ot{constructor(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(t){const e=rt(H.ACCESS_TOKEN);let i="";return i=e&&e.u?s.btoa(encodeURIComponent(e.u).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(Number("0x"+e))))):H.ACCESS_TOKEN||"",t?`mapbox.eventData.${t}:${i}`:`mapbox.eventData:${i}`}fetchEventData(){const t=U("localStorage"),e=this.getStorageKey(),i=this.getStorageKey("uuid");if(t)try{const t=s.localStorage.getItem(e);t&&(this.eventData=JSON.parse(t));const n=s.localStorage.getItem(i);n&&(this.anonId=n)}catch(t){L("Unable to read from LocalStorage")}}saveEventData(){const t=U("localStorage"),e=this.getStorageKey(),i=this.getStorageKey("uuid");if(t)try{s.localStorage.setItem(i,this.anonId),Object.keys(this.eventData).length>=1&&s.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){L("Unable to write to LocalStorage")}}processRequests(t){}postEvent(t,i,n,r){if(!H.EVENTS_URL)return;const o=it(H.EVENTS_URL);o.params.push(`access_token=${r||H.ACCESS_TOKEN||""}`);const s={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:e,skuId:J,userId:this.anonId},a=i?_(s,i):s,l={url:nt(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([a])};this.pendingRequest=Mt(l,(t=>{this.pendingRequest=null,n(t),this.saveEventData(),this.processRequests(r)}))}queueRequest(t,e){this.queue.push(t),this.processRequests(e)}}const st=new class extends ot{constructor(t){super("appUserTurnstile"),this._customAccessToken=t}postTurnstileEvent(t,e){H.EVENTS_URL&&H.ACCESS_TOKEN&&Array.isArray(t)&&t.some((t=>$(t)||tt(t)))&&this.queueRequest(Date.now(),e)}processRequests(t){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const e=rt(H.ACCESS_TOKEN),i=e?e.u:H.ACCESS_TOKEN;let n=i!==this.eventData.tokenU;E(this.anonId)||(this.anonId=w(),n=!0);const r=this.queue.shift();if(this.eventData.lastSuccess){const t=new Date(this.eventData.lastSuccess),e=new Date(r),i=(r-this.eventData.lastSuccess)/864e5;n=n||i>=1||i<-1||t.getDate()!==e.getDate()}else n=!0;if(!n)return this.processRequests();this.postEvent(r,{"enabled.telemetry":!1},(t=>{t||(this.eventData.lastSuccess=r,this.eventData.tokenU=i)}),t)}},at=st.postTurnstileEvent.bind(st),lt=new class extends ot{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(t,e,i,n){this.skuToken=e,this.errorCb=n,H.EVENTS_URL&&(i||H.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},i):this.errorCb(new Error(K)))}processRequests(t){if(this.pendingRequest||0===this.queue.length)return;const{id:e,timestamp:i}=this.queue.shift();e&&this.success[e]||(this.anonId||this.fetchEventData(),E(this.anonId)||(this.anonId=w()),this.postEvent(i,{skuToken:this.skuToken},(t=>{t?this.errorCb(t):e&&(this.success[e]=!0)}),t))}},ct=lt.postMapLoadEvent.bind(lt),ut=new class extends ot{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(t,e,i,n){if(!H.API_URL||!H.SESSION_PATH)return;const r=it(H.API_URL+H.SESSION_PATH);r.params.push(`sku=${e||""}`),r.params.push(`access_token=${n||H.ACCESS_TOKEN||""}`);const o={url:nt(r),headers:{"Content-Type":"text/plain"}};this.pendingRequest=Tt(o,(t=>{this.pendingRequest=null,i(t),this.saveEventData(),this.processRequests(n)}))}getSessionAPI(t,e,i,n){this.skuToken=e,this.errorCb=n,H.SESSION_PATH&&H.API_URL&&(i||H.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},i):this.errorCb(new Error(K)))}processRequests(t){if(this.pendingRequest||0===this.queue.length)return;const{id:e,timestamp:i}=this.queue.shift();e&&this.success[e]||this.getSession(i,this.skuToken,(t=>{t?this.errorCb(t):e&&(this.success[e]=!0)}),t)}},ht=ut.getSessionAPI.bind(ut),pt=new Set,dt="mapbox-tiles";let ft,mt,gt=500,yt=50;function vt(){s.caches&&!ft&&(ft=s.caches.open(dt))}function _t(t){const e=t.indexOf("?");return e<0?t:t.slice(0,e)}let xt=1/0;const bt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(bt);class wt extends Error{constructor(t,e,i){401===e&&tt(i)&&(t+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),super(t),this.status=e,this.url=i}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const At=O()?()=>self.worker&&self.worker.referrer:()=>("blob:"===s.location.protocol?s.parent:s).location.href,Et=function(t,e){if(!(/^file:/.test(i=t.url)||/^file:/.test(At())&&!/^\w+:/.test(i))){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return function(t,e){const i=new s.AbortController,n=new s.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:At(),signal:i.signal});let r=!1,o=!1;const a=(l=n.url).indexOf("sku=")>0&&tt(l);var l;"json"===t.type&&n.headers.set("Accept","application/json");const c=(i,r,l)=>{if(o)return;if(i&&"SecurityError"!==i.message&&L(i),r&&l)return u(r);const c=Date.now();s.fetch(n).then((i=>{if(i.ok){const t=a?i.clone():null;return u(i,t,c)}return e(new wt(i.statusText,i.status,t.url))})).catch((t=>{20!==t.code&&e(new Error(t.message))}))},u=(i,a,l)=>{("arrayBuffer"===t.type?i.arrayBuffer():"json"===t.type?i.json():i.text()).then((t=>{o||(a&&l&&function(t,e,i){if(vt(),!ft)return;const n={status:e.status,statusText:e.statusText,headers:new s.Headers};e.headers.forEach(((t,e)=>n.headers.set(e,t)));const r=k(e.headers.get("Cache-Control")||"");r["no-store"]||(r["max-age"]&&n.headers.set("Expires",new Date(i+1e3*r["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-i<42e4||function(t,e){if(void 0===mt)try{new Response(new ReadableStream),mt=!0}catch(t){mt=!1}mt?e(t.body):t.blob().then(e)}(e,(e=>{const i=new s.Response(e,n);vt(),ft&&ft.then((e=>e.put(_t(t.url),i))).catch((t=>L(t.message)))})))}(n,a,l),r=!0,e(null,t,i.headers.get("Cache-Control"),i.headers.get("Expires")))})).catch((t=>{o||e(new Error(t.message))}))};return a?function(t,e){if(vt(),!ft)return e(null);const i=_t(t.url);ft.then((t=>{t.match(i).then((n=>{const r=function(t){if(!t)return!1;const e=new Date(t.headers.get("Expires")||0),i=k(t.headers.get("Cache-Control")||"");return e>Date.now()&&!i["no-cache"]}(n);t.delete(i),r&&t.put(i,n.clone()),e(null,n,r)})).catch(e)})).catch(e)}(n,c):c(null,null),{cancel:()=>{o=!0,r||i.abort()}}}(t,e);if(O()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var i;return function(t,e){const i=new s.XMLHttpRequest;i.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(i.responseType="arraybuffer");for(const e in t.headers)i.setRequestHeader(e,t.headers[e]);return"json"===t.type&&(i.responseType="text",i.setRequestHeader("Accept","application/json")),i.withCredentials="include"===t.credentials,i.onerror=()=>{e(new Error(i.statusText))},i.onload=()=>{if((i.status>=200&&i.status<300||0===i.status)&&null!==i.response){let n=i.response;if("json"===t.type)try{n=JSON.parse(i.response)}catch(t){return e(t)}e(null,n,i.getResponseHeader("Cache-Control"),i.getResponseHeader("Expires"))}else e(new wt(i.statusText,i.status,t.url))},i.send(t.body),{cancel:()=>i.abort()}}(t,e)},St=function(t,e){return Et(_(t,{type:"arrayBuffer"}),e)},Mt=function(t,e){return Et(_(t,{method:"POST"}),e)},Tt=function(t,e){return Et(_(t,{method:"GET"}),e)};function It(t){const e=s.document.createElement("a");return e.href=t,e.protocol===s.document.location.protocol&&e.host===s.document.location.host}const Ct="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let Pt,Lt;Pt=[],Lt=0;const Dt=function(t,e){if(W.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),Lt>=H.MAX_PARALLEL_IMAGE_REQUESTS){const i={requestParameters:t,callback:e,cancelled:!1,cancel(){this.cancelled=!0}};return Pt.push(i),i}Lt++;let i=!1;const n=()=>{if(!i)for(i=!0,Lt--;Pt.length&&Lt<H.MAX_PARALLEL_IMAGE_REQUESTS;){const t=Pt.shift(),{requestParameters:e,callback:i,cancelled:n}=t;n||(t.cancel=Dt(e,i).cancel)}},r=St(t,((t,i,r,o)=>{n(),t?e(t):i&&(s.createImageBitmap?function(t,e){const i=new s.Blob([new Uint8Array(t)],{type:"image/png"});s.createImageBitmap(i).then((t=>{e(null,t)})).catch((t=>{e(new Error(`Could not load image because of ${t.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))}))}(i,((t,i)=>e(t,i,r,o))):function(t,e){const i=new s.Image,n=s.URL;i.onload=()=>{e(null,i),n.revokeObjectURL(i.src),i.onload=null,s.requestAnimationFrame((()=>{i.src=Ct}))},i.onerror=()=>e(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 r=new s.Blob([new Uint8Array(t)],{type:"image/png"});i.src=t.byteLength?n.createObjectURL(r):Ct}(i,((t,i)=>e(t,i,r,o))))}));return{cancel:()=>{r.cancel(),n()}}};function Rt(t,e,i){i[t]&&-1!==i[t].indexOf(e)||(i[t]=i[t]||[],i[t].push(e))}function Ot(t,e,i){if(i&&i[t]){const n=i[t].indexOf(e);-1!==n&&i[t].splice(n,1)}}class kt{constructor(t,e={}){_(this,e),this.type=t}}class Nt extends kt{constructor(t,e={}){super("error",_({error:t},e))}}class Bt{on(t,e){return this._listeners=this._listeners||{},Rt(t,e,this._listeners),this}off(t,e){return Ot(t,e,this._listeners),Ot(t,e,this._oneTimeListeners),this}once(t,e){return e?(this._oneTimeListeners=this._oneTimeListeners||{},Rt(t,e,this._oneTimeListeners),this):new Promise((e=>this.once(t,e)))}fire(t,e){"string"==typeof t&&(t=new kt(t,e||{}));const i=t.type;if(this.listens(i)){t.target=this;const e=this._listeners&&this._listeners[i]?this._listeners[i].slice():[];for(const i of e)i.call(this,t);const n=this._oneTimeListeners&&this._oneTimeListeners[i]?this._oneTimeListeners[i].slice():[];for(const e of n)Ot(i,e,this._oneTimeListeners),e.call(this,t);const r=this._eventedParent;r&&(_(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),r.fire(t))}else t instanceof Nt&&console.error(t.error);return this}listens(t){return!!(this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t))}setEventedParent(t,e){return this._eventedParent=t,this._eventedParentData=e,this}}var zt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},fog:{type:"fog"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},zoomOffset:{type:"number",default:0},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},zoomOffset:{type:"number",default:0},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},zoomOffset:{type:"number",default:0},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{},sky:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_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:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},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:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-blend":{type:"number","property-type":"data-constant",default:.1,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{},atmosphere:{}},default:"atmosphere",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,"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:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],transition:!1,requires:[{"sky-type":"gradient"}],expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};class Ft{constructor(t,e,i,n){this.message=(t?`${t}: `:"")+i,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)}}function Vt(t){const e=t.value;return e?[new Ft(t.key,e,"constants have been deprecated as of v8")]:[]}function Ut(t,...e){for(const i of e)for(const e in i)t[e]=i[e];return t}function Gt(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function jt(t){if(Array.isArray(t))return t.map(jt);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const i in t)e[i]=jt(t[i]);return e}return Gt(t)}class Ht extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}class Wt{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[t,i]of e)this.bindings[t]=i}concat(t){return new Wt(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const qt={kind:"null"},Xt={kind:"number"},Zt={kind:"string"},Yt={kind:"boolean"},Qt={kind:"color"},Jt={kind:"object"},Kt={kind:"value"},$t={kind:"collator"},te={kind:"formatted"},ee={kind:"resolvedImage"};function ie(t,e){return{kind:"array",itemType:t,N:e}}function ne(t){if("array"===t.kind){const e=ne(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const re=[qt,Xt,Zt,Yt,Qt,te,Jt,ie(Kt),ee];function oe(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!oe(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(const t of re)if(!oe(t,e))return null}return`Expected ${ne(t)} but found ${ne(e)} instead.`}function se(t,e){return e.some((e=>e.kind===t.kind))}function ae(t,e){return e.some((e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t))}function le(t){var e={exports:{}};return t(e,e.exports),e.exports}var ce=le((function(t,e){var i={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function n(t){return(t=Math.round(t))<0?0:t>255?255:t}function r(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function s(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{e.parseCSSColor=function(t){var e,a=t.replace(/ /g,"").toLowerCase();if(a in i)return i[a].slice();if("#"===a[0])return 4===a.length?(e=parseInt(a.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===a.length&&(e=parseInt(a.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=a.indexOf("("),c=a.indexOf(")");if(-1!==l&&c+1===a.length){var u=a.substr(0,l),h=a.substr(l+1,c-(l+1)).split(","),p=1;switch(u){case"rgba":if(4!==h.length)return null;p=o(h.pop());case"rgb":return 3!==h.length?null:[r(h[0]),r(h[1]),r(h[2]),p];case"hsla":if(4!==h.length)return null;p=o(h.pop());case"hsl":if(3!==h.length)return null;var d=(parseFloat(h[0])%360+360)%360/360,f=o(h[1]),m=o(h[2]),g=m<=.5?m*(f+1):m+f-m*f,y=2*m-g;return[n(255*s(y,g,d+1/3)),n(255*s(y,g,d)),n(255*s(y,g,d-1/3)),p];default:return null}}return null}}catch(t){}}));class ue{constructor(t,e,i,n=1){this.r=t,this.g=e,this.b=i,this.a=n}static parse(t){if(!t)return;if(t instanceof ue)return t;if("string"!=typeof t)return;const e=ce.parseCSSColor(t);return e?new ue(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3]):void 0}toString(){const[t,e,i,n]=this.toArray();return`rgba(${Math.round(t)},${Math.round(e)},${Math.round(i)},${n})`}toArray(){const{r:t,g:e,b:i,a:n}=this;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*i/n,n]}}ue.black=new ue(0,0,0,1),ue.white=new ue(1,1,1,1),ue.transparent=new ue(0,0,0,0),ue.red=new ue(1,0,0,1),ue.blue=new ue(0,0,1,1);class he{constructor(t,e,i){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class pe{constructor(t,e,i,n,r){this.text=t,this.image=e,this.scale=i,this.fontStack=n,this.textColor=r}}class de{constructor(t){this.sections=t}static fromString(t){return new de([new pe(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((t=>0!==t.text.length||t.image&&0!==t.image.name.length))}static factory(t){return t instanceof de?t:de.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map((t=>t.text)).join("")}serialize(){const t=["format"];for(const e of this.sections){if(e.image){t.push(["image",e.image.name]);continue}t.push(e.text);const i={};e.fontStack&&(i["text-font"]=["literal",e.fontStack.split(",")]),e.scale&&(i["font-scale"]=e.scale),e.textColor&&(i["text-color"]=["rgba"].concat(e.textColor.toArray())),t.push(i)}return t}}class fe{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new fe({name:t,available:!1}):null}serialize(){return["image",this.name]}}function me(t,e,i,n){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,i,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[t,e,i,n]:[t,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ge(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof ue)return!0;if(t instanceof he)return!0;if(t instanceof de)return!0;if(t instanceof fe)return!0;if(Array.isArray(t)){for(const e of t)if(!ge(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!ge(t[e]))return!1;return!0}return!1}function ye(t){if(null===t)return qt;if("string"==typeof t)return Zt;if("boolean"==typeof t)return Yt;if("number"==typeof t)return Xt;if(t instanceof ue)return Qt;if(t instanceof he)return $t;if(t instanceof de)return te;if(t instanceof fe)return ee;if(Array.isArray(t)){const e=t.length;let i;for(const e of t){const t=ye(e);if(i){if(i===t)continue;i=Kt;break}i=t}return ie(i||Kt,e)}return Jt}function ve(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof ue||t instanceof de||t instanceof fe?t.toString():JSON.stringify(t)}class _e{constructor(t,e){this.type=t,this.value=e}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!ge(t[1]))return e.error("invalid value");const i=t[1];let n=ye(i);const r=e.expectedType;return"array"!==n.kind||0!==n.N||!r||"array"!==r.kind||"number"==typeof r.N&&0!==r.N||(n=r),new _e(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof ue?["rgba"].concat(this.value.toArray()):this.value instanceof de?this.value.serialize():this.value}}class xe{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const be={string:Zt,number:Xt,boolean:Yt,object:Jt};class we{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let i,n=1;const r=t[0];if("array"===r){let r,o;if(t.length>2){const i=t[1];if("string"!=typeof i||!(i in be)||"object"===i)return e.error('The item type argument of "array" must be one of string, number, boolean',1);r=be[i],n++}else r=Kt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],n++}i=ie(r,o)}else i=be[r];const o=[];for(;n<t.length;n++){const i=e.parse(t[n],n,Kt);if(!i)return null;o.push(i)}return new we(i,o)}evaluate(t){for(let e=0;e<this.args.length;e++){const i=this.args[e].evaluate(t);if(!oe(this.type,ye(i)))return i;if(e===this.args.length-1)throw new xe(`Expected value to be of type ${ne(this.type)}, but found ${ne(ye(i))} instead.`)}return null}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=this.type,e=[t.kind];if("array"===t.kind){const i=t.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){e.push(i.kind);const n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n)}}return e.concat(this.args.map((t=>t.serialize())))}}class Ae{constructor(t){this.type=te,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return e.error("First argument must be an image or text section.");const n=[];let r=!1;for(let i=1;i<=t.length-1;++i){const o=t[i];if(r&&"object"==typeof o&&!Array.isArray(o)){r=!1;let t=null;if(o["font-scale"]&&(t=e.parse(o["font-scale"],1,Xt),!t))return null;let i=null;if(o["text-font"]&&(i=e.parse(o["text-font"],1,ie(Zt)),!i))return null;let s=null;if(o["text-color"]&&(s=e.parse(o["text-color"],1,Qt),!s))return null;const a=n[n.length-1];a.scale=t,a.font=i,a.textColor=s}else{const o=e.parse(t[i],1,Kt);if(!o)return null;const s=o.type.kind;if("string"!==s&&"value"!==s&&"null"!==s&&"resolvedImage"!==s)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");r=!0,n.push({content:o,scale:null,font:null,textColor:null})}}return new Ae(n)}evaluate(t){return new de(this.sections.map((e=>{const i=e.content.evaluate(t);return ye(i)===ee?new pe("",i,null,null,null):new pe(ve(i),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))}eachChild(t){for(const e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor)}outputDefined(){return!1}serialize(){const t=["format"];for(const e of this.sections){t.push(e.content.serialize());const i={};e.scale&&(i["font-scale"]=e.scale.serialize()),e.font&&(i["text-font"]=e.font.serialize()),e.textColor&&(i["text-color"]=e.textColor.serialize()),t.push(i)}return t}}class Ee{constructor(t){this.type=ee,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,Zt);return i?new Ee(i):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),i=fe.fromString(e);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(e)>-1),i}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const Se={"to-boolean":Yt,"to-color":Qt,"to-number":Xt,"to-string":Zt};class Me{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[0];if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return e.error("Expected one argument.");const n=Se[i],r=[];for(let i=1;i<t.length;i++){const n=e.parse(t[i],i,Kt);if(!n)return null;r.push(n)}return new Me(n,r)}evaluate(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){let e,i;for(const n of this.args){if(e=n.evaluate(t),i=null,e instanceof ue)return e;if("string"==typeof e){const i=t.parseColor(e);if(i)return i}else if(Array.isArray(e)&&(i=e.length<3||e.length>4?`Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:me(e[0],e[1],e[2],e[3]),!i))return new ue(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new xe(i||`Could not parse color from value '${"string"==typeof e?e:String(JSON.stringify(e))}'`)}if("number"===this.type.kind){let e=null;for(const i of this.args){if(e=i.evaluate(t),null===e)return 0;const n=Number(e);if(!isNaN(n))return n}throw new xe(`Could not convert ${JSON.stringify(e)} to number.`)}return"formatted"===this.type.kind?de.fromString(ve(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?fe.fromString(ve(this.args[0].evaluate(t))):ve(this.args[0].evaluate(t))}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new Ae([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Ee(this.args[0]).serialize();const t=[`to-${this.type.kind}`];return this.eachChild((e=>{t.push(e.serialize())})),t}}const Te=["Unknown","Point","LineString","Polygon"];class Ie{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?Te[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=ue.parse(t)),e}}class Ce{constructor(t,e,i,n){this.name=t,this.type=e,this._evaluate=i,this.args=n}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map((t=>t.serialize())))}static parse(t,e){const i=t[0],n=Ce.definitions[i];if(!n)return e.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const r=Array.isArray(n)?n[0]:n.type,o=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=o.filter((([e])=>!Array.isArray(e)||e.length===t.length-1));let a=null;for(const[n,o]of s){a=new Ke(e.registry,e.path,null,e.scope);const s=[];let l=!1;for(let e=1;e<t.length;e++){const i=t[e],r=Array.isArray(n)?n[e-1]:n.type,o=a.parse(i,1+s.length,r);if(!o){l=!0;break}s.push(o)}if(!l)if(Array.isArray(n)&&n.length!==s.length)a.error(`Expected ${n.length} arguments, but found ${s.length} instead.`);else{for(let t=0;t<s.length;t++){const e=Array.isArray(n)?n[t]:n.type,i=s[t];a.concat(t+1).checkSubtype(e,i.type)}if(0===a.errors.length)return new Ce(i,r,o,s)}}if(1===s.length)e.errors.push(...a.errors);else{const i=(s.length?s:o).map((([t])=>{return e=t,Array.isArray(e)?`(${e.map(ne).join(", ")})`:`(${ne(e.type)}...)`;var e})).join(" | "),n=[];for(let i=1;i<t.length;i++){const r=e.parse(t[i],1+n.length);if(!r)return null;n.push(ne(r.type))}e.error(`Expected arguments of type ${i}, but found (${n.join(", ")}) instead.`)}return null}static register(t,e){Ce.definitions=e;for(const i in e)t[i]=Ce}}class Pe{constructor(t,e,i){this.type=$t,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=e}static parse(t,e){if(2!==t.length)return e.error("Expected one argument.");const i=t[1];if("object"!=typeof i||Array.isArray(i))return e.error("Collator options argument must be an object.");const n=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,Yt);if(!n)return null;const r=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,Yt);if(!r)return null;let o=null;return i.locale&&(o=e.parse(i.locale,1,Zt),!o)?null:new Pe(n,r,o)}evaluate(t){return new he(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}serialize(){const t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]}}const Le=8192;function De(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function Re(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Oe(t,e){const i=(180+t[0])/360,n=(90-t[1])/360,r=Math.pow(2,e.z);return[Math.round(i*r*Le),Math.round(n*r*Le)]}function ke(t,e,i){const n=t[0]-e[0],r=t[1]-e[1],o=t[0]-i[0],s=t[1]-i[1];return n*s-o*r==0&&n*o<=0&&r*s<=0}function Ne(t,e){let i=!1;for(let s=0,a=e.length;s<a;s++){const a=e[s];for(let e=0,s=a.length;e<s-1;e++){if(ke(t,a[e],a[e+1]))return!1;(r=a[e])[1]>(n=t)[1]!=(o=a[e+1])[1]>n[1]&&n[0]<(o[0]-r[0])*(n[1]-r[1])/(o[1]-r[1])+r[0]&&(i=!i)}}var n,r,o;return i}function Be(t,e){for(let i=0;i<e.length;i++)if(Ne(t,e[i]))return!0;return!1}function ze(t,e,i,n){const r=n[0]-i[0],o=n[1]-i[1],s=(t[0]-i[0])*o-r*(t[1]-i[1]),a=(e[0]-i[0])*o-r*(e[1]-i[1]);return s>0&&a<0||s<0&&a>0}function Fe(t,e,i){for(const c of i)for(let i=0;i<c.length-1;++i)if(0!=(a=[(s=c[i+1])[0]-(o=c[i])[0],s[1]-o[1]])[0]*(l=[(r=e)[0]-(n=t)[0],r[1]-n[1]])[1]-a[1]*l[0]&&ze(n,r,o,s)&&ze(o,s,n,r))return!0;var n,r,o,s,a,l;return!1}function Ve(t,e){for(let i=0;i<t.length;++i)if(!Ne(t[i],e))return!1;for(let i=0;i<t.length-1;++i)if(Fe(t[i],t[i+1],e))return!1;return!0}function Ue(t,e){for(let i=0;i<e.length;i++)if(Ve(t,e[i]))return!0;return!1}function Ge(t,e,i){const n=[];for(let r=0;r<t.length;r++){const o=[];for(let n=0;n<t[r].length;n++){const s=Oe(t[r][n],i);De(e,s),o.push(s)}n.push(o)}return n}function je(t,e,i){const n=[];for(let r=0;r<t.length;r++){const o=Ge(t[r],e,i);n.push(o)}return n}function He(t,e,i,n){if(t[0]<i[0]||t[0]>i[2]){const e=.5*n;let r=t[0]-i[0]>e?-n:i[0]-t[0]>e?n:0;0===r&&(r=t[0]-i[2]>e?-n:i[2]-t[0]>e?n:0),t[0]+=r}De(e,t)}function We(t,e,i,n){const r=Math.pow(2,n.z)*Le,o=[n.x*Le,n.y*Le],s=[];for(const n of t)for(const t of n){const n=[t.x+o[0],t.y+o[1]];He(n,e,i,r),s.push(n)}return s}function qe(t,e,i,n){const r=Math.pow(2,n.z)*Le,o=[n.x*Le,n.y*Le],s=[];for(const i of t){const t=[];for(const n of i){const i=[n.x+o[0],n.y+o[1]];De(e,i),t.push(i)}s.push(t)}if(e[2]-e[0]<=r/2){(a=e)[0]=a[1]=1/0,a[2]=a[3]=-1/0;for(const t of s)for(const n of t)He(n,e,i,r)}var a;return s}class Xe{constructor(t,e){this.type=Yt,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(ge(t[1])){const e=t[1];if("FeatureCollection"===e.type)for(let t=0;t<e.features.length;++t){const i=e.features[t].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new Xe(e,e.features[t].geometry)}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new Xe(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new Xe(e,e)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if("Polygon"===e.type){const o=Ge(e.coordinates,n,r),s=We(t.geometry(),i,n,r);if(!Re(i,n))return!1;for(const t of s)if(!Ne(t,o))return!1}if("MultiPolygon"===e.type){const o=je(e.coordinates,n,r),s=We(t.geometry(),i,n,r);if(!Re(i,n))return!1;for(const t of s)if(!Be(t,o))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if("Polygon"===e.type){const o=Ge(e.coordinates,n,r),s=qe(t.geometry(),i,n,r);if(!Re(i,n))return!1;for(const t of s)if(!Ve(t,o))return!1}if("MultiPolygon"===e.type){const o=je(e.coordinates,n,r),s=qe(t.geometry(),i,n,r);if(!Re(i,n))return!1;for(const t of s)if(!Ue(t,o))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}function Ze(t){if(t instanceof Ce){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof Xe)return!1;let e=!0;return t.eachChild((t=>{e&&!Ze(t)&&(e=!1)})),e}function Ye(t){if(t instanceof Ce&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild((t=>{e&&!Ye(t)&&(e=!1)})),e}function Qe(t,e){if(t instanceof Ce&&e.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild((t=>{i&&!Qe(t,e)&&(i=!1)})),i}class Je{constructor(t,e){this.type=e.type,this.name=t,this.boundExpression=e}static parse(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");const i=t[1];return e.scope.has(i)?new Je(i,e.scope.get(i)):e.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class Ke{constructor(t,e=[],i,n=new Wt,r=[]){this.registry=t,this.path=e,this.key=e.map((t=>`[${t}]`)).join(""),this.scope=n,this.errors=r,this.expectedType=i}parse(t,e,i,n,r={}){return e?this.concat(e,i,n)._parse(t,r):this._parse(t,r)}_parse(t,e){function i(t,e,i){return"assert"===i?new we(e,[t]):"coerce"===i?new Me(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const n=t[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 r=this.registry[n];if(r){let n=r.parse(t,this);if(!n)return null;if(this.expectedType){const t=this.expectedType,r=n.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==r.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==r.kind&&"string"!==r.kind){if(this.checkSubtype(t,r))return null}else n=i(n,t,e.typeAnnotation||"coerce");else n=i(n,t,e.typeAnnotation||"assert")}if(!(n instanceof _e)&&"resolvedImage"!==n.type.kind&&$e(n)){const e=new Ie;try{n=new _e(n.type,n.evaluate(e))}catch(t){return this.error(t.message),null}}return n}return this.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,e,i){const n="number"==typeof t?this.path.concat(t):this.path,r=i?this.scope.concat(i):this.scope;return new Ke(this.registry,n,e||null,r,this.errors)}error(t,...e){const i=`${this.key}${e.map((t=>`[${t}]`)).join("")}`;this.errors.push(new Ht(i,t))}checkSubtype(t,e){const i=oe(t,e);return i&&this.error(i),i}}function $e(t){if(t instanceof Je)return $e(t.boundExpression);if(t instanceof Ce&&"error"===t.name)return!1;if(t instanceof Pe)return!1;if(t instanceof Xe)return!1;const e=t instanceof Me||t instanceof we;let i=!0;return t.eachChild((t=>{i=e?i&&$e(t):i&&t instanceof _e})),!!i&&Ze(t)&&Qe(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script"])}function ti(t,e){const i=t.length-1;let n,r,o=0,s=i,a=0;for(;o<=s;)if(a=Math.floor((o+s)/2),n=t[a],r=t[a+1],n<=e){if(a===i||e<r)return a;o=a+1}else{if(!(n>e))throw new xe("Input is not a number.");s=a-1}return 0}class ei{constructor(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[t,e]of i)this.labels.push(t),this.outputs.push(e)}static parse(t,e){if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");const i=e.parse(t[1],1,Xt);if(!i)return null;const n=[];let r=null;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(let i=1;i<t.length;i+=2){const o=1===i?-1/0:t[i],s=t[i+1],a=i,l=i+1;if("number"!=typeof o)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',a);if(n.length&&n[n.length-1][0]>=o)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',a);const c=e.parse(s,l,r);if(!c)return null;r=r||c.type,n.push([o,c])}return new ei(r,i,n)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);const r=e.length;return n>=e[r-1]?i[r-1].evaluate(t):i[ti(e,n)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){const t=["step",this.input.serialize()];for(let e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t}}function ii(t,e,i){return t*(1-i)+e*i}var ni=Object.freeze({__proto__:null,number:ii,color:function(t,e,i){return new ue(ii(t.r,e.r,i),ii(t.g,e.g,i),ii(t.b,e.b,i),ii(t.a,e.a,i))},array:function(t,e,i){return t.map(((t,n)=>ii(t,e[n],i)))}});const ri=.95047,oi=1.08883,si=4/29,ai=6/29,li=3*ai*ai,ci=Math.PI/180,ui=180/Math.PI;function hi(t){return t>.008856451679035631?Math.pow(t,1/3):t/li+si}function pi(t){return t>ai?t*t*t:li*(t-si)}function di(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function fi(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function mi(t){const e=fi(t.r),i=fi(t.g),n=fi(t.b),r=hi((.4124564*e+.3575761*i+.1804375*n)/ri),o=hi((.2126729*e+.7151522*i+.072175*n)/1);return{l:116*o-16,a:500*(r-o),b:200*(o-hi((.0193339*e+.119192*i+.9503041*n)/oi)),alpha:t.a}}function gi(t){let e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*pi(e),i=ri*pi(i),n=oi*pi(n),new ue(di(3.2404542*i-1.5371385*e-.4985314*n),di(-.969266*i+1.8760108*e+.041556*n),di(.0556434*i-.2040259*e+1.0572252*n),t.alpha)}function yi(t,e,i){const n=e-t;return t+i*(n>180||n<-180?n-360*Math.round(n/360):n)}const vi={forward:mi,reverse:gi,interpolate:function(t,e,i){return{l:ii(t.l,e.l,i),a:ii(t.a,e.a,i),b:ii(t.b,e.b,i),alpha:ii(t.alpha,e.alpha,i)}}},_i={forward:function(t){const{l:e,a:i,b:n}=mi(t),r=Math.atan2(n,i)*ui;return{h:r<0?r+360:r,c:Math.sqrt(i*i+n*n),l:e,alpha:t.a}},reverse:function(t){const e=t.h*ci,i=t.c;return gi({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:yi(t.h,e.h,i),c:ii(t.c,e.c,i),l:ii(t.l,e.l,i),alpha:ii(t.alpha,e.alpha,i)}}};var xi=Object.freeze({__proto__:null,lab:vi,hcl:_i});class bi{constructor(t,e,i,n,r){this.type=t,this.operator=e,this.interpolation=i,this.input=n,this.labels=[],this.outputs=[];for(const[t,e]of r)this.labels.push(t),this.outputs.push(e)}static interpolationFactor(t,e,n,r){let o=0;if("exponential"===t.name)o=wi(e,t.base,n,r);else if("linear"===t.name)o=wi(e,1,n,r);else if("cubic-bezier"===t.name){const s=t.controlPoints;o=new i(s[0],s[1],s[2],s[3]).solve(wi(e,1,n,r))}return o}static parse(t,e){let[i,n,r,...o]=t;if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const t=n[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:t}}else{if("cubic-bezier"!==n[0])return e.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const t=n.slice(1);if(4!==t.length||t.some((t=>"number"!=typeof t||t<0||t>1)))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(r=e.parse(r,2,Xt),!r)return null;const s=[];let a=null;"interpolate-hcl"===i||"interpolate-lab"===i?a=Qt:e.expectedType&&"value"!==e.expectedType.kind&&(a=e.expectedType);for(let t=0;t<o.length;t+=2){const i=o[t],n=o[t+1],r=t+3,l=t+4;if("number"!=typeof i)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',r);if(s.length&&s[s.length-1][0]>=i)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',r);const c=e.parse(n,l,a);if(!c)return null;a=a||c.type,s.push([i,c])}return"number"===a.kind||"color"===a.kind||"array"===a.kind&&"number"===a.itemType.kind&&"number"==typeof a.N?new bi(a,i,n,r,s):e.error(`Type ${ne(a)} is not interpolatable.`)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);const r=e.length;if(n>=e[r-1])return i[r-1].evaluate(t);const o=ti(e,n),s=bi.interpolationFactor(this.interpolation,n,e[o],e[o+1]),a=i[o].evaluate(t),l=i[o+1].evaluate(t);return"interpolate"===this.operator?ni[this.type.kind.toLowerCase()](a,l,s):"interpolate-hcl"===this.operator?_i.reverse(_i.interpolate(_i.forward(a),_i.forward(l),s)):vi.reverse(vi.interpolate(vi.forward(a),vi.forward(l),s))}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){let t;t="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 e=[this.operator,t,this.input.serialize()];for(let t=0;t<this.labels.length;t++)e.push(this.labels[t],this.outputs[t].serialize());return e}}function wi(t,e,i,n){const r=n-i,o=t-i;return 0===r?0:1===e?o/r:(Math.pow(e,o)-1)/(Math.pow(e,r)-1)}class Ai{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expectected at least one argument.");let i=null;const n=e.expectedType;n&&"value"!==n.kind&&(i=n);const r=[];for(const n of t.slice(1)){const t=e.parse(n,1+r.length,i,void 0,{typeAnnotation:"omit"});if(!t)return null;i=i||t.type,r.push(t)}const o=n&&r.some((t=>oe(n,t.type)));return new Ai(o?Kt:i,r)}evaluate(t){let e,i=null,n=0;for(const r of this.args)if(n++,i=r.evaluate(t),i&&i instanceof fe&&!i.available&&(e||(e=i.name),i=null,n===this.args.length&&(i=e)),null!==i)break;return i}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=["coalesce"];return this.eachChild((e=>{t.push(e.serialize())})),t}}class Ei{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const e of this.bindings)t(e[1]);t(this.result)}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const i=[];for(let n=1;n<t.length-1;n+=2){const r=t[n];if("string"!=typeof r)return e.error(`Expected string, but found ${typeof r} instead.`,n);if(/[^a-zA-Z0-9_]/.test(r))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);const o=e.parse(t[n+1],n+1);if(!o)return null;i.push([r,o])}const n=e.parse(t[t.length-1],t.length-1,e.expectedType,i);return n?new Ei(i,n):null}outputDefined(){return this.result.outputDefined()}serialize(){const t=["let"];for(const[e,i]of this.bindings)t.push(e,i.serialize());return t.push(this.result.serialize()),t}}class Si{constructor(t,e,i){this.type=t,this.index=e,this.input=i}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Xt),n=e.parse(t[2],2,ie(e.expectedType||Kt));return i&&n?new Si(n.type.itemType,i,n):null}evaluate(t){const e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new xe(`Array index out of bounds: ${e} < 0.`);if(e>=i.length)throw new xe(`Array index out of bounds: ${e} > ${i.length-1}.`);if(e!==Math.floor(e))throw new xe(`Array index must be an integer, but found ${e} instead.`);return i[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class Mi{constructor(t,e){this.type=Yt,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Kt),n=e.parse(t[2],2,Kt);return i&&n?se(i.type,[Yt,Zt,Xt,qt,Kt])?new Mi(i,n):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${ne(i.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return!1;if(!ae(e,["boolean","string","number","null"]))throw new xe(`Expected first argument to be of type boolean, string, number or null, but found ${ne(ye(e))} instead.`);if(!ae(i,["string","array"]))throw new xe(`Expected second argument to be of type array or string, but found ${ne(ye(i))} instead.`);return i.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class Ti{constructor(t,e,i){this.type=Xt,this.needle=t,this.haystack=e,this.fromIndex=i}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Kt),n=e.parse(t[2],2,Kt);if(!i||!n)return null;if(!se(i.type,[Yt,Zt,Xt,qt,Kt]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${ne(i.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,Xt);return r?new Ti(i,n,r):null}return new Ti(i,n)}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!ae(e,["boolean","string","number","null"]))throw new xe(`Expected first argument to be of type boolean, string, number or null, but found ${ne(ye(e))} instead.`);if(!ae(i,["string","array"]))throw new xe(`Expected second argument to be of type array or string, but found ${ne(ye(i))} instead.`);if(this.fromIndex){const n=this.fromIndex.evaluate(t);return i.indexOf(e,n)}return i.indexOf(e)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class Ii{constructor(t,e,i,n,r,o){this.inputType=t,this.type=e,this.input=i,this.cases=n,this.outputs=r,this.otherwise=o}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let i,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);const r={},o=[];for(let s=2;s<t.length-1;s+=2){let a=t[s];const l=t[s+1];Array.isArray(a)||(a=[a]);const c=e.concat(s);if(0===a.length)return c.error("Expected at least one branch label.");for(const t of a){if("number"!=typeof t&&"string"!=typeof t)return c.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return c.error("Numeric branch labels must be integer values.");if(i){if(c.checkSubtype(i,ye(t)))return null}else i=ye(t);if(void 0!==r[String(t)])return c.error("Branch labels must be unique.");r[String(t)]=o.length}const u=e.parse(l,s,n);if(!u)return null;n=n||u.type,o.push(u)}const s=e.parse(t[1],1,Kt);if(!s)return null;const a=e.parse(t[t.length-1],t.length-1,n);return a?"value"!==s.type.kind&&e.concat(1).checkSubtype(i,s.type)?null:new Ii(i,n,s,r,o,a):null}evaluate(t){const e=this.input.evaluate(t);return(ye(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["match",this.input.serialize()],e=Object.keys(this.cases).sort(),i=[],n={};for(const t of e){const e=n[this.cases[t]];void 0===e?(n[this.cases[t]]=i.length,i.push([this.cases[t],[t]])):i[e][1].push(t)}const r=t=>"number"===this.inputType.kind?Number(t):t;for(const[e,n]of i)t.push(1===n.length?r(n[0]):n.map(r)),t.push(this.outputs[e].serialize());return t.push(this.otherwise.serialize()),t}}class Ci{constructor(t,e,i){this.type=t,this.branches=e,this.otherwise=i}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return e.error("Expected an odd number of arguments.");let i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);const n=[];for(let r=1;r<t.length-1;r+=2){const o=e.parse(t[r],r,Yt);if(!o)return null;const s=e.parse(t[r+1],r+1,i);if(!s)return null;n.push([o,s]),i=i||s.type}const r=e.parse(t[t.length-1],t.length-1,i);return r?new Ci(i,n,r):null}evaluate(t){for(const[e,i]of this.branches)if(e.evaluate(t))return i.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[e,i]of this.branches)t(e),t(i);t(this.otherwise)}outputDefined(){return this.branches.every((([t,e])=>e.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild((e=>{t.push(e.serialize())})),t}}class Pi{constructor(t,e,i,n){this.type=t,this.input=e,this.beginIndex=i,this.endIndex=n}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Kt),n=e.parse(t[2],2,Xt);if(!i||!n)return null;if(!se(i.type,[ie(Kt),Zt,Kt]))return e.error(`Expected first argument to be of type array or string, but found ${ne(i.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,Xt);return r?new Pi(i.type,i,n,r):null}return new Pi(i.type,i,n)}evaluate(t){const e=this.input.evaluate(t),i=this.beginIndex.evaluate(t);if(!ae(e,["string","array"]))throw new xe(`Expected first argument to be of type array or string, but found ${ne(ye(e))} instead.`);if(this.endIndex){const n=this.endIndex.evaluate(t);return e.slice(i,n)}return e.slice(i)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function Li(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function Di(t,e,i,n){return 0===n.compare(e,i)}function Ri(t,e,i){const n="=="!==t&&"!="!==t;return class r{constructor(t,e,i){this.type=Yt,this.lhs=t,this.rhs=e,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");const i=t[0];let o=e.parse(t[1],1,Kt);if(!o)return null;if(!Li(i,o.type))return e.concat(1).error(`"${i}" comparisons are not supported for type '${ne(o.type)}'.`);let s=e.parse(t[2],2,Kt);if(!s)return null;if(!Li(i,s.type))return e.concat(2).error(`"${i}" comparisons are not supported for type '${ne(s.type)}'.`);if(o.type.kind!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error(`Cannot compare types '${ne(o.type)}' and '${ne(s.type)}'.`);n&&("value"===o.type.kind&&"value"!==s.type.kind?o=new we(s.type,[o]):"value"!==o.type.kind&&"value"===s.type.kind&&(s=new we(o.type,[s])));let a=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error("Cannot use collator to compare non-string types.");if(a=e.parse(t[3],3,$t),!a)return null}return new r(o,s,a)}evaluate(r){const o=this.lhs.evaluate(r),s=this.rhs.evaluate(r);if(n&&this.hasUntypedArgument){const e=ye(o),i=ye(s);if(e.kind!==i.kind||"string"!==e.kind&&"number"!==e.kind)throw new xe(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${i.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const t=ye(o),i=ye(s);if("string"!==t.kind||"string"!==i.kind)return e(r,o,s)}return this.collator?i(r,o,s,this.collator.evaluate(r)):e(r,o,s)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}serialize(){const e=[t];return this.eachChild((t=>{e.push(t.serialize())})),e}}}const Oi=Ri("==",(function(t,e,i){return e===i}),Di),ki=Ri("!=",(function(t,e,i){return e!==i}),(function(t,e,i,n){return!Di(0,e,i,n)})),Ni=Ri("<",(function(t,e,i){return e<i}),(function(t,e,i,n){return n.compare(e,i)<0})),Bi=Ri(">",(function(t,e,i){return e>i}),(function(t,e,i,n){return n.compare(e,i)>0})),zi=Ri("<=",(function(t,e,i){return e<=i}),(function(t,e,i,n){return n.compare(e,i)<=0})),Fi=Ri(">=",(function(t,e,i){return e>=i}),(function(t,e,i,n){return n.compare(e,i)>=0}));class Vi{constructor(t,e,i,n,r){this.type=Zt,this.number=t,this.locale=e,this.currency=i,this.minFractionDigits=n,this.maxFractionDigits=r}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,Xt);if(!i)return null;const n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");let r=null;if(n.locale&&(r=e.parse(n.locale,1,Zt),!r))return null;let o=null;if(n.currency&&(o=e.parse(n.currency,1,Zt),!o))return null;let s=null;if(n["min-fraction-digits"]&&(s=e.parse(n["min-fraction-digits"],1,Xt),!s))return null;let a=null;return n["max-fraction-digits"]&&(a=e.parse(n["max-fraction-digits"],1,Xt),!a)?null:new Vi(i,r,o,s,a)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]}}class Ui{constructor(t){this.type=Xt,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const i=e.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?e.error(`Expected argument of type string or array, but found ${ne(i.type)} instead.`):new Ui(i):null}evaluate(t){const e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new xe(`Expected value to be of type string or array, but found ${ne(ye(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild((e=>{t.push(e.serialize())})),t}}const Gi={"==":Oi,"!=":ki,">":Bi,"<":Ni,">=":Fi,"<=":zi,array:we,at:Si,boolean:we,case:Ci,coalesce:Ai,collator:Pe,format:Ae,image:Ee,in:Mi,"index-of":Ti,interpolate:bi,"interpolate-hcl":bi,"interpolate-lab":bi,length:Ui,let:Ei,literal:_e,match:Ii,number:we,"number-format":Vi,object:we,slice:Pi,step:ei,string:we,"to-boolean":Me,"to-color":Me,"to-number":Me,"to-string":Me,var:Je,within:Xe};function ji(t,[e,i,n,r]){e=e.evaluate(t),i=i.evaluate(t),n=n.evaluate(t);const o=r?r.evaluate(t):1,s=me(e,i,n,o);if(s)throw new xe(s);return new ue(e/255*o,i/255*o,n/255*o,o)}function Hi(t,e){return t in e}function Wi(t,e){const i=e[t];return void 0===i?null:i}function qi(t){return{type:t}}function Xi(t){return{result:"success",value:t}}function Zi(t){return{result:"error",value:t}}function Yi(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Qi(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Ji(t){return!!t.expression&&t.expression.interpolated}function Ki(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function $i(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function tn(t){return t}function en(t,e){const i="color"===e.type,n=t.stops&&"object"==typeof t.stops[0][0],r=n||!(n||void 0!==t.property),o=t.type||(Ji(e)?"exponential":"interval");if(i&&((t=Ut({},t)).stops&&(t.stops=t.stops.map((t=>[t[0],ue.parse(t[1])]))),t.default=ue.parse(t.default?t.default:e.default)),t.colorSpace&&"rgb"!==t.colorSpace&&!xi[t.colorSpace])throw new Error(`Unknown color space: ${t.colorSpace}`);let s,a,l;if("exponential"===o)s=sn;else if("interval"===o)s=on;else if("categorical"===o){s=rn,a=Object.create(null);for(const e of t.stops)a[e[0]]=e[1];l=typeof t.stops[0][0]}else{if("identity"!==o)throw new Error(`Unknown function type "${o}"`);s=an}if(n){const i={},n=[];for(let e=0;e<t.stops.length;e++){const r=t.stops[e],o=r[0].zoom;void 0===i[o]&&(i[o]={zoom:o,type:t.type,property:t.property,default:t.default,stops:[]},n.push(o)),i[o].stops.push([r[0].value,r[1]])}const r=[];for(const t of n)r.push([i[t].zoom,en(i[t],e)]);const o={name:"linear"};return{kind:"composite",interpolationType:o,interpolationFactor:bi.interpolationFactor.bind(void 0,o),zoomStops:r.map((t=>t[0])),evaluate:({zoom:i},n)=>sn({stops:r,base:t.base},e,i).evaluate(i,n)}}if(r){const i="exponential"===o?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return{kind:"camera",interpolationType:i,interpolationFactor:bi.interpolationFactor.bind(void 0,i),zoomStops:t.stops.map((t=>t[0])),evaluate:({zoom:i})=>s(t,e,i,a,l)}}return{kind:"source",evaluate(i,n){const r=n&&n.properties?n.properties[t.property]:void 0;return void 0===r?nn(t.default,e.default):s(t,e,r,a,l)}}}function nn(t,e,i){return void 0!==t?t:void 0!==e?e:void 0!==i?i:void 0}function rn(t,e,i,n,r){return nn(typeof i===r?n[i]:void 0,t.default,e.default)}function on(t,e,i){if("number"!==Ki(i))return nn(t.default,e.default);const n=t.stops.length;if(1===n)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[n-1][0])return t.stops[n-1][1];const r=ti(t.stops.map((t=>t[0])),i);return t.stops[r][1]}function sn(t,e,i){const n=void 0!==t.base?t.base:1;if("number"!==Ki(i))return nn(t.default,e.default);const r=t.stops.length;if(1===r)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[r-1][0])return t.stops[r-1][1];const o=ti(t.stops.map((t=>t[0])),i),s=function(t,e,i,n){const r=n-i,o=t-i;return 0===r?0:1===e?o/r:(Math.pow(e,o)-1)/(Math.pow(e,r)-1)}(i,n,t.stops[o][0],t.stops[o+1][0]),a=t.stops[o][1],l=t.stops[o+1][1];let c=ni[e.type]||tn;if(t.colorSpace&&"rgb"!==t.colorSpace){const e=xi[t.colorSpace];c=(t,i)=>e.reverse(e.interpolate(e.forward(t),e.forward(i),s))}return"function"==typeof a.evaluate?{evaluate(...t){const e=a.evaluate.apply(void 0,t),i=l.evaluate.apply(void 0,t);if(void 0!==e&&void 0!==i)return c(e,i,s)}}:c(a,l,s)}function an(t,e,i){return"color"===e.type?i=ue.parse(i):"formatted"===e.type?i=de.fromString(i.toString()):"resolvedImage"===e.type?i=fe.fromString(i.toString()):Ki(i)===e.type||"enum"===e.type&&e.values[i]||(i=void 0),nn(i,t.default,e.default)}Ce.register(Gi,{error:[{kind:"error"},[Zt],(t,[e])=>{throw new xe(e.evaluate(t))}],typeof:[Zt,[Kt],(t,[e])=>ne(ye(e.evaluate(t)))],"to-rgba":[ie(Xt,4),[Qt],(t,[e])=>e.evaluate(t).toArray()],rgb:[Qt,[Xt,Xt,Xt],ji],rgba:[Qt,[Xt,Xt,Xt,Xt],ji],has:{type:Yt,overloads:[[[Zt],(t,[e])=>Hi(e.evaluate(t),t.properties())],[[Zt,Jt],(t,[e,i])=>Hi(e.evaluate(t),i.evaluate(t))]]},get:{type:Kt,overloads:[[[Zt],(t,[e])=>Wi(e.evaluate(t),t.properties())],[[Zt,Jt],(t,[e,i])=>Wi(e.evaluate(t),i.evaluate(t))]]},"feature-state":[Kt,[Zt],(t,[e])=>Wi(e.evaluate(t),t.featureState||{})],properties:[Jt,[],t=>t.properties()],"geometry-type":[Zt,[],t=>t.geometryType()],id:[Kt,[],t=>t.id()],zoom:[Xt,[],t=>t.globals.zoom],"heatmap-density":[Xt,[],t=>t.globals.heatmapDensity||0],"line-progress":[Xt,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[Xt,[],t=>t.globals.skyRadialProgress||0],accumulated:[Kt,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[Xt,qi(Xt),(t,e)=>{let i=0;for(const n of e)i+=n.evaluate(t);return i}],"*":[Xt,qi(Xt),(t,e)=>{let i=1;for(const n of e)i*=n.evaluate(t);return i}],"-":{type:Xt,overloads:[[[Xt,Xt],(t,[e,i])=>e.evaluate(t)-i.evaluate(t)],[[Xt],(t,[e])=>-e.evaluate(t)]]},"/":[Xt,[Xt,Xt],(t,[e,i])=>e.evaluate(t)/i.evaluate(t)],"%":[Xt,[Xt,Xt],(t,[e,i])=>e.evaluate(t)%i.evaluate(t)],ln2:[Xt,[],()=>Math.LN2],pi:[Xt,[],()=>Math.PI],e:[Xt,[],()=>Math.E],"^":[Xt,[Xt,Xt],(t,[e,i])=>Math.pow(e.evaluate(t),i.evaluate(t))],sqrt:[Xt,[Xt],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[Xt,[Xt],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[Xt,[Xt],(t,[e])=>Math.log(e.evaluate(t))],log2:[Xt,[Xt],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[Xt,[Xt],(t,[e])=>Math.sin(e.evaluate(t))],cos:[Xt,[Xt],(t,[e])=>Math.cos(e.evaluate(t))],tan:[Xt,[Xt],(t,[e])=>Math.tan(e.evaluate(t))],asin:[Xt,[Xt],(t,[e])=>Math.asin(e.evaluate(t))],acos:[Xt,[Xt],(t,[e])=>Math.acos(e.evaluate(t))],atan:[Xt,[Xt],(t,[e])=>Math.atan(e.evaluate(t))],min:[Xt,qi(Xt),(t,e)=>Math.min(...e.map((e=>e.evaluate(t))))],max:[Xt,qi(Xt),(t,e)=>Math.max(...e.map((e=>e.evaluate(t))))],abs:[Xt,[Xt],(t,[e])=>Math.abs(e.evaluate(t))],round:[Xt,[Xt],(t,[e])=>{const i=e.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[Xt,[Xt],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[Xt,[Xt],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[Yt,[Zt,Kt],(t,[e,i])=>t.properties()[e.value]===i.value],"filter-id-==":[Yt,[Kt],(t,[e])=>t.id()===e.value],"filter-type-==":[Yt,[Zt],(t,[e])=>t.geometryType()===e.value],"filter-<":[Yt,[Zt,Kt],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n<r}],"filter-id-<":[Yt,[Kt],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i<n}],"filter->":[Yt,[Zt,Kt],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n>r}],"filter-id->":[Yt,[Kt],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>n}],"filter-<=":[Yt,[Zt,Kt],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n<=r}],"filter-id-<=":[Yt,[Kt],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i<=n}],"filter->=":[Yt,[Zt,Kt],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n>=r}],"filter-id->=":[Yt,[Kt],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>=n}],"filter-has":[Yt,[Kt],(t,[e])=>e.value in t.properties()],"filter-has-id":[Yt,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[Yt,[ie(Zt)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[Yt,[ie(Kt)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[Yt,[Zt,ie(Kt)],(t,[e,i])=>i.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[Yt,[Zt,ie(Kt)],(t,[e,i])=>function(t,e,i,n){for(;i<=n;){const r=i+n>>1;if(e[r]===t)return!0;e[r]>t?n=r-1:i=r+1}return!1}(t.properties()[e.value],i.value,0,i.value.length-1)],all:{type:Yt,overloads:[[[Yt,Yt],(t,[e,i])=>e.evaluate(t)&&i.evaluate(t)],[qi(Yt),(t,e)=>{for(const i of e)if(!i.evaluate(t))return!1;return!0}]]},any:{type:Yt,overloads:[[[Yt,Yt],(t,[e,i])=>e.evaluate(t)||i.evaluate(t)],[qi(Yt),(t,e)=>{for(const i of e)if(i.evaluate(t))return!0;return!1}]]},"!":[Yt,[Yt],(t,[e])=>!e.evaluate(t)],"is-supported-script":[Yt,[Zt],(t,[e])=>{const i=t.globals&&t.globals.isSupportedScript;return!i||i(e.evaluate(t))}],upcase:[Zt,[Zt],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[Zt,[Zt],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[Zt,qi(Kt),(t,e)=>e.map((e=>ve(e.evaluate(t)))).join("")],"resolved-locale":[Zt,[$t],(t,[e])=>e.evaluate(t).resolvedLocale()]});class ln{constructor(t,e){this.expression=t,this._warningHistory={},this._evaluator=new Ie,this._defaultValue=e?function(t){return"color"===t.type&&$i(t.default)?new ue(0,0,0,0):"color"===t.type?ue.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,i,n,r,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this._evaluator.canonical=n,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)}evaluate(t,e,i,n,r,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null,this._evaluator.canonical=n,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=o||null;try{const t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new xe(`Expected value to be one of ${Object.keys(this._enumValues).map((t=>JSON.stringify(t))).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}}}function cn(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Gi}function un(t,e){const i=new Ke(Gi,[],e?function(t){const e={color:Qt,string:Zt,number:Xt,enum:Zt,boolean:Yt,formatted:te,resolvedImage:ee};return"array"===t.type?ie(e[t.value]||Kt,t.length):e[t.type]}(e):void 0),n=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Xi(new ln(n,e)):Zi(i.errors)}class hn{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Ye(e.expression)}evaluateWithoutErrorHandling(t,e,i,n,r,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,n,r,o)}evaluate(t,e,i,n,r,o){return this._styleExpression.evaluate(t,e,i,n,r,o)}}class pn{constructor(t,e,i,n){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Ye(e.expression),this.interpolationType=n}evaluateWithoutErrorHandling(t,e,i,n,r,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,n,r,o)}evaluate(t,e,i,n,r,o){return this._styleExpression.evaluate(t,e,i,n,r,o)}interpolationFactor(t,e,i){return this.interpolationType?bi.interpolationFactor(this.interpolationType,t,e,i):0}}function dn(t,e){if("error"===(t=un(t,e)).result)return t;const i=t.value.expression,n=Ze(i);if(!n&&!Yi(e))return Zi([new Ht("","data expressions not supported")]);const r=Qe(i,["zoom"]);if(!r&&!Qi(e))return Zi([new Ht("","zoom expressions not supported")]);const o=mn(i);return o||r?o instanceof Ht?Zi([o]):o instanceof bi&&!Ji(e)?Zi([new Ht("",'"interpolate" expressions cannot be used with this property')]):Xi(o?new pn(n?"camera":"composite",t.value,o.labels,o instanceof bi?o.interpolation:void 0):new hn(n?"constant":"source",t.value)):Zi([new Ht("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class fn{constructor(t,e){this._parameters=t,this._specification=e,Ut(this,en(this._parameters,this._specification))}static deserialize(t){return new fn(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function mn(t){let e=null;if(t instanceof Ei)e=mn(t.result);else if(t instanceof Ai){for(const i of t.args)if(e=mn(i),e)break}else(t instanceof ei||t instanceof bi)&&t.input instanceof Ce&&"zoom"===t.input.name&&(e=t);return e instanceof Ht||t.eachChild((t=>{const i=mn(t);i instanceof Ht?e=i:!e&&i?e=new Ht("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new Ht("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function gn(t){const e=t.key,i=t.value,n=t.valueSpec||{},r=t.objectElementValidators||{},o=t.style,s=t.styleSpec;let a=[];const l=Ki(i);if("object"!==l)return[new Ft(e,i,`object expected, ${l} found`)];for(const t in i){const l=t.split(".")[0],c=n[l]||n["*"];let u;if(r[l])u=r[l];else if(n[l])u=Wn;else if(r["*"])u=r["*"];else{if(!n["*"]){a.push(new Ft(e,i[t],`unknown property "${t}"`));continue}u=Wn}a=a.concat(u({key:(e?`${e}.`:e)+t,value:i[t],valueSpec:c,style:o,styleSpec:s,object:i,objectKey:t},i))}for(const t in n)r[t]||n[t].required&&void 0===n[t].default&&void 0===i[t]&&a.push(new Ft(e,i,`missing required property "${t}"`));return a}function yn(t){const e=t.value,i=t.valueSpec,n=t.style,r=t.styleSpec,o=t.key,s=t.arrayElementValidator||Wn;if("array"!==Ki(e))return[new Ft(o,e,`array expected, ${Ki(e)} found`)];if(i.length&&e.length!==i.length)return[new Ft(o,e,`array length ${i.length} expected, length ${e.length} found`)];if(i["min-length"]&&e.length<i["min-length"])return[new Ft(o,e,`array length at least ${i["min-length"]} expected, length ${e.length} found`)];let a={type:i.value,values:i.values,minimum:i.minimum,maximum:i.maximum};r.$version<7&&(a.function=i.function),"object"===Ki(i.value)&&(a=i.value);let l=[];for(let t=0;t<e.length;t++)l=l.concat(s({array:e,arrayIndex:t,value:e[t],valueSpec:a,style:n,styleSpec:r,key:`${o}[${t}]`}));return l}function vn(t){const e=t.key,i=t.value,n=t.valueSpec;let r=Ki(i);if("number"===r&&i!=i&&(r="NaN"),"number"!==r)return[new Ft(e,i,`number expected, ${r} found`)];if("minimum"in n){let r=n.minimum;if("array"===Ki(n.minimum)&&(r=n.minimum[t.arrayIndex]),i<r)return[new Ft(e,i,`${i} is less than the minimum value ${r}`)]}if("maximum"in n){let r=n.maximum;if("array"===Ki(n.maximum)&&(r=n.maximum[t.arrayIndex]),i>r)return[new Ft(e,i,`${i} is greater than the maximum value ${r}`)]}return[]}function _n(t){const e=t.valueSpec,i=Gt(t.value.type);let n,r,o,s={};const a="categorical"!==i&&void 0===t.value.property,l=!a,c="array"===Ki(t.value.stops)&&"array"===Ki(t.value.stops[0])&&"object"===Ki(t.value.stops[0][0]),u=gn({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===i)return[new Ft(t.key,t.value,'identity function may not have a "stops" property')];let e=[];const n=t.value;return e=e.concat(yn({key:t.key,value:n,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===Ki(n)&&0===n.length&&e.push(new Ft(t.key,n,"array must have at least one stop")),e},default:function(t){return Wn({key:t.key,value:t.value,valueSpec:e,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===i&&a&&u.push(new Ft(t.key,t.value,'missing required property "property"')),"identity"===i||t.value.stops||u.push(new Ft(t.key,t.value,'missing required property "stops"')),"exponential"===i&&t.valueSpec.expression&&!Ji(t.valueSpec)&&u.push(new Ft(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!Yi(t.valueSpec)?u.push(new Ft(t.key,t.value,"property functions not supported")):a&&!Qi(t.valueSpec)&&u.push(new Ft(t.key,t.value,"zoom functions not supported"))),"categorical"!==i&&!c||void 0!==t.value.property||u.push(new Ft(t.key,t.value,'"property" property is required')),u;function h(t){let i=[];const n=t.value,a=t.key;if("array"!==Ki(n))return[new Ft(a,n,`array expected, ${Ki(n)} found`)];if(2!==n.length)return[new Ft(a,n,`array length 2 expected, length ${n.length} found`)];if(c){if("object"!==Ki(n[0]))return[new Ft(a,n,`object expected, ${Ki(n[0])} found`)];if(void 0===n[0].zoom)return[new Ft(a,n,"object stop key must have zoom")];if(void 0===n[0].value)return[new Ft(a,n,"object stop key must have value")];if(o&&o>Gt(n[0].zoom))return[new Ft(a,n[0].zoom,"stop zoom values must appear in ascending order")];Gt(n[0].zoom)!==o&&(o=Gt(n[0].zoom),r=void 0,s={}),i=i.concat(gn({key:`${a}[0]`,value:n[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:vn,value:p}}))}else i=i.concat(p({key:`${a}[0]`,value:n[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},n));return cn(jt(n[1]))?i.concat([new Ft(`${a}[1]`,n[1],"expressions are not allowed in function stops.")]):i.concat(Wn({key:`${a}[1]`,value:n[1],valueSpec:e,style:t.style,styleSpec:t.styleSpec}))}function p(t,o){const a=Ki(t.value),l=Gt(t.value),c=null!==t.value?t.value:o;if(n){if(a!==n)return[new Ft(t.key,c,`${a} stop domain type must match previous stop domain type ${n}`)]}else n=a;if("number"!==a&&"string"!==a&&"boolean"!==a)return[new Ft(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==a&&"categorical"!==i){let n=`number expected, ${a} found`;return Yi(e)&&void 0===i&&(n+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ft(t.key,c,n)]}return"categorical"!==i||"number"!==a||isFinite(l)&&Math.floor(l)===l?"categorical"!==i&&"number"===a&&void 0!==r&&l<r?[new Ft(t.key,c,"stop domain values must appear in ascending order")]:(r=l,"categorical"===i&&l in s?[new Ft(t.key,c,"stop domain values must be unique")]:(s[l]=!0,[])):[new Ft(t.key,c,`integer expected, found ${l}`)]}}function xn(t){const e=("property"===t.expressionContext?dn:un)(jt(t.value),t.valueSpec);if("error"===e.result)return e.value.map((e=>new Ft(`${t.key}${e.key}`,t.value,e.message)));const i=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!i.outputDefined())return[new Ft(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===t.expressionContext&&"layout"===t.propertyType&&!Ye(i))return[new Ft(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!Ye(i))return[new Ft(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!Qe(i,["zoom","feature-state"]))return[new Ft(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!Ze(i))return[new Ft(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function bn(t){const e=t.key,i=t.value,n=t.valueSpec,r=[];return Array.isArray(n.values)?-1===n.values.indexOf(Gt(i))&&r.push(new Ft(e,i,`expected one of [${n.values.join(", ")}], ${JSON.stringify(i)} found`)):-1===Object.keys(n.values).indexOf(Gt(i))&&r.push(new Ft(e,i,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(i)} found`)),r}function wn(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!wn(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}const An={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function En(t){if(null==t)return{filter:()=>!0,needGeometry:!1};wn(t)||(t=Tn(t));const e=un(t,An);if("error"===e.result)throw new Error(e.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return{filter:(t,i,n)=>e.value.evaluate(t,i,{},n),needGeometry:Mn(t)}}function Sn(t,e){return t<e?-1:t>e?1:0}function Mn(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(let e=1;e<t.length;e++)if(Mn(t[e]))return!0;return!1}function Tn(t){if(!t)return!0;const e=t[0];return t.length<=1?"any"!==e:"=="===e?In(t[1],t[2],"=="):"!="===e?Ln(In(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?In(t[1],t[2],e):"any"===e?(i=t.slice(1),["any"].concat(i.map(Tn))):"all"===e?["all"].concat(t.slice(1).map(Tn)):"none"===e?["all"].concat(t.slice(1).map(Tn).map(Ln)):"in"===e?Cn(t[1],t.slice(2)):"!in"===e?Ln(Cn(t[1],t.slice(2))):"has"===e?Pn(t[1]):"!has"===e?Ln(Pn(t[1])):"within"!==e||t;var i}function In(t,e,i){switch(t){case"$type":return[`filter-type-${i}`,e];case"$id":return[`filter-id-${i}`,e];default:return[`filter-${i}`,t,e]}}function Cn(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((t=>typeof t!=typeof e[0]))?["filter-in-large",t,["literal",e.sort(Sn)]]:["filter-in-small",t,["literal",e]]}}function Pn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Ln(t){return["!",t]}function Dn(t){return wn(jt(t.value))?xn(Ut({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Rn(t)}function Rn(t){const e=t.value,i=t.key;if("array"!==Ki(e))return[new Ft(i,e,`array expected, ${Ki(e)} found`)];const n=t.styleSpec;let r,o=[];if(e.length<1)return[new Ft(i,e,"filter array must have at least 1 element")];switch(o=o.concat(bn({key:`${i}[0]`,value:e[0],valueSpec:n.filter_operator,style:t.style,styleSpec:t.styleSpec})),Gt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&"$type"===Gt(e[1])&&o.push(new Ft(i,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":3!==e.length&&o.push(new Ft(i,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(r=Ki(e[1]),"string"!==r&&o.push(new Ft(`${i}[1]`,e[1],`string expected, ${r} found`)));for(let s=2;s<e.length;s++)r=Ki(e[s]),"$type"===Gt(e[1])?o=o.concat(bn({key:`${i}[${s}]`,value:e[s],valueSpec:n.geometry_type,style:t.style,styleSpec:t.styleSpec})):"string"!==r&&"number"!==r&&"boolean"!==r&&o.push(new Ft(`${i}[${s}]`,e[s],`string, number, or boolean expected, ${r} found`));break;case"any":case"all":case"none":for(let n=1;n<e.length;n++)o=o.concat(Rn({key:`${i}[${n}]`,value:e[n],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":r=Ki(e[1]),2!==e.length?o.push(new Ft(i,e,`filter array for "${e[0]}" operator must have 2 elements`)):"string"!==r&&o.push(new Ft(`${i}[1]`,e[1],`string expected, ${r} found`));break;case"within":r=Ki(e[1]),2!==e.length?o.push(new Ft(i,e,`filter array for "${e[0]}" operator must have 2 elements`)):"object"!==r&&o.push(new Ft(`${i}[1]`,e[1],`object expected, ${r} found`))}return o}function On(t,e){const i=t.key,n=t.style,r=t.styleSpec,o=t.value,s=t.objectKey,a=r[`${e}_${t.layerType}`];if(!a)return[];const l=s.match(/^(.*)-transition$/);if("paint"===e&&l&&a[l[1]]&&a[l[1]].transition)return Wn({key:i,value:o,valueSpec:r.transition,style:n,styleSpec:r});const c=t.valueSpec||a[s];if(!c)return[new Ft(i,o,`unknown property "${s}"`)];let u;if("string"===Ki(o)&&Yi(c)&&!c.tokens&&(u=/^{([^}]+)}$/.exec(o)))return[new Ft(i,o,`"${s}" does not support interpolation syntax\nUse an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(u[1])} }\`.`)];const h=[];return"symbol"===t.layerType&&("text-field"===s&&n&&!n.glyphs&&h.push(new Ft(i,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===s&&$i(jt(o))&&"identity"===Gt(o.type)&&h.push(new Ft(i,o,'"text-font" does not support identity functions'))),h.concat(Wn({key:t.key,value:o,valueSpec:c,style:n,styleSpec:r,expressionContext:"property",propertyType:e,propertyKey:s}))}function kn(t){return On(t,"paint")}function Nn(t){return On(t,"layout")}function Bn(t){let e=[];const i=t.value,n=t.key,r=t.style,o=t.styleSpec;i.type||i.ref||e.push(new Ft(n,i,'either "type" or "ref" is required'));let s=Gt(i.type);const a=Gt(i.ref);if(i.id){const o=Gt(i.id);for(let s=0;s<t.arrayIndex;s++){const t=r.layers[s];Gt(t.id)===o&&e.push(new Ft(n,i.id,`duplicate layer id "${i.id}", previously used at line ${t.id.__line__}`))}}if("ref"in i){let t;["type","source","source-layer","filter","layout"].forEach((t=>{t in i&&e.push(new Ft(n,i[t],`"${t}" is prohibited for ref layers`))})),r.layers.forEach((e=>{Gt(e.id)===a&&(t=e)})),t?t.ref?e.push(new Ft(n,i.ref,"ref cannot reference another ref layer")):s=Gt(t.type):e.push(new Ft(n,i.ref,`ref layer "${a}" not found`))}else if("background"!==s&&"sky"!==s)if(i.source){const t=r.sources&&r.sources[i.source],o=t&&Gt(t.type);t?"vector"===o&&"raster"===s?e.push(new Ft(n,i.source,`layer "${i.id}" requires a raster source`)):"raster"===o&&"raster"!==s?e.push(new Ft(n,i.source,`layer "${i.id}" requires a vector source`)):"vector"!==o||i["source-layer"]?"raster-dem"===o&&"hillshade"!==s?e.push(new Ft(n,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!i.paint||!i.paint["line-gradient"]||"geojson"===o&&t.lineMetrics||e.push(new Ft(n,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new Ft(n,i,`layer "${i.id}" must specify a "source-layer"`)):e.push(new Ft(n,i.source,`source "${i.source}" not found`))}else e.push(new Ft(n,i,'missing required property "source"'));return e=e.concat(gn({key:n,value:i,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":()=>[],type:()=>Wn({key:`${n}.type`,value:i.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,object:i,objectKey:"type"}),filter:Dn,layout:t=>gn({layer:i,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":t=>Nn(Ut({layerType:s},t))}}),paint:t=>gn({layer:i,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":t=>kn(Ut({layerType:s},t))}})}})),e}function zn(t){const e=t.value,i=t.key,n=Ki(e);return"string"!==n?[new Ft(i,e,`string expected, ${n} found`)]:[]}const Fn={promoteId:function({key:t,value:e}){if("string"===Ki(e))return zn({key:t,value:e});{const i=[];for(const n in e)i.push(...zn({key:`${t}.${n}`,value:e[n]}));return i}}};function Vn(t){const e=t.value,i=t.key,n=t.styleSpec,r=t.style;if(!e.type)return[new Ft(i,e,'"type" is required')];const o=Gt(e.type);let s;switch(o){case"vector":case"raster":case"raster-dem":return s=gn({key:i,value:e,valueSpec:n[`source_${o.replace("-","_")}`],style:t.style,styleSpec:n,objectElementValidators:Fn}),s;case"geojson":if(s=gn({key:i,value:e,valueSpec:n.source_geojson,style:r,styleSpec:n,objectElementValidators:Fn}),e.cluster)for(const t in e.clusterProperties){const[n,r]=e.clusterProperties[t],o="string"==typeof n?[n,["accumulated"],["get",t]]:n;s.push(...xn({key:`${i}.${t}.map`,value:r,expressionContext:"cluster-map"})),s.push(...xn({key:`${i}.${t}.reduce`,value:o,expressionContext:"cluster-reduce"}))}return s;case"video":return gn({key:i,value:e,valueSpec:n.source_video,style:r,styleSpec:n});case"image":return gn({key:i,value:e,valueSpec:n.source_image,style:r,styleSpec:n});case"canvas":return[new Ft(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return bn({key:`${i}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:r,styleSpec:n})}}function Un(t){const e=t.value,i=t.styleSpec,n=i.light,r=t.style;let o=[];const s=Ki(e);if(void 0===e)return o;if("object"!==s)return o=o.concat([new Ft("light",e,`object expected, ${s} found`)]),o;for(const t in e){const s=t.match(/^(.*)-transition$/);o=o.concat(s&&n[s[1]]&&n[s[1]].transition?Wn({key:t,value:e[t],valueSpec:i.transition,style:r,styleSpec:i}):n[t]?Wn({key:t,value:e[t],valueSpec:n[t],style:r,styleSpec:i}):[new Ft(t,e[t],`unknown property "${t}"`)])}return o}function Gn(t){const e=t.value,i=t.key,n=t.style,r=t.styleSpec,o=r.terrain;let s=[];const a=Ki(e);if(void 0===e)return s;if("object"!==a)return s=s.concat([new Ft("terrain",e,`object expected, ${a} found`)]),s;for(const t in e){const i=t.match(/^(.*)-transition$/);s=s.concat(i&&o[i[1]]&&o[i[1]].transition?Wn({key:t,value:e[t],valueSpec:r.transition,style:n,styleSpec:r}):o[t]?Wn({key:t,value:e[t],valueSpec:o[t],style:n,styleSpec:r}):[new Ft(t,e[t],`unknown property "${t}"`)])}if(e.source){const t=n.sources&&n.sources[e.source],r=t&&Gt(t.type);t?"raster-dem"!==r&&s.push(new Ft(i,e.source,`terrain cannot be used with a source of type ${r}, it only be used with a "raster-dem" source type`)):s.push(new Ft(i,e.source,`source "${e.source}" not found`))}else s.push(new Ft(i,e,'terrain is missing required property "source"'));return s}function jn(t){const e=t.value,i=t.style,n=t.styleSpec,r=n.fog;let o=[];const s=Ki(e);if(void 0===e)return o;if("object"!==s)return o=o.concat([new Ft("fog",e,`object expected, ${s} found`)]),o;e.range&&!cn(jt(e.range))&&e.range[0]>=e.range[1]&&(o=o.concat([new Ft("fog",e,"fog.range[0] can't be greater than or equal to fog.range[1]")]));for(const t in e){const s=t.match(/^(.*)-transition$/);o=o.concat(s&&r[s[1]]&&r[s[1]].transition?Wn({key:t,value:e[t],valueSpec:n.transition,style:i,styleSpec:n}):r[t]?Wn({key:t,value:e[t],valueSpec:r[t],style:i,styleSpec:n}):[new Ft(t,e[t],`unknown property "${t}"`)])}return o}const Hn={"*":()=>[],array:yn,boolean:function(t){const e=t.value,i=t.key,n=Ki(e);return"boolean"!==n?[new Ft(i,e,`boolean expected, ${n} found`)]:[]},number:vn,color:function(t){const e=t.key,i=t.value,n=Ki(i);return"string"!==n?[new Ft(e,i,`color expected, ${n} found`)]:null===ce.parseCSSColor(i)?[new Ft(e,i,`color expected, "${i}" found`)]:[]},constants:Vt,enum:bn,filter:Dn,function:_n,layer:Bn,object:gn,source:Vn,light:Un,terrain:Gn,fog:jn,string:zn,formatted:function(t){return 0===zn(t).length?[]:xn(t)},resolvedImage:function(t){return 0===zn(t).length?[]:xn(t)}};function Wn(t){const e=t.value,i=t.valueSpec,n=t.styleSpec;return i.expression&&$i(Gt(e))?_n(t):i.expression&&cn(jt(e))?xn(t):i.type&&Hn[i.type]?Hn[i.type](t):gn(Ut({},t,{valueSpec:i.type?n[i.type]:i}))}function qn(t){const e=t.value,i=t.key,n=zn(t);return n.length||(-1===e.indexOf("{fontstack}")&&n.push(new Ft(i,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&n.push(new Ft(i,e,'"glyphs" url must include a "{range}" token'))),n}function Xn(t,e=zt){let i=[];return i=i.concat(Wn({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:qn,"*":()=>[]}})),t.constants&&(i=i.concat(Vt({key:"constants",value:t.constants,style:t,styleSpec:e}))),Zn(i)}function Zn(t){return[].concat(t).sort(((t,e)=>t.line-e.line))}function Yn(t){return function(...e){return Zn(t.apply(this,e))}}Xn.source=Yn(Vn),Xn.light=Yn(Un),Xn.terrain=Yn(Gn),Xn.fog=Yn(jn),Xn.layer=Yn(Bn),Xn.filter=Yn(Dn),Xn.paintProperty=Yn(kn),Xn.layoutProperty=Yn(Nn);const Qn=Xn,Jn=Qn.light,Kn=Qn.fog,$n=Qn.paintProperty,tr=Qn.layoutProperty;function er(t,e){let i=!1;if(e&&e.length)for(const n of e)t.fire(new Nt(new Error(n.message))),i=!0;return i}var ir=nr;function nr(t,e,i){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var r=new Int32Array(this.arrayBuffer);t=r[0],this.d=(e=r[1])+2*(i=r[2]);for(var o=0;o<this.d*this.d;o++){var s=r[3+o],a=r[3+o+1];n.push(s===a?null:r.subarray(s,a))}var l=r[3+n.length+1];this.keys=r.subarray(r[3+n.length],l),this.bboxes=r.subarray(l),this.insert=this._insertReadonly}else{this.d=e+2*i;for(var c=0;c<this.d*this.d;c++)n.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=i,this.scale=e/t,this.uid=0;var u=i/e*t;this.min=-u,this.max=t+u}nr.prototype.insert=function(t,e,i,n,r){this._forEachCell(e,i,n,r,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(r)},nr.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},nr.prototype._insertCell=function(t,e,i,n,r,o){this.cells[r].push(o)},nr.prototype.query=function(t,e,i,n,r){var o=this.min,s=this.max;if(t<=o&&e<=o&&s<=i&&s<=n&&!r)return Array.prototype.slice.call(this.keys);var a=[];return this._forEachCell(t,e,i,n,this._queryCell,a,{},r),a},nr.prototype._queryCell=function(t,e,i,n,r,o,s,a){var l=this.cells[r];if(null!==l)for(var c=this.keys,u=this.bboxes,h=0;h<l.length;h++){var p=l[h];if(void 0===s[p]){var d=4*p;(a?a(u[d+0],u[d+1],u[d+2],u[d+3]):t<=u[d+2]&&e<=u[d+3]&&i>=u[d+0]&&n>=u[d+1])?(s[p]=!0,o.push(c[p])):s[p]=!1}}},nr.prototype._forEachCell=function(t,e,i,n,r,o,s,a){for(var l=this._convertToCellCoord(t),c=this._convertToCellCoord(e),u=this._convertToCellCoord(i),h=this._convertToCellCoord(n),p=l;p<=u;p++)for(var d=c;d<=h;d++){var f=this.d*d+p;if((!a||a(this._convertFromCellCoord(p),this._convertFromCellCoord(d),this._convertFromCellCoord(p+1),this._convertFromCellCoord(d+1)))&&r.call(this,t,e,i,n,f,o,s,a))return}},nr.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},nr.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},nr.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,i=0,n=0;n<this.cells.length;n++)i+=this.cells[n].length;var r=new Int32Array(e+i+this.keys.length+this.bboxes.length);r[0]=this.extent,r[1]=this.n,r[2]=this.padding;for(var o=e,s=0;s<t.length;s++){var a=t[s];r[3+s]=o,r.set(a,o),o+=a.length}return r[3+t.length]=o,r.set(this.keys,o),r[3+t.length+1]=o+=this.keys.length,r.set(this.bboxes,o),o+=this.bboxes.length,r.buffer};const{ImageData:rr,ImageBitmap:or}=s,sr={};function ar(t,e,i={}){Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),sr[t]={klass:e,omit:i.omit||[],shallow:i.shallow||[]}}ar("Object",Object),ir.serialize=function(t,e){const i=t.toArrayBuffer();return e&&e.push(i),{buffer:i}},ir.deserialize=function(t){return new ir(t.buffer)},ar("Grid",ir),ar("Color",ue),ar("Error",Error),ar("ResolvedImage",fe),ar("StylePropertyFunction",fn),ar("StyleExpression",ln,{omit:["_evaluator"]}),ar("ZoomDependentExpression",pn),ar("ZoomConstantExpression",hn),ar("CompoundExpression",Ce,{omit:["_evaluate"]});for(const t in Gi)Gi[t]._classRegistryKey||ar(`Expression_${t}`,Gi[t]);function lr(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function cr(t){return or&&t instanceof or}function ur(t,e){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(lr(t)||cr(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){const i=t;return e&&e.push(i.buffer),i}if(t instanceof rr)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){const i=[];for(const n of t)i.push(ur(n,e));return i}if("object"==typeof t){const i=t.constructor,n=i._classRegistryKey;if(!n)throw new Error("can't serialize object of unregistered class");const r=i.serialize?i.serialize(t,e):{};if(!i.serialize){for(const i in t){if(!t.hasOwnProperty(i))continue;if(sr[n].omit.indexOf(i)>=0)continue;const o=t[i];r[i]=sr[n].shallow.indexOf(i)>=0?o:ur(o,e)}t instanceof Error&&(r.message=t.message)}if(r.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==n&&(r.$name=n),r}throw new Error("can't serialize object of type "+typeof t)}function hr(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||lr(t)||cr(t)||ArrayBuffer.isView(t)||t instanceof rr)return t;if(Array.isArray(t))return t.map(hr);if("object"==typeof t){const e=t.$name||"Object",{klass:i}=sr[e];if(!i)throw new Error(`can't deserialize unregistered class ${e}`);if(i.deserialize)return i.deserialize(t);const n=Object.create(i.prototype);for(const i of Object.keys(t)){if("$name"===i)continue;const r=t[i];n[i]=sr[e].shallow.indexOf(i)>=0?r:hr(r)}return n}throw new Error("can't deserialize object of type "+typeof t)}class pr{constructor(){this.first=!0}update(t,e){const i=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=i,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=i,!0):(this.lastFloorZoom>i?(this.lastIntegerZoom=i+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<i&&(this.lastIntegerZoom=i,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=i,!0))}}const dr=t=>t>=1536&&t<=1791,fr=t=>t>=1872&&t<=1919,mr=t=>t>=2208&&t<=2303,gr=t=>t>=11904&&t<=12031,yr=t=>t>=12032&&t<=12255,vr=t=>t>=12272&&t<=12287,_r=t=>t>=12288&&t<=12351,xr=t=>t>=12352&&t<=12447,br=t=>t>=12448&&t<=12543,wr=t=>t>=12544&&t<=12591,Ar=t=>t>=12704&&t<=12735,Er=t=>t>=12736&&t<=12783,Sr=t=>t>=12784&&t<=12799,Mr=t=>t>=12800&&t<=13055,Tr=t=>t>=13056&&t<=13311,Ir=t=>t>=13312&&t<=19903,Cr=t=>t>=19968&&t<=40959,Pr=t=>t>=40960&&t<=42127,Lr=t=>t>=42128&&t<=42191,Dr=t=>t>=44032&&t<=55215,Rr=t=>t>=63744&&t<=64255,Or=t=>t>=64336&&t<=65023,kr=t=>t>=65040&&t<=65055,Nr=t=>t>=65072&&t<=65103,Br=t=>t>=65104&&t<=65135,zr=t=>t>=65136&&t<=65279,Fr=t=>t>=65280&&t<=65519;function Vr(t){for(const e of t)if(jr(e.charCodeAt(0)))return!0;return!1}function Ur(t){for(const e of t)if(!Gr(e.charCodeAt(0)))return!1;return!0}function Gr(t){return!(dr(t)||fr(t)||mr(t)||Or(t)||zr(t))}function jr(t){return!(746!==t&&747!==t&&(t<4352||!(Ar(t)||wr(t)||Nr(t)&&!(t>=65097&&t<=65103)||Rr(t)||Tr(t)||gr(t)||Er(t)||!(!_r(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Ir(t)||Cr(t)||Mr(t)||(t=>t>=12592&&t<=12687)(t)||(t=>t>=43360&&t<=43391)(t)||(t=>t>=55216&&t<=55295)(t)||(t=>t>=4352&&t<=4607)(t)||Dr(t)||xr(t)||vr(t)||(t=>t>=12688&&t<=12703)(t)||yr(t)||Sr(t)||br(t)&&12540!==t||!(!Fr(t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!Br(t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||(t=>t>=5120&&t<=5759)(t)||(t=>t>=6320&&t<=6399)(t)||kr(t)||(t=>t>=19904&&t<=19967)(t)||Pr(t)||Lr(t))))}function Hr(t){return!(jr(t)||function(t){return!!((t=>t>=128&&t<=255)(t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||(t=>t>=8192&&t<=8303)(t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||(t=>t>=8448&&t<=8527)(t)||(t=>t>=8528&&t<=8591)(t)||(t=>t>=8960&&t<=9215)(t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||(t=>t>=9216&&t<=9279)(t)&&9251!==t||(t=>t>=9280&&t<=9311)(t)||(t=>t>=9312&&t<=9471)(t)||(t=>t>=9632&&t<=9727)(t)||(t=>t>=9728&&t<=9983)(t)&&!(t>=9754&&t<=9759)||(t=>t>=11008&&t<=11263)(t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||_r(t)||br(t)||(t=>t>=57344&&t<=63743)(t)||Nr(t)||Br(t)||Fr(t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function Wr(t){return t>=1424&&t<=2303||Or(t)||zr(t)}function qr(t,e){return!(!e&&Wr(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||(t=>t>=6016&&t<=6143)(t))}function Xr(t){for(const e of t)if(Wr(e.charCodeAt(0)))return!0;return!1}const Zr="deferred",Yr="loading",Qr="loaded";let Jr=null,Kr="unavailable",$r=null;const to=function(t){t&&"string"==typeof t&&t.indexOf("NetworkError")>-1&&(Kr="error"),Jr&&Jr(t)};function eo(){io.fire(new kt("pluginStateChange",{pluginStatus:Kr,pluginURL:$r}))}const io=new Bt,no=function(){return Kr},ro=function(){if(Kr!==Zr||!$r)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Kr=Yr,eo(),$r&&St({url:$r},(t=>{t?to(t):(Kr=Qr,eo())}))},oo={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>Kr===Qr||null!=oo.applyArabicShaping,isLoading:()=>Kr===Yr,setState(t){Kr=t.pluginStatus,$r=t.pluginURL},isParsed:()=>null!=oo.applyArabicShaping&&null!=oo.processBidirectionalText&&null!=oo.processStyledBidirectionalText,getPluginURL:()=>$r};class so{constructor(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new pr,this.transition={})}isSupportedScript(t){return function(t,e){for(const i of t)if(!qr(i.charCodeAt(0),e))return!1;return!0}(t,oo.isLoaded())}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const t=this.zoom,e=t-Math.floor(t),i=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*i}:{fromScale:.5,toScale:1,t:1-(1-i)*e}}}class ao{constructor(t,e){this.property=t,this.value=e,this.expression=function(t,e){if($i(t))return new fn(t,e);if(cn(t)){const i=dn(t,e);if("error"===i.result)throw new Error(i.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return i.value}{let i=t;return"string"==typeof t&&"color"===e.type&&(i=ue.parse(t)),{kind:"constant",evaluate:()=>i}}}(void 0===e?t.specification.default:e,t.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(t,e,i){return this.property.possiblyEvaluate(this,t,e,i)}}class lo{constructor(t){this.property=t,this.value=new ao(t,void 0)}transitioned(t,e){return new uo(this.property,this.value,e,_({},t.transition,this.transition),t.now)}untransitioned(){return new uo(this.property,this.value,null,{},0)}}class co{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}getValue(t){return C(this._values[t].value.value)}setValue(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new lo(this._values[t].property)),this._values[t].value=new ao(this._values[t].property,null===e?void 0:C(e))}getTransition(t){return C(this._values[t].transition)}setTransition(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new lo(this._values[t].property)),this._values[t].transition=C(e)||void 0}serialize(){const t={};for(const e of Object.keys(this._values)){const i=this.getValue(e);void 0!==i&&(t[e]=i);const n=this.getTransition(e);void 0!==n&&(t[`${e}-transition`]=n)}return t}transitioned(t,e){const i=new ho(this._properties);for(const n of Object.keys(this._values))i._values[n]=this._values[n].transitioned(t,e._values[n]);return i}untransitioned(){const t=new ho(this._properties);for(const e of Object.keys(this._values))t._values[e]=this._values[e].untransitioned();return t}}class uo{constructor(t,e,i,n,r){const o=n.delay||0,s=n.duration||0;r=r||0,this.property=t,this.value=e,this.begin=r+o,this.end=this.begin+s,t.specification.transition&&(n.delay||n.duration)&&(this.prior=i)}possiblyEvaluate(t,e,i){const n=t.now||0,r=this.value.possiblyEvaluate(t,e,i),o=this.prior;if(o){if(n>this.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(n<this.begin)return o.possiblyEvaluate(t,e,i);{const s=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(t,e,i),r,p(s))}}return r}}class ho{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,e,i){const n=new mo(this._properties);for(const r of Object.keys(this._values))n._values[r]=this._values[r].possiblyEvaluate(t,e,i);return n}hasTransition(){for(const t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}}class po{constructor(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)}getValue(t){return C(this._values[t].value)}setValue(t,e){this._values[t]=new ao(this._values[t].property,null===e?void 0:C(e))}serialize(){const t={};for(const e of Object.keys(this._values)){const i=this.getValue(e);void 0!==i&&(t[e]=i)}return t}possiblyEvaluate(t,e,i){const n=new mo(this._properties);for(const r of Object.keys(this._values))n._values[r]=this._values[r].possiblyEvaluate(t,e,i);return n}}class fo{constructor(t,e,i){this.property=t,this.value=e,this.parameters=i}isConstant(){return"constant"===this.value.kind}constantOr(t){return"constant"===this.value.kind?this.value.value:t}evaluate(t,e,i,n){return this.property.evaluate(this.value,this.parameters,t,e,i,n)}}class mo{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}}class go{constructor(t){this.specification=t}possiblyEvaluate(t,e){return t.expression.evaluate(e)}interpolate(t,e,i){const n=ni[this.specification.type];return n?n(t,e,i):t}}class yo{constructor(t,e){this.specification=t,this.overrides=e}possiblyEvaluate(t,e,i,n){return new fo(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},i,n)}:t.expression,e)}interpolate(t,e,i){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new fo(this,{kind:"constant",value:void 0},t.parameters);const n=ni[this.specification.type];return n?new fo(this,{kind:"constant",value:n(t.value.value,e.value.value,i)},t.parameters):t}evaluate(t,e,i,n,r,o){return"constant"===t.kind?t.value:t.evaluate(e,i,n,r,o)}}class vo extends yo{possiblyEvaluate(t,e,i,n){if(void 0===t.value)return new fo(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){const r=t.expression.evaluate(e,null,{},i,n),o="resolvedImage"===t.property.specification.type&&"string"!=typeof r?r.name:r,s=this._calculate(o,o,o,e);return new fo(this,{kind:"constant",value:s},e)}if("camera"===t.expression.kind){const i=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new fo(this,{kind:"constant",value:i},e)}return new fo(this,t.expression,e)}evaluate(t,e,i,n,r,o){if("source"===t.kind){const s=t.evaluate(e,i,n,r,o);return this._calculate(s,s,s,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},i,n),t.evaluate({zoom:Math.floor(e.zoom)},i,n),t.evaluate({zoom:Math.floor(e.zoom)+1},i,n),e):t.value}_calculate(t,e,i,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e,other:i}:{from:i,to:e,other:t}}interpolate(t){return t}}class _o{constructor(t){this.specification=t}possiblyEvaluate(t,e,i,n){if(void 0!==t.value){if("constant"===t.expression.kind){const r=t.expression.evaluate(e,null,{},i,n);return this._calculate(r,r,r,e)}return this._calculate(t.expression.evaluate(new so(Math.floor(e.zoom-1),e)),t.expression.evaluate(new so(Math.floor(e.zoom),e)),t.expression.evaluate(new so(Math.floor(e.zoom+1),e)),e)}}_calculate(t,e,i,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:i,to:e}}interpolate(t){return t}}class xo{constructor(t){this.specification=t}possiblyEvaluate(t,e,i,n){return!!t.expression.evaluate(e,null,{},i,n)}interpolate(){return!1}}class bo{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const e in t){const i=t[e];i.specification.overridable&&this.overridableProperties.push(e);const n=this.defaultPropertyValues[e]=new ao(i,void 0),r=this.defaultTransitionablePropertyValues[e]=new lo(i);this.defaultTransitioningPropertyValues[e]=r.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}}}function wo(t,e){return 256*(t=m(Math.floor(t),0,255))+m(Math.floor(e),0,255)}ar("DataDrivenProperty",yo),ar("DataConstantProperty",go),ar("CrossFadedDataDrivenProperty",vo),ar("CrossFadedProperty",_o),ar("ColorRampProperty",xo);const Ao={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Eo{constructor(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class So{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){const e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Mo(t,e=1){let i=0,n=0;return{members:t.map((t=>{const r=Ao[t.type].BYTES_PER_ELEMENT,o=i=To(i,Math.max(e,r)),s=t.components||1;return n=Math.max(n,r),i+=r*s,{name:t.name,type:t.type,components:s,offset:o}})),size:To(i,Math.max(n,e)),alignment:e}}function To(t,e){return Math.ceil(t/e)*e}class Io extends So{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e){const i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){const n=2*t;return this.int16[n+0]=e,this.int16[n+1]=i,t}}Io.prototype.bytesPerElement=4,ar("StructArrayLayout2i4",Io);class Co extends So{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i,n)}emplace(t,e,i,n,r){const o=4*t;return this.int16[o+0]=e,this.int16[o+1]=i,this.int16[o+2]=n,this.int16[o+3]=r,t}}Co.prototype.bytesPerElement=8,ar("StructArrayLayout4i8",Co);class Po extends So{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,n,r,o,s)}emplace(t,e,i,n,r,o,s,a){const l=6*t,c=12*t,u=3*t;return this.int16[l+0]=e,this.int16[l+1]=i,this.uint8[c+4]=n,this.uint8[c+5]=r,this.uint8[c+6]=o,this.uint8[c+7]=s,this.float32[u+2]=a,t}}Po.prototype.bytesPerElement=12,ar("StructArrayLayout2i4ub1f12",Po);class Lo extends So{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e){const i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){const n=2*t;return this.float32[n+0]=e,this.float32[n+1]=i,t}}Lo.prototype.bytesPerElement=8,ar("StructArrayLayout2f8",Lo);class Do extends So{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,o,s,a,l,c){const u=this.length;return this.resize(u+1),this.emplace(u,t,e,i,n,r,o,s,a,l,c)}emplace(t,e,i,n,r,o,s,a,l,c,u){const h=10*t;return this.uint16[h+0]=e,this.uint16[h+1]=i,this.uint16[h+2]=n,this.uint16[h+3]=r,this.uint16[h+4]=o,this.uint16[h+5]=s,this.uint16[h+6]=a,this.uint16[h+7]=l,this.uint16[h+8]=c,this.uint16[h+9]=u,t}}Do.prototype.bytesPerElement=20,ar("StructArrayLayout10ui20",Do);class Ro extends So{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,o,s,a){const l=this.length;return this.resize(l+1),this.emplace(l,t,e,i,n,r,o,s,a)}emplace(t,e,i,n,r,o,s,a,l){const c=8*t;return this.uint16[c+0]=e,this.uint16[c+1]=i,this.uint16[c+2]=n,this.uint16[c+3]=r,this.uint16[c+4]=o,this.uint16[c+5]=s,this.uint16[c+6]=a,this.uint16[c+7]=l,t}}Ro.prototype.bytesPerElement=16,ar("StructArrayLayout8ui16",Ro);class Oo extends So{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,o,s,a,l,c,u,h){const p=this.length;return this.resize(p+1),this.emplace(p,t,e,i,n,r,o,s,a,l,c,u,h)}emplace(t,e,i,n,r,o,s,a,l,c,u,h,p){const d=12*t;return this.int16[d+0]=e,this.int16[d+1]=i,this.int16[d+2]=n,this.int16[d+3]=r,this.uint16[d+4]=o,this.uint16[d+5]=s,this.uint16[d+6]=a,this.uint16[d+7]=l,this.int16[d+8]=c,this.int16[d+9]=u,this.int16[d+10]=h,this.int16[d+11]=p,t}}Oo.prototype.bytesPerElement=24,ar("StructArrayLayout4i4ui4i24",Oo);class ko extends So{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,i)}emplace(t,e,i,n){const r=3*t;return this.float32[r+0]=e,this.float32[r+1]=i,this.float32[r+2]=n,t}}ko.prototype.bytesPerElement=12,ar("StructArrayLayout3f12",ko);class No extends So{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint32[1*t+0]=e,t}}No.prototype.bytesPerElement=4,ar("StructArrayLayout1ul4",No);class Bo extends So{_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(t,e,i,n,r,o,s,a,l,c){const u=this.length;return this.resize(u+1),this.emplace(u,t,e,i,n,r,o,s,a,l,c)}emplace(t,e,i,n,r,o,s,a,l,c,u){const h=16*t,p=8*t;return this.int16[h+0]=e,this.int16[h+1]=i,this.float32[p+1]=n,this.float32[p+2]=r,this.float32[p+3]=o,this.float32[p+4]=s,this.int16[h+10]=a,this.uint32[p+6]=l,this.uint16[h+14]=c,this.uint16[h+15]=u,t}}Bo.prototype.bytesPerElement=32,ar("StructArrayLayout2i4f1i1ul2ui32",Bo);class zo extends So{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,o){const s=this.length;return this.resize(s+1),this.emplace(s,t,e,i,n,r,o)}emplace(t,e,i,n,r,o,s){const a=6*t;return this.int16[a+0]=e,this.int16[a+1]=i,this.int16[a+2]=n,this.int16[a+3]=r,this.int16[a+4]=o,this.int16[a+5]=s,t}}zo.prototype.bytesPerElement=12,ar("StructArrayLayout2i2i2i12",zo);class Fo extends So{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,i,n,r)}emplace(t,e,i,n,r,o){const s=4*t,a=8*t;return this.float32[s+0]=e,this.float32[s+1]=i,this.float32[s+2]=n,this.int16[a+6]=r,this.int16[a+7]=o,t}}Fo.prototype.bytesPerElement=16,ar("StructArrayLayout2f1f2i16",Fo);class Vo extends So{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i,n)}emplace(t,e,i,n,r){const o=12*t,s=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=i,this.float32[s+1]=n,this.float32[s+2]=r,t}}Vo.prototype.bytesPerElement=12,ar("StructArrayLayout2ub2f12",Vo);class Uo extends So{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,i)}emplace(t,e,i,n){const r=3*t;return this.uint16[r+0]=e,this.uint16[r+1]=i,this.uint16[r+2]=n,t}}Uo.prototype.bytesPerElement=6,ar("StructArrayLayout3ui6",Uo);class Go extends So{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,o,s,a,l,c,u,h,p,d,f,m,g){const y=this.length;return this.resize(y+1),this.emplace(y,t,e,i,n,r,o,s,a,l,c,u,h,p,d,f,m,g)}emplace(t,e,i,n,r,o,s,a,l,c,u,h,p,d,f,m,g,y){const v=24*t,_=12*t,x=48*t;return this.int16[v+0]=e,this.int16[v+1]=i,this.uint16[v+2]=n,this.uint16[v+3]=r,this.uint32[_+2]=o,this.uint32[_+3]=s,this.uint32[_+4]=a,this.uint16[v+10]=l,this.uint16[v+11]=c,this.uint16[v+12]=u,this.float32[_+7]=h,this.float32[_+8]=p,this.uint8[x+36]=d,this.uint8[x+37]=f,this.uint8[x+38]=m,this.uint32[_+10]=g,this.int16[v+22]=y,t}}Go.prototype.bytesPerElement=48,ar("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Go);class jo extends So{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,n,r,o,s,a,l,c,u,h,p,d,f,m,g,y,v,_,x,b,w,A,E,S,M,T){const I=this.length;return this.resize(I+1),this.emplace(I,t,e,i,n,r,o,s,a,l,c,u,h,p,d,f,m,g,y,v,_,x,b,w,A,E,S,M,T)}emplace(t,e,i,n,r,o,s,a,l,c,u,h,p,d,f,m,g,y,v,_,x,b,w,A,E,S,M,T,I){const C=34*t,P=17*t;return this.int16[C+0]=e,this.int16[C+1]=i,this.int16[C+2]=n,this.int16[C+3]=r,this.int16[C+4]=o,this.int16[C+5]=s,this.int16[C+6]=a,this.int16[C+7]=l,this.uint16[C+8]=c,this.uint16[C+9]=u,this.uint16[C+10]=h,this.uint16[C+11]=p,this.uint16[C+12]=d,this.uint16[C+13]=f,this.uint16[C+14]=m,this.uint16[C+15]=g,this.uint16[C+16]=y,this.uint16[C+17]=v,this.uint16[C+18]=_,this.uint16[C+19]=x,this.uint16[C+20]=b,this.uint16[C+21]=w,this.uint16[C+22]=A,this.uint32[P+12]=E,this.float32[P+13]=S,this.float32[P+14]=M,this.float32[P+15]=T,this.float32[P+16]=I,t}}jo.prototype.bytesPerElement=68,ar("StructArrayLayout8i15ui1ul4f68",jo);class Ho extends So{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.float32[1*t+0]=e,t}}Ho.prototype.bytesPerElement=4,ar("StructArrayLayout1f4",Ho);class Wo extends So{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,i)}emplace(t,e,i,n){const r=3*t;return this.int16[r+0]=e,this.int16[r+1]=i,this.int16[r+2]=n,t}}Wo.prototype.bytesPerElement=6,ar("StructArrayLayout3i6",Wo);class qo extends So{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i,n)}emplace(t,e,i,n,r){const o=6*t;return this.uint32[3*t+0]=e,this.uint16[o+2]=i,this.uint16[o+3]=n,this.uint16[o+4]=r,t}}qo.prototype.bytesPerElement=12,ar("StructArrayLayout1ul3ui12",qo);class Xo extends So{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e){const i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){const n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=i,t}}Xo.prototype.bytesPerElement=4,ar("StructArrayLayout2ui4",Xo);class Zo extends So{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint16[1*t+0]=e,t}}Zo.prototype.bytesPerElement=2,ar("StructArrayLayout1ui2",Zo);class Yo extends So{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,n){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i,n)}emplace(t,e,i,n,r){const o=4*t;return this.float32[o+0]=e,this.float32[o+1]=i,this.float32[o+2]=n,this.float32[o+3]=r,t}}Yo.prototype.bytesPerElement=16,ar("StructArrayLayout4f16",Yo);class Qo extends Eo{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.float32[this._pos4+1]}get y1(){return this._structArray.float32[this._pos4+2]}get x2(){return this._structArray.float32[this._pos4+3]}get y2(){return this._structArray.float32[this._pos4+4]}get padding(){return this._structArray.int16[this._pos2+10]}get featureIndex(){return this._structArray.uint32[this._pos4+6]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+14]}get bucketIndex(){return this._structArray.uint16[this._pos2+15]}get anchorPoint(){return new r(this.anchorPointX,this.anchorPointY)}}Qo.prototype.size=32;class Jo extends Bo{get(t){return new Qo(this,t)}}ar("CollisionBoxArray",Jo);class Ko extends Eo{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}Ko.prototype.size=48;class $o extends Go{get(t){return new Ko(this,t)}}ar("PlacedSymbolArray",$o);class ts extends Eo{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(t){this._structArray.uint32[this._pos4+12]=t}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get textOffset0(){return this._structArray.float32[this._pos4+14]}get textOffset1(){return this._structArray.float32[this._pos4+15]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+16]}}ts.prototype.size=68;class es extends jo{get(t){return new ts(this,t)}}ar("SymbolInstanceArray",es);class is extends Ho{getoffsetX(t){return this.float32[1*t+0]}}ar("GlyphOffsetArray",is);class ns extends Wo{getx(t){return this.int16[3*t+0]}gety(t){return this.int16[3*t+1]}gettileUnitDistanceFromAnchor(t){return this.int16[3*t+2]}}ar("SymbolLineVertexArray",ns);class rs extends Eo{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]}}rs.prototype.size=12;class os extends qo{get(t){return new rs(this,t)}}ar("FeatureIndexArray",os);class ss extends Eo{get a_centroid_pos0(){return this._structArray.uint16[this._pos2+0]}get a_centroid_pos1(){return this._structArray.uint16[this._pos2+1]}}ss.prototype.size=4;class as extends Xo{get(t){return new ss(this,t)}}ar("FillExtrusionCentroidArray",as);const ls=Mo([{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"}]),cs=Mo([{name:"a_dash_to",components:4,type:"Uint16"},{name:"a_dash_from",components:4,type:"Uint16"}]);var us=le((function(t){t.exports=function(t,e){var i,n,r,o,s,a,l,c;for(n=t.length-(i=3&t.length),r=e,s=3432918353,a=461845907,c=0;c<n;)l=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24,++c,r=27492+(65535&(o=5*(65535&(r=(r^=l=(65535&(l=(l=(65535&l)*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<13|r>>>19))+((5*(r>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,i){case 3:l^=(255&t.charCodeAt(c+2))<<16;case 2:l^=(255&t.charCodeAt(c+1))<<8;case 1:r^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(c)))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295}return r^=t.length,r=2246822507*(65535&(r^=r>>>16))+((2246822507*(r>>>16)&65535)<<16)&4294967295,r=3266489909*(65535&(r^=r>>>13))+((3266489909*(r>>>16)&65535)<<16)&4294967295,(r^=r>>>16)>>>0}})),hs=le((function(t){t.exports=function(t,e){for(var i,n=t.length,r=e^n,o=0;n>=4;)i=1540483477*(65535&(i=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(i>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:r^=(255&t.charCodeAt(o+2))<<16;case 2:r^=(255&t.charCodeAt(o+1))<<8;case 1:r=1540483477*(65535&(r^=255&t.charCodeAt(o)))+((1540483477*(r>>>16)&65535)<<16)}return r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16),(r^=r>>>15)>>>0}})),ps=us,ds=hs;ps.murmur3=us,ps.murmur2=ds;class fs{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,e,i,n){this.ids.push(ms(t)),this.positions.push(e,i,n)}getPositions(t){const e=ms(t);let i=0,n=this.ids.length-1;for(;i<n;){const t=i+n>>1;this.ids[t]>=e?n=t:i=t+1}const r=[];for(;this.ids[i]===e;)r.push({index:this.positions[3*i],start:this.positions[3*i+1],end:this.positions[3*i+2]}),i++;return r}static serialize(t,e){const i=new Float64Array(t.ids),n=new Uint32Array(t.positions);return gs(i,n,0,i.length-1),e&&e.push(i.buffer,n.buffer),{ids:i,positions:n}}static deserialize(t){const e=new fs;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e}}function ms(t){const e=+t;return!isNaN(e)&&e<=a?e:ps(String(t))}function gs(t,e,i,n){for(;i<n;){const r=t[i+n>>1];let o=i-1,s=n+1;for(;;){do{o++}while(t[o]<r);do{s--}while(t[s]>r);if(o>=s)break;ys(t,o,s),ys(e,3*o,3*s),ys(e,3*o+1,3*s+1),ys(e,3*o+2,3*s+2)}s-i<n-s?(gs(t,e,i,s),i=s+1):(gs(t,e,s+1,n),n=s)}}function ys(t,e,i){const n=t[e];t[e]=t[i],t[i]=n}ar("FeaturePositionMap",fs);class vs{constructor(t,e){this.gl=t.gl,this.location=e}}class _s extends vs{constructor(t,e){super(t,e),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))}}class xs extends vs{constructor(t,e){super(t,e),this.current=[0,0,0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))}}class bs extends vs{constructor(t,e){super(t,e),this.current=ue.transparent}set(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))}}const ws=new Float32Array(16),As=new Float32Array(9);function Es(t){return[wo(255*t.r,255*t.g),wo(255*t.b,255*t.a)]}class Ss{constructor(t,e,i){this.value=t,this.uniformNames=e.map((t=>`u_${t}`)),this.type=i}setUniform(t,e,i){t.set(i.constantOr(this.value))}getBinding(t,e,i){return"color"===this.type?new bs(t,e):new _s(t,e)}}class Ms{constructor(t,e){this.uniformNames=e.map((t=>`u_${t}`)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tl.concat(e.br),this.patternTo=t.tl.concat(t.br)}setUniform(t,e,i,n){const r="u_pattern_to"===n||"u_dash_to"===n?this.patternTo:"u_pattern_from"===n||"u_dash_from"===n?this.patternFrom:"u_pixel_ratio_to"===n?this.pixelRatioTo:"u_pixel_ratio_from"===n?this.pixelRatioFrom:null;r&&t.set(r)}getBinding(t,e,i){return"u_pattern_from"===i||"u_pattern_to"===i||"u_dash_from"===i||"u_dash_to"===i?new xs(t,e):new _s(t,e)}}class Ts{constructor(t,e,i,n){this.expression=t,this.type=i,this.maxValue=0,this.paintVertexAttributes=e.map((t=>({name:`a_${t}`,type:"Float32",components:"color"===i?2:1,offset:0}))),this.paintVertexArray=new n}populatePaintArray(t,e,i,n,r){const o=this.paintVertexArray.length,s=this.expression.evaluate(new so(0),e,{},n,[],r);this.paintVertexArray.resize(t),this._setPaintValue(o,t,s)}updatePaintArray(t,e,i,n){const r=this.expression.evaluate({zoom:0},i,n);this._setPaintValue(t,e,r)}_setPaintValue(t,e,i){if("color"===this.type){const n=Es(i);for(let i=t;i<e;i++)this.paintVertexArray.emplace(i,n[0],n[1])}else{for(let n=t;n<e;n++)this.paintVertexArray.emplace(n,i);this.maxValue=Math.max(this.maxValue,Math.abs(i))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Is{constructor(t,e,i,n,r,o){this.expression=t,this.uniformNames=e.map((t=>`u_${t}_t`)),this.type=i,this.useIntegerZoom=n,this.zoom=r,this.maxValue=0,this.paintVertexAttributes=e.map((t=>({name:`a_${t}`,type:"Float32",components:"color"===i?4:2,offset:0}))),this.paintVertexArray=new o}populatePaintArray(t,e,i,n,r){const o=this.expression.evaluate(new so(this.zoom),e,{},n,[],r),s=this.expression.evaluate(new so(this.zoom+1),e,{},n,[],r),a=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(a,t,o,s)}updatePaintArray(t,e,i,n){const r=this.expression.evaluate({zoom:this.zoom},i,n),o=this.expression.evaluate({zoom:this.zoom+1},i,n);this._setPaintValue(t,e,r,o)}_setPaintValue(t,e,i,n){if("color"===this.type){const r=Es(i),o=Es(n);for(let i=t;i<e;i++)this.paintVertexArray.emplace(i,r[0],r[1],o[0],o[1])}else{for(let r=t;r<e;r++)this.paintVertexArray.emplace(r,i,n);this.maxValue=Math.max(this.maxValue,Math.abs(i),Math.abs(n))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(t,e){const i=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,n=m(this.expression.interpolationFactor(i,this.zoom,this.zoom+1),0,1);t.set(n)}getBinding(t,e,i){return new _s(t,e)}}class Cs{constructor(t,e,i,n,r,o,s){this.expression=t,this.type=i,this.useIntegerZoom=n,this.zoom=r,this.layerId=s,this.paintVertexAttributes=("array"===i?cs:ls).members;for(let t=0;t<e.length;++t);this.zoomInPaintVertexArray=new o,this.zoomOutPaintVertexArray=new o}populatePaintArray(t,e,i){const n=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(n,t,e.patterns&&e.patterns[this.layerId],i)}updatePaintArray(t,e,i,n,r){this._setPaintValues(t,e,i.patterns&&i.patterns[this.layerId],r)}_setPaintValues(t,e,i,n){if(!n||!i)return;const{min:r,mid:o,max:s}=i,a=n[r],l=n[o],c=n[s];if(a&&l&&c)for(let i=t;i<e;i++)this._setPaintValue(this.zoomInPaintVertexArray,i,l,a),this._setPaintValue(this.zoomOutPaintVertexArray,i,l,c)}_setPaintValue(t,e,i,n){t.emplace(e,i.tl[0],i.tl[1],i.br[0],i.br[1],n.tl[0],n.tl[1],n.br[0],n.br[1],i.pixelRatio,n.pixelRatio)}upload(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class Ps{constructor(t,e,i=(()=>!0)){this.binders={},this._buffers=[];const n=[];for(const r in t.paint._values){if(!i(r))continue;const o=t.paint.get(r);if(!(o instanceof fo&&Yi(o.property.specification)))continue;const s=Rs(r,t.type),a=o.value,l=o.property.specification.type,c=o.property.useIntegerZoom,u=o.property.specification["property-type"],h="cross-faded"===u||"cross-faded-data-driven"===u,p="line-dasharray"===String(r)&&"constant"!==t.layout.get("line-cap").value.kind;if("constant"!==a.kind||p)if("source"===a.kind||p||h){const i=Ns(r,l,"source");this.binders[r]=h?new Cs(a,s,l,c,e,i,t.id):new Ts(a,s,l,i),n.push(`/a_${r}`)}else{const t=Ns(r,l,"composite");this.binders[r]=new Is(a,s,l,c,e,t),n.push(`/z_${r}`)}else this.binders[r]=h?new Ms(a.value,s):new Ss(a.value,s,l),n.push(`/u_${r}`)}this.cacheKey=n.sort().join("")}getMaxValue(t){const e=this.binders[t];return e instanceof Ts||e instanceof Is?e.maxValue:0}populatePaintArrays(t,e,i,n,r){for(const o in this.binders){const s=this.binders[o];(s instanceof Ts||s instanceof Is||s instanceof Cs)&&s.populatePaintArray(t,e,i,n,r)}}setConstantPatternPositions(t,e){for(const i in this.binders){const n=this.binders[i];n instanceof Ms&&n.setConstantPatternPositions(t,e)}}updatePaintArrays(t,e,i,n,r){let o=!1;for(const s in t){const a=e.getPositions(s);for(const e of a){const a=i.feature(e.index);for(const i in this.binders){const l=this.binders[i];if((l instanceof Ts||l instanceof Is||l instanceof Cs)&&!0===l.expression.isStateDependent){const c=n.paint.get(i);l.expression=c.value,l.updatePaintArray(e.start,e.end,a,t[s],r),o=!0}}}}return o}defines(){const t=[];for(const e in this.binders){const i=this.binders[e];(i instanceof Ss||i instanceof Ms)&&t.push(...i.uniformNames.map((t=>`#define HAS_UNIFORM_${t}`)))}return t}getBinderAttributes(){const t=[];for(const e in this.binders){const i=this.binders[e];if(i instanceof Ts||i instanceof Is||i instanceof Cs)for(let e=0;e<i.paintVertexAttributes.length;e++)t.push(i.paintVertexAttributes[e].name)}return t}getBinderUniforms(){const t=[];for(const e in this.binders){const i=this.binders[e];if(i instanceof Ss||i instanceof Ms||i instanceof Is)for(const e of i.uniformNames)t.push(e)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,e){const i=[];for(const n in this.binders){const r=this.binders[n];if(r instanceof Ss||r instanceof Ms||r instanceof Is)for(const o of r.uniformNames)if(e[o]){const s=r.getBinding(t,e[o],o);i.push({name:o,property:n,binding:s})}}return i}setUniforms(t,e,i,n){for(const{name:t,property:r,binding:o}of e)this.binders[r].setUniform(o,n,i.get(r),t)}updatePaintBuffers(t){this._buffers=[];for(const e in this.binders){const i=this.binders[e];if(t&&i instanceof Cs){const e=2===t.fromScale?i.zoomInPaintVertexBuffer:i.zoomOutPaintVertexBuffer;e&&this._buffers.push(e)}else(i instanceof Ts||i instanceof Is)&&i.paintVertexBuffer&&this._buffers.push(i.paintVertexBuffer)}}upload(t){for(const e in this.binders){const i=this.binders[e];(i instanceof Ts||i instanceof Is||i instanceof Cs)&&i.upload(t)}this.updatePaintBuffers()}destroy(){for(const t in this.binders){const e=this.binders[t];(e instanceof Ts||e instanceof Is||e instanceof Cs)&&e.destroy()}}}class Ls{constructor(t,e,i=(()=>!0)){this.programConfigurations={};for(const n of t)this.programConfigurations[n.id]=new Ps(n,e,i);this.needsUpload=!1,this._featureMap=new fs,this._bufferOffset=0}populatePaintArrays(t,e,i,n,r,o){for(const i in this.programConfigurations)this.programConfigurations[i].populatePaintArrays(t,e,n,r,o);void 0!==e.id&&this._featureMap.add(e.id,i,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,e,i,n){for(const r of i)this.needsUpload=this.programConfigurations[r.id].updatePaintArrays(t,this._featureMap,e,r,n)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy()}}const Ds={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"line-dasharray":["dash_to","dash_from"]};function Rs(t,e){return Ds[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}const Os={"line-pattern":{source:Do,composite:Do},"fill-pattern":{source:Do,composite:Do},"fill-extrusion-pattern":{source:Do,composite:Do},"line-dasharray":{source:Ro,composite:Ro}},ks={color:{source:Lo,composite:Yo},number:{source:Ho,composite:Lo}};function Ns(t,e,i){const n=Os[t];return n&&n[i]||ks[e][i]}ar("ConstantBinder",Ss),ar("CrossFadedConstantBinder",Ms),ar("SourceExpressionBinder",Ts),ar("CrossFadedCompositeBinder",Cs),ar("CompositeExpressionBinder",Is),ar("ProgramConfiguration",Ps,{omit:["_buffers"]}),ar("ProgramConfigurationSet",Ls);const Bs="-transition";class zs extends Bt{constructor(t,e){if(super(),this.id=t.id,this.type=t.type,this._featureFilter={filter:()=>!0,needGeometry:!1},"custom"!==t.type&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&"sky"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),e.layout&&(this._unevaluatedLayout=new po(e.layout)),e.paint)){this._transitionablePaint=new co(e.paint);for(const e in t.paint)this.setPaintProperty(e,t.paint[e],{validate:!1});for(const e in t.layout)this.setLayoutProperty(e,t.layout[e],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new mo(e.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)}setLayoutProperty(t,e,i={}){null!=e&&this._validate(tr,`layers.${this.id}.layout.${t}`,t,e,i)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)}getPaintProperty(t){return M(t,Bs)?this._transitionablePaint.getTransition(t.slice(0,-Bs.length)):this._transitionablePaint.getValue(t)}setPaintProperty(t,e,i={}){if(null!=e&&this._validate($n,`layers.${this.id}.paint.${t}`,t,e,i))return!1;if(M(t,Bs))return this._transitionablePaint.setTransition(t.slice(0,-Bs.length),e||void 0),!1;{const i=this._transitionablePaint._values[t],n="cross-faded-data-driven"===i.property.specification["property-type"],r=i.value.isDataDriven(),o=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);const s=this._transitionablePaint._values[t].value;return s.isDataDriven()||r||n||this._handleOverridablePaintPropertyUpdate(t,o,s)}}_handleSpecialPaintPropertyUpdate(t){}getProgramIds(){return null}getProgramConfiguration(t){return null}_handleOverridablePaintPropertyUpdate(t,e,i){return!1}isHidden(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)}serialize(){const t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),I(t,((t,e)=>!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)))}_validate(t,e,i,n,r={}){return(!r||!1!==r.validate)&&er(this,t.call(Qn,{key:e,layerType:this.type,objectKey:i,value:n,styleSpec:zt,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const t in this.paint._values){const e=this.paint.get(t);if(e instanceof fo&&Yi(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1}}const Fs=Mo([{name:"a_pos",components:2,type:"Int16"}],4),{members:Vs}=Fs;class Us{constructor(t=[]){this.segments=t}prepareSegment(t,e,i,n){let r=this.segments[this.segments.length-1];return t>Us.MAX_VERTEX_ARRAY_LENGTH&&L(`Max vertices per segment is ${Us.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}`),(!r||r.vertexLength+t>Us.MAX_VERTEX_ARRAY_LENGTH||r.sortKey!==n)&&(r={vertexOffset:e.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0},void 0!==n&&(r.sortKey=n),this.segments.push(r)),r}get(){return this.segments}destroy(){for(const t of this.segments)for(const e in t.vaos)t.vaos[e].destroy()}static simpleSegment(t,e,i,n){return new Us([{vertexOffset:t,primitiveOffset:e,vertexLength:i,primitiveLength:n,vaos:{},sortKey:0}])}}Us.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,ar("SegmentVector",Us);var Gs=8192;const js=Math.pow(2,14)-1,Hs=-js-1;function Ws(t){const e=Gs/t.extent,i=t.loadGeometry();for(let t=0;t<i.length;t++){const n=i[t];for(let t=0;t<n.length;t++){const i=n[t],r=Math.round(i.x*e),o=Math.round(i.y*e);i.x=m(r,Hs,js),i.y=m(o,Hs,js),(r<i.x||r>i.x+1||o<i.y||o>i.y+1)&&L("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return i}function qs(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Ws(t):[]}}function Xs(t,e,i,n,r){t.emplaceBack(2*e+(n+1)/2,2*i+(r+1)/2)}class Zs{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Io,this.indexArray=new Uo,this.segments=new Us,this.programConfigurations=new Ls(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,i){const n=this.layers[0],r=[];let o=null;"circle"===n.type&&(o=n.layout.get("circle-sort-key"));for(const{feature:e,id:n,index:s,sourceLayerIndex:a}of t){const t=this.layers[0]._featureFilter.needGeometry,l=qs(e,t);if(!this.layers[0]._featureFilter.filter(new so(this.zoom),l,i))continue;const c=o?o.evaluate(l,{},i):void 0,u={id:n,properties:e.properties,type:e.type,sourceLayerIndex:a,index:s,geometry:t?l.geometry:Ws(e),patterns:{},sortKey:c};r.push(u)}o&&r.sort(((t,e)=>t.sortKey-e.sortKey));for(const n of r){const{geometry:r,index:o,sourceLayerIndex:s}=n,a=t[o].feature;this.addFeature(n,r,o,i),e.featureIndex.insert(a,r,o,s,this.index)}}update(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Vs),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,e,i,n){for(const i of e)for(const e of i){const i=e.x,n=e.y;if(i<0||i>=Gs||n<0||n>=Gs)continue;const r=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),o=r.vertexLength;Xs(this.layoutVertexArray,i,n,-1,-1),Xs(this.layoutVertexArray,i,n,1,-1),Xs(this.layoutVertexArray,i,n,1,1),Xs(this.layoutVertexArray,i,n,-1,1),this.indexArray.emplaceBack(o,o+1,o+2),this.indexArray.emplaceBack(o,o+3,o+2),r.vertexLength+=4,r.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{},n)}}function Ys(t,e){for(let i=0;i<t.length;i++)if(ra(e,t[i]))return!0;for(let i=0;i<e.length;i++)if(ra(t,e[i]))return!0;return!!$s(t,e)}function Qs(t,e,i){return!!ra(t,e)||!!ea(e,t,i)}function Js(t,e){if(1===t.length)return na(e,t[0]);for(let i=0;i<e.length;i++){const n=e[i];for(let e=0;e<n.length;e++)if(ra(t,n[e]))return!0}for(let i=0;i<t.length;i++)if(na(e,t[i]))return!0;for(let i=0;i<e.length;i++)if($s(t,e[i]))return!0;return!1}function Ks(t,e,i){if(t.length>1){if($s(t,e))return!0;for(let n=0;n<e.length;n++)if(ea(e[n],t,i))return!0}for(let n=0;n<t.length;n++)if(ea(t[n],e,i))return!0;return!1}function $s(t,e){if(0===t.length||0===e.length)return!1;for(let i=0;i<t.length-1;i++){const n=t[i],r=t[i+1];for(let t=0;t<e.length-1;t++)if(ta(n,r,e[t],e[t+1]))return!0}return!1}function ta(t,e,i,n){return D(t,i,n)!==D(e,i,n)&&D(t,e,i)!==D(t,e,n)}function ea(t,e,i){const n=i*i;if(1===e.length)return t.distSqr(e[0])<n;for(let i=1;i<e.length;i++)if(ia(t,e[i-1],e[i])<n)return!0;return!1}function ia(t,e,i){const n=e.distSqr(i);if(0===n)return t.distSqr(e);const r=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/n;return t.distSqr(r<0?e:r>1?i:i.sub(e)._mult(r)._add(e))}function na(t,e){let i,n,r,o=!1;for(let s=0;s<t.length;s++){i=t[s];for(let t=0,s=i.length-1;t<i.length;s=t++)n=i[t],r=i[s],n.y>e.y!=r.y>e.y&&e.x<(r.x-n.x)*(e.y-n.y)/(r.y-n.y)+n.x&&(o=!o)}return o}function ra(t,e){let i=!1;for(let n=0,r=t.length-1;n<t.length;r=n++){const o=t[n],s=t[r];o.y>e.y!=s.y>e.y&&e.x<(s.x-o.x)*(e.y-o.y)/(s.y-o.y)+o.x&&(i=!i)}return i}function oa(t,e,i,n,o){for(const r of t)if(e<=r.x&&i<=r.y&&n>=r.x&&o>=r.y)return!0;const s=[new r(e,i),new r(e,o),new r(n,o),new r(n,i)];if(t.length>2)for(const e of s)if(ra(t,e))return!0;for(let e=0;e<t.length-1;e++)if(sa(t[e],t[e+1],s))return!0;return!1}function sa(t,e,i){const n=i[0],r=i[2];if(t.x<n.x&&e.x<n.x||t.x>r.x&&e.x>r.x||t.y<n.y&&e.y<n.y||t.y>r.y&&e.y>r.y)return!1;const o=D(t,e,i[0]);return o!==D(t,e,i[1])||o!==D(t,e,i[2])||o!==D(t,e,i[3])}function aa(t,e,i){const n=e.paint.get(t).value;return"constant"===n.kind?n.value:i.programConfigurations.get(e.id).getMaxValue(t)}function la(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ca(t,e,i,n,o){if(!e[0]&&!e[1])return t;const s=r.convert(e)._mult(o);"viewport"===i&&s._rotate(-n);const a=[];for(let e=0;e<t.length;e++)a.push(t[e].sub(s));return a}function ua(t,e,i,n){const o=r.convert(t)._mult(n);return"viewport"===e&&o._rotate(-i),o}ar("CircleBucket",Zs,{omit:["layers"]});const ha=new bo({"circle-sort-key":new yo(zt.layout_circle["circle-sort-key"])});var pa={paint:new bo({"circle-radius":new yo(zt.paint_circle["circle-radius"]),"circle-color":new yo(zt.paint_circle["circle-color"]),"circle-blur":new yo(zt.paint_circle["circle-blur"]),"circle-opacity":new yo(zt.paint_circle["circle-opacity"]),"circle-translate":new go(zt.paint_circle["circle-translate"]),"circle-translate-anchor":new go(zt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new go(zt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new go(zt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new yo(zt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new yo(zt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new yo(zt.paint_circle["circle-stroke-opacity"])}),layout:ha},da="undefined"!=typeof Float32Array?Float32Array:Array;function fa(){var t=new da(9);return da!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function ma(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ga(t,e,i){var n=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],p=e[9],d=e[10],f=e[11],m=e[12],g=e[13],y=e[14],v=e[15],_=i[0],x=i[1],b=i[2],w=i[3];return t[0]=_*n+x*a+b*h+w*m,t[1]=_*r+x*l+b*p+w*g,t[2]=_*o+x*c+b*d+w*y,t[3]=_*s+x*u+b*f+w*v,t[4]=(_=i[4])*n+(x=i[5])*a+(b=i[6])*h+(w=i[7])*m,t[5]=_*r+x*l+b*p+w*g,t[6]=_*o+x*c+b*d+w*y,t[7]=_*s+x*u+b*f+w*v,t[8]=(_=i[8])*n+(x=i[9])*a+(b=i[10])*h+(w=i[11])*m,t[9]=_*r+x*l+b*p+w*g,t[10]=_*o+x*c+b*d+w*y,t[11]=_*s+x*u+b*f+w*v,t[12]=(_=i[12])*n+(x=i[13])*a+(b=i[14])*h+(w=i[15])*m,t[13]=_*r+x*l+b*p+w*g,t[14]=_*o+x*c+b*d+w*y,t[15]=_*s+x*u+b*f+w*v,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var ya=ga;function va(){var t=new da(3);return da!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function _a(t){return Math.hypot(t[0],t[1],t[2])}function xa(t,e,i){var n=new da(3);return n[0]=t,n[1]=e,n[2]=i,n}function ba(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t}function wa(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t}function Aa(t,e,i,n){return t[0]=e[0]+i[0]*n,t[1]=e[1]+i[1]*n,t[2]=e[2]+i[2]*n,t}function Ea(t,e){var i=e[0],n=e[1],r=e[2],o=i*i+n*n+r*r;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function Sa(t,e,i){var n=i[0],r=i[1],o=i[2],s=e[0],a=e[1],l=e[2],c=r*l-o*a,u=o*s-n*l,h=n*a-r*s,p=r*h-o*u,d=o*c-n*h,f=n*u-r*c,m=2*i[3];return u*=m,h*=m,d*=2,f*=2,t[0]=s+(c*=m)+(p*=2),t[1]=a+u+d,t[2]=l+h+f,t}var Ma,Ta=ba,Ia=wa,Ca=_a;function Pa(t,e,i){var n=e[0],r=e[1],o=e[2],s=e[3];return t[0]=i[0]*n+i[4]*r+i[8]*o+i[12]*s,t[1]=i[1]*n+i[5]*r+i[9]*o+i[13]*s,t[2]=i[2]*n+i[6]*r+i[10]*o+i[14]*s,t[3]=i[3]*n+i[7]*r+i[11]*o+i[15]*s,t}function La(){var t=new da(4);return da!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Da(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Ra(t,e,i){i*=.5;var n=e[0],r=e[1],o=e[2],s=e[3],a=Math.sin(i),l=Math.cos(i);return t[0]=n*l+s*a,t[1]=r*l+o*a,t[2]=o*l-r*a,t[3]=s*l-n*a,t}function Oa(t,e,i){const n=Pa([],[t.x,t.y,e,1],i);return new r(n[0]/n[3],n[1]/n[3])}va(),Ma=new da(4),da!=Float32Array&&(Ma[0]=0,Ma[1]=0,Ma[2]=0,Ma[3]=0),va(),xa(1,0,0),xa(0,1,0),La(),La(),fa();const ka=xa(0,0,0),Na=xa(0,0,1);function Ba(t,e){const i=va();return ka[2]=e,t.intersectsPlane(ka,Na,i),new r(i[0],i[1])}class za extends Zs{}function Fa(t,{width:e,height:i},n,r){if(r){if(r instanceof Uint8ClampedArray)r=new Uint8Array(r.buffer);else if(r.length!==e*i*n)throw new RangeError("mismatched image size")}else r=new Uint8Array(e*i*n);return t.width=e,t.height=i,t.data=r,t}function Va(t,{width:e,height:i},n){if(e===t.width&&i===t.height)return;const r=Fa({},{width:e,height:i},n);Ua(t,r,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,i)},n),t.width=e,t.height=i,t.data=r.data}function Ua(t,e,i,n,r,o){if(0===r.width||0===r.height)return e;if(r.width>t.width||r.height>t.height||i.x>t.width-r.width||i.y>t.height-r.height)throw new RangeError("out of range source coordinates for image copy");if(r.width>e.width||r.height>e.height||n.x>e.width-r.width||n.y>e.height-r.height)throw new RangeError("out of range destination coordinates for image copy");const s=t.data,a=e.data;for(let l=0;l<r.height;l++){const c=((i.y+l)*t.width+i.x)*o,u=((n.y+l)*e.width+n.x)*o;for(let t=0;t<r.width*o;t++)a[u+t]=s[c+t]}return e}ar("HeatmapBucket",za,{omit:["layers"]});class Ga{constructor(t,e){Fa(this,t,1,e)}resize(t){Va(this,t,1)}clone(){return new Ga({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,i,n,r){Ua(t,e,i,n,r,1)}}class ja{constructor(t,e){Fa(this,t,4,e)}resize(t){Va(this,t,4)}replace(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t}clone(){return new ja({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,i,n,r){Ua(t,e,i,n,r,4)}}ar("AlphaImage",Ga),ar("RGBAImage",ja);var Ha={paint:new bo({"heatmap-radius":new yo(zt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new yo(zt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new go(zt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new xo(zt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new go(zt.paint_heatmap["heatmap-opacity"])})};function Wa(t){const e={},i=t.resolution||256,n=t.clips?t.clips.length:1,r=t.image||new ja({width:i,height:n}),o=(i,n,o)=>{e[t.evaluationKey]=o;const s=t.expression.evaluate(e);r.data[i+n+0]=Math.floor(255*s.r/s.a),r.data[i+n+1]=Math.floor(255*s.g/s.a),r.data[i+n+2]=Math.floor(255*s.b/s.a),r.data[i+n+3]=Math.floor(255*s.a)};if(t.clips)for(let e=0,r=0;e<n;++e,r+=4*i)for(let n=0,s=0;n<i;n++,s+=4){const a=n/(i-1),{start:l,end:c}=t.clips[e];o(r,s,l*(1-a)+c*a)}else for(let t=0,e=0;t<i;t++,e+=4)o(0,e,t/(i-1));return r}var qa={paint:new bo({"hillshade-illumination-direction":new go(zt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new go(zt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new go(zt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new go(zt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new go(zt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new go(zt.paint_hillshade["hillshade-accent-color"])})};const Xa=Mo([{name:"a_pos",components:2,type:"Int16"}],4),{members:Za}=Xa;var Ya=Ja,Qa=Ja;function Ja(t,e,i){i=i||2;var n,r,o,s,a,l,c,u=e&&e.length,h=u?e[0]*i:t.length,p=Ka(t,0,h,i,!0),d=[];if(!p||p.next===p.prev)return d;if(u&&(p=function(t,e,i,n){var r,o,s,a=[];for(r=0,o=e.length;r<o;r++)(s=Ka(t,e[r]*n,r<o-1?e[r+1]*n:t.length,n,!1))===s.next&&(s.steiner=!0),a.push(cl(s));for(a.sort(ol),r=0;r<a.length;r++)sl(a[r],i),i=$a(i,i.next);return i}(t,e,p,i)),t.length>80*i){n=o=t[0],r=s=t[1];for(var f=i;f<h;f+=i)(a=t[f])<n&&(n=a),(l=t[f+1])<r&&(r=l),a>o&&(o=a),l>s&&(s=l);c=0!==(c=Math.max(o-n,s-r))?1/c:0}return tl(p,d,i,n,r,c),d}function Ka(t,e,i,n,r){var o,s;if(r===wl(t,e,i,n)>0)for(o=e;o<i;o+=n)s=_l(o,t[o],t[o+1],s);else for(o=i-n;o>=e;o-=n)s=_l(o,t[o],t[o+1],s);return s&&dl(s,s.next)&&(xl(s),s=s.next),s}function $a(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!dl(n,n.next)&&0!==pl(n.prev,n,n.next))n=n.next;else{if(xl(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function tl(t,e,i,n,r,o,s){if(t){!s&&o&&function(t,e,i,n){var r=t;do{null===r.z&&(r.z=ll(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,i,n,r,o,s,a,l,c=1;do{for(i=t,t=null,o=null,s=0;i;){for(s++,n=i,a=0,e=0;e<c&&(a++,n=n.nextZ);e++);for(l=c;a>0||l>0&&n;)0!==a&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,a--):(r=n,n=n.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;i=n}o.nextZ=null,c*=2}while(s>1)}(r)}(t,n,r,o);for(var a,l,c=t;t.prev!==t.next;)if(a=t.prev,l=t.next,o?il(t,n,r,o):el(t))e.push(a.i/i),e.push(t.i/i),e.push(l.i/i),xl(t),t=l.next,c=l.next;else if((t=l)===c){s?1===s?tl(t=nl($a(t),e,i),e,i,n,r,o,2):2===s&&rl(t,e,i,n,r,o):tl($a(t),e,i,n,r,o,1);break}}}function el(t){var e=t.prev,i=t,n=t.next;if(pl(e,i,n)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(ul(e.x,e.y,i.x,i.y,n.x,n.y,r.x,r.y)&&pl(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function il(t,e,i,n){var r=t.prev,o=t,s=t.next;if(pl(r,o,s)>=0)return!1;for(var a=r.x>o.x?r.x>s.x?r.x:s.x:o.x>s.x?o.x:s.x,l=r.y>o.y?r.y>s.y?r.y:s.y:o.y>s.y?o.y:s.y,c=ll(r.x<o.x?r.x<s.x?r.x:s.x:o.x<s.x?o.x:s.x,r.y<o.y?r.y<s.y?r.y:s.y:o.y<s.y?o.y:s.y,e,i,n),u=ll(a,l,e,i,n),h=t.prevZ,p=t.nextZ;h&&h.z>=c&&p&&p.z<=u;){if(h!==t.prev&&h!==t.next&&ul(r.x,r.y,o.x,o.y,s.x,s.y,h.x,h.y)&&pl(h.prev,h,h.next)>=0)return!1;if(h=h.prevZ,p!==t.prev&&p!==t.next&&ul(r.x,r.y,o.x,o.y,s.x,s.y,p.x,p.y)&&pl(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;h&&h.z>=c;){if(h!==t.prev&&h!==t.next&&ul(r.x,r.y,o.x,o.y,s.x,s.y,h.x,h.y)&&pl(h.prev,h,h.next)>=0)return!1;h=h.prevZ}for(;p&&p.z<=u;){if(p!==t.prev&&p!==t.next&&ul(r.x,r.y,o.x,o.y,s.x,s.y,p.x,p.y)&&pl(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function nl(t,e,i){var n=t;do{var r=n.prev,o=n.next.next;!dl(r,o)&&fl(r,n,n.next,o)&&yl(r,o)&&yl(o,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(o.i/i),xl(n),xl(n.next),n=t=o),n=n.next}while(n!==t);return $a(n)}function rl(t,e,i,n,r,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&hl(s,a)){var l=vl(s,a);return s=$a(s,s.next),l=$a(l,l.next),tl(s,e,i,n,r,o),void tl(l,e,i,n,r,o)}a=a.next}s=s.next}while(s!==t)}function ol(t,e){return t.x-e.x}function sl(t,e){if(e=function(t,e){var i,n=e,r=t.x,o=t.y,s=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var a=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=r&&a>s){if(s=a,a===r){if(o===n.y)return n;if(o===n.next.y)return n.next}i=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!i)return null;if(r===s)return i;var l,c=i,u=i.x,h=i.y,p=1/0;n=i;do{r>=n.x&&n.x>=u&&r!==n.x&&ul(o<h?r:s,o,u,h,o<h?s:r,o,n.x,n.y)&&(l=Math.abs(o-n.y)/(r-n.x),yl(n,t)&&(l<p||l===p&&(n.x>i.x||n.x===i.x&&al(i,n)))&&(i=n,p=l)),n=n.next}while(n!==c);return i}(t,e)){var i=vl(e,t);$a(e,e.next),$a(i,i.next)}}function al(t,e){return pl(t.prev,t,e.prev)<0&&pl(e.next,t,t.next)<0}function ll(t,e,i,n,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function cl(t){var e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function ul(t,e,i,n,r,o,s,a){return(r-s)*(e-a)-(t-s)*(o-a)>=0&&(t-s)*(n-a)-(i-s)*(e-a)>=0&&(i-s)*(o-a)-(r-s)*(n-a)>=0}function hl(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&fl(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(yl(t,e)&&yl(e,t)&&function(t,e){var i=t,n=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&r<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)&&(pl(t.prev,t,e.prev)||pl(t,e.prev,e))||dl(t,e)&&pl(t.prev,t,t.next)>0&&pl(e.prev,e,e.next)>0)}function pl(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function dl(t,e){return t.x===e.x&&t.y===e.y}function fl(t,e,i,n){var r=gl(pl(t,e,i)),o=gl(pl(t,e,n)),s=gl(pl(i,n,t)),a=gl(pl(i,n,e));return r!==o&&s!==a||!(0!==r||!ml(t,i,e))||!(0!==o||!ml(t,n,e))||!(0!==s||!ml(i,t,n))||!(0!==a||!ml(i,e,n))}function ml(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function gl(t){return t>0?1:t<0?-1:0}function yl(t,e){return pl(t.prev,t,t.next)<0?pl(t,e,t.next)>=0&&pl(t,t.prev,e)>=0:pl(t,e,t.prev)<0||pl(t,t.next,e)<0}function vl(t,e){var i=new bl(t.i,t.x,t.y),n=new bl(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,o.next=n,n.prev=o,n}function _l(t,e,i,n){var r=new bl(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function xl(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function bl(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function wl(t,e,i,n){for(var r=0,o=e,s=i-n;o<i;o+=n)r+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return r}function Al(t,e,i,n,r){El(t,e,i||0,n||t.length-1,r||Ml)}function El(t,e,i,n,r){for(;n>i;){if(n-i>600){var o=n-i+1,s=e-i+1,a=Math.log(o),l=.5*Math.exp(2*a/3),c=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1);El(t,e,Math.max(i,Math.floor(e-s*l/o+c)),Math.min(n,Math.floor(e+(o-s)*l/o+c)),r)}var u=t[e],h=i,p=n;for(Sl(t,i,e),r(t[n],u)>0&&Sl(t,i,n);h<p;){for(Sl(t,h,p),h++,p--;r(t[h],u)<0;)h++;for(;r(t[p],u)>0;)p--}0===r(t[i],u)?Sl(t,i,p):Sl(t,++p,n),p<=e&&(i=p+1),e<=p&&(n=p-1)}}function Sl(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function Ml(t,e){return t<e?-1:t>e?1:0}function Tl(t,e){const i=t.length;if(i<=1)return[t];const n=[];let r,o;for(let e=0;e<i;e++){const i=R(t[e]);0!==i&&(t[e].area=Math.abs(i),void 0===o&&(o=i<0),o===i<0?(r&&n.push(r),r=[t[e]]):r.push(t[e]))}if(r&&n.push(r),e>1)for(let t=0;t<n.length;t++)n[t].length<=e||(Al(n[t],e,1,n[t].length-1,Il),n[t]=n[t].slice(0,e));return n}function Il(t,e){return e.area-t.area}function Cl(t,e,i){const n=i.patternDependencies;let r=!1;for(const i of e){const e=i.paint.get(`${t}-pattern`);e.isConstant()||(r=!0);const o=e.constantOr(null);o&&(r=!0,n[o.to]=!0,n[o.from]=!0)}return r}function Pl(t,e,i,n,r){const o=r.patternDependencies;for(const s of e){const e=s.paint.get(`${t}-pattern`).value;if("constant"!==e.kind){let t=e.evaluate({zoom:n-1},i,{},r.availableImages),a=e.evaluate({zoom:n},i,{},r.availableImages),l=e.evaluate({zoom:n+1},i,{},r.availableImages);t=t&&t.name?t.name:t,a=a&&a.name?a.name:a,l=l&&l.name?l.name:l,o[t]=!0,o[a]=!0,o[l]=!0,i.patterns[s.id]={min:t,mid:a,max:l}}}return i}Ja.deviation=function(t,e,i,n){var r=e&&e.length,o=Math.abs(wl(t,0,r?e[0]*i:t.length,i));if(r)for(var s=0,a=e.length;s<a;s++)o-=Math.abs(wl(t,e[s]*i,s<a-1?e[s+1]*i:t.length,i));var l=0;for(s=0;s<n.length;s+=3){var c=n[s]*i,u=n[s+1]*i,h=n[s+2]*i;l+=Math.abs((t[c]-t[h])*(t[u+1]-t[c+1])-(t[c]-t[u])*(t[h+1]-t[c+1]))}return 0===o&&0===l?0:Math.abs((l-o)/o)},Ja.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},n=0,r=0;r<t.length;r++){for(var o=0;o<t[r].length;o++)for(var s=0;s<e;s++)i.vertices.push(t[r][o][s]);r>0&&i.holes.push(n+=t[r-1].length)}return i},Ya.default=Qa;class Ll{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Io,this.indexArray=new Uo,this.indexArray2=new Xo,this.programConfigurations=new Ls(t.layers,t.zoom),this.segments=new Us,this.segments2=new Us,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,i){this.hasPattern=Cl("fill",this.layers,e);const n=this.layers[0].layout.get("fill-sort-key"),r=[];for(const{feature:o,id:s,index:a,sourceLayerIndex:l}of t){const t=this.layers[0]._featureFilter.needGeometry,c=qs(o,t);if(!this.layers[0]._featureFilter.filter(new so(this.zoom),c,i))continue;const u=n?n.evaluate(c,{},i,e.availableImages):void 0,h={id:s,properties:o.properties,type:o.type,sourceLayerIndex:l,index:a,geometry:t?c.geometry:Ws(o),patterns:{},sortKey:u};r.push(h)}n&&r.sort(((t,e)=>t.sortKey-e.sortKey));for(const n of r){const{geometry:r,index:o,sourceLayerIndex:s}=n;if(this.hasPattern){const t=Pl("fill",this.layers,n,this.zoom,e);this.patternFeatures.push(t)}else this.addFeature(n,r,o,i,{});e.featureIndex.insert(t[o].feature,r,o,s,this.index)}}update(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)}addFeatures(t,e,i){for(const t of this.patternFeatures)this.addFeature(t,t.geometry,t.index,e,i)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Za),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,e,i,n,r){for(const t of Tl(e,500)){let e=0;for(const i of t)e+=i.length;const i=this.segments.prepareSegment(e,this.layoutVertexArray,this.indexArray),n=i.vertexLength,r=[],o=[];for(const e of t){if(0===e.length)continue;e!==t[0]&&o.push(r.length/2);const i=this.segments2.prepareSegment(e.length,this.layoutVertexArray,this.indexArray2),n=i.vertexLength;this.layoutVertexArray.emplaceBack(e[0].x,e[0].y),this.indexArray2.emplaceBack(n+e.length-1,n),r.push(e[0].x),r.push(e[0].y);for(let t=1;t<e.length;t++)this.layoutVertexArray.emplaceBack(e[t].x,e[t].y),this.indexArray2.emplaceBack(n+t-1,n+t),r.push(e[t].x),r.push(e[t].y);i.vertexLength+=e.length,i.primitiveLength+=e.length}const s=Ya(r,o);for(let t=0;t<s.length;t+=3)this.indexArray.emplaceBack(n+s[t],n+s[t+1],n+s[t+2]);i.vertexLength+=e,i.primitiveLength+=s.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,r,n)}}ar("FillBucket",Ll,{omit:["layers","patternFeatures"]});const Dl=new bo({"fill-sort-key":new yo(zt.layout_fill["fill-sort-key"])});var Rl={paint:new bo({"fill-antialias":new go(zt.paint_fill["fill-antialias"]),"fill-opacity":new yo(zt.paint_fill["fill-opacity"]),"fill-color":new yo(zt.paint_fill["fill-color"]),"fill-outline-color":new yo(zt.paint_fill["fill-outline-color"]),"fill-translate":new go(zt.paint_fill["fill-translate"]),"fill-translate-anchor":new go(zt.paint_fill["fill-translate-anchor"]),"fill-pattern":new vo(zt.paint_fill["fill-pattern"])}),layout:Dl};const Ol=Mo([{name:"a_pos_normal_ed",components:4,type:"Int16"}]),kl=Mo([{name:"a_centroid_pos",components:2,type:"Uint16"}]),{members:Nl}=Ol;var Bl=zl;function zl(t,e,i,n,r){this.properties={},this.extent=i,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=r,t.readFields(Fl,this,e)}function Fl(t,e,i){1==t?e.id=i.readVarint():2==t?function(t,e){for(var i=t.readVarint()+t.pos;t.pos<i;){var n=e._keys[t.readVarint()],r=e._values[t.readVarint()];e.properties[n]=r}}(i,e):3==t?e.type=i.readVarint():4==t&&(e._geometry=i.pos)}function Vl(t){for(var e,i,n=0,r=0,o=t.length,s=o-1;r<o;s=r++)n+=((i=t[s]).x-(e=t[r]).x)*(e.y+i.y);return n}zl.types=["Unknown","Point","LineString","Polygon"],zl.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,i=t.readVarint()+t.pos,n=1,o=0,s=0,a=0,l=[];t.pos<i;){if(o<=0){var c=t.readVarint();n=7&c,o=c>>3}if(o--,1===n||2===n)s+=t.readSVarint(),a+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new r(s,a));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},zl.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,i=1,n=0,r=0,o=0,s=1/0,a=-1/0,l=1/0,c=-1/0;t.pos<e;){if(n<=0){var u=t.readVarint();i=7&u,n=u>>3}if(n--,1===i||2===i)(r+=t.readSVarint())<s&&(s=r),r>a&&(a=r),(o+=t.readSVarint())<l&&(l=o),o>c&&(c=o);else if(7!==i)throw new Error("unknown command "+i)}return[s,l,a,c]},zl.prototype.toGeoJSON=function(t,e,i){var n,r,o=this.extent*Math.pow(2,i),s=this.extent*t,a=this.extent*e,l=this.loadGeometry(),c=zl.types[this.type];function u(t){for(var e=0;e<t.length;e++){var i=t[e];t[e]=[360*(i.x+s)/o-180,360/Math.PI*Math.atan(Math.exp((180-360*(i.y+a)/o)*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(n=0;n<l.length;n++)h[n]=l[n][0];u(l=h);break;case 2:for(n=0;n<l.length;n++)u(l[n]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var i,n,r=[],o=0;o<e;o++){var s=Vl(t[o]);0!==s&&(void 0===n&&(n=s<0),n===s<0?(i&&r.push(i),i=[t[o]]):i.push(t[o]))}return i&&r.push(i),r}(l),n=0;n<l.length;n++)for(r=0;r<l[n].length;r++)u(l[n][r])}1===l.length?l=l[0]:c="Multi"+c;var p={type:"Feature",geometry:{type:c,coordinates:l},properties:this.properties};return"id"in this&&(p.id=this.id),p};var Ul=Gl;function Gl(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(jl,this,e),this.length=this._features.length}function jl(t,e,i){15===t?e.version=i.readVarint():1===t?e.name=i.readString():5===t?e.extent=i.readVarint():2===t?e._features.push(i.pos):3===t?e._keys.push(i.readString()):4===t&&e._values.push(function(t){for(var e=null,i=t.readVarint()+t.pos;t.pos<i;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(i))}function Hl(t,e,i){if(3===t){var n=new Ul(i,i.readVarint()+i.pos);n.length&&(e[n.name]=n)}}Gl.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new Bl(this._pbf,e,this.extent,this._keys,this._values)};var Wl={VectorTile:function(t,e){this.layers=t.readFields(Hl,{},e)},VectorTileFeature:Bl,VectorTileLayer:Ul};const ql=Wl.VectorTileFeature.types,Xl=Math.pow(2,13);function Zl(t,e,i,n,r,o,s,a){t.emplaceBack((e<<1)+s,(i<<1)+o,(Math.floor(n*Xl)<<1)+r,Math.round(a))}class Yl{constructor(){this.acc=new r(0,0),this.polyCount=[]}startRing(t){this.currentPolyCount={edges:0,top:0},this.polyCount.push(this.currentPolyCount),this.min||(this.min=new r(t.x,t.y),this.max=new r(t.x,t.y))}append(t,e){this.currentPolyCount.edges++,this.acc._add(t);let i=!!this.borders;const n=this.min,r=this.max;t.x<n.x?(n.x=t.x,i=!0):t.x>r.x&&(r.x=t.x,i=!0),t.y<n.y?(n.y=t.y,i=!0):t.y>r.y&&(r.y=t.y,i=!0),((0===t.x||t.x===Gs)&&t.x===e.x)!=((0===t.y||t.y===Gs)&&t.y===e.y)&&this.processBorderOverlap(t,e),i&&this.checkBorderIntersection(t,e)}checkBorderIntersection(t,e){e.x<0!=t.x<0&&this.addBorderIntersection(0,ii(e.y,t.y,(0-e.x)/(t.x-e.x))),e.x>Gs!=t.x>Gs&&this.addBorderIntersection(1,ii(e.y,t.y,(Gs-e.x)/(t.x-e.x))),e.y<0!=t.y<0&&this.addBorderIntersection(2,ii(e.x,t.x,(0-e.y)/(t.y-e.y))),e.y>Gs!=t.y>Gs&&this.addBorderIntersection(3,ii(e.x,t.x,(Gs-e.y)/(t.y-e.y)))}addBorderIntersection(t,e){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 i=this.borders[t];e<i[0]&&(i[0]=e),e>i[1]&&(i[1]=e)}processBorderOverlap(t,e){if(t.x===e.x){if(t.y===e.y)return;const i=0===t.x?0:1;this.addBorderIntersection(i,e.y),this.addBorderIntersection(i,t.y)}else{const i=0===t.y?2:3;this.addBorderIntersection(i,e.x),this.addBorderIntersection(i,t.x)}}centroid(){const t=this.polyCount.reduce(((t,e)=>t+e.edges),0);return 0!==t?this.acc.div(t)._round():new r(0,0)}span(){return new r(this.max.x-this.min.x,this.max.y-this.min.y)}intersectsCount(){return this.borders.reduce(((t,e)=>t+ +(e[0]!==Number.MAX_VALUE)),0)}}class Ql{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Co,this.centroidVertexArray=new as,this.indexArray=new Uo,this.programConfigurations=new Ls(t.layers,t.zoom),this.segments=new Us,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.enableTerrain=t.enableTerrain}populate(t,e,i){this.features=[],this.hasPattern=Cl("fill-extrusion",this.layers,e),this.featuresOnBorder=[],this.borders=[[],[],[],[]],this.borderDone=[!1,!1,!1,!1],this.tileToMeter=function(t){const e=Math.exp(Math.PI*(1-t.y/(1<<t.z)*2));return 80150034*e/(e*e+1)/Gs/(1<<t.z)}(i);for(const{feature:n,id:r,index:o,sourceLayerIndex:s}of t){const t=this.layers[0]._featureFilter.needGeometry,a=qs(n,t);if(!this.layers[0]._featureFilter.filter(new so(this.zoom),a,i))continue;const l={id:r,sourceLayerIndex:s,index:o,geometry:t?a.geometry:Ws(n),properties:n.properties,type:n.type,patterns:{}},c=this.layoutVertexArray.length;this.hasPattern?this.features.push(Pl("fill-extrusion",this.layers,l,this.zoom,e)):this.addFeature(l,l.geometry,o,i,{}),e.featureIndex.insert(n,l.geometry,o,s,this.index,c)}this.sortBorders()}addFeatures(t,e,i){for(const t of this.features){const{geometry:n}=t;this.addFeature(t,n,t.index,e,i)}this.sortBorders()}update(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Nl),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}uploadCentroid(t){0!==this.centroidVertexArray.length&&(this.centroidVertexBuffer?this.needsCentroidUpdate&&this.centroidVertexBuffer.updateData(this.centroidVertexArray):this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,kl.members,!0),this.needsCentroidUpdate=!1)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,e,i,n,r){const o=this.enableTerrain&&t.properties&&"Polygon"===ql[t.type]?new Yl:null;for(const i of Tl(e,500)){let e=0,n=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);if(0===i.length||(s=i[0]).every((t=>t.x<=0))||s.every((t=>t.x>=Gs))||s.every((t=>t.y<=0))||s.every((t=>t.y>=Gs)))continue;for(let t=0;t<i.length;t++){const r=i[t];if(0===r.length)continue;e+=r.length;let s=0;o&&o.startRing(r[0]);for(let t=0;t<r.length;t++){const e=r[t];if(t>=1){const i=r[t-1];if(!Jl(e,i)){o&&o.append(e,i),n.vertexLength+4>Us.MAX_VERTEX_ARRAY_LENGTH&&(n=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const t=e.sub(i)._perp(),r=t.x/(Math.abs(t.x)+Math.abs(t.y)),a=t.y>0?1:0,l=i.dist(e);s+l>32768&&(s=0),Zl(this.layoutVertexArray,e.x,e.y,r,a,0,0,s),Zl(this.layoutVertexArray,e.x,e.y,r,a,0,1,s),s+=l,Zl(this.layoutVertexArray,i.x,i.y,r,a,0,0,s),Zl(this.layoutVertexArray,i.x,i.y,r,a,0,1,s);const c=n.vertexLength;this.indexArray.emplaceBack(c,c+2,c+1),this.indexArray.emplaceBack(c+1,c+2,c+3),n.vertexLength+=4,n.primitiveLength+=2}}}}if(n.vertexLength+e>Us.MAX_VERTEX_ARRAY_LENGTH&&(n=this.segments.prepareSegment(e,this.layoutVertexArray,this.indexArray)),"Polygon"!==ql[t.type])continue;const r=[],a=[],l=n.vertexLength;for(let t=0;t<i.length;t++){const e=i[t];if(0!==e.length){e!==i[0]&&a.push(r.length/2);for(let t=0;t<e.length;t++){const i=e[t];Zl(this.layoutVertexArray,i.x,i.y,0,0,1,1,0),r.push(i.x),r.push(i.y),o&&o.currentPolyCount.top++}}}const c=Ya(r,a);for(let t=0;t<c.length;t+=3)this.indexArray.emplaceBack(l+c[t],l+c[t+2],l+c[t+1]);n.primitiveLength+=c.length/3,n.vertexLength+=e}var s;if(o&&o.polyCount.length>0){if(o.borders){o.vertexArrayOffset=this.centroidVertexArray.length;const t=o.borders,e=this.featuresOnBorder.push(o)-1;for(let i=0;i<4;i++)t[i][0]!==Number.MAX_VALUE&&this.borders[i].push(e)}this.encodeCentroid(o.borders?void 0:o.centroid(),o)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,r,n)}sortBorders(){for(let t=0;t<4;t++)this.borders[t].sort(((e,i)=>this.featuresOnBorder[e].borders[t][0]-this.featuresOnBorder[i].borders[t][0]))}encodeCentroid(t,e,i=!0){let n,r;if(t)if(0!==t.y){const i=e.span()._mult(this.tileToMeter);n=(Math.max(t.x,1)<<3)+Math.min(7,Math.round(i.x/10)),r=(Math.max(t.y,1)<<3)+Math.min(7,Math.round(i.y/10))}else n=Math.ceil(7*(t.x+450)),r=0;else n=0,r=+i;let o=i?this.centroidVertexArray.length:e.vertexArrayOffset;for(const t of e.polyCount){i&&this.centroidVertexArray.resize(this.centroidVertexArray.length+4*t.edges+t.top);for(let e=0;e<2*t.edges;e++)this.centroidVertexArray.emplace(o++,0,r),this.centroidVertexArray.emplace(o++,n,r);for(let e=0;e<t.top;e++)this.centroidVertexArray.emplace(o++,n,r)}}}function Jl(t,e){return t.x===e.x&&(t.x<0||t.x>Gs)||t.y===e.y&&(t.y<0||t.y>Gs)}ar("FillExtrusionBucket",Ql,{omit:["layers","features"]}),ar("PartMetadata",Yl);var Kl={paint:new bo({"fill-extrusion-opacity":new go(zt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new yo(zt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new go(zt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new go(zt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new vo(zt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new yo(zt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new yo(zt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new go(zt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})};function $l(t,e){return t.x*e.x+t.y*e.y}function tc(t,e){if(1===t.length){let i=0;const n=e[i++];let r;for(;!r||n.equals(r);)if(r=e[i++],!r)return 1/0;for(;i<e.length;i++){const o=e[i],s=t[0],a=r.sub(n),l=o.sub(n),c=s.sub(n),u=$l(a,a),h=$l(a,l),p=$l(l,l),d=$l(c,a),f=$l(c,l),m=u*p-h*h,g=(p*d-h*f)/m,y=(u*f-h*d)/m,v=n.z*(1-g-y)+r.z*g+o.z*y;if(isFinite(v))return v}return 1/0}{let t=1/0;for(const i of e)t=Math.min(t,i.z);return t}}function ec(t){const e=new r(t[0],t[1]);return e.z=t[2],e}function ic(t,e,i,n,r,o,s,a){const l=s*r.getElevationAt(t,e,!0,!0),c=0!==o[0],u=c?0===o[1]?s*(o[0]/7-450):s*function(t,e,i){const n=Math.floor(e[0]/8),r=Math.floor(e[1]/8),o=10*(e[0]-8*n),s=10*(e[1]-8*r),a=t.getElevationAt(n,r,!0,!0),l=t.getMeterToDEM(i),c=Math.floor(.5*(o*l-1)),u=Math.floor(.5*(s*l-1)),h=t.tileCoordToPixel(n,r),p=2*c+1,d=2*u+1,f=function(t,e,i,n,r){return[t.getElevationAtPixel(e,i,!0),t.getElevationAtPixel(e+r,i,!0),t.getElevationAtPixel(e,i+r,!0),t.getElevationAtPixel(e+n,i+r,!0)]}(t,h.x-c,h.y-u,p,d),m=Math.abs(f[0]-f[1]),g=Math.abs(f[2]-f[3]),y=Math.abs(f[0]-f[2])+Math.abs(f[1]-f[3]),v=Math.min(.25,.5*l*(m+g)/p),_=Math.min(.25,.5*l*y/d);return a+Math.max(v*o,_*s)}(r,o,a):l;return{base:l+(0===i)?-1:i,top:c?Math.max(u+n,l+i+2):l+n}}const nc=Mo([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_linesofar",components:1,type:"Float32"}],4),{members:rc}=nc,oc=Mo([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:sc}=oc;var ac=lc;function lc(t,e,i,n,r){this.properties={},this.extent=i,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=r,t.readFields(cc,this,e)}function cc(t,e,i){1==t?e.id=i.readVarint():2==t?function(t,e){for(var i=t.readVarint()+t.pos;t.pos<i;){var n=e._keys[t.readVarint()],r=e._values[t.readVarint()];e.properties[n]=r}}(i,e):3==t?e.type=i.readVarint():4==t&&(e._geometry=i.pos)}function uc(t){for(var e,i,n=0,r=0,o=t.length,s=o-1;r<o;s=r++)n+=((i=t[s]).x-(e=t[r]).x)*(e.y+i.y);return n}lc.types=["Unknown","Point","LineString","Polygon"],lc.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,i=t.readVarint()+t.pos,n=1,o=0,s=0,a=0,l=[];t.pos<i;){if(o<=0){var c=t.readVarint();n=7&c,o=c>>3}if(o--,1===n||2===n)s+=t.readSVarint(),a+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new r(s,a));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},lc.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,i=1,n=0,r=0,o=0,s=1/0,a=-1/0,l=1/0,c=-1/0;t.pos<e;){if(n<=0){var u=t.readVarint();i=7&u,n=u>>3}if(n--,1===i||2===i)(r+=t.readSVarint())<s&&(s=r),r>a&&(a=r),(o+=t.readSVarint())<l&&(l=o),o>c&&(c=o);else if(7!==i)throw new Error("unknown command "+i)}return[s,l,a,c]},lc.prototype.toGeoJSON=function(t,e,i){var n,r,o=this.extent*Math.pow(2,i),s=this.extent*t,a=this.extent*e,l=this.loadGeometry(),c=lc.types[this.type];function u(t){for(var e=0;e<t.length;e++){var i=t[e];t[e]=[360*(i.x+s)/o-180,90-360*(i.y+a)/o]}}switch(this.type){case 1:var h=[];for(n=0;n<l.length;n++)h[n]=l[n][0];u(l=h);break;case 2:for(n=0;n<l.length;n++)u(l[n]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var i,n,r=[],o=0;o<e;o++){var s=uc(t[o]);0!==s&&(void 0===n&&(n=s<0),n===s<0?(i&&r.push(i),i=[t[o]]):i.push(t[o]))}return i&&r.push(i),r}(l),n=0;n<l.length;n++)for(r=0;r<l[n].length;r++)u(l[n][r])}1===l.length?l=l[0]:c="Multi"+c;var p={type:"Feature",geometry:{type:c,coordinates:l},properties:this.properties};return"id"in this&&(p.id=this.id),p};var hc=pc;function pc(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(dc,this,e),this.length=this._features.length}function dc(t,e,i){15===t?e.version=i.readVarint():1===t?e.name=i.readString():5===t?e.extent=i.readVarint():2===t?e._features.push(i.pos):3===t?e._keys.push(i.readString()):4===t&&e._values.push(function(t){for(var e=null,i=t.readVarint()+t.pos;t.pos<i;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(i))}function fc(t,e,i){if(3===t){var n=new hc(i,i.readVarint()+i.pos);n.length&&(e[n.name]=n)}}pc.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new ac(this._pbf,e,this.extent,this._keys,this._values)};var mc={VectorTile:function(t,e){this.layers=t.readFields(fc,{},e)},VectorTileFeature:ac,VectorTileLayer:hc};const gc=mc.VectorTileFeature.types,yc=Math.cos(Math.PI/180*37.5);class vc{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((t=>{this.gradients[t.id]={}})),this.layoutVertexArray=new Po,this.layoutVertexArray2=new Lo,this.indexArray=new Uo,this.programConfigurations=new Ls(t.layers,t.zoom),this.segments=new Us,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,i){this.hasPattern=Cl("line",this.layers,e);const n=this.layers[0].layout.get("line-sort-key"),r=[];for(const{feature:e,id:o,index:s,sourceLayerIndex:a}of t){const t=this.layers[0]._featureFilter.needGeometry,l=qs(e,t);if(!this.layers[0]._featureFilter.filter(new so(this.zoom),l,i))continue;const c=n?n.evaluate(l,{},i):void 0,u={id:o,properties:e.properties,type:e.type,sourceLayerIndex:a,index:s,geometry:t?l.geometry:Ws(e),patterns:{},sortKey:c};r.push(u)}n&&r.sort(((t,e)=>t.sortKey-e.sortKey));const{lineAtlas:o,featureIndex:s}=e,a=this.addConstantDashes(o);for(const n of r){const{geometry:r,index:l,sourceLayerIndex:c}=n;if(a&&this.addFeatureDashes(n,o),this.hasPattern){const t=Pl("line",this.layers,n,this.zoom,e);this.patternFeatures.push(t)}else this.addFeature(n,r,l,i,o.positions);s.insert(t[l].feature,r,l,c,this.index)}}addConstantDashes(t){let e=!1;for(const i of this.layers){const n=i.paint.get("line-dasharray").value,r=i.layout.get("line-cap").value;if("constant"!==n.kind||"constant"!==r.kind)e=!0;else{const e=r.value,i=n.value;if(!i)continue;t.addDash(i.from,e),t.addDash(i.to,e),i.other&&t.addDash(i.other,e)}}return e}addFeatureDashes(t,e){const i=this.zoom;for(const n of this.layers){const r=n.paint.get("line-dasharray").value,o=n.layout.get("line-cap").value;if("constant"===r.kind&&"constant"===o.kind)continue;let s,a,l,c,u,h;if("constant"===r.kind){const t=r.value;if(!t)continue;s=t.other||t.to,a=t.to,l=t.from}else s=r.evaluate({zoom:i-1},t),a=r.evaluate({zoom:i},t),l=r.evaluate({zoom:i+1},t);"constant"===o.kind?c=u=h=o.value:(c=o.evaluate({zoom:i-1},t),u=o.evaluate({zoom:i},t),h=o.evaluate({zoom:i+1},t)),e.addDash(s,c),e.addDash(a,u),e.addDash(l,h);const p=e.getKey(s,c),d=e.getKey(a,u),f=e.getKey(l,h);t.patterns[n.id]={min:p,mid:d,max:f}}}update(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)}addFeatures(t,e,i){for(const t of this.patternFeatures)this.addFeature(t,t.geometry,t.index,e,i)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,sc)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,rc),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&t.properties.hasOwnProperty("mapbox_clip_start")&&t.properties.hasOwnProperty("mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}addFeature(t,e,i,n,r){const o=this.layers[0].layout,s=o.get("line-join").evaluate(t,{}),a=o.get("line-cap").evaluate(t,{}),l=o.get("line-miter-limit"),c=o.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(const i of e)this.addLine(i,t,s,a,l,c);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,r,n)}addLine(t,e,i,n,r,o){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineSoFar=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let e=0;e<t.length-1;e++)this.totalDistance+=t[e].dist(t[e+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const s="Polygon"===gc[e.type];let a=t.length;for(;a>=2&&t[a-1].equals(t[a-2]);)a--;let l=0;for(;l<a-1&&t[l].equals(t[l+1]);)l++;if(a<(s?3:2))return;"bevel"===i&&(r=1.05);const c=this.overscaling<=16?122880/(512*this.overscaling):0,u=this.segments.prepareSegment(10*a,this.layoutVertexArray,this.indexArray);let h,p,d,f,m;this.e1=this.e2=-1,s&&(h=t[a-2],m=t[l].sub(h)._unit()._perp());for(let e=l;e<a;e++){if(d=e===a-1?s?t[l+1]:void 0:t[e+1],d&&t[e].equals(d))continue;m&&(f=m),h&&(p=h),h=t[e],m=d?d.sub(h)._unit()._perp():f,f=f||m;let g=f.add(m);0===g.x&&0===g.y||g._unit();const y=f.x*m.x+f.y*m.y,v=g.x*m.x+g.y*m.y,_=0!==v?1/v:1/0,x=2*Math.sqrt(2-2*v),b=v<yc&&p&&d,w=f.x*m.y-f.y*m.x>0;if(b&&e>l){const t=h.dist(p);if(t>2*c){const e=h.sub(h.sub(p)._mult(c/t)._round());this.updateDistance(p,e),this.addCurrentVertex(e,f,0,0,u),p=e}}const A=p&&d;let E=A?i:s?"butt":n;if(A&&"round"===E&&(_<o?E="miter":_<=2&&(E="fakeround")),"miter"===E&&_>r&&(E="bevel"),"bevel"===E&&(_>2&&(E="flipbevel"),_<r&&(E="miter")),p&&this.updateDistance(p,h),"miter"===E)g._mult(_),this.addCurrentVertex(h,g,0,0,u);else if("flipbevel"===E){if(_>100)g=m.mult(-1);else{const t=_*f.add(m).mag()/f.sub(m).mag();g._perp()._mult(t*(w?-1:1))}this.addCurrentVertex(h,g,0,0,u),this.addCurrentVertex(h,g.mult(-1),0,0,u)}else if("bevel"===E||"fakeround"===E){const t=-Math.sqrt(_*_-1),e=w?t:0,i=w?0:t;if(p&&this.addCurrentVertex(h,f,e,i,u),"fakeround"===E){const t=Math.round(180*x/Math.PI/20);for(let e=1;e<t;e++){let i=e/t;if(.5!==i){const t=i-.5;i+=i*t*(i-1)*((1.0904+y*(y*(3.55645-1.43519*y)-3.2452))*t*t+(.848013+y*(.215638*y-1.06021)))}const n=m.sub(f)._mult(i)._add(f)._unit()._mult(w?-1:1);this.addHalfVertex(h,n.x,n.y,!1,w,0,u)}}d&&this.addCurrentVertex(h,m,-e,-i,u)}else if("butt"===E)this.addCurrentVertex(h,g,0,0,u);else if("square"===E){const t=p?1:-1;p||this.addCurrentVertex(h,g,t,t,u),this.addCurrentVertex(h,g,0,0,u),p&&this.addCurrentVertex(h,g,t,t,u)}else"round"===E&&(p&&(this.addCurrentVertex(h,f,0,0,u),this.addCurrentVertex(h,f,1,1,u,!0)),d&&(this.addCurrentVertex(h,m,-1,-1,u,!0),this.addCurrentVertex(h,m,0,0,u)));if(b&&e<a-1){const t=h.dist(d);if(t>2*c){const e=h.add(d.sub(h)._mult(c/t)._round());this.updateDistance(h,e),this.addCurrentVertex(e,m,0,0,u),h=e}}}}addCurrentVertex(t,e,i,n,r,o=!1){const s=e.y*n-e.x,a=-e.y-e.x*n;this.addHalfVertex(t,e.x+e.y*i,e.y-e.x*i,o,!1,i,r),this.addHalfVertex(t,s,a,o,!0,-n,r)}addHalfVertex({x:t,y:e},i,n,r,o,s,a){this.layoutVertexArray.emplaceBack((t<<1)+(r?1:0),(e<<1)+(o?1:0),Math.round(63*i)+128,Math.round(63*n)+128,1+(0===s?0:s<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length);const l=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,l),a.primitiveLength++),o?this.e2=l:this.e1=l}updateScaledDistance(){if(this.lineClips){const t=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=t*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(t,e){this.distance+=t.dist(e),this.updateScaledDistance()}}ar("LineBucket",vc,{omit:["layers","patternFeatures"]});const _c=new bo({"line-cap":new yo(zt.layout_line["line-cap"]),"line-join":new yo(zt.layout_line["line-join"]),"line-miter-limit":new go(zt.layout_line["line-miter-limit"]),"line-round-limit":new go(zt.layout_line["line-round-limit"]),"line-sort-key":new yo(zt.layout_line["line-sort-key"])});var xc={paint:new bo({"line-opacity":new yo(zt.paint_line["line-opacity"]),"line-color":new yo(zt.paint_line["line-color"]),"line-translate":new go(zt.paint_line["line-translate"]),"line-translate-anchor":new go(zt.paint_line["line-translate-anchor"]),"line-width":new yo(zt.paint_line["line-width"]),"line-gap-width":new yo(zt.paint_line["line-gap-width"]),"line-offset":new yo(zt.paint_line["line-offset"]),"line-blur":new yo(zt.paint_line["line-blur"]),"line-dasharray":new vo(zt.paint_line["line-dasharray"]),"line-pattern":new vo(zt.paint_line["line-pattern"]),"line-gradient":new xo(zt.paint_line["line-gradient"])}),layout:_c};const bc=new class extends yo{possiblyEvaluate(t,e){return e=new so(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,i,n){return e=_({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,i,n)}}(xc.paint.properties["line-width"].specification);function wc(t,e){return e>0?e+2*t:t}bc.useIntegerZoom=!0;const Ac=Mo([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Ec=Mo([{name:"a_projected_pos",components:3,type:"Float32"}],4);Mo([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Sc=Mo([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),Mc=Mo([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"}]);Mo([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{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 Tc=Mo([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Ic=Mo([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);Mo([{name:"triangle",components:3,type:"Uint16"}]),Mo([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Mo([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Mo([{type:"Float32",name:"offsetX"}]),Mo([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Cc=24;const Pc=128;function Lc(t,e){const{expression:i}=e;if("constant"===i.kind)return{kind:"constant",layoutSize:i.evaluate(new so(t+1))};if("source"===i.kind)return{kind:"source"};{const{zoomStops:e,interpolationType:n}=i;let r=0;for(;r<e.length&&e[r]<=t;)r++;r=Math.max(0,r-1);let o=r;for(;o<e.length&&e[o]<t+1;)o++;o=Math.min(e.length-1,o);const s=e[r],a=e[o];return"composite"===i.kind?{kind:"composite",minZoom:s,maxZoom:a,interpolationType:n}:{kind:"camera",minZoom:s,maxZoom:a,minSize:i.evaluate(new so(s)),maxSize:i.evaluate(new so(a)),interpolationType:n}}}function Dc(t,{uSize:e,uSizeT:i},{lowerSize:n,upperSize:r}){return"source"===t.kind?n/Pc:"composite"===t.kind?ii(n/Pc,r/Pc,i):e}function Rc(t,e){let i=0,n=0;if("constant"===t.kind)n=t.layoutSize;else if("source"!==t.kind){const{interpolationType:r,minZoom:o,maxZoom:s}=t,a=r?m(bi.interpolationFactor(r,e,o,s),0,1):0;"camera"===t.kind?n=ii(t.minSize,t.maxSize,a):i=a}return{uSizeT:i,uSize:n}}var Oc=Object.freeze({__proto__:null,getSizeData:Lc,evaluateSizeForFeature:Dc,evaluateSizeForZoom:Rc,SIZE_PACK_FACTOR:Pc});function kc(t,e,i){return t.sections.forEach((t=>{t.text=function(t,e,i){const n=e.layout.get("text-transform").evaluate(i,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),oo.applyArabicShaping&&(t=oo.applyArabicShaping(t)),t}(t.text,e,i)})),t}const Nc={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Bc=function(t,e,i,n,r){var o,s,a=8*r-n-1,l=(1<<a)-1,c=l>>1,u=-7,h=i?r-1:0,p=i?-1:1,d=t[e+h];for(h+=p,o=d&(1<<-u)-1,d>>=-u,u+=a;u>0;o=256*o+t[e+h],h+=p,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=n;u>0;s=256*s+t[e+h],h+=p,u-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=c}return(d?-1:1)*s*Math.pow(2,o-n)},zc=function(t,e,i,n,r,o){var s,a,l,c=8*o-r-1,u=(1<<c)-1,h=u>>1,p=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,f=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+h>=1?p/l:p*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=u?(a=0,s=u):s+h>=1?(a=(e*l-1)*Math.pow(2,r),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,r),s=0));r>=8;t[i+d]=255&a,d+=f,a/=256,r-=8);for(s=s<<r|a,c+=r;c>0;t[i+d]=255&s,d+=f,s/=256,c-=8);t[i+d-f]|=128*m},Fc=Vc;function Vc(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Vc.Varint=0,Vc.Fixed64=1,Vc.Bytes=2,Vc.Fixed32=5;var Uc=4294967296,Gc=1/Uc,jc="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Hc(t){return t.type===Vc.Bytes?t.readVarint()+t.pos:t.pos+1}function Wc(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function qc(t,e,i){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(n);for(var r=i.pos-1;r>=t;r--)i.buf[r+n]=i.buf[r]}function Xc(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function Zc(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function Yc(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function Qc(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function Jc(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function Kc(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function $c(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function tu(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function eu(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function iu(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function nu(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function ru(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function ou(t,e,i){1===t&&i.readMessage(su,e)}function su(t,e,i){if(3===t){const{id:t,bitmap:n,width:r,height:o,left:s,top:a,advance:l}=i.readMessage(au,{});e.push({id:t,bitmap:new Ga({width:r+6,height:o+6},n),metrics:{width:r,height:o,left:s,top:a,advance:l}})}}function au(t,e,i){1===t?e.id=i.readVarint():2===t?e.bitmap=i.readBytes():3===t?e.width=i.readVarint():4===t?e.height=i.readVarint():5===t?e.left=i.readSVarint():6===t?e.top=i.readSVarint():7===t&&(e.advance=i.readVarint())}function lu(t){let e=0,i=0;for(const n of t)e+=n.w*n.h,i=Math.max(i,n.w);t.sort(((t,e)=>e.h-t.h));const n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}];let r=0,o=0;for(const e of t)for(let t=n.length-1;t>=0;t--){const i=n[t];if(!(e.w>i.w||e.h>i.h)){if(e.x=i.x,e.y=i.y,o=Math.max(o,e.y+e.h),r=Math.max(r,e.x+e.w),e.w===i.w&&e.h===i.h){const e=n.pop();t<n.length&&(n[t]=e)}else e.h===i.h?(i.x+=e.w,i.w-=e.w):e.w===i.w?(i.y+=e.h,i.h-=e.h):(n.push({x:i.x+e.w,y:i.y,w:i.w-e.w,h:e.h}),i.y+=e.h,i.h-=e.h);break}}return{w:r,h:o,fill:e/(r*o)||0}}Vc.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var n=this.readVarint(),r=n>>3,o=this.pos;this.type=7&n,t(r,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=iu(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=ru(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=iu(this.buf,this.pos)+iu(this.buf,this.pos+4)*Uc;return this.pos+=8,t},readSFixed64:function(){var t=iu(this.buf,this.pos)+ru(this.buf,this.pos+4)*Uc;return this.pos+=8,t},readFloat:function(){var t=Bc(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Bc(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,n=this.buf;return e=127&(i=n[this.pos++]),i<128?e:(e|=(127&(i=n[this.pos++]))<<7,i<128?e:(e|=(127&(i=n[this.pos++]))<<14,i<128?e:(e|=(127&(i=n[this.pos++]))<<21,i<128?e:function(t,e,i){var n,r,o=i.buf;if(n=(112&(r=o[i.pos++]))>>4,r<128)return Wc(t,n,e);if(n|=(127&(r=o[i.pos++]))<<3,r<128)return Wc(t,n,e);if(n|=(127&(r=o[i.pos++]))<<10,r<128)return Wc(t,n,e);if(n|=(127&(r=o[i.pos++]))<<17,r<128)return Wc(t,n,e);if(n|=(127&(r=o[i.pos++]))<<24,r<128)return Wc(t,n,e);if(n|=(1&(r=o[i.pos++]))<<31,r<128)return Wc(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&jc?function(t,e,i){return jc.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){for(var n="",r=e;r<i;){var o,s,a,l=t[r],c=null,u=l>239?4:l>223?3:l>191?2:1;if(r+u>i)break;1===u?l<128&&(c=l):2===u?128==(192&(o=t[r+1]))&&(c=(31&l)<<6|63&o)<=127&&(c=null):3===u?(s=t[r+2],128==(192&(o=t[r+1]))&&128==(192&s)&&((c=(15&l)<<12|(63&o)<<6|63&s)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(s=t[r+2],a=t[r+3],128==(192&(o=t[r+1]))&&128==(192&s)&&128==(192&a)&&((c=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)<=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),r+=u}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Vc.Bytes)return t.push(this.readVarint(e));var i=Hc(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Vc.Bytes)return t.push(this.readSVarint());var e=Hc(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Vc.Bytes)return t.push(this.readBoolean());var e=Hc(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Vc.Bytes)return t.push(this.readFloat());var e=Hc(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Vc.Bytes)return t.push(this.readDouble());var e=Hc(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Vc.Bytes)return t.push(this.readFixed32());var e=Hc(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Vc.Bytes)return t.push(this.readSFixed32());var e=Hc(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Vc.Bytes)return t.push(this.readFixed64());var e=Hc(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Vc.Bytes)return t.push(this.readSFixed64());var e=Hc(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Vc.Varint)for(;this.buf[this.pos++]>127;);else if(e===Vc.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Vc.Fixed32)this.pos+=4;else{if(e!==Vc.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),nu(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),nu(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),nu(this.buf,-1&t,this.pos),nu(this.buf,Math.floor(t*Gc),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),nu(this.buf,-1&t,this.pos),nu(this.buf,Math.floor(t*Gc),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var i,n;if(t>=0?(i=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,i.buf[i.pos]=127&(t>>>=7)}(i,0,e),function(t,e){var i=(7&t)<<4;e.buf[e.pos++]|=i|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,i){for(var n,r,o=0;o<e.length;o++){if((n=e.charCodeAt(o))>55295&&n<57344){if(!r){n>56319||o+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):r=n;continue}if(n<56320){t[i++]=239,t[i++]=191,t[i++]=189,r=n;continue}n=r-55296<<10|n-56320|65536,r=null}else r&&(t[i++]=239,t[i++]=191,t[i++]=189,r=null);n<128?t[i++]=n:(n<2048?t[i++]=n>>6|192:(n<65536?t[i++]=n>>12|224:(t[i++]=n>>18|240,t[i++]=n>>12&63|128),t[i++]=n>>6&63|128),t[i++]=63&n|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&qc(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),zc(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),zc(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var n=this.pos-i;n>=128&&qc(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,i){this.writeTag(t,Vc.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Xc,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Zc,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Jc,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Yc,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Qc,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Kc,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,$c,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,tu,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,eu,e)},writeBytesField:function(t,e){this.writeTag(t,Vc.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Vc.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Vc.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Vc.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Vc.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Vc.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Vc.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Vc.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Vc.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Vc.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};class cu{constructor(t,{pixelRatio:e,version:i,stretchX:n,stretchY:r,content:o}){this.paddedRect=t,this.pixelRatio=e,this.stretchX=n,this.stretchY=r,this.content=o,this.version=i}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class uu{constructor(t,e){const i={},n={};this.haveRenderCallbacks=[];const r=[];this.addImages(t,i,r),this.addImages(e,n,r);const{w:o,h:s}=lu(r),a=new ja({width:o||1,height:s||1});for(const e in t){const n=t[e],r=i[e].paddedRect;ja.copy(n.data,a,{x:0,y:0},{x:r.x+1,y:r.y+1},n.data)}for(const t in e){const i=e[t],r=n[t].paddedRect,o=r.x+1,s=r.y+1,l=i.data.width,c=i.data.height;ja.copy(i.data,a,{x:0,y:0},{x:o,y:s},i.data),ja.copy(i.data,a,{x:0,y:c-1},{x:o,y:s-1},{width:l,height:1}),ja.copy(i.data,a,{x:0,y:0},{x:o,y:s+c},{width:l,height:1}),ja.copy(i.data,a,{x:l-1,y:0},{x:o-1,y:s},{width:1,height:c}),ja.copy(i.data,a,{x:0,y:0},{x:o+l,y:s},{width:1,height:c})}this.image=a,this.iconPositions=i,this.patternPositions=n}addImages(t,e,i){for(const n in t){const r=t[n],o={x:0,y:0,w:r.data.width+2,h:r.data.height+2};i.push(o),e[n]=new cu(o,r),r.hasRenderCallback&&this.haveRenderCallbacks.push(n)}}patchUpdatedImages(t,e){t.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const i in t.updatedImages)this.patchUpdatedImage(this.iconPositions[i],t.getImage(i),e),this.patchUpdatedImage(this.patternPositions[i],t.getImage(i),e)}patchUpdatedImage(t,e,i){if(!t||!e)return;if(t.version===e.version)return;t.version=e.version;const[n,r]=t.tl;i.update(e.data,void 0,{x:n,y:r})}}ar("ImagePosition",cu),ar("ImageAtlas",uu);const hu={horizontal:1,vertical:2,horizontalOnly:3},pu=-17;class du{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(t,e){const i=new du;return i.scale=t||1,i.fontStack=e,i}static forImage(t){const e=new du;return e.imageName=t,e}}class fu{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(t,e){const i=new fu;for(let n=0;n<t.sections.length;n++){const r=t.sections[n];r.image?i.addImageSection(r):i.addTextSection(r,e)}return i}length(){return this.text.length}getSection(t){return this.sections[this.sectionIndex[t]]}getSectionIndex(t){return this.sectionIndex[t]}getCharCode(t){return this.text.charCodeAt(t)}verticalizePunctuation(){this.text=function(t){let e="";for(let i=0;i<t.length;i++){const n=t.charCodeAt(i+1)||null,r=t.charCodeAt(i-1)||null;e+=n&&Hr(n)&&!Nc[t[i+1]]||r&&Hr(r)&&!Nc[t[i-1]]||!Nc[t[i]]?t[i]:Nc[t[i]]}return e}(this.text)}trim(){let t=0;for(let e=0;e<this.text.length&&gu[this.text.charCodeAt(e)];e++)t++;let e=this.text.length;for(let i=this.text.length-1;i>=0&&i>=t&&gu[this.text.charCodeAt(i)];i--)e--;this.text=this.text.substring(t,e),this.sectionIndex=this.sectionIndex.slice(t,e)}substring(t,e){const i=new fu;return i.text=this.text.substring(t,e),i.sectionIndex=this.sectionIndex.slice(t,e),i.sections=this.sections,i}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((t,e)=>Math.max(t,this.sections[e].scale)),0)}addTextSection(t,e){this.text+=t.text,this.sections.push(du.forText(t.scale,t.fontStack||e));const i=this.sections.length-1;for(let e=0;e<t.text.length;++e)this.sectionIndex.push(i)}addImageSection(t){const e=t.image?t.image.name:"";if(0===e.length)return void L("Can't add FormattedSection with an empty image.");const i=this.getNextImageSectionCharCode();i?(this.text+=String.fromCharCode(i),this.sections.push(du.forImage(e)),this.sectionIndex.push(this.sections.length-1)):L("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function mu(t,e,i,n,r,o,s,a,l,c,u,h,p,d,f,m){const g=fu.fromFeature(t,r);let y;h===hu.vertical&&g.verticalizePunctuation();const{processBidirectionalText:v,processStyledBidirectionalText:_}=oo;if(v&&1===g.sections.length){y=[];const t=v(g.toString(),Au(g,c,o,e,n,d,f));for(const e of t){const t=new fu;t.text=e,t.sections=g.sections;for(let i=0;i<e.length;i++)t.sectionIndex.push(0);y.push(t)}}else if(_){y=[];const t=_(g.text,g.sectionIndex,Au(g,c,o,e,n,d,f));for(const e of t){const t=new fu;t.text=e[0],t.sectionIndex=e[1],t.sections=g.sections,y.push(t)}}else y=function(t,e){const i=[],n=t.text;let r=0;for(const n of e)i.push(t.substring(r,n)),r=n;return r<n.length&&i.push(t.substring(r,n.length)),i}(g,Au(g,c,o,e,n,d,f));const x=[],b={positionedLines:x,text:g.toString(),top:u[1],bottom:u[1],left:u[0],right:u[0],writingMode:h,iconsInText:!1,verticalizable:!1};return function(t,e,i,n,r,o,s,a,l,c,u,h){let p=0,d=pu,f=0,m=0;const g="right"===a?1:"left"===a?0:.5;let y=0;for(const s of r){s.trim();const r=s.getMaxScale(),a=(r-1)*Cc,_={positionedGlyphs:[],lineOffset:0};t.positionedLines[y]=_;const x=_.positionedGlyphs;let b=0;if(!s.length()){d+=o,++y;continue}for(let o=0;o<s.length();o++){const f=s.getSection(o),m=s.getSectionIndex(o),g=s.getCharCode(o);let y=0,_=null,w=null,A=null,E=Cc;const S=!(l===hu.horizontal||!u&&!jr(g)||u&&(gu[g]||(v=g,dr(v)||fr(v)||mr(v)||Or(v)||zr(v))));if(f.imageName){const e=n[f.imageName];if(!e)continue;A=f.imageName,t.iconsInText=t.iconsInText||!0,w=e.paddedRect;const i=e.displaySize;f.scale=f.scale*Cc/h,_={width:i[0],height:i[1],left:1,top:-3,advance:S?i[1]:i[0],localGlyph:!1},y=a+(Cc-i[1]*f.scale),E=_.advance;const o=S?i[0]*f.scale-Cc*r:i[1]*f.scale-Cc*r;o>0&&o>b&&(b=o)}else{const t=i[f.fontStack],n=t&&t[g];if(n&&n.rect)w=n.rect,_=n.metrics;else{const t=e[f.fontStack],i=t&&t[g];if(!i)continue;_=i.metrics}y=(r-f.scale)*Cc}S?(t.verticalizable=!0,x.push({glyph:g,imageName:A,x:p,y:d+y,vertical:S,scale:f.scale,localGlyph:_.localGlyph,fontStack:f.fontStack,sectionIndex:m,metrics:_,rect:w}),p+=E*f.scale+c):(x.push({glyph:g,imageName:A,x:p,y:d+y,vertical:S,scale:f.scale,localGlyph:_.localGlyph,fontStack:f.fontStack,sectionIndex:m,metrics:_,rect:w}),p+=_.advance*f.scale+c)}0!==x.length&&(f=Math.max(p-c,f),Su(x,0,x.length-1,g,b)),p=0;const w=o*r+b;_.lineOffset=Math.max(b,a),d+=w,m=Math.max(w,m),++y}var v;const _=d-pu,{horizontalAlign:x,verticalAlign:b}=Eu(s);(function(t,e,i,n,r,o,s,a,l){const c=(e-i)*r;let u=0;u=o!==s?-a*n-pu:(-n*l+.5)*s;for(const e of t)for(const t of e.positionedGlyphs)t.x+=c,t.y+=u})(t.positionedLines,g,x,b,f,m,o,_,r.length),t.top+=-b*_,t.bottom=t.top+_,t.left+=-x*f,t.right=t.left+f}(b,e,i,n,y,s,a,l,h,c,p,m),!function(t){for(const e of t)if(0!==e.positionedGlyphs.length)return!1;return!0}(x)&&b}const gu={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},yu={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 vu(t,e,i,n,r,o){if(e.imageName){const t=n[e.imageName];return t?t.displaySize[0]*e.scale*Cc/o+r:0}{const n=i[e.fontStack],o=n&&n[t];return o?o.metrics.advance*e.scale+r:0}}function _u(t,e,i,n){const r=Math.pow(t-e,2);return n?t<e?r/2:2*r:r+Math.abs(i)*i}function xu(t,e,i){let n=0;return 10===t&&(n-=1e4),i&&(n+=150),40!==t&&65288!==t||(n+=50),41!==e&&65289!==e||(n+=50),n}function bu(t,e,i,n,r,o){let s=null,a=_u(e,i,r,o);for(const t of n){const n=_u(e-t.x,i,r,o)+t.badness;n<=a&&(s=t,a=n)}return{index:t,x:e,priorBreak:s,badness:a}}function wu(t){return t?wu(t.priorBreak).concat(t.index):[]}function Au(t,e,i,n,r,o,s){if("point"!==o)return[];if(!t)return[];const a=[],l=function(t,e,i,n,r,o){let s=0;for(let i=0;i<t.length();i++){const a=t.getSection(i);s+=vu(t.getCharCode(i),a,n,r,e,o)}return s/Math.max(1,Math.ceil(s/i))}(t,e,i,n,r,s),c=t.text.indexOf("")>=0;let u=0;for(let i=0;i<t.length();i++){const o=t.getSection(i),p=t.getCharCode(i);if(gu[p]||(u+=vu(p,o,n,r,e,s)),i<t.length()-1){const e=!((h=p)<11904||!(Ar(h)||wr(h)||Nr(h)||Rr(h)||Tr(h)||gr(h)||Er(h)||_r(h)||Ir(h)||Cr(h)||Mr(h)||Fr(h)||xr(h)||vr(h)||yr(h)||Sr(h)||br(h)||kr(h)||Lr(h)||Pr(h)));(yu[p]||e||o.imageName)&&a.push(bu(i+1,u,l,a,xu(p,t.getCharCode(i+1),e&&c),!1))}}var h;return wu(bu(t.length(),u,l,a,0,!0))}function Eu(t){let e=.5,i=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:e,verticalAlign:i}}function Su(t,e,i,n,r){if(!n&&!r)return;const o=t[i],s=(t[i].x+o.metrics.advance*o.scale)*n;for(let n=e;n<=i;n++)t[n].x-=s,t[n].y+=r}function Mu(t,e,i){const{horizontalAlign:n,verticalAlign:r}=Eu(i),o=e[0]-t.displaySize[0]*n,s=e[1]-t.displaySize[1]*r;return{image:t,top:s,bottom:s+t.displaySize[1],left:o,right:o+t.displaySize[0]}}function Tu(t,e,i,n,r,o){const s=t.image;let a;if(s.content){const t=s.content,e=s.pixelRatio||1;a=[t[0]/e,t[1]/e,s.displaySize[0]-t[2]/e,s.displaySize[1]-t[3]/e]}const l=e.left*o,c=e.right*o;let u,h,p,d;"width"===i||"both"===i?(d=r[0]+l-n[3],h=r[0]+c+n[1]):(d=r[0]+(l+c-s.displaySize[0])/2,h=d+s.displaySize[0]);const f=e.top*o,m=e.bottom*o;return"height"===i||"both"===i?(u=r[1]+f-n[0],p=r[1]+m+n[2]):(u=r[1]+(f+m-s.displaySize[1])/2,p=u+s.displaySize[1]),{image:s,top:u,right:h,bottom:p,left:d,collisionPadding:a}}class Iu extends r{constructor(t,e,i,n){super(t,e),this.angle=i,void 0!==n&&(this.segment=n)}clone(){return new Iu(this.x,this.y,this.angle,this.segment)}}function Cu(t,e,i,n,r){if(void 0===e.segment)return!0;let o=e,s=e.segment+1,a=0;for(;a>-i/2;){if(s--,s<0)return!1;a-=t[s].dist(o),o=t[s]}a+=t[s].dist(t[s+1]),s++;const l=[];let c=0;for(;a<i/2;){const e=t[s],i=t[s+1];if(!i)return!1;let o=t[s-1].angleTo(e)-e.angleTo(i);for(o=Math.abs((o+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:a,angleDelta:o}),c+=o;a-l[0].distance>n;)c-=l.shift().angleDelta;if(c>r)return!1;s++,a+=e.dist(i)}return!0}function Pu(t){let e=0;for(let i=0;i<t.length-1;i++)e+=t[i].dist(t[i+1]);return e}function Lu(t,e,i){return t?.6*e*i:0}function Du(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Ru(t,e,i,n,r,o){const s=Lu(i,r,o),a=Du(i,n)*o;let l=0;const c=Pu(t)/2;for(let i=0;i<t.length-1;i++){const n=t[i],r=t[i+1],o=n.dist(r);if(l+o>c){const u=(c-l)/o,h=ii(n.x,r.x,u),p=ii(n.y,r.y,u),d=new Iu(h,p,r.angleTo(n),i);return d._round(),!s||Cu(t,d,a,s,e)?d:void 0}l+=o}}function Ou(t,e,i,n,r,o,s,a,l){const c=Lu(n,o,s),u=Du(n,r),h=u*s,p=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-h<e/4&&(e=h+e/4),ku(t,p?e/2*a%e:(u/2+2*o)*s*a%e,e,c,i,h,p,!1,l)}function ku(t,e,i,n,r,o,s,a,l){const c=o/2,u=Pu(t);let h=0,p=e-i,d=[];for(let e=0;e<t.length-1;e++){const s=t[e],a=t[e+1],f=s.dist(a),m=a.angleTo(s);for(;p+i<h+f;){p+=i;const g=(p-h)/f,y=ii(s.x,a.x,g),v=ii(s.y,a.y,g);if(y>=0&&y<l&&v>=0&&v<l&&p-c>=0&&p+c<=u){const i=new Iu(y,v,m,e);i._round(),n&&!Cu(t,i,o,n,r)||d.push(i)}}h+=f}return a||d.length||s||(d=ku(t,h/2,i,n,r,o,s,!0,l)),d}function Nu(t,e,i,n,o){const s=[];for(let a=0;a<t.length;a++){const l=t[a];let c;for(let t=0;t<l.length-1;t++){let a=l[t],u=l[t+1];a.x<e&&u.x<e||(a.x<e?a=new r(e,a.y+(e-a.x)/(u.x-a.x)*(u.y-a.y))._round():u.x<e&&(u=new r(e,a.y+(e-a.x)/(u.x-a.x)*(u.y-a.y))._round()),a.y<i&&u.y<i||(a.y<i?a=new r(a.x+(i-a.y)/(u.y-a.y)*(u.x-a.x),i)._round():u.y<i&&(u=new r(a.x+(i-a.y)/(u.y-a.y)*(u.x-a.x),i)._round()),a.x>=n&&u.x>=n||(a.x>=n?a=new r(n,a.y+(n-a.x)/(u.x-a.x)*(u.y-a.y))._round():u.x>=n&&(u=new r(n,a.y+(n-a.x)/(u.x-a.x)*(u.y-a.y))._round()),a.y>=o&&u.y>=o||(a.y>=o?a=new r(a.x+(o-a.y)/(u.y-a.y)*(u.x-a.x),o)._round():u.y>=o&&(u=new r(a.x+(o-a.y)/(u.y-a.y)*(u.x-a.x),o)._round()),c&&a.equals(c[c.length-1])||(c=[a],s.push(c)),c.push(u)))))}}return s}ar("Anchor",Iu);var Bu=Vu,zu=Vu,Fu=1e20;function Vu(t,e,i,n,r,o){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=n||.25,this.fontFamily=r||"sans-serif",this.fontWeight=o||"normal",this.radius=i||8;var s=this.size=this.fontSize+2*this.buffer,a=s+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=s,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textAlign="left",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Uint16Array(a),this.useMetrics=void 0!==this.ctx.measureText("A").actualBoundingBoxLeft,this.middle=Math.round(s/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function Uu(t,e,i,n,r,o){for(var s=0;s<e;s++)Gu(t,s,e,i,n,r,o);for(var a=0;a<i;a++)Gu(t,a*e,1,e,n,r,o)}function Gu(t,e,i,n,r,o,s){var a,l,c,u;for(o[0]=0,s[0]=-Fu,s[1]=Fu,a=0;a<n;a++)r[a]=t[e+a*i];for(a=1,l=0,c=0;a<n;a++){do{c=(r[a]-r[u=o[l]]+a*a-u*u)/(a-u)/2}while(c<=s[l]&&--l>-1);o[++l]=a,s[l]=c,s[l+1]=Fu}for(a=0,l=0;a<n;a++){for(;s[l+1]<a;)l++;t[e+a*i]=r[u=o[l]]+(a-u)*(a-u)}}Vu.prototype._draw=function(t,e){var i,n,r,o,s,a,l,c,u,h=this.ctx.measureText(t),p=h.width,d=2*this.buffer;e&&this.useMetrics?(s=Math.floor(h.actualBoundingBoxAscent),c=this.buffer+Math.ceil(h.actualBoundingBoxAscent),a=this.buffer,l=this.buffer,i=(n=Math.min(this.size,Math.ceil(h.actualBoundingBoxRight-h.actualBoundingBoxLeft)))+d,r=(o=Math.min(this.size-a,Math.ceil(h.actualBoundingBoxAscent+h.actualBoundingBoxDescent)))+d,this.ctx.textBaseline="alphabetic"):(i=n=this.size,r=o=this.size,s=19*this.fontSize/24,a=l=0,c=this.middle,this.ctx.textBaseline="middle"),n&&o&&(this.ctx.clearRect(l,a,n,o),this.ctx.fillText(t,this.buffer,c),u=this.ctx.getImageData(l,a,n,o));var f=new Uint8ClampedArray(i*r);return function(t,e,i,n,r,o,s){o.fill(Fu,0,e*i),s.fill(0,0,e*i);for(var a=(e-n)/2,l=0;l<r;l++)for(var c=0;c<n;c++){var u=(l+a)*e+c+a,h=t.data[4*(l*n+c)+3]/255;if(1===h)o[u]=0,s[u]=Fu;else if(0===h)o[u]=Fu,s[u]=0;else{var p=Math.max(0,.5-h),d=Math.max(0,h-.5);o[u]=p*p,s[u]=d*d}}}(u,i,r,n,o,this.gridOuter,this.gridInner),Uu(this.gridOuter,i,r,this.f,this.v,this.z),Uu(this.gridInner,i,r,this.f,this.v,this.z),function(t,e,i,n,r,o,s){for(var a=0;a<e*i;a++){var l=Math.sqrt(n[a])-Math.sqrt(r[a]);t[a]=Math.round(255-255*(l/o+s))}}(f,i,r,this.gridOuter,this.gridInner,this.radius,this.cutoff),{data:f,metrics:{width:n,height:o,sdfWidth:i,sdfHeight:r,top:s,left:0,advance:p}}},Vu.prototype.draw=function(t){return this._draw(t,!1).data},Vu.prototype.drawWithMetrics=function(t){return this._draw(t,!0)},Bu.default=zu;const ju={none:0,ideographs:1,all:2};class Hu{constructor(t,e,i){this.requestManager=t,this.localGlyphMode=e,this.localFontFamily=i,this.entries={},this.localGlyphs={200:{},400:{},500:{},900:{}}}setURL(t){this.url=t}getGlyphs(t,e){const i=[];for(const e in t)for(const n of t[e])i.push({stack:e,id:n});y(i,(({stack:t,id:e},i)=>{let n=this.entries[t];n||(n=this.entries[t]={glyphs:{},requests:{},ranges:{}});let r=n.glyphs[e];if(void 0!==r)return void i(null,{stack:t,id:e,glyph:r});if(r=this._tinySDF(n,t,e),r)return n.glyphs[e]=r,void i(null,{stack:t,id:e,glyph:r});const o=Math.floor(e/256);if(256*o>65535)return void i(new Error("glyphs > 65535 not supported"));if(n.ranges[o])return void i(null,{stack:t,id:e,glyph:r});let s=n.requests[o];s||(s=n.requests[o]=[],Hu.loadGlyphRange(t,o,this.url,this.requestManager,((t,e)=>{if(e){for(const t in e)this._doesCharSupportLocalGlyph(+t)||(n.glyphs[+t]=e[+t]);n.ranges[o]=!0}for(const i of s)i(t,e);delete n.requests[o]}))),s.push(((n,r)=>{n?i(n):r&&i(null,{stack:t,id:e,glyph:r[e]||null})}))}),((t,i)=>{if(t)e(t);else if(i){const t={};for(const{stack:e,id:n,glyph:r}of i)(t[e]||(t[e]={}))[n]=r&&{id:r.id,bitmap:r.bitmap.clone(),metrics:r.metrics};e(null,t)}}))}_doesCharSupportLocalGlyph(t){return this.localGlyphMode!==ju.none&&(this.localGlyphMode===ju.all?!!this.localFontFamily:!!this.localFontFamily&&(Cr(t)||Dr(t)||xr(t)||br(t)))}_tinySDF(t,e,i){const n=this.localFontFamily;if(!n)return;if(!this._doesCharSupportLocalGlyph(i))return;let r=t.tinySDF;if(!r){let i="400";/bold/i.test(e)?i="900":/medium/i.test(e)?i="500":/light/i.test(e)&&(i="200"),r=t.tinySDF=new Hu.TinySDF(48,6,16,.25,n,i)}if(this.localGlyphs[r.fontWeight][i])return this.localGlyphs[r.fontWeight][i];const{data:o,metrics:s}=r.drawWithMetrics(String.fromCharCode(i)),{sdfWidth:a,sdfHeight:l,width:c,height:u,left:h,top:p,advance:d}=s;return this.localGlyphs[r.fontWeight][i]={id:i,bitmap:new Ga({width:a,height:l},o),metrics:{width:c/2,height:u/2,left:h/2,top:p/2-27,advance:d/2,localGlyph:!0}}}}function Wu(t,e,i,n){const o=[],s=t.image,a=s.pixelRatio,l=s.paddedRect.w-2,c=s.paddedRect.h-2,u=t.right-t.left,h=t.bottom-t.top,p=s.stretchX||[[0,l]],d=s.stretchY||[[0,c]],f=(t,e)=>t+e[1]-e[0],m=p.reduce(f,0),g=d.reduce(f,0),y=l-m,v=c-g;let _=0,x=m,b=0,w=g,A=0,E=y,S=0,M=v;if(s.content&&n){const t=s.content;_=qu(p,0,t[0]),b=qu(d,0,t[1]),x=qu(p,t[0],t[2]),w=qu(d,t[1],t[3]),A=t[0]-_,S=t[1]-b,E=t[2]-t[0]-x,M=t[3]-t[1]-w}const T=(n,o,l,c)=>{const p=Zu(n.stretch-_,x,u,t.left),d=Yu(n.fixed-A,E,n.stretch,m),f=Zu(o.stretch-b,w,h,t.top),y=Yu(o.fixed-S,M,o.stretch,g),v=Zu(l.stretch-_,x,u,t.left),T=Yu(l.fixed-A,E,l.stretch,m),I=Zu(c.stretch-b,w,h,t.top),C=Yu(c.fixed-S,M,c.stretch,g),P=new r(p,f),L=new r(v,f),D=new r(v,I),R=new r(p,I),O=new r(d/a,y/a),k=new r(T/a,C/a),N=e*Math.PI/180;if(N){const t=Math.sin(N),e=Math.cos(N),i=[e,-t,t,e];P._matMult(i),L._matMult(i),R._matMult(i),D._matMult(i)}const B=n.stretch+n.fixed,z=o.stretch+o.fixed;return{tl:P,tr:L,bl:R,br:D,tex:{x:s.paddedRect.x+1+B,y:s.paddedRect.y+1+z,w:l.stretch+l.fixed-B,h:c.stretch+c.fixed-z},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:O,pixelOffsetBR:k,minFontScaleX:E/a/u,minFontScaleY:M/a/h,isSDF:i}};if(n&&(s.stretchX||s.stretchY)){const t=Xu(p,y,m),e=Xu(d,v,g);for(let i=0;i<t.length-1;i++){const n=t[i],r=t[i+1];for(let t=0;t<e.length-1;t++)o.push(T(n,e[t],r,e[t+1]))}}else o.push(T({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:c+1}));return o}function qu(t,e,i){let n=0;for(const r of t)n+=Math.max(e,Math.min(i,r[1]))-Math.max(e,Math.min(i,r[0]));return n}function Xu(t,e,i){const n=[{fixed:-1,stretch:0}];for(const[e,i]of t){const t=n[n.length-1];n.push({fixed:e-t.stretch,stretch:t.stretch}),n.push({fixed:e-t.stretch,stretch:t.stretch+(i-e)})}return n.push({fixed:e+1,stretch:i}),n}function Zu(t,e,i,n){return t/e*i+n}function Yu(t,e,i,n){return t-e*i/n}Hu.loadGlyphRange=function(t,e,i,n,r){const o=256*e,s=o+255,a=n.transformRequest(n.normalizeGlyphsURL(i).replace("{fontstack}",t).replace("{range}",`${o}-${s}`),bt.Glyphs);St(a,((t,e)=>{if(t)r(t);else if(e){const t={};for(const i of function(t){return new Fc(t).readFields(ou,[])}(e))t[i.id]=i;r(null,t)}}))},Hu.TinySDF=Bu;class Qu{constructor(t=[],e=Ju){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:i}=this,n=e[t];for(;t>0;){const r=t-1>>1,o=e[r];if(i(n,o)>=0)break;e[t]=o,t=r}e[t]=n}_down(t){const{data:e,compare:i}=this,n=this.length>>1,r=e[t];for(;t<n;){let n=1+(t<<1),o=e[n];const s=n+1;if(s<this.length&&i(e[s],o)<0&&(n=s,o=e[s]),i(o,r)>=0)break;e[t]=o,t=n}e[t]=r}}function Ju(t,e){return t<e?-1:t>e?1:0}function Ku(t,e=1,i=!1){let n=1/0,o=1/0,s=-1/0,a=-1/0;const l=t[0];for(let t=0;t<l.length;t++){const e=l[t];(!t||e.x<n)&&(n=e.x),(!t||e.y<o)&&(o=e.y),(!t||e.x>s)&&(s=e.x),(!t||e.y>a)&&(a=e.y)}const c=Math.min(s-n,a-o);let u=c/2;const h=new Qu([],$u);if(0===c)return new r(n,o);for(let e=n;e<s;e+=c)for(let i=o;i<a;i+=c)h.push(new th(e+u,i+u,u,t));let p=function(t){let e=0,i=0,n=0;const r=t[0];for(let t=0,o=r.length,s=o-1;t<o;s=t++){const o=r[t],a=r[s],l=o.x*a.y-a.x*o.y;i+=(o.x+a.x)*l,n+=(o.y+a.y)*l,e+=3*l}return new th(i/e,n/e,0,t)}(t),d=h.length;for(;h.length;){const n=h.pop();(n.d>p.d||!p.d)&&(p=n,i&&console.log("found best %d after %d probes",Math.round(1e4*n.d)/1e4,d)),n.max-p.d<=e||(u=n.h/2,h.push(new th(n.p.x-u,n.p.y-u,u,t)),h.push(new th(n.p.x+u,n.p.y-u,u,t)),h.push(new th(n.p.x-u,n.p.y+u,u,t)),h.push(new th(n.p.x+u,n.p.y+u,u,t)),d+=4)}return i&&(console.log(`num probes: ${d}`),console.log(`best distance: ${p.d}`)),p.p}function $u(t,e){return e.max-t.max}function th(t,e,i,n){this.p=new r(t,e),this.h=i,this.d=function(t,e){let i=!1,n=1/0;for(let r=0;r<e.length;r++){const o=e[r];for(let e=0,r=o.length,s=r-1;e<r;s=e++){const r=o[e],a=o[s];r.y>t.y!=a.y>t.y&&t.x<(a.x-r.x)*(t.y-r.y)/(a.y-r.y)+r.x&&(i=!i),n=Math.min(n,ia(t,r,a))}}return(i?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}const eh=Number.POSITIVE_INFINITY;function ih(t,e){return e[1]!==eh?function(t,e,i){let n=0,r=0;switch(e=Math.abs(e),i=Math.abs(i),t){case"top-right":case"top-left":case"top":r=i-7;break;case"bottom-right":case"bottom-left":case"bottom":r=7-i}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}return[n,r]}(t,e[0],e[1]):function(t,e){let i=0,n=0;e<0&&(e=0);const r=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=r-7;break;case"bottom-right":case"bottom-left":n=7-r;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":i=-r;break;case"top-left":case"bottom-left":i=r;break;case"left":i=e;break;case"right":i=-e}return[i,n]}(t,e[0])}function nh(t,e,i,n,r,o,s,a){t.createArrays(),t.tilePixelRatio=Gs/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;const l=t.layers[0].layout,c=t.layers[0]._unevaluatedLayout._values,u={};if("composite"===t.textSizeData.kind){const{minZoom:e,maxZoom:i}=t.textSizeData;u.compositeTextSizes=[c["text-size"].possiblyEvaluate(new so(e),s),c["text-size"].possiblyEvaluate(new so(i),s)]}if("composite"===t.iconSizeData.kind){const{minZoom:e,maxZoom:i}=t.iconSizeData;u.compositeIconSizes=[c["icon-size"].possiblyEvaluate(new so(e),s),c["icon-size"].possiblyEvaluate(new so(i),s)]}u.layoutTextSize=c["text-size"].possiblyEvaluate(new so(a+1),s),u.layoutIconSize=c["icon-size"].possiblyEvaluate(new so(a+1),s),u.textMaxSize=c["text-size"].possiblyEvaluate(new so(18),s);const h="map"===l.get("text-rotation-alignment")&&"point"!==l.get("symbol-placement"),p=l.get("text-keep-upright"),d=l.get("text-size");for(const o of t.features){const a=l.get("text-font").evaluate(o,{},s).join(","),c=d.evaluate(o,{},s),f=u.layoutTextSize.evaluate(o,{},s),m=(u.layoutIconSize.evaluate(o,{},s),{horizontal:{},vertical:void 0}),g=o.text;let y,v=[0,0];if(g){const n=g.toString(),u=l.get("text-letter-spacing").evaluate(o,{},s)*Cc,d=l.get("text-line-height").evaluate(o,{},s)*Cc,y=Ur(n)?u:0,_=l.get("text-anchor").evaluate(o,{},s),x=l.get("text-variable-anchor");if(!x){const t=l.get("text-radial-offset").evaluate(o,{},s);v=t?ih(_,[t*Cc,eh]):l.get("text-offset").evaluate(o,{},s).map((t=>t*Cc))}let b=h?"center":l.get("text-justify").evaluate(o,{},s);const w=l.get("symbol-placement"),A="point"===w?l.get("text-max-width").evaluate(o,{},s)*Cc:0,E=()=>{t.allowVerticalPlacement&&Vr(n)&&(m.vertical=mu(g,e,i,r,a,A,d,_,"left",y,v,hu.vertical,!0,w,f,c))};if(!h&&x){const t="auto"===b?x.map((t=>rh(t))):[b];let n=!1;for(let o=0;o<t.length;o++){const s=t[o];if(!m.horizontal[s])if(n)m.horizontal[s]=m.horizontal[0];else{const t=mu(g,e,i,r,a,A,d,"center",s,y,v,hu.horizontal,!1,w,f,c);t&&(m.horizontal[s]=t,n=1===t.positionedLines.length)}}E()}else{"auto"===b&&(b=rh(_));const t=mu(g,e,i,r,a,A,d,_,b,y,v,hu.horizontal,!1,w,f,c);t&&(m.horizontal[b]=t),E(),Vr(n)&&h&&p&&(m.vertical=mu(g,e,i,r,a,A,d,_,b,y,v,hu.vertical,!1,w,f,c))}}let _=!1;if(o.icon&&o.icon.name){const e=n[o.icon.name];e&&(y=Mu(r[o.icon.name],l.get("icon-offset").evaluate(o,{},s),l.get("icon-anchor").evaluate(o,{},s)),_=e.sdf,void 0===t.sdfIcons?t.sdfIcons=e.sdf:t.sdfIcons!==e.sdf&&L("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(e.pixelRatio!==t.pixelRatio||0!==l.get("icon-rotate").constantOr(1))&&(t.iconsNeedLinear=!0))}const x=lh(m.horizontal)||m.vertical;t.iconsInText||(t.iconsInText=!!x&&x.iconsInText),(x||y)&&oh(t,o,m,y,n,u,f,0,v,_,s)}o&&t.generateCollisionDebugBuffers(a,t.collisionBoxArray)}function rh(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function oh(t,e,i,n,r,o,s,a,l,c,h){let p=o.textMaxSize.evaluate(e,{},h);void 0===p&&(p=s);const d=t.layers[0].layout,f=d.get("icon-offset").evaluate(e,{},h),m=lh(i.horizontal),g=s/24,y=t.tilePixelRatio*g,v=t.tilePixelRatio*p/24,_=t.tilePixelRatio*d.get("symbol-spacing"),x=d.get("text-padding")*t.tilePixelRatio,b=d.get("icon-padding")*t.tilePixelRatio,w=u(d.get("text-max-angle")),A="map"===d.get("text-rotation-alignment")&&"point"!==d.get("symbol-placement"),E="map"===d.get("icon-rotation-alignment")&&"point"!==d.get("symbol-placement"),S=d.get("symbol-placement"),M=_/2,T=d.get("icon-text-fit");let I;n&&"none"!==T&&(t.allowVerticalPlacement&&i.vertical&&(I=Tu(n,i.vertical,T,d.get("icon-text-fit-padding"),f,g)),m&&(n=Tu(n,m,T,d.get("icon-text-fit-padding"),f,g)));const C=(a,u)=>{u.x<0||u.x>=Gs||u.y<0||u.y>=Gs||function(t,e,i,n,r,o,s,a,l,c,u,h,p,d,f,m,g,y,v,_,x,b,w,A,E){const S=t.addToLineVertexArray(e,i);let M,T,I,C,P,D,R,O=0,k=0,N=0,B=0,z=-1,F=-1;const V={};let U=ps(""),G=0,j=0;if(void 0===a._unevaluatedLayout.getValue("text-radial-offset")?[G,j]=a.layout.get("text-offset").evaluate(x,{},A).map((t=>t*Cc)):(G=a.layout.get("text-radial-offset").evaluate(x,{},A)*Cc,j=eh),t.allowVerticalPlacement&&n.vertical){const t=n.vertical;if(f)D=uh(t),s&&(R=uh(s));else{const i=a.layout.get("text-rotate").evaluate(x,{},A)+90;I=ch(l,e,c,u,h,t,0,d,i),s&&(C=ch(l,e,c,u,h,s,0,y,i))}}if(r){const i=a.layout.get("icon-rotate").evaluate(x,{},A),n="none"!==a.layout.get("icon-text-fit"),o=Wu(r,i,w,n),p=s?Wu(s,i,w,n):void 0;T=ch(l,e,c,u,h,r,0,y,i),O=4*o.length;const d=t.iconSizeData;let f=null;"source"===d.kind?(f=[Pc*a.layout.get("icon-size").evaluate(x,{},A)],f[0]>sh&&L(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):"composite"===d.kind&&(f=[Pc*b.compositeIconSizes[0].evaluate(x,{},A),Pc*b.compositeIconSizes[1].evaluate(x,{},A)],(f[0]>sh||f[1]>sh)&&L(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),t.addSymbols(t.icon,o,f,_,v,x,!1,e,S.lineStartIndex,S.lineLength,-1,A),z=t.icon.placedSymbolArray.length-1,p&&(k=4*p.length,t.addSymbols(t.icon,p,f,_,v,x,hu.vertical,e,S.lineStartIndex,S.lineLength,-1,A),F=t.icon.placedSymbolArray.length-1)}for(const i in n.horizontal){const r=n.horizontal[i];M||(U=ps(r.text),f?P=uh(r):M=ch(l,e,c,u,h,r,0,d,a.layout.get("text-rotate").evaluate(x,{},A)));const s=1===r.positionedLines.length;if(N+=ah(t,e,r,o,a,f,x,m,S,n.vertical?hu.horizontal:hu.horizontalOnly,s?Object.keys(n.horizontal):[i],V,z,b,A),s)break}n.vertical&&(B+=ah(t,e,n.vertical,o,a,f,x,m,S,hu.vertical,["vertical"],V,F,b,A));let H=-1;const W=(t,e)=>t?Math.max(t,e):e;H=W(P,H),H=W(D,H),H=W(R,H);const q=H>-1?1:0;q&&(H*=E/Cc),t.glyphOffsetArray.length>=_h.MAX_GLYPHS&&L("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==x.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,x.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,V.right>=0?V.right:-1,V.center>=0?V.center:-1,V.left>=0?V.left:-1,V.vertical||-1,z,F,U,void 0!==M?M:t.collisionBoxArray.length,void 0!==M?M+1:t.collisionBoxArray.length,void 0!==I?I:t.collisionBoxArray.length,void 0!==I?I+1:t.collisionBoxArray.length,void 0!==T?T:t.collisionBoxArray.length,void 0!==T?T+1:t.collisionBoxArray.length,C||t.collisionBoxArray.length,C?C+1:t.collisionBoxArray.length,c,N,B,O,k,q,0,p,G,j,H)}(t,u,a,i,n,r,I,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,y,x,A,l,0,b,E,f,e,o,c,h,s)};if("line"===S)for(const r of Nu(e.geometry,0,0,Gs,Gs)){const e=Ou(r,_,w,i.vertical||m,n,24,v,t.overscaling,Gs);for(const i of e)m&&hh(t,m.text,M,i)||C(r,i)}else if("line-center"===S){for(const t of e.geometry)if(t.length>1){const e=Ru(t,w,i.vertical||m,n,24,v);e&&C(t,e)}}else if("Polygon"===e.type)for(const t of Tl(e.geometry,0)){const e=Ku(t,16);C(t[0],new Iu(e.x,e.y,0))}else if("LineString"===e.type)for(const t of e.geometry)C(t,new Iu(t[0].x,t[0].y,0));else if("Point"===e.type)for(const t of e.geometry)for(const e of t)C([e],new Iu(e.x,e.y,0))}const sh=32640;function ah(t,e,i,n,o,s,a,l,c,u,h,p,d,f,m){const g=function(t,e,i,n,o,s,a,l){const c=n.layout.get("text-rotate").evaluate(s,{})*Math.PI/180,u=[];for(const t of e.positionedLines)for(const n of t.positionedGlyphs){if(!n.rect)continue;const s=n.rect||{};let h=4,p=!0,d=1,f=0;const m=(o||l)&&n.vertical,g=n.metrics.advance*n.scale/2;if(l&&e.verticalizable){const e=(n.scale-1)*Cc,i=(Cc-n.metrics.width*n.scale)/2;f=t.lineOffset/2-(n.imageName?-i:e)}if(n.imageName){const t=a[n.imageName];p=t.sdf,d=t.pixelRatio,h=1/d}const y=o?[n.x+g,n.y]:[0,0];let v=o?[0,0]:[n.x+g+i[0],n.y+i[1]-f],_=[0,0];m&&(_=v,v=[0,0]);const x=(n.metrics.left-h)*n.scale-g+v[0],b=(-n.metrics.top-h)*n.scale+v[1],w=x+s.w*n.scale/(d*(n.localGlyph?2:1)),A=b+s.h*n.scale/(d*(n.localGlyph?2:1)),E=new r(x,b),S=new r(w,b),M=new r(x,A),T=new r(w,A);if(m){const t=new r(-g,g-pu),e=-Math.PI/2,i=12-g,o=new r(22-i,-(n.imageName?i:0)),s=new r(..._);E._rotateAround(e,t)._add(o)._add(s),S._rotateAround(e,t)._add(o)._add(s),M._rotateAround(e,t)._add(o)._add(s),T._rotateAround(e,t)._add(o)._add(s)}if(c){const t=Math.sin(c),e=Math.cos(c),i=[e,-t,t,e];E._matMult(i),S._matMult(i),M._matMult(i),T._matMult(i)}const I=new r(0,0),C=new r(0,0);u.push({tl:E,tr:S,bl:M,br:T,tex:s,writingMode:e.writingMode,glyphOffset:y,sectionIndex:n.sectionIndex,isSDF:p,pixelOffsetTL:I,pixelOffsetBR:C,minFontScaleX:0,minFontScaleY:0})}return u}(0,i,l,o,s,a,n,t.allowVerticalPlacement),y=t.textSizeData;let v=null;"source"===y.kind?(v=[Pc*o.layout.get("text-size").evaluate(a,{},m)],v[0]>sh&&L(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):"composite"===y.kind&&(v=[Pc*f.compositeTextSizes[0].evaluate(a,{},m),Pc*f.compositeTextSizes[1].evaluate(a,{},m)],(v[0]>sh||v[1]>sh)&&L(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),t.addSymbols(t.text,g,v,l,s,a,u,e,c.lineStartIndex,c.lineLength,d,m);for(const e of h)p[e]=t.text.placedSymbolArray.length-1;return 4*g.length}function lh(t){for(const e in t)return t[e];return null}function ch(t,e,i,n,o,s,a,l,c){let h=s.top,p=s.bottom,d=s.left,f=s.right;const m=s.collisionPadding;if(m&&(d-=m[0],h-=m[1],f+=m[2],p+=m[3]),c){const t=new r(d,h),e=new r(f,h),i=new r(d,p),n=new r(f,p),o=u(c);t._rotate(o),e._rotate(o),i._rotate(o),n._rotate(o),d=Math.min(t.x,e.x,i.x,n.x),f=Math.max(t.x,e.x,i.x,n.x),h=Math.min(t.y,e.y,i.y,n.y),p=Math.max(t.y,e.y,i.y,n.y)}return t.emplaceBack(e.x,e.y,d,h,f,p,l,i,n,o),t.length-1}function uh(t){t.collisionPadding&&(t.top-=t.collisionPadding[1],t.bottom+=t.collisionPadding[3]);const e=t.bottom-t.top;return e>0?Math.max(10,e):null}function hh(t,e,i,n){const r=t.compareText;if(e in r){const t=r[e];for(let e=t.length-1;e>=0;e--)if(n.dist(t[e])<i)return!0}else r[e]=[];return r[e].push(n),!1}const ph=mc.VectorTileFeature.types,dh=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function fh(t,e,i,n,r,o,s,a,l,c,u,h,p){const d=a?Math.min(sh,Math.round(a[0])):0,f=a?Math.min(sh,Math.round(a[1])):0;t.emplaceBack(e,i,Math.round(32*n),Math.round(32*r),o,s,(d<<1)+(l?1:0),f,16*c,16*u,256*h,256*p)}function mh(t,e,i){t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i)}function gh(t){for(const e of t.sections)if(Xr(e.text))return!0;return!1}class yh{constructor(t){this.layoutVertexArray=new Oo,this.indexArray=new Uo,this.programConfigurations=t,this.segments=new Us,this.dynamicLayoutVertexArray=new ko,this.opacityVertexArray=new No,this.placedSymbolArray=new $o}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(t,e,i,n){this.isEmpty()||(i&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ac.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Ec.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,dh,!0),this.opacityVertexBuffer.itemSize=1),(i||n)&&this.programConfigurations.upload(t))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}ar("SymbolBuffers",yh);class vh{constructor(t,e,i){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new i,this.segments=new Us,this.collisionVertexArray=new Vo,this.collisionVertexArrayExt=new ko}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,Sc.members,!0),this.collisionVertexBufferExt=t.createVertexBuffer(this.collisionVertexArrayExt,Mc.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy())}}ar("CollisionBuffers",vh);class _h{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=ma([]),this.placementViewportMatrix=ma([]);const e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Lc(this.zoom,e["text-size"]),this.iconSizeData=Lc(this.zoom,e["icon-size"]);const i=this.layers[0].layout,n=i.get("symbol-sort-key"),r=i.get("symbol-z-order");this.canOverlap=i.get("text-allow-overlap")||i.get("icon-allow-overlap")||i.get("text-ignore-placement")||i.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==r&&void 0!==n.constantOr(1),this.sortFeaturesByY=("viewport-y"===r||"auto"===r&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===i.get("symbol-placement")&&(this.writingModes=i.get("text-writing-mode").map((t=>hu[t]))),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.sourceID=t.sourceID}createArrays(){this.text=new yh(new Ls(this.layers,this.zoom,(t=>/^text/.test(t)))),this.icon=new yh(new Ls(this.layers,this.zoom,(t=>/^icon/.test(t)))),this.glyphOffsetArray=new is,this.lineVertexArray=new ns,this.symbolInstances=new es}calculateGlyphDependencies(t,e,i,n,r){for(let o=0;o<t.length;o++)if(e[t.charCodeAt(o)]=!0,(i||n)&&r){const i=Nc[t.charAt(o)];i&&(e[i.charCodeAt(0)]=!0)}}populate(t,e,i){const n=this.layers[0],r=n.layout,o=r.get("text-font"),s=r.get("text-field"),a=r.get("icon-image"),l=("constant"!==s.value.kind||s.value.value instanceof de&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&("constant"!==o.value.kind||o.value.value.length>0),c="constant"!==a.value.kind||!!a.value.value||Object.keys(a.parameters).length>0,u=r.get("symbol-sort-key");if(this.features=[],!l&&!c)return;const h=e.iconDependencies,p=e.glyphDependencies,d=e.availableImages,f=new so(this.zoom);for(const{feature:e,id:s,index:a,sourceLayerIndex:m}of t){const t=n._featureFilter.needGeometry,g=qs(e,t);if(!n._featureFilter.filter(f,g,i))continue;let y,v;if(t||(g.geometry=Ws(e)),l){const t=n.getValueAndResolveTokens("text-field",g,i,d),e=de.factory(t);gh(e)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===no()||this.hasRTLText&&oo.isParsed())&&(y=kc(e,n,g))}if(c){const t=n.getValueAndResolveTokens("icon-image",g,i,d);v=t instanceof fe?t:fe.fromString(t)}if(!y&&!v)continue;const _=this.sortFeaturesByKey?u.evaluate(g,{},i):void 0;if(this.features.push({id:s,text:y,icon:v,index:a,sourceLayerIndex:m,geometry:g.geometry,properties:e.properties,type:ph[e.type],sortKey:_}),v&&(h[v.name]=!0),y){const t=o.evaluate(g,{},i).join(","),e="map"===r.get("text-rotation-alignment")&&"point"!==r.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(hu.vertical)>=0;for(const i of y.sections)if(i.image)h[i.image.name]=!0;else{const n=Vr(y.toString()),r=i.fontStack||t,o=p[r]=p[r]||{};this.calculateGlyphDependencies(i.text,o,e,this.allowVerticalPlacement,n)}}}"line"===r.get("symbol-placement")&&(this.features=function(t){const e={},i={},n=[];let r=0;function o(e){n.push(t[e]),r++}function s(t,e,r){const o=i[t];return delete i[t],i[e]=o,n[o].geometry[0].pop(),n[o].geometry[0]=n[o].geometry[0].concat(r[0]),o}function a(t,i,r){const o=e[i];return delete e[i],e[t]=o,n[o].geometry[0].shift(),n[o].geometry[0]=r[0].concat(n[o].geometry[0]),o}function l(t,e,i){const n=i?e[0][e[0].length-1]:e[0][0];return`${t}:${n.x}:${n.y}`}for(let c=0;c<t.length;c++){const u=t[c],h=u.geometry,p=u.text?u.text.toString():null;if(!p){o(c);continue}const d=l(p,h),f=l(p,h,!0);if(d in i&&f in e&&i[d]!==e[f]){const t=a(d,f,h),r=s(d,f,n[t].geometry);delete e[d],delete i[f],i[l(p,n[r].geometry,!0)]=r,n[t].geometry=null}else d in i?s(d,f,h):f in e?a(d,f,h):(o(c),e[d]=r-1,i[f]=r-1)}return n.filter((t=>t.geometry))}(this.features)),this.sortFeaturesByKey&&this.features.sort(((t,e)=>t.sortKey-e.sortKey))}update(t,e,i){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,i),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,i))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,e){const i=this.lineVertexArray.length;if(void 0!==t.segment){let i=t.dist(e[t.segment+1]),n=t.dist(e[t.segment]);const r={};for(let n=t.segment+1;n<e.length;n++)r[n]={x:e[n].x,y:e[n].y,tileUnitDistanceFromAnchor:i},n<e.length-1&&(i+=e[n+1].dist(e[n]));for(let i=t.segment||0;i>=0;i--)r[i]={x:e[i].x,y:e[i].y,tileUnitDistanceFromAnchor:n},i>0&&(n+=e[i-1].dist(e[i]));for(let t=0;t<e.length;t++){const e=r[t];this.lineVertexArray.emplaceBack(e.x,e.y,e.tileUnitDistanceFromAnchor)}}return{lineStartIndex:i,lineLength:this.lineVertexArray.length-i}}addSymbols(t,e,i,n,r,o,s,a,l,c,u,h){const p=t.indexArray,d=t.layoutVertexArray,f=t.segments.prepareSegment(4*e.length,d,p,this.canOverlap?o.sortKey:void 0),m=this.glyphOffsetArray.length,g=f.vertexLength,y=this.allowVerticalPlacement&&s===hu.vertical?Math.PI/2:0,v=o.text&&o.text.sections;for(let n=0;n<e.length;n++){const{tl:r,tr:s,bl:l,br:c,tex:u,pixelOffsetTL:m,pixelOffsetBR:g,minFontScaleX:_,minFontScaleY:x,glyphOffset:b,isSDF:w,sectionIndex:A}=e[n],E=f.vertexLength,S=b[1];fh(d,a.x,a.y,r.x,S+r.y,u.x,u.y,i,w,m.x,m.y,_,x),fh(d,a.x,a.y,s.x,S+s.y,u.x+u.w,u.y,i,w,g.x,m.y,_,x),fh(d,a.x,a.y,l.x,S+l.y,u.x,u.y+u.h,i,w,m.x,g.y,_,x),fh(d,a.x,a.y,c.x,S+c.y,u.x+u.w,u.y+u.h,i,w,g.x,g.y,_,x),mh(t.dynamicLayoutVertexArray,a,y),p.emplaceBack(E,E+1,E+2),p.emplaceBack(E+1,E+2,E+3),f.vertexLength+=4,f.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(b[0]),n!==e.length-1&&A===e[n+1].sectionIndex||t.programConfigurations.populatePaintArrays(d.length,o,o.index,{},h,v&&v[A])}t.placedSymbolArray.emplaceBack(a.x,a.y,m,this.glyphOffsetArray.length-m,g,l,c,a.segment,i?i[0]:0,i?i[1]:0,n[0],n[1],s,0,!1,0,u)}_commitLayoutVertex(t,e,i,n,r){t.emplaceBack(e.x,e.y,i,n,Math.round(r.x),Math.round(r.y))}_addCollisionDebugVertices(t,e,i,n,o){const s=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray),a=s.vertexLength,l=o.anchorX,c=o.anchorY;for(let t=0;t<4;t++)i.collisionVertexArray.emplaceBack(0,0,0,0);i.collisionVertexArrayExt.emplaceBack(e,-t.padding,-t.padding),i.collisionVertexArrayExt.emplaceBack(e,t.padding,-t.padding),i.collisionVertexArrayExt.emplaceBack(e,t.padding,t.padding),i.collisionVertexArrayExt.emplaceBack(e,-t.padding,t.padding),this._commitLayoutVertex(i.layoutVertexArray,n,l,c,new r(t.x1,t.y1)),this._commitLayoutVertex(i.layoutVertexArray,n,l,c,new r(t.x2,t.y1)),this._commitLayoutVertex(i.layoutVertexArray,n,l,c,new r(t.x2,t.y2)),this._commitLayoutVertex(i.layoutVertexArray,n,l,c,new r(t.x1,t.y2)),s.vertexLength+=4;const u=i.indexArray;u.emplaceBack(a,a+1),u.emplaceBack(a+1,a+2),u.emplaceBack(a+2,a+3),u.emplaceBack(a+3,a),s.primitiveLength+=4}_addTextDebugCollisionBoxes(t,e,i,n,r,o){for(let s=n;s<r;s++){const n=i.get(s),r=this.getSymbolInstanceTextSize(t,o,e,s);this._addCollisionDebugVertices(n,r,this.textCollisionBox,n.anchorPoint,o)}}_addIconDebugCollisionBoxes(t,e,i,n,r,o){for(let s=n;s<r;s++){const n=i.get(s),r=this.getSymbolInstanceIconSize(t,e,s);this._addCollisionDebugVertices(n,r,this.iconCollisionBox,n.anchorPoint,o)}}generateCollisionDebugBuffers(t,e){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new vh(zo,Tc.members,Xo),this.iconCollisionBox=new vh(zo,Tc.members,Xo);const i=Rc(this.iconSizeData,t),n=Rc(this.textSizeData,t);for(let r=0;r<this.symbolInstances.length;r++){const o=this.symbolInstances.get(r);this._addTextDebugCollisionBoxes(n,t,e,o.textBoxStartIndex,o.textBoxEndIndex,o),this._addTextDebugCollisionBoxes(n,t,e,o.verticalTextBoxStartIndex,o.verticalTextBoxEndIndex,o),this._addIconDebugCollisionBoxes(i,t,e,o.iconBoxStartIndex,o.iconBoxEndIndex,o),this._addIconDebugCollisionBoxes(i,t,e,o.verticalIconBoxStartIndex,o.verticalIconBoxEndIndex,o)}}getSymbolInstanceTextSize(t,e,i,n){const r=this.text.placedSymbolArray.get(e.rightJustifiedTextSymbolIndex>=0?e.rightJustifiedTextSymbolIndex:e.centerJustifiedTextSymbolIndex>=0?e.centerJustifiedTextSymbolIndex:e.leftJustifiedTextSymbolIndex>=0?e.leftJustifiedTextSymbolIndex:e.verticalPlacedTextSymbolIndex>=0?e.verticalPlacedTextSymbolIndex:n),o=Dc(this.textSizeData,t,r)/Cc;return this.tilePixelRatio*o}getSymbolInstanceIconSize(t,e,i){const n=this.icon.placedSymbolArray.get(i),r=Dc(this.iconSizeData,t,n);return this.tilePixelRatio*r}_commitDebugCollisionVertexUpdate(t,e,i){t.emplaceBack(e,-i,-i),t.emplaceBack(e,i,-i),t.emplaceBack(e,i,i),t.emplaceBack(e,-i,i)}_updateTextDebugCollisionBoxes(t,e,i,n,r,o){for(let s=n;s<r;s++){const n=i.get(s),r=this.getSymbolInstanceTextSize(t,o,e,s);this._commitDebugCollisionVertexUpdate(this.textCollisionBox.collisionVertexArrayExt,r,n.padding)}}_updateIconDebugCollisionBoxes(t,e,i,n,r){for(let o=n;o<r;o++){const n=i.get(o),r=this.getSymbolInstanceIconSize(t,e,o);this._commitDebugCollisionVertexUpdate(this.iconCollisionBox.collisionVertexArrayExt,r,n.padding)}}updateCollisionDebugBuffers(t,e){if(!this.hasDebugData())return;this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexArrayExt.clear(),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexArrayExt.clear();const i=Rc(this.iconSizeData,t),n=Rc(this.textSizeData,t);for(let r=0;r<this.symbolInstances.length;r++){const o=this.symbolInstances.get(r);this._updateTextDebugCollisionBoxes(n,t,e,o.textBoxStartIndex,o.textBoxEndIndex,o),this._updateTextDebugCollisionBoxes(n,t,e,o.verticalTextBoxStartIndex,o.verticalTextBoxEndIndex,o),this._updateIconDebugCollisionBoxes(i,t,e,o.iconBoxStartIndex,o.iconBoxEndIndex),this._updateIconDebugCollisionBoxes(i,t,e,o.verticalIconBoxStartIndex,o.verticalIconBoxEndIndex)}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(t,e,i,n,r,o,s,a,l){const c={};for(let n=e;n<i;n++){const e=t.get(n);c.textBox={x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,padding:e.padding,anchorPointX:e.anchorPointX,anchorPointY:e.anchorPointY},c.textFeatureIndex=e.featureIndex;break}for(let e=n;e<r;e++){const i=t.get(e);c.verticalTextBox={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2,padding:i.padding,anchorPointX:i.anchorPointX,anchorPointY:i.anchorPointY},c.verticalTextFeatureIndex=i.featureIndex;break}for(let e=o;e<s;e++){const i=t.get(e);c.iconBox={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2,padding:i.padding,anchorPointX:i.anchorPointX,anchorPointY:i.anchorPointY},c.iconFeatureIndex=i.featureIndex;break}for(let e=a;e<l;e++){const i=t.get(e);c.verticalIconBox={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2,padding:i.padding,anchorPointX:i.anchorPointX,anchorPointY:i.anchorPointY},c.verticalIconFeatureIndex=i.featureIndex;break}return c}deserializeCollisionBoxes(t){this.collisionArrays=[];for(let e=0;e<this.symbolInstances.length;e++){const i=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,i.textBoxStartIndex,i.textBoxEndIndex,i.verticalTextBoxStartIndex,i.verticalTextBoxEndIndex,i.iconBoxStartIndex,i.iconBoxEndIndex,i.verticalIconBoxStartIndex,i.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(t,e){const i=t.placedSymbolArray.get(e),n=i.vertexStartIndex+4*i.numGlyphs;for(let e=i.vertexStartIndex;e<n;e+=4)t.indexArray.emplaceBack(e,e+1,e+2),t.indexArray.emplaceBack(e+1,e+2,e+3)}getSortedSymbolIndexes(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const e=Math.sin(t),i=Math.cos(t),n=[],r=[],o=[];for(let t=0;t<this.symbolInstances.length;++t){o.push(t);const s=this.symbolInstances.get(t);n.push(0|Math.round(e*s.anchorX+i*s.anchorY)),r.push(s.featureIndex)}return o.sort(((t,e)=>n[t]-n[e]||r[e]-r[t])),o}addToSortKeyRanges(t,e){const i=this.sortKeyRanges[this.sortKeyRanges.length-1];i&&i.sortKey===e?i.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const t of this.symbolInstanceIndexes){const e=this.symbolInstances.get(t);this.featureSortOrder.push(e.featureIndex),[e.rightJustifiedTextSymbolIndex,e.centerJustifiedTextSymbolIndex,e.leftJustifiedTextSymbolIndex].forEach(((t,e,i)=>{t>=0&&i.indexOf(t)===e&&this.addIndicesForPlacedSymbol(this.text,t)})),e.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,e.verticalPlacedTextSymbolIndex),e.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.placedIconSymbolIndex),e.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}ar("SymbolBucket",_h,{omit:["layers","collisionBoxArray","features","compareText"]}),_h.MAX_GLYPHS=65535,_h.addDynamicAttributes=mh;const xh=new bo({"symbol-placement":new go(zt.layout_symbol["symbol-placement"]),"symbol-spacing":new go(zt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new go(zt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new yo(zt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new go(zt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new go(zt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new go(zt.layout_symbol["icon-ignore-placement"]),"icon-optional":new go(zt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new go(zt.layout_symbol["icon-rotation-alignment"]),"icon-size":new yo(zt.layout_symbol["icon-size"]),"icon-text-fit":new go(zt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new go(zt.layout_symbol["icon-text-fit-padding"]),"icon-image":new yo(zt.layout_symbol["icon-image"]),"icon-rotate":new yo(zt.layout_symbol["icon-rotate"]),"icon-padding":new go(zt.layout_symbol["icon-padding"]),"icon-keep-upright":new go(zt.layout_symbol["icon-keep-upright"]),"icon-offset":new yo(zt.layout_symbol["icon-offset"]),"icon-anchor":new yo(zt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new go(zt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new go(zt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new go(zt.layout_symbol["text-rotation-alignment"]),"text-field":new yo(zt.layout_symbol["text-field"]),"text-font":new yo(zt.layout_symbol["text-font"]),"text-size":new yo(zt.layout_symbol["text-size"]),"text-max-width":new yo(zt.layout_symbol["text-max-width"]),"text-line-height":new yo(zt.layout_symbol["text-line-height"]),"text-letter-spacing":new yo(zt.layout_symbol["text-letter-spacing"]),"text-justify":new yo(zt.layout_symbol["text-justify"]),"text-radial-offset":new yo(zt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new go(zt.layout_symbol["text-variable-anchor"]),"text-anchor":new yo(zt.layout_symbol["text-anchor"]),"text-max-angle":new go(zt.layout_symbol["text-max-angle"]),"text-writing-mode":new go(zt.layout_symbol["text-writing-mode"]),"text-rotate":new yo(zt.layout_symbol["text-rotate"]),"text-padding":new go(zt.layout_symbol["text-padding"]),"text-keep-upright":new go(zt.layout_symbol["text-keep-upright"]),"text-transform":new yo(zt.layout_symbol["text-transform"]),"text-offset":new yo(zt.layout_symbol["text-offset"]),"text-allow-overlap":new go(zt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new go(zt.layout_symbol["text-ignore-placement"]),"text-optional":new go(zt.layout_symbol["text-optional"])});var bh={paint:new bo({"icon-opacity":new yo(zt.paint_symbol["icon-opacity"]),"icon-color":new yo(zt.paint_symbol["icon-color"]),"icon-halo-color":new yo(zt.paint_symbol["icon-halo-color"]),"icon-halo-width":new yo(zt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new yo(zt.paint_symbol["icon-halo-blur"]),"icon-translate":new go(zt.paint_symbol["icon-translate"]),"icon-translate-anchor":new go(zt.paint_symbol["icon-translate-anchor"]),"text-opacity":new yo(zt.paint_symbol["text-opacity"]),"text-color":new yo(zt.paint_symbol["text-color"],{runtimeType:Qt,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new yo(zt.paint_symbol["text-halo-color"]),"text-halo-width":new yo(zt.paint_symbol["text-halo-width"]),"text-halo-blur":new yo(zt.paint_symbol["text-halo-blur"]),"text-translate":new go(zt.paint_symbol["text-translate"]),"text-translate-anchor":new go(zt.paint_symbol["text-translate-anchor"])}),layout:xh};class wh{constructor(t){this.type=t.property.overrides?t.property.overrides.runtimeType:qt,this.defaultValue=t}evaluate(t){if(t.formattedSection){const e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}ar("FormatSectionOverride",wh,{omit:["defaultValue"]});class Ah extends zs{constructor(t){super(t,bh)}recalculate(t,e){if(super.recalculate(t,e),"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")),"point"===this.layout.get("symbol-placement")){const t=this.layout.get("text-writing-mode");if(t){const e=[];for(const i of t)e.indexOf(i)<0&&e.push(i);this.layout._values["text-writing-mode"]=e}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(t,e,i,n){const r=this.layout.get(t).evaluate(e,{},i,n),o=this._unevaluatedLayout._values[t];return o.isDataDriven()||cn(o.value)||!r?r:function(t,e){return e.replace(/{([^{}]+)}/g,((e,i)=>i in t?String(t[i]):""))}(e.properties,r)}createBucket(t){return new _h(t)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const t of bh.paint.overridableProperties){if(!Ah.hasPaintOverride(this.layout,t))continue;const e=this.paint.get(t),i=new wh(e),n=new ln(i,e.property.specification);let r=null;r="constant"===e.value.kind||"source"===e.value.kind?new hn("source",n):new pn("composite",n,e.value.zoomStops,e.value._interpolationType),this.paint._values[t]=new fo(e.property,r,e.parameters)}}_handleOverridablePaintPropertyUpdate(t,e,i){return!(!this.layout||e.isDataDriven()||i.isDataDriven())&&Ah.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,e){const i=t.get("text-field"),n=bh.paint.properties[e];let r=!1;const o=t=>{for(const e of t)if(n.overrides&&n.overrides.hasOverride(e))return void(r=!0)};if("constant"===i.value.kind&&i.value.value instanceof de)o(i.value.value.sections);else if("source"===i.value.kind){const t=e=>{r||(e instanceof _e&&ye(e.value)===te?o(e.value.sections):e instanceof Ae?o(e.sections):e.eachChild(t))},e=i.value;e._styleExpression&&t(e._styleExpression.expression)}return r}getProgramConfiguration(t){return new Ps(this,t)}}var Eh={paint:new bo({"background-color":new go(zt.paint_background["background-color"]),"background-pattern":new _o(zt.paint_background["background-pattern"]),"background-opacity":new go(zt.paint_background["background-opacity"])})},Sh={paint:new bo({"raster-opacity":new go(zt.paint_raster["raster-opacity"]),"raster-hue-rotate":new go(zt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new go(zt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new go(zt.paint_raster["raster-brightness-max"]),"raster-saturation":new go(zt.paint_raster["raster-saturation"]),"raster-contrast":new go(zt.paint_raster["raster-contrast"]),"raster-resampling":new go(zt.paint_raster["raster-resampling"]),"raster-fade-duration":new go(zt.paint_raster["raster-fade-duration"])})};class Mh extends zs{constructor(t){super(t,{}),this.implementation=t}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){}serialize(){}onAdd(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)}onRemove(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)}}var Th={paint:new bo({"sky-type":new go(zt.paint_sky["sky-type"]),"sky-atmosphere-sun":new go(zt.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new go(zt.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new go(zt.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new go(zt.paint_sky["sky-gradient-radius"]),"sky-gradient":new xo(zt.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new go(zt.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new go(zt.paint_sky["sky-atmosphere-color"]),"sky-opacity":new go(zt.paint_sky["sky-opacity"])})};function Ih(t,e,i){const n=xa(0,0,1),r=Da(La());return function(t,e,i){i*=.5;var n=e[0],r=e[1],o=e[2],s=e[3],a=Math.sin(i),l=Math.cos(i);t[0]=n*l-o*a,t[1]=r*l+s*a,t[2]=o*l+n*a,t[3]=s*l-r*a}(r,r,i?-u(t)+Math.PI:u(t)),Ra(r,r,-u(e)),Sa(n,n,r),Ea(n,n)}const Ch={circle:class extends zs{constructor(t){super(t,pa)}createBucket(t){return new Zs(t)}queryRadius(t){const e=t;return aa("circle-radius",this,e)+aa("circle-stroke-width",this,e)+la(this.paint.get("circle-translate"))}queryIntersectsFeature(t,e,i,n,r,o,s,a){const l="map"===this.paint.get("circle-pitch-alignment");if(l&&t.queryGeometry.isAboveHorizon)return!1;const c=ua(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,t.pixelToTileUnitsFactor),u=this.paint.get("circle-radius").evaluate(e,i)+this.paint.get("circle-stroke-width").evaluate(e,i),h=l?u*t.pixelToTileUnitsFactor:u;for(const e of n)for(const i of e){const e=i.add(c),n=a&&o.elevation?o.elevation.exaggeration()*a.getElevationAt(e.x,e.y,!0):0,r=l?e:Oa(e,n,s),u=l?t.tilespaceRays.map((t=>Ba(t,n))):t.queryGeometry.screenGeometry;let p=h;const d=Pa([],[i.x,i.y,n,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?p*=d[3]/o.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(p*=o.cameraToCenterDistance/d[3]),Qs(u,r,p))return!0}return!1}getProgramIds(){return["circle"]}getProgramConfiguration(t){return new Ps(this,t)}},heatmap:class extends zs{createBucket(t){return new za(t)}constructor(t){super(t,Ha),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){"heatmap-color"===t&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Wa({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(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}getProgramIds(){return["heatmap","heatmapTexture"]}getProgramConfiguration(t){return new Ps(this,t)}},hillshade:class extends zs{constructor(t){super(t,qa)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}getProgramIds(){return["hillshade","hillshadePrepare"]}getProgramConfiguration(t){return new Ps(this,t)}},fill:class extends zs{constructor(t){super(t,Rl)}getProgramIds(){const t=this.paint.get("fill-pattern"),e=t&&t.constantOr(1),i=[e?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&i.push(e&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),i}getProgramConfiguration(t){return new Ps(this,t)}recalculate(t,e){super.recalculate(t,e);const i=this.paint._values["fill-outline-color"];"constant"===i.value.kind&&void 0===i.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new Ll(t)}queryRadius(){return la(this.paint.get("fill-translate"))}queryIntersectsFeature(t,e,i,n,r,o){return!t.queryGeometry.isAboveHorizon&&Js(ca(t.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,t.pixelToTileUnitsFactor),n)}isTileClipped(){return!0}},"fill-extrusion":class extends zs{constructor(t){super(t,Kl)}createBucket(t){return new Ql(t)}queryRadius(){return la(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}getProgramConfiguration(t){return new Ps(this,t)}queryIntersectsFeature(t,e,i,n,o,s,a,l,c){const u=ua(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),s.angle,t.pixelToTileUnitsFactor),h=this.paint.get("fill-extrusion-height").evaluate(e,i),p=this.paint.get("fill-extrusion-base").evaluate(e,i),d=[0,0],f=l&&s.elevation,m=s.elevation?s.elevation.exaggeration():1;if(f){const e=t.tile.getBucket(this).centroidVertexArray,i=c+1;if(i<e.length){const t=e.get(i);d[0]=t.a_centroid_pos0,d[1]=t.a_centroid_pos1}}if(0===d[0]&&1===d[1])return!1;const g=function(t,e,i,n,o,s,a,l,c){return s?function(t,e,i,n,r,o,s,a,l){const c=[],u=[],h=[0,0,0,1];for(const p of t){const t=[],d=[];for(const c of p){const u=c.x+n.x,p=c.y+n.y,f=ic(u,p,e,i,o,s,a,l);h[0]=u,h[1]=p,h[2]=f.base,h[3]=1,Pa(h,h,r),h[3]=Math.max(h[3],1e-5);const m=ec([h[0]/h[3],h[1]/h[3],h[2]/h[3]]);h[0]=u,h[1]=p,h[2]=f.top,h[3]=1,Pa(h,h,r),h[3]=Math.max(h[3],1e-5);const g=ec([h[0]/h[3],h[1]/h[3],h[2]/h[3]]);t.push(m),d.push(g)}c.push(t),u.push(d)}return[c,u]}(t,e,i,n,o,s,a,l,c):function(t,e,i,n,o){const s=[],a=[],l=o[8]*e,c=o[9]*e,u=o[10]*e,h=o[11]*e,p=o[8]*i,d=o[9]*i,f=o[10]*i,m=o[11]*i;for(const e of t){const t=[],i=[];for(const s of e){const e=s.x+n.x,a=s.y+n.y,g=o[0]*e+o[4]*a+o[12],y=o[1]*e+o[5]*a+o[13],v=o[2]*e+o[6]*a+o[14],_=o[3]*e+o[7]*a+o[15],x=g+l,b=y+c,w=v+u,A=Math.max(_+h,1e-5),E=g+p,S=y+d,M=v+f,T=Math.max(_+m,1e-5),I=new r(x/A,b/A);I.z=w/A,t.push(I);const C=new r(E/T,S/T);C.z=M/T,i.push(C)}s.push(t),a.push(i)}return[s,a]}(t,e,i,n,o)}(n,p,h,u,a,f?l:null,d,m,s.center.lat),y=t.queryGeometry;return function(t,e,i){let n=1/0;Js(i,e)&&(n=tc(i,e[0]));for(let r=0;r<e.length;r++){const o=e[r],s=t[r];for(let t=0;t<o.length-1;t++){const e=o[t],r=[e,o[t+1],s[t+1],s[t],e];Ys(i,r)&&(n=Math.min(n,tc(i,r)))}}return n!==1/0&&n}(g[0],g[1],y.isPointQuery()?y.screenBounds:y.screenGeometry)}},line:class extends zs{constructor(t){super(t,xc),this.gradientVersion=0}_handleSpecialPaintPropertyUpdate(t){if("line-gradient"===t){const t=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=t._styleExpression&&t._styleExpression.expression instanceof ei,this.gradientVersion=(this.gradientVersion+1)%a}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint._values["line-floorwidth"]=bc.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new vc(t)}getProgramIds(){const t=this.paint.get("line-dasharray"),e=this.paint.get("line-pattern").constantOr(1),i=this.paint.get("line-gradient");return[e?"linePattern":t?"lineSDF":i?"lineGradient":"line"]}getProgramConfiguration(t){return new Ps(this,t)}queryRadius(t){const e=t,i=wc(aa("line-width",this,e),aa("line-gap-width",this,e)),n=aa("line-offset",this,e);return i/2+Math.abs(n)+la(this.paint.get("line-translate"))}queryIntersectsFeature(t,e,i,n,o,s){if(t.queryGeometry.isAboveHorizon)return!1;const a=ca(t.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),s.angle,t.pixelToTileUnitsFactor),l=t.pixelToTileUnitsFactor/2*wc(this.paint.get("line-width").evaluate(e,i),this.paint.get("line-gap-width").evaluate(e,i)),c=this.paint.get("line-offset").evaluate(e,i);return c&&(n=function(t,e){const i=[],n=new r(0,0);for(let r=0;r<t.length;r++){const o=t[r],s=[];for(let t=0;t<o.length;t++){const i=o[t-1],r=o[t],a=o[t+1],l=0===t?n:r.sub(i)._unit()._perp(),c=t===o.length-1?n:a.sub(r)._unit()._perp(),u=l._add(c)._unit();u._mult(1/(u.x*c.x+u.y*c.y)),s.push(u._mult(e)._add(r))}i.push(s)}return i}(n,c*t.pixelToTileUnitsFactor)),function(t,e,i){for(let n=0;n<e.length;n++){const r=e[n];if(t.length>=3)for(let e=0;e<r.length;e++)if(ra(t,r[e]))return!0;if(Ks(t,r,i))return!0}return!1}(a,n,l)}isTileClipped(){return!0}},symbol:Ah,background:class extends zs{constructor(t){super(t,Eh)}getProgramIds(){return[this.paint.get("background-pattern")?"backgroundPattern":"background"]}},raster:class extends zs{constructor(t){super(t,Sh)}getProgramIds(){return["raster"]}},sky:class extends zs{constructor(t){super(t,Th),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){"sky-gradient"===t?this._updateColorRamp():"sky-atmosphere-sun"!==t&&"sky-atmosphere-halo-color"!==t&&"sky-atmosphere-color"!==t&&"sky-atmosphere-sun-intensity"!==t||(this._skyboxInvalidated=!0)}_updateColorRamp(){this.colorRamp=Wa({expression:this._transitionablePaint._values["sky-gradient"].value.expression,evaluationKey:"skyRadialProgress"}),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}needsSkyboxCapture(t){if(this._skyboxInvalidated||!this.skyboxTexture||!this.skyboxGeometry)return!0;if(!this.paint.get("sky-atmosphere-sun")){const e=t.style.light.properties.get("position");return this._lightPosition.azimuthal!==e.azimuthal||this._lightPosition.polar!==e.polar}}getCenter(t,e){const i=this.paint.get("sky-type");if("atmosphere"===i){const i=this.paint.get("sky-atmosphere-sun"),n=!i,r=t.style.light,o=r.properties.get("position");return n&&"viewport"===r.properties.get("anchor")&&L("The sun direction is attached to a light with viewport anchor, lighting may behave unexpectedly."),n?Ih(o.azimuthal,90-o.polar,e):Ih(i[0],90-i[1],e)}if("gradient"===i){const t=this.paint.get("sky-gradient-center");return Ih(t[0],90-t[1],e)}}is3D(){return!1}isSky(){return!0}markSkyboxValid(t){this._skyboxInvalidated=!1,this._lightPosition=t.style.light.properties.get("position")}hasOffscreenPass(){return!0}getProgramIds(){const t=this.paint.get("sky-type");return"atmosphere"===t?["skyboxCapture","skybox"]:"gradient"===t?["skyboxGradient"]:null}}},{HTMLImageElement:Ph,HTMLCanvasElement:Lh,HTMLVideoElement:Dh,ImageData:Rh,ImageBitmap:Oh}=s;class kh{constructor(t,e,i,n){this.context=t,this.format=i,this.texture=t.gl.createTexture(),this.update(e,n)}update(t,e,i){const{width:n,height:r}=t,o=!(this.size&&this.size[0]===n&&this.size[1]===r||i),{context:s}=this,{gl:a}=s;if(this.useMipmap=Boolean(e&&e.useMipmap),a.bindTexture(a.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1),s.pixelStoreUnpackPremultiplyAlpha.set(this.format===a.RGBA&&(!e||!1!==e.premultiply)),o)this.size=[n,r],t instanceof Ph||t instanceof Lh||t instanceof Dh||t instanceof Rh||Oh&&t instanceof Oh?a.texImage2D(a.TEXTURE_2D,0,this.format,this.format,a.UNSIGNED_BYTE,t):a.texImage2D(a.TEXTURE_2D,0,this.format,n,r,0,this.format,a.UNSIGNED_BYTE,t.data);else{const{x:e,y:o}=i||{x:0,y:0};t instanceof Ph||t instanceof Lh||t instanceof Dh||t instanceof Rh||Oh&&t instanceof Oh?a.texSubImage2D(a.TEXTURE_2D,0,e,o,a.RGBA,a.UNSIGNED_BYTE,t):a.texSubImage2D(a.TEXTURE_2D,0,e,o,n,r,a.RGBA,a.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&a.generateMipmap(a.TEXTURE_2D)}bind(t,e,i){const{context:n}=this,{gl:r}=n;r.bindTexture(r.TEXTURE_2D,this.texture),i!==r.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(i=r.LINEAR),t!==this.filter&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,i||t),this.filter=t),e!==this.wrap&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,e),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,e),this.wrap=e)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}class Nh{constructor(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))}setNorthEast(t){return this._ne=t instanceof zh?new zh(t.lng,t.lat):zh.convert(t),this}setSouthWest(t){return this._sw=t instanceof zh?new zh(t.lng,t.lat):zh.convert(t),this}extend(t){const e=this._sw,i=this._ne;let n,r;if(t instanceof zh)n=t,r=t;else{if(!(t instanceof Nh))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(Nh.convert(t)):this.extend(zh.convert(t)):this;if(n=t._sw,r=t._ne,!n||!r)return this}return e||i?(e.lng=Math.min(n.lng,e.lng),e.lat=Math.min(n.lat,e.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new zh(n.lng,n.lat),this._ne=new zh(r.lng,r.lat)),this}getCenter(){return new zh((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 zh(this.getWest(),this.getNorth())}getSouthEast(){return new zh(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(t){const{lng:e,lat:i}=zh.convert(t);let n=this._sw.lng<=e&&e<=this._ne.lng;return this._sw.lng>this._ne.lng&&(n=this._sw.lng>=e&&e>=this._ne.lng),this._sw.lat<=i&&i<=this._ne.lat&&n}static convert(t){return!t||t instanceof Nh?t:new Nh(t)}}const Bh=6371008.8;class zh{constructor(t,e){if(isNaN(t)||isNaN(e))throw new Error(`Invalid LngLat object: (${t}, ${e})`);if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new zh(g(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){const e=Math.PI/180,i=this.lat*e,n=t.lat*e,r=Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return Bh*Math.acos(Math.min(r,1))}toBounds(t=0){const e=360*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return new Nh(new zh(this.lng-i,this.lat-e),new zh(this.lng+i,this.lat+e))}static convert(t){if(t instanceof zh)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new zh(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new zh(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}const Fh=2*Math.PI*Bh;function Vh(t){return Fh*Math.cos(t*Math.PI/180)}function Uh(t){return(180+t)/360}function Gh(t){return(90-t)/360}function jh(t,e){return t/Vh(e)}function Hh(t){return m(90-360*t,-90,90)}function Wh(t,e){return t*Vh(Hh(e))}class qh{constructor(t,e,i=0){this.x=+t,this.y=+e,this.z=+i}static fromLngLat(t,e=0){const i=zh.convert(t);return new qh(Uh(i.lng),Gh(i.lat),jh(e,i.lat))}toLngLat(){return new zh(360*this.x-180,Hh(this.y))}toAltitude(){return Wh(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Fh*(t=Hh(this.y),1/Math.cos(t*Math.PI/180));var t}}class Xh{constructor(t,e){this.width=t,this.height=e,this.nextRow=0,this.image=new Ga({width:t,height:e}),this.positions={},this.uploaded=!1}getDash(t,e){const i=this.getKey(t,e);return this.positions[i]}trim(){const t=this.width,e=this.height=A(this.nextRow);this.image.resize({width:t,height:e})}getKey(t,e){return t.join(",")+e}getDashRanges(t,e,i){const n=[];let r=t.length%2==1?-t[t.length-1]*i:0,o=t[0]*i,s=!0;n.push({left:r,right:o,isDash:s,zeroLength:0===t[0]});let a=t[0];for(let e=1;e<t.length;e++){s=!s;const l=t[e];r=a*i,a+=l,o=a*i,n.push({left:r,right:o,isDash:s,zeroLength:0===l})}return n}addRoundDash(t,e,i){const n=e/2;for(let e=-i;e<=i;e++){const r=this.width*(this.nextRow+i+e);let o=0,s=t[o];for(let a=0;a<this.width;a++){a/s.right>1&&(s=t[++o]);const l=Math.abs(a-s.left),c=Math.abs(a-s.right),u=Math.min(l,c);let h;const p=e/i*(n+1);if(s.isDash){const t=n-Math.abs(p);h=Math.sqrt(u*u+t*t)}else h=n-Math.sqrt(u*u+p*p);this.image.data[r+a]=Math.max(0,Math.min(255,h+128))}}}addRegularDash(t,e){for(let e=t.length-1;e>=0;--e){const i=t[e],n=t[e+1];i.zeroLength?t.splice(e,1):n&&n.isDash===i.isDash&&(n.left=i.left,t.splice(e,1))}const i=t[0],n=t[t.length-1];i.isDash===n.isDash&&(i.left=n.left-this.width,n.right=i.right+this.width);const r=this.width*this.nextRow;let o=0,s=t[o];for(let i=0;i<this.width;i++){i/s.right>1&&(s=t[++o]);const n=Math.abs(i-s.left),a=Math.abs(i-s.right),l=Math.min(n,a);this.image.data[r+i]=Math.max(0,Math.min(255,(s.isDash?l:-l)+e+128))}}addDash(t,e){const i=this.getKey(t,e);if(this.positions[i])return this.positions[i];const n="round"===e,r=n?7:0,o=2*r+1;if(this.nextRow+o>this.height)return L("LineAtlas out of space"),null;0===t.length&&t.push(1);let s=0;for(let e=0;e<t.length;e++)t[e]<0&&(L("Negative value is found in line dasharray, replacing values with 0"),t[e]=0),s+=t[e];if(0!==s){const i=this.width/s,o=this.getDashRanges(t,this.width,i);n?this.addRoundDash(o,i,r):this.addRegularDash(o,"square"===e?.5*i:0)}const a=this.nextRow+r;this.nextRow+=o;const l={tl:[a,r],br:[s,0]};return this.positions[i]=l,l}}ar("LineAtlas",Xh);class Zh{constructor(t){this._callback=t,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(){delete this._channel,this._callback=()=>{}}}const Yh=s.performance;function Qh(t){const e=t?t.url.toString():void 0;return Yh.getEntriesByName(e)}class Jh{constructor(){this.tasks={},this.taskQueue=[],S(["process"],this),this.invoker=new Zh(this.process),this.nextId=0}add(t,e){const i=this.nextId++,n=function({type:t,isSymbolTile:e,zoom:i}){return i=i||0,"message"===t?0:"maybePrepare"!==t||e?"parseTile"!==t||e?"parseTile"===t&&e?300-i:"maybePrepare"===t&&e?400-i:500:200-i:100-i}(e);if(0===n){O();try{t()}finally{}return{cancel:()=>{}}}return this.tasks[i]={fn:t,metadata:e,priority:n,id:i},this.taskQueue.push(i),this.invoker.trigger(),{cancel:()=>{delete this.tasks[i]}}}process(){O();try{if(this.taskQueue=this.taskQueue.filter((t=>!!this.tasks[t])),!this.taskQueue.length)return;const t=this.pick();if(null===t)return;const e=this.tasks[t];if(delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),!e)return;e.fn()}finally{}}pick(){let t=null,e=1/0;for(let i=0;i<this.taskQueue.length;i++){const n=this.tasks[this.taskQueue[i]];n.priority<e&&(e=n.priority,t=i)}if(null===t)return null;const i=this.taskQueue[t];return this.taskQueue.splice(t,1),i}remove(){this.invoker.remove()}}class Kh{constructor(t,e,i){this.z=t,this.x=e,this.y=i,this.key=ep(0,t,t,e,i)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,e,i){const n=function(t,e,i){const n=360/Math.pow(2,i);return[t*n-180,90-(e+1)*n,(t+1)*n-180,90-e*n].join(",")}(this.x,this.y,this.z),r=function(t,e,i){let n,r="";for(let o=t;o>0;o--)n=1<<o-1,r+=(e&n?1:0)+(i&n?2:0);return r}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z+(i||0))).replace("{x}",String(this.x)).replace("{y}",String("tms"===e?0===this.z?0:Math.pow(2,this.z-1)-1-this.y:this.y)).replace("{quadkey}",r).replace("{bbox-epsg-4490}",n)}getTilePoint(t){const e=Math.pow(2,this.z);return new r((t.x*e-this.x)*Gs,(t.y*e-this.y)*Gs)}getTileVec3(t){const e=Math.pow(2,this.z);return xa((t.x*e-this.x)*Gs,(t.y*e-this.y)*Gs,Wh(t.z,t.y))}toString(){return`${this.z}/${this.x}/${this.y}`}}class $h{constructor(t,e){this.wrap=t,this.canonical=e,this.key=ep(t,e.z,e.z,e.x,e.y)}}class tp{constructor(t,e,i,n,r){this.overscaledZ=t,this.wrap=e,this.canonical=new Kh(i,+n,+r),this.key=0===e&&t===i?this.canonical.key:ep(e,t,i,n,r)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){const e=this.canonical.z-t;return t>this.canonical.z?new tp(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new tp(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)}calculateScaledKey(t,e=!0){if(this.overscaledZ===t&&e)return this.key;if(t>this.canonical.z)return ep(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y);{const i=this.canonical.z-t;return ep(this.wrap*+e,t,t,this.canonical.x>>i,this.canonical.y>>i)}}isChildOf(t){if(t.wrap!==this.wrap)return!1;const e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e}children(t){if(this.overscaledZ>=t)return[new tp(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const e=this.canonical.z+1,i=2*this.canonical.x,n=2*this.canonical.y;return[new tp(e,this.wrap,e,i,n),new tp(e,this.wrap,e,i+1,n),new tp(e,this.wrap,e,i,n+1),new tp(e,this.wrap,e,i+1,n+1)]}isLessThan(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))}wrapped(){return new tp(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new tp(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new $h(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(t){return this.canonical.getTilePoint(new qh(t.x-this.wrap,t.y))}getTileVec3(t){return this.canonical.getTileVec3(new qh(t.x-this.wrap,t.y,t.z))}}function ep(t,e,i,n,r){const o=1<<Math.min(i,22);let s=o*(r%o)+n%o;return t&&i<22&&(s+=o*o*((t<0?-2*t-1:2*t)%(1<<2*(22-i)))),16*(32*s+i)+(e-i)}ar("CanonicalTileID",Kh),ar("OverscaledTileID",tp,{omit:["projMatrix"]});class ip{constructor(t){this._stringToNumber={},this._numberToString=[];for(let e=0;e<t.length;e++){const i=t[e];this._stringToNumber[i]=e,this._numberToString[e]=i}}encode(t){return this._stringToNumber[t]}decode(t){return this._numberToString[t]}}class np{constructor(t,e,i,n,r){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=i,t._y=n,this.properties=t.properties,this.id=r}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(t){this._geometry=t}toJSON(){const t={geometry:this.geometry};for(const e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t}}var rp=Mo([{name:"a_pos",type:"Int16",components:2}]);class op{constructor(t,e,i){this.tileID=t,this.uid=b(),this.uses=0,this.tileSize=e,this.tileZoom=i,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(t){const e=t+this.timeAdded;e<G.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e)}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}loadVectorData(t,e,i){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){const i={};if(!e)return i;for(const n of t){const t=n.layerIds.map((t=>e.getLayer(t))).filter(Boolean);if(0!==t.length){n.layers=t,n.stateDependentLayerIds&&(n.stateDependentLayers=n.stateDependentLayerIds.map((e=>t.filter((t=>t.id===e))[0])));for(const e of t)i[e.id]=n}}return i}(t.buckets,e.style),this.hasSymbolBuckets=!1;for(const t in this.buckets){const e=this.buckets[t];if(e instanceof _h){if(this.hasSymbolBuckets=!0,!i)break;e.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const t in this.buckets){const e=this.buckets[t];if(e instanceof _h&&e.hasRTLText){this.hasRTLText=!0,oo.isLoading()||oo.isLoaded()||"deferred"!==no()||ro();break}}this.queryPadding=0;for(const t in this.buckets){const i=this.buckets[t];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(t).queryRadius(i))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage),t.lineAtlas&&(this.lineAtlas=t.lineAtlas)}else this.collisionBoxArray=new Jo}unloadVectorData(){for(const t in this.buckets)this.buckets[t].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.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(const e in this.buckets){const i=this.buckets[e];i.uploadPending()&&i.upload(t)}const e=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new kh(t,this.imageAtlas.image,e.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new kh(t,this.glyphAtlasImage,e.ALPHA),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new kh(t,this.lineAtlas.image,e.ALPHA),this.lineAtlas.uploaded=!0)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,e,i,n,r,o,s,a){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({tileResult:n,pixelPosMatrix:s,transform:o,params:r},t,e,i):{}}querySourceFeatures(t,e){const i=this.latestFeatureIndex;if(!i||!i.rawTileData)return;const n=i.loadVTLayers(),r=e?e.sourceLayer:"",o=n._geojsonTileLayer||n[r];if(!o)return;const s=En(e&&e.filter),{z:a,x:l,y:c}=this.tileID.canonical,u={z:a,x:l,y:c};for(let e=0;e<o.length;e++){const n=o.feature(e);if(s.needGeometry){const t=qs(n,!0);if(!s.filter(new so(this.tileID.overscaledZ),t,this.tileID.canonical))continue}else if(!s.filter(new so(this.tileID.overscaledZ),n))continue;const h=i.getId(n,r),p=new np(n,a,l,c,h);p.tile=u,t.push(p)}}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(t){const e=this.expirationTime;if(t.cacheControl){const e=k(t.cacheControl);e["max-age"]&&(this.expirationTime=Date.now()+1e3*e["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){const t=Date.now();let i=!1;if(this.expirationTime>t)i=!1;else if(e)if(this.expirationTime<e)i=!0;else{const n=this.expirationTime-e;n?this.expirationTime=t+Math.max(n,3e4):i=!0}else i=!0;i?(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(t,e){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||0===Object.keys(t).length)return;const i=this.latestFeatureIndex.loadVTLayers();for(const n in this.buckets){if(!e.style.hasLayer(n))continue;const r=this.buckets[n],o=r.layers[0].sourceLayer||"_geojsonTileLayer",s=i[o],a=t[o];if(!s||!a||0===Object.keys(a).length)continue;r.update(a,s,this.imageAtlas&&this.imageAtlas.patternPositions||{});const l=e&&e.style&&e.style.getLayer(n);l&&(this.queryPadding=Math.max(this.queryPadding,l.queryRadius(r)))}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<G.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(t){this.symbolFadeHoldUntil=G.now()+t}setDependencies(t,e){const i={};for(const t of e)i[t]=!0;this.dependencies[t]=i}hasDependency(t,e){for(const i of t){const t=this.dependencies[i];if(t)for(const i of e)if(t[i])return!0}return!1}clearQueryDebugViz(){}}class sp{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,e,i){const n=String(e);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][n]=this.stateChanges[t][n]||{},_(this.stateChanges[t][n],i),null===this.deletedStates[t]){this.deletedStates[t]={};for(const e in this.state[t])e!==n&&(this.deletedStates[t][e]=null)}else if(this.deletedStates[t]&&null===this.deletedStates[t][n]){this.deletedStates[t][n]={};for(const e in this.state[t][n])i[e]||(this.deletedStates[t][n][e]=null)}else for(const e in i)this.deletedStates[t]&&this.deletedStates[t][n]&&null===this.deletedStates[t][n][e]&&delete this.deletedStates[t][n][e]}removeFeatureState(t,e,i){if(null===this.deletedStates[t])return;const n=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},i&&void 0!==e)null!==this.deletedStates[t][n]&&(this.deletedStates[t][n]=this.deletedStates[t][n]||{},this.deletedStates[t][n][i]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][n])for(i in this.deletedStates[t][n]={},this.stateChanges[t][n])this.deletedStates[t][n][i]=null;else this.deletedStates[t][n]=null;else this.deletedStates[t]=null}getState(t,e){const i=String(e),n=_({},(this.state[t]||{})[i],(this.stateChanges[t]||{})[i]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){const i=this.deletedStates[t][e];if(null===i)return{};for(const t in i)delete n[t]}return n}initializeTileState(t,e){t.setFeatureState(this.state,e)}coalesceChanges(t,e){const i={};for(const t in this.stateChanges){this.state[t]=this.state[t]||{};const e={};for(const i in this.stateChanges[t])this.state[t][i]||(this.state[t][i]={}),_(this.state[t][i],this.stateChanges[t][i]),e[i]=this.state[t][i];i[t]=e}for(const t in this.deletedStates){this.state[t]=this.state[t]||{};const e={};if(null===this.deletedStates[t])for(const i in this.state[t])e[i]={},this.state[t][i]={};else for(const i in this.deletedStates[t]){if(null===this.deletedStates[t][i])this.state[t][i]={};else for(const e of Object.keys(this.deletedStates[t][i]))delete this.state[t][i][e];e[i]=this.state[t][i]}i[t]=i[t]||{},_(i[t],e)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(i).length)for(const n in t)t[n].setFeatureState(i,e)}}class ap{constructor(t){this.size=t,this.minimums=[],this.maximums=[],this.leaves=[]}getElevation(t,e){const i=this.toIdx(t,e);return{min:this.minimums[i],max:this.maximums[i]}}isLeaf(t,e){return this.leaves[this.toIdx(t,e)]}toIdx(t,e){return e*this.size+t}}function lp(t,e,i,n){let r=0,o=Number.MAX_VALUE;for(let s=0;s<3;s++)if(Math.abs(n[s])<1e-15){if(i[s]<t[s]||i[s]>e[s])return null}else{const a=1/n[s];let l=(t[s]-i[s])*a,c=(e[s]-i[s])*a;if(l>c){const t=l;l=c,c=t}if(l>r&&(r=l),c<o&&(o=c),r>o)return null}return r}function cp(t,e,i,n,r,o,s,a,l,c,u){const h=n-t,p=r-e,d=o-i,f=s-t,m=a-e,g=l-i,y=u[1]*g-u[2]*m,v=u[2]*f-u[0]*g,_=u[0]*m-u[1]*f,x=h*y+p*v+d*_;if(Math.abs(x)<1e-15)return null;const b=1/x,w=c[0]-t,A=c[1]-e,E=c[2]-i,S=(w*y+A*v+E*_)*b;if(S<0||S>1)return null;const M=A*d-E*p,T=E*h-w*d,I=w*p-A*h,C=(u[0]*M+u[1]*T+u[2]*I)*b;return C<0||S+C>1?null:(f*M+m*T+g*I)*b}function up(t,e,i){return(t-e)/(i-e)}function hp(t,e,i,n,r,o,s,a,l){const c=1<<i,u=o-n,h=s-r,p=(t+1)/c*u+n,d=(e+0)/c*h+r,f=(e+1)/c*h+r;a[0]=(t+0)/c*u+n,a[1]=d,l[0]=p,l[1]=f}class pp{constructor(t){if(this.maximums=[],this.minimums=[],this.leaves=[],this.childOffsets=[],this.nodeCount=0,this.dem=t,this._siblingOffset=[[0,0],[1,0],[0,1],[1,1]],!this.dem)return;const e=function(t){const e=Math.ceil(Math.log2(t.dim/8)),i=[];let n=Math.ceil(Math.pow(2,e));const r=1/n,o=(t,e,i,n,r)=>{const o=n?1:0,s=(t+1)*i-o,a=e*i,l=(e+1)*i-o;r[0]=t*i,r[1]=a,r[2]=s,r[3]=l};let s=new ap(n);const a=[];for(let e=0;e<n*n;e++){o(e%n,Math.floor(e/n),r,!1,a);const i=fp(a[0],a[1],t),l=fp(a[2],a[1],t),c=fp(a[2],a[3],t),u=fp(a[0],a[3],t);s.minimums.push(Math.min(i,l,c,u)),s.maximums.push(Math.max(i,l,c,u)),s.leaves.push(1)}for(i.push(s),n/=2;n>=1;n/=2){const t=i[i.length-1];s=new ap(n);for(let e=0;e<n*n;e++){o(e%n,Math.floor(e/n),2,!0,a);const i=t.getElevation(a[0],a[1]),r=t.getElevation(a[2],a[1]),l=t.getElevation(a[2],a[3]),c=t.getElevation(a[0],a[3]),u=t.isLeaf(a[0],a[1]),h=t.isLeaf(a[2],a[1]),p=t.isLeaf(a[2],a[3]),d=t.isLeaf(a[0],a[3]),f=Math.min(i.min,r.min,l.min,c.min),m=Math.max(i.max,r.max,l.max,c.max),g=u&&h&&p&&d;s.maximums.push(m),s.minimums.push(f),s.leaves.push(m-f<=5&&g?1:0)}i.push(s)}return i}(this.dem),i=e.length-1,n=e[i];this._addNode(n.minimums[0],n.maximums[0],n.leaves[0]),this._construct(e,0,0,i,0)}raycastRoot(t,e,i,n,r,o,s=1){return lp([t,e,-100],[i,n,this.maximums[0]*s],r,o)}raycast(t,e,i,n,r,o,s=1){if(!this.nodeCount)return null;const a=this.raycastRoot(t,e,i,n,r,o,s);if(null==a)return null;const l=[],c=[],u=[],h=[],p=[{idx:0,t:a,nodex:0,nodey:0,depth:0}];for(;p.length>0;){const{idx:a,t:d,nodex:f,nodey:m,depth:g}=p.pop();if(this.leaves[a]){hp(f,m,g,t,e,i,n,u,h);const a=1<<g,l=(f+0)/a,c=(f+1)/a,p=(m+0)/a,y=(m+1)/a,v=fp(l,p,this.dem)*s,_=fp(c,p,this.dem)*s,x=fp(c,y,this.dem)*s,b=fp(l,y,this.dem)*s,w=cp(u[0],u[1],v,h[0],u[1],_,h[0],h[1],x,r,o),A=cp(h[0],h[1],x,u[0],h[1],b,u[0],u[1],v,r,o),E=Math.min(null!==w?w:Number.MAX_VALUE,null!==A?A:Number.MAX_VALUE);if(E!==Number.MAX_VALUE)return E;{const t=Aa([],r,o,d);if(dp(v,_,b,x,up(t[0],u[0],h[0]),up(t[1],u[1],h[1]))>=t[2])return d}continue}let y=0;for(let p=0;p<this._siblingOffset.length;p++){hp((f<<1)+this._siblingOffset[p][0],(m<<1)+this._siblingOffset[p][1],g+1,t,e,i,n,u,h),u[2]=-100,h[2]=this.maximums[this.childOffsets[a]+p]*s;const d=lp(u,h,r,o);if(null!=d){const t=d;l[p]=t;let e=!1;for(let i=0;i<y&&!e;i++)t>=l[c[i]]&&(c.splice(i,0,p),e=!0);e||(c[y]=p),y++}}for(let t=0;t<y;t++){const e=c[t];p.push({idx:this.childOffsets[a]+e,t:l[e],nodex:(f<<1)+this._siblingOffset[e][0],nodey:(m<<1)+this._siblingOffset[e][1],depth:g+1})}}return null}_addNode(t,e,i){return this.minimums.push(t),this.maximums.push(e),this.leaves.push(i),this.childOffsets.push(0),this.nodeCount++}_construct(t,e,i,n,r){if(1===t[n].isLeaf(e,i))return;this.childOffsets[r]||(this.childOffsets[r]=this.nodeCount);const o=n-1,s=t[o];let a,l=0;for(let t=0;t<this._siblingOffset.length;t++){const n=2*e+this._siblingOffset[t][0],r=2*i+this._siblingOffset[t][1],o=s.getElevation(n,r),c=s.isLeaf(n,r),u=this._addNode(o.min,o.max,c);c&&(l|=1<<t),a||(a=u)}for(let n=0;n<this._siblingOffset.length;n++)l&1<<n||this._construct(t,2*e+this._siblingOffset[n][0],2*i+this._siblingOffset[n][1],o,a+n)}}function dp(t,e,i,n,r,o){return ii(ii(t,i,o),ii(e,n,o),r)}function fp(t,e,i){const n=i.dim,r=m(t*n-.5,0,n-1),o=m(e*n-.5,0,n-1),s=Math.floor(r),a=Math.floor(o),l=Math.min(s+1,n-1),c=Math.min(a+1,n-1);return dp(i.get(s,a),i.get(l,a),i.get(s,c),i.get(l,c),r-s,o-a)}const mp={mapbox:[6553.6,25.6,.1,1e4],terrarium:[256,1,1/256,32768]};class gp{get tree(){return this._tree||this._buildQuadTree(),this._tree}constructor(t,e,i,n=!1,r=!1){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(i&&"mapbox"!==i&&"terrarium"!==i)return L(`"${i}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=e.height;const o=this.dim=e.height-2;if(this.data=new Uint32Array(e.data.buffer),this.encoding=i||"mapbox",this.borderReady=n,!n){for(let t=0;t<o;t++)this.data[this._idx(-1,t)]=this.data[this._idx(0,t)],this.data[this._idx(o,t)]=this.data[this._idx(o-1,t)],this.data[this._idx(t,-1)]=this.data[this._idx(t,0)],this.data[this._idx(t,o)]=this.data[this._idx(t,o-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(o,-1)]=this.data[this._idx(o-1,0)],this.data[this._idx(-1,o)]=this.data[this._idx(0,o-1)],this.data[this._idx(o,o)]=this.data[this._idx(o-1,o-1)],r&&this._buildQuadTree()}}_buildQuadTree(){this._tree=new pp(this)}get(t,e,i=!1){const n=new Uint8Array(this.data.buffer);i&&(t=m(t,-1,this.dim),e=m(e,-1,this.dim));const r=4*this._idx(t,e);return("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(n[r],n[r+1],n[r+2])}static getUnpackVector(t){return mp[t]}get unpackVector(){return mp[this.encoding]}_idx(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)}_unpackMapbox(t,e,i){return(256*t*256+256*e+i)/10-1e4}_unpackTerrarium(t,e,i){return 256*t+e+i/256-32768}static pack(t,e){const i=[0,0,0,0],n=gp.getUnpackVector(e);let r=Math.floor((t+n[3])/n[2]);return i[2]=r%256,r=Math.floor(r/256),i[1]=r%256,r=Math.floor(r/256),i[0]=r,i}getPixels(){return new ja({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(t,e,i){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let n=e*this.dim,r=e*this.dim+this.dim,o=i*this.dim,s=i*this.dim+this.dim;switch(e){case-1:n=r-1;break;case 1:r=n+1}switch(i){case-1:o=s-1;break;case 1:s=o+1}const a=-e*this.dim,l=-i*this.dim;for(let e=o;e<s;e++)for(let i=n;i<r;i++)this.data[this._idx(i,e)]=t.data[this._idx(i+a,e+l)]}onDeserialize(){this._tree&&(this._tree.dem=this)}}ar("DEMData",gp),ar("DemMinMaxQuadTree",pp,{omit:["dem"]});class yp{constructor(t,e){this.max=t,this.onRemove=e,this.reset()}reset(){for(const t in this.data)for(const e of this.data[t])e.timeout&&clearTimeout(e.timeout),this.onRemove(e.value);return this.data={},this.order=[],this}add(t,e,i){const n=t.wrapped().key;void 0===this.data[n]&&(this.data[n]=[]);const r={value:e,timeout:void 0};if(void 0!==i&&(r.timeout=setTimeout((()=>{this.remove(t,r)}),i)),this.data[n].push(r),this.order.push(n),this.order.length>this.max){const t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){const e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value}getByKey(t){const e=this.data[t];return e?e[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,e){if(!this.has(t))return this;const i=t.wrapped().key,n=void 0===e?0:this.data[i].indexOf(e),r=this.data[i][n];return this.data[i].splice(n,1),r.timeout&&clearTimeout(r.timeout),0===this.data[i].length&&delete this.data[i],this.onRemove(r.value),this.order.splice(this.order.indexOf(i),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}filter(t){const e=[];for(const i in this.data)for(const n of this.data[i])t(n.value)||e.push(n);for(const t of e)this.remove(t.value.tileID,t)}}class vp{constructor(t,e,i){this.func=t,this.mask=e,this.range=i}}vp.ReadOnly=!1,vp.ReadWrite=!0,vp.disabled=new vp(519,vp.ReadOnly,[0,1]);const _p=7680;class xp{constructor(t,e,i,n,r,o){this.test=t,this.ref=e,this.mask=i,this.fail=n,this.depthFail=r,this.pass=o}}xp.disabled=new xp({func:519,mask:0},0,0,_p,_p,_p);class bp{constructor(t,e,i){this.blendFunction=t,this.blendColor=e,this.mask=i}}bp.Replace=[1,0],bp.disabled=new bp(bp.Replace,ue.transparent,[!1,!1,!1,!1]),bp.unblended=new bp(bp.Replace,ue.transparent,[!0,!0,!0,!0]),bp.alphaBlended=new bp([1,771],ue.transparent,[!0,!0,!0,!0]);const wp=1029,Ap=2305;class Ep{constructor(t,e,i){this.enable=t,this.mode=e,this.frontFace=i}}Ep.disabled=new Ep(!1,wp,Ap),Ep.backCCW=new Ep(!0,wp,Ap),Ep.backCW=new Ep(!0,wp,2304),Ep.frontCW=new Ep(!0,1028,2304),Ep.frontCCW=new Ep(!0,1028,Ap);class Sp extends Bt{constructor(t,e,i){super(),this.id=t,this._onlySymbols=i,e.on("data",(t=>{"source"===t.dataType&&"metadata"===t.sourceDataType&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform))})),e.on("error",(()=>{this._sourceErrored=!0})),this._source=e,this._tiles={},this._cache=new yp(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new sp}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(const t in this._tiles){const e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(t,e){return t.isSymbolTile=this._onlySymbols,this._source.loadTile(t,e)}_unloadTile(t){if(this._source.unloadTile)return this._source.unloadTile(t,(()=>{}))}_abortTile(t){if(this._source.abortTile)return this._source.abortTile(t,(()=>{}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const e in this._tiles){const i=this._tiles[e];i.upload(t),i.prepare(this.map.style.imageManager)}}getIds(){return v(this._tiles).map((t=>t.tileID)).sort(Mp).map((t=>t.key))}getRenderableIds(t){const e=[];for(const i in this._tiles)this._isIdRenderable(+i,t)&&e.push(this._tiles[i]);return t?e.sort(((t,e)=>{const i=t.tileID,n=e.tileID,o=new r(i.canonical.x,i.canonical.y)._rotate(this.transform.angle),s=new r(n.canonical.x,n.canonical.y)._rotate(this.transform.angle);return i.overscaledZ-n.overscaledZ||s.y-o.y||s.x-o.x})).map((t=>t.tileID.key)):e.map((t=>t.tileID)).sort(Mp).map((t=>t.key))}hasRenderableParent(t){const e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)}_isIdRenderable(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const t in this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(+t,"reloading")}}_reloadTile(t,e){const i=this._tiles[t];i&&("loading"!==i.state&&(i.state=e),this._loadTile(i,this._tileLoaded.bind(this,i,t,e)))}_tileLoaded(t,e,i,n){if(n)return t.state="errored",void(404!==n.status?this._source.fire(new Nt(n,{tile:t})):this.update(this.transform));t.timeAdded=G.now(),"expired"===i&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(e,t),"raster-dem"===this.getSource().type&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),this._source.fire(new kt("data",{dataType:"source",tile:t,coord:t.tileID,sourceCacheId:this.id}))}_backfillDEM(t){const e=this.getRenderableIds();for(let n=0;n<e.length;n++){const r=e[n];if(t.neighboringTiles&&t.neighboringTiles[r]){const e=this.getTileByID(r);i(t,e),i(e,t)}}function i(t,e){if(!t.dem||t.dem.borderReady)return;t.needsHillshadePrepare=!0,t.needsDEMTextureUpload=!0;let i=e.tileID.canonical.x-t.tileID.canonical.x;const n=e.tileID.canonical.y-t.tileID.canonical.y,r=Math.pow(2,t.tileID.canonical.z),o=e.tileID.key;0===i&&0===n||Math.abs(n)>1||(Math.abs(i)>1&&(1===Math.abs(i+r)?i+=r:1===Math.abs(i-r)&&(i-=r)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,i,n),t.neighboringTiles&&t.neighboringTiles[o]&&(t.neighboringTiles[o].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,e,i,n){for(const r in this._tiles){let o=this._tiles[r];if(n[r]||!o.hasData()||o.tileID.overscaledZ<=e||o.tileID.overscaledZ>i)continue;let s=o.tileID;for(;o&&o.tileID.overscaledZ>e+1;){const t=o.tileID.scaledTo(o.tileID.overscaledZ-1);o=this._tiles[t.key],o&&o.hasData()&&(s=t)}let a=s;for(;a.overscaledZ>e;)if(a=a.scaledTo(a.overscaledZ-1),t[a.key]){n[s.key]=s;break}}}findLoadedParent(t,e){if(t.key in this._loadedParentTiles){const i=this._loadedParentTiles[t.key];return i&&i.tileID.overscaledZ>=e?i:null}for(let i=t.overscaledZ-1;i>=e;i--){const e=t.scaledTo(i),n=this._getLoadedTile(e);if(n)return n}}_getLoadedTile(t){const e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(this._source.reparseOverscaled?t.wrapped().key:t.canonical.key)}updateCacheSize(t,e){e=e||this._source.tileSize;const i=Math.ceil(t.width/e)+1,n=Math.ceil(t.height/e)+1,r=Math.floor(i*n*5),o="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(o)}handleWrapJump(t){const e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){const t={};for(const i in this._tiles){const n=this._tiles[i];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+e),t[n.tileID.key]=n}this._tiles=t;for(const t in this._timers)clearTimeout(this._timers[t]),delete this._timers[t];for(const t in this._tiles)this._setTileReloadTimer(+t,this._tiles[t])}}update(t,e,i){if(this.transform=t,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage)return;if(this.usedForTerrain&&!i)return;let n;this.updateCacheSize(t,e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?n=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((t=>new tp(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y))):(n=t.coveringTiles({tileSize:e||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!i,reparseOverscaled:this._source.reparseOverscaled,useElevationData:!!this.transform.elevation&&!this.usedForTerrain}),this._source.hasTile&&(n=n.filter((t=>this._source.hasTile(t))))):n=[];const r=this._updateRetainedTiles(n);if(Tp(this._source.type)&&0!==n.length){const t={},e={},i=Object.keys(r);for(const n of i){const i=r[n],o=this._tiles[n];if(!o||o.fadeEndTime&&o.fadeEndTime<=G.now())continue;const s=this.findLoadedParent(i,Math.max(i.overscaledZ-Sp.maxOverzooming,this._source.minzoom));s&&(this._addTile(s.tileID),t[s.tileID.key]=s.tileID),e[n]=i}const o=n[n.length-1].overscaledZ;for(const t in this._tiles){const i=this._tiles[t];if(r[t]||!i.hasData())continue;let n=i.tileID;for(;n.overscaledZ>o;){n=n.scaledTo(n.overscaledZ-1);const o=this._tiles[n.key];if(o&&o.hasData()&&e[n.key]){r[t]=i.tileID;break}}}for(const e in t)r[e]||(this._coveredTiles[e]=!0,r[e]=t[e])}for(const t in r)this._tiles[t].clearFadeHold();const o=function(t,e){const i=[];for(const n in t)n in e||i.push(n);return i}(this._tiles,r);for(const t of o){const e=this._tiles[t];e.hasSymbolBuckets&&!e.holdingForFade()?e.setHoldDuration(this.map._fadeDuration):e.hasSymbolBuckets&&!e.symbolFadeFinished()||this._removeTile(+t)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(+t)}_updateRetainedTiles(t){const e={};if(0===t.length)return e;const i={},n=t[t.length-1].overscaledZ,r=t[0].overscaledZ,o=Math.max(r-Sp.maxOverzooming,this._source.minzoom),s=Math.max(r+Sp.maxUnderzooming,this._source.minzoom),a={};for(const i of t){const t=this._addTile(i);e[i.key]=i,t.hasData()||n<this._source.maxzoom&&(a[i.key]=i)}this._retainLoadedChildren(a,n,s,e);for(const n of t){let t=this._tiles[n.key];if(t.hasData())continue;if(n.canonical.z>=this._source.maxzoom){const t=n.children(this._source.maxzoom)[0],i=this.getTile(t);if(i&&i.hasData()){e[t.key]=t;continue}}else{const t=n.children(this._source.maxzoom);if(e[t[0].key]&&e[t[1].key]&&e[t[2].key]&&e[t[3].key])continue}let r=t.wasRequested();for(let s=n.overscaledZ-1;s>=o;--s){const o=n.scaledTo(s);if(i[o.key])break;if(i[o.key]=!0,t=this.getTile(o),!t&&r&&(t=this._addTile(o)),t&&(e[o.key]=o,r=t.wasRequested(),t.hasData()))break}}return e}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const e=[];let i,n=this._tiles[t].tileID;for(;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){i=this._loadedParentTiles[n.key];break}e.push(n.key);const t=n.scaledTo(n.overscaledZ-1);if(i=this._getLoadedTile(t),i)break;n=t}for(const t of e)this._loadedParentTiles[t]=i}}_addTile(t){let e=this._tiles[t.key];if(e)return e;e=this._cache.getAndRemove(t),e&&(this._setTileReloadTimer(t.key,e),e.tileID=t,this._state.initializeTileState(e,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,e)));const i=Boolean(e);return i||(e=new op(t,this._source.tileSize*t.overscaleFactor(),this.transform.tileZoom),this._loadTile(e,this._tileLoaded.bind(this,e,t.key,e.state))),e?(e.uses++,this._tiles[t.key]=e,i||this._source.fire(new kt("dataloading",{tile:e,coord:e.tileID,dataType:"source"})),e):null}_setTileReloadTimer(t,e){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const i=e.getExpiryTimeout();i&&(this._timers[t]=setTimeout((()=>{this._reloadTile(t,"expired"),delete this._timers[t]}),i))}_removeTile(t){const e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(+t);this._cache.reset()}tilesIn(t,e,i){const n=[],r=this.transform;if(!r)return n;for(const o in this._tiles){const s=this._tiles[o];if(i&&s.clearQueryDebugViz(),s.holdingForFade())continue;const a=t.containsTile(s,r,e);a&&n.push(a)}return n}getVisibleCoordinates(t){const e=this.getRenderableIds(t).map((t=>this._tiles[t].tileID));for(const t of e)t.projMatrix=this.transform.calculateProjMatrix(t.toUnwrapped());return e}hasTransition(){if(this._source.hasTransition())return!0;if(Tp(this._source.type))for(const t in this._tiles){const e=this._tiles[t];if(void 0!==e.fadeEndTime&&e.fadeEndTime>=G.now())return!0}return!1}setFeatureState(t,e,i){this._state.updateState(t=t||"_geojsonTileLayer",e,i)}removeFeatureState(t,e,i){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,i)}getFeatureState(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)}setDependencies(t,e,i){const n=this._tiles[t];n&&n.setDependencies(e,i)}reloadTilesForDependencies(t,e){for(const i in this._tiles)this._tiles[i].hasDependency(t,e)&&this._reloadTile(+i,"reloading");this._cache.filter((i=>!i.hasDependency(t,e)))}}function Mp(t,e){const i=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-i||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function Tp(t){return"raster"===t||"image"===t||"video"===t}Sp.maxOverzooming=10,Sp.maxUnderzooming=3;class Ip{constructor(t,e,i){this._demTile=t,this._dem=this._demTile.dem,this._scale=e,this._offset=i}static create(t,e,i){const n=i||t.findDEMTileFor(e);if(!n||!n.dem)return;const r=n.dem,o=n.tileID,s=1<<e.canonical.z-o.canonical.z;return new Ip(n,n.tileSize/Gs/s,[(e.canonical.x/s-o.canonical.x)*r.dim,(e.canonical.y/s-o.canonical.y)*r.dim])}tileCoordToPixel(t,e){const i=e*this._scale+this._offset[1],n=Math.floor(t*this._scale+this._offset[0]),o=Math.floor(i);return new r(n,o)}getElevationAt(t,e,i,n){const r=t*this._scale+this._offset[0],o=e*this._scale+this._offset[1],s=Math.floor(r),a=Math.floor(o),l=this._dem;return n=!!n,i?ii(ii(l.get(s,a,n),l.get(s,a+1,n),o-a),ii(l.get(s+1,a,n),l.get(s+1,a+1,n),o-a),r-s):l.get(s,a,n)}getElevationAtPixel(t,e,i){return this._dem.get(t,e,!!i)}getMeterToDEM(t){return(1<<this._demTile.tileID.canonical.z)*jh(1,t)*this._dem.stride}}class Cp{constructor(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new ir(Gs,16,0),this.featureIndexArray=new os,this.promoteId=e}insert(t,e,i,n,r,o=0){const s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(i,n,r,o);const a=this.grid;for(let t=0;t<e.length;t++){const i=e[t],n=[1/0,1/0,-1/0,-1/0];for(let t=0;t<i.length;t++){const e=i[t];n[0]=Math.min(n[0],e.x),n[1]=Math.min(n[1],e.y),n[2]=Math.max(n[2],e.x),n[3]=Math.max(n[3],e.y)}n[0]<Gs&&n[1]<Gs&&n[2]>=0&&n[3]>=0&&a.insert(s,n[0],n[1],n[2],n[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new mc.VectorTile(new Fc(this.rawTileData)).layers,this.sourceLayerCoder=new ip(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(t,e,i,n){this.loadVTLayers();const r=t.params||{},o=En(r.filter),s=t.tileResult,a=t.transform,l=s.bufferedTilespaceBounds,c=this.grid.query(l.min.x,l.min.y,l.max.x,l.max.y,((t,e,i,n)=>oa(s.bufferedTilespaceGeometry,t,e,i,n)));c.sort(Lp);let u=null;a.elevation&&c.length>0&&(u=Ip.create(a.elevation,this.tileID));const h={};let p;for(let a=0;a<c.length;a++){const l=c[a];if(l===p)continue;p=l;const d=this.featureIndexArray.get(l);let f=null;this.loadMatchingFeature(h,d,o,r.layers,r.availableImages,e,i,n,((e,i,n,r=0)=>(f||(f=Ws(e)),i.queryIntersectsFeature(s,e,n,f,this.z,t.transform,t.pixelPosMatrix,u,r))))}return h}loadMatchingFeature(t,e,i,n,r,o,s,a,l){const{featureIndex:c,bucketIndex:u,sourceLayerIndex:h,layoutVertexArrayOffset:p}=e,d=this.bucketLayerIDs[u];if(n&&!function(t,e){for(let i=0;i<t.length;i++)if(e.indexOf(t[i])>=0)return!0;return!1}(n,d))return;const f=this.sourceLayerCoder.decode(h),m=this.vtLayers[f].feature(c);if(i.needGeometry){const t=qs(m,!0);if(!i.filter(new so(this.tileID.overscaledZ),t,this.tileID.canonical))return}else if(!i.filter(new so(this.tileID.overscaledZ),m))return;const g=this.getId(m,f);for(let e=0;e<d.length;e++){const i=d[e];if(n&&n.indexOf(i)<0)continue;const u=o[i];if(!u)continue;let h={};void 0!==g&&a&&(h=a.getState(u.sourceLayer||"_geojsonTileLayer",g));const f=_({},s[i]);f.paint=Pp(f.paint,u.paint,m,h,r),f.layout=Pp(f.layout,u.layout,m,h,r);const y=!l||l(m,u,h,p);if(!y)continue;const v=new np(m,this.z,this.x,this.y,g);v.layer=f;let x=t[i];void 0===x&&(x=t[i]=[]),x.push({featureIndex:c,feature:v,intersectionZ:y})}}lookupSymbolFeatures(t,e,i,n,r,o,s,a){const l={};this.loadVTLayers();const c=En(r);for(const r of t)this.loadMatchingFeature(l,{bucketIndex:i,sourceLayerIndex:n,featureIndex:r,layoutVertexArrayOffset:0},c,o,s,a,e);return l}hasLayer(t){for(const e of this.bucketLayerIDs)for(const i of e)if(t===i)return!0;return!1}getId(t,e){let i=t.id;return this.promoteId&&(i=t.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[e]],"boolean"==typeof i&&(i=Number(i))),i}}function Pp(t,e,i,n,r){return T(t,((t,o)=>{const s=e instanceof mo?e.get(o):null;return s&&s.evaluate?s.evaluate(i,n,r):s}))}function Lp(t,e){return e-t}ar("FeatureIndex",Cp,{omit:["rawTileData","sourceLayerCoder"]});class Dp{constructor(t){const e={},i=[];for(const n in t){const r=t[n],o=e[n]={};for(const t in r){const e=r[+t];if(!e||0===e.bitmap.width||0===e.bitmap.height)continue;const n=e.metrics.localGlyph?2:1,s={x:0,y:0,w:e.bitmap.width+2*n,h:e.bitmap.height+2*n};i.push(s),o[t]={rect:s,metrics:e.metrics}}}const{w:n,h:r}=lu(i),o=new Ga({width:n||1,height:r||1});for(const i in t){const n=t[i];for(const t in n){const r=n[+t];if(!r||0===r.bitmap.width||0===r.bitmap.height)continue;const s=e[i][t].rect,a=r.metrics.localGlyph?2:1;Ga.copy(r.bitmap,o,{x:0,y:0},{x:s.x+a,y:s.y+a},r.bitmap)}}this.image=o,this.positions=e}}ar("GlyphAtlas",Dp);class Rp{constructor(t){this.tileID=new tp(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.tileZoom=t.tileZoom,this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies,this.promoteId=t.promoteId,this.enableTerrain=!!t.enableTerrain,this.isSymbolTile=t.isSymbolTile}parse(t,e,i,n,r){this.status="parsing",this.data=t,this.collisionBoxArray=new Jo;const o=new ip(Object.keys(t.layers).sort()),s=new Cp(this.tileID,this.promoteId);s.bucketLayerIDs=[];const a={},l=new Xh(256,256),c={featureIndex:s,iconDependencies:{},patternDependencies:{},glyphDependencies:{},lineAtlas:l,availableImages:i},u=e.familiesBySource[this.source];for(const e in u){const n=t.layers[e];if(!n)continue;let r=!1,l=!1;for(const t of u[e])"symbol"===t[0].type?r=!0:l=!0;if(!0===this.isSymbolTile&&!r)continue;if(!1===this.isSymbolTile&&!l)continue;1===n.version&&L(`Vector tile source "${this.source}" layer "${e}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const h=o.encode(e),p=[];for(let t=0;t<n.length;t++){const i=n.feature(t),r=s.getId(i,e);p.push({feature:i,id:r,index:t,sourceLayerIndex:h})}for(const t of u[e]){const e=t[0];void 0!==this.isSymbolTile&&"symbol"===e.type!==this.isSymbolTile||e.minzoom&&this.zoom<Math.floor(e.minzoom)||e.maxzoom&&this.zoom>=e.maxzoom||"none"!==e.visibility&&(Op(t,this.zoom,i),(a[e.id]=e.createBucket({index:s.bucketLayerIDs.length,layers:t,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:h,sourceID:this.source,enableTerrain:this.enableTerrain})).populate(p,c,this.tileID.canonical),s.bucketLayerIDs.push(t.map((t=>t.id))))}}let h,p,d,f;l.trim();const m={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},g=T(c.glyphDependencies,(t=>Object.keys(t).map(Number)));Object.keys(g).length?n.send("getGlyphs",{uid:this.uid,stacks:g},((t,e)=>{h||(h=t,p=e,x.call(this))}),void 0,!1,m):p={};const y=Object.keys(c.iconDependencies);y.length?n.send("getImages",{icons:y,source:this.source,tileID:this.tileID,type:"icons"},((t,e)=>{h||(h=t,d=e,x.call(this))}),void 0,!1,m):d={};const _=Object.keys(c.patternDependencies);function x(){if(h)return r(h);if(p&&d&&f){const t=new Dp(p),e=new uu(d,f);for(const n in a){const r=a[n];r instanceof _h?(Op(r.layers,this.zoom,i),nh(r,p,t.positions,d,e.iconPositions,this.showCollisionBoxes,this.tileID.canonical,this.tileZoom)):r.hasPattern&&(r instanceof vc||r instanceof Ll||r instanceof Ql)&&(Op(r.layers,this.zoom,i),r.addFeatures(c,this.tileID.canonical,e.patternPositions))}this.status="done",r(null,{buckets:v(a).filter((t=>!t.isEmpty())),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,lineAtlas:l,imageAtlas:e,glyphMap:this.returnDependencies?p:null,iconMap:this.returnDependencies?d:null,glyphPositions:this.returnDependencies?t.positions:null})}}_.length?n.send("getImages",{icons:_,source:this.source,tileID:this.tileID,type:"patterns"},((t,e)=>{h||(h=t,f=e,x.call(this))}),void 0,!1,m):f={},x.call(this)}}function Op(t,e,i){const n=new so(e);for(const e of t)e.recalculate(n,i)}class kp{constructor(t){this.entries={},this.scheduler=t}request(t,e,i,n){const r=this.entries[t]=this.entries[t]||{callbacks:[]};if(r.result){const[t,i]=r.result;return this.scheduler?this.scheduler.add((()=>{n(t,i)}),e):n(t,i),()=>{}}return r.callbacks.push(n),r.cancel||(r.cancel=i(((i,n)=>{r.result=[i,n];for(const t of r.callbacks)this.scheduler?this.scheduler.add((()=>{t(i,n)}),e):t(i,n);setTimeout((()=>delete this.entries[t]),3e3)}))),()=>{r.result||(r.callbacks=r.callbacks.filter((t=>t!==n)),r.callbacks.length||(r.cancel(),delete this.entries[t]))}}}function Np(t,e,i){const n=JSON.stringify(t.request);return t.data&&(this.deduped.entries[n]={result:[null,t.data]}),this.deduped.request(n,{type:"parseTile",isSymbolTile:t.isSymbolTile,zoom:t.tileZoom},(e=>{const n=St(t.request,((t,n,r,o)=>{t?e(t):n&&e(null,{vectorTile:i?void 0:new mc.VectorTile(new Fc(n)),rawData:n,cacheControl:r,expires:o})}));return()=>{n.cancel(),e()}}),e)}t.ARRAY_TYPE=da,t.AUTH_ERR_MSG=K,t.Actor=class{constructor(t,e,i){this.target=t,this.parent=e,this.mapId=i,this.callbacks={},this.cancelCallbacks={},S(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.globalScope=O()?t:s,this.scheduler=new Jh}send(t,e,i,n,r=!1,o){const s=Math.round(1e18*Math.random()).toString(36).substring(0,10);i&&(i.metadata=o,this.callbacks[s]=i);const a=V(this.globalScope)?void 0:[];return this.target.postMessage({id:s,type:t,hasCallback:!!i,targetMapId:n,mustQueue:r,sourceMapId:this.mapId,data:ur(e,a)},a),{cancel:()=>{i&&delete this.callbacks[s],this.target.postMessage({id:s,type:"<cancel>",targetMapId:n,sourceMapId:this.mapId})}}}receive(t){const e=t.data,i=e.id;if(i&&(!e.targetMapId||this.mapId===e.targetMapId))if("<cancel>"===e.type){const t=this.cancelCallbacks[i];delete this.cancelCallbacks[i],t&&t.cancel()}else if(e.mustQueue||O()){const t=this.callbacks[i];this.cancelCallbacks[i]=this.scheduler.add((()=>this.processTask(i,e)),t&&t.metadata||{type:"message"})}else this.processTask(i,e)}processTask(t,e){if("<response>"===e.type){const i=this.callbacks[t];delete this.callbacks[t],i&&(e.error?i(hr(e.error)):i(null,hr(e.data)))}else{const i=V(this.globalScope)?void 0:[],n=e.hasCallback?(e,n)=>{delete this.cancelCallbacks[t],this.target.postMessage({id:t,type:"<response>",sourceMapId:this.mapId,error:e?ur(e):null,data:ur(n,i)},i)}:t=>{},r=hr(e.data);if(this.parent[e.type])this.parent[e.type](e.sourceMapId,r,n);else if(this.parent.getWorkerSource){const t=e.type.split(".");this.parent.getWorkerSource(e.sourceMapId,t[0],r.source)[t[1]](r,n)}else n(new Error(`Could not find function ${e.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}},t.CanonicalTileID=Kh,t.Color=ue,t.ColorMode=bp,t.CullFaceMode=Ep,t.DEMData=gp,t.DataConstantProperty=go,t.DedupedRequest=kp,t.DepthMode=vp,t.EXTENT=Gs,t.Elevation=class{getAtPointOrZero(t,e=0){return this.getAtPoint(t,e)||0}getAtPoint(t,e,i=!0){null==e&&(e=null);const n=this._source();if(!n)return e;if(t.y<0||t.y>1)return e;const r=n.getSource().maxzoom,o=1<<r,s=Math.floor(t.x),a=t.x-s,l=new tp(r,s,r,Math.floor(a*o),Math.floor(t.y*o)),c=this.findDEMTileFor(l);if(!c||!c.dem)return e;const u=c.dem,h=1<<c.tileID.canonical.z,p=(a*h-c.tileID.canonical.x)*u.dim,d=(t.y*h-c.tileID.canonical.y)*u.dim,f=Math.floor(p),m=Math.floor(d);return(i?this.exaggeration():1)*ii(ii(u.get(f,m),u.get(f,m+1),d-m),ii(u.get(f+1,m),u.get(f+1,m+1),d-m),p-f)}getAtTileOffset(t,e,i){const n=1<<t.canonical.z;return this.getAtPointOrZero(new qh(t.wrap+(t.canonical.x+e/Gs)/n,(t.canonical.y+i/Gs)/n))}getForTilePoints(t,e,i,n){const r=Ip.create(this,t,n);return!!r&&(e.forEach((t=>{t[2]=this.exaggeration()*r.getElevationAt(t[0],t[1],i)})),!0)}getMinMaxForTile(t){const e=this.findDEMTileFor(t);if(!e||!e.dem)return null;const i=e.dem.tree,n=e.tileID,r=1<<t.canonical.z-n.canonical.z;let o=t.canonical.x/r-n.canonical.x,s=t.canonical.y/r-n.canonical.y,a=0;for(let e=0;e<t.canonical.z-n.canonical.z&&!i.leaves[a];e++){o*=2,s*=2;const t=2*Math.floor(s)+Math.floor(o);a=i.childOffsets[a]+t,o%=1,s%=1}return{min:this.exaggeration()*i.minimums[a],max:this.exaggeration()*i.maximums[a]}}getMinElevationBelowMSL(){throw new Error("Pure virtual method called.")}raycast(t,e,i){throw new Error("Pure virtual method called.")}pointCoordinate(t){throw new Error("Pure virtual method called.")}_source(){throw new Error("Pure virtual method called.")}exaggeration(){throw new Error("Pure virtual method called.")}findDEMTileFor(t){throw new Error("Pure virtual method called.")}get visibleDemTiles(){throw new Error("Getter must be implemented in subclass.")}},t.ErrorEvent=Nt,t.EvaluationParameters=so,t.Event=kt,t.Evented=Bt,t.GlyphManager=Hu,t.ImagePosition=cu,t.LineAtlas=Xh,t.LngLat=zh,t.LngLatBounds=Nh,t.LocalGlyphMode=ju,t.MAX_SAFE_INTEGER=a,t.MercatorCoordinate=qh,t.ONE_EM=Cc,t.OverscaledTileID=tp,t.Properties=bo,t.RGBAImage=ja,t.RequestManager=class{constructor(t,e,i){this._transformRequestFn=t,this._customAccessToken=e,this._silenceAuthErrors=!!i,this._createSkuToken()}_createSkuToken(){const t=function(){let t="";for(let e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",J,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt}_isSkuTokenExpired(){return Date.now()>this._skuTokenExpiresAt}transformRequest(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}}normalizeStyleURL(t,e){if(!$(t))return t;const i=it(t);return i.path=`/styles/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||e)}normalizeGlyphsURL(t,e){if(!$(t))return t;const i=it(t);return i.path=`/fonts/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||e)}normalizeSourceURL(t,e){if(!$(t))return t;const i=it(t);return i.path=`/v4/${i.authority}.json`,i.params.push("secure"),this._makeAPIURL(i,this._customAccessToken||e)}normalizeSpriteURL(t,e,i,n){const r=it(t);return $(t)?(r.path=`/styles/v1${r.path}/sprite${e}${i}`,this._makeAPIURL(r,this._customAccessToken||n)):(r.path+=`${e}${i}`,nt(r))}normalizeTileURL(t,e,i){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!$(t))return t;const n=it(t);n.path=n.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${e||i&&"raster"!==n.authority&&512===i?"@2x":""}${W.supported?".webp":"$1"}`),"raster"===n.authority?n.path=`/${H.RASTER_URL_PREFIX}${n.path}`:(n.path=n.path.replace(/^.+\/v4\//,"/"),n.path=`/${H.TILE_URL_VERSION}${n.path}`);const r=this._customAccessToken||function(t){for(const e of t){const t=e.match(/^access_token=(.*)$/);if(t)return t[1]}return null}(n.params)||H.ACCESS_TOKEN;return H.REQUIRE_ACCESS_TOKEN&&r&&this._skuToken&&n.params.push(`sku=${this._skuToken}`),this._makeAPIURL(n,r)}canonicalizeTileURL(t,e){const i=it(t);if(!i.path.match(/^(\/v4\/|\/raster\/v1\/)/)||!i.path.match(/\.[\w]+$/))return t;let n="mapbox://";i.path.match(/^\/raster\/v1\//)?n+=`raster/${i.path.replace(`/${H.RASTER_URL_PREFIX}/`,"")}`:n+=`tiles/${i.path.replace(`/${H.TILE_URL_VERSION}/`,"")}`;let r=i.params;return e&&(r=r.filter((t=>!t.match(/^access_token=/)))),r.length&&(n+=`?${r.join("&")}`),n}canonicalizeTileset(t,e){const i=!!e&&$(e),n=[];for(const e of t.tiles||[])tt(e)?n.push(this.canonicalizeTileURL(e,i)):n.push(e);return n}_makeAPIURL(t,e){const i="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",n=it(H.API_URL);if(t.protocol=n.protocol,t.authority=n.authority,"http"===t.protocol){const e=t.params.indexOf("secure");e>=0&&t.params.splice(e,1)}if("/"!==n.path&&(t.path=`${n.path}${t.path}`),!H.REQUIRE_ACCESS_TOKEN)return nt(t);if(e=e||H.ACCESS_TOKEN,!this._silenceAuthErrors){if(!e)throw new Error(`An API access token is required to use Mapbox GL. ${i}`);if("s"===e[0])throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${i}`)}return t.params=t.params.filter((t=>-1===t.indexOf("access_token"))),t.params.push(`access_token=${e||""}`),nt(t)}},t.ResourceType=bt,t.SegmentVector=Us,t.SourceCache=Sp,t.StencilMode=xp,t.StructArrayLayout1ui2=Zo,t.StructArrayLayout2f1f2i16=Fo,t.StructArrayLayout2i4=Io,t.StructArrayLayout2ui4=Xo,t.StructArrayLayout3f12=ko,t.StructArrayLayout3ui6=Uo,t.StructArrayLayout4i8=Co,t.Texture=kh,t.Tile=op,t.Transitionable=co,t.Uniform1f=_s,t.Uniform1i=class extends vs{constructor(t,e){super(t,e),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))}},t.Uniform2f=class extends vs{constructor(t,e){super(t,e),this.current=[0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))}},t.Uniform3f=class extends vs{constructor(t,e){super(t,e),this.current=[0,0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))}},t.Uniform4f=xs,t.UniformColor=bs,t.UniformMatrix3f=class extends vs{constructor(t,e){super(t,e),this.current=As}set(t){for(let e=0;e<9;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix3fv(this.location,!1,t);break}}},t.UniformMatrix4f=class extends vs{constructor(t,e){super(t,e),this.current=ws}set(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(let e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}}},t.UnwrappedTileID=$h,t.ValidationError=Ft,t.VectorTileWorkerSource=class extends Bt{constructor(t,e,i,n,r){super(),this.actor=t,this.layerIndex=e,this.availableImages=i,this.loadVectorData=r||Np,this.loading={},this.loaded={},this.deduped=new kp(t.scheduler),this.isSpriteLoaded=n,this.scheduler=t.scheduler}loadTile(t,e){const i=t.uid,n=t&&t.request,r=n&&n.collectResourceTiming,o=this.loading[i]=new Rp(t);o.abort=this.loadVectorData(t,((s,a)=>{const l=!this.loading[i];if(delete this.loading[i],l||s||!a)return o.status="done",l||(this.loaded[i]=o),e(s);const c=a.rawData,u={};a.expires&&(u.expires=a.expires),a.cacheControl&&(u.cacheControl=a.cacheControl),o.vectorTile=a.vectorTile||new mc.VectorTile(new Fc(c));const h=()=>{o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,((t,i)=>{if(t||!i)return e(t);const o={};if(r){const t=Qh(n);t.length>0&&(o.resourceTiming=JSON.parse(JSON.stringify(t)))}e(null,_({rawTileData:c.slice(0)},i,u,o))}))};this.isSpriteLoaded?h():this.once("isSpriteLoaded",(()=>{this.scheduler?this.scheduler.add(h,{type:"parseTile",isSymbolTile:t.isSymbolTile,zoom:t.tileZoom}):h()})),this.loaded=this.loaded||{},this.loaded[i]=o}))}reloadTile(t,e){const i=this.loaded,n=t.uid,r=this;if(i&&i[n]){const o=i[n];o.showCollisionBoxes=t.showCollisionBoxes,o.enableTerrain=!!t.enableTerrain;const s=(t,i)=>{const n=o.reloadCallback;n&&(delete o.reloadCallback,o.parse(o.vectorTile,r.layerIndex,this.availableImages,r.actor,n)),e(t,i)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}}abortTile(t,e){const i=t.uid,n=this.loading[i];n&&(n.abort&&n.abort(),delete this.loading[i]),e()}removeTile(t,e){const i=this.loaded,n=t.uid;i&&i[n]&&delete i[n],e()}},t.WritingMode=hu,t.ZoomHistory=pr,t.add=function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t},t.addDynamicAttributes=mh,t.altitudeFromMercatorZ=Wh,t.asyncAll=y,t.bezier=d,t.bindAll=S,t.bufferConvexPolygon=function(t,e){const i=[];for(let n=0;n<t.length;n++){const r=g(n-1,-1,t.length-1),o=g(n+1,-1,t.length-1),s=t[n],a=t[o],l=t[r].sub(s).unit(),c=a.sub(s).unit(),u=c.angleWithSep(l.x,l.y),h=l.add(c).unit().mult(-1*e/Math.sin(u/2));i.push(s.add(h))}return i},t.cacheEntryPossiblyAdded=function(t){xt++,xt>yt&&(t.getActor().send("enforceCacheSizeLimit",gt),xt=0)},t.clamp=m,t.clearTileCache=function(t){const e=s.caches.delete(dt);t&&e.catch(t).then((()=>t()))},t.clipLine=Nu,t.clone=function(t){var e=new da(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.clone$1=function(t){var e=new da(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$2=C,t.collisionCircleLayout=Ic,t.config=H,t.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},t.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},t.create=va,t.create$1=function(){var t=new da(16);return da!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$2=fa,t.createExpression=un,t.createFilter=En,t.createLayout=Mo,t.createStyleLayer=function(t){return"custom"===t.type?new Mh(t):new Ch[t.type](t)},t.cross=function(t,e,i){var n=e[0],r=e[1],o=e[2],s=i[0],a=i[1],l=i[2];return t[0]=r*l-o*a,t[1]=o*s-n*l,t[2]=n*a-r*s,t},t.degToRad=u,t.div=function(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t[2]=e[2]/i[2],t},t.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},t.dot$1=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},t.ease=f,t.easeCubicInOut=p,t.emitValidationErrors=er,t.endsWith=M,t.enforceCacheSizeLimit=function(t){vt(),ft&&ft.then((e=>{e.keys().then((i=>{for(let n=0;n<i.length-t;n++)e.delete(i[n])}))}))},t.evaluateSizeForFeature=Dc,t.evaluateSizeForZoom=Rc,t.evaluateVariableOffset=ih,t.evented=io,t.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},t.exactEquals$1=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},t.exported=G,t.exported$1=W,t.extend=_,t.filterObject=I,t.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},t.fromQuat=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=i+i,a=n+n,l=r+r,c=i*s,u=n*s,h=n*a,p=r*s,d=r*a,f=r*l,m=o*s,g=o*a,y=o*l;return t[0]=1-h-f,t[1]=u+y,t[2]=p-g,t[3]=0,t[4]=u-y,t[5]=1-c-f,t[6]=d+m,t[7]=0,t[8]=p+g,t[9]=d-m,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.fromRotation=function(t,e){var i=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.furthestTileCorner=function(t){const e=Math.round((t+45+360)%360/90)%4;return h[e]},t.getAABBPointSquareDist=function(t,e,i){let n=0;for(let r=0;r<2;++r){const o=i?i[r]:0;t[r]>o&&(n+=(t[r]-o)*(t[r]-o)),e[r]<o&&(n+=(o-e[r])*(o-e[r]))}return n},t.getAnchorAlignment=Eu,t.getAnchorJustification=rh,t.getBounds=function(t){let e=1/0,i=1/0,n=-1/0,o=-1/0;for(const r of t)e=Math.min(e,r.x),i=Math.min(i,r.y),n=Math.max(n,r.x),o=Math.max(o,r.y);return{min:new r(e,i),max:new r(n,o)}},t.getImage=Dt,t.getJSON=function(t,e){return Et(_(t,{type:"json"}),e)},t.getMapSessionAPI=ht,t.getPerformanceMeasurement=Qh,t.getRTLTextPluginStatus=no,t.getReferrer=At,t.getVideo=function(t,e){const i=s.document.createElement("video");i.muted=!0,i.onloadstart=function(){e(null,i)};for(let e=0;e<t.length;e++){const n=s.document.createElement("source");It(t[e])||(i.crossOrigin="Anonymous"),n.src=t[e],i.appendChild(n)}return{cancel:()=>{}}},t.identity=ma,t.identity$1=Da,t.invert=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],p=e[10],d=e[11],f=e[12],m=e[13],g=e[14],y=e[15],v=i*a-n*s,_=i*l-r*s,x=i*c-o*s,b=n*l-r*a,w=n*c-o*a,A=r*c-o*l,E=u*m-h*f,S=u*g-p*f,M=u*y-d*f,T=h*g-p*m,I=h*y-d*m,C=p*y-d*g,P=v*C-_*I+x*T+b*M-w*S+A*E;return P?(t[0]=(a*C-l*I+c*T)*(P=1/P),t[1]=(r*I-n*C-o*T)*P,t[2]=(m*A-g*w+y*b)*P,t[3]=(p*w-h*A-d*b)*P,t[4]=(l*M-s*C-c*S)*P,t[5]=(i*C-r*M+o*S)*P,t[6]=(g*x-f*A-y*_)*P,t[7]=(u*A-p*x+d*_)*P,t[8]=(s*I-a*M+c*E)*P,t[9]=(n*M-i*I-o*E)*P,t[10]=(f*w-m*x+y*v)*P,t[11]=(h*x-u*w-d*v)*P,t[12]=(a*S-s*T-l*E)*P,t[13]=(i*T-n*S+r*E)*P,t[14]=(m*_-f*b-g*v)*P,t[15]=(u*b-h*_+p*v)*P,t):null},t.isMapAuthenticated=function(t){return pt.has(t)},t.isMapboxURL=$,t.latFromMercatorY=Hh,t.len=Ca,t.length=_a,t.length$1=function(t){return Math.hypot(t[0],t[1],t[2],t[3])},t.loadVectorTile=Np,t.makeRequest=Et,t.mercatorXfromLng=Uh,t.mercatorYfromLat=Gh,t.mercatorZfromAltitude=jh,t.mul=function(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t[3]=e[3]*i[3],t},t.mul$1=ya,t.mul$2=Ia,t.multiply=ga,t.multiply$1=wa,t.nextPowerOfTwo=A,t.normalize=Ea,t.normalize$1=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=i*i+n*n+r*r+o*o;return s>0&&(s=1/Math.sqrt(s)),t[0]=i*s,t[1]=n*s,t[2]=r*s,t[3]=o*s,t},t.number=ii,t.ortho=function(t,e,i,n,r,o,s){var a=1/(e-i),l=1/(n-r),c=1/(o-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+i)*a,t[13]=(r+n)*l,t[14]=(s+o)*c,t[15]=1,t},t.pbf=Fc,t.perspective=function(t,e,i,n,r){var o,s=1/Math.tan(e/2);return t[0]=s/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0?(t[10]=(r+n)*(o=1/(n-r)),t[14]=2*r*n*o):(t[10]=-1,t[14]=-2*n),t},t.pick=function(t,e){const i={};for(let n=0;n<e.length;n++){const r=e[n];r in t&&(i[r]=t[r])}return i},t.plugin=oo,t.pointGeometry=r,t.polygonIntersectsBox=oa,t.polygonIntersectsPolygon=Ys,t.polygonizeBounds=function(t,e,i=0,n=!0){const o=new r(i,i),s=t.sub(o),a=e.add(o),l=[s,new r(a.x,s.y),a,new r(s.x,a.y)];return n&&l.push(s),l},t.posAttributes=rp,t.postMapLoadEvent=ct,t.postTurnstileEvent=at,t.potpack=lu,t.prevPowerOfTwo=function(t){return t<=1?1:Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},t.radToDeg=function(t){return t*c},t.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.registerForPluginStateChange=function(t){return t({pluginStatus:Kr,pluginURL:$r}),io.on("pluginStateChange",t),t},t.removeAuthState=function(t){pt.delete(t)},t.renderColorRamp=Wa,t.rotateX=function(t,e,i){var n=Math.sin(i),r=Math.cos(i),o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u=e[9],h=e[10],p=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*r+c*n,t[5]=s*r+u*n,t[6]=a*r+h*n,t[7]=l*r+p*n,t[8]=c*r-o*n,t[9]=u*r-s*n,t[10]=h*r-a*n,t[11]=p*r-l*n,t},t.rotateX$1=Ra,t.rotateY=function(t,e,i){var n=Math.sin(i),r=Math.cos(i),o=e[0],s=e[1],a=e[2],l=e[3],c=e[8],u=e[9],h=e[10],p=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*r-c*n,t[1]=s*r-u*n,t[2]=a*r-h*n,t[3]=l*r-p*n,t[8]=o*n+c*r,t[9]=s*n+u*r,t[10]=a*n+h*r,t[11]=l*n+p*r,t},t.rotateZ=function(t,e,i){var n=Math.sin(i),r=Math.cos(i),o=e[0],s=e[1],a=e[2],l=e[3],c=e[4],u=e[5],h=e[6],p=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*r+c*n,t[1]=s*r+u*n,t[2]=a*r+h*n,t[3]=l*r+p*n,t[4]=c*r-o*n,t[5]=u*r-s*n,t[6]=h*r-a*n,t[7]=p*r-l*n,t},t.rotateZ$1=function(t,e,i){i*=.5;var n=e[0],r=e[1],o=e[2],s=e[3],a=Math.sin(i),l=Math.cos(i);return t[0]=n*l+r*a,t[1]=r*l-n*a,t[2]=o*l+s*a,t[3]=s*l-o*a,t},t.scale=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t},t.scale$1=function(t,e,i){var n=i[0],r=i[1],o=i[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.scale$2=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t},t.scaleAndAdd=Aa,t.setCacheLimits=function(t,e){gt=t,yt=e},t.setRTLTextPlugin=function(t,e,i=!1){if(Kr===Zr||Kr===Yr||Kr===Qr)throw new Error("setRTLTextPlugin cannot be called multiple times.");$r=G.resolveURL(t),Kr=Zr,Jr=e,eo(),i||ro()},t.smoothstep=function(t,e,i){return(i=m((i-t)/(e-t),0,1))*i*(3-2*i)},t.spec=zt,t.storeAuthState=function(t,e){e?pt.add(t):pt.delete(t)},t.sub=Ta,t.subtract=ba,t.symbolSize=Oc,t.transformMat3=function(t,e,i){var n=e[0],r=e[1],o=e[2];return t[0]=n*i[0]+r*i[3]+o*i[6],t[1]=n*i[1]+r*i[4]+o*i[7],t[2]=n*i[2]+r*i[5]+o*i[8],t},t.transformMat4=Pa,t.transformMat4$1=function(t,e,i){var n=e[0],r=e[1],o=e[2],s=i[3]*n+i[7]*r+i[11]*o+i[15];return t[0]=(i[0]*n+i[4]*r+i[8]*o+i[12])/(s=s||1),t[1]=(i[1]*n+i[5]*r+i[9]*o+i[13])/s,t[2]=(i[2]*n+i[6]*r+i[10]*o+i[14])/s,t},t.transformQuat=Sa,t.translate=function(t,e,i){var n,r,o,s,a,l,c,u,h,p,d,f,m=i[0],g=i[1],y=i[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*y+e[12],t[13]=e[1]*m+e[5]*g+e[9]*y+e[13],t[14]=e[2]*m+e[6]*g+e[10]*y+e[14],t[15]=e[3]*m+e[7]*g+e[11]*y+e[15]):(r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],p=e[9],d=e[10],f=e[11],t[0]=n=e[0],t[1]=r,t[2]=o,t[3]=s,t[4]=a,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=p,t[10]=d,t[11]=f,t[12]=n*m+a*g+h*y+e[12],t[13]=r*m+l*g+p*y+e[13],t[14]=o*m+c*g+d*y+e[14],t[15]=s*m+u*g+f*y+e[15]),t},t.triggerPluginCompletionEvent=to,t.uniqueId=b,t.validateCustomStyleLayer=function(t){const e=[],i=t.id;return void 0===i&&e.push({message:`layers.${i}: missing required property "id"`}),void 0===t.render&&e.push({message:`layers.${i}: missing required method "render"`}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),e},t.validateFog=Kn,t.validateLight=Jn,t.validateStyle=Qn,t.values=v,t.vectorTile=mc,t.vectorTile$1=Wl,t.version=e,t.warnOnce=L,t.window=s,t.wrap=g})),n(["./shared"],(function(t){function e(t){const i=typeof t;if("number"===i||"boolean"===i||"string"===i||null==t)return JSON.stringify(t);if(Array.isArray(t)){let i="[";for(const n of t)i+=`${e(n)},`;return`${i}]`}const n=Object.keys(t).sort();let r="{";for(let i=0;i<n.length;i++)r+=`${JSON.stringify(n[i])}:${e(t[n[i]])},`;return`${r}}`}function i(i){let n="";for(const r of t.refProperties)n+=`/${e(i[r])}`;return n}class n{constructor(t){this.keyCache={},t&&this.replace(t)}replace(t){this._layerConfigs={},this._layers={},this.update(t,[])}update(e,n){for(const i of e){this._layerConfigs[i.id]=i;const e=this._layers[i.id]=t.createStyleLayer(i);e._featureFilter=t.createFilter(e.filter),this.keyCache[i.id]&&delete this.keyCache[i.id]}for(const t of n)delete this.keyCache[t],delete this._layerConfigs[t],delete this._layers[t];this.familiesBySource={};const r=function(t,e){const n={};for(let r=0;r<t.length;r++){const o=e&&e[t[r].id]||i(t[r]);e&&(e[t[r].id]=o);let s=n[o];s||(s=n[o]=[]),s.push(t[r])}const r=[];for(const t in n)r.push(n[t]);return r}(t.values(this._layerConfigs),this.keyCache);for(const t of r){const e=t.map((t=>this._layers[t.id])),i=e[0];if("none"===i.visibility)continue;const n=i.source||"";let r=this.familiesBySource[n];r||(r=this.familiesBySource[n]={});const o=i.sourceLayer||"_geojsonTileLayer";let s=r[o];s||(s=r[o]=[]),s.push(e)}}}const{ImageBitmap:r}=t.window;class o{loadTile(e,i){const{uid:n,encoding:o,rawImageData:s,padding:a,buildQuadTree:l}=e,c=r&&s instanceof r?this.getImageData(s,a):s;i(null,new t.DEMData(n,c,o,a<1,l))}getImageData(e,i){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);const n=this.offscreenCanvasContext.getImageData(-i,-i,e.width+2*i,e.height+2*i);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:n.width,height:n.height},n.data)}}var s=function t(e,i){var n,r=e&&e.type;if("FeatureCollection"===r)for(n=0;n<e.features.length;n++)t(e.features[n],i);else if("GeometryCollection"===r)for(n=0;n<e.geometries.length;n++)t(e.geometries[n],i);else if("Feature"===r)t(e.geometry,i);else if("Polygon"===r)a(e.coordinates,i);else if("MultiPolygon"===r)for(n=0;n<e.coordinates.length;n++)a(e.coordinates[n],i);return e};function a(t,e){if(0!==t.length){l(t[0],e);for(var i=1;i<t.length;i++)l(t[i],!e)}}function l(t,e){for(var i=0,n=0,r=t.length,o=r-1;n<r;o=n++)i+=(t[n][0]-t[o][0])*(t[o][1]+t[n][1]);i>=0!=!!e&&t.reverse()}const c=t.vectorTile.VectorTileFeature.prototype.toGeoJSON;class u{constructor(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))}loadGeometry(){if(1===this._feature.type){const e=[];for(const i of this._feature.geometry)e.push([new t.pointGeometry(i[0],i[1])]);return e}{const e=[];for(const i of this._feature.geometry){const n=[];for(const e of i)n.push(new t.pointGeometry(e[0],e[1]));e.push(n)}return e}}toGeoJSON(t,e,i){return c.call(this,t,e,i)}}class h{constructor(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.EXTENT,this.length=e.length,this._features=e}feature(t){return new u(this._features[t])}}var p=t.vectorTile$1.VectorTileFeature,d=f;function f(t,e){this.options=e||{},this.features=t,this.length=t.length}function m(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}f.prototype.feature=function(t){return new m(this.features[t],this.options.extent)},m.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var i=0;i<e.length;i++){for(var n=e[i],r=[],o=0;o<n.length;o++)r.push(new t.pointGeometry(n[o][0],n[o][1]));this.geometry.push(r)}return this.geometry},m.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,i=-1/0,n=1/0,r=-1/0,o=0;o<t.length;o++)for(var s=t[o],a=0;a<s.length;a++){var l=s[a];e=Math.min(e,l.x),i=Math.max(i,l.x),n=Math.min(n,l.y),r=Math.max(r,l.y)}return[e,n,i,r]},m.prototype.toGeoJSON=p.prototype.toGeoJSON;var g=v,y=d;function v(e){var i=new t.pbf;return function(t,e){for(var i in t.layers)e.writeMessage(3,_,t.layers[i])}(e,i),i.finish()}function _(t,e){var i;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var n={keys:[],values:[],keycache:{},valuecache:{}};for(i=0;i<t.length;i++)n.feature=t.feature(i),e.writeMessage(2,x,n);var r=n.keys;for(i=0;i<r.length;i++)e.writeStringField(3,r[i]);var o=n.values;for(i=0;i<o.length;i++)e.writeMessage(4,S,o[i])}function x(t,e){var i=t.feature;void 0!==i.id&&e.writeVarintField(1,i.id),e.writeMessage(2,b,t),e.writeVarintField(3,i.type),e.writeMessage(4,E,i)}function b(t,e){var i=t.feature,n=t.keys,r=t.values,o=t.keycache,s=t.valuecache;for(var a in i.properties){var l=o[a];void 0===l&&(n.push(a),o[a]=l=n.length-1),e.writeVarint(l);var c=i.properties[a],u=typeof c;"string"!==u&&"boolean"!==u&&"number"!==u&&(c=JSON.stringify(c));var h=u+":"+c,p=s[h];void 0===p&&(r.push(c),s[h]=p=r.length-1),e.writeVarint(p)}}function w(t,e){return(e<<3)+(7&t)}function A(t){return t<<1^t>>31}function E(t,e){for(var i=t.loadGeometry(),n=t.type,r=0,o=0,s=i.length,a=0;a<s;a++){var l=i[a],c=1;1===n&&(c=l.length),e.writeVarint(w(1,c));for(var u=3===n?l.length-1:l.length,h=0;h<u;h++){1===h&&1!==n&&e.writeVarint(w(2,u-1));var p=l[h].x-r,d=l[h].y-o;e.writeVarint(A(p)),e.writeVarint(A(d)),r+=p,o+=d}3===n&&e.writeVarint(w(7,1))}}function S(t,e){var i=typeof t;"string"===i?e.writeStringField(1,t):"boolean"===i?e.writeBooleanField(7,t):"number"===i&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}function M(t,e,i,n,r,o){if(r-n<=i)return;const s=n+r>>1;T(t,e,s,n,r,o%2),M(t,e,i,n,s-1,o+1),M(t,e,i,s+1,r,o+1)}function T(t,e,i,n,r,o){for(;r>n;){if(r-n>600){const s=r-n+1,a=i-n+1,l=Math.log(s),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(s-c)/s)*(a-s/2<0?-1:1);T(t,e,i,Math.max(n,Math.floor(i-a*c/s+u)),Math.min(r,Math.floor(i+(s-a)*c/s+u)),o)}const s=e[2*i+o];let a=n,l=r;for(I(t,e,n,i),e[2*r+o]>s&&I(t,e,n,r);a<l;){for(I(t,e,a,l),a++,l--;e[2*a+o]<s;)a++;for(;e[2*l+o]>s;)l--}e[2*n+o]===s?I(t,e,n,l):(l++,I(t,e,l,r)),l<=i&&(n=l+1),i<=l&&(r=l-1)}}function I(t,e,i,n){C(t,i,n),C(e,2*i,2*n),C(e,2*i+1,2*n+1)}function C(t,e,i){const n=t[e];t[e]=t[i],t[i]=n}function P(t,e,i,n){const r=t-i,o=e-n;return r*r+o*o}g.fromVectorTileJs=v,g.fromGeojsonVt=function(t,e){e=e||{};var i={};for(var n in t)i[n]=new d(t[n].features,e),i[n].name=n,i[n].version=e.version,i[n].extent=e.extent;return v({layers:i})},g.GeoJSONWrapper=y;const L=t=>t[0],D=t=>t[1];class R{constructor(t,e=L,i=D,n=64,r=Float64Array){this.nodeSize=n,this.points=t;const o=t.length<65536?Uint16Array:Uint32Array,s=this.ids=new o(t.length),a=this.coords=new r(2*t.length);for(let n=0;n<t.length;n++)s[n]=n,a[2*n]=e(t[n]),a[2*n+1]=i(t[n]);M(s,a,n,0,s.length-1,0)}range(t,e,i,n){return function(t,e,i,n,r,o,s){const a=[0,t.length-1,0],l=[];let c,u;for(;a.length;){const h=a.pop(),p=a.pop(),d=a.pop();if(p-d<=s){for(let s=d;s<=p;s++)c=e[2*s],u=e[2*s+1],c>=i&&c<=r&&u>=n&&u<=o&&l.push(t[s]);continue}const f=Math.floor((d+p)/2);c=e[2*f],u=e[2*f+1],c>=i&&c<=r&&u>=n&&u<=o&&l.push(t[f]);const m=(h+1)%2;(0===h?i<=c:n<=u)&&(a.push(d),a.push(f-1),a.push(m)),(0===h?r>=c:o>=u)&&(a.push(f+1),a.push(p),a.push(m))}return l}(this.ids,this.coords,t,e,i,n,this.nodeSize)}within(t,e,i){return function(t,e,i,n,r,o){const s=[0,t.length-1,0],a=[],l=r*r;for(;s.length;){const c=s.pop(),u=s.pop(),h=s.pop();if(u-h<=o){for(let r=h;r<=u;r++)P(e[2*r],e[2*r+1],i,n)<=l&&a.push(t[r]);continue}const p=Math.floor((h+u)/2),d=e[2*p],f=e[2*p+1];P(d,f,i,n)<=l&&a.push(t[p]);const m=(c+1)%2;(0===c?i-r<=d:n-r<=f)&&(s.push(h),s.push(p-1),s.push(m)),(0===c?i+r>=d:n+r>=f)&&(s.push(p+1),s.push(u),s.push(m))}return a}(this.ids,this.coords,t,e,i,this.nodeSize)}}const O={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},k=Math.fround||(N=new Float32Array(1),t=>(N[0]=+t,N[0]));var N;class B{constructor(t){this.options=H(Object.create(O),t),this.trees=new Array(this.options.maxZoom+1)}load(t){const{log:e,minZoom:i,maxZoom:n,nodeSize:r}=this.options;e&&console.time("total time");const o=`prepare ${t.length} points`;e&&console.time(o),this.points=t;let s=[];for(let e=0;e<t.length;e++)t[e].geometry&&s.push(F(t[e],e));this.trees[n+1]=new R(s,W,q,r,Float32Array),e&&console.timeEnd(o);for(let t=n;t>=i;t--){const i=+Date.now();s=this._cluster(s,t),this.trees[t]=new R(s,W,q,r,Float32Array),e&&console.log("z%d: %d clusters in %dms",t,s.length,+Date.now()-i)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let i=((t[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,t[1]));let r=180===t[2]?180:((t[2]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)i=-180,r=180;else if(i>r){const t=this.getClusters([i,n,180,o],e),s=this.getClusters([-180,n,r,o],e);return t.concat(s)}const s=this.trees[this._limitZoom(e)],a=s.range(G(i),j(o),G(r),j(n)),l=[];for(const t of a){const e=s.points[t];l.push(e.numPoints?V(e):this.points[e.index])}return l}getChildren(t){const e=this._getOriginId(t),i=this._getOriginZoom(t),n="No cluster with the specified id.",r=this.trees[i];if(!r)throw new Error(n);const o=r.points[e];if(!o)throw new Error(n);const s=this.options.radius/(this.options.extent*Math.pow(2,i-1)),a=r.within(o.x,o.y,s),l=[];for(const e of a){const i=r.points[e];i.parentId===t&&l.push(i.numPoints?V(i):this.points[i.index])}if(0===l.length)throw new Error(n);return l}getLeaves(t,e,i){const n=[];return this._appendLeaves(n,t,e=e||10,i=i||0,0),n}getTile(t,e,i){const n=this.trees[this._limitZoom(t)],r=Math.pow(2,t),{extent:o,radius:s}=this.options,a=s/o,l=(i-a)/r,c=(i+1+a)/r,u={features:[]};return this._addTileFeatures(n.range((e-a)/r,l,(e+1+a)/r,c),n.points,e,i,r,u),0===e&&this._addTileFeatures(n.range(1-a/r,l,1,c),n.points,r,i,r,u),e===r-1&&this._addTileFeatures(n.range(0,l,a/r,c),n.points,-1,i,r,u),u.features.length?u:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const i=this.getChildren(t);if(e++,1!==i.length)break;t=i[0].properties.cluster_id}return e}_appendLeaves(t,e,i,n,r){const o=this.getChildren(e);for(const e of o){const o=e.properties;if(o&&o.cluster?r+o.point_count<=n?r+=o.point_count:r=this._appendLeaves(t,o.cluster_id,i,n,r):r<n?r++:t.push(e),t.length===i)break}return r}_addTileFeatures(t,e,i,n,r,o){for(const s of t){const t=e[s],a=t.numPoints;let l,c,u;if(a)l=U(t),c=t.x,u=t.y;else{const e=this.points[t.index];l=e.properties,c=G(e.geometry.coordinates[0]),u=j(e.geometry.coordinates[1])}const h={type:1,geometry:[[Math.round(this.options.extent*(c*r-i)),Math.round(this.options.extent*(u*r-n))]],tags:l};let p;a?p=t.id:this.options.generateId?p=t.index:this.points[t.index].id&&(p=this.points[t.index].id),void 0!==p&&(h.id=p),o.features.push(h)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(+t,this.options.maxZoom+1))}_cluster(t,e){const i=[],{radius:n,extent:r,reduce:o,minPoints:s}=this.options,a=n/(r*Math.pow(2,e));for(let n=0;n<t.length;n++){const r=t[n];if(r.zoom<=e)continue;r.zoom=e;const l=this.trees[e+1],c=l.within(r.x,r.y,a),u=r.numPoints||1;let h=u;for(const t of c){const i=l.points[t];i.zoom>e&&(h+=i.numPoints||1)}if(h>=s){let t=r.x*u,s=r.y*u,a=o&&u>1?this._map(r,!0):null;const p=(n<<5)+(e+1)+this.points.length;for(const i of c){const n=l.points[i];if(n.zoom<=e)continue;n.zoom=e;const c=n.numPoints||1;t+=n.x*c,s+=n.y*c,n.parentId=p,o&&(a||(a=this._map(r,!0)),o(a,this._map(n)))}r.parentId=p,i.push(z(t/h,s/h,p,h,a))}else if(i.push(r),h>1)for(const t of c){const n=l.points[t];n.zoom<=e||(n.zoom=e,i.push(n))}}return i}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e){if(t.numPoints)return e?H({},t.properties):t.properties;const i=this.points[t.index].properties,n=this.options.map(i);return e&&n===i?H({},n):n}}function z(t,e,i,n,r){return{x:k(t),y:k(e),zoom:1/0,id:i,parentId:-1,numPoints:n,properties:r}}function F(t,e){const[i,n]=t.geometry.coordinates;return{x:k(G(i)),y:k(j(n)),zoom:1/0,index:e,parentId:-1}}function V(t){return{type:"Feature",id:t.id,properties:U(t),geometry:{type:"Point",coordinates:[(i=t.x,360*(i-.5)),(e=t.y,90-360*e)]}};var e,i}function U(t){const e=t.numPoints,i=e>=1e4?`${Math.round(e/1e3)}k`:e>=1e3?Math.round(e/100)/10+"k":e;return H(H({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:i})}function G(t){return t/360+.5}function j(t){const e=.25-t/360;return e<0?0:e>.5?.5:e}function H(t,e){for(const i in e)t[i]=e[i];return t}function W(t){return t.x}function q(t){return t.y}function X(t,e,i,n){for(var r,o=n,s=i-e>>1,a=i-e,l=t[e],c=t[e+1],u=t[i],h=t[i+1],p=e+3;p<i;p+=3){var d=Z(t[p],t[p+1],l,c,u,h);if(d>o)r=p,o=d;else if(d===o){var f=Math.abs(p-s);f<a&&(r=p,a=f)}}o>n&&(r-e>3&&X(t,e,r,n),t[r+2]=o,i-r>3&&X(t,r,i,n))}function Z(t,e,i,n,r,o){var s=r-i,a=o-n;if(0!==s||0!==a){var l=((t-i)*s+(e-n)*a)/(s*s+a*a);l>1?(i=r,n=o):l>0&&(i+=s*l,n+=a*l)}return(s=t-i)*s+(a=e-n)*a}function Y(t,e,i,n){var r={id:void 0===t?null:t,type:e,geometry:i,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,i=t.type;if("Point"===i||"MultiPoint"===i||"LineString"===i)Q(t,e);else if("Polygon"===i||"MultiLineString"===i)for(var n=0;n<e.length;n++)Q(t,e[n]);else if("MultiPolygon"===i)for(n=0;n<e.length;n++)for(var r=0;r<e[n].length;r++)Q(t,e[n][r])}(r),r}function Q(t,e){for(var i=0;i<e.length;i+=3)t.minX=Math.min(t.minX,e[i]),t.minY=Math.min(t.minY,e[i+1]),t.maxX=Math.max(t.maxX,e[i]),t.maxY=Math.max(t.maxY,e[i+1])}function J(t,e,i,n){if(e.geometry){var r=e.geometry.coordinates,o=e.geometry.type,s=Math.pow(i.tolerance/((1<<i.maxZoom)*i.extent),2),a=[],l=e.id;if(i.promoteId?l=e.properties[i.promoteId]:i.generateId&&(l=n||0),"Point"===o)K(r,a);else if("MultiPoint"===o)for(var c=0;c<r.length;c++)K(r[c],a);else if("LineString"===o)$(r,a,s,!1);else if("MultiLineString"===o){if(i.lineMetrics){for(c=0;c<r.length;c++)$(r[c],a=[],s,!1),t.push(Y(l,"LineString",a,e.properties));return}tt(r,a,s,!1)}else if("Polygon"===o)tt(r,a,s,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(c=0;c<e.geometry.geometries.length;c++)J(t,{id:l,geometry:e.geometry.geometries[c],properties:e.properties},i,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(c=0;c<r.length;c++){var u=[];tt(r[c],u,s,!0),a.push(u)}}t.push(Y(l,o,a,e.properties))}}function K(t,e){e.push(et(t[0])),e.push(it(t[1])),e.push(0)}function $(t,e,i,n){for(var r,o,s=0,a=0;a<t.length;a++){var l=et(t[a][0]),c=it(t[a][1]);e.push(l),e.push(c),e.push(0),a>0&&(s+=n?(r*c-l*o)/2:Math.sqrt(Math.pow(l-r,2)+Math.pow(c-o,2))),r=l,o=c}var u=e.length-3;e[2]=1,X(e,0,u,i),e[u+2]=1,e.size=Math.abs(s),e.start=0,e.end=e.size}function tt(t,e,i,n){for(var r=0;r<t.length;r++){var o=[];$(t[r],o,i,n),e.push(o)}}function et(t){return t/360+.5}function it(t){var e=.25-t/360;return e<0?0:e>.5?.5:e}function nt(t,e,i,n,r,o,s,a){if(n/=e,o>=(i/=e)&&s<n)return t;if(s<i||o>=n)return null;for(var l=[],c=0;c<t.length;c++){var u=t[c],h=u.geometry,p=u.type,d=0===r?u.minX:u.minY,f=0===r?u.maxX:u.maxY;if(d>=i&&f<n)l.push(u);else if(!(f<i||d>=n)){var m=[];if("Point"===p||"MultiPoint"===p)rt(h,m,i,n,r);else if("LineString"===p)ot(h,m,i,n,r,!1,a.lineMetrics);else if("MultiLineString"===p)at(h,m,i,n,r,!1);else if("Polygon"===p)at(h,m,i,n,r,!0);else if("MultiPolygon"===p)for(var g=0;g<h.length;g++){var y=[];at(h[g],y,i,n,r,!0),y.length&&m.push(y)}if(m.length){if(a.lineMetrics&&"LineString"===p){for(g=0;g<m.length;g++)l.push(Y(u.id,p,m[g],u.tags));continue}"LineString"!==p&&"MultiLineString"!==p||(1===m.length?(p="LineString",m=m[0]):p="MultiLineString"),"Point"!==p&&"MultiPoint"!==p||(p=3===m.length?"Point":"MultiPoint"),l.push(Y(u.id,p,m,u.tags))}}}return l.length?l:null}function rt(t,e,i,n,r){for(var o=0;o<t.length;o+=3){var s=t[o+r];s>=i&&s<=n&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function ot(t,e,i,n,r,o,s){for(var a,l,c=st(t),u=0===r?ct:ut,h=t.start,p=0;p<t.length-3;p+=3){var d=t[p],f=t[p+1],m=t[p+2],g=t[p+3],y=t[p+4],v=0===r?d:f,_=0===r?g:y,x=!1;s&&(a=Math.sqrt(Math.pow(d-g,2)+Math.pow(f-y,2))),v<i?_>i&&(l=u(c,d,f,g,y,i),s&&(c.start=h+a*l)):v>n?_<n&&(l=u(c,d,f,g,y,n),s&&(c.start=h+a*l)):lt(c,d,f,m),_<i&&v>=i&&(l=u(c,d,f,g,y,i),x=!0),_>n&&v<=n&&(l=u(c,d,f,g,y,n),x=!0),!o&&x&&(s&&(c.end=h+a*l),e.push(c),c=st(t)),s&&(h+=a)}var b=t.length-3;d=t[b],f=t[b+1],m=t[b+2],(v=0===r?d:f)>=i&&v<=n&<(c,d,f,m),b=c.length-3,o&&b>=3&&(c[b]!==c[0]||c[b+1]!==c[1])&<(c,c[0],c[1],c[2]),c.length&&e.push(c)}function st(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function at(t,e,i,n,r,o){for(var s=0;s<t.length;s++)ot(t[s],e,i,n,r,o,!1)}function lt(t,e,i,n){t.push(e),t.push(i),t.push(n)}function ct(t,e,i,n,r,o){var s=(o-e)/(n-e);return t.push(o),t.push(i+(r-i)*s),t.push(1),s}function ut(t,e,i,n,r,o){var s=(o-i)/(r-i);return t.push(e+(n-e)*s),t.push(o),t.push(1),s}function ht(t,e){for(var i=[],n=0;n<t.length;n++){var r,o=t[n],s=o.type;if("Point"===s||"MultiPoint"===s||"LineString"===s)r=pt(o.geometry,e);else if("MultiLineString"===s||"Polygon"===s){r=[];for(var a=0;a<o.geometry.length;a++)r.push(pt(o.geometry[a],e))}else if("MultiPolygon"===s)for(r=[],a=0;a<o.geometry.length;a++){for(var l=[],c=0;c<o.geometry[a].length;c++)l.push(pt(o.geometry[a][c],e));r.push(l)}i.push(Y(o.id,s,r,o.tags))}return i}function pt(t,e){var i=[];i.size=t.size,void 0!==t.start&&(i.start=t.start,i.end=t.end);for(var n=0;n<t.length;n+=3)i.push(t[n]+e,t[n+1],t[n+2]);return i}function dt(t,e){if(t.transformed)return t;var i,n,r,o=1<<t.z,s=t.x,a=t.y;for(i=0;i<t.features.length;i++){var l=t.features[i],c=l.geometry,u=l.type;if(l.geometry=[],1===u)for(n=0;n<c.length;n+=2)l.geometry.push(ft(c[n],c[n+1],e,o,s,a));else for(n=0;n<c.length;n++){var h=[];for(r=0;r<c[n].length;r+=2)h.push(ft(c[n][r],c[n][r+1],e,o,s,a));l.geometry.push(h)}}return t.transformed=!0,t}function ft(t,e,i,n,r,o){return[Math.round(i*(t*n-r)),Math.round(i*(e*n-o))]}function mt(t,e,i,n,r){for(var o=e===r.maxZoom?0:r.tolerance/((1<<e)*r.extent),s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:i,y:n,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},a=0;a<t.length;a++){s.numFeatures++,gt(s,t[a],o,r);var l=t[a].minX,c=t[a].minY,u=t[a].maxX,h=t[a].maxY;l<s.minX&&(s.minX=l),c<s.minY&&(s.minY=c),u>s.maxX&&(s.maxX=u),h>s.maxY&&(s.maxY=h)}return s}function gt(t,e,i,n){var r=e.geometry,o=e.type,s=[];if("Point"===o||"MultiPoint"===o)for(var a=0;a<r.length;a+=3)s.push(r[a]),s.push(r[a+1]),t.numPoints++,t.numSimplified++;else if("LineString"===o)yt(s,r,t,i,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(a=0;a<r.length;a++)yt(s,r[a],t,i,"Polygon"===o,0===a);else if("MultiPolygon"===o)for(var l=0;l<r.length;l++){var c=r[l];for(a=0;a<c.length;a++)yt(s,c[a],t,i,!0,0===a)}if(s.length){var u=e.tags||null;if("LineString"===o&&n.lineMetrics){for(var h in u={},e.tags)u[h]=e.tags[h];u.mapbox_clip_start=r.start/r.size,u.mapbox_clip_end=r.end/r.size}var p={geometry:s,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:u};null!==e.id&&(p.id=e.id),t.features.push(p)}}function yt(t,e,i,n,r,o){var s=n*n;if(n>0&&e.size<(r?s:n))i.numPoints+=e.length/3;else{for(var a=[],l=0;l<e.length;l+=3)(0===n||e[l+2]>s)&&(i.numSimplified++,a.push(e[l]),a.push(e[l+1])),i.numPoints++;r&&function(t,e){for(var i=0,n=0,r=t.length,o=r-2;n<r;o=n,n+=2)i+=(t[n]-t[o])*(t[n+1]+t[o+1]);if(i>0===e)for(n=0,r=t.length;n<r/2;n+=2){var s=t[n],a=t[n+1];t[n]=t[r-2-n],t[n+1]=t[r-1-n],t[r-2-n]=s,t[r-1-n]=a}}(a,o),t.push(a)}}function vt(t,e){var i=(e=this.options=function(t,e){for(var i in e)t[i]=e[i];return t}(Object.create(this.options),e)).debug;if(i&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var i=[];if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)J(i,t.features[n],e,n);else J(i,"Feature"===t.type?t:{geometry:t},e);return i}(t,e);this.tiles={},this.tileCoords=[],i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(n=function(t,e){var i=e.buffer/e.extent,n=t,r=nt(t,1,-1-i,i,0,-1,2,e),o=nt(t,1,1-i,2+i,0,-1,2,e);return(r||o)&&(n=nt(t,1,-i,1+i,0,-1,2,e)||[],r&&(n=ht(r,1).concat(n)),o&&(n=n.concat(ht(o,-1)))),n}(n,e)).length&&this.splitTile(n,0,0,0),i&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function _t(t,e,i){return 32*((1<<t)*i+e)+t}function xt(t,e){const i=t.tileID.canonical;if(!this._geoJSONIndex)return e(null,null);const n=this._geoJSONIndex.getTile(i.z,i.x,i.y);if(!n)return e(null,null);const r=new h(n.features);let o=g(r);0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{vectorTile:r,rawData:o.buffer})}vt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},vt.prototype.splitTile=function(t,e,i,n,r,o,s){for(var a=[t,e,i,n],l=this.options,c=l.debug;a.length;){n=a.pop(),i=a.pop(),e=a.pop(),t=a.pop();var u=1<<e,h=_t(e,i,n),p=this.tiles[h];if(!p&&(c>1&&console.time("creation"),p=this.tiles[h]=mt(t,e,i,n,l),this.tileCoords.push({z:e,x:i,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,i,n,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var d="z"+e;this.stats[d]=(this.stats[d]||0)+1,this.total++}if(p.source=t,r){if(e===l.maxZoom||e===r)continue;var f=1<<r-e;if(i!==Math.floor(o/f)||n!==Math.floor(s/f))continue}else if(e===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue;if(p.source=null,0!==t.length){c>1&&console.time("clipping");var m,g,y,v,_,x,b=.5*l.buffer/l.extent,w=.5-b,A=.5+b,E=1+b;m=g=y=v=null,_=nt(t,u,i-b,i+A,0,p.minX,p.maxX,l),x=nt(t,u,i+w,i+E,0,p.minX,p.maxX,l),t=null,_&&(m=nt(_,u,n-b,n+A,1,p.minY,p.maxY,l),g=nt(_,u,n+w,n+E,1,p.minY,p.maxY,l),_=null),x&&(y=nt(x,u,n-b,n+A,1,p.minY,p.maxY,l),v=nt(x,u,n+w,n+E,1,p.minY,p.maxY,l),x=null),c>1&&console.timeEnd("clipping"),a.push(m||[],e+1,2*i,2*n),a.push(g||[],e+1,2*i,2*n+1),a.push(y||[],e+1,2*i+1,2*n),a.push(v||[],e+1,2*i+1,2*n+1)}}},vt.prototype.getTile=function(t,e,i){var n=this.options,r=n.extent,o=n.debug;if(t<0||t>24)return null;var s=1<<t,a=_t(t,e=(e%s+s)%s,i);if(this.tiles[a])return dt(this.tiles[a],r);o>1&&console.log("drilling down to z%d-%d-%d",t,e,i);for(var l,c=t,u=e,h=i;!l&&c>0;)c--,u=Math.floor(u/2),h=Math.floor(h/2),l=this.tiles[_t(c,u,h)];return l&&l.source?(o>1&&console.log("found parent tile z%d-%d-%d",c,u,h),o>1&&console.time("drilling down"),this.splitTile(l.source,c,u,h,t,e,i),o>1&&console.timeEnd("drilling down"),this.tiles[a]?dt(this.tiles[a],r):null):null};class bt extends t.VectorTileWorkerSource{constructor(t,e,i,n,r){super(t,e,i,n,xt),r&&(this.loadGeoJSON=r)}loadData(e,i){const n=e&&e.request,r=n&&n.collectResourceTiming;this.loadGeoJSON(e,((o,a)=>{if(o||!a)return i(o);if("object"!=typeof a)return i(new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`));{s(a,!0);try{if(e.filter){const i=t.createExpression(e.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===i.result)throw new Error(i.value.map((t=>`${t.key}: ${t.message}`)).join(", "));const n=a.features.filter((t=>i.value.evaluate({zoom:0},t)));a={type:"FeatureCollection",features:n}}this._geoJSONIndex=e.cluster?new B(function({superclusterOptions:e,clusterProperties:i}){if(!i||!e)return e;const n={},r={},o={accumulated:null,zoom:0},s={properties:null},a=Object.keys(i);for(const e of a){const[o,s]=i[e],a=t.createExpression(s),l=t.createExpression("string"==typeof o?[o,["accumulated"],["get",e]]:o);n[e]=a.value,r[e]=l.value}return e.map=t=>{s.properties=t;const e={};for(const t of a)e[t]=n[t].evaluate(o,s);return e},e.reduce=(t,e)=>{s.properties=e;for(const e of a)o.accumulated=t[e],t[e]=r[e].evaluate(o,s)},e}(e)).load(a.features):function(t,e){return new vt(t,e)}(a,e.geojsonVtOptions)}catch(o){return i(o)}this.loaded={};const l={};if(r){const i=t.getPerformanceMeasurement(n);i&&(l.resourceTiming={},l.resourceTiming[e.source]=JSON.parse(JSON.stringify(i)))}i(null,l)}}))}reloadTile(t,e){const i=this.loaded;return i&&i[t.uid]?super.reloadTile(t,e):this.loadTile(t,e)}loadGeoJSON(e,i){if(e.request)t.getJSON(e.request,i);else{if("string"!=typeof e.data)return i(new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`));try{return i(null,JSON.parse(e.data))}catch(t){return i(new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(t,e){try{e(null,this._geoJSONIndex.getClusterExpansionZoom(t.clusterId))}catch(t){e(t)}}getClusterChildren(t,e){try{e(null,this._geoJSONIndex.getChildren(t.clusterId))}catch(t){e(t)}}getClusterLeaves(t,e){try{e(null,this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset))}catch(t){e(t)}}}class wt{constructor(e){this.self=e,this.actor=new t.Actor(e,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded=!1,this.workerSourceTypes={vector:t.VectorTileWorkerSource,geojson:bt},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(t,e)=>{if(this.workerSourceTypes[t])throw new Error(`Worker source with name "${t}" already registered.`);this.workerSourceTypes[t]=e},this.self.registerRTLTextPlugin=e=>{if(t.plugin.isParsed())throw new Error("RTL text plugin already registered.");t.plugin.applyArabicShaping=e.applyArabicShaping,t.plugin.processBidirectionalText=e.processBidirectionalText,t.plugin.processStyledBidirectionalText=e.processStyledBidirectionalText}}checkIfReady(t,e,i){i()}setReferrer(t,e){this.referrer=e}spriteLoaded(e,i){this.isSpriteLoaded=i;for(const n in this.workerSources[e]){const r=this.workerSources[e][n];for(const e in r)r[e]instanceof t.VectorTileWorkerSource&&(r[e].isSpriteLoaded=i,r[e].fire(new t.Event("isSpriteLoaded")))}}setImages(t,e,i){this.availableImages[t]=e;for(const i in this.workerSources[t]){const n=this.workerSources[t][i];for(const t in n)n[t].availableImages=e}i()}enableTerrain(t,e,i){this.terrain=e,i()}setLayers(t,e,i){this.getLayerIndex(t).replace(e),i()}updateLayers(t,e,i){this.getLayerIndex(t).update(e.layers,e.removedIds),i()}loadTile(e,i,n){const r=this.enableTerrain?t.extend({enableTerrain:this.terrain},i):i;this.getWorkerSource(e,i.type,i.source).loadTile(r,n)}loadDEMTile(e,i,n){const r=this.enableTerrain?t.extend({buildQuadTree:this.terrain},i):i;this.getDEMWorkerSource(e,i.source).loadTile(r,n)}reloadTile(e,i,n){const r=this.enableTerrain?t.extend({enableTerrain:this.terrain},i):i;this.getWorkerSource(e,i.type,i.source).reloadTile(r,n)}abortTile(t,e,i){this.getWorkerSource(t,e.type,e.source).abortTile(e,i)}removeTile(t,e,i){this.getWorkerSource(t,e.type,e.source).removeTile(e,i)}removeSource(t,e,i){if(!this.workerSources[t]||!this.workerSources[t][e.type]||!this.workerSources[t][e.type][e.source])return;const n=this.workerSources[t][e.type][e.source];delete this.workerSources[t][e.type][e.source],void 0!==n.removeSource?n.removeSource(e,i):i()}loadWorkerSource(t,e,i){try{this.self.importScripts(e.url),i()}catch(t){i(t.toString())}}syncRTLPluginState(e,i,n){try{t.plugin.setState(i);const e=t.plugin.getPluginURL();if(t.plugin.isLoaded()&&!t.plugin.isParsed()&&null!=e){this.self.importScripts(e);const i=t.plugin.isParsed();n(i?void 0:new Error(`RTL Text Plugin failed to import scripts from ${e}`),i)}}catch(t){n(t.toString())}}getAvailableImages(t){let e=this.availableImages[t];return e||(e=[]),e}getLayerIndex(t){let e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new n),e}getWorkerSource(t,e,i){return this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),this.workerSources[t][e][i]||(this.workerSources[t][e][i]=new this.workerSourceTypes[e]({send:(e,i,n,r,o,s)=>{this.actor.send(e,i,n,t,o,s)},scheduler:this.actor.scheduler},this.getLayerIndex(t),this.getAvailableImages(t),this.isSpriteLoaded)),this.workerSources[t][e][i]}getDEMWorkerSource(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new o),this.demWorkerSources[t][e]}enforceCacheSizeLimit(e,i){t.enforceCacheSizeLimit(i)}getWorkerPerformanceMetrics(t,e,i){i(void 0,void 0)}}return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new wt(self)),wt})),n(["./shared"],(function(t){var e=i;function i(t){return!function(t){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 t,e,i=new Blob([""],{type:"text/javascript"}),n=URL.createObjectURL(i);try{e=new Worker(n),t=!0}catch(e){t=!1}return e&&e.terminate(),URL.revokeObjectURL(n),t}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var t=document.createElement("canvas");t.width=t.height=1;var e=t.getContext("2d");if(!e)return!1;var i=e.getImageData(0,0,1,1);return i&&i.width===t.width}()?(void 0===n[e=t&&t.failIfMajorPerformanceCaveat]&&(n[e]=function(t){var e,n=function(t){var e=document.createElement("canvas"),n=Object.create(i.webGLContextAttributes);return n.failIfMajorPerformanceCaveat=t,e.getContext("webgl",n)||e.getContext("experimental-webgl",n)}(t);if(!n)return!1;try{e=n.createShader(n.VERTEX_SHADER)}catch(t){return!1}return!(!e||n.isContextLost())&&(n.shaderSource(e,"void main() {}"),n.compileShader(e),!0===n.getShaderParameter(e,n.COMPILE_STATUS))}(e)),n[e]?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 e}(t)}var n={};function r(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(!r(t[i],e[i]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==e){if("object"!=typeof e)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const i in t)if(!r(t[i],e[i]))return!1;return!0}return t===e}i.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};const o={create:function(e,i,n){const r=t.window.document.createElement(e);return void 0!==i&&(r.className=i),n&&n.appendChild(r),r},createNS:function(e,i){return t.window.document.createElementNS(e,i)}},s=t.window.document&&t.window.document.documentElement.style,a=s&&void 0!==s.userSelect?"userSelect":"WebkitUserSelect";let l;o.disableDrag=function(){s&&a&&(l=s[a],s[a]="none")},o.enableDrag=function(){s&&a&&(s[a]=l)},o.setTransform=function(t,e){t.style.transform=e};let c=!1;try{const e=Object.defineProperty({},"passive",{get(){c=!0}});t.window.addEventListener("test",e,e),t.window.removeEventListener("test",e,e)}catch(t){c=!1}o.addEventListener=function(t,e,i,n={}){t.addEventListener(e,i,"passive"in n&&c?n:n.capture)},o.removeEventListener=function(t,e,i,n={}){t.removeEventListener(e,i,"passive"in n&&c?n:n.capture)};const u=function(e){e.preventDefault(),e.stopPropagation(),t.window.removeEventListener("click",u,!0)};function h(e,i,n){const r=e.offsetWidth===i.width?1:e.offsetWidth/i.width;return new t.pointGeometry((n.clientX-i.left)*r,(n.clientY-i.top)*r)}o.suppressClick=function(){t.window.addEventListener("click",u,!0),t.window.setTimeout((()=>{t.window.removeEventListener("click",u,!0)}),0)},o.mousePos=function(t,e){const i=t.getBoundingClientRect();return h(t,i,e)},o.touchPos=function(t,e){const i=t.getBoundingClientRect(),n=[];for(let r=0;r<e.length;r++)n.push(h(t,i,e[r]));return n},o.mouseButton=function(e){return void 0!==t.window.InstallTrigger&&2===e.button&&e.ctrlKey&&t.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:e.button},o.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};class p{constructor(t,e){this.pos=t,this.dir=e}intersectsPlane(e,i,n){const r=t.dot(i,this.dir);if(Math.abs(r)<1e-6)return!1;const o=t.dot(t.sub(t.create(),e,this.pos),i)/r,s=t.scaleAndAdd(t.create(),this.pos,this.dir,o);return t.copy(n,s),!0}}class d{constructor(t,e){this.points=t,this.planes=e}static fromInvProjectionMatrix(e,i,n){const r=Math.pow(2,n),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((n=>{const o=t.transformMat4([],n,e),s=1/o[3]/i*r;return t.mul(o,o,[s,s,1/o[3],s])})),s=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((e=>{const i=t.sub([],o[e[0]],o[e[1]]),n=t.sub([],o[e[2]],o[e[1]]),r=t.normalize([],t.cross([],i,n)),s=-t.dot(r,o[e[1]]);return r.concat(s)}));return new d(o,s)}}class f{constructor(e,i){this.min=e,this.max=i,this.center=t.scale([],t.add([],this.min,this.max),.5)}quadrant(e){const i=[e%2==0,e<2],n=t.clone(this.min),r=t.clone(this.max);for(let t=0;t<i.length;t++)n[t]=i[t]?this.min[t]:this.center[t],r[t]=i[t]?this.center[t]:this.max[t];return r[2]=this.max[2],new f(n,r)}distanceX(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]}distanceY(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]}distanceZ(t){return Math.max(Math.min(this.max[2],t[2]),this.min[2])-t[2]}intersects(e){const i=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],1],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]];let n=!0;for(let r=0;r<e.planes.length;r++){const o=e.planes[r];let s=0;for(let e=0;e<i.length;e++)s+=t.dot$1(o,i[e])>=0;if(0===s)return 0;s!==i.length&&(n=!1)}if(n)return 2;for(let t=0;t<3;t++){let i=Number.MAX_VALUE,n=-Number.MAX_VALUE;for(let r=0;r<e.points.length;r++){const o=e.points[r][t]-this.min[t];i=Math.min(i,o),n=Math.max(n,o)}if(n<0||i>this.max[t]-this.min[t])return 0}return 1}}function m(t){const{userImage:e}=t;return!!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}class g extends t.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(const{ids:t,callback:e}of this.requestors)this._notify(t,e);this.requestors=[]}}getImage(t){return this.images[t]}addImage(t,e){this._validate(t,e)&&(this.images[t]=e)}_validate(e,i){let n=!0;return this._validateStretch(i.stretchX,i.data&&i.data.width)||(this.fire(new t.ErrorEvent(new Error(`Image "${e}" has invalid "stretchX" value`))),n=!1),this._validateStretch(i.stretchY,i.data&&i.data.height)||(this.fire(new t.ErrorEvent(new Error(`Image "${e}" has invalid "stretchY" value`))),n=!1),this._validateContent(i.content,i)||(this.fire(new t.ErrorEvent(new Error(`Image "${e}" has invalid "content" value`))),n=!1),n}_validateStretch(t,e){if(!t)return!0;let i=0;for(const n of t){if(n[0]<i||n[1]<n[0]||e<n[1])return!1;i=n[1]}return!0}_validateContent(t,e){return!(t&&(4!==t.length||t[0]<0||e.data.width<t[0]||t[1]<0||e.data.height<t[1]||t[2]<0||e.data.width<t[2]||t[3]<0||e.data.height<t[3]||t[2]<t[0]||t[3]<t[1]))}updateImage(t,e){e.version=this.images[t].version+1,this.images[t]=e,this.updatedImages[t]=!0}removeImage(t){const e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(t,e){let i=!0;if(!this.isLoaded())for(const e of t)this.images[e]||(i=!1);this.isLoaded()||i?this._notify(t,e):this.requestors.push({ids:t,callback:e})}_notify(e,i){const n={};for(const i of e){this.images[i]||this.fire(new t.Event("styleimagemissing",{id:i}));const e=this.images[i];e?n[i]={data:e.data.clone(),pixelRatio:e.pixelRatio,sdf:e.sdf,version:e.version,stretchX:e.stretchX,stretchY:e.stretchY,content:e.content,hasRenderCallback:Boolean(e.userImage&&e.userImage.render)}:t.warnOnce(`Image "${i}" 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.`)}i(null,n)}getPixelSize(){const{width:t,height:e}=this.atlasImage;return{width:t,height:e}}getPattern(e){const i=this.patterns[e],n=this.getImage(e);if(!n)return null;if(i&&i.position.version===n.version)return i.position;if(i)i.position.version=n.version;else{const i={w:n.data.width+2,h:n.data.height+2,x:0,y:0},r=new t.ImagePosition(i,n);this.patterns[e]={bin:i,position:r}}return this._updatePatternAtlas(),this.patterns[e].position}bind(e){const i=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new t.Texture(e,this.atlasImage,i.RGBA),this.atlasTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)}_updatePatternAtlas(){const e=[];for(const t in this.patterns)e.push(this.patterns[t].bin);const{w:i,h:n}=t.potpack(e),r=this.atlasImage;r.resize({width:i||1,height:n||1});for(const e in this.patterns){const{bin:i}=this.patterns[e],n=i.x+1,o=i.y+1,s=this.images[e].data,a=s.width,l=s.height;t.RGBAImage.copy(s,r,{x:0,y:0},{x:n,y:o},{width:a,height:l}),t.RGBAImage.copy(s,r,{x:0,y:l-1},{x:n,y:o-1},{width:a,height:1}),t.RGBAImage.copy(s,r,{x:0,y:0},{x:n,y:o+l},{width:a,height:1}),t.RGBAImage.copy(s,r,{x:a-1,y:0},{x:n-1,y:o},{width:1,height:l}),t.RGBAImage.copy(s,r,{x:0,y:0},{x:n+a,y:o},{width:1,height:l})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(const e of t){if(this.callbackDispatchedThisFrame[e])continue;this.callbackDispatchedThisFrame[e]=!0;const t=this.images[e];m(t)&&this.updateImage(e,t)}}}const y=new t.Properties({anchor:new t.DataConstantProperty(t.spec.light.anchor),position:new class{constructor(){this.specification=t.spec.light.position}possiblyEvaluate(e,i){return function([e,i,n]){const r=t.degToRad(i+90),o=t.degToRad(n);return{x:e*Math.cos(r)*Math.sin(o),y:e*Math.sin(r)*Math.sin(o),z:e*Math.cos(o),azimuthal:i,polar:n}}(e.expression.evaluate(i))}interpolate(e,i,n){return{x:t.number(e.x,i.x,n),y:t.number(e.y,i.y,n),z:t.number(e.z,i.z,n),azimuthal:t.number(e.azimuthal,i.azimuthal,n),polar:t.number(e.polar,i.polar,n)}}},color:new t.DataConstantProperty(t.spec.light.color),intensity:new t.DataConstantProperty(t.spec.light.intensity)}),v="-transition";class _ extends t.Evented{constructor(e){super(),this._transitionable=new t.Transitionable(y),this.setLight(e),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(e,i={}){if(!this._validate(t.validateLight,e,i))for(const i in e){const n=e[i];t.endsWith(i,v)?this._transitionable.setTransition(i.slice(0,-v.length),n):this._transitionable.setValue(i,n)}}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(e,i,n){return(!n||!1!==n.validate)&&t.emitValidationErrors(this,e.call(t.validateStyle,t.extend({value:i,style:{glyphs:!0,sprite:!0},styleSpec:t.spec})))}}const x=new t.Properties({source:new t.DataConstantProperty(t.spec.terrain.source),exaggeration:new t.DataConstantProperty(t.spec.terrain.exaggeration)}),b="-transition";class w extends t.Evented{constructor(e){super(),this._transitionable=new t.Transitionable(x),this.set(e),this._transitioning=this._transitionable.untransitioned()}get(){return this._transitionable.serialize()}set(e){for(const i in e){const n=e[i];t.endsWith(i,b)?this._transitionable.setTransition(i.slice(0,-b.length),n):this._transitionable.setValue(i,n)}}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}}function A(e,i,n,r){const o=t.smoothstep(45,65,n),[s,a]=E(e,r),l=t.length(i);let c=1-Math.min(1,Math.exp((l-s)/(a-s)*-6));return c*=c*c,c=Math.min(1,1.00747*c),c*o*e.alpha}function E(t,e){const i=.5/Math.tan(.5*e);return[t.range[0]+i,t.range[1]+i]}const S=new t.Properties({range:new t.DataConstantProperty(t.spec.fog.range),color:new t.DataConstantProperty(t.spec.fog.color),"horizon-blend":new t.DataConstantProperty(t.spec.fog["horizon-blend"])}),M="-transition";class T extends t.Evented{constructor(e){super(),this._transitionable=new t.Transitionable(S),this.set(e),this._transitioning=this._transitionable.untransitioned()}get state(){return{range:this.properties.get("range"),horizonBlend:this.properties.get("horizon-blend"),alpha:this.properties.get("color").a}}get(){return this._transitionable.serialize()}set(e){if(!this._validate(t.validateFog,e))for(const i in e){const n=e[i];t.endsWith(i,M)?this._transitionable.setTransition(i.slice(0,-M.length),n):this._transitionable.setValue(i,n)}}getOpacity(e){const i=this.properties&&this.properties.get("color")||1;return t.smoothstep(45,65,e)*i.a}getOpacityAtLatLng(e,i){return function(e,i,n){const r=t.MercatorCoordinate.fromLngLat(i),o=n.elevation?n.elevation.getAtPointOrZero(r):0,s=[r.x,r.y,o];return t.transformMat4$1(s,s,n.mercatorFogMatrix),A(e,s,n.pitch,n._fov)}(this.state,e,i)}getFovAdjustedRange(t){return E(this.state,t)}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(e,i,n){return(!n||!1!==n.validate)&&t.emitValidationErrors(this,e.call(t.validateStyle,t.extend({value:i,style:{glyphs:!0,sprite:!0},styleSpec:t.spec})))}}class I{constructor(e,i){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=t.uniqueId();const n=this.workerPool.acquire(this.id);for(let t=0;t<n.length;t++){const e=new I.Actor(n[t],i,this.id);e.name=`Worker ${t}`,this.actors.push(e)}this.ready=!1,this.broadcast("checkIfReady",null,(()=>{this.ready=!0}))}broadcast(e,i,n){t.asyncAll(this.actors,((t,n)=>{t.send(e,i,n)}),n=n||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach((t=>{t.remove()})),this.actors=[],this.workerPool.release(this.id)}}function C(e,i,n){return i*(t.EXTENT/(e.tileSize*Math.pow(2,n-e.tileID.overscaledZ)))}I.Actor=t.Actor;class P{constructor(t,e,i,n){this.screenBounds=t,this.cameraPoint=e,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=i,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this.screenGeometry.map((t=>n.pointCoordinate3D(t))),this.cameraGeometry=this.bufferedCameraGeometry(0)}static createFromScreenPoints(e,i){let n,r;if(e instanceof t.pointGeometry||"number"==typeof e[0]){const o=t.pointGeometry.convert(e);n=[t.pointGeometry.convert(e)],r=i.isPointAboveHorizon(o)}else{const o=t.pointGeometry.convert(e[0]),s=t.pointGeometry.convert(e[1]);n=[o,s],r=t.polygonizeBounds(o,s).every((t=>i.isPointAboveHorizon(t)))}return new P(n,i.getCameraPoint(),r,i)}isPointQuery(){return 1===this.screenBounds.length}bufferedScreenGeometry(e){return t.polygonizeBounds(this.screenBounds[0],1===this.screenBounds.length?this.screenBounds[0]:this.screenBounds[1],e)}bufferedCameraGeometry(e){const i=this.screenBounds[0],n=1===this.screenBounds.length?this.screenBounds[0].add(new t.pointGeometry(1,1)):this.screenBounds[1],r=t.polygonizeBounds(i,n,0,!1);return this.cameraPoint.y>n.y&&(this.cameraPoint.x>i.x&&this.cameraPoint.x<n.x?r.splice(3,0,this.cameraPoint):this.cameraPoint.x>=n.x?r[2]=this.cameraPoint:this.cameraPoint.x<=i.x&&(r[3]=this.cameraPoint)),t.bufferConvexPolygon(r,e)}containsTile(e,i,n){const r=e.queryPadding+1,o=n?this._bufferedCameraMercator(r,i).map((t=>e.tileID.getTilePoint(t))):this._bufferedScreenMercator(r,i).map((t=>e.tileID.getTilePoint(t))),s=this.screenGeometryMercator.map((t=>e.tileID.getTileVec3(t))),a=s.map((e=>new t.pointGeometry(e[0],e[1]))),l=i.getFreeCameraOptions().position||new t.MercatorCoordinate(0,0,0),c=e.tileID.getTileVec3(l),u=s.map((e=>{const i=t.sub(e,e,c);return t.normalize(i,i),new p(c,i)})),h=C(e,1,i.zoom);if(t.polygonIntersectsBox(o,0,0,t.EXTENT,t.EXTENT))return{queryGeometry:this,tilespaceGeometry:a,tilespaceRays:u,bufferedTilespaceGeometry:o,bufferedTilespaceBounds:(d=t.getBounds(o),d.min.x=t.clamp(d.min.x,0,t.EXTENT),d.min.y=t.clamp(d.min.y,0,t.EXTENT),d.max.x=t.clamp(d.max.x,0,t.EXTENT),d.max.y=t.clamp(d.max.y,0,t.EXTENT),d),tile:e,tileID:e.tileID,pixelToTileUnitsFactor:h};var d}_bufferedScreenMercator(t,e){const i=L(t);if(this._screenRaycastCache[i])return this._screenRaycastCache[i];{const n=this.bufferedScreenGeometry(t).map((t=>e.pointCoordinate3D(t)));return this._screenRaycastCache[i]=n,n}}_bufferedCameraMercator(t,e){const i=L(t);if(this._cameraRaycastCache[i])return this._cameraRaycastCache[i];{const n=this.bufferedCameraGeometry(t).map((t=>e.pointCoordinate3D(t)));return this._cameraRaycastCache[i]=n,n}}}function L(t){return 100*t|0}function D(e,i,n){const r=function(r,o){if(r)return n(r);if(o){const r=t.pick(t.extend(o,e),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding","zoomOffset"]);o.vector_layers&&(r.vectorLayers=o.vector_layers,r.vectorLayerIds=r.vectorLayers.map((t=>t.id))),r.tiles=i.canonicalizeTileset(r,e.url),n(null,r)}};return e.url?t.getJSON(i.transformRequest(i.normalizeSourceURL(e.url),t.ResourceType.Source),r):t.exported.frame((()=>r(null,e)))}class R{constructor(e,i,n){this.bounds=t.LngLatBounds.convert(this.validateBounds(e)),this.minzoom=i||0,this.maxzoom=n||24}validateBounds(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(e){const i=Math.pow(2,e.z),n=Math.floor(t.mercatorXfromLng(this.bounds.getWest())*i),r=Math.floor(t.mercatorYfromLat(this.bounds.getNorth())*i),o=Math.ceil(t.mercatorXfromLng(this.bounds.getEast())*i),s=Math.ceil(t.mercatorYfromLat(this.bounds.getSouth())*i);return e.x>=n&&e.x<o&&e.y>=r&&e.y<s}}class O{constructor(t,e,i){this.context=t;const n=t.gl;this.buffer=n.createBuffer(),this.dynamicDraw=Boolean(i),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){const e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const k={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class N{constructor(t,e,i,n){this.length=e.length,this.attributes=i,this.itemSize=e.bytesPerElement,this.dynamicDraw=n,this.context=t;const r=t.gl;this.buffer=r.createBuffer(),t.bindVertexBuffer.set(this.buffer),r.bufferData(r.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){const e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,e){for(let i=0;i<this.attributes.length;i++){const n=e.attributes[this.attributes[i].name];void 0!==n&&t.enableVertexAttribArray(n)}}setVertexAttribPointers(t,e,i){for(let n=0;n<this.attributes.length;n++){const r=this.attributes[n],o=e.attributes[r.name];void 0!==o&&t.vertexAttribPointer(o,r.components,t[k[r.type]],!1,this.itemSize,r.offset+this.itemSize*(i||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class B{constructor(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(t){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class z extends B{getDefault(){return t.Color.transparent}set(t){const e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class F extends B{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}}class V extends B{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}}class U extends B{getDefault(){return[!0,!0,!0,!0]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class G extends B{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}}class j extends B{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}}class H extends B{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){const e=this.current;(t.func!==e.func||t.ref!==e.ref||t.mask!==e.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)}}class W extends B{getDefault(){const t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)}}class q extends B{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1}}class X extends B{getDefault(){return[0,1]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)}}class Z extends B{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1}}class Y extends B{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}}class Q extends B{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1}}class J extends B{getDefault(){const t=this.gl;return[t.ONE,t.ZERO]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)}}class K extends B{getDefault(){return t.Color.transparent}set(t){const e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class $ extends B{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)}}class tt extends B{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}}class et extends B{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}}class it extends B{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}}class nt extends B{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)}}class rt extends B{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}}class ot extends B{getDefault(){const t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class st extends B{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1}}class at extends B{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class lt extends B{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}}class ct extends B{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class ut extends B{getDefault(){return null}set(t){const e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class ht extends B{constructor(t){super(t),this.vao=t.extVertexArrayObject}getDefault(){return null}set(t){this.vao&&(t!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(t),this.current=t,this.dirty=!1)}}class pt extends B{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}}class dt extends B{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}}class ft extends B{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}}class mt extends B{constructor(t,e){super(t),this.context=t,this.parent=e}getDefault(){return null}}class gt extends mt{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class yt extends mt{attachment(){return this.gl.DEPTH_ATTACHMENT}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,this.attachment(),e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class vt extends yt{attachment(){return this.gl.DEPTH_STENCIL_ATTACHMENT}}class _t{constructor(t,e,i,n){this.context=t,this.width=e,this.height=i;const r=this.framebuffer=t.gl.createFramebuffer();this.colorAttachment=new gt(t,r),n&&(this.depthAttachment=new yt(t,r))}destroy(){const t=this.context.gl,e=this.colorAttachment.get();if(e&&t.deleteTexture(e),this.depthAttachment){const e=this.depthAttachment.get();e&&t.deleteRenderbuffer(e)}t.deleteFramebuffer(this.framebuffer)}}class xt{constructor(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new z(this),this.clearDepth=new F(this),this.clearStencil=new V(this),this.colorMask=new U(this),this.depthMask=new G(this),this.stencilMask=new j(this),this.stencilFunc=new H(this),this.stencilOp=new W(this),this.stencilTest=new q(this),this.depthRange=new X(this),this.depthTest=new Z(this),this.depthFunc=new Y(this),this.blend=new Q(this),this.blendFunc=new J(this),this.blendColor=new K(this),this.blendEquation=new $(this),this.cullFace=new tt(this),this.cullFaceSide=new et(this),this.frontFace=new it(this),this.program=new nt(this),this.activeTexture=new rt(this),this.viewport=new ot(this),this.bindFramebuffer=new st(this),this.bindRenderbuffer=new at(this),this.bindTexture=new lt(this),this.bindVertexBuffer=new ct(this),this.bindElementBuffer=new ut(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new ht(this),this.pixelStoreUnpack=new pt(this),this.pixelStoreUnpackPremultiplyAlpha=new dt(this),this.pixelStoreUnpackFlipY=new ft(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureFilterAnisotropicForceOff=!1,this.extTextureHalfFloat=t.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(t.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=t.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=t.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=t.getParameter(t.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(t,e){return new O(this,t,e)}createVertexBuffer(t,e,i){return new N(this,t,e,i)}createRenderbuffer(t,e,i){const n=this.gl,r=n.createRenderbuffer();return this.bindRenderbuffer.set(r),n.renderbufferStorage(n.RENDERBUFFER,t,e,i),this.bindRenderbuffer.set(null),r}createFramebuffer(t,e,i){return new _t(this,t,e,i)}clear({color:t,depth:e,stencil:i}){const n=this.gl;let r=0;t&&(r|=n.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),void 0!==e&&(r|=n.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(e),this.depthMask.set(!0)),void 0!==i&&(r|=n.STENCIL_BUFFER_BIT,this.clearStencil.set(i),this.stencilMask.set(255)),n.clear(r)}setCullFace(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))}setDepthMode(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)}setStencilMode(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)}setColorMode(e){r(e.blendFunction,t.ColorMode.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)}unbindVAO(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)}}class bt extends t.Evented{constructor(e,i,n,r){super(),this.id=e,this.dispatcher=n,this.setEventedParent(r),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this.zoomOffset=0,this._loaded=!1,this._options=t.extend({type:"raster"},i),t.extend(this,t.pick(i,["url","scheme","tileSize","zoomOffset"]))}load(){this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=D(this._options,this.map._requestManager,((e,i)=>{this._tileJSONRequest=null,this._loaded=!0,e?this.fire(new t.ErrorEvent(e)):i&&(t.extend(this,i),i.bounds&&(this.tileBounds=new R(i.bounds,this.minzoom,this.maxzoom)),t.postTurnstileEvent(i.tiles),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return t.extend({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(e,i){const n=t.exported.devicePixelRatio>=2,r=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme,this.zoomOffset),n,this.tileSize);e.request=t.getImage(this.map._requestManager.transformRequest(r,t.ResourceType.Tile),((n,r,o,s)=>{if(delete e.request,e.aborted)e.state="unloaded",i(null);else if(n)e.state="errored",i(n);else if(r){this.map._refreshExpiredTiles&&e.setExpiryData({cacheControl:o,expires:s});const n=this.map.painter.context,a=n.gl;e.texture=this.map.painter.getTileTexture(r.width),e.texture?e.texture.update(r,{useMipmap:!0}):(e.texture=new t.Texture(n,r,a.RGBA,{useMipmap:!0}),e.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),n.extTextureFilterAnisotropic&&a.texParameterf(a.TEXTURE_2D,n.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,n.extTextureFilterAnisotropicMax)),e.state="loaded",t.cacheEntryPossiblyAdded(this.dispatcher),i(null)}}))}abortTile(t,e){t.request&&(t.request.cancel(),delete t.request),e()}unloadTile(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e()}hasTransition(){return!1}}let wt;var At=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Et extends t.Evented{constructor(t,e,i,n){super(),this.id=t,this.dispatcher=i,this.coordinates=e.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(n),this.options=e}load(e,i){this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),((n,r)=>{this._loaded=!0,n?this.fire(new t.ErrorEvent(n)):r&&(this.image=r,e&&(this.coordinates=e),i&&i(),this._finishLoading())}))}loaded(){return this._loaded}updateImage(t){return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(()=>{this.texture=null})),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}setCoordinates(e){this.coordinates=e;const i=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){let i=1/0,n=1/0,r=-1/0,o=-1/0;for(const t of e)i=Math.min(i,t.x),n=Math.min(n,t.y),r=Math.max(r,t.x),o=Math.max(o,t.y);const s=Math.max(r-i,o-n),a=Math.max(0,Math.floor(-Math.log(s)/Math.LN2)),l=Math.pow(2,a);return new t.CanonicalTileID(a,Math.floor((i+r)/2*l),Math.floor((n+o)/2*l))}(i),this.minzoom=this.maxzoom=this.tileID.z;const n=i.map((t=>this.tileID.getTilePoint(t)._round()));return this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(n[0].x,n[0].y,0,0),this._boundsArray.emplaceBack(n[1].x,n[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(n[3].x,n[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(n[2].x,n[2].y,t.EXTENT,t.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;const e=this.map.painter.context,i=e.gl;this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,At.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(e,this.image,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE));for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture)}}loadTile(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},e(null)):(t.state="errored",e(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}const St={vector:class extends t.Evented{constructor(e,i,n,r){if(super(),this.id=e,this.dispatcher=n,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.zoomOffset=0,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,t.extend(this,t.pick(i,["url","scheme","tileSize","promoteId","zoomOffset"])),this._options=t.extend({type:"vector"},i),this._collectResourceTiming=i.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(r),this._tileWorkers={},this._deduped=new t.DedupedRequest}load(){this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=D(this._options,this.map._requestManager,((e,i)=>{this._tileJSONRequest=null,this._loaded=!0,e?this.fire(new t.ErrorEvent(e)):i&&(t.extend(this,i),i.bounds&&(this.tileBounds=new R(i.bounds,this.minzoom,this.maxzoom)),t.postTurnstileEvent(i.tiles,this.map._requestManager._customAccessToken),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t();const e=this.map.style._getSourceCaches(this.id);for(const t of e)t.clearTiles();this.load()}setTiles(t){return this.setSourceProperty((()=>{this._options.tiles=t})),this}setUrl(t){return this.setSourceProperty((()=>{this.url=t,this._options.url=t})),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return t.extend({},this._options)}loadTile(e,i){const n=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme,this.zoomOffset)),r={request:this.map._requestManager.transformRequest(n,t.ResourceType.Tile),data:void 0,uid:e.uid,tileID:e.tileID,tileZoom:e.tileZoom,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:t.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:e.isSymbolTile};if(r.request.collectResourceTiming=this._collectResourceTiming,e.actor&&"expired"!==e.state)"loading"===e.state?e.reloadCallback=i:e.request=e.actor.send("reloadTile",r,o.bind(this));else if(e.actor=this._tileWorkers[n]=this._tileWorkers[n]||this.dispatcher.getActor(),this.dispatcher.ready)e.request=e.actor.send("loadTile",r,o.bind(this),void 0,!0);else{const i=t.loadVectorTile.call({deduped:this._deduped},r,((t,i)=>{t||!i?o.call(this,t):(r.data={cacheControl:i.cacheControl,expires:i.expires,rawData:i.rawData.slice(0)},e.actor&&e.actor.send("loadTile",r,o.bind(this),void 0,!0))}),!0);e.request={cancel:i}}function o(n,r){return delete e.request,e.aborted?i(null):n&&404!==n.status?i(n):(r&&r.resourceTiming&&(e.resourceTiming=r.resourceTiming),this.map._refreshExpiredTiles&&r&&e.setExpiryData(r),e.loadVectorData(r,this.map.painter),t.cacheEntryPossiblyAdded(this.dispatcher),i(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id})}unloadTile(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}},raster:bt,"raster-dem":class extends bt{constructor(e,i,n,r){super(e,i,n,r),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({type:"raster-dem"},i),this.encoding=i.encoding||"mapbox"}loadTile(e,i){const n=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme,this.zoomOffset),!1,this.tileSize);function r(t,n){t&&(e.state="errored",i(t)),n&&(e.dem=n,e.dem.onDeserialize(),e.needsHillshadePrepare=!0,e.needsDEMTextureUpload=!0,e.state="loaded",i(null))}e.request=t.getImage(this.map._requestManager.transformRequest(n,t.ResourceType.Tile),function(n,o,s,a){if(delete e.request,e.aborted)e.state="unloaded",i(null);else if(n)e.state="errored",i(n);else if(o){this.map._refreshExpiredTiles&&e.setExpiryData({cacheControl:s,expires:a});const i=t.window.ImageBitmap&&o instanceof t.window.ImageBitmap&&(null==wt&&(wt=t.window.OffscreenCanvas&&new t.window.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof t.window.createImageBitmap),wt),n=1-(o.width-t.prevPowerOfTwo(o.width))/2;n<1||e.neighboringTiles||(e.neighboringTiles=this._getNeighboringTiles(e.tileID));const l=i?o:t.exported.getImageData(o,n),c={uid:e.uid,coord:e.tileID,source:this.id,rawImageData:l,encoding:this.encoding,padding:n};e.actor&&"expired"!==e.state||(e.actor=this.dispatcher.getActor(),e.actor.send("loadDEMTile",c,r.bind(this),void 0,!0))}}.bind(this))}_getNeighboringTiles(e){const i=e.canonical,n=Math.pow(2,i.z),r=(i.x-1+n)%n,o=0===i.x?e.wrap-1:e.wrap,s=(i.x+1+n)%n,a=i.x+1===n?e.wrap+1:e.wrap,l={};return l[new t.OverscaledTileID(e.overscaledZ,o,i.z,r,i.y).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,a,i.z,s,i.y).key]={backfilled:!1},i.y>0&&(l[new t.OverscaledTileID(e.overscaledZ,o,i.z,r,i.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,i.z,i.x,i.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,a,i.z,s,i.y-1).key]={backfilled:!1}),i.y+1<n&&(l[new t.OverscaledTileID(e.overscaledZ,o,i.z,r,i.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,i.z,i.x,i.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,a,i.z,s,i.y+1).key]={backfilled:!1}),l}unloadTile(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded"}},geojson:class extends t.Evented{constructor(e,i,n,r){super(),this.id=e,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(r),this._data=i.data,this._options=t.extend({},i),this._collectResourceTiming=i.collectResourceTiming,void 0!==i.maxzoom&&(this.maxzoom=i.maxzoom),i.type&&(this.type=i.type),i.attribution&&(this.attribution=i.attribution),this.promoteId=i.promoteId;const o=t.EXTENT/this.tileSize;this.workerOptions=t.extend({source:this.id,cluster:i.cluster||!1,geojsonVtOptions:{buffer:(void 0!==i.buffer?i.buffer:128)*o,tolerance:(void 0!==i.tolerance?i.tolerance:.375)*o,extent:t.EXTENT,maxZoom:this.maxzoom,lineMetrics:i.lineMetrics||!1,generateId:i.generateId||!1},superclusterOptions:{maxZoom:void 0!==i.clusterMaxZoom?i.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,i.clusterMinPoints||2),extent:t.EXTENT,radius:(void 0!==i.clusterRadius?i.clusterRadius:50)*o,log:!1,generateId:i.generateId||!1},clusterProperties:i.clusterProperties,filter:i.filter},i.workerOptions)}onAdd(t){this.map=t,this.setData(this._data)}setData(t){return this._data=t,this._updateWorkerData(),this}getClusterExpansionZoom(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this}getClusterChildren(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this}getClusterLeaves(t,e,i,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:i},n),this}_updateWorkerData(){if(this._pendingLoad)return void(this._coalesce=!0);this.fire(new t.Event("dataloading",{dataType:"source"})),this._loaded=!1;const e=t.extend({},this.workerOptions),i=this._data;"string"==typeof i?(e.request=this.map._requestManager.transformRequest(t.exported.resolveURL(i),t.ResourceType.Source),e.request.collectResourceTiming=this._collectResourceTiming):e.data=JSON.stringify(i),this._pendingLoad=this.actor.send(`${this.type}.loadData`,e,((e,i)=>{if(this._loaded=!0,this._pendingLoad=null,e)this.fire(new t.ErrorEvent(e));else{const e={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&i&&i.resourceTiming&&i.resourceTiming[this.id]&&(e.resourceTiming=i.resourceTiming[this.id]),this.fire(new t.Event("data",e)),this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(),this._coalesce=!1)}))}loaded(){return this._loaded}loadTile(e,i){const n=e.actor?"reloadTile":"loadTile";e.actor=this.actor,e.request=this.actor.send(n,{type:this.type,uid:e.uid,tileID:e.tileID,tileZoom:e.tileZoom,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},((t,r)=>(delete e.request,e.unloadVectorData(),e.aborted?i(null):t?i(t):(e.loadVectorData(r,this.map.painter,"reloadTile"===n),i(null)))),void 0,"loadTile"===n)}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0}unloadTile(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})}onRemove(){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return t.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends Et{constructor(t,e,i,n){super(t,e,i,n),this.roundZoom=!0,this.type="video",this.options=e}load(){this._loaded=!1;const e=this.options;this.urls=[];for(const i of e.urls)this.urls.push(this.map._requestManager.transformRequest(i,t.ResourceType.Source).url);t.getVideo(this.urls,((e,i)=>{this._loaded=!0,e?this.fire(new t.ErrorEvent(e)):i&&(this.video=i,this.video.loop=!0,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(e){if(this.video){const i=this.video.seekable;e<i.start(0)||e>i.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${i.start(0)} and ${i.end(0)}-second mark.`))):this.video.currentTime=e}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,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 e=this.map.painter.context,i=e.gl;this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,At.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE));for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture)}}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:Et,canvas:class extends Et{constructor(e,i,n,r){super(e,i,n,r),i.coordinates?Array.isArray(i.coordinates)&&4===i.coordinates.length&&!i.coordinates.some((t=>!Array.isArray(t)||2!==t.length||t.some((t=>"number"!=typeof t))))||this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${e}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${e}`,null,'missing required property "coordinates"'))),i.animate&&"boolean"!=typeof i.animate&&this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${e}`,null,'optional "animate" property must be a boolean value'))),i.canvas?"string"==typeof i.canvas||i.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${e}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${e}`,null,'missing required property "canvas"'))),this.options=i,this.animate=void 0===i.animate||i.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),this._hasInvalidDimensions())return;if(0===Object.keys(this.tiles).length)return;const i=this.map.painter.context,n=i.gl;this.boundsBuffer||(this.boundsBuffer=i.createVertexBuffer(this._boundsArray,At.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(i,this.canvas,n.RGBA,{premultiply:!0});for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture)}}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}},Mt=function(e,i,n,r){const o=new St[i.type](e,i,n,r);if(o.id!==e)throw new Error(`Expected Source id to be ${e} instead of ${o.id}`);return t.bindAll(["load","abort","unload","serialize","prepare"],o),o};function Tt(e,i){const n=t.identity([]);return t.scale$1(n,n,[.5*e.width,.5*-e.height,1]),t.translate(n,n,[1,-1,0]),t.multiply(n,n,e.calculateProjMatrix(i.toUnwrapped()))}function It(t,e,i,n,r,o,s,a=!1){const l=t.tilesIn(n,s,a);l.sort(Pt);const c=[];for(const n of l)c.push({wrappedTileID:n.tile.tileID.wrapped().key,queryResults:n.tile.queryRenderedFeatures(e,i,t._state,n,r,o,Tt(t.transform,n.tile.tileID),a)});const u=function(t){const e={},i={};for(const n of t){const t=n.queryResults,r=n.wrappedTileID,o=i[r]=i[r]||{};for(const i in t){const n=t[i],r=o[i]=o[i]||{},s=e[i]=e[i]||[];for(const t of n)r[t.featureIndex]||(r[t.featureIndex]=!0,s.push(t))}}return e}(c);for(const e in u)u[e].forEach((e=>{const i=e.feature,n=t.getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=n}));return u}function Ct(t,e){const i=t.getRenderableIds().map((e=>t.getTileByID(e))),n=[],r={};for(let t=0;t<i.length;t++){const o=i[t],s=o.tileID.canonical.key;r[s]||(r[s]=!0,o.querySourceFeatures(n,e))}return n}function Pt(t,e){const i=t.tileID,n=e.tileID;return i.overscaledZ-n.overscaledZ||i.canonical.y-n.canonical.y||i.wrap-n.wrap||i.canonical.x-n.canonical.x}function Lt(){return null!=qr.workerClass?new qr.workerClass:new t.window.Worker(qr.workerUrl)}const Dt="mapboxgl_preloaded_worker_pool";class Rt{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length<Rt.workerCount;)this.workers.push(new Lt);return this.active[t]=!0,this.workers.slice()}release(t){delete this.active[t],0===this.numActive()&&(this.workers.forEach((t=>{t.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[Dt]}numActive(){return Object.keys(this.active).length}}let Ot;function kt(){return Ot||(Ot=new Rt),Ot}function Nt(e,i){const n={};for(const t in e)"ref"!==t&&(n[t]=e[t]);return t.refProperties.forEach((t=>{t in i&&(n[t]=i[t])})),n}function Bt(t){t=t.slice();const e=Object.create(null);for(let i=0;i<t.length;i++)e[t[i].id]=t[i];for(let i=0;i<t.length;i++)"ref"in t[i]&&(t[i]=Nt(t[i],e[t[i].ref]));return t}Rt.workerCount=2;const zt={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"};function Ft(t,e,i){i.push({command:zt.addSource,args:[t,e[t]]})}function Vt(t,e,i){e.push({command:zt.removeSource,args:[t]}),i[t]=!0}function Ut(t,e,i,n){Vt(t,i,n),Ft(t,e,i)}function Gt(t,e,i){let n;for(n in t[i])if(t[i].hasOwnProperty(n)&&"data"!==n&&!r(t[i][n],e[i][n]))return!1;for(n in e[i])if(e[i].hasOwnProperty(n)&&"data"!==n&&!r(t[i][n],e[i][n]))return!1;return!0}function jt(t,e,i,n,o,s){let a;for(a in e=e||{},t=t||{})t.hasOwnProperty(a)&&(r(t[a],e[a])||i.push({command:s,args:[n,a,e[a],o]}));for(a in e)e.hasOwnProperty(a)&&!t.hasOwnProperty(a)&&(r(t[a],e[a])||i.push({command:s,args:[n,a,e[a],o]}))}function Ht(t){return t.id}function Wt(t,e){return t[e.id]=e,t}class qt{constructor(t,e){this.reset(t,e)}reset(t,e){this.points=t||[],this._distances=[0];for(let t=1;t<this.points.length;t++)this._distances[t]=this._distances[t-1]+this.points[t].dist(this.points[t-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(e||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(e){if(1===this.points.length)return this.points[0];e=t.clamp(e,0,1);let i=1,n=this._distances[i];const r=e*this.paddedLength+this.padding;for(;n<r&&i<this._distances.length;)n=this._distances[++i];const o=i-1,s=this._distances[o],a=n-s,l=a>0?(r-s)/a:0;return this.points[o].mult(1-l).add(this.points[i].mult(l))}}class Xt{constructor(t,e,i){const n=this.boxCells=[],r=this.circleCells=[];this.xCellCount=Math.ceil(t/i),this.yCellCount=Math.ceil(e/i);for(let t=0;t<this.xCellCount*this.yCellCount;t++)n.push([]),r.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(t,e,i,n,r){this._forEachCell(e,i,n,r,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(r)}insertCircle(t,e,i,n){this._forEachCell(e-n,i-n,e+n,i+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(i),this.circles.push(n)}_insertBoxCell(t,e,i,n,r,o){this.boxCells[r].push(o)}_insertCircleCell(t,e,i,n,r,o){this.circleCells[r].push(o)}_query(t,e,i,n,r,o){if(i<0||t>this.width||n<0||e>this.height)return!r&&[];const s=[];if(t<=0&&e<=0&&this.width<=i&&this.height<=n){if(r)return!0;for(let t=0;t<this.boxKeys.length;t++)s.push({key:this.boxKeys[t],x1:this.bboxes[4*t],y1:this.bboxes[4*t+1],x2:this.bboxes[4*t+2],y2:this.bboxes[4*t+3]});for(let t=0;t<this.circleKeys.length;t++){const e=this.circles[3*t],i=this.circles[3*t+1],n=this.circles[3*t+2];s.push({key:this.circleKeys[t],x1:e-n,y1:i-n,x2:e+n,y2:i+n})}return o?s.filter(o):s}return this._forEachCell(t,e,i,n,this._queryCell,s,{hitTest:r,seenUids:{box:{},circle:{}}},o),r?s.length>0:s}_queryCircle(t,e,i,n,r){const o=t-i,s=t+i,a=e-i,l=e+i;if(s<0||o>this.width||l<0||a>this.height)return!n&&[];const c=[];return this._forEachCell(o,a,s,l,this._queryCellCircle,c,{hitTest:n,circle:{x:t,y:e,radius:i},seenUids:{box:{},circle:{}}},r),n?c.length>0:c}query(t,e,i,n,r){return this._query(t,e,i,n,!1,r)}hitTest(t,e,i,n,r){return this._query(t,e,i,n,!0,r)}hitTestCircle(t,e,i,n){return this._queryCircle(t,e,i,!0,n)}_queryCell(t,e,i,n,r,o,s,a){const l=s.seenUids,c=this.boxCells[r];if(null!==c){const r=this.bboxes;for(const u of c)if(!l.box[u]){l.box[u]=!0;const c=4*u;if(t<=r[c+2]&&e<=r[c+3]&&i>=r[c+0]&&n>=r[c+1]&&(!a||a(this.boxKeys[u]))){if(s.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[u],x1:r[c],y1:r[c+1],x2:r[c+2],y2:r[c+3]})}}}const u=this.circleCells[r];if(null!==u){const r=this.circles;for(const c of u)if(!l.circle[c]){l.circle[c]=!0;const u=3*c;if(this._circleAndRectCollide(r[u],r[u+1],r[u+2],t,e,i,n)&&(!a||a(this.circleKeys[c]))){if(s.hitTest)return o.push(!0),!0;{const t=r[u],e=r[u+1],i=r[u+2];o.push({key:this.circleKeys[c],x1:t-i,y1:e-i,x2:t+i,y2:e+i})}}}}}_queryCellCircle(t,e,i,n,r,o,s,a){const l=s.circle,c=s.seenUids,u=this.boxCells[r];if(null!==u){const t=this.bboxes;for(const e of u)if(!c.box[e]){c.box[e]=!0;const i=4*e;if(this._circleAndRectCollide(l.x,l.y,l.radius,t[i+0],t[i+1],t[i+2],t[i+3])&&(!a||a(this.boxKeys[e])))return o.push(!0),!0}}const h=this.circleCells[r];if(null!==h){const t=this.circles;for(const e of h)if(!c.circle[e]){c.circle[e]=!0;const i=3*e;if(this._circlesCollide(t[i],t[i+1],t[i+2],l.x,l.y,l.radius)&&(!a||a(this.circleKeys[e])))return o.push(!0),!0}}}_forEachCell(t,e,i,n,r,o,s,a){const l=this._convertToXCellCoord(t),c=this._convertToYCellCoord(e),u=this._convertToXCellCoord(i),h=this._convertToYCellCoord(n);for(let p=l;p<=u;p++)for(let l=c;l<=h;l++)if(r.call(this,t,e,i,n,this.xCellCount*l+p,o,s,a))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,e,i,n,r,o){const s=n-t,a=r-e,l=i+o;return l*l>s*s+a*a}_circleAndRectCollide(t,e,i,n,r,o,s){const a=(o-n)/2,l=Math.abs(t-(n+a));if(l>a+i)return!1;const c=(s-r)/2,u=Math.abs(e-(r+c));if(u>c+i)return!1;if(l<=a||u<=c)return!0;const h=l-a,p=u-c;return h*h+p*p<=i*i}}function Zt(e,i,n,r,o){const s=t.create$1();return i?(t.scale$1(s,s,[1/o,1/o,1]),n||t.rotateZ(s,s,r.angle)):t.multiply(s,r.labelPlaneMatrix,e),s}function Yt(e,i,n,r,o){if(i){const i=t.clone$1(e);return t.scale$1(i,i,[o,o,1]),n||t.rotateZ(i,i,-r.angle),i}return r.glCoordMatrix}function Qt(e,i,n=0){const r=[e.x,e.y,n,1];n?t.transformMat4(r,r,i):ae(r,r,i);const o=r[3];return{point:new t.pointGeometry(r[0]/o,r[1]/o),signedDistanceFromCamera:o}}function Jt(t,e){return Math.min(.5+t/e*.5,1.5)}function Kt(t,e){const i=t[0]/t[3],n=t[1]/t[3];return i>=-e[0]&&i<=e[0]&&n>=-e[1]&&n<=e[1]}function $t(e,i,n,r,o,s,a,l,c){const u=r?e.textSizeData:e.iconSizeData,h=t.evaluateSizeForZoom(u,n.transform.zoom),p=[256/n.width*2+1,256/n.height*2+1],d=r?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;d.clear();const f=e.lineVertexArray,m=r?e.text.placedSymbolArray:e.icon.placedSymbolArray,g=n.transform.width/n.transform.height;let y=!1;for(let r=0;r<m.length;r++){const v=m.get(r);if(v.hidden||v.writingMode===t.WritingMode.vertical&&!y){se(v.numGlyphs,d);continue}y=!1;const _=c?c({x:v.anchorX,y:v.anchorY}):0,x=[v.anchorX,v.anchorY,_,1];if(t.transformMat4(x,x,i),!Kt(x,p)){se(v.numGlyphs,d);continue}const b=Jt(n.transform.cameraToCenterDistance,x[3]),w=t.evaluateSizeForFeature(u,h,v),A=a?w/b:w*b,E=new t.pointGeometry(v.anchorX,v.anchorY),S=Qt(E,o,_);if(S.signedDistanceFromCamera<=0){se(v.numGlyphs,d);continue}const M=S.point;let T={};const I=a?null:c,C=ie(v,A,!1,l,i,o,s,e.glyphOffsetArray,f,d,M,E,T,g,I);y=C.useVertical,I&&C.needsFlipping&&(T={}),(C.notEnoughRoom||y||C.needsFlipping&&ie(v,A,!0,l,i,o,s,e.glyphOffsetArray,f,d,M,E,T,g,I).notEnoughRoom)&&se(v.numGlyphs,d)}r?e.text.dynamicLayoutVertexBuffer.updateData(d):e.icon.dynamicLayoutVertexBuffer.updateData(d)}function te(t,e,i,n,r,o,s,a,l,c,u,h,p){const d=a.glyphStartIndex+a.numGlyphs,f=a.lineStartIndex,m=a.lineStartIndex+a.lineLength,g=e.getoffsetX(a.glyphStartIndex),y=e.getoffsetX(d-1),v=re(t*g,i,n,r,o,s,a.segment,f,m,l,c,u,h,p,!0);if(!v)return null;const _=re(t*y,i,n,r,o,s,a.segment,f,m,l,c,u,h,p,!0);return _?{first:v,last:_}:null}function ee(e,i,n,r){return e===t.WritingMode.horizontal&&Math.abs(n.y-i.y)>Math.abs(n.x-i.x)*r?{useVertical:!0}:(e===t.WritingMode.vertical?i.y<n.y:i.x>n.x)?{needsFlipping:!0}:null}function ie(e,i,n,r,o,s,a,l,c,u,h,p,d,f,m){const g=i/24,y=e.lineOffsetX*g,v=e.lineOffsetY*g;let _;if(e.numGlyphs>1){const t=e.glyphStartIndex+e.numGlyphs,i=e.lineStartIndex,o=e.lineStartIndex+e.lineLength,u=te(g,l,y,v,n,h,p,e,c,s,d,m);if(!u)return{notEnoughRoom:!0};const x=Qt(u.first.point,a).point,b=Qt(u.last.point,a).point;if(r&&!n){const t=ee(e.writingMode,x,b,f);if(t)return t}_=[u.first];for(let r=e.glyphStartIndex+1;r<t-1;r++)_.push(re(g*l.getoffsetX(r),y,v,n,h,p,e.segment,i,o,c,s,d,m));_.push(u.last)}else{if(r&&!n){const i=Qt(p,o).point,n=e.lineStartIndex+e.segment+1,r=new t.pointGeometry(c.getx(n),c.gety(n)),s=Qt(r,o),a=s.signedDistanceFromCamera>0?s.point:ne(p,r,i,1,o),l=ee(e.writingMode,i,a,f);if(l)return l}const i=re(g*l.getoffsetX(e.glyphStartIndex),y,v,n,h,p,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,s,d,m);if(!i)return{notEnoughRoom:!0};_=[i]}for(const e of _)t.addDynamicAttributes(u,e.point,e.angle);return{}}function ne(t,e,i,n,r,o){const s=t.add(t.sub(e)._unit()),a=Qt(s,r,o?o(s):0).point,l=i.sub(a);return i.add(l._mult(n/l.mag()))}function re(e,i,n,r,o,s,a,l,c,u,h,p,d,f,m){const g=r?e-i:e+i;let y=g>0?1:-1,v=0;r&&(y*=-1,v=Math.PI),y<0&&(v+=Math.PI);let _=y>0?l+a:l+a+1,x=o,b=o,w=0,A=0;const E=Math.abs(g),S=[],M=[];let T=s;const I=()=>{const e=_-y;return 0===w?s:new t.pointGeometry(u.getx(e),u.gety(e))},C=()=>ne(I(),T,b,E-w+1,h,d);for(;w+A<=E;){if(_+=y,_<l||_>=c)return null;if(b=x,S.push(x),f&&M.push(T||I()),x=p[_],void 0===x){T=new t.pointGeometry(u.getx(_),u.gety(_));const e=Qt(T,h,d?d(T):0);x=e.signedDistanceFromCamera>0?p[_]=e.point:C()}else T=null;w+=A,A=b.dist(x)}m&&d&&(T=T||new t.pointGeometry(u.getx(_),u.gety(_)),p[_]=x=void 0===p[_]?x:C(),A=b.dist(x));const P=(E-w)/A,L=x.sub(b),D=L.mult(P)._add(b);n&&D._add(L._unit()._perp()._mult(n*y));const R=v+Math.atan2(x.y-b.y,x.x-b.x);return S.push(D),f&&(T=T||new t.pointGeometry(u.getx(_),u.gety(_)),M.push(function(e,i,n){const r=1-n;return new t.pointGeometry(e.x*r+i.x*n,e.y*r+i.y*n)}(M.length>0?M[M.length-1]:T,T,P))),{point:D,angle:R,path:S,tilePath:M}}const oe=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function se(t,e){for(let i=0;i<t;i++){const t=e.length;e.resize(t+4),e.float32.set(oe,3*t)}}function ae(t,e,i){const n=e[0],r=e[1];return t[0]=i[0]*n+i[4]*r+i[12],t[1]=i[1]*n+i[5]*r+i[13],t[3]=i[3]*n+i[7]*r+i[15],t}const le=100;class ce{constructor(t,e,i=new Xt(t.width+200,t.height+200,25),n=new Xt(t.width+200,t.height+200,25)){this.transform=t,this.grid=i,this.ignoredGrid=n,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+le,this.screenBottomBoundary=t.height+le,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200,this.fogState=e}placeCollisionBox(t,e,i,n,r,o,s){const a=this.projectAndGetPerspectiveRatio(o,e.anchorPointX,e.anchorPointY,e.elevation,e.tileID),l=r*a.perspectiveRatio,c=(e.x1*t+i.x-e.padding)*l+a.point.x,u=(e.y1*t+i.y-e.padding)*l+a.point.y,h=(e.x2*t+i.x+e.padding)*l+a.point.x,p=(e.y2*t+i.y+e.padding)*l+a.point.y,d=a.perspectiveRatio<=.55||a.aboveHorizon;return!this.isInsideGrid(c,u,h,p)||!n&&this.grid.hitTest(c,u,h,p,s)||d?{box:[],offscreen:!1}:{box:[c,u,h,p],offscreen:this.isOffscreen(c,u,h,p)}}placeCollisionCircles(e,i,n,r,o,s,a,l,c,u,h,p,d,f){const m=[],g=this.transform.elevation,y=g?t=>g.getAtTileOffset(f,t.x,t.y):t=>0,v=new t.pointGeometry(i.anchorX,i.anchorY),_=y(v),x=this.projectAndGetPerspectiveRatio(s,v.x,v.y,_,f),{perspectiveRatio:b}=x,w=(u?o/b:o*b)/t.ONE_EM,A=Qt(v,a,_).point,E=x.signedDistanceFromCamera>0?te(w,r,i.lineOffsetX*w,i.lineOffsetY*w,!1,A,v,i,n,a,{},g&&!u?y:null,u&&!!g):null;let S=!1,M=!1,T=!0;if(E&&!x.aboveHorizon){const i=.5*p*b+d,n=new t.pointGeometry(-100,-100),r=new t.pointGeometry(this.screenRightBoundary,this.screenBottomBoundary),o=new qt,s=E.first,a=E.last;let u=[];for(let t=s.path.length-1;t>=1;t--)u.push(s.path[t]);for(let t=1;t<a.path.length;t++)u.push(a.path[t]);const f=2.5*i;if(l){const t=u.map(g?(t,e)=>{const i=y(e<s.path.length-1?s.tilePath[s.path.length-1-e]:a.tilePath[e-s.path.length+2]);return Qt(t,l,i)}:t=>Qt(t,l));u=t.some((t=>t.signedDistanceFromCamera<=0))?[]:t.map((t=>t.point))}let v=[];if(u.length>0){const e=u[0].clone(),i=u[0].clone();for(let t=1;t<u.length;t++)e.x=Math.min(e.x,u[t].x),e.y=Math.min(e.y,u[t].y),i.x=Math.max(i.x,u[t].x),i.y=Math.max(i.y,u[t].y);v=e.x>=n.x&&i.x<=r.x&&e.y>=n.y&&i.y<=r.y?[u]:i.x<n.x||e.x>r.x||i.y<n.y||e.y>r.y?[]:t.clipLine([u],n.x,n.y,r.x,r.y)}for(const t of v){o.reset(t,.25*i);let n=0;n=o.length<=.5*i?1:Math.ceil(o.paddedLength/f)+1;for(let t=0;t<n;t++){const r=t/Math.max(n-1,1),s=o.lerp(r),a=s.x+le,l=s.y+le;m.push(a,l,i,0);const u=a-i,p=l-i,d=a+i,f=l+i;if(T=T&&this.isOffscreen(u,p,d,f),M=M||this.isInsideGrid(u,p,d,f),!e&&this.grid.hitTestCircle(a,l,i,h)&&(S=!0,!c))return{circles:[],offscreen:!1,collisionDetected:S}}}}return{circles:!c&&S||!M?[]:m,offscreen:T,collisionDetected:S}}queryRenderedSymbols(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};const i=[];let n=1/0,r=1/0,o=-1/0,s=-1/0;for(const a of e){const e=new t.pointGeometry(a.x+le,a.y+le);n=Math.min(n,e.x),r=Math.min(r,e.y),o=Math.max(o,e.x),s=Math.max(s,e.y),i.push(e)}const a=this.grid.query(n,r,o,s).concat(this.ignoredGrid.query(n,r,o,s)),l={},c={};for(const e of a){const n=e.key;if(void 0===l[n.bucketInstanceId]&&(l[n.bucketInstanceId]={}),l[n.bucketInstanceId][n.featureIndex])continue;const r=[new t.pointGeometry(e.x1,e.y1),new t.pointGeometry(e.x2,e.y1),new t.pointGeometry(e.x2,e.y2),new t.pointGeometry(e.x1,e.y2)];t.polygonIntersectsPolygon(i,r)&&(l[n.bucketInstanceId][n.featureIndex]=!0,void 0===c[n.bucketInstanceId]&&(c[n.bucketInstanceId]=[]),c[n.bucketInstanceId].push(n.featureIndex))}return c}insertCollisionBox(t,e,i,n,r){(e?this.ignoredGrid:this.grid).insert({bucketInstanceId:i,featureIndex:n,collisionGroupID:r},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,e,i,n,r){const o=e?this.ignoredGrid:this.grid,s={bucketInstanceId:i,featureIndex:n,collisionGroupID:r};for(let e=0;e<t.length;e+=4)o.insertCircle(s,t[e],t[e+1],t[e+2])}projectAndGetPerspectiveRatio(e,i,n,r,o){const s=[i,n,r||0,1];let a=!1;if(r||this.transform.pitch>0){t.transformMat4(s,s,e);let l=!1;this.fogState&&o&&(l=function(e,i,n,r,o,s){const a=s.calculateFogTileMatrix(o),l=[i,n,r];return t.transformMat4$1(l,l,a),A(e,l,s.pitch,s._fov)}(this.fogState,i,n,r||0,o.toUnwrapped(),this.transform)>.9),a=s[2]>s[3]||l}else ae(s,s,e);return{point:new t.pointGeometry((s[0]/s[3]+1)/2*this.transform.width+le,(-s[1]/s[3]+1)/2*this.transform.height+le),perspectiveRatio:Math.min(.5+this.transform.cameraToCenterDistance/s[3]*.5,1.5),signedDistanceFromCamera:s[3],aboveHorizon:a}}isOffscreen(t,e,i,n){return i<le||t>=this.screenRightBoundary||n<le||e>this.screenBottomBoundary}isInsideGrid(t,e,i,n){return i>=0&&t<this.gridRightBoundary&&n>=0&&e<this.gridBottomBoundary}getViewportMatrix(){const e=t.identity([]);return t.translate(e,e,[-100,-100,0]),e}}class ue{constructor(t,e,i,n){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):n&&i?1:0,this.placed=i}isHidden(){return 0===this.opacity&&!this.placed}}class he{constructor(t,e,i,n,r){this.text=new ue(t?t.text:null,e,i,r),this.icon=new ue(t?t.icon:null,e,n,r)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class pe{constructor(t,e,i){this.text=t,this.icon=e,this.skipFade=i}}class de{constructor(){this.invProjMatrix=t.create$1(),this.viewportMatrix=t.create$1(),this.circles=[]}}class fe{constructor(t,e,i,n,r){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=i,this.bucketIndex=n,this.tileID=r}}class me{constructor(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}get(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){const e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:t=>t.collisionGroupID===e}}return this.collisionGroups[t]}}function ge(e,i,n,r,o){const{horizontalAlign:s,verticalAlign:a}=t.getAnchorAlignment(e),l=-(s-.5)*i,c=-(a-.5)*n,u=t.evaluateVariableOffset(e,r);return new t.pointGeometry(l+u[0]*o,c+u[1]*o)}function ye(e,i,n,r,o){const s=new t.pointGeometry(e,i);return n&&s._rotate(r?o:-o),s}class ve{constructor(t,e,i,n,r){this.transform=t.clone(),this.collisionIndex=new ce(this.transform,r),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new me(i),this.collisionCircleArrays={},this.prevPlacement=n,n&&(n.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(e,i,n,r){const o=n.getBucket(i),s=n.latestFeatureIndex;if(!o||!s||i.id!==o.layerIds[0])return;const a=n.collisionBoxArray,l=o.layers[0].layout,c=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),u=n.tileSize/t.EXTENT,h=this.transform.calculateProjMatrix(n.tileID.toUnwrapped()),p="map"===l.get("text-pitch-alignment"),d="map"===l.get("text-rotation-alignment"),f=C(n,1,this.transform.zoom),m=Zt(h,p,d,this.transform,f);let g=null;if(p){const e=Yt(h,p,d,this.transform,f);g=t.multiply([],this.transform.labelPlaneMatrix,e)}this.retainedQueryData[o.bucketInstanceId]=new fe(o.bucketInstanceId,s,o.sourceLayerIndex,o.index,n.tileID);const y={bucket:o,layout:l,posMatrix:h,textLabelPlaneMatrix:m,labelToScreenMatrix:g,scale:c,textPixelRatio:u,holdingForFade:n.holdingForFade(),collisionBoxArray:a,partiallyEvaluatedTextSize:t.evaluateSizeForZoom(o.textSizeData,this.transform.zoom),partiallyEvaluatedIconSize:t.evaluateSizeForZoom(o.iconSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(o.sourceID)};if(r)for(const t of o.sortKeyRanges){const{sortKey:i,symbolInstanceStart:n,symbolInstanceEnd:r}=t;e.push({sortKey:i,symbolInstanceStart:n,symbolInstanceEnd:r,parameters:y})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:o.symbolInstances.length,parameters:y})}attemptAnchorPlacement(t,e,i,n,r,o,s,a,l,c,u,h,p,d,f,m,g,y){const v=[h.textOffset0,h.textOffset1],_=d.getSymbolInstanceTextSize(g,h,this.transform.zoom,p),x=ge(t,i,n,v,r),b=this.collisionIndex.placeCollisionBox(_,e,ye(x.x,x.y,o,s,this.transform.angle),u,a,l,c.predicate);if((!m||0!==this.collisionIndex.placeCollisionBox(d.getSymbolInstanceIconSize(y,this.transform.zoom,p),m,ye(x.x,x.y,o,s,this.transform.angle),u,a,l,c.predicate).box.length)&&b.box.length>0){let e;return this.prevPlacement&&this.prevPlacement.variableOffsets[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID].text&&(e=this.prevPlacement.variableOffsets[h.crossTileID].anchor),this.variableOffsets[h.crossTileID]={textOffset:v,width:i,height:n,anchor:t,textBoxScale:r,prevAnchor:e},this.markUsedJustification(d,t,h,f),d.allowVerticalPlacement&&(this.markUsedOrientation(d,f,h),this.placedOrientations[h.crossTileID]=f),{shift:x,placedGlyphBoxes:b}}}placeLayerBucketPart(e,i,n){const{bucket:r,layout:o,posMatrix:s,textLabelPlaneMatrix:a,labelToScreenMatrix:l,textPixelRatio:c,holdingForFade:u,collisionBoxArray:h,partiallyEvaluatedTextSize:p,partiallyEvaluatedIconSize:d,collisionGroup:f}=e.parameters,m=o.get("text-optional"),g=o.get("icon-optional"),y=o.get("text-allow-overlap"),v=o.get("icon-allow-overlap"),_="map"===o.get("text-rotation-alignment"),x="map"===o.get("text-pitch-alignment"),b="none"!==o.get("icon-text-fit"),w="viewport-y"===o.get("symbol-z-order"),A=y&&(v||!r.hasIconData()||g),E=v&&(y||!r.hasTextData()||m);!r.collisionArrays&&h&&r.deserializeCollisionBoxes(h),n&&r.updateCollisionDebugBuffers(this.transform.zoom,h);const S=(e,h,w)=>{if(i[e.crossTileID])return;if(u)return void(this.placements[e.crossTileID]=new pe(!1,!1,!1));let S=!1,M=!1,T=!0,I=null,C={box:null,offscreen:null},P={box:null,offscreen:null},L=null,D=null,R=null,O=0,k=0,N=0;w.textFeatureIndex?O=w.textFeatureIndex:e.useRuntimeCollisionCircles&&(O=e.featureIndex),w.verticalTextFeatureIndex&&(k=w.verticalTextFeatureIndex);const B=t=>{t.tileID=this.retainedQueryData[r.bucketInstanceId].tileID,(this.transform.elevation||t.elevation)&&(t.elevation=this.transform.elevation?this.transform.elevation.getAtTileOffset(this.retainedQueryData[r.bucketInstanceId].tileID,t.anchorPointX,t.anchorPointY):0)},z=w.textBox;if(z){B(z);const i=i=>{let n=t.WritingMode.horizontal;if(r.allowVerticalPlacement&&!i&&this.prevPlacement){const t=this.prevPlacement.placedOrientations[e.crossTileID];t&&(this.placedOrientations[e.crossTileID]=t,n=t,this.markUsedOrientation(r,n,e))}return n},n=(i,n)=>{if(r.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&w.verticalTextBox){for(const e of r.writingModes)if(e===t.WritingMode.vertical?(C=n(),P=C):C=i(),C&&C.box&&C.box.length)break}else C=i()};if(o.get("text-variable-anchor")){let a=o.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[e.crossTileID]){const t=this.prevPlacement.variableOffsets[e.crossTileID];a.indexOf(t.anchor)>0&&(a=a.filter((e=>e!==t.anchor)),a.unshift(t.anchor))}const l=(t,i,n)=>{const o=e.textBoxScale,l=(t.x2-t.x1)*o+2*t.padding,u=(t.y2-t.y1)*o+2*t.padding,m=b&&!v?i:null;m&&B(m);let g={box:[],offscreen:!1};const w=y?2*a.length:a.length;for(let i=0;i<w;++i){const y=this.attemptAnchorPlacement(a[i%a.length],t,l,u,o,_,x,c,s,f,i>=a.length,e,h,r,n,m,p,d);if(y&&(g=y.placedGlyphBoxes,g&&g.box&&g.box.length)){S=!0,I=y.shift;break}}return g};n((()=>l(z,w.iconBox,t.WritingMode.horizontal)),(()=>{const i=w.verticalTextBox;return i&&B(i),r.allowVerticalPlacement&&!(C&&C.box&&C.box.length)&&e.numVerticalGlyphVertices>0&&i?l(i,w.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),C&&(S=C.box,T=C.offscreen);const u=i(C&&C.box);if(!S&&this.prevPlacement){const t=this.prevPlacement.variableOffsets[e.crossTileID];t&&(this.variableOffsets[e.crossTileID]=t,this.markUsedJustification(r,t.anchor,e,u))}}else{const o=(i,n)=>{const o=r.getSymbolInstanceTextSize(p,e,this.transform.zoom,h),a=this.collisionIndex.placeCollisionBox(o,i,new t.pointGeometry(0,0),y,c,s,f.predicate);return a&&a.box&&a.box.length&&(this.markUsedOrientation(r,n,e),this.placedOrientations[e.crossTileID]=n),a};n((()=>o(z,t.WritingMode.horizontal)),(()=>{const i=w.verticalTextBox;return r.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&i?(B(i),o(i,t.WritingMode.vertical)):{box:null,offscreen:null}})),i(C&&C.box&&C.box.length)}}if(L=C,S=L&&L.box&&L.box.length>0,T=L&&L.offscreen,e.useRuntimeCollisionCircles){const i=r.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),c=t.evaluateSizeForFeature(r.textSizeData,p,i),u=o.get("text-padding");D=this.collisionIndex.placeCollisionCircles(y,i,r.lineVertexArray,r.glyphOffsetArray,c,s,a,l,n,x,f.predicate,e.collisionCircleDiameter,u,this.retainedQueryData[r.bucketInstanceId].tileID),S=y||D.circles.length>0&&!D.collisionDetected,T=T&&D.offscreen}if(w.iconFeatureIndex&&(N=w.iconFeatureIndex),w.iconBox){const e=e=>{B(e);const i=b&&I?ye(I.x,I.y,_,x,this.transform.angle):new t.pointGeometry(0,0),n=r.getSymbolInstanceIconSize(d,this.transform.zoom,h);return this.collisionIndex.placeCollisionBox(n,e,i,v,c,s,f.predicate)};P&&P.box&&P.box.length&&w.verticalIconBox?(R=e(w.verticalIconBox),M=R.box.length>0):(R=e(w.iconBox),M=R.box.length>0),T=T&&R.offscreen}const F=m||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,V=g||0===e.numIconVertices;if(F||V?V?F||(M=M&&S):S=M&&S:M=S=M&&S,S&&L&&L.box&&this.collisionIndex.insertCollisionBox(L.box,o.get("text-ignore-placement"),r.bucketInstanceId,P&&P.box&&k?k:O,f.ID),M&&R&&this.collisionIndex.insertCollisionBox(R.box,o.get("icon-ignore-placement"),r.bucketInstanceId,N,f.ID),D&&(S&&this.collisionIndex.insertCollisionCircles(D.circles,o.get("text-ignore-placement"),r.bucketInstanceId,O,f.ID),n)){const t=r.bucketInstanceId;let e=this.collisionCircleArrays[t];void 0===e&&(e=this.collisionCircleArrays[t]=new de);for(let t=0;t<D.circles.length;t+=4)e.circles.push(D.circles[t+0]),e.circles.push(D.circles[t+1]),e.circles.push(D.circles[t+2]),e.circles.push(D.collisionDetected?1:0)}this.placements[e.crossTileID]=new pe(S||A,M||E,T||r.justReloaded),i[e.crossTileID]=!0};if(w){const t=r.getSortedSymbolIndexes(this.transform.angle);for(let e=t.length-1;e>=0;--e){const i=t[e];S(r.symbolInstances.get(i),i,r.collisionArrays[i])}}else for(let t=e.symbolInstanceStart;t<e.symbolInstanceEnd;t++)S(r.symbolInstances.get(t),t,r.collisionArrays[t]);if(n&&r.bucketInstanceId in this.collisionCircleArrays){const e=this.collisionCircleArrays[r.bucketInstanceId];t.invert(e.invProjMatrix,s),e.viewportMatrix=this.collisionIndex.getViewportMatrix()}r.justReloaded=!1}markUsedJustification(e,i,n,r){let o;o=r===t.WritingMode.vertical?n.verticalPlacedTextSymbolIndex:{left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex}[t.getAnchorJustification(i)];const s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];for(const t of s)t>=0&&(e.text.placedSymbolArray.get(t).crossTileID=o>=0&&t!==o?0:n.crossTileID)}markUsedOrientation(e,i,n){const r=i===t.WritingMode.horizontal||i===t.WritingMode.horizontalOnly?i:0,o=i===t.WritingMode.vertical?i:0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];for(const t of s)e.text.placedSymbolArray.get(t).placedOrientation=r;n.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=o)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const e=this.prevPlacement;let i=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;const n=e?e.symbolFadeChange(t):1,r=e?e.opacities:{},o=e?e.variableOffsets:{},s=e?e.placedOrientations:{};for(const t in this.placements){const e=this.placements[t],o=r[t];o?(this.opacities[t]=new he(o,n,e.text,e.icon),i=i||e.text!==o.text.placed||e.icon!==o.icon.placed):(this.opacities[t]=new he(null,n,e.text,e.icon,e.skipFade),i=i||e.text||e.icon)}for(const t in r){const e=r[t];if(!this.opacities[t]){const r=new he(e,n,!1,!1);r.isHidden()||(this.opacities[t]=r,i=i||e.text.placed||e.icon.placed)}}for(const t in o)this.variableOffsets[t]||!this.opacities[t]||this.opacities[t].isHidden()||(this.variableOffsets[t]=o[t]);for(const t in s)this.placedOrientations[t]||!this.opacities[t]||this.opacities[t].isHidden()||(this.placedOrientations[t]=s[t]);i?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)}updateLayerOpacities(t,e){const i={};for(const n of e){const e=n.getBucket(t);e&&n.latestFeatureIndex&&t.id===e.layerIds[0]&&this.updateBucketOpacities(e,i,n.collisionBoxArray)}}updateBucketOpacities(e,i,n){e.hasTextData()&&e.text.opacityVertexArray.clear(),e.hasIconData()&&e.icon.opacityVertexArray.clear(),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();const r=e.layers[0].layout,o=new he(null,0,!1,!1,!0),s=r.get("text-allow-overlap"),a=r.get("icon-allow-overlap"),l=r.get("text-variable-anchor"),c="map"===r.get("text-rotation-alignment"),u="map"===r.get("text-pitch-alignment"),h="none"!==r.get("icon-text-fit"),p=new he(null,0,s&&(a||!e.hasIconData()||r.get("icon-optional")),a&&(s||!e.hasTextData()||r.get("text-optional")),!0);!e.collisionArrays&&n&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(n);const d=(t,e,i)=>{for(let n=0;n<e/4;n++)t.opacityVertexArray.emplaceBack(i)};for(let n=0;n<e.symbolInstances.length;n++){const r=e.symbolInstances.get(n),{numHorizontalGlyphVertices:s,numVerticalGlyphVertices:a,crossTileID:f}=r;let m=this.opacities[f];i[f]?m=o:m||(m=p,this.opacities[f]=m),i[f]=!0;const g=r.numIconVertices>0,y=this.placedOrientations[r.crossTileID],v=y===t.WritingMode.vertical,_=y===t.WritingMode.horizontal||y===t.WritingMode.horizontalOnly;if(s>0||a>0){const t=Te(m.text);d(e.text,s,v?Ie:t),d(e.text,a,_?Ie:t);const i=m.text.isHidden();[r.rightJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.leftJustifiedTextSymbolIndex].forEach((t=>{t>=0&&(e.text.placedSymbolArray.get(t).hidden=i||v?1:0)})),r.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(r.verticalPlacedTextSymbolIndex).hidden=i||_?1:0);const n=this.variableOffsets[r.crossTileID];n&&this.markUsedJustification(e,n.anchor,r,y);const o=this.placedOrientations[r.crossTileID];o&&(this.markUsedJustification(e,"left",r,o),this.markUsedOrientation(e,o,r))}if(g){const t=Te(m.icon),i=!(h&&r.verticalPlacedIconSymbolIndex&&v);r.placedIconSymbolIndex>=0&&(d(e.icon,r.numIconVertices,i?t:Ie),e.icon.placedSymbolArray.get(r.placedIconSymbolIndex).hidden=m.icon.isHidden()),r.verticalPlacedIconSymbolIndex>=0&&(d(e.icon,r.numVerticalIconVertices,i?Ie:t),e.icon.placedSymbolArray.get(r.verticalPlacedIconSymbolIndex).hidden=m.icon.isHidden())}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){const i=e.collisionArrays[n];if(i){let n=new t.pointGeometry(0,0);if(i.textBox||i.verticalTextBox){let t=!0;if(l){const e=this.variableOffsets[f];e?(n=ge(e.anchor,e.width,e.height,e.textOffset,e.textBoxScale),c&&n._rotate(u?this.transform.angle:-this.transform.angle)):t=!1}i.textBox&&_e(e.textCollisionBox.collisionVertexArray,m.text.placed,!t||v,n.x,n.y),i.verticalTextBox&&_e(e.textCollisionBox.collisionVertexArray,m.text.placed,!t||_,n.x,n.y)}const r=Boolean(!_&&i.verticalIconBox);i.iconBox&&_e(e.iconCollisionBox.collisionVertexArray,m.icon.placed,r,h?n.x:0,h?n.y:0),i.verticalIconBox&&_e(e.iconCollisionBox.collisionVertexArray,m.icon.placed,!r,h?n.x:0,h?n.y:0)}}}if(e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.bucketInstanceId in this.collisionCircleArrays){const t=this.collisionCircleArrays[e.bucketInstanceId];e.placementInvProjMatrix=t.invProjMatrix,e.placementViewportMatrix=t.viewportMatrix,e.collisionCircleArray=t.circles,delete this.collisionCircleArrays[e.bucketInstanceId]}}symbolFadeChange(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(t,e){const i=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*i>t}setStale(){this.stale=!0}}function _e(t,e,i,n,r){t.emplaceBack(e?1:0,i?1:0,n||0,r||0),t.emplaceBack(e?1:0,i?1:0,n||0,r||0),t.emplaceBack(e?1:0,i?1:0,n||0,r||0),t.emplaceBack(e?1:0,i?1:0,n||0,r||0)}const xe=Math.pow(2,25),be=Math.pow(2,24),we=Math.pow(2,17),Ae=Math.pow(2,16),Ee=Math.pow(2,9),Se=Math.pow(2,8),Me=Math.pow(2,1);function Te(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;const e=t.placed?1:0,i=Math.floor(127*t.opacity);return i*xe+e*be+i*we+e*Ae+i*Ee+e*Se+i*Me+e}const Ie=0;class Ce{constructor(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,e,i,n,r){const o=this._bucketParts;for(;this._currentTileIndex<t.length;)if(e.getBucketParts(o,n,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,r())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,o.sort(((t,e)=>t.sortKey-e.sortKey)));this._currentPartIndex<o.length;)if(e.placeLayerBucketPart(o[this._currentPartIndex],this._seenCrossTileIDs,i),this._currentPartIndex++,r())return!0;return!1}}class Pe{constructor(t,e,i,n,r,o,s,a){this.placement=new ve(t,r,o,s,a),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=i,this._showCollisionBoxes=n,this._done=!1}isDone(){return this._done}continuePlacement(e,i,n){const r=t.exported.now(),o=()=>{const e=t.exported.now()-r;return!this._forceFullPlacement&&e>2};for(;this._currentPlacementIndex>=0;){const t=i[e[this._currentPlacementIndex]],r=this.placement.collisionIndex.transform.zoom;if("symbol"===t.type&&(!t.minzoom||t.minzoom<=r)&&(!t.maxzoom||t.maxzoom>r)){if(this._inProgressLayer||(this._inProgressLayer=new Ce(t)),this._inProgressLayer.continuePlacement(n[t.source],this.placement,this._showCollisionBoxes,t,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const Le=512/t.EXTENT/2;class De{constructor(t,e,i){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=i;for(let i=0;i<e.length;i++){const n=e.get(i),r=n.key;this.indexedSymbolInstances[r]||(this.indexedSymbolInstances[r]=[]),this.indexedSymbolInstances[r].push({crossTileID:n.crossTileID,coord:this.getScaledCoordinates(n,t)})}}getScaledCoordinates(e,i){const n=Le/Math.pow(2,i.canonical.z-this.tileID.canonical.z);return{x:Math.floor((i.canonical.x*t.EXTENT+e.anchorX)*n),y:Math.floor((i.canonical.y*t.EXTENT+e.anchorY)*n)}}findMatches(t,e,i){const n=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z);for(let r=0;r<t.length;r++){const o=t.get(r);if(o.crossTileID)continue;const s=this.indexedSymbolInstances[o.key];if(!s)continue;const a=this.getScaledCoordinates(o,e);for(const t of s)if(Math.abs(t.coord.x-a.x)<=n&&Math.abs(t.coord.y-a.y)<=n&&!i[t.crossTileID]){i[t.crossTileID]=!0,o.crossTileID=t.crossTileID;break}}}}class Re{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Oe{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const e=Math.round((t-this.lng)/360);if(0!==e)for(const t in this.indexes){const i=this.indexes[t],n={};for(const t in i){const r=i[t];r.tileID=r.tileID.unwrapTo(r.tileID.wrap+e),n[r.tileID.key]=r}this.indexes[t]=n}this.lng=t}addBucket(t,e,i){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let t=0;t<e.symbolInstances.length;t++)e.symbolInstances.get(t).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});const n=this.usedCrossTileIDs[t.overscaledZ];for(const i in this.indexes){const r=this.indexes[i];if(Number(i)>t.overscaledZ)for(const i in r){const o=r[i];o.tileID.isChildOf(t)&&o.findMatches(e.symbolInstances,t,n)}else{const o=r[t.scaledTo(Number(i)).key];o&&o.findMatches(e.symbolInstances,t,n)}}for(let t=0;t<e.symbolInstances.length;t++){const r=e.symbolInstances.get(t);r.crossTileID||(r.crossTileID=i.generate(),n[r.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new De(t,e.symbolInstances,e.bucketInstanceId),!0}removeBucketCrossTileIDs(t,e){for(const i in e.indexedSymbolInstances)for(const n of e.indexedSymbolInstances[i])delete this.usedCrossTileIDs[t][n.crossTileID]}removeStaleBuckets(t){let e=!1;for(const i in this.indexes){const n=this.indexes[i];for(const r in n)t[n[r].bucketInstanceId]||(this.removeBucketCrossTileIDs(i,n[r]),delete n[r],e=!0)}return e}}class ke{constructor(){this.layerIndexes={},this.crossTileIDs=new Re,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(t,e,i){let n=this.layerIndexes[t.id];void 0===n&&(n=this.layerIndexes[t.id]=new Oe);let r=!1;const o={};n.handleWrapJump(i);for(const i of e){const e=i.getBucket(t);e&&t.id===e.layerIds[0]&&(e.bucketInstanceId||(e.bucketInstanceId=++this.maxBucketInstanceId),n.addBucket(i.tileID,e,this.crossTileIDs)&&(r=!0),o[e.bucketInstanceId]=!0)}return n.removeStaleBuckets(o)&&(r=!0),r}pruneUnusedLayers(t){const e={};t.forEach((t=>{e[t]=!0}));for(const t in this.layerIndexes)e[t]||delete this.layerIndexes[t]}}const Ne=(e,i)=>t.emitValidationErrors(e,i&&i.filter((t=>"source.canvas"!==t.identifier))),Be=t.pick(zt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog"]),ze=t.pick(zt,["setCenter","setZoom","setBearing","setPitch"]),Fe=function(){const e={},i=t.spec.$version;for(const n in t.spec.$root){const r=t.spec.$root[n];if(r.required){let t=null;t="version"===n?i:"array"===r.type?[]:{},null!=t&&(e[n]=t)}}return e}(),Ve={fill:!0,line:!0,background:!0,hillshade:!0,raster:!0};class Ue extends t.Evented{constructor(e,i={}){super(),this.map=e,this.dispatcher=new I(kt(),this),this.imageManager=new g,this.imageManager.setEventedParent(this),this.glyphManager=new t.GlyphManager(e._requestManager,i.localFontFamily?t.LocalGlyphMode.all:i.localIdeographFontFamily?t.LocalGlyphMode.ideographs:t.LocalGlyphMode.none,i.localFontFamily||i.localIdeographFontFamily),this.lineAtlas=new t.LineAtlas(256,512),this.crossTileSymbolIndex=new ke,this._layers={},this._num3DLayers=0,this._numSymbolLayers=0,this._numCircleLayers=0,this._serializedLayers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this.zoomHistory=new t.ZoomHistory,this._loaded=!1,this._availableImages=[],this._order=[],this._drapedFirstOrder=[],this._markersNeedUpdate=!1,this._resetUpdates(),this.dispatcher.broadcast("setReferrer",t.getReferrer());const n=this;this._rtlTextPluginCallback=Ue.registerForPluginStateChange((e=>{n.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:e.pluginStatus,pluginURL:e.pluginURL},((e,i)=>{if(t.triggerPluginCompletionEvent(e),i&&i.every((t=>t)))for(const t in n._sourceCaches){const e=n._sourceCaches[t],i=e.getSource().type;"vector"!==i&&"geojson"!==i||e.reload()}}))})),this.on("data",(t=>{if("source"!==t.dataType||"metadata"!==t.sourceDataType)return;const e=this.getSource(t.sourceId);if(e&&e.vectorLayerIds)for(const t in this._layers){const i=this._layers[t];i.source===e.id&&this._validateLayer(i)}}))}loadURL(e,i={}){this.fire(new t.Event("dataloading",{dataType:"style"}));const n="boolean"==typeof i.validate?i.validate:!t.isMapboxURL(e);e=this.map._requestManager.normalizeStyleURL(e,i.accessToken);const r=this.map._requestManager.transformRequest(e,t.ResourceType.Style);this._request=t.getJSON(r,((e,i)=>{this._request=null,e?this.fire(new t.ErrorEvent(e)):i&&this._load(i,n)}))}loadJSON(e,i={}){this.fire(new t.Event("dataloading",{dataType:"style"})),this._request=t.exported.frame((()=>{this._request=null,this._load(e,!1!==i.validate)}))}loadEmpty(){this.fire(new t.Event("dataloading",{dataType:"style"})),this._load(Fe,!1)}_updateLayerCount(t,e){const i=e?1:-1;t.is3D()&&(this._num3DLayers+=i),"circle"===t.type&&(this._numCircleLayers+=i),"symbol"===t.type&&(this._numSymbolLayers+=i)}_load(e,i){if(i&&Ne(this,t.validateStyle(e)))return;this._loaded=!0,this.stylesheet=e;for(const t in e.sources)this.addSource(t,e.sources[t],{validate:!1});this._changed=!1,e.sprite?this._loadSprite(e.sprite):(this.imageManager.setLoaded(!0),this.dispatcher.broadcast("spriteLoaded",!0)),this.glyphManager.setURL(e.glyphs);const n=Bt(this.stylesheet.layers);this._order=n.map((t=>t.id)),this._layers={},this._serializedLayers={};for(let e of n)e=t.createStyleLayer(e),e.setEventedParent(this,{layer:{id:e.id}}),this._layers[e.id]=e,this._serializedLayers[e.id]=e.serialize(),this._updateLayerCount(e,!0);this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new _(this.stylesheet.light),this.stylesheet.terrain&&this._createTerrain(this.stylesheet.terrain),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this._updateDrapeFirstLayers(),this.fire(new t.Event("data",{dataType:"style"})),this.fire(new t.Event("style.load"))}_loadSprite(e){this._spriteRequest=function(e,i,n){let r,o,s;const a=t.exported.devicePixelRatio>1?"@2x":"";let l=t.getJSON(i.transformRequest(i.normalizeSpriteURL(e,a,".json"),t.ResourceType.SpriteJSON),((t,e)=>{l=null,s||(s=t,r=e,u())})),c=t.getImage(i.transformRequest(i.normalizeSpriteURL(e,a,".png"),t.ResourceType.SpriteImage),((t,e)=>{c=null,s||(s=t,o=e,u())}));function u(){if(s)n(s);else if(r&&o){const e=t.exported.getImageData(o),i={};for(const n in r){const{width:o,height:s,x:a,y:l,sdf:c,pixelRatio:u,stretchX:h,stretchY:p,content:d}=r[n],f=new t.RGBAImage({width:o,height:s});t.RGBAImage.copy(e,f,{x:a,y:l},{x:0,y:0},{width:o,height:s}),i[n]={data:f,pixelRatio:u,sdf:c,stretchX:h,stretchY:p,content:d}}n(null,i)}}return{cancel(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null)}}}(e,this.map._requestManager,((e,i)=>{if(this._spriteRequest=null,e)this.fire(new t.ErrorEvent(e));else if(i)for(const t in i)this.imageManager.addImage(t,i[t]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.dispatcher.broadcast("spriteLoaded",!0),this.fire(new t.Event("data",{dataType:"style"}))}))}_validateLayer(e){const i=this.getSource(e.source);if(!i)return;const n=e.sourceLayer;n&&("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new t.ErrorEvent(new Error(`Source layer "${n}" does not exist on source "${i.id}" as specified by style layer "${e.id}"`)))}loaded(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(const t in this._sourceCaches)if(!this._sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(t){const e=[];for(const i of t){const t=this._layers[i];"custom"!==t.type&&e.push(t.serialize())}return e}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;if(this.fog&&this.fog.hasTransition())return!0;for(const t in this._sourceCaches)if(this._sourceCaches[t].hasTransition())return!0;for(const t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}get order(){return this.map._optimizeForTerrain&&this.terrain?this._drapedFirstOrder:this._order}isLayerDraped(t){return!!this.terrain&&Ve[t.type]}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}update(e){if(!this._loaded)return;const i=this._changed;if(this._changed){const t=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);(t.length||i.length)&&this._updateWorkerLayers(t,i);for(const t in this._updatedSources){const e=this._updatedSources[t];"reload"===e?this._reloadSource(t):"clear"===e&&this._clearSource(t)}this._updateTilesForChangedImages();for(const t in this._updatedPaintProps)this._layers[t].updateTransitions(e);this.light.updateTransitions(e),this.fog&&this.fog.updateTransitions(e),this._resetUpdates()}const n={};for(const t in this._sourceCaches){const e=this._sourceCaches[t];n[t]=e.used,e.used=!1}for(const t of this._order){const i=this._layers[t];if(i.recalculate(e,this._availableImages),!i.isHidden(e.zoom)){const t=this._getLayerSourceCache(i);t&&(t.used=!0)}const n=this.map.painter;if(n){const t=i.getProgramIds();if(!t)continue;const r=i.getProgramConfiguration(e.zoom);for(const e of t)n.useProgram(e,r)}}for(const e in n){const i=this._sourceCaches[e];n[e]!==i.used&&i.getSource().fire(new t.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:i.getSource().id}))}this.light.recalculate(e),this.terrain&&this.terrain.recalculate(e),this.fog&&this.fog.recalculate(e),this.z=e.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),i&&this.fire(new t.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const e in this._sourceCaches)this._sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateWorkerLayers(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setState(e){if(this._checkLoaded(),Ne(this,t.validateStyle(e)))return!1;(e=t.clone$2(e)).layers=Bt(e.layers);const i=function(t,e){if(!t)return[{command:zt.setStyle,args:[e]}];let i=[];try{if(!r(t.version,e.version))return[{command:zt.setStyle,args:[e]}];r(t.center,e.center)||i.push({command:zt.setCenter,args:[e.center]}),r(t.zoom,e.zoom)||i.push({command:zt.setZoom,args:[e.zoom]}),r(t.bearing,e.bearing)||i.push({command:zt.setBearing,args:[e.bearing]}),r(t.pitch,e.pitch)||i.push({command:zt.setPitch,args:[e.pitch]}),r(t.sprite,e.sprite)||i.push({command:zt.setSprite,args:[e.sprite]}),r(t.glyphs,e.glyphs)||i.push({command:zt.setGlyphs,args:[e.glyphs]}),r(t.transition,e.transition)||i.push({command:zt.setTransition,args:[e.transition]}),r(t.light,e.light)||i.push({command:zt.setLight,args:[e.light]}),r(t.fog,e.fog)||i.push({command:zt.setFog,args:[e.fog]});const n={},o=[];!function(t,e,i,n){let o;for(o in e=e||{},t=t||{})t.hasOwnProperty(o)&&(e.hasOwnProperty(o)||Vt(o,i,n));for(o in e)e.hasOwnProperty(o)&&(t.hasOwnProperty(o)?r(t[o],e[o])||("geojson"===t[o].type&&"geojson"===e[o].type&&Gt(t,e,o)?i.push({command:zt.setGeoJSONSourceData,args:[o,e[o].data]}):Ut(o,e,i,n)):Ft(o,e,i))}(t.sources,e.sources,o,n);const s=[];t.layers&&t.layers.forEach((t=>{n[t.source]?i.push({command:zt.removeLayer,args:[t.id]}):s.push(t)}));let a=t.terrain;a&&n[a.source]&&(i.push({command:zt.setTerrain,args:[void 0]}),a=void 0),i=i.concat(o),r(a,e.terrain)||i.push({command:zt.setTerrain,args:[e.terrain]}),function(t,e,i){e=e||[];const n=(t=t||[]).map(Ht),o=e.map(Ht),s=t.reduce(Wt,{}),a=e.reduce(Wt,{}),l=n.slice(),c=Object.create(null);let u,h,p,d,f,m,g;for(u=0,h=0;u<n.length;u++)p=n[u],a.hasOwnProperty(p)?h++:(i.push({command:zt.removeLayer,args:[p]}),l.splice(l.indexOf(p,h),1));for(u=0,h=0;u<o.length;u++)p=o[o.length-1-u],l[l.length-1-u]!==p&&(s.hasOwnProperty(p)?(i.push({command:zt.removeLayer,args:[p]}),l.splice(l.lastIndexOf(p,l.length-h),1)):h++,m=l[l.length-u],i.push({command:zt.addLayer,args:[a[p],m]}),l.splice(l.length-u,0,p),c[p]=!0);for(u=0;u<o.length;u++)if(p=o[u],d=s[p],f=a[p],!c[p]&&!r(d,f))if(r(d.source,f.source)&&r(d["source-layer"],f["source-layer"])&&r(d.type,f.type)){for(g in jt(d.layout,f.layout,i,p,null,zt.setLayoutProperty),jt(d.paint,f.paint,i,p,null,zt.setPaintProperty),r(d.filter,f.filter)||i.push({command:zt.setFilter,args:[p,f.filter]}),r(d.minzoom,f.minzoom)&&r(d.maxzoom,f.maxzoom)||i.push({command:zt.setLayerZoomRange,args:[p,f.minzoom,f.maxzoom]}),d)d.hasOwnProperty(g)&&"layout"!==g&&"paint"!==g&&"filter"!==g&&"metadata"!==g&&"minzoom"!==g&&"maxzoom"!==g&&(0===g.indexOf("paint.")?jt(d[g],f[g],i,p,g.slice(6),zt.setPaintProperty):r(d[g],f[g])||i.push({command:zt.setLayerProperty,args:[p,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.")?jt(d[g],f[g],i,p,g.slice(6),zt.setPaintProperty):r(d[g],f[g])||i.push({command:zt.setLayerProperty,args:[p,g,f[g]]}))}else i.push({command:zt.removeLayer,args:[p]}),m=l[l.lastIndexOf(p)+1],i.push({command:zt.addLayer,args:[f,m]})}(s,e.layers,i)}catch(t){console.warn("Unable to compute style diff:",t),i=[{command:zt.setStyle,args:[e]}]}return i}(this.serialize(),e).filter((t=>!(t.command in ze)));if(0===i.length)return!1;const n=i.filter((t=>!(t.command in Be)));if(n.length>0)throw new Error(`Unimplemented: ${n.map((t=>t.command)).join(", ")}.`);return i.forEach((t=>{"setTransition"!==t.command&&this[t.command].apply(this,t.args)})),this.stylesheet=e,!0}addImage(e,i){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,i),this._afterImageUpdated(e)}updateImage(t,e){this.imageManager.updateImage(t,e)}getImage(t){return this.imageManager.getImage(t)}removeImage(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._afterImageUpdated(e)}_afterImageUpdated(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(e,i,n={}){if(this._checkLoaded(),void 0!==this.getSource(e))throw new Error("There is already a source with this ID");if(!i.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(i).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(i.type)>=0&&this._validate(t.validateStyle.source,`sources.${e}`,i,null,n))return;this.map&&this.map._collectResourceTiming&&(i.collectResourceTiming=!0);const r=Mt(e,i,this.dispatcher,this);r.setEventedParent(this,(()=>({isSourceLoaded:this.loaded(),source:r.serialize(),sourceId:e})));const o=i=>{const n=(i?"symbol:":"other:")+e,o=this._sourceCaches[n]=new t.SourceCache(n,r,i);(i?this._symbolSourceCaches:this._otherSourceCaches)[e]=o,o.style=this,o.onAdd(this.map)};o(!1),"vector"!==i.type&&"geojson"!==i.type||o(!0),r.onAdd&&r.onAdd(this.map),this._changed=!0}removeSource(e){this._checkLoaded();const i=this.getSource(e);if(void 0===i)throw new Error("There is no source with this ID");for(const i in this._layers)if(this._layers[i].source===e)return this.fire(new t.ErrorEvent(new Error(`Source "${e}" cannot be removed while layer "${i}" is using it.`)));if(this.terrain&&this.terrain.get().source===e)return this.fire(new t.ErrorEvent(new Error(`Source "${e}" cannot be removed while terrain is using it.`)));const n=this._getSourceCaches(e);for(const e of n)delete this._sourceCaches[e.id],delete this._updatedSources[e.id],e.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e.getSource().id})),e.setEventedParent(null),e.clearTiles();delete this._otherSourceCaches[e],delete this._symbolSourceCaches[e],i.setEventedParent(null),i.onRemove&&i.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,e){this._checkLoaded(),this.getSource(t).setData(e),this._changed=!0}getSource(t){const e=this._getSourceCache(t);return e&&e.getSource()}addLayer(e,i,n={}){this._checkLoaded();const r=e.id;if(this.getLayer(r))return void this.fire(new t.ErrorEvent(new Error(`Layer with id "${r}" already exists on this map`)));let o;if("custom"===e.type){if(Ne(this,t.validateCustomStyleLayer(e)))return;o=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(r,e.source),e=t.clone$2(e),e=t.extend(e,{source:r})),this._validate(t.validateStyle.layer,`layers.${r}`,e,{arrayIndex:-1},n))return;o=t.createStyleLayer(e),this._validateLayer(o),o.setEventedParent(this,{layer:{id:r}}),this._serializedLayers[o.id]=o.serialize(),this._updateLayerCount(o,!0)}const s=i?this._order.indexOf(i):this._order.length;if(i&&-1===s)return void this.fire(new t.ErrorEvent(new Error(`Layer with id "${i}" does not exist on this map.`)));this._order.splice(s,0,r),this._layerOrderChanged=!0,this._layers[r]=o;const a=this._getLayerSourceCache(o);if(this._removedLayers[r]&&o.source&&a&&"custom"!==o.type){const t=this._removedLayers[r];delete this._removedLayers[r],t.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",a.pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map),this._updateDrapeFirstLayers()}moveLayer(e,i){if(this._checkLoaded(),this._changed=!0,!this._layers[e])return void this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style and cannot be moved.`)));if(e===i)return;const n=this._order.indexOf(e);this._order.splice(n,1);const r=i?this._order.indexOf(i):this._order.length;i&&-1===r?this.fire(new t.ErrorEvent(new Error(`Layer with id "${i}" does not exist on this map.`))):(this._order.splice(r,0,e),this._layerOrderChanged=!0,this._updateDrapeFirstLayers())}removeLayer(e){this._checkLoaded();const i=this._layers[e];if(!i)return void this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style and cannot be removed.`)));i.setEventedParent(null),this._updateLayerCount(i,!1);const n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=i,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],i.onRemove&&i.onRemove(this.map),this._updateDrapeFirstLayers()}getLayer(t){return this._layers[t]}hasLayer(t){return t in this._layers}hasLayerType(t){for(const e in this._layers)if(this._layers[e].type===t)return!0;return!1}setLayerZoomRange(e,i,n){this._checkLoaded();const r=this.getLayer(e);r?r.minzoom===i&&r.maxzoom===n||(null!=i&&(r.minzoom=i),null!=n&&(r.maxzoom=n),this._updateLayer(r)):this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style and cannot have zoom extent.`)))}setFilter(e,i,n={}){this._checkLoaded();const o=this.getLayer(e);if(o){if(!r(o.filter,i))return null==i?(o.filter=void 0,void this._updateLayer(o)):void(this._validate(t.validateStyle.filter,`layers.${o.id}.filter`,i,null,n)||(o.filter=t.clone$2(i),this._updateLayer(o)))}else this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style and cannot be filtered.`)))}getFilter(e){return t.clone$2(this.getLayer(e).filter)}setLayoutProperty(e,i,n,o={}){this._checkLoaded();const s=this.getLayer(e);s?r(s.getLayoutProperty(i),n)||(s.setLayoutProperty(i,n,o),this._updateLayer(s)):this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style and cannot be styled.`)))}getLayoutProperty(e,i){const n=this.getLayer(e);if(n)return n.getLayoutProperty(i);this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style.`)))}setPaintProperty(e,i,n,o={}){this._checkLoaded();const s=this.getLayer(e);s?r(s.getPaintProperty(i),n)||(s.setPaintProperty(i,n,o)&&this._updateLayer(s),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style and cannot be styled.`)))}getPaintProperty(t,e){return this.getLayer(t).getPaintProperty(e)}setFeatureState(e,i){this._checkLoaded();const n=e.source,r=e.sourceLayer,o=this.getSource(n);if(void 0===o)return void this.fire(new t.ErrorEvent(new Error(`The source '${n}' does not exist in the map's style.`)));const s=o.type;if("geojson"===s&&r)return void this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if("vector"===s&&!r)return void this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided.")));const a=this._getSourceCaches(n);for(const t of a)t.setFeatureState(r,e.id,i)}removeFeatureState(e,i){this._checkLoaded();const n=e.source,r=this.getSource(n);if(void 0===r)return void this.fire(new t.ErrorEvent(new Error(`The source '${n}' does not exist in the map's style.`)));const o=r.type,s="vector"===o?e.sourceLayer:void 0;if("vector"===o&&!s)return void this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));if(i&&"string"!=typeof e.id&&"number"!=typeof e.id)return void this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));const a=this._getSourceCaches(n);for(const t of a)t.removeFeatureState(s,e.id,i)}getFeatureState(e){this._checkLoaded();const i=e.source,n=e.sourceLayer,r=this.getSource(i);if(void 0!==r){if("vector"!==r.type||n)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),this._getSourceCaches(i)[0].getFeatureState(n,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error(`The source '${i}' does not exist in the map's style.`)))}getTransition(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){const e={};for(const t in this._sourceCaches){const i=this._sourceCaches[t].getSource();e[i.id]||(e[i.id]=i.serialize())}return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,terrain:this.stylesheet.terrain,fog:this.stylesheet.fog,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:e,layers:this._serializeLayers(this._order)},(t=>void 0!==t))}_updateLayer(t){this._updatedLayers[t.id]=!0;const e=this._getLayerSourceCache(t);t.source&&!this._updatedSources[t.source]&&e&&"raster"!==e.getSource().type&&(this._updatedSources[t.source]="reload",e.pause()),this._changed=!0}_flattenAndSortRenderedFeatures(t){const e=t=>"fill-extrusion"===this._layers[t].type,i={},n=[];for(let r=this._order.length-1;r>=0;r--){const o=this._order[r];if(e(o)){i[o]=r;for(const e of t){const t=e[o];if(t)for(const e of t)n.push(e)}}}n.sort(((t,e)=>e.intersectionZ-t.intersectionZ));const r=[];for(let o=this._order.length-1;o>=0;o--){const s=this._order[o];if(e(s))for(let t=n.length-1;t>=0;t--){const e=n[t].feature;if(i[e.layer.id]<o)break;r.push(e),n.pop()}else for(const e of t){const t=e[s];if(t)for(const e of t)r.push(e.feature)}}return r}queryRenderedFeatures(e,i,n){i&&i.filter&&this._validate(t.validateStyle.filter,"queryRenderedFeatures.filter",i.filter,null,i);const r={};if(i&&i.layers){if(!Array.isArray(i.layers))return this.fire(new t.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(const e of i.layers){const i=this._layers[e];if(!i)return this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style and cannot be queried for features.`))),[];r[i.source]=!0}}const o=[];i.availableImages=this._availableImages;const s=i&&i.layers?i.layers.some((t=>{const e=this.getLayer(t);return e&&e.is3D()})):this.has3DLayers(),a=P.createFromScreenPoints(e,n);for(const t in this._sourceCaches){const e=this._sourceCaches[t].getSource().id;i.layers&&!r[e]||o.push(It(this._sourceCaches[t],this._layers,this._serializedLayers,a,i,n,s,!!this.map._showQueryGeometry))}return this.placement&&o.push(function(t,e,i,n,r,o,s){const a={},l=o.queryRenderedSymbols(n),c=[];for(const t of Object.keys(l).map(Number))c.push(s[t]);c.sort(Pt);for(const i of c){const n=i.featureIndex.lookupSymbolFeatures(l[i.bucketInstanceId],e,i.bucketIndex,i.sourceLayerIndex,r.filter,r.layers,r.availableImages,t);for(const t in n){const e=a[t]=a[t]||[],r=n[t];r.sort(((t,e)=>{const n=i.featureSortOrder;if(n){const i=n.indexOf(t.featureIndex);return n.indexOf(e.featureIndex)-i}return e.featureIndex-t.featureIndex}));for(const t of r)e.push(t)}}for(const e in a)a[e].forEach((n=>{const r=n.feature,o=i(t[e]).getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=o}));return a}(this._layers,this._serializedLayers,this._getLayerSourceCache.bind(this),a.screenGeometry,i,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(o)}querySourceFeatures(e,i){i&&i.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",i.filter,null,i);const n=this._getSourceCaches(e);let r=[];for(const t of n)r=r.concat(Ct(t,i));return r}addSourceType(t,e,i){return Ue.getSourceType(t)?i(new Error(`A source type called "${t}" already exists.`)):(Ue.setSourceType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},i):i(null,null))}getLight(){return this.light.getLight()}setLight(e,i={}){this._checkLoaded();const n=this.light.getLight();let o=!1;for(const t in e)if(!r(e[t],n[t])){o=!0;break}if(!o)return;const s={now:t.exported.now(),transition:t.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,i),this.light.updateTransitions(s)}getTerrain(){return this.terrain?this.terrain.get():null}setTerrain(e){if(this._checkLoaded(),!e)return delete this.terrain,delete this.stylesheet.terrain,this.dispatcher.broadcast("enableTerrain",!1),this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);if("object"==typeof e.source){const i="terrain-dem-src";this.addSource(i,e.source),e=t.clone$2(e),e=t.extend(e,{source:i})}if(!this._validate(t.validateStyle.terrain,"terrain",e)){if(this.terrain){const i=this.terrain,n=i.get();for(const o in e)if(!r(e[o],n[o])){i.set(e),this.stylesheet.terrain=e;const n={now:t.exported.now(),transition:t.extend({duration:0},this.stylesheet.transition)};i.updateTransitions(n);break}}else this._createTerrain(e);this._updateDrapeFirstLayers(),this._markersNeedUpdate=!0}}_createFog(e){const i=this.fog=new T(e);this.stylesheet.fog=e;const n={now:t.exported.now(),transition:t.extend({duration:0},this.stylesheet.transition)};i.updateTransitions(n)}_updateMarkersOpacity(){0!==this.map._markers.length&&this.map._requestDomTask((()=>{for(const t of this.map._markers)t._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 i=this.fog,n=i.get();for(const o in e)if(!r(e[o],n[o])){i.set(e),this.stylesheet.fog=e;const n={now:t.exported.now(),transition:t.extend({duration:0},this.stylesheet.transition)};i.updateTransitions(n);break}}else this._createFog(e);this._markersNeedUpdate=!0}_updateDrapeFirstLayers(){if(!this.map._optimizeForTerrain||!this.terrain)return;const t=this._order.filter((t=>this.isLayerDraped(this._layers[t]))),e=this._order.filter((t=>!this.isLayerDraped(this._layers[t])));this._drapedFirstOrder=[],this._drapedFirstOrder.push(...t),this._drapedFirstOrder.push(...e)}_createTerrain(e){const i=this.terrain=new w(e);this.stylesheet.terrain=e,this.dispatcher.broadcast("enableTerrain",!0),this._force3DLayerUpdate();const n={now:t.exported.now(),transition:t.extend({duration:0},this.stylesheet.transition)};i.updateTransitions(n)}_force3DLayerUpdate(){for(const t in this._layers){const e=this._layers[t];"fill-extrusion"===e.type&&this._updateLayer(e)}}_validate(e,i,n,r,o={}){return(!o||!1!==o.validate)&&Ne(this,e.call(t.validateStyle,t.extend({key:i,style:this.serialize(),value:n,styleSpec:t.spec},r)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),t.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(const t in this._layers)this._layers[t].setEventedParent(null);for(const t in this._sourceCaches)this._sourceCaches[t].clearTiles(),this._sourceCaches[t].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}_clearSource(t){const e=this._getSourceCaches(t);for(const t of e)t.clearTiles()}_reloadSource(t){const e=this._getSourceCaches(t);for(const t of e)t.resume(),t.reload()}_updateSources(t){for(const e in this._sourceCaches)this._sourceCaches[e].update(t)}_generateCollisionBoxes(){for(const t in this._sourceCaches){const e=this._sourceCaches[t];e.resume(),e.reload()}}_updatePlacement(e,i,n,r,o=!1){let s=!1,a=!1;const l={};for(const t of this._order){const i=this._layers[t];if("symbol"!==i.type)continue;if(!l[i.source]){const t=this._getLayerSourceCache(i);if(!t)continue;l[i.source]=t.getRenderableIds(!0).map((e=>t.getTileByID(e))).sort(((t,e)=>e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)))}const n=this.crossTileSymbolIndex.addLayer(i,l[i.source],e.center.lng);s=s||n}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),o=o||this._layerOrderChanged||0===n,this._layerOrderChanged&&this.fire(new t.Event("neworder")),(o||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.exported.now(),e.zoom))&&(this.pauseablePlacement=new Pe(e,this._order,o,i,n,r,this.placement,this.fog?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(t.exported.now()),a=!0),s&&this.pauseablePlacement.placement.setStale()),a||s)for(const t of this._order){const e=this._layers[t];"symbol"===e.type&&this.placement.updateLayerOpacities(e,l[e.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(t.exported.now())}_releaseSymbolFadeTiles(){for(const t in this._sourceCaches)this._sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,e,i){this.imageManager.getImages(e.icons,i),this._updateTilesForChangedImages();const n=t=>{t&&t.setDependencies(e.tileID.key,e.type,e.icons)};n(this._otherSourceCaches[e.source]),n(this._symbolSourceCaches[e.source])}getGlyphs(t,e,i){this.glyphManager.getGlyphs(e.stacks,i)}getResource(e,i,n){return t.makeRequest(i,n)}_getSourceCache(t){return this._otherSourceCaches[t]}_getLayerSourceCache(t){return"symbol"===t.type?this._symbolSourceCaches[t.source]:this._otherSourceCaches[t.source]}_getSourceCaches(t){const e=[];return this._otherSourceCaches[t]&&e.push(this._otherSourceCaches[t]),this._symbolSourceCaches[t]&&e.push(this._symbolSourceCaches[t]),e}has3DLayers(){return this._num3DLayers>0}hasSymbolLayers(){return this._numSymbolLayers>0}hasCircleLayers(){return this._numCircleLayers>0}}Ue.getSourceType=function(t){return St[t]},Ue.setSourceType=function(t,e){St[t]=e},Ue.registerForPluginStateChange=t.registerForPluginStateChange;var Ge="\n#define EPSILON 0.0000001\n#define PI 3.141592653589793\n#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;varying vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}\n#endif",je="attribute highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;varying highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}";let He={},We={};He=Ye("","\n#define ELEVATION_SCALE 7.0\n#define ELEVATION_OFFSET 450.0\n#ifdef TERRAIN\nuniform sampler2D u_dem;uniform sampler2D u_dem_prev;uniform 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) {float 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);}float prevElevation(vec2 apos) {float 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#ifdef TERRAIN_VERTEX_MORPHING\nfloat elevation(vec2 apos) {float nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);}\n#else\nfloat elevation(vec2 apos) {return currentElevation(apos);}\n#endif\nfloat unpack_depth(vec4 rgba_depth)\n{const vec4 bit_shift=vec4(1.0/(256.0*256.0*256.0),1.0/(256.0*256.0),1.0/256.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}bool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;float depth=unpack_depth(texture2D(u_depth,(coord.xy+1.0)*0.5));return coord.z > depth+0.0005;}float occlusionFade(vec4 frag) {vec3 coord=frag.xyz/frag.w;vec3 df=vec3(5.0*u_depth_size_inv,0.0);vec2 uv=0.5*coord.xy+0.5;vec4 depth=vec4(\nunpack_depth(texture2D(u_depth,uv-df.xz)),unpack_depth(texture2D(u_depth,uv+df.xz)),unpack_depth(texture2D(u_depth,uv-df.zy)),unpack_depth(texture2D(u_depth,uv+df.zy))\n);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z-0.001)-depth),0.0,1.0));}vec4 fourSample(vec2 pos,vec2 off) {vec4 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);return vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;vec4 bounds=vec4(d,vec2(1.0)-d);h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);}\n#else\nfloat elevation(vec2 pos) { return 0.0; }bool isOccluded(vec4 frag) { return false; }float occlusionFade(vec4 frag) { return 1.0; }\n#endif",!0),We=Ye("#ifdef FOG\nuniform float u_fog_temporal_offset;float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);return mix(color,u_fog_color.rgb,opacity);}vec3 fog_apply_from_vert(vec3 color,float fog_opac) {return mix(color,u_fog_color.rgb,fog_opac);}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/=alpha;color.rgb=fog_apply(color.rgb,pos);color.rgb*=alpha;return color;}vec3 fog_dither(vec3 color) {vec2 dither_seed=gl_FragCoord.xy+u_fog_temporal_offset;return dither(color,dither_seed);}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);}\n#endif","#ifdef FOG\nuniform mat4 u_fog_matrix;vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);}\n#endif",!0);const qe=Ye("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\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;}","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\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."),Xe=Ge;var Ze={background:Ye("uniform vec4 u_color;uniform float u_opacity;void main() {vec4 out_color=u_color;\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),backgroundPattern:Ye("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 out_color=mix(color1,color2,u_mix);\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),circle:Ye("varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(\nantialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)\n);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef FOG\nout_color=fog_apply_premultiplied(out_color,v_fog_pos);\n#endif\ngl_FragColor=out_color*(v_visibility*opacity_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","#define NUM_VISIBILITY_RINGS 2\n#define INV_SQRT2 0.70710678\n#define ELEVATION_BIAS 0.0001\n#define NUM_SAMPLES_PER_RING 16\nuniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility;\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) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale);\n#ifdef PITCH_WITH_MAP\nreturn u_matrix*( world_center+vec4(sample_offset,0,0) );\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);float height=circle_elevation(circle_center);vec4 world_center=vec4(circle_center,height,1);vec4 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);float visibility=0.0;\n#ifdef TERRAIN\nfloat step=get_sample_step();\n#ifdef PITCH_WITH_MAP\nfloat cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);vec4 occlusion_world_center=vec4(circle_center,cantilevered_height,1);vec4 occlusion_projected_center=u_matrix*occlusion_world_center;\n#else\nvec4 occlusion_world_center=world_center;vec4 occlusion_projected_center=projected_center;\n#endif\nfor(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING);\n#else\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:Ye("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:Ye("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef FOG\ngl_FragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying 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;vec3 pos=vec3(floor(a_pos*0.5)+extrude,elevation(floor(a_pos*0.5)));gl_Position=u_matrix*vec4(pos,1);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),heatmapTexture:Ye("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:Ye("varying float v_placed;varying float v_notUsed;void main() {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 vec2 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_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=u_matrix*vec4(a_pos,elevation(a_pos),1.0);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:Ye("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos_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:Ye("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1);}"),fill:Ye("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\nvec4 out_color=color;\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillOutline:Ye("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color;\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillOutlinePattern:Ye("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=mix(color1,color2,u_fade);\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillPattern:Ye("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 out_color=mix(color1,color2,u_fade);\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillExtrusion:Ye("varying vec4 v_color;void main() {vec4 color=v_color;\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_FragColor=color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 pos_nx=floor(a_pos_normal_ed.xyz*0.5);mediump vec3 top_up_ny=a_pos_normal_ed.xyz-2.0*pos_nx;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;\n#ifdef TERRAIN\nvec2 centroid_pos=a_centroid_pos;bool flat_roof=centroid_pos.x !=0.0;float ele=elevation(pos_nx.xy);float hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);float c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;float h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);vec3 pos=vec3(pos_nx.xy,h);gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);\n#else\nvec3 pos=vec3(pos_nx.xy,t > 0.0 ? height : base);gl_Position=u_matrix*vec4(pos,1);\n#endif\nfloat colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.rgb+=clamp(color.rgb*directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_color*=u_opacity;\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),fillExtrusionPattern:Ye("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 out_color=mix(color1,color2,u_fade);out_color=out_color*v_lighting;\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 pos_nx=floor(a_pos_normal_ed.xyz*0.5);mediump vec3 top_up_ny=a_pos_normal_ed.xyz-2.0*pos_nx;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;\n#ifdef TERRAIN\nvec2 centroid_pos=a_centroid_pos;bool flat_roof=centroid_pos.x !=0.0;float ele=elevation(pos_nx.xy);float hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);float c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;float h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);vec3 p=vec3(pos_nx.xy,h);gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);\n#else\nvec3 p=vec3(pos_nx.xy,z);gl_Position=u_matrix*vec4(p,1);\n#endif\nvec2 pos=normal.z==1.0\n? pos_nx.xy\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;\n#ifdef FOG\nv_fog_pos=fog_position(p);\n#endif\n}"),hillshadePrepare:Ye("#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,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2(\n(c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c)\n)/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(\nderiv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:Ye("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef FOG\ngl_FragColor=fog_dither(fog_apply_premultiplied(gl_FragColor,v_fog_pos));\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),line:Ye("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 out_color=color;\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\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_width2=vec2(outset,inset);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),lineGradient:Ye("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);\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_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\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_width2=vec2(outset,inset);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),linePattern:Ye("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_linesofar;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,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}"),lineSDF:Ye("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_mix;uniform vec3 u_scale;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash_from\n#pragma mapbox: define lowp vec4 dash_to\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 dash_from\n#pragma mapbox: initialize mediump vec4 dash_to\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);float sdfwidth=min(dash_from.z*u_scale.y,dash_to.z*u_scale.z);float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/sdfwidth;alpha*=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);vec4 out_color=color;\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define EXTRUDE_SCALE 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_linesofar;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform vec2 u_texsize;uniform mediump vec3 u_scale;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash_from\n#pragma mapbox: define lowp vec4 dash_to\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 dash_from\n#pragma mapbox: initialize mediump vec4 dash_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*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_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,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\nfloat tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;float widthA=dash_from.z*fromScale;float widthB=dash_to.z*toScale;float heightA=dash_from.y;float heightB=dash_to.y;v_tex_a=vec2(a_linesofar*(tileZoomRatio/widthA)/floorwidth,(-normal.y*heightA+dash_from.x+0.5)/u_texsize.y);v_tex_b=vec2(a_linesofar*(tileZoomRatio/widthB)/floorwidth,(-normal.y*heightB+dash_to.x+0.5)/u_texsize.y);v_width2=vec2(outset,inset);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),raster:Ye("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(\ndot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);vec3 out_color=mix(u_high_vec,u_low_vec,rgb);\n#ifdef FOG\nout_color=fog_dither(fog_apply(out_color,v_fog_pos));\n#endif\ngl_FragColor=vec4(out_color*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),symbolIcon:Ye("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_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}float h=elevation(a_pos);vec4 projectedPoint=u_matrix*vec4(a_pos,h,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),h,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h,1.0);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0);\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\nfloat occlusion_fade=occlusionFade(projectedPoint);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projectedPoint.w <=0.0 || occlusion_fade==0.0));v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));}"),symbolSDF:Ye("#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_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}float h=elevation(a_pos);vec4 projectedPoint=u_matrix*vec4(a_pos,h,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),h,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h,1.0);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset);\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\nfloat occlusion_fade=occlusionFade(projectedPoint);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projectedPoint.w <=0.0 || occlusion_fade==0.0));float gamma_scale=gl_Position.w;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));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),symbolTextAndIcon:Ye("#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_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}float h=elevation(a_pos);vec4 projectedPoint=u_matrix*vec4(a_pos,h,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),h,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h,1.0);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*fontScale);\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\nfloat occlusion_fade=occlusionFade(projectedPoint);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projectedPoint.w <=0.0 || occlusion_fade==0.0));float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}"),terrainRaster:Ye("uniform sampler2D u_image0;varying vec2 v_pos0;\n#ifdef FOG\nvarying float v_fog_opacity;\n#endif\nvoid main() {vec4 color=texture2D(u_image0,v_pos0);\n#ifdef FOG\ncolor.rgb=fog_dither(fog_apply_from_vert(color.rgb,v_fog_opacity));\n#endif\ngl_FragColor=color;\n#ifdef TERRAIN_WIREFRAME\ngl_FragColor=vec4(1.0,0.0,0.0,0.8);\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_skirt_height;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;\n#ifdef FOG\nvarying float v_fog_opacity;\n#endif\nconst float skirtOffset=24575.0;const float wireframeOffset=0.00015;void main() {v_pos0=a_texture_pos/8192.0;float skirt=float(a_pos.x >=skirtOffset);float elevation=elevation(a_texture_pos)-skirt*u_skirt_height;\n#ifdef TERRAIN_WIREFRAME\nelevation+=u_skirt_height*u_skirt_height*wireframeOffset;\n#endif\nvec2 decodedPos=a_pos-vec2(skirt*skirtOffset,0.0);gl_Position=u_matrix*vec4(decodedPos,elevation,1.0);\n#ifdef FOG\nv_fog_opacity=fog(fog_position(vec3(decodedPos,elevation)));\n#endif\n}"),terrainDepth:Ye("#ifdef GL_ES\nprecision highp float;\n#endif\nvec4 pack_depth(float ndc_z) {float depth=ndc_z*0.5+0.5;const vec4 bit_shift=vec4(256.0*256.0*256.0,256.0*256.0,256.0,1.0);const vec4 bit_mask =vec4(0.0,1.0/256.0,1.0/256.0,1.0/256.0);vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}varying float v_depth;void main() {gl_FragColor=pack_depth(v_depth);}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying float v_depth;void main() {float elevation=elevation(a_texture_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}"),skybox:Ye("\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}",je),skyboxGradient:Ye("varying highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform lowp 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}",je),skyboxCapture:Ye("\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);}")};function Ye(t,e,i){const n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r=/uniform (highp |mediump |lowp )?([\w]+) ([\w]+)([\s]*)([\w]*)/g,o=e.match(/attribute (highp |mediump |lowp )?([\w]+) ([\w]+)/g),s=t.match(r),a=e.match(r),l=Ge.match(r);let c=a?a.concat(s):s;i||(He.staticUniforms&&(c=He.staticUniforms.concat(c)),We.staticUniforms&&(c=We.staticUniforms.concat(c))),c&&(c=c.concat(l));const u={};return{fragmentSource:t=t.replace(n,((t,e,i,n,r)=>(u[r]=!0,"define"===e?`\n#ifndef HAS_UNIFORM_u_${r}\nvarying ${i} ${n} ${r};\n#else\nuniform ${i} ${n} u_${r};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${r}\n ${i} ${n} ${r} = u_${r};\n#endif\n`))),vertexSource:e=e.replace(n,((t,e,i,n,r)=>{const o="float"===n?"vec2":"vec4",s=r.match(/color/)?"color":o;return u[r]?"define"===e?`\n#ifndef HAS_UNIFORM_u_${r}\nuniform lowp float u_${r}_t;\nattribute ${i} ${o} a_${r};\nvarying ${i} ${n} ${r};\n#else\nuniform ${i} ${n} u_${r};\n#endif\n`:"vec4"===s?`\n#ifndef HAS_UNIFORM_u_${r}\n ${r} = a_${r};\n#else\n ${i} ${n} ${r} = u_${r};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${r}\n ${r} = unpack_mix_${s}(a_${r}, u_${r}_t);\n#else\n ${i} ${n} ${r} = u_${r};\n#endif\n`:"define"===e?`\n#ifndef HAS_UNIFORM_u_${r}\nuniform lowp float u_${r}_t;\nattribute ${i} ${o} a_${r};\n#else\nuniform ${i} ${n} u_${r};\n#endif\n`:"vec4"===s?`\n#ifndef HAS_UNIFORM_u_${r}\n ${i} ${n} ${r} = a_${r};\n#else\n ${i} ${n} ${r} = u_${r};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${r}\n ${i} ${n} ${r} = unpack_mix_${s}(a_${r}, u_${r}_t);\n#else\n ${i} ${n} ${r} = u_${r};\n#endif\n`})),staticAttributes:o,staticUniforms:c}}class Qe{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,e,i,n,r,o,s,a){this.context=t;let l=this.boundPaintVertexBuffers.length!==n.length;for(let t=0;!l&&t<n.length;t++)this.boundPaintVertexBuffers[t]!==n[t]&&(l=!0);t.extVertexArrayObject&&this.vao&&this.boundProgram===e&&this.boundLayoutVertexBuffer===i&&!l&&this.boundIndexBuffer===r&&this.boundVertexOffset===o&&this.boundDynamicVertexBuffer===s&&this.boundDynamicVertexBuffer2===a?(t.bindVertexArrayOES.set(this.vao),s&&s.bind(),r&&r.dynamicDraw&&r.bind(),a&&a.bind()):this.freshBind(e,i,n,r,o,s,a)}freshBind(t,e,i,n,r,o,s){let a;const l=t.numAttributes,c=this.context,u=c.gl;if(c.extVertexArrayObject)this.vao&&this.destroy(),this.vao=c.extVertexArrayObject.createVertexArrayOES(),c.bindVertexArrayOES.set(this.vao),a=0,this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=i,this.boundIndexBuffer=n,this.boundVertexOffset=r,this.boundDynamicVertexBuffer=o,this.boundDynamicVertexBuffer2=s;else{a=c.currentNumAttributes||0;for(let t=l;t<a;t++)u.disableVertexAttribArray(t)}e.enableAttributes(u,t);for(const e of i)e.enableAttributes(u,t);o&&o.enableAttributes(u,t),s&&s.enableAttributes(u,t),e.bind(),e.setVertexAttribPointers(u,t,r);for(const e of i)e.bind(),e.setVertexAttribPointers(u,t,r);o&&(o.bind(),o.setVertexAttribPointers(u,t,r)),n&&n.bind(),s&&(s.bind(),s.setVertexAttribPointers(u,t,r)),c.currentNumAttributes=l}destroy(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)}}function Je(e,i){const n=Math.pow(2,i.canonical.z),r=i.canonical.y;return[new t.MercatorCoordinate(0,r/n).toLngLat().lat,new t.MercatorCoordinate(0,(r+1)/n).toLngLat().lat]}function Ke(e,i,n,r,o,s,a){const l=e.context,c=l.gl,u=n.fbo;if(!u)return;e.prepareDrawTile(i);const h=e.useProgram("hillshade");l.activeTexture.set(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,u.colorAttachment.get());const p=((t,e,i,n)=>{const r=i.paint.get("hillshade-shadow-color"),o=i.paint.get("hillshade-highlight-color"),s=i.paint.get("hillshade-accent-color");let a=i.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===i.paint.get("hillshade-illumination-anchor")&&(a-=t.transform.angle);const l=!t.options.moving;return{u_matrix:n||t.transform.calculateProjMatrix(e.tileID.toUnwrapped(),l),u_image:0,u_latrange:Je(0,e.tileID),u_light:[i.paint.get("hillshade-exaggeration"),a],u_shadow:r,u_highlight:o,u_accent:s}})(e,n,r,e.terrain?i.projMatrix:null);e.prepareDrawProgram(l,h,i.toUnwrapped()),h.draw(l,c.TRIANGLES,o,s,a,t.CullFaceMode.disabled,p,r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}function $e(e,i,n){if(!i.needsDEMTextureUpload)return;const r=e.context,o=r.gl;r.pixelStoreUnpackPremultiplyAlpha.set(!1),i.demTexture=i.demTexture||e.getTileTexture(n.stride);const s=n.getPixels();i.demTexture?i.demTexture.update(s,{premultiply:!1}):i.demTexture=new t.Texture(r,s,o.RGBA,{premultiply:!1}),i.needsDEMTextureUpload=!1}function ti(e,i,n,r,o,s){const a=e.context,l=a.gl;if(!i.dem)return;const c=i.dem;if(a.activeTexture.set(l.TEXTURE1),$e(e,i,c),!i.demTexture)return;i.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);const u=c.dim;a.activeTexture.set(l.TEXTURE0);let h=i.fbo;if(!h){const e=new t.Texture(a,{width:u,height:u,data:null},l.RGBA);e.bind(l.LINEAR,l.CLAMP_TO_EDGE),h=i.fbo=a.createFramebuffer(u,u,!0),h.colorAttachment.set(e.texture)}a.bindFramebuffer.set(h.framebuffer),a.viewport.set([0,0,u,u]),e.useProgram("hillshadePrepare").draw(a,l.TRIANGLES,r,o,s,t.CullFaceMode.disabled,((e,i)=>{const n=i.stride,r=t.create$1();return t.ortho(r,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(r,r,[0,-t.EXTENT,0]),{u_matrix:r,u_image:1,u_dimension:[n,n],u_zoom:e.overscaledZ,u_unpack:i.unpackVector}})(i.tileID,c),n.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),i.needsHillshadePrepare=!1}const ei=(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image0:new t.Uniform1i(e,i.u_image0),u_skirt_height:new t.Uniform1f(e,i.u_skirt_height)}),ii=(t,e)=>({u_matrix:t,u_image0:0,u_skirt_height:e}),ni=new class{constructor(){this.operations={}}newMorphing(t,e,i,n,r){if(t in this.operations){const e=this.operations[t];e.to.tileID.key!==i.tileID.key&&(e.queued=i)}else this.operations[t]={startTime:n,phase:0,duration:r,from:e,to:i,queued:null}}getMorphValuesForProxy(t){if(!(t in this.operations))return null;const e=this.operations[t];return{from:e.from,to:e.to,phase:e.phase}}update(t){for(const e in this.operations){const i=this.operations[e];for(i.phase=(t-i.startTime)/i.duration;i.phase>=1||!this._validOp(i);)if(!this._nextOp(i,t)){delete this.operations[e];break}}}_nextOp(t,e){return!!t.queued&&(t.from=t.to,t.to=t.queued,t.queued=null,t.phase=0,t.startTime=e,!0)}_validOp(t){return t.from.hasData()&&t.to.hasData()}},ri={0:null,1:"TERRAIN_VERTEX_MORPHING",2:"TERRAIN_WIREFRAME"};function oi(e,i,n,r,o){const s=e.context,a=s.gl;let l,c;const u=e.options.showTerrainWireframe?2:0,h=(t,i)=>{if(c===t)return;const n=[ri[t]];i&&n.push(ri[u]),l=e.useProgram("terrainRaster",null,n),c=t},p=e.colorModeForRenderPass(),d=new t.DepthMode(a.LEQUAL,t.DepthMode.ReadWrite,e.depthRangeFor3D);ni.update(o);const f=e.transform,m=6*Math.pow(1.5,22-f.zoom)*i.exaggeration();(u?[!1,!0]:[!1]).forEach((u=>{c=-1;const g=u?a.LINES:a.TRIANGLES,[y,v]=u?i.getWirefameBuffer():[i.gridIndexBuffer,i.gridSegments];for(const c of r){const r=n.getTile(c),b=t.StencilMode.disabled,w=i.prevTerrainTileForTile[c.key],A=i.terrainTileForTile[c.key];x=A,null!=(_=w)&&null!=x&&_.hasData()&&x.hasData()&&null!=_.demTexture&&null!=x.demTexture&&_.tileID.key!==x.tileID.key&&ni.newMorphing(c.key,w,A,o,250),s.activeTexture.set(a.TEXTURE0),r.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST);const E=ni.getMorphValuesForProxy(c.key),S=E?1:0;let M;E&&(M={morphing:{srcDemTile:E.from,dstDemTile:E.to,phase:t.easeCubicInOut(E.phase)}});const T=ii(c.projMatrix,si(c.canonical,f.renderWorldCopies)?m/10:m);h(S,u),i.setupElevationDraw(r,l,M),e.prepareDrawProgram(s,l,c.toUnwrapped()),l.draw(s,g,d,b,p,t.CullFaceMode.backCCW,T,"terrain_raster",i.gridBuffer,y,v)}var _,x}))}function si(t,e){const i=1<<t.z;return!e&&(0===t.x||t.x===i-1)||0===t.y||t.y===i-1}const ai=t=>({u_matrix:t});function li(e,i,n,r,o){if(o>0){const s=t.exported.now(),a=(s-e.timeAdded)/o,l=i?(s-i.timeAdded)/o:-1,c=n.getSource(),u=r.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),h=!i||Math.abs(i.tileID.overscaledZ-u)>Math.abs(e.tileID.overscaledZ-u),p=h&&e.refreshedUponExpiration?1:t.clamp(h?a:1-l,0,1);return e.refreshedUponExpiration&&a>=1&&(e.refreshedUponExpiration=!1),i?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}class ci extends t.SourceCache{constructor(t){const e=Mt("proxy",{type:"geojson",maxzoom:t.transform.maxZoom},new I(kt(),null),t.style);super("proxy",e,!1),e.setEventedParent(this),this.map=this.getSource().map=t,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(e,i,n){if(e.freezeTileCoverage)return;this.transform=e;const r=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,useElevationData:!0}).reduce(((i,n)=>{if(i[n.key]="",!this._tiles[n.key]){const i=new t.Tile(n,this._source.tileSize*n.overscaleFactor(),e.tileZoom);i.state="loaded",this._tiles[n.key]=i}return i}),{});for(const t in this._tiles)t in r||(this.freeFBO(t),this._tiles[t].state="unloaded",delete this._tiles[t])}freeFBO(t){const e=this.proxyCachedFBO[t];if(void 0!==e){const i=Object.values(e);this.renderCachePool.push(...i),delete this.proxyCachedFBO[t]}}deallocRenderCache(){this.renderCache.forEach((t=>t.fb.destroy())),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class ui extends t.OverscaledTileID{constructor(t,e,i){super(t.overscaledZ,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y),this.proxyTileKey=e,this.projMatrix=i}}class hi extends t.Elevation{constructor(e,i){super(),this.painter=e,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[n,r,o]=function(e){const i=new t.StructArrayLayout4i8,n=new t.StructArrayLayout3ui6,r=131;i.reserve(17161),n.reserve(33800);const o=t.EXTENT/128,s=t.EXTENT+o/2,a=s+o;for(let e=-o;e<a;e+=o)for(let n=-o;n<a;n+=o){const r=n<0||n>s||e<0||e>s?24575:0,o=t.clamp(Math.round(n),0,t.EXTENT),a=t.clamp(Math.round(e),0,t.EXTENT);i.emplaceBack(o+r,a,o,a)}const l=(t,e)=>{const i=e*r+t;n.emplaceBack(i+1,i,i+r),n.emplaceBack(i+r,i+r+1,i+1)};for(let t=1;t<129;t++)for(let e=1;e<129;e++)l(e,t);return[0,129].forEach((t=>{for(let e=0;e<130;e++)l(e,t),l(t,e)})),[i,n,32768]}(),s=e.context;this.gridBuffer=s.createVertexBuffer(n,At.members),this.gridIndexBuffer=s.createIndexBuffer(r),this.gridSegments=t.SegmentVector.simpleSegment(0,0,n.length,r.length),this.gridNoSkirtSegments=t.SegmentVector.simpleSegment(0,0,n.length,o),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new ci(i.map),this.orthoMatrix=t.create$1(),t.ortho(this.orthoMatrix,0,t.EXTENT,0,t.EXTENT,0,1);const a=s.gl;this._overlapStencilMode=new t.StencilMode({func:a.GEQUAL,mask:255},0,255,a.KEEP,a.KEEP,a.REPLACE),this._previousZoom=e.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=i,this._useVertexMorphing=!0,this._exaggeration=1}set style(t){t.on("data",this._onStyleDataEvent.bind(this)),t.on("neworder",this._checkRenderCacheEfficiency.bind(this)),this._style=t,this._checkRenderCacheEfficiency()}update(e,i,n){if(e&&e.terrain){this._style!==e&&(this.style=e),this.enabled=!0;const r=e.terrain.properties;this.sourceCache=e._getSourceCache(r.get("source")),this._exaggeration=r.get("exaggeration");const o=()=>{this.sourceCache.used&&t.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 e=this.sourceCache.getSource().tileSize/128,n=this.proxySourceCache.getSource().tileSize;this.sourceCache.update(i,e*n,!0),this._findCoveringTileCache[this.sourceCache.id]={}};this.sourceCache.usedForTerrain||(this._findCoveringTileCache[this.sourceCache.id]={},this.sourceCache.usedForTerrain=!0,o(),this._initializing=!0),o(),i.updateElevation(!n),this._findCoveringTileCache[this.proxySourceCache.id]={},this.proxySourceCache.update(i),this._emptyDEMTextureDirty=!0}else this._disable()}_checkRenderCacheEfficiency(){const e=this.renderCacheEfficiency(this._style);this._style.map._optimizeForTerrain||100!==e.efficiency&&t.warnOnce(`Terrain render cache efficiency is not optimal (${e.efficiency}%) and performance\n may be affected negatively, consider placing all background, fill and line layers before layer\n with id '${e.firstUndrapedLayer}' or create a map using optimizeForTerrain: true option.`)}_onStyleDataEvent(t){t.coord&&"source"===t.dataType?this._clearRenderCacheForTile(t.sourceCacheId,t.coord):"style"===t.dataType&&(this._invalidateRenderCache=!0)}_disable(){if(this.enabled&&(this.enabled=!1,this._sharedDepthStencil=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const t in this._style._sourceCaches)this._style._sourceCaches[t].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this.pool.forEach((t=>t.fb.destroy())),this.pool=[],this._depthFBO&&(this._depthFBO.destroy(),delete this._depthFBO,delete this._depthTexture)}_source(){return this.enabled?this.sourceCache:null}exaggeration(){return this._exaggeration}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const t=2*this.proxySourceCache.getSource().tileSize;return[t,t]}set useVertexMorphing(t){this._useVertexMorphing=t}updateTileBinding(e){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const i=this.proxySourceCache,n=this.painter.transform;this._initializing&&(this._initializing=0===n._centerAltitude&&-1===this.getAtPointOrZero(t.MercatorCoordinate.fromLngLat(n.center),-1),this._emptyDEMTextureDirty=!this._initializing);const r=this.painter.options;this.renderCached=(r.zooming||r.moving||r.rotating||!!this.forceRenderCached)&&!this._invalidateRenderCache,this._invalidateRenderCache=!1;const o=this.proxyCoords=i.getIds().map((t=>{const e=i.getTileByID(t).tileID;return e.projMatrix=n.calculateProjMatrix(e.toUnwrapped()),e}));!function(e,i){const n=i.transform.pointCoordinate(i.transform.getCameraPoint()),r=new t.pointGeometry(n.x,n.y);e.sort(((e,i)=>{if(i.overscaledZ-e.overscaledZ)return i.overscaledZ-e.overscaledZ;const n=new t.pointGeometry(e.canonical.x+(1<<e.canonical.z)*e.wrap,e.canonical.y),o=new t.pointGeometry(i.canonical.x+(1<<i.canonical.z)*i.wrap,i.canonical.y),s=r.mult(1<<e.canonical.z);return s.x-=.5,s.y-=.5,s.distSqr(n)-s.distSqr(o)}))}(o,this.painter),this._previousZoom=n.zoom;const s=this.proxyToSource||{};this.proxyToSource={},o.forEach((t=>{this.proxyToSource[t.key]={}})),this.terrainTileForTile={};const a=this._style._sourceCaches;for(const t in a){const i=a[t];if(!i.used)continue;if(i!==this.sourceCache&&(this._findCoveringTileCache[i.id]={}),this._setupProxiedCoordsForOrtho(i,e[t],s),i.usedForTerrain)continue;const n=e[t];i.getSource().reparseOverscaled&&this._assignTerrainTiles(n)}this.proxiedCoords[i.id]=o.map((t=>new ui(t,t.key,this.orthoMatrix))),this._assignTerrainTiles(o),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(s),this.renderingToTexture=!1,this._updateTimestamp=t.exported.now();const l={};this._visibleDemTiles=[];for(const t of this.proxyCoords){const e=this.terrainTileForTile[t.key];if(!e)continue;const i=e.tileID.key;i in l||(this._visibleDemTiles.push(e),l[i]=i)}}_assignTerrainTiles(t){this._initializing||t.forEach((t=>{if(this.terrainTileForTile[t.key])return;const e=this._findTileCoveringTileID(t,this.sourceCache);e&&(this.terrainTileForTile[t.key]=e)}))}_prepareDEMTextures(){const t=this.painter.context,e=t.gl;for(const i in this.terrainTileForTile){const n=this.terrainTileForTile[i],r=n.dem;!r||n.demTexture&&!n.needsDEMTextureUpload||(t.activeTexture.set(e.TEXTURE1),$e(this.painter,n,r))}}_prepareDemTileUniforms(t,e,i,n){if(!e||null==e.demTexture)return!1;const r=t.tileID.canonical,o=Math.pow(2,e.tileID.canonical.z-r.z),s=n||"";return i[`u_dem_tl${s}`]=[r.x*o%1,r.y*o%1],i[`u_dem_scale${s}`]=o,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}_getLoadedAreaMinimum(){let t=0;const e=this._visibleDemTiles.reduce(((e,i)=>{if(!i.dem)return e;const n=i.dem.tree.minimums[0];return n>0&&t++,e+n}),0);return t?e/t:0}_updateEmptyDEMTexture(){const e=this.painter.context,i=e.gl;e.activeTexture.set(i.TEXTURE2);const n=this._getLoadedAreaMinimum(),r={width:1,height:1,data:new Uint8Array(t.DEMData.pack(n,this.sourceCache.getSource().encoding))};this._emptyDEMTextureDirty=!1;let o=this._emptyDEMTexture;return o?o.update(r,{premultiply:!1}):o=this._emptyDEMTexture=new t.Texture(e,r,i.RGBA,{premultiply:!1}),o}setupElevationDraw(e,i,n){const r=this.painter.context,o=r.gl,s=(a=this.sourceCache.getSource().encoding,{u_dem:2,u_dem_prev:4,u_dem_unpack:t.DEMData.getUnpackVector(a),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 a;s.u_dem_size=this.sourceCache.getSource().tileSize,s.u_exaggeration=this.exaggeration();let l=null,c=null,u=1;if(n&&n.morphing&&this._useVertexMorphing){const t=n.morphing.srcDemTile,i=n.morphing.dstDemTile;u=n.morphing.phase,t&&i&&(this._prepareDemTileUniforms(e,t,s,"_prev")&&(c=t),this._prepareDemTileUniforms(e,i,s)&&(l=i))}if(c&&l?(r.activeTexture.set(o.TEXTURE2),l.demTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE,o.NEAREST),r.activeTexture.set(o.TEXTURE4),c.demTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE,o.NEAREST),s.u_dem_lerp=u):(l=this.terrainTileForTile[e.tileID.key],r.activeTexture.set(o.TEXTURE2),(this._prepareDemTileUniforms(e,l,s)?l.demTexture:this.emptyDEMTexture).bind(o.NEAREST,o.CLAMP_TO_EDGE,o.NEAREST)),n&&n.useDepthForOcclusion&&(r.activeTexture.set(o.TEXTURE3),this._depthTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE,o.NEAREST),s.u_depth_size_inv=[1/this._depthFBO.width,1/this._depthFBO.height]),n&&n.useMeterToDem&&l){const e=(1<<l.tileID.canonical.z)*t.mercatorZfromAltitude(1,this.painter.transform.center.lat)*this.sourceCache.getSource().tileSize;s.u_meter_to_dem=e}n&&n.labelPlaneMatrixInv&&(s.u_label_plane_matrix_inv=n.labelPlaneMatrixInv),i.setTerrainUniformValues(r,s)}renderBatch(e){if(0===this._drapedRenderBatches.length)return e+1;this.renderingToTexture=!0;const i=this.painter,n=this.painter.context,r=this.proxySourceCache,o=this.proxiedCoords[r.id],s=()=>{n.bindFramebuffer.set(null),n.viewport.set([0,0,i.width,i.height]),this.renderingToTexture=!1},a=this._drapedRenderBatches.shift();let l=[];const c=i.style.order;let u=0;for(let h=0;h<o.length;h++){const p=o[h],d=r.getTileByID(p.proxyTileKey),f=r.proxyCachedFBO[p.key]?r.proxyCachedFBO[p.key][e]:void 0;let m,g;if(m=this.currentFBO=void 0!==f?r.renderCache[f]:this.pool[u++],d.texture=m.tex,void 0===f||m.dirty){n.bindFramebuffer.set(m.fb.framebuffer),this.renderedToTile=!1,m.dirty&&(n.clear({color:t.Color.transparent}),m.dirty=!1);for(let t=a.start;t<=a.end;++t){const e=i.style._layers[c[t]];if(e.isHidden(i.transform.zoom))continue;const r=i.style._getLayerSourceCache(e),o=r?this.proxyToSource[p.key][r.id]:[p];if(!o)continue;const s=o;n.viewport.set([0,0,m.fb.width,m.fb.height]),g!==(r?r.id:null)&&(this._setupStencil(o,e,r),g=r?r.id:null),i.renderLayer(i,r,e,s)}m.dirty=this.renderedToTile,this.renderedToTile&&l.push(d.tileID),5===u&&(u=0,l.length>0&&(s(),oi(i,this,r,l,this._updateTimestamp),this.renderingToTexture=!0,l=[]))}else l.push(d.tileID)}return s(),l.length>0&&oi(i,this,r,l,this._updateTimestamp),a.end+1}postRender(){}renderCacheEfficiency(t){const e=t.order.length;if(0===e)return{efficiency:100};let i,n=0,r=0,o=!1;for(let s=0;s<e;++s){const e=t._layers[t.order[s]];this._style.isLayerDraped(e)?(o&&++n,++r):o||(o=!0,i=e.id)}return 0===r?{efficiency:100}:{efficiency:100*(1-n/r),firstUndrapedLayer:i}}getMinElevationBelowMSL(){let t=0;return this._visibleDemTiles.filter((t=>t.dem)).forEach((e=>{t=Math.min(t,e.dem.tree.minimums[0])})),0===t?t:(t-30)*this._exaggeration}raycast(t,e,i){if(!this._visibleDemTiles)return null;const n=this._visibleDemTiles.filter((t=>t.dem)).map((n=>{const r=n.tileID,o=Math.pow(2,r.overscaledZ),{x:s,y:a}=r.canonical,l=s/o,c=(s+1)/o,u=a/o,h=(a+1)/o;return{minx:l,miny:u,maxx:c,maxy:h,t:n.dem.tree.raycastRoot(l,u,c,h,t,e,i),tile:n}}));n.sort(((t,e)=>(null!==t.t?t.t:Number.MAX_VALUE)-(null!==e.t?e.t:Number.MAX_VALUE)));for(const r of n){if(null==r.t)return null;const n=r.tile.dem.tree.raycast(r.minx,r.miny,r.maxx,r.maxy,t,e,i);if(null!=n)return n}return null}_createFBO(){const e=this.painter.context,i=e.gl,n=this.drapeBufferSize;e.activeTexture.set(i.TEXTURE0);const r=new t.Texture(e,{width:n[0],height:n[1],data:null},i.RGBA);r.bind(i.LINEAR,i.CLAMP_TO_EDGE);const o=e.createFramebuffer(n[0],n[1],!1);return o.colorAttachment.set(r.texture),o.depthAttachment=new vt(e,o.framebuffer),void 0===this._sharedDepthStencil?(this._sharedDepthStencil=e.createRenderbuffer(e.gl.DEPTH_STENCIL,n[0],n[1]),this._stencilRef=0,o.depthAttachment.set(this._sharedDepthStencil),e.clear({stencil:0})):o.depthAttachment.set(this._sharedDepthStencil),e.extTextureFilterAnisotropic&&!e.extTextureFilterAnisotropicForceOff&&i.texParameterf(i.TEXTURE_2D,e.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.extTextureFilterAnisotropicMax),{fb:o,tex:r,dirty:!1}}_initFBOPool(){for(;this.pool.length<Math.min(5,this.proxyCoords.length);)this.pool.push(this._createFBO())}_shouldDisableRenderCache(){if(!this.renderCached)return!0;if(this._style.light&&this._style.light.hasTransition())return!0;for(const t in this._style._sourceCaches)if(this._style._sourceCaches[t].hasTransition())return!0;return this._style.order.some((t=>{const e=this._style._layers[t],i=e.isHidden(this.painter.transform.zoom),n=e.getCrossfadeParameters(),r=!!n&&1!==n.t,o=e.hasTransition();return"custom"!==e.type&&!i&&(r||o)}))}_clearRasterFadeFromRenderCache(){let t=!1;for(const e in this._style._sourceCaches)if(this._style._sourceCaches[e]._source instanceof bt){t=!0;break}if(t)for(let t=0;t<this._style.order.length;++t){const e=this._style._layers[this._style.order[t]],i=e.isHidden(this.painter.transform.zoom),n=this._style._getLayerSourceCache(e);if("raster"!==e.type||i||!n)continue;const r=e.paint.get("raster-fade-duration");for(const t of this.proxyCoords){const e=this.proxyToSource[t.key][n.id];if(e)for(const t of e){const e=li(n.getTile(t),n.findLoadedParent(t,0),n,this.painter.transform,r);(1!==e.opacity||0!==e.mix)&&this._clearRenderCacheForTile(n.id,t)}}}}_setupDrapedRenderBatches(){const t=this._style.order,e=t.length;if(0===e)return;const i=[];let n,r=0,o=this._style._layers[t[r]];for(;!this._style.isLayerDraped(o)&&o.isHidden(this.painter.transform.zoom)&&++r<e;)o=this._style._layers[t[r]];for(;r<e;++r){const e=this._style._layers[t[r]];e.isHidden(this.painter.transform.zoom)||(this._style.isLayerDraped(e)?void 0===n&&(n=r):void 0!==n&&(i.push({start:n,end:r-1}),n=void 0))}void 0!==n&&i.push({start:n,end:r-1}),this._drapedRenderBatches=i}_setupRenderCache(t){const e=this.proxySourceCache;if(this._shouldDisableRenderCache()){if(e.renderCache.length>e.renderCachePool.length){const t=Object.values(e.proxyCachedFBO);e.proxyCachedFBO={};for(let i=0;i<t.length;++i){const n=Object.values(t[i]);e.renderCachePool.push(...n)}}return}this._clearRasterFadeFromRenderCache();const i=this.proxyCoords,n=this._tilesDirty;for(let r=i.length-1;r>=0;r--){const o=i[r];if(e.getTileByID(o.key),void 0!==e.proxyCachedFBO[o.key]){const i=t[o.key],r=this.proxyToSource[o.key];let s=0;for(const t in r){const e=r[t],o=i[t];if(!o||o.length!==e.length||e.some(((e,i)=>e!==o[i]||n[t]&&n[t].hasOwnProperty(e.key)))){s=-1;break}++s}for(const t in e.proxyCachedFBO[o.key])e.renderCache[e.proxyCachedFBO[o.key][t]].dirty=s<0||s!==Object.values(i).length}else for(let t=0;t<this._drapedRenderBatches.length;++t){const i=this._drapedRenderBatches[t];let n=e.renderCachePool.pop();void 0===n&&e.renderCache.length<50&&(n=e.renderCache.length,e.renderCache.push(this._createFBO())),void 0!==n&&(void 0===e.proxyCachedFBO[o.key]&&(e.proxyCachedFBO[o.key]={}),e.proxyCachedFBO[o.key][i.start]=n,e.renderCache[n].dirty=!0)}}this._tilesDirty={}}_setupStencil(t,e,i){if(!i||!this._sourceTilesOverlap[i.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const n=this.painter.context,r=n.gl;if(t.length<=1)return void(this._overlapStencilType=!1);let o;if(e.isTileClipped())o=t.length,this._overlapStencilMode.test={func:r.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(t[0].overscaledZ>t[t.length-1].overscaledZ))return void(this._overlapStencilType=!1);o=1,this._overlapStencilMode.test={func:r.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+o>255&&(n.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=o,this._overlapStencilMode.ref=this._stencilRef,e.isTileClipped()&&this._renderTileClippingMasks(t,this._overlapStencilMode.ref)}stencilModeForRTTOverlap(e){return this.renderingToTexture&&this._overlapStencilType?("Clip"===this._overlapStencilType&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[e.key]),this._overlapStencilMode):t.StencilMode.disabled}_renderTileClippingMasks(e,i){const n=this.painter,r=this.painter.context,o=r.gl;n._tileClippingMaskIDs={},r.setColorMode(t.ColorMode.disabled),r.setDepthMode(t.DepthMode.disabled);const s=n.useProgram("clippingMask");for(const a of e){const e=n._tileClippingMaskIDs[a.key]=--i;s.draw(r,o.TRIANGLES,t.DepthMode.disabled,new t.StencilMode({func:o.ALWAYS,mask:0},e,255,o.KEEP,o.KEEP,o.REPLACE),t.ColorMode.disabled,t.CullFaceMode.disabled,ai(a.projMatrix),"$clipping",n.tileExtentBuffer,n.quadTriangleIndexBuffer,n.tileExtentSegments)}}pointCoordinate(e){const i=this.painter.transform;if(e.x<0||e.x>i.width||e.y<0||e.y>i.height)return null;const n=[e.x,e.y,1,1];t.transformMat4(n,n,i.pixelMatrixInverse),t.scale$2(n,n,1/n[3]),n[0]/=i.worldSize,n[1]/=i.worldSize;const r=i._camera.position,o=t.mercatorZfromAltitude(1,i.center.lat),s=[r[0],r[1],r[2]/o,0],a=t.subtract([],n.slice(0,3),s);t.normalize(a,a);const l=this.raycast(s,a,this._exaggeration);return null!==l&&l?(t.scaleAndAdd(s,s,a,l),s[3]=s[2],s[2]*=o,s):null}drawDepth(){const e=this.painter,i=e.context,n=this.proxySourceCache,r=Math.ceil(e.width),o=Math.ceil(e.height);if(!this._depthFBO||this._depthFBO.width===r&&this._depthFBO.height===o||(this._depthFBO.destroy(),delete this._depthFBO,delete this._depthTexture),!this._depthFBO){const e=i.gl,n=i.createFramebuffer(r,o,!0);i.activeTexture.set(e.TEXTURE0);const s=new t.Texture(i,{width:r,height:o,data:null},e.RGBA);s.bind(e.NEAREST,e.CLAMP_TO_EDGE),n.colorAttachment.set(s.texture);const a=i.createRenderbuffer(i.gl.DEPTH_COMPONENT16,r,o);n.depthAttachment.set(a),this._depthFBO=n,this._depthTexture=s}i.bindFramebuffer.set(this._depthFBO.framebuffer),i.viewport.set([0,0,r,o]),function(e,i,n,r){const o=e.context,s=o.gl;o.clear({depth:1});const a=e.useProgram("terrainDepth"),l=new t.DepthMode(s.LESS,t.DepthMode.ReadWrite,e.depthRangeFor3D);for(const e of r){const r=n.getTile(e),c=ii(e.projMatrix,0);i.setupElevationDraw(r,a),a.draw(o,s.TRIANGLES,l,t.StencilMode.disabled,t.ColorMode.unblended,t.CullFaceMode.backCCW,c,"terrain_depth",i.gridBuffer,i.gridIndexBuffer,i.gridNoSkirtSegments)}}(e,this,n,this.proxyCoords)}_setupProxiedCoordsForOrtho(t,e,i){if(t.getSource()instanceof Et)return this._setupProxiedCoordsForImageSource(t,e,i);this._findCoveringTileCache[t.id]=this._findCoveringTileCache[t.id]||{};const n=this.proxiedCoords[t.id]=[],r=this.proxyCoords;for(let e=0;e<r.length;e++){const o=r[e],s=this._findTileCoveringTileID(o,t);if(s){const e=this._createProxiedId(o,s,i[o.key]&&i[o.key][t.id]);n.push(e),this.proxyToSource[o.key][t.id]=[e]}}let o=!1;for(let r=0;r<e.length;r++){const s=t.getTile(e[r]);if(!s||!s.hasData())continue;const a=this._findTileCoveringTileID(s.tileID,this.proxySourceCache);if(a&&a.tileID.canonical.z!==s.tileID.canonical.z){const e=this.proxyToSource[a.tileID.key][t.id],r=this._createProxiedId(a.tileID,s,i[a.tileID.key]&&i[a.tileID.key][t.id]);e?e.splice(e.length-1,0,r):this.proxyToSource[a.tileID.key][t.id]=[r],n.push(r),o=!0}}this._sourceTilesOverlap[t.id]=o}_setupProxiedCoordsForImageSource(e,i,n){if(!e.getSource().loaded())return;const r=this.proxiedCoords[e.id]=[],o=this.proxyCoords,s=e.getSource(),a=new t.pointGeometry(s.tileID.x,s.tileID.y)._div(1<<s.tileID.z),l=s.coordinates.map(t.MercatorCoordinate.fromLngLat).reduce(((t,e)=>(t.min.x=Math.min(t.min.x,e.x-a.x),t.min.y=Math.min(t.min.y,e.y-a.y),t.max.x=Math.max(t.max.x,e.x-a.x),t.max.y=Math.max(t.max.y,e.y-a.y),t)),{min:new t.pointGeometry(Number.MAX_VALUE,Number.MAX_VALUE),max:new t.pointGeometry(-Number.MAX_VALUE,-Number.MAX_VALUE)}),c=(e,i)=>{const n=e.wrap+e.canonical.x/(1<<e.canonical.z),r=e.canonical.y/(1<<e.canonical.z),o=t.EXTENT/(1<<e.canonical.z),s=i.wrap+i.canonical.x/(1<<i.canonical.z),a=i.canonical.y/(1<<i.canonical.z);return n+o<s+l.min.x||n>s+l.max.x||r+o<a+l.min.y||r>a+l.max.y};for(let t=0;t<o.length;t++){const s=o[t];for(let t=0;t<i.length;t++){const o=e.getTile(i[t]);if(!o||!o.hasData())continue;if(c(s,o.tileID))continue;const a=this._createProxiedId(s,o,n[s.key]&&n[s.key][e.id]),l=this.proxyToSource[s.key][e.id];l?l.push(a):this.proxyToSource[s.key][e.id]=[a],r.push(a)}}}_createProxiedId(e,i,n){let r=this.orthoMatrix;if(n){const t=n.find((t=>t.key===i.tileID.key));if(t)return t}if(i.tileID.key!==e.key){const n=e.canonical.z-i.tileID.canonical.z;let o,s,a;r=t.create$1();const l=i.tileID.wrap-e.wrap<<e.overscaledZ;n>0?(o=t.EXTENT>>n,s=o*((i.tileID.canonical.x<<n)-e.canonical.x+l),a=o*((i.tileID.canonical.y<<n)-e.canonical.y)):(o=t.EXTENT<<-n,s=t.EXTENT*(i.tileID.canonical.x-(e.canonical.x+l<<-n)),a=t.EXTENT*(i.tileID.canonical.y-(e.canonical.y<<-n))),t.ortho(r,0,o,0,o,0,1),t.translate(r,r,[s,a,0])}return new ui(i.tileID,e.key,r)}_findTileCoveringTileID(e,i){let n=i.getTile(e);if(n&&n.hasData())return n;const r=this._findCoveringTileCache[i.id],o=r[e.key];if(n=o?i.getTileByID(o):null,n&&n.hasData()||null===o)return n;let s=n?n.tileID:e,a=s.overscaledZ;const l=i.getSource().minzoom,c=[];if(!o){const r=i.getSource().maxzoom;if(e.canonical.z>=r){const n=e.canonical.z-r;i.getSource().reparseOverscaled?(a=Math.max(e.canonical.z+2,i.transform.tileZoom),s=new t.OverscaledTileID(a,e.wrap,r,e.canonical.x>>n,e.canonical.y>>n)):0!==n&&(a=r,s=new t.OverscaledTileID(a,e.wrap,r,e.canonical.x>>n,e.canonical.y>>n))}s.key!==e.key&&(c.push(s.key),n=i.getTile(s))}const u=t=>{c.forEach((e=>{r[e]=t})),c.length=0};for(a-=1;a>=l&&(!n||!n.hasData());a--){n&&u(n.tileID.key);const t=s.calculateScaledKey(a);if(n=i.getTileByID(t),n&&n.hasData())break;const e=r[t];if(null===e)break;void 0===e?c.push(t):n=i.getTileByID(e)}return u(n?n.tileID.key:null),n&&n.hasData()?n:null}findDEMTileFor(t){return this.enabled?this._findTileCoveringTileID(t,this.sourceCache):null}prepareDrawTile(t){this.renderedToTile||(this.renderedToTile=!0)}_clearRenderCacheForTile(t,e){let i=this._tilesDirty[t];i||(i=this._tilesDirty[t]={}),i[e.key]=!0}getWirefameBuffer(){if(!this.wireframeSegments){const e=function(e){let i,n,r;const o=new t.StructArrayLayout2ui4,s=131;for(n=1;n<129;n++){for(i=1;i<129;i++)r=n*s+i,o.emplaceBack(r,r+1),o.emplaceBack(r,r+s),o.emplaceBack(r+1,r+s),128===n&&o.emplaceBack(r+s,r+s+1);o.emplaceBack(r+1,r+1+s)}return o}();this.wireframeIndexBuffer=this.painter.context.createIndexBuffer(e),this.wireframeSegments=t.SegmentVector.simpleSegment(0,0,this.gridBuffer.length,e.length)}return[this.wireframeIndexBuffer,this.wireframeSegments]}}function pi(t){const e=[];for(let i=0;i<t.length;i++){if(null===t[i])continue;const n=t[i].split(" ");e.push(n.pop())}return e}class di{static cacheKey(t,e,i){let n=`${t}${i?i.cacheKey:""}`;for(const t of e)n+=`/${t}`;return n}constructor(e,i,n,r,o,s){const a=e.gl;this.program=a.createProgram();const l=pi(n.staticAttributes),c=r?r.getBinderAttributes():[],u=l.concat(c),h=n.staticUniforms?pi(n.staticUniforms):[],p=r?r.getBinderUniforms():[],d=h.concat(p),f=[];for(const t of d)f.indexOf(t)<0&&f.push(t);let m=r?r.defines():[];m=m.concat(s.map((t=>`#define ${t}`)));const g=m.concat(qe.fragmentSource,Xe,We.fragmentSource,n.fragmentSource).join("\n"),y=m.concat(qe.vertexSource,Xe,We.vertexSource,He.vertexSource,n.vertexSource).join("\n"),v=a.createShader(a.FRAGMENT_SHADER);if(a.isContextLost())return void(this.failedToCreate=!0);a.shaderSource(v,g),a.compileShader(v),a.attachShader(this.program,v);const _=a.createShader(a.VERTEX_SHADER);if(a.isContextLost())return void(this.failedToCreate=!0);a.shaderSource(_,y),a.compileShader(_),a.attachShader(this.program,_),this.attributes={};const x={};this.numAttributes=u.length;for(let t=0;t<this.numAttributes;t++)u[t]&&(a.bindAttribLocation(this.program,t,u[t]),this.attributes[u[t]]=t);a.linkProgram(this.program),a.deleteShader(_),a.deleteShader(v);for(let t=0;t<f.length;t++){const e=f[t];if(e&&!x[e]){const t=a.getUniformLocation(this.program,e);t&&(x[e]=t)}}this.fixedUniforms=o(e,x),this.binderUniforms=r?r.getUniforms(e,x):[],-1!==s.indexOf("TERRAIN")&&(this.terrainUniforms=((e,i)=>({u_dem:new t.Uniform1i(e,i.u_dem),u_dem_prev:new t.Uniform1i(e,i.u_dem_prev),u_dem_unpack:new t.Uniform4f(e,i.u_dem_unpack),u_dem_tl:new t.Uniform2f(e,i.u_dem_tl),u_dem_scale:new t.Uniform1f(e,i.u_dem_scale),u_dem_tl_prev:new t.Uniform2f(e,i.u_dem_tl_prev),u_dem_scale_prev:new t.Uniform1f(e,i.u_dem_scale_prev),u_dem_size:new t.Uniform1f(e,i.u_dem_size),u_dem_lerp:new t.Uniform1f(e,i.u_dem_lerp),u_exaggeration:new t.Uniform1f(e,i.u_exaggeration),u_depth:new t.Uniform1i(e,i.u_depth),u_depth_size_inv:new t.Uniform2f(e,i.u_depth_size_inv),u_meter_to_dem:new t.Uniform1f(e,i.u_meter_to_dem),u_label_plane_matrix_inv:new t.UniformMatrix4f(e,i.u_label_plane_matrix_inv)}))(e,x)),-1!==s.indexOf("FOG")&&(this.fogUniforms=((e,i)=>({u_fog_matrix:new t.UniformMatrix4f(e,i.u_fog_matrix),u_fog_range:new t.Uniform2f(e,i.u_fog_range),u_fog_color:new t.Uniform4f(e,i.u_fog_color),u_fog_horizon_blend:new t.Uniform1f(e,i.u_fog_horizon_blend),u_fog_temporal_offset:new t.Uniform1f(e,i.u_fog_temporal_offset)}))(e,x))}setTerrainUniformValues(t,e){if(!this.terrainUniforms)return;const i=this.terrainUniforms;if(!this.failedToCreate){t.program.set(this.program);for(const t in e)i[t].set(e[t])}}setFogUniformValues(t,e){if(!this.fogUniforms)return;const i=this.fogUniforms;if(!this.failedToCreate){t.program.set(this.program);for(const t in e)i[t].location&&i[t].set(e[t])}}draw(t,e,i,n,r,o,s,a,l,c,u,h,p,d,f,m){const g=t.gl;if(this.failedToCreate)return;t.program.set(this.program),t.setDepthMode(i),t.setStencilMode(n),t.setColorMode(r),t.setCullFace(o);for(const t in this.fixedUniforms)this.fixedUniforms[t].set(s[t]);d&&d.setUniforms(t,this.binderUniforms,h,{zoom:p});const y={[g.LINES]:2,[g.TRIANGLES]:3,[g.LINE_STRIP]:1}[e];for(const i of u.get()){const n=i.vaos||(i.vaos={});(n[a]||(n[a]=new Qe)).bind(t,this,l,d?d.getPaintVertexBuffers():[],c,i.vertexOffset,f,m),g.drawElements(e,i.primitiveLength*y,g.UNSIGNED_SHORT,i.primitiveOffset*y*2)}}}function fi(t,e,i){const n=1/C(i,1,e.transform.tileZoom),r=Math.pow(2,i.tileID.overscaledZ),o=i.tileSize*Math.pow(2,e.transform.tileZoom)/r,s=o*(i.tileID.canonical.x+i.tileID.wrap*r),a=o*i.tileID.canonical.y;return{u_image:0,u_texsize:i.imageAtlasTexture.size,u_scale:[n,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[s>>16,a>>16],u_pixel_coord_lower:[65535&s,65535&a]}}const mi=(e,i,n,r)=>{const o=i.style.light,s=o.properties.get("position"),a=[s.x,s.y,s.z],l=t.create$2();"viewport"===o.properties.get("anchor")&&(t.fromRotation(l,-i.transform.angle),t.transformMat3(a,a,l));const c=o.properties.get("color");return{u_matrix:e,u_lightpos:a,u_lightintensity:o.properties.get("intensity"),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+n,u_opacity:r}},gi=(e,i,n,r,o,s,a)=>t.extend(mi(e,i,n,r),fi(s,i,a),{u_height_factor:-Math.pow(2,o.overscaledZ)/a.tileSize/8}),yi=t=>({u_matrix:t}),vi=(e,i,n,r)=>t.extend(yi(e),fi(n,i,r)),_i=(t,e)=>({u_matrix:t,u_world:e}),xi=(e,i,n,r,o)=>t.extend(vi(e,i,n,r),{u_world:o}),bi=(e,i,n,r)=>{const o=e.transform;let s;if("map"===r.paint.get("circle-pitch-alignment")){const t=C(n,1,o.zoom);s=[t,t]}else s=o.pixelsToGLUnits;return{u_camera_to_center_distance:o.cameraToCenterDistance,u_matrix:e.translatePosMatrix(i.projMatrix,n,r.paint.get("circle-translate"),r.paint.get("circle-translate-anchor")),u_device_pixel_ratio:t.exported.devicePixelRatio,u_extrude_scale:s}},wi=t=>{const e=[];return"map"===t.paint.get("circle-pitch-alignment")&&e.push("PITCH_WITH_MAP"),"map"===t.paint.get("circle-pitch-scale")&&e.push("SCALE_WITH_MAP"),e},Ai=(e,i,n)=>{const r=t.EXTENT/n.tileSize;return{u_matrix:e,u_camera_to_center_distance:i.cameraToCenterDistance,u_extrude_scale:[i.pixelsToGLUnits[0]/r,i.pixelsToGLUnits[1]/r]}},Ei=(t,e,i=1)=>({u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:i}),Si=(t,e,i,n)=>({u_matrix:t,u_extrude_scale:C(e,1,i),u_intensity:n}),Mi=(e,i,n,r)=>{const o=e.transform;return{u_matrix:Li(e,i,n,r),u_ratio:1/C(i,1,o.zoom),u_device_pixel_ratio:t.exported.devicePixelRatio,u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]]}},Ti=(e,i,n,r,o)=>t.extend(Mi(e,i,n,r),{u_image:0,u_image_height:o}),Ii=(e,i,n,r,o)=>{const s=e.transform,a=Pi(i,s);return{u_matrix:Li(e,i,n,o),u_texsize:i.imageAtlasTexture.size,u_ratio:1/C(i,1,s.zoom),u_device_pixel_ratio:t.exported.devicePixelRatio,u_image:0,u_scale:[a,r.fromScale,r.toScale],u_fade:r.t,u_units_to_pixels:[1/s.pixelsToGLUnits[0],1/s.pixelsToGLUnits[1]]}},Ci=(e,i,n,r,o)=>{const s=Pi(i,e.transform);return t.extend(Mi(e,i,n,o),{u_texsize:i.lineAtlasTexture.size,u_scale:[s,r.fromScale,r.toScale],u_image:0,u_mix:r.t})};function Pi(t,e){return 1/C(t,1,e.tileZoom)}function Li(t,e,i,n){return t.translatePosMatrix(n||e.tileID.projMatrix,e,i.paint.get("line-translate"),i.paint.get("line-translate-anchor"))}const Di=(t,e,i,n,r)=>{return{u_matrix:t,u_tl_parent:e,u_scale_parent:i,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*r.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:r.paint.get("raster-brightness-min"),u_brightness_high:r.paint.get("raster-brightness-max"),u_saturation_factor:(s=r.paint.get("raster-saturation"),s>0?1-1/(1.001-s):-s),u_contrast_factor:(o=r.paint.get("raster-contrast"),o>0?1/(1-o):1+o),u_spin_weights:Ri(r.paint.get("raster-hue-rotate"))};var o,s};function Ri(t){t*=Math.PI/180;const e=Math.sin(t),i=Math.cos(t);return[(2*i+1)/3,(-Math.sqrt(3)*e-i+1)/3,(Math.sqrt(3)*e-i+1)/3]}const Oi=(t,e,i,n,r,o,s,a,l,c)=>{const u=r.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:u.cameraToCenterDistance,u_pitch:u.pitch/360*2*Math.PI,u_rotate_symbol:+i,u_aspect_ratio:u.width/u.height,u_fade_change:r.options.fadeDuration?r.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:s,u_coord_matrix:a,u_is_text:+l,u_pitch_with_map:+n,u_texsize:c,u_texture:0}},ki=(e,i,n,r,o,s,a,l,c,u,h)=>{const{cameraToCenterDistance:p,_pitch:d}=o.transform;return t.extend(Oi(e,i,n,r,o,s,a,l,c,u),{u_gamma_scale:r?p*Math.cos(o.terrain?0:d):1,u_device_pixel_ratio:t.exported.devicePixelRatio,u_is_halo:+h})},Ni=(e,i,n,r,o,s,a,l,c,u)=>t.extend(ki(e,i,n,r,o,s,a,l,!0,c,!0),{u_texsize_icon:u,u_texture_icon:1}),Bi=(t,e,i)=>({u_matrix:t,u_opacity:e,u_color:i}),zi=(e,i,n,r,o,s)=>t.extend(function(t,e,i,n){const r=i.imageManager.getPattern(t.from.toString()),o=i.imageManager.getPattern(t.to.toString()),{width:s,height:a}=i.imageManager.getPixelSize(),l=Math.pow(2,n.tileID.overscaledZ),c=n.tileSize*Math.pow(2,i.transform.tileZoom)/l,u=c*(n.tileID.canonical.x+n.tileID.wrap*l),h=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:r.tl,u_pattern_br_a:r.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[s,a],u_mix:e.t,u_pattern_size_a:r.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/C(n,1,i.transform.tileZoom),u_pixel_coord_upper:[u>>16,h>>16],u_pixel_coord_lower:[65535&u,65535&h]}}(r,s,n,o),{u_matrix:e,u_opacity:i}),Fi={fillExtrusion:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_lightpos:new t.Uniform3f(e,i.u_lightpos),u_lightintensity:new t.Uniform1f(e,i.u_lightintensity),u_lightcolor:new t.Uniform3f(e,i.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,i.u_vertical_gradient),u_opacity:new t.Uniform1f(e,i.u_opacity)}),fillExtrusionPattern:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_lightpos:new t.Uniform3f(e,i.u_lightpos),u_lightintensity:new t.Uniform1f(e,i.u_lightintensity),u_lightcolor:new t.Uniform3f(e,i.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,i.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,i.u_height_factor),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade),u_opacity:new t.Uniform1f(e,i.u_opacity)}),fill:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}),fillPattern:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade)}),fillOutline:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world)}),fillOutlinePattern:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade)}),circle:(e,i)=>({u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_extrude_scale:new t.Uniform2f(e,i.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}),collisionBox:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_extrude_scale:new t.Uniform2f(e,i.u_extrude_scale)}),collisionCircle:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,i.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,i.u_viewport_size)}),debug:(e,i)=>({u_color:new t.UniformColor(e,i.u_color),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_overlay:new t.Uniform1i(e,i.u_overlay),u_overlay_scale:new t.Uniform1f(e,i.u_overlay_scale)}),clippingMask:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}),heatmap:(e,i)=>({u_extrude_scale:new t.Uniform1f(e,i.u_extrude_scale),u_intensity:new t.Uniform1f(e,i.u_intensity),u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}),heatmapTexture:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world),u_image:new t.Uniform1i(e,i.u_image),u_color_ramp:new t.Uniform1i(e,i.u_color_ramp),u_opacity:new t.Uniform1f(e,i.u_opacity)}),hillshade:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_latrange:new t.Uniform2f(e,i.u_latrange),u_light:new t.Uniform2f(e,i.u_light),u_shadow:new t.UniformColor(e,i.u_shadow),u_highlight:new t.UniformColor(e,i.u_highlight),u_accent:new t.UniformColor(e,i.u_accent)}),hillshadePrepare:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_dimension:new t.Uniform2f(e,i.u_dimension),u_zoom:new t.Uniform1f(e,i.u_zoom),u_unpack:new t.Uniform4f(e,i.u_unpack)}),line:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_ratio:new t.Uniform1f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels)}),lineGradient:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_ratio:new t.Uniform1f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels),u_image:new t.Uniform1i(e,i.u_image),u_image_height:new t.Uniform1f(e,i.u_image_height)}),linePattern:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_texsize:new t.Uniform2f(e,i.u_texsize),u_ratio:new t.Uniform1f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_image:new t.Uniform1i(e,i.u_image),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade)}),lineSDF:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_texsize:new t.Uniform2f(e,i.u_texsize),u_ratio:new t.Uniform1f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels),u_image:new t.Uniform1i(e,i.u_image),u_scale:new t.Uniform3f(e,i.u_scale),u_mix:new t.Uniform1f(e,i.u_mix)}),raster:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_tl_parent:new t.Uniform2f(e,i.u_tl_parent),u_scale_parent:new t.Uniform1f(e,i.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,i.u_buffer_scale),u_fade_t:new t.Uniform1f(e,i.u_fade_t),u_opacity:new t.Uniform1f(e,i.u_opacity),u_image0:new t.Uniform1i(e,i.u_image0),u_image1:new t.Uniform1i(e,i.u_image1),u_brightness_low:new t.Uniform1f(e,i.u_brightness_low),u_brightness_high:new t.Uniform1f(e,i.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,i.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,i.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,i.u_spin_weights)}),symbolIcon:(e,i)=>({u_is_size_zoom_constant:new t.Uniform1i(e,i.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,i.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,i.u_size_t),u_size:new t.Uniform1f(e,i.u_size),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,i.u_pitch),u_rotate_symbol:new t.Uniform1i(e,i.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,i.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,i.u_fade_change),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,i.u_coord_matrix),u_is_text:new t.Uniform1i(e,i.u_is_text),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_texsize:new t.Uniform2f(e,i.u_texsize),u_texture:new t.Uniform1i(e,i.u_texture)}),symbolSDF:(e,i)=>({u_is_size_zoom_constant:new t.Uniform1i(e,i.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,i.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,i.u_size_t),u_size:new t.Uniform1f(e,i.u_size),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,i.u_pitch),u_rotate_symbol:new t.Uniform1i(e,i.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,i.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,i.u_fade_change),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,i.u_coord_matrix),u_is_text:new t.Uniform1i(e,i.u_is_text),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_texsize:new t.Uniform2f(e,i.u_texsize),u_texture:new t.Uniform1i(e,i.u_texture),u_gamma_scale:new t.Uniform1f(e,i.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,i.u_is_halo)}),symbolTextAndIcon:(e,i)=>({u_is_size_zoom_constant:new t.Uniform1i(e,i.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,i.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,i.u_size_t),u_size:new t.Uniform1f(e,i.u_size),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,i.u_pitch),u_rotate_symbol:new t.Uniform1i(e,i.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,i.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,i.u_fade_change),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,i.u_coord_matrix),u_is_text:new t.Uniform1i(e,i.u_is_text),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_texsize:new t.Uniform2f(e,i.u_texsize),u_texsize_icon:new t.Uniform2f(e,i.u_texsize_icon),u_texture:new t.Uniform1i(e,i.u_texture),u_texture_icon:new t.Uniform1i(e,i.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,i.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,i.u_is_halo)}),background:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_opacity:new t.Uniform1f(e,i.u_opacity),u_color:new t.UniformColor(e,i.u_color)}),backgroundPattern:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_opacity:new t.Uniform1f(e,i.u_opacity),u_image:new t.Uniform1i(e,i.u_image),u_pattern_tl_a:new t.Uniform2f(e,i.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,i.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,i.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,i.u_pattern_br_b),u_texsize:new t.Uniform2f(e,i.u_texsize),u_mix:new t.Uniform1f(e,i.u_mix),u_pattern_size_a:new t.Uniform2f(e,i.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,i.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,i.u_scale_a),u_scale_b:new t.Uniform1f(e,i.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,i.u_tile_units_to_pixels)}),terrainRaster:ei,terrainDepth:ei,skybox:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_sun_direction:new t.Uniform3f(e,i.u_sun_direction),u_cubemap:new t.Uniform1i(e,i.u_cubemap),u_opacity:new t.Uniform1f(e,i.u_opacity),u_temporal_offset:new t.Uniform1f(e,i.u_temporal_offset)}),skyboxGradient:(e,i)=>({u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_color_ramp:new t.Uniform1i(e,i.u_color_ramp),u_center_direction:new t.Uniform3f(e,i.u_center_direction),u_radius:new t.Uniform1f(e,i.u_radius),u_opacity:new t.Uniform1f(e,i.u_opacity),u_temporal_offset:new t.Uniform1f(e,i.u_temporal_offset)}),skyboxCapture:(e,i)=>({u_matrix_3f:new t.UniformMatrix3f(e,i.u_matrix_3f),u_sun_direction:new t.Uniform3f(e,i.u_sun_direction),u_sun_intensity:new t.Uniform1f(e,i.u_sun_intensity),u_color_tint_r:new t.Uniform4f(e,i.u_color_tint_r),u_color_tint_m:new t.Uniform4f(e,i.u_color_tint_m),u_luminance:new t.Uniform1f(e,i.u_luminance)})};let Vi;function Ui(e,i,n,r,o,s,a){const l=e.context,c=l.gl,u=e.useProgram("collisionBox"),h=[];let p=0,d=0;for(let f=0;f<r.length;f++){const m=r[f],g=i.getTile(m),y=g.getBucket(n);if(!y)continue;let v=m.projMatrix;0===o[0]&&0===o[1]||(v=e.translatePosMatrix(m.projMatrix,g,o,s));const _=a?y.textCollisionBox:y.iconCollisionBox,x=y.collisionCircleArray;if(x.length>0){const i=t.create$1(),n=v;t.mul$1(i,y.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul$1(i,i,y.placementViewportMatrix),h.push({circleArray:x,circleOffset:d,transform:n,invTransform:i}),p+=x.length/4,d=p}_&&(e.terrain&&e.terrain.setupElevationDraw(g,u),u.draw(l,c.LINES,t.DepthMode.disabled,t.StencilMode.disabled,e.colorModeForRenderPass(),t.CullFaceMode.disabled,Ai(v,e.transform,g),n.id,_.layoutVertexBuffer,_.indexBuffer,_.segments,null,e.transform.zoom,null,_.collisionVertexBuffer,_.collisionVertexBufferExt))}if(!a||!h.length)return;const f=e.useProgram("collisionCircle"),m=new t.StructArrayLayout2f1f2i16;m.resize(4*p),m._trim();let g=0;for(const t of h)for(let e=0;e<t.circleArray.length/4;e++){const i=4*e,n=t.circleArray[i+0],r=t.circleArray[i+1],o=t.circleArray[i+2],s=t.circleArray[i+3];m.emplace(g++,n,r,o,s,0),m.emplace(g++,n,r,o,s,1),m.emplace(g++,n,r,o,s,2),m.emplace(g++,n,r,o,s,3)}(!Vi||Vi.length<2*p)&&(Vi=function(e){const i=2*e,n=new t.StructArrayLayout3ui6;n.resize(i),n._trim();for(let t=0;t<i;t++){const e=6*t;n.uint16[e+0]=4*t+0,n.uint16[e+1]=4*t+1,n.uint16[e+2]=4*t+2,n.uint16[e+3]=4*t+2,n.uint16[e+4]=4*t+3,n.uint16[e+5]=4*t+0}return n}(p));const y=l.createIndexBuffer(Vi,!0),v=l.createVertexBuffer(m,t.collisionCircleLayout.members,!0);for(const i of h){const r={u_matrix:i.transform,u_inv_matrix:i.invTransform,u_camera_to_center_distance:(_=e.transform).cameraToCenterDistance,u_viewport_size:[_.width,_.height]};f.draw(l,c.TRIANGLES,t.DepthMode.disabled,t.StencilMode.disabled,e.colorModeForRenderPass(),t.CullFaceMode.disabled,r,n.id,v,y,t.SegmentVector.simpleSegment(0,2*i.circleOffset,i.circleArray.length,i.circleArray.length/2),null,e.transform.zoom,null,null,null)}var _;v.destroy(),y.destroy()}const Gi=t.identity(new Float32Array(16));function ji(e,i,n,r,o,s){const{horizontalAlign:a,verticalAlign:l}=t.getAnchorAlignment(e),c=-(a-.5)*i,u=-(l-.5)*n,h=t.evaluateVariableOffset(e,r);return new t.pointGeometry((c/o+h[0])*s,(u/o+h[1])*s)}function Hi(e,i,n,r,o,s,a,l,c,u,h,p){const d=e.text.placedSymbolArray,f=e.text.dynamicLayoutVertexArray,m=e.icon.dynamicLayoutVertexArray,g={};f.clear();for(let m=0;m<d.length;m++){const y=d.get(m),v=e.allowVerticalPlacement&&!y.placedOrientation,_=y.hidden||!y.crossTileID||v?null:r[y.crossTileID];if(_){const r=new t.pointGeometry(y.anchorX,y.anchorY),d=p(r),m=Qt(r,n?l:a,d),v=Jt(s.cameraToCenterDistance,m.signedDistanceFromCamera);let x=o.evaluateSizeForFeature(e.textSizeData,u,y)*v/t.ONE_EM;n&&(x*=e.tilePixelRatio/c);const{width:b,height:w,anchor:A,textOffset:E,textBoxScale:S}=_,M=ji(A,b,w,E,S,x),T=n?Qt(r.add(M),a,d).point:m.point.add(i?M.rotate(-s.angle):M),I=e.allowVerticalPlacement&&y.placedOrientation===t.WritingMode.vertical?Math.PI/2:0;for(let e=0;e<y.numGlyphs;e++)t.addDynamicAttributes(f,T,I);h&&y.associatedIconIndex>=0&&(g[y.associatedIconIndex]={shiftedAnchor:T,angle:I})}else se(y.numGlyphs,f)}if(h){m.clear();const i=e.icon.placedSymbolArray;for(let e=0;e<i.length;e++){const n=i.get(e);if(n.hidden)se(n.numGlyphs,m);else{const i=g[e];if(i)for(let e=0;e<n.numGlyphs;e++)t.addDynamicAttributes(m,i.shiftedAnchor,i.angle);else se(n.numGlyphs,m)}}e.icon.dynamicLayoutVertexBuffer.updateData(m)}e.text.dynamicLayoutVertexBuffer.updateData(f)}function Wi(t,e,i){return i.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function qi(e,i,n,r,o,s,a,l,c,u,h,p){const d=e.context,f=d.gl,m=e.transform,g="map"===l,y="map"===c,v=g&&"point"!==n.layout.get("symbol-placement"),_=g&&!y&&!v,x=void 0!==n.layout.get("symbol-sort-key").constantOr(1);let b=!1;const w=e.depthModeForSublayer(0,t.DepthMode.ReadOnly),A=n.layout.get("text-variable-anchor"),E=[],S=e.terrain&&y?["PITCH_WITH_MAP_TERRAIN"]:null;for(const l of r){const r=i.getTile(l),c=r.getBucket(n);if(!c)continue;const h=o?c.text:c.icon;if(!h||!h.segments.get().length)continue;const p=h.programConfigurations.get(n.id),d=o||c.sdfIcons,w=o?c.textSizeData:c.iconSizeData,M=y||0!==m.pitch,T=e.useProgram(Wi(d,o,c),p,S),I=t.evaluateSizeForZoom(w,m.zoom);let P,L,D,R,O=[0,0],k=null;if(o){if(L=r.glyphAtlasTexture,D=f.LINEAR,P=r.glyphAtlasTexture.size,c.iconsInText){O=r.imageAtlasTexture.size,k=r.imageAtlasTexture;const t="composite"===w.kind||"camera"===w.kind;R=M||e.options.rotating||e.options.zooming||t?f.LINEAR:f.NEAREST}}else{const t=1!==n.layout.get("icon-size").constantOr(0)||c.iconsNeedLinear;L=r.imageAtlasTexture,D=d||e.options.rotating||e.options.zooming||t||M?f.LINEAR:f.NEAREST,P=r.imageAtlasTexture.size}const N=C(r,1,e.transform.zoom),B=Zt(l.projMatrix,y,g,e.transform,N),z=e.terrain&&y&&v?t.invert(new Float32Array(16),B):Gi,F=Yt(l.projMatrix,y,g,e.transform,N),V=A&&c.hasTextData(),U="none"!==n.layout.get("icon-text-fit")&&V&&c.hasIconData();if(v){const t=m.elevation;$t(c,l.projMatrix,e,o,B,F,y,u,t?e=>t.getAtTileOffset(l,e.x,e.y):null)}const G=e.translatePosMatrix(l.projMatrix,r,s,a),j=v||o&&A||U?Gi:B,H=e.translatePosMatrix(F,r,s,a,!0),W=d&&0!==n.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1);let q;q=d?c.iconsInText?Ni(w.kind,I,_,y,e,G,j,H,P,O):ki(w.kind,I,_,y,e,G,j,H,o,P,!0):Oi(w.kind,I,_,y,e,G,j,H,o,P);const X={program:T,buffers:h,uniformValues:q,atlasTexture:L,atlasTextureIcon:k,atlasInterpolation:D,atlasInterpolationIcon:R,isSDF:d,hasHalo:W,tile:r,labelPlaneMatrixInv:z};if(x&&c.canOverlap){b=!0;const e=h.segments.get();for(const i of e)E.push({segments:new t.SegmentVector([i]),sortKey:i.sortKey,state:X})}else E.push({segments:h.segments,sortKey:0,state:X})}b&&E.sort(((t,e)=>t.sortKey-e.sortKey));for(const t of E){const i=t.state;if(e.terrain&&e.terrain.setupElevationDraw(i.tile,i.program,{useDepthForOcclusion:!0,labelPlaneMatrixInv:i.labelPlaneMatrixInv}),d.activeTexture.set(f.TEXTURE0),i.atlasTexture.bind(i.atlasInterpolation,f.CLAMP_TO_EDGE),i.atlasTextureIcon&&(d.activeTexture.set(f.TEXTURE1),i.atlasTextureIcon&&i.atlasTextureIcon.bind(i.atlasInterpolationIcon,f.CLAMP_TO_EDGE)),i.isSDF){const r=i.uniformValues;i.hasHalo&&(r.u_is_halo=1,Xi(i.buffers,t.segments,n,e,i.program,w,h,p,r)),r.u_is_halo=0}Xi(i.buffers,t.segments,n,e,i.program,w,h,p,i.uniformValues)}}function Xi(e,i,n,r,o,s,a,l,c){const u=r.context;o.draw(u,u.gl.TRIANGLES,s,a,l,t.CullFaceMode.disabled,c,n.id,e.layoutVertexBuffer,e.indexBuffer,i,n.paint,r.transform.zoom,e.programConfigurations.get(n.id),e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer)}function Zi(e,i,n,r,o,s,a){const l=e.context.gl,c=n.paint.get("fill-pattern"),u=c&&c.constantOr(1),h=n.getCrossfadeParameters();let p,d,f,m,g;a?(d=u&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",p=l.LINES):(d=u?"fillPattern":"fill",p=l.TRIANGLES);for(const y of r){const r=i.getTile(y);if(u&&!r.patternsLoaded())continue;const v=r.getBucket(n);if(!v)continue;e.prepareDrawTile(y);const _=v.programConfigurations.get(n.id),x=e.useProgram(d,_);u&&(e.context.activeTexture.set(l.TEXTURE0),r.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),_.updatePaintBuffers(h));const b=c.constantOr(null);if(b&&r.imageAtlas){const t=r.imageAtlas,e=t.patternPositions[b.to.toString()],i=t.patternPositions[b.from.toString()];e&&i&&_.setConstantPatternPositions(e,i)}const w=e.translatePosMatrix(y.projMatrix,r,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(a){m=v.indexBuffer2,g=v.segments2;const t=e.terrain&&e.terrain.renderingToTexture?e.terrain.drapeBufferSize:[l.drawingBufferWidth,l.drawingBufferHeight];f="fillOutlinePattern"===d&&u?xi(w,e,h,r,t):_i(w,t)}else m=v.indexBuffer,g=v.segments,f=u?vi(w,e,h,r):yi(w);e.prepareDrawProgram(e.context,x,y.toUnwrapped()),x.draw(e.context,p,o,e.stencilModeForClipping(y),s,t.CullFaceMode.disabled,f,n.id,v.layoutVertexBuffer,m,g,n.paint,e.transform.zoom,_)}}function Yi(e,i,n,r,o,s,a){const l=e.context,c=l.gl,u=n.paint.get("fill-extrusion-pattern"),h=u.constantOr(1),p=n.getCrossfadeParameters(),d=n.paint.get("fill-extrusion-opacity");for(const f of r){const r=i.getTile(f),m=r.getBucket(n);if(!m)continue;const g=m.programConfigurations.get(n.id),y=e.useProgram(h?"fillExtrusionPattern":"fillExtrusion",g);if(e.terrain){const t=e.terrain;if(!m.enableTerrain)continue;if(t.setupElevationDraw(r,y,{useMeterToDem:!0}),Qi(l,i,f,m,n,t),!m.centroidVertexBuffer){const t=y.attributes.a_centroid_pos;void 0!==t&&c.vertexAttrib2f(t,0,0)}}h&&(e.context.activeTexture.set(c.TEXTURE0),r.imageAtlasTexture.bind(c.LINEAR,c.CLAMP_TO_EDGE),g.updatePaintBuffers(p));const v=u.constantOr(null);if(v&&r.imageAtlas){const t=r.imageAtlas,e=t.patternPositions[v.to.toString()],i=t.patternPositions[v.from.toString()];e&&i&&g.setConstantPatternPositions(e,i)}const _=e.translatePosMatrix(f.projMatrix,r,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),x=n.paint.get("fill-extrusion-vertical-gradient"),b=h?gi(_,e,x,d,f,p,r):mi(_,e,x,d);e.prepareDrawProgram(l,y,f.toUnwrapped()),y.draw(l,l.gl.TRIANGLES,o,s,a,t.CullFaceMode.backCCW,b,n.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,n.paint,e.transform.zoom,g,e.terrain?m.centroidVertexBuffer:null)}}function Qi(e,i,n,r,o,s){const a=[e=>{let i=e.canonical.x-1,n=e.wrap;return i<0&&(i=(1<<e.canonical.z)-1,n--),new t.OverscaledTileID(e.overscaledZ,n,e.canonical.z,i,e.canonical.y)},e=>{let i=e.canonical.x+1,n=e.wrap;return i===1<<e.canonical.z&&(i=0,n++),new t.OverscaledTileID(e.overscaledZ,n,e.canonical.z,i,e.canonical.y)},e=>new t.OverscaledTileID(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,(0===e.canonical.y?1<<e.canonical.z:e.canonical.y)-1),e=>new t.OverscaledTileID(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y===(1<<e.canonical.z)-1?0:e.canonical.y+1)],l=t=>{const e=i.getSource().maxzoom,n=t=>{const e=i.getTileByID(t);if(e&&e.hasData())return e.getBucket(o)};let r,s,a;return(t.overscaledZ===t.canonical.z||t.overscaledZ>=e)&&(r=n(t.key)),t.overscaledZ>=e&&(s=n(t.calculateScaledKey(t.overscaledZ+1))),t.overscaledZ>e&&(a=n(t.calculateScaledKey(t.overscaledZ-1))),r||s||a},c=[0,0,0],u=(e,i)=>(c[0]=Math.min(e.min.y,i.min.y),c[1]=Math.max(e.max.y,i.max.y),c[2]=t.EXTENT-i.min.x>e.max.x?i.min.x-t.EXTENT:e.max.x,c),h=(e,i)=>(c[0]=Math.min(e.min.x,i.min.x),c[1]=Math.max(e.max.x,i.max.x),c[2]=t.EXTENT-i.min.y>e.max.y?i.min.y-t.EXTENT:e.max.y,c),p=[(t,e)=>u(t,e),(t,e)=>u(e,t),(t,e)=>h(t,e),(t,e)=>h(e,t)],d=new t.pointGeometry(0,0);let f,m,g;const y=(e,i,r,o,a)=>{const l=[[o?r:e,o?e:r,0],[o?r:i,o?i:r,0]],c=a<0?t.EXTENT+a:a,u=[o?c:(e+i)/2,o?(e+i)/2:c,0];return 0===r&&a<0||0!==r&&a>0?s.getForTilePoints(g,[u],!0,m):l.push(u),s.getForTilePoints(n,l,!0,f),Math.max(l[0][2],l[1][2],u[2])/s.exaggeration()};for(let e=0;e<4;e++){const i=r.borders[e];if(0===i.length&&(r.borderDone[e]=!0),r.borderDone[e])continue;const o=g=a[e](n),c=l(o);if(!c||!c.enableTerrain)continue;if(m=s.findDEMTileFor(o),!m||!m.dem)continue;if(!f){const t=s.findDEMTileFor(n);if(!t||!t.dem)return;f=t}const u=(e<2?1:5)-e,h=c.borders[u];let v=0;for(let n=0;n<i.length;n++){const o=r.featuresOnBorder[i[n]],s=o.borders[e];let a;for(;v<h.length&&(a=c.featuresOnBorder[h[v]],!(a.borders[u][1]>s[0]+3));)c.borderDone[u]||c.encodeCentroid(void 0,a,!1),v++;if(a&&v<h.length){const i=v;let n=0;for(;!(a.borders[u][0]>s[1]-3)&&(n++,++v!==h.length);)a=c.featuresOnBorder[h[v]];if(a=c.featuresOnBorder[h[i]],o.intersectsCount()>1||a.intersectsCount()>1||1!==n){1!==n&&(v=i),r.encodeCentroid(void 0,o,!1),c.borderDone[u]||c.encodeCentroid(void 0,a,!1);continue}const l=p[e](o,a),f=e%2?t.EXTENT-1:0;d.x=y(l[0],Math.min(t.EXTENT-1,l[1]),f,e<2,l[2]),d.y=0,r.encodeCentroid(d,o,!1),c.borderDone[u]||c.encodeCentroid(d,a,!1)}else r.encodeCentroid(void 0,o,!1)}r.borderDone[e]=r.needsCentroidUpdate=!0,c.borderDone[u]||(c.borderDone[u]=c.needsCentroidUpdate=!0)}(r.needsCentroidUpdate||!r.centroidVertexBuffer&&0!==r.centroidVertexArray.length)&&r.uploadCentroid(e)}const Ji=new t.Color(1,0,0,1),Ki=new t.Color(0,1,0,1),$i=new t.Color(0,0,1,1),tn=new t.Color(1,0,1,1),en=new t.Color(0,1,1,1);function nn(t,e,i,n){on(t,0,e+i/2,t.transform.width,i,n)}function rn(t,e,i,n){on(t,e-i/2,0,i,t.transform.height,n)}function on(e,i,n,r,o,s){const a=e.context,l=a.gl;l.enable(l.SCISSOR_TEST),l.scissor(i*t.exported.devicePixelRatio,n*t.exported.devicePixelRatio,r*t.exported.devicePixelRatio,o*t.exported.devicePixelRatio),a.clear({color:s}),l.disable(l.SCISSOR_TEST)}function sn(e,i,n){const r=e.context,o=r.gl,s=n.projMatrix,a=e.useProgram("debug"),l=i.getTileByID(n.key);e.terrain&&e.terrain.setupElevationDraw(l,a);const c=t.DepthMode.disabled,u=t.StencilMode.disabled,h=e.colorModeForRenderPass(),p="$debug";r.activeTexture.set(o.TEXTURE0),e.emptyTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE),a.draw(r,o.LINE_STRIP,c,u,h,t.CullFaceMode.disabled,Ei(s,t.Color.red),p,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);const d=l.latestRawTileData,f=Math.floor((d&&d.byteLength||0)/1024),m=i.getTile(n).tileSize,g=512/Math.min(m,512)*(n.overscaledZ/e.transform.zoom)*.5;let y=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(y+=` => ${n.overscaledZ}`),function(t,e){t.initDebugOverlayCanvas();const i=t.debugOverlayCanvas,n=t.context.gl,r=t.debugOverlayCanvas.getContext("2d");r.clearRect(0,0,i.width,i.height),r.shadowColor="white",r.shadowBlur=2,r.lineWidth=1.5,r.strokeStyle="white",r.textBaseline="top",r.font="bold 36px Open Sans, sans-serif",r.fillText(e,5,5),r.strokeText(e,5,5),t.debugOverlayTexture.update(i),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(e,`${y} ${f}kb`),a.draw(r,o.TRIANGLES,c,u,t.ColorMode.alphaBlended,t.CullFaceMode.disabled,Ei(s,t.Color.transparent,g),p,e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}const an=t.createLayout([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:ln}=an;function cn(t,e,i,n){t.emplaceBack(e,i,n)}class un{constructor(e){this.vertexArray=new t.StructArrayLayout3f12,this.indices=new t.StructArrayLayout3ui6,cn(this.vertexArray,-1,-1,1),cn(this.vertexArray,1,-1,1),cn(this.vertexArray,-1,1,1),cn(this.vertexArray,1,1,1),cn(this.vertexArray,-1,-1,-1),cn(this.vertexArray,1,-1,-1),cn(this.vertexArray,-1,1,-1),cn(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=e.createVertexBuffer(this.vertexArray,ln),this.indexBuffer=e.createIndexBuffer(this.indices),this.segment=t.SegmentVector.simpleSegment(0,0,36,12)}}function hn(e,i,n,r,o,s){const a=e.gl,l=i.paint.get("sky-atmosphere-color"),c=i.paint.get("sky-atmosphere-halo-color"),u=i.paint.get("sky-atmosphere-sun-intensity"),h=((t,e,i,n,r)=>({u_matrix_3f:t,u_sun_direction:e,u_sun_intensity:i,u_color_tint_r:[n.r,n.g,n.b,n.a],u_color_tint_m:[r.r,r.g,r.b,r.a],u_luminance:5e-5}))(t.fromMat4([],r),o,u,l,c);a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_CUBE_MAP_POSITIVE_X+s,i.skyboxTexture,0),n.draw(e,a.TRIANGLES,t.DepthMode.disabled,t.StencilMode.disabled,t.ColorMode.unblended,t.CullFaceMode.frontCW,h,"skyboxCapture",i.skyboxGeometry.vertexBuffer,i.skyboxGeometry.indexBuffer,i.skyboxGeometry.segment)}const pn={symbol:function(e,i,n,r,o){if("translucent"!==e.renderPass)return;const s=t.StencilMode.disabled,a=e.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(e,i,n,r,o,s,a){const l=i.transform,c="map"===o,u="map"===s;for(const o of e){const e=r.getTile(o),s=e.getBucket(n);if(!s||!s.text||!s.text.segments.get().length)continue;const h=t.evaluateSizeForZoom(s.textSizeData,l.zoom),p=C(e,1,i.transform.zoom),d=Zt(o.projMatrix,u,c,i.transform,p),f="none"!==n.layout.get("icon-text-fit")&&s.hasIconData();if(h){const i=Math.pow(2,l.zoom-e.tileID.overscaledZ),n=l.elevation;Hi(s,c,u,a,t.symbolSize,l,d,o.projMatrix,i,h,f,n?t=>n.getAtTileOffset(o,t.x,t.y):t=>0)}}}(r,e,n,i,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),o),0!==n.paint.get("icon-opacity").constantOr(1)&&qi(e,i,n,r,!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"),s,a),0!==n.paint.get("text-opacity").constantOr(1)&&qi(e,i,n,r,!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"),s,a),i.map.showCollisionBoxes&&(Ui(e,i,n,r,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),Ui(e,i,n,r,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))},circle:function(e,i,n,r){if("translucent"!==e.renderPass)return;const o=n.paint.get("circle-opacity"),s=n.paint.get("circle-stroke-width"),a=n.paint.get("circle-stroke-opacity"),l=void 0!==n.layout.get("circle-sort-key").constantOr(1);if(0===o.constantOr(1)&&(0===s.constantOr(1)||0===a.constantOr(1)))return;const c=e.context,u=c.gl,h=e.depthModeForSublayer(0,t.DepthMode.ReadOnly),p=t.StencilMode.disabled,d=e.colorModeForRenderPass(),f=[];for(let o=0;o<r.length;o++){const s=r[o],a=i.getTile(s),c=a.getBucket(n);if(!c)continue;const u=c.programConfigurations.get(n.id),h=wi(n),p={programConfiguration:u,program:e.useProgram("circle",u,h),layoutVertexBuffer:c.layoutVertexBuffer,indexBuffer:c.indexBuffer,uniformValues:bi(e,s,a,n),tile:a};if(l){const e=c.segments.get();for(const i of e)f.push({segments:new t.SegmentVector([i]),sortKey:i.sortKey,state:p})}else f.push({segments:c.segments,sortKey:0,state:p})}l&&f.sort(((t,e)=>t.sortKey-e.sortKey));for(const i of f){const{programConfiguration:r,program:o,layoutVertexBuffer:s,indexBuffer:a,uniformValues:l,tile:f}=i.state,m=i.segments;e.terrain&&e.terrain.setupElevationDraw(f,o,{useDepthForOcclusion:!0}),e.prepareDrawProgram(c,o,f.tileID.toUnwrapped()),o.draw(c,u.TRIANGLES,h,p,d,t.CullFaceMode.disabled,l,n.id,s,a,m,n.paint,e.transform.zoom,r)}},heatmap:function(e,i,n,r){if(0!==n.paint.get("heatmap-opacity"))if("offscreen"===e.renderPass){const o=e.context,s=o.gl,a=t.StencilMode.disabled,l=new t.ColorMode([s.ONE,s.ONE],t.Color.transparent,[!0,!0,!0,!0]);!function(t,e,i){const n=t.gl;t.activeTexture.set(n.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);let r=i.heatmapFbo;if(r)n.bindTexture(n.TEXTURE_2D,r.colorAttachment.get()),t.bindFramebuffer.set(r.framebuffer);else{const o=n.createTexture();n.bindTexture(n.TEXTURE_2D,o),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),r=i.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4,!1),function(t,e,i,n){const r=t.gl;r.texImage2D(r.TEXTURE_2D,0,r.RGBA,e.width/4,e.height/4,0,r.RGBA,t.extRenderToTextureHalfFloat?t.extTextureHalfFloat.HALF_FLOAT_OES:r.UNSIGNED_BYTE,null),n.colorAttachment.set(i)}(t,e,o,r)}}(o,e,n),o.clear({color:t.Color.transparent});for(let c=0;c<r.length;c++){const u=r[c];if(i.hasRenderableParent(u))continue;const h=i.getTile(u),p=h.getBucket(n);if(!p)continue;const d=p.programConfigurations.get(n.id),f=e.useProgram("heatmap",d),{zoom:m}=e.transform;e.terrain&&e.terrain.setupElevationDraw(h,f),e.prepareDrawProgram(o,f,u.toUnwrapped()),f.draw(o,s.TRIANGLES,t.DepthMode.disabled,a,l,t.CullFaceMode.disabled,Si(u.projMatrix,h,m,n.paint.get("heatmap-intensity")),n.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,n.paint,e.transform.zoom,d)}o.viewport.set([0,0,e.width,e.height])}else"translucent"===e.renderPass&&(e.context.setColorMode(e.colorModeForRenderPass()),function(e,i){const n=e.context,r=n.gl,o=i.heatmapFbo;if(!o)return;n.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,o.colorAttachment.get()),n.activeTexture.set(r.TEXTURE1);let s=i.colorRampTexture;s||(s=i.colorRampTexture=new t.Texture(n,i.colorRamp,r.RGBA)),s.bind(r.LINEAR,r.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(n,r.TRIANGLES,t.DepthMode.disabled,t.StencilMode.disabled,e.colorModeForRenderPass(),t.CullFaceMode.disabled,((e,i,n,r)=>{const o=t.create$1();t.ortho(o,0,e.width,e.height,0,0,1);const s=e.context.gl;return{u_matrix:o,u_world:[s.drawingBufferWidth,s.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:i.paint.get("heatmap-opacity")}})(e,i),i.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,i.paint,e.transform.zoom)}(e,n))},line:function(e,i,n,r){if("translucent"!==e.renderPass)return;const o=n.paint.get("line-opacity"),s=n.paint.get("line-width");if(0===o.constantOr(1)||0===s.constantOr(1))return;const a=e.depthModeForSublayer(0,t.DepthMode.ReadOnly),l=e.colorModeForRenderPass(),c=n.paint.get("line-dasharray"),u=c.constantOr(1),h=n.layout.get("line-cap"),p=n.paint.get("line-pattern"),d=p.constantOr(1),f=n.paint.get("line-gradient"),m=n.getCrossfadeParameters(),g=d?"linePattern":u?"lineSDF":f?"lineGradient":"line",y=e.context,v=y.gl;for(const o of r){const r=i.getTile(o);if(d&&!r.patternsLoaded())continue;const s=r.getBucket(n);if(!s)continue;e.prepareDrawTile(o);const _=s.programConfigurations.get(n.id),x=e.useProgram(g,_),b=p.constantOr(null);if(b&&r.imageAtlas){const t=r.imageAtlas,e=t.patternPositions[b.to.toString()],i=t.patternPositions[b.from.toString()];e&&i&&_.setConstantPatternPositions(e,i)}const w=c.constantOr(null),A=h.constantOr(null);if(!d&&w&&A&&r.lineAtlas){const t=r.lineAtlas,e=t.getDash(w.to,A),i=t.getDash(w.from,A);e&&i&&_.setConstantPatternPositions(e,i)}const E=e.terrain?o.projMatrix:null,S=d?Ii(e,r,n,m,E):u?Ci(e,r,n,m,E):f?Ti(e,r,n,E,s.lineClipsArray.length):Mi(e,r,n,E);if(d)y.activeTexture.set(v.TEXTURE0),r.imageAtlasTexture.bind(v.LINEAR,v.CLAMP_TO_EDGE),_.updatePaintBuffers(m);else if(u)y.activeTexture.set(v.TEXTURE0),r.lineAtlasTexture.bind(v.LINEAR,v.REPEAT),_.updatePaintBuffers(m);else if(f){const r=s.gradients[n.id];let a=r.texture;if(n.gradientVersion!==r.version){let l=256;if(n.stepInterpolant){const n=i.getSource().maxzoom,r=o.canonical.z===n?Math.ceil(1<<e.transform.maxZoom-o.canonical.z):1;l=t.clamp(t.nextPowerOfTwo(s.maxLineLength/t.EXTENT*1024*r),256,y.maxTextureSize)}r.gradient=t.renderColorRamp({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:l,image:r.gradient||void 0,clips:s.lineClipsArray}),r.texture?r.texture.update(r.gradient):r.texture=new t.Texture(y,r.gradient,v.RGBA),r.version=n.gradientVersion,a=r.texture}y.activeTexture.set(v.TEXTURE0),a.bind(n.stepInterpolant?v.NEAREST:v.LINEAR,v.CLAMP_TO_EDGE)}e.prepareDrawProgram(y,x,o.toUnwrapped()),x.draw(y,v.TRIANGLES,a,e.stencilModeForClipping(o),l,t.CullFaceMode.disabled,S,n.id,s.layoutVertexBuffer,s.indexBuffer,s.segments,n.paint,e.transform.zoom,_,s.layoutVertexBuffer2)}},fill:function(e,i,n,r){const o=n.paint.get("fill-color"),s=n.paint.get("fill-opacity");if(0===s.constantOr(1))return;const a=e.colorModeForRenderPass(),l=n.paint.get("fill-pattern"),c=e.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===o.constantOr(t.Color.transparent).a&&1===s.constantOr(0)?"opaque":"translucent";if(e.renderPass===c){const o=e.depthModeForSublayer(1,"opaque"===e.renderPass?t.DepthMode.ReadWrite:t.DepthMode.ReadOnly);Zi(e,i,n,r,o,a,!1)}if("translucent"===e.renderPass&&n.paint.get("fill-antialias")){const o=e.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,t.DepthMode.ReadOnly);Zi(e,i,n,r,o,a,!0)}},"fill-extrusion":function(e,i,n,r){const o=n.paint.get("fill-extrusion-opacity");if(0!==o&&"translucent"===e.renderPass){const s=new t.DepthMode(e.context.gl.LEQUAL,t.DepthMode.ReadWrite,e.depthRangeFor3D);if(1!==o||n.paint.get("fill-extrusion-pattern").constantOr(1))Yi(e,i,n,r,s,t.StencilMode.disabled,t.ColorMode.disabled),Yi(e,i,n,r,s,e.stencilModeFor3D(),e.colorModeForRenderPass());else{const o=e.colorModeForRenderPass();Yi(e,i,n,r,s,t.StencilMode.disabled,o)}}},hillshade:function(e,i,n,r){if("offscreen"!==e.renderPass&&"translucent"!==e.renderPass)return;const o=e.context,s=e.depthModeForSublayer(0,t.DepthMode.ReadOnly),a=e.colorModeForRenderPass(),l=e.terrain&&e.terrain.renderingToTexture,[c,u]="translucent"!==e.renderPass||l?[{},r]:e.stencilConfigForOverlap(r);for(const r of u){const o=i.getTile(r);if(o.needsHillshadePrepare&&"offscreen"===e.renderPass)ti(e,o,n,s,t.StencilMode.disabled,a);else if("translucent"===e.renderPass){const t=l&&e.terrain?e.terrain.stencilModeForRTTOverlap(r):c[r.overscaledZ];Ke(e,r,o,n,s,t,a)}}o.viewport.set([0,0,e.width,e.height])},raster:function(e,i,n,r,o,s){if("translucent"!==e.renderPass)return;if(0===n.paint.get("raster-opacity"))return;if(!r.length)return;const a=e.context,l=a.gl,c=i.getSource(),u=e.useProgram("raster"),h=e.colorModeForRenderPass(),p=e.terrain&&e.terrain.renderingToTexture,[d,f]=c instanceof Et||p?[{},r]:e.stencilConfigForOverlap(r),m=f[f.length-1].overscaledZ,g=!e.options.moving;for(const r of f){const o=p?t.DepthMode.disabled:e.depthModeForSublayer(r.overscaledZ-m,1===n.paint.get("raster-opacity")?t.DepthMode.ReadWrite:t.DepthMode.ReadOnly,l.LESS),f=r.toUnwrapped(),y=i.getTile(r);if(p&&(!y||!y.hasData()))continue;const v=p?r.projMatrix:e.transform.calculateProjMatrix(f,g),_=e.terrain&&p?e.terrain.stencilModeForRTTOverlap(r):d[r.overscaledZ],x=s?0:n.paint.get("raster-fade-duration");y.registerFadeDuration(x);const b=i.findLoadedParent(r,0),w=li(y,b,i,e.transform,x);let A,E;e.terrain&&e.terrain.prepareDrawTile(r);const S="nearest"===n.paint.get("raster-resampling")?l.NEAREST:l.LINEAR;a.activeTexture.set(l.TEXTURE0),y.texture.bind(S,l.CLAMP_TO_EDGE,l.LINEAR_MIPMAP_NEAREST),a.activeTexture.set(l.TEXTURE1),b?(b.texture.bind(S,l.CLAMP_TO_EDGE,l.LINEAR_MIPMAP_NEAREST),A=Math.pow(2,b.tileID.overscaledZ-y.tileID.overscaledZ),E=[y.tileID.canonical.x*A%1,y.tileID.canonical.y*A%1]):y.texture.bind(S,l.CLAMP_TO_EDGE,l.LINEAR_MIPMAP_NEAREST);const M=Di(v,E||[0,0],A||1,w,n);e.prepareDrawProgram(a,u,f),c instanceof Et?u.draw(a,l.TRIANGLES,o,t.StencilMode.disabled,h,t.CullFaceMode.disabled,M,n.id,c.boundsBuffer,e.quadTriangleIndexBuffer,c.boundsSegments):u.draw(a,l.TRIANGLES,o,_,h,t.CullFaceMode.disabled,M,n.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}},background:function(e,i,n,r){const o=n.paint.get("background-color"),s=n.paint.get("background-opacity");if(0===s)return;const a=e.context,l=a.gl,c=e.transform,u=c.tileSize,h=n.paint.get("background-pattern");if(e.isPatternMissing(h))return;const p=!h&&1===o.a&&1===s&&e.opaquePassEnabledForLayer()?"opaque":"translucent";if(e.renderPass!==p)return;const d=t.StencilMode.disabled,f=e.depthModeForSublayer(0,"opaque"===p?t.DepthMode.ReadWrite:t.DepthMode.ReadOnly),m=e.colorModeForRenderPass(),g=e.useProgram(h?"backgroundPattern":"background"),y=r||c.coveringTiles({tileSize:u});h&&(a.activeTexture.set(l.TEXTURE0),e.imageManager.bind(e.context));const v=n.getCrossfadeParameters();for(const i of y){const c=i.toUnwrapped(),p=r?i.projMatrix:e.transform.calculateProjMatrix(c);e.prepareDrawTile(i);const y=h?zi(p,s,e,h,{tileID:i,tileSize:u},v):Bi(p,s,o);e.prepareDrawProgram(a,g,c),g.draw(a,l.TRIANGLES,f,d,m,t.CullFaceMode.disabled,y,n.id,e.tileExtentBuffer,e.quadTriangleIndexBuffer,e.tileExtentSegments)}},sky:function(e,i,n){const r=n.paint.get("sky-opacity");if(0===r)return;const o=e.context,s=n.paint.get("sky-type"),a=new t.DepthMode(o.gl.LEQUAL,t.DepthMode.ReadOnly,[0,1]),l=e.frameCounter/1e3%1;"atmosphere"===s?"offscreen"===e.renderPass?n.needsSkyboxCapture(e)&&(function(e,i,n,r){const o=e.context,s=o.gl;let a=i.skyboxFbo;if(!a){a=i.skyboxFbo=o.createFramebuffer(32,32,!1),i.skyboxGeometry=new un(o),i.skyboxTexture=o.gl.createTexture(),s.bindTexture(s.TEXTURE_CUBE_MAP,i.skyboxTexture),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MIN_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MAG_FILTER,s.LINEAR);for(let t=0;t<6;++t)s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,s.RGBA,32,32,0,s.RGBA,s.UNSIGNED_BYTE,null)}o.bindFramebuffer.set(a.framebuffer),o.viewport.set([0,0,32,32]);const l=i.getCenter(e,!0),c=e.useProgram("skyboxCapture"),u=new Float64Array(16);t.identity(u),t.rotateY(u,u,.5*-Math.PI),hn(o,i,c,u,l,0),t.identity(u),t.rotateY(u,u,.5*Math.PI),hn(o,i,c,u,l,1),t.identity(u),t.rotateX(u,u,.5*-Math.PI),hn(o,i,c,u,l,2),t.identity(u),t.rotateX(u,u,.5*Math.PI),hn(o,i,c,u,l,3),t.identity(u),hn(o,i,c,u,l,4),t.identity(u),t.rotateY(u,u,Math.PI),hn(o,i,c,u,l,5),o.viewport.set([0,0,e.width,e.height])}(e,n),n.markSkyboxValid(e)):"sky"===e.renderPass&&function(e,i,n,r,o){const s=e.context,a=s.gl,l=e.transform,c=e.useProgram("skybox");s.activeTexture.set(a.TEXTURE0),a.bindTexture(a.TEXTURE_CUBE_MAP,i.skyboxTexture);const u=((t,e,i,n,r)=>({u_matrix:t,u_sun_direction:e,u_cubemap:0,u_opacity:n,u_temporal_offset:r}))(l.skyboxMatrix,i.getCenter(e,!1),0,r,o);e.prepareDrawProgram(s,c),c.draw(s,a.TRIANGLES,n,t.StencilMode.disabled,e.colorModeForRenderPass(),t.CullFaceMode.backCW,u,"skybox",i.skyboxGeometry.vertexBuffer,i.skyboxGeometry.indexBuffer,i.skyboxGeometry.segment)}(e,n,a,r,l):"gradient"===s&&"sky"===e.renderPass&&function(e,i,n,r,o){const s=e.context,a=s.gl,l=e.transform,c=e.useProgram("skyboxGradient");i.skyboxGeometry||(i.skyboxGeometry=new un(s)),s.activeTexture.set(a.TEXTURE0);let u=i.colorRampTexture;u||(u=i.colorRampTexture=new t.Texture(s,i.colorRamp,a.RGBA)),u.bind(a.LINEAR,a.CLAMP_TO_EDGE);const h=((e,i,n,r,o)=>({u_matrix:e,u_color_ramp:0,u_center_direction:i,u_radius:t.degToRad(n),u_opacity:r,u_temporal_offset:o}))(l.skyboxMatrix,i.getCenter(e,!1),i.paint.get("sky-gradient-radius"),r,o);e.prepareDrawProgram(s,c),c.draw(s,a.TRIANGLES,n,t.StencilMode.disabled,e.colorModeForRenderPass(),t.CullFaceMode.backCW,h,"skyboxGradient",i.skyboxGeometry.vertexBuffer,i.skyboxGeometry.indexBuffer,i.skyboxGeometry.segment)}(e,n,a,r,l)},debug:function(t,e,i){for(let n=0;n<i.length;n++)sn(t,e,i[n])},custom:function(e,i,n){const r=e.context,o=n.implementation;if("offscreen"===e.renderPass){const t=o.prerender;t&&(e.setCustomLayerDefaults(),r.setColorMode(e.colorModeForRenderPass()),t.call(o,r.gl,e.transform.customLayerMatrix()),r.setDirty(),e.setBaseState())}else if("translucent"===e.renderPass){e.setCustomLayerDefaults(),r.setColorMode(e.colorModeForRenderPass()),r.setStencilMode(t.StencilMode.disabled);const i="3d"===o.renderingMode?new t.DepthMode(e.context.gl.LEQUAL,t.DepthMode.ReadWrite,e.depthRangeFor3D):e.depthModeForSublayer(0,t.DepthMode.ReadOnly);r.setDepthMode(i),o.render(r.gl,e.transform.customLayerMatrix()),r.setDirty(),e.setBaseState(),r.bindFramebuffer.set(null)}}};class dn{constructor(e,i){this.context=new xt(e),this.transform=i,this._tileTextures={},this.frameCopies=[],this.loadTimeStamps=[],this.setup(),this.numSublayers=t.SourceCache.maxUnderzooming+t.SourceCache.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new ke,this.gpuTimers={},this.frameCounter=0}updateTerrain(t,e){const i=!!t&&!!t.terrain;if(!(i||this._terrain&&this._terrain.enabled))return;this._terrain||(this._terrain=new hi(this,t));const n=this._terrain;this.transform.elevation=i?n:null,n.update(t,this.transform,e)}_updateFog(t){const e=t.fog;if(!e||e.getOpacity(this.transform.pitch)<1||e.properties.get("horizon-blend")<.03)return void(this.transform.fogCullDistSq=null);const[i,n]=e.getFovAdjustedRange(this.transform._fov),r=i+.78*(n-i);this.transform.fogCullDistSq=r*r}get terrain(){return this._terrain&&this._terrain.enabled?this._terrain:null}resize(e,i){if(this.width=e*t.exported.devicePixelRatio,this.height=i*t.exported.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const t of this.style.order)this.style._layers[t].resize()}setup(){const e=this.context,i=new t.StructArrayLayout2i4;i.emplaceBack(0,0),i.emplaceBack(t.EXTENT,0),i.emplaceBack(0,t.EXTENT),i.emplaceBack(t.EXTENT,t.EXTENT),this.tileExtentBuffer=e.createVertexBuffer(i,t.posAttributes.members),this.tileExtentSegments=t.SegmentVector.simpleSegment(0,0,4,2);const n=new t.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(t.EXTENT,0),n.emplaceBack(0,t.EXTENT),n.emplaceBack(t.EXTENT,t.EXTENT),this.debugBuffer=e.createVertexBuffer(n,t.posAttributes.members),this.debugSegments=t.SegmentVector.simpleSegment(0,0,4,5);const r=new t.StructArrayLayout4i8;r.emplaceBack(0,0,0,0),r.emplaceBack(t.EXTENT,0,t.EXTENT,0),r.emplaceBack(0,t.EXTENT,0,t.EXTENT),r.emplaceBack(t.EXTENT,t.EXTENT,t.EXTENT,t.EXTENT),this.rasterBoundsBuffer=e.createVertexBuffer(r,At.members),this.rasterBoundsSegments=t.SegmentVector.simpleSegment(0,0,4,2);const o=new t.StructArrayLayout2i4;o.emplaceBack(0,0),o.emplaceBack(1,0),o.emplaceBack(0,1),o.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(o,t.posAttributes.members),this.viewportSegments=t.SegmentVector.simpleSegment(0,0,4,2);const s=new t.StructArrayLayout1ui2;s.emplaceBack(0),s.emplaceBack(1),s.emplaceBack(3),s.emplaceBack(2),s.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(s);const a=new t.StructArrayLayout3ui6;a.emplaceBack(0,1,2),a.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(a),this.emptyTexture=new t.Texture(e,{width:1,height:1,data:new Uint8Array([0,0,0,0])},e.gl.RGBA),this.identityMat=t.create$1();const l=this.context.gl;this.stencilClearMode=new t.StencilMode({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO),this.loadTimeStamps.push(t.window.performance.now())}clearStencil(){const e=this.context,i=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const n=t.create$1();t.ortho(n,0,this.width,this.height,0,0,1),t.scale$1(n,n,[i.drawingBufferWidth,i.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,i.TRIANGLES,t.DepthMode.disabled,this.stencilClearMode,t.ColorMode.disabled,t.CullFaceMode.disabled,ai(n),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(e,i,n){if(!(i&&this.currentStencilSource!==i.id&&e.isTileClipped()&&n&&n.length))return;this.currentStencilSource=i.id;const r=this.context,o=r.gl;this.nextStencilID+n.length>256&&this.clearStencil(),r.setColorMode(t.ColorMode.disabled),r.setDepthMode(t.DepthMode.disabled);const s=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const e of n){const i=this._tileClippingMaskIDs[e.key]=this.nextStencilID++;s.draw(r,o.TRIANGLES,t.DepthMode.disabled,new t.StencilMode({func:o.ALWAYS,mask:0},i,255,o.KEEP,o.KEEP,o.REPLACE),t.ColorMode.disabled,t.CullFaceMode.disabled,ai(e.projMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const e=this.nextStencilID++,i=this.context.gl;return new t.StencilMode({func:i.NOTEQUAL,mask:255},e,255,i.KEEP,i.KEEP,i.REPLACE)}stencilModeForClipping(e){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(e);const i=this.context.gl;return new t.StencilMode({func:i.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,i.KEEP,i.KEEP,i.REPLACE)}stencilConfigForOverlap(e){const i=this.context.gl,n=e.sort(((t,e)=>e.overscaledZ-t.overscaledZ)),r=n[n.length-1].overscaledZ,o=n[0].overscaledZ-r+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();const e={};for(let n=0;n<o;n++)e[n+r]=new t.StencilMode({func:i.GEQUAL,mask:255},n+this.nextStencilID,255,i.KEEP,i.KEEP,i.REPLACE);return this.nextStencilID+=o,[e,n]}return[{[r]:t.StencilMode.disabled},n]}colorModeForRenderPass(){const e=this.context.gl;if(this._showOverdrawInspector){const i=1/8;return new t.ColorMode([e.CONSTANT_COLOR,e.ONE],new t.Color(i,i,i,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?t.ColorMode.unblended:t.ColorMode.alphaBlended}depthModeForSublayer(e,i,n){if(!this.opaquePassEnabledForLayer())return t.DepthMode.disabled;const r=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new t.DepthMode(n||this.context.gl.LEQUAL,i,[r,r])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(e,i){this.style=e,this.options=i,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(t.exported.now()),this.imageManager.beginFrame();const n=this.style.order,r=this.style._sourceCaches;for(const t in r){const e=r[t];e.used&&e.prepare(this.context)}const o={},s={},a={};for(const t in r){const e=r[t];o[t]=e.getVisibleCoordinates(),s[t]=o[t].slice().reverse(),a[t]=e.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let t=0;t<n.length;t++)if(this.style._layers[n[t]].is3D()){this.opaquePassCutoff=t;break}if(this.terrain&&(this.terrain.updateTileBinding(a),this.opaquePassCutoff=0),!t.isMapAuthenticated(this.context.gl))return;this.renderPass="offscreen";for(const t of n){const i=this.style._layers[t],n=e._getLayerSourceCache(i);if(!i.hasOffscreenPass()||i.isHidden(this.transform.zoom))continue;const r=n?s[n.id]:void 0;("custom"===i.type||i.isSky()||r&&r.length)&&this.renderLayer(this,n,i,r)}this.depthRangeFor3D=[0,1-(e.order.length+2)*this.numSublayers*this.depthEpsilon],this.terrain&&(this.style.hasSymbolLayers()||this.style.hasCircleLayers())&&this.terrain.drawDepth(),this.context.bindFramebuffer.set(null),this.context.viewport.set([0,0,this.width,this.height]);let l=t.Color.transparent;if(this.style.fog&&(l=this.style.fog.properties.get("color")),this.context.clear({color:i.showOverdrawInspector?t.Color.black:l,depth:1}),this.clearStencil(),this._showOverdrawInspector=i.showOverdrawInspector,this.renderPass="opaque",!this.terrain)for(this.currentLayer=n.length-1;this.currentLayer>=0;this.currentLayer--){const t=this.style._layers[n[this.currentLayer]],i=e._getLayerSourceCache(t);if(t.isSky())continue;const r=i?s[i.id]:void 0;this._renderTileClippingMasks(t,i,r),this.renderLayer(this,i,t,r)}if(this.renderPass="sky",this.transform.isHorizonVisible())for(this.currentLayer=0;this.currentLayer<n.length;this.currentLayer++){const t=this.style._layers[n[this.currentLayer]],i=e._getLayerSourceCache(t);t.isSky()&&this.renderLayer(this,i,t,i?s[i.id]:void 0)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<n.length;){const t=this.style._layers[n[this.currentLayer]],i=e._getLayerSourceCache(t);if(t.isSky()){++this.currentLayer;continue}if(this.terrain&&this.style.isLayerDraped(t)){if(t.isHidden(this.transform.zoom)){++this.currentLayer;continue}this.currentLayer=this.terrain.renderBatch(this.currentLayer);continue}const r=i?("symbol"===t.type?a:s)[i.id]:void 0;this._renderTileClippingMasks(t,i,i?o[i.id]:void 0),this.renderLayer(this,i,t,r),++this.currentLayer}if(this.terrain&&this.terrain.postRender(),this.options.showTileBoundaries||this.options.showQueryGeometry){let i=null;t.values(this.style._layers).forEach((t=>{const n=e._getLayerSourceCache(t);n&&!t.isHidden(this.transform.zoom)&&(!i||i.getSource().maxzoom<n.getSource().maxzoom)&&(i=n)})),i&&this.options.showTileBoundaries&&pn.debug(this,i,i.getVisibleCoordinates())}this.options.showPadding&&function(t){const e=t.transform.padding;nn(t,t.transform.height-(e.top||0),3,Ji),nn(t,e.bottom||0,3,Ki),rn(t,e.left||0,3,$i),rn(t,t.transform.width-(e.right||0),3,tn);const i=t.transform.centerPoint;!function(t,e,i,n){on(t,e-1,i-10,2,20,n),on(t,e-10,i-1,20,2,n)}(t,i.x,t.transform.height-i.y,en)}(this),this.context.setDefault(),this.frameCounter=(this.frameCounter+1)%t.MAX_SAFE_INTEGER,this.tileLoaded&&this.options.speedIndexTiming&&(this.loadTimeStamps.push(t.window.performance.now()),this.saveCanvasCopy())}renderLayer(t,e,i,n){i.isHidden(this.transform.zoom)||("background"===i.type||"sky"===i.type||"custom"===i.type||n&&n.length)&&(this.id=i.id,this.gpuTimingStart(i),pn[i.type](t,e,i,n,this.style.placement.variableOffsets,this.options.isInitialLoad),this.gpuTimingEnd())}gpuTimingStart(t){if(!this.options.gpuTiming)return;const e=this.context.extTimerQuery;let i=this.gpuTimers[t.id];i||(i=this.gpuTimers[t.id]={calls:0,cpuTime:0,query:e.createQueryEXT()}),i.calls++,e.beginQueryEXT(e.TIME_ELAPSED_EXT,i.query)}gpuTimingEnd(){if(!this.options.gpuTiming)return;const t=this.context.extTimerQuery;t.endQueryEXT(t.TIME_ELAPSED_EXT)}collectGpuTimers(){const t=this.gpuTimers;return this.gpuTimers={},t}queryGpuTimers(t){const e={};for(const i in t){const n=t[i],r=this.context.extTimerQuery,o=r.getQueryObjectEXT(n.query,r.QUERY_RESULT_EXT)/1e6;r.deleteQueryEXT(n.query),e[i]=o}return e}translatePosMatrix(e,i,n,r,o){if(!n[0]&&!n[1])return e;const s=o?"map"===r?this.transform.angle:0:"viewport"===r?-this.transform.angle:0;if(s){const t=Math.sin(s),e=Math.cos(s);n=[n[0]*e-n[1]*t,n[0]*t+n[1]*e]}const a=[o?n[0]:C(i,n[0],this.transform.zoom),o?n[1]:C(i,n[1],this.transform.zoom),0],l=new Float32Array(16);return t.translate(l,e,a),l}saveTileTexture(t){const e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]}getTileTexture(t){const e=this._tileTextures[t];return e&&e.length>0?e.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;const e=this.imageManager.getPattern(t.from.toString()),i=this.imageManager.getPattern(t.to.toString());return!e||!i}currentGlobalDefines(){const t=this.terrain&&this.terrain.renderingToTexture,e=this.style&&this.style.fog,i=[];return this.terrain&&!this.terrain.renderingToTexture&&i.push("TERRAIN"),e&&!t&&0!==e.getOpacity(this.transform.pitch)&&i.push("FOG"),t&&i.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&i.push("OVERDRAW_INSPECTOR"),i}useProgram(t,e,i){this.cache=this.cache||{};const n=i||[],r=this.currentGlobalDefines().concat(n),o=di.cacheKey(t,r,e);return this.cache[o]||(this.cache[o]=new di(this.context,t,Ze[t],e,Fi[t],r)),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 t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this._terrain&&this._terrain.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}prepareDrawTile(t){this.terrain&&this.terrain.prepareDrawTile(t)}prepareDrawProgram(t,e,i){if(this.terrain&&this.terrain.renderingToTexture)return;const n=this.style.fog;if(n){const r=n.getOpacity(this.transform.pitch);0!==r&&e.setFogUniformValues(t,((t,e,i,n)=>{const r=e.properties.get("color"),o=t.frameCounter/1e3%1,s=[r.r/r.a,r.g/r.a,r.b/r.a,n];return{u_fog_matrix:i?t.transform.calculateFogTileMatrix(i):t.identityMat,u_fog_range:e.getFovAdjustedRange(t.transform._fov),u_fog_color:s,u_fog_horizon_blend:e.properties.get("horizon-blend"),u_fog_temporal_offset:o}})(this,n,i,r))}}setTileLoadedFlag(t){this.tileLoaded=t}saveCanvasCopy(){this.frameCopies.push(this.canvasCopy()),this.tileLoaded=!1}canvasCopy(){const t=this.context.gl,e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.copyTexImage2D(t.TEXTURE_2D,0,t.RGBA,0,0,t.drawingBufferWidth,t.drawingBufferHeight,0),e}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const t=this.style&&this.style.fog;return!!t&&0!==t.getOpacity(this.transform.pitch)}}class fn{constructor(t=0,e=0,i=0,n=0){if(isNaN(t)||t<0||isNaN(e)||e<0||isNaN(i)||i<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=i,this.right=n}interpolate(e,i,n){return null!=i.top&&null!=e.top&&(this.top=t.number(e.top,i.top,n)),null!=i.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,i.bottom,n)),null!=i.left&&null!=e.left&&(this.left=t.number(e.left,i.left,n)),null!=i.right&&null!=e.right&&(this.right=t.number(e.right,i.right,n)),this}getCenter(e,i){const n=t.clamp((this.left+e-this.right)/2,0,e),r=t.clamp((this.top+i-this.bottom)/2,0,i);return new t.pointGeometry(n,r)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new fn(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function mn(t,e){return[t[4*e],t[4*e+1],t[4*e+2],t[4*e+3]]}function gn(t,e,i){t[4*e+0]=i[0],t[4*e+1]=i[1],t[4*e+2]=i[2],t[4*e+3]=i[3]}function yn(e,i){const n=mn(e,3);t.fromQuat(e,i),gn(e,3,n)}function vn(t,e){gn(t,3,[e[0],e[1],e[2],1])}function _n(e,i){const n=t.identity$1([]);return t.rotateZ$1(n,n,-i),t.rotateX$1(n,n,-e),n}function xn(e,i){const n=[e[0],e[1],0],r=[i[0],i[1],0];if(t.length(n)>=1e-15){const e=t.normalize([],n);t.scale(r,e,t.dot(r,e)),i[0]=r[0],i[1]=r[1]}const o=t.cross([],i,e);if(t.len(o)<1e-15)return null;const s=Math.atan2(-o[1],o[0]);return _n(Math.atan2(Math.sqrt(e[0]*e[0]+e[1]*e[1]),-e[2]),s)}class bn{constructor(t,e){this.position=t,this.orientation=e}get position(){return this._position}set position(e){this._position=this._renderWorldCopies?function(e){if(!e)return;const i=Array.isArray(e)?new t.MercatorCoordinate(e[0],e[1],e[2]):e;return i.x=t.wrap(i.x,0,1),i}(e):e}lookAtPoint(e,i){if(this.orientation=null,!this.position)return;const n=this._elevation?this._elevation.getAtPointOrZero(t.MercatorCoordinate.fromLngLat(e)):0,r=this.position,o=t.MercatorCoordinate.fromLngLat(e,n),s=[o.x-r.x,o.y-r.y,o.z-r.z];i||(i=[0,0,1]),i[2]=Math.abs(i[2]),this.orientation=xn(s,i)}setPitchBearing(e,i){this.orientation=_n(t.degToRad(e),t.degToRad(-i))}}class wn{constructor(e,i){this._transform=t.identity([]),this._orientation=t.identity$1([]),i&&(this._orientation=i,yn(this._transform,this._orientation)),e&&vn(this._transform,e)}get mercatorPosition(){const e=this.position;return new t.MercatorCoordinate(e[0],e[1],e[2])}get position(){const t=mn(this._transform,3);return[t[0],t[1],t[2]]}set position(t){vn(this._transform,t)}get orientation(){return this._orientation}set orientation(t){this._orientation=t,yn(this._transform,this._orientation)}getPitchBearing(){const t=this.forward(),e=this.right();return{bearing:Math.atan2(-e[1],e[0]),pitch:Math.atan2(Math.sqrt(t[0]*t[0]+t[1]*t[1]),-t[2])}}setPitchBearing(t,e){this._orientation=_n(t,e),yn(this._transform,this._orientation)}forward(){const t=mn(this._transform,2);return[-t[0],-t[1],-t[2]]}up(){const t=mn(this._transform,1);return[-t[0],-t[1],-t[2]]}right(){const t=mn(this._transform,0);return[t[0],t[1],t[2]]}getCameraToWorld(e,i){const n=new Float64Array(16);return t.invert(n,this.getWorldToCamera(e,i)),n}getWorldToCameraPosition(e,i,n){const r=this.position;t.scale(r,r,-e);const o=new Float64Array(16);return t.fromScaling(o,[n,n,n]),t.translate(o,o,r),o[10]*=i,o}getWorldToCamera(e,i){const n=new Float64Array(16),r=new Float64Array(4),o=this.position;return t.conjugate(r,this._orientation),t.scale(o,o,-e),t.fromQuat(n,r),t.translate(n,n,o),n[1]*=-1,n[5]*=-1,n[9]*=-1,n[13]*=-1,n[8]*=i,n[9]*=i,n[10]*=i,n[11]*=i,n}getCameraToClipPerspective(e,i,n,r){const o=new Float64Array(16);return t.perspective(o,e,i,n,r),o}getDistanceToElevation(e){const i=0===e?0:t.mercatorZfromAltitude(e,this.position[1]),n=this.forward();return(i-this.position[2])/n[2]}clone(){return new wn([...this.position],[...this.orientation])}}class An{constructor(e,i,n,r,o){this.tileSize=512,this.maxValidLatitude=90,this._renderWorldCopies=void 0===o||o,this._minZoom=e||0,this._maxZoom=i||22,this._minPitch=null==n?0:n,this._maxPitch=null==r?60:r,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new fn,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._camera=new wn,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._horizonShift=.1}clone(){const t=new An(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t._elevation=this._elevation,t._centerAltitude=this._centerAltitude,t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t.cameraElevationReference=this.cameraElevationReference,t._center=this._center,t._setZoom(this.zoom),t._cameraZoom=this._cameraZoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._averageElevation=this._averageElevation,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._camera=this._camera.clone(),t._calcMatrices(),t.freezeTileCoverage=this.freezeTileCoverage,t}get elevation(){return this._elevation}set elevation(t){this._elevation!==t&&(this._elevation=t,t?this._updateCenterElevation()&&this._updateCameraOnTerrain():(this._cameraZoom=null,this._centerAltitude=0),this._calcMatrices())}updateElevation(t){this._terrainEnabled()&&null==this._cameraZoom&&this._updateCenterElevation()&&this._updateCameraOnTerrain(),t&&this._constrainCameraAltitude(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))}get maxZoom(){return this._maxZoom}set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))}get minPitch(){return this._minPitch}set minPitch(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))}get maxPitch(){return this._maxPitch}set maxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t}get worldSize(){return this.tileSize*this.scale}get cameraWorldSize(){const t=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(t))}get pixelsPerMeter(){return t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize}get cameraPixelsPerMeter(){return t.mercatorZfromAltitude(1,this.center.lat)*this.cameraWorldSize}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new t.pointGeometry(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(e){const i=-t.wrap(e,-180,180)*Math.PI/180;var n;this.angle!==i&&(this._unmodified=!1,this.angle=i,this._calcMatrices(),this.rotationMatrix=(n=new t.ARRAY_TYPE(4),t.ARRAY_TYPE!=Float32Array&&(n[1]=0,n[2]=0),n[0]=1,n[3]=1,n),function(t,e,i){var n=e[0],r=e[1],o=e[2],s=e[3],a=Math.sin(i),l=Math.cos(i);t[0]=n*l+o*a,t[1]=r*l+s*a,t[2]=n*-a+o*l,t[3]=r*-a+s*l}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(e){const i=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==i&&(this._unmodified=!1,this._pitch=i,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())}get averageElevation(){return this._averageElevation}set averageElevation(t){this._averageElevation=t,this._calcFogMatrices()}get zoom(){return this._zoom}set zoom(t){const e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._setZoom(e),this._terrainEnabled()&&this._updateCameraOnTerrain(),this._constrain(),this._calcMatrices())}_setZoom(t){this._zoom=t,this.scale=this.zoomScale(t),this.tileZoom=Math.floor(t),this.zoomFraction=t-this.tileZoom}_updateCenterElevation(){if(!this._elevation)return!1;const e=this._elevation.getAtPointOrZero(t.MercatorCoordinate.fromLngLat(this.center),-1);return-1===e?(this._cameraZoom=null,!1):(this._centerAltitude=e,!0)}_updateCameraOnTerrain(){const e=this.cameraToCenterDistance/this.worldSize,i=t.mercatorZfromAltitude(this._centerAltitude,this.center.lat);this._cameraZoom=this._zoomFromMercatorZ(i+e)}sampleAverageElevation(){if(!this._elevation)return 0;const e=this._elevation,i=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],n=this.horizonLineFromTop();let r=0,o=0;for(let s=0;s<i.length;s++){const a=new t.pointGeometry(i[s][0]*this.width,n+i[s][1]*(this.height-n)),l=e.pointCoordinate(a);if(!l)continue;const c=1/Math.hypot(l[0]-this._camera.position[0],l[1]-this._camera.position[1]);r+=l[3]*c,o+=c}return 0===o?NaN:r/o}get center(){return this._center}set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._terrainEnabled()&&("ground"===this.cameraElevationReference?this._updateCenterElevation()?this._updateCameraOnTerrain():this._cameraZoom=null:this._updateZoomFromElevation()),this._constrain(),this._calcMatrices())}_updateZoomFromElevation(){if(null==this._cameraZoom||!this._elevation)return;const e=this._cameraZoom,i=this._elevation.getAtPointOrZero(t.MercatorCoordinate.fromLngLat(this.center)),n=t.mercatorZfromAltitude(i,this.center.lat),r=this._mercatorZfromZoom(e),o=this._mercatorZfromZoom(this._maxZoom),s=Math.max(r-n,o);this._setZoom(this._zoomFromMercatorZ(s))}get padding(){return this._edgeInsets.toJSON()}set padding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}computeZoomRelativeTo(e){const i=this.rayIntersectionCoordinate(this.pointRayIntersection(this.centerPoint,e.toAltitude()));let n;n=e.z<this._camera.position[2]?[i.x,i.y,i.z]:[e.x,e.y,e.z];const r=t.length(t.sub([],this._camera.position,n));return t.clamp(this._zoomFromMercatorZ(r),this._minZoom,this._maxZoom)}setFreeCameraOptions(e){if(!this.height)return;if(!e.position&&!e.orientation)return;this._updateCameraState();let i=!1;if(e.orientation&&!t.exactEquals(e.orientation,this._camera.orientation)&&(i=this._setCameraOrientation(e.orientation)),e.position){const n=[e.position.x,e.position.y,e.position.z];t.exactEquals$1(n,this._camera.position)||(this._setCameraPosition(n),i=!0)}i&&(this._updateStateFromCamera(),this.recenterOnTerrain())}getFreeCameraOptions(){this._updateCameraState();const e=this._camera.position,i=new bn;return i.position=new t.MercatorCoordinate(e[0],e[1],e[2]),i.orientation=this._camera.orientation,i._elevation=this.elevation,i._renderWorldCopies=this._renderWorldCopies,i}_setCameraOrientation(e){if(!t.length$1(e))return!1;t.normalize$1(e,e);const i=t.transformQuat([],[0,0,-1],e),n=t.transformQuat([],[0,-1,0],e);if(n[2]<0)return!1;const r=xn(i,n);return!!r&&(this._camera.orientation=r,!0)}_setCameraPosition(e){const i=this.zoomScale(this.minZoom)*this.tileSize,n=this.zoomScale(this.maxZoom)*this.tileSize,r=this.cameraToCenterDistance;e[2]=t.clamp(e[2],r/n,r/i),this._camera.position=e}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}get fovAboveCenter(){return this._fov*(.5+this.centerOffset.y/this.height)}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,e,i){this._unmodified=!1,this._edgeInsets.interpolate(t,e,i),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){const e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)}getVisibleUnwrappedCoordinates(e){const i=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies){const n=this.pointCoordinate(new t.pointGeometry(0,0)),r=this.pointCoordinate(new t.pointGeometry(this.width,0)),o=this.pointCoordinate(new t.pointGeometry(this.width,this.height)),s=this.pointCoordinate(new t.pointGeometry(0,this.height)),a=Math.floor(Math.min(n.x,r.x,o.x,s.x)),l=Math.floor(Math.max(n.x,r.x,o.x,s.x)),c=1;for(let n=a-c;n<=l+c;n++)0!==n&&i.push(new t.UnwrappedTileID(n,e))}return i}coveringTiles(e){let i=this.coveringZoomLevel(e);const n=i,r=!!e.useElevationData;if(void 0!==e.minzoom&&i<e.minzoom)return[];void 0!==e.maxzoom&&i>e.maxzoom&&(i=e.maxzoom);const o=t.MercatorCoordinate.fromLngLat(this.center),s=1<<i,a=[s*o.x,s*o.y,0],l=d.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,i),c=this.pointCoordinate(this.getCameraPoint()),u=s*t.mercatorZfromAltitude(1,this.center.lat),h=this._camera.position[2]/t.mercatorZfromAltitude(1,this.center.lat),p=[s*c.x,s*c.y,h],m=this.cameraToCenterDistance/e.tileSize*(e.roundZoom?1:.502),g=this.pitch<=60&&this._edgeInsets.top<=this._edgeInsets.bottom&&!this._elevation?i:0,y=e.isTerrainDEM&&this._elevation?1e4*this._elevation.exaggeration():this._centerAltitude,v=e.isTerrainDEM?-y:this._elevation?this._elevation.getMinElevationBelowMSL():0,_=t=>({aabb:new f([t*s,0,-y],[(t+1)*s,s,y]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}),x=[],b=[],w=i,A=e.reparseOverscaled?n:i,E=t=>{if(!this._elevation||!t.tileID)return;const e=this._elevation.getMinMaxForTile(t.tileID),i=t.aabb;e?(i.min[2]=e.min,i.max[2]=e.max,i.center[2]=(i.min[2]+i.max[2])/2):(t.shouldSplit=T(t),t.shouldSplit||(i.min[2]=i.max[2]=i.center[2]=this._centerAltitude))},S=t=>t*t,M=S((h-this._centerAltitude)*u),T=t=>{if(t.zoom<g)return!0;if(t.zoom===w)return!1;if(null!=t.shouldSplit)return t.shouldSplit;const e=t.aabb.distanceX(p),i=t.aabb.distanceY(p);let n=M;r&&(n=S(t.aabb.distanceZ(p)*u));const o=e*e+i*i+n;return o<S((1<<w-t.zoom)*m*((t,e)=>{if(e*S(.707)<t)return 1;const i=Math.sqrt(e/t);return i/(1.4144271570014144+(Math.pow(1.1,i-1.4144271570014144+1)-1)/(1.1-1)-1)})(Math.max(n,M),o))};if(this._renderWorldCopies)for(let t=1;t<=3;t++)x.push(_(-t)),x.push(_(t));for(x.push(_(0));x.length>0;){const n=x.pop(),o=n.x,s=n.y;let c=n.fullyVisible;if(!c){const t=n.aabb.intersects(l);if(0===t)continue;c=2===t}if(n.zoom!==w&&T(n))for(let e=0;e<4;e++){const i=(o<<1)+e%2,a=(s<<1)+(e>>1),l={aabb:n.aabb.quadrant(e),zoom:n.zoom+1,x:i,y:a,wrap:n.wrap,fullyVisible:c,tileID:void 0,shouldSplit:void 0};r&&(l.tileID=new t.OverscaledTileID(n.zoom+1===w?A:n.zoom+1,n.wrap,n.zoom+1,i,a),E(l)),x.push(l)}else{const r=n.zoom===w?A:n.zoom;if(e.minzoom&&e.minzoom>r)continue;const l=a[0]-(.5+o+(n.wrap<<n.zoom))*(1<<i-n.zoom),c=a[1]-.5-s,u=n.tileID?n.tileID:new t.OverscaledTileID(r,n.wrap,n.zoom,o,s);b.push({tileID:u,distanceSq:l*l+c*c})}}if(this.fogCullDistSq){const e=this.fogCullDistSq;b.splice(0,b.length,...b.filter((i=>{const n=[0,0,0,1],o=[t.EXTENT,t.EXTENT,0,1],s=this.calculateFogTileMatrix(i.tileID.toUnwrapped());t.transformMat4(n,n,s),t.transformMat4(o,o,s);const a=t.getAABBPointSquareDist(n,o);if(0===a)return!0;let l=!1;const c=this.horizonLineFromTop();if(a>e&&0!==c){const e=this.calculateProjMatrix(i.tileID.toUnwrapped());let n;r&&this._elevation&&(n=this._elevation.getMinMaxForTile(i.tileID)),n||(n={min:v,max:y});const o=t.furthestTileCorner(this.bearing),s=[o[0]*t.EXTENT,o[1]*t.EXTENT,n.max];t.transformMat4$1(s,s,e),l=(1-s[1])*this.height*.5<c}return a<e||l})))}return b.sort(((t,e)=>t.distanceSq-e.distanceSq)).map((t=>t.tileID))}resize(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(t){return Math.pow(2,t)}scaleZoom(t){return Math.log(t)/Math.LN2}project(e){const i=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.pointGeometry(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(i)*this.worldSize)}unproject(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}setLocationAtPoint(e,i){const n=this.pointCoordinate(i),r=this.pointCoordinate(this.centerPoint),o=this.locationCoordinate(e),s=new t.MercatorCoordinate(o.x-(n.x-r.x),o.y-(n.y-r.y));this.center=this.coordinateLocation(s),this._renderWorldCopies&&(this.center=this.center.wrap())}setLocation(t){this.center=this.coordinateLocation(t),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(t){return this._coordinatePoint(this.locationCoordinate(t),!1)}locationPoint3D(t){return this._coordinatePoint(this.locationCoordinate(t),!0)}pointLocation(t){return this.coordinateLocation(this.pointCoordinate(t))}pointLocation3D(t){return this.coordinateLocation(this.pointCoordinate3D(t))}locationCoordinate(e){return t.MercatorCoordinate.fromLngLat(e)}coordinateLocation(t){return t.toLngLat()}pointRayIntersection(e,i){const n=null!=i?i:this._centerAltitude,r=[e.x,e.y,0,1],o=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(o,o,this.pixelMatrixInverse);const s=o[3];t.scale$2(r,r,1/r[3]),t.scale$2(o,o,1/s);const a=r[2],l=o[2];return{p0:r,p1:o,t:a===l?0:(n-a)/(l-a)}}screenPointToMercatorRay(e){const i=[e.x,e.y,0,1],n=[e.x,e.y,1,1];return t.transformMat4(i,i,this.pixelMatrixInverse),t.transformMat4(n,n,this.pixelMatrixInverse),t.scale$2(i,i,1/i[3]),t.scale$2(n,n,1/n[3]),i[2]=t.mercatorZfromAltitude(i[2],this._center.lat)*this.worldSize,n[2]=t.mercatorZfromAltitude(n[2],this._center.lat)*this.worldSize,t.scale$2(i,i,1/this.worldSize),t.scale$2(n,n,1/this.worldSize),new p([i[0],i[1],i[2]],t.normalize([],t.sub([],n,i)))}rayIntersectionCoordinate(e){const{p0:i,p1:n,t:r}=e,o=t.mercatorZfromAltitude(i[2],this._center.lat),s=t.mercatorZfromAltitude(n[2],this._center.lat);return new t.MercatorCoordinate(t.number(i[0],n[0],r)/this.worldSize,t.number(i[1],n[1],r)/this.worldSize,t.number(o,s,r))}pointCoordinate(e){const i=this.horizonLineFromTop(!1),n=new t.pointGeometry(e.x,Math.max(i,e.y));return this.rayIntersectionCoordinate(this.pointRayIntersection(n))}pointCoordinate3D(e){if(!this.elevation)return this.pointCoordinate(e);const i=this.elevation;let n=this.elevation.pointCoordinate(e);if(n)return new t.MercatorCoordinate(n[0],n[1],n[2]);let r=0,o=this.horizonLineFromTop();if(e.y>o)return this.pointCoordinate(e);const s=.02*o,a=e.clone();for(let e=0;e<10&&o-r>s;e++){a.y=t.number(r,o,.66);const e=i.pointCoordinate(a);e?(o=a.y,n=e):r=a.y}return n?new t.MercatorCoordinate(n[0],n[1],n[2]):this.pointCoordinate(e)}isPointAboveHorizon(t){if(this.elevation)return!this.elevation.pointCoordinate(t);{const e=this.horizonLineFromTop();return t.y<e}}_coordinatePoint(e,i){const n=i&&this.elevation?this.elevation.getAtPointOrZero(e,this._centerAltitude):this._centerAltitude,r=[e.x*this.worldSize,e.y*this.worldSize,n+e.toAltitude(),1];return t.transformMat4(r,r,this.pixelMatrix),r[3]>0?new t.pointGeometry(r[0]/r[3],r[1]/r[3]):new t.pointGeometry(Number.MAX_VALUE,Number.MAX_VALUE)}getBounds(){return this._terrainEnabled()?this._getBounds3D():(new t.LngLatBounds).extend(this.pointLocation(new t.pointGeometry(this._edgeInsets.left,this._edgeInsets.top))).extend(this.pointLocation(new t.pointGeometry(this.width-this._edgeInsets.right,this._edgeInsets.top))).extend(this.pointLocation(new t.pointGeometry(this.width-this._edgeInsets.right,this.height-this._edgeInsets.bottom))).extend(this.pointLocation(new t.pointGeometry(this._edgeInsets.left,this.height-this._edgeInsets.bottom)))}_getBounds3D(){const e=this.elevation,i=e.visibleDemTiles.reduce(((t,e)=>{if(e.dem){const i=e.dem.tree;t.min=Math.min(t.min,i.minimums[0]),t.max=Math.max(t.max,i.maximums[0])}return t}),{min:Number.MAX_VALUE,max:0});i.min*=e.exaggeration(),i.max*=e.exaggeration();const n=this.horizonLineFromTop();return[new t.pointGeometry(0,n),new t.pointGeometry(this.width,n),new t.pointGeometry(this.width,this.height),new t.pointGeometry(0,this.height)].reduce(((t,e)=>t.extend(this.coordinateLocation(this.rayIntersectionCoordinate(this.pointRayIntersection(e,i.min)))).extend(this.coordinateLocation(this.rayIntersectionCoordinate(this.pointRayIntersection(e,i.max))))),new t.LngLatBounds)}horizonLineFromTop(t=!0){const e=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))+this.centerOffset.y,i=this.height/2-.97*e;return t?Math.max(0,i):i}getMaxBounds(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}setMaxBounds(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}calculatePosMatrix(e,i){const n=e.canonical,r=i/this.zoomScale(n.z),o=n.x+Math.pow(2,n.z)*e.wrap,s=t.identity(new Float64Array(16));return t.translate(s,s,[o*r,n.y*r,0]),t.scale$1(s,s,[r/t.EXTENT,r/t.EXTENT,1]),s}calculateFogTileMatrix(e){const i=e.key,n=this._fogTileMatrixCache;if(n[i])return n[i];const r=this.calculatePosMatrix(e,this.cameraWorldSize);return t.multiply(r,this.worldToFogMatrix,r),n[i]=new Float32Array(r),n[i]}calculateProjMatrix(e,i=!1){const n=e.key,r=i?this._alignedProjMatrixCache:this._projMatrixCache;if(r[n])return r[n];const o=this.calculatePosMatrix(e,this.worldSize);return t.multiply(o,i?this.alignedProjMatrix:this.projMatrix,o),r[n]=new Float32Array(o),r[n]}customLayerMatrix(){return this.mercatorMatrix.slice()}recenterOnTerrain(){if(!this._elevation)return;const e=this._elevation;this._updateCameraState();const i=this._camera.position,n=this._camera.forward();if(i[2]<=0||n[2]>=0)return;const r=t.mercatorZfromAltitude(1,this._center.lat);i[2]/=r,n[2]/=r,t.normalize(n,n);const o=e.raycast(i,n,e.exaggeration());if(o){const e=t.scaleAndAdd([],i,n,o),r=new t.MercatorCoordinate(e[0],e[1],t.mercatorZfromAltitude(e[2],t.latFromMercatorY(e[1]))),s=this._camera.position,a=r.z+t.length([r.x-s[0],r.y-s[1],r.z-s[2]]);this._cameraZoom=this._zoomFromMercatorZ(a),this._centerAltitude=r.toAltitude(),this._center=r.toLngLat(),this._updateZoomFromElevation(),this._constrain(),this._calcMatrices()}}_constrainCameraAltitude(){if(!this._elevation)return;const e=this._elevation;this._updateCameraState();const i=e.getAtPointOrZero(this._camera.mercatorPosition),n=this._minimumHeightOverTerrain()*Math.cos(t.degToRad(this._maxPitch)),r=t.mercatorZfromAltitude(i,this._center.lat),o=this._camera.position[2]-r;if(o<n){const e=t.MercatorCoordinate.fromLngLat(this._center,this._centerAltitude),i=this._camera.mercatorPosition,r=[e.x-i.x,e.y-i.y,e.z-i.z],s=t.length(r);r[2]-=n-o;const a=t.length(r);if(0===a)return;t.scale(r,r,s/a),this._camera.position=[e.x-r[0],e.y-r[1],e.z-r[2]],this._camera.orientation=xn(r,this._camera.up()),this._updateStateFromCamera()}}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let e,i,n,r,o=-90,s=90,a=-180,l=180;const c=this.size,u=this._unmodified;if(this.latRange){const i=this.latRange;o=t.mercatorYfromLat(i[1])*this.worldSize,s=t.mercatorYfromLat(i[0])*this.worldSize,e=s-o<c.y?c.y/(s-o):0}if(this.lngRange){const e=this.lngRange;a=t.mercatorXfromLng(e[0])*this.worldSize,l=t.mercatorXfromLng(e[1])*this.worldSize,i=l-a<c.x?c.x/(l-a):0}const h=this.point,p=Math.max(i||0,e||0);if(p)return this.center=this.unproject(new t.pointGeometry(i?(l+a)/2:h.x,e?(s+o)/2:h.y)),this.zoom+=this.scaleZoom(p),this._unmodified=u,void(this._constraining=!1);if(this.latRange){const t=h.y,e=c.y/2;t-e<o&&(r=o+e),t+e>s&&(r=s-e)}if(this.lngRange){const t=h.x,e=c.x/2;t-e<a&&(n=a+e),t+e>l&&(n=l-e)}void 0===n&&void 0===r||(this.center=this.unproject(new t.pointGeometry(void 0!==n?n:h.x,void 0!==r?r:h.y))),this._constrainCameraAltitude(),this._unmodified=u,this._constraining=!1}_minZoomForBounds(){const e=(t,e)=>Math.log2(t/(this.tileSize*Math.abs(e[1]-e[0])));let i=0;if(this.latRange){const n=this.latRange;i=e(this.height,[t.mercatorYfromLat(n[0]),t.mercatorYfromLat(n[1])])}let n=0;if(this.lngRange){const i=this.lngRange;n=e(this.width,[t.mercatorXfromLng(i[0]),t.mercatorXfromLng(i[1])])}return Math.max(i,n)}_maxCameraBoundsDistance(){return this._mercatorZfromZoom(this._minZoomForBounds())}_calcMatrices(){if(!this.height)return;const e=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;const i=this.pixelsPerMeter;this._updateCameraState();const n=Math.PI/2+this._pitch,r=this.fovAboveCenter,o=this.elevation?this.elevation.getMinElevationBelowMSL()*i:0,s=(this._camera.position[2]*this.worldSize-o)/Math.cos(this._pitch),a=Math.sin(r)*s/Math.sin(t.clamp(Math.PI-n-r,.01,Math.PI-.01)),l=this.point,c=l.x,u=l.y,h=Math.cos(Math.PI/2-this._pitch)*a+s,p=Math.min(1.01*h,s*(1/this._horizonShift)),d=this.height/50,f=this._camera.getWorldToCamera(this.worldSize,i),m=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,d,p);m[8]=2*-e.x/this.width,m[9]=2*e.y/this.height;let g=t.mul$1([],m,f);this.mercatorMatrix=t.scale$1([],g,[this.worldSize,this.worldSize,this.worldSize/i]),this.projMatrix=g,this.invProjMatrix=t.invert(new Float64Array(16),this.projMatrix);const y=new Float32Array(16);t.identity(y),t.scale$1(y,y,[1,-1,1]),t.rotateX(y,y,this._pitch),t.rotateZ(y,y,this.angle);const v=t.perspective(new Float32Array(16),this._fov,this.width/this.height,d,p),_=(Math.PI/2-this._pitch)*(this.height/this._fov)*this._horizonShift;v[8]=2*-e.x/this.width,v[9]=2*(e.y+_)/this.height,this.skyboxMatrix=t.multiply(y,v,y);const x=this.width%2/2,b=this.height%2/2,w=Math.cos(this.angle),A=Math.sin(this.angle),E=c-Math.round(c)+w*x+A*b,S=u-Math.round(u)+w*b+A*x,M=new Float64Array(g);if(t.translate(M,M,[E>.5?E-1:E,S>.5?S-1:S,0]),this.alignedProjMatrix=M,g=t.create$1(),t.scale$1(g,g,[this.width/2,-this.height/2,1]),t.translate(g,g,[1,-1,0]),this.labelPlaneMatrix=g,g=t.create$1(),t.scale$1(g,g,[1,-1,1]),t.translate(g,g,[-1,-1,0]),t.scale$1(g,g,[2/this.width,2/this.height,1]),this.glCoordMatrix=g,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),this._calcFogMatrices(),g=t.invert(new Float64Array(16),this.pixelMatrix),!g)throw new Error("failed to invert matrix");this.pixelMatrixInverse=g,this._projMatrixCache={},this._alignedProjMatrixCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const e=this.cameraWorldSize,i=this.cameraPixelsPerMeter,n=this._camera.position,r=1/this.height,o=[e,e,i];t.scale(o,o,r),t.scale(n,n,-1),t.multiply$1(n,n,o);const s=t.create$1();t.translate(s,s,n),t.scale$1(s,s,o),this.mercatorFogMatrix=s,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(e,i,r)}_updateCameraState(){if(!this.height)return;this._camera.setPitchBearing(this._pitch,this.angle);const e=this._camera.forward(),i=this.cameraToCenterDistance,n=this.point,r=this._mercatorZfromZoom(this._cameraZoom?this._cameraZoom:this._zoom)-t.mercatorZfromAltitude(this._centerAltitude,this.center.lat),o=this.cameraToCenterDistance/r;this._camera.position=[n.x/this.worldSize-e[0]*i/o,n.y/this.worldSize-e[1]*i/o,t.mercatorZfromAltitude(this._centerAltitude,this._center.lat)+-e[2]*i/o]}_translateCameraConstrained(e){const i=this._maxCameraBoundsDistance()*Math.cos(this._pitch),n=e[2];let r=1;n>0&&(r=Math.min((i-this._camera.position[2])/n,1)),this._camera.position=t.scaleAndAdd([],this._camera.position,e,r),this._updateStateFromCamera()}_updateStateFromCamera(){const e=this._camera.position,i=this._camera.forward(),{pitch:n,bearing:r}=this._camera.getPitchBearing(),o=t.mercatorZfromAltitude(this._centerAltitude,this.center.lat),s=this._mercatorZfromZoom(this._maxZoom)*Math.cos(t.degToRad(this._maxPitch)),a=Math.max((e[2]-o)/Math.cos(n),s),l=this._zoomFromMercatorZ(a);t.scaleAndAdd(e,e,i,a),this._pitch=t.clamp(n,t.degToRad(this.minPitch),t.degToRad(this.maxPitch)),this.angle=t.wrap(r,-Math.PI,Math.PI),this._setZoom(t.clamp(l,this._minZoom,this._maxZoom)),this._terrainEnabled()&&this._updateCameraOnTerrain(),this._center=new t.MercatorCoordinate(e[0],e[1],e[2]).toLngLat(),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(t){return Math.pow(2,t)*this.tileSize}_mercatorZfromZoom(t){return this.cameraToCenterDistance/this._worldSizeFromZoom(t)}_minimumHeightOverTerrain(){const t=Math.min((null!=this._cameraZoom?this._cameraZoom:this._zoom)+2,this._maxZoom);return this._mercatorZfromZoom(t)}_zoomFromMercatorZ(t){return this.scaleZoom(this.cameraToCenterDistance/(t*this.tileSize))}_terrainEnabled(){return!!this._elevation}isHorizonVisibleForPoints(e,i){const n=Math.min(e.x,i.x),r=Math.max(e.x,i.x),o=Math.min(e.y,i.y),s=Math.max(e.y,i.y),a=[new t.pointGeometry(n,o),new t.pointGeometry(r,s),new t.pointGeometry(n,s),new t.pointGeometry(r,o)],l=this._renderWorldCopies?-3:0,c=this._renderWorldCopies?4:1;for(const t of a){const e=this.pointRayIntersection(t);if(e.t<0)return!0;const i=this.rayIntersectionCoordinate(e);if(i.x<l||i.y<0||i.x>c||i.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+t.radToDeg(this.fovAboveCenter)>88||this.isHorizonVisibleForPoints(new t.pointGeometry(0,0),new t.pointGeometry(this.width,this.height))}zoomDeltaToMovement(e,i){const n=t.length(t.sub([],this._camera.position,e)),r=this._zoomFromMercatorZ(n)+i;return n-this._mercatorZfromZoom(r)}getCameraPoint(){const e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.pointGeometry(0,e))}}class En{constructor(e){this._hashName=e&&encodeURIComponent(e),t.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=function(t,e){let i=!1,n=null;const r=()=>{n=null,i&&(t(),n=setTimeout(r,300),i=!1)};return()=>(i=!0,n||r(),n)}(this._updateHashUnthrottled.bind(this))}addTo(e){return this._map=e,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(e){const i=this._map.getCenter(),n=Math.round(100*this._map.getZoom())/100,r=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),o=Math.pow(10,r),s=Math.round(i.lng*o)/o,a=Math.round(i.lat*o)/o,l=this._map.getBearing(),c=this._map.getPitch();let u="";if(u+=e?`/${s}/${a}/${n}`:`${n}/${a}/${s}`,(l||c)&&(u+="/"+Math.round(10*l)/10),c&&(u+=`/${Math.round(c)}`),this._hashName){const e=this._hashName;let i=!1;const n=t.window.location.hash.slice(1).split("&").map((t=>{const n=t.split("=")[0];return n===e?(i=!0,`${n}=${u}`):t})).filter((t=>t));return i||n.push(`${e}=${u}`),`#${n.join("&")}`}return`#${u}`}_getCurrentHash(){const e=t.window.location.hash.replace("#","");if(this._hashName){let t;return e.split("&").map((t=>t.split("="))).forEach((e=>{e[0]===this._hashName&&(t=e)})),(t&&t[1]||"").split("/")}return e.split("/")}_onHashChange(){const t=this._getCurrentHash();if(t.length>=3&&!t.some((t=>isNaN(t)))){const e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1}_updateHashUnthrottled(){const e=t.window.location.href.replace(/(#.+)?$/,this.getHashString());t.window.history.replaceState(t.window.history.state,null,e)}}const Sn={linearity:.3,easing:t.bezier(0,0,.3,1)},Mn=t.extend({deceleration:2500,maxSpeed:1400},Sn),Tn=t.extend({deceleration:20,maxSpeed:1400},Sn),In=t.extend({deceleration:1e3,maxSpeed:360},Sn),Cn=t.extend({deceleration:1e3,maxSpeed:90},Sn);class Pn{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:t.exported.now(),settings:e})}_drainInertiaBuffer(){const e=this._inertiaBuffer,i=t.exported.now();for(;e.length>0&&i-e[0].time>160;)e.shift()}_onMoveEnd(e){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const i={zoom:0,bearing:0,pitch:0,pan:new t.pointGeometry(0,0),pinchAround:void 0,around:void 0};for(const{settings:t}of this._inertiaBuffer)i.zoom+=t.zoomDelta||0,i.bearing+=t.bearingDelta||0,i.pitch+=t.pitchDelta||0,t.panDelta&&i.pan._add(t.panDelta),t.around&&(i.around=t.around),t.pinchAround&&(i.pinchAround=t.pinchAround);const n=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,r={};if(i.pan.mag()){const o=Dn(i.pan.mag(),n,t.extend({},Mn,e||{}));r.offset=i.pan.mult(o.amount/i.pan.mag()),r.center=this._map.transform.center,Ln(r,o)}if(i.zoom){const t=Dn(i.zoom,n,Tn);r.zoom=this._map.transform.zoom+t.amount,Ln(r,t)}if(i.bearing){const e=Dn(i.bearing,n,In);r.bearing=this._map.transform.bearing+t.clamp(e.amount,-179,179),Ln(r,e)}if(i.pitch){const t=Dn(i.pitch,n,Cn);r.pitch=this._map.transform.pitch+t.amount,Ln(r,t)}if(r.zoom||r.bearing){const t=void 0===i.pinchAround?i.around:i.pinchAround;r.around=t?this._map.unproject(t):this._map.getCenter()}return this.clear(),t.extend(r,{noMoveStart:!0})}}function Ln(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function Dn(e,i,n){const{maxSpeed:r,linearity:o,deceleration:s}=n,a=t.clamp(e*o/(i/1e3),-r,r),l=Math.abs(a)/(s*o);return{easing:n.easing,duration:1e3*l,amount:a*(l/2)}}class Rn extends t.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,i,n,r={}){const s=o.mousePos(i.getCanvasContainer(),n),a=i.unproject(s);super(e,t.extend({point:s,lngLat:a,originalEvent:n},r)),this._defaultPrevented=!1,this.target=i}}class On extends t.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,i,n){const r="touchend"===e?n.changedTouches:n.touches,s=o.touchPos(i.getCanvasContainer(),r),a=s.map((t=>i.unproject(t))),l=s.reduce(((t,e,i,n)=>t.add(e.div(n.length))),new t.pointGeometry(0,0));super(e,{points:s,point:l,lngLats:a,lngLat:i.unproject(l),originalEvent:n}),this._defaultPrevented=!1}}class kn extends t.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,e,i){super(t,{originalEvent:i}),this._defaultPrevented=!1}}class Nn{constructor(t,e){this._map=t,this._clickTolerance=e.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new kn(t.type,this._map,t))}mousedown(t,e){return this._mousedownPos=e,this._firePreventable(new Rn(t.type,this._map,t))}mouseup(t){this._map.fire(new Rn(t.type,this._map,t))}click(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new Rn(t.type,this._map,t))}dblclick(t){return this._firePreventable(new Rn(t.type,this._map,t))}mouseover(t){this._map.fire(new Rn(t.type,this._map,t))}mouseout(t){this._map.fire(new Rn(t.type,this._map,t))}touchstart(t){return this._firePreventable(new On(t.type,this._map,t))}touchmove(t){this._map.fire(new On(t.type,this._map,t))}touchend(t){this._map.fire(new On(t.type,this._map,t))}touchcancel(t){this._map.fire(new On(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Bn{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,delete this._contextMenuEvent}mousemove(t){this._map.fire(new Rn(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Rn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new Rn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class zn{constructor(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(o.disableDrag(),this._startPos=this._lastPos=e,this._active=!0)}mousemoveWindow(t,e){if(!this._active)return;const i=e;if(this._lastPos.equals(i)||!this._box&&i.dist(this._startPos)<this._clickTolerance)return;const n=this._startPos;this._lastPos=i,this._box||(this._box=o.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));const r=Math.min(n.x,i.x),s=Math.max(n.x,i.x),a=Math.min(n.y,i.y),l=Math.max(n.y,i.y);this._map._requestDomTask((()=>{this._box&&(o.setTransform(this._box,`translate(${r}px,${a}px)`),this._box.style.width=s-r+"px",this._box.style.height=l-a+"px")}))}mouseupWindow(e,i){if(!this._active)return;if(0!==e.button)return;const n=this._startPos,r=i;if(this.reset(),o.suppressClick(),n.x!==r.x||n.y!==r.y)return this._map.fire(new t.Event("boxzoomend",{originalEvent:e})),{cameraAnimation:t=>t.fitScreenCoordinates(n,r,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",e)}keydown(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(o.remove(this._box),this._box=null),o.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,i){return this._map.fire(new t.Event(e,{originalEvent:i}))}}function Fn(t,e){const i={};for(let n=0;n<t.length;n++)i[t[n].identifier]=e[n];return i}class Vn{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,i,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){const i=new t.pointGeometry(0,0);for(const t of e)i._add(t);return i.div(e.length)}(i),this.touches=Fn(n,i)))}touchmove(t,e,i){if(this.aborted||!this.centroid)return;const n=Fn(i,e);for(const t in this.touches){const e=this.touches[t],i=n[t];(!i||i.dist(e)>30)&&(this.aborted=!0)}}touchend(t,e,i){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===i.length){const t=!this.aborted&&this.centroid;if(this.reset(),t)return t}}}class Un{constructor(t){this.singleTap=new Vn(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,e,i){this.singleTap.touchstart(t,e,i)}touchmove(t,e,i){this.singleTap.touchmove(t,e,i)}touchend(t,e,i){const n=this.singleTap.touchend(t,e,i);if(n){const e=t.timeStamp-this.lastTime<500,i=!this.lastTap||this.lastTap.dist(n)<30;if(e&&i||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}}}class Gn{constructor(){this._zoomIn=new Un({numTouches:1,numTaps:2}),this._zoomOut=new Un({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,e,i){this._zoomIn.touchstart(t,e,i),this._zoomOut.touchstart(t,e,i)}touchmove(t,e,i){this._zoomIn.touchmove(t,e,i),this._zoomOut.touchmove(t,e,i)}touchend(t,e,i){const n=this._zoomIn.touchend(t,e,i),r=this._zoomOut.touchend(t,e,i);return n?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(n)},{originalEvent:t})}):r?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(r)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const jn={0:1,2:2};class Hn{constructor(t){this.reset(),this._clickTolerance=t.clickTolerance||1}reset(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton}_correctButton(t,e){return!1}_move(t,e){return{}}mousedown(t,e){if(this._lastPoint)return;const i=o.mouseButton(t);this._correctButton(t,i)&&(this._lastPoint=e,this._eventButton=i)}mousemoveWindow(t,e){const i=this._lastPoint;if(i)if(t.preventDefault(),function(t,e){const i=jn[e];return void 0===t.buttons||(t.buttons&i)!==i}(t,this._eventButton))this.reset();else if(this._moved||!(e.dist(i)<this._clickTolerance))return this._moved=!0,this._lastPoint=e,this._move(i,e)}mouseupWindow(t){this._lastPoint&&o.mouseButton(t)===this._eventButton&&(this._moved&&o.suppressClick(),this.reset())}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Wn extends Hn{mousedown(t,e){super.mousedown(t,e),this._lastPoint&&(this._active=!0)}_correctButton(t,e){return 0===e&&!t.ctrlKey}_move(t,e){return{around:e,panDelta:e.sub(t)}}}class qn extends Hn{_correctButton(t,e){return 0===e&&t.ctrlKey||2===e}_move(t,e){const i=.8*(e.x-t.x);if(i)return this._active=!0,{bearingDelta:i}}contextmenu(t){t.preventDefault()}}class Xn extends Hn{_correctButton(t,e){return 0===e&&t.ctrlKey||2===e}_move(t,e){const i=-.5*(e.y-t.y);if(i)return this._active=!0,{pitchDelta:i}}contextmenu(t){t.preventDefault()}}class Zn{constructor(t){this._minTouches=1,this._clickTolerance=t.clickTolerance||1,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new t.pointGeometry(0,0)}touchstart(t,e,i){return this._calculateTransform(t,e,i)}touchmove(t,e,i){if(this._active&&!(i.length<this._minTouches))return t.preventDefault(),this._calculateTransform(t,e,i)}touchend(t,e,i){this._calculateTransform(t,e,i),this._active&&i.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,i,n){n.length>0&&(this._active=!0);const r=Fn(n,i),o=new t.pointGeometry(0,0),s=new t.pointGeometry(0,0);let a=0;for(const t in r){const e=r[t],i=this._touches[t];i&&(o._add(e),s._add(e.sub(i)),a++,r[t]=e)}if(this._touches=r,a<this._minTouches||!s.mag())return;const l=s.div(a);return this._sum._add(l),this._sum.mag()<this._clickTolerance?void 0:{around:o.div(a),panDelta:l}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Yn{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}_start(t){}_move(t,e,i){return{}}touchstart(t,e,i){this._firstTwoTouches||i.length<2||(this._firstTwoTouches=[i[0].identifier,i[1].identifier],this._start([e[0],e[1]]))}touchmove(t,e,i){if(!this._firstTwoTouches)return;t.preventDefault();const[n,r]=this._firstTwoTouches,o=Qn(i,e,n),s=Qn(i,e,r);if(!o||!s)return;const a=this._aroundCenter?null:o.add(s).div(2);return this._move([o,s],a,t)}touchend(t,e,i){if(!this._firstTwoTouches)return;const[n,r]=this._firstTwoTouches,s=Qn(i,e,n),a=Qn(i,e,r);s&&a||(this._active&&o.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function Qn(t,e,i){for(let n=0;n<t.length;n++)if(t[n].identifier===i)return e[n]}function Jn(t,e){return Math.log(t/e)/Math.LN2}class Kn extends Yn{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,e){const i=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(Jn(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Jn(this._distance,i),pinchAround:e}}}function $n(t,e){return 180*t.angleWith(e)/Math.PI}class tr extends Yn{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])}_move(t,e){const i=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:$n(this._vector,i),pinchAround:e}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());const e=25/(Math.PI*this._minDiameter)*360,i=$n(t,this._startVector);return Math.abs(i)<e}}function er(t){return Math.abs(t.y)>Math.abs(t.x)}class ir extends Yn{reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}_start(t){this._lastPoints=t,er(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,e,i){const n=t[0].sub(this._lastPoints[0]),r=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,r,i.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(n.y+r.y)/2*-.5}}gestureBeginsVertically(t,e,i){if(void 0!==this._valid)return this._valid;const n=t.mag()>=2,r=e.mag()>=2;if(!n&&!r)return;if(!n||!r)return void 0===this._firstMove&&(this._firstMove=i),i-this._firstMove<100&&void 0;const o=t.y>0==e.y>0;return er(t)&&er(e)&&o}}const nr={panStep:100,bearingStep:15,pitchStep:10};class rr{constructor(){const t=nr;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let e=0,i=0,n=0,r=0,o=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?i=-1:(t.preventDefault(),r=-1);break;case 39:t.shiftKey?i=1:(t.preventDefault(),r=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),o=-1);break;case 40:t.shiftKey?n=-1:(t.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(i=0,n=0),{cameraAnimation:s=>{const a=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:or,zoom:e?Math.round(a)+e*(t.shiftKey?2:1):a,bearing:s.getBearing()+i*this._bearingStep,pitch:s.getPitch()+n*this._pitchStep,offset:[-r*this._panStep,-o*this._panStep],center:s.getCenter()},{originalEvent:t})}}}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 or(t){return t*(2-t)}const sr=4.000244140625;class ar{constructor(e,i){this._map=e,this._el=e.getCanvasContainer(),this._handler=i,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,t.bindAll(["_onTimeout"],this)}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(e){if(!this.isEnabled())return;let i=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY;const n=t.exported.now(),r=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==i&&i%sr==0?this._type="wheel":0!==i&&Math.abs(i)<4?this._type="trackpad":r>400?(this._type=null,this._lastValue=i,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(r*i)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,i+=this._lastValue)),e.shiftKey&&i&&(i/=4),this._type&&(this._lastWheelEvent=e,this._delta-=i,this._active||this._start(e)),e.preventDefault()}_onTimeout(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)}_start(t){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 e=o.mousePos(this._el,t);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:e,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 e=this._map.transform,i=()=>e._terrainEnabled()?e.computeZoomRelativeTo(this._aroundCoord):e.zoom;if(0!==this._delta){const t="wheel"===this._type&&Math.abs(this._delta)>sr?this._wheelZoomRate:this._defaultZoomRate;let n=2/(1+Math.exp(-Math.abs(this._delta*t)));this._delta<0&&0!==n&&(n=1/n);const r=i(),o=Math.pow(2,r),s="number"==typeof this._targetZoom?e.zoomScale(this._targetZoom):o;this._targetZoom=Math.min(e.maxZoom,Math.max(e.minZoom,e.scaleZoom(s*n))),"wheel"===this._type&&(this._startZoom=i(),this._easing=this._smoothOutEasing(200)),this._delta=0}const n="number"==typeof this._targetZoom?this._targetZoom:i(),r=this._startZoom,o=this._easing;let s,a=!1;if("wheel"===this._type&&r&&o){const e=Math.min((t.exported.now()-this._lastWheelEventTime)/200,1),i=o(e);s=t.number(r,n,i),e<1?this._frameId||(this._frameId=!0):a=!0}else s=n,a=!0;return this._active=!0,a&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!a,zoomDelta:s-i(),around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let i=t.ease;if(this._prevEase){const e=this._prevEase,n=(t.exported.now()-e.start)/e.duration,r=e.easing(n+.01)-e.easing(n),o=.27/Math.sqrt(r*r+1e-4)*.01,s=Math.sqrt(.0729-o*o);i=t.bezier(o,s,.25,1)}return this._prevEase={start:t.exported.now(),duration:e,easing:i},i}reset(){this._active=!1}}class lr{constructor(t,e){this._clickZoom=t,this._tapZoom=e}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 cr{constructor(){this.reset()}reset(){this._active=!1}dblclick(t,e){return t.preventDefault(),{cameraAnimation:i=>{i.easeTo({duration:300,zoom:i.getZoom()+(t.shiftKey?-1:1),around:i.unproject(e)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ur{constructor(){this._tap=new Un({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()}touchstart(t,e,i){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?i.length>0&&(this._swipePoint=e[0],this._swipeTouch=i[0].identifier):this._tap.touchstart(t,e,i))}touchmove(t,e,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;const n=e[0],r=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:r/128}}}else this._tap.touchmove(t,e,i)}touchend(t,e,i){this._tapTime?this._swipePoint&&0===i.length&&this.reset():this._tap.touchend(t,e,i)&&(this._tapTime=t.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class hr{constructor(t,e,i){this._el=t,this._mousePan=e,this._touchPan=i}enable(t){this._inertiaOptions=t||{},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 pr{constructor(t,e,i){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=i}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 dr{constructor(t,e,i,n){this._el=t,this._touchZoom=e,this._touchRotate=i,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),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 fr=t=>t.zoom||t.drag||t.pitch||t.rotate;class mr extends t.Event{}class gr{constructor(){this.constants=[1,1,.01],this.radius=0}setup(e,i){const n=t.sub([],i,e);this.radius=t.length(n[2]<0?t.div([],n,this.constants):[n[0],n[1],0])}projectRay(e){t.div(e,e,this.constants),t.normalize(e,e),t.mul$2(e,e,this.constants);const i=t.scale([],e,this.radius);if(i[2]>0){const e=t.scale([],[0,0,1],t.dot(i,[0,0,1])),n=t.scale([],t.normalize([],[i[0],i[1],0]),this.radius),r=t.add([],i,t.scale([],t.sub([],t.add([],n,e),i),2));i[0]=r[0],i[1]=r[1]}return i}}function yr(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}class vr{constructor(e,i){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Pn(e),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new gr,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(i),t.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],[t.window.document,"mousemove",{capture:!0}],[t.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],[t.window,"blur",void 0]];for(const[e,i,n]of this._listeners)o.addEventListener(e,i,e===t.window.document?this.handleWindowEvent:this.handleEvent,n)}destroy(){for(const[e,i,n]of this._listeners)o.removeEventListener(e,i,e===t.window.document?this.handleWindowEvent:this.handleEvent,n)}_addDefaultHandlers(t){const e=this._map,i=e.getCanvasContainer();this._add("mapEvent",new Nn(e,t));const n=e.boxZoom=new zn(e,t);this._add("boxZoom",n);const r=new Gn,o=new cr;e.doubleClickZoom=new lr(o,r),this._add("tapZoom",r),this._add("clickZoom",o);const s=new ur;this._add("tapDragZoom",s);const a=e.touchPitch=new ir;this._add("touchPitch",a);const l=new qn(t),c=new Xn(t);e.dragRotate=new pr(t,l,c),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",c,["mouseRotate"]);const u=new Wn(t),h=new Zn(t);e.dragPan=new hr(i,u,h),this._add("mousePan",u),this._add("touchPan",h,["touchZoom","touchRotate"]);const p=new tr,d=new Kn;e.touchZoomRotate=new dr(i,d,p,s),this._add("touchRotate",p,["touchPan","touchZoom"]),this._add("touchZoom",d,["touchPan","touchRotate"]),this._add("blockableMapEvent",new Bn(e));const f=e.scrollZoom=new ar(e,this);this._add("scrollZoom",f,["mousePan"]);const m=e.keyboard=new rr;this._add("keyboard",m);for(const i of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])t.interactive&&t[i]&&e[i].enable(t[i])}_add(t,e,i){this._handlers.push({handlerName:t,handler:e,allowed:i}),this._handlersById[t]=e}stop(t){if(!this._updatingCamera){for(const{handler:t}of this._handlers)t.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(const{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(fr(this._eventsInProgress))||this.isZooming()}_blockedByActive(t,e,i){for(const n in t)if(n!==i&&(!e||e.indexOf(n)<0))return!0;return!1}handleWindowEvent(t){this.handleEvent(t,`${t.type}Window`)}_getMapTouches(t){const e=[];for(const i of t)this._el.contains(i.target)&&e.push(i);return e}handleEvent(t,e){if("blur"===t.type)return void this.stop(!0);this._updatingCamera=!0;const i="renderFrame"===t.type,n=i?void 0:t,r={needsRenderFrame:!1},s={},a={},l=t.touches?this._getMapTouches(t.touches):void 0,c=l?o.touchPos(this._el,l):i?void 0:o.mousePos(this._el,t);for(const{handlerName:i,handler:o,allowed:u}of this._handlers){if(!o.isEnabled())continue;let h;this._blockedByActive(a,u,i)?o.reset():o[e||t.type]&&(h=o[e||t.type](t,c,l),this.mergeHandlerResult(r,s,h,i,n),h&&h.needsRenderFrame&&this._triggerRenderFrame()),(h||o.isActive())&&(a[i]=o)}const u={};for(const t in this._previousActiveHandlers)a[t]||(u[t]=n);this._previousActiveHandlers=a,(Object.keys(u).length||yr(r))&&(this._changes.push([r,s,u]),this._triggerRenderFrame()),(Object.keys(a).length||yr(r))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:h}=r;h&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],h(this._map))}mergeHandlerResult(e,i,n,r,o){if(!n)return;t.extend(e,n);const s={handlerName:r,originalEvent:n.originalEvent||o};void 0!==n.zoomDelta&&(i.zoom=s),void 0!==n.panDelta&&(i.drag=s),void 0!==n.pitchDelta&&(i.pitch=s),void 0!==n.bearingDelta&&(i.rotate=s)}_applyChanges(){const e={},i={},n={};for(const[r,o,s]of this._changes)r.panDelta&&(e.panDelta=(e.panDelta||new t.pointGeometry(0,0))._add(r.panDelta)),r.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+r.zoomDelta),r.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+r.bearingDelta),r.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+r.pitchDelta),void 0!==r.around&&(e.around=r.around),void 0!==r.aroundCoord&&(e.aroundCoord=r.aroundCoord),void 0!==r.pinchAround&&(e.pinchAround=r.pinchAround),r.noInertia&&(e.noInertia=r.noInertia),t.extend(i,o),t.extend(n,s);this._updateMapTransform(e,i,n),this._changes=[]}_updateMapTransform(e,i,n){const r=this._map,o=r.transform,s=t=>[t.x,t.y,t.z];if((t=>{const e=this._eventsInProgress.drag;return e&&!this._handlersById[e.handlerName].isActive()})()&&!yr(e)){const t=o.zoom;o.cameraElevationReference="sea",o.recenterOnTerrain(),o.cameraElevationReference="ground",t!==o.zoom&&this._map._update(!0)}if(!yr(e))return this._fireEvents(i,n,!0);let{panDelta:a,zoomDelta:l,bearingDelta:c,pitchDelta:u,around:h,aroundCoord:p,pinchAround:d}=e;void 0!==d&&(h=d),(t=>i.drag&&!this._eventsInProgress.drag)()&&h&&(this._dragOrigin=s(o.pointCoordinate3D(h)),this._trackingEllipsoid.setup(o._camera.position,this._dragOrigin)),o.cameraElevationReference="sea",r._stop(!0),h=h||r.transform.centerPoint,c&&(o.bearing+=c),u&&(o.pitch+=u),o._updateCameraState();const f=[0,0,0];if(a){const t=o.screenPointToMercatorRay(h),e=o.screenPointToMercatorRay(h.sub(a)),i=this._trackingEllipsoid.projectRay(t.dir),n=this._trackingEllipsoid.projectRay(e.dir);f[0]=n[0]-i[0],f[1]=n[1]-i[1]}const m=o.zoom,g=[0,0,0];if(l){const e=s(p||o.pointCoordinate3D(h)),i={dir:t.normalize([],t.sub([],e,o._camera.position))},n=o.screenPointToMercatorRay(o.centerPoint);if(i.dir[2]<0){const r=t.altitudeFromMercatorZ(e[2],e[1]),a=o.rayIntersectionCoordinate(o.pointRayIntersection(o.centerPoint,r)),c=o.zoomDeltaToMovement(s(a),l)*(n.dir[2]/i.dir[2]);t.scale(g,i.dir,c)}else if(o._terrainEnabled()){const n=o.zoomDeltaToMovement(e,l);t.scale(g,i.dir,n)}}const y=t.add(f,f,g);o._translateCameraConstrained(y),l&&Math.abs(o.zoom-m)>1e-4&&o.recenterOnTerrain(),o.cameraElevationReference="ground",this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(i,n,!0)}_fireEvents(e,i,n){const r=fr(this._eventsInProgress),o=fr(e),s={};for(const t in e){const{originalEvent:i}=e[t];this._eventsInProgress[t]||(s[`${t}start`]=i),this._eventsInProgress[t]=e[t]}!r&&o&&this._fireEvent("movestart",o.originalEvent);for(const t in s)this._fireEvent(t,s[t]);o&&this._fireEvent("move",o.originalEvent);for(const t in e){const{originalEvent:i}=e[t];this._fireEvent(t,i)}const a={};let l;for(const t in this._eventsInProgress){const{handlerName:e,originalEvent:n}=this._eventsInProgress[t];this._handlersById[e].isActive()||(delete this._eventsInProgress[t],l=i[e]||n,a[`${t}end`]=l)}for(const t in a)this._fireEvent(t,a[t]);const c=fr(this._eventsInProgress);if(n&&(r||o)&&!c){this._updatingCamera=!0;const e=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),i=t=>0!==t&&-this._bearingSnap<t&&t<this._bearingSnap;e?(i(e.bearing||this._map.getBearing())&&(e.bearing=0),this._map.easeTo(e,{originalEvent:l})):(this._map.fire(new t.Event("moveend",{originalEvent:l})),i(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(e,i){this._map.fire(new t.Event(e,i?{originalEvent:i}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((t=>{delete this._frameId,this.handleEvent(new mr("renderFrame",{timeStamp:t})),this._applyChanges()}))}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}class _r extends t.Evented{constructor(e,i){super(),this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=i.bearingSnap,t.bindAll(["_renderFrameCallback"],this)}getCenter(){return new t.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(t,e){return this.jumpTo({center:t},e)}panBy(e,i,n){return e=t.pointGeometry.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},i),n)}panTo(e,i,n){return this.easeTo(t.extend({center:e},i),n)}getZoom(){return this.transform.zoom}setZoom(t,e){return this.jumpTo({zoom:t},e),this}zoomTo(e,i,n){return this.easeTo(t.extend({zoom:e},i),n)}zoomIn(t,e){return this.zoomTo(this.getZoom()+1,t,e),this}zoomOut(t,e){return this.zoomTo(this.getZoom()-1,t,e),this}getBearing(){return this.transform.bearing}setBearing(t,e){return this.jumpTo({bearing:t},e),this}getPadding(){return this.transform.padding}setPadding(t,e){return this.jumpTo({padding:t},e),this}rotateTo(e,i,n){return this.easeTo(t.extend({bearing:e},i),n)}resetNorth(e,i){return this.rotateTo(0,t.extend({duration:1e3},e),i),this}resetNorthPitch(e,i){return this.easeTo(t.extend({bearing:0,pitch:0,duration:1e3},e),i),this}snapToNorth(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this}getPitch(){return this.transform.pitch}setPitch(t,e){return this.jumpTo({pitch:t},e),this}cameraForBounds(e,i){e=t.LngLatBounds.convert(e);const n=i&&i.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),n,i)}_extendCameraOptions(e){const i={top:0,bottom:0,right:0,left:0};if("number"==typeof(e=t.extend({padding:i,offset:[0,0],maxZoom:this.transform.maxZoom},e)).padding){const t=e.padding;e.padding={top:t,bottom:t,right:t,left:t}}return e.padding=t.extend(i,e.padding),e}_cameraForBoxAndBearing(e,i,n,r){const o=this._extendCameraOptions(r),s=this.transform,a=s.padding,l=s.project(t.LngLat.convert(e)),c=s.project(t.LngLat.convert(i)),u=l.rotate(-t.degToRad(n)),h=c.rotate(-t.degToRad(n)),p=new t.pointGeometry(Math.max(u.x,h.x),Math.max(u.y,h.y)),d=new t.pointGeometry(Math.min(u.x,h.x),Math.min(u.y,h.y)),f=p.sub(d),m=(s.width-(a.left+a.right+o.padding.left+o.padding.right))/f.x,g=(s.height-(a.top+a.bottom+o.padding.top+o.padding.bottom))/f.y;if(g<0||m<0)return void t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.");const y=Math.min(s.scaleZoom(s.scale*Math.min(m,g)),o.maxZoom),v="number"==typeof o.offset.x?new t.pointGeometry(o.offset.x,o.offset.y):t.pointGeometry.convert(o.offset),_=new t.pointGeometry((o.padding.left-o.padding.right)/2,(o.padding.top-o.padding.bottom)/2).rotate(n*Math.PI/180),x=v.add(_).mult(s.scale/s.zoomScale(y));return{center:s.unproject(l.add(c).div(2).sub(x)),zoom:y,bearing:n}}_cameraForBox(e,i,n,r,o){const s=this._extendCameraOptions(o);n=n||0,r=r||0,e=t.LngLat.convert(e),i=t.LngLat.convert(i);const a=this.transform.clone();a.padding=s.padding;const l=this.getFreeCameraOptions(),c=new t.LngLat(.5*(e.lng+i.lng),.5*(e.lat+i.lat)),u=.5*(n+r);if(a._camera.position[2]<t.mercatorZfromAltitude(u,c.lat))return void t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.");l.lookAtPoint(c),a.setFreeCameraOptions(l);const h=t.MercatorCoordinate.fromLngLat(e),p=t.MercatorCoordinate.fromLngLat(i),m=a.pointRayIntersection(a.centerPoint,u),g=[(y=a.rayIntersectionCoordinate(m)).x,y.y,y.z];var y;const v=a.screenPointToMercatorRay(a.centerPoint);let _,x=0;do{const i=Math.floor(a.zoom),o=1<<i,s=Math.min(o*h.x,o*p.x),l=Math.min(o*h.y,o*p.y),c=Math.max(o*h.x,o*p.x),u=Math.max(o*h.y,o*p.y),m=new f([s,l,n],[c,u,r]),y=d.fromInvProjectionMatrix(a.invProjMatrix,a.worldSize,i);if(2!==m.intersects(y)){_&&(a._camera.position=t.scaleAndAdd([],a._camera.position,v.dir,-_),a._updateStateFromCamera());break}const x=t.sub([],a._camera.position,g);_=.5*t.length(x),a._camera.position=t.scaleAndAdd([],a._camera.position,v.dir,_);try{a._updateStateFromCamera()}catch(e){return void t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}}while(++x<10);return{center:a.center,zoom:a.zoom,bearing:a.bearing,pitch:a.pitch}}fitBounds(t,e,i){return this._fitInternal(this.cameraForBounds(t,e),e,i)}_raycastElevationBox(e,i){const n=this.transform.elevation;if(!n)return;const r=new t.pointGeometry(e.x,i.y),o=new t.pointGeometry(i.x,e.y),s=n.pointCoordinate(e);if(!s)return;const a=n.pointCoordinate(i);if(!a)return;const l=n.pointCoordinate(r);if(!l)return;const c=n.pointCoordinate(o);if(!c)return;const u=new t.MercatorCoordinate(s[0],s[1]).toLngLat(),h=new t.MercatorCoordinate(a[0],a[1]).toLngLat(),p=new t.MercatorCoordinate(l[0],l[1]).toLngLat(),d=new t.MercatorCoordinate(c[0],c[1]).toLngLat(),f=Math.min(u.lng,Math.min(h.lng,Math.min(p.lng,d.lng))),m=Math.min(u.lat,Math.min(h.lat,Math.min(p.lat,d.lat))),g=Math.max(u.lng,Math.max(h.lng,Math.max(p.lng,d.lng))),y=Math.max(u.lat,Math.max(h.lat,Math.max(p.lat,d.lat))),v=Math.min(s[3],Math.min(a[3],Math.min(l[3],c[3]))),_=Math.max(s[3],Math.max(a[3],Math.max(l[3],c[3])));return{minLngLat:new t.LngLat(f,m),maxLngLat:new t.LngLat(g,y),minAltitude:v,maxAltitude:_}}fitScreenCoordinates(e,i,n,r,o){let s,a,l,c;const u=t.pointGeometry.convert(e),h=t.pointGeometry.convert(i),p=this._raycastElevationBox(u,h);if(p)s=p.minLngLat,a=p.maxLngLat,l=p.minAltitude,c=p.maxAltitude;else{if(this.transform.isHorizonVisibleForPoints(u,h))return this;s=this.transform.pointLocation(u),a=this.transform.pointLocation(h)}return this._fitInternal(0===this.transform.pitch?this._cameraForBoxAndBearing(this.transform.pointLocation(t.pointGeometry.convert(e)),this.transform.pointLocation(t.pointGeometry.convert(i)),n,r):this._cameraForBox(s,a,l,c,r),r,o)}_fitInternal(e,i,n){return e?(delete(i=t.extend(e,i)).padding,i.linear?this.easeTo(i,n):this.flyTo(i,n)):this}jumpTo(e,i){this.stop();const n=this.transform;let r=!1,o=!1,s=!1;return"zoom"in e&&n.zoom!==+e.zoom&&(r=!0,n.zoom=+e.zoom),void 0!==e.center&&(n.center=t.LngLat.convert(e.center)),"bearing"in e&&n.bearing!==+e.bearing&&(o=!0,n.bearing=+e.bearing),"pitch"in e&&n.pitch!==+e.pitch&&(s=!0,n.pitch=+e.pitch),null==e.padding||n.isPaddingEqual(e.padding)||(n.padding=e.padding),this.fire(new t.Event("movestart",i)).fire(new t.Event("move",i)),r&&this.fire(new t.Event("zoomstart",i)).fire(new t.Event("zoom",i)).fire(new t.Event("zoomend",i)),o&&this.fire(new t.Event("rotatestart",i)).fire(new t.Event("rotate",i)).fire(new t.Event("rotateend",i)),s&&this.fire(new t.Event("pitchstart",i)).fire(new t.Event("pitch",i)).fire(new t.Event("pitchend",i)),this.fire(new t.Event("moveend",i))}getFreeCameraOptions(){return this.transform.getFreeCameraOptions()}setFreeCameraOptions(e,i){this.stop();const n=this.transform,r=n.zoom,o=n.pitch,s=n.bearing;n.setFreeCameraOptions(e);const a=r!==n.zoom,l=o!==n.pitch,c=s!==n.bearing;return this.fire(new t.Event("movestart",i)).fire(new t.Event("move",i)),a&&this.fire(new t.Event("zoomstart",i)).fire(new t.Event("zoom",i)).fire(new t.Event("zoomend",i)),c&&this.fire(new t.Event("rotatestart",i)).fire(new t.Event("rotate",i)).fire(new t.Event("rotateend",i)),l&&this.fire(new t.Event("pitchstart",i)).fire(new t.Event("pitch",i)).fire(new t.Event("pitchend",i)),this.fire(new t.Event("moveend",i)),this}easeTo(e,i){this._stop(!1,e.easeId),(!1===(e=t.extend({offset:[0,0],duration:500,easing:t.ease},e)).animate||!e.essential&&t.exported.prefersReducedMotion)&&(e.duration=0);const n=this.transform,r=this.getZoom(),o=this.getBearing(),s=this.getPitch(),a=this.getPadding(),l="zoom"in e?+e.zoom:r,c="bearing"in e?this._normalizeBearing(e.bearing,o):o,u="pitch"in e?+e.pitch:s,h="padding"in e?e.padding:n.padding,p=t.pointGeometry.convert(e.offset);let d=n.centerPoint.add(p);const f=n.pointLocation(d),m=t.LngLat.convert(e.center||f);this._normalizeCenter(m);const g=n.project(f),y=n.project(m).sub(g),v=n.zoomScale(l-r);let _,x;e.around&&(_=t.LngLat.convert(e.around),x=n.locationPoint(_));const b={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||l!==r,this._rotating=this._rotating||o!==c,this._pitching=this._pitching||u!==s,this._padding=!n.isPaddingEqual(h),this._easeId=e.easeId,this._prepareEase(i,e.noMoveStart,b),this._ease((e=>{if(this._zooming&&(n.zoom=t.number(r,l,e)),this._rotating&&(n.bearing=t.number(o,c,e)),this._pitching&&(n.pitch=t.number(s,u,e)),this._padding&&(n.interpolatePadding(a,h,e),d=n.centerPoint.add(p)),_)n.setLocationAtPoint(_,x);else{const t=n.zoomScale(n.zoom-r),i=l>r?Math.min(2,v):Math.max(.5,v),o=Math.pow(i,1-e),s=n.unproject(g.add(y.mult(e*o)).mult(t));n.setLocationAtPoint(n.renderWorldCopies?s.wrap():s,d)}this._fireMoveEvents(i)}),(t=>{n.recenterOnTerrain(),this._afterEase(i,t)}),e),this}_prepareEase(e,i,n={}){this._moving=!0,this.transform.cameraElevationReference="sea",i||n.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!n.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new t.Event("pitchstart",e))}_fireMoveEvents(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))}_afterEase(e,i){if(this._easeId&&i&&this._easeId===i)return;delete this._easeId,this.transform.cameraElevationReference="ground";const n=this._zooming,r=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new t.Event("zoomend",e)),r&&this.fire(new t.Event("rotateend",e)),o&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}flyTo(e,i){if(!e.essential&&t.exported.prefersReducedMotion){const n=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(n,i)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);const n=this.transform,r=this.getZoom(),o=this.getBearing(),s=this.getPitch(),a=this.getPadding(),l="zoom"in e?t.clamp(+e.zoom,n.minZoom,n.maxZoom):r,c="bearing"in e?this._normalizeBearing(e.bearing,o):o,u="pitch"in e?+e.pitch:s,h="padding"in e?e.padding:n.padding,p=n.zoomScale(l-r),d=t.pointGeometry.convert(e.offset);let f=n.centerPoint.add(d);const m=n.pointLocation(f),g=t.LngLat.convert(e.center||m);this._normalizeCenter(g);const y=n.project(m),v=n.project(g).sub(y);let _=e.curve;const x=Math.max(n.width,n.height),b=x/p,w=v.mag();if("minZoom"in e){const i=t.clamp(Math.min(e.minZoom,r,l),n.minZoom,n.maxZoom),o=x/n.zoomScale(i-r);_=Math.sqrt(o/w*2)}const A=_*_;function E(t){const e=(b*b-x*x+(t?-1:1)*A*A*w*w)/(2*(t?b:x)*A*w);return Math.log(Math.sqrt(e*e+1)-e)}function S(t){return(Math.exp(t)-Math.exp(-t))/2}function M(t){return(Math.exp(t)+Math.exp(-t))/2}const T=E(0);let I=function(t){return M(T)/M(T+_*t)},C=function(t){return x*((M(T)*(S(e=T+_*t)/M(e))-S(T))/A)/w;var e},P=(E(1)-T)/_;if(Math.abs(w)<1e-6||!isFinite(P)){if(Math.abs(x-b)<1e-6)return this.easeTo(e,i);const t=b<x?-1:1;P=Math.abs(Math.log(b/x))/_,C=function(){return 0},I=function(e){return Math.exp(t*_*e)}}return e.duration="duration"in e?+e.duration:1e3*P/("screenSpeed"in e?+e.screenSpeed/_:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=o!==c,this._pitching=u!==s,this._padding=!n.isPaddingEqual(h),this._prepareEase(i,!1),this._ease((e=>{const p=e*P,m=1/I(p);n.zoom=1===e?l:r+n.scaleZoom(m),this._rotating&&(n.bearing=t.number(o,c,e)),this._pitching&&(n.pitch=t.number(s,u,e)),this._padding&&(n.interpolatePadding(a,h,e),f=n.centerPoint.add(d));const _=1===e?g:n.unproject(y.add(v.mult(C(p))).mult(m));n.setLocationAtPoint(n.renderWorldCopies?_.wrap():_,f),n._updateCenterElevation(),this._fireMoveEvents(i)}),(()=>this._afterEase(i)),e),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const t=this._onEaseEnd;delete this._onEaseEnd,t.call(this,e)}if(!t){const t=this.handlers;t&&t.stop(!1)}return this}_ease(e,i,n){!1===n.animate||0===n.duration?(e(1),i()):(this._easeStart=t.exported.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=i,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const e=Math.min((t.exported.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(e,i){e=t.wrap(e,-180,180);const n=Math.abs(e-i);return Math.abs(e-360-i)<n&&(e-=360),Math.abs(e+360-i)<n&&(e+=360),e}_normalizeCenter(t){const e=this.transform;if(!e.renderWorldCopies||e.lngRange)return;const i=t.lng-e.center.lng;t.lng+=i>180?-360:i<-180?360:0}}class xr{constructor(e={}){this.options=e,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(t){const e=this.options&&this.options.compact;return this._map=t,this._container=o.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=o.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=o.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){o.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_setElementTitle(t,e){const i=this._map._getUIString(`AttributionControl.${e}`);t.title=i,t.setAttribute("aria-label",i)}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))}_updateEditLink(){let e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));const i=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){const n=i.reduce(((t,e,n)=>(e.value&&(t+=`${e.key}=${e.value}${n<i.length-1?"&":""}`),t)),"?");e.href=`${t.config.FEEDBACK_URL}/${n}${this._map._hash?this._map._hash.getHashString(!0):""}`,e.rel="noopener nofollow",this._setElementTitle(e,"MapFeedback")}}_updateData(t){!t||"metadata"!==t.sourceDataType&&"visibility"!==t.sourceDataType&&"style"!==t.dataType||(this._updateAttributions(),this._updateEditLink())}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((t=>"string"!=typeof t?"":t))):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){const t=this._map.style.stylesheet;this.styleOwner=t.owner,this.styleId=t.id}const e=this._map.style._sourceCaches;for(const i in e){const n=e[i];if(n.used){const e=n.getSource();e.attribution&&t.indexOf(e.attribution)<0&&t.push(e.attribution)}}t.sort(((t,e)=>t.length-e.length)),t=t.filter(((e,i)=>{for(let n=i+1;n<t.length;n++)if(t[n].indexOf(e)>=0)return!1;return!0}));const i=t.join(" | ");i!==this._attribHTML&&(this._attribHTML=i,t.length?(this._innerContainer.innerHTML=i,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 br{constructor(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)}onAdd(t){this._map=t,this._container=o.create("div","mapboxgl-ctrl");const e=o.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){o.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const t=this._map.style._sourceCaches;if(0===Object.entries(t).length)return!0;for(const e in t){const i=t[e].getSource();if(i.hasOwnProperty("mapbox_logo")&&!i.mapbox_logo)return!1}return!0}_updateCompact(){const t=this._container.children;if(t.length){const e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}}}class wr{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e}remove(t){const e=this._currentlyRunning,i=e?this._queue.concat(e):this._queue;for(const e of i)if(e.id===t)return void(e.cancelled=!0)}run(t=0){const e=this._currentlyRunning=this._queue;this._queue=[];for(const i of e)if(!i.cancelled&&(i.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}function Ar(e,i,n){if(e=new t.LngLat(e.lng,e.lat),i){const r=new t.LngLat(e.lng-360,e.lat),o=new t.LngLat(e.lng+360,e.lat),s=360*Math.ceil(Math.abs(e.lng-n.center.lng)/360),a=n.locationPoint(e).distSqr(i),l=i.x<0||i.y<0||i.x>n.width||i.y>n.height;n.locationPoint(r).distSqr(i)<a&&(l||Math.abs(r.lng-n.center.lng)<s)?e=r:n.locationPoint(o).distSqr(i)<a&&(l||Math.abs(o.lng-n.center.lng)<s)&&(e=o)}for(;Math.abs(e.lng-n.center.lng)>180;){const t=n.locationPoint(e);if(t.x>=0&&t.y>=0&&t.x<=n.width&&t.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e}const Er={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Sr(t,e,i){const n=t.classList;for(const t in Er)n.remove(`mapboxgl-${i}-anchor-${t}`);n.add(`mapboxgl-${i}-anchor-${e}`)}class Mr extends t.Evented{constructor(e,i){if(super(),(e instanceof t.window.HTMLElement||i)&&(e=t.extend({element:e},i)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this),this._anchor=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",this._scale=e&&e.scale||1,this._draggable=e&&e.draggable||!1,this._clickTolerance=e&&e.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=e&&e.rotation||0,this._rotationAlignment=e&&e.rotationAlignment||"auto",this._pitchAlignment=e&&e.pitchAlignment&&"auto"!==e.pitchAlignment?e.pitchAlignment:this._rotationAlignment,e&&e.element)this._element=e.element,this._offset=t.pointGeometry.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=o.create("div"),this._element.setAttribute("aria-label","Map marker");const i=o.createNS("http://www.w3.org/2000/svg","svg"),n=41,r=27;i.setAttributeNS(null,"display","block"),i.setAttributeNS(null,"height",`${n}px`),i.setAttributeNS(null,"width",`${r}px`),i.setAttributeNS(null,"viewBox",`0 0 ${r} ${n}`);const s=o.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"stroke","none"),s.setAttributeNS(null,"stroke-width","1"),s.setAttributeNS(null,"fill","none"),s.setAttributeNS(null,"fill-rule","evenodd");const a=o.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"fill-rule","nonzero");const l=o.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");const c=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const t of c){const e=o.createNS("http://www.w3.org/2000/svg","ellipse");e.setAttributeNS(null,"opacity","0.04"),e.setAttributeNS(null,"cx","10.5"),e.setAttributeNS(null,"cy","5.80029008"),e.setAttributeNS(null,"rx",t.rx),e.setAttributeNS(null,"ry",t.ry),l.appendChild(e)}const u=o.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"fill",this._color);const h=o.createNS("http://www.w3.org/2000/svg","path");h.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),u.appendChild(h);const p=o.createNS("http://www.w3.org/2000/svg","g");p.setAttributeNS(null,"opacity","0.25"),p.setAttributeNS(null,"fill","#000000");const d=o.createNS("http://www.w3.org/2000/svg","path");d.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),p.appendChild(d);const f=o.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"transform","translate(6.0, 7.0)"),f.setAttributeNS(null,"fill","#FFFFFF");const m=o.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"transform","translate(8.0, 8.0)");const g=o.createNS("http://www.w3.org/2000/svg","circle");g.setAttributeNS(null,"fill","#000000"),g.setAttributeNS(null,"opacity","0.25"),g.setAttributeNS(null,"cx","5.5"),g.setAttributeNS(null,"cy","5.5"),g.setAttributeNS(null,"r","5.4999962");const y=o.createNS("http://www.w3.org/2000/svg","circle");y.setAttributeNS(null,"fill","#FFFFFF"),y.setAttributeNS(null,"cx","5.5"),y.setAttributeNS(null,"cy","5.5"),y.setAttributeNS(null,"r","5.4999962"),m.appendChild(g),m.appendChild(y),a.appendChild(l),a.appendChild(u),a.appendChild(p),a.appendChild(f),a.appendChild(m),i.appendChild(a),i.setAttributeNS(null,"height",n*this._scale+"px"),i.setAttributeNS(null,"width",r*this._scale+"px"),this._element.appendChild(i),this._offset=t.pointGeometry.convert(e&&e.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(t=>{t.preventDefault()})),this._element.addEventListener("mousedown",(t=>{t.preventDefault()})),Sr(this._element,this._anchor,"marker"),this._popup=null}addTo(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("remove",this._clearFadeTimer),t._addMarker(this),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._map.off("remove",this._clearFadeTimer),this._map._removeMarker(this),delete this._map),this._clearFadeTimer(),o.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){const e=38.1,i=13.5,n=Math.sqrt(Math.pow(i,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-e],"bottom-left":[n,-1*(e-i+n)],"bottom-right":[-n,-1*(e-i+n)],left:[i,-1*(e-i)],right:[-i,-1*(e-i)]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}_onKeyPress(t){const e=t.code,i=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==i&&13!==i||this.togglePopup()}_onMapClick(t){const e=t.originalEvent.target,i=this._element;this._popup&&(e===i||i.contains(e))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this}_evaluateOpacity(){const t=this._pos?this._pos.sub(this._transformedOffset()):null;if(!this._withinScreenBounds(t))return void this._clearFadeTimer();const e=this._map.unproject(t);let i=!1;if(this._map.getTerrain()){const t=this._map.getFreeCameraOptions();if(t.position){const n=t.position.toLngLat();i=n.distanceTo(e)<.9*n.distanceTo(this._lngLat)}}const n=(1-this._map._queryFogOpacity(e))*(i?.2:1);this._element.style.opacity=`${n}`,this._popup&&this._popup._setOpacity(`${n}`),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_withinScreenBounds(t){const e=this._map.transform;return!!t&&t.x>=0&&t.x<e.width&&t.y>=0&&t.y<e.height}_update(t){if(!this._map)return;this._map.transform.renderWorldCopies&&(this._lngLat=Ar(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._transformedOffset());let e="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?e=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(e=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let i="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?i="rotateX(0deg)":"map"===this._pitchAlignment&&(i=`rotateX(${this._map.getPitch()}deg)`),t&&"moveend"!==t.type||(this._pos=this._pos.round()),this._map._requestDomTask((()=>{this._map&&(this._element&&this._pos&&this._anchor&&o.setTransform(this._element,`${Er[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${i} ${e}`),!this._map.getTerrain()&&!this._map.getFog()||this._fadeTimer||(this._fadeTimer=setTimeout(this._evaluateOpacity.bind(this),60)))}))}_transformedOffset(){if(!this._defaultMarker)return this._offset;const t=this._map.transform,e=this._offset.mult(this._scale);return"map"===this._rotationAlignment&&e._rotate(t.angle),"map"===this._pitchAlignment&&(e.y*=Math.cos(t._pitch)),e}getOffset(){return this._offset}setOffset(e){return this._offset=t.pointGeometry.convert(e),this._update(),this}_onMove(e){if(!this._isDragging){const t=this._clickTolerance||this._map._clickTolerance;this._isDragging=e.point.dist(this._pointerdownPos)>=t}this._isDragging&&(this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag")))}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive"}_addDragHandler(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._transformedOffset()),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))}setDraggable(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}class Tr{constructor(t){this.jumpTo(t)}getValue(e){if(e<=this._startTime)return this._start;if(e>=this._endTime)return this._end;const i=t.easeCubicInOut((e-this._startTime)/(this._endTime-this._startTime));return this._start*(1-i)+this._end*i}isEasing(t){return t>=this._startTime&&t<=this._endTime}jumpTo(t){this._startTime=-1/0,this._endTime=-1/0,this._start=t,this._end=t}easeTo(t,e,i){this._start=this.getValue(e),this._end=t,this._startTime=e,this._endTime=e+i}}const Ir={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},{HTMLImageElement:Cr,HTMLElement:Pr,ImageBitmap:Lr}=t.window,Dr={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,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,optimizeForTerrain:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0};function Rr(t){t.parentNode&&t.parentNode.removeChild(t)}const Or={showCompass:!0,showZoom:!0,visualizePitch:!1};class kr{constructor(e,i,n=!1){this._clickTolerance=10,this.element=i,this.mouseRotate=new qn({clickTolerance:e.dragRotate._mouseRotate._clickTolerance}),this.map=e,n&&(this.mousePitch=new Xn({clickTolerance:e.dragRotate._mousePitch._clickTolerance})),t.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),o.addEventListener(i,"mousedown",this.mousedown),o.addEventListener(i,"touchstart",this.touchstart,{passive:!1}),o.addEventListener(i,"touchmove",this.touchmove),o.addEventListener(i,"touchend",this.touchend),o.addEventListener(i,"touchcancel",this.reset)}down(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),o.disableDrag()}move(t,e){const i=this.map,n=this.mouseRotate.mousemoveWindow(t,e);if(n&&n.bearingDelta&&i.setBearing(i.getBearing()+n.bearingDelta),this.mousePitch){const n=this.mousePitch.mousemoveWindow(t,e);n&&n.pitchDelta&&i.setPitch(i.getPitch()+n.pitchDelta)}}off(){const t=this.element;o.removeEventListener(t,"mousedown",this.mousedown),o.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),o.removeEventListener(t,"touchmove",this.touchmove),o.removeEventListener(t,"touchend",this.touchend),o.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){o.enableDrag(),o.removeEventListener(t.window,"mousemove",this.mousemove),o.removeEventListener(t.window,"mouseup",this.mouseup)}mousedown(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:()=>e.preventDefault()}),o.mousePos(this.element,e)),o.addEventListener(t.window,"mousemove",this.mousemove),o.addEventListener(t.window,"mouseup",this.mouseup)}mousemove(t){this.move(t,o.mousePos(this.element,t))}mouseup(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()}touchstart(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=o.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>t.preventDefault()},this._startPos))}touchmove(t){1!==t.targetTouches.length?this.reset():(this._lastPos=o.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:()=>t.preventDefault()},this._lastPos))}touchend(t){0===t.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 Nr={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Br,zr=0,Fr=!1;const Vr={maxWidth:100,unit:"metric"};function Ur(t,e,i){const n=i&&i.maxWidth||100,r=t._container.clientHeight/2,o=t.unproject([0,r]),s=t.unproject([n,r]),a=o.distanceTo(s);if(i&&"imperial"===i.unit){const i=3.2808*a;i>5280?Gr(e,n,i/5280,t._getUIString("ScaleControl.Miles"),t):Gr(e,n,i,t._getUIString("ScaleControl.Feet"),t)}else i&&"nautical"===i.unit?Gr(e,n,a/1852,t._getUIString("ScaleControl.NauticalMiles"),t):a>=1e3?Gr(e,n,a/1e3,t._getUIString("ScaleControl.Kilometers"),t):Gr(e,n,a,t._getUIString("ScaleControl.Meters"),t)}function Gr(t,e,i,n,r){const o=function(t){const e=Math.pow(10,`${Math.floor(t)}`.length-1);let i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:i>=1?1:function(t){const e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(i),e*i}(i),s=o/i;r._requestDomTask((()=>{t.style.width=e*s+"px",t.innerHTML=`${o} ${n}`}))}const jr={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",},Hr=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Wr(e){if(e){if("number"==typeof e){const i=Math.round(Math.sqrt(.5*Math.pow(e,2)));return{center:new t.pointGeometry(0,0),top:new t.pointGeometry(0,e),"top-left":new t.pointGeometry(i,i),"top-right":new t.pointGeometry(-i,i),bottom:new t.pointGeometry(0,-e),"bottom-left":new t.pointGeometry(i,-i),"bottom-right":new t.pointGeometry(-i,-i),left:new t.pointGeometry(e,0),right:new t.pointGeometry(-e,0)}}if(e instanceof t.pointGeometry||Array.isArray(e)){const i=t.pointGeometry.convert(e);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:t.pointGeometry.convert(e.center||[0,0]),top:t.pointGeometry.convert(e.top||[0,0]),"top-left":t.pointGeometry.convert(e["top-left"]||[0,0]),"top-right":t.pointGeometry.convert(e["top-right"]||[0,0]),bottom:t.pointGeometry.convert(e.bottom||[0,0]),"bottom-left":t.pointGeometry.convert(e["bottom-left"]||[0,0]),"bottom-right":t.pointGeometry.convert(e["bottom-right"]||[0,0]),left:t.pointGeometry.convert(e.left||[0,0]),right:t.pointGeometry.convert(e.right||[0,0])}}return Wr(new t.pointGeometry(0,0))}const qr={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:class extends _r{constructor(e){if(null!=(e=t.extend({},Dr,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new An(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies),e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._optimizeForTerrain=e.optimizeForTerrain,this._renderTaskQueue=new wr,this._domRenderTaskQueue=new wr,this._controls=[],this._markers=[],this._mapId=t.uniqueId(),this._locale=t.extend({},Ir,e.locale),this._clickTolerance=e.clickTolerance,this._averageElevationLastSampledAt=-1/0,this._averageElevation=new Tr(0),this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken,e.testMode),this._silenceAuthErrors=!!e.testMode,"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error(`Container '${e.container}' not found.`)}else{if(!(e.container instanceof Pr))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_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!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new vr(this,e),this._hash=e.hash&&new En("string"==typeof e.hash&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localFontFamily=e.localFontFamily,this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),e.attributionControl&&this.addControl(new xr({customAttribution:e.customAttribution})),this._logoControl=new br,this.addControl(this._logoControl,e.logoPosition),this.on("style.load",(()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)})),this.on("data",(e=>{this._update("style"===e.dataType),this.fire(new t.Event(`${e.dataType}data`,e))})),this.on("dataloading",(e=>{this.fire(new t.Event(`${e.dataType}dataloading`,e))}))}_getMapId(){return this._mapId}addControl(e,i){if(void 0===i&&(i=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=e.onAdd(this);this._controls.push(e);const r=this._controlPositions[i];return-1!==i.indexOf("bottom")?r.insertBefore(n,r.firstChild):r.appendChild(n),this}removeControl(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const i=this._controls.indexOf(e);return i>-1&&this._controls.splice(i,1),e.onRemove(this),this}hasControl(t){return this._controls.indexOf(t)>-1}resize(e){const i=this._containerDimensions(),n=i[0],r=i[1];this._resizeCanvas(n,r),this.transform.resize(n,r),this.painter.resize(n,r);const o=!this._moving;return o&&(this.stop(),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e))),this.fire(new t.Event("resize",e)),o&&this.fire(new t.Event("moveend",e)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),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;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;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;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;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(t){return this.transform.renderWorldCopies=t,this._update()}project(e){return this.transform.locationPoint3D(t.LngLat.convert(e))}unproject(e){return this.transform.pointLocation3D(t.pointGeometry.convert(e))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()}_createDelegatedListener(t,e,i){if("mouseenter"===t||"mouseover"===t){let n=!1;const r=r=>{const o=this.getLayer(e)?this.queryRenderedFeatures(r.point,{layers:[e]}):[];o.length?n||(n=!0,i.call(this,new Rn(t,this,r.originalEvent,{features:o}))):n=!1};return{layer:e,listener:i,delegates:{mousemove:r,mouseout:()=>{n=!1}}}}if("mouseleave"===t||"mouseout"===t){let n=!1;const r=r=>{(this.getLayer(e)?this.queryRenderedFeatures(r.point,{layers:[e]}):[]).length?n=!0:n&&(n=!1,i.call(this,new Rn(t,this,r.originalEvent)))},o=e=>{n&&(n=!1,i.call(this,new Rn(t,this,e.originalEvent)))};return{layer:e,listener:i,delegates:{mousemove:r,mouseout:o}}}{const n=t=>{const n=this.getLayer(e)?this.queryRenderedFeatures(t.point,{layers:[e]}):[];n.length&&(t.features=n,i.call(this,t),delete t.features)};return{layer:e,listener:i,delegates:{[t]:n}}}}on(t,e,i){if(void 0===i)return super.on(t,e);const n=this._createDelegatedListener(t,e,i);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(n);for(const t in n.delegates)this.on(t,n.delegates[t]);return this}once(t,e,i){if(void 0===i)return super.once(t,e);const n=this._createDelegatedListener(t,e,i);for(const t in n.delegates)this.once(t,n.delegates[t]);return this}off(t,e,i){return void 0===i?super.off(t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&(n=>{const r=this._delegatedListeners[t];for(let t=0;t<r.length;t++){const n=r[t];if(n.layer===e&&n.listener===i){for(const t in n.delegates)this.off(t,n.delegates[t]);return r.splice(t,1),this}}})(),this)}queryRenderedFeatures(e,i){return this.style?(void 0!==i||void 0===e||e instanceof t.pointGeometry||Array.isArray(e)||(i=e,e=void 0),this.style.queryRenderedFeatures(e=e||[[0,0],[this.transform.width,this.transform.height]],i=i||{},this.transform)):[]}querySourceFeatures(t,e){return this.style.querySourceFeatures(t,e)}setStyle(e,i){return!1!==(i=t.extend({},{localIdeographFontFamily:this._localIdeographFontFamily,localFontFamily:this._localFontFamily},i)).diff&&i.localIdeographFontFamily===this._localIdeographFontFamily&&i.localFontFamily===this._localFontFamily&&this.style&&e?(this._diffStyle(e,i),this):(this._localIdeographFontFamily=i.localIdeographFontFamily,this._localFontFamily=i.localFontFamily,this._updateStyle(e,i))}_getUIString(t){const e=this._locale[t];if(null==e)throw new Error(`Missing UI string '${t}'`);return e}_updateStyle(t,e){return this.style&&(this.style.setEventedParent(null),this.style._remove(),delete this.style),t&&(this.style=new Ue(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t):this.style.loadJSON(t)),this._updateTerrain(),this}_lazyInitEmptyStyle(){this.style||(this.style=new Ue(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(e,i){if("string"==typeof e){const n=this._requestManager.normalizeStyleURL(e),r=this._requestManager.transformRequest(n,t.ResourceType.Style);t.getJSON(r,((e,n)=>{e?this.fire(new t.ErrorEvent(e)):n&&this._updateDiff(n,i)}))}else"object"==typeof e&&this._updateDiff(e,i)}_updateDiff(e,i){try{this.style.setState(e)&&this._update(!0)}catch(n){t.warnOnce(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(e,i)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():t.warnOnce("There is no style added to the map.")}addSource(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)}isSourceLoaded(e){const i=this.style&&this.style._getSourceCaches(e);if(0!==i.length)return i.every((t=>t.loaded()));this.fire(new t.ErrorEvent(new Error(`There is no source with ID '${e}'`)))}areTilesLoaded(){const t=this.style&&this.style._sourceCaches;for(const e in t){const i=t[e]._tiles;for(const t in i){const e=i[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}}return!0}addSourceType(t,e,i){return this._lazyInitEmptyStyle(),this.style.addSourceType(t,e,i)}removeSource(t){return this.style.removeSource(t),this._updateTerrain(),this._update(!0)}getSource(t){return this.style.getSource(t)}addImage(e,i,{pixelRatio:n=1,sdf:r=!1,stretchX:o,stretchY:s,content:a}={}){if(this._lazyInitEmptyStyle(),i instanceof Cr||Lr&&i instanceof Lr){const{width:l,height:c,data:u}=t.exported.getImageData(i);this.style.addImage(e,{data:new t.RGBAImage({width:l,height:c},u),pixelRatio:n,stretchX:o,stretchY:s,content:a,sdf:r,version:0})}else{if(void 0===i.width||void 0===i.height)return this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:l,height:c,data:u}=i,h=i;this.style.addImage(e,{data:new t.RGBAImage({width:l,height:c},new Uint8Array(u)),pixelRatio:n,stretchX:o,stretchY:s,content:a,sdf:r,version:0,userImage:h}),h.onAdd&&h.onAdd(this,e)}}}updateImage(e,i){const n=this.style.getImage(e);if(!n)return this.fire(new t.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const r=i instanceof Cr||Lr&&i instanceof Lr?t.exported.getImageData(i):i,{width:o,height:s,data:a}=r;return void 0===o||void 0===s?this.fire(new t.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`"))):o!==n.data.width||s!==n.data.height?this.fire(new t.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(n.data.replace(a,!(i instanceof Cr||Lr&&i instanceof Lr)),void this.style.updateImage(e,n))}hasImage(e){return e?!!this.style.getImage(e):(this.fire(new t.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(t)}loadImage(e,i){t.getImage(this._requestManager.transformRequest(e,t.ResourceType.Image),((e,n)=>{i(e,n instanceof Cr?t.exported.getImageData(n):n)}))}listImages(){return this.style.listImages()}addLayer(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)}moveLayer(t,e){return this.style.moveLayer(t,e),this._update(!0)}removeLayer(t){return this.style.removeLayer(t),this._update(!0)}getLayer(t){return this.style.getLayer(t)}setLayerZoomRange(t,e,i){return this.style.setLayerZoomRange(t,e,i),this._update(!0)}setFilter(t,e,i={}){return this.style.setFilter(t,e,i),this._update(!0)}getFilter(t){return this.style.getFilter(t)}setPaintProperty(t,e,i,n={}){return this.style.setPaintProperty(t,e,i,n),this._update(!0)}getPaintProperty(t,e){return this.style.getPaintProperty(t,e)}setLayoutProperty(t,e,i,n={}){return this.style.setLayoutProperty(t,e,i,n),this._update(!0)}getLayoutProperty(t,e){return this.style.getLayoutProperty(t,e)}setLight(t,e={}){return this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)}getLight(){return this.style.getLight()}setTerrain(t){return this._lazyInitEmptyStyle(),this.style.setTerrain(t),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(t){return this._lazyInitEmptyStyle(),this.style.setFog(t),this._update(!0)}getFog(){return this.style?this.style.getFog():null}_queryFogOpacity(e){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(t.LngLat.convert(e),this.transform):0}queryTerrainElevation(e,i){const n=this.transform.elevation;return n?(i=t.extend({},{exaggerated:!0},i),n.getAtPoint(t.MercatorCoordinate.fromLngLat(e),null,i.exaggerated)):null}setFeatureState(t,e){return this.style.setFeatureState(t,e),this._update()}removeFeatureState(t,e){return this.style.removeFeatureState(t,e),this._update()}getFeatureState(t){return this.style.getFeatureState(t)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]}_detectMissingCSS(){"rgb(250, 128, 114)"!==t.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&t.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 t=this._container;t.classList.add("mapboxgl-map"),(this._missingCSSCanary=o.create("div","mapboxgl-canary",t)).style.visibility="hidden",this._detectMissingCSS();const e=this._canvasContainer=o.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=o.create("canvas","mapboxgl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");const i=this._containerDimensions();this._resizeCanvas(i[0],i[1]);const n=this._controlContainer=o.create("div","mapboxgl-control-container",t),r=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((t=>{r[t]=o.create("div",`mapboxgl-ctrl-${t}`,n)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(e,i){const n=t.exported.devicePixelRatio||1;this._canvas.width=n*e,this._canvas.height=n*i,this._canvas.style.width=`${e}px`,this._canvas.style.height=`${i}px`}_addMarker(t){this._markers.push(t)}_removeMarker(t){const e=this._markers.indexOf(t);-1!==e&&this._markers.splice(e,1)}_setupPainter(){const i=t.extend({},e.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),n=this._canvas.getContext("webgl",i)||this._canvas.getContext("experimental-webgl",i);n?(t.storeAuthState(n,!0),this.painter=new dn(n,this.transform),this.on("data",(t=>{"source"===t.dataType&&this.painter.setTileLoadedFlag(!0)})),t.exported$1.testSupport(n)):this.fire(new t.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(e){e.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new t.Event("webglcontextlost",{originalEvent:e}))}_contextRestored(e){this._setupPainter(),this.resize(),this._update(),this.fire(new t.Event("webglcontextrestored",{originalEvent:e}))}_onMapScroll(t){if(t.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(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(t){return this._update(),this._renderTaskQueue.add(t)}_cancelRenderFrame(t){this._renderTaskQueue.remove(t)}_requestDomTask(t){!this.isMoving()&&this.loaded()?t():this._domRenderTaskQueue.add(t)}_render(e){let i;const n=this.painter.context.extTimerQuery,r=t.exported.now();this.listens("gpu-timing-frame")&&(i=n.createQueryEXT(),n.beginQueryEXT(n.TIME_ELAPSED_EXT,i));let o=this._updateAverageElevation(r);if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),this._domRenderTaskQueue.run(e),this._removed)return;let s=!1;const a=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const e=this.transform.zoom,i=t.exported.now();this.style.zoomHistory.update(e,i);const n=new t.EvaluationParameters(e,{now:i,fadeDuration:a,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),r=n.crossFadingFactor();1===r&&r===this._crossFadingFactor||(s=!0,this._crossFadingFactor=r),this.style.update(n)}if(this.style&&this.style.fog&&this.style.fog.hasTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0),this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,a,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showTerrainWireframe:this.showTerrainWireframe,showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:a,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),speedIndexTiming:this.speedIndexTiming}),this.fire(new t.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new t.Event("load"))),this.style&&(this.style.hasTransitions()||s)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){const e=t.exported.now()-r;n.endQueryEXT(n.TIME_ELAPSED_EXT,i),setTimeout((()=>{const r=n.getQueryObjectEXT(i,n.QUERY_RESULT_EXT)/1e6;n.deleteQueryEXT(i),this.fire(new t.Event("gpu-timing-frame",{cpuTime:e,gpuTime:r}))}),50)}if(this.listens("gpu-timing-layer")){const e=this.painter.collectGpuTimers();setTimeout((()=>{const i=this.painter.queryGpuTimers(e);this.fire(new t.Event("gpu-timing-layer",{layerTimes:i}))}),50)}const l=this._sourcesDirty||this._styleDirty||this._placementDirty||o;if(l||this._repaint)this.triggerRepaint();else{const e=!this.isMoving()&&this.loaded();if(e&&(o=this._updateAverageElevation(r,!0)),o)this.triggerRepaint();else if(this._triggerFrame(!1),e&&(this.fire(new t.Event("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const e=this._calculateSpeedIndex();this.fire(new t.Event("speedindexcompleted",{speedIndex:e})),this.speedIndexTiming=!1}}return!this._loaded||this._fullyLoaded||l||(this._fullyLoaded=!0,this._authenticate()),this}_updateAverageElevation(t,e=!1){const i=t=>(this.transform.averageElevation=t,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return 0!==this.transform.averageElevation&&i(0);if((e||t-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(t)){const e=this.transform.averageElevation;let n=this.transform.sampleAverageElevation();isNaN(n)?n=0:this._averageElevationLastSampledAt=t;const r=Math.abs(e-n);if(r>1)this._averageElevation.easeTo(n,t,300);else if(r>1e-4)return this._averageElevation.jumpTo(n),i(n)}return!!this._averageElevation.isEasing(t)&&i(this._averageElevation.getValue(t))}_authenticate(){t.getMapSessionAPI(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,(e=>{if(e&&(e.message===t.AUTH_ERR_MSG||401===e.status)){const e=this.painter.context.gl;t.storeAuthState(e,!1),this._logoControl instanceof br&&this._logoControl._updateLogo(),e&&e.clear(e.DEPTH_BUFFER_BIT|e.COLOR_BUFFER_BIT|e.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new t.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/")))}})),t.postMapLoadEvent(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,(()=>{}))}_updateTerrain(){this.painter.updateTerrain(this.style,this.isMoving()||this.isRotating()||this.isZooming())}_calculateSpeedIndex(){const t=this.painter.canvasCopy(),e=this.painter.getCanvasCopiesAndTimestamps();e.timeStamps.push(performance.now());const i=this.painter.context.gl,n=i.createFramebuffer();function r(t){i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,t,0);const e=new Uint8Array(i.drawingBufferWidth*i.drawingBufferHeight*4);return i.readPixels(0,0,i.drawingBufferWidth,i.drawingBufferHeight,i.RGBA,i.UNSIGNED_BYTE,e),e}return i.bindFramebuffer(i.FRAMEBUFFER,n),this._canvasPixelComparison(r(t),e.canvasCopies.map(r),e.timeStamps)}_canvasPixelComparison(t,e,i){let n=i[1]-i[0];const r=t.length/4;for(let o=0;o<e.length;o++){const s=e[o];let a=0;for(let e=0;e<s.length;e+=4)s[e]===t[e]&&s[e+1]===t[e+1]&&s[e+2]===t[e+2]&&s[e+3]===t[e+3]&&(a+=1);n+=(i[o+2]-i[o+1])*(1-a/r)}return n}remove(){this._hash&&this._hash.remove();for(const t of this._controls)t.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this._domRenderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),void 0!==t.window&&(t.window.removeEventListener("resize",this._onWindowResize,!1),t.window.removeEventListener("orientationchange",this._onWindowResize,!1),t.window.removeEventListener("online",this._onWindowOnline,!1));const e=this.painter.context.gl.getExtension("WEBGL_lose_context");e&&e.loseContext(),Rr(this._canvasContainer),Rr(this._controlContainer),Rr(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),t.removeAuthState(this.painter.context.gl),this._removed=!0,this.fire(new t.Event("remove"))}triggerRepaint(){this._triggerFrame(!0)}_triggerFrame(e){this._renderNextFrame=this._renderNextFrame||e,this.style&&!this._frame&&(this._frame=t.exported.frame((t=>{const e=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,e&&this._render(t)})))}_onWindowOnline(){this._update()}_onWindowResize(t){this._trackResize&&this.resize({originalEvent:t})._update()}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(t){this._showTerrainWireframe!==t&&(this._showTerrainWireframe=t,this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(t){this._speedIndexTiming!==t&&(this._speedIndexTiming=t,this._update())}get showPadding(){return!!this._showPadding}set showPadding(t){this._showPadding!==t&&(this._showPadding=t,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())}get repaint(){return!!this._repaint}set repaint(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(t){this._vertices=t,this._update()}_setCacheLimits(e,i){t.setCacheLimits(e,i)}get version(){return t.version}},NavigationControl:class{constructor(e){this.options=t.extend({},Or,e),this._container=o.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(t=>t.preventDefault())),this.options.showZoom&&(t.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(t=>this._map.zoomIn({},{originalEvent:t}))),o.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(t=>this._map.zoomOut({},{originalEvent:t}))),o.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(t.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",(t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})})),this._compassIcon=o.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))}_updateZoomButtons(){const t=this._map.getZoom(),e=t===this._map.getMaxZoom(),i=t===this._map.getMinZoom();this._zoomInButton.disabled=e,this._zoomOutButton.disabled=i,this._zoomInButton.setAttribute("aria-disabled",e.toString()),this._zoomOutButton.setAttribute("aria-disabled",i.toString())}_rotateCompassArrow(){const t=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._map._requestDomTask((()=>{this._compassIcon&&(this._compassIcon.style.transform=t)}))}onAdd(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new kr(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){o.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(t,e){const i=o.create("button",t,this._container);return i.type="button",i.addEventListener("click",e),i}_setButtonTitle(t,e){const i=this._map._getUIString(`NavigationControl.${e}`);t.title=i,t.setAttribute("aria-label",i)}},GeolocateControl:class extends t.Evented{constructor(e){super(),this.options=t.extend({},Nr,e),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}onAdd(e){var i;return this._map=e,this._container=o.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),i=this._setupUI,void 0!==Br?i(Br):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((t=>{Br="denied"!==t.state,i(Br)})):(Br=!!t.window.navigator.geolocation,i(Br)),this._container}onRemove(){void 0!==this._geolocationWatchID&&(t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),o.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,zr=0,Fr=!1}_isOutOfMapMaxBounds(t){const e=this._map.getMaxBounds(),i=t.coords;return e&&(i.longitude<e.getWest()||i.longitude>e.getEast()||i.latitude<e.getSouth()||i.latitude>e.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(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}}_updateCamera(e){const i=new t.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,r=this._map.getBearing(),o=t.extend({bearing:r},this.options.fitBoundsOptions);this._map.fitBounds(i.toBounds(n),o,{geolocateSource:!0})}_updateMarker(e){if(e){const i=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),i=this._map.unproject([100,t]),n=e.distanceTo(i)/100,r=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=`${r}px`,this._circleElement.style.height=`${r}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_onError(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&Fr)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(e){if(this._container.addEventListener("contextmenu",(t=>t.preventDefault())),this._geolocateButton=o.create("button","mapboxgl-ctrl-geolocate",this._container),o.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e)}else{const t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=o.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Mr(this._dotElement),this._circleElement=o.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Mr({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",(e=>{e.geolocateSource||"ACTIVE_LOCK"!==this._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new t.Event("trackuserlocationend")))}))}trigger(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":zr--,Fr=!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 t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}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"),zr++,zr>1?(e={maximumAge:6e5,timeout:0},Fr=!0):(e=this.options.positionOptions,Fr=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:xr,ScaleControl:class{constructor(e){this.options=t.extend({},Vr,e),t.bindAll(["_onMove","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_onMove(){Ur(this._map,this._container,this.options)}onAdd(t){return this._map=t,this._container=o.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){o.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}setUnit(t){this.options.unit=t,Ur(this._map,this._container,this.options)}},FullscreenControl:class{constructor(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in t.window.document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=o.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){o.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!t.window.document.fullscreenEnabled&&!t.window.document.webkitFullscreenEnabled)}_setupUI(){const e=this._fullscreenButton=o.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);o.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(t.window.document.fullscreenElement||t.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()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends t.Evented{constructor(e){super(),this.options=t.extend(Object.create(jr),e),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}addTo(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this}isOpen(){return!!this._map}remove(){return this._content&&o.remove(this._content),this._container&&(o.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new t.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(e){return this.setDOMContent(t.window.document.createTextNode(e))}setHTML(e){const i=t.window.document.createDocumentFragment(),n=t.window.document.createElement("body");let r;for(n.innerHTML=e;r=n.firstChild,r;)i.appendChild(r);return this.setDOMContent(i)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(t){return this.options.maxWidth=t,this._update(),this}setDOMContent(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=o.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(t){this._container&&this._container.classList.add(t)}removeClassName(t){this._container&&this._container.classList.remove(t)}setOffset(t){return this.options.offset=t,this._update(),this}toggleClassName(t){if(this._container)return this._container.classList.toggle(t)}_createCloseButton(){this.options.closeButton&&(this._closeButton=o.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_onMouseUp(t){this._update(t.point)}_onMouseMove(t){this._update(t.point)}_onDrag(t){this._update(t.point)}_update(t){if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(this._container||(this._container=o.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=o.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((t=>this._container.classList.add(t))),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Ar(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!t)return;const e=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);let i=this.options.anchor;const n=Wr(this.options.offset);if(!i){const t=this._container.offsetWidth,r=this._container.offsetHeight;let o;o=e.y+n.bottom.y<r?["top"]:e.y>this._map.transform.height-r?["bottom"]:[],e.x<t/2?o.push("left"):e.x>this._map.transform.width-t/2&&o.push("right"),i=0===o.length?"bottom":o.join("-")}const r=e.add(n[i]).round();this._map._requestDomTask((()=>{this._container&&i&&(o.setTransform(this._container,`${Er[i]} translate(${r.x}px,${r.y}px)`),Sr(this._container,i,"popup"))}))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const t=this._container.querySelector(Hr);t&&t.focus()}_onClose(){this.remove()}_setOpacity(t){this._content&&(this._content.style.opacity=t),this._tip&&(this._tip.style.opacity=t)}},Marker:Mr,Style:Ue,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.pointGeometry,MercatorCoordinate:t.MercatorCoordinate,FreeCameraOptions:bn,Evented:t.Evented,config:t.config,prewarm:function(){kt().acquire(Dt)},clearPrewarmedResources:function(){const t=Ot;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(Dt),Ot=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Rt.workerCount},set workerCount(t){Rt.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage(e){t.clearTileCache(e)},workerUrl:"",workerClass:null,setNow:t.exported.setNow,restoreNow:t.exported.restoreNow};return qr}));var r=i;return r}()}(_A);var xA=rt(_A.exports);class bA extends Dm.ScaleControl{constructor(t){super(t)}updateStyle(t){const e=document.getElementsByClassName("mapboxgl-ctrl-scale");if(!(e.length>0))throw new Error("No ScaleControl found.");for(let i=0;i<e.length;i++){const n=e[i];for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n.style[e]=t[e])}}}class wA extends xA.ScaleControl{constructor(t){super(t)}updateStyle(t){const e=document.getElementsByClassName("mapboxgl-ctrl-scale");if(!(e.length>0))throw new Error("No ScaleControl found.");for(let i=0;i<e.length;i++){const n=e[i];for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n.style[e]=t[e])}}}class AA extends Dm.NavigationControl{constructor(t){super(t)}updateStyle(t){const e=document.getElementsByClassName("mapboxgl-ctrl-compass");if(!(e.length>0))throw new Error("No NavigationControl found.");for(let i=0;i<e.length;i++){const n=e[i];for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n.style[e]=t[e])}}}class EA extends xA.NavigationControl{constructor(t){super(t)}updateStyle(t){const e=document.getElementsByClassName("mapboxgl-ctrl-compass");if(!(e.length>0))throw new Error("No NavigationControl found.");for(let i=0;i<e.length;i++){const n=e[i];for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n.style[e]=t[e])}}}class SA{id;coord;fillColor;constructor(t,e){this.id="mb"+d(0,10),this.coord=t,this.fillColor=e||"rgba(200,202,199,1)",this.addLayer()}addLayer(){cNt.value.addLayer({id:this.id,type:"fill",source:{type:"geojson",data:{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-180,90],[180,90],[180,-90],[-180,-90]],...this.coord]}}},paint:{"fill-color":this.fillColor},layout:{visibility:"visible"}})}update(t){cNt.value.getStyle().layers.find((e=>e.id==t))?cNt.value.moveLayer(t,this.id):setTimeout((()=>{this.update(t)}))}destroy(){cNt.value.removeLayer(this.id)}}class MA{line;options;eventListeners;trackLength;totalTime;runLength;runTime;playStatus;_trackPlayerDefaultOptions={speed:60,speedMultiplier:2,eachMoveDistance:.1};currentPosition;timeoutHandle;runLine;remainingLine;heading;plane;EVENT={INIT:"INIT",START:"START",PAUSE:"PAUSE",PLAYING:"PLAYING",CONTINUE:"CONTINUE",STOP:"STOP"};PLAY_STATUS={INIT:"INIT",PLAYING:"PLAYING",PAUSED:"PAUSED",STOPPED:"STOPPED"};lineName;constructor(t,e){this.trackLength=0,this.totalTime=0,this.runLength=0,this.runTime=0,this.heading=0,this.timeoutHandle="",this.lineName="",this.playStatus="",this.line=t,this.options=this._extends(e,this._trackPlayerDefaultOptions),this._verifyAllOptions(),this.eventListeners={};for(const t in this.EVENT)this.eventListeners[t]=[];this._init()}_isFunction(t){return"function"==typeof t}_isPositiveNumber(t){return!isNaN(t)&&t>0}_verifySpeed(t){if(t||(t=this.getSpeed()),!this._isPositiveNumber(t))throw new Error("Illegal speed value: "+t)}_verifySpeedMultiplier(t){if(t||(t=this.getSpeedMultiplier()),!this._isPositiveNumber(t))throw new Error("Illegal speedMultiplier value: "+t)}_verifyEachMoveDistance(t){if(t||(t=this.getEachMoveDistance()),!this._isPositiveNumber(t))throw new Error("Illegal eachMoveDistance value: "+t)}_verifyAllOptions(){this._verifySpeed(),this._verifySpeedMultiplier(),this._verifyEachMoveDistance()}_extends(t,e){t||(t={});for(const i in e)t[i]||(t[i]=e[i]);return t}_init=()=>{this.trackLength=ye(this.line,{units:"kilometers"}),this.totalTime=Math.ceil(this.trackLength/this.getSpeed()/this.getSpeedMultiplier()*3600),this.runLength=0,this.runTime=0,this.playStatus=this.PLAY_STATUS.INIT,this._fireEvent({source:this.options.type,line:this.line,trackLength:this._round(this.trackLength,3),totalTime:this._round(this.totalTime,0),runLength:this._round(this.runLength,3),runTime:this._round(this.runTime,0),eventName:this.EVENT.INIT})};destroy(){this._clearTimeoutHandle(),this.plane.remove(),delete this.line,delete this.trackLength,delete this.totalTime,delete this.runLength,delete this.runTime,delete this.options}start(){const{STOPPED:t,INIT:e,PLAYING:i}=this.PLAY_STATUS,{START:n,PLAYING:r}=this.EVENT;this.playStatus===t&&this._init(),this.playStatus!==e&&this.playStatus!==t||(this.playStatus=i,this._fireEvent({source:this.options.type,line:this.line,trackLength:this._round(this.trackLength,3),totalTime:this._round(this.totalTime,0),runLength:this._round(this.runLength,3),runTime:this._round(this.runTime,0),currentPosition:this._getStartPoint(),eventName:n}),this.runLength=0,this.runTime=0,this.currentPosition=this._getStartPoint(),this._fireEvent({source:this.options.type,line:this.line,trackLength:this._round(this.trackLength,3),totalTime:this._round(this.totalTime,0),runLength:this._round(this.runLength,3),runTime:this._round(this.runTime,0),runLine:null,remainingLine:dt(this.line),currentPosition:this.currentPosition,eventName:r}),this.timeoutHandle=setTimeout(this._start.bind(this),this._calcIntervalTime()))}_calcIntervalTime(){this._verifyAllOptions();const t=this.getSpeed(),e=this.getSpeedMultiplier(),i=this.getEachMoveDistance();this.totalTime=Math.ceil(this.trackLength/t/e*3600);let n=i;if(this.runLength+n>this.trackLength)n=this.trackLength-this.runLength,this.runLength=this.trackLength,this.currentPosition=this._getEndPoint(),this.runLine=dt(this.line),this.remainingLine=null,this.heading=0;else{const t=this.line;this.runLength+=n,this.remainingLine=ve(t,this.runLength,void 0,{units:"kilometers"}),this.runLine=ve(t,0,this.runLength,{units:"kilometers"}),this.currentPosition=R(this.remainingLine.geometry.coordinates[0]),this.remainingLine.geometry.coordinates.length<=1?this.heading=0:this.heading=xt(this.currentPosition,R(this.remainingLine.geometry.coordinates[1]))}const r=n/t/e*36e5;return this.runTime+=r/1e3,r}_round(t,e){e||(e=0);const i=Math.pow(10,e);return Math.round(t*i)/i}_start(){this._fireEvent({source:this.options.type,line:this.line,trackLength:this._round(this.trackLength,3),totalTime:this._round(this.totalTime,0),runLength:this._round(this.runLength,3),runTime:this._round(this.runTime,0),runLine:this.runLine,remainingLine:this.remainingLine,heading:this.heading,currentPosition:this.currentPosition,eventName:this.EVENT.PLAYING}),this.runLength===this.trackLength&&(this.playStatus=this.PLAY_STATUS.STOPPED,this._fireEvent({source:this.options.type,line:this.line,trackLength:this._round(this.trackLength,3),totalTime:this._round(this.totalTime,0),runLength:this._round(this.runLength,3),runTime:this._round(this.runTime,0),currentPosition:this.currentPosition,eventName:this.EVENT.STOP})),this.runLength<this.trackLength&&(this.timeoutHandle=setTimeout(this._start.bind(this),this._calcIntervalTime()))}_fireEvent(t){const e=this.eventListeners[t.eventName];e&&e.forEach((e=>{e(t)}))}_getStartPoint(){return R(this.line.geometry.coordinates[0])}_getEndPoint(){const t=this.line;return R(t.geometry.coordinates[t.geometry.coordinates.length-1])}pause(){const{PLAYING:t,PAUSED:e}=this.PLAY_STATUS;this.playStatus===t&&(this.playStatus=e,this._clearTimeoutHandle(),this._fireEvent({source:this.options.type,line:this.line,trackLength:this._round(this.trackLength,3),totalTime:this._round(this.totalTime,0),runLength:this._round(this.runLength,3),runTime:this._round(this.runTime,0),currentPosition:this.currentPosition,eventName:this.EVENT.PAUSE}))}continue(){const{PLAYING:t,PAUSED:e}=this.PLAY_STATUS;this.playStatus===e&&(this.playStatus=t,this._fireEvent({source:this.options.type,line:this.line,trackLength:this._round(this.trackLength,3),totalTime:this._round(this.totalTime,0),runLength:this._round(this.runLength,3),runTime:this._round(this.runTime,0),currentPosition:this.currentPosition,eventName:this.EVENT.CONTINUE}),this._start())}stop(){const{PLAYING:t,PAUSED:e,STOPPED:i}=this.PLAY_STATUS;this.playStatus!==t&&this.playStatus!==e||(this.runLength=0,this._clearTimeoutHandle(),this.playStatus=i,this._fireEvent({source:this.options.type,line:this.line,trackLength:this._round(this.trackLength,3),totalTime:this._round(this.totalTime,0),runLength:this._round(this.runLength,3),runTime:this._round(this.runTime,0),currentPosition:this.currentPosition,eventName:this.EVENT.STOP}))}_clearTimeoutHandle(){this.timeoutHandle&&(clearTimeout(this.timeoutHandle),this.timeoutHandle=null)}on(t,e){const i=this.eventListeners[t];if(!i)throw new Error("Unknown event: "+t);if(!e)throw new Error("Undefined listener:"+String(e));-1===i.indexOf(e)&&i.push(e)}off(t,e){const i=this.eventListeners[t];if(!i)throw new Error("Unknown event: "+t);if(!e)throw new Error("Undefined listener:"+String(e));const n=i.indexOf(e);-1!==n&&i.splice(n,1)}getPlayStatus(){return this.playStatus}getTrackLength(){return this.trackLength}getSpeed(){const t=this._isFunction(this.options.speed)?this.options.speed():this.options.speed;return Number(t)}setSpeed(t){this._verifySpeed(t),this.options.speed=t}getSpeedMultiplier(){const t=this._isFunction(this.options.speedMultiplier)?this.options.speedMultiplier():this.options.speedMultiplier;return Number(t)}setSpeedMultiplier(t){this._verifySpeedMultiplier(t),this.options.speedMultiplier=t}getEachMoveDistance(){const t=this._isFunction(this.options.eachMoveDistance)?this.options.eachMoveDistance():this.options.eachMoveDistance;return Number(t)}setEachMoveDistance(t){this._verifyEachMoveDistance(t),this.options.eachMoveDistance=t}jumpTo(t){t<0?t=0:t>this.trackLength&&(t=this.trackLength);const e=this.line;this.runLength=t,this.runLength===this.trackLength?(this.currentPosition=this._getEndPoint(),this.runLine=dt(e),this.remainingLine=null,this.heading=0):(this.remainingLine=ve(e,this.runLength,void 0,{units:"kilometers"}),this.runLine=ve(e,0,this.runLength,{units:"kilometers"}),this.currentPosition=R(this.remainingLine.geometry.coordinates[0]),this.remainingLine.geometry.coordinates.length<=1?this.heading=0:this.heading=xt(this.currentPosition,R(this.remainingLine.geometry.coordinates[1]))),this.playStatus===this.PLAY_STATUS.PLAYING&&(this._clearTimeoutHandle(),this._start())}}const TA=(t,e)=>{const i="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent('<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t<path fill="#ffffff" d="M870.334 514.725l-713.943 419.15 205.529-424.557-208.254-419.193z" />\n\t\t\t</svg>'))),n=e||10,r=new Image(n,n);r.src=i,r.onload=function(){!cNt.value.hasImage("arrowIcon")&&cNt.value.addImage("arrowIcon",r),!cNt.value.getLayer(t+"arrow")&&cNt.value.addLayer({id:t+"arrow",type:"symbol",source:t+"source",layout:{"symbol-placement":"line","symbol-spacing":30,"icon-image":"arrowIcon","icon-size":1,"icon-allow-overlap":!0}})}};class IA{icon;popup;_line;_lineDistance;_play;_index;_steps;_newRouteGeoJson;_realRouteGeoJson;_animatePointGeoJson;_flag;_options;eventListeners;EVENT={PLAYING:"PLAYING",LENGTH:"LENGTH",START:"START"};constructor(t,e,i){this._line=t,this.icon=e,this._options=i,this.eventListeners={};for(const t in this.EVENT)this.eventListeners[t]=[];this._lineDistance=ye(t);const n=Math.ceil(1e3*this._lineDistance/(60*(this._options.speed||1)));this._newRouteGeoJson=dA(t,n,{type:"line",units:"kilometers"}),this._realRouteGeoJson={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"LineString",coordinates:[]},properties:{}}]},this._animatePointGeoJson={type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"Point",coordinates:[]}}]},this._index=0,this._play=!0,this._steps=this._newRouteGeoJson.geometry.coordinates.length,this._flag=0}_animate(){if(this._index>=this._steps)return void(this._options.isAgain?(this._index=0,this._animate()):window.cancelAnimationFrame(this._flag));let t,e;0==this._index?(this._realRouteGeoJson.features[0].geometry.coordinates=[],t=this._newRouteGeoJson.geometry.coordinates[this._index],e=this._newRouteGeoJson.geometry.coordinates[this._index+1]):0!==this._index&&(t=this._newRouteGeoJson.geometry.coordinates[this._index-1],e=this._newRouteGeoJson.geometry.coordinates[this._index]);const i=xt(R(t),R(e))-(0|this._options.angle),n=this._newRouteGeoJson.geometry.coordinates[this._index],r=ye(this._realRouteGeoJson);this.icon.setRotation(i),this.icon.setLngLat(n),this._realRouteGeoJson.features[0].geometry.coordinates.push(n);const o=this._realRouteGeoJson.features?.[0]?.properties?.id;this._fireEvent({...this._line.properties,traveldData:this._realRouteGeoJson,postion:n,eventName:this.EVENT.PLAYING,currentId:o}),this._play&&(this._flag=requestAnimationFrame((()=>this._animate()))),this._index=this._index+1;const s=r/this._lineDistance*100;this._options.percent=s>99.9?100:Number(s.toString().split(".")[0]),this._fireEvent({...this._line.properties,traveldData:this._realRouteGeoJson,traveldLength:r,totalLength:this._lineDistance,percent:this._options.percent,currentId:o,eventName:this.EVENT.LENGTH})}start(){0==this._index?(this._play=!0,this._animate()):this._play?this._index=0:(this._index=0,this._play=!0,this._animate())}update(t){const e=ye(t);this._lineDistance=e;const i=dA(t,Math.ceil(1e3*e/(60*(this._options.speed||1))),{type:"line",units:"kilometers"}).geometry.coordinates;this._newRouteGeoJson.geometry.coordinates=i;const n=JSON.parse(JSON.stringify(this._steps));this._steps=this._newRouteGeoJson.geometry.coordinates.length,this._index>=n&&!this._options.isAgain&&this._animate()}setSpeed(t){this._options.speed=t;const e=Math.ceil(1e3*this._lineDistance/(60*(this._options.speed||1)));this._newRouteGeoJson=dA(this._line,e,{type:"line",units:"kilometers"});const i=[this.icon._lngLat.lng,this.icon._lngLat.lat],n=ue(this._newRouteGeoJson,i);n.properties.index&&(this._index=n.properties.index),this._steps=this._newRouteGeoJson.geometry.coordinates.length}pause(t){this._play?this._play=t:(this._play=t,t&&this._animate())}destroy(){this._index=0,this.icon.remove(),window.cancelAnimationFrame(this._flag)}on(t,e){const i=this.eventListeners[t];if(!i)throw new Error("Unknown event: "+t);if(!e)throw new Error("Undefined listener:"+String(e));-1===i.indexOf(e)&&i.push(e)}off(t,e){const i=this.eventListeners[t];if(!i)throw new Error("Unknown event: "+t);if(!e)throw new Error("Undefined listener:"+String(e));const n=i.indexOf(e);-1!==n&&i.splice(n,1)}_fireEvent(t){const e=this.eventListeners[t.eventName];e&&e.forEach((e=>{e(t)}))}}let CA;const PA={cap:"butt",join:"miter",miterLimit:2,roundLimit:1.05,visibility:"visible",opacity:1,color:"#000000",width:1,anchor:"map"};function LA(t){const{cap:e,join:i,visibility:n,roundLimit:r,miterLimit:o,opacity:s,pattern:a,color:l,translate:c,anchor:u,width:h,gapWidth:p,offset:d,blur:f,dasharray:m,gradient:g}={...PA,...t||{}},y={visibility:n,"line-cap":e,"line-join":i,"line-miter-limit":r,"line-round-limit":o},v={"line-opacity":s,"line-color":l,"line-width":h,"line-translate-anchor":u};return f&&(v["line-blur"]=f),c&&(v["line-translate"]=c),m&&(v["line-dasharray"]=m),d&&(v["line-offset"]=d),p&&(v["line-gap-width"]=p),g&&(v["line-gradient"]=g),a&&(v["line-pattern"]=a),{layout:y,paint:v}}function DA(t,e,i,n){const r=[];return t.features.forEach(((t,o)=>{if(t.properties){const s=OA(t.properties.image?t.properties.image:e,t,`trajectoryPlayback_${o}`,i,n);r.push(s)}})),r}function RA(){const t=cNt.value.unproject([100,100]),e=cNt.value.unproject([101,101]),i=t=>t*Math.PI/180;return((t,e,n,r)=>{const o=i(t),s=i(n),a=o-s,l=i(e)-i(r),c=Math.pow(Math.sin(a/2),2)+Math.cos(o)*Math.cos(s)*Math.pow(Math.sin(l/2),2);let u=2*Math.asin(Math.sqrt(c));return u*=6378.137,u=Math.round(1e4*u)/1e4,u})(t.lat,t.lng,e.lat,e.lng)}function OA(t,e,i,n,r){const o={width:64,height:64,speed:10,...r||{}},s=A({tag:"div",attrs:{className:i,style:{backgroundImage:`url(${t})`,width:`${o.width}px`,height:`${o.height}px`,backgroundSize:"100% 100%"}}}),a=new MA(e,{speedMultiplier:40,speed:o.speed,eachMoveDistance:RA});a.lineName=i,a.start();const l=new cNt.value.mapboxgl.Marker(s).setLngLat(e.geometry.coordinates[0]).addTo(cNt.value);return a.on(a.EVENT.PLAYING,(t=>{const e=t.currentPosition.geometry.coordinates;l.setLngLat(e),l.setRotation(t.heading)})),a.plane=l,a.on(a.EVENT.STOP,(()=>{if(n){const s=(o=`.${i}`,document.querySelector(o));s&&s.remove();const a=OA(t,e,i,n,r);CA=CA.map((t=>(t.lineName==a.lineName&&(t=a),t)))}var o})),a}const kA=(t,e)=>{for(let i=0,n=t.length;i<n;i++)t[i][e]()},NA=(t,e,i)=>{const n=i||d(0,10);let r;r=p(t)?$p(t,"lineString"):t;const{image:o,maxzoom:s,minzoom:a,imageWidth:l,imageHeight:c,speed:u,isFly:h,isArrow:f,arrowSize:m,width:g,color:y,isShowLine:v,isReplay:_}=e;let x=_;null==typeof _&&(x=!1),cNt.value.getLayer(i)||(CA=DA(r,o,x,{width:l||32,height:c||32,speed:u||10})),cNt.value.addSource(n+"source",{type:"geojson",data:r,lineMetrics:!0});const b={width:g,color:y,visibility:!1===v?"none":"visible"};cNt.value.addLayer({id:n,type:"line",source:n+"source",maxzoom:s||24,minzoom:a||1,...LA(b)}),"visible"==b.visibility&&f&&TA(n,m);return h&&td(r,!0),{trajectorys:CA,destroy:()=>(t=>{kA(CA,"destroy"),cNt.value.removeLayer(t),cNt.value.getLayer(t+"arrow")&&cNt.value.removeLayer(t+"arrow"),cNt.value.removeSource(t+"source"),cNt.value.hasImage("arrowIcon")&&cNt.value.removeImage("arrowIcon")})(n),start:()=>kA(CA,"continue"),pause:()=>kA(CA,"pause")}};var BA=function(t,e){return BA=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},BA(t,e)};function zA(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}BA(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}"function"==typeof SuppressedError&&SuppressedError;var FA=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},VA=new function(){this.browser=new FA,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow="undefined"!=typeof window};"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(VA.wxa=!0,VA.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?VA.worker=!0:"undefined"==typeof navigator?(VA.node=!0,VA.svgSupported=!0):function(t,e){var i=e.browser,n=t.match(/Firefox\/([\d.]+)/),r=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),o=t.match(/Edge?\/([\d.]+)/),s=/micromessenger/i.test(t);n&&(i.firefox=!0,i.version=n[1]);r&&(i.ie=!0,i.version=r[1]);o&&(i.edge=!0,i.version=o[1],i.newEdge=+o[1].split(".")[0]>18);s&&(i.weChat=!0);e.svgSupported="undefined"!=typeof SVGRect,e.touchEventsSupported="ontouchstart"in window&&!i.ie&&!i.edge,e.pointerEventsSupported="onpointerdown"in window&&(i.edge||i.ie&&+i.version>=11),e.domSupported="undefined"!=typeof document;var a=document.documentElement.style;e.transform3dSupported=(i.ie&&"transition"in a||i.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in a)&&!("OTransition"in a),e.transformSupported=e.transform3dSupported||i.ie&&+i.version>=9}(navigator.userAgent,VA);var UA=VA,GA=12,jA="sans-serif",HA=GA+"px "+jA;var WA,qA,XA=function(t){var e={};if("undefined"==typeof JSON)return e;for(var i=0;i<t.length;i++){var n=String.fromCharCode(i+32),r=(t.charCodeAt(i)-20)/100;e[n]=r}return e}("007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N"),ZA={createCanvas:function(){return"undefined"!=typeof document&&document.createElement("canvas")},measureText:function(t,e){if(!WA){var i=ZA.createCanvas();WA=i&&i.getContext("2d")}if(WA)return qA!==e&&(qA=WA.font=e||HA),WA.measureText(t);t=t||"";var n=/(\d+)px/.exec(e=e||HA),r=n&&+n[1]||GA,o=0;if(e.indexOf("mono")>=0)o=r*t.length;else for(var s=0;s<t.length;s++){var a=XA[t[s]];o+=null==a?r:a*r}return{width:o}},loadImage:function(t,e,i){var n=new Image;return n.onload=e,n.onerror=i,n.src=t,n}},YA=_E(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],(function(t,e){return t["[object "+e+"]"]=!0,t}),{}),QA=_E(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],(function(t,e){return t["[object "+e+"Array]"]=!0,t}),{}),JA=Object.prototype.toString,KA=Array.prototype,$A=KA.forEach,tE=KA.filter,eE=KA.slice,iE=KA.map,nE=function(){}.constructor,rE=nE?nE.prototype:null,oE="__proto__",sE=2311;function aE(){return sE++}function lE(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];"undefined"!=typeof console&&console.error.apply(console,t)}function cE(t){if(null==t||"object"!=typeof t)return t;var e=t,i=JA.call(t);if("[object Array]"===i){if(!WE(t)){e=[];for(var n=0,r=t.length;n<r;n++)e[n]=cE(t[n])}}else if(QA[i]){if(!WE(t)){var o=t.constructor;if(o.from)e=o.from(t);else{e=new o(t.length);for(n=0,r=t.length;n<r;n++)e[n]=t[n]}}}else if(!YA[i]&&!WE(t)&&!DE(t))for(var s in e={},t)t.hasOwnProperty(s)&&s!==oE&&(e[s]=cE(t[s]));return e}function uE(t,e,i){if(!CE(e)||!CE(t))return i?cE(e):t;for(var n in e)if(e.hasOwnProperty(n)&&n!==oE){var r=t[n],o=e[n];!CE(o)||!CE(r)||EE(o)||EE(r)||DE(o)||DE(r)||PE(o)||PE(r)||WE(o)||WE(r)?!i&&n in t||(t[n]=cE(e[n])):uE(r,o,i)}return t}function hE(t,e){for(var i=t[0],n=1,r=t.length;n<r;n++)i=uE(i,t[n],e);return i}function pE(t,e){if(Object.assign)Object.assign(t,e);else for(var i in e)e.hasOwnProperty(i)&&i!==oE&&(t[i]=e[i]);return t}function dE(t,e,i){for(var n=bE(e),r=0;r<n.length;r++){var o=n[r];(i?null!=e[o]:null==t[o])&&(t[o]=e[o])}return t}function fE(t,e){if(t){if(t.indexOf)return t.indexOf(e);for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i}return-1}function mE(t,e,i){if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames)for(var n=Object.getOwnPropertyNames(e),r=0;r<n.length;r++){var o=n[r];"constructor"!==o&&(i?null!=e[o]:null==t[o])&&(t[o]=e[o])}else dE(t,e,i)}function gE(t){return!!t&&("string"!=typeof t&&"number"==typeof t.length)}function yE(t,e,i){if(t&&e)if(t.forEach&&t.forEach===$A)t.forEach(e,i);else if(t.length===+t.length)for(var n=0,r=t.length;n<r;n++)e.call(i,t[n],n,t);else for(var o in t)t.hasOwnProperty(o)&&e.call(i,t[o],o,t)}function vE(t,e,i){if(!t)return[];if(!e)return FE(t);if(t.map&&t.map===iE)return t.map(e,i);for(var n=[],r=0,o=t.length;r<o;r++)n.push(e.call(i,t[r],r,t));return n}function _E(t,e,i,n){if(t&&e){for(var r=0,o=t.length;r<o;r++)i=e.call(n,i,t[r],r,t);return i}}function xE(t,e,i){if(!t)return[];if(!e)return FE(t);if(t.filter&&t.filter===tE)return t.filter(e,i);for(var n=[],r=0,o=t.length;r<o;r++)e.call(i,t[r],r,t)&&n.push(t[r]);return n}function bE(t){if(!t)return[];if(Object.keys)return Object.keys(t);var e=[];for(var i in t)t.hasOwnProperty(i)&&e.push(i);return e}ZA.createCanvas;var wE=rE&&SE(rE.bind)?rE.call.bind(rE.bind):function(t,e){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];return function(){return t.apply(e,i.concat(eE.call(arguments)))}};function AE(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return function(){return t.apply(this,e.concat(eE.call(arguments)))}}function EE(t){return Array.isArray?Array.isArray(t):"[object Array]"===JA.call(t)}function SE(t){return"function"==typeof t}function ME(t){return"string"==typeof t}function TE(t){return"[object String]"===JA.call(t)}function IE(t){return"number"==typeof t}function CE(t){var e=typeof t;return"function"===e||!!t&&"object"===e}function PE(t){return!!YA[JA.call(t)]}function LE(t){return!!QA[JA.call(t)]}function DE(t){return"object"==typeof t&&"number"==typeof t.nodeType&&"object"==typeof t.ownerDocument}function RE(t){return null!=t.colorStops}function OE(t){return"[object RegExp]"===JA.call(t)}function kE(t){return t!=t}function NE(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=0,n=t.length;i<n;i++)if(null!=t[i])return t[i]}function BE(t,e){return null!=t?t:e}function zE(t,e,i){return null!=t?t:null!=e?e:i}function FE(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return eE.apply(t,e)}function VE(t){if("number"==typeof t)return[t,t,t,t];var e=t.length;return 2===e?[t[0],t[1],t[0],t[1]]:3===e?[t[0],t[1],t[2],t[1]]:t}function UE(t,e){if(!t)throw new Error(e)}function GE(t){return null==t?null:"function"==typeof t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var jE="__ec_primitive__";function HE(t){t[jE]=!0}function WE(t){return t[jE]}var qE=function(){function t(){this.data={}}return t.prototype.delete=function(t){var e=this.has(t);return e&&delete this.data[t],e},t.prototype.has=function(t){return this.data.hasOwnProperty(t)},t.prototype.get=function(t){return this.data[t]},t.prototype.set=function(t,e){return this.data[t]=e,this},t.prototype.keys=function(){return bE(this.data)},t.prototype.forEach=function(t){var e=this.data;for(var i in e)e.hasOwnProperty(i)&&t(e[i],i)},t}(),XE="function"==typeof Map;var ZE=function(){function t(e){var i=EE(e);this.data=XE?new Map:new qE;var n=this;function r(t,e){i?n.set(t,e):n.set(e,t)}e instanceof t?e.each(r):e&&yE(e,r)}return t.prototype.hasKey=function(t){return this.data.has(t)},t.prototype.get=function(t){return this.data.get(t)},t.prototype.set=function(t,e){return this.data.set(t,e),e},t.prototype.each=function(t,e){this.data.forEach((function(i,n){t.call(e,i,n)}))},t.prototype.keys=function(){var t=this.data.keys();return XE?Array.from(t):t},t.prototype.removeKey=function(t){this.data.delete(t)},t}();function YE(t){return new ZE(t)}function QE(t,e){for(var i=new t.constructor(t.length+e.length),n=0;n<t.length;n++)i[n]=t[n];var r=t.length;for(n=0;n<e.length;n++)i[n+r]=e[n];return i}function JE(t,e){var i;if(Object.create)i=Object.create(t);else{var n=function(){};n.prototype=t,i=new n}return e&&pE(i,e),i}function KE(t){var e=t.style;e.webkitUserSelect="none",e.userSelect="none",e.webkitTapHighlightColor="rgba(0,0,0,0)",e["-webkit-touch-callout"]="none"}function $E(t,e){return t.hasOwnProperty(e)}function tS(){}var eS=180/Math.PI;function iS(t,e){return null==t&&(t=0),null==e&&(e=0),[t,e]}function nS(t,e){return t[0]=e[0],t[1]=e[1],t}function rS(t){return[t[0],t[1]]}function oS(t,e,i){return t[0]=e,t[1]=i,t}function sS(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t}function aS(t,e,i,n){return t[0]=e[0]+i[0]*n,t[1]=e[1]+i[1]*n,t}function lS(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t}function cS(t){return Math.sqrt(function(t){return t[0]*t[0]+t[1]*t[1]}(t))}function uS(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t}function hS(t,e){var i=cS(e);return 0===i?(t[0]=0,t[1]=0):(t[0]=e[0]/i,t[1]=e[1]/i),t}function pS(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var dS=pS;var fS=function(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])};function mS(t,e,i,n){return t[0]=e[0]+n*(i[0]-e[0]),t[1]=e[1]+n*(i[1]-e[1]),t}function gS(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[2]*r+i[4],t[1]=i[1]*n+i[3]*r+i[5],t}function yS(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t}function vS(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t}var _S=function(t,e){this.target=t,this.topTarget=e&&e.topTarget},xS=function(){function t(t){this.handler=t,t.on("mousedown",this._dragStart,this),t.on("mousemove",this._drag,this),t.on("mouseup",this._dragEnd,this)}return t.prototype._dragStart=function(t){for(var e=t.target;e&&!e.draggable;)e=e.parent||e.__hostTarget;e&&(this._draggingTarget=e,e.dragging=!0,this._x=t.offsetX,this._y=t.offsetY,this.handler.dispatchToElement(new _S(e,t),"dragstart",t.event))},t.prototype._drag=function(t){var e=this._draggingTarget;if(e){var i=t.offsetX,n=t.offsetY,r=i-this._x,o=n-this._y;this._x=i,this._y=n,e.drift(r,o,t),this.handler.dispatchToElement(new _S(e,t),"drag",t.event);var s=this.handler.findHover(i,n,e).target,a=this._dropTarget;this._dropTarget=s,e!==s&&(a&&s!==a&&this.handler.dispatchToElement(new _S(a,t),"dragleave",t.event),s&&s!==a&&this.handler.dispatchToElement(new _S(s,t),"dragenter",t.event))}},t.prototype._dragEnd=function(t){var e=this._draggingTarget;e&&(e.dragging=!1),this.handler.dispatchToElement(new _S(e,t),"dragend",t.event),this._dropTarget&&this.handler.dispatchToElement(new _S(this._dropTarget,t),"drop",t.event),this._draggingTarget=null,this._dropTarget=null},t}(),bS=xS,wS=function(){function t(t){t&&(this._$eventProcessor=t)}return t.prototype.on=function(t,e,i,n){this._$handlers||(this._$handlers={});var r=this._$handlers;if("function"==typeof e&&(n=i,i=e,e=null),!i||!t)return this;var o=this._$eventProcessor;null!=e&&o&&o.normalizeQuery&&(e=o.normalizeQuery(e)),r[t]||(r[t]=[]);for(var s=0;s<r[t].length;s++)if(r[t][s].h===i)return this;var a={h:i,query:e,ctx:n||this,callAtLast:i.zrEventfulCallAtLast},l=r[t].length-1,c=r[t][l];return c&&c.callAtLast?r[t].splice(l,0,a):r[t].push(a),this},t.prototype.isSilent=function(t){var e=this._$handlers;return!e||!e[t]||!e[t].length},t.prototype.off=function(t,e){var i=this._$handlers;if(!i)return this;if(!t)return this._$handlers={},this;if(e){if(i[t]){for(var n=[],r=0,o=i[t].length;r<o;r++)i[t][r].h!==e&&n.push(i[t][r]);i[t]=n}i[t]&&0===i[t].length&&delete i[t]}else delete i[t];return this},t.prototype.trigger=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(!this._$handlers)return this;var n=this._$handlers[t],r=this._$eventProcessor;if(n)for(var o=e.length,s=n.length,a=0;a<s;a++){var l=n[a];if(!r||!r.filter||null==l.query||r.filter(t,l.query))switch(o){case 0:l.h.call(l.ctx);break;case 1:l.h.call(l.ctx,e[0]);break;case 2:l.h.call(l.ctx,e[0],e[1]);break;default:l.h.apply(l.ctx,e)}}return r&&r.afterTrigger&&r.afterTrigger(t),this},t.prototype.triggerWithContext=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(!this._$handlers)return this;var n=this._$handlers[t],r=this._$eventProcessor;if(n)for(var o=e.length,s=e[o-1],a=n.length,l=0;l<a;l++){var c=n[l];if(!r||!r.filter||null==c.query||r.filter(t,c.query))switch(o){case 0:c.h.call(s);break;case 1:c.h.call(s,e[0]);break;case 2:c.h.call(s,e[0],e[1]);break;default:c.h.apply(s,e.slice(1,o-1))}}return r&&r.afterTrigger&&r.afterTrigger(t),this},t}(),AS=wS,ES=Math.log(2);function SS(t,e,i,n,r,o){var s=n+"-"+r,a=t.length;if(o.hasOwnProperty(s))return o[s];if(1===e){var l=Math.round(Math.log((1<<a)-1&~r)/ES);return t[i][l]}for(var c=n|1<<i,u=i+1;n&1<<u;)u++;for(var h=0,p=0,d=0;p<a;p++){var f=1<<p;f&r||(h+=(d%2?-1:1)*t[i][p]*SS(t,e-1,u,c,r|f,o),d++)}return o[s]=h,h}function MS(t,e){var i=[[t[0],t[1],1,0,0,0,-e[0]*t[0],-e[0]*t[1]],[0,0,0,t[0],t[1],1,-e[1]*t[0],-e[1]*t[1]],[t[2],t[3],1,0,0,0,-e[2]*t[2],-e[2]*t[3]],[0,0,0,t[2],t[3],1,-e[3]*t[2],-e[3]*t[3]],[t[4],t[5],1,0,0,0,-e[4]*t[4],-e[4]*t[5]],[0,0,0,t[4],t[5],1,-e[5]*t[4],-e[5]*t[5]],[t[6],t[7],1,0,0,0,-e[6]*t[6],-e[6]*t[7]],[0,0,0,t[6],t[7],1,-e[7]*t[6],-e[7]*t[7]]],n={},r=SS(i,8,0,0,0,n);if(0!==r){for(var o=[],s=0;s<8;s++)for(var a=0;a<8;a++)null==o[a]&&(o[a]=0),o[a]+=((s+a)%2?-1:1)*SS(i,7,0===s?1:0,1<<s,1<<a,n)/r*e[s];return function(t,e,i){var n=e*o[6]+i*o[7]+1;t[0]=(e*o[0]+i*o[1]+o[2])/n,t[1]=(e*o[3]+i*o[4]+o[5])/n}}}var TS="___zrEVENTSAVED",IS=[];function CS(t,e,i,n,r){if(e.getBoundingClientRect&&UA.domSupported&&!PS(e)){var o=e[TS]||(e[TS]={}),s=function(t,e){var i=e.markers;if(i)return i;i=e.markers=[];for(var n=["left","right"],r=["top","bottom"],o=0;o<4;o++){var s=document.createElement("div"),a=o%2,l=(o>>1)%2;s.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",n[a]+":0",r[l]+":0",n[1-a]+":auto",r[1-l]+":auto",""].join("!important;"),t.appendChild(s),i.push(s)}return i}(e,o),a=function(t,e,i){for(var n=i?"invTrans":"trans",r=e[n],o=e.srcCoords,s=[],a=[],l=!0,c=0;c<4;c++){var u=t[c].getBoundingClientRect(),h=2*c,p=u.left,d=u.top;s.push(p,d),l=l&&o&&p===o[h]&&d===o[h+1],a.push(t[c].offsetLeft,t[c].offsetTop)}return l&&r?r:(e.srcCoords=s,e[n]=i?MS(a,s):MS(s,a))}(s,o,r);if(a)return a(t,i,n),!0}return!1}function PS(t){return"CANVAS"===t.nodeName.toUpperCase()}var LS=/([&<>"'])/g,DS={"&":"&","<":"<",">":">",'"':""","'":"'"};function RS(t){return null==t?"":(t+"").replace(LS,(function(t,e){return DS[e]}))}var OS=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,kS=[],NS=UA.browser.firefox&&+UA.browser.version.split(".")[0]<39;function BS(t,e,i,n){return i=i||{},n?zS(t,e,i):NS&&null!=e.layerX&&e.layerX!==e.offsetX?(i.zrX=e.layerX,i.zrY=e.layerY):null!=e.offsetX?(i.zrX=e.offsetX,i.zrY=e.offsetY):zS(t,e,i),i}function zS(t,e,i){if(UA.domSupported&&t.getBoundingClientRect){var n=e.clientX,r=e.clientY;if(PS(t)){var o=t.getBoundingClientRect();return i.zrX=n-o.left,void(i.zrY=r-o.top)}if(CS(kS,t,n,r))return i.zrX=kS[0],void(i.zrY=kS[1])}i.zrX=i.zrY=0}function FS(t){return t||window.event}function VS(t,e,i){if(null!=(e=FS(e)).zrX)return e;var n=e.type;if(n&&n.indexOf("touch")>=0){var r="touchend"!==n?e.targetTouches[0]:e.changedTouches[0];r&&BS(t,r,e,i)}else{BS(t,e,e,i);var o=function(t){var e=t.wheelDelta;if(e)return e;var i=t.deltaX,n=t.deltaY;if(null==i||null==n)return e;return 3*(0!==n?Math.abs(n):Math.abs(i))*(n>0?-1:n<0?1:i>0?-1:1)}(e);e.zrDelta=o?o/120:-(e.detail||0)/3}var s=e.button;return null==e.which&&void 0!==s&&OS.test(e.type)&&(e.which=1&s?1:2&s?3:4&s?2:0),e}function US(t,e,i,n){t.addEventListener(e,i,n)}function GS(t,e,i,n){t.removeEventListener(e,i,n)}var jS=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0};function HS(t){return 2===t.which||3===t.which}var WS=function(){function t(){this._track=[]}return t.prototype.recognize=function(t,e,i){return this._doTrack(t,e,i),this._recognize(t)},t.prototype.clear=function(){return this._track.length=0,this},t.prototype._doTrack=function(t,e,i){var n=t.touches;if(n){for(var r={points:[],touches:[],target:e,event:t},o=0,s=n.length;o<s;o++){var a=n[o],l=BS(i,a,{});r.points.push([l.zrX,l.zrY]),r.touches.push(a)}this._track.push(r)}},t.prototype._recognize=function(t){for(var e in XS)if(XS.hasOwnProperty(e)){var i=XS[e](this._track,t);if(i)return i}},t}();function qS(t){var e=t[1][0]-t[0][0],i=t[1][1]-t[0][1];return Math.sqrt(e*e+i*i)}var XS={pinch:function(t,e){var i=t.length;if(i){var n,r=(t[i-1]||{}).points,o=(t[i-2]||{}).points||r;if(o&&o.length>1&&r&&r.length>1){var s=qS(r)/qS(o);!isFinite(s)&&(s=1),e.pinchScale=s;var a=[((n=r)[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2];return e.pinchX=a[0],e.pinchY=a[1],{type:"pinch",target:t[0].target,event:e}}}}};function ZS(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function YS(t,e){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}function QS(t,e,i){var n=e[0]*i[0]+e[2]*i[1],r=e[1]*i[0]+e[3]*i[1],o=e[0]*i[2]+e[2]*i[3],s=e[1]*i[2]+e[3]*i[3],a=e[0]*i[4]+e[2]*i[5]+e[4],l=e[1]*i[4]+e[3]*i[5]+e[5];return t[0]=n,t[1]=r,t[2]=o,t[3]=s,t[4]=a,t[5]=l,t}function JS(t,e,i){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+i[0],t[5]=e[5]+i[1],t}function KS(t,e,i){var n=e[0],r=e[2],o=e[4],s=e[1],a=e[3],l=e[5],c=Math.sin(i),u=Math.cos(i);return t[0]=n*u+s*c,t[1]=-n*c+s*u,t[2]=r*u+a*c,t[3]=-r*c+u*a,t[4]=u*o+c*l,t[5]=u*l-c*o,t}function $S(t,e,i){var n=i[0],r=i[1];return t[0]=e[0]*n,t[1]=e[1]*r,t[2]=e[2]*n,t[3]=e[3]*r,t[4]=e[4]*n,t[5]=e[5]*r,t}function tM(t,e){var i=e[0],n=e[2],r=e[4],o=e[1],s=e[3],a=e[5],l=i*s-o*n;return l?(l=1/l,t[0]=s*l,t[1]=-o*l,t[2]=-n*l,t[3]=i*l,t[4]=(n*a-s*r)*l,t[5]=(o*r-i*a)*l,t):null}var eM=function(){function t(t,e){this.x=t||0,this.y=e||0}return t.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.set=function(t,e){return this.x=t,this.y=e,this},t.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},t.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},t.prototype.scale=function(t){this.x*=t,this.y*=t},t.prototype.scaleAndAdd=function(t,e){this.x+=t.x*e,this.y+=t.y*e},t.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},t.prototype.dot=function(t){return this.x*t.x+this.y*t.y},t.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},t.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},t.prototype.distance=function(t){var e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)},t.prototype.distanceSquare=function(t){var e=this.x-t.x,i=this.y-t.y;return e*e+i*i},t.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.prototype.transform=function(t){if(t){var e=this.x,i=this.y;return this.x=t[0]*e+t[2]*i+t[4],this.y=t[1]*e+t[3]*i+t[5],this}},t.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},t.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},t.set=function(t,e,i){t.x=e,t.y=i},t.copy=function(t,e){t.x=e.x,t.y=e.y},t.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},t.lenSquare=function(t){return t.x*t.x+t.y*t.y},t.dot=function(t,e){return t.x*e.x+t.y*e.y},t.add=function(t,e,i){t.x=e.x+i.x,t.y=e.y+i.y},t.sub=function(t,e,i){t.x=e.x-i.x,t.y=e.y-i.y},t.scale=function(t,e,i){t.x=e.x*i,t.y=e.y*i},t.scaleAndAdd=function(t,e,i,n){t.x=e.x+i.x*n,t.y=e.y+i.y*n},t.lerp=function(t,e,i,n){var r=1-n;t.x=r*e.x+n*i.x,t.y=r*e.y+n*i.y},t}(),iM=eM,nM=Math.min,rM=Math.max,oM=new iM,sM=new iM,aM=new iM,lM=new iM,cM=new iM,uM=new iM,hM=function(){function t(t,e,i,n){i<0&&(t+=i,i=-i),n<0&&(e+=n,n=-n),this.x=t,this.y=e,this.width=i,this.height=n}return t.prototype.union=function(t){var e=nM(t.x,this.x),i=nM(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=rM(t.x+t.width,this.x+this.width)-e:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=rM(t.y+t.height,this.y+this.height)-i:this.height=t.height,this.x=e,this.y=i},t.prototype.applyTransform=function(e){t.applyTransform(this,this,e)},t.prototype.calculateTransform=function(t){var e=this,i=t.width/e.width,n=t.height/e.height,r=[1,0,0,1,0,0];return JS(r,r,[-e.x,-e.y]),$S(r,r,[i,n]),JS(r,r,[t.x,t.y]),r},t.prototype.intersect=function(e,i){if(!e)return!1;e instanceof t||(e=t.create(e));var n=this,r=n.x,o=n.x+n.width,s=n.y,a=n.y+n.height,l=e.x,c=e.x+e.width,u=e.y,h=e.y+e.height,p=!(o<l||c<r||a<u||h<s);if(i){var d=1/0,f=0,m=Math.abs(o-l),g=Math.abs(c-r),y=Math.abs(a-u),v=Math.abs(h-s),_=Math.min(m,g),x=Math.min(y,v);o<l||c<r?_>f&&(f=_,m<g?iM.set(uM,-m,0):iM.set(uM,g,0)):_<d&&(d=_,m<g?iM.set(cM,m,0):iM.set(cM,-g,0)),a<u||h<s?x>f&&(f=x,y<v?iM.set(uM,0,-y):iM.set(uM,0,v)):_<d&&(d=_,y<v?iM.set(cM,0,y):iM.set(cM,0,-v))}return i&&iM.copy(i,p?cM:uM),p},t.prototype.contain=function(t,e){var i=this;return t>=i.x&&t<=i.x+i.width&&e>=i.y&&e<=i.y+i.height},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(e){t.copy(this,e)},t.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},t.prototype.isZero=function(){return 0===this.width||0===this.height},t.create=function(e){return new t(e.x,e.y,e.width,e.height)},t.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},t.applyTransform=function(e,i,n){if(n){if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var r=n[0],o=n[3],s=n[4],a=n[5];return e.x=i.x*r+s,e.y=i.y*o+a,e.width=i.width*r,e.height=i.height*o,e.width<0&&(e.x+=e.width,e.width=-e.width),void(e.height<0&&(e.y+=e.height,e.height=-e.height))}oM.x=aM.x=i.x,oM.y=lM.y=i.y,sM.x=lM.x=i.x+i.width,sM.y=aM.y=i.y+i.height,oM.transform(n),lM.transform(n),sM.transform(n),aM.transform(n),e.x=nM(oM.x,sM.x,aM.x,lM.x),e.y=nM(oM.y,sM.y,aM.y,lM.y);var l=rM(oM.x,sM.x,aM.x,lM.x),c=rM(oM.y,sM.y,aM.y,lM.y);e.width=l-e.x,e.height=c-e.y}else e!==i&&t.copy(e,i)},t}(),pM=hM,dM="silent";function fM(){jS(this.event)}var mM=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.handler=null,e}return zA(e,t),e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(AS),gM=function(t,e){this.x=t,this.y=e},yM=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],vM=new pM(0,0,0,0),_M=function(t){function e(e,i,n,r,o){var s=t.call(this)||this;return s._hovered=new gM(0,0),s.storage=e,s.painter=i,s.painterRoot=r,s._pointerSize=o,n=n||new mM,s.proxy=null,s.setHandlerProxy(n),s._draggingMgr=new bS(s),s}return zA(e,t),e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(yE(yM,(function(e){t.on&&t.on(e,this[e],this)}),this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var e=t.zrX,i=t.zrY,n=wM(this,e,i),r=this._hovered,o=r.target;o&&!o.__zr&&(o=(r=this.findHover(r.x,r.y)).target);var s=this._hovered=n?new gM(e,i):this.findHover(e,i),a=s.target,l=this.proxy;l.setCursor&&l.setCursor(a?a.cursor:"default"),o&&a!==o&&this.dispatchToElement(r,"mouseout",t),this.dispatchToElement(s,"mousemove",t),a&&a!==o&&this.dispatchToElement(s,"mouseover",t)},e.prototype.mouseout=function(t){var e=t.zrEventControl;"only_globalout"!==e&&this.dispatchToElement(this._hovered,"mouseout",t),"no_globalout"!==e&&this.trigger("globalout",{type:"globalout",event:t})},e.prototype.resize=function(){this._hovered=new gM(0,0)},e.prototype.dispatch=function(t,e){var i=this[t];i&&i.call(this,e)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},e.prototype.dispatchToElement=function(t,e,i){var n=(t=t||{}).target;if(!n||!n.silent){for(var r="on"+e,o=function(t,e,i){return{type:t,event:i,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:i.zrX,offsetY:i.zrY,gestureEvent:i.gestureEvent,pinchX:i.pinchX,pinchY:i.pinchY,pinchScale:i.pinchScale,wheelDelta:i.zrDelta,zrByTouch:i.zrByTouch,which:i.which,stop:fM}}(e,t,i);n&&(n[r]&&(o.cancelBubble=!!n[r].call(n,o)),n.trigger(e,o),n=n.__hostTarget?n.__hostTarget:n.parent,!o.cancelBubble););o.cancelBubble||(this.trigger(e,o),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer((function(t){"function"==typeof t[r]&&t[r].call(t,o),t.trigger&&t.trigger(e,o)})))}},e.prototype.findHover=function(t,e,i){var n=this.storage.getDisplayList(),r=new gM(t,e);if(bM(n,r,t,e,i),this._pointerSize&&!r.target){for(var o=[],s=this._pointerSize,a=s/2,l=new pM(t-a,e-a,s,s),c=n.length-1;c>=0;c--){var u=n[c];u===i||u.ignore||u.ignoreCoarsePointer||u.parent&&u.parent.ignoreCoarsePointer||(vM.copy(u.getBoundingRect()),u.transform&&vM.applyTransform(u.transform),vM.intersect(l)&&o.push(u))}if(o.length)for(var h=Math.PI/12,p=2*Math.PI,d=0;d<a;d+=4)for(var f=0;f<p;f+=h){if(bM(o,r,t+d*Math.cos(f),e+d*Math.sin(f),i),r.target)return r}}return r},e.prototype.processGesture=function(t,e){this._gestureMgr||(this._gestureMgr=new WS);var i=this._gestureMgr;"start"===e&&i.clear();var n=i.recognize(t,this.findHover(t.zrX,t.zrY,null).target,this.proxy.dom);if("end"===e&&i.clear(),n){var r=n.type;t.gestureEvent=r;var o=new gM;o.target=n.target,this.dispatchToElement(o,r,n.event)}},e}(AS);function xM(t,e,i){if(t[t.rectHover?"rectContain":"contain"](e,i)){for(var n=t,r=void 0,o=!1;n;){if(n.ignoreClip&&(o=!0),!o){var s=n.getClipPath();if(s&&!s.contain(e,i))return!1;n.silent&&(r=!0)}var a=n.__hostTarget;n=a||n.parent}return!r||dM}return!1}function bM(t,e,i,n,r){for(var o=t.length-1;o>=0;o--){var s=t[o],a=void 0;if(s!==r&&!s.ignore&&(a=xM(s,i,n))&&(!e.topTarget&&(e.topTarget=s),a!==dM)){e.target=s;break}}}function wM(t,e,i){var n=t.painter;return e<0||e>n.getWidth()||i<0||i>n.getHeight()}yE(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(t){_M.prototype[t]=function(e){var i,n,r=e.zrX,o=e.zrY,s=wM(this,r,o);if("mouseup"===t&&s||(n=(i=this.findHover(r,o)).target),"mousedown"===t)this._downEl=n,this._downPoint=[e.zrX,e.zrY],this._upEl=n;else if("mouseup"===t)this._upEl=n;else if("click"===t){if(this._downEl!==this._upEl||!this._downPoint||dS(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(i,t,e)}}));var AM=_M,EM=32,SM=7;function MM(t,e,i,n){var r=e+1;if(r===i)return 1;if(n(t[r++],t[e])<0){for(;r<i&&n(t[r],t[r-1])<0;)r++;!function(t,e,i){i--;for(;e<i;){var n=t[e];t[e++]=t[i],t[i--]=n}}(t,e,r)}else for(;r<i&&n(t[r],t[r-1])>=0;)r++;return r-e}function TM(t,e,i,n,r){for(n===e&&n++;n<i;n++){for(var o,s=t[n],a=e,l=n;a<l;)r(s,t[o=a+l>>>1])<0?l=o:a=o+1;var c=n-a;switch(c){case 3:t[a+3]=t[a+2];case 2:t[a+2]=t[a+1];case 1:t[a+1]=t[a];break;default:for(;c>0;)t[a+c]=t[a+c-1],c--}t[a]=s}}function IM(t,e,i,n,r,o){var s=0,a=0,l=1;if(o(t,e[i+r])>0){for(a=n-r;l<a&&o(t,e[i+r+l])>0;)s=l,(l=1+(l<<1))<=0&&(l=a);l>a&&(l=a),s+=r,l+=r}else{for(a=r+1;l<a&&o(t,e[i+r-l])<=0;)s=l,(l=1+(l<<1))<=0&&(l=a);l>a&&(l=a);var c=s;s=r-l,l=r-c}for(s++;s<l;){var u=s+(l-s>>>1);o(t,e[i+u])>0?s=u+1:l=u}return l}function CM(t,e,i,n,r,o){var s=0,a=0,l=1;if(o(t,e[i+r])<0){for(a=r+1;l<a&&o(t,e[i+r-l])<0;)s=l,(l=1+(l<<1))<=0&&(l=a);l>a&&(l=a);var c=s;s=r-l,l=r-c}else{for(a=n-r;l<a&&o(t,e[i+r+l])>=0;)s=l,(l=1+(l<<1))<=0&&(l=a);l>a&&(l=a),s+=r,l+=r}for(s++;s<l;){var u=s+(l-s>>>1);o(t,e[i+u])<0?l=u:s=u+1}return l}function PM(t,e){var i,n,r=SM,o=0;t.length;var s=[];function a(a){var l=i[a],c=n[a],u=i[a+1],h=n[a+1];n[a]=c+h,a===o-3&&(i[a+1]=i[a+2],n[a+1]=n[a+2]),o--;var p=CM(t[u],t,l,c,0,e);l+=p,0!==(c-=p)&&0!==(h=IM(t[l+c-1],t,u,h,h-1,e))&&(c<=h?function(i,n,o,a){var l=0;for(l=0;l<n;l++)s[l]=t[i+l];var c=0,u=o,h=i;if(t[h++]=t[u++],0==--a){for(l=0;l<n;l++)t[h+l]=s[c+l];return}if(1===n){for(l=0;l<a;l++)t[h+l]=t[u+l];return void(t[h+a]=s[c])}var p,d,f,m=r;for(;;){p=0,d=0,f=!1;do{if(e(t[u],s[c])<0){if(t[h++]=t[u++],d++,p=0,0==--a){f=!0;break}}else if(t[h++]=s[c++],p++,d=0,1==--n){f=!0;break}}while((p|d)<m);if(f)break;do{if(0!==(p=CM(t[u],s,c,n,0,e))){for(l=0;l<p;l++)t[h+l]=s[c+l];if(h+=p,c+=p,(n-=p)<=1){f=!0;break}}if(t[h++]=t[u++],0==--a){f=!0;break}if(0!==(d=IM(s[c],t,u,a,0,e))){for(l=0;l<d;l++)t[h+l]=t[u+l];if(h+=d,u+=d,0===(a-=d)){f=!0;break}}if(t[h++]=s[c++],1==--n){f=!0;break}m--}while(p>=SM||d>=SM);if(f)break;m<0&&(m=0),m+=2}if((r=m)<1&&(r=1),1===n){for(l=0;l<a;l++)t[h+l]=t[u+l];t[h+a]=s[c]}else{if(0===n)throw new Error;for(l=0;l<n;l++)t[h+l]=s[c+l]}}(l,c,u,h):function(i,n,o,a){var l=0;for(l=0;l<a;l++)s[l]=t[o+l];var c=i+n-1,u=a-1,h=o+a-1,p=0,d=0;if(t[h--]=t[c--],0==--n){for(p=h-(a-1),l=0;l<a;l++)t[p+l]=s[l];return}if(1===a){for(d=(h-=n)+1,p=(c-=n)+1,l=n-1;l>=0;l--)t[d+l]=t[p+l];return void(t[h]=s[u])}var f=r;for(;;){var m=0,g=0,y=!1;do{if(e(s[u],t[c])<0){if(t[h--]=t[c--],m++,g=0,0==--n){y=!0;break}}else if(t[h--]=s[u--],g++,m=0,1==--a){y=!0;break}}while((m|g)<f);if(y)break;do{if(0!==(m=n-CM(s[u],t,i,n,n-1,e))){for(n-=m,d=(h-=m)+1,p=(c-=m)+1,l=m-1;l>=0;l--)t[d+l]=t[p+l];if(0===n){y=!0;break}}if(t[h--]=s[u--],1==--a){y=!0;break}if(0!==(g=a-IM(t[c],s,0,a,a-1,e))){for(a-=g,d=(h-=g)+1,p=(u-=g)+1,l=0;l<g;l++)t[d+l]=s[p+l];if(a<=1){y=!0;break}}if(t[h--]=t[c--],0==--n){y=!0;break}f--}while(m>=SM||g>=SM);if(y)break;f<0&&(f=0),f+=2}(r=f)<1&&(r=1);if(1===a){for(d=(h-=n)+1,p=(c-=n)+1,l=n-1;l>=0;l--)t[d+l]=t[p+l];t[h]=s[u]}else{if(0===a)throw new Error;for(p=h-(a-1),l=0;l<a;l++)t[p+l]=s[l]}}(l,c,u,h))}return i=[],n=[],{mergeRuns:function(){for(;o>1;){var t=o-2;if(t>=1&&n[t-1]<=n[t]+n[t+1]||t>=2&&n[t-2]<=n[t]+n[t-1])n[t-1]<n[t+1]&&t--;else if(n[t]>n[t+1])break;a(t)}},forceMergeRuns:function(){for(;o>1;){var t=o-2;t>0&&n[t-1]<n[t+1]&&t--,a(t)}},pushRun:function(t,e){i[o]=t,n[o]=e,o+=1}}}function LM(t,e,i,n){i||(i=0),n||(n=t.length);var r=n-i;if(!(r<2)){var o=0;if(r<EM)TM(t,i,n,i+(o=MM(t,i,n,e)),e);else{var s=PM(t,e),a=function(t){for(var e=0;t>=EM;)e|=1&t,t>>=1;return t+e}(r);do{if((o=MM(t,i,n,e))<a){var l=r;l>a&&(l=a),TM(t,i,i+l,i+o,e),o=l}s.pushRun(i,o),s.mergeRuns(),r-=o,i+=o}while(0!==r);s.forceMergeRuns()}}}var DM=1,RM=4,OM=!1;function kM(){OM||(OM=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function NM(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var BM=function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=NM}return t.prototype.traverse=function(t,e){for(var i=0;i<this._roots.length;i++)this._roots[i].traverse(t,e)},t.prototype.getDisplayList=function(t,e){e=e||!1;var i=this._displayList;return!t&&i.length||this.updateDisplayList(e),i},t.prototype.updateDisplayList=function(t){this._displayListLen=0;for(var e=this._roots,i=this._displayList,n=0,r=e.length;n<r;n++)this._updateAndAddDisplayable(e[n],null,t);i.length=this._displayListLen,LM(i,NM)},t.prototype._updateAndAddDisplayable=function(t,e,i){if(!t.ignore||i){t.beforeUpdate(),t.update(),t.afterUpdate();var n=t.getClipPath();if(t.ignoreClip)e=null;else if(n){e=e?e.slice():[];for(var r=n,o=t;r;)r.parent=o,r.updateTransform(),e.push(r),o=r,r=r.getClipPath()}if(t.childrenRef){for(var s=t.childrenRef(),a=0;a<s.length;a++){var l=s[a];t.__dirty&&(l.__dirty|=DM),this._updateAndAddDisplayable(l,e,i)}t.__dirty=0}else{var c=t;e&&e.length?c.__clipPaths=e:c.__clipPaths&&c.__clipPaths.length>0&&(c.__clipPaths=[]),isNaN(c.z)&&(kM(),c.z=0),isNaN(c.z2)&&(kM(),c.z2=0),isNaN(c.zlevel)&&(kM(),c.zlevel=0),this._displayList[this._displayListLen++]=c}var u=t.getDecalElement&&t.getDecalElement();u&&this._updateAndAddDisplayable(u,e,i);var h=t.getTextGuideLine();h&&this._updateAndAddDisplayable(h,e,i);var p=t.getTextContent();p&&this._updateAndAddDisplayable(p,e,i)}},t.prototype.addRoot=function(t){t.__zr&&t.__zr.storage===this||this._roots.push(t)},t.prototype.delRoot=function(t){if(t instanceof Array)for(var e=0,i=t.length;e<i;e++)this.delRoot(t[e]);else{var n=fE(this._roots,t);n>=0&&this._roots.splice(n,1)}},t.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},t.prototype.getRoots=function(){return this._roots},t.prototype.dispose=function(){this._displayList=null,this._roots=null},t}(),zM=BM,FM=UA.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)},VM={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,i=.1,n=.4;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=n*Math.asin(1/i)/(2*Math.PI),(t*=2)<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-VM.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?.5*VM.bounceIn(2*t):.5*VM.bounceOut(2*t-1)+.5}},UM=VM,GM=Math.pow,jM=Math.sqrt,HM=1e-8,WM=1e-4,qM=jM(3),XM=1/3,ZM=iS(),YM=iS(),QM=iS();function JM(t){return t>-HM&&t<HM}function KM(t){return t>HM||t<-HM}function $M(t,e,i,n,r){var o=1-r;return o*o*(o*t+3*r*e)+r*r*(r*n+3*o*i)}function tT(t,e,i,n,r){var o=1-r;return 3*(((e-t)*o+2*(i-e)*r)*o+(n-i)*r*r)}function eT(t,e,i,n,r,o){var s=n+3*(e-i)-t,a=3*(i-2*e+t),l=3*(e-t),c=t-r,u=a*a-3*s*l,h=a*l-9*s*c,p=l*l-3*a*c,d=0;if(JM(u)&&JM(h)){if(JM(a))o[0]=0;else(E=-l/a)>=0&&E<=1&&(o[d++]=E)}else{var f=h*h-4*u*p;if(JM(f)){var m=h/u,g=-m/2;(E=-a/s+m)>=0&&E<=1&&(o[d++]=E),g>=0&&g<=1&&(o[d++]=g)}else if(f>0){var y=jM(f),v=u*a+1.5*s*(-h+y),_=u*a+1.5*s*(-h-y);(E=(-a-((v=v<0?-GM(-v,XM):GM(v,XM))+(_=_<0?-GM(-_,XM):GM(_,XM))))/(3*s))>=0&&E<=1&&(o[d++]=E)}else{var x=(2*u*a-3*s*h)/(2*jM(u*u*u)),b=Math.acos(x)/3,w=jM(u),A=Math.cos(b),E=(-a-2*w*A)/(3*s),S=(g=(-a+w*(A+qM*Math.sin(b)))/(3*s),(-a+w*(A-qM*Math.sin(b)))/(3*s));E>=0&&E<=1&&(o[d++]=E),g>=0&&g<=1&&(o[d++]=g),S>=0&&S<=1&&(o[d++]=S)}}return d}function iT(t,e,i,n,r){var o=6*i-12*e+6*t,s=9*e+3*n-3*t-9*i,a=3*e-3*t,l=0;if(JM(s)){if(KM(o))(u=-a/o)>=0&&u<=1&&(r[l++]=u)}else{var c=o*o-4*s*a;if(JM(c))r[0]=-o/(2*s);else if(c>0){var u,h=jM(c),p=(-o-h)/(2*s);(u=(-o+h)/(2*s))>=0&&u<=1&&(r[l++]=u),p>=0&&p<=1&&(r[l++]=p)}}return l}function nT(t,e,i,n,r,o){var s=(e-t)*r+t,a=(i-e)*r+e,l=(n-i)*r+i,c=(a-s)*r+s,u=(l-a)*r+a,h=(u-c)*r+c;o[0]=t,o[1]=s,o[2]=c,o[3]=h,o[4]=h,o[5]=u,o[6]=l,o[7]=n}function rT(t,e,i,n,r,o,s,a,l,c,u){var h,p,d,f,m,g=.005,y=1/0;ZM[0]=l,ZM[1]=c;for(var v=0;v<1;v+=.05)YM[0]=$M(t,i,r,s,v),YM[1]=$M(e,n,o,a,v),(f=fS(ZM,YM))<y&&(h=v,y=f);y=1/0;for(var _=0;_<32&&!(g<WM);_++)p=h-g,d=h+g,YM[0]=$M(t,i,r,s,p),YM[1]=$M(e,n,o,a,p),f=fS(YM,ZM),p>=0&&f<y?(h=p,y=f):(QM[0]=$M(t,i,r,s,d),QM[1]=$M(e,n,o,a,d),m=fS(QM,ZM),d<=1&&m<y?(h=d,y=m):g*=.5);return u&&(u[0]=$M(t,i,r,s,h),u[1]=$M(e,n,o,a,h)),jM(y)}function oT(t,e,i,n,r,o,s,a,l){for(var c=t,u=e,h=0,p=1/l,d=1;d<=l;d++){var f=d*p,m=$M(t,i,r,s,f),g=$M(e,n,o,a,f),y=m-c,v=g-u;h+=Math.sqrt(y*y+v*v),c=m,u=g}return h}function sT(t,e,i,n){var r=1-n;return r*(r*t+2*n*e)+n*n*i}function aT(t,e,i,n){return 2*((1-n)*(e-t)+n*(i-e))}function lT(t,e,i){var n=t+i-2*e;return 0===n?.5:(t-e)/n}function cT(t,e,i,n,r){var o=(e-t)*n+t,s=(i-e)*n+e,a=(s-o)*n+o;r[0]=t,r[1]=o,r[2]=a,r[3]=a,r[4]=s,r[5]=i}function uT(t,e,i,n,r,o,s,a,l){var c,u=.005,h=1/0;ZM[0]=s,ZM[1]=a;for(var p=0;p<1;p+=.05){YM[0]=sT(t,i,r,p),YM[1]=sT(e,n,o,p),(g=fS(ZM,YM))<h&&(c=p,h=g)}h=1/0;for(var d=0;d<32&&!(u<WM);d++){var f=c-u,m=c+u;YM[0]=sT(t,i,r,f),YM[1]=sT(e,n,o,f);var g=fS(YM,ZM);if(f>=0&&g<h)c=f,h=g;else{QM[0]=sT(t,i,r,m),QM[1]=sT(e,n,o,m);var y=fS(QM,ZM);m<=1&&y<h?(c=m,h=y):u*=.5}}return l&&(l[0]=sT(t,i,r,c),l[1]=sT(e,n,o,c)),jM(h)}function hT(t,e,i,n,r,o,s){for(var a=t,l=e,c=0,u=1/s,h=1;h<=s;h++){var p=h*u,d=sT(t,i,r,p),f=sT(e,n,o,p),m=d-a,g=f-l;c+=Math.sqrt(m*m+g*g),a=d,l=f}return c}var pT=/cubic-bezier\(([0-9,\.e ]+)\)/;function dT(t){var e=t&&pT.exec(t);if(e){var i=e[1].split(","),n=+GE(i[0]),r=+GE(i[1]),o=+GE(i[2]),s=+GE(i[3]);if(isNaN(n+r+o+s))return;var a=[];return function(t){return t<=0?0:t>=1?1:eT(0,n,o,1,t,a)&&$M(0,r,s,1,a[0])}}}var fT=function(){function t(t){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=t.life||1e3,this._delay=t.delay||0,this.loop=t.loop||!1,this.onframe=t.onframe||tS,this.ondestroy=t.ondestroy||tS,this.onrestart=t.onrestart||tS,t.easing&&this.setEasing(t.easing)}return t.prototype.step=function(t,e){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),!this._paused){var i=this._life,n=t-this._startTime-this._pausedTime,r=n/i;r<0&&(r=0),r=Math.min(r,1);var o=this.easingFunc,s=o?o(r):r;if(this.onframe(s),1===r){if(!this.loop)return!0;var a=n%i;this._startTime=t-a,this._pausedTime=0,this.onrestart()}return!1}this._pausedTime+=e},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t.prototype.setEasing=function(t){this.easing=t,this.easingFunc=SE(t)?t:UM[t]||dT(t)},t}(),mT=function(t){this.value=t},gT=function(){function t(){this._len=0}return t.prototype.insert=function(t){var e=new mT(t);return this.insertEntry(e),e},t.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},t.prototype.remove=function(t){var e=t.prev,i=t.next;e?e.next=i:this.head=i,i?i.prev=e:this.tail=e,t.next=t.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t}(),yT=function(){function t(t){this._list=new gT,this._maxSize=10,this._map={},this._maxSize=t}return t.prototype.put=function(t,e){var i=this._list,n=this._map,r=null;if(null==n[t]){var o=i.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var a=i.head;i.remove(a),delete n[a.key],r=a.value,this._lastRemovedEntry=a}s?s.value=e:s=new mT(e),s.key=t,i.insertEntry(s),n[t]=s}return r},t.prototype.get=function(t){var e=this._map[t],i=this._list;if(null!=e)return e!==i.tail&&(i.remove(e),i.insertEntry(e)),e.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t}(),vT=yT,_T={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],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 xT(t){return(t=Math.round(t))<0?0:t>255?255:t}function bT(t){return t<0?0:t>1?1:t}function wT(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?xT(parseFloat(e)/100*255):xT(parseInt(e,10))}function AT(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?bT(parseFloat(e)/100):bT(parseFloat(e))}function ET(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}function ST(t,e,i){return t+(e-t)*i}function MT(t,e,i,n,r){return t[0]=e,t[1]=i,t[2]=n,t[3]=r,t}function TT(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var IT=new vT(20),CT=null;function PT(t,e){CT&&TT(CT,e),CT=IT.put(t,CT||e.slice())}function LT(t,e){if(t){e=e||[];var i=IT.get(t);if(i)return TT(e,i);var n=(t+="").replace(/ /g,"").toLowerCase();if(n in _T)return TT(e,_T[n]),PT(t,e),e;var r,o=n.length;if("#"===n.charAt(0))return 4===o||5===o?(r=parseInt(n.slice(1,4),16))>=0&&r<=4095?(MT(e,(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,5===o?parseInt(n.slice(4),16)/15:1),PT(t,e),e):void MT(e,0,0,0,1):7===o||9===o?(r=parseInt(n.slice(1,7),16))>=0&&r<=16777215?(MT(e,(16711680&r)>>16,(65280&r)>>8,255&r,9===o?parseInt(n.slice(7),16)/255:1),PT(t,e),e):void MT(e,0,0,0,1):void 0;var s=n.indexOf("("),a=n.indexOf(")");if(-1!==s&&a+1===o){var l=n.substr(0,s),c=n.substr(s+1,a-(s+1)).split(","),u=1;switch(l){case"rgba":if(4!==c.length)return 3===c.length?MT(e,+c[0],+c[1],+c[2],1):MT(e,0,0,0,1);u=AT(c.pop());case"rgb":return c.length>=3?(MT(e,wT(c[0]),wT(c[1]),wT(c[2]),3===c.length?u:AT(c[3])),PT(t,e),e):void MT(e,0,0,0,1);case"hsla":return 4!==c.length?void MT(e,0,0,0,1):(c[3]=AT(c[3]),DT(c,e),PT(t,e),e);case"hsl":return 3!==c.length?void MT(e,0,0,0,1):(DT(c,e),PT(t,e),e);default:return}}MT(e,0,0,0,1)}}function DT(t,e){var i=(parseFloat(t[0])%360+360)%360/360,n=AT(t[1]),r=AT(t[2]),o=r<=.5?r*(n+1):r+n-r*n,s=2*r-o;return MT(e=e||[],xT(255*ET(s,o,i+1/3)),xT(255*ET(s,o,i)),xT(255*ET(s,o,i-1/3)),1),4===t.length&&(e[3]=t[3]),e}function RT(t,e){var i=LT(t);if(i){for(var n=0;n<3;n++)i[n]=e<0?i[n]*(1-e)|0:(255-i[n])*e+i[n]|0,i[n]>255?i[n]=255:i[n]<0&&(i[n]=0);return BT(i,4===i.length?"rgba":"rgb")}}function OT(t,e,i){if(e&&e.length&&t>=0&&t<=1){i=i||[];var n=t*(e.length-1),r=Math.floor(n),o=Math.ceil(n),s=e[r],a=e[o],l=n-r;return i[0]=xT(ST(s[0],a[0],l)),i[1]=xT(ST(s[1],a[1],l)),i[2]=xT(ST(s[2],a[2],l)),i[3]=bT(ST(s[3],a[3],l)),i}}function kT(t,e,i,n){var r=LT(t);if(t)return r=function(t){if(t){var e,i,n=t[0]/255,r=t[1]/255,o=t[2]/255,s=Math.min(n,r,o),a=Math.max(n,r,o),l=a-s,c=(a+s)/2;if(0===l)e=0,i=0;else{i=c<.5?l/(a+s):l/(2-a-s);var u=((a-n)/6+l/2)/l,h=((a-r)/6+l/2)/l,p=((a-o)/6+l/2)/l;n===a?e=p-h:r===a?e=1/3+u-p:o===a&&(e=2/3+h-u),e<0&&(e+=1),e>1&&(e-=1)}var d=[360*e,i,c];return null!=t[3]&&d.push(t[3]),d}}(r),null!=e&&(r[0]=function(t){return(t=Math.round(t))<0?0:t>360?360:t}(e)),null!=i&&(r[1]=AT(i)),null!=n&&(r[2]=AT(n)),BT(DT(r),"rgba")}function NT(t,e){var i=LT(t);if(i&&null!=e)return i[3]=bT(e),BT(i,"rgba")}function BT(t,e){if(t&&t.length){var i=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(i+=","+t[3]),e+"("+i+")"}}function zT(t,e){var i=LT(t);return i?(.299*i[0]+.587*i[1]+.114*i[2])*i[3]/255+(1-i[3])*e:0}var FT=Math.round;function VT(t){var e;if(t&&"transparent"!==t){if("string"==typeof t&&t.indexOf("rgba")>-1){var i=LT(t);i&&(t="rgb("+i[0]+","+i[1]+","+i[2]+")",e=i[3])}}else t="none";return{color:t,opacity:null==e?1:e}}var UT=1e-4;function GT(t){return t<UT&&t>-UT}function jT(t){return FT(1e3*t)/1e3}function HT(t){return FT(1e4*t)/1e4}var WT={left:"start",right:"end",center:"middle",middle:"middle"};function qT(t){return t&&!!t.image}function XT(t){return qT(t)||function(t){return t&&!!t.svgElement}(t)}function ZT(t){return"linear"===t.type}function YT(t){return"radial"===t.type}function QT(t){return t&&("linear"===t.type||"radial"===t.type)}function JT(t){return"url(#"+t+")"}function KT(t){var e=t.getGlobalScale(),i=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(i)/Math.log(10)),1)}function $T(t){var e=t.x||0,i=t.y||0,n=(t.rotation||0)*eS,r=BE(t.scaleX,1),o=BE(t.scaleY,1),s=t.skewX||0,a=t.skewY||0,l=[];return(e||i)&&l.push("translate("+e+"px,"+i+"px)"),n&&l.push("rotate("+n+")"),1===r&&1===o||l.push("scale("+r+","+o+")"),(s||a)&&l.push("skew("+FT(s*eS)+"deg, "+FT(a*eS)+"deg)"),l.join(" ")}var tI=UA.hasGlobalWindow&&SE(window.btoa)?function(t){return window.btoa(unescape(encodeURIComponent(t)))}:"undefined"!=typeof Buffer?function(t){return Buffer.from(t).toString("base64")}:function(t){return"production"!==process.env.NODE_ENV&&lE("Base64 isn't natively supported in the current environment."),null},eI=Array.prototype.slice;function iI(t,e,i){return(e-t)*i+t}function nI(t,e,i,n){for(var r=e.length,o=0;o<r;o++)t[o]=iI(e[o],i[o],n);return t}function rI(t,e,i,n){for(var r=e.length,o=0;o<r;o++)t[o]=e[o]+i[o]*n;return t}function oI(t,e,i,n){for(var r=e.length,o=r&&e[0].length,s=0;s<r;s++){t[s]||(t[s]=[]);for(var a=0;a<o;a++)t[s][a]=e[s][a]+i[s][a]*n}return t}function sI(t,e){for(var i=t.length,n=e.length,r=i>n?e:t,o=Math.min(i,n),s=r[o-1]||{color:[0,0,0,0],offset:0},a=o;a<Math.max(i,n);a++)r.push({offset:s.offset,color:s.color.slice()})}function aI(t,e,i){var n=t,r=e;if(n.push&&r.push){var o=n.length,s=r.length;if(o!==s)if(o>s)n.length=s;else for(var a=o;a<s;a++)n.push(1===i?r[a]:eI.call(r[a]));var l=n[0]&&n[0].length;for(a=0;a<n.length;a++)if(1===i)isNaN(n[a])&&(n[a]=r[a]);else for(var c=0;c<l;c++)isNaN(n[a][c])&&(n[a][c]=r[a][c])}}function lI(t){if(gE(t)){var e=t.length;if(gE(t[0])){for(var i=[],n=0;n<e;n++)i.push(eI.call(t[n]));return i}return eI.call(t)}return t}function cI(t){return t[0]=Math.floor(t[0])||0,t[1]=Math.floor(t[1])||0,t[2]=Math.floor(t[2])||0,t[3]=null==t[3]?1:t[3],"rgba("+t.join(",")+")"}function uI(t){return 4===t||5===t}function hI(t){return 1===t||2===t}var pI=[0,0,0,0],dI=function(){function t(t){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=t}return t.prototype.isFinished=function(){return this._finished},t.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},t.prototype.needsAnimate=function(){return this.keyframes.length>=1},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(t,e,i){this._needsSort=!0;var n=this.keyframes,r=n.length,o=!1,s=6,a=e;if(gE(e)){var l=function(t){return gE(t&&t[0])?2:1}(e);s=l,(1===l&&!IE(e[0])||2===l&&!IE(e[0][0]))&&(o=!0)}else if(IE(e)&&!kE(e))s=0;else if(ME(e))if(isNaN(+e)){var c=LT(e);c&&(a=c,s=3)}else s=0;else if(RE(e)){var u=pE({},a);u.colorStops=vE(e.colorStops,(function(t){return{offset:t.offset,color:LT(t.color)}})),ZT(e)?s=4:YT(e)&&(s=5),a=u}0===r?this.valType=s:s===this.valType&&6!==s||(o=!0),this.discrete=this.discrete||o;var h={time:t,value:a,rawValue:e,percent:0};return i&&(h.easing=i,h.easingFunc=SE(i)?i:UM[i]||dT(i)),n.push(h),h},t.prototype.prepare=function(t,e){var i=this.keyframes;this._needsSort&&i.sort((function(t,e){return t.time-e.time}));for(var n=this.valType,r=i.length,o=i[r-1],s=this.discrete,a=hI(n),l=uI(n),c=0;c<r;c++){var u=i[c],h=u.value,p=o.value;u.percent=u.time/t,s||(a&&c!==r-1?aI(h,p,n):l&&sI(h.colorStops,p.colorStops))}if(!s&&5!==n&&e&&this.needsAnimate()&&e.needsAnimate()&&n===e.valType&&!e._finished){this._additiveTrack=e;var d=i[0].value;for(c=0;c<r;c++)0===n?i[c].additiveValue=i[c].value-d:3===n?i[c].additiveValue=rI([],i[c].value,d,-1):hI(n)&&(i[c].additiveValue=1===n?rI([],i[c].value,d,-1):oI([],i[c].value,d,-1))}},t.prototype.step=function(t,e){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var i,n,r,o=null!=this._additiveTrack,s=o?"additiveValue":"value",a=this.valType,l=this.keyframes,c=l.length,u=this.propName,h=3===a,p=this._lastFr,d=Math.min;if(1===c)n=r=l[0];else{if(e<0)i=0;else if(e<this._lastFrP){for(i=d(p+1,c-1);i>=0&&!(l[i].percent<=e);i--);i=d(i,c-2)}else{for(i=p;i<c&&!(l[i].percent>e);i++);i=d(i-1,c-2)}r=l[i+1],n=l[i]}if(n&&r){this._lastFr=i,this._lastFrP=e;var f=r.percent-n.percent,m=0===f?1:d((e-n.percent)/f,1);r.easingFunc&&(m=r.easingFunc(m));var g=o?this._additiveValue:h?pI:t[u];if(!hI(a)&&!h||g||(g=this._additiveValue=[]),this.discrete)t[u]=m<1?n.rawValue:r.rawValue;else if(hI(a))1===a?nI(g,n[s],r[s],m):function(t,e,i,n){for(var r=e.length,o=r&&e[0].length,s=0;s<r;s++){t[s]||(t[s]=[]);for(var a=0;a<o;a++)t[s][a]=iI(e[s][a],i[s][a],n)}}(g,n[s],r[s],m);else if(uI(a)){var y=n[s],v=r[s],_=4===a;t[u]={type:_?"linear":"radial",x:iI(y.x,v.x,m),y:iI(y.y,v.y,m),colorStops:vE(y.colorStops,(function(t,e){var i=v.colorStops[e];return{offset:iI(t.offset,i.offset,m),color:cI(nI([],t.color,i.color,m))}})),global:v.global},_?(t[u].x2=iI(y.x2,v.x2,m),t[u].y2=iI(y.y2,v.y2,m)):t[u].r=iI(y.r,v.r,m)}else if(h)nI(g,n[s],r[s],m),o||(t[u]=cI(g));else{var x=iI(n[s],r[s],m);o?this._additiveValue=x:t[u]=x}o&&this._addToTarget(t)}}},t.prototype._addToTarget=function(t){var e=this.valType,i=this.propName,n=this._additiveValue;0===e?t[i]=t[i]+n:3===e?(LT(t[i],pI),rI(pI,pI,n,1),t[i]=cI(pI)):1===e?rI(t[i],t[i],n,1):2===e&&oI(t[i],t[i],n,1)},t}(),fI=function(){function t(t,e,i,n){this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=t,this._loop=e,e&&n?lE("Can' use additive animation on looped animation."):(this._additiveAnimators=n,this._allowDiscrete=i)}return t.prototype.getMaxTime=function(){return this._maxTime},t.prototype.getDelay=function(){return this._delay},t.prototype.getLoop=function(){return this._loop},t.prototype.getTarget=function(){return this._target},t.prototype.changeTarget=function(t){this._target=t},t.prototype.when=function(t,e,i){return this.whenWithKeys(t,e,bE(e),i)},t.prototype.whenWithKeys=function(t,e,i,n){for(var r=this._tracks,o=0;o<i.length;o++){var s=i[o],a=r[s];if(!a){a=r[s]=new dI(s);var l=void 0,c=this._getAdditiveTrack(s);if(c){var u=c.keyframes,h=u[u.length-1];l=h&&h.value,3===c.valType&&l&&(l=cI(l))}else l=this._target[s];if(null==l)continue;t>0&&a.addKeyframe(0,lI(l),n),this._trackKeys.push(s)}a.addKeyframe(t,lI(e[s]),n)}return this._maxTime=Math.max(this._maxTime,t),this},t.prototype.pause=function(){this._clip.pause(),this._paused=!0},t.prototype.resume=function(){this._clip.resume(),this._paused=!1},t.prototype.isPaused=function(){return!!this._paused},t.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},t.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var e=t.length,i=0;i<e;i++)t[i].call(this)},t.prototype._abortedCallback=function(){this._setTracksFinished();var t=this.animation,e=this._abortedCbs;if(t&&t.removeClip(this._clip),this._clip=null,e)for(var i=0;i<e.length;i++)e[i].call(this)},t.prototype._setTracksFinished=function(){for(var t=this._tracks,e=this._trackKeys,i=0;i<e.length;i++)t[e[i]].setFinished()},t.prototype._getAdditiveTrack=function(t){var e,i=this._additiveAnimators;if(i)for(var n=0;n<i.length;n++){var r=i[n].getTrack(t);r&&(e=r)}return e},t.prototype.start=function(t){if(!(this._started>0)){this._started=1;for(var e=this,i=[],n=this._maxTime||0,r=0;r<this._trackKeys.length;r++){var o=this._trackKeys[r],s=this._tracks[o],a=this._getAdditiveTrack(o),l=s.keyframes,c=l.length;if(s.prepare(n,a),s.needsAnimate())if(!this._allowDiscrete&&s.discrete){var u=l[c-1];u&&(e._target[s.propName]=u.rawValue),s.setFinished()}else i.push(s)}if(i.length||this._force){var h=new fT({life:n,loop:this._loop,delay:this._delay||0,onframe:function(t){e._started=2;var n=e._additiveAnimators;if(n){for(var r=!1,o=0;o<n.length;o++)if(n[o]._clip){r=!0;break}r||(e._additiveAnimators=null)}for(o=0;o<i.length;o++)i[o].step(e._target,t);var s=e._onframeCbs;if(s)for(o=0;o<s.length;o++)s[o](e._target,t)},ondestroy:function(){e._doneCallback()}});this._clip=h,this.animation&&this.animation.addClip(h),t&&h.setEasing(t)}else this._doneCallback();return this}},t.prototype.stop=function(t){if(this._clip){var e=this._clip;t&&e.onframe(1),this._abortedCallback()}},t.prototype.delay=function(t){return this._delay=t,this},t.prototype.during=function(t){return t&&(this._onframeCbs||(this._onframeCbs=[]),this._onframeCbs.push(t)),this},t.prototype.done=function(t){return t&&(this._doneCbs||(this._doneCbs=[]),this._doneCbs.push(t)),this},t.prototype.aborted=function(t){return t&&(this._abortedCbs||(this._abortedCbs=[]),this._abortedCbs.push(t)),this},t.prototype.getClip=function(){return this._clip},t.prototype.getTrack=function(t){return this._tracks[t]},t.prototype.getTracks=function(){var t=this;return vE(this._trackKeys,(function(e){return t._tracks[e]}))},t.prototype.stopTracks=function(t,e){if(!t.length||!this._clip)return!0;for(var i=this._tracks,n=this._trackKeys,r=0;r<t.length;r++){var o=i[t[r]];o&&!o.isFinished()&&(e?o.step(this._target,1):1===this._started&&o.step(this._target,0),o.setFinished())}var s=!0;for(r=0;r<n.length;r++)if(!i[n[r]].isFinished()){s=!1;break}return s&&this._abortedCallback(),s},t.prototype.saveTo=function(t,e,i){if(t){e=e||this._trackKeys;for(var n=0;n<e.length;n++){var r=e[n],o=this._tracks[r];if(o&&!o.isFinished()){var s=o.keyframes,a=s[i?0:s.length-1];a&&(t[r]=lI(a.rawValue))}}}},t.prototype.__changeFinalValue=function(t,e){e=e||bE(t);for(var i=0;i<e.length;i++){var n=e[i],r=this._tracks[n];if(r){var o=r.keyframes;if(o.length>1){var s=o.pop();r.addKeyframe(s.time,t[n]),r.prepare(this._maxTime,r.getAdditiveTrack())}}}},t}();function mI(){return(new Date).getTime()}var gI,yI,vI,_I=function(t){function e(e){var i=t.call(this)||this;return i._running=!1,i._time=0,i._pausedTime=0,i._pauseStart=0,i._paused=!1,e=e||{},i.stage=e.stage||{},i}return zA(e,t),e.prototype.addClip=function(t){t.animation&&this.removeClip(t),this._head?(this._tail.next=t,t.prev=this._tail,t.next=null,this._tail=t):this._head=this._tail=t,t.animation=this},e.prototype.addAnimator=function(t){t.animation=this;var e=t.getClip();e&&this.addClip(e)},e.prototype.removeClip=function(t){if(t.animation){var e=t.prev,i=t.next;e?e.next=i:this._head=i,i?i.prev=e:this._tail=e,t.next=t.prev=t.animation=null}},e.prototype.removeAnimator=function(t){var e=t.getClip();e&&this.removeClip(e),t.animation=null},e.prototype.update=function(t){for(var e=mI()-this._pausedTime,i=e-this._time,n=this._head;n;){var r=n.next;n.step(e,i)?(n.ondestroy(),this.removeClip(n),n=r):n=r}this._time=e,t||(this.trigger("frame",i),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var t=this;this._running=!0,FM((function e(){t._running&&(FM(e),!t._paused&&t.update())}))},e.prototype.start=function(){this._running||(this._time=mI(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=mI(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=mI()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var t=this._head;t;){var e=t.next;t.prev=t.next=t.animation=null,t=e}this._head=this._tail=null},e.prototype.isFinished=function(){return null==this._head},e.prototype.animate=function(t,e){e=e||{},this.start();var i=new fI(t,e.loop);return this.addAnimator(i),i},e}(AS),xI=_I,bI=UA.domSupported,wI=(yI={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},vI=vE(gI=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],(function(t){var e=t.replace("mouse","pointer");return yI.hasOwnProperty(e)?e:t})),{mouse:gI,touch:["touchstart","touchend","touchmove"],pointer:vI}),AI=["mousemove","mouseup"],EI=["pointermove","pointerup"],SI=!1;function MI(t){var e=t.pointerType;return"pen"===e||"touch"===e}function TI(t){t&&(t.zrByTouch=!0)}function II(t,e){for(var i=e,n=!1;i&&9!==i.nodeType&&!(n=i.domBelongToZr||i!==e&&i===t.painterRoot);)i=i.parentNode;return n}var CI=function(t,e){this.stopPropagation=tS,this.stopImmediatePropagation=tS,this.preventDefault=tS,this.type=e.type,this.target=this.currentTarget=t.dom,this.pointerType=e.pointerType,this.clientX=e.clientX,this.clientY=e.clientY},PI={mousedown:function(t){t=VS(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=VS(this.dom,t);var e=this.__mayPointerCapture;!e||t.zrX===e[0]&&t.zrY===e[1]||this.__togglePointerCapture(!0),this.trigger("mousemove",t)},mouseup:function(t){t=VS(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){II(this,(t=VS(this.dom,t)).toElement||t.relatedTarget)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){SI=!0,t=VS(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){SI||(t=VS(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){TI(t=VS(this.dom,t)),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),PI.mousemove.call(this,t),PI.mousedown.call(this,t)},touchmove:function(t){TI(t=VS(this.dom,t)),this.handler.processGesture(t,"change"),PI.mousemove.call(this,t)},touchend:function(t){TI(t=VS(this.dom,t)),this.handler.processGesture(t,"end"),PI.mouseup.call(this,t),+new Date-+this.__lastTouchMoment<300&&PI.click.call(this,t)},pointerdown:function(t){PI.mousedown.call(this,t)},pointermove:function(t){MI(t)||PI.mousemove.call(this,t)},pointerup:function(t){PI.mouseup.call(this,t)},pointerout:function(t){MI(t)||PI.mouseout.call(this,t)}};yE(["click","dblclick","contextmenu"],(function(t){PI[t]=function(e){e=VS(this.dom,e),this.trigger(t,e)}}));var LI={pointermove:function(t){MI(t)||LI.mousemove.call(this,t)},pointerup:function(t){LI.mouseup.call(this,t)},mousemove:function(t){this.trigger("mousemove",t)},mouseup:function(t){var e=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",t),e&&(t.zrEventControl="only_globalout",this.trigger("mouseout",t))}};function DI(t,e){var i=e.domHandlers;UA.pointerEventsSupported?yE(wI.pointer,(function(n){OI(e,n,(function(e){i[n].call(t,e)}))})):(UA.touchEventsSupported&&yE(wI.touch,(function(n){OI(e,n,(function(r){i[n].call(t,r),function(t){t.touching=!0,null!=t.touchTimer&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout((function(){t.touching=!1,t.touchTimer=null}),700)}(e)}))})),yE(wI.mouse,(function(n){OI(e,n,(function(r){r=FS(r),e.touching||i[n].call(t,r)}))})))}function RI(t,e){function i(i){OI(e,i,(function(n){n=FS(n),II(t,n.target)||(n=function(t,e){return VS(t.dom,new CI(t,e),!0)}(t,n),e.domHandlers[i].call(t,n))}),{capture:!0})}UA.pointerEventsSupported?yE(EI,i):UA.touchEventsSupported||yE(AI,i)}function OI(t,e,i,n){t.mounted[e]=i,t.listenerOpts[e]=n,US(t.domTarget,e,i,n)}function kI(t){var e=t.mounted;for(var i in e)e.hasOwnProperty(i)&&GS(t.domTarget,i,e[i],t.listenerOpts[i]);t.mounted={}}var NI=function(t,e){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=t,this.domHandlers=e},BI=function(t){function e(e,i){var n=t.call(this)||this;return n.__pointerCapturing=!1,n.dom=e,n.painterRoot=i,n._localHandlerScope=new NI(e,PI),bI&&(n._globalHandlerScope=new NI(document,LI)),DI(n,n._localHandlerScope),n}return zA(e,t),e.prototype.dispose=function(){kI(this._localHandlerScope),bI&&kI(this._globalHandlerScope)},e.prototype.setCursor=function(t){this.dom.style&&(this.dom.style.cursor=t||"default")},e.prototype.__togglePointerCapture=function(t){if(this.__mayPointerCapture=null,bI&&+this.__pointerCapturing^+t){this.__pointerCapturing=t;var e=this._globalHandlerScope;t?RI(this,e):kI(e)}},e}(AS),zI=1;UA.hasGlobalWindow&&(zI=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var FI=zI,VI="#333",UI="#ccc",GI=ZS,jI=5e-5;function HI(t){return t>jI||t<-5e-5}var WI=[],qI=[],XI=[1,0,0,1,0,0],ZI=Math.abs,YI=function(){function t(){}return t.prototype.getLocalTransform=function(e){return t.getLocalTransform(this,e)},t.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},t.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},t.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},t.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},t.prototype.needLocalTransform=function(){return HI(this.rotation)||HI(this.x)||HI(this.y)||HI(this.scaleX-1)||HI(this.scaleY-1)||HI(this.skewX)||HI(this.skewY)},t.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,e=this.needLocalTransform(),i=this.transform;e||t?(i=i||[1,0,0,1,0,0],e?this.getLocalTransform(i):GI(i),t&&(e?QS(i,t,i):YS(i,t)),this.transform=i,this._resolveGlobalScaleRatio(i)):i&&(GI(i),this.invTransform=null)},t.prototype._resolveGlobalScaleRatio=function(t){var e=this.globalScaleRatio;if(null!=e&&1!==e){this.getGlobalScale(WI);var i=WI[0]<0?-1:1,n=WI[1]<0?-1:1,r=((WI[0]-i)*e+i)/WI[0]||0,o=((WI[1]-n)*e+n)/WI[1]||0;t[0]*=r,t[1]*=r,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||[1,0,0,1,0,0],tM(this.invTransform,t)},t.prototype.getComputedTransform=function(){for(var t=this,e=[];t;)e.push(t),t=t.parent;for(;t=e.pop();)t.updateTransform();return this.transform},t.prototype.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],i=t[2]*t[2]+t[3]*t[3],n=Math.atan2(t[1],t[0]),r=Math.PI/2+n-Math.atan2(t[3],t[2]);i=Math.sqrt(i)*Math.cos(r),e=Math.sqrt(e),this.skewX=r,this.skewY=0,this.rotation=-n,this.x=+t[4],this.y=+t[5],this.scaleX=e,this.scaleY=i,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(QS(qI,t.invTransform,e),e=qI);var i=this.originX,n=this.originY;(i||n)&&(XI[4]=i,XI[5]=n,QS(qI,e,XI),qI[4]-=i,qI[5]-=n,e=qI),this.setLocalTransform(e)}},t.prototype.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},t.prototype.transformCoordToLocal=function(t,e){var i=[t,e],n=this.invTransform;return n&&gS(i,i,n),i},t.prototype.transformCoordToGlobal=function(t,e){var i=[t,e],n=this.transform;return n&&gS(i,i,n),i},t.prototype.getLineScale=function(){var t=this.transform;return t&&ZI(t[0]-1)>1e-10&&ZI(t[3]-1)>1e-10?Math.sqrt(ZI(t[0]*t[3]-t[2]*t[1])):1},t.prototype.copyTransform=function(t){JI(this,t)},t.getLocalTransform=function(t,e){e=e||[];var i=t.originX||0,n=t.originY||0,r=t.scaleX,o=t.scaleY,s=t.anchorX,a=t.anchorY,l=t.rotation||0,c=t.x,u=t.y,h=t.skewX?Math.tan(t.skewX):0,p=t.skewY?Math.tan(-t.skewY):0;if(i||n||s||a){var d=i+s,f=n+a;e[4]=-d*r-h*f*o,e[5]=-f*o-p*d*r}else e[4]=e[5]=0;return e[0]=r,e[3]=o,e[1]=p*r,e[2]=h*o,l&&KS(e,e,l),e[4]+=i+c,e[5]+=n+u,e},t.initDefaultProps=function(){var e=t.prototype;e.scaleX=e.scaleY=e.globalScaleRatio=1,e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0}(),t}(),QI=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function JI(t,e){for(var i=0;i<QI.length;i++){var n=QI[i];t[n]=e[n]}}var KI=YI,$I={};function tC(t,e){var i=$I[e=e||HA];i||(i=$I[e]=new vT(500));var n=i.get(t);return null==n&&(n=ZA.measureText(t,e).width,i.put(t,n)),n}function eC(t,e,i,n){var r=tC(t,e),o=oC(e),s=nC(0,r,i),a=rC(0,o,n);return new pM(s,a,r,o)}function iC(t,e,i,n){var r=((t||"")+"").split("\n");if(1===r.length)return eC(r[0],e,i,n);for(var o=new pM(0,0,0,0),s=0;s<r.length;s++){var a=eC(r[s],e,i,n);0===s?o.copy(a):o.union(a)}return o}function nC(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}function rC(t,e,i){return"middle"===i?t-=e/2:"bottom"===i&&(t-=e),t}function oC(t){return tC("国",t)}function sC(t,e){return"string"==typeof t?t.lastIndexOf("%")>=0?parseFloat(t)/100*e:parseFloat(t):t}function aC(t,e,i){var n=e.position||"inside",r=null!=e.distance?e.distance:5,o=i.height,s=i.width,a=o/2,l=i.x,c=i.y,u="left",h="top";if(n instanceof Array)l+=sC(n[0],i.width),c+=sC(n[1],i.height),u=null,h=null;else switch(n){case"left":l-=r,c+=a,u="right",h="middle";break;case"right":l+=r+s,c+=a,h="middle";break;case"top":l+=s/2,c-=r,u="center",h="bottom";break;case"bottom":l+=s/2,c+=o+r,u="center";break;case"inside":l+=s/2,c+=a,u="center",h="middle";break;case"insideLeft":l+=r,c+=a,h="middle";break;case"insideRight":l+=s-r,c+=a,u="right",h="middle";break;case"insideTop":l+=s/2,c+=r,u="center";break;case"insideBottom":l+=s/2,c+=o-r,u="center",h="bottom";break;case"insideTopLeft":l+=r,c+=r;break;case"insideTopRight":l+=s-r,c+=r,u="right";break;case"insideBottomLeft":l+=r,c+=o-r,h="bottom";break;case"insideBottomRight":l+=s-r,c+=o-r,u="right",h="bottom"}return(t=t||{}).x=l,t.y=c,t.align=u,t.verticalAlign=h,t}var lC="__zr_normal__",cC=QI.concat(["ignore"]),uC=_E(QI,(function(t,e){return t[e]=!0,t}),{ignore:!1}),hC={},pC=new pM(0,0,0,0),dC=function(){function t(t){this.id=aE(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return t.prototype._init=function(t){this.attr(t)},t.prototype.drift=function(t,e,i){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0}var n=this.transform;n||(n=this.transform=[1,0,0,1,0,0]),n[4]+=t,n[5]+=e,this.decomposeTransform(),this.markRedraw()},t.prototype.beforeUpdate=function(){},t.prototype.afterUpdate=function(){},t.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},t.prototype.updateInnerText=function(t){var e=this._textContent;if(e&&(!e.ignore||t)){this.textConfig||(this.textConfig={});var i=this.textConfig,n=i.local,r=e.innerTransformable,o=void 0,s=void 0,a=!1;r.parent=n?this:null;var l=!1;if(r.copyTransform(e),null!=i.position){var c=pC;i.layoutRect?c.copy(i.layoutRect):c.copy(this.getBoundingRect()),n||c.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(hC,i,c):aC(hC,i,c),r.x=hC.x,r.y=hC.y,o=hC.align,s=hC.verticalAlign;var u=i.origin;if(u&&null!=i.rotation){var h=void 0,p=void 0;"center"===u?(h=.5*c.width,p=.5*c.height):(h=sC(u[0],c.width),p=sC(u[1],c.height)),l=!0,r.originX=-r.x+h+(n?0:c.x),r.originY=-r.y+p+(n?0:c.y)}}null!=i.rotation&&(r.rotation=i.rotation);var d=i.offset;d&&(r.x+=d[0],r.y+=d[1],l||(r.originX=-d[0],r.originY=-d[1]));var f=null==i.inside?"string"==typeof i.position&&i.position.indexOf("inside")>=0:i.inside,m=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),g=void 0,y=void 0,v=void 0;f&&this.canBeInsideText()?(g=i.insideFill,y=i.insideStroke,null!=g&&"auto"!==g||(g=this.getInsideTextFill()),null!=y&&"auto"!==y||(y=this.getInsideTextStroke(g),v=!0)):(g=i.outsideFill,y=i.outsideStroke,null!=g&&"auto"!==g||(g=this.getOutsideFill()),null!=y&&"auto"!==y||(y=this.getOutsideStroke(g),v=!0)),(g=g||"#000")===m.fill&&y===m.stroke&&v===m.autoStroke&&o===m.align&&s===m.verticalAlign||(a=!0,m.fill=g,m.stroke=y,m.autoStroke=v,m.align=o,m.verticalAlign=s,e.setDefaultTextStyle(m)),e.__dirty|=DM,a&&e.dirtyStyle(!0)}},t.prototype.canBeInsideText=function(){return!0},t.prototype.getInsideTextFill=function(){return"#fff"},t.prototype.getInsideTextStroke=function(t){return"#000"},t.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?UI:VI},t.prototype.getOutsideStroke=function(t){var e=this.__zr&&this.__zr.getBackgroundColor(),i="string"==typeof e&<(e);i||(i=[255,255,255,1]);for(var n=i[3],r=this.__zr.isDarkMode(),o=0;o<3;o++)i[o]=i[o]*n+(r?0:255)*(1-n);return i[3]=1,BT(i,"rgba")},t.prototype.traverse=function(t,e){},t.prototype.attrKV=function(t,e){"textConfig"===t?this.setTextConfig(e):"textContent"===t?this.setTextContent(e):"clipPath"===t?this.setClipPath(e):"extra"===t?(this.extra=this.extra||{},pE(this.extra,e)):this[t]=e},t.prototype.hide=function(){this.ignore=!0,this.markRedraw()},t.prototype.show=function(){this.ignore=!1,this.markRedraw()},t.prototype.attr=function(t,e){if("string"==typeof t)this.attrKV(t,e);else if(CE(t))for(var i=bE(t),n=0;n<i.length;n++){var r=i[n];this.attrKV(r,t[r])}return this.markRedraw(),this},t.prototype.saveCurrentToNormalState=function(t){this._innerSaveToNormal(t);for(var e=this._normalState,i=0;i<this.animators.length;i++){var n=this.animators[i],r=n.__fromStateTransition;if(!(n.getLoop()||r&&r!==lC)){var o=n.targetName,s=o?e[o]:e;n.saveTo(s)}}},t.prototype._innerSaveToNormal=function(t){var e=this._normalState;e||(e=this._normalState={}),t.textConfig&&!e.textConfig&&(e.textConfig=this.textConfig),this._savePrimaryToNormal(t,e,cC)},t.prototype._savePrimaryToNormal=function(t,e,i){for(var n=0;n<i.length;n++){var r=i[n];null==t[r]||r in e||(e[r]=this[r])}},t.prototype.hasState=function(){return this.currentStates.length>0},t.prototype.getState=function(t){return this.states[t]},t.prototype.ensureState=function(t){var e=this.states;return e[t]||(e[t]={}),e[t]},t.prototype.clearStates=function(t){this.useState(lC,!1,t)},t.prototype.useState=function(t,e,i,n){var r=t===lC;if(this.hasState()||!r){var o=this.currentStates,s=this.stateTransition;if(!(fE(o,t)>=0)||!e&&1!==o.length){var a;if(this.stateProxy&&!r&&(a=this.stateProxy(t)),a||(a=this.states&&this.states[t]),a||r){r||this.saveCurrentToNormalState(a);var l=!!(a&&a.hoverLayer||n);l&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,a,this._normalState,e,!i&&!this.__inHover&&s&&s.duration>0,s);var c=this._textContent,u=this._textGuide;return c&&c.useState(t,e,i,l),u&&u.useState(t,e,i,l),r?(this.currentStates=[],this._normalState={}):e?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!l&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~DM),a}lE("State "+t+" not exists.")}}},t.prototype.useStates=function(t,e,i){if(t.length){var n=[],r=this.currentStates,o=t.length,s=o===r.length;if(s)for(var a=0;a<o;a++)if(t[a]!==r[a]){s=!1;break}if(s)return;for(a=0;a<o;a++){var l=t[a],c=void 0;this.stateProxy&&(c=this.stateProxy(l,t)),c||(c=this.states[l]),c&&n.push(c)}var u=n[o-1],h=!!(u&&u.hoverLayer||i);h&&this._toggleHoverLayerFlag(!0);var p=this._mergeStates(n),d=this.stateTransition;this.saveCurrentToNormalState(p),this._applyStateObj(t.join(","),p,this._normalState,!1,!e&&!this.__inHover&&d&&d.duration>0,d);var f=this._textContent,m=this._textGuide;f&&f.useStates(t,e,h),m&&m.useStates(t,e,h),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~DM)}else this.clearStates()},t.prototype._updateAnimationTargets=function(){for(var t=0;t<this.animators.length;t++){var e=this.animators[t];e.targetName&&e.changeTarget(this[e.targetName])}},t.prototype.removeState=function(t){var e=fE(this.currentStates,t);if(e>=0){var i=this.currentStates.slice();i.splice(e,1),this.useStates(i)}},t.prototype.replaceState=function(t,e,i){var n=this.currentStates.slice(),r=fE(n,t),o=fE(n,e)>=0;r>=0?o?n.splice(r,1):n[r]=e:i&&!o&&n.push(e),this.useStates(n)},t.prototype.toggleState=function(t,e){e?this.useState(t,!0):this.removeState(t)},t.prototype._mergeStates=function(t){for(var e,i={},n=0;n<t.length;n++){var r=t[n];pE(i,r),r.textConfig&&pE(e=e||{},r.textConfig)}return e&&(i.textConfig=e),i},t.prototype._applyStateObj=function(t,e,i,n,r,o){var s=!(e&&n);e&&e.textConfig?(this.textConfig=pE({},n?this.textConfig:i.textConfig),pE(this.textConfig,e.textConfig)):s&&i.textConfig&&(this.textConfig=i.textConfig);for(var a={},l=!1,c=0;c<cC.length;c++){var u=cC[c],h=r&&uC[u];e&&null!=e[u]?h?(l=!0,a[u]=e[u]):this[u]=e[u]:s&&null!=i[u]&&(h?(l=!0,a[u]=i[u]):this[u]=i[u])}if(!r)for(c=0;c<this.animators.length;c++){var p=this.animators[c],d=p.targetName;p.getLoop()||p.__changeFinalValue(d?(e||i)[d]:e||i)}l&&this._transitionState(t,a,o)},t.prototype._attachComponent=function(t){if(!t.__zr||t.__hostTarget){if(t!==this){var e=this.__zr;e&&t.addSelfToZr(e),t.__zr=e,t.__hostTarget=this}else if("production"!==process.env.NODE_ENV)throw new Error("Recursive component attachment.")}else if("production"!==process.env.NODE_ENV)throw new Error("Text element has been added to zrender.")},t.prototype._detachComponent=function(t){t.__zr&&t.removeSelfFromZr(t.__zr),t.__zr=null,t.__hostTarget=null},t.prototype.getClipPath=function(){return this._clipPath},t.prototype.setClipPath=function(t){this._clipPath&&this._clipPath!==t&&this.removeClipPath(),this._attachComponent(t),this._clipPath=t,this.markRedraw()},t.prototype.removeClipPath=function(){var t=this._clipPath;t&&(this._detachComponent(t),this._clipPath=null,this.markRedraw())},t.prototype.getTextContent=function(){return this._textContent},t.prototype.setTextContent=function(t){var e=this._textContent;if(e!==t){if(e&&e!==t&&this.removeTextContent(),"production"!==process.env.NODE_ENV&&t.__zr&&!t.__hostTarget)throw new Error("Text element has been added to zrender.");t.innerTransformable=new KI,this._attachComponent(t),this._textContent=t,this.markRedraw()}},t.prototype.setTextConfig=function(t){this.textConfig||(this.textConfig={}),pE(this.textConfig,t),this.markRedraw()},t.prototype.removeTextConfig=function(){this.textConfig=null,this.markRedraw()},t.prototype.removeTextContent=function(){var t=this._textContent;t&&(t.innerTransformable=null,this._detachComponent(t),this._textContent=null,this._innerTextDefaultStyle=null,this.markRedraw())},t.prototype.getTextGuideLine=function(){return this._textGuide},t.prototype.setTextGuideLine=function(t){this._textGuide&&this._textGuide!==t&&this.removeTextGuideLine(),this._attachComponent(t),this._textGuide=t,this.markRedraw()},t.prototype.removeTextGuideLine=function(){var t=this._textGuide;t&&(this._detachComponent(t),this._textGuide=null,this.markRedraw())},t.prototype.markRedraw=function(){this.__dirty|=DM;var t=this.__zr;t&&(this.__inHover?t.refreshHover():t.refresh()),this.__hostTarget&&this.__hostTarget.markRedraw()},t.prototype.dirty=function(){this.markRedraw()},t.prototype._toggleHoverLayerFlag=function(t){this.__inHover=t;var e=this._textContent,i=this._textGuide;e&&(e.__inHover=t),i&&(i.__inHover=t)},t.prototype.addSelfToZr=function(t){if(this.__zr!==t){this.__zr=t;var e=this.animators;if(e)for(var i=0;i<e.length;i++)t.animation.addAnimator(e[i]);this._clipPath&&this._clipPath.addSelfToZr(t),this._textContent&&this._textContent.addSelfToZr(t),this._textGuide&&this._textGuide.addSelfToZr(t)}},t.prototype.removeSelfFromZr=function(t){if(this.__zr){this.__zr=null;var e=this.animators;if(e)for(var i=0;i<e.length;i++)t.animation.removeAnimator(e[i]);this._clipPath&&this._clipPath.removeSelfFromZr(t),this._textContent&&this._textContent.removeSelfFromZr(t),this._textGuide&&this._textGuide.removeSelfFromZr(t)}},t.prototype.animate=function(t,e,i){var n=t?this[t]:this;if("production"===process.env.NODE_ENV||n){var r=new fI(n,e,i);return t&&(r.targetName=t),this.addAnimator(r,t),r}lE('Property "'+t+'" is not existed in element '+this.id)},t.prototype.addAnimator=function(t,e){var i=this.__zr,n=this;t.during((function(){n.updateDuringAnimation(e)})).done((function(){var e=n.animators,i=fE(e,t);i>=0&&e.splice(i,1)})),this.animators.push(t),i&&i.animation.addAnimator(t),i&&i.wakeUp()},t.prototype.updateDuringAnimation=function(t){this.markRedraw()},t.prototype.stopAnimation=function(t,e){for(var i=this.animators,n=i.length,r=[],o=0;o<n;o++){var s=i[o];t&&t!==s.scope?r.push(s):s.stop(e)}return this.animators=r,this},t.prototype.animateTo=function(t,e,i){fC(this,t,e,i)},t.prototype.animateFrom=function(t,e,i){fC(this,t,e,i,!0)},t.prototype._transitionState=function(t,e,i,n){for(var r=fC(this,e,i,n),o=0;o<r.length;o++)r[o].__fromStateTransition=t},t.prototype.getBoundingRect=function(){return null},t.prototype.getPaintRect=function(){return null},t.initDefaultProps=function(){var e=t.prototype;e.type="element",e.name="",e.ignore=e.silent=e.isGroup=e.draggable=e.dragging=e.ignoreClip=e.__inHover=!1,e.__dirty=DM;var i={};function n(t,e,n){i[t+e+n]||(console.warn("DEPRECATED: '"+t+"' has been deprecated. use '"+e+"', '"+n+"' instead"),i[t+e+n]=!0)}function r(t,i,r,o){function s(t,e){Object.defineProperty(e,0,{get:function(){return t[r]},set:function(e){t[r]=e}}),Object.defineProperty(e,1,{get:function(){return t[o]},set:function(e){t[o]=e}})}Object.defineProperty(e,t,{get:function(){("production"!==process.env.NODE_ENV&&n(t,r,o),this[i])||s(this,this[i]=[]);return this[i]},set:function(e){"production"!==process.env.NODE_ENV&&n(t,r,o),this[r]=e[0],this[o]=e[1],this[i]=e,s(this,e)}})}Object.defineProperty&&(r("position","_legacyPos","x","y"),r("scale","_legacyScale","scaleX","scaleY"),r("origin","_legacyOrigin","originX","originY"))}(),t}();function fC(t,e,i,n,r){var o=[];yC(t,"",t,e,i=i||{},n,o,r);var s=o.length,a=!1,l=i.done,c=i.aborted,u=function(){a=!0,--s<=0&&(a?l&&l():c&&c())},h=function(){--s<=0&&(a?l&&l():c&&c())};s||l&&l(),o.length>0&&i.during&&o[0].during((function(t,e){i.during(e)}));for(var p=0;p<o.length;p++){var d=o[p];u&&d.done(u),h&&d.aborted(h),i.force&&d.duration(i.duration),d.start(i.easing)}return o}function mC(t,e,i){for(var n=0;n<i;n++)t[n]=e[n]}function gC(t,e,i){if(gE(e[i]))if(gE(t[i])||(t[i]=[]),LE(e[i])){var n=e[i].length;t[i].length!==n&&(t[i]=new e[i].constructor(n),mC(t[i],e[i],n))}else{var r=e[i],o=t[i],s=r.length;if(gE(r[0]))for(var a=r[0].length,l=0;l<s;l++)o[l]?mC(o[l],r[l],a):o[l]=Array.prototype.slice.call(r[l]);else mC(o,r,s);o.length=r.length}else t[i]=e[i]}function yC(t,e,i,n,r,o,s,a){for(var l=bE(n),c=r.duration,u=r.delay,h=r.additive,p=r.setToFinal,d=!CE(o),f=t.animators,m=[],g=0;g<l.length;g++){var y=l[g],v=n[y];if(null!=v&&null!=i[y]&&(d||o[y]))if(!CE(v)||gE(v)||RE(v))m.push(y);else{if(e){a||(i[y]=v,t.updateDuringAnimation(e));continue}yC(t,y,i[y],v,r,o&&o[y],s,a)}else a||(i[y]=v,t.updateDuringAnimation(e),m.push(y))}var _=m.length;if(!h&&_)for(var x=0;x<f.length;x++){if((w=f[x]).targetName===e)if(w.stopTracks(m)){var b=fE(f,w);f.splice(b,1)}}if(r.force||(m=xE(m,(function(t){return e=n[t],r=i[t],!(e===r||gE(e)&&gE(r)&&function(t,e){var i=t.length;if(i!==e.length)return!1;for(var n=0;n<i;n++)if(t[n]!==e[n])return!1;return!0}(e,r));var e,r})),_=m.length),_>0||r.force&&!s.length){var w,A=void 0,E=void 0,S=void 0;if(a){E={},p&&(A={});for(x=0;x<_;x++){E[y=m[x]]=i[y],p?A[y]=n[y]:i[y]=n[y]}}else if(p){S={};for(x=0;x<_;x++){S[y=m[x]]=lI(i[y]),gC(i,n,y)}}(w=new fI(i,!1,!1,h?xE(f,(function(t){return t.targetName===e})):null)).targetName=e,r.scope&&(w.scope=r.scope),p&&A&&w.whenWithKeys(0,A,m),S&&w.whenWithKeys(0,S,m),w.whenWithKeys(null==c?500:c,a?E:n,m).delay(u||0),t.addAnimator(w,e),s.push(w)}}mE(dC,AS),mE(dC,KI);var vC=dC,_C=function(t){function e(e){var i=t.call(this)||this;return i.isGroup=!0,i._children=[],i.attr(e),i}return zA(e,t),e.prototype.childrenRef=function(){return this._children},e.prototype.children=function(){return this._children.slice()},e.prototype.childAt=function(t){return this._children[t]},e.prototype.childOfName=function(t){for(var e=this._children,i=0;i<e.length;i++)if(e[i].name===t)return e[i]},e.prototype.childCount=function(){return this._children.length},e.prototype.add=function(t){if(t&&(t!==this&&t.parent!==this&&(this._children.push(t),this._doAdd(t)),"production"!==process.env.NODE_ENV&&t.__hostTarget))throw"This elemenet has been used as an attachment";return this},e.prototype.addBefore=function(t,e){if(t&&t!==this&&t.parent!==this&&e&&e.parent===this){var i=this._children,n=i.indexOf(e);n>=0&&(i.splice(n,0,t),this._doAdd(t))}return this},e.prototype.replace=function(t,e){var i=fE(this._children,t);return i>=0&&this.replaceAt(e,i),this},e.prototype.replaceAt=function(t,e){var i=this._children,n=i[e];if(t&&t!==this&&t.parent!==this&&t!==n){i[e]=t,n.parent=null;var r=this.__zr;r&&n.removeSelfFromZr(r),this._doAdd(t)}return this},e.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__zr;e&&e!==t.__zr&&t.addSelfToZr(e),e&&e.refresh()},e.prototype.remove=function(t){var e=this.__zr,i=this._children,n=fE(i,t);return n<0||(i.splice(n,1),t.parent=null,e&&t.removeSelfFromZr(e),e&&e.refresh()),this},e.prototype.removeAll=function(){for(var t=this._children,e=this.__zr,i=0;i<t.length;i++){var n=t[i];e&&n.removeSelfFromZr(e),n.parent=null}return t.length=0,this},e.prototype.eachChild=function(t,e){for(var i=this._children,n=0;n<i.length;n++){var r=i[n];t.call(e,r,n)}return this},e.prototype.traverse=function(t,e){for(var i=0;i<this._children.length;i++){var n=this._children[i],r=t.call(e,n);n.isGroup&&!r&&n.traverse(t,e)}return this},e.prototype.addSelfToZr=function(e){t.prototype.addSelfToZr.call(this,e);for(var i=0;i<this._children.length;i++){this._children[i].addSelfToZr(e)}},e.prototype.removeSelfFromZr=function(e){t.prototype.removeSelfFromZr.call(this,e);for(var i=0;i<this._children.length;i++){this._children[i].removeSelfFromZr(e)}},e.prototype.getBoundingRect=function(t){for(var e=new pM(0,0,0,0),i=t||this._children,n=[],r=null,o=0;o<i.length;o++){var s=i[o];if(!s.ignore&&!s.invisible){var a=s.getBoundingRect(),l=s.getLocalTransform(n);l?(pM.applyTransform(e,a,l),(r=r||e.clone()).union(e)):(r=r||a.clone()).union(a)}}return r||e},e}(vC);_C.prototype.type="group";var xC=_C,bC={},wC={};
|
||
/*!
|
||
* ZRender, a high performance 2d drawing library.
|
||
*
|
||
* Copyright (c) 2013, Baidu Inc.
|
||
* All rights reserved.
|
||
*
|
||
* LICENSE
|
||
* https://github.com/ecomfe/zrender/blob/master/LICENSE.txt
|
||
*/var AC=function(){function t(t,e,i){var n=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!0,this._darkMode=!1,i=i||{},this.dom=e,this.id=t;var r=new zM,o=i.renderer||"canvas";if(bC[o]||(o=bE(bC)[0]),"production"!==process.env.NODE_ENV&&!bC[o])throw new Error("Renderer '"+o+"' is not imported. Please import it first.");i.useDirtyRect=null!=i.useDirtyRect&&i.useDirtyRect;var s=new bC[o](e,r,i,t),a=i.ssr||s.ssrOnly;this.storage=r,this.painter=s;var l,c=UA.node||UA.worker||a?null:new BI(s.getViewportRoot(),s.root),u=i.useCoarsePointer;(null==u||"auto"===u?UA.touchEventsSupported:!!u)&&(l=BE(i.pointerSize,44)),this.handler=new AM(r,s,c,s.root,l),this.animation=new xI({stage:{update:a?null:function(){return n._flush(!0)}}}),a||this.animation.start()}return t.prototype.add=function(t){t&&(this.storage.addRoot(t),t.addSelfToZr(this),this.refresh())},t.prototype.remove=function(t){t&&(this.storage.delRoot(t),t.removeSelfFromZr(this),this.refresh())},t.prototype.configLayer=function(t,e){this.painter.configLayer&&this.painter.configLayer(t,e),this.refresh()},t.prototype.setBackgroundColor=function(t){this.painter.setBackgroundColor&&this.painter.setBackgroundColor(t),this.refresh(),this._backgroundColor=t,this._darkMode=function(t){if(!t)return!1;if("string"==typeof t)return zT(t,1)<.4;if(t.colorStops){for(var e=t.colorStops,i=0,n=e.length,r=0;r<n;r++)i+=zT(e[r].color,1);return(i/=n)<.4}return!1}(t)},t.prototype.getBackgroundColor=function(){return this._backgroundColor},t.prototype.setDarkMode=function(t){this._darkMode=t},t.prototype.isDarkMode=function(){return this._darkMode},t.prototype.refreshImmediately=function(t){t||this.animation.update(!0),this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1},t.prototype.refresh=function(){this._needsRefresh=!0,this.animation.start()},t.prototype.flush=function(){this._flush(!1)},t.prototype._flush=function(t){var e,i=mI();this._needsRefresh&&(e=!0,this.refreshImmediately(t)),this._needsRefreshHover&&(e=!0,this.refreshHoverImmediately());var n=mI();e?(this._stillFrameAccum=0,this.trigger("rendered",{elapsedTime:n-i})):this._sleepAfterStill>0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},t.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},t.prototype.wakeUp=function(){this.animation.start(),this._stillFrameAccum=0},t.prototype.refreshHover=function(){this._needsRefreshHover=!0},t.prototype.refreshHoverImmediately=function(){this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover()},t.prototype.resize=function(t){t=t||{},this.painter.resize(t.width,t.height),this.handler.resize()},t.prototype.clearAnimation=function(){this.animation.clear()},t.prototype.getWidth=function(){return this.painter.getWidth()},t.prototype.getHeight=function(){return this.painter.getHeight()},t.prototype.setCursorStyle=function(t){this.handler.setCursorStyle(t)},t.prototype.findHover=function(t,e){return this.handler.findHover(t,e)},t.prototype.on=function(t,e,i){return this.handler.on(t,e,i),this},t.prototype.off=function(t,e){this.handler.off(t,e)},t.prototype.trigger=function(t,e){this.handler.trigger(t,e)},t.prototype.clear=function(){for(var t=this.storage.getRoots(),e=0;e<t.length;e++)t[e]instanceof xC&&t[e].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()},t.prototype.dispose=function(){var t;this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,t=this.id,delete wC[t]},t}();function EC(t,e){var i=new AC(aE(),t,e);return wC[i.id]=i,i}var SC=1e-4,MC=20;function TC(t,e,i,n){var r=e[0],o=e[1],s=i[0],a=i[1],l=o-r,c=a-s;if(0===l)return 0===c?s:(s+a)/2;if(n)if(l>0){if(t<=r)return s;if(t>=o)return a}else{if(t>=r)return s;if(t<=o)return a}else{if(t===r)return s;if(t===o)return a}return(t-r)/l*c+s}function IC(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%"}return ME(t)?(i=t,i.replace(/^\s+|\s+$/g,"")).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t;var i}function CC(t,e,i){return null==e&&(e=10),e=Math.min(Math.max(0,e),MC),t=(+t).toFixed(e),i?t:+t}function PC(t){return t.sort((function(t,e){return t-e})),t}function LC(t){if(t=+t,isNaN(t))return 0;if(t>1e-14)for(var e=1,i=0;i<15;i++,e*=10)if(Math.round(t*e)/e===t)return i;return DC(t)}function DC(t){var e=t.toString().toLowerCase(),i=e.indexOf("e"),n=i>0?+e.slice(i+1):0,r=i>0?i:e.length,o=e.indexOf("."),s=o<0?0:r-1-o;return Math.max(0,s-n)}function RC(t,e){var i=Math.log,n=Math.LN10,r=Math.floor(i(t[1]-t[0])/n),o=Math.round(i(Math.abs(e[1]-e[0]))/n),s=Math.min(Math.max(-r+o,0),20);return isFinite(s)?s:20}function OC(t,e){var i=Math.max(LC(t),LC(e)),n=t+e;return i>MC?n:CC(n,i)}var kC=9007199254740991;function NC(t){var e=2*Math.PI;return(t%e+e)%e}function BC(t){return t>-SC&&t<SC}var zC=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function FC(t){if(t instanceof Date)return t;if(ME(t)){var e=zC.exec(t);if(!e)return new Date(NaN);if(e[8]){var i=+e[4]||0;return"Z"!==e[8].toUpperCase()&&(i-=+e[8].slice(0,3)),new Date(Date.UTC(+e[1],+(e[2]||1)-1,+e[3]||1,i,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0))}return new Date(+e[1],+(e[2]||1)-1,+e[3]||1,+e[4]||0,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0)}return null==t?new Date(NaN):new Date(Math.round(t))}function VC(t){if(0===t)return 0;var e=Math.floor(Math.log(t)/Math.LN10);return t/Math.pow(10,e)>=10&&e++,e}function UC(t,e){var i=VC(t),n=Math.pow(10,i),r=t/n;return t=(e?r<1.5?1:r<2.5?2:r<4?3:r<7?5:10:r<1?1:r<2?2:r<3?3:r<5?5:10)*n,i>=-20?+t.toFixed(i<0?-i:0):t}function GC(t,e){var i=(t.length-1)*e+1,n=Math.floor(i),r=+t[n-1],o=i-n;return o?r+o*(t[n]-r):r}function jC(t){t.sort((function(t,e){return a(t,e,0)?-1:1}));for(var e=-1/0,i=1,n=0;n<t.length;){for(var r=t[n].interval,o=t[n].close,s=0;s<2;s++)r[s]<=e&&(r[s]=e,o[s]=s?1:1-i),e=r[s],i=o[s];r[0]===r[1]&&o[0]*o[1]!=1?t.splice(n,1):n++}return t;function a(t,e,i){return t.interval[i]<e.interval[i]||t.interval[i]===e.interval[i]&&(t.close[i]-e.close[i]==(i?-1:1)||!i&&a(t,e,1))}}function HC(t){var e=parseFloat(t);return e==t&&(0!==e||!ME(t)||t.indexOf("x")<=0)?e:NaN}function WC(t){return!isNaN(HC(t))}function qC(){return Math.round(9*Math.random())}function XC(t,e){return 0===e?t:XC(e,t%e)}function ZC(t,e){return null==t?e:null==e?t:t*e/XC(t,e)}var YC="[ECharts] ",QC={},JC="undefined"!=typeof console&&console.warn&&console.log;function KC(t,e,i){if(JC){if(i){if(QC[e])return;QC[e]=!0}console[t](YC+e)}}function $C(t,e){KC("warn",t,e)}function tP(t,e){KC("error",t,e)}function eP(t){"production"!==process.env.NODE_ENV&&KC("warn","DEPRECATED: "+t,!0)}function iP(t,e,i){"production"!==process.env.NODE_ENV&&eP((i?"["+i+"]":"")+t+" is deprecated, use "+e+" instead.")}function nP(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i="";if("production"!==process.env.NODE_ENV){var n=function(t){return void 0===t?"undefined":t===1/0?"Infinity":t===-1/0?"-Infinity":kE(t)?"NaN":t instanceof Date?"Date("+t.toISOString()+")":SE(t)?"function () { ... }":OE(t)?t+"":null};i=vE(t,(function(t){if(ME(t))return t;var e=n(t);if(null!=e)return e;if("undefined"==typeof JSON||!JSON.stringify)return"?";try{return JSON.stringify(t,(function(t,e){var i=n(e);return null==i?e:i}))}catch(t){return"?"}})).join(" ")}return i}function rP(t){throw new Error(t)}function oP(t,e,i){return(e-t)*i+t}var sP="series\0",aP="\0_ec_\0";function lP(t){return t instanceof Array?t:null==t?[]:[t]}function cP(t,e,i){if(t){t[e]=t[e]||{},t.emphasis=t.emphasis||{},t.emphasis[e]=t.emphasis[e]||{};for(var n=0,r=i.length;n<r;n++){var o=i[n];!t.emphasis[e].hasOwnProperty(o)&&t[e].hasOwnProperty(o)&&(t.emphasis[e][o]=t[e][o])}}}var uP=["fontStyle","fontWeight","fontSize","fontFamily","rich","tag","color","textBorderColor","textBorderWidth","width","height","lineHeight","align","verticalAlign","baseline","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","backgroundColor","borderColor","borderWidth","borderRadius","padding"];function hP(t){return!CE(t)||EE(t)||t instanceof Date?t:t.value}function pP(t){return CE(t)&&!(t instanceof Array)}function dP(t,e,i){var n="normalMerge"===i,r="replaceMerge"===i,o="replaceAll"===i;t=t||[],e=(e||[]).slice();var s=YE();yE(e,(function(t,i){CE(t)?"production"!==process.env.NODE_ENV&&(null==t.id||vP(t.id)||yP(t.id),null==t.name||vP(t.name)||yP(t.name)):e[i]=null}));var a,l,c=function(t,e,i){var n=[];if("replaceAll"===i)return n;for(var r=0;r<t.length;r++){var o=t[r];o&&null!=o.id&&e.set(o.id,r),n.push({existing:"replaceMerge"===i||xP(o)?null:o,newOption:null,keyInfo:null,brandNew:null})}return n}(t,s,i);return(n||r)&&function(t,e,i,n){yE(n,(function(r,o){if(r&&null!=r.id){var s=mP(r.id),a=i.get(s);if(null!=a){var l=t[a];UE(!l.newOption,'Duplicated option on id "'+s+'".'),l.newOption=r,l.existing=e[a],n[o]=null}}}))}(c,t,s,e),n&&function(t,e){yE(e,(function(i,n){if(i&&null!=i.name)for(var r=0;r<t.length;r++){var o=t[r].existing;if(!t[r].newOption&&o&&(null==o.id||null==i.id)&&!xP(i)&&!xP(o)&&fP("name",o,i))return t[r].newOption=i,void(e[n]=null)}}))}(c,e),n||r?function(t,e,i){yE(e,(function(e){if(e){for(var n,r=0;(n=t[r])&&(n.newOption||xP(n.existing)||n.existing&&null!=e.id&&!fP("id",e,n.existing));)r++;n?(n.newOption=e,n.brandNew=i):t.push({newOption:e,brandNew:i,existing:null,keyInfo:null}),r++}}))}(c,e,r):o&&function(t,e){yE(e,(function(e){t.push({newOption:e,brandNew:!0,existing:null,keyInfo:null})}))}(c,e),a=c,l=YE(),yE(a,(function(t){var e=t.existing;e&&l.set(e.id,t)})),yE(a,(function(t){var e=t.newOption;UE(!e||null==e.id||!l.get(e.id)||l.get(e.id)===t,"id duplicates: "+(e&&e.id)),e&&null!=e.id&&l.set(e.id,t),!t.keyInfo&&(t.keyInfo={})})),yE(a,(function(t,e){var i=t.existing,n=t.newOption,r=t.keyInfo;if(CE(n)){if(r.name=null!=n.name?mP(n.name):i?i.name:sP+e,i)r.id=mP(i.id);else if(null!=n.id)r.id=mP(n.id);else{var o=0;do{r.id="\0"+r.name+"\0"+o++}while(l.get(r.id))}l.set(r.id,t)}})),c}function fP(t,e,i){var n=gP(e[t],null),r=gP(i[t],null);return null!=n&&null!=r&&n===r}function mP(t){if("production"!==process.env.NODE_ENV&&null==t)throw new Error;return gP(t,"")}function gP(t,e){return null==t?e:ME(t)?t:IE(t)||TE(t)?t+"":e}function yP(t){"production"!==process.env.NODE_ENV&&$C("`"+t+"` is invalid id or name. Must be a string or number.")}function vP(t){return TE(t)||WC(t)}function _P(t){var e=t.name;return!(!e||!e.indexOf(sP))}function xP(t){return t&&null!=t.id&&0===mP(t.id).indexOf(aP)}function bP(t,e){return null!=e.dataIndexInside?e.dataIndexInside:null!=e.dataIndex?EE(e.dataIndex)?vE(e.dataIndex,(function(e){return t.indexOfRawIndex(e)})):t.indexOfRawIndex(e.dataIndex):null!=e.name?EE(e.name)?vE(e.name,(function(e){return t.indexOfName(e)})):t.indexOfName(e.name):void 0}function wP(){var t="__ec_inner_"+AP++;return function(e){return e[t]||(e[t]={})}}var AP=qC();function EP(t,e,i){var n=SP(e,i),r=n.mainTypeSpecified,o=n.queryOptionMap,s=n.others,a=i?i.defaultMainType:null;return!r&&a&&o.set(a,{}),o.each((function(e,n){var r=IP(t,n,e,{useDefault:a===n,enableAll:!i||null==i.enableAll||i.enableAll,enableNone:!i||null==i.enableNone||i.enableNone});s[n+"Models"]=r.models,s[n+"Model"]=r.models[0]})),s}function SP(t,e){var i;if(ME(t)){var n={};n[t+"Index"]=0,i=n}else i=t;var r=YE(),o={},s=!1;return yE(i,(function(t,i){if("dataIndex"!==i&&"dataIndexInside"!==i){var n=i.match(/^(\w+)(Index|Id|Name)$/)||[],a=n[1],l=(n[2]||"").toLowerCase();if(a&&l&&!(e&&e.includeMainTypes&&fE(e.includeMainTypes,a)<0))s=s||!!a,(r.get(a)||r.set(a,{}))[l]=t}else o[i]=t})),{mainTypeSpecified:s,queryOptionMap:r,others:o}}var MP={useDefault:!0,enableAll:!1,enableNone:!1},TP={useDefault:!1,enableAll:!0,enableNone:!0};function IP(t,e,i,n){n=n||MP;var r=i.index,o=i.id,s=i.name,a={models:null,specified:null!=r||null!=o||null!=s};if(!a.specified){var l=void 0;return a.models=n.useDefault&&(l=t.getComponent(e))?[l]:[],a}return"none"===r||!1===r?(UE(n.enableNone,'`"none"` or `false` is not a valid value on index option.'),a.models=[],a):("all"===r&&(UE(n.enableAll,'`"all"` is not a valid value on index option.'),r=o=s=null),a.models=t.queryComponents({mainType:e,index:r,id:o,name:s}),a)}function CP(t,e,i){t.setAttribute?t.setAttribute(e,i):t[e]=i}function PP(t,e){var i=YE(),n=[];return yE(t,(function(t){var r=e(t);(i.get(r)||(n.push(r),i.set(r,[]))).push(t)})),{keys:n,buckets:i}}function LP(t,e,i,n,r){var o=null==e||"auto"===e;if(null==n)return n;if(IE(n))return CC(f=oP(i||0,n,r),o?Math.max(LC(i||0),LC(n)):e);if(ME(n))return r<1?i:n;for(var s=[],a=i,l=n,c=Math.max(a?a.length:0,l.length),u=0;u<c;++u){var h=t.getDimensionInfo(u);if(h&&"ordinal"===h.type)s[u]=(r<1&&a?a:l)[u];else{var p=a&&a[u]?a[u]:0,d=l[u],f=oP(p,d,r);s[u]=CC(f,o?Math.max(LC(p),LC(d)):e)}}return s}var DP=".",RP="___EC__COMPONENT__CONTAINER___",OP="___EC__EXTENDED_CLASS___";function kP(t){var e={main:"",sub:""};if(t){var i=t.split(DP);e.main=i[0]||"",e.sub=i[1]||""}return e}function NP(t,e){t.$constructor=t,t.extend=function(t){"production"!==process.env.NODE_ENV&&yE(e,(function(e){t[e]||console.warn("Method `"+e+"` should be implemented"+(t.type?" in "+t.type:"")+".")}));var i,n,r=this;return SE(n=r)&&/^class\s/.test(Function.prototype.toString.call(n))?i=function(t){function e(){return t.apply(this,arguments)||this}return zA(e,t),e}(r):(i=function(){(t.$constructor||r).apply(this,arguments)},function(t,e){var i=t.prototype;function n(){}for(var r in n.prototype=e.prototype,t.prototype=new n,i)i.hasOwnProperty(r)&&(t.prototype[r]=i[r]);t.prototype.constructor=t,t.superClass=e}(i,this)),pE(i.prototype,t),i[OP]=!0,i.extend=this.extend,i.superCall=FP,i.superApply=VP,i.superClass=r,i}}function BP(t,e){t.extend=e.extend}var zP=Math.round(10*Math.random());function FP(t,e){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];return this.superClass.prototype[e].apply(t,i)}function VP(t,e,i){return this.superClass.prototype[e].apply(t,i)}function UP(t){var e={};t.registerClass=function(t){var i,n=t.type||t.prototype.type;if(n){UE(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(i=n),'componentType "'+i+'" illegal'),t.prototype.type=n;var r=kP(n);if(r.sub){if(r.sub!==RP){var o=function(t){var i=e[t.main];i&&i[RP]||((i=e[t.main]={})[RP]=!0);return i}(r);o[r.sub]=t}}else"production"!==process.env.NODE_ENV&&e[r.main]&&console.warn(r.main+" exists."),e[r.main]=t}return t},t.getClass=function(t,i,n){var r=e[t];if(r&&r[RP]&&(r=i?r[i]:null),n&&!r)throw new Error(i?"Component "+t+"."+(i||"")+" is used but not imported.":t+".type should be specified.");return r},t.getClassesByMainType=function(t){var i=kP(t),n=[],r=e[i.main];return r&&r[RP]?yE(r,(function(t,e){e!==RP&&n.push(t)})):n.push(r),n},t.hasClass=function(t){var i=kP(t);return!!e[i.main]},t.getAllClassMainTypes=function(){var t=[];return yE(e,(function(e,i){t.push(i)})),t},t.hasSubTypes=function(t){var i=kP(t),n=e[i.main];return n&&n[RP]}}function GP(t,e){for(var i=0;i<t.length;i++)t[i][1]||(t[i][1]=t[i][0]);return e=e||!1,function(i,n,r){for(var o={},s=0;s<t.length;s++){var a=t[s][1];if(!(n&&fE(n,a)>=0||r&&fE(r,a)<0)){var l=i.getShallow(a,e);null!=l&&(o[t[s][0]]=l)}}return o}}var jP=GP([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),HP=function(){function t(){}return t.prototype.getAreaStyle=function(t,e){return jP(this,t,e)},t}(),WP=new vT(50);function qP(t){if("string"==typeof t){var e=WP.get(t);return e&&e.image}return t}function XP(t,e,i,n,r){if(t){if("string"==typeof t){if(e&&e.__zrImageSrc===t||!i)return e;var o=WP.get(t),s={hostEl:i,cb:n,cbPayload:r};return o?!YP(e=o.image)&&o.pending.push(s):((e=ZA.loadImage(t,ZP,ZP)).__zrImageSrc=t,WP.put(t,e.__cachedImgObj={image:e,pending:[s]})),e}return t}return e}function ZP(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e<t.pending.length;e++){var i=t.pending[e],n=i.cb;n&&n(this,i.cbPayload),i.hostEl.dirty()}t.pending.length=0}function YP(t){return t&&t.width&&t.height}var QP=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function JP(t,e,i,n,r){if(!e)return"";var o=(t+"").split("\n");r=KP(e,i,n,r);for(var s=0,a=o.length;s<a;s++)o[s]=$P(o[s],r);return o.join("\n")}function KP(t,e,i,n){var r=pE({},n=n||{});r.font=e,i=BE(i,"..."),r.maxIterations=BE(n.maxIterations,2);var o=r.minChar=BE(n.minChar,0);r.cnCharWidth=tC("国",e);var s=r.ascCharWidth=tC("a",e);r.placeholder=BE(n.placeholder,"");for(var a=t=Math.max(0,t-1),l=0;l<o&&a>=s;l++)a-=s;var c=tC(i,e);return c>a&&(i="",c=0),a=t-c,r.ellipsis=i,r.ellipsisWidth=c,r.contentWidth=a,r.containerWidth=t,r}function $P(t,e){var i=e.containerWidth,n=e.font,r=e.contentWidth;if(!i)return"";var o=tC(t,n);if(o<=i)return t;for(var s=0;;s++){if(o<=r||s>=e.maxIterations){t+=e.ellipsis;break}var a=0===s?tL(t,r,e.ascCharWidth,e.cnCharWidth):o>0?Math.floor(t.length*r/o):0;o=tC(t=t.substr(0,a),n)}return""===t&&(t=e.placeholder),t}function tL(t,e,i,n){for(var r=0,o=0,s=t.length;o<s&&r<e;o++){var a=t.charCodeAt(o);r+=0<=a&&a<=127?i:n}return o}var eL=function(){},iL=function(t){this.tokens=[],t&&(this.tokens=t)},nL=function(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[]};function rL(t,e,i,n,r){var o,s,a=""===e,l=r&&i.rich[r]||{},c=t.lines,u=l.font||i.font,h=!1;if(n){var p=l.padding,d=p?p[1]+p[3]:0;if(null!=l.width&&"auto"!==l.width){var f=sC(l.width,n.width)+d;c.length>0&&f+n.accumWidth>n.width&&(o=e.split("\n"),h=!0),n.accumWidth=f}else{var m=aL(e,u,n.width,n.breakAll,n.accumWidth);n.accumWidth=m.accumWidth+d,s=m.linesWidths,o=m.lines}}else o=e.split("\n");for(var g=0;g<o.length;g++){var y=o[g],v=new eL;if(v.styleName=r,v.text=y,v.isLineHolder=!y&&!a,"number"==typeof l.width?v.width=l.width:v.width=s?s[g]:tC(y,u),g||h)c.push(new iL([v]));else{var _=(c[c.length-1]||(c[0]=new iL)).tokens,x=_.length;1===x&&_[0].isLineHolder?_[0]=v:(y||!x||a)&&_.push(v)}}}var oL=_E(",&?/;] ".split(""),(function(t,e){return t[e]=!0,t}),{});function sL(t){return!function(t){var e=t.charCodeAt(0);return e>=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}(t)||!!oL[t]}function aL(t,e,i,n,r){for(var o=[],s=[],a="",l="",c=0,u=0,h=0;h<t.length;h++){var p=t.charAt(h);if("\n"!==p){var d=tC(p,e),f=!n&&!sL(p);(o.length?u+d>i:r+u+d>i)?u?(a||l)&&(f?(a||(a=l,l="",u=c=0),o.push(a),s.push(u-c),l+=p,a="",u=c+=d):(l&&(a+=l,l="",c=0),o.push(a),s.push(u),a=p,u=d)):f?(o.push(l),s.push(c),l=p,c=d):(o.push(p),s.push(d)):(u+=d,f?(l+=p,c+=d):(l&&(a+=l,l="",c=0),a+=p))}else l&&(a+=l,u+=c),o.push(a),s.push(u),a="",l="",c=0,u=0}return o.length||a||(a=t,l="",c=0),l&&(a+=l),a&&(o.push(a),s.push(u)),1===o.length&&(u+=r),{accumWidth:u,lines:o,linesWidths:s}}var lL="__zr_style_"+Math.round(10*Math.random()),cL={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},uL={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};cL[lL]=!0;var hL=["z","z2","invisible"],pL=["invisible"],dL=function(t){function e(e){return t.call(this,e)||this}var i;return zA(e,t),e.prototype._init=function(e){for(var i=bE(e),n=0;n<i.length;n++){var r=i[n];"style"===r?this.useStyle(e[r]):t.prototype.attrKV.call(this,r,e[r])}this.style||this.useStyle({})},e.prototype.beforeBrush=function(){},e.prototype.afterBrush=function(){},e.prototype.innerBeforeBrush=function(){},e.prototype.innerAfterBrush=function(){},e.prototype.shouldBePainted=function(t,e,i,n){var r=this.transform;if(this.ignore||this.invisible||0===this.style.opacity||this.culling&&function(t,e,i){fL.copy(t.getBoundingRect()),t.transform&&fL.applyTransform(t.transform);return mL.width=e,mL.height=i,!fL.intersect(mL)}(this,t,e)||r&&!r[0]&&!r[3])return!1;if(i&&this.__clipPaths)for(var o=0;o<this.__clipPaths.length;++o)if(this.__clipPaths[o].isZeroArea())return!1;if(n&&this.parent)for(var s=this.parent;s;){if(s.ignore)return!1;s=s.parent}return!0},e.prototype.contain=function(t,e){return this.rectContain(t,e)},e.prototype.traverse=function(t,e){t.call(e,this)},e.prototype.rectContain=function(t,e){var i=this.transformCoordToLocal(t,e);return this.getBoundingRect().contain(i[0],i[1])},e.prototype.getPaintRect=function(){var t=this._paintRect;if(!this._paintRect||this.__dirty){var e=this.transform,i=this.getBoundingRect(),n=this.style,r=n.shadowBlur||0,o=n.shadowOffsetX||0,s=n.shadowOffsetY||0;t=this._paintRect||(this._paintRect=new pM(0,0,0,0)),e?pM.applyTransform(t,i,e):t.copy(i),(r||o||s)&&(t.width+=2*r+Math.abs(o),t.height+=2*r+Math.abs(s),t.x=Math.min(t.x,t.x+o-r),t.y=Math.min(t.y,t.y+s-r));var a=this.dirtyRectTolerance;t.isZero()||(t.x=Math.floor(t.x-a),t.y=Math.floor(t.y-a),t.width=Math.ceil(t.width+1+2*a),t.height=Math.ceil(t.height+1+2*a))}return t},e.prototype.setPrevPaintRect=function(t){t?(this._prevPaintRect=this._prevPaintRect||new pM(0,0,0,0),this._prevPaintRect.copy(t)):this._prevPaintRect=null},e.prototype.getPrevPaintRect=function(){return this._prevPaintRect},e.prototype.animateStyle=function(t){return this.animate("style",t)},e.prototype.updateDuringAnimation=function(t){"style"===t?this.dirtyStyle():this.markRedraw()},e.prototype.attrKV=function(e,i){"style"!==e?t.prototype.attrKV.call(this,e,i):this.style?this.setStyle(i):this.useStyle(i)},e.prototype.setStyle=function(t,e){return"string"==typeof t?this.style[t]=e:pE(this.style,t),this.dirtyStyle(),this},e.prototype.dirtyStyle=function(t){t||this.markRedraw(),this.__dirty|=2,this._rect&&(this._rect=null)},e.prototype.dirty=function(){this.dirtyStyle()},e.prototype.styleChanged=function(){return!!(2&this.__dirty)},e.prototype.styleUpdated=function(){this.__dirty&=-3},e.prototype.createStyle=function(t){return JE(cL,t)},e.prototype.useStyle=function(t){t[lL]||(t=this.createStyle(t)),this.__inHover?this.__hoverStyle=t:this.style=t,this.dirtyStyle()},e.prototype.isStyleObject=function(t){return t[lL]},e.prototype._innerSaveToNormal=function(e){t.prototype._innerSaveToNormal.call(this,e);var i=this._normalState;e.style&&!i.style&&(i.style=this._mergeStyle(this.createStyle(),this.style)),this._savePrimaryToNormal(e,i,hL)},e.prototype._applyStateObj=function(e,i,n,r,o,s){t.prototype._applyStateObj.call(this,e,i,n,r,o,s);var a,l=!(i&&r);if(i&&i.style?o?r?a=i.style:(a=this._mergeStyle(this.createStyle(),n.style),this._mergeStyle(a,i.style)):(a=this._mergeStyle(this.createStyle(),r?this.style:n.style),this._mergeStyle(a,i.style)):l&&(a=n.style),a)if(o){var c=this.style;if(this.style=this.createStyle(l?{}:c),l)for(var u=bE(c),h=0;h<u.length;h++){(d=u[h])in a&&(a[d]=a[d],this.style[d]=c[d])}var p=bE(a);for(h=0;h<p.length;h++){var d=p[h];this.style[d]=this.style[d]}this._transitionState(e,{style:a},s,this.getAnimationStyleProps())}else this.useStyle(a);var f=this.__inHover?pL:hL;for(h=0;h<f.length;h++){d=f[h];i&&null!=i[d]?this[d]=i[d]:l&&null!=n[d]&&(this[d]=n[d])}},e.prototype._mergeStates=function(e){for(var i,n=t.prototype._mergeStates.call(this,e),r=0;r<e.length;r++){var o=e[r];o.style&&(i=i||{},this._mergeStyle(i,o.style))}return i&&(n.style=i),n},e.prototype._mergeStyle=function(t,e){return pE(t,e),t},e.prototype.getAnimationStyleProps=function(){return uL},e.initDefaultProps=((i=e.prototype).type="displayable",i.invisible=!1,i.z=0,i.z2=0,i.zlevel=0,i.culling=!1,i.cursor="pointer",i.rectHover=!1,i.incremental=!1,i._rect=null,i.dirtyRectTolerance=0,void(i.__dirty=2|DM)),e}(vC),fL=new pM(0,0,0,0),mL=new pM(0,0,0,0);var gL=dL,yL=Math.min,vL=Math.max,_L=Math.sin,xL=Math.cos,bL=2*Math.PI,wL=iS(),AL=iS(),EL=iS();function SL(t,e,i){if(0!==t.length){for(var n=t[0],r=n[0],o=n[0],s=n[1],a=n[1],l=1;l<t.length;l++)n=t[l],r=yL(r,n[0]),o=vL(o,n[0]),s=yL(s,n[1]),a=vL(a,n[1]);e[0]=r,e[1]=s,i[0]=o,i[1]=a}}function ML(t,e,i,n,r,o){r[0]=yL(t,i),r[1]=yL(e,n),o[0]=vL(t,i),o[1]=vL(e,n)}var TL=[],IL=[];function CL(t,e,i,n,r,o,s,a,l,c){var u=iT,h=$M,p=u(t,i,r,s,TL);l[0]=1/0,l[1]=1/0,c[0]=-1/0,c[1]=-1/0;for(var d=0;d<p;d++){var f=h(t,i,r,s,TL[d]);l[0]=yL(f,l[0]),c[0]=vL(f,c[0])}p=u(e,n,o,a,IL);for(d=0;d<p;d++){var m=h(e,n,o,a,IL[d]);l[1]=yL(m,l[1]),c[1]=vL(m,c[1])}l[0]=yL(t,l[0]),c[0]=vL(t,c[0]),l[0]=yL(s,l[0]),c[0]=vL(s,c[0]),l[1]=yL(e,l[1]),c[1]=vL(e,c[1]),l[1]=yL(a,l[1]),c[1]=vL(a,c[1])}function PL(t,e,i,n,r,o,s,a){var l=lT,c=sT,u=vL(yL(l(t,i,r),1),0),h=vL(yL(l(e,n,o),1),0),p=c(t,i,r,u),d=c(e,n,o,h);s[0]=yL(t,r,p),s[1]=yL(e,o,d),a[0]=vL(t,r,p),a[1]=vL(e,o,d)}function LL(t,e,i,n,r,o,s,a,l){var c=yS,u=vS,h=Math.abs(r-o);if(h%bL<1e-4&&h>1e-4)return a[0]=t-i,a[1]=e-n,l[0]=t+i,void(l[1]=e+n);if(wL[0]=xL(r)*i+t,wL[1]=_L(r)*n+e,AL[0]=xL(o)*i+t,AL[1]=_L(o)*n+e,c(a,wL,AL),u(l,wL,AL),(r%=bL)<0&&(r+=bL),(o%=bL)<0&&(o+=bL),r>o&&!s?o+=bL:r<o&&s&&(r+=bL),s){var p=o;o=r,r=p}for(var d=0;d<o;d+=Math.PI/2)d>r&&(EL[0]=xL(d)*i+t,EL[1]=_L(d)*n+e,c(a,EL,a),u(l,EL,l))}var DL={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},RL=[],OL=[],kL=[],NL=[],BL=[],zL=[],FL=Math.min,VL=Math.max,UL=Math.cos,jL=Math.sin,HL=Math.abs,WL=Math.PI,qL=2*WL,XL="undefined"!=typeof Float32Array,ZL=[];function YL(t){return Math.round(t/WL*1e8)/1e8%2*WL}function QL(t,e){var i=YL(t[0]);i<0&&(i+=qL);var n=i-t[0],r=t[1];r+=n,!e&&r-i>=qL?r=i+qL:e&&i-r>=qL?r=i-qL:!e&&i>r?r=i+(qL-YL(i-r)):e&&i<r&&(r=i-(qL-YL(r-i))),t[0]=i,t[1]=r}var JL=function(){function t(t){this.dpr=1,this._xi=0,this._yi=0,this._x0=0,this._y0=0,this._len=0,t&&(this._saveData=!1),this._saveData&&(this.data=[])}return t.prototype.increaseVersion=function(){this._version++},t.prototype.getVersion=function(){return this._version},t.prototype.setScale=function(t,e,i){(i=i||0)>0&&(this._ux=HL(i/FI/t)||0,this._uy=HL(i/FI/e)||0)},t.prototype.setDPR=function(t){this.dpr=t},t.prototype.setContext=function(t){this._ctx=t},t.prototype.getContext=function(){return this._ctx},t.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},t.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(t,e){return this._drawPendingPt(),this.addData(DL.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},t.prototype.lineTo=function(t,e){var i=HL(t-this._xi),n=HL(e-this._yi),r=i>this._ux||n>this._uy;if(this.addData(DL.L,t,e),this._ctx&&r&&this._ctx.lineTo(t,e),r)this._xi=t,this._yi=e,this._pendingPtDist=0;else{var o=i*i+n*n;o>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=e,this._pendingPtDist=o)}return this},t.prototype.bezierCurveTo=function(t,e,i,n,r,o){return this._drawPendingPt(),this.addData(DL.C,t,e,i,n,r,o),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,r,o),this._xi=r,this._yi=o,this},t.prototype.quadraticCurveTo=function(t,e,i,n){return this._drawPendingPt(),this.addData(DL.Q,t,e,i,n),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this._xi=i,this._yi=n,this},t.prototype.arc=function(t,e,i,n,r,o){this._drawPendingPt(),ZL[0]=n,ZL[1]=r,QL(ZL,o),n=ZL[0];var s=(r=ZL[1])-n;return this.addData(DL.A,t,e,i,i,n,s,0,o?0:1),this._ctx&&this._ctx.arc(t,e,i,n,r,o),this._xi=UL(r)*i+t,this._yi=jL(r)*i+e,this},t.prototype.arcTo=function(t,e,i,n,r){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(t,e,i,n,r),this},t.prototype.rect=function(t,e,i,n){return this._drawPendingPt(),this._ctx&&this._ctx.rect(t,e,i,n),this.addData(DL.R,t,e,i,n),this},t.prototype.closePath=function(){this._drawPendingPt(),this.addData(DL.Z);var t=this._ctx,e=this._x0,i=this._y0;return t&&t.closePath(),this._xi=e,this._yi=i,this},t.prototype.fill=function(t){t&&t.fill(),this.toStatic()},t.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},t.prototype.len=function(){return this._len},t.prototype.setData=function(t){var e=t.length;this.data&&this.data.length===e||!XL||(this.data=new Float32Array(e));for(var i=0;i<e;i++)this.data[i]=t[i];this._len=e},t.prototype.appendPath=function(t){t instanceof Array||(t=[t]);for(var e=t.length,i=0,n=this._len,r=0;r<e;r++)i+=t[r].len();XL&&this.data instanceof Float32Array&&(this.data=new Float32Array(n+i));for(r=0;r<e;r++)for(var o=t[r].data,s=0;s<o.length;s++)this.data[n++]=o[s];this._len=n},t.prototype.addData=function(t,e,i,n,r,o,s,a,l){if(this._saveData){var c=this.data;this._len+arguments.length>c.length&&(this._expandData(),c=this.data);for(var u=0;u<arguments.length;u++)c[this._len++]=arguments[u]}},t.prototype._drawPendingPt=function(){this._pendingPtDist>0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e<this._len;e++)t[e]=this.data[e];this.data=t}},t.prototype.toStatic=function(){if(this._saveData){this._drawPendingPt();var t=this.data;t instanceof Array&&(t.length=this._len,XL&&this._len>11&&(this.data=new Float32Array(t)))}},t.prototype.getBoundingRect=function(){kL[0]=kL[1]=BL[0]=BL[1]=Number.MAX_VALUE,NL[0]=NL[1]=zL[0]=zL[1]=-Number.MAX_VALUE;var t,e=this.data,i=0,n=0,r=0,o=0;for(t=0;t<this._len;){var s=e[t++],a=1===t;switch(a&&(r=i=e[t],o=n=e[t+1]),s){case DL.M:i=r=e[t++],n=o=e[t++],BL[0]=r,BL[1]=o,zL[0]=r,zL[1]=o;break;case DL.L:ML(i,n,e[t],e[t+1],BL,zL),i=e[t++],n=e[t++];break;case DL.C:CL(i,n,e[t++],e[t++],e[t++],e[t++],e[t],e[t+1],BL,zL),i=e[t++],n=e[t++];break;case DL.Q:PL(i,n,e[t++],e[t++],e[t],e[t+1],BL,zL),i=e[t++],n=e[t++];break;case DL.A:var l=e[t++],c=e[t++],u=e[t++],h=e[t++],p=e[t++],d=e[t++]+p;t+=1;var f=!e[t++];a&&(r=UL(p)*u+l,o=jL(p)*h+c),LL(l,c,u,h,p,d,f,BL,zL),i=UL(d)*u+l,n=jL(d)*h+c;break;case DL.R:ML(r=i=e[t++],o=n=e[t++],r+e[t++],o+e[t++],BL,zL);break;case DL.Z:i=r,n=o}yS(kL,kL,BL),vS(NL,NL,zL)}return 0===t&&(kL[0]=kL[1]=NL[0]=NL[1]=0),new pM(kL[0],kL[1],NL[0]-kL[0],NL[1]-kL[1])},t.prototype._calculateLength=function(){var t=this.data,e=this._len,i=this._ux,n=this._uy,r=0,o=0,s=0,a=0;this._pathSegLen||(this._pathSegLen=[]);for(var l=this._pathSegLen,c=0,u=0,h=0;h<e;){var p=t[h++],d=1===h;d&&(s=r=t[h],a=o=t[h+1]);var f=-1;switch(p){case DL.M:r=s=t[h++],o=a=t[h++];break;case DL.L:var m=t[h++],g=(_=t[h++])-o;(HL(C=m-r)>i||HL(g)>n||h===e-1)&&(f=Math.sqrt(C*C+g*g),r=m,o=_);break;case DL.C:var y=t[h++],v=t[h++],_=(m=t[h++],t[h++]),x=t[h++],b=t[h++];f=oT(r,o,y,v,m,_,x,b,10),r=x,o=b;break;case DL.Q:f=hT(r,o,y=t[h++],v=t[h++],m=t[h++],_=t[h++],10),r=m,o=_;break;case DL.A:var w=t[h++],A=t[h++],E=t[h++],S=t[h++],M=t[h++],T=t[h++],I=T+M;h+=1,t[h++],d&&(s=UL(M)*E+w,a=jL(M)*S+A),f=VL(E,S)*FL(qL,Math.abs(T)),r=UL(I)*E+w,o=jL(I)*S+A;break;case DL.R:s=r=t[h++],a=o=t[h++],f=2*t[h++]+2*t[h++];break;case DL.Z:var C=s-r;g=a-o;f=Math.sqrt(C*C+g*g),r=s,o=a}f>=0&&(l[u++]=f,c+=f)}return this._pathLen=c,c},t.prototype.rebuildPath=function(t,e){var i,n,r,o,s,a,l,c,u,h,p=this.data,d=this._ux,f=this._uy,m=this._len,g=e<1,y=0,v=0,_=0;if(!g||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,c=e*this._pathLen))t:for(var x=0;x<m;){var b=p[x++],w=1===x;switch(w&&(i=r=p[x],n=o=p[x+1]),b!==DL.L&&_>0&&(t.lineTo(u,h),_=0),b){case DL.M:i=r=p[x++],n=o=p[x++],t.moveTo(r,o);break;case DL.L:s=p[x++],a=p[x++];var A=HL(s-r),E=HL(a-o);if(A>d||E>f){if(g){if(y+(Z=l[v++])>c){var S=(c-y)/Z;t.lineTo(r*(1-S)+s*S,o*(1-S)+a*S);break t}y+=Z}t.lineTo(s,a),r=s,o=a,_=0}else{var M=A*A+E*E;M>_&&(u=s,h=a,_=M)}break;case DL.C:var T=p[x++],I=p[x++],C=p[x++],P=p[x++],L=p[x++],D=p[x++];if(g){if(y+(Z=l[v++])>c){nT(r,T,C,L,S=(c-y)/Z,RL),nT(o,I,P,D,S,OL),t.bezierCurveTo(RL[1],OL[1],RL[2],OL[2],RL[3],OL[3]);break t}y+=Z}t.bezierCurveTo(T,I,C,P,L,D),r=L,o=D;break;case DL.Q:T=p[x++],I=p[x++],C=p[x++],P=p[x++];if(g){if(y+(Z=l[v++])>c){cT(r,T,C,S=(c-y)/Z,RL),cT(o,I,P,S,OL),t.quadraticCurveTo(RL[1],OL[1],RL[2],OL[2]);break t}y+=Z}t.quadraticCurveTo(T,I,C,P),r=C,o=P;break;case DL.A:var R=p[x++],O=p[x++],k=p[x++],N=p[x++],B=p[x++],z=p[x++],F=p[x++],V=!p[x++],U=k>N?k:N,G=HL(k-N)>.001,j=B+z,H=!1;if(g)y+(Z=l[v++])>c&&(j=B+z*(c-y)/Z,H=!0),y+=Z;if(G&&t.ellipse?t.ellipse(R,O,k,N,F,B,j,V):t.arc(R,O,U,B,j,V),H)break t;w&&(i=UL(B)*k+R,n=jL(B)*N+O),r=UL(j)*k+R,o=jL(j)*N+O;break;case DL.R:i=r=p[x],n=o=p[x+1],s=p[x++],a=p[x++];var W=p[x++],q=p[x++];if(g){if(y+(Z=l[v++])>c){var X=c-y;t.moveTo(s,a),t.lineTo(s+FL(X,W),a),(X-=W)>0&&t.lineTo(s+W,a+FL(X,q)),(X-=q)>0&&t.lineTo(s+VL(W-X,0),a+q),(X-=W)>0&&t.lineTo(s,a+VL(q-X,0));break t}y+=Z}t.rect(s,a,W,q);break;case DL.Z:if(g){var Z;if(y+(Z=l[v++])>c){S=(c-y)/Z;t.lineTo(r*(1-S)+i*S,o*(1-S)+n*S);break t}y+=Z}t.closePath(),r=i,o=n}}},t.prototype.clone=function(){var e=new t,i=this.data;return e.data=i.slice?i.slice():Array.prototype.slice.call(i),e._len=this._len,e},t.CMD=DL,t.initDefaultProps=function(){var e=t.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),t}(),KL=JL;function $L(t,e,i,n,r,o,s){if(0===r)return!1;var a=r,l=0;if(s>e+a&&s>n+a||s<e-a&&s<n-a||o>t+a&&o>i+a||o<t-a&&o<i-a)return!1;if(t===i)return Math.abs(o-t)<=a/2;var c=(l=(e-n)/(t-i))*o-s+(t*n-i*e)/(t-i);return c*c/(l*l+1)<=a/2*a/2}function tD(t,e,i,n,r,o,s,a,l,c,u){if(0===l)return!1;var h=l;return!(u>e+h&&u>n+h&&u>o+h&&u>a+h||u<e-h&&u<n-h&&u<o-h&&u<a-h||c>t+h&&c>i+h&&c>r+h&&c>s+h||c<t-h&&c<i-h&&c<r-h&&c<s-h)&&rT(t,e,i,n,r,o,s,a,c,u,null)<=h/2}function eD(t,e,i,n,r,o,s,a,l){if(0===s)return!1;var c=s;return!(l>e+c&&l>n+c&&l>o+c||l<e-c&&l<n-c&&l<o-c||a>t+c&&a>i+c&&a>r+c||a<t-c&&a<i-c&&a<r-c)&&uT(t,e,i,n,r,o,a,l,null)<=c/2}var iD=2*Math.PI;function nD(t){return(t%=iD)<0&&(t+=iD),t}var rD=2*Math.PI;function oD(t,e,i,n,r,o,s,a,l){if(0===s)return!1;var c=s;a-=t,l-=e;var u=Math.sqrt(a*a+l*l);if(u-c>i||u+c<i)return!1;if(Math.abs(n-r)%rD<1e-4)return!0;if(o){var h=n;n=nD(r),r=nD(h)}else n=nD(n),r=nD(r);n>r&&(r+=rD);var p=Math.atan2(l,a);return p<0&&(p+=rD),p>=n&&p<=r||p+rD>=n&&p+rD<=r}function sD(t,e,i,n,r,o){if(o>e&&o>n||o<e&&o<n)return 0;if(n===e)return 0;var s=(o-e)/(n-e),a=n<e?1:-1;1!==s&&0!==s||(a=n<e?.5:-.5);var l=s*(i-t)+t;return l===r?1/0:l>r?a:0}var aD=KL.CMD,lD=2*Math.PI,cD=1e-4;var uD=[-1,-1,-1],hD=[-1,-1];function pD(t,e,i,n,r,o,s,a,l,c){if(c>e&&c>n&&c>o&&c>a||c<e&&c<n&&c<o&&c<a)return 0;var u,h=eT(e,n,o,a,c,uD);if(0===h)return 0;for(var p=0,d=-1,f=void 0,m=void 0,g=0;g<h;g++){var y=uD[g],v=0===y||1===y?.5:1;$M(t,i,r,s,y)<l||(d<0&&(d=iT(e,n,o,a,hD),hD[1]<hD[0]&&d>1&&(u=void 0,u=hD[0],hD[0]=hD[1],hD[1]=u),f=$M(e,n,o,a,hD[0]),d>1&&(m=$M(e,n,o,a,hD[1]))),2===d?y<hD[0]?p+=f<e?v:-v:y<hD[1]?p+=m<f?v:-v:p+=a<m?v:-v:y<hD[0]?p+=f<e?v:-v:p+=a<f?v:-v)}return p}function dD(t,e,i,n,r,o,s,a){if(a>e&&a>n&&a>o||a<e&&a<n&&a<o)return 0;var l=function(t,e,i,n,r){var o=t-2*e+i,s=2*(e-t),a=t-n,l=0;if(JM(o))KM(s)&&(u=-a/s)>=0&&u<=1&&(r[l++]=u);else{var c=s*s-4*o*a;if(JM(c))(u=-s/(2*o))>=0&&u<=1&&(r[l++]=u);else if(c>0){var u,h=jM(c),p=(-s-h)/(2*o);(u=(-s+h)/(2*o))>=0&&u<=1&&(r[l++]=u),p>=0&&p<=1&&(r[l++]=p)}}return l}(e,n,o,a,uD);if(0===l)return 0;var c=lT(e,n,o);if(c>=0&&c<=1){for(var u=0,h=sT(e,n,o,c),p=0;p<l;p++){var d=0===uD[p]||1===uD[p]?.5:1;sT(t,i,r,uD[p])<s||(uD[p]<c?u+=h<e?d:-d:u+=o<h?d:-d)}return u}d=0===uD[0]||1===uD[0]?.5:1;return sT(t,i,r,uD[0])<s?0:o<e?d:-d}function fD(t,e,i,n,r,o,s,a){if((a-=e)>i||a<-i)return 0;var l=Math.sqrt(i*i-a*a);uD[0]=-l,uD[1]=l;var c=Math.abs(n-r);if(c<1e-4)return 0;if(c>=lD-1e-4){n=0,r=lD;var u=o?1:-1;return s>=uD[0]+t&&s<=uD[1]+t?u:0}if(n>r){var h=n;n=r,r=h}n<0&&(n+=lD,r+=lD);for(var p=0,d=0;d<2;d++){var f=uD[d];if(f+t>s){var m=Math.atan2(a,f);u=o?1:-1;m<0&&(m=lD+m),(m>=n&&m<=r||m+lD>=n&&m+lD<=r)&&(m>Math.PI/2&&m<1.5*Math.PI&&(u=-u),p+=u)}}return p}function mD(t,e,i,n,r){for(var o,s,a=t.data,l=t.len(),c=0,u=0,h=0,p=0,d=0,f=0;f<l;){var m=a[f++],g=1===f;switch(m===aD.M&&f>1&&(i||(c+=sD(u,h,p,d,n,r))),g&&(p=u=a[f],d=h=a[f+1]),m){case aD.M:u=p=a[f++],h=d=a[f++];break;case aD.L:if(i){if($L(u,h,a[f],a[f+1],e,n,r))return!0}else c+=sD(u,h,a[f],a[f+1],n,r)||0;u=a[f++],h=a[f++];break;case aD.C:if(i){if(tD(u,h,a[f++],a[f++],a[f++],a[f++],a[f],a[f+1],e,n,r))return!0}else c+=pD(u,h,a[f++],a[f++],a[f++],a[f++],a[f],a[f+1],n,r)||0;u=a[f++],h=a[f++];break;case aD.Q:if(i){if(eD(u,h,a[f++],a[f++],a[f],a[f+1],e,n,r))return!0}else c+=dD(u,h,a[f++],a[f++],a[f],a[f+1],n,r)||0;u=a[f++],h=a[f++];break;case aD.A:var y=a[f++],v=a[f++],_=a[f++],x=a[f++],b=a[f++],w=a[f++];f+=1;var A=!!(1-a[f++]);o=Math.cos(b)*_+y,s=Math.sin(b)*x+v,g?(p=o,d=s):c+=sD(u,h,o,s,n,r);var E=(n-y)*x/_+y;if(i){if(oD(y,v,x,b,b+w,A,e,E,r))return!0}else c+=fD(y,v,x,b,b+w,A,E,r);u=Math.cos(b+w)*_+y,h=Math.sin(b+w)*x+v;break;case aD.R:if(p=u=a[f++],d=h=a[f++],o=p+a[f++],s=d+a[f++],i){if($L(p,d,o,d,e,n,r)||$L(o,d,o,s,e,n,r)||$L(o,s,p,s,e,n,r)||$L(p,s,p,d,e,n,r))return!0}else c+=sD(o,d,o,s,n,r),c+=sD(p,s,p,d,n,r);break;case aD.Z:if(i){if($L(u,h,p,d,e,n,r))return!0}else c+=sD(u,h,p,d,n,r);u=p,h=d}}return i||function(t,e){return Math.abs(t-e)<cD}(h,d)||(c+=sD(u,h,p,d,n,r)||0),0!==c}var gD=dE({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},cL),yD={style:dE({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},uL.style)},vD=QI.concat(["invisible","culling","z","z2","zlevel","parent"]),_D=function(t){function e(e){return t.call(this,e)||this}var i;return zA(e,t),e.prototype.update=function(){var i=this;t.prototype.update.call(this);var n=this.style;if(n.decal){var r=this._decalEl=this._decalEl||new e;r.buildPath===e.prototype.buildPath&&(r.buildPath=function(t){i.buildPath(t,i.shape)}),r.silent=!0;var o=r.style;for(var s in n)o[s]!==n[s]&&(o[s]=n[s]);o.fill=n.fill?n.decal:null,o.decal=null,o.shadowColor=null,n.strokeFirst&&(o.stroke=null);for(var a=0;a<vD.length;++a)r[vD[a]]=this[vD[a]];r.__dirty|=DM}else this._decalEl&&(this._decalEl=null)},e.prototype.getDecalElement=function(){return this._decalEl},e.prototype._init=function(e){var i=bE(e);this.shape=this.getDefaultShape();var n=this.getDefaultStyle();n&&this.useStyle(n);for(var r=0;r<i.length;r++){var o=i[r],s=e[o];"style"===o?this.style?pE(this.style,s):this.useStyle(s):"shape"===o?pE(this.shape,s):t.prototype.attrKV.call(this,o,s)}this.style||this.useStyle({})},e.prototype.getDefaultStyle=function(){return null},e.prototype.getDefaultShape=function(){return{}},e.prototype.canBeInsideText=function(){return this.hasFill()},e.prototype.getInsideTextFill=function(){var t=this.style.fill;if("none"!==t){if(ME(t)){var e=zT(t,0);return e>.5?VI:e>.2?"#eee":UI}if(t)return UI}return VI},e.prototype.getInsideTextStroke=function(t){var e=this.style.fill;if(ME(e)){var i=this.__zr;if(!(!i||!i.isDarkMode())===zT(t,0)<.4)return e}},e.prototype.buildPath=function(t,e,i){},e.prototype.pathUpdated=function(){this.__dirty&=~RM},e.prototype.getUpdatedPathProxy=function(t){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,t),this.path},e.prototype.createPathProxy=function(){this.path=new KL(!1)},e.prototype.hasStroke=function(){var t=this.style,e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))},e.prototype.hasFill=function(){var t=this.style.fill;return null!=t&&"none"!==t},e.prototype.getBoundingRect=function(){var t=this._rect,e=this.style,i=!t;if(i){var n=!1;this.path||(n=!0,this.createPathProxy());var r=this.path;(n||this.__dirty&RM)&&(r.beginPath(),this.buildPath(r,this.shape,!1),this.pathUpdated()),t=r.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var o=this._rectStroke||(this._rectStroke=t.clone());if(this.__dirty||i){o.copy(t);var s=e.strokeNoScale?this.getLineScale():1,a=e.lineWidth;if(!this.hasFill()){var l=this.strokeContainThreshold;a=Math.max(a,null==l?4:l)}s>1e-10&&(o.width+=a/s,o.height+=a/s,o.x-=a/s/2,o.y-=a/s/2)}return o}return t},e.prototype.contain=function(t,e){var i=this.transformCoordToLocal(t,e),n=this.getBoundingRect(),r=this.style;if(t=i[0],e=i[1],n.contain(t,e)){var o=this.path;if(this.hasStroke()){var s=r.lineWidth,a=r.strokeNoScale?this.getLineScale():1;if(a>1e-10&&(this.hasFill()||(s=Math.max(s,this.strokeContainThreshold)),function(t,e,i,n){return mD(t,e,!0,i,n)}(o,s/a,t,e)))return!0}if(this.hasFill())return function(t,e,i){return mD(t,0,!1,e,i)}(o,t,e)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=RM,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(t){return this.animate("shape",t)},e.prototype.updateDuringAnimation=function(t){"style"===t?this.dirtyStyle():"shape"===t?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(e,i){"shape"===e?this.setShape(i):t.prototype.attrKV.call(this,e,i)},e.prototype.setShape=function(t,e){var i=this.shape;return i||(i=this.shape={}),"string"==typeof t?i[t]=e:pE(i,t),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&RM)},e.prototype.createStyle=function(t){return JE(gD,t)},e.prototype._innerSaveToNormal=function(e){t.prototype._innerSaveToNormal.call(this,e);var i=this._normalState;e.shape&&!i.shape&&(i.shape=pE({},this.shape))},e.prototype._applyStateObj=function(e,i,n,r,o,s){t.prototype._applyStateObj.call(this,e,i,n,r,o,s);var a,l=!(i&&r);if(i&&i.shape?o?r?a=i.shape:(a=pE({},n.shape),pE(a,i.shape)):(a=pE({},r?this.shape:n.shape),pE(a,i.shape)):l&&(a=n.shape),a)if(o){this.shape=pE({},this.shape);for(var c={},u=bE(a),h=0;h<u.length;h++){var p=u[h];"object"==typeof a[p]?this.shape[p]=a[p]:c[p]=a[p]}this._transitionState(e,{shape:c},s)}else this.shape=a,this.dirtyShape()},e.prototype._mergeStates=function(e){for(var i,n=t.prototype._mergeStates.call(this,e),r=0;r<e.length;r++){var o=e[r];o.shape&&(i=i||{},this._mergeStyle(i,o.shape))}return i&&(n.shape=i),n},e.prototype.getAnimationStyleProps=function(){return yD},e.prototype.isZeroArea=function(){return!1},e.extend=function(t){var i=function(e){function i(i){var n=e.call(this,i)||this;return t.init&&t.init.call(n,i),n}return zA(i,e),i.prototype.getDefaultStyle=function(){return cE(t.style)},i.prototype.getDefaultShape=function(){return cE(t.shape)},i}(e);for(var n in t)"function"==typeof t[n]&&(i.prototype[n]=t[n]);return i},e.initDefaultProps=((i=e.prototype).type="path",i.strokeContainThreshold=5,i.segmentIgnoreThreshold=0,i.subPixelOptimize=!1,i.autoBatch=!1,void(i.__dirty=2|DM|RM)),e}(gL),xD=_D,bD=dE({strokeFirst:!0,font:HA,x:0,y:0,textAlign:"left",textBaseline:"top",miterLimit:2},gD),wD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return zA(e,t),e.prototype.hasStroke=function(){var t=this.style,e=t.stroke;return null!=e&&"none"!==e&&t.lineWidth>0},e.prototype.hasFill=function(){var t=this.style.fill;return null!=t&&"none"!==t},e.prototype.createStyle=function(t){return JE(bD,t)},e.prototype.setBoundingRect=function(t){this._rect=t},e.prototype.getBoundingRect=function(){var t=this.style;if(!this._rect){var e=t.text;null!=e?e+="":e="";var i=iC(e,t.font,t.textAlign,t.textBaseline);if(i.x+=t.x||0,i.y+=t.y||0,this.hasStroke()){var n=t.lineWidth;i.x-=n/2,i.y-=n/2,i.width+=n,i.height+=n}this._rect=i}return this._rect},e.initDefaultProps=void(e.prototype.dirtyRectTolerance=10),e}(gL);wD.prototype.type="tspan";var AD=wD,ED=dE({x:0,y:0},cL),SD={style:dE({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},uL.style)};var MD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return zA(e,t),e.prototype.createStyle=function(t){return JE(ED,t)},e.prototype._getSize=function(t){var e=this.style,i=e[t];if(null!=i)return i;var n,r=(n=e.image)&&"string"!=typeof n&&n.width&&n.height?e.image:this.__image;if(!r)return 0;var o="width"===t?"height":"width",s=e[o];return null==s?r[t]:r[t]/r[o]*s},e.prototype.getWidth=function(){return this._getSize("width")},e.prototype.getHeight=function(){return this._getSize("height")},e.prototype.getAnimationStyleProps=function(){return SD},e.prototype.getBoundingRect=function(){var t=this.style;return this._rect||(this._rect=new pM(t.x||0,t.y||0,this.getWidth(),this.getHeight())),this._rect},e}(gL);MD.prototype.type="image";var TD=MD;var ID=Math.round;function CD(t,e,i){if(e){var n=e.x1,r=e.x2,o=e.y1,s=e.y2;t.x1=n,t.x2=r,t.y1=o,t.y2=s;var a=i&&i.lineWidth;return a?(ID(2*n)===ID(2*r)&&(t.x1=t.x2=LD(n,a,!0)),ID(2*o)===ID(2*s)&&(t.y1=t.y2=LD(o,a,!0)),t):t}}function PD(t,e,i){if(e){var n=e.x,r=e.y,o=e.width,s=e.height;t.x=n,t.y=r,t.width=o,t.height=s;var a=i&&i.lineWidth;return a?(t.x=LD(n,a,!0),t.y=LD(r,a,!0),t.width=Math.max(LD(n+o,a,!1)-t.x,0===o?0:1),t.height=Math.max(LD(r+s,a,!1)-t.y,0===s?0:1),t):t}}function LD(t,e,i){if(!e)return t;var n=ID(2*t);return(n+ID(e))%2==0?n/2:(n+(i?1:-1))/2}var DD=function(){this.x=0,this.y=0,this.width=0,this.height=0},RD={},OD=function(t){function e(e){return t.call(this,e)||this}return zA(e,t),e.prototype.getDefaultShape=function(){return new DD},e.prototype.buildPath=function(t,e){var i,n,r,o;if(this.subPixelOptimize){var s=PD(RD,e,this.style);i=s.x,n=s.y,r=s.width,o=s.height,s.r=e.r,e=s}else i=e.x,n=e.y,r=e.width,o=e.height;e.r?function(t,e){var i,n,r,o,s,a=e.x,l=e.y,c=e.width,u=e.height,h=e.r;c<0&&(a+=c,c=-c),u<0&&(l+=u,u=-u),"number"==typeof h?i=n=r=o=h:h instanceof Array?1===h.length?i=n=r=o=h[0]:2===h.length?(i=r=h[0],n=o=h[1]):3===h.length?(i=h[0],n=o=h[1],r=h[2]):(i=h[0],n=h[1],r=h[2],o=h[3]):i=n=r=o=0,i+n>c&&(i*=c/(s=i+n),n*=c/s),r+o>c&&(r*=c/(s=r+o),o*=c/s),n+r>u&&(n*=u/(s=n+r),r*=u/s),i+o>u&&(i*=u/(s=i+o),o*=u/s),t.moveTo(a+i,l),t.lineTo(a+c-n,l),0!==n&&t.arc(a+c-n,l+n,n,-Math.PI/2,0),t.lineTo(a+c,l+u-r),0!==r&&t.arc(a+c-r,l+u-r,r,0,Math.PI/2),t.lineTo(a+o,l+u),0!==o&&t.arc(a+o,l+u-o,o,Math.PI/2,Math.PI),t.lineTo(a,l+i),0!==i&&t.arc(a+i,l+i,i,Math.PI,1.5*Math.PI)}(t,e):t.rect(i,n,r,o)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(xD);OD.prototype.type="rect";var kD=OD,ND={fill:"#000"},BD={style:dE({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},uL.style)},zD=function(t){function e(e){var i=t.call(this)||this;return i.type="text",i._children=[],i._defaultStyle=ND,i.attr(e),i}return zA(e,t),e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){t.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var e=0;e<this._children.length;e++){var i=this._children[e];i.zlevel=this.zlevel,i.z=this.z,i.z2=this.z2,i.culling=this.culling,i.cursor=this.cursor,i.invisible=this.invisible}},e.prototype.updateTransform=function(){var e=this.innerTransformable;e?(e.updateTransform(),e.transform&&(this.transform=e.transform)):t.prototype.updateTransform.call(this)},e.prototype.getLocalTransform=function(e){var i=this.innerTransformable;return i?i.getLocalTransform(e):t.prototype.getLocalTransform.call(this,e)},e.prototype.getComputedTransform=function(){return this.__hostTarget&&(this.__hostTarget.getComputedTransform(),this.__hostTarget.updateInnerText(!0)),t.prototype.getComputedTransform.call(this)},e.prototype._updateSubTexts=function(){var t;this._childCursor=0,WD(t=this.style),yE(t.rich,WD),this.style.rich?this._updateRichTexts():this._updatePlainTexts(),this._children.length=this._childCursor,this.styleUpdated()},e.prototype.addSelfToZr=function(e){t.prototype.addSelfToZr.call(this,e);for(var i=0;i<this._children.length;i++)this._children[i].__zr=e},e.prototype.removeSelfFromZr=function(e){t.prototype.removeSelfFromZr.call(this,e);for(var i=0;i<this._children.length;i++)this._children[i].__zr=null},e.prototype.getBoundingRect=function(){if(this.styleChanged()&&this._updateSubTexts(),!this._rect){for(var t=new pM(0,0,0,0),e=this._children,i=[],n=null,r=0;r<e.length;r++){var o=e[r],s=o.getBoundingRect(),a=o.getLocalTransform(i);a?(t.copy(s),t.applyTransform(a),(n=n||t.clone()).union(t)):(n=n||s.clone()).union(s)}this._rect=n||t}return this._rect},e.prototype.setDefaultTextStyle=function(t){this._defaultStyle=t||ND},e.prototype.setTextContent=function(t){if("production"!==process.env.NODE_ENV)throw new Error("Can't attach text on another text")},e.prototype._mergeStyle=function(t,e){if(!e)return t;var i=e.rich,n=t.rich||i&&{};return pE(t,e),i&&n?(this._mergeRich(n,i),t.rich=n):n&&(t.rich=n),t},e.prototype._mergeRich=function(t,e){for(var i=bE(e),n=0;n<i.length;n++){var r=i[n];t[r]=t[r]||{},pE(t[r],e[r])}},e.prototype.getAnimationStyleProps=function(){return BD},e.prototype._getOrCreateChild=function(t){var e=this._children[this._childCursor];return e&&e instanceof t||(e=new t),this._children[this._childCursor++]=e,e.__zr=this.__zr,e.parent=this,e},e.prototype._updatePlainTexts=function(){var t=this.style,e=t.font||HA,i=t.padding,n=function(t,e){null!=t&&(t+="");var i,n=e.overflow,r=e.padding,o=e.font,s="truncate"===n,a=oC(o),l=BE(e.lineHeight,a),c=!!e.backgroundColor,u="truncate"===e.lineOverflow,h=e.width,p=(i=null==h||"break"!==n&&"breakAll"!==n?t?t.split("\n"):[]:t?aL(t,e.font,h,"breakAll"===n,0).lines:[]).length*l,d=BE(e.height,p);if(p>d&&u){var f=Math.floor(d/l);i=i.slice(0,f)}if(t&&s&&null!=h)for(var m=KP(h,o,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),g=0;g<i.length;g++)i[g]=$P(i[g],m);var y=d,v=0;for(g=0;g<i.length;g++)v=Math.max(tC(i[g],o),v);null==h&&(h=v);var _=v;return r&&(y+=r[0]+r[2],_+=r[1]+r[3],h+=r[1]+r[3]),c&&(_=h),{lines:i,height:d,outerWidth:_,outerHeight:y,lineHeight:l,calculatedLineHeight:a,contentWidth:v,contentHeight:p,width:h}}(YD(t),t),r=QD(t),o=!!t.backgroundColor,s=n.outerHeight,a=n.outerWidth,l=n.contentWidth,c=n.lines,u=n.lineHeight,h=this._defaultStyle,p=t.x||0,d=t.y||0,f=t.align||h.align||"left",m=t.verticalAlign||h.verticalAlign||"top",g=p,y=rC(d,n.contentHeight,m);if(r||i){var v=nC(p,a,f),_=rC(d,s,m);r&&this._renderBackground(t,t,v,_,a,s)}y+=u/2,i&&(g=ZD(p,f,i),"top"===m?y+=i[0]:"bottom"===m&&(y-=i[2]));for(var x=0,b=!1,w=(XD("fill"in t?t.fill:(b=!0,h.fill))),A=(qD("stroke"in t?t.stroke:o||h.autoStroke&&!b?null:(x=2,h.stroke))),E=t.textShadowBlur>0,S=null!=t.width&&("truncate"===t.overflow||"break"===t.overflow||"breakAll"===t.overflow),M=n.calculatedLineHeight,T=0;T<c.length;T++){var I=this._getOrCreateChild(AD),C=I.createStyle();I.useStyle(C),C.text=c[T],C.x=g,C.y=y,f&&(C.textAlign=f),C.textBaseline="middle",C.opacity=t.opacity,C.strokeFirst=!0,E&&(C.shadowBlur=t.textShadowBlur||0,C.shadowColor=t.textShadowColor||"transparent",C.shadowOffsetX=t.textShadowOffsetX||0,C.shadowOffsetY=t.textShadowOffsetY||0),C.stroke=A,C.fill=w,A&&(C.lineWidth=t.lineWidth||x,C.lineDash=t.lineDash,C.lineDashOffset=t.lineDashOffset||0),C.font=e,jD(C,t),y+=u,S&&I.setBoundingRect(new pM(nC(C.x,t.width,C.textAlign),rC(C.y,M,C.textBaseline),l,M))}},e.prototype._updateRichTexts=function(){var t=this.style,e=function(t,e){var i=new nL;if(null!=t&&(t+=""),!t)return i;for(var n,r=e.width,o=e.height,s=e.overflow,a="break"!==s&&"breakAll"!==s||null==r?null:{width:r,accumWidth:0,breakAll:"breakAll"===s},l=QP.lastIndex=0;null!=(n=QP.exec(t));){var c=n.index;c>l&&rL(i,t.substring(l,c),e,a),rL(i,n[2],e,a,n[1]),l=QP.lastIndex}l<t.length&&rL(i,t.substring(l,t.length),e,a);var u=[],h=0,p=0,d=e.padding,f="truncate"===s,m="truncate"===e.lineOverflow;function g(t,e,i){t.width=e,t.lineHeight=i,h+=i,p=Math.max(p,e)}t:for(var y=0;y<i.lines.length;y++){for(var v=i.lines[y],_=0,x=0,b=0;b<v.tokens.length;b++){var w=(D=v.tokens[b]).styleName&&e.rich[D.styleName]||{},A=D.textPadding=w.padding,E=A?A[1]+A[3]:0,S=D.font=w.font||e.font;D.contentHeight=oC(S);var M=BE(w.height,D.contentHeight);if(D.innerHeight=M,A&&(M+=A[0]+A[2]),D.height=M,D.lineHeight=zE(w.lineHeight,e.lineHeight,M),D.align=w&&w.align||e.align,D.verticalAlign=w&&w.verticalAlign||"middle",m&&null!=o&&h+D.lineHeight>o){b>0?(v.tokens=v.tokens.slice(0,b),g(v,x,_),i.lines=i.lines.slice(0,y+1)):i.lines=i.lines.slice(0,y);break t}var T=w.width,I=null==T||"auto"===T;if("string"==typeof T&&"%"===T.charAt(T.length-1))D.percentWidth=T,u.push(D),D.contentWidth=tC(D.text,S);else{if(I){var C=w.backgroundColor,P=C&&C.image;P&&YP(P=qP(P))&&(D.width=Math.max(D.width,P.width*M/P.height))}var L=f&&null!=r?r-x:null;null!=L&&L<D.width?!I||L<E?(D.text="",D.width=D.contentWidth=0):(D.text=JP(D.text,L-E,S,e.ellipsis,{minChar:e.truncateMinChar}),D.width=D.contentWidth=tC(D.text,S)):D.contentWidth=tC(D.text,S)}D.width+=E,x+=D.width,w&&(_=Math.max(_,D.lineHeight))}g(v,x,_)}for(i.outerWidth=i.width=BE(r,p),i.outerHeight=i.height=BE(o,h),i.contentHeight=h,i.contentWidth=p,d&&(i.outerWidth+=d[1]+d[3],i.outerHeight+=d[0]+d[2]),y=0;y<u.length;y++){var D,R=(D=u[y]).percentWidth;D.width=parseInt(R,10)/100*i.width}return i}(YD(t),t),i=e.width,n=e.outerWidth,r=e.outerHeight,o=t.padding,s=t.x||0,a=t.y||0,l=this._defaultStyle,c=t.align||l.align,u=t.verticalAlign||l.verticalAlign,h=nC(s,n,c),p=rC(a,r,u),d=h,f=p;o&&(d+=o[3],f+=o[0]);var m=d+i;QD(t)&&this._renderBackground(t,t,h,p,n,r);for(var g=!!t.backgroundColor,y=0;y<e.lines.length;y++){for(var v=e.lines[y],_=v.tokens,x=_.length,b=v.lineHeight,w=v.width,A=0,E=d,S=m,M=x-1,T=void 0;A<x&&(!(T=_[A]).align||"left"===T.align);)this._placeToken(T,t,b,f,E,"left",g),w-=T.width,E+=T.width,A++;for(;M>=0&&"right"===(T=_[M]).align;)this._placeToken(T,t,b,f,S,"right",g),w-=T.width,S-=T.width,M--;for(E+=(i-(E-d)-(m-S)-w)/2;A<=M;)T=_[A],this._placeToken(T,t,b,f,E+T.width/2,"center",g),E+=T.width,A++;f+=b}},e.prototype._placeToken=function(t,e,i,n,r,o,s){var a=e.rich[t.styleName]||{};a.text=t.text;var l=t.verticalAlign,c=n+i/2;"top"===l?c=n+t.height/2:"bottom"===l&&(c=n+i-t.height/2),!t.isLineHolder&&QD(a)&&this._renderBackground(a,e,"right"===o?r-t.width:"center"===o?r-t.width/2:r,c-t.height/2,t.width,t.height);var u=!!a.backgroundColor,h=t.textPadding;h&&(r=ZD(r,o,h),c-=t.height/2-h[0]-t.innerHeight/2);var p=this._getOrCreateChild(AD),d=p.createStyle();p.useStyle(d);var f=this._defaultStyle,m=!1,g=0,y=XD("fill"in a?a.fill:"fill"in e?e.fill:(m=!0,f.fill)),v=qD("stroke"in a?a.stroke:"stroke"in e?e.stroke:u||s||f.autoStroke&&!m?null:(g=2,f.stroke)),_=a.textShadowBlur>0||e.textShadowBlur>0;d.text=t.text,d.x=r,d.y=c,_&&(d.shadowBlur=a.textShadowBlur||e.textShadowBlur||0,d.shadowColor=a.textShadowColor||e.textShadowColor||"transparent",d.shadowOffsetX=a.textShadowOffsetX||e.textShadowOffsetX||0,d.shadowOffsetY=a.textShadowOffsetY||e.textShadowOffsetY||0),d.textAlign=o,d.textBaseline="middle",d.font=t.font||HA,d.opacity=zE(a.opacity,e.opacity,1),jD(d,a),v&&(d.lineWidth=zE(a.lineWidth,e.lineWidth,g),d.lineDash=BE(a.lineDash,e.lineDash),d.lineDashOffset=e.lineDashOffset||0,d.stroke=v),y&&(d.fill=y);var x=t.contentWidth,b=t.contentHeight;p.setBoundingRect(new pM(nC(d.x,x,d.textAlign),rC(d.y,b,d.textBaseline),x,b))},e.prototype._renderBackground=function(t,e,i,n,r,o){var s,a,l,c=t.backgroundColor,u=t.borderWidth,h=t.borderColor,p=c&&c.image,d=c&&!p,f=t.borderRadius,m=this;if(d||t.lineHeight||u&&h){(s=this._getOrCreateChild(kD)).useStyle(s.createStyle()),s.style.fill=null;var g=s.shape;g.x=i,g.y=n,g.width=r,g.height=o,g.r=f,s.dirtyShape()}if(d)(l=s.style).fill=c||null,l.fillOpacity=BE(t.fillOpacity,1);else if(p){(a=this._getOrCreateChild(TD)).onload=function(){m.dirtyStyle()};var y=a.style;y.image=c.image,y.x=i,y.y=n,y.width=r,y.height=o}u&&h&&((l=s.style).lineWidth=u,l.stroke=h,l.strokeOpacity=BE(t.strokeOpacity,1),l.lineDash=t.borderDash,l.lineDashOffset=t.borderDashOffset||0,s.strokeContainThreshold=0,s.hasFill()&&s.hasStroke()&&(l.strokeFirst=!0,l.lineWidth*=2));var v=(s||a).style;v.shadowBlur=t.shadowBlur||0,v.shadowColor=t.shadowColor||"transparent",v.shadowOffsetX=t.shadowOffsetX||0,v.shadowOffsetY=t.shadowOffsetY||0,v.opacity=zE(t.opacity,e.opacity,1)},e.makeFont=function(t){var e="";return HD(t)&&(e=[t.fontStyle,t.fontWeight,GD(t.fontSize),t.fontFamily||"sans-serif"].join(" ")),e&&GE(e)||t.textFont||t.font},e}(gL),FD={left:!0,right:1,center:1},VD={top:1,bottom:1,middle:1},UD=["fontStyle","fontWeight","fontSize","fontFamily"];function GD(t){return"string"!=typeof t||-1===t.indexOf("px")&&-1===t.indexOf("rem")&&-1===t.indexOf("em")?isNaN(+t)?GA+"px":t+"px":t}function jD(t,e){for(var i=0;i<UD.length;i++){var n=UD[i],r=e[n];null!=r&&(t[n]=r)}}function HD(t){return null!=t.fontSize||t.fontFamily||t.fontWeight}function WD(t){if(t){t.font=zD.makeFont(t);var e=t.align;"middle"===e&&(e="center"),t.align=null==e||FD[e]?e:"left";var i=t.verticalAlign;"center"===i&&(i="middle"),t.verticalAlign=null==i||VD[i]?i:"top",t.padding&&(t.padding=VE(t.padding))}}function qD(t,e){return null==t||e<=0||"transparent"===t||"none"===t?null:t.image||t.colorStops?"#000":t}function XD(t){return null==t||"none"===t?null:t.image||t.colorStops?"#000":t}function ZD(t,e,i){return"right"===e?t-i[1]:"center"===e?t+i[3]/2-i[1]/2:t+i[3]}function YD(t){var e=t.text;return null!=e&&(e+=""),e}function QD(t){return!!(t.backgroundColor||t.lineHeight||t.borderWidth&&t.borderColor)}var JD=zD,KD=wP(),$D=function(t,e,i,n){if(n){var r=KD(n);r.dataIndex=i,r.dataType=e,r.seriesIndex=t,"group"===n.type&&n.traverse((function(n){var r=KD(n);r.seriesIndex=t,r.dataIndex=i,r.dataType=e}))}},tR=1,eR={},iR=wP(),nR=wP(),rR=0,oR=1,sR=2,aR=["emphasis","blur","select"],lR=["normal","emphasis","blur","select"],cR=10,uR=9,hR="highlight",pR="downplay",dR="select",fR="unselect",mR="toggleSelect";function gR(t){return null!=t&&"none"!==t}var yR=new vT(100);function vR(t){if(ME(t)){var e=yR.get(t);return e||(e=RT(t,-.1),yR.put(t,e)),e}if(RE(t)){var i=pE({},t);return i.colorStops=vE(t.colorStops,(function(t){return{offset:t.offset,color:RT(t.color,-.1)}})),i}return t}function _R(t,e,i){t.onHoverStateChange&&(t.hoverState||0)!==i&&t.onHoverStateChange(e),t.hoverState=i}function xR(t){_R(t,"emphasis",sR)}function bR(t){t.hoverState===sR&&_R(t,"normal",rR)}function wR(t){_R(t,"blur",oR)}function AR(t){t.hoverState===oR&&_R(t,"normal",rR)}function ER(t){t.selected=!0}function SR(t){t.selected=!1}function MR(t,e,i){e(t,i)}function TR(t,e,i){MR(t,e,i),t.isGroup&&t.traverse((function(t){MR(t,e,i)}))}function IR(t,e){switch(e){case"emphasis":t.hoverState=sR;break;case"normal":t.hoverState=rR;break;case"blur":t.hoverState=oR;break;case"select":t.selected=!0}}function CR(t,e){var i=this.states[t];if(this.style){if("emphasis"===t)return function(t,e,i,n){var r=i&&fE(i,"select")>=0,o=!1;if(t instanceof xD){var s=iR(t),a=r&&s.selectFill||s.normalFill,l=r&&s.selectStroke||s.normalStroke;if(gR(a)||gR(l)){var c=(n=n||{}).style||{};"inherit"===c.fill?(o=!0,n=pE({},n),(c=pE({},c)).fill=a):!gR(c.fill)&&gR(a)?(o=!0,n=pE({},n),(c=pE({},c)).fill=vR(a)):!gR(c.stroke)&&gR(l)&&(o||(n=pE({},n),c=pE({},c)),c.stroke=vR(l)),n.style=c}}if(n&&null==n.z2){o||(n=pE({},n));var u=t.z2EmphasisLift;n.z2=t.z2+(null!=u?u:cR)}return n}(this,0,e,i);if("blur"===t)return function(t,e,i){var n=fE(t.currentStates,e)>=0,r=t.style.opacity,o=n?null:function(t,e,i,n){for(var r=t.style,o={},s=0;s<e.length;s++){var a=e[s],l=r[a];o[a]=null==l?n&&n[a]:l}for(s=0;s<t.animators.length;s++){var c=t.animators[s];c.__fromStateTransition&&c.__fromStateTransition.indexOf(i)<0&&"style"===c.targetName&&c.saveTo(o,e)}return o}(t,["opacity"],e,{opacity:1}),s=(i=i||{}).style||{};return null==s.opacity&&(i=pE({},i),s=pE({opacity:n?r:.1*o.opacity},s),i.style=s),i}(this,t,i);if("select"===t)return function(t,e,i){if(i&&null==i.z2){i=pE({},i);var n=t.z2SelectLift;i.z2=t.z2+(null!=n?n:uR)}return i}(this,0,i)}return i}function PR(t){t.stateProxy=CR;var e=t.getTextContent(),i=t.getTextGuideLine();e&&(e.stateProxy=CR),i&&(i.stateProxy=CR)}function LR(t,e){!FR(t,e)&&!t.__highByOuter&&TR(t,xR)}function DR(t,e){!FR(t,e)&&!t.__highByOuter&&TR(t,bR)}function RR(t,e){t.__highByOuter|=1<<(e||0),TR(t,xR)}function OR(t,e){!(t.__highByOuter&=~(1<<(e||0)))&&TR(t,bR)}function kR(t){TR(t,wR)}function NR(t){TR(t,AR)}function BR(t){TR(t,ER)}function zR(t){TR(t,SR)}function FR(t,e){return t.__highDownSilentOnTouch&&e.zrByTouch}function VR(t){var e=t.getModel(),i=[],n=[];e.eachComponent((function(e,r){var o=nR(r),s="series"===e,a=s?t.getViewOfSeriesModel(r):t.getViewOfComponentModel(r);!s&&n.push(a),o.isBlured&&(a.group.traverse((function(t){AR(t)})),s&&i.push(r)),o.isBlured=!1})),yE(n,(function(t){t&&t.toggleBlurSeries&&t.toggleBlurSeries(i,!1,e)}))}function UR(t,e,i,n){var r=n.getModel();function o(t,e){for(var i=0;i<e.length;i++){var n=t.getItemGraphicEl(e[i]);n&&NR(n)}}if(i=i||"coordinateSystem",null!=t&&e&&"none"!==e){var s=r.getSeriesByIndex(t),a=s.coordinateSystem;a&&a.master&&(a=a.master);var l=[];r.eachSeries((function(t){var r=s===t,c=t.coordinateSystem;if(c&&c.master&&(c=c.master),!("series"===i&&!r||"coordinateSystem"===i&&!(c&&a?c===a:r)||"series"===e&&r)){if(n.getViewOfSeriesModel(t).group.traverse((function(t){t.__highByOuter&&r&&"self"===e||wR(t)})),gE(e))o(t.getData(),e);else if(CE(e))for(var u=bE(e),h=0;h<u.length;h++)o(t.getData(u[h]),e[u[h]]);l.push(t),nR(t).isBlured=!0}})),r.eachComponent((function(t,e){if("series"!==t){var i=n.getViewOfComponentModel(e);i&&i.toggleBlurSeries&&i.toggleBlurSeries(l,!0,r)}}))}}function GR(t,e,i){if(null!=t&&null!=e){var n=i.getModel().getComponent(t,e);if(n){nR(n).isBlured=!0;var r=i.getViewOfComponentModel(n);r&&r.focusBlurEnabled&&r.group.traverse((function(t){wR(t)}))}}}function jR(t,e,i,n){var r={focusSelf:!1,dispatchers:null};if(null==t||"series"===t||null==e||null==i)return r;var o=n.getModel().getComponent(t,e);if(!o)return r;var s=n.getViewOfComponentModel(o);if(!s||!s.findHighDownDispatchers)return r;for(var a,l=s.findHighDownDispatchers(i),c=0;c<l.length;c++)if("production"===process.env.NODE_ENV||$R(l[c])||tP("param should be highDownDispatcher"),"self"===KD(l[c]).focus){a=!0;break}return{focusSelf:a,dispatchers:l}}function HR(t){yE(t.getAllData(),(function(e){var i=e.data,n=e.type;i.eachItemGraphicEl((function(e,i){t.isSelected(i,n)?BR(e):zR(e)}))}))}function WR(t){var e=[];return t.eachSeries((function(t){yE(t.getAllData(),(function(i){i.data;var n=i.type,r=t.getSelectedDataIndices();if(r.length>0){var o={dataIndex:r,seriesIndex:t.seriesIndex};null!=n&&(o.dataType=n),e.push(o)}}))})),e}function qR(t,e,i){KR(t,!0),TR(t,PR),ZR(t,e,i)}function XR(t,e,i,n){n?function(t){KR(t,!1)}(t):qR(t,e,i)}function ZR(t,e,i){var n=KD(t);null!=e?(n.focus=e,n.blurScope=i):n.focus&&(n.focus=null)}var YR=["emphasis","blur","select"],QR={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function JR(t,e,i,n){i=i||"itemStyle";for(var r=0;r<YR.length;r++){var o=YR[r],s=e.getModel([o,i]);t.ensureState(o).style=n?n(s):s[QR[i]]()}}function KR(t,e){var i=!1===e,n=t;t.highDownSilentOnTouch&&(n.__highDownSilentOnTouch=t.highDownSilentOnTouch),i&&!n.__highDownDispatcher||(n.__highByOuter=n.__highByOuter||0,n.__highDownDispatcher=!i)}function $R(t){return!(!t||!t.__highDownDispatcher)}function tO(t){var e=t.type;return e===dR||e===fR||e===mR}function eO(t){var e=t.type;return e===hR||e===pR}var iO=KL.CMD,nO=[[],[],[]],rO=Math.sqrt,oO=Math.atan2;function sO(t,e){if(e){var i,n,r,o,s,a,l=t.data,c=t.len(),u=iO.M,h=iO.C,p=iO.L,d=iO.R,f=iO.A,m=iO.Q;for(r=0,o=0;r<c;){switch(i=l[r++],o=r,n=0,i){case u:case p:n=1;break;case h:n=3;break;case m:n=2;break;case f:var g=e[4],y=e[5],v=rO(e[0]*e[0]+e[1]*e[1]),_=rO(e[2]*e[2]+e[3]*e[3]),x=oO(-e[1]/_,e[0]/v);l[r]*=v,l[r++]+=g,l[r]*=_,l[r++]+=y,l[r++]*=v,l[r++]*=_,l[r++]+=x,l[r++]+=x,o=r+=2;break;case d:a[0]=l[r++],a[1]=l[r++],gS(a,a,e),l[o++]=a[0],l[o++]=a[1],a[0]+=l[r++],a[1]+=l[r++],gS(a,a,e),l[o++]=a[0],l[o++]=a[1]}for(s=0;s<n;s++){var b=nO[s];b[0]=l[r++],b[1]=l[r++],gS(b,b,e),l[o++]=b[0],l[o++]=b[1]}}t.increaseVersion()}}var aO=Math.sqrt,lO=Math.sin,cO=Math.cos,uO=Math.PI;function hO(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function pO(t,e){return(t[0]*e[0]+t[1]*e[1])/(hO(t)*hO(e))}function dO(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(pO(t,e))}function fO(t,e,i,n,r,o,s,a,l,c,u){var h=l*(uO/180),p=cO(h)*(t-i)/2+lO(h)*(e-n)/2,d=-1*lO(h)*(t-i)/2+cO(h)*(e-n)/2,f=p*p/(s*s)+d*d/(a*a);f>1&&(s*=aO(f),a*=aO(f));var m=(r===o?-1:1)*aO((s*s*(a*a)-s*s*(d*d)-a*a*(p*p))/(s*s*(d*d)+a*a*(p*p)))||0,g=m*s*d/a,y=m*-a*p/s,v=(t+i)/2+cO(h)*g-lO(h)*y,_=(e+n)/2+lO(h)*g+cO(h)*y,x=dO([1,0],[(p-g)/s,(d-y)/a]),b=[(p-g)/s,(d-y)/a],w=[(-1*p-g)/s,(-1*d-y)/a],A=dO(b,w);if(pO(b,w)<=-1&&(A=uO),pO(b,w)>=1&&(A=0),A<0){var E=Math.round(A/uO*1e6)/1e6;A=2*uO+E%2*uO}u.addData(c,v,_,s,a,x,A,h,o)}var mO=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,gO=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;var yO=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return zA(e,t),e.prototype.applyTransform=function(t){},e}(xD);function vO(t){return null!=t.setData}function _O(t,e){var i=function(t){var e=new KL;if(!t)return e;var i,n=0,r=0,o=n,s=r,a=KL.CMD,l=t.match(mO);if(!l)return e;for(var c=0;c<l.length;c++){for(var u=l[c],h=u.charAt(0),p=void 0,d=u.match(gO)||[],f=d.length,m=0;m<f;m++)d[m]=parseFloat(d[m]);for(var g=0;g<f;){var y=void 0,v=void 0,_=void 0,x=void 0,b=void 0,w=void 0,A=void 0,E=n,S=r,M=void 0,T=void 0;switch(h){case"l":n+=d[g++],r+=d[g++],p=a.L,e.addData(p,n,r);break;case"L":n=d[g++],r=d[g++],p=a.L,e.addData(p,n,r);break;case"m":n+=d[g++],r+=d[g++],p=a.M,e.addData(p,n,r),o=n,s=r,h="l";break;case"M":n=d[g++],r=d[g++],p=a.M,e.addData(p,n,r),o=n,s=r,h="L";break;case"h":n+=d[g++],p=a.L,e.addData(p,n,r);break;case"H":n=d[g++],p=a.L,e.addData(p,n,r);break;case"v":r+=d[g++],p=a.L,e.addData(p,n,r);break;case"V":r=d[g++],p=a.L,e.addData(p,n,r);break;case"C":p=a.C,e.addData(p,d[g++],d[g++],d[g++],d[g++],d[g++],d[g++]),n=d[g-2],r=d[g-1];break;case"c":p=a.C,e.addData(p,d[g++]+n,d[g++]+r,d[g++]+n,d[g++]+r,d[g++]+n,d[g++]+r),n+=d[g-2],r+=d[g-1];break;case"S":y=n,v=r,M=e.len(),T=e.data,i===a.C&&(y+=n-T[M-4],v+=r-T[M-3]),p=a.C,E=d[g++],S=d[g++],n=d[g++],r=d[g++],e.addData(p,y,v,E,S,n,r);break;case"s":y=n,v=r,M=e.len(),T=e.data,i===a.C&&(y+=n-T[M-4],v+=r-T[M-3]),p=a.C,E=n+d[g++],S=r+d[g++],n+=d[g++],r+=d[g++],e.addData(p,y,v,E,S,n,r);break;case"Q":E=d[g++],S=d[g++],n=d[g++],r=d[g++],p=a.Q,e.addData(p,E,S,n,r);break;case"q":E=d[g++]+n,S=d[g++]+r,n+=d[g++],r+=d[g++],p=a.Q,e.addData(p,E,S,n,r);break;case"T":y=n,v=r,M=e.len(),T=e.data,i===a.Q&&(y+=n-T[M-4],v+=r-T[M-3]),n=d[g++],r=d[g++],p=a.Q,e.addData(p,y,v,n,r);break;case"t":y=n,v=r,M=e.len(),T=e.data,i===a.Q&&(y+=n-T[M-4],v+=r-T[M-3]),n+=d[g++],r+=d[g++],p=a.Q,e.addData(p,y,v,n,r);break;case"A":_=d[g++],x=d[g++],b=d[g++],w=d[g++],A=d[g++],fO(E=n,S=r,n=d[g++],r=d[g++],w,A,_,x,b,p=a.A,e);break;case"a":_=d[g++],x=d[g++],b=d[g++],w=d[g++],A=d[g++],fO(E=n,S=r,n+=d[g++],r+=d[g++],w,A,_,x,b,p=a.A,e)}}"z"!==h&&"Z"!==h||(p=a.Z,e.addData(p),n=o,r=s),i=p}return e.toStatic(),e}(t),n=pE({},e);return n.buildPath=function(t){if(vO(t)){t.setData(i.data),(e=t.getContext())&&t.rebuildPath(e,1)}else{var e=t;i.rebuildPath(e,1)}},n.applyTransform=function(t){sO(i,t),this.dirtyShape()},n}function xO(t,e){return new yO(_O(t,e))}function bO(t,e){e=e||{};var i=new xD;return t.shape&&i.setShape(t.shape),i.setStyle(t.style),e.bakeTransform?sO(i.path,t.getComputedTransform()):e.toLocal?i.setLocalTransform(t.getComputedTransform()):i.copyTransform(t),i.buildPath=t.buildPath,i.applyTransform=i.applyTransform,i.z=t.z,i.z2=t.z2,i.zlevel=t.zlevel,i}var wO=function(){this.cx=0,this.cy=0,this.r=0},AO=function(t){function e(e){return t.call(this,e)||this}return zA(e,t),e.prototype.getDefaultShape=function(){return new wO},e.prototype.buildPath=function(t,e){t.moveTo(e.cx+e.r,e.cy),t.arc(e.cx,e.cy,e.r,0,2*Math.PI)},e}(xD);AO.prototype.type="circle";var EO=AO,SO=function(){this.cx=0,this.cy=0,this.rx=0,this.ry=0},MO=function(t){function e(e){return t.call(this,e)||this}return zA(e,t),e.prototype.getDefaultShape=function(){return new SO},e.prototype.buildPath=function(t,e){var i=.5522848,n=e.cx,r=e.cy,o=e.rx,s=e.ry,a=o*i,l=s*i;t.moveTo(n-o,r),t.bezierCurveTo(n-o,r-l,n-a,r-s,n,r-s),t.bezierCurveTo(n+a,r-s,n+o,r-l,n+o,r),t.bezierCurveTo(n+o,r+l,n+a,r+s,n,r+s),t.bezierCurveTo(n-a,r+s,n-o,r+l,n-o,r),t.closePath()},e}(xD);MO.prototype.type="ellipse";var TO=MO,IO=Math.PI,CO=2*IO,PO=Math.sin,LO=Math.cos,DO=Math.acos,RO=Math.atan2,OO=Math.abs,kO=Math.sqrt,NO=Math.max,BO=Math.min,zO=1e-4;function FO(t,e,i,n,r,o,s){var a=t-i,l=e-n,c=(s?o:-o)/kO(a*a+l*l),u=c*l,h=-c*a,p=t+u,d=e+h,f=i+u,m=n+h,g=(p+f)/2,y=(d+m)/2,v=f-p,_=m-d,x=v*v+_*_,b=r-o,w=p*m-f*d,A=(_<0?-1:1)*kO(NO(0,b*b*x-w*w)),E=(w*_-v*A)/x,S=(-w*v-_*A)/x,M=(w*_+v*A)/x,T=(-w*v+_*A)/x,I=E-g,C=S-y,P=M-g,L=T-y;return I*I+C*C>P*P+L*L&&(E=M,S=T),{cx:E,cy:S,x0:-u,y0:-h,x1:E*(r/b-1),y1:S*(r/b-1)}}function VO(t,e){var i,n=NO(e.r,0),r=NO(e.r0||0,0),o=n>0;if(o||r>0){if(o||(n=r,r=0),r>n){var s=n;n=r,r=s}var a=e.startAngle,l=e.endAngle;if(!isNaN(a)&&!isNaN(l)){var c=e.cx,u=e.cy,h=!!e.clockwise,p=OO(l-a),d=p>CO&&p%CO;if(d>zO&&(p=d),n>zO)if(p>CO-zO)t.moveTo(c+n*LO(a),u+n*PO(a)),t.arc(c,u,n,a,l,!h),r>zO&&(t.moveTo(c+r*LO(l),u+r*PO(l)),t.arc(c,u,r,l,a,h));else{var f=void 0,m=void 0,g=void 0,y=void 0,v=void 0,_=void 0,x=void 0,b=void 0,w=void 0,A=void 0,E=void 0,S=void 0,M=void 0,T=void 0,I=void 0,C=void 0,P=n*LO(a),L=n*PO(a),D=r*LO(l),R=r*PO(l),O=p>zO;if(O){var k=e.cornerRadius;k&&(i=function(t){var e;if(EE(t)){var i=t.length;if(!i)return t;e=1===i?[t[0],t[0],0,0]:2===i?[t[0],t[0],t[1],t[1]]:3===i?t.concat(t[2]):t}else e=[t,t,t,t];return e}(k),f=i[0],m=i[1],g=i[2],y=i[3]);var N=OO(n-r)/2;if(v=BO(N,g),_=BO(N,y),x=BO(N,f),b=BO(N,m),E=w=NO(v,_),S=A=NO(x,b),(w>zO||A>zO)&&(M=n*LO(l),T=n*PO(l),I=r*LO(a),C=r*PO(a),p<IO)){var B=function(t,e,i,n,r,o,s,a){var l=i-t,c=n-e,u=s-r,h=a-o,p=h*l-u*c;if(!(p*p<zO))return[t+(p=(u*(e-o)-h*(t-r))/p)*l,e+p*c]}(P,L,I,C,M,T,D,R);if(B){var z=P-B[0],F=L-B[1],V=M-B[0],U=T-B[1],G=1/PO(DO((z*V+F*U)/(kO(z*z+F*F)*kO(V*V+U*U)))/2),j=kO(B[0]*B[0]+B[1]*B[1]);E=BO(w,(n-j)/(G+1)),S=BO(A,(r-j)/(G-1))}}}if(O)if(E>zO){var H=BO(g,E),W=BO(y,E),q=FO(I,C,P,L,n,H,h),X=FO(M,T,D,R,n,W,h);t.moveTo(c+q.cx+q.x0,u+q.cy+q.y0),E<w&&H===W?t.arc(c+q.cx,u+q.cy,E,RO(q.y0,q.x0),RO(X.y0,X.x0),!h):(H>0&&t.arc(c+q.cx,u+q.cy,H,RO(q.y0,q.x0),RO(q.y1,q.x1),!h),t.arc(c,u,n,RO(q.cy+q.y1,q.cx+q.x1),RO(X.cy+X.y1,X.cx+X.x1),!h),W>0&&t.arc(c+X.cx,u+X.cy,W,RO(X.y1,X.x1),RO(X.y0,X.x0),!h))}else t.moveTo(c+P,u+L),t.arc(c,u,n,a,l,!h);else t.moveTo(c+P,u+L);if(r>zO&&O)if(S>zO){H=BO(f,S),q=FO(D,R,M,T,r,-(W=BO(m,S)),h),X=FO(P,L,I,C,r,-H,h);t.lineTo(c+q.cx+q.x0,u+q.cy+q.y0),S<A&&H===W?t.arc(c+q.cx,u+q.cy,S,RO(q.y0,q.x0),RO(X.y0,X.x0),!h):(W>0&&t.arc(c+q.cx,u+q.cy,W,RO(q.y0,q.x0),RO(q.y1,q.x1),!h),t.arc(c,u,r,RO(q.cy+q.y1,q.cx+q.x1),RO(X.cy+X.y1,X.cx+X.x1),h),H>0&&t.arc(c+X.cx,u+X.cy,H,RO(X.y1,X.x1),RO(X.y0,X.x0),!h))}else t.lineTo(c+D,u+R),t.arc(c,u,r,l,a,h);else t.lineTo(c+D,u+R)}else t.moveTo(c,u);t.closePath()}}}var UO=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0,this.cornerRadius=0},GO=function(t){function e(e){return t.call(this,e)||this}return zA(e,t),e.prototype.getDefaultShape=function(){return new UO},e.prototype.buildPath=function(t,e){VO(t,e)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(xD);GO.prototype.type="sector";var jO=GO,HO=function(){this.cx=0,this.cy=0,this.r=0,this.r0=0},WO=function(t){function e(e){return t.call(this,e)||this}return zA(e,t),e.prototype.getDefaultShape=function(){return new HO},e.prototype.buildPath=function(t,e){var i=e.cx,n=e.cy,r=2*Math.PI;t.moveTo(i+e.r,n),t.arc(i,n,e.r,0,r,!1),t.moveTo(i+e.r0,n),t.arc(i,n,e.r0,0,r,!0)},e}(xD);WO.prototype.type="ring";var qO=WO;function XO(t,e,i){var n=e.smooth,r=e.points;if(r&&r.length>=2){if(n){var o=function(t,e,i,n){var r,o,s,a,l=[],c=[],u=[],h=[];if(n){s=[1/0,1/0],a=[-1/0,-1/0];for(var p=0,d=t.length;p<d;p++)yS(s,s,t[p]),vS(a,a,t[p]);yS(s,s,n[0]),vS(a,a,n[1])}for(p=0,d=t.length;p<d;p++){var f=t[p];if(i)r=t[p?p-1:d-1],o=t[(p+1)%d];else{if(0===p||p===d-1){l.push(rS(t[p]));continue}r=t[p-1],o=t[p+1]}lS(c,o,r),uS(c,c,e);var m=pS(f,r),g=pS(f,o),y=m+g;0!==y&&(m/=y,g/=y),uS(u,c,-m),uS(h,c,g);var v=sS([],f,u),_=sS([],f,h);n&&(vS(v,v,s),yS(v,v,a),vS(_,_,s),yS(_,_,a)),l.push(v),l.push(_)}return i&&l.push(l.shift()),l}(r,n,i,e.smoothConstraint);t.moveTo(r[0][0],r[0][1]);for(var s=r.length,a=0;a<(i?s:s-1);a++){var l=o[2*a],c=o[2*a+1],u=r[(a+1)%s];t.bezierCurveTo(l[0],l[1],c[0],c[1],u[0],u[1])}}else{t.moveTo(r[0][0],r[0][1]);a=1;for(var h=r.length;a<h;a++)t.lineTo(r[a][0],r[a][1])}i&&t.closePath()}}var ZO=function(){this.points=null,this.smooth=0,this.smoothConstraint=null},YO=function(t){function e(e){return t.call(this,e)||this}return zA(e,t),e.prototype.getDefaultShape=function(){return new ZO},e.prototype.buildPath=function(t,e){XO(t,e,!0)},e}(xD);YO.prototype.type="polygon";var QO=YO,JO=function(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null},KO=function(t){function e(e){return t.call(this,e)||this}return zA(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new JO},e.prototype.buildPath=function(t,e){XO(t,e,!1)},e}(xD);KO.prototype.type="polyline";var $O=KO,tk={},ek=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1},ik=function(t){function e(e){return t.call(this,e)||this}return zA(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new ek},e.prototype.buildPath=function(t,e){var i,n,r,o;if(this.subPixelOptimize){var s=CD(tk,e,this.style);i=s.x1,n=s.y1,r=s.x2,o=s.y2}else i=e.x1,n=e.y1,r=e.x2,o=e.y2;var a=e.percent;0!==a&&(t.moveTo(i,n),a<1&&(r=i*(1-a)+r*a,o=n*(1-a)+o*a),t.lineTo(r,o))},e.prototype.pointAt=function(t){var e=this.shape;return[e.x1*(1-t)+e.x2*t,e.y1*(1-t)+e.y2*t]},e}(xD);ik.prototype.type="line";var nk=ik,rk=[],ok=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1};function sk(t,e,i){var n=t.cpx2,r=t.cpy2;return null!=n||null!=r?[(i?tT:$M)(t.x1,t.cpx1,t.cpx2,t.x2,e),(i?tT:$M)(t.y1,t.cpy1,t.cpy2,t.y2,e)]:[(i?aT:sT)(t.x1,t.cpx1,t.x2,e),(i?aT:sT)(t.y1,t.cpy1,t.y2,e)]}var ak=function(t){function e(e){return t.call(this,e)||this}return zA(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new ok},e.prototype.buildPath=function(t,e){var i=e.x1,n=e.y1,r=e.x2,o=e.y2,s=e.cpx1,a=e.cpy1,l=e.cpx2,c=e.cpy2,u=e.percent;0!==u&&(t.moveTo(i,n),null==l||null==c?(u<1&&(cT(i,s,r,u,rk),s=rk[1],r=rk[2],cT(n,a,o,u,rk),a=rk[1],o=rk[2]),t.quadraticCurveTo(s,a,r,o)):(u<1&&(nT(i,s,l,r,u,rk),s=rk[1],l=rk[2],r=rk[3],nT(n,a,c,o,u,rk),a=rk[1],c=rk[2],o=rk[3]),t.bezierCurveTo(s,a,l,c,r,o)))},e.prototype.pointAt=function(t){return sk(this.shape,t,!1)},e.prototype.tangentAt=function(t){var e=sk(this.shape,t,!0);return hS(e,e)},e}(xD);ak.prototype.type="bezier-curve";var lk=ak,ck=function(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},uk=function(t){function e(e){return t.call(this,e)||this}return zA(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new ck},e.prototype.buildPath=function(t,e){var i=e.cx,n=e.cy,r=Math.max(e.r,0),o=e.startAngle,s=e.endAngle,a=e.clockwise,l=Math.cos(o),c=Math.sin(o);t.moveTo(l*r+i,c*r+n),t.arc(i,n,r,o,s,!a)},e}(xD);uk.prototype.type="arc";var hk=uk,pk=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="compound",e}return zA(e,t),e.prototype._updatePathDirty=function(){for(var t=this.shape.paths,e=this.shapeChanged(),i=0;i<t.length;i++)e=e||t[i].shapeChanged();e&&this.dirtyShape()},e.prototype.beforeBrush=function(){this._updatePathDirty();for(var t=this.shape.paths||[],e=this.getGlobalScale(),i=0;i<t.length;i++)t[i].path||t[i].createPathProxy(),t[i].path.setScale(e[0],e[1],t[i].segmentIgnoreThreshold)},e.prototype.buildPath=function(t,e){for(var i=e.paths||[],n=0;n<i.length;n++)i[n].buildPath(t,i[n].shape,!0)},e.prototype.afterBrush=function(){for(var t=this.shape.paths||[],e=0;e<t.length;e++)t[e].pathUpdated()},e.prototype.getBoundingRect=function(){return this._updatePathDirty.call(this),xD.prototype.getBoundingRect.call(this)},e}(xD),dk=pk,fk=function(){function t(t){this.colorStops=t||[]}return t.prototype.addColorStop=function(t,e){this.colorStops.push({offset:t,color:e})},t}(),mk=function(t){function e(e,i,n,r,o,s){var a=t.call(this,o)||this;return a.x=null==e?0:e,a.y=null==i?0:i,a.x2=null==n?1:n,a.y2=null==r?0:r,a.type="linear",a.global=s||!1,a}return zA(e,t),e}(fk),gk=function(t){function e(e,i,n,r,o){var s=t.call(this,r)||this;return s.x=null==e?.5:e,s.y=null==i?.5:i,s.r=null==n?.5:n,s.type="radial",s.global=o||!1,s}return zA(e,t),e}(fk),yk=gk,vk=[0,0],_k=[0,0],xk=new iM,bk=new iM,wk=function(){function t(t,e){this._corners=[],this._axes=[],this._origin=[0,0];for(var i=0;i<4;i++)this._corners[i]=new iM;for(i=0;i<2;i++)this._axes[i]=new iM;t&&this.fromBoundingRect(t,e)}return t.prototype.fromBoundingRect=function(t,e){var i=this._corners,n=this._axes,r=t.x,o=t.y,s=r+t.width,a=o+t.height;if(i[0].set(r,o),i[1].set(s,o),i[2].set(s,a),i[3].set(r,a),e)for(var l=0;l<4;l++)i[l].transform(e);iM.sub(n[0],i[1],i[0]),iM.sub(n[1],i[3],i[0]),n[0].normalize(),n[1].normalize();for(l=0;l<2;l++)this._origin[l]=n[l].dot(i[0])},t.prototype.intersect=function(t,e){var i=!0,n=!e;return xk.set(1/0,1/0),bk.set(0,0),!this._intersectCheckOneSide(this,t,xk,bk,n,1)&&(i=!1,n)||!this._intersectCheckOneSide(t,this,xk,bk,n,-1)&&(i=!1,n)||n||iM.copy(e,i?xk:bk),i},t.prototype._intersectCheckOneSide=function(t,e,i,n,r,o){for(var s=!0,a=0;a<2;a++){var l=this._axes[a];if(this._getProjMinMaxOnAxis(a,t._corners,vk),this._getProjMinMaxOnAxis(a,e._corners,_k),vk[1]<_k[0]||vk[0]>_k[1]){if(s=!1,r)return s;var c=Math.abs(_k[0]-vk[1]),u=Math.abs(vk[0]-_k[1]);Math.min(c,u)>n.len()&&(c<u?iM.scale(n,l,-c*o):iM.scale(n,l,u*o))}else if(i){c=Math.abs(_k[0]-vk[1]),u=Math.abs(vk[0]-_k[1]);Math.min(c,u)<i.len()&&(c<u?iM.scale(i,l,c*o):iM.scale(i,l,-u*o))}}return s},t.prototype._getProjMinMaxOnAxis=function(t,e,i){for(var n=this._axes[t],r=this._origin,o=e[0].dot(n)+r[t],s=o,a=o,l=1;l<e.length;l++){var c=e[l].dot(n)+r[t];s=Math.min(c,s),a=Math.max(c,a)}i[0]=s,i[1]=a},t}(),Ak=wk,Ek=[],Sk=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.notClear=!0,e.incremental=!0,e._displayables=[],e._temporaryDisplayables=[],e._cursor=0,e}return zA(e,t),e.prototype.traverse=function(t,e){t.call(e,this)},e.prototype.useStyle=function(){this.style={}},e.prototype.getCursor=function(){return this._cursor},e.prototype.innerAfterBrush=function(){this._cursor=this._displayables.length},e.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.markRedraw(),this.notClear=!1},e.prototype.clearTemporalDisplayables=function(){this._temporaryDisplayables=[]},e.prototype.addDisplayable=function(t,e){e?this._temporaryDisplayables.push(t):this._displayables.push(t),this.markRedraw()},e.prototype.addDisplayables=function(t,e){e=e||!1;for(var i=0;i<t.length;i++)this.addDisplayable(t[i],e)},e.prototype.getDisplayables=function(){return this._displayables},e.prototype.getTemporalDisplayables=function(){return this._temporaryDisplayables},e.prototype.eachPendingDisplayable=function(t){for(var e=this._cursor;e<this._displayables.length;e++)t&&t(this._displayables[e]);for(e=0;e<this._temporaryDisplayables.length;e++)t&&t(this._temporaryDisplayables[e])},e.prototype.update=function(){this.updateTransform();for(var t=this._cursor;t<this._displayables.length;t++){(e=this._displayables[t]).parent=this,e.update(),e.parent=null}for(t=0;t<this._temporaryDisplayables.length;t++){var e;(e=this._temporaryDisplayables[t]).parent=this,e.update(),e.parent=null}},e.prototype.getBoundingRect=function(){if(!this._rect){for(var t=new pM(1/0,1/0,-1/0,-1/0),e=0;e<this._displayables.length;e++){var i=this._displayables[e],n=i.getBoundingRect().clone();i.needLocalTransform()&&n.applyTransform(i.getLocalTransform(Ek)),t.union(n)}this._rect=t}return this._rect},e.prototype.contain=function(t,e){var i=this.transformCoordToLocal(t,e);if(this.getBoundingRect().contain(i[0],i[1]))for(var n=0;n<this._displayables.length;n++){if(this._displayables[n].contain(t,e))return!0}return!1},e}(gL),Mk=Sk,Tk=wP();function Ik(t,e,i,n,r){var o;if(e&&e.ecModel){var s=e.ecModel.getUpdatePayload();o=s&&s.animation}var a="update"===t;if(e&&e.isAnimationEnabled()){var l=void 0,c=void 0,u=void 0;return n?(l=BE(n.duration,200),c=BE(n.easing,"cubicOut"),u=0):(l=e.getShallow(a?"animationDurationUpdate":"animationDuration"),c=e.getShallow(a?"animationEasingUpdate":"animationEasing"),u=e.getShallow(a?"animationDelayUpdate":"animationDelay")),o&&(null!=o.duration&&(l=o.duration),null!=o.easing&&(c=o.easing),null!=o.delay&&(u=o.delay)),SE(u)&&(u=u(i,r)),SE(l)&&(l=l(i)),{duration:l||0,delay:u,easing:c}}return null}function Ck(t,e,i,n,r,o,s){var a,l=!1;SE(r)?(s=o,o=r,r=null):CE(r)&&(o=r.cb,s=r.during,l=r.isFrom,a=r.removeOpt,r=r.dataIndex);var c="leave"===t;c||e.stopAnimation("leave");var u=Ik(t,n,r,c?a||{}:null,n&&n.getAnimationDelayParams?n.getAnimationDelayParams(e,r):null);if(u&&u.duration>0){var h={duration:u.duration,delay:u.delay||0,easing:u.easing,done:o,force:!!o||!!s,setToFinal:!c,scope:t,during:s};l?e.animateFrom(i,h):e.animateTo(i,h)}else e.stopAnimation(),!l&&e.attr(i),s&&s(1),o&&o()}function Pk(t,e,i,n,r,o){Ck("update",t,e,i,n,r,o)}function Lk(t,e,i,n,r,o){Ck("enter",t,e,i,n,r,o)}function Dk(t){if(!t.__zr)return!0;for(var e=0;e<t.animators.length;e++){if("leave"===t.animators[e].scope)return!0}return!1}function Rk(t,e,i,n,r,o){Dk(t)||Ck("leave",t,e,i,n,r,o)}function Ok(t,e,i,n){t.removeTextContent(),t.removeTextGuideLine(),Rk(t,{style:{opacity:0}},e,i,n)}function kk(t,e,i){function n(){t.parent&&t.parent.remove(t)}t.isGroup?t.traverse((function(t){t.isGroup||Ok(t,e,i,n)})):Ok(t,e,i,n)}function Nk(t){Tk(t).oldStyle=t.style}var Bk=Math.max,zk=Math.min,Fk={};var Vk=function(t,e){var i=_O(t,e);return function(t){function e(e){var n=t.call(this,e)||this;return n.applyTransform=i.applyTransform,n.buildPath=i.buildPath,n}return zA(e,t),e}(yO)};function Uk(t,e){Fk[t]=e}function Gk(t){if(Fk.hasOwnProperty(t))return Fk[t]}function jk(t,e,i,n){var r=xO(t,e);return i&&("center"===n&&(i=Wk(i,r.getBoundingRect())),Xk(r,i)),r}function Hk(t,e,i){var n=new TD({style:{image:t,x:e.x,y:e.y,width:e.width,height:e.height},onload:function(t){if("center"===i){var r={width:t.width,height:t.height};n.setStyle(Wk(e,r))}}});return n}function Wk(t,e){var i,n=e.width/e.height,r=t.height*n;return i=r<=t.width?t.height:(r=t.width)/n,{x:t.x+t.width/2-r/2,y:t.y+t.height/2-i/2,width:r,height:i}}var qk=function(t,e){for(var i=[],n=t.length,r=0;r<n;r++){var o=t[r];i.push(o.getUpdatedPathProxy(!0))}var s=new xD(e);return s.createPathProxy(),s.buildPath=function(t){if(vO(t)){t.appendPath(i);var e=t.getContext();e&&t.rebuildPath(e,1)}},s};function Xk(t,e){if(t.applyTransform){var i=t.getBoundingRect().calculateTransform(e);t.applyTransform(i)}}function Zk(t,e){return CD(t,t,{lineWidth:e}),t}var Yk=LD;function Qk(t,e){for(var i=ZS([]);t&&t!==e;)QS(i,t.getLocalTransform(),i),t=t.parent;return i}function Jk(t,e,i){return e&&!gE(e)&&(e=KI.getLocalTransform(e)),i&&(e=tM([],e)),gS([],t,e)}function Kk(t,e,i){var n=0===e[4]||0===e[5]||0===e[0]?1:Math.abs(2*e[4]/e[0]),r=0===e[4]||0===e[5]||0===e[2]?1:Math.abs(2*e[4]/e[2]),o=["left"===t?-n:"right"===t?n:0,"top"===t?-r:"bottom"===t?r:0];return o=Jk(o,e,i),Math.abs(o[0])>Math.abs(o[1])?o[0]>0?"right":"left":o[1]>0?"bottom":"top"}function $k(t){return!t.isGroup}function tN(t,e,i){if(t&&e){var n,r=(n={},t.traverse((function(t){$k(t)&&t.anid&&(n[t.anid]=t)})),n);e.traverse((function(t){if($k(t)&&t.anid){var e=r[t.anid];if(e){var n=o(t);t.attr(o(e)),Pk(t,n,i,KD(t).dataIndex)}}}))}function o(t){var e={x:t.x,y:t.y,rotation:t.rotation};return function(t){return null!=t.shape}(t)&&(e.shape=pE({},t.shape)),e}}function eN(t,e){return vE(t,(function(t){var i=t[0];i=Bk(i,e.x),i=zk(i,e.x+e.width);var n=t[1];return n=Bk(n,e.y),[i,n=zk(n,e.y+e.height)]}))}function iN(t,e,i){var n=pE({rectHover:!0},e),r=n.style={strokeNoScale:!0};if(i=i||{x:-1,y:-1,width:2,height:2},t)return 0===t.indexOf("image://")?(r.image=t.slice(8),dE(r,i),new TD(n)):jk(t.replace("path://",""),n,i,"center")}function nN(t,e,i,n,r){for(var o=0,s=r[r.length-1];o<r.length;o++){var a=r[o];if(rN(t,e,i,n,a[0],a[1],s[0],s[1]))return!0;s=a}}function rN(t,e,i,n,r,o,s,a){var l,c=i-t,u=n-e,h=s-r,p=a-o,d=oN(h,p,c,u);if((l=d)<=1e-6&&l>=-1e-6)return!1;var f=t-r,m=e-o,g=oN(f,m,c,u)/d;if(g<0||g>1)return!1;var y=oN(f,m,h,p)/d;return!(y<0||y>1)}function oN(t,e,i,n){return t*n-i*e}function sN(t){var e=t.itemTooltipOption,i=t.componentModel,n=t.itemName,r=ME(e)?{formatter:e}:e,o=i.mainType,s=i.componentIndex,a={componentType:o,name:n,$vars:["name"]};a[o+"Index"]=s;var l=t.formatterParamsExtra;l&&yE(bE(l),(function(t){$E(a,t)||(a[t]=l[t],a.$vars.push(t))}));var c=KD(t.el);c.componentMainType=o,c.componentIndex=s,c.tooltipConfig={name:n,option:dE({content:n,formatterParams:a},r)}}function aN(t,e){var i;t.isGroup&&(i=e(t)),i||t.traverse(e)}function lN(t,e){if(t)if(EE(t))for(var i=0;i<t.length;i++)aN(t[i],e);else aN(t,e)}Uk("circle",EO),Uk("ellipse",TO),Uk("sector",jO),Uk("ring",qO),Uk("polygon",QO),Uk("polyline",$O),Uk("rect",kD),Uk("line",nk),Uk("bezierCurve",lk),Uk("arc",hk);var cN=Object.freeze({__proto__:null,updateProps:Pk,initProps:Lk,removeElement:Rk,removeElementWithFadeOut:kk,isElementRemoved:Dk,extendShape:function(t){return xD.extend(t)},extendPath:function(t,e){return Vk(t,e)},registerShape:Uk,getShapeClass:Gk,makePath:jk,makeImage:Hk,mergePath:qk,resizePath:Xk,subPixelOptimizeLine:Zk,subPixelOptimizeRect:function(t){return PD(t.shape,t.shape,t.style),t},subPixelOptimize:Yk,getTransform:Qk,applyTransform:Jk,transformDirection:Kk,groupTransition:tN,clipPointsByRect:eN,clipRectByRect:function(t,e){var i=Bk(t.x,e.x),n=zk(t.x+t.width,e.x+e.width),r=Bk(t.y,e.y),o=zk(t.y+t.height,e.y+e.height);if(n>=i&&o>=r)return{x:i,y:r,width:n-i,height:o-r}},createIcon:iN,linePolygonIntersect:nN,lineLineIntersect:rN,setTooltipConfig:sN,traverseElements:lN,Group:xC,Image:TD,Text:JD,Circle:EO,Ellipse:TO,Sector:jO,Ring:qO,Polygon:QO,Polyline:$O,Rect:kD,Line:nk,BezierCurve:lk,Arc:hk,IncrementalDisplayable:Mk,CompoundPath:dk,LinearGradient:mk,RadialGradient:yk,BoundingRect:pM,OrientedBoundingRect:Ak,Point:iM,Path:xD}),uN={};function hN(t,e){for(var i=0;i<aR.length;i++){var n=aR[i],r=e[n],o=t.ensureState(n);o.style=o.style||{},o.style.text=r}var s=t.currentStates.slice();t.clearStates(!0),t.setStyle({text:e.normal}),t.useStates(s,!0)}function pN(t,e,i){var n,r=t.labelFetcher,o=t.labelDataIndex,s=t.labelDimIndex,a=e.normal;r&&(n=r.getFormattedLabel(o,"normal",null,s,a&&a.get("formatter"),null!=i?{interpolatedValue:i}:null)),null==n&&(n=SE(t.defaultText)?t.defaultText(o,t,i):t.defaultText);for(var l={normal:n},c=0;c<aR.length;c++){var u=aR[c],h=e[u];l[u]=BE(r?r.getFormattedLabel(o,u,null,s,h&&h.get("formatter")):null,n)}return l}function dN(t,e,i,n){i=i||uN;for(var r=t instanceof JD,o=!1,s=0;s<lR.length;s++){if((p=e[lR[s]])&&p.getShallow("show")){o=!0;break}}var a=r?t:t.getTextContent();if(o){r||(a||(a=new JD,t.setTextContent(a)),t.stateProxy&&(a.stateProxy=t.stateProxy));var l=pN(i,e),c=e.normal,u=!!c.getShallow("show"),h=mN(c,n&&n.normal,i,!1,!r);h.text=l.normal,r||t.setTextConfig(gN(c,i,!1));for(s=0;s<aR.length;s++){var p,d=aR[s];if(p=e[d]){var f=a.ensureState(d),m=!!BE(p.getShallow("show"),u);if(m!==u&&(f.ignore=!m),f.style=mN(p,n&&n[d],i,!0,!r),f.style.text=l[d],!r)t.ensureState(d).textConfig=gN(p,i,!0)}}a.silent=!!c.getShallow("silent"),null!=a.style.x&&(h.x=a.style.x),null!=a.style.y&&(h.y=a.style.y),a.ignore=!u,a.useStyle(h),a.dirty(),i.enableTextSetter&&(wN(a).setLabelText=function(t){var n=pN(i,e,t);hN(a,n)})}else a&&(a.ignore=!0);t.dirty()}function fN(t,e){e=e||"label";for(var i={normal:t.getModel(e)},n=0;n<aR.length;n++){var r=aR[n];i[r]=t.getModel([r,e])}return i}function mN(t,e,i,n,r){var o={};return function(t,e,i,n,r){i=i||uN;var o,s=e.ecModel,a=s&&s.option.textStyle,l=function(t){var e;for(;t&&t!==t.ecModel;){var i=(t.option||uN).rich;if(i){e=e||{};for(var n=bE(i),r=0;r<n.length;r++){e[n[r]]=1}}t=t.parentModel}return e}(e);if(l)for(var c in o={},l)if(l.hasOwnProperty(c)){var u=e.getModel(["rich",c]);xN(o[c]={},u,a,i,n,r,!1,!0)}o&&(t.rich=o);var h=e.get("overflow");h&&(t.overflow=h);var p=e.get("minMargin");null!=p&&(t.margin=p);xN(t,e,a,i,n,r,!0,!1)}(o,t,i,n,r),e&&pE(o,e),o}function gN(t,e,i){e=e||{};var n,r={},o=t.getShallow("rotate"),s=BE(t.getShallow("distance"),i?null:5),a=t.getShallow("offset");return"outside"===(n=t.getShallow("position")||(i?null:"inside"))&&(n=e.defaultOutsidePosition||"top"),null!=n&&(r.position=n),null!=a&&(r.offset=a),null!=o&&(o*=Math.PI/180,r.rotation=o),null!=s&&(r.distance=s),r.outsideFill="inherit"===t.get("color")?e.inheritColor||null:"auto",r}var yN=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],vN=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],_N=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];function xN(t,e,i,n,r,o,s,a){i=!r&&i||uN;var l=n&&n.inheritColor,c=e.getShallow("color"),u=e.getShallow("textBorderColor"),h=BE(e.getShallow("opacity"),i.opacity);"inherit"!==c&&"auto"!==c||("production"!==process.env.NODE_ENV&&"auto"===c&&iP("color: 'auto'","color: 'inherit'"),c=l||null),"inherit"!==u&&"auto"!==u||("production"!==process.env.NODE_ENV&&"auto"===u&&iP("color: 'auto'","color: 'inherit'"),u=l||null),o||(c=c||i.color,u=u||i.textBorderColor),null!=c&&(t.fill=c),null!=u&&(t.stroke=u);var p=BE(e.getShallow("textBorderWidth"),i.textBorderWidth);null!=p&&(t.lineWidth=p);var d=BE(e.getShallow("textBorderType"),i.textBorderType);null!=d&&(t.lineDash=d);var f=BE(e.getShallow("textBorderDashOffset"),i.textBorderDashOffset);null!=f&&(t.lineDashOffset=f),r||null!=h||a||(h=n&&n.defaultOpacity),null!=h&&(t.opacity=h),r||o||null==t.fill&&n.inheritColor&&(t.fill=n.inheritColor);for(var m=0;m<yN.length;m++){var g=yN[m];null!=(v=BE(e.getShallow(g),i[g]))&&(t[g]=v)}for(m=0;m<vN.length;m++){g=vN[m];null!=(v=e.getShallow(g))&&(t[g]=v)}if(null==t.verticalAlign){var y=e.getShallow("baseline");null!=y&&(t.verticalAlign=y)}if(!s||!n.disableBox){for(m=0;m<_N.length;m++){var v;g=_N[m];null!=(v=e.getShallow(g))&&(t[g]=v)}var _=e.getShallow("borderType");null!=_&&(t.borderDash=_),"auto"!==t.backgroundColor&&"inherit"!==t.backgroundColor||!l||("production"!==process.env.NODE_ENV&&"auto"===t.backgroundColor&&iP("backgroundColor: 'auto'","backgroundColor: 'inherit'"),t.backgroundColor=l),"auto"!==t.borderColor&&"inherit"!==t.borderColor||!l||("production"!==process.env.NODE_ENV&&"auto"===t.borderColor&&iP("borderColor: 'auto'","borderColor: 'inherit'"),t.borderColor=l)}}function bN(t,e){var i=e&&e.getModel("textStyle");return GE([t.fontStyle||i&&i.getShallow("fontStyle")||"",t.fontWeight||i&&i.getShallow("fontWeight")||"",(t.fontSize||i&&i.getShallow("fontSize")||12)+"px",t.fontFamily||i&&i.getShallow("fontFamily")||"sans-serif"].join(" "))}var wN=wP();function AN(t,e,i,n){if(t){var r=wN(t);r.prevValue=r.value,r.value=i;var o=e.normal;r.valueAnimation=o.get("valueAnimation"),r.valueAnimation&&(r.precision=o.get("precision"),r.defaultInterpolatedText=n,r.statesModels=e)}}function EN(t,e,i,n,r){var o=wN(t);if(o.valueAnimation&&o.prevValue!==o.value){var s=o.defaultInterpolatedText,a=BE(o.interpolatedValue,o.prevValue),l=o.value;t.percent=0,(null==o.prevValue?Lk:Pk)(t,{percent:1},n,e,null,(function(n){var c=LP(i,o.precision,a,l,n);o.interpolatedValue=1===n?null:c;var u=pN({labelDataIndex:e,labelFetcher:r,defaultText:s?s(c):c+""},o.statesModels,c);hN(t,u)}))}}var SN,MN,TN=["textStyle","color"],IN=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],CN=new JD,PN=function(){function t(){}return t.prototype.getTextColor=function(t){var e=this.ecModel;return this.getShallow("color")||(!t&&e?e.get(TN):null)},t.prototype.getFont=function(){return bN({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},t.prototype.getTextRect=function(t){for(var e={text:t,verticalAlign:this.getShallow("verticalAlign")||this.getShallow("baseline")},i=0;i<IN.length;i++)e[IN[i]]=this.getShallow(IN[i]);return CN.useStyle(e),CN.update(),CN.getBoundingRect()},t}(),LN=PN,DN=[["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","type"],["lineDashOffset","dashOffset"],["lineCap","cap"],["lineJoin","join"],["miterLimit"]],RN=GP(DN),ON=function(){function t(){}return t.prototype.getLineStyle=function(t){return RN(this,t)},t}(),kN=[["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","borderType"],["lineDashOffset","borderDashOffset"],["lineCap","borderCap"],["lineJoin","borderJoin"],["miterLimit","borderMiterLimit"]],NN=GP(kN),BN=function(){function t(){}return t.prototype.getItemStyle=function(t,e){return NN(this,t,e)},t}(),zN=function(){function t(t,e,i){this.parentModel=e,this.ecModel=i,this.option=t}return t.prototype.init=function(t,e,i){},t.prototype.mergeOption=function(t,e){uE(this.option,t,!0)},t.prototype.get=function(t,e){return null==t?this.option:this._doGet(this.parsePath(t),!e&&this.parentModel)},t.prototype.getShallow=function(t,e){var i=this.option,n=null==i?i:i[t];if(null==n&&!e){var r=this.parentModel;r&&(n=r.getShallow(t))}return n},t.prototype.getModel=function(e,i){var n=null!=e,r=n?this.parsePath(e):null;return new t(n?this._doGet(r):this.option,i=i||this.parentModel&&this.parentModel.getModel(this.resolveParentPath(r)),this.ecModel)},t.prototype.isEmpty=function(){return null==this.option},t.prototype.restoreData=function(){},t.prototype.clone=function(){return new(0,this.constructor)(cE(this.option))},t.prototype.parsePath=function(t){return"string"==typeof t?t.split("."):t},t.prototype.resolveParentPath=function(t){return t},t.prototype.isAnimationEnabled=function(){if(!UA.node&&this.option){if(null!=this.option.animation)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}},t.prototype._doGet=function(t,e){var i=this.option;if(!t)return i;for(var n=0;n<t.length&&(!t[n]||null!=(i=i&&"object"==typeof i?i[t[n]]:null));n++);return null==i&&e&&(i=e._doGet(this.resolveParentPath(t),e.parentModel)),i},t}();NP(zN),SN=zN,MN=["__\0is_clz",zP++].join("_"),SN.prototype[MN]=!0,"production"!==process.env.NODE_ENV&&UE(!SN.isInstance,'The method "is" can not be defined.'),SN.isInstance=function(t){return!(!t||!t[MN])},mE(zN,ON),mE(zN,BN),mE(zN,HP),mE(zN,LN);var FN=zN,VN=Math.round(10*Math.random());function UN(t){return[t||"",VN++].join("_")}function GN(t,e){return uE(uE({},t,!0),e,!0)}var jN="ZH",HN="EN",WN=HN,qN={},XN={},ZN=UA.domSupported&&(document.documentElement.lang||navigator.language||navigator.browserLanguage).toUpperCase().indexOf(jN)>-1?jN:WN;function YN(t,e){t=t.toUpperCase(),XN[t]=new FN(e),qN[t]=e}function QN(t){return XN[t]}YN(HN,{time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}}),YN(jN,{time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}});var JN=1e3,KN=60*JN,$N=60*KN,tB=24*$N,eB=365*tB,iB={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},nB="{yyyy}-{MM}-{dd}",rB={year:"{yyyy}",month:"{yyyy}-{MM}",day:nB,hour:nB+" "+iB.hour,minute:nB+" "+iB.minute,second:nB+" "+iB.second,millisecond:iB.none},oB=["year","month","day","hour","minute","second","millisecond"],sB=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function aB(t,e){return"0000".substr(0,e-(t+="").length)+t}function lB(t){switch(t){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return t}}function cB(t){return t===lB(t)}function uB(t,e,i,n){var r=FC(t),o=r[dB(i)](),s=r[fB(i)]()+1,a=Math.floor((s-1)/3)+1,l=r[mB(i)](),c=r["get"+(i?"UTC":"")+"Day"](),u=r[gB(i)](),h=(u-1)%12+1,p=r[yB(i)](),d=r[vB(i)](),f=r[_B(i)](),m=(n instanceof FN?n:QN(n||ZN)||XN[WN]).getModel("time"),g=m.get("month"),y=m.get("monthAbbr"),v=m.get("dayOfWeek"),_=m.get("dayOfWeekAbbr");return(e||"").replace(/{yyyy}/g,o+"").replace(/{yy}/g,aB(o%100+"",2)).replace(/{Q}/g,a+"").replace(/{MMMM}/g,g[s-1]).replace(/{MMM}/g,y[s-1]).replace(/{MM}/g,aB(s,2)).replace(/{M}/g,s+"").replace(/{dd}/g,aB(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,v[c]).replace(/{ee}/g,_[c]).replace(/{e}/g,c+"").replace(/{HH}/g,aB(u,2)).replace(/{H}/g,u+"").replace(/{hh}/g,aB(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,aB(p,2)).replace(/{m}/g,p+"").replace(/{ss}/g,aB(d,2)).replace(/{s}/g,d+"").replace(/{SSS}/g,aB(f,3)).replace(/{S}/g,f+"")}function hB(t,e){var i=FC(t),n=i[fB(e)]()+1,r=i[mB(e)](),o=i[gB(e)](),s=i[yB(e)](),a=i[vB(e)](),l=0===i[_B(e)](),c=l&&0===a,u=c&&0===s,h=u&&0===o,p=h&&1===r;return p&&1===n?"year":p?"month":h?"day":u?"hour":c?"minute":l?"second":"millisecond"}function pB(t,e,i){var n=IE(t)?FC(t):t;switch(e=e||hB(t,i)){case"year":return n[dB(i)]();case"half-year":return n[fB(i)]()>=6?1:0;case"quarter":return Math.floor((n[fB(i)]()+1)/4);case"month":return n[fB(i)]();case"day":return n[mB(i)]();case"half-day":return n[gB(i)]()/24;case"hour":return n[gB(i)]();case"minute":return n[yB(i)]();case"second":return n[vB(i)]();case"millisecond":return n[_B(i)]()}}function dB(t){return t?"getUTCFullYear":"getFullYear"}function fB(t){return t?"getUTCMonth":"getMonth"}function mB(t){return t?"getUTCDate":"getDate"}function gB(t){return t?"getUTCHours":"getHours"}function yB(t){return t?"getUTCMinutes":"getMinutes"}function vB(t){return t?"getUTCSeconds":"getSeconds"}function _B(t){return t?"getUTCMilliseconds":"getMilliseconds"}function xB(t){return t?"setUTCFullYear":"setFullYear"}function bB(t){return t?"setUTCMonth":"setMonth"}function wB(t){return t?"setUTCDate":"setDate"}function AB(t){return t?"setUTCHours":"setHours"}function EB(t){return t?"setUTCMinutes":"setMinutes"}function SB(t){return t?"setUTCSeconds":"setSeconds"}function MB(t){return t?"setUTCMilliseconds":"setMilliseconds"}function TB(t){if(!WC(t))return ME(t)?t:"-";var e=(t+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function IB(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()})),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}var CB=VE;function PB(t,e,i){function n(t){return t&&GE(t)?t:"-"}function r(t){return!(null==t||isNaN(t)||!isFinite(t))}var o="time"===e,s=t instanceof Date;if(o||s){var a=o?FC(t):t;if(!isNaN(+a))return uB(a,"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}",i);if(s)return"-"}if("ordinal"===e)return TE(t)?n(t):IE(t)&&r(t)?t+"":"-";var l=HC(t);return r(l)?TB(l):TE(t)?n(t):"boolean"==typeof t?t+"":"-"}var LB=["a","b","c","d","e","f","g"],DB=function(t,e){return"{"+t+(null==e?"":e)+"}"};function RB(t,e,i){EE(e)||(e=[e]);var n=e.length;if(!n)return"";for(var r=e[0].$vars||[],o=0;o<r.length;o++){var s=LB[o];t=t.replace(DB(s),DB(s,0))}for(var a=0;a<n;a++)for(var l=0;l<r.length;l++){var c=e[a][r[l]];t=t.replace(DB(LB[l],a),i?RS(c):c)}return t}function OB(t,e){return e=e||"transparent",ME(t)?t:CE(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}function kB(t,e){if("_blank"===e||"blank"===e){var i=window.open();i.opener=null,i.location.href=t}else window.open(t,e)}var NB=yE,BB=["left","right","top","bottom","width","height"],zB=[["width","left","right"],["height","top","bottom"]];function FB(t,e,i,n,r){var o=0,s=0;null==n&&(n=1/0),null==r&&(r=1/0);var a=0;e.eachChild((function(l,c){var u,h,p=l.getBoundingRect(),d=e.childAt(c+1),f=d&&d.getBoundingRect();if("horizontal"===t){var m=p.width+(f?-f.x+p.x:0);(u=o+m)>n||l.newline?(o=0,u=m,s+=a+i,a=p.height):a=Math.max(a,p.height)}else{var g=p.height+(f?-f.y+p.y:0);(h=s+g)>r||l.newline?(o+=a+i,s=0,h=g,a=p.width):a=Math.max(a,p.width)}l.newline||(l.x=o,l.y=s,l.markRedraw(),"horizontal"===t?o=u+i:s=h+i)}))}var VB=FB;function UB(t,e,i){i=CB(i||0);var n=e.width,r=e.height,o=IC(t.left,n),s=IC(t.top,r),a=IC(t.right,n),l=IC(t.bottom,r),c=IC(t.width,n),u=IC(t.height,r),h=i[2]+i[0],p=i[1]+i[3],d=t.aspect;switch(isNaN(c)&&(c=n-a-p-o),isNaN(u)&&(u=r-l-h-s),null!=d&&(isNaN(c)&&isNaN(u)&&(d>n/r?c=.8*n:u=.8*r),isNaN(c)&&(c=d*u),isNaN(u)&&(u=c/d)),isNaN(o)&&(o=n-a-c-p),isNaN(s)&&(s=r-l-u-h),t.left||t.right){case"center":o=n/2-c/2-i[3];break;case"right":o=n-c-p}switch(t.top||t.bottom){case"middle":case"center":s=r/2-u/2-i[0];break;case"bottom":s=r-u-h}o=o||0,s=s||0,isNaN(c)&&(c=n-p-o-(a||0)),isNaN(u)&&(u=r-h-s-(l||0));var f=new pM(o+i[3],s+i[0],c,u);return f.margin=i,f}function GB(t,e,i,n,r,o){var s,a=!r||!r.hv||r.hv[0],l=!r||!r.hv||r.hv[1],c=r&&r.boundingMode||"all";if((o=o||t).x=t.x,o.y=t.y,!a&&!l)return!1;if("raw"===c)s="group"===t.type?new pM(0,0,+e.width||0,+e.height||0):t.getBoundingRect();else if(s=t.getBoundingRect(),t.needLocalTransform()){var u=t.getLocalTransform();(s=s.clone()).applyTransform(u)}var h=UB(dE({width:s.width,height:s.height},e),i,n),p=a?h.x-s.x:0,d=l?h.y-s.y:0;return"raw"===c?(o.x=p,o.y=d):(o.x+=p,o.y+=d),o===t&&t.markRedraw(),!0}function jB(t){var e=t.layoutMode||t.constructor.layoutMode;return CE(e)?e:e?{type:e}:null}function HB(t,e,i){var n=i&&i.ignoreSize;!EE(n)&&(n=[n,n]);var r=s(zB[0],0),o=s(zB[1],1);function s(i,r){var o={},s=0,c={},u=0;if(NB(i,(function(e){c[e]=t[e]})),NB(i,(function(t){a(e,t)&&(o[t]=c[t]=e[t]),l(o,t)&&s++,l(c,t)&&u++})),n[r])return l(e,i[1])?c[i[2]]=null:l(e,i[2])&&(c[i[1]]=null),c;if(2!==u&&s){if(s>=2)return o;for(var h=0;h<i.length;h++){var p=i[h];if(!a(o,p)&&a(t,p)){o[p]=t[p];break}}return o}return c}function a(t,e){return t.hasOwnProperty(e)}function l(t,e){return null!=t[e]&&"auto"!==t[e]}function c(t,e,i){NB(t,(function(t){e[t]=i[t]}))}c(zB[0],t,r),c(zB[1],t,o)}function WB(t){return qB({},t)}function qB(t,e){return e&&t&&NB(BB,(function(i){e.hasOwnProperty(i)&&(t[i]=e[i])})),t}AE(FB,"vertical"),AE(FB,"horizontal");var XB=wP(),ZB=function(t){function e(e,i,n){var r=t.call(this,e,i,n)||this;return r.uid=UN("ec_cpt_model"),r}return zA(e,t),e.prototype.init=function(t,e,i){this.mergeDefaultAndTheme(t,i)},e.prototype.mergeDefaultAndTheme=function(t,e){var i=jB(this),n=i?WB(t):{};uE(t,e.getTheme().get(this.mainType)),uE(t,this.getDefaultOption()),i&&HB(t,n,i)},e.prototype.mergeOption=function(t,e){uE(this.option,t,!0);var i=jB(this);i&&HB(this.option,t,i)},e.prototype.optionUpdated=function(t,e){},e.prototype.getDefaultOption=function(){var t=this.constructor;if(!function(t){return!(!t||!t[OP])}(t))return t.defaultOption;var e=XB(this);if(!e.defaultOption){for(var i=[],n=t;n;){var r=n.prototype.defaultOption;r&&i.push(r),n=n.superClass}for(var o={},s=i.length-1;s>=0;s--)o=uE(o,i[s],!0);e.defaultOption=o}return e.defaultOption},e.prototype.getReferringComponents=function(t,e){var i=t+"Index",n=t+"Id";return IP(this.ecModel,t,{index:this.get(i,!0),id:this.get(n,!0)},e)},e.prototype.getBoxLayoutParams=function(){var t=this;return{left:t.get("left"),top:t.get("top"),right:t.get("right"),bottom:t.get("bottom"),width:t.get("width"),height:t.get("height")}},e.prototype.getZLevelKey=function(){return""},e.prototype.setZLevel=function(t){this.option.zlevel=t},e.protoInitialize=function(){var t=e.prototype;t.type="component",t.id="",t.name="",t.mainType="",t.subType="",t.componentIndex=0}(),e}(FN);BP(ZB,FN),UP(ZB),function(t){var e={};t.registerSubTypeDefaulter=function(t,i){var n=kP(t);e[n.main]=i},t.determineSubType=function(i,n){var r=n.type;if(!r){var o=kP(i).main;t.hasSubTypes(i)&&e[o]&&(r=e[o](n))}return r}}(ZB),function(t,e){function i(t,e){return t[e]||(t[e]={predecessor:[],successor:[]}),t[e]}t.topologicalTravel=function(t,n,r,o){if(t.length){var s=function(t){var n={},r=[];return yE(t,(function(o){var s=i(n,o),a=function(t,e){var i=[];return yE(t,(function(t){fE(e,t)>=0&&i.push(t)})),i}(s.originalDeps=e(o),t);s.entryCount=a.length,0===s.entryCount&&r.push(o),yE(a,(function(t){fE(s.predecessor,t)<0&&s.predecessor.push(t);var e=i(n,t);fE(e.successor,t)<0&&e.successor.push(o)}))})),{graph:n,noEntryList:r}}(n),a=s.graph,l=s.noEntryList,c={};for(yE(t,(function(t){c[t]=!0}));l.length;){var u=l.pop(),h=a[u],p=!!c[u];p&&(r.call(o,u,h.originalDeps.slice()),delete c[u]),yE(h.successor,p?f:d)}yE(c,(function(){var e="";throw"production"!==process.env.NODE_ENV&&(e=nP("Circular dependency may exists: ",c,t,n)),new Error(e)}))}function d(t){a[t].entryCount--,0===a[t].entryCount&&l.push(t)}function f(t){c[t]=!0,d(t)}}}(ZB,(function(t){var e=[];yE(ZB.getClassesByMainType(t),(function(t){e=e.concat(t.dependencies||t.prototype.dependencies||[])})),e=vE(e,(function(t){return kP(t).main})),"dataset"!==t&&fE(e,"dataset")<=0&&e.unshift("dataset");return e}));var YB=ZB,QB="";"undefined"!=typeof navigator&&(QB=navigator.platform||"");var JB="rgba(0, 0, 0, 0.2)",KB={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:JB,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:JB,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:JB,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:JB,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:JB,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:JB,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:QB.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1},$B=YE(["tooltip","label","itemName","itemId","itemGroupId","seriesName"]),tz="original",ez="arrayRows",iz="objectRows",nz="keyedColumns",rz="typedArray",oz="unknown",sz="column",az="row",lz={Must:1,Might:2,Not:3},cz=wP();function uz(t,e,i){var n={},r=pz(e);if(!r||!t)return n;var o,s,a=[],l=[],c=e.ecModel,u=cz(c).datasetMap,h=r.uid+"_"+i.seriesLayoutBy;yE(t=t.slice(),(function(e,i){var r=CE(e)?e:t[i]={name:e};"ordinal"===r.type&&null==o&&(o=i,s=f(r)),n[r.name]=[]}));var p=u.get(h)||u.set(h,{categoryWayDim:s,valueWayDim:0});function d(t,e,i){for(var n=0;n<i;n++)t.push(e+n)}function f(t){var e=t.dimsDef;return e?e.length:1}return yE(t,(function(t,e){var i=t.name,r=f(t);if(null==o){var s=p.valueWayDim;d(n[i],s,r),d(l,s,r),p.valueWayDim+=r}else if(o===e)d(n[i],0,r),d(a,0,r);else{s=p.categoryWayDim;d(n[i],s,r),d(l,s,r),p.categoryWayDim+=r}})),a.length&&(n.itemName=a),l.length&&(n.seriesName=l),n}function hz(t,e,i){var n={};if(!pz(t))return n;var r,o=e.sourceFormat,s=e.dimensionsDefine;o!==iz&&o!==nz||yE(s,(function(t,e){"name"===(CE(t)?t.name:t)&&(r=e)}));var a=function(){for(var t={},n={},a=[],l=0,c=Math.min(5,i);l<c;l++){var u=fz(e.data,o,e.seriesLayoutBy,s,e.startIndex,l);a.push(u);var h=u===lz.Not;if(h&&null==t.v&&l!==r&&(t.v=l),(null==t.n||t.n===t.v||!h&&a[t.n]===lz.Not)&&(t.n=l),p(t)&&a[t.n]!==lz.Not)return t;h||(u===lz.Might&&null==n.v&&l!==r&&(n.v=l),null!=n.n&&n.n!==n.v||(n.n=l))}function p(t){return null!=t.v&&null!=t.n}return p(t)?t:p(n)?n:null}();if(a){n.value=[a.v];var l=null!=r?r:a.n;n.itemName=[l],n.seriesName=[l]}return n}function pz(t){if(!t.get("data",!0))return IP(t.ecModel,"dataset",{index:t.get("datasetIndex",!0),id:t.get("datasetId",!0)},MP).models[0]}function dz(t,e){return fz(t.data,t.sourceFormat,t.seriesLayoutBy,t.dimensionsDefine,t.startIndex,e)}function fz(t,e,i,n,r,o){var s,a,l;if(LE(t))return lz.Not;if(n){var c=n[o];CE(c)?(a=c.name,l=c.type):ME(c)&&(a=c)}if(null!=l)return"ordinal"===l?lz.Must:lz.Not;if(e===ez){var u=t;if(i===az){for(var h=u[o],p=0;p<(h||[]).length&&p<5;p++)if(null!=(s=_(h[r+p])))return s}else for(p=0;p<u.length&&p<5;p++){var d=u[r+p];if(d&&null!=(s=_(d[o])))return s}}else if(e===iz){var f=t;if(!a)return lz.Not;for(p=0;p<f.length&&p<5;p++){if((y=f[p])&&null!=(s=_(y[a])))return s}}else if(e===nz){var m=t;if(!a)return lz.Not;if(!(h=m[a])||LE(h))return lz.Not;for(p=0;p<h.length&&p<5;p++)if(null!=(s=_(h[p])))return s}else if(e===tz){var g=t;for(p=0;p<g.length&&p<5;p++){var y,v=hP(y=g[p]);if(!EE(v))return lz.Not;if(null!=(s=_(v[o])))return s}}function _(t){var e=ME(t);return null!=t&&isFinite(t)&&""!==t?e?lz.Might:lz.Not:e&&"-"!==t?lz.Must:void 0}return lz.Not}var mz=YE();var gz,yz,vz,_z=wP(),xz=wP(),bz=function(){function t(){}return t.prototype.getColorFromPalette=function(t,e,i){var n=lP(this.get("color",!0)),r=this.get("colorLayer",!0);return Az(this,_z,n,r,t,e,i)},t.prototype.clearColorPalette=function(){!function(t,e){e(t).paletteIdx=0,e(t).paletteNameMap={}}(this,_z)},t}();function wz(t,e,i,n){var r=lP(t.get(["aria","decal","decals"]));return Az(t,xz,r,null,e,i,n)}function Az(t,e,i,n,r,o,s){var a=e(o=o||t),l=a.paletteIdx||0,c=a.paletteNameMap=a.paletteNameMap||{};if(c.hasOwnProperty(r))return c[r];var u=null!=s&&n?function(t,e){for(var i=t.length,n=0;n<i;n++)if(t[n].length>e)return t[n];return t[i-1]}(n,s):i;if((u=u||i)&&u.length){var h=u[l];return r&&(c[r]=h),a.paletteIdx=(l+1)%u.length,h}}var Ez="\0_ec_inner",Sz={grid:"GridComponent",polar:"PolarComponent",geo:"GeoComponent",singleAxis:"SingleAxisComponent",parallel:"ParallelComponent",calendar:"CalendarComponent",graphic:"GraphicComponent",toolbox:"ToolboxComponent",tooltip:"TooltipComponent",axisPointer:"AxisPointerComponent",brush:"BrushComponent",title:"TitleComponent",timeline:"TimelineComponent",markPoint:"MarkPointComponent",markLine:"MarkLineComponent",markArea:"MarkAreaComponent",legend:"LegendComponent",dataZoom:"DataZoomComponent",visualMap:"VisualMapComponent",xAxis:"GridComponent",yAxis:"GridComponent",angleAxis:"PolarComponent",radiusAxis:"PolarComponent"},Mz={line:"LineChart",bar:"BarChart",pie:"PieChart",scatter:"ScatterChart",radar:"RadarChart",map:"MapChart",tree:"TreeChart",treemap:"TreemapChart",graph:"GraphChart",gauge:"GaugeChart",funnel:"FunnelChart",parallel:"ParallelChart",sankey:"SankeyChart",boxplot:"BoxplotChart",candlestick:"CandlestickChart",effectScatter:"EffectScatterChart",lines:"LinesChart",heatmap:"HeatmapChart",pictorialBar:"PictorialBarChart",themeRiver:"ThemeRiverChart",sunburst:"SunburstChart",custom:"CustomChart"},Tz={};var Iz=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return zA(e,t),e.prototype.init=function(t,e,i,n,r,o){n=n||{},this.option=null,this._theme=new FN(n),this._locale=new FN(r),this._optionManager=o},e.prototype.setOption=function(t,e,i){"production"!==process.env.NODE_ENV&&(UE(null!=t,"option is null/undefined"),UE(1!==t[Ez],"please use chart.getOption()"));var n=Lz(e);this._optionManager.setOption(t,i,n),this._resetOption(null,n)},e.prototype.resetOption=function(t,e){return this._resetOption(t,Lz(e))},e.prototype._resetOption=function(t,e){var i=!1,n=this._optionManager;if(!t||"recreate"===t){var r=n.mountOption("recreate"===t);"production"!==process.env.NODE_ENV&&yE(r,(function(t,e){if(!YB.hasClass(e)){var i=Sz[e];i&&!Tz[i]&&(tP("Component "+e+" is used but not imported.\nimport { "+i+" } from 'echarts/components';\necharts.use(["+i+"]);"),Tz[i]=!0)}})),this.option&&"recreate"!==t?(this.restoreData(),this._mergeOption(r,e)):vz(this,r),i=!0}if("timeline"!==t&&"media"!==t||this.restoreData(),!t||"recreate"===t||"timeline"===t){var o=n.getTimelineOption(this);o&&(i=!0,this._mergeOption(o,e))}if(!t||"recreate"===t||"media"===t){var s=n.getMediaOption(this);s.length&&yE(s,(function(t){i=!0,this._mergeOption(t,e)}),this)}return i},e.prototype.mergeOption=function(t){this._mergeOption(t,null)},e.prototype._mergeOption=function(t,e){var i=this.option,n=this._componentsMap,r=this._componentsCount,o=[],s=YE(),a=e&&e.replaceMergeMainTypeMap;cz(this).datasetMap=YE(),yE(t,(function(t,e){null!=t&&(YB.hasClass(e)?e&&(o.push(e),s.set(e,!0)):i[e]=null==i[e]?cE(t):uE(i[e],t,!0))})),a&&a.each((function(t,e){YB.hasClass(e)&&!s.get(e)&&(o.push(e),s.set(e,!0))})),YB.topologicalTravel(o,YB.getAllClassMainTypes(),(function(e){var o=function(t,e,i){var n=mz.get(e);if(!n)return i;var r=n(t);if(!r)return i;if("production"!==process.env.NODE_ENV)for(var o=0;o<r.length;o++)UE(xP(r[o]));return i.concat(r)}(this,e,lP(t[e])),s=n.get(e),l=s?a&&a.get(e)?"replaceMerge":"normalMerge":"replaceAll",c=dP(s,o,l);(function(t,e,i){yE(t,(function(t){var n=t.newOption;CE(n)&&(t.keyInfo.mainType=e,t.keyInfo.subType=function(t,e,i,n){return e.type?e.type:i?i.subType:n.determineSubType(t,e)}(e,n,t.existing,i))}))})(c,e,YB),i[e]=null,n.set(e,null),r.set(e,0);var u,h,p=[],d=[],f=0;yE(c,(function(t,i){var n=t.existing,r=t.newOption;if(r){var o="series"===e,s=YB.getClass(e,t.keyInfo.subType,!o);if(!s){if("production"!==process.env.NODE_ENV){var a=t.keyInfo.subType,l=Mz[a];Tz[a]||(Tz[a]=!0,tP(l?"Series "+a+" is used but not imported.\nimport { "+l+" } from 'echarts/charts';\necharts.use(["+l+"]);":"Unknown series "+a))}return}if("tooltip"===e){if(u)return void("production"!==process.env.NODE_ENV&&(h||($C("Currently only one tooltip component is allowed."),h=!0)));u=!0}if(n&&n.constructor===s)n.name=t.keyInfo.name,n.mergeOption(r,this),n.optionUpdated(r,!1);else{var c=pE({componentIndex:i},t.keyInfo);pE(n=new s(r,this,this,c),c),t.brandNew&&(n.__requireNewView=!0),n.init(r,this,this),n.optionUpdated(null,!0)}}else n&&(n.mergeOption({},this),n.optionUpdated({},!1));n?(p.push(n.option),d.push(n),f++):(p.push(void 0),d.push(void 0))}),this),i[e]=p,n.set(e,d),r.set(e,f),"series"===e&&gz(this)}),this),this._seriesIndices||gz(this)},e.prototype.getOption=function(){var t=cE(this.option);return yE(t,(function(e,i){if(YB.hasClass(i)){for(var n=lP(e),r=n.length,o=!1,s=r-1;s>=0;s--)n[s]&&!xP(n[s])?o=!0:(n[s]=null,!o&&r--);n.length=r,t[i]=n}})),delete t[Ez],t},e.prototype.getTheme=function(){return this._theme},e.prototype.getLocaleModel=function(){return this._locale},e.prototype.setUpdatePayload=function(t){this._payload=t},e.prototype.getUpdatePayload=function(){return this._payload},e.prototype.getComponent=function(t,e){var i=this._componentsMap.get(t);if(i){var n=i[e||0];if(n)return n;if(null==e)for(var r=0;r<i.length;r++)if(i[r])return i[r]}},e.prototype.queryComponents=function(t){var e=t.mainType;if(!e)return[];var i,n=t.index,r=t.id,o=t.name,s=this._componentsMap.get(e);return s&&s.length?(null!=n?(i=[],yE(lP(n),(function(t){s[t]&&i.push(s[t])}))):i=null!=r?Cz("id",r,s):null!=o?Cz("name",o,s):xE(s,(function(t){return!!t})),Pz(i,t)):[]},e.prototype.findComponents=function(t){var e,i,n,r,o,s=t.query,a=t.mainType,l=(i=a+"Index",n=a+"Id",r=a+"Name",!(e=s)||null==e[i]&&null==e[n]&&null==e[r]?null:{mainType:a,index:e[i],id:e[n],name:e[r]}),c=l?this.queryComponents(l):xE(this._componentsMap.get(a),(function(t){return!!t}));return o=Pz(c,t),t.filter?xE(o,t.filter):o},e.prototype.eachComponent=function(t,e,i){var n=this._componentsMap;if(SE(t)){var r=e,o=t;n.each((function(t,e){for(var i=0;t&&i<t.length;i++){var n=t[i];n&&o.call(r,e,n,n.componentIndex)}}))}else for(var s=ME(t)?n.get(t):CE(t)?this.findComponents(t):null,a=0;s&&a<s.length;a++){var l=s[a];l&&e.call(i,l,l.componentIndex)}},e.prototype.getSeriesByName=function(t){var e=gP(t,null);return xE(this._componentsMap.get("series"),(function(t){return!!t&&null!=e&&t.name===e}))},e.prototype.getSeriesByIndex=function(t){return this._componentsMap.get("series")[t]},e.prototype.getSeriesByType=function(t){return xE(this._componentsMap.get("series"),(function(e){return!!e&&e.subType===t}))},e.prototype.getSeries=function(){return xE(this._componentsMap.get("series"),(function(t){return!!t}))},e.prototype.getSeriesCount=function(){return this._componentsCount.get("series")},e.prototype.eachSeries=function(t,e){yz(this),yE(this._seriesIndices,(function(i){var n=this._componentsMap.get("series")[i];t.call(e,n,i)}),this)},e.prototype.eachRawSeries=function(t,e){yE(this._componentsMap.get("series"),(function(i){i&&t.call(e,i,i.componentIndex)}))},e.prototype.eachSeriesByType=function(t,e,i){yz(this),yE(this._seriesIndices,(function(n){var r=this._componentsMap.get("series")[n];r.subType===t&&e.call(i,r,n)}),this)},e.prototype.eachRawSeriesByType=function(t,e,i){return yE(this.getSeriesByType(t),e,i)},e.prototype.isSeriesFiltered=function(t){return yz(this),null==this._seriesIndicesMap.get(t.componentIndex)},e.prototype.getCurrentSeriesIndices=function(){return(this._seriesIndices||[]).slice()},e.prototype.filterSeries=function(t,e){yz(this);var i=[];yE(this._seriesIndices,(function(n){var r=this._componentsMap.get("series")[n];t.call(e,r,n)&&i.push(n)}),this),this._seriesIndices=i,this._seriesIndicesMap=YE(i)},e.prototype.restoreData=function(t){gz(this);var e=this._componentsMap,i=[];e.each((function(t,e){YB.hasClass(e)&&i.push(e)})),YB.topologicalTravel(i,YB.getAllClassMainTypes(),(function(i){yE(e.get(i),(function(e){!e||"series"===i&&function(t,e){if(e){var i=e.seriesIndex,n=e.seriesId,r=e.seriesName;return null!=i&&t.componentIndex!==i||null!=n&&t.id!==n||null!=r&&t.name!==r}}(e,t)||e.restoreData()}))}))},e.internalField=(gz=function(t){var e=t._seriesIndices=[];yE(t._componentsMap.get("series"),(function(t){t&&e.push(t.componentIndex)})),t._seriesIndicesMap=YE(e)},yz=function(t){if("production"!==process.env.NODE_ENV&&!t._seriesIndices)throw new Error("Option should contains series.")},void(vz=function(t,e){t.option={},t.option[Ez]=1,t._componentsMap=YE({series:[]}),t._componentsCount=YE();var i=e.aria;CE(i)&&null==i.enabled&&(i.enabled=!0),function(t,e){var i=t.color&&!t.colorLayer;yE(e,(function(e,n){"colorLayer"===n&&i||YB.hasClass(n)||("object"==typeof e?t[n]=t[n]?uE(t[n],e,!1):cE(e):null==t[n]&&(t[n]=e))}))}(e,t._theme.option),uE(e,KB,!1),t._mergeOption(e,null)})),e}(FN);function Cz(t,e,i){if(EE(e)){var n=YE();return yE(e,(function(t){null!=t&&(null!=gP(t,null)&&n.set(t,!0))})),xE(i,(function(e){return e&&n.get(e[t])}))}var r=gP(e,null);return xE(i,(function(e){return e&&null!=r&&e[t]===r}))}function Pz(t,e){return e.hasOwnProperty("subType")?xE(t,(function(t){return t&&t.subType===e.subType})):t}function Lz(t){var e=YE();return t&&yE(lP(t.replaceMerge),(function(t){"production"!==process.env.NODE_ENV&&UE(YB.hasClass(t),'"'+t+'" is not valid component main type in "replaceMerge"'),e.set(t,!0)})),{replaceMergeMainTypeMap:e}}mE(Iz,bz);var Dz=Iz,Rz=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isSSR","isDisposed","on","off","getDataURL","getConnectedDataURL","getOption","getId","updateLabelLayout"],Oz=function(t){yE(Rz,(function(e){this[e]=wE(t[e],t)}),this)},kz={},Nz=function(){function t(){this._coordinateSystems=[]}return t.prototype.create=function(t,e){var i=[];yE(kz,(function(n,r){var o=n.create(t,e);i=i.concat(o||[])})),this._coordinateSystems=i},t.prototype.update=function(t,e){yE(this._coordinateSystems,(function(i){i.update&&i.update(t,e)}))},t.prototype.getCoordinateSystems=function(){return this._coordinateSystems.slice()},t.register=function(t,e){kz[t]=e},t.get=function(t){return kz[t]},t}(),Bz=Nz,zz=/^(min|max)?(.+)$/,Fz=function(){function t(t){this._timelineOptions=[],this._mediaList=[],this._currentMediaIndices=[],this._api=t}return t.prototype.setOption=function(t,e,i){t&&(yE(lP(t.series),(function(t){t&&t.data&&LE(t.data)&&HE(t.data)})),yE(lP(t.dataset),(function(t){t&&t.source&&LE(t.source)&&HE(t.source)}))),t=cE(t);var n=this._optionBackup,r=function(t,e,i){var n,r,o=[],s=t.baseOption,a=t.timeline,l=t.options,c=t.media,u=!!t.media,h=!!(l||a||s&&s.timeline);s?(r=s).timeline||(r.timeline=a):((h||u)&&(t.options=t.media=null),r=t);u&&(EE(c)?yE(c,(function(t){"production"!==process.env.NODE_ENV&&t&&!t.option&&CE(t.query)&&CE(t.query.option)&&tP("Illegal media option. Must be like { media: [ { query: {}, option: {} } ] }"),t&&t.option&&(t.query?o.push(t):n||(n=t))})):"production"!==process.env.NODE_ENV&&tP("Illegal media option. Must be an array. Like { media: [ {...}, {...} ] }"));function p(t){yE(e,(function(e){e(t,i)}))}return p(r),yE(l,(function(t){return p(t)})),yE(o,(function(t){return p(t.option)})),{baseOption:r,timelineOptions:l||[],mediaDefault:n,mediaList:o}}(t,e,!n);this._newBaseOption=r.baseOption,n?(r.timelineOptions.length&&(n.timelineOptions=r.timelineOptions),r.mediaList.length&&(n.mediaList=r.mediaList),r.mediaDefault&&(n.mediaDefault=r.mediaDefault)):this._optionBackup=r},t.prototype.mountOption=function(t){var e=this._optionBackup;return this._timelineOptions=e.timelineOptions,this._mediaList=e.mediaList,this._mediaDefault=e.mediaDefault,this._currentMediaIndices=[],cE(t?e.baseOption:this._newBaseOption)},t.prototype.getTimelineOption=function(t){var e,i=this._timelineOptions;if(i.length){var n=t.getComponent("timeline");n&&(e=cE(i[n.getCurrentIndex()]))}return e},t.prototype.getMediaOption=function(t){var e,i,n=this._api.getWidth(),r=this._api.getHeight(),o=this._mediaList,s=this._mediaDefault,a=[],l=[];if(!o.length&&!s)return l;for(var c=0,u=o.length;c<u;c++)Vz(o[c].query,n,r)&&a.push(c);return!a.length&&s&&(a=[-1]),a.length&&(e=a,i=this._currentMediaIndices,e.join(",")!==i.join(","))&&(l=vE(a,(function(t){return cE(-1===t?s.option:o[t].option)}))),this._currentMediaIndices=a,l},t}();function Vz(t,e,i){var n={width:e,height:i,aspectratio:e/i},r=!0;return yE(t,(function(t,e){var i=e.match(zz);if(i&&i[1]&&i[2]){var o=i[1],s=i[2].toLowerCase();(function(t,e,i){return"min"===i?t>=e:"max"===i?t<=e:t===e})(n[s],t,o)||(r=!1)}})),r}var Uz=Fz,Gz=yE,jz=CE,Hz=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function Wz(t){var e=t&&t.itemStyle;if(e)for(var i=0,n=Hz.length;i<n;i++){var r=Hz[i],o=e.normal,s=e.emphasis;o&&o[r]&&("production"!==process.env.NODE_ENV&&iP("itemStyle.normal."+r,r),t[r]=t[r]||{},t[r].normal?uE(t[r].normal,o[r]):t[r].normal=o[r],o[r]=null),s&&s[r]&&("production"!==process.env.NODE_ENV&&iP("itemStyle.emphasis."+r,"emphasis."+r),t[r]=t[r]||{},t[r].emphasis?uE(t[r].emphasis,s[r]):t[r].emphasis=s[r],s[r]=null)}}function qz(t,e,i){if(t&&t[e]&&(t[e].normal||t[e].emphasis)){var n=t[e].normal,r=t[e].emphasis;n&&("production"!==process.env.NODE_ENV&&eP("'normal' hierarchy in "+e+" has been removed since 4.0. All style properties are configured in "+e+" directly now."),i?(t[e].normal=t[e].emphasis=null,dE(t[e],n)):t[e]=n),r&&("production"!==process.env.NODE_ENV&&eP(e+".emphasis has been changed to emphasis."+e+" since 4.0"),t.emphasis=t.emphasis||{},t.emphasis[e]=r,r.focus&&(t.emphasis.focus=r.focus),r.blurScope&&(t.emphasis.blurScope=r.blurScope))}}function Xz(t){qz(t,"itemStyle"),qz(t,"lineStyle"),qz(t,"areaStyle"),qz(t,"label"),qz(t,"labelLine"),qz(t,"upperLabel"),qz(t,"edgeLabel")}function Zz(t,e){var i=jz(t)&&t[e],n=jz(i)&&i.textStyle;if(n){"production"!==process.env.NODE_ENV&&eP("textStyle hierarchy in "+e+" has been removed since 4.0. All textStyle properties are configured in "+e+" directly now.");for(var r=0,o=uP.length;r<o;r++){var s=uP[r];n.hasOwnProperty(s)&&(i[s]=n[s])}}}function Yz(t){t&&(Xz(t),Zz(t,"label"),t.emphasis&&Zz(t.emphasis,"label"))}function Qz(t){return EE(t)?t:t?[t]:[]}function Jz(t){return(EE(t)?t[0]:t)||{}}function Kz(t,e){Gz(Qz(t.series),(function(t){jz(t)&&function(t){if(jz(t)){Wz(t),Xz(t),Zz(t,"label"),Zz(t,"upperLabel"),Zz(t,"edgeLabel"),t.emphasis&&(Zz(t.emphasis,"label"),Zz(t.emphasis,"upperLabel"),Zz(t.emphasis,"edgeLabel"));var e=t.markPoint;e&&(Wz(e),Yz(e));var i=t.markLine;i&&(Wz(i),Yz(i));var n=t.markArea;n&&Yz(n);var r=t.data;if("graph"===t.type){r=r||t.nodes;var o=t.links||t.edges;if(o&&!LE(o))for(var s=0;s<o.length;s++)Yz(o[s]);yE(t.categories,(function(t){Xz(t)}))}if(r&&!LE(r))for(s=0;s<r.length;s++)Yz(r[s]);if((e=t.markPoint)&&e.data){var a=e.data;for(s=0;s<a.length;s++)Yz(a[s])}if((i=t.markLine)&&i.data){var l=i.data;for(s=0;s<l.length;s++)EE(l[s])?(Yz(l[s][0]),Yz(l[s][1])):Yz(l[s])}"gauge"===t.type?(Zz(t,"axisLabel"),Zz(t,"title"),Zz(t,"detail")):"treemap"===t.type?(qz(t.breadcrumb,"itemStyle"),yE(t.levels,(function(t){Xz(t)}))):"tree"===t.type&&Xz(t.leaves)}}(t)}));var i=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];e&&i.push("valueAxis","categoryAxis","logAxis","timeAxis"),Gz(i,(function(e){Gz(Qz(t[e]),(function(t){t&&(Zz(t,"axisLabel"),Zz(t.axisPointer,"label"))}))})),Gz(Qz(t.parallel),(function(t){var e=t&&t.parallelAxisDefault;Zz(e,"axisLabel"),Zz(e&&e.axisPointer,"label")})),Gz(Qz(t.calendar),(function(t){qz(t,"itemStyle"),Zz(t,"dayLabel"),Zz(t,"monthLabel"),Zz(t,"yearLabel")})),Gz(Qz(t.radar),(function(t){Zz(t,"name"),t.name&&null==t.axisName&&(t.axisName=t.name,delete t.name,"production"!==process.env.NODE_ENV&&eP("name property in radar component has been changed to axisName")),null!=t.nameGap&&null==t.axisNameGap&&(t.axisNameGap=t.nameGap,delete t.nameGap,"production"!==process.env.NODE_ENV&&eP("nameGap property in radar component has been changed to axisNameGap")),"production"!==process.env.NODE_ENV&&Gz(t.indicator,(function(t){t.text&&iP("text","name","radar.indicator")}))})),Gz(Qz(t.geo),(function(t){jz(t)&&(Yz(t),Gz(Qz(t.regions),(function(t){Yz(t)})))})),Gz(Qz(t.timeline),(function(t){Yz(t),qz(t,"label"),qz(t,"itemStyle"),qz(t,"controlStyle",!0);var e=t.data;EE(e)&&yE(e,(function(t){CE(t)&&(qz(t,"label"),qz(t,"itemStyle"))}))})),Gz(Qz(t.toolbox),(function(t){qz(t,"iconStyle"),Gz(t.feature,(function(t){qz(t,"iconStyle")}))})),Zz(Jz(t.axisPointer),"label"),Zz(Jz(t.tooltip).axisPointer,"label")}function $z(t){t&&yE(tF,(function(e){e[0]in t&&!(e[1]in t)&&(t[e[1]]=t[e[0]])}))}var tF=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],eF=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],iF=[["borderRadius","barBorderRadius"],["borderColor","barBorderColor"],["borderWidth","barBorderWidth"]];function nF(t){var e=t&&t.itemStyle;if(e)for(var i=0;i<iF.length;i++){var n=iF[i][1],r=iF[i][0];null!=e[n]&&(e[r]=e[n],"production"!==process.env.NODE_ENV&&iP(n,r))}}function rF(t){t&&"edge"===t.alignTo&&null!=t.margin&&null==t.edgeDistance&&("production"!==process.env.NODE_ENV&&iP("label.margin","label.edgeDistance","pie"),t.edgeDistance=t.margin)}function oF(t){t&&t.downplay&&!t.blur&&(t.blur=t.downplay,"production"!==process.env.NODE_ENV&&iP("downplay","blur","sunburst"))}function sF(t,e){if(t)for(var i=0;i<t.length;i++)e(t[i]),t[i]&&sF(t[i].children,e)}function aF(t,e){Kz(t,e),t.series=lP(t.series),yE(t.series,(function(t){if(CE(t)){var e=t.type;if("line"===e)null!=t.clipOverflow&&(t.clip=t.clipOverflow,"production"!==process.env.NODE_ENV&&iP("clipOverflow","clip","line"));else if("pie"===e||"gauge"===e){if(null!=t.clockWise&&(t.clockwise=t.clockWise,"production"!==process.env.NODE_ENV&&iP("clockWise","clockwise")),rF(t.label),(r=t.data)&&!LE(r))for(var i=0;i<r.length;i++)rF(r[i]);null!=t.hoverOffset&&(t.emphasis=t.emphasis||{},(t.emphasis.scaleSize=null)&&("production"!==process.env.NODE_ENV&&iP("hoverOffset","emphasis.scaleSize"),t.emphasis.scaleSize=t.hoverOffset))}else if("gauge"===e){var n=function(t,e){for(var i=e.split(","),n=t,r=0;r<i.length&&null!=(n=n&&n[i[r]]);r++);return n}(t,"pointer.color");null!=n&&function(t,e,i,n){for(var r,o=e.split(","),s=t,a=0;a<o.length-1;a++)null==s[r=o[a]]&&(s[r]={}),s=s[r];(n||null==s[o[a]])&&(s[o[a]]=i)}(t,"itemStyle.color",n)}else if("bar"===e){var r;if(nF(t),nF(t.backgroundStyle),nF(t.emphasis),(r=t.data)&&!LE(r))for(i=0;i<r.length;i++)"object"==typeof r[i]&&(nF(r[i]),nF(r[i]&&r[i].emphasis))}else if("sunburst"===e){var o=t.highlightPolicy;o&&(t.emphasis=t.emphasis||{},t.emphasis.focus||(t.emphasis.focus=o,"production"!==process.env.NODE_ENV&&iP("highlightPolicy","emphasis.focus","sunburst"))),oF(t),sF(t.data,oF)}else"graph"===e||"sankey"===e?function(t){t&&null!=t.focusNodeAdjacency&&(t.emphasis=t.emphasis||{},null==t.emphasis.focus&&("production"!==process.env.NODE_ENV&&iP("focusNodeAdjacency","emphasis: { focus: 'adjacency'}","graph/sankey"),t.emphasis.focus="adjacency"))}(t):"map"===e&&(t.mapType&&!t.map&&("production"!==process.env.NODE_ENV&&iP("mapType","map","map"),t.map=t.mapType),t.mapLocation&&("production"!==process.env.NODE_ENV&&eP("`mapLocation` is not used anymore."),dE(t,t.mapLocation)));null!=t.hoverAnimation&&(t.emphasis=t.emphasis||{},t.emphasis&&null==t.emphasis.scale&&("production"!==process.env.NODE_ENV&&iP("hoverAnimation","emphasis.scale"),t.emphasis.scale=t.hoverAnimation)),$z(t)}})),t.dataRange&&(t.visualMap=t.dataRange),yE(eF,(function(e){var i=t[e];i&&(EE(i)||(i=[i]),yE(i,(function(t){$z(t)})))}))}function lF(t){yE(t,(function(e,i){var n=[],r=[NaN,NaN],o=[e.stackResultDimension,e.stackedOverDimension],s=e.data,a=e.isStackedByIndex,l=e.seriesModel.get("stackStrategy")||"samesign";s.modify(o,(function(o,c,u){var h,p,d=s.get(e.stackedDimension,u);if(isNaN(d))return r;a?p=s.getRawIndex(u):h=s.get(e.stackedByDimension,u);for(var f=NaN,m=i-1;m>=0;m--){var g=t[m];if(a||(p=g.data.rawIndexOf(g.stackedByDimension,h)),p>=0){var y=g.data.getByRawIndex(g.stackResultDimension,p);if("all"===l||"positive"===l&&y>0||"negative"===l&&y<0||"samesign"===l&&d>=0&&y>0||"samesign"===l&&d<=0&&y<0){d=OC(d,y),f=y;break}}}return n[0]=d,n[1]=f,n}))}))}var cF,uF,hF,pF,dF,fF=function(t){this.data=t.data||(t.sourceFormat===nz?{}:[]),this.sourceFormat=t.sourceFormat||oz,this.seriesLayoutBy=t.seriesLayoutBy||sz,this.startIndex=t.startIndex||0,this.dimensionsDetectedCount=t.dimensionsDetectedCount,this.metaRawOption=t.metaRawOption;var e=this.dimensionsDefine=t.dimensionsDefine;if(e)for(var i=0;i<e.length;i++){var n=e[i];null==n.type&&dz(this,i)===lz.Must&&(n.type="ordinal")}};function mF(t){return t instanceof fF}function gF(t,e,i){i=i||vF(t);var n=e.seriesLayoutBy,r=function(t,e,i,n,r){var o,s;if(!t)return{dimensionsDefine:_F(r),startIndex:s,dimensionsDetectedCount:o};if(e===ez){var a=t;"auto"===n||null==n?xF((function(t){null!=t&&"-"!==t&&(ME(t)?null==s&&(s=1):s=0)}),i,a,10):s=IE(n)?n:n?1:0,r||1!==s||(r=[],xF((function(t,e){r[e]=null!=t?t+"":""}),i,a,1/0)),o=r?r.length:i===az?a.length:a[0]?a[0].length:null}else if(e===iz)r||(r=function(t){var e,i=0;for(;i<t.length&&!(e=t[i++]););if(e)return bE(e)}(t));else if(e===nz)r||(r=[],yE(t,(function(t,e){r.push(e)})));else if(e===tz){var l=hP(t[0]);o=EE(l)&&l.length||1}else e===rz&&"production"!==process.env.NODE_ENV&&UE(!!r,"dimensions must be given if data is TypedArray.");return{startIndex:s,dimensionsDefine:_F(r),dimensionsDetectedCount:o}}(t,i,n,e.sourceHeader,e.dimensions);return new fF({data:t,sourceFormat:i,seriesLayoutBy:n,dimensionsDefine:r.dimensionsDefine,startIndex:r.startIndex,dimensionsDetectedCount:r.dimensionsDetectedCount,metaRawOption:cE(e)})}function yF(t){return new fF({data:t,sourceFormat:LE(t)?rz:tz})}function vF(t){var e=oz;if(LE(t))e=rz;else if(EE(t)){0===t.length&&(e=ez);for(var i=0,n=t.length;i<n;i++){var r=t[i];if(null!=r){if(EE(r)){e=ez;break}if(CE(r)){e=iz;break}}}}else if(CE(t))for(var o in t)if($E(t,o)&&gE(t[o])){e=nz;break}return e}function _F(t){if(t){var e=YE();return vE(t,(function(t,i){var n={name:(t=CE(t)?t:{name:t}).name,displayName:t.displayName,type:t.type};if(null==n.name)return n;n.name+="",null==n.displayName&&(n.displayName=n.name);var r=e.get(n.name);return r?n.name+="-"+r.count++:e.set(n.name,{count:1}),n}))}}function xF(t,e,i,n){if(e===az)for(var r=0;r<i.length&&r<n;r++)t(i[r]?i[r][0]:null,r);else{var o=i[0]||[];for(r=0;r<o.length&&r<n;r++)t(o[r],r)}}function bF(t){var e=t.sourceFormat;return e===iz||e===nz}var wF=function(){function t(t,e){var i=mF(t)?t:yF(t);this._source=i;var n=this._data=i.data;if(i.sourceFormat===rz){if("production"!==process.env.NODE_ENV&&null==e)throw new Error("Typed array data must specify dimension size");this._offset=0,this._dimSize=e,this._data=n}dF(this,n,i)}return t.prototype.getSource=function(){return this._source},t.prototype.count=function(){return 0},t.prototype.getItem=function(t,e){},t.prototype.appendData=function(t){},t.prototype.clean=function(){},t.protoInitialize=function(){var e=t.prototype;e.pure=!1,e.persistent=!0}(),t.internalField=function(){var t;dF=function(t,r,o){var s=o.sourceFormat,a=o.seriesLayoutBy,l=o.startIndex,c=o.dimensionsDefine,u=pF[DF(s,a)];if("production"!==process.env.NODE_ENV&&UE(u,"Invalide sourceFormat: "+s),pE(t,u),s===rz)t.getItem=e,t.count=n,t.fillStorage=i;else{var h=SF(s,a);t.getItem=wE(h,null,r,l,c);var p=IF(s,a);t.count=wE(p,null,r,l,c)}};var e=function(t,e){t-=this._offset,e=e||[];for(var i=this._data,n=this._dimSize,r=n*t,o=0;o<n;o++)e[o]=i[r+o];return e},i=function(t,e,i,n){for(var r=this._data,o=this._dimSize,s=0;s<o;s++){for(var a=n[s],l=null==a[0]?1/0:a[0],c=null==a[1]?-1/0:a[1],u=e-t,h=i[s],p=0;p<u;p++){var d=r[p*o+s];h[t+p]=d,d<l&&(l=d),d>c&&(c=d)}a[0]=l,a[1]=c}},n=function(){return this._data?this._data.length/this._dimSize:0};function r(t){for(var e=0;e<t.length;e++)this._data.push(t[e])}(t={})[ez+"_"+sz]={pure:!0,appendData:r},t[ez+"_"+az]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},t[iz]={pure:!0,appendData:r},t[nz]={pure:!0,appendData:function(t){var e=this._data;yE(t,(function(t,i){for(var n=e[i]||(e[i]=[]),r=0;r<(t||[]).length;r++)n.push(t[r])}))}},t[tz]={appendData:r},t[rz]={persistent:!1,pure:!0,appendData:function(t){"production"!==process.env.NODE_ENV&&UE(LE(t),"Added data must be TypedArray if data in initialization is TypedArray"),this._data=t},clean:function(){this._offset+=this.count(),this._data=null}},pF=t}(),t}(),AF=function(t,e,i,n){return t[n]},EF=((cF={})[ez+"_"+sz]=function(t,e,i,n){return t[n+e]},cF[ez+"_"+az]=function(t,e,i,n,r){n+=e;for(var o=r||[],s=t,a=0;a<s.length;a++){var l=s[a];o[a]=l?l[n]:null}return o},cF[iz]=AF,cF[nz]=function(t,e,i,n,r){for(var o=r||[],s=0;s<i.length;s++){var a=i[s].name;if("production"!==process.env.NODE_ENV&&null==a)throw new Error;var l=t[a];o[s]=l?l[n]:null}return o},cF[tz]=AF,cF);function SF(t,e){var i=EF[DF(t,e)];return"production"!==process.env.NODE_ENV&&UE(i,'Do not support get item on "'+t+'", "'+e+'".'),i}var MF=function(t,e,i){return t.length},TF=((uF={})[ez+"_"+sz]=function(t,e,i){return Math.max(0,t.length-e)},uF[ez+"_"+az]=function(t,e,i){var n=t[0];return n?Math.max(0,n.length-e):0},uF[iz]=MF,uF[nz]=function(t,e,i){var n=i[0].name;if("production"!==process.env.NODE_ENV&&null==n)throw new Error;var r=t[n];return r?r.length:0},uF[tz]=MF,uF);function IF(t,e){var i=TF[DF(t,e)];return"production"!==process.env.NODE_ENV&&UE(i,'Do not support count on "'+t+'", "'+e+'".'),i}var CF=function(t,e,i){return t[e]},PF=((hF={})[ez]=CF,hF[iz]=function(t,e,i){return t[i]},hF[nz]=CF,hF[tz]=function(t,e,i){var n=hP(t);return n instanceof Array?n[e]:n},hF[rz]=CF,hF);function LF(t){var e=PF[t];return"production"!==process.env.NODE_ENV&&UE(e,'Do not support get value on "'+t+'".'),e}function DF(t,e){return t===ez?t+"_"+e:t}function RF(t,e,i){if(t){var n=t.getRawDataItem(e);if(null!=n){var r=t.getStore(),o=r.getSource().sourceFormat;if(null!=i){var s=t.getDimensionIndex(i),a=r.getDimensionProperty(s);return LF(o)(n,s,a)}var l=n;return o===tz&&(l=hP(n)),l}}}var OF=/\{@(.+?)\}/g,kF=function(){function t(){}return t.prototype.getDataParams=function(t,e){var i=this.getData(e),n=this.getRawValue(t,e),r=i.getRawIndex(t),o=i.getName(t),s=i.getRawDataItem(t),a=i.getItemVisual(t,"style"),l=a&&a[i.getItemVisual(t,"drawType")||"fill"],c=a&&a.stroke,u=this.mainType,h="series"===u,p=i.userOutput&&i.userOutput.get();return{componentType:u,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:h?this.subType:null,seriesIndex:this.seriesIndex,seriesId:h?this.id:null,seriesName:h?this.name:null,name:o,dataIndex:r,data:s,dataType:e,value:n,color:l,borderColor:c,dimensionNames:p?p.fullDimensions:null,encode:p?p.encode:null,$vars:["seriesName","name","value"]}},t.prototype.getFormattedLabel=function(t,e,i,n,r,o){e=e||"normal";var s=this.getData(i),a=this.getDataParams(t,i);(o&&(a.value=o.interpolatedValue),null!=n&&EE(a.value)&&(a.value=a.value[n]),r)||(r=s.getItemModel(t).get("normal"===e?["label","formatter"]:[e,"label","formatter"]));return SE(r)?(a.status=e,a.dimensionIndex=n,r(a)):ME(r)?RB(r,a).replace(OF,(function(e,i){var n=i.length,r=i;"["===r.charAt(0)&&"]"===r.charAt(n-1)&&(r=+r.slice(1,n-1),"production"!==process.env.NODE_ENV&&isNaN(r)&&tP("Invalide label formatter: @"+i+", only support @[0], @[1], @[2], ..."));var a=RF(s,t,r);if(o&&EE(o.interpolatedValue)){var l=s.getDimensionIndex(r);l>=0&&(a=o.interpolatedValue[l])}return null!=a?a+"":""})):void 0},t.prototype.getRawValue=function(t,e){return RF(this.getData(e),t)},t.prototype.formatTooltip=function(t,e,i){},t}();function NF(t){var e,i;return CE(t)?t.type?i=t:"production"!==process.env.NODE_ENV&&console.warn("The return type of `formatTooltip` is not supported: "+nP(t)):e=t,{text:e,frag:i}}function BF(t){return new zF(t)}var zF=function(){function t(t){t=t||{},this._reset=t.reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0}return t.prototype.perform=function(t){var e,i=this._upstream,n=t&&t.skip;if(this._dirty&&i){var r=this.context;r.data=r.outputData=i.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!n&&(e=this._plan(this.context));var o,s=u(this._modBy),a=this._modDataCount||0,l=u(t&&t.modBy),c=t&&t.modDataCount||0;function u(t){return!(t>=1)&&(t=1),t}s===l&&a===c||(e="reset"),(this._dirty||"reset"===e)&&(this._dirty=!1,o=this._doReset(n)),this._modBy=l,this._modDataCount=c;var h=t&&t.step;if(i?("production"!==process.env.NODE_ENV&&UE(null!=i._outputDueEnd),this._dueEnd=i._outputDueEnd):("production"!==process.env.NODE_ENV&&UE(!this._progress||this._count),this._dueEnd=this._count?this._count(this.context):1/0),this._progress){var p=this._dueIndex,d=Math.min(null!=h?this._dueIndex+h:1/0,this._dueEnd);if(!n&&(o||p<d)){var f=this._progress;if(EE(f))for(var m=0;m<f.length;m++)this._doProgress(f[m],p,d,l,c);else this._doProgress(f,p,d,l,c)}this._dueIndex=d;var g=null!=this._settedOutputEnd?this._settedOutputEnd:d;"production"!==process.env.NODE_ENV&&UE(g>=this._outputDueEnd),this._outputDueEnd=g}else this._dueIndex=this._outputDueEnd=null!=this._settedOutputEnd?this._settedOutputEnd:this._dueEnd;return this.unfinished()},t.prototype.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},t.prototype._doProgress=function(t,e,i,n,r){FF.reset(e,i,n,r),this._callingProgress=t,this._callingProgress({start:e,end:i,count:i-e,next:FF.next},this.context)},t.prototype._doReset=function(t){var e,i;this._dueIndex=this._outputDueEnd=this._dueEnd=0,this._settedOutputEnd=null,!t&&this._reset&&((e=this._reset(this.context))&&e.progress&&(i=e.forceFirstProgress,e=e.progress),EE(e)&&!e.length&&(e=null)),this._progress=e,this._modBy=this._modDataCount=null;var n=this._downstream;return n&&n.dirty(),i},t.prototype.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},t.prototype.pipe=function(t){"production"!==process.env.NODE_ENV&&UE(t&&!t._disposed&&t!==this),(this._downstream!==t||this._dirty)&&(this._downstream=t,t._upstream=this,t.dirty())},t.prototype.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},t.prototype.getUpstream=function(){return this._upstream},t.prototype.getDownstream=function(){return this._downstream},t.prototype.setOutputEnd=function(t){this._outputDueEnd=this._settedOutputEnd=t},t}(),FF=function(){var t,e,i,n,r,o={reset:function(l,c,u,h){e=l,t=c,i=u,n=h,r=Math.ceil(n/i),o.next=i>1&&n>0?a:s}};return o;function s(){return e<t?e++:null}function a(){var o=e%r*i+Math.ceil(e/r),s=e>=t?null:o<n?o:e;return e++,s}}();function VF(t,e){var i=e&&e.type;return"ordinal"===i?t:("time"!==i||IE(t)||null==t||"-"===t||(t=+FC(t)),null==t||""===t?NaN:+t)}var UF=YE({number:function(t){return parseFloat(t)},time:function(t){return+FC(t)},trim:function(t){return ME(t)?GE(t):t}});function GF(t){return UF.get(t)}var jF={lt:function(t,e){return t<e},lte:function(t,e){return t<=e},gt:function(t,e){return t>e},gte:function(t,e){return t>=e}},HF=function(){function t(t,e){if(!IE(e)){var i="";"production"!==process.env.NODE_ENV&&(i='rvalue of "<", ">", "<=", ">=" can only be number in filter.'),rP(i)}this._opFn=jF[t],this._rvalFloat=HC(e)}return t.prototype.evaluate=function(t){return IE(t)?this._opFn(t,this._rvalFloat):this._opFn(HC(t),this._rvalFloat)},t}(),WF=function(){function t(t,e){var i="desc"===t;this._resultLT=i?1:-1,null==e&&(e=i?"min":"max"),this._incomparable="min"===e?-1/0:1/0}return t.prototype.evaluate=function(t,e){var i=IE(t)?t:HC(t),n=IE(e)?e:HC(e),r=isNaN(i),o=isNaN(n);if(r&&(i=this._incomparable),o&&(n=this._incomparable),r&&o){var s=ME(t),a=ME(e);s&&(i=a?t:0),a&&(n=s?e:0)}return i<n?this._resultLT:i>n?-this._resultLT:0},t}(),qF=function(){function t(t,e){this._rval=e,this._isEQ=t,this._rvalTypeof=typeof e,this._rvalFloat=HC(e)}return t.prototype.evaluate=function(t){var e=t===this._rval;if(!e){var i=typeof t;i===this._rvalTypeof||"number"!==i&&"number"!==this._rvalTypeof||(e=HC(t)===this._rvalFloat)}return this._isEQ?e:!e},t}();function XF(t,e){return"eq"===t||"ne"===t?new qF("eq"===t,e):$E(jF,t)?new HF(t,e):null}var ZF=function(){function t(){}return t.prototype.getRawData=function(){throw new Error("not supported")},t.prototype.getRawDataItem=function(t){throw new Error("not supported")},t.prototype.cloneRawData=function(){},t.prototype.getDimensionInfo=function(t){},t.prototype.cloneAllDimensionInfo=function(){},t.prototype.count=function(){},t.prototype.retrieveValue=function(t,e){},t.prototype.retrieveValueFromItem=function(t,e){},t.prototype.convertValue=function(t,e){return VF(t,e)},t}();function YF(t){var e=t.sourceFormat;if(!eV(e)){var i="";"production"!==process.env.NODE_ENV&&(i="`getRawData` is not supported in source format "+e),rP(i)}return t.data}function QF(t){var e=t.sourceFormat,i=t.data;if(!eV(e)){var n="";"production"!==process.env.NODE_ENV&&(n="`cloneRawData` is not supported in source format "+e),rP(n)}if(e===ez){for(var r=[],o=0,s=i.length;o<s;o++)r.push(i[o].slice());return r}if(e===iz){for(r=[],o=0,s=i.length;o<s;o++)r.push(pE({},i[o]));return r}}function JF(t,e,i){if(null!=i)return IE(i)||!isNaN(i)&&!$E(e,i)?t[i]:$E(e,i)?e[i]:void 0}function KF(t){return cE(t)}var $F=YE();function tV(t,e,i,n){var r="";e.length||("production"!==process.env.NODE_ENV&&(r="Must have at least one upstream dataset."),rP(r)),CE(t)||("production"!==process.env.NODE_ENV&&(r="transform declaration must be an object rather than "+typeof t+"."),rP(r));var o=t.type,s=$F.get(o);s||("production"!==process.env.NODE_ENV&&(r='Can not find transform on type "'+o+'".'),rP(r));var a,l=vE(e,(function(t){return function(t,e){var i=new ZF,n=t.data,r=i.sourceFormat=t.sourceFormat,o=t.startIndex,s="";t.seriesLayoutBy!==sz&&("production"!==process.env.NODE_ENV&&(s='`seriesLayoutBy` of upstream dataset can only be "column" in data transform.'),rP(s));var a=[],l={},c=t.dimensionsDefine;if(c)yE(c,(function(t,e){var i=t.name,n={index:e,name:i,displayName:t.displayName};if(a.push(n),null!=i){var r="";$E(l,i)&&("production"!==process.env.NODE_ENV&&(r='dimension name "'+i+'" duplicated.'),rP(r)),l[i]=n}}));else for(var u=0;u<t.dimensionsDetectedCount;u++)a.push({index:u});var h=SF(r,sz);e.__isBuiltIn&&(i.getRawDataItem=function(t){return h(n,o,a,t)},i.getRawData=wE(YF,null,t)),i.cloneRawData=wE(QF,null,t);var p=IF(r,sz);i.count=wE(p,null,n,o,a);var d=LF(r);i.retrieveValue=function(t,e){var i=h(n,o,a,t);return f(i,e)};var f=i.retrieveValueFromItem=function(t,e){if(null!=t){var i=a[e];return i?d(t,e,i.name):void 0}};return i.getDimensionInfo=wE(JF,null,a,l),i.cloneAllDimensionInfo=wE(KF,null,a),i}(t,s)})),c=lP(s.transform({upstream:l[0],upstreamList:l,config:cE(t.config)}));if("production"!==process.env.NODE_ENV&&t.print){var u=vE(c,(function(t){var e=null!=n?" === pipe index: "+n:"";return["=== dataset index: "+i.datasetIndex+e+" ===","- transform result data:",nP(t.data),"- transform result dimensions:",nP(t.dimensions)].join("\n")})).join("\n");KC("log",u,a)}return vE(c,(function(t,i){var n,r="";CE(t)||("production"!==process.env.NODE_ENV&&(r="A transform should not return some empty results."),rP(r)),t.data||("production"!==process.env.NODE_ENV&&(r="Transform result data should be not be null or undefined"),rP(r)),eV(vF(t.data))||("production"!==process.env.NODE_ENV&&(r="Transform result data should be array rows or object rows."),rP(r));var o=e[0];if(o&&0===i&&!t.dimensions){var s=o.startIndex;s&&(t.data=o.data.slice(0,s).concat(t.data)),n={seriesLayoutBy:sz,sourceHeader:s,dimensions:o.metaRawOption.dimensions}}else n={seriesLayoutBy:sz,sourceHeader:0,dimensions:t.dimensions};return gF(t.data,n,null)}))}function eV(t){return t===ez||t===iz}var iV,nV="undefined",rV=typeof Uint32Array===nV?Array:Uint32Array,oV=typeof Uint16Array===nV?Array:Uint16Array,sV=typeof Int32Array===nV?Array:Int32Array,aV=typeof Float64Array===nV?Array:Float64Array,lV={float:aV,int:sV,ordinal:Array,number:Array,time:aV};function cV(t){return t>65535?rV:oV}function uV(t,e,i,n,r){var o=lV[i||"float"];if(r){var s=t[e],a=s&&s.length;if(a!==n){for(var l=new o(n),c=0;c<a;c++)l[c]=s[c];t[e]=l}}else t[e]=new o(n)}var hV=function(){function t(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=YE()}return t.prototype.initData=function(t,e,i){"production"!==process.env.NODE_ENV&&UE(SE(t.getItem)&&SE(t.count),"Invalid data provider."),this._provider=t,this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var n=t.getSource(),r=this.defaultDimValueGetter=iV[n.sourceFormat];this._dimValueGetter=i||r,this._rawExtent=[];var o=bF(n);this._dimensions=vE(e,(function(t){return"production"!==process.env.NODE_ENV&&o&&UE(null!=t.property),{type:t.type,property:t.property}})),this._initDataFromProvider(0,t.count())},t.prototype.getProvider=function(){return this._provider},t.prototype.getSource=function(){return this._provider.getSource()},t.prototype.ensureCalculationDimension=function(t,e){var i=this._calcDimNameToIdx,n=this._dimensions,r=i.get(t);if(null!=r){if(n[r].type===e)return r}else r=n.length;return n[r]={type:e},i.set(t,r),this._chunks[r]=new lV[e||"float"](this._rawCount),this._rawExtent[r]=[1/0,-1/0],r},t.prototype.collectOrdinalMeta=function(t,e){var i=this._chunks[t],n=this._dimensions[t],r=this._rawExtent,o=n.ordinalOffset||0,s=i.length;0===o&&(r[t]=[1/0,-1/0]);for(var a=r[t],l=o;l<s;l++){var c=i[l]=e.parseAndCollect(i[l]);isNaN(c)||(a[0]=Math.min(c,a[0]),a[1]=Math.max(c,a[1]))}n.ordinalMeta=e,n.ordinalOffset=s,n.type="ordinal"},t.prototype.getOrdinalMeta=function(t){return this._dimensions[t].ordinalMeta},t.prototype.getDimensionProperty=function(t){var e=this._dimensions[t];return e&&e.property},t.prototype.appendData=function(t){"production"!==process.env.NODE_ENV&&UE(!this._indices,"appendData can only be called on raw data.");var e=this._provider,i=this.count();e.appendData(t);var n=e.count();return e.persistent||(n+=i),i<n&&this._initDataFromProvider(i,n,!0),[i,n]},t.prototype.appendValues=function(t,e){for(var i=this._chunks,n=this._dimensions,r=n.length,o=this._rawExtent,s=this.count(),a=s+Math.max(t.length,e||0),l=0;l<r;l++){uV(i,l,(d=n[l]).type,a,!0)}for(var c=[],u=s;u<a;u++)for(var h=u-s,p=0;p<r;p++){var d=n[p],f=iV.arrayRows.call(this,t[h]||c,d.property,h,p);i[p][u]=f;var m=o[p];f<m[0]&&(m[0]=f),f>m[1]&&(m[1]=f)}return this._rawCount=this._count=a,{start:s,end:a}},t.prototype._initDataFromProvider=function(t,e,i){for(var n=this._provider,r=this._chunks,o=this._dimensions,s=o.length,a=this._rawExtent,l=vE(o,(function(t){return t.property})),c=0;c<s;c++){var u=o[c];a[c]||(a[c]=[1/0,-1/0]),uV(r,c,u.type,e,i)}if(n.fillStorage)n.fillStorage(t,e,r,a);else for(var h=[],p=t;p<e;p++){h=n.getItem(p,h);for(var d=0;d<s;d++){var f=r[d],m=this._dimValueGetter(h,l[d],p,d);f[p]=m;var g=a[d];m<g[0]&&(g[0]=m),m>g[1]&&(g[1]=m)}}!n.persistent&&n.clean&&n.clean(),this._rawCount=this._count=e,this._extent=[]},t.prototype.count=function(){return this._count},t.prototype.get=function(t,e){if(!(e>=0&&e<this._count))return NaN;var i=this._chunks[t];return i?i[this.getRawIndex(e)]:NaN},t.prototype.getValues=function(t,e){var i=[],n=[];if(null==e){e=t,t=[];for(var r=0;r<this._dimensions.length;r++)n.push(r)}else n=t;r=0;for(var o=n.length;r<o;r++)i.push(this.get(n[r],e));return i},t.prototype.getByRawIndex=function(t,e){if(!(e>=0&&e<this._rawCount))return NaN;var i=this._chunks[t];return i?i[e]:NaN},t.prototype.getSum=function(t){var e=0;if(this._chunks[t])for(var i=0,n=this.count();i<n;i++){var r=this.get(t,i);isNaN(r)||(e+=r)}return e},t.prototype.getMedian=function(t){var e=[];this.each([t],(function(t){isNaN(t)||e.push(t)}));var i=e.sort((function(t,e){return t-e})),n=this.count();return 0===n?0:n%2==1?i[(n-1)/2]:(i[n/2]+i[n/2-1])/2},t.prototype.indexOfRawIndex=function(t){if(t>=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,i=e[t];if(null!=i&&i<this._count&&i===t)return t;for(var n=0,r=this._count-1;n<=r;){var o=(n+r)/2|0;if(e[o]<t)n=o+1;else{if(!(e[o]>t))return o;r=o-1}}return-1},t.prototype.indicesOfNearest=function(t,e,i){var n=this._chunks[t],r=[];if(!n)return r;null==i&&(i=1/0);for(var o=1/0,s=-1,a=0,l=0,c=this.count();l<c;l++){var u=e-n[this.getRawIndex(l)],h=Math.abs(u);h<=i&&((h<o||h===o&&u>=0&&s<0)&&(o=h,s=u,a=0),u===s&&(r[a++]=l))}return r.length=a,r},t.prototype.getIndices=function(){var t,e=this._indices;if(e){var i=e.constructor,n=this._count;if(i===Array){t=new i(n);for(var r=0;r<n;r++)t[r]=e[r]}else t=new i(e.buffer,0,n)}else{t=new(i=cV(this._rawCount))(this.count());for(r=0;r<t.length;r++)t[r]=r}return t},t.prototype.filter=function(t,e){if(!this._count)return this;for(var i=this.clone(),n=i.count(),r=new(cV(i._rawCount))(n),o=[],s=t.length,a=0,l=t[0],c=i._chunks,u=0;u<n;u++){var h=void 0,p=i.getRawIndex(u);if(0===s)h=e(u);else if(1===s){h=e(c[l][p],u)}else{for(var d=0;d<s;d++)o[d]=c[t[d]][p];o[d]=u,h=e.apply(null,o)}h&&(r[a++]=p)}return a<n&&(i._indices=r),i._count=a,i._extent=[],i._updateGetRawIdx(),i},t.prototype.selectRange=function(t){var e=this.clone(),i=e._count;if(!i)return this;var n=bE(t),r=n.length;if(!r)return this;var o=e.count(),s=new(cV(e._rawCount))(o),a=0,l=n[0],c=t[l][0],u=t[l][1],h=e._chunks,p=!1;if(!e._indices){var d=0;if(1===r){for(var f=h[n[0]],m=0;m<i;m++){((_=f[m])>=c&&_<=u||isNaN(_))&&(s[a++]=d),d++}p=!0}else if(2===r){f=h[n[0]];var g=h[n[1]],y=t[n[1]][0],v=t[n[1]][1];for(m=0;m<i;m++){var _=f[m],x=g[m];(_>=c&&_<=u||isNaN(_))&&(x>=y&&x<=v||isNaN(x))&&(s[a++]=d),d++}p=!0}}if(!p)if(1===r)for(m=0;m<o;m++){var b=e.getRawIndex(m);((_=h[n[0]][b])>=c&&_<=u||isNaN(_))&&(s[a++]=b)}else for(m=0;m<o;m++){for(var w=!0,A=(b=e.getRawIndex(m),0);A<r;A++){var E=n[A];((_=h[E][b])<t[E][0]||_>t[E][1])&&(w=!1)}w&&(s[a++]=e.getRawIndex(m))}return a<o&&(e._indices=s),e._count=a,e._extent=[],e._updateGetRawIdx(),e},t.prototype.map=function(t,e){var i=this.clone(t);return this._updateDims(i,t,e),i},t.prototype.modify=function(t,e){this._updateDims(this,t,e)},t.prototype._updateDims=function(t,e,i){for(var n=t._chunks,r=[],o=e.length,s=t.count(),a=[],l=t._rawExtent,c=0;c<e.length;c++)l[e[c]]=[1/0,-1/0];for(var u=0;u<s;u++){for(var h=t.getRawIndex(u),p=0;p<o;p++)a[p]=n[e[p]][h];a[o]=u;var d=i&&i.apply(null,a);if(null!=d){"object"!=typeof d&&(r[0]=d,d=r);for(c=0;c<d.length;c++){var f=e[c],m=d[c],g=l[f],y=n[f];y&&(y[h]=m),m<g[0]&&(g[0]=m),m>g[1]&&(g[1]=m)}}}},t.prototype.lttbDownSample=function(t,e){var i,n,r,o=this.clone([t],!0),s=o._chunks[t],a=this.count(),l=0,c=Math.floor(1/e),u=this.getRawIndex(0),h=new(cV(this._rawCount))(Math.min(2*(Math.ceil(a/c)+2),a));h[l++]=u;for(var p=1;p<a-1;p+=c){for(var d=Math.min(p+c,a-1),f=Math.min(p+2*c,a),m=(f+d)/2,g=0,y=d;y<f;y++){var v=s[S=this.getRawIndex(y)];isNaN(v)||(g+=v)}g/=f-d;var _=p,x=Math.min(p+c,a),b=p-1,w=s[u];i=-1,r=_;var A=-1,E=0;for(y=_;y<x;y++){var S;v=s[S=this.getRawIndex(y)];isNaN(v)?(E++,A<0&&(A=S)):(n=Math.abs((b-m)*(v-w)-(b-y)*(g-w)))>i&&(i=n,r=S)}E>0&&E<x-_&&(h[l++]=Math.min(A,r),r=Math.max(A,r)),h[l++]=r,u=r}return h[l++]=this.getRawIndex(a-1),o._count=l,o._indices=h,o.getRawIndex=this._getRawIdx,o},t.prototype.downSample=function(t,e,i,n){for(var r=this.clone([t],!0),o=r._chunks,s=[],a=Math.floor(1/e),l=o[t],c=this.count(),u=r._rawExtent[t]=[1/0,-1/0],h=new(cV(this._rawCount))(Math.ceil(c/a)),p=0,d=0;d<c;d+=a){a>c-d&&(a=c-d,s.length=a);for(var f=0;f<a;f++){var m=this.getRawIndex(d+f);s[f]=l[m]}var g=i(s),y=this.getRawIndex(Math.min(d+n(s,g)||0,c-1));l[y]=g,g<u[0]&&(u[0]=g),g>u[1]&&(u[1]=g),h[p++]=y}return r._count=p,r._indices=h,r._updateGetRawIdx(),r},t.prototype.each=function(t,e){if(this._count)for(var i=t.length,n=this._chunks,r=0,o=this.count();r<o;r++){var s=this.getRawIndex(r);switch(i){case 0:e(r);break;case 1:e(n[t[0]][s],r);break;case 2:e(n[t[0]][s],n[t[1]][s],r);break;default:for(var a=0,l=[];a<i;a++)l[a]=n[t[a]][s];l[a]=r,e.apply(null,l)}}},t.prototype.getDataExtent=function(t){var e=this._chunks[t],i=[1/0,-1/0];if(!e)return i;var n,r=this.count();if(!this._indices)return this._rawExtent[t].slice();if(n=this._extent[t])return n.slice();for(var o=(n=i)[0],s=n[1],a=0;a<r;a++){var l=e[this.getRawIndex(a)];l<o&&(o=l),l>s&&(s=l)}return n=[o,s],this._extent[t]=n,n},t.prototype.getRawDataItem=function(t){var e=this.getRawIndex(t);if(this._provider.persistent)return this._provider.getItem(e);for(var i=[],n=this._chunks,r=0;r<n.length;r++)i.push(n[r][e]);return i},t.prototype.clone=function(e,i){var n,r,o=new t,s=this._chunks,a=e&&_E(e,(function(t,e){return t[e]=!0,t}),{});if(a)for(var l=0;l<s.length;l++)o._chunks[l]=a[l]?(n=s[l],r=void 0,(r=n.constructor)===Array?n.slice():new r(n)):s[l];else o._chunks=s;return this._copyCommonProps(o),i||(o._indices=this._cloneIndices()),o._updateGetRawIdx(),o},t.prototype._copyCommonProps=function(t){t._count=this._count,t._rawCount=this._rawCount,t._provider=this._provider,t._dimensions=this._dimensions,t._extent=cE(this._extent),t._rawExtent=cE(this._rawExtent)},t.prototype._cloneIndices=function(){if(this._indices){var t=this._indices.constructor,e=void 0;if(t===Array){var i=this._indices.length;e=new t(i);for(var n=0;n<i;n++)e[n]=this._indices[n]}else e=new t(this._indices);return e}return null},t.prototype._getRawIdxIdentity=function(t){return t},t.prototype._getRawIdx=function(t){return t<this._count&&t>=0?this._indices[t]:-1},t.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},t.internalField=function(){function t(t,e,i,n){return VF(t[n],this._dimensions[n])}iV={arrayRows:t,objectRows:function(t,e,i,n){return VF(t[e],this._dimensions[n])},keyedColumns:t,original:function(t,e,i,n){var r=t&&(null==t.value?t:t.value);return VF(r instanceof Array?r[n]:r,this._dimensions[n])},typedArray:function(t,e,i,n){return t[n]}}}(),t}(),pV=function(){function t(t){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=t}return t.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},t.prototype._setLocalSource=function(t,e){this._sourceList=t,this._upstreamSignList=e,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},t.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},t.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},t.prototype._createSource=function(){this._setLocalSource([],[]);var t,e,i=this._sourceHost,n=this._getUpstreamSourceManagers(),r=!!n.length;if(fV(i)){var o=i,s=void 0,a=void 0,l=void 0;if(r){var c=n[0];c.prepareSource(),s=(l=c.getSource()).data,a=l.sourceFormat,e=[c._getVersionSign()]}else a=LE(s=o.get("data",!0))?rz:tz,e=[];var u=this._getSourceMetaRawOption()||{},h=l&&l.metaRawOption||{},p=BE(u.seriesLayoutBy,h.seriesLayoutBy)||null,d=BE(u.sourceHeader,h.sourceHeader),f=BE(u.dimensions,h.dimensions);t=p!==h.seriesLayoutBy||!!d!=!!h.sourceHeader||f?[gF(s,{seriesLayoutBy:p,sourceHeader:d,dimensions:f},a)]:[]}else{var m=i;if(r){var g=this._applyTransform(n);t=g.sourceList,e=g.upstreamSignList}else{t=[gF(m.get("source",!0),this._getSourceMetaRawOption(),null)],e=[]}}"production"!==process.env.NODE_ENV&&UE(t&&e),this._setLocalSource(t,e)},t.prototype._applyTransform=function(t){var e,i=this._sourceHost,n=i.get("transform",!0),r=i.get("fromTransformResult",!0);if("production"!==process.env.NODE_ENV&&UE(null!=r||null!=n),null!=r){var o="";1!==t.length&&("production"!==process.env.NODE_ENV&&(o="When using `fromTransformResult`, there should be only one upstream dataset"),mV(o))}var s,a=[],l=[];return yE(t,(function(t){t.prepareSource();var e=t.getSource(r||0),i="";null==r||e||("production"!==process.env.NODE_ENV&&(i="Can not retrieve result by `fromTransformResult`: "+r),mV(i)),a.push(e),l.push(t._getVersionSign())})),n?e=function(t,e,i){var n=lP(t),r=n.length,o="";r||("production"!==process.env.NODE_ENV&&(o="If `transform` declared, it should at least contain one transform."),rP(o));for(var s=0,a=r;s<a;s++)e=tV(n[s],e,i,1===r?null:s),s!==a-1&&(e.length=Math.max(e.length,1));return e}(n,a,{datasetIndex:i.componentIndex}):null!=r&&(e=[(s=a[0],new fF({data:s.data,sourceFormat:s.sourceFormat,seriesLayoutBy:s.seriesLayoutBy,dimensionsDefine:cE(s.dimensionsDefine),startIndex:s.startIndex,dimensionsDetectedCount:s.dimensionsDetectedCount}))]),{sourceList:e,upstreamSignList:l}},t.prototype._isDirty=function(){if(this._dirty)return!0;for(var t=this._getUpstreamSourceManagers(),e=0;e<t.length;e++){var i=t[e];if(i._isDirty()||this._upstreamSignList[e]!==i._getVersionSign())return!0}},t.prototype.getSource=function(t){t=t||0;var e=this._sourceList[t];if(!e){var i=this._getUpstreamSourceManagers();return i[0]&&i[0].getSource(t)}return e},t.prototype.getSharedDataStore=function(t){"production"!==process.env.NODE_ENV&&UE(fV(this._sourceHost),"Can only call getDataStore on series source manager.");var e=t.makeStoreSchema();return this._innerGetDataStore(e.dimensions,t.source,e.hash)},t.prototype._innerGetDataStore=function(t,e,i){var n=this._storeList,r=n[0];r||(r=n[0]={});var o=r[i];if(!o){var s=this._getUpstreamSourceManagers()[0];fV(this._sourceHost)&&s?o=s._innerGetDataStore(t,e,i):(o=new hV).initData(new wF(e,t.length),t),r[i]=o}return o},t.prototype._getUpstreamSourceManagers=function(){var t=this._sourceHost;if(fV(t)){var e=pz(t);return e?[e.getSourceManager()]:[]}return vE(function(t){return t.get("transform",!0)||t.get("fromTransformResult",!0)?IP(t.ecModel,"dataset",{index:t.get("fromDatasetIndex",!0),id:t.get("fromDatasetId",!0)},MP).models:[]}(t),(function(t){return t.getSourceManager()}))},t.prototype._getSourceMetaRawOption=function(){var t,e,i,n=this._sourceHost;if(fV(n))t=n.get("seriesLayoutBy",!0),e=n.get("sourceHeader",!0),i=n.get("dimensions",!0);else if(!this._getUpstreamSourceManagers().length){var r=n;t=r.get("seriesLayoutBy",!0),e=r.get("sourceHeader",!0),i=r.get("dimensions",!0)}return{seriesLayoutBy:t,sourceHeader:e,dimensions:i}},t}();function dV(t){t.option.transform&&HE(t.option.transform)}function fV(t){return"series"===t.mainType}function mV(t){throw new Error(t)}var gV="line-height:1";function yV(t,e){var i=t.color||"#6e7079",n=t.fontSize||12,r=t.fontWeight||"400",o=t.color||"#464646",s=t.fontSize||14,a=t.fontWeight||"900";return"html"===e?{nameStyle:"font-size:"+RS(n+"")+"px;color:"+RS(i)+";font-weight:"+RS(r+""),valueStyle:"font-size:"+RS(s+"")+"px;color:"+RS(o)+";font-weight:"+RS(a+"")}:{nameStyle:{fontSize:n,fill:i,fontWeight:r},valueStyle:{fontSize:s,fill:o,fontWeight:a}}}var vV=[0,10,20,30],_V=["","\n","\n\n","\n\n\n"];function xV(t,e){return e.type=t,e}function bV(t){return"section"===t.type}function wV(t){return bV(t)?EV:SV}function AV(t){if(bV(t)){var e=0,i=t.blocks.length,n=i>1||i>0&&!t.noHeader;return yE(t.blocks,(function(t){var i=AV(t);i>=e&&(e=i+ +(n&&(!i||bV(t)&&!t.noHeader)))})),e}return 0}function EV(t,e,i,n){var r,o=e.noHeader,s=(r=AV(e),{html:vV[r],richText:_V[r]}),a=[],l=e.blocks||[];UE(!l||EE(l)),l=l||[];var c=t.orderMode;if(e.sortBlocks&&c){l=l.slice();var u={valueAsc:"asc",valueDesc:"desc"};if($E(u,c)){var h=new WF(u[c],null);l.sort((function(t,e){return h.evaluate(t.sortParam,e.sortParam)}))}else"seriesDesc"===c&&l.reverse()}yE(l,(function(i,r){var o=e.valueFormatter,l=wV(i)(o?pE(pE({},t),{valueFormatter:o}):t,i,r>0?s.html:0,n);null!=l&&a.push(l)}));var p="richText"===t.renderMode?a.join(s.richText):TV(a.join(""),o?i:s.html);if(o)return p;var d=PB(e.header,"ordinal",t.useUTC),f=yV(n,t.renderMode).nameStyle;return"richText"===t.renderMode?IV(t,d,f)+s.richText+p:TV('<div style="'+f+";"+gV+';">'+RS(d)+"</div>"+p,i)}function SV(t,e,i,n){var r=t.renderMode,o=e.noName,s=e.noValue,a=!e.markerType,l=e.name,c=t.useUTC,u=e.valueFormatter||t.valueFormatter||function(t){return vE(t=EE(t)?t:[t],(function(t,e){return PB(t,EE(d)?d[e]:d,c)}))};if(!o||!s){var h=a?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",r),p=o?"":PB(l,"ordinal",c),d=e.valueType,f=s?[]:u(e.value),m=!a||!o,g=!a&&o,y=yV(n,r),v=y.nameStyle,_=y.valueStyle;return"richText"===r?(a?"":h)+(o?"":IV(t,p,v))+(s?"":function(t,e,i,n,r){var o=[r],s=n?10:20;return i&&o.push({padding:[0,0,0,s],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(EE(e)?e.join(" "):e,o)}(t,f,m,g,_)):TV((a?"":h)+(o?"":function(t,e,i){return'<span style="'+i+";"+(e?"margin-left:2px":"")+'">'+RS(t)+"</span>"}(p,!a,v))+(s?"":function(t,e,i,n){var r=i?"10px":"20px",o=e?"float:right;margin-left:"+r:"";return t=EE(t)?t:[t],'<span style="'+o+";"+n+'">'+vE(t,(function(t){return RS(t)})).join(" ")+"</span>"}(f,m,g,_)),i)}}function MV(t,e,i,n,r,o){if(t)return wV(t)({useUTC:r,renderMode:i,orderMode:n,markupStyleCreator:e,valueFormatter:t.valueFormatter},t,0,o)}function TV(t,e){return'<div style="'+("margin: "+e+"px 0 0")+";"+gV+';">'+t+'<div style="clear:both"></div></div>'}function IV(t,e,i){return t.markupStyleCreator.wrapRichTextStyle(e,i)}function CV(t,e){return OB(t.getData().getItemVisual(e,"style")[t.visualDrawType])}function PV(t,e){var i=t.get("padding");return null!=i?i:"richText"===e?[8,10]:10}var LV=function(){function t(){this.richTextStyles={},this._nextStyleNameId=qC()}return t.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},t.prototype.makeTooltipMarker=function(t,e,i){var n="richText"===i?this._generateStyleName():null,r=function(t,e){var i=ME(t)?{color:t,extraCssText:e}:t||{},n=i.color,r=i.type;e=i.extraCssText;var o=i.renderMode||"html";return n?"html"===o?"subItem"===r?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+RS(n)+";"+(e||"")+'"></span>':'<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:'+RS(n)+";"+(e||"")+'"></span>':{renderMode:o,content:"{"+(i.markerId||"markerX")+"|} ",style:"subItem"===r?{width:4,height:4,borderRadius:2,backgroundColor:n}:{width:10,height:10,borderRadius:5,backgroundColor:n}}:""}({color:e,type:t,renderMode:i,markerId:n});return ME(r)?r:("production"!==process.env.NODE_ENV&&UE(n),this.richTextStyles[n]=r.style,r.content)},t.prototype.wrapRichTextStyle=function(t,e){var i={};EE(e)?yE(e,(function(t){return pE(i,t)})):pE(i,e);var n=this._generateStyleName();return this.richTextStyles[n]=i,"{"+n+"|"+t+"}"},t}();function DV(t){var e,i,n,r,o=t.series,s=t.dataIndex,a=t.multipleSeries,l=o.getData(),c=l.mapDimensionsAll("defaultedTooltip"),u=c.length,h=o.getRawValue(s),p=EE(h),d=CV(o,s);if(u>1||p&&!u){var f=function(t,e,i,n,r){var o=e.getData(),s=_E(t,(function(t,e,i){var n=o.getDimensionInfo(i);return t||n&&!1!==n.tooltip&&null!=n.displayName}),!1),a=[],l=[],c=[];function u(t,e){var i=o.getDimensionInfo(e);i&&!1!==i.otherDims.tooltip&&(s?c.push(xV("nameValue",{markerType:"subItem",markerColor:r,name:i.displayName,value:t,valueType:i.type})):(a.push(t),l.push(i.type)))}return n.length?yE(n,(function(t){u(RF(o,i,t),t)})):yE(t,u),{inlineValues:a,inlineValueTypes:l,blocks:c}}(h,o,s,c,d);e=f.inlineValues,i=f.inlineValueTypes,n=f.blocks,r=f.inlineValues[0]}else if(u){var m=l.getDimensionInfo(c[0]);r=e=RF(l,s,c[0]),i=m.type}else r=e=p?h[0]:h;var g=_P(o),y=g&&o.name||"",v=l.getName(s),_=a?y:v;return xV("section",{header:y,noHeader:a||!g,sortParam:r,blocks:[xV("nameValue",{markerType:"item",markerColor:d,name:_,noName:!GE(_),value:e,valueType:i})].concat(n||[])})}var RV=wP();function OV(t,e){return t.getName(e)||t.getId(e)}var kV="__universalTransitionEnabled",NV=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._selectedDataIndicesMap={},e}return zA(e,t),e.prototype.init=function(t,e,i){this.seriesIndex=this.componentIndex,this.dataTask=BF({count:zV,reset:FV}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,i),(RV(this).sourceManager=new pV(this)).prepareSource();var n=this.getInitialData(t,i);UV(n,this),this.dataTask.context.data=n,"production"!==process.env.NODE_ENV&&UE(n,"getInitialData returned invalid data."),RV(this).dataBeforeProcessed=n,BV(this),this._initSelectedMapFromData(n)},e.prototype.mergeDefaultAndTheme=function(t,e){var i=jB(this),n=i?WB(t):{},r=this.subType;YB.hasClass(r)&&(r+="Series"),uE(t,e.getTheme().get(this.subType)),uE(t,this.getDefaultOption()),cP(t,"label",["show"]),this.fillDataTextStyle(t.data),i&&HB(t,n,i)},e.prototype.mergeOption=function(t,e){t=uE(this.option,t,!0),this.fillDataTextStyle(t.data);var i=jB(this);i&&HB(this.option,t,i);var n=RV(this).sourceManager;n.dirty(),n.prepareSource();var r=this.getInitialData(t,e);UV(r,this),this.dataTask.dirty(),this.dataTask.context.data=r,RV(this).dataBeforeProcessed=r,BV(this),this._initSelectedMapFromData(r)},e.prototype.fillDataTextStyle=function(t){if(t&&!LE(t))for(var e=["show"],i=0;i<t.length;i++)t[i]&&t[i].label&&cP(t[i],"label",e)},e.prototype.getInitialData=function(t,e){},e.prototype.appendData=function(t){this.getRawData().appendData(t.data)},e.prototype.getData=function(t){var e=jV(this);if(e){var i=e.context.data;return null==t?i:i.getLinkedData(t)}return RV(this).data},e.prototype.getAllData=function(){var t=this.getData();return t&&t.getLinkedDataAll?t.getLinkedDataAll():[{data:t}]},e.prototype.setData=function(t){var e=jV(this);if(e){var i=e.context;i.outputData=t,e!==this.dataTask&&(i.data=t)}RV(this).data=t},e.prototype.getEncode=function(){var t=this.get("encode",!0);if(t)return YE(t)},e.prototype.getSourceManager=function(){return RV(this).sourceManager},e.prototype.getSource=function(){return this.getSourceManager().getSource()},e.prototype.getRawData=function(){return RV(this).dataBeforeProcessed},e.prototype.getColorBy=function(){return this.get("colorBy")||"series"},e.prototype.isColorBySeries=function(){return"series"===this.getColorBy()},e.prototype.getBaseAxis=function(){var t=this.coordinateSystem;return t&&t.getBaseAxis&&t.getBaseAxis()},e.prototype.formatTooltip=function(t,e,i){return DV({series:this,dataIndex:t,multipleSeries:e})},e.prototype.isAnimationEnabled=function(){var t=this.ecModel;if(UA.node&&(!t||!t.ssr))return!1;var e=this.getShallow("animation");return e&&this.getData().count()>this.getShallow("animationThreshold")&&(e=!1),!!e},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(t,e,i){var n=this.ecModel,r=bz.prototype.getColorFromPalette.call(this,t,e,i);return r||(r=n.getColorFromPalette(t,e,i)),r},e.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},e.prototype.getProgressive=function(){return this.get("progressive")},e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},e.prototype.select=function(t,e){this._innerSelect(this.getData(e),t)},e.prototype.unselect=function(t,e){var i=this.option.selectedMap;if(i){var n=this.option.selectedMode,r=this.getData(e);if("series"===n||"all"===i)return this.option.selectedMap={},void(this._selectedDataIndicesMap={});for(var o=0;o<t.length;o++){var s=OV(r,t[o]);i[s]=!1,this._selectedDataIndicesMap[s]=-1}}},e.prototype.toggleSelect=function(t,e){for(var i=[],n=0;n<t.length;n++)i[0]=t[n],this.isSelected(t[n],e)?this.unselect(i,e):this.select(i,e)},e.prototype.getSelectedDataIndices=function(){if("all"===this.option.selectedMap)return[].slice.call(this.getData().getIndices());for(var t=this._selectedDataIndicesMap,e=bE(t),i=[],n=0;n<e.length;n++){var r=t[e[n]];r>=0&&i.push(r)}return i},e.prototype.isSelected=function(t,e){var i=this.option.selectedMap;if(!i)return!1;var n=this.getData(e);return("all"===i||i[OV(n,t)])&&!n.getItemModel(t).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[kV])return!0;var t=this.option.universalTransition;return!!t&&(!0===t||t&&t.enabled)},e.prototype._innerSelect=function(t,e){var i,n,r=this.option,o=r.selectedMode,s=e.length;if(o&&s)if("series"===o)r.selectedMap="all";else if("multiple"===o){CE(r.selectedMap)||(r.selectedMap={});for(var a=r.selectedMap,l=0;l<s;l++){var c=e[l];a[h=OV(t,c)]=!0,this._selectedDataIndicesMap[h]=t.getRawIndex(c)}}else if("single"===o||!0===o){var u=e[s-1],h=OV(t,u);r.selectedMap=((i={})[h]=!0,i),this._selectedDataIndicesMap=((n={})[h]=t.getRawIndex(u),n)}},e.prototype._initSelectedMapFromData=function(t){if(!this.option.selectedMap){var e=[];t.hasItemOption&&t.each((function(i){var n=t.getRawDataItem(i);n&&n.selected&&e.push(i)})),e.length>0&&this._innerSelect(t,e)}},e.registerClass=function(t){return YB.registerClass(t)},e.protoInitialize=function(){var t=e.prototype;t.type="series.__base__",t.seriesIndex=0,t.ignoreStyleOnData=!1,t.hasSymbolVisual=!1,t.defaultSymbol="circle",t.visualStyleAccessPath="itemStyle",t.visualDrawType="fill"}(),e}(YB);function BV(t){var e=t.name;_P(t)||(t.name=function(t){var e=t.getRawData(),i=e.mapDimensionsAll("seriesName"),n=[];return yE(i,(function(t){var i=e.getDimensionInfo(t);i.displayName&&n.push(i.displayName)})),n.join(" ")}(t)||e)}function zV(t){return t.model.getRawData().count()}function FV(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),VV}function VV(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function UV(t,e){yE(QE(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),(function(i){t.wrapMethod(i,AE(GV,e))}))}function GV(t,e){var i=jV(t);return i&&i.setOutputEnd((e||this).count()),e}function jV(t){var e=(t.ecModel||{}).scheduler,i=e&&e.getPipeline(t.uid);if(i){var n=i.currentTask;if(n){var r=n.agentStubMap;r&&(n=r.get(t.uid))}return n}}mE(NV,kF),mE(NV,bz),BP(NV,YB);var HV=NV,WV=function(){function t(){this.group=new xC,this.uid=UN("viewComponent")}return t.prototype.init=function(t,e){},t.prototype.render=function(t,e,i,n){},t.prototype.dispose=function(t,e){},t.prototype.updateView=function(t,e,i,n){},t.prototype.updateLayout=function(t,e,i,n){},t.prototype.updateVisual=function(t,e,i,n){},t.prototype.toggleBlurSeries=function(t,e,i){},t.prototype.eachRendered=function(t){var e=this.group;e&&e.traverse(t)},t}();NP(WV),UP(WV);var qV=WV;function XV(){var t=wP();return function(e){var i=t(e),n=e.pipelineContext,r=!!i.large,o=!!i.progressiveRender,s=i.large=!(!n||!n.large),a=i.progressiveRender=!(!n||!n.progressiveRender);return!(r===s&&o===a)&&"reset"}}var ZV=wP(),YV=XV(),QV=function(){function t(){this.group=new xC,this.uid=UN("viewChart"),this.renderTask=BF({plan:$V,reset:tU}),this.renderTask.context={view:this}}return t.prototype.init=function(t,e){},t.prototype.render=function(t,e,i,n){if("production"!==process.env.NODE_ENV)throw new Error("render method must been implemented")},t.prototype.highlight=function(t,e,i,n){var r=t.getData(n&&n.dataType);r?KV(r,n,"emphasis"):"production"!==process.env.NODE_ENV&&tP("Unknown dataType "+n.dataType)},t.prototype.downplay=function(t,e,i,n){var r=t.getData(n&&n.dataType);r?KV(r,n,"normal"):"production"!==process.env.NODE_ENV&&tP("Unknown dataType "+n.dataType)},t.prototype.remove=function(t,e){this.group.removeAll()},t.prototype.dispose=function(t,e){},t.prototype.updateView=function(t,e,i,n){this.render(t,e,i,n)},t.prototype.updateLayout=function(t,e,i,n){this.render(t,e,i,n)},t.prototype.updateVisual=function(t,e,i,n){this.render(t,e,i,n)},t.prototype.eachRendered=function(t){lN(this.group,t)},t.markUpdateMethod=function(t,e){ZV(t).updateMethod=e},t.protoInitialize=void(t.prototype.type="chart"),t}();function JV(t,e,i){t&&$R(t)&&("emphasis"===e?RR:OR)(t,i)}function KV(t,e,i){var n=bP(t,e),r=e&&null!=e.highlightKey?function(t){var e=eR[t];return null==e&&tR<=32&&(e=eR[t]=tR++),e}(e.highlightKey):null;null!=n?yE(lP(n),(function(e){JV(t.getItemGraphicEl(e),i,r)})):t.eachItemGraphicEl((function(t){JV(t,i,r)}))}function $V(t){return YV(t.model)}function tU(t){var e=t.model,i=t.ecModel,n=t.api,r=t.payload,o=e.pipelineContext.progressiveRender,s=t.view,a=r&&ZV(r).updateMethod,l=o?"incrementalPrepareRender":a&&s[a]?a:"render";return"render"!==l&&s[l](e,i,n,r),eU[l]}NP(QV,["dispose"]),UP(QV);var eU={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}},iU=QV,nU="\0__throttleOriginMethod",rU="\0__throttleRate",oU="\0__throttleType";function sU(t,e,i){var n,r,o,s,a,l=0,c=0,u=null;function h(){c=(new Date).getTime(),u=null,t.apply(o,s||[])}e=e||0;var p=function(){for(var t=[],p=0;p<arguments.length;p++)t[p]=arguments[p];n=(new Date).getTime(),o=this,s=t;var d=a||e,f=a||i;a=null,r=n-(f?l:c)-d,clearTimeout(u),f?u=setTimeout(h,d):r>=0?h():u=setTimeout(h,-r),l=n};return p.clear=function(){u&&(clearTimeout(u),u=null)},p.debounceNextCall=function(t){a=t},p}function aU(t,e,i,n){var r=t[e];if(r){var o=r[nU]||r,s=r[oU];if(r[rU]!==i||s!==n){if(null==i||!n)return t[e]=o;(r=t[e]=sU(o,i,"debounce"===n))[nU]=o,r[oU]=n,r[rU]=i}return r}}function lU(t,e){var i=t[e];i&&i[nU]&&(i.clear&&i.clear(),t[e]=i[nU])}var cU=wP(),uU={itemStyle:GP(kN,!0),lineStyle:GP(DN,!0)},hU={lineStyle:"stroke",itemStyle:"fill"};function pU(t,e){var i=t.visualStyleMapper||uU[e];return i||(console.warn("Unknown style type '"+e+"'."),uU.itemStyle)}function dU(t,e){var i=t.visualDrawType||hU[e];return i||(console.warn("Unknown style type '"+e+"'."),"fill")}var fU={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var i=t.getData(),n=t.visualStyleAccessPath||"itemStyle",r=t.getModel(n),o=pU(t,n)(r),s=r.getShallow("decal");s&&(i.setVisual("decal",s),s.dirty=!0);var a=dU(t,n),l=o[a],c=SE(l)?l:null,u="auto"===o.fill||"auto"===o.stroke;if(!o[a]||c||u){var h=t.getColorFromPalette(t.name,null,e.getSeriesCount());o[a]||(o[a]=h,i.setVisual("colorFromPalette",!0)),o.fill="auto"===o.fill||SE(o.fill)?h:o.fill,o.stroke="auto"===o.stroke||SE(o.stroke)?h:o.stroke}if(i.setVisual("style",o),i.setVisual("drawType",a),!e.isSeriesFiltered(t)&&c)return i.setVisual("colorFromPalette",!1),{dataEach:function(e,i){var n=t.getDataParams(i),r=pE({},o);r[a]=c(n),e.setItemVisual(i,"style",r)}}}},mU=new FN,gU={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(!t.ignoreStyleOnData&&!e.isSeriesFiltered(t)){var i=t.getData(),n=t.visualStyleAccessPath||"itemStyle",r=pU(t,n),o=i.getVisual("drawType");return{dataEach:i.hasItemOption?function(t,e){var i=t.getRawDataItem(e);if(i&&i[n]){mU.option=i[n];var s=r(mU);pE(t.ensureUniqueItemVisual(e,"style"),s),mU.option.decal&&(t.setItemVisual(e,"decal",mU.option.decal),mU.option.decal.dirty=!0),o in s&&t.setItemVisual(e,"colorFromPalette",!1)}}:null}}}},yU={performRawSeries:!0,overallReset:function(t){var e=YE();t.eachSeries((function(t){var i=t.getColorBy();if(!t.isColorBySeries()){var n=t.type+"-"+i,r=e.get(n);r||(r={},e.set(n,r)),cU(t).scope=r}})),t.eachSeries((function(e){if(!e.isColorBySeries()&&!t.isSeriesFiltered(e)){var i=e.getRawData(),n={},r=e.getData(),o=cU(e).scope,s=e.visualStyleAccessPath||"itemStyle",a=dU(e,s);r.each((function(t){var e=r.getRawIndex(t);n[e]=t})),i.each((function(t){var s=n[t];if(r.getItemVisual(s,"colorFromPalette")){var l=r.ensureUniqueItemVisual(s,"style"),c=i.getName(t)||t+"",u=i.count();l[a]=e.getColorFromPalette(c,o,u)}}))}}))}},vU=Math.PI;var _U=function(){function t(t,e,i,n){this._stageTaskMap=YE(),this.ecInstance=t,this.api=e,i=this._dataProcessorHandlers=i.slice(),n=this._visualHandlers=n.slice(),this._allHandlers=i.concat(n)}return t.prototype.restoreData=function(t,e){t.restoreData(e),this._stageTaskMap.each((function(t){var e=t.overallTask;e&&e.dirty()}))},t.prototype.getPerformArgs=function(t,e){if(t.__pipeline){var i=this._pipelineMap.get(t.__pipeline.id),n=i.context,r=!e&&i.progressiveEnabled&&(!n||n.progressiveRender)&&t.__idxInPipeline>i.blockIndex?i.step:null,o=n&&n.modDataCount;return{step:r,modBy:null!=o?Math.ceil(o/r):null,modDataCount:o}}},t.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},t.prototype.updateStreamModes=function(t,e){var i=this._pipelineMap.get(t.uid),n=t.getData().count(),r=i.progressiveEnabled&&e.incrementalPrepareRender&&n>=i.threshold,o=t.get("large")&&n>=t.get("largeThreshold"),s="mod"===t.get("progressiveChunkMode")?n:null;t.pipelineContext=i.context={progressiveRender:r,modDataCount:s,large:o}},t.prototype.restorePipelines=function(t){var e=this,i=e._pipelineMap=YE();t.eachSeries((function(t){var n=t.getProgressive(),r=t.uid;i.set(r,{id:r,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:n&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(n||700),count:0}),e._pipe(t,t.dataTask)}))},t.prototype.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.api.getModel(),i=this.api;yE(this._allHandlers,(function(n){var r=t.get(n.uid)||t.set(n.uid,{}),o="";"production"!==process.env.NODE_ENV&&(o='"reset" and "overallReset" must not be both specified.'),UE(!(n.reset&&n.overallReset),o),n.reset&&this._createSeriesStageTask(n,r,e,i),n.overallReset&&this._createOverallStageTask(n,r,e,i)}),this)},t.prototype.prepareView=function(t,e,i,n){var r=t.renderTask,o=r.context;o.model=e,o.ecModel=i,o.api=n,r.__block=!t.incrementalPrepareRender,this._pipe(e,r)},t.prototype.performDataProcessorTasks=function(t,e){this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},t.prototype.performVisualTasks=function(t,e,i){this._performStageTasks(this._visualHandlers,t,e,i)},t.prototype._performStageTasks=function(t,e,i,n){n=n||{};var r=!1,o=this;function s(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}yE(t,(function(t,a){if(!n.visualType||n.visualType===t.visualType){var l=o._stageTaskMap.get(t.uid),c=l.seriesTaskMap,u=l.overallTask;if(u){var h,p=u.agentStubMap;p.each((function(t){s(n,t)&&(t.dirty(),h=!0)})),h&&u.dirty(),o.updatePayload(u,i);var d=o.getPerformArgs(u,n.block);p.each((function(t){t.perform(d)})),u.perform(d)&&(r=!0)}else c&&c.each((function(a,l){s(n,a)&&a.dirty();var c=o.getPerformArgs(a,n.block);c.skip=!t.performRawSeries&&e.isSeriesFiltered(a.context.model),o.updatePayload(a,i),a.perform(c)&&(r=!0)}))}})),this.unfinished=r||this.unfinished},t.prototype.performSeriesTasks=function(t){var e;t.eachSeries((function(t){e=t.dataTask.perform()||e})),this.unfinished=e||this.unfinished},t.prototype.plan=function(){this._pipelineMap.each((function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)}))},t.prototype.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},t.prototype._createSeriesStageTask=function(t,e,i,n){var r=this,o=e.seriesTaskMap,s=e.seriesTaskMap=YE(),a=t.seriesType,l=t.getTargetSeries;function c(e){var a=e.uid,l=s.set(a,o&&o.get(a)||BF({plan:EU,reset:SU,count:IU}));l.context={model:e,ecModel:i,api:n,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:r},r._pipe(e,l)}t.createOnAllSeries?i.eachRawSeries(c):a?i.eachRawSeriesByType(a,c):l&&l(i,n).each(c)},t.prototype._createOverallStageTask=function(t,e,i,n){var r=this,o=e.overallTask=e.overallTask||BF({reset:xU});o.context={ecModel:i,api:n,overallReset:t.overallReset,scheduler:r};var s=o.agentStubMap,a=o.agentStubMap=YE(),l=t.seriesType,c=t.getTargetSeries,u=!0,h=!1,p="";function d(t){var e=t.uid,i=a.set(e,s&&s.get(e)||(h=!0,BF({reset:bU,onDirty:AU})));i.context={model:t,overallProgress:u},i.agent=o,i.__block=u,r._pipe(t,i)}"production"!==process.env.NODE_ENV&&(p='"createOnAllSeries" is not supported for "overallReset", because it will block all streams.'),UE(!t.createOnAllSeries,p),l?i.eachRawSeriesByType(l,d):c?c(i,n).each(d):(u=!1,yE(i.getSeries(),d)),h&&o.dirty()},t.prototype._pipe=function(t,e){var i=t.uid,n=this._pipelineMap.get(i);!n.head&&(n.head=e),n.tail&&n.tail.pipe(e),n.tail=e,e.__idxInPipeline=n.count++,e.__pipeline=n},t.wrapStageHandler=function(t,e){return SE(t)&&(t={overallReset:t,seriesType:CU(t)}),t.uid=UN("stageHandler"),e&&(t.visualType=e),t},t}();function xU(t){t.overallReset(t.ecModel,t.api,t.payload)}function bU(t){return t.overallProgress&&wU}function wU(){this.agent.dirty(),this.getDownstream().dirty()}function AU(){this.agent&&this.agent.dirty()}function EU(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function SU(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=lP(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?vE(e,(function(t,e){return TU(e)})):MU}var MU=TU(0);function TU(t){return function(e,i){var n=i.data,r=i.resetDefines[t];if(r&&r.dataEach)for(var o=e.start;o<e.end;o++)r.dataEach(n,o);else r&&r.progress&&r.progress(e,n)}}function IU(t){return t.data.count()}function CU(t){PU=null;try{t(LU,DU)}catch(t){}return PU}var PU,LU={},DU={};function RU(t,e){for(var i in e.prototype)t[i]=tS}RU(LU,Dz),RU(DU,Oz),LU.eachSeriesByType=LU.eachRawSeriesByType=function(t){PU=t},LU.eachComponent=function(t){"series"===t.mainType&&t.subType&&(PU=t.subType)};var OU=_U,kU=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"],NU={color:kU,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],kU]},BU="#B9B8CE",zU="#100C2A",FU=function(){return{axisLine:{lineStyle:{color:BU}},splitLine:{lineStyle:{color:"#484753"}},splitArea:{areaStyle:{color:["rgba(255,255,255,0.02)","rgba(255,255,255,0.05)"]}},minorSplitLine:{lineStyle:{color:"#20203B"}}}},VU=["#4992ff","#7cffb2","#fddd60","#ff6e76","#58d9f9","#05c091","#ff8a45","#8d48e3","#dd79ff"],UU={darkMode:!0,color:VU,backgroundColor:zU,axisPointer:{lineStyle:{color:"#817f91"},crossStyle:{color:"#817f91"},label:{color:"#fff"}},legend:{textStyle:{color:BU}},textStyle:{color:BU},title:{textStyle:{color:"#EEF1FA"},subtextStyle:{color:"#B9B8CE"}},toolbox:{iconStyle:{borderColor:BU}},dataZoom:{borderColor:"#71708A",textStyle:{color:BU},brushStyle:{color:"rgba(135,163,206,0.3)"},handleStyle:{color:"#353450",borderColor:"#C5CBE3"},moveHandleStyle:{color:"#B0B6C3",opacity:.3},fillerColor:"rgba(135,163,206,0.2)",emphasis:{handleStyle:{borderColor:"#91B7F2",color:"#4D587D"},moveHandleStyle:{color:"#636D9A",opacity:.7}},dataBackground:{lineStyle:{color:"#71708A",width:1},areaStyle:{color:"#71708A"}},selectedDataBackground:{lineStyle:{color:"#87A3CE"},areaStyle:{color:"#87A3CE"}}},visualMap:{textStyle:{color:BU}},timeline:{lineStyle:{color:BU},label:{color:BU},controlStyle:{color:BU,borderColor:BU}},calendar:{itemStyle:{color:zU},dayLabel:{color:BU},monthLabel:{color:BU},yearLabel:{color:BU}},timeAxis:FU(),logAxis:FU(),valueAxis:FU(),categoryAxis:FU(),line:{symbol:"circle"},graph:{color:VU},gauge:{title:{color:BU},axisLine:{lineStyle:{color:[[1,"rgba(207,212,219,0.2)"]]}},axisLabel:{color:BU},detail:{color:"#EEF1FA"}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}}};UU.categoryAxis.splitLine.show=!1;var GU=UU,jU=function(){function t(){}return t.prototype.normalizeQuery=function(t){var e={},i={},n={};if(ME(t)){var r=kP(t);e.mainType=r.main||null,e.subType=r.sub||null}else{var o=["Index","Name","Id"],s={name:1,dataIndex:1,dataType:1};yE(t,(function(t,r){for(var a=!1,l=0;l<o.length;l++){var c=o[l],u=r.lastIndexOf(c);if(u>0&&u===r.length-c.length){var h=r.slice(0,u);"data"!==h&&(e.mainType=h,e[c.toLowerCase()]=t,a=!0)}}s.hasOwnProperty(r)&&(i[r]=t,a=!0),a||(n[r]=t)}))}return{cptQuery:e,dataQuery:i,otherQuery:n}},t.prototype.filter=function(t,e){var i=this.eventInfo;if(!i)return!0;var n=i.targetEl,r=i.packedEvent,o=i.model,s=i.view;if(!o||!s)return!0;var a=e.cptQuery,l=e.dataQuery;return c(a,o,"mainType")&&c(a,o,"subType")&&c(a,o,"index","componentIndex")&&c(a,o,"name")&&c(a,o,"id")&&c(l,r,"name")&&c(l,r,"dataIndex")&&c(l,r,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(t,e.otherQuery,n,r));function c(t,e,i,n){return null==t[i]||e[n||i]===t[i]}},t.prototype.afterTrigger=function(){this.eventInfo=null},t}(),HU=["symbol","symbolSize","symbolRotate","symbolOffset"],WU=HU.concat(["symbolKeepAspect"]),qU={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var i=t.getData();if(t.legendIcon&&i.setVisual("legendIcon",t.legendIcon),t.hasSymbolVisual){for(var n={},r={},o=!1,s=0;s<HU.length;s++){var a=HU[s],l=t.get(a);SE(l)?(o=!0,r[a]=l):n[a]=l}if(n.symbol=n.symbol||t.defaultSymbol,i.setVisual(pE({legendIcon:t.legendIcon||n.symbol,symbolKeepAspect:t.get("symbolKeepAspect")},n)),!e.isSeriesFiltered(t)){var c=bE(r);return{dataEach:o?function(e,i){for(var n=t.getRawValue(i),o=t.getDataParams(i),s=0;s<c.length;s++){var a=c[s];e.setItemVisual(i,a,r[a](n,o))}}:null}}}}},XU={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(t.hasSymbolVisual&&!e.isSeriesFiltered(t))return{dataEach:t.getData().hasItemOption?function(t,e){for(var i=t.getItemModel(e),n=0;n<WU.length;n++){var r=WU[n],o=i.getShallow(r,!0);null!=o&&t.setItemVisual(e,r,o)}}:null}}};function ZU(t,e,i){switch(i){case"color":return t.getItemVisual(e,"style")[t.getVisual("drawType")];case"opacity":return t.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getItemVisual(e,i);default:"production"!==process.env.NODE_ENV&&console.warn("Unknown visual type "+i)}}function YU(t,e){switch(e){case"color":return t.getVisual("style")[t.getVisual("drawType")];case"opacity":return t.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getVisual(e);default:"production"!==process.env.NODE_ENV&&console.warn("Unknown visual type "+e)}}function QU(t,e,i,n){switch(i){case"color":t.ensureUniqueItemVisual(e,"style")[t.getVisual("drawType")]=n,t.setItemVisual(e,"colorFromPalette",!1);break;case"opacity":t.ensureUniqueItemVisual(e,"style").opacity=n;break;case"symbol":case"symbolSize":case"liftZ":t.setItemVisual(e,i,n);break;default:"production"!==process.env.NODE_ENV&&console.warn("Unknown visual type "+i)}}function JU(t,e){function i(e,i){var n=[];return e.eachComponent({mainType:"series",subType:t,query:i},(function(t){n.push(t.seriesIndex)})),n}yE([[t+"ToggleSelect","toggleSelect"],[t+"Select","select"],[t+"UnSelect","unselect"]],(function(t){e(t[0],(function(e,n,r){e=pE({},e),"production"!==process.env.NODE_ENV&&iP(e.type,t[1]),r.dispatchAction(pE(e,{type:t[1],seriesIndex:i(n,e)}))}))}))}function KU(t,e,i,n,r){var o=t+e;i.isSilent(o)||("production"!==process.env.NODE_ENV&&eP("event "+o+" is deprecated."),n.eachComponent({mainType:"series",subType:"pie"},(function(t){for(var e=t.seriesIndex,n=t.option.selectedMap,s=r.selected,a=0;a<s.length;a++)if(s[a].seriesIndex===e){var l=t.getData(),c=bP(l,r.fromActionPayload);i.trigger(o,{type:o,seriesId:t.id,name:EE(c)?l.getName(c[0]):l.getName(c),selected:ME(n)?n:pE({},n)})}})))}function $U(t,e,i){for(var n;t&&(!e(t)||(n=t,!i));)t=t.__hostTarget||t.parent;return n}var tG=Math.round(9*Math.random()),eG="function"==typeof Object.defineProperty,iG=function(){function t(){this._id="__ec_inner_"+tG++}return t.prototype.get=function(t){return this._guard(t)[this._id]},t.prototype.set=function(t,e){var i=this._guard(t);return eG?Object.defineProperty(i,this._id,{value:e,enumerable:!1,configurable:!0}):i[this._id]=e,this},t.prototype.delete=function(t){return!!this.has(t)&&(delete this._guard(t)[this._id],!0)},t.prototype.has=function(t){return!!this._guard(t)[this._id]},t.prototype._guard=function(t){if(t!==Object(t))throw TypeError("Value of WeakMap is not a non-null object.");return t},t}(),nG=iG,rG=xD.extend({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var i=e.cx,n=e.cy,r=e.width/2,o=e.height/2;t.moveTo(i,n-o),t.lineTo(i+r,n+o),t.lineTo(i-r,n+o),t.closePath()}}),oG=xD.extend({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var i=e.cx,n=e.cy,r=e.width/2,o=e.height/2;t.moveTo(i,n-o),t.lineTo(i+r,n),t.lineTo(i,n+o),t.lineTo(i-r,n),t.closePath()}}),sG=xD.extend({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var i=e.x,n=e.y,r=e.width/5*3,o=Math.max(r,e.height),s=r/2,a=s*s/(o-s),l=n-o+s+a,c=Math.asin(a/s),u=Math.cos(c)*s,h=Math.sin(c),p=Math.cos(c),d=.6*s,f=.7*s;t.moveTo(i-u,l+a),t.arc(i,l,s,Math.PI-c,2*Math.PI+c),t.bezierCurveTo(i+u-h*d,l+a+p*d,i,n-f,i,n),t.bezierCurveTo(i,n-f,i-u+h*d,l+a+p*d,i-u,l+a),t.closePath()}}),aG=xD.extend({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var i=e.height,n=e.width,r=e.x,o=e.y,s=n/3*2;t.moveTo(r,o),t.lineTo(r+s,o+i),t.lineTo(r,o+i/4*3),t.lineTo(r-s,o+i),t.lineTo(r,o),t.closePath()}}),lG={line:function(t,e,i,n,r){r.x1=t,r.y1=e+n/2,r.x2=t+i,r.y2=e+n/2},rect:function(t,e,i,n,r){r.x=t,r.y=e,r.width=i,r.height=n},roundRect:function(t,e,i,n,r){r.x=t,r.y=e,r.width=i,r.height=n,r.r=Math.min(i,n)/4},square:function(t,e,i,n,r){var o=Math.min(i,n);r.x=t,r.y=e,r.width=o,r.height=o},circle:function(t,e,i,n,r){r.cx=t+i/2,r.cy=e+n/2,r.r=Math.min(i,n)/2},diamond:function(t,e,i,n,r){r.cx=t+i/2,r.cy=e+n/2,r.width=i,r.height=n},pin:function(t,e,i,n,r){r.x=t+i/2,r.y=e+n/2,r.width=i,r.height=n},arrow:function(t,e,i,n,r){r.x=t+i/2,r.y=e+n/2,r.width=i,r.height=n},triangle:function(t,e,i,n,r){r.cx=t+i/2,r.cy=e+n/2,r.width=i,r.height=n}},cG={};yE({line:nk,rect:kD,roundRect:kD,square:kD,circle:EO,diamond:oG,pin:sG,arrow:aG,triangle:rG},(function(t,e){cG[e]=new t}));var uG=xD.extend({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(t,e,i){var n=aC(t,e,i),r=this.shape;return r&&"pin"===r.symbolType&&"inside"===e.position&&(n.y=i.y+.4*i.height),n},buildPath:function(t,e,i){var n=e.symbolType;if("none"!==n){var r=cG[n];r||(r=cG[n="rect"]),lG[n](e.x,e.y,e.width,e.height,r.shape),r.buildPath(t,r.shape,i)}}});function hG(t,e){if("image"!==this.type){var i=this.style;this.__isEmptyBrush?(i.stroke=t,i.fill=e||"#fff",i.lineWidth=2):"line"===this.shape.symbolType?i.stroke=t:i.fill=t,this.markRedraw()}}function pG(t,e,i,n,r,o,s){var a,l=0===t.indexOf("empty");return l&&(t=t.substr(5,1).toLowerCase()+t.substr(6)),(a=0===t.indexOf("image://")?Hk(t.slice(8),new pM(e,i,n,r),s?"center":"cover"):0===t.indexOf("path://")?jk(t.slice(7),{},new pM(e,i,n,r),s?"center":"cover"):new uG({shape:{symbolType:t,x:e,y:i,width:n,height:r}})).__isEmptyBrush=l,a.setColor=hG,o&&a.setColor(o),a}function dG(t){return EE(t)||(t=[+t,+t]),[t[0]||0,t[1]||0]}function fG(t,e){if(null!=t)return EE(t)||(t=[t,t]),[IC(t[0],e[0])||0,IC(BE(t[1],t[0]),e[1])||0]}function mG(t){return isFinite(t)}function gG(t,e,i){for(var n="radial"===e.type?function(t,e,i){var n=i.width,r=i.height,o=Math.min(n,r),s=null==e.x?.5:e.x,a=null==e.y?.5:e.y,l=null==e.r?.5:e.r;return e.global||(s=s*n+i.x,a=a*r+i.y,l*=o),s=mG(s)?s:.5,a=mG(a)?a:.5,l=l>=0&&mG(l)?l:.5,t.createRadialGradient(s,a,0,s,a,l)}(t,e,i):function(t,e,i){var n=null==e.x?0:e.x,r=null==e.x2?1:e.x2,o=null==e.y?0:e.y,s=null==e.y2?0:e.y2;return e.global||(n=n*i.width+i.x,r=r*i.width+i.x,o=o*i.height+i.y,s=s*i.height+i.y),n=mG(n)?n:0,r=mG(r)?r:1,o=mG(o)?o:0,s=mG(s)?s:0,t.createLinearGradient(n,o,r,s)}(t,e,i),r=e.colorStops,o=0;o<r.length;o++)n.addColorStop(r[o].offset,r[o].color);return n}function yG(t){return parseInt(t,10)}function vG(t,e,i){var n=["width","height"][e],r=["clientWidth","clientHeight"][e],o=["paddingLeft","paddingTop"][e],s=["paddingRight","paddingBottom"][e];if(null!=i[n]&&"auto"!==i[n])return parseFloat(i[n]);var a=document.defaultView.getComputedStyle(t);return(t[r]||yG(a[n])||yG(t.style[n]))-(yG(a[o])||0)-(yG(a[s])||0)|0}function _G(t){var e,i,n=t.style,r=n.lineDash&&n.lineWidth>0&&(e=n.lineDash,i=n.lineWidth,e&&"solid"!==e&&i>0?"dashed"===e?[4*i,2*i]:"dotted"===e?[i]:IE(e)?[e]:EE(e)?e:null:null),o=n.lineDashOffset;if(r){var s=n.strokeNoScale&&t.getLineScale?t.getLineScale():1;s&&1!==s&&(r=vE(r,(function(t){return t/s})),o/=s)}return[r,o]}var xG=new KL(!0);function bG(t){var e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))}function wG(t){return"string"==typeof t&&"none"!==t}function AG(t){var e=t.fill;return null!=e&&"none"!==e}function EG(t,e){if(null!=e.fillOpacity&&1!==e.fillOpacity){var i=t.globalAlpha;t.globalAlpha=e.fillOpacity*e.opacity,t.fill(),t.globalAlpha=i}else t.fill()}function SG(t,e){if(null!=e.strokeOpacity&&1!==e.strokeOpacity){var i=t.globalAlpha;t.globalAlpha=e.strokeOpacity*e.opacity,t.stroke(),t.globalAlpha=i}else t.stroke()}function MG(t,e,i){var n=XP(e.image,e.__image,i);if(YP(n)){var r=t.createPattern(n,e.repeat||"repeat");if("function"==typeof DOMMatrix&&r&&r.setTransform){var o=new DOMMatrix;o.translateSelf(e.x||0,e.y||0),o.rotateSelf(0,0,(e.rotation||0)*eS),o.scaleSelf(e.scaleX||1,e.scaleY||1),r.setTransform(o)}return r}}var TG=["shadowBlur","shadowOffsetX","shadowOffsetY"],IG=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function CG(t,e,i,n,r){var o=!1;if(!n&&e===(i=i||{}))return!1;if(n||e.opacity!==i.opacity){NG(t,r),o=!0;var s=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(s)?cL.opacity:s}(n||e.blend!==i.blend)&&(o||(NG(t,r),o=!0),t.globalCompositeOperation=e.blend||cL.blend);for(var a=0;a<TG.length;a++){var l=TG[a];(n||e[l]!==i[l])&&(o||(NG(t,r),o=!0),t[l]=t.dpr*(e[l]||0))}return(n||e.shadowColor!==i.shadowColor)&&(o||(NG(t,r),o=!0),t.shadowColor=e.shadowColor||cL.shadowColor),o}function PG(t,e,i,n,r){var o=BG(e,r.inHover),s=n?null:i&&BG(i,r.inHover)||{};if(o===s)return!1;var a=CG(t,o,s,n,r);if((n||o.fill!==s.fill)&&(a||(NG(t,r),a=!0),wG(o.fill)&&(t.fillStyle=o.fill)),(n||o.stroke!==s.stroke)&&(a||(NG(t,r),a=!0),wG(o.stroke)&&(t.strokeStyle=o.stroke)),(n||o.opacity!==s.opacity)&&(a||(NG(t,r),a=!0),t.globalAlpha=null==o.opacity?1:o.opacity),e.hasStroke()){var l=o.lineWidth/(o.strokeNoScale&&e.getLineScale?e.getLineScale():1);t.lineWidth!==l&&(a||(NG(t,r),a=!0),t.lineWidth=l)}for(var c=0;c<IG.length;c++){var u=IG[c],h=u[0];(n||o[h]!==s[h])&&(a||(NG(t,r),a=!0),t[h]=o[h]||u[1])}return a}function LG(t,e){var i=e.transform,n=t.dpr||1;i?t.setTransform(n*i[0],n*i[1],n*i[2],n*i[3],n*i[4],n*i[5]):t.setTransform(n,0,0,n,0,0)}var DG=1,RG=2,OG=3,kG=4;function NG(t,e){e.batchFill&&t.fill(),e.batchStroke&&t.stroke(),e.batchFill="",e.batchStroke=""}function BG(t,e){return e&&t.__hoverStyle||t.style}function zG(t,e){FG(t,e,{inHover:!1,viewWidth:0,viewHeight:0},!0)}function FG(t,e,i,n){var r=e.transform;if(!e.shouldBePainted(i.viewWidth,i.viewHeight,!1,!1))return e.__dirty&=~DM,void(e.__isRendered=!1);var o=e.__clipPaths,s=i.prevElClipPaths,a=!1,l=!1;if(s&&!function(t,e){if(t===e||!t&&!e)return!1;if(!t||!e||t.length!==e.length)return!0;for(var i=0;i<t.length;i++)if(t[i]!==e[i])return!0;return!1}(o,s)||(s&&s.length&&(NG(t,i),t.restore(),l=a=!0,i.prevElClipPaths=null,i.allClipped=!1,i.prevEl=null),o&&o.length&&(NG(t,i),t.save(),function(t,e,i){for(var n=!1,r=0;r<t.length;r++){var o=t[r];n=n||o.isZeroArea(),LG(e,o),e.beginPath(),o.buildPath(e,o.shape),e.clip()}i.allClipped=n}(o,t,i),a=!0),i.prevElClipPaths=o),i.allClipped)e.__isRendered=!1;else{e.beforeBrush&&e.beforeBrush(),e.innerBeforeBrush();var c=i.prevEl;c||(l=a=!0);var u,h,p=e instanceof xD&&e.autoBatch&&function(t){var e=AG(t),i=bG(t);return!(t.lineDash||!(+e^+i)||e&&"string"!=typeof t.fill||i&&"string"!=typeof t.stroke||t.strokePercent<1||t.strokeOpacity<1||t.fillOpacity<1)}(e.style);a||(u=r,h=c.transform,u&&h?u[0]!==h[0]||u[1]!==h[1]||u[2]!==h[2]||u[3]!==h[3]||u[4]!==h[4]||u[5]!==h[5]:u||h)?(NG(t,i),LG(t,e)):p||NG(t,i);var d=BG(e,i.inHover);e instanceof xD?(i.lastDrawType!==DG&&(l=!0,i.lastDrawType=DG),PG(t,e,c,l,i),p&&(i.batchFill||i.batchStroke)||t.beginPath(),function(t,e,i,n){var r,o=bG(i),s=AG(i),a=i.strokePercent,l=a<1,c=!e.path;e.silent&&!l||!c||e.createPathProxy();var u=e.path||xG,h=e.__dirty;if(!n){var p=i.fill,d=i.stroke,f=s&&!!p.colorStops,m=o&&!!d.colorStops,g=s&&!!p.image,y=o&&!!d.image,v=void 0,_=void 0,x=void 0,b=void 0,w=void 0;(f||m)&&(w=e.getBoundingRect()),f&&(v=h?gG(t,p,w):e.__canvasFillGradient,e.__canvasFillGradient=v),m&&(_=h?gG(t,d,w):e.__canvasStrokeGradient,e.__canvasStrokeGradient=_),g&&(x=h||!e.__canvasFillPattern?MG(t,p,e):e.__canvasFillPattern,e.__canvasFillPattern=x),y&&(b=h||!e.__canvasStrokePattern?MG(t,d,e):e.__canvasStrokePattern,e.__canvasStrokePattern=x),f?t.fillStyle=v:g&&(x?t.fillStyle=x:s=!1),m?t.strokeStyle=_:y&&(b?t.strokeStyle=b:o=!1)}var A,E,S=e.getGlobalScale();u.setScale(S[0],S[1],e.segmentIgnoreThreshold),t.setLineDash&&i.lineDash&&(A=(r=_G(e))[0],E=r[1]);var M=!0;(c||h&RM)&&(u.setDPR(t.dpr),l?u.setContext(null):(u.setContext(t),M=!1),u.reset(),e.buildPath(u,e.shape,n),u.toStatic(),e.pathUpdated()),M&&u.rebuildPath(t,l?a:1),A&&(t.setLineDash(A),t.lineDashOffset=E),n||(i.strokeFirst?(o&&SG(t,i),s&&EG(t,i)):(s&&EG(t,i),o&&SG(t,i))),A&&t.setLineDash([])}(t,e,d,p),p&&(i.batchFill=d.fill||"",i.batchStroke=d.stroke||"")):e instanceof AD?(i.lastDrawType!==OG&&(l=!0,i.lastDrawType=OG),PG(t,e,c,l,i),function(t,e,i){var n,r=i.text;if(null!=r&&(r+=""),r){t.font=i.font||HA,t.textAlign=i.textAlign,t.textBaseline=i.textBaseline;var o=void 0,s=void 0;t.setLineDash&&i.lineDash&&(o=(n=_G(e))[0],s=n[1]),o&&(t.setLineDash(o),t.lineDashOffset=s),i.strokeFirst?(bG(i)&&t.strokeText(r,i.x,i.y),AG(i)&&t.fillText(r,i.x,i.y)):(AG(i)&&t.fillText(r,i.x,i.y),bG(i)&&t.strokeText(r,i.x,i.y)),o&&t.setLineDash([])}}(t,e,d)):e instanceof TD?(i.lastDrawType!==RG&&(l=!0,i.lastDrawType=RG),function(t,e,i,n,r){CG(t,BG(e,r.inHover),i&&BG(i,r.inHover),n,r)}(t,e,c,l,i),function(t,e,i){var n=e.__image=XP(i.image,e.__image,e,e.onload);if(n&&YP(n)){var r=i.x||0,o=i.y||0,s=e.getWidth(),a=e.getHeight(),l=n.width/n.height;if(null==s&&null!=a?s=a*l:null==a&&null!=s?a=s/l:null==s&&null==a&&(s=n.width,a=n.height),i.sWidth&&i.sHeight){var c=i.sx||0,u=i.sy||0;t.drawImage(n,c,u,i.sWidth,i.sHeight,r,o,s,a)}else if(i.sx&&i.sy){var h=s-(c=i.sx),p=a-(u=i.sy);t.drawImage(n,c,u,h,p,r,o,s,a)}else t.drawImage(n,r,o,s,a)}}(t,e,d)):e.getTemporalDisplayables&&(i.lastDrawType!==kG&&(l=!0,i.lastDrawType=kG),function(t,e,i){var n=e.getDisplayables(),r=e.getTemporalDisplayables();t.save();var o,s,a={prevElClipPaths:null,prevEl:null,allClipped:!1,viewWidth:i.viewWidth,viewHeight:i.viewHeight,inHover:i.inHover};for(o=e.getCursor(),s=n.length;o<s;o++){(u=n[o]).beforeBrush&&u.beforeBrush(),u.innerBeforeBrush(),FG(t,u,a,o===s-1),u.innerAfterBrush(),u.afterBrush&&u.afterBrush(),a.prevEl=u}for(var l=0,c=r.length;l<c;l++){var u;(u=r[l]).beforeBrush&&u.beforeBrush(),u.innerBeforeBrush(),FG(t,u,a,l===c-1),u.innerAfterBrush(),u.afterBrush&&u.afterBrush(),a.prevEl=u}e.clearTemporalDisplayables(),e.notClear=!0,t.restore()}(t,e,i)),p&&n&&NG(t,i),e.innerAfterBrush(),e.afterBrush&&e.afterBrush(),i.prevEl=e,e.__dirty=0,e.__isRendered=!0}}var VG=new nG,UG=new vT(100),GG=["symbol","symbolSize","symbolKeepAspect","color","backgroundColor","dashArrayX","dashArrayY","maxTileWidth","maxTileHeight"];function jG(t,e){if("none"===t)return null;var i=e.getDevicePixelRatio(),n=e.getZr(),r="svg"===n.painter.type;t.dirty&&VG.delete(t);var o=VG.get(t);if(o)return o;var s=dE(t,{symbol:"rect",symbolSize:1,symbolKeepAspect:!0,color:"rgba(0, 0, 0, 0.2)",backgroundColor:null,dashArrayX:5,dashArrayY:5,rotation:0,maxTileWidth:512,maxTileHeight:512});"none"===s.backgroundColor&&(s.backgroundColor=null);var a={repeat:"repeat"};return function(t){for(var e,o=[i],a=!0,l=0;l<GG.length;++l){var c=s[GG[l]];if(null!=c&&!EE(c)&&!ME(c)&&!IE(c)&&"boolean"!=typeof c){a=!1;break}o.push(c)}if(a){e=o.join(",")+(r?"-svg":"");var u=UG.get(e);u&&(r?t.svgElement=u:t.image=u)}var h,p=WG(s.dashArrayX),d=function(t){if(!t||"object"==typeof t&&0===t.length)return[0,0];if(IE(t)){var e=Math.ceil(t);return[e,e]}var i=vE(t,(function(t){return Math.ceil(t)}));return t.length%2?i.concat(i):i}(s.dashArrayY),f=HG(s.symbol),m=(x=p,vE(x,(function(t){return qG(t)}))),g=qG(d),y=!r&&ZA.createCanvas(),v=r&&{tag:"g",attrs:{},key:"dcl",children:[]},_=function(){for(var t=1,e=0,i=m.length;e<i;++e)t=ZC(t,m[e]);var n=1;for(e=0,i=f.length;e<i;++e)n=ZC(n,f[e].length);t*=n;var r=g*m.length*f.length;if("production"!==process.env.NODE_ENV){var o=function(t){console.warn("Calculated decal size is greater than "+t+" due to decal option settings so "+t+" is used for the decal size. Please consider changing the decal option to make a smaller decal or set "+t+" to be larger to avoid incontinuity.")};t>s.maxTileWidth&&o("maxTileWidth"),r>s.maxTileHeight&&o("maxTileHeight")}return{width:Math.max(1,Math.min(t,s.maxTileWidth)),height:Math.max(1,Math.min(r,s.maxTileHeight))}}();var x;y&&(y.width=_.width*i,y.height=_.height*i,h=y.getContext("2d"));(function(){h&&(h.clearRect(0,0,y.width,y.height),s.backgroundColor&&(h.fillStyle=s.backgroundColor,h.fillRect(0,0,y.width,y.height)));for(var t=0,e=0;e<d.length;++e)t+=d[e];if(t<=0)return;var o=-g,a=0,l=0,c=0;for(;o<_.height;){if(a%2==0){for(var u=l/2%f.length,m=0,x=0,b=0;m<2*_.width;){var w=0;for(e=0;e<p[c].length;++e)w+=p[c][e];if(w<=0)break;if(x%2==0){var A=.5*(1-s.symbolSize),E=m+p[c][x]*A,S=o+d[a]*A,M=p[c][x]*s.symbolSize,T=d[a]*s.symbolSize,I=b/2%f[u].length;C(E,S,M,T,f[u][I])}m+=p[c][x],++b,++x===p[c].length&&(x=0)}++c===p.length&&(c=0)}o+=d[a],++l,++a===d.length&&(a=0)}function C(t,e,o,a,l){var c=r?1:i,u=pG(l,t*c,e*c,o*c,a*c,s.color,s.symbolKeepAspect);if(r){var p=n.painter.renderOneToVNode(u);p&&v.children.push(p)}else zG(h,u)}})(),a&&UG.put(e,y||v);t.image=y,t.svgElement=v,t.svgWidth=_.width,t.svgHeight=_.height}(a),a.rotation=s.rotation,a.scaleX=a.scaleY=r?1:1/i,VG.set(t,a),t.dirty=!1,a}function HG(t){if(!t||0===t.length)return[["rect"]];if(ME(t))return[[t]];for(var e=!0,i=0;i<t.length;++i)if(!ME(t[i])){e=!1;break}if(e)return HG([t]);var n=[];for(i=0;i<t.length;++i)ME(t[i])?n.push([t[i]]):n.push(t[i]);return n}function WG(t){if(!t||0===t.length)return[[0,0]];if(IE(t))return[[r=Math.ceil(t),r]];for(var e=!0,i=0;i<t.length;++i)if(!IE(t[i])){e=!1;break}if(e)return WG([t]);var n=[];for(i=0;i<t.length;++i)if(IE(t[i])){var r=Math.ceil(t[i]);n.push([r,r])}else{r=vE(t[i],(function(t){return Math.ceil(t)}));r.length%2==1?n.push(r.concat(r)):n.push(r)}return n}function qG(t){for(var e=0,i=0;i<t.length;++i)e+=t[i];return t.length%2==1?2*e:e}var XG=new AS,ZG={};var YG=2e3,QG=4500,JG={PROCESSOR:{FILTER:1e3,SERIES_FILTER:800,STATISTIC:5e3},VISUAL:{LAYOUT:1e3,PROGRESSIVE_LAYOUT:1100,GLOBAL:YG,CHART:3e3,POST_CHART_LAYOUT:4600,COMPONENT:4e3,BRUSH:5e3,CHART_ITEM:QG,ARIA:6e3,DECAL:7e3}},KG="__flagInMainProcess",$G="__pendingUpdate",tj="__needsUpdateStatus",ej=/^[a-zA-Z0-9_]+$/,ij="__connectUpdateStatus";function nj(t){return function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];if(!this.isDisposed())return oj(this,t,e);Cj(this.id)}}function rj(t){return function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return oj(this,t,e)}}function oj(t,e,i){return i[0]=i[0]&&i[0].toLowerCase(),AS.prototype[e].apply(t,i)}var sj,aj,lj,cj,uj,hj,pj,dj,fj,mj,gj,yj,vj,_j,xj,bj,wj,Aj,Ej=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return zA(e,t),e}(AS),Sj=Ej.prototype;Sj.on=rj("on"),Sj.off=rj("off");var Mj=function(t){function e(e,i,n){var r=t.call(this,new jU)||this;r._chartsViews=[],r._chartsMap={},r._componentsViews=[],r._componentsMap={},r._pendingActions=[],n=n||{},ME(i)&&(i=kj[i]),r._dom=e;var o="canvas",s="auto",a=!1;if("production"!==process.env.NODE_ENV){var l=UA.hasGlobalWindow?window:global;o=l.__ECHARTS__DEFAULT__RENDERER__||o,s=BE(l.__ECHARTS__DEFAULT__COARSE_POINTER,s);var c=l.__ECHARTS__DEFAULT__USE_DIRTY_RECT__;a=null==c?a:c}var u=r._zr=EC(e,{renderer:n.renderer||o,devicePixelRatio:n.devicePixelRatio,width:n.width,height:n.height,ssr:n.ssr,useDirtyRect:BE(n.useDirtyRect,a),useCoarsePointer:BE(n.useCoarsePointer,s),pointerSize:n.pointerSize});r._ssr=n.ssr,r._throttledZrFlush=sU(wE(u.flush,u),17),(i=cE(i))&&aF(i,!0),r._theme=i,r._locale=function(t){if(ME(t)){var e=qN[t.toUpperCase()]||{};return t===jN||t===HN?cE(e):uE(cE(e),cE(qN[WN]),!1)}return uE(cE(t),cE(qN[WN]),!1)}(n.locale||ZN),r._coordSysMgr=new Bz;var h=r._api=xj(r);function p(t,e){return t.__prio-e.__prio}return LM(Oj,p),LM(Dj,p),r._scheduler=new OU(r,h,Dj,Oj),r._messageCenter=new Ej,r._initEvents(),r.resize=wE(r.resize,r),u.animation.on("frame",r._onframe,r),mj(u,r),gj(u,r),HE(r),r}return zA(e,t),e.prototype._onframe=function(){if(!this._disposed){Aj(this);var t=this._scheduler;if(this[$G]){var e=this[$G].silent;this[KG]=!0;try{sj(this),cj.update.call(this,null,this[$G].updateParams)}catch(t){throw this[KG]=!1,this[$G]=null,t}this._zr.flush(),this[KG]=!1,this[$G]=null,dj.call(this,e),fj.call(this,e)}else if(t.unfinished){var i=1,n=this._model,r=this._api;t.unfinished=!1;do{var o=+new Date;t.performSeriesTasks(n),t.performDataProcessorTasks(n),hj(this,n),t.performVisualTasks(n),_j(this,this._model,r,"remain",{}),i-=+new Date-o}while(i>0&&t.unfinished);t.unfinished||this._zr.flush()}}},e.prototype.getDom=function(){return this._dom},e.prototype.getId=function(){return this.id},e.prototype.getZr=function(){return this._zr},e.prototype.isSSR=function(){return this._ssr},e.prototype.setOption=function(t,e,i){if(this[KG])"production"!==process.env.NODE_ENV&&tP("`setOption` should not be called during main process.");else if(this._disposed)Cj(this.id);else{var n,r,o;if(CE(e)&&(i=e.lazyUpdate,n=e.silent,r=e.replaceMerge,o=e.transition,e=e.notMerge),this[KG]=!0,!this._model||e){var s=new Uz(this._api),a=this._theme,l=this._model=new Dz;l.scheduler=this._scheduler,l.ssr=this._ssr,l.init(null,null,null,a,this._locale,s)}this._model.setOption(t,{replaceMerge:r},Rj);var c={seriesTransition:o,optionChanged:!0};if(i)this[$G]={silent:n,updateParams:c},this[KG]=!1,this.getZr().wakeUp();else{try{sj(this),cj.update.call(this,null,c)}catch(t){throw this[$G]=null,this[KG]=!1,t}this._ssr||this._zr.flush(),this[$G]=null,this[KG]=!1,dj.call(this,n),fj.call(this,n)}}},e.prototype.setTheme=function(){eP("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},e.prototype.getModel=function(){return this._model},e.prototype.getOption=function(){return this._model&&this._model.getOption()},e.prototype.getWidth=function(){return this._zr.getWidth()},e.prototype.getHeight=function(){return this._zr.getHeight()},e.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||UA.hasGlobalWindow&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(t){return"production"!==process.env.NODE_ENV&&iP("getRenderedCanvas","renderToCanvas"),this.renderToCanvas(t)},e.prototype.renderToCanvas=function(t){t=t||{};var e=this._zr.painter;if("production"!==process.env.NODE_ENV&&"canvas"!==e.type)throw new Error("renderToCanvas can only be used in the canvas renderer.");return e.getRenderedCanvas({backgroundColor:t.backgroundColor||this._model.get("backgroundColor"),pixelRatio:t.pixelRatio||this.getDevicePixelRatio()})},e.prototype.renderToSVGString=function(t){t=t||{};var e=this._zr.painter;if("production"!==process.env.NODE_ENV&&"svg"!==e.type)throw new Error("renderToSVGString can only be used in the svg renderer.");return e.renderToString({useViewBox:t.useViewBox})},e.prototype.getSvgDataURL=function(){if(UA.svgSupported){var t=this._zr;return yE(t.storage.getDisplayList(),(function(t){t.stopAnimation(null,!0)})),t.painter.toDataURL()}},e.prototype.getDataURL=function(t){if(!this._disposed){var e=(t=t||{}).excludeComponents,i=this._model,n=[],r=this;yE(e,(function(t){i.eachComponent({mainType:t},(function(t){var e=r._componentsMap[t.__viewId];e.group.ignore||(n.push(e),e.group.ignore=!0)}))}));var o="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.renderToCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return yE(n,(function(t){t.group.ignore=!1})),o}Cj(this.id)},e.prototype.getConnectedDataURL=function(t){if(!this._disposed){var e="svg"===t.type,i=this.group,n=Math.min,r=Math.max,o=1/0;if(zj[i]){var s=o,a=o,l=-1/0,c=-1/0,u=[],h=t&&t.pixelRatio||this.getDevicePixelRatio();yE(Bj,(function(o,h){if(o.group===i){var p=e?o.getZr().painter.getSvgDom().innerHTML:o.renderToCanvas(cE(t)),d=o.getDom().getBoundingClientRect();s=n(d.left,s),a=n(d.top,a),l=r(d.right,l),c=r(d.bottom,c),u.push({dom:p,left:d.left,top:d.top})}}));var p=(l*=h)-(s*=h),d=(c*=h)-(a*=h),f=ZA.createCanvas(),m=EC(f,{renderer:e?"svg":"canvas"});if(m.resize({width:p,height:d}),e){var g="";return yE(u,(function(t){var e=t.left-s,i=t.top-a;g+='<g transform="translate('+e+","+i+')">'+t.dom+"</g>"})),m.painter.getSvgRoot().innerHTML=g,t.connectedBackgroundColor&&m.painter.setBackgroundColor(t.connectedBackgroundColor),m.refreshImmediately(),m.painter.toDataURL()}return t.connectedBackgroundColor&&m.add(new kD({shape:{x:0,y:0,width:p,height:d},style:{fill:t.connectedBackgroundColor}})),yE(u,(function(t){var e=new TD({style:{x:t.left*h-s,y:t.top*h-a,image:t.dom}});m.add(e)})),m.refreshImmediately(),f.toDataURL("image/"+(t&&t.type||"png"))}return this.getDataURL(t)}Cj(this.id)},e.prototype.convertToPixel=function(t,e){return uj(this,"convertToPixel",t,e)},e.prototype.convertFromPixel=function(t,e){return uj(this,"convertFromPixel",t,e)},e.prototype.containPixel=function(t,e){var i;if(!this._disposed)return yE(EP(this._model,t),(function(t,n){n.indexOf("Models")>=0&&yE(t,(function(t){var r=t.coordinateSystem;if(r&&r.containPoint)i=i||!!r.containPoint(e);else if("seriesModels"===n){var o=this._chartsMap[t.__viewId];o&&o.containPoint?i=i||o.containPoint(e,t):"production"!==process.env.NODE_ENV&&$C(n+": "+(o?"The found component do not support containPoint.":"No view mapping to the found component."))}else"production"!==process.env.NODE_ENV&&$C(n+": containPoint is not supported")}),this)}),this),!!i;Cj(this.id)},e.prototype.getVisual=function(t,e){var i=EP(this._model,t,{defaultMainType:"series"}),n=i.seriesModel;"production"!==process.env.NODE_ENV&&(n||$C("There is no specified series model"));var r=n.getData(),o=i.hasOwnProperty("dataIndexInside")?i.dataIndexInside:i.hasOwnProperty("dataIndex")?r.indexOfRawIndex(i.dataIndex):null;return null!=o?ZU(r,o,e):YU(r,e)},e.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},e.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},e.prototype._initEvents=function(){var t,e,i,n=this;yE(Ij,(function(t){var e=function(e){var i,r=n.getModel(),o=e.target,s="globalout"===t;if(s?i={}:o&&$U(o,(function(t){var e=KD(t);if(e&&null!=e.dataIndex){var n=e.dataModel||r.getSeriesByIndex(e.seriesIndex);return i=n&&n.getDataParams(e.dataIndex,e.dataType,o)||{},!0}if(e.eventData)return i=pE({},e.eventData),!0}),!0),i){var a=i.componentType,l=i.componentIndex;"markLine"!==a&&"markPoint"!==a&&"markArea"!==a||(a="series",l=i.seriesIndex);var c=a&&null!=l&&r.getComponent(a,l),u=c&&n["series"===c.mainType?"_chartsMap":"_componentsMap"][c.__viewId];"production"!==process.env.NODE_ENV&&(s||c&&u||$C("model or view can not be found by params")),i.event=e,i.type=t,n._$eventProcessor.eventInfo={targetEl:o,packedEvent:i,model:c,view:u},n.trigger(t,i)}};e.zrEventfulCallAtLast=!0,n._zr.on(t,e,n)})),yE(Lj,(function(t,e){n._messageCenter.on(e,(function(t){this.trigger(e,t)}),n)})),yE(["selectchanged"],(function(t){n._messageCenter.on(t,(function(e){this.trigger(t,e)}),n)})),t=this._messageCenter,e=this,i=this._api,t.on("selectchanged",(function(t){var n=i.getModel();t.isFromClick?(KU("map","selectchanged",e,n,t),KU("pie","selectchanged",e,n,t)):"select"===t.fromAction?(KU("map","selected",e,n,t),KU("pie","selected",e,n,t)):"unselect"===t.fromAction&&(KU("map","unselected",e,n,t),KU("pie","unselected",e,n,t))}))},e.prototype.isDisposed=function(){return this._disposed},e.prototype.clear=function(){this._disposed?Cj(this.id):this.setOption({series:[]},!0)},e.prototype.dispose=function(){if(this._disposed)Cj(this.id);else{this._disposed=!0,this.getDom()&&CP(this.getDom(),Vj,"");var t=this,e=t._api,i=t._model;yE(t._componentsViews,(function(t){t.dispose(i,e)})),yE(t._chartsViews,(function(t){t.dispose(i,e)})),t._zr.dispose(),t._dom=t._model=t._chartsMap=t._componentsMap=t._chartsViews=t._componentsViews=t._scheduler=t._api=t._zr=t._throttledZrFlush=t._theme=t._coordSysMgr=t._messageCenter=null,delete Bj[t.id]}},e.prototype.resize=function(t){if(this[KG])"production"!==process.env.NODE_ENV&&tP("`resize` should not be called during main process.");else if(this._disposed)Cj(this.id);else{this._zr.resize(t);var e=this._model;if(this._loadingFX&&this._loadingFX.resize(),e){var i=e.resetOption("media"),n=t&&t.silent;this[$G]&&(null==n&&(n=this[$G].silent),i=!0,this[$G]=null),this[KG]=!0;try{i&&sj(this),cj.update.call(this,{type:"resize",animation:pE({duration:0},t&&t.animation)})}catch(t){throw this[KG]=!1,t}this[KG]=!1,dj.call(this,n),fj.call(this,n)}}},e.prototype.showLoading=function(t,e){if(this._disposed)Cj(this.id);else if(CE(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),Nj[t]){var i=Nj[t](this._api,e),n=this._zr;this._loadingFX=i,n.add(i)}else"production"!==process.env.NODE_ENV&&$C("Loading effects "+t+" not exists.")},e.prototype.hideLoading=function(){this._disposed?Cj(this.id):(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},e.prototype.makeActionFromEvent=function(t){var e=pE({},t);return e.type=Lj[t.type],e},e.prototype.dispatchAction=function(t,e){if(this._disposed)Cj(this.id);else if(CE(e)||(e={silent:!!e}),Pj[t.type]&&this._model)if(this[KG])this._pendingActions.push(t);else{var i=e.silent;pj.call(this,t,i);var n=e.flush;n?this._zr.flush():!1!==n&&UA.browser.weChat&&this._throttledZrFlush(),dj.call(this,i),fj.call(this,i)}},e.prototype.updateLabelLayout=function(){XG.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(t){if(this._disposed)Cj(this.id);else{var e=t.seriesIndex,i=this.getModel().getSeriesByIndex(e);"production"!==process.env.NODE_ENV&&UE(t.data&&i),i.appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp()}},e.internalField=function(){function t(t){t.clearColorPalette(),t.eachSeries((function(t){t.clearColorPalette()}))}function e(t){for(var e=[],i=t.currentStates,n=0;n<i.length;n++){var r=i[n];"emphasis"!==r&&"blur"!==r&&"select"!==r&&e.push(r)}t.selected&&t.states.select&&e.push("select"),t.hoverState===sR&&t.states.emphasis?e.push("emphasis"):t.hoverState===oR&&t.states.blur&&e.push("blur"),t.useStates(e)}function i(t,e){if(!t.preventAutoZ){var i=t.get("z")||0,r=t.get("zlevel")||0;e.eachRendered((function(t){return n(t,i,r,-1/0),!0}))}}function n(t,e,i,r){var o=t.getTextContent(),s=t.getTextGuideLine();if(t.isGroup)for(var a=t.childrenRef(),l=0;l<a.length;l++)r=Math.max(n(a[l],e,i,r),r);else t.z=e,t.zlevel=i,r=Math.max(t.z2,r);if(o&&(o.z=e,o.zlevel=i,isFinite(r)&&(o.z2=r+2)),s){var c=t.textGuideLineConfig;s.z=e,s.zlevel=i,isFinite(r)&&(s.z2=r+(c&&c.showAbove?1:-1))}return r}function r(t,e){e.eachRendered((function(t){if(!Dk(t)){var e=t.getTextContent(),i=t.getTextGuideLine();t.stateTransition&&(t.stateTransition=null),e&&e.stateTransition&&(e.stateTransition=null),i&&i.stateTransition&&(i.stateTransition=null),t.hasState()?(t.prevStates=t.currentStates,t.clearStates()):t.prevStates&&(t.prevStates=null)}}))}function o(t,i){var n=t.getModel("stateAnimation"),r=t.isAnimationEnabled(),o=n.get("duration"),s=o>0?{duration:o,delay:n.get("delay"),easing:n.get("easing")}:null;i.eachRendered((function(t){if(t.states&&t.states.emphasis){if(Dk(t))return;if(t instanceof xD&&function(t){var e=iR(t);e.normalFill=t.style.fill,e.normalStroke=t.style.stroke;var i=t.states.select||{};e.selectFill=i.style&&i.style.fill||null,e.selectStroke=i.style&&i.style.stroke||null}(t),t.__dirty){var i=t.prevStates;i&&t.useStates(i)}if(r){t.stateTransition=s;var n=t.getTextContent(),o=t.getTextGuideLine();n&&(n.stateTransition=s),o&&(o.stateTransition=s)}t.__dirty&&e(t)}}))}sj=function(t){var e=t._scheduler;e.restorePipelines(t._model),e.prepareStageTasks(),aj(t,!0),aj(t,!1),e.plan()},aj=function(t,e){for(var i=t._model,n=t._scheduler,r=e?t._componentsViews:t._chartsViews,o=e?t._componentsMap:t._chartsMap,s=t._zr,a=t._api,l=0;l<r.length;l++)r[l].__alive=!1;function c(t){var l=t.__requireNewView;t.__requireNewView=!1;var c="_ec_"+t.id+"_"+t.type,u=!l&&o[c];if(!u){var h=kP(t.type),p=e?qV.getClass(h.main,h.sub):iU.getClass(h.sub);"production"!==process.env.NODE_ENV&&UE(p,h.sub+" does not exist."),(u=new p).init(i,a),o[c]=u,r.push(u),s.add(u.group)}t.__viewId=u.__id=c,u.__alive=!0,u.__model=t,u.group.__ecComponentInfo={mainType:t.mainType,index:t.componentIndex},!e&&n.prepareView(u,t,i,a)}e?i.eachComponent((function(t,e){"series"!==t&&c(e)})):i.eachSeries(c);for(l=0;l<r.length;){var u=r[l];u.__alive?l++:(!e&&u.renderTask.dispose(),s.remove(u.group),u.dispose(i,a),r.splice(l,1),o[u.__id]===u&&delete o[u.__id],u.__id=u.group.__ecComponentInfo=null)}},lj=function(t,e,i,n,r){var o=t._model;if(o.setUpdatePayload(i),n){var s={};s[n+"Id"]=i[n+"Id"],s[n+"Index"]=i[n+"Index"],s[n+"Name"]=i[n+"Name"];var a={mainType:n,query:s};r&&(a.subType=r);var l,c=i.excludeSeriesId;null!=c&&(l=YE(),yE(lP(c),(function(t){var e=gP(t,null);null!=e&&l.set(e,!0)}))),o&&o.eachComponent(a,(function(e){if(!(l&&null!=l.get(e.id)))if(eO(i))if(e instanceof HV)i.type!==hR||i.notBlur||e.get(["emphasis","disabled"])||function(t,e,i){var n=t.seriesIndex,r=t.getData(e.dataType);if(r){var o=bP(r,e);o=(EE(o)?o[0]:o)||0;var s=r.getItemGraphicEl(o);if(!s)for(var a=r.count(),l=0;!s&&l<a;)s=r.getItemGraphicEl(l++);if(s){var c=KD(s);UR(n,c.focus,c.blurScope,i)}else{var u=t.get(["emphasis","focus"]),h=t.get(["emphasis","blurScope"]);null!=u&&UR(n,u,h,i)}}else"production"!==process.env.NODE_ENV&&tP("Unknown dataType "+e.dataType)}(e,i,t._api);else{var n=jR(e.mainType,e.componentIndex,i.name,t._api),r=n.focusSelf,o=n.dispatchers;i.type===hR&&r&&!i.notBlur&&GR(e.mainType,e.componentIndex,t._api),o&&yE(o,(function(t){i.type===hR?RR(t):OR(t)}))}else tO(i)&&e instanceof HV&&(!function(t,e,i){if(tO(e)){var n=e.dataType,r=bP(t.getData(n),e);EE(r)||(r=[r]),t[e.type===mR?"toggleSelect":e.type===dR?"select":"unselect"](r,n)}}(e,i,t._api),HR(e),wj(t))}),t),o&&o.eachComponent(a,(function(e){l&&null!=l.get(e.id)||u(t["series"===n?"_chartsMap":"_componentsMap"][e.__viewId])}),t)}else yE([].concat(t._componentsViews).concat(t._chartsViews),u);function u(n){n&&n.__alive&&n[e]&&n[e](n.__model,o,t._api,i)}},cj={prepareAndUpdate:function(t){sj(this),cj.update.call(this,t,{optionChanged:null!=t.newOption})},update:function(e,i){var n=this._model,r=this._api,o=this._zr,s=this._coordSysMgr,a=this._scheduler;if(n){n.setUpdatePayload(e),a.restoreData(n,e),a.performSeriesTasks(n),s.create(n,r),a.performDataProcessorTasks(n,e),hj(this,n),s.update(n,r),t(n),a.performVisualTasks(n,e),yj(this,n,r,e,i);var l=n.get("backgroundColor")||"transparent",c=n.get("darkMode");o.setBackgroundColor(l),null!=c&&"auto"!==c&&o.setDarkMode(c),XG.trigger("afterupdate",n,r)}},updateTransform:function(e){var i=this,n=this._model,r=this._api;if(n){n.setUpdatePayload(e);var o=[];n.eachComponent((function(t,s){if("series"!==t){var a=i.getViewOfComponentModel(s);if(a&&a.__alive)if(a.updateTransform){var l=a.updateTransform(s,n,r,e);l&&l.update&&o.push(a)}else o.push(a)}}));var s=YE();n.eachSeries((function(t){var o=i._chartsMap[t.__viewId];if(o.updateTransform){var a=o.updateTransform(t,n,r,e);a&&a.update&&s.set(t.uid,1)}else s.set(t.uid,1)})),t(n),this._scheduler.performVisualTasks(n,e,{setDirty:!0,dirtyMap:s}),_j(this,n,r,e,{},s),XG.trigger("afterupdate",n,r)}},updateView:function(e){var i=this._model;i&&(i.setUpdatePayload(e),iU.markUpdateMethod(e,"updateView"),t(i),this._scheduler.performVisualTasks(i,e,{setDirty:!0}),yj(this,i,this._api,e,{}),XG.trigger("afterupdate",i,this._api))},updateVisual:function(e){var i=this,n=this._model;n&&(n.setUpdatePayload(e),n.eachSeries((function(t){t.getData().clearAllVisual()})),iU.markUpdateMethod(e,"updateVisual"),t(n),this._scheduler.performVisualTasks(n,e,{visualType:"visual",setDirty:!0}),n.eachComponent((function(t,r){if("series"!==t){var o=i.getViewOfComponentModel(r);o&&o.__alive&&o.updateVisual(r,n,i._api,e)}})),n.eachSeries((function(t){i._chartsMap[t.__viewId].updateVisual(t,n,i._api,e)})),XG.trigger("afterupdate",n,this._api))},updateLayout:function(t){cj.update.call(this,t)}},uj=function(t,e,i,n){if(t._disposed)Cj(t.id);else{for(var r,o=t._model,s=t._coordSysMgr.getCoordinateSystems(),a=EP(o,i),l=0;l<s.length;l++){var c=s[l];if(c[e]&&null!=(r=c[e](o,a,n)))return r}"production"!==process.env.NODE_ENV&&$C("No coordinate system that supports "+e+" found by the given finder.")}},hj=function(t,e){var i=t._chartsMap,n=t._scheduler;e.eachSeries((function(t){n.updateStreamModes(t,i[t.__viewId])}))},pj=function(t,e){var i=this,n=this.getModel(),r=t.type,o=t.escapeConnect,s=Pj[r],a=s.actionInfo,l=(a.update||"update").split(":"),c=l.pop(),u=null!=l[0]&&kP(l[0]);this[KG]=!0;var h=[t],p=!1;t.batch&&(p=!0,h=vE(t.batch,(function(e){return(e=dE(pE({},e),t)).batch=null,e})));var d,f=[],m=tO(t),g=eO(t);if(g&&VR(this._api),yE(h,(function(e){if((d=(d=s.action(e,i._model,i._api))||pE({},e)).type=a.event||d.type,f.push(d),g){var n=SP(t),r=n.queryOptionMap,o=n.mainTypeSpecified?r.keys()[0]:"series";lj(i,c,e,o),wj(i)}else m?(lj(i,c,e,"series"),wj(i)):u&&lj(i,c,e,u.main,u.sub)})),"none"!==c&&!g&&!m&&!u)try{this[$G]?(sj(this),cj.update.call(this,t),this[$G]=null):cj[c].call(this,t)}catch(t){throw this[KG]=!1,t}if(d=p?{type:a.event||r,escapeConnect:o,batch:f}:f[0],this[KG]=!1,!e){var y=this._messageCenter;if(y.trigger(d.type,d),m){var v={type:"selectchanged",escapeConnect:o,selected:WR(n),isFromClick:t.isFromClick||!1,fromAction:t.type,fromActionPayload:t};y.trigger(v.type,v)}}},dj=function(t){for(var e=this._pendingActions;e.length;){var i=e.shift();pj.call(this,i,t)}},fj=function(t){!t&&this.trigger("updated")},mj=function(t,e){t.on("rendered",(function(i){e.trigger("rendered",i),!t.animation.isFinished()||e[$G]||e._scheduler.unfinished||e._pendingActions.length||e.trigger("finished")}))},gj=function(t,e){t.on("mouseover",(function(t){var i=$U(t.target,$R);i&&(!function(t,e,i){"production"===process.env.NODE_ENV||$R(t)||tP("param should be highDownDispatcher");var n=KD(t),r=jR(n.componentMainType,n.componentIndex,n.componentHighDownName,i),o=r.dispatchers,s=r.focusSelf;o?(s&&GR(n.componentMainType,n.componentIndex,i),yE(o,(function(t){return LR(t,e)}))):(UR(n.seriesIndex,n.focus,n.blurScope,i),"self"===n.focus&&GR(n.componentMainType,n.componentIndex,i),LR(t,e))}(i,t,e._api),wj(e))})).on("mouseout",(function(t){var i=$U(t.target,$R);i&&(!function(t,e,i){"production"===process.env.NODE_ENV||$R(t)||tP("param should be highDownDispatcher"),VR(i);var n=KD(t),r=jR(n.componentMainType,n.componentIndex,n.componentHighDownName,i).dispatchers;r?yE(r,(function(t){return DR(t,e)})):DR(t,e)}(i,t,e._api),wj(e))})).on("click",(function(t){var i=$U(t.target,(function(t){return null!=KD(t).dataIndex}),!0);if(i){var n=i.selected?"unselect":"select",r=KD(i);e._api.dispatchAction({type:n,dataType:r.dataType,dataIndexInside:r.dataIndex,seriesIndex:r.seriesIndex,isFromClick:!0})}}))},yj=function(t,e,i,n,r){!function(t){var e=[],i=[],n=!1;if(t.eachComponent((function(t,r){var o=r.get("zlevel")||0,s=r.get("z")||0,a=r.getZLevelKey();n=n||!!a,("series"===t?i:e).push({zlevel:o,z:s,idx:r.componentIndex,type:t,key:a})})),n){var r,o,s=e.concat(i);LM(s,(function(t,e){return t.zlevel===e.zlevel?t.z-e.z:t.zlevel-e.zlevel})),yE(s,(function(e){var i=t.getComponent(e.type,e.idx),n=e.zlevel,s=e.key;null!=r&&(n=Math.max(r,n)),s?(n===r&&s!==o&&n++,o=s):o&&(n===r&&n++,o=""),r=n,i.setZLevel(n)}))}}(e),vj(t,e,i,n,r),yE(t._chartsViews,(function(t){t.__alive=!1})),_j(t,e,i,n,r),yE(t._chartsViews,(function(t){t.__alive||t.remove(e,i)}))},vj=function(t,e,n,s,a,l){yE(l||t._componentsViews,(function(t){var a=t.__model;r(a,t),t.render(a,e,n,s),i(a,t),o(a,t)}))},_j=function(t,e,n,s,a,l){var c=t._scheduler;a=pE(a||{},{updatedSeries:e.getSeries()}),XG.trigger("series:beforeupdate",e,n,a);var u=!1;e.eachSeries((function(e){var i=t._chartsMap[e.__viewId];i.__alive=!0;var n=i.renderTask;c.updatePayload(n,s),r(e,i),l&&l.get(e.uid)&&n.dirty(),n.perform(c.getPerformArgs(n))&&(u=!0),i.group.silent=!!e.get("silent"),function(t,e){var i=t.get("blendMode")||null;e.eachRendered((function(t){t.isGroup||(t.style.blend=i)}))}(e,i),HR(e)})),c.unfinished=u||c.unfinished,XG.trigger("series:layoutlabels",e,n,a),XG.trigger("series:transition",e,n,a),e.eachSeries((function(e){var n=t._chartsMap[e.__viewId];i(e,n),o(e,n)})),function(t,e){var i=t._zr,n=i.storage,r=0;n.traverse((function(t){t.isGroup||r++})),r>e.get("hoverLayerThreshold")&&!UA.node&&!UA.worker&&e.eachSeries((function(e){if(!e.preventUsingHoverLayer){var i=t._chartsMap[e.__viewId];i.__alive&&i.eachRendered((function(t){t.states.emphasis&&(t.states.emphasis.hoverLayer=!0)}))}}))}(t,e),XG.trigger("series:afterupdate",e,n,a)},wj=function(t){t[tj]=!0,t.getZr().wakeUp()},Aj=function(t){t[tj]&&(t.getZr().storage.traverse((function(t){Dk(t)||e(t)})),t[tj]=!1)},xj=function(t){return new(function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return zA(i,e),i.prototype.getCoordinateSystems=function(){return t._coordSysMgr.getCoordinateSystems()},i.prototype.getComponentByElement=function(e){for(;e;){var i=e.__ecComponentInfo;if(null!=i)return t._model.getComponent(i.mainType,i.index);e=e.parent}},i.prototype.enterEmphasis=function(e,i){RR(e,i),wj(t)},i.prototype.leaveEmphasis=function(e,i){OR(e,i),wj(t)},i.prototype.enterBlur=function(e){kR(e),wj(t)},i.prototype.leaveBlur=function(e){NR(e),wj(t)},i.prototype.enterSelect=function(e){BR(e),wj(t)},i.prototype.leaveSelect=function(e){zR(e),wj(t)},i.prototype.getModel=function(){return t.getModel()},i.prototype.getViewOfComponentModel=function(e){return t.getViewOfComponentModel(e)},i.prototype.getViewOfSeriesModel=function(e){return t.getViewOfSeriesModel(e)},i}(Oz))(t)},bj=function(t){function e(t,e){for(var i=0;i<t.length;i++){t[i][ij]=e}}yE(Lj,(function(i,n){t._messageCenter.on(n,(function(i){if(zj[t.group]&&0!==t[ij]){if(i&&i.escapeConnect)return;var n=t.makeActionFromEvent(i),r=[];yE(Bj,(function(e){e!==t&&e.group===t.group&&r.push(e)})),e(r,0),yE(r,(function(t){1!==t[ij]&&t.dispatchAction(n)})),e(r,2)}}))}))}}(),e}(AS),Tj=Mj.prototype;Tj.on=nj("on"),Tj.off=nj("off"),Tj.one=function(t,e,i){var n=this;eP("ECharts#one is deprecated."),this.on.call(this,t,(function i(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];e&&e.apply&&e.apply(this,r),n.off(t,i)}),i)};var Ij=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];function Cj(t){"production"!==process.env.NODE_ENV&&$C("Instance "+t+" has been disposed")}var Pj={},Lj={},Dj=[],Rj=[],Oj=[],kj={},Nj={},Bj={},zj={},Fj=+new Date-0,Vj="_echarts_instance_";function Uj(t,e,i){var n=!(i&&i.ssr);if(n){if("production"!==process.env.NODE_ENV&&!t)throw new Error("Initialize failed: invalid dom.");var r=function(t){return Bj[function(t,e){return t.getAttribute?t.getAttribute(e):t[e]}(t,Vj)]}(t);if(r)return"production"!==process.env.NODE_ENV&&$C("There is a chart instance already initialized on the dom."),r;"production"!==process.env.NODE_ENV&&(!DE(t)||"CANVAS"===t.nodeName.toUpperCase()||(t.clientWidth||i&&null!=i.width)&&(t.clientHeight||i&&null!=i.height)||$C("Can't get DOM width or height. Please check dom.clientWidth and dom.clientHeight. They should not be 0.For example, you may need to call this in the callback of window.onload."))}var o=new Mj(t,e,i);return o.id="ec_"+Fj++,Bj[o.id]=o,n&&CP(t,Vj,o.id),bj(o),XG.trigger("afterinit",o),o}function Gj(t,e){kj[t]=e}function jj(t){fE(Rj,t)<0&&Rj.push(t)}function Hj(t,e){Qj(Dj,t,e,2e3)}function Wj(t,e){XG.on(t,e)}function qj(t,e,i){SE(e)&&(i=e,e="");var n=CE(t)?t.type:[t,t={event:e}][0];t.event=(t.event||n).toLowerCase(),e=t.event,Lj[e]||(UE(ej.test(n)&&ej.test(e)),Pj[n]||(Pj[n]={action:i,actionInfo:t}),Lj[e]=n)}function Xj(t,e){Bz.register(t,e)}function Zj(t,e){Qj(Oj,t,e,3e3,"visual")}var Yj=[];function Qj(t,e,i,n,r){if((SE(e)||CE(e))&&(i=e,e=n),"production"!==process.env.NODE_ENV){if(isNaN(e)||null==e)throw new Error("Illegal priority");yE(t,(function(t){UE(t.__raw!==i)}))}if(!(fE(Yj,i)>=0)){Yj.push(i);var o=OU.wrapStageHandler(i,r);o.__prio=e,o.__raw=i,t.push(o)}}function Jj(t,e){Nj[t]=e}var Kj=function(t){var e=(t=cE(t)).type,i="";e||("production"!==process.env.NODE_ENV&&(i="Must have a `type` when `registerTransform`."),rP(i));var n=e.split(":");2!==n.length&&("production"!==process.env.NODE_ENV&&(i='Name must include namespace like "ns:regression".'),rP(i));var r=!1;"echarts"===n[0]&&(e=n[1],r=!0),t.__isBuiltIn=r,$F.set(e,t)};Zj(YG,fU),Zj(QG,gU),Zj(QG,yU),Zj(YG,qU),Zj(QG,XU),Zj(7e3,(function(t,e){t.eachRawSeries((function(i){if(!t.isSeriesFiltered(i)){var n=i.getData();n.hasItemVisual()&&n.each((function(t){var i=n.getItemVisual(t,"decal");i&&(n.ensureUniqueItemVisual(t,"style").decal=jG(i,e))}));var r=n.getVisual("decal");if(r)n.getVisual("style").decal=jG(r,e)}}))})),jj(aF),Hj(900,(function(t){var e=YE();t.eachSeries((function(t){var i=t.get("stack");if(i){var n=e.get(i)||e.set(i,[]),r=t.getData(),o={stackResultDimension:r.getCalculationInfo("stackResultDimension"),stackedOverDimension:r.getCalculationInfo("stackedOverDimension"),stackedDimension:r.getCalculationInfo("stackedDimension"),stackedByDimension:r.getCalculationInfo("stackedByDimension"),isStackedByIndex:r.getCalculationInfo("isStackedByIndex"),data:r,seriesModel:t};if(!o.stackedDimension||!o.isStackedByIndex&&!o.stackedByDimension)return;n.length&&r.setCalculationInfo("stackedOnSeries",n[n.length-1].seriesModel),n.push(o)}})),e.each(lF)})),Jj("default",(function(t,e){dE(e=e||{},{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var i=new xC,n=new kD({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});i.add(n);var r,o=new JD({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),s=new kD({style:{fill:"none"},textContent:o,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});return i.add(s),e.showSpinner&&((r=new hk({shape:{startAngle:-vU/2,endAngle:-vU/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001})).animateShape(!0).when(1e3,{endAngle:3*vU/2}).start("circularInOut"),r.animateShape(!0).when(1e3,{startAngle:3*vU/2}).delay(300).start("circularInOut"),i.add(r)),i.resize=function(){var i=o.getBoundingRect().width,a=e.showSpinner?e.spinnerRadius:0,l=(t.getWidth()-2*a-(e.showSpinner&&i?10:0)-i)/2-(e.showSpinner&&i?0:5+i/2)+(e.showSpinner?0:i/2)+(i?0:a),c=t.getHeight()/2;e.showSpinner&&r.setShape({cx:l,cy:c}),s.setShape({x:l-a,y:c-a,width:2*a,height:2*a}),n.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},i.resize(),i})),qj({type:hR,event:hR,update:hR},tS),qj({type:pR,event:pR,update:pR},tS),qj({type:dR,event:dR,update:dR},tS),qj({type:fR,event:fR,update:fR},tS),qj({type:mR,event:mR,update:mR},tS),Gj("light",NU),Gj("dark",GU);var $j=[],tH={registerPreprocessor:jj,registerProcessor:Hj,registerPostInit:function(t){Wj("afterinit",t)},registerPostUpdate:function(t){Wj("afterupdate",t)},registerUpdateLifecycle:Wj,registerAction:qj,registerCoordinateSystem:Xj,registerLayout:function(t,e){Qj(Oj,t,e,1e3,"layout")},registerVisual:Zj,registerTransform:Kj,registerLoading:Jj,registerMap:function(t,e,i){var n=function(t){return"production"!==process.env.NODE_ENV&&(ZG[t]||tP("Implementation of "+t+" doesn't exists.")),ZG[t]}("registerMap");n&&n(t,e,i)},registerImpl:function(t,e){"production"!==process.env.NODE_ENV&&ZG[t]&&tP("Already has an implementation of "+t+"."),ZG[t]=e},PRIORITY:JG,ComponentModel:YB,ComponentView:qV,SeriesModel:HV,ChartView:iU,registerComponentModel:function(t){YB.registerClass(t)},registerComponentView:function(t){qV.registerClass(t)},registerSeriesModel:function(t){HV.registerClass(t)},registerChartView:function(t){iU.registerClass(t)},registerSubTypeDefaulter:function(t,e){YB.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){!function(t,e){bC[t]=e}(t,e)}};function eH(t){EE(t)?yE(t,(function(t){eH(t)})):fE($j,t)>=0||($j.push(t),SE(t)&&(t={install:t}),t.install(tH))}function iH(t){return null==t?0:t.length||1}function nH(t){return t}var rH=function(){function t(t,e,i,n,r,o){this._old=t,this._new=e,this._oldKeyGetter=i||nH,this._newKeyGetter=n||nH,this.context=r,this._diffModeMultiple="multiple"===o}return t.prototype.add=function(t){return this._add=t,this},t.prototype.update=function(t){return this._update=t,this},t.prototype.updateManyToOne=function(t){return this._updateManyToOne=t,this},t.prototype.updateOneToMany=function(t){return this._updateOneToMany=t,this},t.prototype.updateManyToMany=function(t){return this._updateManyToMany=t,this},t.prototype.remove=function(t){return this._remove=t,this},t.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},t.prototype._executeOneToOne=function(){var t=this._old,e=this._new,i={},n=new Array(t.length),r=new Array(e.length);this._initIndexMap(t,null,n,"_oldKeyGetter"),this._initIndexMap(e,i,r,"_newKeyGetter");for(var o=0;o<t.length;o++){var s=n[o],a=i[s],l=iH(a);if(l>1){var c=a.shift();1===a.length&&(i[s]=a[0]),this._update&&this._update(c,o)}else 1===l?(i[s]=null,this._update&&this._update(a,o)):this._remove&&this._remove(o)}this._performRestAdd(r,i)},t.prototype._executeMultiple=function(){var t=this._old,e=this._new,i={},n={},r=[],o=[];this._initIndexMap(t,i,r,"_oldKeyGetter"),this._initIndexMap(e,n,o,"_newKeyGetter");for(var s=0;s<r.length;s++){var a=r[s],l=i[a],c=n[a],u=iH(l),h=iH(c);if(u>1&&1===h)this._updateManyToOne&&this._updateManyToOne(c,l),n[a]=null;else if(1===u&&h>1)this._updateOneToMany&&this._updateOneToMany(c,l),n[a]=null;else if(1===u&&1===h)this._update&&this._update(c,l),n[a]=null;else if(u>1&&h>1)this._updateManyToMany&&this._updateManyToMany(c,l),n[a]=null;else if(u>1)for(var p=0;p<u;p++)this._remove&&this._remove(l[p]);else this._remove&&this._remove(l)}this._performRestAdd(o,n)},t.prototype._performRestAdd=function(t,e){for(var i=0;i<t.length;i++){var n=t[i],r=e[n],o=iH(r);if(o>1)for(var s=0;s<o;s++)this._add&&this._add(r[s]);else 1===o&&this._add&&this._add(r);e[n]=null}},t.prototype._initIndexMap=function(t,e,i,n){for(var r=this._diffModeMultiple,o=0;o<t.length;o++){var s="_ec_"+this[n](t[o],o);if(r||(i[o]=s),e){var a=e[s],l=iH(a);0===l?(e[s]=o,r&&i.push(s)):1===l?e[s]=[a,o]:a.push(o)}}},t}(),oH=rH,sH=function(){function t(t,e){this._encode=t,this._schema=e}return t.prototype.get=function(){return{fullDimensions:this._getFullDimensionNames(),encode:this._encode}},t.prototype._getFullDimensionNames=function(){return this._cachedDimNames||(this._cachedDimNames=this._schema?this._schema.makeOutputDimensionNames():[]),this._cachedDimNames},t}();function aH(t,e){return t.hasOwnProperty(e)||(t[e]=[]),t[e]}function lH(t){return"category"===t?"ordinal":"time"===t?"time":"float"}var cH=function(t){this.otherDims={},null!=t&&pE(this,t)},uH=wP(),hH={float:"f",int:"i",ordinal:"o",number:"n",time:"t"},pH=function(){function t(t){this.dimensions=t.dimensions,this._dimOmitted=t.dimensionOmitted,this.source=t.source,this._fullDimCount=t.fullDimensionCount,this._updateDimOmitted(t.dimensionOmitted)}return t.prototype.isDimensionOmitted=function(){return this._dimOmitted},t.prototype._updateDimOmitted=function(t){this._dimOmitted=t,t&&(this._dimNameMap||(this._dimNameMap=mH(this.source)))},t.prototype.getSourceDimensionIndex=function(t){return BE(this._dimNameMap.get(t),-1)},t.prototype.getSourceDimension=function(t){var e=this.source.dimensionsDefine;if(e)return e[t]},t.prototype.makeStoreSchema=function(){for(var t=this._fullDimCount,e=bF(this.source),i=!gH(t),n="",r=[],o=0,s=0;o<t;o++){var a=void 0,l=void 0,c=void 0,u=this.dimensions[s];if(u&&u.storeDimIndex===o)a=e?u.name:null,l=u.type,c=u.ordinalMeta,s++;else{var h=this.getSourceDimension(o);h&&(a=e?h.name:null,l=h.type)}r.push({property:a,type:l,ordinalMeta:c}),!e||null==a||u&&u.isCalculationCoord||(n+=i?a.replace(/\`/g,"`1").replace(/\$/g,"`2"):a),n+="$",n+=hH[l]||"f",c&&(n+=c.uid),n+="$"}var p=this.source;return{dimensions:r,hash:[p.seriesLayoutBy,p.startIndex,n].join("$$")}},t.prototype.makeOutputDimensionNames=function(){for(var t=[],e=0,i=0;e<this._fullDimCount;e++){var n=void 0,r=this.dimensions[i];if(r&&r.storeDimIndex===e)r.isCalculationCoord||(n=r.name),i++;else{var o=this.getSourceDimension(e);o&&(n=o.name)}t.push(n)}return t},t.prototype.appendCalculationDimension=function(t){this.dimensions.push(t),t.isCalculationCoord=!0,this._fullDimCount++,this._updateDimOmitted(!0)},t}();function dH(t){return t instanceof pH}function fH(t){for(var e=YE(),i=0;i<(t||[]).length;i++){var n=t[i],r=CE(n)?n.name:n;null!=r&&null==e.get(r)&&e.set(r,i)}return e}function mH(t){var e=uH(t);return e.dimNameMap||(e.dimNameMap=fH(t.dimensionsDefine))}function gH(t){return t>30}var yH,vH,_H,xH,bH,wH,AH,EH=CE,SH=vE,MH="undefined"==typeof Int32Array?Array:Int32Array,TH=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],IH=["_approximateExtent"],CH=function(){function t(t,e){var i;this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","lttbDownSample"];var n=!1;dH(t)?(i=t.dimensions,this._dimOmitted=t.isDimensionOmitted(),this._schema=t):(n=!0,i=t),i=i||["x","y"];for(var r={},o=[],s={},a=!1,l={},c=0;c<i.length;c++){var u=i[c],h=ME(u)?new cH({name:u}):u instanceof cH?u:new cH(u),p=h.name;h.type=h.type||"float",h.coordDim||(h.coordDim=p,h.coordDimIndex=0);var d=h.otherDims=h.otherDims||{};o.push(p),r[p]=h,null!=l[p]&&(a=!0),h.createInvertedIndices&&(s[p]=[]),0===d.itemName&&(this._nameDimIdx=c),0===d.itemId&&(this._idDimIdx=c),"production"!==process.env.NODE_ENV&&UE(n||h.storeDimIndex>=0),n&&(h.storeDimIndex=c)}if(this.dimensions=o,this._dimInfos=r,this._initGetDimensionInfo(a),this.hostModel=e,this._invertedIndicesMap=s,this._dimOmitted){var f=this._dimIdxToName=YE();yE(o,(function(t){f.set(r[t].storeDimIndex,t)}))}}return t.prototype.getDimension=function(t){var e=this._recognizeDimIndex(t);if(null==e)return t;if(e=t,!this._dimOmitted)return this.dimensions[e];var i=this._dimIdxToName.get(e);if(null!=i)return i;var n=this._schema.getSourceDimension(e);return n?n.name:void 0},t.prototype.getDimensionIndex=function(t){var e=this._recognizeDimIndex(t);if(null!=e)return e;if(null==t)return-1;var i=this._getDimInfo(t);return i?i.storeDimIndex:this._dimOmitted?this._schema.getSourceDimensionIndex(t):-1},t.prototype._recognizeDimIndex=function(t){if(IE(t)||null!=t&&!isNaN(t)&&!this._getDimInfo(t)&&(!this._dimOmitted||this._schema.getSourceDimensionIndex(t)<0))return+t},t.prototype._getStoreDimIndex=function(t){var e=this.getDimensionIndex(t);if("production"!==process.env.NODE_ENV&&null==e)throw new Error("Unknown dimension "+t);return e},t.prototype.getDimensionInfo=function(t){return this._getDimInfo(this.getDimension(t))},t.prototype._initGetDimensionInfo=function(t){var e=this._dimInfos;this._getDimInfo=t?function(t){return e.hasOwnProperty(t)?e[t]:void 0}:function(t){return e[t]}},t.prototype.getDimensionsOnCoord=function(){return this._dimSummary.dataDimsOnCoord.slice()},t.prototype.mapDimension=function(t,e){var i=this._dimSummary;if(null==e)return i.encodeFirstDimNotExtra[t];var n=i.encode[t];return n?n[e]:null},t.prototype.mapDimensionsAll=function(t){return(this._dimSummary.encode[t]||[]).slice()},t.prototype.getStore=function(){return this._store},t.prototype.initData=function(t,e,i){var n,r=this;if(t instanceof hV&&(n=t),!n){var o=this.dimensions,s=mF(t)||gE(t)?new wF(t,o.length):t;n=new hV;var a=SH(o,(function(t){return{type:r._dimInfos[t].type,property:t}}));n.initData(s,a,i)}this._store=n,this._nameList=(e||[]).slice(),this._idList=[],this._nameRepeatCount={},this._doInit(0,n.count()),this._dimSummary=function(t,e){var i={},n=i.encode={},r=YE(),o=[],s=[],a={};yE(t.dimensions,(function(e){var i,l=t.getDimensionInfo(e),c=l.coordDim;if(c){"production"!==process.env.NODE_ENV&&UE(null==$B.get(c));var u=l.coordDimIndex;aH(n,c)[u]=e,l.isExtraCoord||(r.set(c,1),"ordinal"!==(i=l.type)&&"time"!==i&&(o[0]=e),aH(a,c)[u]=t.getDimensionIndex(l.name)),l.defaultTooltip&&s.push(e)}$B.each((function(t,e){var i=aH(n,e),r=l.otherDims[e];null!=r&&!1!==r&&(i[r]=l.name)}))}));var l=[],c={};r.each((function(t,e){var i=n[e];c[e]=i[0],l=l.concat(i)})),i.dataDimsOnCoord=l,i.dataDimIndicesOnCoord=vE(l,(function(e){return t.getDimensionInfo(e).storeDimIndex})),i.encodeFirstDimNotExtra=c;var u=n.label;u&&u.length&&(o=u.slice());var h=n.tooltip;return h&&h.length?s=h.slice():s.length||(s=o.slice()),n.defaultedLabel=o,n.defaultedTooltip=s,i.userOutput=new sH(a,e),i}(this,this._schema),this.userOutput=this._dimSummary.userOutput},t.prototype.appendData=function(t){var e=this._store.appendData(t);this._doInit(e[0],e[1])},t.prototype.appendValues=function(t,e){var i=this._store.appendValues(t,e.length),n=i.start,r=i.end,o=this._shouldMakeIdFromName();if(this._updateOrdinalMeta(),e)for(var s=n;s<r;s++){var a=s-n;this._nameList[s]=e[a],o&&AH(this,s)}},t.prototype._updateOrdinalMeta=function(){for(var t=this._store,e=this.dimensions,i=0;i<e.length;i++){var n=this._dimInfos[e[i]];n.ordinalMeta&&t.collectOrdinalMeta(n.storeDimIndex,n.ordinalMeta)}},t.prototype._shouldMakeIdFromName=function(){var t=this._store.getProvider();return null==this._idDimIdx&&t.getSource().sourceFormat!==rz&&!t.fillStorage},t.prototype._doInit=function(t,e){if(!(t>=e)){var i=this._store.getProvider();this._updateOrdinalMeta();var n=this._nameList,r=this._idList;if(i.getSource().sourceFormat===tz&&!i.pure)for(var o=[],s=t;s<e;s++){var a=i.getItem(s,o);if(!this.hasItemOption&&pP(a)&&(this.hasItemOption=!0),a){var l=a.name;null==n[s]&&null!=l&&(n[s]=gP(l,null));var c=a.id;null==r[s]&&null!=c&&(r[s]=gP(c,null))}}if(this._shouldMakeIdFromName())for(s=t;s<e;s++)AH(this,s);yH(this)}},t.prototype.getApproximateExtent=function(t){return this._approximateExtent[t]||this._store.getDataExtent(this._getStoreDimIndex(t))},t.prototype.setApproximateExtent=function(t,e){e=this.getDimension(e),this._approximateExtent[e]=t.slice()},t.prototype.getCalculationInfo=function(t){return this._calculationInfo[t]},t.prototype.setCalculationInfo=function(t,e){EH(t)?pE(this._calculationInfo,t):this._calculationInfo[t]=e},t.prototype.getName=function(t){var e=this.getRawIndex(t),i=this._nameList[e];return null==i&&null!=this._nameDimIdx&&(i=_H(this,this._nameDimIdx,e)),null==i&&(i=""),i},t.prototype._getCategory=function(t,e){var i=this._store.get(t,e),n=this._store.getOrdinalMeta(t);return n?n.categories[i]:i},t.prototype.getId=function(t){return vH(this,this.getRawIndex(t))},t.prototype.count=function(){return this._store.count()},t.prototype.get=function(t,e){var i=this._store,n=this._dimInfos[t];if(n)return i.get(n.storeDimIndex,e)},t.prototype.getByRawIndex=function(t,e){var i=this._store,n=this._dimInfos[t];if(n)return i.getByRawIndex(n.storeDimIndex,e)},t.prototype.getIndices=function(){return this._store.getIndices()},t.prototype.getDataExtent=function(t){return this._store.getDataExtent(this._getStoreDimIndex(t))},t.prototype.getSum=function(t){return this._store.getSum(this._getStoreDimIndex(t))},t.prototype.getMedian=function(t){return this._store.getMedian(this._getStoreDimIndex(t))},t.prototype.getValues=function(t,e){var i=this,n=this._store;return EE(t)?n.getValues(SH(t,(function(t){return i._getStoreDimIndex(t)})),e):n.getValues(t)},t.prototype.hasValue=function(t){for(var e=this._dimSummary.dataDimIndicesOnCoord,i=0,n=e.length;i<n;i++)if(isNaN(this._store.get(e[i],t)))return!1;return!0},t.prototype.indexOfName=function(t){for(var e=0,i=this._store.count();e<i;e++)if(this.getName(e)===t)return e;return-1},t.prototype.getRawIndex=function(t){return this._store.getRawIndex(t)},t.prototype.indexOfRawIndex=function(t){return this._store.indexOfRawIndex(t)},t.prototype.rawIndexOf=function(t,e){var i=t&&this._invertedIndicesMap[t];if("production"!==process.env.NODE_ENV&&!i)throw new Error("Do not supported yet");var n=i[e];return null==n||isNaN(n)?-1:n},t.prototype.indicesOfNearest=function(t,e,i){return this._store.indicesOfNearest(this._getStoreDimIndex(t),e,i)},t.prototype.each=function(t,e,i){SE(t)&&(i=e,e=t,t=[]);var n=i||this,r=SH(xH(t),this._getStoreDimIndex,this);this._store.each(r,n?wE(e,n):e)},t.prototype.filterSelf=function(t,e,i){SE(t)&&(i=e,e=t,t=[]);var n=i||this,r=SH(xH(t),this._getStoreDimIndex,this);return this._store=this._store.filter(r,n?wE(e,n):e),this},t.prototype.selectRange=function(t){var e=this,i={};return yE(bE(t),(function(n){var r=e._getStoreDimIndex(n);i[r]=t[n]})),this._store=this._store.selectRange(i),this},t.prototype.mapArray=function(t,e,i){SE(t)&&(i=e,e=t,t=[]),i=i||this;var n=[];return this.each(t,(function(){n.push(e&&e.apply(this,arguments))}),i),n},t.prototype.map=function(t,e,i,n){var r=i||n||this,o=SH(xH(t),this._getStoreDimIndex,this),s=wH(this);return s._store=this._store.map(o,r?wE(e,r):e),s},t.prototype.modify=function(t,e,i,n){var r=this,o=i||n||this;"production"!==process.env.NODE_ENV&&yE(xH(t),(function(t){r.getDimensionInfo(t).isCalculationCoord||console.error("Danger: only stack dimension can be modified")}));var s=SH(xH(t),this._getStoreDimIndex,this);this._store.modify(s,o?wE(e,o):e)},t.prototype.downSample=function(t,e,i,n){var r=wH(this);return r._store=this._store.downSample(this._getStoreDimIndex(t),e,i,n),r},t.prototype.lttbDownSample=function(t,e){var i=wH(this);return i._store=this._store.lttbDownSample(this._getStoreDimIndex(t),e),i},t.prototype.getRawDataItem=function(t){return this._store.getRawDataItem(t)},t.prototype.getItemModel=function(t){var e=this.hostModel,i=this.getRawDataItem(t);return new FN(i,e,e&&e.ecModel)},t.prototype.diff=function(t){var e=this;return new oH(t?t.getStore().getIndices():[],this.getStore().getIndices(),(function(e){return vH(t,e)}),(function(t){return vH(e,t)}))},t.prototype.getVisual=function(t){var e=this._visual;return e&&e[t]},t.prototype.setVisual=function(t,e){this._visual=this._visual||{},EH(t)?pE(this._visual,t):this._visual[t]=e},t.prototype.getItemVisual=function(t,e){var i=this._itemVisuals[t],n=i&&i[e];return null==n?this.getVisual(e):n},t.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},t.prototype.ensureUniqueItemVisual=function(t,e){var i=this._itemVisuals,n=i[t];n||(n=i[t]={});var r=n[e];return null==r&&(EE(r=this.getVisual(e))?r=r.slice():EH(r)&&(r=pE({},r)),n[e]=r),r},t.prototype.setItemVisual=function(t,e,i){var n=this._itemVisuals[t]||{};this._itemVisuals[t]=n,EH(e)?pE(n,e):n[e]=i},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(t,e){EH(t)?pE(this._layout,t):this._layout[t]=e},t.prototype.getLayout=function(t){return this._layout[t]},t.prototype.getItemLayout=function(t){return this._itemLayouts[t]},t.prototype.setItemLayout=function(t,e,i){this._itemLayouts[t]=i?pE(this._itemLayouts[t]||{},e):e},t.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},t.prototype.setItemGraphicEl=function(t,e){var i=this.hostModel&&this.hostModel.seriesIndex;$D(i,this.dataType,t,e),this._graphicEls[t]=e},t.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},t.prototype.eachItemGraphicEl=function(t,e){yE(this._graphicEls,(function(i,n){i&&t&&t.call(e,i,n)}))},t.prototype.cloneShallow=function(e){return e||(e=new t(this._schema?this._schema:SH(this.dimensions,this._getDimInfo,this),this.hostModel)),bH(e,this),e._store=this._store,e},t.prototype.wrapMethod=function(t,e){var i=this[t];SE(i)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var t=i.apply(this,arguments);return e.apply(this,[t].concat(FE(arguments)))})},t.internalField=(yH=function(t){var e=t._invertedIndicesMap;yE(e,(function(i,n){var r=t._dimInfos[n],o=r.ordinalMeta,s=t._store;if(o){i=e[n]=new MH(o.categories.length);for(var a=0;a<i.length;a++)i[a]=-1;for(a=0;a<s.count();a++)i[s.get(r.storeDimIndex,a)]=a}}))},_H=function(t,e,i){return gP(t._getCategory(e,i),null)},vH=function(t,e){var i=t._idList[e];return null==i&&null!=t._idDimIdx&&(i=_H(t,t._idDimIdx,e)),null==i&&(i="e\0\0"+e),i},xH=function(t){return EE(t)||(t=null!=t?[t]:[]),t},wH=function(e){var i=new t(e._schema?e._schema:SH(e.dimensions,e._getDimInfo,e),e.hostModel);return bH(i,e),i},bH=function(t,e){yE(TH.concat(e.__wrappedMethods||[]),(function(i){e.hasOwnProperty(i)&&(t[i]=e[i])})),t.__wrappedMethods=e.__wrappedMethods,yE(IH,(function(i){t[i]=cE(e[i])})),t._calculationInfo=pE({},e._calculationInfo)},void(AH=function(t,e){var i=t._nameList,n=t._idList,r=t._nameDimIdx,o=t._idDimIdx,s=i[e],a=n[e];if(null==s&&null!=r&&(i[e]=s=_H(t,r,e)),null==a&&null!=o&&(n[e]=a=_H(t,o,e)),null==a&&null!=s){var l=t._nameRepeatCount,c=l[s]=(l[s]||0)+1;a=s,c>1&&(a+="__ec__"+c),n[e]=a}})),t}(),PH=CH;function LH(t,e){mF(t)||(t=yF(t));var i=(e=e||{}).coordDimensions||[],n=e.dimensionsDefine||t.dimensionsDefine||[],r=YE(),o=[],s=function(t,e,i,n){var r=Math.max(t.dimensionsDetectedCount||1,e.length,i.length,n||0);return yE(e,(function(t){var e;CE(t)&&(e=t.dimsDef)&&(r=Math.max(r,e.length))})),r}(t,i,n,e.dimensionsCount),a=e.canOmitUnusedDimensions&&gH(s),l=n===t.dimensionsDefine,c=l?mH(t):fH(n),u=e.encodeDefine;!u&&e.encodeDefaulter&&(u=e.encodeDefaulter(t,s));for(var h=YE(u),p=new sV(s),d=0;d<p.length;d++)p[d]=-1;function f(t){var e=p[t];if(e<0){var i=n[t],r=CE(i)?i:{name:i},s=new cH,a=r.name;null!=a&&null!=c.get(a)&&(s.name=s.displayName=a),null!=r.type&&(s.type=r.type),null!=r.displayName&&(s.displayName=r.displayName);var l=o.length;return p[t]=l,s.storeDimIndex=t,o.push(s),s}return o[e]}if(!a)for(d=0;d<s;d++)f(d);h.each((function(t,e){var i=lP(t).slice();if(1===i.length&&!ME(i[0])&&i[0]<0)h.set(e,!1);else{var n=h.set(e,[]);yE(i,(function(t,i){var r=ME(t)?c.get(t):t;null!=r&&r<s&&(n[i]=r,g(f(r),e,i))}))}}));var m=0;function g(t,e,i){null!=$B.get(e)?t.otherDims[e]=i:(t.coordDim=e,t.coordDimIndex=i,r.set(e,!0))}yE(i,(function(t){var e,i,n,r;if(ME(t))e=t,r={};else{e=(r=t).name;var o=r.ordinalMeta;r.ordinalMeta=null,(r=pE({},r)).ordinalMeta=o,i=r.dimsDef,n=r.otherDims,r.name=r.coordDim=r.coordDimIndex=r.dimsDef=r.otherDims=null}var a=h.get(e);if(!1!==a){if(!(a=lP(a)).length)for(var c=0;c<(i&&i.length||1);c++){for(;m<s&&null!=f(m).coordDim;)m++;m<s&&a.push(m++)}yE(a,(function(t,o){var s=f(t);if(l&&null!=r.type&&(s.type=r.type),g(dE(s,r),e,o),null==s.name&&i){var a=i[o];!CE(a)&&(a={name:a}),s.name=s.displayName=a.name,s.defaultTooltip=a.defaultTooltip}n&&dE(s.otherDims,n)}))}}));var y=e.generateCoord,v=e.generateCoordCount,_=null!=v;v=y?v||1:0;var x=y||"value";function b(t){null==t.name&&(t.name=t.coordDim)}if(a)yE(o,(function(t){b(t)})),o.sort((function(t,e){return t.storeDimIndex-e.storeDimIndex}));else for(var w=0;w<s;w++){var A=f(w);null==A.coordDim&&(A.coordDim=DH(x,r,_),A.coordDimIndex=0,(!y||v<=0)&&(A.isExtraCoord=!0),v--),b(A),null!=A.type||dz(t,w)!==lz.Must&&(!A.isExtraCoord||null==A.otherDims.itemName&&null==A.otherDims.seriesName)||(A.type="ordinal")}return function(t){for(var e=YE(),i=0;i<t.length;i++){var n=t[i],r=n.name,o=e.get(r)||0;o>0&&(n.name=r+(o-1)),o++,e.set(r,o)}}(o),new pH({source:t,dimensions:o,fullDimensionCount:s,dimensionOmitted:a})}function DH(t,e,i){if(i||e.hasKey(t)){for(var n=0;e.hasKey(t+n);)n++;t+=n}return e.set(t,!0),t}var RH=function(t){this.coordSysDims=[],this.axisMap=YE(),this.categoryAxisMap=YE(),this.coordSysName=t};var OH={cartesian2d:function(t,e,i,n){var r=t.getReferringComponents("xAxis",MP).models[0],o=t.getReferringComponents("yAxis",MP).models[0];if("production"!==process.env.NODE_ENV){if(!r)throw new Error('xAxis "'+NE(t.get("xAxisIndex"),t.get("xAxisId"),0)+'" not found');if(!o)throw new Error('yAxis "'+NE(t.get("xAxisIndex"),t.get("yAxisId"),0)+'" not found')}e.coordSysDims=["x","y"],i.set("x",r),i.set("y",o),kH(r)&&(n.set("x",r),e.firstCategoryDimIndex=0),kH(o)&&(n.set("y",o),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,i,n){var r=t.getReferringComponents("singleAxis",MP).models[0];if("production"!==process.env.NODE_ENV&&!r)throw new Error("singleAxis should be specified.");e.coordSysDims=["single"],i.set("single",r),kH(r)&&(n.set("single",r),e.firstCategoryDimIndex=0)},polar:function(t,e,i,n){var r=t.getReferringComponents("polar",MP).models[0],o=r.findAxisModel("radiusAxis"),s=r.findAxisModel("angleAxis");if("production"!==process.env.NODE_ENV){if(!s)throw new Error("angleAxis option not found");if(!o)throw new Error("radiusAxis option not found")}e.coordSysDims=["radius","angle"],i.set("radius",o),i.set("angle",s),kH(o)&&(n.set("radius",o),e.firstCategoryDimIndex=0),kH(s)&&(n.set("angle",s),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},geo:function(t,e,i,n){e.coordSysDims=["lng","lat"]},parallel:function(t,e,i,n){var r=t.ecModel,o=r.getComponent("parallel",t.get("parallelIndex")),s=e.coordSysDims=o.dimensions.slice();yE(o.parallelAxisIndex,(function(t,o){var a=r.getComponent("parallelAxis",t),l=s[o];i.set(l,a),kH(a)&&(n.set(l,a),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=o))}))}};function kH(t){return"category"===t.get("type")}function NH(t,e,i){var n,r,o,s=(i=i||{}).byIndex,a=i.stackedCoordDimension;!function(t){return!dH(t.schema)}(e)?(r=e.schema,n=r.dimensions,o=e.store):n=e;var l,c,u,h,p=!(!t||!t.get("stack"));if(yE(n,(function(t,e){ME(t)&&(n[e]=t={name:t}),p&&!t.isExtraCoord&&(s||l||!t.ordinalMeta||(l=t),c||"ordinal"===t.type||"time"===t.type||a&&a!==t.coordDim||(c=t))})),!c||s||l||(s=!0),c){u="__\0ecstackresult_"+t.id,h="__\0ecstackedover_"+t.id,l&&(l.createInvertedIndices=!0);var d=c.coordDim,f=c.type,m=0;yE(n,(function(t){t.coordDim===d&&m++}));var g={name:u,coordDim:d,coordDimIndex:m,type:f,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:n.length},y={name:h,coordDim:h,coordDimIndex:m+1,type:f,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:n.length+1};r?(o&&(g.storeDimIndex=o.ensureCalculationDimension(h,f),y.storeDimIndex=o.ensureCalculationDimension(u,f)),r.appendCalculationDimension(g),r.appendCalculationDimension(y)):(n.push(g),n.push(y))}return{stackedDimension:c&&c.name,stackedByDimension:l&&l.name,isStackedByIndex:s,stackedOverDimension:h,stackResultDimension:u}}function BH(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function zH(t,e){return BH(t,e)?t.getCalculationInfo("stackResultDimension"):e}function FH(t,e,i){i=i||{};var n,r=e.getSourceManager(),o=!1;t?(o=!0,n=yF(t)):o=(n=r.getSource()).sourceFormat===tz;var s=function(t){var e=t.get("coordinateSystem"),i=new RH(e),n=OH[e];if(n)return n(t,i,i.axisMap,i.categoryAxisMap),i}(e),a=function(t,e){var i,n=t.get("coordinateSystem"),r=Bz.get(n);return e&&e.coordSysDims&&(i=vE(e.coordSysDims,(function(t){var i={name:t},n=e.axisMap.get(t);if(n){var r=n.get("type");i.type=lH(r)}return i}))),i||(i=r&&(r.getDimensionsInfo?r.getDimensionsInfo():r.dimensions.slice())||["x","y"]),i}(e,s),l=i.useEncodeDefaulter,c=SE(l)?l:l?AE(uz,a,e):null,u=LH(n,{coordDimensions:a,generateCoord:i.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:c,canOmitUnusedDimensions:!o}),h=function(t,e,i){var n,r;return i&&yE(t,(function(t,o){var s=t.coordDim,a=i.categoryAxisMap.get(s);a&&(null==n&&(n=o),t.ordinalMeta=a.getOrdinalMeta(),e&&(t.createInvertedIndices=!0)),null!=t.otherDims.itemName&&(r=!0)})),r||null==n||(t[n].otherDims.itemName=0),n}(u.dimensions,i.createInvertedIndices,s),p=o?null:r.getSharedDataStore(u),d=NH(e,{schema:u,store:p}),f=new PH(u,e);f.setCalculationInfo(d);var m=null!=h&&function(t){if(t.sourceFormat===tz){var e=function(t){var e=0;for(;e<t.length&&null==t[e];)e++;return t[e]}(t.data||[]);return!EE(hP(e))}}(n)?function(t,e,i,n){return n===h?i:this.defaultDimValueGetter(t,e,i,n)}:null;return f.hasItemOption=!1,f.initData(o?n:p,null,m),f}var VH=function(){function t(t){this._setting=t||{},this._extent=[1/0,-1/0]}return t.prototype.getSetting=function(t){return this._setting[t]},t.prototype.unionExtent=function(t){var e=this._extent;t[0]<e[0]&&(e[0]=t[0]),t[1]>e[1]&&(e[1]=t[1])},t.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.setExtent=function(t,e){var i=this._extent;isNaN(t)||(i[0]=t),isNaN(e)||(i[1]=e)},t.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},t.prototype.isBlank=function(){return this._isBlank},t.prototype.setBlank=function(t){this._isBlank=t},t}();UP(VH);var UH=VH,GH=0,jH=function(){function t(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++GH}return t.createByAxisModel=function(e){var i=e.option,n=i.data,r=n&&vE(n,HH);return new t({categories:r,needCollect:!r,deduplication:!1!==i.dedplication})},t.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},t.prototype.parseAndCollect=function(t){var e,i=this._needCollect;if(!ME(t)&&!i)return t;if(i&&!this._deduplication)return e=this.categories.length,this.categories[e]=t,e;var n=this._getOrCreateMap();return null==(e=n.get(t))&&(i?(e=this.categories.length,this.categories[e]=t,n.set(t,e)):e=NaN),e},t.prototype._getOrCreateMap=function(){return this._map||(this._map=YE(this.categories))},t}();function HH(t){return CE(t)&&null!=t.value?t.value:t+""}var WH=jH;function qH(t){return"interval"===t.type||"log"===t.type}function XH(t,e,i,n){var r={},o=t[1]-t[0],s=r.interval=UC(o/e,!0);null!=i&&s<i&&(s=r.interval=i),null!=n&&s>n&&(s=r.interval=n);var a=r.intervalPrecision=YH(s);return function(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),QH(t,0,e),QH(t,1,e),t[0]>t[1]&&(t[0]=t[1])}(r.niceTickExtent=[CC(Math.ceil(t[0]/s)*s,a),CC(Math.floor(t[1]/s)*s,a)],t),r}function ZH(t){var e=Math.pow(10,VC(t)),i=t/e;return i?2===i?i=3:3===i?i=5:i*=2:i=1,CC(i*e)}function YH(t){return LC(t)+2}function QH(t,e,i){t[e]=Math.max(Math.min(t[e],i[1]),i[0])}function JH(t,e){return t>=e[0]&&t<=e[1]}function KH(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function $H(t,e){return t*(e[1]-e[0])+e[0]}var tW=function(t){function e(e){var i=t.call(this,e)||this;i.type="ordinal";var n=i.getSetting("ordinalMeta");return n||(n=new WH({})),EE(n)&&(n=new WH({categories:vE(n,(function(t){return CE(t)?t.value:t}))})),i._ordinalMeta=n,i._extent=i.getSetting("extent")||[0,n.categories.length-1],i}return zA(e,t),e.prototype.parse=function(t){return null==t?NaN:ME(t)?this._ordinalMeta.getOrdinal(t):Math.round(t)},e.prototype.contain=function(t){return JH(t=this.parse(t),this._extent)&&null!=this._ordinalMeta.categories[t]},e.prototype.normalize=function(t){return KH(t=this._getTickNumber(this.parse(t)),this._extent)},e.prototype.scale=function(t){return t=Math.round($H(t,this._extent)),this.getRawOrdinalNumber(t)},e.prototype.getTicks=function(){for(var t=[],e=this._extent,i=e[0];i<=e[1];)t.push({value:i}),i++;return t},e.prototype.getMinorTicks=function(t){},e.prototype.setSortInfo=function(t){if(null!=t){for(var e=t.ordinalNumbers,i=this._ordinalNumbersByTick=[],n=this._ticksByOrdinalNumber=[],r=0,o=this._ordinalMeta.categories.length,s=Math.min(o,e.length);r<s;++r){var a=e[r];i[r]=a,n[a]=r}for(var l=0;r<o;++r){for(;null!=n[l];)l++;i.push(l),n[l]=r}}else this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null},e.prototype._getTickNumber=function(t){var e=this._ticksByOrdinalNumber;return e&&t>=0&&t<e.length?e[t]:t},e.prototype.getRawOrdinalNumber=function(t){var e=this._ordinalNumbersByTick;return e&&t>=0&&t<e.length?e[t]:t},e.prototype.getLabel=function(t){if(!this.isBlank()){var e=this.getRawOrdinalNumber(t.value),i=this._ordinalMeta.categories[e];return null==i?"":i+""}},e.prototype.count=function(){return this._extent[1]-this._extent[0]+1},e.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},e.prototype.isInExtentRange=function(t){return t=this._getTickNumber(t),this._extent[0]<=t&&this._extent[1]>=t},e.prototype.getOrdinalMeta=function(){return this._ordinalMeta},e.prototype.calcNiceTicks=function(){},e.prototype.calcNiceExtent=function(){},e.type="ordinal",e}(UH);UH.registerClass(tW);var eW=tW,iW=CC,nW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="interval",e._interval=0,e._intervalPrecision=2,e}return zA(e,t),e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return JH(t,this._extent)},e.prototype.normalize=function(t){return KH(t,this._extent)},e.prototype.scale=function(t){return $H(t,this._extent)},e.prototype.setExtent=function(t,e){var i=this._extent;isNaN(t)||(i[0]=parseFloat(t)),isNaN(e)||(i[1]=parseFloat(e))},e.prototype.unionExtent=function(t){var e=this._extent;t[0]<e[0]&&(e[0]=t[0]),t[1]>e[1]&&(e[1]=t[1]),this.setExtent(e[0],e[1])},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=YH(t)},e.prototype.getTicks=function(t){var e=this._interval,i=this._extent,n=this._niceExtent,r=this._intervalPrecision,o=[];if(!e)return o;i[0]<n[0]&&(t?o.push({value:iW(n[0]-e,r)}):o.push({value:i[0]}));for(var s=n[0];s<=n[1]&&(o.push({value:s}),(s=iW(s+e,r))!==o[o.length-1].value);)if(o.length>1e4)return[];var a=o.length?o[o.length-1].value:n[1];return i[1]>a&&(t?o.push({value:iW(a+e,r)}):o.push({value:i[1]})),o},e.prototype.getMinorTicks=function(t){for(var e=this.getTicks(!0),i=[],n=this.getExtent(),r=1;r<e.length;r++){for(var o=e[r],s=e[r-1],a=0,l=[],c=(o.value-s.value)/t;a<t-1;){var u=iW(s.value+(a+1)*c);u>n[0]&&u<n[1]&&l.push(u),a++}i.push(l)}return i},e.prototype.getLabel=function(t,e){if(null==t)return"";var i=e&&e.precision;return null==i?i=LC(t.value)||0:"auto"===i&&(i=this._intervalPrecision),TB(iW(t.value,i,!0))},e.prototype.calcNiceTicks=function(t,e,i){t=t||5;var n=this._extent,r=n[1]-n[0];if(isFinite(r)){r<0&&(r=-r,n.reverse());var o=XH(n,t,e,i);this._intervalPrecision=o.intervalPrecision,this._interval=o.interval,this._niceExtent=o.niceTickExtent}},e.prototype.calcNiceExtent=function(t){var e=this._extent;if(e[0]===e[1])if(0!==e[0]){var i=Math.abs(e[0]);t.fixMax||(e[1]+=i/2),e[0]-=i/2}else e[1]=1;var n=e[1]-e[0];isFinite(n)||(e[0]=0,e[1]=1),this.calcNiceTicks(t.splitNumber,t.minInterval,t.maxInterval);var r=this._interval;t.fixMin||(e[0]=iW(Math.floor(e[0]/r)*r)),t.fixMax||(e[1]=iW(Math.ceil(e[1]/r)*r))},e.prototype.setNiceExtent=function(t,e){this._niceExtent=[t,e]},e.type="interval",e}(UH);UH.registerClass(nW);var rW=nW,oW="undefined"!=typeof Float32Array,sW=oW?Float32Array:Array;function aW(t){return EE(t)?oW?new Float32Array(t):t:new sW(t)}var lW="__ec_stack_";function cW(t){return t.get("stack")||lW+t.seriesIndex}function uW(t){return t.dim+t.index}function hW(t,e){var i=[];return e.eachSeriesByType(t,(function(t){gW(t)&&i.push(t)})),i}function pW(t){var e=function(t){var e={};yE(t,(function(t){var i=t.coordinateSystem.getBaseAxis();if("time"===i.type||"value"===i.type)for(var n=t.getData(),r=i.dim+"_"+i.index,o=n.getDimensionIndex(n.mapDimension(i.dim)),s=n.getStore(),a=0,l=s.count();a<l;++a){var c=s.get(o,a);e[r]?e[r].push(c):e[r]=[c]}}));var i={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(r){r.sort((function(t,e){return t-e}));for(var o=null,s=1;s<r.length;++s){var a=r[s]-r[s-1];a>0&&(o=null===o?a:Math.min(o,a))}i[n]=o}}return i}(t),i=[];return yE(t,(function(t){var n,r=t.coordinateSystem.getBaseAxis(),o=r.getExtent();if("category"===r.type)n=r.getBandWidth();else if("value"===r.type||"time"===r.type){var s=r.dim+"_"+r.index,a=e[s],l=Math.abs(o[1]-o[0]),c=r.scale.getExtent(),u=Math.abs(c[1]-c[0]);n=a?l/u*a:l}else{var h=t.getData();n=Math.abs(o[1]-o[0])/h.count()}var p=IC(t.get("barWidth"),n),d=IC(t.get("barMaxWidth"),n),f=IC(t.get("barMinWidth")||(yW(t)?.5:1),n),m=t.get("barGap"),g=t.get("barCategoryGap");i.push({bandWidth:n,barWidth:p,barMaxWidth:d,barMinWidth:f,barGap:m,barCategoryGap:g,axisKey:uW(r),stackId:cW(t)})})),dW(i)}function dW(t){var e={};yE(t,(function(t,i){var n=t.axisKey,r=t.bandWidth,o=e[n]||{bandWidth:r,remainedWidth:r,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},s=o.stacks;e[n]=o;var a=t.stackId;s[a]||o.autoWidthCount++,s[a]=s[a]||{width:0,maxWidth:0};var l=t.barWidth;l&&!s[a].width&&(s[a].width=l,l=Math.min(o.remainedWidth,l),o.remainedWidth-=l);var c=t.barMaxWidth;c&&(s[a].maxWidth=c);var u=t.barMinWidth;u&&(s[a].minWidth=u);var h=t.barGap;null!=h&&(o.gap=h);var p=t.barCategoryGap;null!=p&&(o.categoryGap=p)}));var i={};return yE(e,(function(t,e){i[e]={};var n=t.stacks,r=t.bandWidth,o=t.categoryGap;if(null==o){var s=bE(n).length;o=Math.max(35-4*s,15)+"%"}var a=IC(o,r),l=IC(t.gap,1),c=t.remainedWidth,u=t.autoWidthCount,h=(c-a)/(u+(u-1)*l);h=Math.max(h,0),yE(n,(function(t){var e=t.maxWidth,i=t.minWidth;if(t.width){n=t.width;e&&(n=Math.min(n,e)),i&&(n=Math.max(n,i)),t.width=n,c-=n+l*n,u--}else{var n=h;e&&e<n&&(n=Math.min(e,c)),i&&i>n&&(n=i),n!==h&&(t.width=n,c-=n+l*n,u--)}})),h=(c-a)/(u+(u-1)*l),h=Math.max(h,0);var p,d=0;yE(n,(function(t,e){t.width||(t.width=h),p=t,d+=t.width*(1+l)})),p&&(d-=p.width*l);var f=-d/2;yE(n,(function(t,n){i[e][n]=i[e][n]||{bandWidth:r,offset:f,width:t.width},f+=t.width*(1+l)}))})),i}function fW(t,e){var i=hW(t,e),n=pW(i);yE(i,(function(t){var e=t.getData(),i=t.coordinateSystem.getBaseAxis(),r=cW(t),o=n[uW(i)][r],s=o.offset,a=o.width;e.setLayout({bandWidth:o.bandWidth,offset:s,size:a})}))}function mW(t){return{seriesType:t,plan:XV(),reset:function(t){if(gW(t)){var e=t.getData(),i=t.coordinateSystem,n=i.getBaseAxis(),r=i.getOtherAxis(n),o=e.getDimensionIndex(e.mapDimension(r.dim)),s=e.getDimensionIndex(e.mapDimension(n.dim)),a=t.get("showBackground",!0),l=e.mapDimension(r.dim),c=e.getCalculationInfo("stackResultDimension"),u=BH(e,l)&&!!e.getCalculationInfo("stackedOnSeries"),h=r.isHorizontal(),p=function(t,e){return e.toGlobalCoord(e.dataToCoord("log"===e.type?1:0))}(0,r),d=yW(t),f=t.get("barMinHeight")||0,m=c&&e.getDimensionIndex(c),g=e.getLayout("size"),y=e.getLayout("offset");return{progress:function(t,e){for(var n,r=t.count,l=d&&aW(3*r),c=d&&a&&aW(3*r),v=d&&aW(r),_=i.master.getRect(),x=h?_.width:_.height,b=e.getStore(),w=0;null!=(n=t.next());){var A=b.get(u?m:o,n),E=b.get(s,n),S=p,M=void 0;u&&(M=+A-b.get(o,n));var T=void 0,I=void 0,C=void 0,P=void 0;if(h){var L=i.dataToPoint([A,E]);if(u)S=i.dataToPoint([M,E])[0];T=S,I=L[1]+y,C=L[0]-S,P=g,Math.abs(C)<f&&(C=(C<0?-1:1)*f)}else{L=i.dataToPoint([E,A]);if(u)S=i.dataToPoint([E,M])[1];T=L[0]+y,I=S,C=g,P=L[1]-S,Math.abs(P)<f&&(P=(P<=0?-1:1)*f)}d?(l[w]=T,l[w+1]=I,l[w+2]=h?C:P,c&&(c[w]=h?_.x:T,c[w+1]=h?I:_.y,c[w+2]=x),v[n]=n):e.setItemLayout(n,{x:T,y:I,width:C,height:P}),w+=3}d&&e.setLayout({largePoints:l,largeDataIndices:v,largeBackgroundPoints:c,valueAxisHorizontal:h})}}}}}}function gW(t){return t.coordinateSystem&&"cartesian2d"===t.coordinateSystem.type}function yW(t){return t.pipelineContext&&t.pipelineContext.large}var vW=function(t){function e(e){var i=t.call(this,e)||this;return i.type="time",i}return zA(e,t),e.prototype.getLabel=function(t){var e=this.getSetting("useUTC");return uB(t.value,rB[function(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}(lB(this._minLevelUnit))]||rB.second,e,this.getSetting("locale"))},e.prototype.getFormattedLabel=function(t,e,i){var n=this.getSetting("useUTC");return function(t,e,i,n,r){var o=null;if(ME(i))o=i;else if(SE(i))o=i(t.value,e,{level:t.level});else{var s=pE({},iB);if(t.level>0)for(var a=0;a<oB.length;++a)s[oB[a]]="{primary|"+s[oB[a]]+"}";var l=i?!1===i.inherit?i:dE(i,s):s,c=hB(t.value,r);if(l[c])o=l[c];else if(l.inherit){for(a=sB.indexOf(c)-1;a>=0;--a)if(l[c]){o=l[c];break}o=o||s.none}if(EE(o)){var u=null==t.level?0:t.level>=0?t.level:o.length+t.level;o=o[u=Math.min(u,o.length-1)]}}return uB(new Date(t.value),o,r,n)}(t,e,i,this.getSetting("locale"),n)},e.prototype.getTicks=function(){var t=this._interval,e=this._extent,i=[];if(!t)return i;i.push({value:e[0],level:0});var n=this.getSetting("useUTC"),r=function(t,e,i,n){var r=1e4,o=sB,s=0;function a(t,e,i,r,o,s,a){for(var l=new Date(e),c=e,u=l[r]();c<i&&c<=n[1];)a.push({value:c}),u+=t,l[o](u),c=l.getTime();a.push({value:c,notAdd:!0})}function l(t,r,o){var s=[],l=!r.length;if(!function(t,e,i,n){var r=FC(e),o=FC(i),s=function(t){return pB(r,t,n)===pB(o,t,n)},a=function(){return s("year")},l=function(){return a()&&s("month")},c=function(){return l()&&s("day")},u=function(){return c()&&s("hour")},h=function(){return u()&&s("minute")},p=function(){return h()&&s("second")},d=function(){return p()&&s("millisecond")};switch(t){case"year":return a();case"month":return l();case"day":return c();case"hour":return u();case"minute":return h();case"second":return p();case"millisecond":return d()}}(lB(t),n[0],n[1],i)){l&&(r=[{value:SW(new Date(n[0]),t,i)},{value:n[1]}]);for(var c=0;c<r.length-1;c++){var u=r[c].value,h=r[c+1].value;if(u!==h){var p=void 0,d=void 0,f=void 0,m=!1;switch(t){case"year":p=Math.max(1,Math.round(e/tB/365)),d=dB(i),f=xB(i);break;case"half-year":case"quarter":case"month":p=bW(e),d=fB(i),f=bB(i);break;case"week":case"half-week":case"day":p=xW(e),d=mB(i),f=wB(i),m=!0;break;case"half-day":case"quarter-day":case"hour":p=wW(e),d=gB(i),f=AB(i);break;case"minute":p=AW(e,!0),d=yB(i),f=EB(i);break;case"second":p=AW(e,!1),d=vB(i),f=SB(i);break;case"millisecond":p=EW(e),d=_B(i),f=MB(i)}a(p,u,h,d,f,m,s),"year"===t&&o.length>1&&0===c&&o.unshift({value:o[0].value-p})}}for(c=0;c<s.length;c++)o.push(s[c]);return s}}for(var c=[],u=[],h=0,p=0,d=0;d<o.length&&s++<r;++d){var f=lB(o[d]);if(cB(o[d]))if(l(o[d],c[c.length-1]||[],u),f!==(o[d+1]?lB(o[d+1]):null)){if(u.length){p=h,u.sort((function(t,e){return t.value-e.value}));for(var m=[],g=0;g<u.length;++g){var y=u[g].value;0!==g&&u[g-1].value===y||(m.push(u[g]),y>=n[0]&&y<=n[1]&&h++)}var v=(n[1]-n[0])/e;if(h>1.5*v&&p>v/1.5)break;if(c.push(m),h>v||t===o[d])break}u=[]}}"production"!==process.env.NODE_ENV&&s>=r&&$C("Exceed safe limit.");var _=xE(vE(c,(function(t){return xE(t,(function(t){return t.value>=n[0]&&t.value<=n[1]&&!t.notAdd}))})),(function(t){return t.length>0})),x=[],b=_.length-1;for(d=0;d<_.length;++d)for(var w=_[d],A=0;A<w.length;++A)x.push({value:w[A].value,level:b-d});x.sort((function(t,e){return t.value-e.value}));var E=[];for(d=0;d<x.length;++d)0!==d&&x[d].value===x[d-1].value||E.push(x[d]);return E}(this._minLevelUnit,this._approxInterval,n,e);return(i=i.concat(r)).push({value:e[1],level:0}),i},e.prototype.calcNiceExtent=function(t){var e=this._extent;if(e[0]===e[1]&&(e[0]-=tB,e[1]+=tB),e[1]===-1/0&&e[0]===1/0){var i=new Date;e[1]=+new Date(i.getFullYear(),i.getMonth(),i.getDate()),e[0]=e[1]-tB}this.calcNiceTicks(t.splitNumber,t.minInterval,t.maxInterval)},e.prototype.calcNiceTicks=function(t,e,i){t=t||10;var n=this._extent,r=n[1]-n[0];this._approxInterval=r/t,null!=e&&this._approxInterval<e&&(this._approxInterval=e),null!=i&&this._approxInterval>i&&(this._approxInterval=i);var o=_W.length,s=Math.min(function(t,e,i,n){for(;i<n;){var r=i+n>>>1;t[r][1]<e?i=r+1:n=r}return i}(_W,this._approxInterval,0,o),o-1);this._interval=_W[s][1],this._minLevelUnit=_W[Math.max(s-1,0)][0]},e.prototype.parse=function(t){return IE(t)?t:+FC(t)},e.prototype.contain=function(t){return JH(this.parse(t),this._extent)},e.prototype.normalize=function(t){return KH(this.parse(t),this._extent)},e.prototype.scale=function(t){return $H(t,this._extent)},e.type="time",e}(rW),_W=[["second",JN],["minute",KN],["hour",$N],["quarter-day",6*$N],["half-day",12*$N],["day",1.2*tB],["half-week",3.5*tB],["week",7*tB],["month",31*tB],["quarter",95*tB],["half-year",eB/2],["year",eB]];function xW(t,e){return(t/=tB)>16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function bW(t){return(t/=30*tB)>6?6:t>3?3:t>2?2:1}function wW(t){return(t/=$N)>12?12:t>6?6:t>3.5?4:t>2?2:1}function AW(t,e){return(t/=e?KN:JN)>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function EW(t){return UC(t,!0)}function SW(t,e,i){var n=new Date(t);switch(lB(e)){case"year":case"month":n[bB(i)](0);case"day":n[wB(i)](1);case"hour":n[AB(i)](0);case"minute":n[EB(i)](0);case"second":n[SB(i)](0),n[MB(i)](0)}return n.getTime()}UH.registerClass(vW);var MW=vW,TW=UH.prototype,IW=rW.prototype,CW=CC,PW=Math.floor,LW=Math.ceil,DW=Math.pow,RW=Math.log,OW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="log",e.base=10,e._originalScale=new rW,e._interval=0,e}return zA(e,t),e.prototype.getTicks=function(t){var e=this._originalScale,i=this._extent,n=e.getExtent();return vE(IW.getTicks.call(this,t),(function(t){var e=t.value,r=CC(DW(this.base,e));return r=e===i[0]&&this._fixMin?NW(r,n[0]):r,{value:r=e===i[1]&&this._fixMax?NW(r,n[1]):r}}),this)},e.prototype.setExtent=function(t,e){var i=RW(this.base);t=RW(Math.max(0,t))/i,e=RW(Math.max(0,e))/i,IW.setExtent.call(this,t,e)},e.prototype.getExtent=function(){var t=this.base,e=TW.getExtent.call(this);e[0]=DW(t,e[0]),e[1]=DW(t,e[1]);var i=this._originalScale.getExtent();return this._fixMin&&(e[0]=NW(e[0],i[0])),this._fixMax&&(e[1]=NW(e[1],i[1])),e},e.prototype.unionExtent=function(t){this._originalScale.unionExtent(t);var e=this.base;t[0]=RW(t[0])/RW(e),t[1]=RW(t[1])/RW(e),TW.unionExtent.call(this,t)},e.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},e.prototype.calcNiceTicks=function(t){t=t||10;var e=this._extent,i=e[1]-e[0];if(!(i===1/0||i<=0)){var n,r=(n=i,Math.pow(10,VC(n)));for(t/i*r<=.5&&(r*=10);!isNaN(r)&&Math.abs(r)<1&&Math.abs(r)>0;)r*=10;var o=[CC(LW(e[0]/r)*r),CC(PW(e[1]/r)*r)];this._interval=r,this._niceExtent=o}},e.prototype.calcNiceExtent=function(t){IW.calcNiceExtent.call(this,t),this._fixMin=t.fixMin,this._fixMax=t.fixMax},e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return JH(t=RW(t)/RW(this.base),this._extent)},e.prototype.normalize=function(t){return KH(t=RW(t)/RW(this.base),this._extent)},e.prototype.scale=function(t){return t=$H(t,this._extent),DW(this.base,t)},e.type="log",e}(UH),kW=OW.prototype;function NW(t,e){return CW(t,LC(e))}kW.getMinorTicks=IW.getMinorTicks,kW.getLabel=IW.getLabel,UH.registerClass(OW);var BW=OW,zW=function(){function t(t,e,i){this._prepareParams(t,e,i)}return t.prototype._prepareParams=function(t,e,i){i[1]<i[0]&&(i=[NaN,NaN]),this._dataMin=i[0],this._dataMax=i[1];var n=this._isOrdinal="ordinal"===t.type;this._needCrossZero="interval"===t.type&&e.getNeedCrossZero&&e.getNeedCrossZero();var r=this._modelMinRaw=e.get("min",!0);SE(r)?this._modelMinNum=GW(t,r({min:i[0],max:i[1]})):"dataMin"!==r&&(this._modelMinNum=GW(t,r));var o=this._modelMaxRaw=e.get("max",!0);if(SE(o)?this._modelMaxNum=GW(t,o({min:i[0],max:i[1]})):"dataMax"!==o&&(this._modelMaxNum=GW(t,o)),n)this._axisDataLen=e.getCategories().length;else{var s=e.get("boundaryGap"),a=EE(s)?s:[s||0,s||0];"boolean"==typeof a[0]||"boolean"==typeof a[1]?("production"!==process.env.NODE_ENV&&console.warn('Boolean type for boundaryGap is only allowed for ordinal axis. Please use string in percentage instead, e.g., "20%". Currently, boundaryGap is set to be 0.'),this._boundaryGapInner=[0,0]):this._boundaryGapInner=[sC(a[0],1),sC(a[1],1)]}},t.prototype.calculate=function(){var t=this._isOrdinal,e=this._dataMin,i=this._dataMax,n=this._axisDataLen,r=this._boundaryGapInner,o=t?null:i-e||Math.abs(e),s="dataMin"===this._modelMinRaw?e:this._modelMinNum,a="dataMax"===this._modelMaxRaw?i:this._modelMaxNum,l=null!=s,c=null!=a;null==s&&(s=t?n?0:NaN:e-r[0]*o),null==a&&(a=t?n?n-1:NaN:i+r[1]*o),(null==s||!isFinite(s))&&(s=NaN),(null==a||!isFinite(a))&&(a=NaN);var u=kE(s)||kE(a)||t&&!n;this._needCrossZero&&(s>0&&a>0&&!l&&(s=0),s<0&&a<0&&!c&&(a=0));var h=this._determinedMin,p=this._determinedMax;return null!=h&&(s=h,l=!0),null!=p&&(a=p,c=!0),{min:s,max:a,minFixed:l,maxFixed:c,isBlank:u}},t.prototype.modifyDataMinMax=function(t,e){"production"!==process.env.NODE_ENV&&UE(!this.frozen),this[VW[t]]=e},t.prototype.setDeterminedMinMax=function(t,e){var i=FW[t];"production"!==process.env.NODE_ENV&&UE(!this.frozen&&null==this[i]),this[i]=e},t.prototype.freeze=function(){this.frozen=!0},t}(),FW={min:"_determinedMin",max:"_determinedMax"},VW={min:"_dataMin",max:"_dataMax"};function UW(t,e,i){var n=t.rawExtentInfo;return n||(n=new zW(t,e,i),t.rawExtentInfo=n,n)}function GW(t,e){return null==e?null:kE(e)?NaN:t.parse(e)}function jW(t,e){var i=t.type,n=UW(t,e,t.getExtent()).calculate();t.setBlank(n.isBlank);var r=n.min,o=n.max,s=e.ecModel;if(s&&"time"===i){var a=hW("bar",s),l=!1;if(yE(a,(function(t){l=l||t.getBaseAxis()===e.axis})),l){var c=pW(a),u=function(t,e,i,n){var r=i.axis.getExtent(),o=r[1]-r[0],s=function(t,e,i){if(t&&e){var n=t[uW(e)];return null!=n&&null!=i?n[cW(i)]:n}}(n,i.axis);if(void 0===s)return{min:t,max:e};var a=1/0;yE(s,(function(t){a=Math.min(t.offset,a)}));var l=-1/0;yE(s,(function(t){l=Math.max(t.offset+t.width,l)})),a=Math.abs(a),l=Math.abs(l);var c=a+l,u=e-t,h=u/(1-(a+l)/o)-u;return e+=h*(l/c),t-=h*(a/c),{min:t,max:e}}(r,o,e,c);r=u.min,o=u.max}}return{extent:[r,o],fixMin:n.minFixed,fixMax:n.maxFixed}}function HW(t,e){var i=e,n=jW(t,i),r=n.extent,o=i.get("splitNumber");t instanceof BW&&(t.base=i.get("logBase"));var s=t.type,a=i.get("interval"),l="interval"===s||"time"===s;t.setExtent(r[0],r[1]),t.calcNiceExtent({splitNumber:o,fixMin:n.fixMin,fixMax:n.fixMax,minInterval:l?i.get("minInterval"):null,maxInterval:l?i.get("maxInterval"):null}),null!=a&&t.setInterval&&t.setInterval(a)}function WW(t,e){if(e=e||t.get("type"))switch(e){case"category":return new eW({ordinalMeta:t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),extent:[1/0,-1/0]});case"time":return new MW({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC")});default:return new(UH.getClass(e)||rW)}}function qW(t){var e,i,n=t.getLabelModel().get("formatter"),r="category"===t.type?t.scale.getExtent()[0]:null;return"time"===t.scale.type?(i=n,function(e,n){return t.scale.getFormattedLabel(e,n,i)}):ME(n)?function(e){return function(i){var n=t.scale.getLabel(i);return e.replace("{value}",null!=n?n:"")}}(n):SE(n)?(e=n,function(i,n){return null!=r&&(n=i.value-r),e(XW(t,i),n,null!=i.level?{level:i.level}:null)}):function(e){return t.scale.getLabel(e)}}function XW(t,e){return"category"===t.type?t.scale.getLabel(e):e.value}function ZW(t,e){var i=e*Math.PI/180,n=t.width,r=t.height,o=n*Math.abs(Math.cos(i))+Math.abs(r*Math.sin(i)),s=n*Math.abs(Math.sin(i))+Math.abs(r*Math.cos(i));return new pM(t.x,t.y,o,s)}function YW(t){var e=t.get("interval");return null==e?"auto":e}function QW(t){return"category"===t.type&&0===YW(t.getLabelModel())}function JW(t,e){var i={};return yE(t.mapDimensionsAll(e),(function(e){i[zH(t,e)]=!0})),bE(i)}var KW=function(){function t(){}return t.prototype.getNeedCrossZero=function(){return!this.option.scale},t.prototype.getCoordSysModel=function(){},t}(),$W=1e-8;function tq(t,e){return Math.abs(t-e)<$W}function eq(t,e,i){var n=0,r=t[0];if(!r)return!1;for(var o=1;o<t.length;o++){var s=t[o];n+=sD(r[0],r[1],s[0],s[1],e,i),r=s}var a=t[0];return tq(r[0],a[0])&&tq(r[1],a[1])||(n+=sD(r[0],r[1],a[0],a[1],e,i)),0!==n}var iq=[];function nq(t,e){for(var i=0;i<t.length;i++)gS(t[i],t[i],e)}function rq(t,e,i,n){for(var r=0;r<t.length;r++){var o=t[r];n&&(o=n.project(o)),o&&isFinite(o[0])&&isFinite(o[1])&&(yS(e,e,o),vS(i,i,o))}}var oq=function(){function t(t){this.name=t}return t.prototype.setCenter=function(t){this._center=t},t.prototype.getCenter=function(){var t=this._center;return t||(t=this._center=this.calcCenter()),t},t}(),sq=function(t,e){this.type="polygon",this.exterior=t,this.interiors=e},aq=function(t){this.type="linestring",this.points=t},lq=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.type="geoJSON",r.geometries=i,r._center=n&&[n[0],n[1]],r}return zA(e,t),e.prototype.calcCenter=function(){for(var t,e=this.geometries,i=0,n=0;n<e.length;n++){var r=e[n],o=r.exterior,s=o&&o.length;s>i&&(t=r,i=s)}if(t)return function(t){for(var e=0,i=0,n=0,r=t.length,o=t[r-1][0],s=t[r-1][1],a=0;a<r;a++){var l=t[a][0],c=t[a][1],u=o*c-l*s;e+=u,i+=(o+l)*u,n+=(s+c)*u,o=l,s=c}return e?[i/e/3,n/e/3,e]:[t[0][0]||0,t[0][1]||0]}(t.exterior);var a=this.getBoundingRect();return[a.x+a.width/2,a.y+a.height/2]},e.prototype.getBoundingRect=function(t){var e=this._rect;if(e&&!t)return e;var i=[1/0,1/0],n=[-1/0,-1/0];return yE(this.geometries,(function(e){"polygon"===e.type?rq(e.exterior,i,n,t):yE(e.points,(function(e){rq(e,i,n,t)}))})),isFinite(i[0])&&isFinite(i[1])&&isFinite(n[0])&&isFinite(n[1])||(i[0]=i[1]=n[0]=n[1]=0),e=new pM(i[0],i[1],n[0]-i[0],n[1]-i[1]),t||(this._rect=e),e},e.prototype.contain=function(t){var e=this.getBoundingRect(),i=this.geometries;if(!e.contain(t[0],t[1]))return!1;t:for(var n=0,r=i.length;n<r;n++){var o=i[n];if("polygon"===o.type){var s=o.exterior,a=o.interiors;if(eq(s,t[0],t[1])){for(var l=0;l<(a?a.length:0);l++)if(eq(a[l],t[0],t[1]))continue t;return!0}}}return!1},e.prototype.transformTo=function(t,e,i,n){var r=this.getBoundingRect(),o=r.width/r.height;i?n||(n=i/o):i=o*n;for(var s=new pM(t,e,i,n),a=r.calculateTransform(s),l=this.geometries,c=0;c<l.length;c++){var u=l[c];"polygon"===u.type?(nq(u.exterior,a),yE(u.interiors,(function(t){nq(t,a)}))):yE(u.points,(function(t){nq(t,a)}))}(r=this._rect).copy(s),this._center=[r.x+r.width/2,r.y+r.height/2]},e.prototype.cloneShallow=function(t){null==t&&(t=this.name);var i=new e(t,this.geometries,this._center);return i._rect=this._rect,i.transformTo=null,i},e}(oq),cq=function(t){function e(e,i){var n=t.call(this,e)||this;return n.type="geoSVG",n._elOnlyForCalculate=i,n}return zA(e,t),e.prototype.calcCenter=function(){for(var t=this._elOnlyForCalculate,e=t.getBoundingRect(),i=[e.x+e.width/2,e.y+e.height/2],n=ZS(iq),r=t;r&&!r.isGeoSVGGraphicRoot;)QS(n,r.getLocalTransform(),n),r=r.parent;return tM(n,n),gS(i,i,n),i},e}(oq);function uq(t,e,i){for(var n=0;n<t.length;n++)t[n]=hq(t[n],e[n],i)}function hq(t,e,i){for(var n=[],r=e[0],o=e[1],s=0;s<t.length;s+=2){var a=t.charCodeAt(s)-64,l=t.charCodeAt(s+1)-64;a=a>>1^-(1&a),l=l>>1^-(1&l),r=a+=r,o=l+=o,n.push([a/i,l/i])}return n}function pq(t,e){return t=function(t){if(!t.UTF8Encoding)return t;var e=t,i=e.UTF8Scale;return null==i&&(i=1024),yE(e.features,(function(t){var e=t.geometry,n=e.encodeOffsets,r=e.coordinates;if(n)switch(e.type){case"LineString":e.coordinates=hq(r,n,i);break;case"Polygon":case"MultiLineString":uq(r,n,i);break;case"MultiPolygon":yE(r,(function(t,e){return uq(t,n[e],i)}))}})),e.UTF8Encoding=!1,e}(t),vE(xE(t.features,(function(t){return t.geometry&&t.properties&&t.geometry.coordinates.length>0})),(function(t){var i=t.properties,n=t.geometry,r=[];switch(n.type){case"Polygon":var o=n.coordinates;r.push(new sq(o[0],o.slice(1)));break;case"MultiPolygon":yE(n.coordinates,(function(t){t[0]&&r.push(new sq(t[0],t.slice(1)))}));break;case"LineString":r.push(new aq([n.coordinates]));break;case"MultiLineString":r.push(new aq(n.coordinates))}var s=new lq(i[e||"name"],r,i.cp);return s.properties=i,s}))}var dq=wP();function fq(t){return"category"===t.type?function(t){var e=t.getLabelModel(),i=gq(t,e);return!e.get("show")||t.scale.isBlank()?{labels:[],labelCategoryInterval:i.labelCategoryInterval}:i}(t):function(t){var e=t.scale.getTicks(),i=qW(t);return{labels:vE(e,(function(e,n){return{level:e.level,formattedLabel:i(e,n),rawLabel:t.scale.getLabel(e),tickValue:e.value}}))}}(t)}function mq(t,e){return"category"===t.type?function(t,e){var i,n,r=yq(t,"ticks"),o=YW(e),s=vq(r,o);if(s)return s;e.get("show")&&!t.scale.isBlank()||(i=[]);if(SE(o))i=bq(t,o,!0);else if("auto"===o){var a=gq(t,t.getLabelModel());n=a.labelCategoryInterval,i=vE(a.labels,(function(t){return t.tickValue}))}else i=xq(t,n=o,!0);return _q(r,o,{ticks:i,tickCategoryInterval:n})}(t,e):{ticks:vE(t.scale.getTicks(),(function(t){return t.value}))}}function gq(t,e){var i,n,r=yq(t,"labels"),o=YW(e),s=vq(r,o);return s||(SE(o)?i=bq(t,o):(n="auto"===o?function(t){var e=dq(t).autoInterval;return null!=e?e:dq(t).autoInterval=t.calculateCategoryInterval()}(t):o,i=xq(t,n)),_q(r,o,{labels:i,labelCategoryInterval:n}))}function yq(t,e){return dq(t)[e]||(dq(t)[e]=[])}function vq(t,e){for(var i=0;i<t.length;i++)if(t[i].key===e)return t[i].value}function _q(t,e,i){return t.push({key:e,value:i}),i}function xq(t,e,i){var n=qW(t),r=t.scale,o=r.getExtent(),s=t.getLabelModel(),a=[],l=Math.max((e||0)+1,1),c=o[0],u=r.count();0!==c&&l>1&&u/l>2&&(c=Math.round(Math.ceil(c/l)*l));var h=QW(t),p=s.get("showMinLabel")||h,d=s.get("showMaxLabel")||h;p&&c!==o[0]&&m(o[0]);for(var f=c;f<=o[1];f+=l)m(f);function m(t){var e={value:t};a.push(i?t:{formattedLabel:n(e),rawLabel:r.getLabel(e),tickValue:t})}return d&&f-l!==o[1]&&m(o[1]),a}function bq(t,e,i){var n=t.scale,r=qW(t),o=[];return yE(n.getTicks(),(function(t){var s=n.getLabel(t),a=t.value;e(t.value,s)&&o.push(i?a:{formattedLabel:r(t),rawLabel:s,tickValue:a})})),o}var wq=[0,1],Aq=function(){function t(t,e,i){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=e,this._extent=i||[0,0]}return t.prototype.contain=function(t){var e=this._extent,i=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return t>=i&&t<=n},t.prototype.containData=function(t){return this.scale.contain(t)},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.getPixelPrecision=function(t){return RC(t||this.scale.getExtent(),this._extent)},t.prototype.setExtent=function(t,e){var i=this._extent;i[0]=t,i[1]=e},t.prototype.dataToCoord=function(t,e){var i=this._extent,n=this.scale;return t=n.normalize(t),this.onBand&&"ordinal"===n.type&&Eq(i=i.slice(),n.count()),TC(t,wq,i,e)},t.prototype.coordToData=function(t,e){var i=this._extent,n=this.scale;this.onBand&&"ordinal"===n.type&&Eq(i=i.slice(),n.count());var r=TC(t,i,wq,e);return this.scale.scale(r)},t.prototype.pointToData=function(t,e){},t.prototype.getTicksCoords=function(t){var e=(t=t||{}).tickModel||this.getTickModel(),i=vE(mq(this,e).ticks,(function(t){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawOrdinalNumber(t):t),tickValue:t}}),this);return function(t,e,i,n){var r=e.length;if(!t.onBand||i||!r)return;var o,s,a=t.getExtent();if(1===r)e[0].coord=a[0],o=e[1]={coord:a[1]};else{var l=e[r-1].tickValue-e[0].tickValue,c=(e[r-1].coord-e[0].coord)/l;yE(e,(function(t){t.coord-=c/2})),s=1+t.scale.getExtent()[1]-e[r-1].tickValue,o={coord:e[r-1].coord+c*s},e.push(o)}var u=a[0]>a[1];h(e[0].coord,a[0])&&(n?e[0].coord=a[0]:e.shift());n&&h(a[0],e[0].coord)&&e.unshift({coord:a[0]});h(a[1],o.coord)&&(n?o.coord=a[1]:e.pop());n&&h(o.coord,a[1])&&e.push({coord:a[1]});function h(t,e){return t=CC(t),e=CC(e),u?t>e:t<e}}(this,i,e.get("alignWithLabel"),t.clamp),i},t.prototype.getMinorTicksCoords=function(){if("ordinal"===this.scale.type)return[];var t=this.model.getModel("minorTick").get("splitNumber");return t>0&&t<100||(t=5),vE(this.scale.getMinorTicks(t),(function(t){return vE(t,(function(t){return{coord:this.dataToCoord(t),tickValue:t}}),this)}),this)},t.prototype.getViewLabels=function(){return fq(this).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},t.prototype.getBandWidth=function(){var t=this._extent,e=this.scale.getExtent(),i=e[1]-e[0]+(this.onBand?1:0);0===i&&(i=1);var n=Math.abs(t[1]-t[0]);return Math.abs(n)/i},t.prototype.calculateCategoryInterval=function(){return function(t){var e=function(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}(t),i=qW(t),n=(e.axisRotate-e.labelRotate)/180*Math.PI,r=t.scale,o=r.getExtent(),s=r.count();if(o[1]-o[0]<1)return 0;var a=1;s>40&&(a=Math.max(1,Math.floor(s/40)));for(var l=o[0],c=t.dataToCoord(l+1)-t.dataToCoord(l),u=Math.abs(c*Math.cos(n)),h=Math.abs(c*Math.sin(n)),p=0,d=0;l<=o[1];l+=a){var f,m,g=iC(i({value:l}),e.font,"center","top");f=1.3*g.width,m=1.3*g.height,p=Math.max(p,f,7),d=Math.max(d,m,7)}var y=p/u,v=d/h;isNaN(y)&&(y=1/0),isNaN(v)&&(v=1/0);var _=Math.max(0,Math.floor(Math.min(y,v))),x=dq(t.model),b=t.getExtent(),w=x.lastAutoInterval,A=x.lastTickCount;return null!=w&&null!=A&&Math.abs(w-_)<=1&&Math.abs(A-s)<=1&&w>_&&x.axisExtent0===b[0]&&x.axisExtent1===b[1]?_=w:(x.lastTickCount=s,x.lastAutoInterval=_,x.axisExtent0=b[0],x.axisExtent1=b[1]),_}(this)},t}();function Eq(t,e){var i=(t[1]-t[0])/e/2;t[0]+=i,t[1]-=i}var Sq=Aq,Mq=2*Math.PI,Tq=KL.CMD,Iq=["top","right","bottom","left"];function Cq(t,e,i,n,r){var o=i.width,s=i.height;switch(t){case"top":n.set(i.x+o/2,i.y-e),r.set(0,-1);break;case"bottom":n.set(i.x+o/2,i.y+s+e),r.set(0,1);break;case"left":n.set(i.x-e,i.y+s/2),r.set(-1,0);break;case"right":n.set(i.x+o+e,i.y+s/2),r.set(1,0)}}function Pq(t,e,i,n,r,o,s,a,l){s-=t,a-=e;var c=Math.sqrt(s*s+a*a),u=(s/=c)*i+t,h=(a/=c)*i+e;if(Math.abs(n-r)%Mq<1e-4)return l[0]=u,l[1]=h,c-i;if(o){var p=n;n=nD(r),r=nD(p)}else n=nD(n),r=nD(r);n>r&&(r+=Mq);var d=Math.atan2(a,s);if(d<0&&(d+=Mq),d>=n&&d<=r||d+Mq>=n&&d+Mq<=r)return l[0]=u,l[1]=h,c-i;var f=i*Math.cos(n)+t,m=i*Math.sin(n)+e,g=i*Math.cos(r)+t,y=i*Math.sin(r)+e,v=(f-s)*(f-s)+(m-a)*(m-a),_=(g-s)*(g-s)+(y-a)*(y-a);return v<_?(l[0]=f,l[1]=m,Math.sqrt(v)):(l[0]=g,l[1]=y,Math.sqrt(_))}function Lq(t,e,i,n,r,o,s,a){var l=r-t,c=o-e,u=i-t,h=n-e,p=Math.sqrt(u*u+h*h),d=(l*(u/=p)+c*(h/=p))/p;a&&(d=Math.min(Math.max(d,0),1)),d*=p;var f=s[0]=t+d*u,m=s[1]=e+d*h;return Math.sqrt((f-r)*(f-r)+(m-o)*(m-o))}function Dq(t,e,i,n,r,o,s){i<0&&(t+=i,i=-i),n<0&&(e+=n,n=-n);var a=t+i,l=e+n,c=s[0]=Math.min(Math.max(r,t),a),u=s[1]=Math.min(Math.max(o,e),l);return Math.sqrt((c-r)*(c-r)+(u-o)*(u-o))}var Rq=[];function Oq(t,e,i){var n=Dq(e.x,e.y,e.width,e.height,t.x,t.y,Rq);return i.set(Rq[0],Rq[1]),n}function kq(t,e,i){for(var n,r,o=0,s=0,a=0,l=0,c=1/0,u=e.data,h=t.x,p=t.y,d=0;d<u.length;){var f=u[d++];1===d&&(a=o=u[d],l=s=u[d+1]);var m=c;switch(f){case Tq.M:o=a=u[d++],s=l=u[d++];break;case Tq.L:m=Lq(o,s,u[d],u[d+1],h,p,Rq,!0),o=u[d++],s=u[d++];break;case Tq.C:m=rT(o,s,u[d++],u[d++],u[d++],u[d++],u[d],u[d+1],h,p,Rq),o=u[d++],s=u[d++];break;case Tq.Q:m=uT(o,s,u[d++],u[d++],u[d],u[d+1],h,p,Rq),o=u[d++],s=u[d++];break;case Tq.A:var g=u[d++],y=u[d++],v=u[d++],_=u[d++],x=u[d++],b=u[d++];d+=1;var w=!!(1-u[d++]);n=Math.cos(x)*v+g,r=Math.sin(x)*_+y,d<=1&&(a=n,l=r),m=Pq(g,y,_,x,x+b,w,(h-g)*_/v+g,p,Rq),o=Math.cos(x+b)*v+g,s=Math.sin(x+b)*_+y;break;case Tq.R:m=Dq(a=o=u[d++],l=s=u[d++],u[d++],u[d++],h,p,Rq);break;case Tq.Z:m=Lq(o,s,a,l,h,p,Rq,!0),o=a,s=l}m<c&&(c=m,i.set(Rq[0],Rq[1]))}return c}var Nq=new iM,Bq=new iM,zq=new iM,Fq=new iM,Vq=new iM;function Uq(t,e){if(t){var i=t.getTextGuideLine(),n=t.getTextContent();if(n&&i){var r=t.textGuideLineConfig||{},o=[[0,0],[0,0],[0,0]],s=r.candidates||Iq,a=n.getBoundingRect().clone();a.applyTransform(n.getComputedTransform());var l=1/0,c=r.anchor,u=t.getComputedTransform(),h=u&&tM([],u),p=e.get("length2")||0;c&&zq.copy(c);for(var d=0;d<s.length;d++){Cq(s[d],0,a,Nq,Fq),iM.scaleAndAdd(Bq,Nq,Fq,p),Bq.transform(h);var f=t.getBoundingRect(),m=c?c.distance(Bq):t instanceof xD?kq(Bq,t.path,zq):Oq(Bq,f,zq);m<l&&(l=m,Bq.transform(u),zq.transform(u),zq.toArray(o[0]),Bq.toArray(o[1]),Nq.toArray(o[2]))}Hq(o,e.get("minTurnAngle")),i.setShape({points:o})}}}var Gq=[],jq=new iM;function Hq(t,e){if(e<=180&&e>0){e=e/180*Math.PI,Nq.fromArray(t[0]),Bq.fromArray(t[1]),zq.fromArray(t[2]),iM.sub(Fq,Nq,Bq),iM.sub(Vq,zq,Bq);var i=Fq.len(),n=Vq.len();if(!(i<.001||n<.001)){Fq.scale(1/i),Vq.scale(1/n);var r=Fq.dot(Vq);if(Math.cos(e)<r){var o=Lq(Bq.x,Bq.y,zq.x,zq.y,Nq.x,Nq.y,Gq,!1);jq.fromArray(Gq),jq.scaleAndAdd(Vq,o/Math.tan(Math.PI-e));var s=zq.x!==Bq.x?(jq.x-Bq.x)/(zq.x-Bq.x):(jq.y-Bq.y)/(zq.y-Bq.y);if(isNaN(s))return;s<0?iM.copy(jq,Bq):s>1&&iM.copy(jq,zq),jq.toArray(t[1])}}}}function Wq(t,e,i){if(i<=180&&i>0){i=i/180*Math.PI,Nq.fromArray(t[0]),Bq.fromArray(t[1]),zq.fromArray(t[2]),iM.sub(Fq,Bq,Nq),iM.sub(Vq,zq,Bq);var n=Fq.len(),r=Vq.len();if(!(n<.001||r<.001))if(Fq.scale(1/n),Vq.scale(1/r),Fq.dot(e)<Math.cos(i)){var o=Lq(Bq.x,Bq.y,zq.x,zq.y,Nq.x,Nq.y,Gq,!1);jq.fromArray(Gq);var s=Math.PI/2,a=s+Math.acos(Vq.dot(e))-i;if(a>=s)iM.copy(jq,zq);else{jq.scaleAndAdd(Vq,o/Math.tan(Math.PI/2-a));var l=zq.x!==Bq.x?(jq.x-Bq.x)/(zq.x-Bq.x):(jq.y-Bq.y)/(zq.y-Bq.y);if(isNaN(l))return;l<0?iM.copy(jq,Bq):l>1&&iM.copy(jq,zq)}jq.toArray(t[1])}}}function qq(t,e,i,n){var r="normal"===i,o=r?t:t.ensureState(i);o.ignore=e;var s=n.get("smooth");s&&!0===s&&(s=.3),o.shape=o.shape||{},s>0&&(o.shape.smooth=s);var a=n.getModel("lineStyle").getLineStyle();r?t.useStyle(a):o.style=a}function Xq(t,e){var i=e.smooth,n=e.points;if(n)if(t.moveTo(n[0][0],n[0][1]),i>0&&n.length>=3){var r=dS(n[0],n[1]),o=dS(n[1],n[2]);if(!r||!o)return t.lineTo(n[1][0],n[1][1]),void t.lineTo(n[2][0],n[2][1]);var s=Math.min(r,o)*i,a=mS([],n[1],n[0],s/r),l=mS([],n[1],n[2],s/o),c=mS([],a,l,.5);t.bezierCurveTo(a[0],a[1],a[0],a[1],c[0],c[1]),t.bezierCurveTo(l[0],l[1],l[0],l[1],n[2][0],n[2][1])}else for(var u=1;u<n.length;u++)t.lineTo(n[u][0],n[u][1])}function Zq(t,e,i){var n=t.getTextGuideLine(),r=t.getTextContent();if(r){for(var o=e.normal,s=o.get("show"),a=r.ignore,l=0;l<lR.length;l++){var c=lR[l],u=e[c],h="normal"===c;if(u){var p=u.get("show");if((h?a:BE(r.states[c]&&r.states[c].ignore,a))||!BE(p,s)){var d=h?n:n&&n.states[c];d&&(d.ignore=!0);continue}n||(n=new $O,t.setTextGuideLine(n),h||!a&&s||qq(n,!0,"normal",e.normal),t.stateProxy&&(n.stateProxy=t.stateProxy)),qq(n,!1,c,u)}}if(n){dE(n.style,i),n.style.fill=null;var f=o.get("showAbove");(t.textGuideLineConfig=t.textGuideLineConfig||{}).showAbove=f||!1,n.buildPath=Xq}}else n&&t.removeTextGuideLine()}function Yq(t,e){e=e||"labelLine";for(var i={normal:t.getModel(e)},n=0;n<aR.length;n++){var r=aR[n];i[r]=t.getModel([r,e])}return i}function Qq(t){for(var e=[],i=0;i<t.length;i++){var n=t[i];if(!n.defaultAttr.ignore){var r=n.label,o=r.getComputedTransform(),s=r.getBoundingRect(),a=!o||o[1]<1e-5&&o[2]<1e-5,l=r.style.margin||0,c=s.clone();c.applyTransform(o),c.x-=l/2,c.y-=l/2,c.width+=l,c.height+=l;var u=a?new Ak(s,o):null;e.push({label:r,labelLine:n.labelLine,rect:c,localRect:s,obb:u,priority:n.priority,defaultAttr:n.defaultAttr,layoutOption:n.computedLayoutOption,axisAligned:a,transform:o})}}return e}function Jq(t,e,i,n,r,o){var s=t.length;if(!(s<2)){t.sort((function(t,i){return t.rect[e]-i.rect[e]}));for(var a,l=0,c=!1,u=0,h=0;h<s;h++){var p=t[h],d=p.rect;(a=d[e]-l)<0&&(d[e]-=a,p.label[e]-=a,c=!0),u+=Math.max(-a,0),l=d[e]+d[i]}u>0&&o&&x(-u/s,0,s);var f,m,g=t[0],y=t[s-1];return v(),f<0&&b(-f,.8),m<0&&b(m,.8),v(),_(f,m,1),_(m,f,-1),v(),f<0&&w(-f),m<0&&w(m),c}function v(){f=g.rect[e]-n,m=r-y.rect[e]-y.rect[i]}function _(t,e,i){if(t<0){var n=Math.min(e,-t);if(n>0){x(n*i,0,s);var r=n+t;r<0&&b(-r*i,1)}else b(-t*i,1)}}function x(i,n,r){0!==i&&(c=!0);for(var o=n;o<r;o++){var s=t[o];s.rect[e]+=i,s.label[e]+=i}}function b(n,r){for(var o=[],a=0,l=1;l<s;l++){var c=t[l-1].rect,u=Math.max(t[l].rect[e]-c[e]-c[i],0);o.push(u),a+=u}if(a){var h=Math.min(Math.abs(n)/a,r);if(n>0)for(l=0;l<s-1;l++){x(o[l]*h,0,l+1)}else for(l=s-1;l>0;l--){x(-(o[l-1]*h),l,s)}}}function w(t){var e=t<0?-1:1;t=Math.abs(t);for(var i=Math.ceil(t/(s-1)),n=0;n<s-1;n++)if(e>0?x(i,0,n+1):x(-i,s-n-1,s),(t-=i)<=0)return}}function Kq(t,e,i,n){return Jq(t,"y","height",e,i,n)}function $q(t){var e=[];t.sort((function(t,e){return e.priority-t.priority}));var i=new pM(0,0,0,0);function n(t){if(!t.ignore){var e=t.ensureState("emphasis");null==e.ignore&&(e.ignore=!1)}t.ignore=!0}for(var r=0;r<t.length;r++){var o=t[r],s=o.axisAligned,a=o.localRect,l=o.transform,c=o.label,u=o.labelLine;i.copy(o.rect),i.width-=.1,i.height-=.1,i.x+=.05,i.y+=.05;for(var h=o.obb,p=!1,d=0;d<e.length;d++){var f=e[d];if(i.intersect(f.rect)){if(s&&f.axisAligned){p=!0;break}if(f.obb||(f.obb=new Ak(f.localRect,f.transform)),h||(h=new Ak(a,l)),h.intersect(f.obb)){p=!0;break}}}p?(n(c),u&&n(u)):(c.attr("ignore",o.defaultAttr.ignore),u&&u.attr("ignore",o.defaultAttr.labelGuideIgnore),e.push(o))}}function tX(t){if(t){for(var e=[],i=0;i<t.length;i++)e.push(t[i].slice());return e}}function eX(t,e){var i=t.label,n=e&&e.getTextGuideLine();return{dataIndex:t.dataIndex,dataType:t.dataType,seriesIndex:t.seriesModel.seriesIndex,text:t.label.style.text,rect:t.hostRect,labelRect:t.rect,align:i.style.align,verticalAlign:i.style.verticalAlign,labelLinePoints:tX(n&&n.shape.points)}}var iX=["align","verticalAlign","width","height","fontSize"],nX=new KI,rX=wP(),oX=wP();function sX(t,e,i){for(var n=0;n<i.length;n++){var r=i[n];null!=e[r]&&(t[r]=e[r])}}var aX=["x","y","rotation"],lX=function(){function t(){this._labelList=[],this._chartViewList=[]}return t.prototype.clearLabels=function(){this._labelList=[],this._chartViewList=[]},t.prototype._addLabel=function(t,e,i,n,r){var o=n.style,s=n.__hostTarget.textConfig||{},a=n.getComputedTransform(),l=n.getBoundingRect().plain();pM.applyTransform(l,l,a),a?nX.setLocalTransform(a):(nX.x=nX.y=nX.rotation=nX.originX=nX.originY=0,nX.scaleX=nX.scaleY=1),nX.rotation=nD(nX.rotation);var c,u=n.__hostTarget;if(u){c=u.getBoundingRect().plain();var h=u.getComputedTransform();pM.applyTransform(c,c,h)}var p=c&&u.getTextGuideLine();this._labelList.push({label:n,labelLine:p,seriesModel:i,dataIndex:t,dataType:e,layoutOption:r,computedLayoutOption:null,rect:l,hostRect:c,priority:c?c.width*c.height:0,defaultAttr:{ignore:n.ignore,labelGuideIgnore:p&&p.ignore,x:nX.x,y:nX.y,scaleX:nX.scaleX,scaleY:nX.scaleY,rotation:nX.rotation,style:{x:o.x,y:o.y,align:o.align,verticalAlign:o.verticalAlign,width:o.width,height:o.height,fontSize:o.fontSize},cursor:n.cursor,attachedPos:s.position,attachedRot:s.rotation}})},t.prototype.addLabelsOfSeries=function(t){var e=this;this._chartViewList.push(t);var i=t.__model,n=i.get("labelLayout");(SE(n)||bE(n).length)&&t.group.traverse((function(t){if(t.ignore)return!0;var r=t.getTextContent(),o=KD(t);r&&!r.disableLabelLayout&&e._addLabel(o.dataIndex,o.dataType,i,r,n)}))},t.prototype.updateLayoutConfig=function(t){var e=t.getWidth(),i=t.getHeight();function n(t,e){return function(){Uq(t,e)}}for(var r=0;r<this._labelList.length;r++){var o=this._labelList[r],s=o.label,a=s.__hostTarget,l=o.defaultAttr,c=void 0;c=(c=SE(o.layoutOption)?o.layoutOption(eX(o,a)):o.layoutOption)||{},o.computedLayoutOption=c;var u=Math.PI/180;a&&a.setTextConfig({local:!1,position:null!=c.x||null!=c.y?null:l.attachedPos,rotation:null!=c.rotate?c.rotate*u:l.attachedRot,offset:[c.dx||0,c.dy||0]});var h=!1;if(null!=c.x?(s.x=IC(c.x,e),s.setStyle("x",0),h=!0):(s.x=l.x,s.setStyle("x",l.style.x)),null!=c.y?(s.y=IC(c.y,i),s.setStyle("y",0),h=!0):(s.y=l.y,s.setStyle("y",l.style.y)),c.labelLinePoints){var p=a.getTextGuideLine();p&&(p.setShape({points:c.labelLinePoints}),h=!1)}rX(s).needsUpdateLabelLine=h,s.rotation=null!=c.rotate?c.rotate*u:l.rotation,s.scaleX=l.scaleX,s.scaleY=l.scaleY;for(var d=0;d<iX.length;d++){var f=iX[d];s.setStyle(f,null!=c[f]?c[f]:l.style[f])}if(c.draggable){if(s.draggable=!0,s.cursor="move",a){var m=o.seriesModel;if(null!=o.dataIndex)m=o.seriesModel.getData(o.dataType).getItemModel(o.dataIndex);s.on("drag",n(a,m.getModel("labelLine")))}}else s.off("drag"),s.cursor=l.cursor}},t.prototype.layout=function(t){var e,i=t.getWidth(),n=t.getHeight(),r=Qq(this._labelList),o=xE(r,(function(t){return"shiftX"===t.layoutOption.moveOverlap})),s=xE(r,(function(t){return"shiftY"===t.layoutOption.moveOverlap}));Jq(o,"x","width",0,i,e),Kq(s,0,n),$q(xE(r,(function(t){return t.layoutOption.hideOverlap})))},t.prototype.processLabelsOverall=function(){var t=this;yE(this._chartViewList,(function(e){var i=e.__model,n=e.ignoreLabelLineUpdate,r=i.isAnimationEnabled();e.group.traverse((function(e){if(e.ignore&&!e.forceLabelAnimation)return!0;var o=!n,s=e.getTextContent();!o&&s&&(o=rX(s).needsUpdateLabelLine),o&&t._updateLabelLine(e,i),r&&t._animateLabels(e,i)}))}))},t.prototype._updateLabelLine=function(t,e){var i=t.getTextContent(),n=KD(t),r=n.dataIndex;if(i&&null!=r){var o=e.getData(n.dataType),s=o.getItemModel(r),a={},l=o.getItemVisual(r,"style");if(l){var c=o.getVisual("drawType");a.stroke=l[c]}var u=s.getModel("labelLine");Zq(t,Yq(s),a),Uq(t,u)}},t.prototype._animateLabels=function(t,e){var i=t.getTextContent(),n=t.getTextGuideLine();if(i&&(t.forceLabelAnimation||!i.ignore&&!i.invisible&&!t.disableLabelAnimation&&!Dk(t))){var r=(d=rX(i)).oldLayout,o=KD(t),s=o.dataIndex,a={x:i.x,y:i.y,rotation:i.rotation},l=e.getData(o.dataType);if(r){i.attr(r);var c=t.prevStates;c&&(fE(c,"select")>=0&&i.attr(d.oldLayoutSelect),fE(c,"emphasis")>=0&&i.attr(d.oldLayoutEmphasis)),Pk(i,a,e,s)}else if(i.attr(a),!wN(i).valueAnimation){var u=BE(i.style.opacity,1);i.style.opacity=0,Lk(i,{style:{opacity:u}},e,s)}if(d.oldLayout=a,i.states.select){var h=d.oldLayoutSelect={};sX(h,a,aX),sX(h,i.states.select,aX)}if(i.states.emphasis){var p=d.oldLayoutEmphasis={};sX(p,a,aX),sX(p,i.states.emphasis,aX)}EN(i,s,l,e,e)}if(n&&!n.ignore&&!n.invisible){r=(d=oX(n)).oldLayout;var d,f={points:n.shape.points};r?(n.attr({shape:r}),Pk(n,{shape:f},e)):(n.setShape(f),n.style.strokePercent=0,Lk(n,{style:{strokePercent:1}},e)),d.oldLayout=f}},t}(),cX=lX,uX=wP();var hX=Math.sin,pX=Math.cos,dX=Math.PI,fX=2*Math.PI,mX=180/dX,gX=function(){function t(){}return t.prototype.reset=function(t){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,t||4)},t.prototype.moveTo=function(t,e){this._add("M",t,e)},t.prototype.lineTo=function(t,e){this._add("L",t,e)},t.prototype.bezierCurveTo=function(t,e,i,n,r,o){this._add("C",t,e,i,n,r,o)},t.prototype.quadraticCurveTo=function(t,e,i,n){this._add("Q",t,e,i,n)},t.prototype.arc=function(t,e,i,n,r,o){this.ellipse(t,e,i,i,0,n,r,o)},t.prototype.ellipse=function(t,e,i,n,r,o,s,a){var l=s-o,c=!a,u=Math.abs(l),h=GT(u-fX)||(c?l>=fX:-l>=fX),p=l>0?l%fX:l%fX+fX,d=!1;d=!!h||!GT(u)&&p>=dX==!!c;var f=t+i*pX(o),m=e+n*hX(o);this._start&&this._add("M",f,m);var g=Math.round(r*mX);if(h){var y=1/this._p,v=(c?1:-1)*(fX-y);this._add("A",i,n,g,1,+c,t+i*pX(o+v),e+n*hX(o+v)),y>.01&&this._add("A",i,n,g,0,+c,f,m)}else{var _=t+i*pX(s),x=e+n*hX(s);this._add("A",i,n,g,+d,+c,_,x)}},t.prototype.rect=function(t,e,i,n){this._add("M",t,e),this._add("l",i,0),this._add("l",0,n),this._add("l",-i,0),this._add("Z")},t.prototype.closePath=function(){this._d.length>0&&this._add("Z")},t.prototype._add=function(t,e,i,n,r,o,s,a,l){for(var c=[],u=this._p,h=1;h<arguments.length;h++){var p=arguments[h];if(isNaN(p))return void(this._invalid=!0);c.push(Math.round(p*u)/u)}this._d.push(t+c.join(" ")),this._start="Z"===t},t.prototype.generateStr=function(){this._str=this._invalid?"":this._d.join(""),this._d=[]},t.prototype.getStr=function(){return this._str},t}(),yX=gX,vX="none",_X=Math.round;var xX=["lineCap","miterLimit","lineJoin"],bX=vE(xX,(function(t){return"stroke-"+t.toLowerCase()}));function wX(t,e,i,n){var r=null==e.opacity?1:e.opacity;if(i instanceof TD)t("opacity",r);else{if(function(t){var e=t.fill;return null!=e&&e!==vX}(e)){var o=VT(e.fill);t("fill",o.color);var s=null!=e.fillOpacity?e.fillOpacity*o.opacity*r:o.opacity*r;(n||s<1)&&t("fill-opacity",s)}else t("fill",vX);if(function(t){var e=t.stroke;return null!=e&&e!==vX}(e)){var a=VT(e.stroke);t("stroke",a.color);var l=e.strokeNoScale?i.getLineScale():1,c=l?(e.lineWidth||0)/l:0,u=null!=e.strokeOpacity?e.strokeOpacity*a.opacity*r:a.opacity*r,h=e.strokeFirst;if((n||1!==c)&&t("stroke-width",c),(n||h)&&t("paint-order",h?"stroke":"fill"),(n||u<1)&&t("stroke-opacity",u),e.lineDash){var p=_G(i),d=p[0],f=p[1];d&&(f=_X(f||0),t("stroke-dasharray",d.join(",")),(f||n)&&t("stroke-dashoffset",f))}else n&&t("stroke-dasharray",vX);for(var m=0;m<xX.length;m++){var g=xX[m];if(n||e[g]!==gD[g]){var y=e[g]||gD[g];y&&t(bX[m],y)}}}else n&&t("stroke",vX)}}var AX="http://www.w3.org/2000/svg",EX="http://www.w3.org/1999/xlink",SX="http://www.w3.org/2000/xmlns/",MX="http://www.w3.org/XML/1998/namespace";function TX(t){return document.createElementNS(AX,t)}function IX(t,e,i,n,r){return{tag:t,attrs:i||{},children:n,text:r,key:e}}function CX(t,e){var i=(e=e||{}).newline?"\n":"";return function t(e){var n=e.children,r=e.tag,o=e.attrs,s=e.text;return function(t,e){var i=[];if(e)for(var n in e){var r=e[n],o=n;!1!==r&&(!0!==r&&null!=r&&(o+='="'+r+'"'),i.push(o))}return"<"+t+" "+i.join(" ")+">"}(r,o)+("style"!==r?RS(s):s||"")+(n?""+i+vE(n,(function(e){return t(e)})).join(i)+i:"")+function(t){return"</"+t+">"}(r)}(t)}function PX(t){return{zrId:t,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssClassIdx:0,cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function LX(t,e,i,n){return IX("svg","root",{width:t,height:e,xmlns:AX,"xmlns:xlink":EX,version:"1.1",baseProfile:"full",viewBox:!!n&&"0 0 "+t+" "+e},i)}var DX={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},RX="transform-origin";function OX(t,e,i){var n=pE({},t.shape);pE(n,e),t.buildPath(i,n);var r=new yX;return r.reset(KT(t)),i.rebuildPath(r,1),r.generateStr(),r.getStr()}function kX(t,e){var i=e.originX,n=e.originY;(i||n)&&(t[RX]=i+"px "+n+"px")}var NX={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function BX(t,e){var i=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[i]=t,i}function zX(t){return ME(t)?DX[t]?"cubic-bezier("+DX[t]+")":dT(t)?t:"":""}function FX(t,e,i,n){var r=t.animators,o=r.length,s=[];if(t instanceof dk){var a=function(t,e,i){var n,r,o=t.shape.paths,s={};if(yE(o,(function(t){var e=PX(i.zrId);e.animation=!0,FX(t,{},e,!0);var o=e.cssAnims,a=e.cssNodes,l=bE(o),c=l.length;if(c){var u=o[r=l[c-1]];for(var h in u){var p=u[h];s[h]=s[h]||{d:""},s[h].d+=p.d||""}for(var d in a){var f=a[d].animation;f.indexOf(r)>=0&&(n=f)}}})),n){e.d=!1;var a=BX(s,i);return n.replace(r,a)}}(t,e,i);if(a)s.push(a);else if(!o)return}else if(!o)return;for(var l={},c=0;c<o;c++){var u=r[c],h=[u.getMaxTime()/1e3+"s"],p=zX(u.getClip().easing),d=u.getDelay();p?h.push(p):h.push("linear"),d&&h.push(d/1e3+"s"),u.getLoop()&&h.push("infinite");var f=h.join(" ");l[f]=l[f]||[f,[]],l[f][1].push(u)}function m(r){var o,s=r[1],a=s.length,l={},c={},u={},h="animation-timing-function";function p(t,e,i){for(var n=t.getTracks(),r=t.getMaxTime(),o=0;o<n.length;o++){var s=n[o];if(s.needsAnimate()){var a=s.keyframes,l=s.propName;if(i&&(l=i(l)),l)for(var c=0;c<a.length;c++){var u=a[c],p=Math.round(u.time/r*100)+"%",d=zX(u.easing),f=u.rawValue;(ME(f)||IE(f))&&(e[p]=e[p]||{},e[p][l]=u.rawValue,d&&(e[p][h]=d))}}}}for(var d=0;d<a;d++){(A=(w=s[d]).targetName)?"shape"===A&&p(w,c):!n&&p(w,l)}for(var f in l){var m={};JI(m,t),pE(m,l[f]);var g=$T(m),y=l[f][h];u[f]=g?{transform:g}:{},kX(u[f],m),y&&(u[f][h]=y)}var v=!0;for(var f in c){u[f]=u[f]||{};var _=!o;y=c[f][h];_&&(o=new KL);var x=o.len();o.reset(),u[f].d=OX(t,c[f],o);var b=o.len();if(!_&&x!==b){v=!1;break}y&&(u[f][h]=y)}if(!v)for(var f in u)delete u[f].d;if(!n)for(d=0;d<a;d++){var w,A;"style"===(A=(w=s[d]).targetName)&&p(w,u,(function(t){return NX[t]}))}var E,S=bE(u),M=!0;for(d=1;d<S.length;d++){var T=S[d-1],I=S[d];if(u[T][RX]!==u[I][RX]){M=!1;break}E=u[T][RX]}if(M&&E){for(var f in u)u[f][RX]&&delete u[f][RX];e[RX]=E}if(xE(S,(function(t){return bE(u[t]).length>0})).length)return BX(u,i)+" "+r[0]+" both"}for(var g in l){(a=m(l[g]))&&s.push(a)}if(s.length){var y=i.zrId+"-cls-"+i.cssClassIdx++;i.cssNodes["."+y]={animation:s.join(",")},e.class=y}}var VX=Math.round;function UX(t){return t&&ME(t.src)}function GX(t){return t&&SE(t.toDataURL)}function jX(t,e,i,n){wX((function(r,o){var s="fill"===r||"stroke"===r;s&&QT(o)?$X(e,t,r,n):s&&XT(o)?tZ(i,t,r,n):t[r]=o}),e,i,!1),function(t,e,i){var n=t.style;if(function(t){return t&&(t.shadowBlur||t.shadowOffsetX||t.shadowOffsetY)}(n)){var r=function(t){var e=t.style,i=t.getGlobalScale();return[e.shadowColor,(e.shadowBlur||0).toFixed(2),(e.shadowOffsetX||0).toFixed(2),(e.shadowOffsetY||0).toFixed(2),i[0],i[1]].join(",")}(t),o=i.shadowCache,s=o[r];if(!s){var a=t.getGlobalScale(),l=a[0],c=a[1];if(!l||!c)return;var u=n.shadowOffsetX||0,h=n.shadowOffsetY||0,p=n.shadowBlur,d=VT(n.shadowColor),f=d.opacity,m=d.color,g=p/2/l+" "+p/2/c;s=i.zrId+"-s"+i.shadowIdx++,i.defs[s]=IX("filter",s,{id:s,x:"-100%",y:"-100%",width:"300%",height:"300%"},[IX("feDropShadow","",{dx:u/l,dy:h/c,stdDeviation:g,"flood-color":m,"flood-opacity":f})]),o[r]=s}e.filter=JT(s)}}(i,t,n)}function HX(t){return GT(t[0]-1)&>(t[1])&>(t[2])&>(t[3]-1)}function WX(t,e,i){if(e&&(!function(t){return GT(t[4])&>(t[5])}(e)||!HX(e))){var n=i?10:1e4;t.transform=HX(e)?"translate("+VX(e[4]*n)/n+" "+VX(e[5]*n)/n+")":function(t){return"matrix("+jT(t[0])+","+jT(t[1])+","+jT(t[2])+","+jT(t[3])+","+HT(t[4])+","+HT(t[5])+")"}(e)}}function qX(t,e,i){for(var n=t.points,r=[],o=0;o<n.length;o++)r.push(VX(n[o][0]*i)/i),r.push(VX(n[o][1]*i)/i);e.points=r.join(" ")}function XX(t){return!t.smooth}var ZX,YX,QX={circle:[(ZX=["cx","cy","r"],YX=vE(ZX,(function(t){return"string"==typeof t?[t,t]:t})),function(t,e,i){for(var n=0;n<YX.length;n++){var r=YX[n],o=t[r[0]];null!=o&&(e[r[1]]=VX(o*i)/i)}})],polyline:[qX,XX],polygon:[qX,XX]};function JX(t,e){var i=t.style,n=t.shape,r=QX[t.type],o={},s=e.animation,a="path",l=t.style.strokePercent,c=e.compress&&KT(t)||4;if(!r||e.willUpdate||r[1]&&!r[1](n)||s&&function(t){for(var e=t.animators,i=0;i<e.length;i++)if("shape"===e[i].targetName)return!0;return!1}(t)||l<1){var u=!t.path||t.shapeChanged();t.path||t.createPathProxy();var h=t.path;u&&(h.beginPath(),t.buildPath(h,t.shape),t.pathUpdated());var p=h.getVersion(),d=t,f=d.__svgPathBuilder;d.__svgPathVersion===p&&f&&l===d.__svgPathStrokePercent||(f||(f=d.__svgPathBuilder=new yX),f.reset(c),h.rebuildPath(f,l),f.generateStr(),d.__svgPathVersion=p,d.__svgPathStrokePercent=l),o.d=f.getStr()}else{a=t.type;var m=Math.pow(10,c);r[0](n,o,m)}return WX(o,t.transform),jX(o,i,t,e),e.animation&&FX(t,o,e),IX(a,t.id+"",o)}function KX(t,e){return t instanceof xD?JX(t,e):t instanceof TD?function(t,e){var i=t.style,n=i.image;if(n&&!ME(n)&&(UX(n)?n=n.src:GX(n)&&(n=n.toDataURL())),n){var r=i.x||0,o=i.y||0,s={href:n,width:i.width,height:i.height};return r&&(s.x=r),o&&(s.y=o),WX(s,t.transform),jX(s,i,t,e),e.animation&&FX(t,s,e),IX("image",t.id+"",s)}}(t,e):t instanceof AD?function(t,e){var i=t.style,n=i.text;if(null!=n&&(n+=""),n&&!isNaN(i.x)&&!isNaN(i.y)){var r=i.font||HA,o=i.x||0,s=function(t,e,i){return"top"===i?t+=e/2:"bottom"===i&&(t-=e/2),t}(i.y||0,oC(r),i.textBaseline),a={"dominant-baseline":"central","text-anchor":WT[i.textAlign]||i.textAlign};if(HD(i)){var l="",c=i.fontStyle,u=GD(i.fontSize);if(!parseFloat(u))return;var h=i.fontFamily||jA,p=i.fontWeight;l+="font-size:"+u+";font-family:"+h+";",c&&"normal"!==c&&(l+="font-style:"+c+";"),p&&"normal"!==p&&(l+="font-weight:"+p+";"),a.style=l}else a.style="font: "+r;return n.match(/\s/)&&(a["xml:space"]="preserve"),o&&(a.x=o),s&&(a.y=s),WX(a,t.transform),jX(a,i,t,e),e.animation&&FX(t,a,e),IX("text",t.id+"",a,void 0,n)}}(t,e):void 0}function $X(t,e,i,n){var r,o=t[i],s={gradientUnits:o.global?"userSpaceOnUse":"objectBoundingBox"};if(ZT(o))r="linearGradient",s.x1=o.x,s.y1=o.y,s.x2=o.x2,s.y2=o.y2;else{if(!YT(o))return void("production"!==process.env.NODE_ENV&&lE("Illegal gradient type."));r="radialGradient",s.cx=BE(o.x,.5),s.cy=BE(o.y,.5),s.r=BE(o.r,.5)}for(var a=o.colorStops,l=[],c=0,u=a.length;c<u;++c){var h=100*HT(a[c].offset)+"%",p=VT(a[c].color),d=p.color,f=p.opacity,m={offset:h};m["stop-color"]=d,f<1&&(m["stop-opacity"]=f),l.push(IX("stop",c+"",m))}var g=CX(IX(r,"",s,l)),y=n.gradientCache,v=y[g];v||(v=n.zrId+"-g"+n.gradientIdx++,y[g]=v,s.id=v,n.defs[v]=IX(r,v,s,l)),e[i]=JT(v)}function tZ(t,e,i,n){var r,o=t.style[i],s=t.getBoundingRect(),a={},l=o.repeat,c="no-repeat"===l,u="repeat-x"===l,h="repeat-y"===l;if(qT(o)){var p=o.imageWidth,d=o.imageHeight,f=void 0,m=o.image;if(ME(m)?f=m:UX(m)?f=m.src:GX(m)&&(f=m.toDataURL()),"undefined"==typeof Image){var g="Image width/height must been given explictly in svg-ssr renderer.";UE(p,g),UE(d,g)}else if(null==p||null==d){var y=function(t,e){if(t){var i=t.elm,n=p||e.width,r=d||e.height;"pattern"===t.tag&&(u?(r=1,n/=s.width):h&&(n=1,r/=s.height)),t.attrs.width=n,t.attrs.height=r,i&&(i.setAttribute("width",n),i.setAttribute("height",r))}},v=XP(f,null,t,(function(t){c||y(w,t),y(r,t)}));v&&v.width&&v.height&&(p=p||v.width,d=d||v.height)}r=IX("image","img",{href:f,width:p,height:d}),a.width=p,a.height=d}else o.svgElement&&(r=cE(o.svgElement),a.width=o.svgWidth,a.height=o.svgHeight);if(r){var _,x;c?_=x=1:u?(x=1,_=a.width/s.width):h?(_=1,x=a.height/s.height):a.patternUnits="userSpaceOnUse",null==_||isNaN(_)||(a.width=_),null==x||isNaN(x)||(a.height=x);var b=$T(o);b&&(a.patternTransform=b);var w=IX("pattern","",a,[r]),A=CX(w),E=n.patternCache,S=E[A];S||(S=n.zrId+"-p"+n.patternIdx++,E[A]=S,a.id=S,w=n.defs[S]=IX("pattern",S,a,[r])),e[i]=JT(S)}}function eZ(t,e,i){var n=i.clipPathCache,r=i.defs,o=n[t.id];if(!o){var s={id:o=i.zrId+"-c"+i.clipPathIdx++};n[t.id]=o,r[o]=IX("clipPath",o,s,[JX(t,i)])}e["clip-path"]=JT(o)}function iZ(t){return document.createTextNode(t)}function nZ(t,e,i){t.insertBefore(e,i)}function rZ(t,e){t.removeChild(e)}function oZ(t,e){t.appendChild(e)}function sZ(t){return t.parentNode}function aZ(t){return t.nextSibling}function lZ(t,e){t.textContent=e}var cZ=58,uZ=120,hZ=IX("","");function pZ(t){return void 0===t}function dZ(t){return void 0!==t}function fZ(t,e,i){for(var n={},r=e;r<=i;++r){var o=t[r].key;void 0!==o&&("production"!==process.env.NODE_ENV&&null!=n[o]&&console.error("Duplicate key "+o),n[o]=r)}return n}function mZ(t,e){var i=t.key===e.key;return t.tag===e.tag&&i}function gZ(t){var e,i=t.children,n=t.tag;if(dZ(n)){var r=t.elm=TX(n);if(_Z(hZ,t),EE(i))for(e=0;e<i.length;++e){var o=i[e];null!=o&&oZ(r,gZ(o))}else dZ(t.text)&&!CE(t.text)&&oZ(r,iZ(t.text))}else t.elm=iZ(t.text);return t.elm}function yZ(t,e,i,n,r){for(;n<=r;++n){var o=i[n];null!=o&&nZ(t,gZ(o),e)}}function vZ(t,e,i,n){for(;i<=n;++i){var r=e[i];if(null!=r)if(dZ(r.tag))rZ(sZ(r.elm),r.elm);else rZ(t,r.elm)}}function _Z(t,e){var i,n=e.elm,r=t&&t.attrs||{},o=e.attrs||{};if(r!==o){for(i in o){var s=o[i];r[i]!==s&&(!0===s?n.setAttribute(i,""):!1===s?n.removeAttribute(i):i.charCodeAt(0)!==uZ?n.setAttribute(i,s):"xmlns:xlink"===i||"xmlns"===i?n.setAttributeNS(SX,i,s):i.charCodeAt(3)===cZ?n.setAttributeNS(MX,i,s):i.charCodeAt(5)===cZ?n.setAttributeNS(EX,i,s):n.setAttribute(i,s))}for(i in r)i in o||n.removeAttribute(i)}}function xZ(t,e){var i=e.elm=t.elm,n=t.children,r=e.children;t!==e&&(_Z(t,e),pZ(e.text)?dZ(n)&&dZ(r)?n!==r&&function(t,e,i){for(var n,r,o,s=0,a=0,l=e.length-1,c=e[0],u=e[l],h=i.length-1,p=i[0],d=i[h];s<=l&&a<=h;)null==c?c=e[++s]:null==u?u=e[--l]:null==p?p=i[++a]:null==d?d=i[--h]:mZ(c,p)?(xZ(c,p),c=e[++s],p=i[++a]):mZ(u,d)?(xZ(u,d),u=e[--l],d=i[--h]):mZ(c,d)?(xZ(c,d),nZ(t,c.elm,aZ(u.elm)),c=e[++s],d=i[--h]):mZ(u,p)?(xZ(u,p),nZ(t,u.elm,c.elm),u=e[--l],p=i[++a]):(pZ(n)&&(n=fZ(e,s,l)),pZ(r=n[p.key])||(o=e[r]).tag!==p.tag?nZ(t,gZ(p),c.elm):(xZ(o,p),e[r]=void 0,nZ(t,o.elm,c.elm)),p=i[++a]);(s<=l||a<=h)&&(s>l?yZ(t,null==i[h+1]?null:i[h+1].elm,i,a,h):vZ(t,e,s,l))}(i,n,r):dZ(r)?(dZ(t.text)&&lZ(i,""),yZ(i,null,r,0,r.length-1)):dZ(n)?vZ(i,n,0,n.length-1):dZ(t.text)&&lZ(i,""):t.text!==e.text&&(dZ(n)&&vZ(i,n,0,n.length-1),lZ(i,e.text)))}var bZ=0,wZ=function(){function t(t,e,i){if(this.type="svg",this.refreshHover=AZ("refreshHover"),this.configLayer=AZ("configLayer"),this.storage=e,this._opts=i=pE({},i),this.root=t,this._id="zr"+bZ++,this._oldVNode=LX(i.width,i.height),t&&!i.ssr){var n=this._viewport=document.createElement("div");n.style.cssText="position:relative;overflow:hidden";var r=this._svgDom=this._oldVNode.elm=TX("svg");_Z(null,this._oldVNode),n.appendChild(r),t.appendChild(n)}this.resize(i.width,i.height)}return t.prototype.getType=function(){return this.type},t.prototype.getViewportRoot=function(){return this._viewport},t.prototype.getViewportRootOffset=function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},t.prototype.getSvgDom=function(){return this._svgDom},t.prototype.refresh=function(){if(this.root){var t=this.renderToVNode({willUpdate:!0});t.attrs.style="position:absolute;left:0;top:0;user-select:none",function(t,e){if(mZ(t,e))xZ(t,e);else{var i=t.elm,n=sZ(i);gZ(e),null!==n&&(nZ(n,e.elm,aZ(i)),vZ(n,[t],0,0))}}(this._oldVNode,t),this._oldVNode=t}},t.prototype.renderOneToVNode=function(t){return KX(t,PX(this._id))},t.prototype.renderToVNode=function(t){t=t||{};var e=this.storage.getDisplayList(!0),i=this._width,n=this._height,r=PX(this._id);r.animation=t.animation,r.willUpdate=t.willUpdate,r.compress=t.compress;var o=[],s=this._bgVNode=function(t,e,i,n){var r;if(i&&"none"!==i)if(r=IX("rect","bg",{width:t,height:e,x:"0",y:"0",id:"0"}),QT(i))$X({fill:i},r.attrs,"fill",n);else if(XT(i))tZ({style:{fill:i},dirty:tS,getBoundingRect:function(){return{width:t,height:e}}},r.attrs,"fill",n);else{var o=VT(i),s=o.color,a=o.opacity;r.attrs.fill=s,a<1&&(r.attrs["fill-opacity"]=a)}return r}(i,n,this._backgroundColor,r);s&&o.push(s);var a=t.compress?null:this._mainVNode=IX("g","main",{},[]);this._paintList(e,r,a?a.children:o),a&&o.push(a);var l=vE(bE(r.defs),(function(t){return r.defs[t]}));if(l.length&&o.push(IX("defs","defs",{},l)),t.animation){var c=function(t,e,i){var n=(i=i||{}).newline?"\n":"",r=" {"+n,o=n+"}",s=vE(bE(t),(function(e){return e+r+vE(bE(t[e]),(function(i){return i+":"+t[e][i]+";"})).join(n)+o})).join(n),a=vE(bE(e),(function(t){return"@keyframes "+t+r+vE(bE(e[t]),(function(i){return i+r+vE(bE(e[t][i]),(function(n){var r=e[t][i][n];return"d"===n&&(r='path("'+r+'")'),n+":"+r+";"})).join(n)+o})).join(n)+o})).join(n);return s||a?["<![CDATA[",s,a,"]]>"].join(n):""}(r.cssNodes,r.cssAnims,{newline:!0});if(c){var u=IX("style","stl",{},[],c);o.push(u)}}return LX(i,n,o,t.useViewBox)},t.prototype.renderToString=function(t){return t=t||{},CX(this.renderToVNode({animation:BE(t.cssAnimation,!0),willUpdate:!1,compress:!0,useViewBox:BE(t.useViewBox,!0)}),{newline:!0})},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t},t.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},t.prototype._paintList=function(t,e,i){for(var n,r,o=t.length,s=[],a=0,l=0,c=0;c<o;c++){var u=t[c];if(!u.invisible){var h=u.__clipPaths,p=h&&h.length||0,d=r&&r.length||0,f=void 0;for(f=Math.max(p-1,d-1);f>=0&&(!h||!r||h[f]!==r[f]);f--);for(var m=d-1;m>f;m--)n=s[--a-1];for(var g=f+1;g<p;g++){var y={};eZ(h[g],y,e);var v=IX("g","clip-g-"+l++,y,[]);(n?n.children:i).push(v),s[a++]=v,n=v}r=h;var _=KX(u,e);_&&(n?n.children:i).push(_)}}},t.prototype.resize=function(t,e){var i=this._opts,n=this.root,r=this._viewport;if(null!=t&&(i.width=t),null!=e&&(i.height=e),n&&r&&(r.style.display="none",t=vG(n,0,i),e=vG(n,1,i),r.style.display=""),this._width!==t||this._height!==e){if(this._width=t,this._height=e,r){var o=r.style;o.width=t+"px",o.height=e+"px"}if(XT(this._backgroundColor))this.refresh();else{var s=this._svgDom;s&&(s.setAttribute("width",t),s.setAttribute("height",e));var a=this._bgVNode&&this._bgVNode.elm;a&&(a.setAttribute("width",t),a.setAttribute("height",e))}}},t.prototype.getWidth=function(){return this._width},t.prototype.getHeight=function(){return this._height},t.prototype.dispose=function(){this.root&&(this.root.innerHTML=""),this._svgDom=this._viewport=this.storage=this._oldVNode=this._bgVNode=this._mainVNode=null},t.prototype.clear=function(){this._svgDom&&(this._svgDom.innerHTML=null),this._oldVNode=null},t.prototype.toDataURL=function(t){var e=this.renderToString(),i="data:image/svg+xml;";return t?(e=tI(e))&&i+"base64,"+e:i+"charset=UTF-8,"+encodeURIComponent(e)},t}();function AZ(t){return function(){"production"!==process.env.NODE_ENV&&lE('In SVG mode painter not support method "'+t+'"')}}var EZ=wZ;function SZ(t,e,i){var n=ZA.createCanvas(),r=e.getWidth(),o=e.getHeight(),s=n.style;return s&&(s.position="absolute",s.left="0",s.top="0",s.width=r+"px",s.height=o+"px",n.setAttribute("data-zr-dom-id",t)),n.width=r*i,n.height=o*i,n}var MZ=function(t){function e(e,i,n){var r,o=t.call(this)||this;o.motionBlur=!1,o.lastFrameAlpha=.7,o.dpr=1,o.virtual=!1,o.config={},o.incremental=!1,o.zlevel=0,o.maxRepaintRectCount=5,o.__dirty=!0,o.__firstTimePaint=!0,o.__used=!1,o.__drawIndex=0,o.__startIndex=0,o.__endIndex=0,o.__prevStartIndex=null,o.__prevEndIndex=null,n=n||FI,"string"==typeof e?r=SZ(e,i,n):CE(e)&&(e=(r=e).id),o.id=e,o.dom=r;var s=r.style;return s&&(KE(r),r.onselectstart=function(){return!1},s.padding="0",s.margin="0",s.borderWidth="0"),o.painter=i,o.dpr=n,o}return zA(e,t),e.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},e.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},e.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},e.prototype.setUnpainted=function(){this.__firstTimePaint=!0},e.prototype.createBackBuffer=function(){var t=this.dpr;this.domBack=SZ("back-"+this.id,this.painter,t),this.ctxBack=this.domBack.getContext("2d"),1!==t&&this.ctxBack.scale(t,t)},e.prototype.createRepaintRects=function(t,e,i,n){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var r,o=[],s=this.maxRepaintRectCount,a=!1,l=new pM(0,0,0,0);function c(t){if(t.isFinite()&&!t.isZero())if(0===o.length){(e=new pM(0,0,0,0)).copy(t),o.push(e)}else{for(var e,i=!1,n=1/0,r=0,c=0;c<o.length;++c){var u=o[c];if(u.intersect(t)){var h=new pM(0,0,0,0);h.copy(u),h.union(t),o[c]=h,i=!0;break}if(a){l.copy(t),l.union(u);var p=t.width*t.height,d=u.width*u.height,f=l.width*l.height-p-d;f<n&&(n=f,r=c)}}if(a&&(o[r].union(t),i=!0),!i)(e=new pM(0,0,0,0)).copy(t),o.push(e);a||(a=o.length>=s)}}for(var u=this.__startIndex;u<this.__endIndex;++u){if(d=t[u]){var h=d.shouldBePainted(i,n,!0,!0);(f=d.__isRendered&&(d.__dirty&DM||!h)?d.getPrevPaintRect():null)&&c(f);var p=h&&(d.__dirty&DM||!d.__isRendered)?d.getPaintRect():null;p&&c(p)}}for(u=this.__prevStartIndex;u<this.__prevEndIndex;++u){var d,f;h=(d=e[u]).shouldBePainted(i,n,!0,!0);if(d&&(!h||!d.__zr)&&d.__isRendered)(f=d.getPrevPaintRect())&&c(f)}do{r=!1;for(u=0;u<o.length;)if(o[u].isZero())o.splice(u,1);else{for(var m=u+1;m<o.length;)o[u].intersect(o[m])?(r=!0,o[u].union(o[m]),o.splice(m,1)):m++;u++}}while(r);return this._paintRects=o,o},e.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},e.prototype.resize=function(t,e){var i=this.dpr,n=this.dom,r=n.style,o=this.domBack;r&&(r.width=t+"px",r.height=e+"px"),n.width=t*i,n.height=e*i,o&&(o.width=t*i,o.height=e*i,1!==i&&this.ctxBack.scale(i,i))},e.prototype.clear=function(t,e,i){var n=this.dom,r=this.ctx,o=n.width,s=n.height;e=e||this.clearColor;var a=this.motionBlur&&!t,l=this.lastFrameAlpha,c=this.dpr,u=this;a&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(n,0,0,o/c,s/c));var h=this.domBack;function p(t,i,n,o){if(r.clearRect(t,i,n,o),e&&"transparent"!==e){var s=void 0;if(RE(e))s=(e.global||e.__width===n&&e.__height===o)&&e.__canvasGradient||gG(r,e,{x:0,y:0,width:n,height:o}),e.__canvasGradient=s,e.__width=n,e.__height=o;else null!=e.image&&(e.scaleX=e.scaleX||c,e.scaleY=e.scaleY||c,s=MG(r,e,{dirty:function(){u.setUnpainted(),u.__painter.refresh()}}));r.save(),r.fillStyle=s||e,r.fillRect(t,i,n,o),r.restore()}a&&(r.save(),r.globalAlpha=l,r.drawImage(h,t,i,n,o),r.restore())}!i||a?p(0,0,o,s):i.length&&yE(i,(function(t){p(t.x*c,t.y*c,t.width*c,t.height*c)}))},e}(AS),TZ=MZ,IZ=1e5,CZ=314159,PZ=.01;var LZ=function(){function t(t,e,i,n){this.type="canvas",this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas";var r=!t.nodeName||"CANVAS"===t.nodeName.toUpperCase();this._opts=i=pE({},i||{}),this.dpr=i.devicePixelRatio||FI,this._singleCanvas=r,this.root=t,t.style&&(KE(t),t.innerHTML=""),this.storage=e;var o=this._zlevelList;this._prevDisplayList=[];var s=this._layers;if(r){var a=t,l=a.width,c=a.height;null!=i.width&&(l=i.width),null!=i.height&&(c=i.height),this.dpr=i.devicePixelRatio||1,a.width=l*this.dpr,a.height=c*this.dpr,this._width=l,this._height=c;var u=new TZ(a,this,this.dpr);u.__builtin__=!0,u.initContext(),s[314159]=u,u.zlevel=CZ,o.push(CZ),this._domRoot=t}else{this._width=vG(t,0,i),this._height=vG(t,1,i);var h=this._domRoot=function(t,e){var i=document.createElement("div");return i.style.cssText=["position:relative","width:"+t+"px","height:"+e+"px","padding:0","margin:0","border-width:0"].join(";")+";",i}(this._width,this._height);t.appendChild(h)}}return t.prototype.getType=function(){return"canvas"},t.prototype.isSingleCanvas=function(){return this._singleCanvas},t.prototype.getViewportRoot=function(){return this._domRoot},t.prototype.getViewportRootOffset=function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},t.prototype.refresh=function(t){var e=this.storage.getDisplayList(!0),i=this._prevDisplayList,n=this._zlevelList;this._redrawId=Math.random(),this._paintList(e,i,t,this._redrawId);for(var r=0;r<n.length;r++){var o=n[r],s=this._layers[o];if(!s.__builtin__&&s.refresh){var a=0===r?this._backgroundColor:null;s.refresh(a)}}return this._opts.useDirtyRect&&(this._prevDisplayList=e.slice()),this},t.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},t.prototype._paintHoverList=function(t){var e=t.length,i=this._hoverlayer;if(i&&i.clear(),e){for(var n,r={inHover:!0,viewWidth:this._width,viewHeight:this._height},o=0;o<e;o++){var s=t[o];s.__inHover&&(i||(i=this._hoverlayer=this.getLayer(IZ)),n||(n=i.ctx).save(),FG(n,s,r,o===e-1))}n&&n.restore()}},t.prototype.getHoverLayer=function(){return this.getLayer(IZ)},t.prototype.paintOne=function(t,e){zG(t,e)},t.prototype._paintList=function(t,e,i,n){if(this._redrawId===n){i=i||!1,this._updateLayerStatus(t);var r=this._doPaintList(t,e,i),o=r.finished,s=r.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),s&&this._paintHoverList(t),o)this.eachLayer((function(t){t.afterBrush&&t.afterBrush()}));else{var a=this;FM((function(){a._paintList(t,e,i,n)}))}}},t.prototype._compositeManually=function(){var t=this.getLayer(CZ).ctx,e=this._domRoot.width,i=this._domRoot.height;t.clearRect(0,0,e,i),this.eachBuiltinLayer((function(n){n.virtual&&t.drawImage(n.dom,0,0,e,i)}))},t.prototype._doPaintList=function(t,e,i){for(var n=this,r=[],o=this._opts.useDirtyRect,s=0;s<this._zlevelList.length;s++){var a=this._zlevelList[s],l=this._layers[a];l.__builtin__&&l!==this._hoverlayer&&(l.__dirty||i)&&r.push(l)}for(var c=!0,u=!1,h=function(s){var a,l=r[s],h=l.ctx,d=o&&l.createRepaintRects(t,e,p._width,p._height),f=i?l.__startIndex:l.__drawIndex,m=!i&&l.incremental&&Date.now,g=m&&Date.now(),y=l.zlevel===p._zlevelList[0]?p._backgroundColor:null;if(l.__startIndex===l.__endIndex)l.clear(!1,y,d);else if(f===l.__startIndex){var v=t[f];v.incremental&&v.notClear&&!i||l.clear(!1,y,d)}-1===f&&(console.error("For some unknown reason. drawIndex is -1"),f=l.__startIndex);var _=function(e){var i={inHover:!1,allClipped:!1,prevEl:null,viewWidth:n._width,viewHeight:n._height};for(a=f;a<l.__endIndex;a++){var r=t[a];if(r.__inHover&&(u=!0),n._doPaintEl(r,l,o,e,i,a===l.__endIndex-1),m)if(Date.now()-g>15)break}i.prevElClipPaths&&h.restore()};if(d)if(0===d.length)a=l.__endIndex;else for(var x=p.dpr,b=0;b<d.length;++b){var w=d[b];h.save(),h.beginPath(),h.rect(w.x*x,w.y*x,w.width*x,w.height*x),h.clip(),_(w),h.restore()}else h.save(),_(),h.restore();l.__drawIndex=a,l.__drawIndex<l.__endIndex&&(c=!1)},p=this,d=0;d<r.length;d++)h(d);return UA.wxa&&yE(this._layers,(function(t){t&&t.ctx&&t.ctx.draw&&t.ctx.draw()})),{finished:c,needsRefreshHover:u}},t.prototype._doPaintEl=function(t,e,i,n,r,o){var s=e.ctx;if(i){var a=t.getPaintRect();(!n||a&&a.intersect(n))&&(FG(s,t,r,o),t.setPrevPaintRect(a))}else FG(s,t,r,o)},t.prototype.getLayer=function(t,e){this._singleCanvas&&!this._needsManuallyCompositing&&(t=CZ);var i=this._layers[t];return i||((i=new TZ("zr_"+t,this,this.dpr)).zlevel=t,i.__builtin__=!0,this._layerConfig[t]?uE(i,this._layerConfig[t],!0):this._layerConfig[t-PZ]&&uE(i,this._layerConfig[t-PZ],!0),e&&(i.virtual=e),this.insertLayer(t,i),i.initContext()),i},t.prototype.insertLayer=function(t,e){var i=this._layers,n=this._zlevelList,r=n.length,o=this._domRoot,s=null,a=-1;if(i[t])"production"!==process.env.NODE_ENV&&lE("ZLevel "+t+" has been used already");else if(function(t){return!!t&&(!!t.__builtin__||"function"==typeof t.resize&&"function"==typeof t.refresh)}(e)){if(r>0&&t>n[0]){for(a=0;a<r-1&&!(n[a]<t&&n[a+1]>t);a++);s=i[n[a]]}if(n.splice(a+1,0,t),i[t]=e,!e.virtual)if(s){var l=s.dom;l.nextSibling?o.insertBefore(e.dom,l.nextSibling):o.appendChild(e.dom)}else o.firstChild?o.insertBefore(e.dom,o.firstChild):o.appendChild(e.dom);e.__painter=this}else"production"!==process.env.NODE_ENV&&lE("Layer of zlevel "+t+" is not valid")},t.prototype.eachLayer=function(t,e){for(var i=this._zlevelList,n=0;n<i.length;n++){var r=i[n];t.call(e,this._layers[r],r)}},t.prototype.eachBuiltinLayer=function(t,e){for(var i=this._zlevelList,n=0;n<i.length;n++){var r=i[n],o=this._layers[r];o.__builtin__&&t.call(e,o,r)}},t.prototype.eachOtherLayer=function(t,e){for(var i=this._zlevelList,n=0;n<i.length;n++){var r=i[n],o=this._layers[r];o.__builtin__||t.call(e,o,r)}},t.prototype.getLayers=function(){return this._layers},t.prototype._updateLayerStatus=function(t){function e(t){o&&(o.__endIndex!==t&&(o.__dirty=!0),o.__endIndex=t)}if(this.eachBuiltinLayer((function(t,e){t.__dirty=t.__used=!1})),this._singleCanvas)for(var i=1;i<t.length;i++){if((a=t[i]).zlevel!==t[i-1].zlevel||a.incremental){this._needsManuallyCompositing=!0;break}}var n,r,o=null,s=0;for(r=0;r<t.length;r++){var a,l=(a=t[r]).zlevel,c=void 0;n!==l&&(n=l,s=0),a.incremental?((c=this.getLayer(l+.001,this._needsManuallyCompositing)).incremental=!0,s=1):c=this.getLayer(l+(s>0?PZ:0),this._needsManuallyCompositing),c.__builtin__||lE("ZLevel "+l+" has been used by unkown layer "+c.id),c!==o&&(c.__used=!0,c.__startIndex!==r&&(c.__dirty=!0),c.__startIndex=r,c.incremental?c.__drawIndex=-1:c.__drawIndex=r,e(r),o=c),a.__dirty&DM&&!a.__inHover&&(c.__dirty=!0,c.incremental&&c.__drawIndex<0&&(c.__drawIndex=r))}e(r),this.eachBuiltinLayer((function(t,e){!t.__used&&t.getElementCount()>0&&(t.__dirty=!0,t.__startIndex=t.__endIndex=t.__drawIndex=0),t.__dirty&&t.__drawIndex<0&&(t.__drawIndex=t.__startIndex)}))},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(t){t.clear()},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t,yE(this._layers,(function(t){t.setUnpainted()}))},t.prototype.configLayer=function(t,e){if(e){var i=this._layerConfig;i[t]?uE(i[t],e,!0):i[t]=e;for(var n=0;n<this._zlevelList.length;n++){var r=this._zlevelList[n];if(r===t||r===t+PZ)uE(this._layers[r],i[t],!0)}}},t.prototype.delLayer=function(t){var e=this._layers,i=this._zlevelList,n=e[t];n&&(n.dom.parentNode.removeChild(n.dom),delete e[t],i.splice(fE(i,t),1))},t.prototype.resize=function(t,e){if(this._domRoot.style){var i=this._domRoot;i.style.display="none";var n=this._opts,r=this.root;if(null!=t&&(n.width=t),null!=e&&(n.height=e),t=vG(r,0,n),e=vG(r,1,n),i.style.display="",this._width!==t||e!==this._height){for(var o in i.style.width=t+"px",i.style.height=e+"px",this._layers)this._layers.hasOwnProperty(o)&&this._layers[o].resize(t,e);this.refresh(!0)}this._width=t,this._height=e}else{if(null==t||null==e)return;this._width=t,this._height=e,this.getLayer(CZ).resize(t,e)}return this},t.prototype.clearLayer=function(t){var e=this._layers[t];e&&e.clear()},t.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},t.prototype.getRenderedCanvas=function(t){if(t=t||{},this._singleCanvas&&!this._compositeManually)return this._layers[314159].dom;var e=new TZ("image",this,t.pixelRatio||this.dpr);e.initContext(),e.clear(!1,t.backgroundColor||this._backgroundColor);var i=e.ctx;if(t.pixelRatio<=this.dpr){this.refresh();var n=e.dom.width,r=e.dom.height;this.eachLayer((function(t){t.__builtin__?i.drawImage(t.dom,0,0,n,r):t.renderToCanvas&&(i.save(),t.renderToCanvas(i),i.restore())}))}else for(var o={inHover:!1,viewWidth:this._width,viewHeight:this._height},s=this.storage.getDisplayList(!0),a=0,l=s.length;a<l;a++){var c=s[a];FG(i,c,o,a===l-1)}return e.dom},t.prototype.getWidth=function(){return this._width},t.prototype.getHeight=function(){return this._height},t}(),DZ=LZ;var RZ=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.hasSymbolVisual=!0,i}return zA(e,t),e.prototype.getInitialData=function(t){if("production"!==process.env.NODE_ENV){var e=t.coordinateSystem;if("polar"!==e&&"cartesian2d"!==e)throw new Error("Line not support coordinateSystem besides cartesian and polar")}return FH(null,this,{useEncodeDefaulter:!0})},e.prototype.getLegendIcon=function(t){var e=new xC,i=pG("line",0,t.itemHeight/2,t.itemWidth,0,t.lineStyle.stroke,!1);e.add(i),i.setStyle(t.lineStyle);var n=this.getData().getVisual("symbol"),r=this.getData().getVisual("symbolRotate"),o="none"===n?"circle":n,s=.8*t.itemHeight,a=pG(o,(t.itemWidth-s)/2,(t.itemHeight-s)/2,s,s,t.itemStyle.fill);e.add(a),a.setStyle(t.itemStyle);var l="inherit"===t.iconRotate?r:t.iconRotate||0;return a.rotation=l*Math.PI/180,a.setOrigin([t.itemWidth/2,t.itemHeight/2]),o.indexOf("empty")>-1&&(a.style.stroke=a.style.fill,a.style.fill="#fff",a.style.lineWidth=2),e},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},e}(HV),OZ=RZ;function kZ(t,e){var i=t.mapDimensionsAll("defaultedLabel"),n=i.length;if(1===n){var r=RF(t,e,i[0]);return null!=r?r+"":null}if(n){for(var o=[],s=0;s<i.length;s++)o.push(RF(t,e,i[s]));return o.join(" ")}}function NZ(t,e){var i=t.mapDimensionsAll("defaultedLabel");if(!EE(e))return e+"";for(var n=[],r=0;r<i.length;r++){var o=t.getDimensionIndex(i[r]);o>=0&&n.push(e[o])}return n.join(" ")}var BZ=function(t){function e(e,i,n,r){var o=t.call(this)||this;return o.updateData(e,i,n,r),o}return zA(e,t),e.prototype._createSymbol=function(t,e,i,n,r){this.removeAll();var o=pG(t,-1,-1,2,2,null,r);o.attr({z2:100,culling:!0,scaleX:n[0]/2,scaleY:n[1]/2}),o.drift=zZ,this._symbolType=t,this.add(o)},e.prototype.stopSymbolAnimation=function(t){this.childAt(0).stopAnimation(null,t)},e.prototype.getSymbolType=function(){return this._symbolType},e.prototype.getSymbolPath=function(){return this.childAt(0)},e.prototype.highlight=function(){RR(this.childAt(0))},e.prototype.downplay=function(){OR(this.childAt(0))},e.prototype.setZ=function(t,e){var i=this.childAt(0);i.zlevel=t,i.z=e},e.prototype.setDraggable=function(t,e){var i=this.childAt(0);i.draggable=t,i.cursor=!e&&t?"move":i.cursor},e.prototype.updateData=function(t,i,n,r){this.silent=!1;var o=t.getItemVisual(i,"symbol")||"circle",s=t.hostModel,a=e.getSymbolSize(t,i),l=o!==this._symbolType,c=r&&r.disableAnimation;if(l){var u=t.getItemVisual(i,"symbolKeepAspect");this._createSymbol(o,t,i,a,u)}else{(p=this.childAt(0)).silent=!1;var h={scaleX:a[0]/2,scaleY:a[1]/2};c?p.attr(h):Pk(p,h,s,i),Nk(p)}if(this._updateCommon(t,i,a,n,r),l){var p=this.childAt(0);if(!c){h={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:p.style.opacity}};p.scaleX=p.scaleY=0,p.style.opacity=0,Lk(p,h,s,i)}}c&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(t,e,i,n,r){var o,s,a,l,c,u,h,p,d,f=this.childAt(0),m=t.hostModel;if(n&&(o=n.emphasisItemStyle,s=n.blurItemStyle,a=n.selectItemStyle,l=n.focus,c=n.blurScope,h=n.labelStatesModels,p=n.hoverScale,d=n.cursorStyle,u=n.emphasisDisabled),!n||t.hasItemOption){var g=n&&n.itemModel?n.itemModel:t.getItemModel(e),y=g.getModel("emphasis");o=y.getModel("itemStyle").getItemStyle(),a=g.getModel(["select","itemStyle"]).getItemStyle(),s=g.getModel(["blur","itemStyle"]).getItemStyle(),l=y.get("focus"),c=y.get("blurScope"),u=y.get("disabled"),h=fN(g),p=y.getShallow("scale"),d=g.getShallow("cursor")}var v=t.getItemVisual(e,"symbolRotate");f.attr("rotation",(v||0)*Math.PI/180||0);var _=fG(t.getItemVisual(e,"symbolOffset"),i);_&&(f.x=_[0],f.y=_[1]),d&&f.attr("cursor",d);var x=t.getItemVisual(e,"style"),b=x.fill;if(f instanceof TD){var w=f.style;f.useStyle(pE({image:w.image,x:w.x,y:w.y,width:w.width,height:w.height},x))}else f.__isEmptyBrush?f.useStyle(pE({},x)):f.useStyle(x),f.style.decal=null,f.setColor(b,r&&r.symbolInnerColor),f.style.strokeNoScale=!0;var A=t.getItemVisual(e,"liftZ"),E=this._z2;null!=A?null==E&&(this._z2=f.z2,f.z2+=A):null!=E&&(f.z2=E,this._z2=null);var S=r&&r.useNameLabel;dN(f,h,{labelFetcher:m,labelDataIndex:e,defaultText:function(e){return S?t.getName(e):kZ(t,e)},inheritColor:b,defaultOpacity:x.opacity}),this._sizeX=i[0]/2,this._sizeY=i[1]/2;var M=f.ensureState("emphasis");M.style=o,f.ensureState("select").style=a,f.ensureState("blur").style=s;var T=null==p||!0===p?Math.max(1.1,3/this._sizeY):isFinite(p)&&p>0?+p:1;M.scaleX=this._sizeX*T,M.scaleY=this._sizeY*T,this.setSymbolScale(1),XR(this,l,c,u)},e.prototype.setSymbolScale=function(t){this.scaleX=this.scaleY=t},e.prototype.fadeOut=function(t,e,i){var n=this.childAt(0),r=KD(this).dataIndex,o=i&&i.animation;if(this.silent=n.silent=!0,i&&i.fadeLabel){var s=n.getTextContent();s&&Rk(s,{style:{opacity:0}},e,{dataIndex:r,removeOpt:o,cb:function(){n.removeTextContent()}})}else n.removeTextContent();Rk(n,{style:{opacity:0},scaleX:0,scaleY:0},e,{dataIndex:r,cb:t,removeOpt:o})},e.getSymbolSize=function(t,e){return dG(t.getItemVisual(e,"symbolSize"))},e}(xC);function zZ(t,e){this.parent.drift(t,e)}var FZ=BZ;function VZ(t,e,i,n){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(n.isIgnore&&n.isIgnore(i))&&!(n.clipShape&&!n.clipShape.contain(e[0],e[1]))&&"none"!==t.getItemVisual(i,"symbol")}function UZ(t){return null==t||CE(t)||(t={isIgnore:t}),t||{}}function GZ(t){var e=t.hostModel,i=e.getModel("emphasis");return{emphasisItemStyle:i.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:i.get("focus"),blurScope:i.get("blurScope"),emphasisDisabled:i.get("disabled"),hoverScale:i.get("scale"),labelStatesModels:fN(e),cursorStyle:e.get("cursor")}}var jZ=function(){function t(t){this.group=new xC,this._SymbolCtor=t||FZ}return t.prototype.updateData=function(t,e){this._progressiveEls=null,e=UZ(e);var i=this.group,n=t.hostModel,r=this._data,o=this._SymbolCtor,s=e.disableAnimation,a=GZ(t),l={disableAnimation:s},c=e.getSymbolPoint||function(e){return t.getItemLayout(e)};r||i.removeAll(),t.diff(r).add((function(n){var r=c(n);if(VZ(t,r,n,e)){var s=new o(t,n,a,l);s.setPosition(r),t.setItemGraphicEl(n,s),i.add(s)}})).update((function(u,h){var p=r.getItemGraphicEl(h),d=c(u);if(VZ(t,d,u,e)){var f=t.getItemVisual(u,"symbol")||"circle",m=p&&p.getSymbolType&&p.getSymbolType();if(!p||m&&m!==f)i.remove(p),(p=new o(t,u,a,l)).setPosition(d);else{p.updateData(t,u,a,l);var g={x:d[0],y:d[1]};s?p.attr(g):Pk(p,g,n)}i.add(p),t.setItemGraphicEl(u,p)}else i.remove(p)})).remove((function(t){var e=r.getItemGraphicEl(t);e&&e.fadeOut((function(){i.remove(e)}),n)})).execute(),this._getSymbolPoint=c,this._data=t},t.prototype.updateLayout=function(){var t=this,e=this._data;e&&e.eachItemGraphicEl((function(e,i){var n=t._getSymbolPoint(i);e.setPosition(n),e.markRedraw()}))},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=GZ(t),this._data=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e,i){function n(t){t.isGroup||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[],i=UZ(i);for(var r=t.start;r<t.end;r++){var o=e.getItemLayout(r);if(VZ(e,o,r,i)){var s=new this._SymbolCtor(e,r,this._seriesScope);s.traverse(n),s.setPosition(o),this.group.add(s),e.setItemGraphicEl(r,s),this._progressiveEls.push(s)}}},t.prototype.eachRendered=function(t){lN(this._progressiveEls||this.group,t)},t.prototype.remove=function(t){var e=this.group,i=this._data;i&&t?i.eachItemGraphicEl((function(t){t.fadeOut((function(){e.remove(t)}),i.hostModel)})):e.removeAll()},t}(),HZ=jZ;function WZ(t,e,i){var n=t.getBaseAxis(),r=t.getOtherAxis(n),o=function(t,e){var i=0,n=t.scale.getExtent();"start"===e?i=n[0]:"end"===e?i=n[1]:IE(e)&&!isNaN(e)?i=e:n[0]>0?i=n[0]:n[1]<0&&(i=n[1]);return i}(r,i),s=n.dim,a=r.dim,l=e.mapDimension(a),c=e.mapDimension(s),u="x"===a||"radius"===a?1:0,h=vE(t.dimensions,(function(t){return e.mapDimension(t)})),p=!1,d=e.getCalculationInfo("stackResultDimension");return BH(e,h[0])&&(p=!0,h[0]=d),BH(e,h[1])&&(p=!0,h[1]=d),{dataDimsForPoint:h,valueStart:o,valueAxisDim:a,baseAxisDim:s,stacked:!!p,valueDim:l,baseDim:c,baseDataOffset:u,stackedOverDimension:e.getCalculationInfo("stackedOverDimension")}}function qZ(t,e,i,n){var r=NaN;t.stacked&&(r=i.get(i.getCalculationInfo("stackedOverDimension"),n)),isNaN(r)&&(r=t.valueStart);var o=t.baseDataOffset,s=[];return s[o]=i.get(t.baseDim,n),s[1-o]=r,e.dataToPoint(s)}var XZ=Math.min,ZZ=Math.max;function YZ(t,e){return isNaN(t)||isNaN(e)}function QZ(t,e,i,n,r,o,s,a,l){for(var c,u,h,p,d,f,m=i,g=0;g<n;g++){var y=e[2*m],v=e[2*m+1];if(m>=r||m<0)break;if(YZ(y,v)){if(l){m+=o;continue}break}if(m===i)t[o>0?"moveTo":"lineTo"](y,v),h=y,p=v;else{var _=y-c,x=v-u;if(_*_+x*x<.5){m+=o;continue}if(s>0){for(var b=m+o,w=e[2*b],A=e[2*b+1];w===y&&A===v&&g<n;)g++,m+=o,w=e[2*(b+=o)],A=e[2*b+1],_=(y=e[2*m])-c,x=(v=e[2*m+1])-u;var E=g+1;if(l)for(;YZ(w,A)&&E<n;)E++,w=e[2*(b+=o)],A=e[2*b+1];var S=.5,M=0,T=0,I=void 0,C=void 0;if(E>=n||YZ(w,A))d=y,f=v;else{M=w-c,T=A-u;var P=y-c,L=w-y,D=v-u,R=A-v,O=void 0,k=void 0;if("x"===a){var N=M>0?1:-1;d=y-N*(O=Math.abs(P))*s,f=v,I=y+N*(k=Math.abs(L))*s,C=v}else if("y"===a){var B=T>0?1:-1;d=y,f=v-B*(O=Math.abs(D))*s,I=y,C=v+B*(k=Math.abs(R))*s}else O=Math.sqrt(P*P+D*D),d=y-M*s*(1-(S=(k=Math.sqrt(L*L+R*R))/(k+O))),f=v-T*s*(1-S),C=v+T*s*S,I=XZ(I=y+M*s*S,ZZ(w,y)),C=XZ(C,ZZ(A,v)),I=ZZ(I,XZ(w,y)),f=v-(T=(C=ZZ(C,XZ(A,v)))-v)*O/k,d=XZ(d=y-(M=I-y)*O/k,ZZ(c,y)),f=XZ(f,ZZ(u,v)),I=y+(M=y-(d=ZZ(d,XZ(c,y))))*k/O,C=v+(T=v-(f=ZZ(f,XZ(u,v))))*k/O}t.bezierCurveTo(h,p,d,f,y,v),h=I,p=C}else t.lineTo(y,v)}c=y,u=v,m+=o}return g}var JZ=function(){this.smooth=0,this.smoothConstraint=!0},KZ=function(t){function e(e){var i=t.call(this,e)||this;return i.type="ec-polyline",i}return zA(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new JZ},e.prototype.buildPath=function(t,e){var i=e.points,n=0,r=i.length/2;if(e.connectNulls){for(;r>0&&YZ(i[2*r-2],i[2*r-1]);r--);for(;n<r&&YZ(i[2*n],i[2*n+1]);n++);}for(;n<r;)n+=QZ(t,i,n,r,r,1,e.smooth,e.smoothMonotone,e.connectNulls)+1},e.prototype.getPointOn=function(t,e){this.path||(this.createPathProxy(),this.buildPath(this.path,this.shape));for(var i,n,r=this.path.data,o=KL.CMD,s="x"===e,a=[],l=0;l<r.length;){var c=void 0,u=void 0,h=void 0,p=void 0,d=void 0,f=void 0,m=void 0;switch(r[l++]){case o.M:i=r[l++],n=r[l++];break;case o.L:if(c=r[l++],u=r[l++],(m=s?(t-i)/(c-i):(t-n)/(u-n))<=1&&m>=0){var g=s?(u-n)*m+n:(c-i)*m+i;return s?[t,g]:[g,t]}i=c,n=u;break;case o.C:c=r[l++],u=r[l++],h=r[l++],p=r[l++],d=r[l++],f=r[l++];var y=s?eT(i,c,h,d,t,a):eT(n,u,p,f,t,a);if(y>0)for(var v=0;v<y;v++){var _=a[v];if(_<=1&&_>=0){g=s?$M(n,u,p,f,_):$M(i,c,h,d,_);return s?[t,g]:[g,t]}}i=d,n=f}}},e}(xD),$Z=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return zA(e,t),e}(JZ),tY=function(t){function e(e){var i=t.call(this,e)||this;return i.type="ec-polygon",i}return zA(e,t),e.prototype.getDefaultShape=function(){return new $Z},e.prototype.buildPath=function(t,e){var i=e.points,n=e.stackedOnPoints,r=0,o=i.length/2,s=e.smoothMonotone;if(e.connectNulls){for(;o>0&&YZ(i[2*o-2],i[2*o-1]);o--);for(;r<o&&YZ(i[2*r],i[2*r+1]);r++);}for(;r<o;){var a=QZ(t,i,r,o,o,1,e.smooth,s,e.connectNulls);QZ(t,n,r+a-1,a,o,-1,e.stackedOnSmooth,s,e.connectNulls),r+=a+1,t.closePath()}},e}(xD);function eY(t,e,i,n,r){var o=t.getArea(),s=o.x,a=o.y,l=o.width,c=o.height,u=i.get(["lineStyle","width"])||2;s-=u/2,a-=u/2,l+=u,c+=u,s=Math.floor(s),l=Math.round(l);var h=new kD({shape:{x:s,y:a,width:l,height:c}});if(e){var p=t.getBaseAxis(),d=p.isHorizontal(),f=p.inverse;d?(f&&(h.shape.x+=l),h.shape.width=0):(f||(h.shape.y+=c),h.shape.height=0);var m=SE(r)?function(t){r(t,h)}:null;Lk(h,{shape:{width:l,height:c,x:s,y:a}},i,null,n,m)}return h}function iY(t,e,i){var n=t.getArea(),r=CC(n.r0,1),o=CC(n.r,1),s=new jO({shape:{cx:CC(t.cx,1),cy:CC(t.cy,1),r0:r,r:o,startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}});e&&("angle"===t.getBaseAxis().dim?s.shape.endAngle=n.startAngle:s.shape.r=r,Lk(s,{shape:{endAngle:n.endAngle,r:o}},i));return s}function nY(t,e,i,n,r){return t?"polar"===t.type?iY(t,e,i):"cartesian2d"===t.type?eY(t,e,i,n,r):null:null}function rY(t,e){return t.type===e}function oY(t,e){if(t.length===e.length){for(var i=0;i<t.length;i++)if(t[i]!==e[i])return;return!0}}function sY(t){for(var e=1/0,i=1/0,n=-1/0,r=-1/0,o=0;o<t.length;){var s=t[o++],a=t[o++];isNaN(s)||(e=Math.min(s,e),n=Math.max(s,n)),isNaN(a)||(i=Math.min(a,i),r=Math.max(a,r))}return[[e,i],[n,r]]}function aY(t,e){var i=sY(t),n=i[0],r=i[1],o=sY(e),s=o[0],a=o[1];return Math.max(Math.abs(n[0]-s[0]),Math.abs(n[1]-s[1]),Math.abs(r[0]-a[0]),Math.abs(r[1]-a[1]))}function lY(t){return IE(t)?t:t?.5:0}function cY(t,e,i,n){var r=e.getBaseAxis(),o="x"===r.dim||"radius"===r.dim?0:1,s=[],a=0,l=[],c=[],u=[],h=[];if(n){for(a=0;a<t.length;a+=2)isNaN(t[a])||isNaN(t[a+1])||h.push(t[a],t[a+1]);t=h}for(a=0;a<t.length-2;a+=2)switch(u[0]=t[a+2],u[1]=t[a+3],c[0]=t[a],c[1]=t[a+1],s.push(c[0],c[1]),i){case"end":l[o]=u[o],l[1-o]=c[1-o],s.push(l[0],l[1]);break;case"middle":var p=(c[o]+u[o])/2,d=[];l[o]=d[o]=p,l[1-o]=c[1-o],d[1-o]=u[1-o],s.push(l[0],l[1]),s.push(d[0],d[1]);break;default:l[o]=c[o],l[1-o]=u[1-o],s.push(l[0],l[1])}return s.push(t[a++],t[a++]),s}function uY(t,e){var i,n,r=[],o=t.length;function s(t,e,i){var n=t.coord;return{coord:i,color:function(t,e,i){if(e&&e.length&&t>=0&&t<=1){var n=t*(e.length-1),r=Math.floor(n),o=Math.ceil(n),s=LT(e[r]),a=LT(e[o]),l=n-r,c=BT([xT(ST(s[0],a[0],l)),xT(ST(s[1],a[1],l)),xT(ST(s[2],a[2],l)),bT(ST(s[3],a[3],l))],"rgba");return i?{color:c,leftIndex:r,rightIndex:o,value:n}:c}}((i-n)/(e.coord-n),[t.color,e.color])}}for(var a=0;a<o;a++){var l=t[a],c=l.coord;if(c<0)i=l;else{if(c>e){n?r.push(s(n,l,e)):i&&r.push(s(i,l,0),s(i,l,e));break}i&&(r.push(s(i,l,0)),i=null),r.push(l),n=l}}return r}function hY(t,e,i){var n=t.get("showAllSymbol"),r="auto"===n;if(!n||r){var o=i.getAxesByScale("ordinal")[0];if(o&&(!r||!function(t,e){var i=t.getExtent(),n=Math.abs(i[1]-i[0])/t.scale.count();isNaN(n)&&(n=0);for(var r=e.count(),o=Math.max(1,Math.round(r/5)),s=0;s<r;s+=o)if(1.5*FZ.getSymbolSize(e,s)[t.isHorizontal()?1:0]>n)return!1;return!0}(o,e))){var s=e.mapDimension(o.dim),a={};return yE(o.getViewLabels(),(function(t){var e=o.scale.getRawOrdinalNumber(t.tickValue);a[e]=1})),function(t){return!a.hasOwnProperty(e.get(s,t))}}}}function pY(t,e){return[t[2*e],t[2*e+1]]}function dY(t){if(t.get(["endLabel","show"]))return!0;for(var e=0;e<aR.length;e++)if(t.get([aR[e],"endLabel","show"]))return!0;return!1}function fY(t,e,i,n){if(rY(e,"cartesian2d")){var r=n.getModel("endLabel"),o=r.get("valueAnimation"),s=n.getData(),a={lastFrameIndex:0},l=dY(n)?function(i,n){t._endLabelOnDuring(i,n,s,a,o,r,e)}:null,c=e.getBaseAxis().isHorizontal(),u=eY(e,i,n,(function(){var e=t._endLabel;e&&i&&null!=a.originalX&&e.attr({x:a.originalX,y:a.originalY})}),l);if(!n.get("clip",!0)){var h=u.shape,p=Math.max(h.width,h.height);c?(h.y-=p,h.height+=2*p):(h.x-=p,h.width+=2*p)}return l&&l(1,u),u}return"production"!==process.env.NODE_ENV&&n.get(["endLabel","show"])&&console.warn("endLabel is not supported for lines in polar systems."),iY(e,i,n)}var mY=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return zA(e,t),e.prototype.init=function(){var t=new xC,e=new HZ;this.group.add(e.group),this._symbolDraw=e,this._lineGroup=t},e.prototype.render=function(t,e,i){var n=this,r=t.coordinateSystem,o=this.group,s=t.getData(),a=t.getModel("lineStyle"),l=t.getModel("areaStyle"),c=s.getLayout("points")||[],u="polar"===r.type,h=this._coordSys,p=this._symbolDraw,d=this._polyline,f=this._polygon,m=this._lineGroup,g=!e.ssr&&t.isAnimationEnabled(),y=!l.isEmpty(),v=l.get("origin"),_=WZ(r,s,v),x=y&&function(t,e,i){if(!i.valueDim)return[];for(var n=e.count(),r=aW(2*n),o=0;o<n;o++){var s=qZ(i,t,e,o);r[2*o]=s[0],r[2*o+1]=s[1]}return r}(r,s,_),b=t.get("showSymbol"),w=t.get("connectNulls"),A=b&&!u&&hY(t,s,r),E=this._data;E&&E.eachItemGraphicEl((function(t,e){t.__temp&&(o.remove(t),E.setItemGraphicEl(e,null))})),b||p.remove(),o.add(m);var S,M=!u&&t.get("step");r&&r.getArea&&t.get("clip",!0)&&(null!=(S=r.getArea()).width?(S.x-=.1,S.y-=.1,S.width+=.2,S.height+=.2):S.r0&&(S.r0-=.5,S.r+=.5)),this._clipShapeForSymbol=S;var T=function(t,e,i){var n=t.getVisual("visualMeta");if(n&&n.length&&t.count())if("cartesian2d"===e.type){for(var r,o,s=n.length-1;s>=0;s--){var a=t.getDimensionInfo(n[s].dimension);if("x"===(r=a&&a.coordDim)||"y"===r){o=n[s];break}}if(o){var l=e.getAxis(r),c=vE(o.stops,(function(t){return{coord:l.toGlobalCoord(l.dataToCoord(t.value)),color:t.color}})),u=c.length,h=o.outerColors.slice();u&&c[0].coord>c[u-1].coord&&(c.reverse(),h.reverse());var p=uY(c,"x"===r?i.getWidth():i.getHeight()),d=p.length;if(!d&&u)return c[0].coord<0?h[1]?h[1]:c[u-1].color:h[0]?h[0]:c[0].color;var f=p[0].coord-10,m=p[d-1].coord+10,g=m-f;if(g<.001)return"transparent";yE(p,(function(t){t.offset=(t.coord-f)/g})),p.push({offset:d?p[d-1].offset:.5,color:h[1]||"transparent"}),p.unshift({offset:d?p[0].offset:.5,color:h[0]||"transparent"});var y=new mk(0,0,0,0,p,!0);return y[r]=f,y[r+"2"]=m,y}"production"!==process.env.NODE_ENV&&console.warn("Visual map on line style only support x or y dimension.")}else"production"!==process.env.NODE_ENV&&console.warn("Visual map on line style is only supported on cartesian2d.")}(s,r,i)||s.getVisual("style")[s.getVisual("drawType")];if(d&&h.type===r.type&&M===this._step){y&&!f?f=this._newPolygon(c,x):f&&!y&&(m.remove(f),f=this._polygon=null),u||this._initOrUpdateEndLabel(t,r,OB(T));var I=m.getClipPath();if(I)Lk(I,{shape:fY(this,r,!1,t).shape},t);else m.setClipPath(fY(this,r,!0,t));b&&p.updateData(s,{isIgnore:A,clipShape:S,disableAnimation:!0,getSymbolPoint:function(t){return[c[2*t],c[2*t+1]]}}),oY(this._stackedOnPoints,x)&&oY(this._points,c)||(g?this._doUpdateAnimation(s,x,r,i,M,v,w):(M&&(c=cY(c,r,M,w),x&&(x=cY(x,r,M,w))),d.setShape({points:c}),f&&f.setShape({points:c,stackedOnPoints:x})))}else b&&p.updateData(s,{isIgnore:A,clipShape:S,disableAnimation:!0,getSymbolPoint:function(t){return[c[2*t],c[2*t+1]]}}),g&&this._initSymbolLabelAnimation(s,r,S),M&&(c=cY(c,r,M,w),x&&(x=cY(x,r,M,w))),d=this._newPolyline(c),y?f=this._newPolygon(c,x):f&&(m.remove(f),f=this._polygon=null),u||this._initOrUpdateEndLabel(t,r,OB(T)),m.setClipPath(fY(this,r,!0,t));var C=t.getModel("emphasis"),P=C.get("focus"),L=C.get("blurScope"),D=C.get("disabled");(d.useStyle(dE(a.getLineStyle(),{fill:"none",stroke:T,lineJoin:"bevel"})),JR(d,t,"lineStyle"),d.style.lineWidth>0&&"bolder"===t.get(["emphasis","lineStyle","width"]))&&(d.getState("emphasis").style.lineWidth=+d.style.lineWidth+1);KD(d).seriesIndex=t.seriesIndex,XR(d,P,L,D);var R=lY(t.get("smooth")),O=t.get("smoothMonotone");if(d.setShape({smooth:R,smoothMonotone:O,connectNulls:w}),f){var k=s.getCalculationInfo("stackedOnSeries"),N=0;f.useStyle(dE(l.getAreaStyle(),{fill:T,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),k&&(N=lY(k.get("smooth"))),f.setShape({smooth:R,stackedOnSmooth:N,smoothMonotone:O,connectNulls:w}),JR(f,t,"areaStyle"),KD(f).seriesIndex=t.seriesIndex,XR(f,P,L,D)}var B=function(t){n._changePolyState(t)};s.eachItemGraphicEl((function(t){t&&(t.onHoverStateChange=B)})),this._polyline.onHoverStateChange=B,this._data=s,this._coordSys=r,this._stackedOnPoints=x,this._points=c,this._step=M,this._valueOrigin=v,t.get("triggerLineEvent")&&(this.packEventData(t,d),f&&this.packEventData(t,f))},e.prototype.packEventData=function(t,e){KD(e).eventData={componentType:"series",componentSubType:"line",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"line"}},e.prototype.highlight=function(t,e,i,n){var r=t.getData(),o=bP(r,n);if(this._changePolyState("emphasis"),!(o instanceof Array)&&null!=o&&o>=0){var s=r.getLayout("points"),a=r.getItemGraphicEl(o);if(!a){var l=s[2*o],c=s[2*o+1];if(isNaN(l)||isNaN(c))return;if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(l,c))return;var u=t.get("zlevel")||0,h=t.get("z")||0;(a=new FZ(r,o)).x=l,a.y=c,a.setZ(u,h);var p=a.getSymbolPath().getTextContent();p&&(p.zlevel=u,p.z=h,p.z2=this._polyline.z2+1),a.__temp=!0,r.setItemGraphicEl(o,a),a.stopSymbolAnimation(!0),this.group.add(a)}a.highlight()}else iU.prototype.highlight.call(this,t,e,i,n)},e.prototype.downplay=function(t,e,i,n){var r=t.getData(),o=bP(r,n);if(this._changePolyState("normal"),null!=o&&o>=0){var s=r.getItemGraphicEl(o);s&&(s.__temp?(r.setItemGraphicEl(o,null),this.group.remove(s)):s.downplay())}else iU.prototype.downplay.call(this,t,e,i,n)},e.prototype._changePolyState=function(t){var e=this._polygon;IR(this._polyline,t),e&&IR(e,t)},e.prototype._newPolyline=function(t){var e=this._polyline;return e&&this._lineGroup.remove(e),e=new KZ({shape:{points:t},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(e),this._polyline=e,e},e.prototype._newPolygon=function(t,e){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new tY({shape:{points:t,stackedOnPoints:e},segmentIgnoreThreshold:2}),this._lineGroup.add(i),this._polygon=i,i},e.prototype._initSymbolLabelAnimation=function(t,e,i){var n,r,o=e.getBaseAxis(),s=o.inverse;"cartesian2d"===e.type?(n=o.isHorizontal(),r=!1):"polar"===e.type&&(n="angle"===o.dim,r=!0);var a=t.hostModel,l=a.get("animationDuration");SE(l)&&(l=l(null));var c=a.get("animationDelay")||0,u=SE(c)?c(null):c;t.eachItemGraphicEl((function(t,o){var a=t;if(a){var h=[t.x,t.y],p=void 0,d=void 0,f=void 0;if(i)if(r){var m=i,g=e.pointToCoord(h);n?(p=m.startAngle,d=m.endAngle,f=-g[1]/180*Math.PI):(p=m.r0,d=m.r,f=g[0])}else{var y=i;n?(p=y.x,d=y.x+y.width,f=t.x):(p=y.y+y.height,d=y.y,f=t.y)}var v=d===p?0:(f-p)/(d-p);s&&(v=1-v);var _=SE(c)?c(o):l*v+u,x=a.getSymbolPath(),b=x.getTextContent();a.attr({scaleX:0,scaleY:0}),a.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:_}),b&&b.animateFrom({style:{opacity:0}},{duration:300,delay:_}),x.disableLabelAnimation=!0}}))},e.prototype._initOrUpdateEndLabel=function(t,e,i){var n=t.getModel("endLabel");if(dY(t)){var r=t.getData(),o=this._polyline,s=r.getLayout("points");if(!s)return o.removeTextContent(),void(this._endLabel=null);var a=this._endLabel;a||((a=this._endLabel=new JD({z2:200})).ignoreClip=!0,o.setTextContent(this._endLabel),o.disableLabelAnimation=!0);var l=function(t){for(var e,i,n=t.length/2;n>0&&(e=t[2*n-2],i=t[2*n-1],isNaN(e)||isNaN(i));n--);return n-1}(s);l>=0&&(dN(o,fN(t,"endLabel"),{inheritColor:i,labelFetcher:t,labelDataIndex:l,defaultText:function(t,e,i){return null!=i?NZ(r,i):kZ(r,t)},enableTextSetter:!0},function(t,e){var i=e.getBaseAxis(),n=i.isHorizontal(),r=i.inverse,o=n?r?"right":"left":"center",s=n?"middle":r?"top":"bottom";return{normal:{align:t.get("align")||o,verticalAlign:t.get("verticalAlign")||s}}}(n,e)),o.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(t,e,i,n,r,o,s){var a=this._endLabel,l=this._polyline;if(a){t<1&&null==n.originalX&&(n.originalX=a.x,n.originalY=a.y);var c=i.getLayout("points"),u=i.hostModel,h=u.get("connectNulls"),p=o.get("precision"),d=o.get("distance")||0,f=s.getBaseAxis(),m=f.isHorizontal(),g=f.inverse,y=e.shape,v=g?m?y.x:y.y+y.height:m?y.x+y.width:y.y,_=(m?d:0)*(g?-1:1),x=(m?0:-d)*(g?-1:1),b=m?"x":"y",w=function(t,e,i){for(var n,r,o=t.length/2,s="x"===i?0:1,a=0,l=-1,c=0;c<o;c++)if(r=t[2*c+s],!isNaN(r)&&!isNaN(t[2*c+1-s]))if(0!==c){if(n<=e&&r>=e||n>=e&&r<=e){l=c;break}a=c,n=r}else n=r;return{range:[a,l],t:(e-n)/(r-n)}}(c,v,b),A=w.range,E=A[1]-A[0],S=void 0;if(E>=1){if(E>1&&!h){var M=pY(c,A[0]);a.attr({x:M[0]+_,y:M[1]+x}),r&&(S=u.getRawValue(A[0]))}else{(M=l.getPointOn(v,b))&&a.attr({x:M[0]+_,y:M[1]+x});var T=u.getRawValue(A[0]),I=u.getRawValue(A[1]);r&&(S=LP(i,p,T,I,w.t))}n.lastFrameIndex=A[0]}else{var C=1===t||n.lastFrameIndex>0?A[0]:0;M=pY(c,C);r&&(S=u.getRawValue(C)),a.attr({x:M[0]+_,y:M[1]+x})}if(r){var P=wN(a);"function"==typeof P.setLabelText&&P.setLabelText(S)}}},e.prototype._doUpdateAnimation=function(t,e,i,n,r,o,s){var a=this._polyline,l=this._polygon,c=t.hostModel,u=function(t,e,i,n,r,o,s,a){for(var l=function(t,e){var i=[];return e.diff(t).add((function(t){i.push({cmd:"+",idx:t})})).update((function(t,e){i.push({cmd:"=",idx:e,idx1:t})})).remove((function(t){i.push({cmd:"-",idx:t})})).execute(),i}(t,e),c=[],u=[],h=[],p=[],d=[],f=[],m=[],g=WZ(r,e,s),y=t.getLayout("points")||[],v=e.getLayout("points")||[],_=0;_<l.length;_++){var x=l[_],b=!0,w=void 0,A=void 0;switch(x.cmd){case"=":w=2*x.idx,A=2*x.idx1;var E=y[w],S=y[w+1],M=v[A],T=v[A+1];(isNaN(E)||isNaN(S))&&(E=M,S=T),c.push(E,S),u.push(M,T),h.push(i[w],i[w+1]),p.push(n[A],n[A+1]),m.push(e.getRawIndex(x.idx1));break;case"+":var I=x.idx,C=g.dataDimsForPoint,P=r.dataToPoint([e.get(C[0],I),e.get(C[1],I)]);A=2*I,c.push(P[0],P[1]),u.push(v[A],v[A+1]);var L=qZ(g,r,e,I);h.push(L[0],L[1]),p.push(n[A],n[A+1]),m.push(e.getRawIndex(I));break;case"-":b=!1}b&&(d.push(x),f.push(f.length))}f.sort((function(t,e){return m[t]-m[e]}));var D=c.length,R=aW(D),O=aW(D),k=aW(D),N=aW(D),B=[];for(_=0;_<f.length;_++){var z=f[_],F=2*_,V=2*z;R[F]=c[V],R[F+1]=c[V+1],O[F]=u[V],O[F+1]=u[V+1],k[F]=h[V],k[F+1]=h[V+1],N[F]=p[V],N[F+1]=p[V+1],B[_]=d[z]}return{current:R,next:O,stackedOnCurrent:k,stackedOnNext:N,status:B}}(this._data,t,this._stackedOnPoints,e,this._coordSys,0,this._valueOrigin),h=u.current,p=u.stackedOnCurrent,d=u.next,f=u.stackedOnNext;if(r&&(h=cY(u.current,i,r,s),p=cY(u.stackedOnCurrent,i,r,s),d=cY(u.next,i,r,s),f=cY(u.stackedOnNext,i,r,s)),aY(h,d)>3e3||l&&aY(p,f)>3e3)return a.stopAnimation(),a.setShape({points:d}),void(l&&(l.stopAnimation(),l.setShape({points:d,stackedOnPoints:f})));a.shape.__points=u.current,a.shape.points=h;var m={shape:{points:d}};u.current!==h&&(m.shape.__points=u.next),a.stopAnimation(),Pk(a,m,c),l&&(l.setShape({points:h,stackedOnPoints:p}),l.stopAnimation(),Pk(l,{shape:{stackedOnPoints:f}},c),a.shape.points!==l.shape.points&&(l.shape.points=a.shape.points));for(var g=[],y=u.status,v=0;v<y.length;v++){if("="===y[v].cmd){var _=t.getItemGraphicEl(y[v].idx1);_&&g.push({el:_,ptIdx:v})}}a.animators&&a.animators.length&&a.animators[0].during((function(){l&&l.dirtyShape();for(var t=a.shape.__points,e=0;e<g.length;e++){var i=g[e].el,n=2*g[e].ptIdx;i.x=t[n],i.y=t[n+1],i.markRedraw()}}))},e.prototype.remove=function(t){var e=this.group,i=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),i&&i.eachItemGraphicEl((function(t,n){t.__temp&&(e.remove(t),i.setItemGraphicEl(n,null))})),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._endLabel=this._data=null},e.type="line",e}(iU),gY=mY;function yY(t,e){return{seriesType:t,plan:XV(),reset:function(t){var i=t.getData(),n=t.coordinateSystem,r=t.pipelineContext,o=e||r.large;if(n){var s=vE(n.dimensions,(function(t){return i.mapDimension(t)})).slice(0,2),a=s.length,l=i.getCalculationInfo("stackResultDimension");BH(i,s[0])&&(s[0]=l),BH(i,s[1])&&(s[1]=l);var c=i.getStore(),u=i.getDimensionIndex(s[0]),h=i.getDimensionIndex(s[1]);return a&&{progress:function(t,e){for(var i=t.end-t.start,r=o&&aW(i*a),s=[],l=[],p=t.start,d=0;p<t.end;p++){var f=void 0;if(1===a){var m=c.get(u,p);f=n.dataToPoint(m,null,l)}else s[0]=c.get(u,p),s[1]=c.get(h,p),f=n.dataToPoint(s,null,l);o?(r[d++]=f[0],r[d++]=f[1]):e.setItemLayout(p,f.slice())}o&&e.setLayout("points",r)}}}}}}var vY={average:function(t){for(var e=0,i=0,n=0;n<t.length;n++)isNaN(t[n])||(e+=t[n],i++);return 0===i?NaN:e/i},sum:function(t){for(var e=0,i=0;i<t.length;i++)e+=t[i]||0;return e},max:function(t){for(var e=-1/0,i=0;i<t.length;i++)t[i]>e&&(e=t[i]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,i=0;i<t.length;i++)t[i]<e&&(e=t[i]);return isFinite(e)?e:NaN},nearest:function(t){return t[0]}},_Y=function(t){return Math.round(t.length/2)};function xY(t){return{seriesType:t,reset:function(t,e,i){var n=t.getData(),r=t.get("sampling"),o=t.coordinateSystem,s=n.count();if(s>10&&"cartesian2d"===o.type&&r){var a=o.getBaseAxis(),l=o.getOtherAxis(a),c=a.getExtent(),u=i.getDevicePixelRatio(),h=Math.abs(c[1]-c[0])*(u||1),p=Math.round(s/h);if(isFinite(p)&&p>1){"lttb"===r&&t.setData(n.lttbDownSample(n.mapDimension(l.dim),1/p));var d=void 0;ME(r)?d=vY[r]:SE(r)&&(d=r),d&&t.setData(n.downSample(n.mapDimension(l.dim),1/p,d,_Y))}}}}}var bY=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.getInitialData=function(t,e){return FH(null,this,{useEncodeDefaulter:!0})},e.prototype.getMarkerPosition=function(t,e,i){var n=this.coordinateSystem;if(n&&n.clampData){var r=n.clampData(t),o=n.dataToPoint(r);if(i)yE(n.getAxes(),(function(t,i){if("category"===t.type&&null!=e){var n=t.getTicksCoords(),s=r[i],a="x1"===e[i]||"y1"===e[i];if(a&&(s+=1),n.length<2)return;if(2===n.length)return void(o[i]=t.toGlobalCoord(t.getExtent()[a?1:0]));for(var l=void 0,c=void 0,u=1,h=0;h<n.length;h++){var p=n[h].coord,d=h===n.length-1?n[h-1].tickValue+u:n[h].tickValue;if(d===s){c=p;break}if(d<s)l=p;else if(null!=l&&d>s){c=(p+l)/2;break}1===h&&(u=d-n[0].tickValue)}null==c&&(l?l&&(c=n[n.length-1].coord):c=n[0].coord),o[i]=t.toGlobalCoord(c)}}));else{var s=this.getData(),a=s.getLayout("offset"),l=s.getLayout("size"),c=n.getBaseAxis().isHorizontal()?0:1;o[c]+=a+l/2}return o}return[NaN,NaN]},e.type="series.__base_bar__",e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},e}(HV);HV.registerClass(bY);var wY=bY,AY=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.getInitialData=function(){return FH(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},e.prototype.getProgressive=function(){return!!this.get("large")&&this.get("progressive")},e.prototype.getProgressiveThreshold=function(){var t=this.get("progressiveThreshold"),e=this.get("largeThreshold");return e>t&&(t=e),t},e.prototype.brushSelector=function(t,e,i){return i.rect(e.getItemLayout(t))},e.type="series.bar",e.dependencies=["grid","polar"],e.defaultOption=GN(wY.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),e}(wY),EY=AY,SY=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},MY=function(t){function e(e){var i=t.call(this,e)||this;return i.type="sausage",i}return zA(e,t),e.prototype.getDefaultShape=function(){return new SY},e.prototype.buildPath=function(t,e){var i=e.cx,n=e.cy,r=Math.max(e.r0||0,0),o=Math.max(e.r,0),s=.5*(o-r),a=r+s,l=e.startAngle,c=e.endAngle,u=e.clockwise,h=2*Math.PI,p=u?c-l<h:l-c<h;p||(l=c-(u?h:-h));var d=Math.cos(l),f=Math.sin(l),m=Math.cos(c),g=Math.sin(c);p?(t.moveTo(d*r+i,f*r+n),t.arc(d*a+i,f*a+n,s,-Math.PI+l,l,!u)):t.moveTo(d*o+i,f*o+n),t.arc(i,n,o,l,c,!u),t.arc(m*a+i,g*a+n,s,c-2*Math.PI,c-Math.PI,!u),0!==r&&t.arc(i,n,r,c,l,u)},e}(xD),TY=MY;function IY(t,e,i){return e*Math.sin(t)*(i?-1:1)}function CY(t,e,i){return e*Math.cos(t)*(i?1:-1)}function PY(t,e,i){var n=t.get("borderRadius");if(null==n)return i?{cornerRadius:0}:null;EE(n)||(n=[n,n,n,n]);var r=Math.abs(e.r||0-e.r0||0);return{cornerRadius:vE(n,(function(t){return sC(t,r)}))}}var LY=Math.max,DY=Math.min;var RY=function(t){function e(){var i=t.call(this)||this;return i.type=e.type,i._isFirstFrame=!0,i}return zA(e,t),e.prototype.render=function(t,e,i,n){this._model=t,this._removeOnRenderedListener(i),this._updateDrawMode(t);var r=t.get("coordinateSystem");"cartesian2d"===r||"polar"===r?(this._progressiveEls=null,this._isLargeDraw?this._renderLarge(t,e,i):this._renderNormal(t,e,i,n)):"production"!==process.env.NODE_ENV&&$C("Only cartesian2d and polar supported for bar.")},e.prototype.incrementalPrepareRender=function(t){this._clear(),this._updateDrawMode(t),this._updateLargeClip(t)},e.prototype.incrementalRender=function(t,e){this._progressiveEls=[],this._incrementalRenderLarge(t,e)},e.prototype.eachRendered=function(t){lN(this._progressiveEls||this.group,t)},e.prototype._updateDrawMode=function(t){var e=t.pipelineContext.large;null!=this._isLargeDraw&&e===this._isLargeDraw||(this._isLargeDraw=e,this._clear())},e.prototype._renderNormal=function(t,e,i,n){var r,o=this.group,s=t.getData(),a=this._data,l=t.coordinateSystem,c=l.getBaseAxis();"cartesian2d"===l.type?r=c.isHorizontal():"polar"===l.type&&(r="angle"===c.dim);var u=t.isAnimationEnabled()?t:null,h=function(t,e){var i=t.get("realtimeSort",!0),n=e.getBaseAxis();"production"!==process.env.NODE_ENV&&i&&("category"!==n.type&&$C("`realtimeSort` will not work because this bar series is not based on a category axis."),"cartesian2d"!==e.type&&$C("`realtimeSort` will not work because this bar series is not on cartesian2d."));if(i&&"category"===n.type&&"cartesian2d"===e.type)return{baseAxis:n,otherAxis:e.getOtherAxis(n)}}(t,l);h&&this._enableRealtimeSort(h,s,i);var p=t.get("clip",!0)||h,d=function(t,e){var i=t.getArea&&t.getArea();if(rY(t,"cartesian2d")){var n=t.getBaseAxis();if("category"!==n.type||!n.onBand){var r=e.getLayout("bandWidth");n.isHorizontal()?(i.x-=r,i.width+=2*r):(i.y-=r,i.height+=2*r)}}return i}(l,s);o.removeClipPath();var f=t.get("roundCap",!0),m=t.get("showBackground",!0),g=t.getModel("backgroundStyle"),y=g.get("borderRadius")||0,v=[],_=this._backgroundEls,x=n&&n.isInitSort,b=n&&"changeAxisOrder"===n.type;function w(t){var e=UY[l.type](s,t),i=function(t,e,i){var n="polar"===t.type?jO:kD;return new n({shape:ZY(e,i,t),silent:!0,z2:0})}(l,r,e);return i.useStyle(g.getItemStyle()),"cartesian2d"===l.type?i.setShape("r",y):i.setShape("cornerRadius",y),v[t]=i,i}s.diff(a).add((function(e){var i=s.getItemModel(e),n=UY[l.type](s,e,i);if(m&&w(e),s.hasValue(e)&&VY[l.type](n)){var a=!1;p&&(a=OY[l.type](d,n));var g=kY[l.type](t,s,e,n,r,u,c.model,!1,f);h&&(g.forceLabelAnimation=!0),jY(g,s,e,i,n,t,r,"polar"===l.type),x?g.attr({shape:n}):h?NY(h,u,g,n,e,r,!1,!1):Lk(g,{shape:n},t,e),s.setItemGraphicEl(e,g),o.add(g),g.ignore=a}})).update((function(e,i){var n=s.getItemModel(e),A=UY[l.type](s,e,n);if(m){var E=void 0;0===_.length?E=w(i):((E=_[i]).useStyle(g.getItemStyle()),"cartesian2d"===l.type?E.setShape("r",y):E.setShape("cornerRadius",y),v[e]=E);var S=UY[l.type](s,e);Pk(E,{shape:ZY(r,S,l)},u,e)}var M=a.getItemGraphicEl(i);if(s.hasValue(e)&&VY[l.type](A)){var T=!1;if(p&&(T=OY[l.type](d,A))&&o.remove(M),M?Nk(M):M=kY[l.type](t,s,e,A,r,u,c.model,!!M,f),h&&(M.forceLabelAnimation=!0),b){var I=M.getTextContent();if(I){var C=wN(I);null!=C.prevValue&&(C.prevValue=C.value)}}else jY(M,s,e,n,A,t,r,"polar"===l.type);x?M.attr({shape:A}):h?NY(h,u,M,A,e,r,!0,b):Pk(M,{shape:A},t,e,null),s.setItemGraphicEl(e,M),M.ignore=T,o.add(M)}else o.remove(M)})).remove((function(e){var i=a.getItemGraphicEl(e);i&&kk(i,t,e)})).execute();var A=this._backgroundGroup||(this._backgroundGroup=new xC);A.removeAll();for(var E=0;E<v.length;++E)A.add(v[E]);o.add(A),this._backgroundEls=v,this._data=s},e.prototype._renderLarge=function(t,e,i){this._clear(),qY(t,this.group),this._updateLargeClip(t)},e.prototype._incrementalRenderLarge=function(t,e){this._removeBackground(),qY(e,this.group,this._progressiveEls,!0)},e.prototype._updateLargeClip=function(t){var e=t.get("clip",!0)&&nY(t.coordinateSystem,!1,t),i=this.group;e?i.setClipPath(e):i.removeClipPath()},e.prototype._enableRealtimeSort=function(t,e,i){var n=this;if(e.count()){var r=t.baseAxis;if(this._isFirstFrame)this._dispatchInitSort(e,t,i),this._isFirstFrame=!1;else{var o=function(t){var i=e.getItemGraphicEl(t),n=i&&i.shape;return n&&Math.abs(r.isHorizontal()?n.height:n.width)||0};this._onRendered=function(){n._updateSortWithinSameData(e,o,r,i)},i.getZr().on("rendered",this._onRendered)}}},e.prototype._dataSort=function(t,e,i){var n=[];return t.each(t.mapDimension(e.dim),(function(t,e){var r=i(e);r=null==r?NaN:r,n.push({dataIndex:e,mappedValue:r,ordinalNumber:t})})),n.sort((function(t,e){return e.mappedValue-t.mappedValue})),{ordinalNumbers:vE(n,(function(t){return t.ordinalNumber}))}},e.prototype._isOrderChangedWithinSameData=function(t,e,i){for(var n=i.scale,r=t.mapDimension(i.dim),o=Number.MAX_VALUE,s=0,a=n.getOrdinalMeta().categories.length;s<a;++s){var l=t.rawIndexOf(r,n.getRawOrdinalNumber(s)),c=l<0?Number.MIN_VALUE:e(t.indexOfRawIndex(l));if(c>o)return!0;o=c}return!1},e.prototype._isOrderDifferentInView=function(t,e){for(var i=e.scale,n=i.getExtent(),r=Math.max(0,n[0]),o=Math.min(n[1],i.getOrdinalMeta().categories.length-1);r<=o;++r)if(t.ordinalNumbers[r]!==i.getRawOrdinalNumber(r))return!0},e.prototype._updateSortWithinSameData=function(t,e,i,n){if(this._isOrderChangedWithinSameData(t,e,i)){var r=this._dataSort(t,i,e);this._isOrderDifferentInView(r,i)&&(this._removeOnRenderedListener(n),n.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",axisId:i.index,sortInfo:r}))}},e.prototype._dispatchInitSort=function(t,e,i){var n=e.baseAxis,r=this._dataSort(t,n,(function(i){return t.get(t.mapDimension(e.otherAxis.dim),i)}));i.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",isInitSort:!0,axisId:n.index,sortInfo:r})},e.prototype.remove=function(t,e){this._clear(this._model),this._removeOnRenderedListener(e)},e.prototype.dispose=function(t,e){this._removeOnRenderedListener(e)},e.prototype._removeOnRenderedListener=function(t){this._onRendered&&(t.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(t){var e=this.group,i=this._data;t&&t.isAnimationEnabled()&&i&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],i.eachItemGraphicEl((function(e){kk(e,t,KD(e).dataIndex)}))):e.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type="bar",e}(iU),OY={cartesian2d:function(t,e){var i=e.width<0?-1:1,n=e.height<0?-1:1;i<0&&(e.x+=e.width,e.width=-e.width),n<0&&(e.y+=e.height,e.height=-e.height);var r=t.x+t.width,o=t.y+t.height,s=LY(e.x,t.x),a=DY(e.x+e.width,r),l=LY(e.y,t.y),c=DY(e.y+e.height,o),u=a<s,h=c<l;return e.x=u&&s>r?a:s,e.y=h&&l>o?c:l,e.width=u?0:a-s,e.height=h?0:c-l,i<0&&(e.x+=e.width,e.width=-e.width),n<0&&(e.y+=e.height,e.height=-e.height),u||h},polar:function(t,e){var i=e.r0<=e.r?1:-1;if(i<0){var n=e.r;e.r=e.r0,e.r0=n}var r=DY(e.r,t.r),o=LY(e.r0,t.r0);e.r=r,e.r0=o;var s=r-o<0;if(i<0){n=e.r;e.r=e.r0,e.r0=n}return s}},kY={cartesian2d:function(t,e,i,n,r,o,s,a,l){var c=new kD({shape:pE({},n),z2:1});(c.__dataIndex=i,c.name="item",o)&&(c.shape[r?"height":"width"]=0);return c},polar:function(t,e,i,n,r,o,s,a,l){var c=!r&&l?TY:jO,u=new c({shape:n,z2:1});u.name="item";var h,p,d=GY(r);if(u.calculateTextPosition=(h=d,p=({isRoundCap:c===TY}||{}).isRoundCap,function(t,e,i){var n=e.position;if(!n||n instanceof Array)return aC(t,e,i);var r=h(n),o=null!=e.distance?e.distance:5,s=this.shape,a=s.cx,l=s.cy,c=s.r,u=s.r0,d=(c+u)/2,f=s.startAngle,m=s.endAngle,g=(f+m)/2,y=p?Math.abs(c-u)/2:0,v=Math.cos,_=Math.sin,x=a+c*v(f),b=l+c*_(f),w="left",A="top";switch(r){case"startArc":x=a+(u-o)*v(g),b=l+(u-o)*_(g),w="center",A="top";break;case"insideStartArc":x=a+(u+o)*v(g),b=l+(u+o)*_(g),w="center",A="bottom";break;case"startAngle":x=a+d*v(f)+IY(f,o+y,!1),b=l+d*_(f)+CY(f,o+y,!1),w="right",A="middle";break;case"insideStartAngle":x=a+d*v(f)+IY(f,-o+y,!1),b=l+d*_(f)+CY(f,-o+y,!1),w="left",A="middle";break;case"middle":x=a+d*v(g),b=l+d*_(g),w="center",A="middle";break;case"endArc":x=a+(c+o)*v(g),b=l+(c+o)*_(g),w="center",A="bottom";break;case"insideEndArc":x=a+(c-o)*v(g),b=l+(c-o)*_(g),w="center",A="top";break;case"endAngle":x=a+d*v(m)+IY(m,o+y,!0),b=l+d*_(m)+CY(m,o+y,!0),w="left",A="middle";break;case"insideEndAngle":x=a+d*v(m)+IY(m,-o+y,!0),b=l+d*_(m)+CY(m,-o+y,!0),w="right",A="middle";break;default:return aC(t,e,i)}return(t=t||{}).x=x,t.y=b,t.align=w,t.verticalAlign=A,t}),o){var f=r?"r":"endAngle",m={};u.shape[f]=r?n.r0:n.startAngle,m[f]=n[f],(a?Pk:Lk)(u,{shape:m},o)}return u}};function NY(t,e,i,n,r,o,s,a){var l,c;o?(c={x:n.x,width:n.width},l={y:n.y,height:n.height}):(c={y:n.y,height:n.height},l={x:n.x,width:n.width}),a||(s?Pk:Lk)(i,{shape:l},e,r,null),(s?Pk:Lk)(i,{shape:c},e?t.baseAxis.model:null,r)}function BY(t,e){for(var i=0;i<e.length;i++)if(!isFinite(t[e[i]]))return!0;return!1}var zY=["x","y","width","height"],FY=["cx","cy","r","startAngle","endAngle"],VY={cartesian2d:function(t){return!BY(t,zY)},polar:function(t){return!BY(t,FY)}},UY={cartesian2d:function(t,e,i){var n=t.getItemLayout(e),r=i?function(t,e){var i=t.get(["itemStyle","borderColor"]);if(!i||"none"===i)return 0;var n=t.get(["itemStyle","borderWidth"])||0,r=isNaN(e.width)?Number.MAX_VALUE:Math.abs(e.width),o=isNaN(e.height)?Number.MAX_VALUE:Math.abs(e.height);return Math.min(n,r,o)}(i,n):0,o=n.width>0?1:-1,s=n.height>0?1:-1;return{x:n.x+o*r/2,y:n.y+s*r/2,width:n.width-o*r,height:n.height-s*r}},polar:function(t,e,i){var n=t.getItemLayout(e);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}}};function GY(t){return function(t){var e=t?"Arc":"Angle";return function(t){switch(t){case"start":case"insideStart":case"end":case"insideEnd":return t+e;default:return t}}}(t)}function jY(t,e,i,n,r,o,s,a){var l=e.getItemVisual(i,"style");if(a){if(!o.get("roundCap")){var c=t.shape;pE(c,PY(n.getModel("itemStyle"),c,!0)),t.setShape(c)}}else{var u=n.get(["itemStyle","borderRadius"])||0;t.setShape("r",u)}t.useStyle(l);var h=n.getShallow("cursor");h&&t.attr("cursor",h);var p=a?s?r.r>=r.r0?"endArc":"startArc":r.endAngle>=r.startAngle?"endAngle":"startAngle":s?r.height>=0?"bottom":"top":r.width>=0?"right":"left",d=fN(n);dN(t,d,{labelFetcher:o,labelDataIndex:i,defaultText:kZ(o.getData(),i),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:p});var f=t.getTextContent();if(a&&f){var m=n.get(["label","position"]);t.textConfig.inside="middle"===m||null,function(t,e,i,n){if(IE(n))t.setTextConfig({rotation:n});else if(EE(e))t.setTextConfig({rotation:0});else{var r,o=t.shape,s=o.clockwise?o.startAngle:o.endAngle,a=o.clockwise?o.endAngle:o.startAngle,l=(s+a)/2,c=i(e);switch(c){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":r=l;break;case"startAngle":case"insideStartAngle":r=s;break;case"endAngle":case"insideEndAngle":r=a;break;default:return void t.setTextConfig({rotation:0})}var u=1.5*Math.PI-r;"middle"===c&&u>Math.PI/2&&u<1.5*Math.PI&&(u-=Math.PI),t.setTextConfig({rotation:u})}}(t,"outside"===m?p:m,GY(s),n.get(["label","rotate"]))}AN(f,d,o.getRawValue(i),(function(t){return NZ(e,t)}));var g=n.getModel(["emphasis"]);XR(t,g.get("focus"),g.get("blurScope"),g.get("disabled")),JR(t,n),function(t){return null!=t.startAngle&&null!=t.endAngle&&t.startAngle===t.endAngle}(r)&&(t.style.fill="none",t.style.stroke="none",yE(t.states,(function(t){t.style&&(t.style.fill=t.style.stroke="none")})))}var HY=function(){},WY=function(t){function e(e){var i=t.call(this,e)||this;return i.type="largeBar",i}return zA(e,t),e.prototype.getDefaultShape=function(){return new HY},e.prototype.buildPath=function(t,e){for(var i=e.points,n=this.baseDimIdx,r=1-this.baseDimIdx,o=[],s=[],a=this.barWidth,l=0;l<i.length;l+=3)s[n]=a,s[r]=i[l+2],o[n]=i[l+n],o[r]=i[l+r],t.rect(o[0],o[1],s[0],s[1])},e}(xD);function qY(t,e,i,n){var r=t.getData(),o=r.getLayout("valueAxisHorizontal")?1:0,s=r.getLayout("largeDataIndices"),a=r.getLayout("size"),l=t.getModel("backgroundStyle"),c=r.getLayout("largeBackgroundPoints");if(c){var u=new WY({shape:{points:c},incremental:!!n,silent:!0,z2:0});u.baseDimIdx=o,u.largeDataIndices=s,u.barWidth=a,u.useStyle(l.getItemStyle()),e.add(u),i&&i.push(u)}var h=new WY({shape:{points:r.getLayout("largePoints")},incremental:!!n,ignoreCoarsePointer:!0,z2:1});h.baseDimIdx=o,h.largeDataIndices=s,h.barWidth=a,e.add(h),h.useStyle(r.getVisual("style")),KD(h).seriesIndex=t.seriesIndex,t.get("silent")||(h.on("mousedown",XY),h.on("mousemove",XY)),i&&i.push(h)}var XY=sU((function(t){var e=function(t,e,i){for(var n=t.baseDimIdx,r=1-n,o=t.shape.points,s=t.largeDataIndices,a=[],l=[],c=t.barWidth,u=0,h=o.length/3;u<h;u++){var p=3*u;if(l[n]=c,l[r]=o[p+2],a[n]=o[p+n],a[r]=o[p+r],l[r]<0&&(a[r]+=l[r],l[r]=-l[r]),e>=a[0]&&e<=a[0]+l[0]&&i>=a[1]&&i<=a[1]+l[1])return s[u]}return-1}(this,t.offsetX,t.offsetY);KD(this).dataIndex=e>=0?e:null}),30,!1);function ZY(t,e,i){if(rY(i,"cartesian2d")){var n=e,r=i.getArea();return{x:t?n.x:r.x,y:t?r.y:n.y,width:t?n.width:r.width,height:t?r.height:n.height}}var o=e;return{cx:(r=i.getArea()).cx,cy:r.cy,r0:t?r.r0:o.r0,r:t?r.r:o.r,startAngle:t?o.startAngle:0,endAngle:t?o.endAngle:2*Math.PI}}var YY=RY;var QY=2*Math.PI,JY=Math.PI/180;function KY(t,e){return UB(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function $Y(t,e){var i=KY(t,e),n=t.get("center"),r=t.get("radius");EE(r)||(r=[0,r]);var o,s,a=IC(i.width,e.getWidth()),l=IC(i.height,e.getHeight()),c=Math.min(a,l),u=IC(r[0],c/2),h=IC(r[1],c/2),p=t.coordinateSystem;if(p){var d=p.dataToPoint(n);o=d[0]||0,s=d[1]||0}else EE(n)||(n=[n,n]),o=IC(n[0],a)+i.x,s=IC(n[1],l)+i.y;return{cx:o,cy:s,r0:u,r:h}}function tQ(t,e,i){e.eachSeriesByType(t,(function(t){var e=t.getData(),n=e.mapDimension("value"),r=KY(t,i),o=$Y(t,i),s=o.cx,a=o.cy,l=o.r,c=o.r0,u=-t.get("startAngle")*JY,h=t.get("minAngle")*JY,p=0;e.each(n,(function(t){!isNaN(t)&&p++}));var d=e.getSum(n),f=Math.PI/(d||p)*2,m=t.get("clockwise"),g=t.get("roseType"),y=t.get("stillShowZeroSum"),v=e.getDataExtent(n);v[0]=0;var _=QY,x=0,b=u,w=m?1:-1;if(e.setLayout({viewRect:r,r:l}),e.each(n,(function(t,i){var n;if(isNaN(t))e.setItemLayout(i,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:m,cx:s,cy:a,r0:c,r:g?NaN:l});else{(n="area"!==g?0===d&&y?f:t*f:QY/p)<h?(n=h,_-=h):x+=t;var r=b+w*n;e.setItemLayout(i,{angle:n,startAngle:b,endAngle:r,clockwise:m,cx:s,cy:a,r0:c,r:g?TC(t,v,[c,l]):l}),b=r}})),_<QY&&p)if(_<=.001){var A=QY/p;e.each(n,(function(t,i){if(!isNaN(t)){var n=e.getItemLayout(i);n.angle=A,n.startAngle=u+w*i*A,n.endAngle=u+w*(i+1)*A}}))}else f=_/x,b=u,e.each(n,(function(t,i){if(!isNaN(t)){var n=e.getItemLayout(i),r=n.angle===h?h:t*f;n.startAngle=b,n.endAngle=b+w*r,b+=w*r}}))}))}function eQ(t){return{seriesType:t,reset:function(t,e){var i=e.findComponents({mainType:"legend"});if(i&&i.length){var n=t.getData();n.filterSelf((function(t){for(var e=n.getName(t),r=0;r<i.length;r++)if(!i[r].isSelected(e))return!1;return!0}))}}}}var iQ=Math.PI/180;function nQ(t,e,i,n,r,o,s,a,l,c){if(!(t.length<2)){for(var u=t.length,h=0;h<u;h++)if("outer"===t[h].position&&"labelLine"===t[h].labelAlignTo){var p=t[h].label.x-c;t[h].linePoints[1][0]+=p,t[h].label.x=c}Kq(t,l,l+s)&&function(t){for(var o={list:[],maxY:0},s={list:[],maxY:0},a=0;a<t.length;a++)if("none"===t[a].labelAlignTo){var l=t[a],c=l.label.y>i?s:o,u=Math.abs(l.label.y-i);if(u>=c.maxY){var h=l.label.x-e-l.len2*r,p=n+l.len,f=Math.abs(h)<p?Math.sqrt(u*u/(1-h*h/p/p)):p;c.rB=f,c.maxY=u}c.list.push(l)}d(o),d(s)}(t)}function d(t){for(var o=t.rB,s=o*o,a=0;a<t.list.length;a++){var l=t.list[a],c=Math.abs(l.label.y-i),u=n+l.len,h=u*u,p=Math.sqrt((1-Math.abs(c*c/s))*h),d=e+(p+l.len2)*r,f=d-l.label.x;rQ(l,l.targetTextWidth-f*r,!0),l.label.x=d}}}function rQ(t,e,i){if(void 0===i&&(i=!1),null==t.labelStyleWidth){var n=t.label,r=n.style,o=t.rect,s=r.backgroundColor,a=r.padding,l=a?a[1]+a[3]:0,c=r.overflow,u=o.width+(s?0:l);if(e<u||i){var h=o.height;if(c&&c.match("break")){n.setStyle("backgroundColor",null),n.setStyle("width",e-l);var p=n.getBoundingRect();n.setStyle("width",Math.ceil(p.width)),n.setStyle("backgroundColor",s)}else{var d=e-l,f=e<u?d:i?d>t.unconstrainedWidth?null:d:null;n.setStyle("width",f)}var m=n.getBoundingRect();o.width=m.width;var g=(n.style.margin||0)+2.1;o.height=m.height+g,o.y-=(o.height-h)/2}}}function oQ(t){return"center"===t.position}function sQ(t){var e,i,n=t.getData(),r=[],o=!1,s=(t.get("minShowLabelAngle")||0)*iQ,a=n.getLayout("viewRect"),l=n.getLayout("r"),c=a.width,u=a.x,h=a.y,p=a.height;function d(t){t.ignore=!0}n.each((function(t){var a=n.getItemGraphicEl(t),h=a.shape,p=a.getTextContent(),f=a.getTextGuideLine(),m=n.getItemModel(t),g=m.getModel("label"),y=g.get("position")||m.get(["emphasis","label","position"]),v=g.get("distanceToLabelLine"),_=g.get("alignTo"),x=IC(g.get("edgeDistance"),c),b=g.get("bleedMargin"),w=m.getModel("labelLine"),A=w.get("length");A=IC(A,c);var E=w.get("length2");if(E=IC(E,c),Math.abs(h.endAngle-h.startAngle)<s)return yE(p.states,d),p.ignore=!0,void(f&&(yE(f.states,d),f.ignore=!0));if(function(t){if(!t.ignore)return!0;for(var e in t.states)if(!1===t.states[e].ignore)return!0;return!1}(p)){var S,M,T,I,C=(h.startAngle+h.endAngle)/2,P=Math.cos(C),L=Math.sin(C);e=h.cx,i=h.cy;var D="inside"===y||"inner"===y;if("center"===y)S=h.cx,M=h.cy,I="center";else{var R=(D?(h.r+h.r0)/2*P:h.r*P)+e,O=(D?(h.r+h.r0)/2*L:h.r*L)+i;if(S=R+3*P,M=O+3*L,!D){var k=R+P*(A+l-h.r),N=O+L*(A+l-h.r),B=k+(P<0?-1:1)*E;S="edge"===_?P<0?u+x:u+c-x:B+(P<0?-v:v),M=N,T=[[R,O],[k,N],[B,N]]}I=D?"center":"edge"===_?P>0?"right":"left":P>0?"left":"right"}var z=Math.PI,F=0,V=g.get("rotate");if(IE(V))F=V*(z/180);else if("center"===y)F=0;else if("radial"===V||!0===V){F=P<0?-C+z:-C}else if("tangential"===V&&"outside"!==y&&"outer"!==y){var U=Math.atan2(P,L);U<0&&(U=2*z+U),L>0&&(U=z+U),F=U-z}if(o=!!F,p.x=S,p.y=M,p.rotation=F,p.setStyle({verticalAlign:"middle"}),D){p.setStyle({align:I});var G=p.states.select;G&&(G.x+=p.x,G.y+=p.y)}else{var j=p.getBoundingRect().clone();j.applyTransform(p.getComputedTransform());var H=(p.style.margin||0)+2.1;j.y-=H/2,j.height+=H,r.push({label:p,labelLine:f,position:y,len:A,len2:E,minTurnAngle:w.get("minTurnAngle"),maxSurfaceAngle:w.get("maxSurfaceAngle"),surfaceNormal:new iM(P,L),linePoints:T,textAlign:I,labelDistance:v,labelAlignTo:_,edgeDistance:x,bleedMargin:b,rect:j,unconstrainedWidth:j.width,labelStyleWidth:p.style.width})}a.setTextConfig({inside:D})}})),!o&&t.get("avoidLabelOverlap")&&function(t,e,i,n,r,o,s,a){for(var l=[],c=[],u=Number.MAX_VALUE,h=-Number.MAX_VALUE,p=0;p<t.length;p++){var d=t[p].label;oQ(t[p])||(d.x<e?(u=Math.min(u,d.x),l.push(t[p])):(h=Math.max(h,d.x),c.push(t[p])))}for(p=0;p<t.length;p++)if(!oQ(g=t[p])&&g.linePoints){if(null!=g.labelStyleWidth)continue;d=g.label;var f=g.linePoints,m=void 0;m="edge"===g.labelAlignTo?d.x<e?f[2][0]-g.labelDistance-s-g.edgeDistance:s+r-g.edgeDistance-f[2][0]-g.labelDistance:"labelLine"===g.labelAlignTo?d.x<e?u-s-g.bleedMargin:s+r-h-g.bleedMargin:d.x<e?d.x-s-g.bleedMargin:s+r-d.x-g.bleedMargin,g.targetTextWidth=m,rQ(g,m)}for(nQ(c,e,i,n,1,0,o,0,a,h),nQ(l,e,i,n,-1,0,o,0,a,u),p=0;p<t.length;p++){var g;if(!oQ(g=t[p])&&g.linePoints){d=g.label,f=g.linePoints;var y="edge"===g.labelAlignTo,v=d.style.padding,_=v?v[1]+v[3]:0,x=d.style.backgroundColor?0:_,b=g.rect.width+x,w=f[1][0]-f[2][0];y?d.x<e?f[2][0]=s+g.edgeDistance+b+g.labelDistance:f[2][0]=s+r-g.edgeDistance-b-g.labelDistance:(d.x<e?f[2][0]=d.x+g.labelDistance:f[2][0]=d.x-g.labelDistance,f[1][0]=f[2][0]+w),f[1][1]=f[2][1]=d.y}}}(r,e,i,l,c,p,u,h);for(var f=0;f<r.length;f++){var m=r[f],g=m.label,y=m.labelLine,v=isNaN(g.x)||isNaN(g.y);if(g){g.setStyle({align:m.textAlign}),v&&(yE(g.states,d),g.ignore=!0);var _=g.states.select;_&&(_.x+=g.x,_.y+=g.y)}if(y){var x=m.linePoints;v||!x?(yE(y.states,d),y.ignore=!0):(Hq(x,m.minTurnAngle),Wq(x,m.surfaceNormal,m.maxSurfaceAngle),y.setShape({points:x}),g.__hostTarget.textGuideLineConfig={anchor:new iM(x[0][0],x[0][1])})}}}var aQ=function(t){function e(e,i,n){var r=t.call(this)||this;r.z2=2;var o=new JD;return r.setTextContent(o),r.updateData(e,i,n,!0),r}return zA(e,t),e.prototype.updateData=function(t,e,i,n){var r=this,o=t.hostModel,s=t.getItemModel(e),a=s.getModel("emphasis"),l=t.getItemLayout(e),c=pE(PY(s.getModel("itemStyle"),l,!0),l);if(isNaN(c.startAngle))r.setShape(c);else{if(n){r.setShape(c);var u=o.getShallow("animationType");o.ecModel.ssr?(Lk(r,{scaleX:0,scaleY:0},o,{dataIndex:e,isFrom:!0}),r.originX=c.cx,r.originY=c.cy):"scale"===u?(r.shape.r=l.r0,Lk(r,{shape:{r:l.r}},o,e)):null!=i?(r.setShape({startAngle:i,endAngle:i}),Lk(r,{shape:{startAngle:l.startAngle,endAngle:l.endAngle}},o,e)):(r.shape.endAngle=l.startAngle,Pk(r,{shape:{endAngle:l.endAngle}},o,e))}else Nk(r),Pk(r,{shape:c},o,e);r.useStyle(t.getItemVisual(e,"style")),JR(r,s);var h=(l.startAngle+l.endAngle)/2,p=o.get("selectedOffset"),d=Math.cos(h)*p,f=Math.sin(h)*p,m=s.getShallow("cursor");m&&r.attr("cursor",m),this._updateLabel(o,t,e),r.ensureState("emphasis").shape=pE({r:l.r+(a.get("scale")&&a.get("scaleSize")||0)},PY(a.getModel("itemStyle"),l)),pE(r.ensureState("select"),{x:d,y:f,shape:PY(s.getModel(["select","itemStyle"]),l)}),pE(r.ensureState("blur"),{shape:PY(s.getModel(["blur","itemStyle"]),l)});var g=r.getTextGuideLine(),y=r.getTextContent();g&&pE(g.ensureState("select"),{x:d,y:f}),pE(y.ensureState("select"),{x:d,y:f}),XR(this,a.get("focus"),a.get("blurScope"),a.get("disabled"))}},e.prototype._updateLabel=function(t,e,i){var n=this,r=e.getItemModel(i),o=r.getModel("labelLine"),s=e.getItemVisual(i,"style"),a=s&&s.fill,l=s&&s.opacity;dN(n,fN(r),{labelFetcher:e.hostModel,labelDataIndex:i,inheritColor:a,defaultOpacity:l,defaultText:t.getFormattedLabel(i,"normal")||e.getName(i)});var c=n.getTextContent();n.setTextConfig({position:null,rotation:null}),c.attr({z2:10});var u=t.get(["label","position"]);if("outside"!==u&&"outer"!==u)n.removeTextGuideLine();else{var h=this.getTextGuideLine();h||(h=new $O,this.setTextGuideLine(h)),Zq(this,Yq(r),{stroke:a,opacity:zE(o.get(["lineStyle","opacity"]),l,1)})}},e}(jO),lQ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.ignoreLabelLineUpdate=!0,e}return zA(e,t),e.prototype.render=function(t,e,i,n){var r,o=t.getData(),s=this._data,a=this.group;if(!s&&o.count()>0){for(var l=o.getItemLayout(0),c=1;isNaN(l&&l.startAngle)&&c<o.count();++c)l=o.getItemLayout(c);l&&(r=l.startAngle)}if(this._emptyCircleSector&&a.remove(this._emptyCircleSector),0===o.count()&&t.get("showEmptyCircle")){var u=new jO({shape:$Y(t,i)});u.useStyle(t.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=u,a.add(u)}o.diff(s).add((function(t){var e=new aQ(o,t,r);o.setItemGraphicEl(t,e),a.add(e)})).update((function(t,e){var i=s.getItemGraphicEl(e);i.updateData(o,t,r),i.off("click"),a.add(i),o.setItemGraphicEl(t,i)})).remove((function(e){kk(s.getItemGraphicEl(e),t,e)})).execute(),sQ(t),"expansion"!==t.get("animationTypeUpdate")&&(this._data=o)},e.prototype.dispose=function(){},e.prototype.containPoint=function(t,e){var i=e.getData().getItemLayout(0);if(i){var n=t[0]-i.cx,r=t[1]-i.cy,o=Math.sqrt(n*n+r*r);return o<=i.r&&o>=i.r0}},e.type="pie",e}(iU),cQ=lQ;function uQ(t,e,i){e=EE(e)&&{coordDimensions:e}||pE({encodeDefine:t.getEncode()},e);var n=t.getSource(),r=LH(n,e).dimensions,o=new PH(r,t);return o.initData(n,i),o}var hQ=function(){function t(t,e){this._getDataWithEncodedVisual=t,this._getRawData=e}return t.prototype.getAllNames=function(){var t=this._getRawData();return t.mapArray(t.getName)},t.prototype.containName=function(t){return this._getRawData().indexOfName(t)>=0},t.prototype.indexOfName=function(t){return this._getDataWithEncodedVisual().indexOfName(t)},t.prototype.getItemVisual=function(t,e){return this._getDataWithEncodedVisual().getItemVisual(t,e)},t}(),pQ=hQ,dQ=wP(),fQ=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return zA(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new pQ(wE(this.getData,this),wE(this.getRawData,this)),this._defaultLabelLine(e)},e.prototype.mergeOption=function(){t.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return uQ(this,{coordDimensions:["value"],encodeDefaulter:AE(hz,this)})},e.prototype.getDataParams=function(e){var i=this.getData(),n=dQ(i),r=n.seats;if(!r){var o=[];i.each(i.mapDimension("value"),(function(t){o.push(t)})),r=n.seats=function(t,e){var i=_E(t,(function(t,e){return t+(isNaN(e)?0:e)}),0);if(0===i)return[];for(var n=Math.pow(10,e),r=vE(t,(function(t){return(isNaN(t)?0:t)/i*n*100})),o=100*n,s=vE(r,(function(t){return Math.floor(t)})),a=_E(s,(function(t,e){return t+e}),0),l=vE(r,(function(t,e){return t-s[e]}));a<o;){for(var c=Number.NEGATIVE_INFINITY,u=null,h=0,p=l.length;h<p;++h)l[h]>c&&(c=l[h],u=h);++s[u],l[u]=0,++a}return vE(s,(function(t){return t/n}))}(o,i.hostModel.get("percentPrecision"))}var s=t.prototype.getDataParams.call(this,e);return s.percent=r[e]||0,s.$vars.push("percent"),s},e.prototype._defaultLabelLine=function(t){cP(t,"labelLine",["show"]);var e=t.labelLine,i=t.emphasis.labelLine;e.show=e.show&&t.label.show,i.show=i.show&&t.emphasis.label.show},e.type="series.pie",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},e}(HV),mQ=fQ;var gQ=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.hasSymbolVisual=!0,i}return zA(e,t),e.prototype.getInitialData=function(t,e){return FH(null,this,{useEncodeDefaulter:!0})},e.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?5e3:this.get("progressive"):t},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?1e4:this.get("progressiveThreshold"):t},e.prototype.brushSelector=function(t,e,i){return i.point(e.getItemLayout(t))},e.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},e.type="series.scatter",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},e}(HV),yQ=gQ,vQ=function(){},_Q=function(t){function e(e){var i=t.call(this,e)||this;return i._off=0,i.hoverDataIdx=-1,i}return zA(e,t),e.prototype.getDefaultShape=function(){return new vQ},e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.buildPath=function(t,e){var i,n=e.points,r=e.size,o=this.symbolProxy,s=o.shape,a=t.getContext?t.getContext():t,l=a&&r[0]<4,c=this.softClipShape;if(l)this._ctx=a;else{for(this._ctx=null,i=this._off;i<n.length;){var u=n[i++],h=n[i++];isNaN(u)||isNaN(h)||(c&&!c.contain(u,h)||(s.x=u-r[0]/2,s.y=h-r[1]/2,s.width=r[0],s.height=r[1],o.buildPath(t,s,!0)))}this.incremental&&(this._off=i,this.notClear=!0)}},e.prototype.afterBrush=function(){var t,e=this.shape,i=e.points,n=e.size,r=this._ctx,o=this.softClipShape;if(r){for(t=this._off;t<i.length;){var s=i[t++],a=i[t++];isNaN(s)||isNaN(a)||(o&&!o.contain(s,a)||r.fillRect(s-n[0]/2,a-n[1]/2,n[0],n[1]))}this.incremental&&(this._off=t,this.notClear=!0)}},e.prototype.findDataIndex=function(t,e){for(var i=this.shape,n=i.points,r=i.size,o=Math.max(r[0],4),s=Math.max(r[1],4),a=n.length/2-1;a>=0;a--){var l=2*a,c=n[l]-o/2,u=n[l+1]-s/2;if(t>=c&&e>=u&&t<=c+o&&e<=u+s)return a}return-1},e.prototype.contain=function(t,e){var i=this.transformCoordToLocal(t,e),n=this.getBoundingRect();return t=i[0],e=i[1],n.contain(t,e)?(this.hoverDataIdx=this.findDataIndex(t,e))>=0:(this.hoverDataIdx=-1,!1)},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var e=this.shape,i=e.points,n=e.size,r=n[0],o=n[1],s=1/0,a=1/0,l=-1/0,c=-1/0,u=0;u<i.length;){var h=i[u++],p=i[u++];s=Math.min(h,s),l=Math.max(h,l),a=Math.min(p,a),c=Math.max(p,c)}t=this._rect=new pM(s-r/2,a-o/2,l-s+r,c-a+o)}return t},e}(xD),xQ=function(){function t(){this.group=new xC}return t.prototype.updateData=function(t,e){this._clear();var i=this._create();i.setShape({points:t.getLayout("points")}),this._setCommon(i,t,e)},t.prototype.updateLayout=function(t){var e=t.getLayout("points");this.group.eachChild((function(t){if(null!=t.startIndex){var i=2*(t.endIndex-t.startIndex),n=4*t.startIndex*2;e=new Float32Array(e.buffer,n,i)}t.setShape("points",e),t.reset()}))},t.prototype.incrementalPrepareUpdate=function(t){this._clear()},t.prototype.incrementalUpdate=function(t,e,i){var n=this._newAdded[0],r=e.getLayout("points"),o=n&&n.shape.points;if(o&&o.length<2e4){var s=o.length,a=new Float32Array(s+r.length);a.set(o),a.set(r,s),n.endIndex=t.end,n.setShape({points:a})}else{this._newAdded=[];var l=this._create();l.startIndex=t.start,l.endIndex=t.end,l.incremental=!0,l.setShape({points:r}),this._setCommon(l,e,i)}},t.prototype.eachRendered=function(t){this._newAdded[0]&&t(this._newAdded[0])},t.prototype._create=function(){var t=new _Q({cursor:"default"});return t.ignoreCoarsePointer=!0,this.group.add(t),this._newAdded.push(t),t},t.prototype._setCommon=function(t,e,i){var n=e.hostModel;i=i||{};var r=e.getVisual("symbolSize");t.setShape("size",r instanceof Array?r:[r,r]),t.softClipShape=i.clipShape||null,t.symbolProxy=pG(e.getVisual("symbol"),0,0,0,0),t.setColor=t.symbolProxy.setColor;var o=t.shape.size[0]<4;t.useStyle(n.getModel("itemStyle").getItemStyle(o?["color","shadowBlur","shadowColor"]:["color"]));var s=e.getVisual("style"),a=s&&s.fill;a&&t.setColor(a);var l=KD(t);l.seriesIndex=n.seriesIndex,t.on("mousemove",(function(e){l.dataIndex=null;var i=t.hoverDataIdx;i>=0&&(l.dataIndex=i+(t.startIndex||0))}))},t.prototype.remove=function(){this._clear()},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}(),bQ=xQ,wQ=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.render=function(t,e,i){var n=t.getData();this._updateSymbolDraw(n,t).updateData(n,{clipShape:this._getClipShape(t)}),this._finished=!0},e.prototype.incrementalPrepareRender=function(t,e,i){var n=t.getData();this._updateSymbolDraw(n,t).incrementalPrepareUpdate(n),this._finished=!1},e.prototype.incrementalRender=function(t,e,i){this._symbolDraw.incrementalUpdate(t,e.getData(),{clipShape:this._getClipShape(e)}),this._finished=t.end===e.getData().count()},e.prototype.updateTransform=function(t,e,i){var n=t.getData();if(this.group.dirty(),!this._finished||n.count()>1e4)return{update:!0};var r=yY("").reset(t,e,i);r.progress&&r.progress({start:0,end:n.count(),count:n.count()},n),this._symbolDraw.updateLayout(n)},e.prototype.eachRendered=function(t){this._symbolDraw&&this._symbolDraw.eachRendered(t)},e.prototype._getClipShape=function(t){var e=t.coordinateSystem,i=e&&e.getArea&&e.getArea();return t.get("clip",!0)?i:null},e.prototype._updateSymbolDraw=function(t,e){var i=this._symbolDraw,n=e.pipelineContext.large;return i&&n===this._isLargeDraw||(i&&i.remove(),i=this._symbolDraw=n?new bQ:new HZ,this._isLargeDraw=n,this.group.removeAll()),this.group.add(i.group),i},e.prototype.remove=function(t,e){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}(iU),AQ=wQ,EQ=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return zA(e,t),e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},e}(YB),SQ=EQ,MQ=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return zA(e,t),e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",MP).models[0]},e.type="cartesian2dAxis",e}(YB);mE(MQ,KW);var TQ={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},IQ=uE({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},TQ),CQ=uE({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},TQ),PQ={category:IQ,value:CQ,time:uE({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},CQ),log:dE({logBase:10},CQ)},LQ={value:1,category:1,time:1,log:1};function DQ(t,e,i,n){yE(LQ,(function(r,o){var s=uE(uE({},PQ[o],!0),n,!0),a=function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e+"Axis."+o,i}return zA(i,t),i.prototype.mergeDefaultAndTheme=function(t,e){var i=jB(this),n=i?WB(t):{};uE(t,e.getTheme().get(o+"Axis")),uE(t,this.getDefaultOption()),t.type=RQ(t),i&&HB(t,n,i)},i.prototype.optionUpdated=function(){"category"===this.option.type&&(this.__ordinalMeta=WH.createByAxisModel(this))},i.prototype.getCategories=function(t){var e=this.option;if("category"===e.type)return t?e.data:this.__ordinalMeta.categories},i.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},i.type=e+"Axis."+o,i.defaultOption=s,i}(i);t.registerComponentModel(a)})),t.registerSubTypeDefaulter(e+"Axis",RQ)}function RQ(t){return t.type||(t.data?"category":"value")}var OQ=function(){function t(t){this.type="cartesian",this._dimList=[],this._axes={},this.name=t||""}return t.prototype.getAxis=function(t){return this._axes[t]},t.prototype.getAxes=function(){return vE(this._dimList,(function(t){return this._axes[t]}),this)},t.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),xE(this.getAxes(),(function(e){return e.scale.type===t}))},t.prototype.addAxis=function(t){var e=t.dim;this._axes[e]=t,this._dimList.push(e)},t}(),kQ=["x","y"];function NQ(t){return"interval"===t.type||"time"===t.type}var BQ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="cartesian2d",e.dimensions=kQ,e}return zA(e,t),e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var t=this.getAxis("x").scale,e=this.getAxis("y").scale;if(NQ(t)&&NQ(e)){var i=t.getExtent(),n=e.getExtent(),r=this.dataToPoint([i[0],n[0]]),o=this.dataToPoint([i[1],n[1]]),s=i[1]-i[0],a=n[1]-n[0];if(s&&a){var l=(o[0]-r[0])/s,c=(o[1]-r[1])/a,u=r[0]-i[0]*l,h=r[1]-n[0]*c,p=this._transform=[l,0,0,c,u,h];this._invTransform=tM([],p)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(t){var e=this.getAxis("x"),i=this.getAxis("y");return e.contain(e.toLocalCoord(t[0]))&&i.contain(i.toLocalCoord(t[1]))},e.prototype.containData=function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},e.prototype.containZone=function(t,e){var i=this.dataToPoint(t),n=this.dataToPoint(e),r=this.getArea(),o=new pM(i[0],i[1],n[0]-i[0],n[1]-i[1]);return r.intersect(o)},e.prototype.dataToPoint=function(t,e,i){i=i||[];var n=t[0],r=t[1];if(this._transform&&null!=n&&isFinite(n)&&null!=r&&isFinite(r))return gS(i,t,this._transform);var o=this.getAxis("x"),s=this.getAxis("y");return i[0]=o.toGlobalCoord(o.dataToCoord(n,e)),i[1]=s.toGlobalCoord(s.dataToCoord(r,e)),i},e.prototype.clampData=function(t,e){var i=this.getAxis("x").scale,n=this.getAxis("y").scale,r=i.getExtent(),o=n.getExtent(),s=i.parse(t[0]),a=n.parse(t[1]);return(e=e||[])[0]=Math.min(Math.max(Math.min(r[0],r[1]),s),Math.max(r[0],r[1])),e[1]=Math.min(Math.max(Math.min(o[0],o[1]),a),Math.max(o[0],o[1])),e},e.prototype.pointToData=function(t,e){var i=[];if(this._invTransform)return gS(i,t,this._invTransform);var n=this.getAxis("x"),r=this.getAxis("y");return i[0]=n.coordToData(n.toLocalCoord(t[0]),e),i[1]=r.coordToData(r.toLocalCoord(t[1]),e),i},e.prototype.getOtherAxis=function(t){return this.getAxis("x"===t.dim?"y":"x")},e.prototype.getArea=function(){var t=this.getAxis("x").getGlobalExtent(),e=this.getAxis("y").getGlobalExtent(),i=Math.min(t[0],t[1]),n=Math.min(e[0],e[1]),r=Math.max(t[0],t[1])-i,o=Math.max(e[0],e[1])-n;return new pM(i,n,r,o)},e}(OQ),zQ=function(t){function e(e,i,n,r,o){var s=t.call(this,e,i,n)||this;return s.index=0,s.type=r||"value",s.position=o||"bottom",s}return zA(e,t),e.prototype.isHorizontal=function(){var t=this.position;return"top"===t||"bottom"===t},e.prototype.getGlobalExtent=function(t){var e=this.getExtent();return e[0]=this.toGlobalCoord(e[0]),e[1]=this.toGlobalCoord(e[1]),t&&e[0]>e[1]&&e.reverse(),e},e.prototype.pointToData=function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},e.prototype.setCategorySortInfo=function(t){if("category"!==this.type)return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},e}(Sq),FQ=zQ;function VQ(t,e,i){i=i||{};var n=t.coordinateSystem,r=e.axis,o={},s=r.getAxesOnZeroOf()[0],a=r.position,l=s?"onZero":a,c=r.dim,u=n.getRect(),h=[u.x,u.x+u.width,u.y,u.y+u.height],p={left:0,right:1,top:0,bottom:1,onZero:2},d=e.get("offset")||0,f="x"===c?[h[2]-d,h[3]+d]:[h[0]-d,h[1]+d];if(s){var m=s.toGlobalCoord(s.dataToCoord(0));f[p.onZero]=Math.max(Math.min(m,f[1]),f[0])}o.position=["y"===c?f[p[l]]:h[0],"x"===c?f[p[l]]:h[3]],o.rotation=Math.PI/2*("x"===c?0:1);o.labelDirection=o.tickDirection=o.nameDirection={top:-1,bottom:1,left:-1,right:1}[a],o.labelOffset=s?f[p[a]]-f[p.onZero]:0,e.get(["axisTick","inside"])&&(o.tickDirection=-o.tickDirection),NE(i.labelInside,e.get(["axisLabel","inside"]))&&(o.labelDirection=-o.labelDirection);var g=e.get(["axisLabel","rotate"]);return o.labelRotate="top"===l?-g:g,o.z2=1,o}function UQ(t){return"cartesian2d"===t.get("coordinateSystem")}function GQ(t){var e={xAxisModel:null,yAxisModel:null};return yE(e,(function(i,n){var r=n.replace(/Model$/,""),o=t.getReferringComponents(r,MP).models[0];if("production"!==process.env.NODE_ENV&&!o)throw new Error(r+' "'+zE(t.get(r+"Index"),t.get(r+"Id"),0)+'" not found');e[n]=o})),e}var jQ=Math.log;function HQ(t,e,i){var n=rW.prototype,r=n.getTicks.call(i),o=n.getTicks.call(i,!0),s=r.length-1,a=n.getInterval.call(i),l=jW(t,e),c=l.extent,u=l.fixMin,h=l.fixMax;if("log"===t.type){var p=jQ(t.base);c=[jQ(c[0])/p,jQ(c[1])/p]}t.setExtent(c[0],c[1]),t.calcNiceExtent({splitNumber:s,fixMin:u,fixMax:h});var d=n.getExtent.call(t);u&&(c[0]=d[0]),h&&(c[1]=d[1]);var f=n.getInterval.call(t),m=c[0],g=c[1];if(u&&h)f=(g-m)/s;else if(u)for(g=c[0]+f*s;g<c[1]&&isFinite(g)&&isFinite(c[1]);)f=ZH(f),g=c[0]+f*s;else if(h)for(m=c[1]-f*s;m>c[0]&&isFinite(m)&&isFinite(c[0]);)f=ZH(f),m=c[1]-f*s;else{t.getTicks().length-1>s&&(f=ZH(f));var y=f*s;(m=CC((g=Math.ceil(c[1]/f)*f)-y))<0&&c[0]>=0?(m=0,g=CC(y)):g>0&&c[1]<=0&&(g=0,m=-CC(y))}var v=(r[0].value-o[0].value)/a,_=(r[s].value-o[s].value)/a;if(n.setExtent.call(t,m+f*v,g+f*_),n.setInterval.call(t,f),(v||_)&&n.setNiceExtent.call(t,m+f,g-f),"production"!==process.env.NODE_ENV){var x=n.getTicks.call(t);x[1]&&(!function(t){var e=Math.pow(10,VC(Math.abs(t))),i=Math.abs(t/e);return 0===i||1===i||2===i||3===i||5===i}(f)||DC(x[1].value)>DC(f))&&$C("The ticks may be not readable when set min: "+e.get("min")+", max: "+e.get("max")+" and alignTicks: true")}}var WQ=function(){function t(t,e,i){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=kQ,this._initCartesian(t,e,i),this.model=t}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(t,e){var i=this._axesMap;function n(t){var e,i=bE(t),n=i.length;if(n){for(var r=[],o=n-1;o>=0;o--){var s=t[+i[o]],a=s.model,l=s.scale;qH(l)&&a.get("alignTicks")&&null==a.get("interval")?r.push(s):(HW(l,a),qH(l)&&(e=s))}r.length&&(e||HW((e=r.pop()).scale,e.model),yE(r,(function(t){HQ(t.scale,t.model,e.scale)})))}}this._updateScale(t,this.model),n(i.x),n(i.y);var r={};yE(i.x,(function(t){XQ(i,"y",t,r)})),yE(i.y,(function(t){XQ(i,"x",t,r)})),this.resize(this.model,e)},t.prototype.resize=function(t,e,i){var n=t.getBoxLayoutParams(),r=!i&&t.get("containLabel"),o=UB(n,{width:e.getWidth(),height:e.getHeight()});this._rect=o;var s=this._axesList;function a(){yE(s,(function(t){var e=t.isHorizontal(),i=e?[0,o.width]:[0,o.height],n=t.inverse?1:0;t.setExtent(i[n],i[1-n]),function(t,e){var i=t.getExtent(),n=i[0]+i[1];t.toGlobalCoord="x"===t.dim?function(t){return t+e}:function(t){return n-t+e},t.toLocalCoord="x"===t.dim?function(t){return t-e}:function(t){return n-t+e}}(t,e?o.x:o.y)}))}a(),r&&(yE(s,(function(t){if(!t.model.get(["axisLabel","inside"])){var e=function(t){var e=t.model,i=t.scale;if(e.get(["axisLabel","show"])&&!i.isBlank()){var n,r,o=i.getExtent();r=i instanceof eW?i.count():(n=i.getTicks()).length;var s,a=t.getLabelModel(),l=qW(t),c=1;r>40&&(c=Math.ceil(r/40));for(var u=0;u<r;u+=c){var h=l(n?n[u]:{value:o[0]+u},u),p=ZW(a.getTextRect(h),a.get("rotate")||0);s?s.union(p):s=p}return s}}(t);if(e){var i=t.isHorizontal()?"height":"width",n=t.model.get(["axisLabel","margin"]);o[i]-=e[i]+n,"top"===t.position?o.y+=e.height+n:"left"===t.position&&(o.x+=e.width+n)}}})),a()),yE(this._coordsList,(function(t){t.calcAffineTransform()}))},t.prototype.getAxis=function(t,e){var i=this._axesMap[t];if(null!=i)return i[e||0]},t.prototype.getAxes=function(){return this._axesList.slice()},t.prototype.getCartesian=function(t,e){if(null!=t&&null!=e){var i="x"+t+"y"+e;return this._coordsMap[i]}CE(t)&&(e=t.yAxisIndex,t=t.xAxisIndex);for(var n=0,r=this._coordsList;n<r.length;n++)if(r[n].getAxis("x").index===t||r[n].getAxis("y").index===e)return r[n]},t.prototype.getCartesians=function(){return this._coordsList.slice()},t.prototype.convertToPixel=function(t,e,i){var n=this._findConvertTarget(e);return n.cartesian?n.cartesian.dataToPoint(i):n.axis?n.axis.toGlobalCoord(n.axis.dataToCoord(i)):null},t.prototype.convertFromPixel=function(t,e,i){var n=this._findConvertTarget(e);return n.cartesian?n.cartesian.pointToData(i):n.axis?n.axis.coordToData(n.axis.toLocalCoord(i)):null},t.prototype._findConvertTarget=function(t){var e,i,n=t.seriesModel,r=t.xAxisModel||n&&n.getReferringComponents("xAxis",MP).models[0],o=t.yAxisModel||n&&n.getReferringComponents("yAxis",MP).models[0],s=t.gridModel,a=this._coordsList;if(n)fE(a,e=n.coordinateSystem)<0&&(e=null);else if(r&&o)e=this.getCartesian(r.componentIndex,o.componentIndex);else if(r)i=this.getAxis("x",r.componentIndex);else if(o)i=this.getAxis("y",o.componentIndex);else if(s){s.coordinateSystem===this&&(e=this._coordsList[0])}return{cartesian:e,axis:i}},t.prototype.containPoint=function(t){var e=this._coordsList[0];if(e)return e.containPoint(t)},t.prototype._initCartesian=function(t,e,i){var n=this,r=this,o={left:!1,right:!1,top:!1,bottom:!1},s={x:{},y:{}},a={x:0,y:0};if(e.eachComponent("xAxis",l("x"),this),e.eachComponent("yAxis",l("y"),this),!a.x||!a.y)return this._axesMap={},void(this._axesList=[]);function l(e){return function(i,n){if(qQ(i,t)){var l=i.get("position");"x"===e?"top"!==l&&"bottom"!==l&&(l=o.bottom?"top":"bottom"):"left"!==l&&"right"!==l&&(l=o.left?"right":"left"),o[l]=!0;var c=new FQ(e,WW(i),[0,0],i.get("type"),l),u="category"===c.type;c.onBand=u&&i.get("boundaryGap"),c.inverse=i.get("inverse"),i.axis=c,c.model=i,c.grid=r,c.index=n,r._axesList.push(c),s[e][n]=c,a[e]++}}}this._axesMap=s,yE(s.x,(function(e,i){yE(s.y,(function(r,o){var s="x"+i+"y"+o,a=new BQ(s);a.master=n,a.model=t,n._coordsMap[s]=a,n._coordsList.push(a),a.addAxis(e),a.addAxis(r)}))}))},t.prototype._updateScale=function(t,e){function i(t,e){yE(JW(t,e.dim),(function(i){e.scale.unionExtentFromData(t,i)}))}yE(this._axesList,(function(t){if(t.scale.setExtent(1/0,-1/0),"category"===t.type){var e=t.model.get("categorySortInfo");t.scale.setSortInfo(e)}})),t.eachSeries((function(t){if(UQ(t)){var n=GQ(t),r=n.xAxisModel,o=n.yAxisModel;if(!qQ(r,e)||!qQ(o,e))return;var s=this.getCartesian(r.componentIndex,o.componentIndex),a=t.getData(),l=s.getAxis("x"),c=s.getAxis("y");i(a,l),i(a,c)}}),this)},t.prototype.getTooltipAxes=function(t){var e=[],i=[];return yE(this.getCartesians(),(function(n){var r=null!=t&&"auto"!==t?n.getAxis(t):n.getBaseAxis(),o=n.getOtherAxis(r);fE(e,r)<0&&e.push(r),fE(i,o)<0&&i.push(o)})),{baseAxes:e,otherAxes:i}},t.create=function(e,i){var n=[];return e.eachComponent("grid",(function(r,o){var s=new t(r,e,i);s.name="grid_"+o,s.resize(r,i,!0),r.coordinateSystem=s,n.push(s)})),e.eachSeries((function(t){if(UQ(t)){var e=GQ(t),i=e.xAxisModel,n=e.yAxisModel,r=i.getCoordSysModel();if("production"!==process.env.NODE_ENV){if(!r)throw new Error('Grid "'+zE(i.get("gridIndex"),i.get("gridId"),0)+'" not found');if(i.getCoordSysModel()!==n.getCoordSysModel())throw new Error("xAxis and yAxis must use the same grid")}var o=r.coordinateSystem;t.coordinateSystem=o.getCartesian(i.componentIndex,n.componentIndex)}})),n},t.dimensions=kQ,t}();function qQ(t,e){return t.getCoordSysModel()===e}function XQ(t,e,i,n){i.getAxesOnZeroOf=function(){return r?[r]:[]};var r,o=t[e],s=i.model,a=s.get(["axisLine","onZero"]),l=s.get(["axisLine","onZeroAxisIndex"]);if(a){if(null!=l)ZQ(o[l])&&(r=o[l]);else for(var c in o)if(o.hasOwnProperty(c)&&ZQ(o[c])&&!n[u(o[c])]){r=o[c];break}r&&(n[u(r)]=!0)}function u(t){return t.dim+"_"+t.index}}function ZQ(t){return t&&"category"!==t.type&&"time"!==t.type&&function(t){var e=t.scale.getExtent(),i=e[0],n=e[1];return!(i>0&&n>0||i<0&&n<0)}(t)}var YQ=WQ,QQ=Math.PI,JQ=function(){function t(t,e){this.group=new xC,this.opt=e,this.axisModel=t,dE(e,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var i=new xC({x:e.position[0],y:e.position[1],rotation:e.rotation});i.updateTransform(),this._transformGroup=i}return t.prototype.hasBuilder=function(t){return!!KQ[t]},t.prototype.add=function(t){KQ[t](this.opt,this.axisModel,this.group,this._transformGroup)},t.prototype.getGroup=function(){return this.group},t.innerTextLayout=function(t,e,i){var n,r,o=NC(e-t);return BC(o)?(r=i>0?"top":"bottom",n="center"):BC(o-QQ)?(r=i>0?"bottom":"top",n="center"):(r="middle",n=o>0&&o<QQ?i>0?"right":"left":i>0?"left":"right"),{rotation:o,textAlign:n,textVerticalAlign:r}},t.makeAxisEventDataBase=function(t){var e={componentType:t.mainType,componentIndex:t.componentIndex};return e[t.mainType+"Index"]=t.componentIndex,e},t.isLabelSilent=function(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)},t}(),KQ={axisLine:function(t,e,i,n){var r=e.get(["axisLine","show"]);if("auto"===r&&t.handleAutoShown&&(r=t.handleAutoShown("axisLine")),r){var o=e.axis.getExtent(),s=n.transform,a=[o[0],0],l=[o[1],0],c=a[0]>l[0];s&&(gS(a,a,s),gS(l,l,s));var u=pE({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),h=new nk({shape:{x1:a[0],y1:a[1],x2:l[0],y2:l[1]},style:u,strokeContainThreshold:t.strokeContainThreshold||5,silent:!0,z2:1});Zk(h.shape,h.style.lineWidth),h.anid="line",i.add(h);var p=e.get(["axisLine","symbol"]);if(null!=p){var d=e.get(["axisLine","symbolSize"]);ME(p)&&(p=[p,p]),(ME(d)||IE(d))&&(d=[d,d]);var f=fG(e.get(["axisLine","symbolOffset"])||0,d),m=d[0],g=d[1];yE([{rotate:t.rotation+Math.PI/2,offset:f[0],r:0},{rotate:t.rotation-Math.PI/2,offset:f[1],r:Math.sqrt((a[0]-l[0])*(a[0]-l[0])+(a[1]-l[1])*(a[1]-l[1]))}],(function(e,n){if("none"!==p[n]&&null!=p[n]){var r=pG(p[n],-m/2,-g/2,m,g,u.stroke,!0),o=e.r+e.offset,s=c?l:a;r.attr({rotation:e.rotate,x:s[0]+o*Math.cos(t.rotation),y:s[1]-o*Math.sin(t.rotation),silent:!0,z2:11}),i.add(r)}}))}}},axisTickLabel:function(t,e,i,n){var r=function(t,e,i,n){var r=i.axis,o=i.getModel("axisTick"),s=o.get("show");"auto"===s&&n.handleAutoShown&&(s=n.handleAutoShown("axisTick"));if(!s||r.scale.isBlank())return;for(var a=o.getModel("lineStyle"),l=n.tickDirection*o.get("length"),c=iJ(r.getTicksCoords(),e.transform,l,dE(a.getLineStyle(),{stroke:i.get(["axisLine","lineStyle","color"])}),"ticks"),u=0;u<c.length;u++)t.add(c[u]);return c}(i,n,e,t),o=function(t,e,i,n){var r=i.axis,o=NE(n.axisLabelShow,i.get(["axisLabel","show"]));if(!o||r.scale.isBlank())return;var s=i.getModel("axisLabel"),a=s.get("margin"),l=r.getViewLabels(),c=(NE(n.labelRotate,s.get("rotate"))||0)*QQ/180,u=JQ.innerTextLayout(n.rotation,c,n.labelDirection),h=i.getCategories&&i.getCategories(!0),p=[],d=JQ.isLabelSilent(i),f=i.get("triggerEvent");return yE(l,(function(o,l){var c="ordinal"===r.scale.type?r.scale.getRawOrdinalNumber(o.tickValue):o.tickValue,m=o.formattedLabel,g=o.rawLabel,y=s;if(h&&h[c]){var v=h[c];CE(v)&&v.textStyle&&(y=new FN(v.textStyle,s,i.ecModel))}var _=y.getTextColor()||i.get(["axisLine","lineStyle","color"]),x=r.dataToCoord(c),b=new JD({x:x,y:n.labelOffset+n.labelDirection*a,rotation:u.rotation,silent:d,z2:10+(o.level||0),style:mN(y,{text:m,align:y.getShallow("align",!0)||u.textAlign,verticalAlign:y.getShallow("verticalAlign",!0)||y.getShallow("baseline",!0)||u.textVerticalAlign,fill:SE(_)?_("category"===r.type?g:"value"===r.type?c+"":c,l):_})});if(b.anid="label_"+c,f){var w=JQ.makeAxisEventDataBase(i);w.targetType="axisLabel",w.value=g,w.tickIndex=l,"category"===r.type&&(w.dataIndex=c),KD(b).eventData=w}e.add(b),b.updateTransform(),p.push(b),t.add(b),b.decomposeTransform()})),p}(i,n,e,t);if(function(t,e,i){if(QW(t.axis))return;var n=t.get(["axisLabel","showMinLabel"]),r=t.get(["axisLabel","showMaxLabel"]);e=e||[],i=i||[];var o=e[0],s=e[1],a=e[e.length-1],l=e[e.length-2],c=i[0],u=i[1],h=i[i.length-1],p=i[i.length-2];!1===n?($Q(o),$Q(c)):tJ(o,s)&&(n?($Q(s),$Q(u)):($Q(o),$Q(c)));!1===r?($Q(a),$Q(h)):tJ(l,a)&&(r?($Q(l),$Q(p)):($Q(a),$Q(h)))}(e,o,r),function(t,e,i,n){var r=i.axis,o=i.getModel("minorTick");if(!o.get("show")||r.scale.isBlank())return;var s=r.getMinorTicksCoords();if(!s.length)return;for(var a=o.getModel("lineStyle"),l=n*o.get("length"),c=dE(a.getLineStyle(),dE(i.getModel("axisTick").getLineStyle(),{stroke:i.get(["axisLine","lineStyle","color"])})),u=0;u<s.length;u++)for(var h=iJ(s[u],e.transform,l,c,"minorticks_"+u),p=0;p<h.length;p++)t.add(h[p])}(i,n,e,t.tickDirection),e.get(["axisLabel","hideOverlap"])){var s=Qq(vE(o,(function(t){return{label:t,priority:t.z2,defaultAttr:{ignore:t.ignore}}})));$q(s)}},axisName:function(t,e,i,n){var r=NE(t.axisName,e.get("name"));if(r){var o,s,a=e.get("nameLocation"),l=t.nameDirection,c=e.getModel("nameTextStyle"),u=e.get("nameGap")||0,h=e.axis.getExtent(),p=h[0]>h[1]?-1:1,d=["start"===a?h[0]-p*u:"end"===a?h[1]+p*u:(h[0]+h[1])/2,eJ(a)?t.labelOffset+l*u:0],f=e.get("nameRotate");null!=f&&(f=f*QQ/180),eJ(a)?o=JQ.innerTextLayout(t.rotation,null!=f?f:t.rotation,l):(o=function(t,e,i,n){var r,o,s=NC(i-t),a=n[0]>n[1],l="start"===e&&!a||"start"!==e&&a;BC(s-QQ/2)?(o=l?"bottom":"top",r="center"):BC(s-1.5*QQ)?(o=l?"top":"bottom",r="center"):(o="middle",r=s<1.5*QQ&&s>QQ/2?l?"left":"right":l?"right":"left");return{rotation:s,textAlign:r,textVerticalAlign:o}}(t.rotation,a,f||0,h),null!=(s=t.axisNameAvailableWidth)&&(s=Math.abs(s/Math.sin(o.rotation)),!isFinite(s)&&(s=null)));var m=c.getFont(),g=e.get("nameTruncate",!0)||{},y=g.ellipsis,v=NE(t.nameTruncateMaxWidth,g.maxWidth,s),_=new JD({x:d[0],y:d[1],rotation:o.rotation,silent:JQ.isLabelSilent(e),style:mN(c,{text:r,font:m,overflow:"truncate",width:v,ellipsis:y,fill:c.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:c.get("align")||o.textAlign,verticalAlign:c.get("verticalAlign")||o.textVerticalAlign}),z2:1});if(sN({el:_,componentModel:e,itemName:r}),_.__fullText=r,_.anid="name",e.get("triggerEvent")){var x=JQ.makeAxisEventDataBase(e);x.targetType="axisName",x.name=r,KD(_).eventData=x}n.add(_),_.updateTransform(),i.add(_),_.decomposeTransform()}}};function $Q(t){t&&(t.ignore=!0)}function tJ(t,e){var i=t&&t.getBoundingRect().clone(),n=e&&e.getBoundingRect().clone();if(i&&n){var r=ZS([]);return KS(r,r,-t.rotation),i.applyTransform(QS([],r,t.getLocalTransform())),n.applyTransform(QS([],r,e.getLocalTransform())),i.intersect(n)}}function eJ(t){return"middle"===t||"center"===t}function iJ(t,e,i,n,r){for(var o=[],s=[],a=[],l=0;l<t.length;l++){var c=t[l].coord;s[0]=c,s[1]=0,a[0]=c,a[1]=i,e&&(gS(s,s,e),gS(a,a,e));var u=new nk({shape:{x1:s[0],y1:s[1],x2:a[0],y2:a[1]},style:n,z2:2,autoBatch:!0,silent:!0});Zk(u.shape,u.style.lineWidth),u.anid=r+"_"+t[l].tickValue,o.push(u)}return o}var nJ=JQ;function rJ(t,e){var i={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return function(t,e,i){var n=e.getComponent("tooltip"),r=e.getComponent("axisPointer"),o=r.get("link",!0)||[],s=[];yE(i.getCoordinateSystems(),(function(i){if(i.axisPointerEnabled){var a=lJ(i.model),l=t.coordSysAxesInfo[a]={};t.coordSysMap[a]=i;var c=i.model.getModel("tooltip",n);if(yE(i.getAxes(),AE(d,!1,null)),i.getTooltipAxes&&n&&c.get("show")){var u="axis"===c.get("trigger"),h="cross"===c.get(["axisPointer","type"]),p=i.getTooltipAxes(c.get(["axisPointer","axis"]));(u||h)&&yE(p.baseAxes,AE(d,!h||"cross",u)),h&&yE(p.otherAxes,AE(d,"cross",!1))}}function d(n,a,u){var h=u.model.getModel("axisPointer",r),p=h.get("show");if(p&&("auto"!==p||n||aJ(h))){null==a&&(a=h.get("triggerTooltip")),h=n?function(t,e,i,n,r,o){var s=e.getModel("axisPointer"),a={};yE(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],(function(t){a[t]=cE(s.get(t))})),a.snap="category"!==t.type&&!!o,"cross"===s.get("type")&&(a.type="line");var l=a.label||(a.label={});if(null==l.show&&(l.show=!1),"cross"===r){var c=s.get(["label","show"]);if(l.show=null==c||c,!o){var u=a.lineStyle=s.get("crossStyle");u&&dE(l,u.textStyle)}}return t.model.getModel("axisPointer",new FN(a,i,n))}(u,c,r,e,n,a):h;var d=h.get("snap"),f=h.get("triggerEmphasis"),m=lJ(u.model),g=a||d||"category"===u.type,y=t.axesInfo[m]={key:m,axis:u,coordSys:i,axisPointerModel:h,triggerTooltip:a,triggerEmphasis:f,involveSeries:g,snap:d,useHandle:aJ(h),seriesModels:[],linkGroup:null};l[m]=y,t.seriesInvolved=t.seriesInvolved||g;var v=function(t,e){for(var i=e.model,n=e.dim,r=0;r<t.length;r++){var o=t[r]||{};if(oJ(o[n+"AxisId"],i.id)||oJ(o[n+"AxisIndex"],i.componentIndex)||oJ(o[n+"AxisName"],i.name))return r}}(o,u);if(null!=v){var _=s[v]||(s[v]={axesInfo:{}});_.axesInfo[m]=y,_.mapper=o[v].mapper,y.linkGroup=_}}}}))}(i,t,e),i.seriesInvolved&&function(t,e){e.eachSeries((function(e){var i=e.coordinateSystem,n=e.get(["tooltip","trigger"],!0),r=e.get(["tooltip","show"],!0);i&&"none"!==n&&!1!==n&&"item"!==n&&!1!==r&&!1!==e.get(["axisPointer","show"],!0)&&yE(t.coordSysAxesInfo[lJ(i.model)],(function(t){var n=t.axis;i.getAxis(n.dim)===n&&(t.seriesModels.push(e),null==t.seriesDataCount&&(t.seriesDataCount=0),t.seriesDataCount+=e.getData().count())}))}))}(i,t),i}function oJ(t,e){return"all"===t||EE(t)&&fE(t,e)>=0||t===e}function sJ(t){var e=(t.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return e&&e.axesInfo[lJ(t)]}function aJ(t){return!!t.get(["handle","show"])}function lJ(t){return t.type+"||"+t.id}var cJ={},uJ=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.render=function(e,i,n,r){this.axisPointerClass&&function(t){var e=sJ(t);if(e){var i=e.axisPointerModel,n=e.axis.scale,r=i.option,o=i.get("status"),s=i.get("value");null!=s&&(s=n.parse(s));var a=aJ(i);null==o&&(r.status=a?"show":"hide");var l=n.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==s||s>l[1])&&(s=l[1]),s<l[0]&&(s=l[0]),r.value=s,a&&(r.status=e.axis.scale.isBlank()?"hide":"show")}}(e),t.prototype.render.apply(this,arguments),this._doUpdateAxisPointerClass(e,n,!0)},e.prototype.updateAxisPointer=function(t,e,i,n){this._doUpdateAxisPointerClass(t,i,!1)},e.prototype.remove=function(t,e){var i=this._axisPointer;i&&i.remove(e)},e.prototype.dispose=function(e,i){this._disposeAxisPointer(i),t.prototype.dispose.apply(this,arguments)},e.prototype._doUpdateAxisPointerClass=function(t,i,n){var r=e.getAxisPointerClass(this.axisPointerClass);if(r){var o=function(t){var e=sJ(t);return e&&e.axisPointerModel}(t);o?(this._axisPointer||(this._axisPointer=new r)).render(t,o,i,n):this._disposeAxisPointer(i)}},e.prototype._disposeAxisPointer=function(t){this._axisPointer&&this._axisPointer.dispose(t),this._axisPointer=null},e.registerAxisPointerClass=function(t,e){if("production"!==process.env.NODE_ENV&&cJ[t])throw new Error("axisPointer "+t+" exists");cJ[t]=e},e.getAxisPointerClass=function(t){return t&&cJ[t]},e.type="axis",e}(qV),hJ=uJ,pJ=wP();function dJ(t,e,i,n){var r=i.axis;if(!r.scale.isBlank()){var o=i.getModel("splitArea"),s=o.getModel("areaStyle"),a=s.get("color"),l=n.coordinateSystem.getRect(),c=r.getTicksCoords({tickModel:o,clamp:!0});if(c.length){var u=a.length,h=pJ(t).splitAreaColors,p=YE(),d=0;if(h)for(var f=0;f<c.length;f++){var m=h.get(c[f].tickValue);if(null!=m){d=(m+(u-1)*f)%u;break}}var g=r.toGlobalCoord(c[0].coord),y=s.getAreaStyle();a=EE(a)?a:[a];for(f=1;f<c.length;f++){var v=r.toGlobalCoord(c[f].coord),_=void 0,x=void 0,b=void 0,w=void 0;r.isHorizontal()?(_=g,x=l.y,b=v-_,w=l.height,g=_+b):(_=l.x,x=g,b=l.width,g=x+(w=v-x));var A=c[f-1].tickValue;null!=A&&p.set(A,d),e.add(new kD({anid:null!=A?"area_"+A:null,shape:{x:_,y:x,width:b,height:w},style:dE({fill:a[d]},y),autoBatch:!0,silent:!0})),d=(d+1)%u}pJ(t).splitAreaColors=p}}}function fJ(t){pJ(t).splitAreaColors=null}var mJ=["axisLine","axisTickLabel","axisName"],gJ=["splitArea","splitLine","minorSplitLine"],yJ=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.axisPointerClass="CartesianAxisPointer",i}return zA(e,t),e.prototype.render=function(e,i,n,r){this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new xC,this.group.add(this._axisGroup),e.get("show")){var s=e.getCoordSysModel(),a=VQ(s,e),l=new nJ(e,pE({handleAutoShown:function(t){for(var i=s.coordinateSystem.getCartesians(),n=0;n<i.length;n++)if(qH(i[n].getOtherAxis(e.axis).scale))return!0;return!1}},a));yE(mJ,l.add,l),this._axisGroup.add(l.getGroup()),yE(gJ,(function(t){e.get([t,"show"])&&vJ[t](this,this._axisGroup,e,s)}),this),r&&"changeAxisOrder"===r.type&&r.isInitSort||tN(o,this._axisGroup,e),t.prototype.render.call(this,e,i,n,r)}},e.prototype.remove=function(){fJ(this)},e.type="cartesianAxis",e}(hJ),vJ={splitLine:function(t,e,i,n){var r=i.axis;if(!r.scale.isBlank()){var o=i.getModel("splitLine"),s=o.getModel("lineStyle"),a=s.get("color");a=EE(a)?a:[a];for(var l=n.coordinateSystem.getRect(),c=r.isHorizontal(),u=0,h=r.getTicksCoords({tickModel:o}),p=[],d=[],f=s.getLineStyle(),m=0;m<h.length;m++){var g=r.toGlobalCoord(h[m].coord);c?(p[0]=g,p[1]=l.y,d[0]=g,d[1]=l.y+l.height):(p[0]=l.x,p[1]=g,d[0]=l.x+l.width,d[1]=g);var y=u++%a.length,v=h[m].tickValue,_=new nk({anid:null!=v?"line_"+h[m].tickValue:null,autoBatch:!0,shape:{x1:p[0],y1:p[1],x2:d[0],y2:d[1]},style:dE({stroke:a[y]},f),silent:!0});Zk(_.shape,f.lineWidth),e.add(_)}}},minorSplitLine:function(t,e,i,n){var r=i.axis,o=i.getModel("minorSplitLine").getModel("lineStyle"),s=n.coordinateSystem.getRect(),a=r.isHorizontal(),l=r.getMinorTicksCoords();if(l.length)for(var c=[],u=[],h=o.getLineStyle(),p=0;p<l.length;p++)for(var d=0;d<l[p].length;d++){var f=r.toGlobalCoord(l[p][d].coord);a?(c[0]=f,c[1]=s.y,u[0]=f,u[1]=s.y+s.height):(c[0]=s.x,c[1]=f,u[0]=s.x+s.width,u[1]=f);var m=new nk({anid:"minor_line_"+l[p][d].tickValue,autoBatch:!0,shape:{x1:c[0],y1:c[1],x2:u[0],y2:u[1]},style:h,silent:!0});Zk(m.shape,h.lineWidth),e.add(m)}},splitArea:function(t,e,i,n){dJ(t,e,i,n)}},_J=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.type="xAxis",e}(yJ),xJ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=_J.type,e}return zA(e,t),e.type="yAxis",e}(yJ),bJ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="grid",e}return zA(e,t),e.prototype.render=function(t,e){this.group.removeAll(),t.get("show")&&this.group.add(new kD({shape:t.coordinateSystem.getRect(),style:dE({fill:t.get("backgroundColor")},t.getItemStyle()),silent:!0,z2:-1}))},e.type="grid",e}(qV),wJ={offset:0};function AJ(t){t.registerComponentView(bJ),t.registerComponentModel(SQ),t.registerCoordinateSystem("cartesian2d",YQ),DQ(t,"x",MQ,wJ),DQ(t,"y",MQ,wJ),t.registerComponentView(_J),t.registerComponentView(xJ),t.registerPreprocessor((function(t){t.xAxis&&t.yAxis&&!t.grid&&(t.grid={})}))}function EJ(t){t.eachSeriesByType("radar",(function(t){var e=t.getData(),i=[],n=t.coordinateSystem;if(n){var r=n.getIndicatorAxes();yE(r,(function(t,o){e.each(e.mapDimension(r[o].dim),(function(t,e){i[e]=i[e]||[];var r=n.dataToPoint(t,o);i[e][o]=SJ(r)?r:MJ(n)}))})),e.each((function(t){var r=function(t,e,i){if(t&&e)for(var n=0,r=t.length;n<r;n++)if(e.call(i,t[n],n,t))return t[n]}(i[t],(function(t){return SJ(t)}))||MJ(n);i[t].push(r.slice()),e.setItemLayout(t,i[t])}))}}))}function SJ(t){return!isNaN(t[0])&&!isNaN(t[1])}function MJ(t){return[t.cx,t.cy]}function TJ(t){var e=t.polar;if(e){EE(e)||(e=[e]);var i=[];yE(e,(function(e,n){e.indicator?(e.type&&!e.shape&&(e.shape=e.type),t.radar=t.radar||[],EE(t.radar)||(t.radar=[t.radar]),t.radar.push(e)):i.push(e)})),t.polar=i}yE(t.series,(function(t){t&&"radar"===t.type&&t.polarIndex&&(t.radarIndex=t.polarIndex)}))}var IJ=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.render=function(t,e,i){var n=t.coordinateSystem,r=this.group,o=t.getData(),s=this._data;function a(t,e){var i=t.getItemVisual(e,"symbol")||"circle";if("none"!==i){var n=dG(t.getItemVisual(e,"symbolSize")),r=pG(i,-1,-1,2,2),o=t.getItemVisual(e,"symbolRotate")||0;return r.attr({style:{strokeNoScale:!0},z2:100,scaleX:n[0]/2,scaleY:n[1]/2,rotation:o*Math.PI/180||0}),r}}function l(e,i,n,r,o,s){n.removeAll();for(var l=0;l<i.length-1;l++){var c=a(r,o);c&&(c.__dimIdx=l,e[l]?(c.setPosition(e[l]),cN[s?"initProps":"updateProps"](c,{x:i[l][0],y:i[l][1]},t,o)):c.setPosition(i[l]),n.add(c))}}function c(t){return vE(t,(function(t){return[n.cx,n.cy]}))}o.diff(s).add((function(e){var i=o.getItemLayout(e);if(i){var n=new QO,r=new $O,s={shape:{points:i}};n.shape.points=c(i),r.shape.points=c(i),Lk(n,s,t,e),Lk(r,s,t,e);var a=new xC,u=new xC;a.add(r),a.add(n),a.add(u),l(r.shape.points,i,u,o,e,!0),o.setItemGraphicEl(e,a)}})).update((function(e,i){var n=s.getItemGraphicEl(i),r=n.childAt(0),a=n.childAt(1),c=n.childAt(2),u={shape:{points:o.getItemLayout(e)}};u.shape.points&&(l(r.shape.points,u.shape.points,c,o,e,!1),Nk(a),Nk(r),Pk(r,u,t),Pk(a,u,t),o.setItemGraphicEl(e,n))})).remove((function(t){r.remove(s.getItemGraphicEl(t))})).execute(),o.eachItemGraphicEl((function(t,e){var i=o.getItemModel(e),n=t.childAt(0),s=t.childAt(1),a=t.childAt(2),l=o.getItemVisual(e,"style"),c=l.fill;r.add(t),n.useStyle(dE(i.getModel("lineStyle").getLineStyle(),{fill:"none",stroke:c})),JR(n,i,"lineStyle"),JR(s,i,"areaStyle");var u=i.getModel("areaStyle"),h=u.isEmpty()&&u.parentModel.isEmpty();s.ignore=h,yE(["emphasis","select","blur"],(function(t){var e=i.getModel([t,"areaStyle"]),n=e.isEmpty()&&e.parentModel.isEmpty();s.ensureState(t).ignore=n&&h})),s.useStyle(dE(u.getAreaStyle(),{fill:c,opacity:.7,decal:l.decal}));var p=i.getModel("emphasis"),d=p.getModel("itemStyle").getItemStyle();a.eachChild((function(t){if(t instanceof TD){var n=t.style;t.useStyle(pE({image:n.image,x:n.x,y:n.y,width:n.width,height:n.height},l))}else t.useStyle(l),t.setColor(c),t.style.strokeNoScale=!0;t.ensureState("emphasis").style=cE(d);var r=o.getStore().get(o.getDimensionIndex(t.__dimIdx),e);(null==r||isNaN(r))&&(r=""),dN(t,fN(i),{labelFetcher:o.hostModel,labelDataIndex:e,labelDimIndex:t.__dimIdx,defaultText:r,inheritColor:c,defaultOpacity:l.opacity})})),XR(t,p.get("focus"),p.get("blurScope"),p.get("disabled"))})),this._data=o},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.type="radar",e}(iU),CJ=IJ,PJ=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.hasSymbolVisual=!0,i}return zA(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new pQ(wE(this.getData,this),wE(this.getRawData,this))},e.prototype.getInitialData=function(t,e){return uQ(this,{generateCoord:"indicator_",generateCoordCount:1/0})},e.prototype.formatTooltip=function(t,e,i){var n=this.getData(),r=this.coordinateSystem.getIndicatorAxes(),o=this.getData().getName(t),s=""===o?this.name:o,a=CV(this,t);return xV("section",{header:s,sortBlocks:!0,blocks:vE(r,(function(e){var i=n.get(n.mapDimension(e.dim),t);return xV("nameValue",{markerType:"subItem",markerColor:a,name:e.name,value:i,sortParam:i})}))})},e.prototype.getTooltipPosition=function(t){if(null!=t)for(var e=this.getData(),i=this.coordinateSystem,n=e.getValues(vE(i.dimensions,(function(t){return e.mapDimension(t)})),t),r=0,o=n.length;r<o;r++)if(!isNaN(n[r])){var s=i.getIndicatorAxes();return i.coordToPoint(s[r].dataToCoord(n[r]),r)}},e.type="series.radar",e.dependencies=["radar"],e.defaultOption={z:2,colorBy:"data",coordinateSystem:"radar",legendHoverLink:!0,radarIndex:0,lineStyle:{width:2,type:"solid",join:"round"},label:{position:"top"},symbolSize:8},e}(HV),LJ=PJ,DJ=PQ.value;function RJ(t,e){return dE({show:e},t)}var OJ=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.optionUpdated=function(){var t=this.get("boundaryGap"),e=this.get("splitNumber"),i=this.get("scale"),n=this.get("axisLine"),r=this.get("axisTick"),o=this.get("axisLabel"),s=this.get("axisName"),a=this.get(["axisName","show"]),l=this.get(["axisName","formatter"]),c=this.get("axisNameGap"),u=this.get("triggerEvent"),h=vE(this.get("indicator")||[],(function(h){null!=h.max&&h.max>0&&!h.min?h.min=0:null!=h.min&&h.min<0&&!h.max&&(h.max=0);var p=s;null!=h.color&&(p=dE({color:h.color},s));var d=uE(cE(h),{boundaryGap:t,splitNumber:e,scale:i,axisLine:n,axisTick:r,axisLabel:o,name:h.text,showName:a,nameLocation:"end",nameGap:c,nameTextStyle:p,triggerEvent:u},!1);if(ME(l)){var f=d.name;d.name=l.replace("{value}",null!=f?f:"")}else SE(l)&&(d.name=l(d.name,d));var m=new FN(d,null,this.ecModel);return mE(m,KW.prototype),m.mainType="radar",m.componentIndex=this.componentIndex,m}),this);this._indicatorModels=h},e.prototype.getIndicatorModels=function(){return this._indicatorModels},e.type="radar",e.defaultOption={z:0,center:["50%","50%"],radius:"75%",startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:uE({lineStyle:{color:"#bbb"}},DJ.axisLine),axisLabel:RJ(DJ.axisLabel,!1),axisTick:RJ(DJ.axisTick,!1),splitLine:RJ(DJ.splitLine,!0),splitArea:RJ(DJ.splitArea,!0),indicator:[]},e}(YB),kJ=OJ,NJ=["axisLine","axisTickLabel","axisName"],BJ=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.render=function(t,e,i){this.group.removeAll(),this._buildAxes(t),this._buildSplitLineAndArea(t)},e.prototype._buildAxes=function(t){var e=t.coordinateSystem;yE(vE(e.getIndicatorAxes(),(function(t){var i=t.model.get("showName")?t.name:"";return new nJ(t.model,{axisName:i,position:[e.cx,e.cy],rotation:t.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})})),(function(t){yE(NJ,t.add,t),this.group.add(t.getGroup())}),this)},e.prototype._buildSplitLineAndArea=function(t){var e=t.coordinateSystem,i=e.getIndicatorAxes();if(i.length){var n=t.get("shape"),r=t.getModel("splitLine"),o=t.getModel("splitArea"),s=r.getModel("lineStyle"),a=o.getModel("areaStyle"),l=r.get("show"),c=o.get("show"),u=s.get("color"),h=a.get("color"),p=EE(u)?u:[u],d=EE(h)?h:[h],f=[],m=[];if("circle"===n)for(var g=i[0].getTicksCoords(),y=e.cx,v=e.cy,_=0;_<g.length;_++){if(l)f[T(f,p,_)].push(new EO({shape:{cx:y,cy:v,r:g[_].coord}}));if(c&&_<g.length-1)m[T(m,d,_)].push(new qO({shape:{cx:y,cy:v,r0:g[_].coord,r:g[_+1].coord}}))}else{var x,b=vE(i,(function(t,i){var n=t.getTicksCoords();return x=null==x?n.length-1:Math.min(n.length-1,x),vE(n,(function(t){return e.coordToPoint(t.coord,i)}))})),w=[];for(_=0;_<=x;_++){for(var A=[],E=0;E<i.length;E++)A.push(b[E][_]);if(A[0]?A.push(A[0].slice()):"production"!==process.env.NODE_ENV&&console.error("Can't draw value axis "+_),l)f[T(f,p,_)].push(new $O({shape:{points:A}}));if(c&&w)m[T(m,d,_-1)].push(new QO({shape:{points:A.concat(w)}}));w=A.slice().reverse()}}var S=s.getLineStyle(),M=a.getAreaStyle();yE(m,(function(t,e){this.group.add(qk(t,{style:dE({stroke:"none",fill:d[e%d.length]},M),silent:!0}))}),this),yE(f,(function(t,e){this.group.add(qk(t,{style:dE({fill:"none",stroke:p[e%p.length]},S),silent:!0}))}),this)}function T(t,e,i){var n=i%e.length;return t[n]=t[n]||[],n}},e.type="radar",e}(qV),zJ=BJ,FJ=function(t){function e(e,i,n){var r=t.call(this,e,i,n)||this;return r.type="value",r.angle=0,r.name="",r}return zA(e,t),e}(Sq),VJ=FJ,UJ=function(){function t(t,e,i){this.dimensions=[],this._model=t,this._indicatorAxes=vE(t.getIndicatorModels(),(function(t,e){var i="indicator_"+e,n=new VJ(i,new rW);return n.name=t.get("name"),n.model=t,t.axis=n,this.dimensions.push(i),n}),this),this.resize(t,i)}return t.prototype.getIndicatorAxes=function(){return this._indicatorAxes},t.prototype.dataToPoint=function(t,e){var i=this._indicatorAxes[e];return this.coordToPoint(i.dataToCoord(t),e)},t.prototype.coordToPoint=function(t,e){var i=this._indicatorAxes[e].angle;return[this.cx+t*Math.cos(i),this.cy-t*Math.sin(i)]},t.prototype.pointToData=function(t){var e=t[0]-this.cx,i=t[1]-this.cy,n=Math.sqrt(e*e+i*i);e/=n,i/=n;for(var r,o=Math.atan2(-i,e),s=1/0,a=-1,l=0;l<this._indicatorAxes.length;l++){var c=this._indicatorAxes[l],u=Math.abs(o-c.angle);u<s&&(r=c,a=l,s=u)}return[a,+(r&&r.coordToData(n))]},t.prototype.resize=function(t,e){var i=t.get("center"),n=e.getWidth(),r=e.getHeight(),o=Math.min(n,r)/2;this.cx=IC(i[0],n),this.cy=IC(i[1],r),this.startAngle=t.get("startAngle")*Math.PI/180;var s=t.get("radius");(ME(s)||IE(s))&&(s=[0,s]),this.r0=IC(s[0],o),this.r=IC(s[1],o),yE(this._indicatorAxes,(function(t,e){t.setExtent(this.r0,this.r);var i=this.startAngle+e*Math.PI*2/this._indicatorAxes.length;i=Math.atan2(Math.sin(i),Math.cos(i)),t.angle=i}),this)},t.prototype.update=function(t,e){var i=this._indicatorAxes,n=this._model;yE(i,(function(t){t.scale.setExtent(1/0,-1/0)})),t.eachSeriesByType("radar",(function(e,r){if("radar"===e.get("coordinateSystem")&&t.getComponent("radar",e.get("radarIndex"))===n){var o=e.getData();yE(i,(function(t){t.scale.unionExtentFromData(o,o.mapDimension(t.dim))}))}}),this);var r=n.get("splitNumber"),o=new rW;o.setExtent(0,r),o.setInterval(1),yE(i,(function(t,e){HQ(t.scale,t.model,o)}))},t.prototype.convertToPixel=function(t,e,i){return console.warn("Not implemented."),null},t.prototype.convertFromPixel=function(t,e,i){return console.warn("Not implemented."),null},t.prototype.containPoint=function(t){return console.warn("Not implemented."),!1},t.create=function(e,i){var n=[];return e.eachComponent("radar",(function(r){var o=new t(r,e,i);n.push(o),r.coordinateSystem=o})),e.eachSeriesByType("radar",(function(t){"radar"===t.get("coordinateSystem")&&(t.coordinateSystem=n[t.get("radarIndex")||0])})),n},t.dimensions=[],t}(),GJ=UJ;function jJ(t){t.registerCoordinateSystem("radar",GJ),t.registerComponentModel(kJ),t.registerComponentView(zJ),t.registerVisual({seriesType:"radar",reset:function(t){var e=t.getData();e.each((function(t){e.setItemVisual(t,"legendIcon","roundRect")})),e.setVisual("legendIcon","roundRect")}})}var HJ="\0_ec_interaction_mutex";function WJ(t,e){return!!qJ(t)[e]}function qJ(t){return t[HJ]||(t[HJ]={})}qj({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},tS);var XJ=function(t){function e(e){var i=t.call(this)||this;i._zr=e;var n=wE(i._mousedownHandler,i),r=wE(i._mousemoveHandler,i),o=wE(i._mouseupHandler,i),s=wE(i._mousewheelHandler,i),a=wE(i._pinchHandler,i);return i.enable=function(t,i){this.disable(),this._opt=dE(cE(i)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),null==t&&(t=!0),!0!==t&&"move"!==t&&"pan"!==t||(e.on("mousedown",n),e.on("mousemove",r),e.on("mouseup",o)),!0!==t&&"scale"!==t&&"zoom"!==t||(e.on("mousewheel",s),e.on("pinch",a))},i.disable=function(){e.off("mousedown",n),e.off("mousemove",r),e.off("mouseup",o),e.off("mousewheel",s),e.off("pinch",a)},i}return zA(e,t),e.prototype.isDragging=function(){return this._dragging},e.prototype.isPinching=function(){return this._pinching},e.prototype.setPointerChecker=function(t){this.pointerChecker=t},e.prototype.dispose=function(){this.disable()},e.prototype._mousedownHandler=function(t){if(!HS(t)){for(var e=t.target;e;){if(e.draggable)return;e=e.__hostTarget||e.parent}var i=t.offsetX,n=t.offsetY;this.pointerChecker&&this.pointerChecker(t,i,n)&&(this._x=i,this._y=n,this._dragging=!0)}},e.prototype._mousemoveHandler=function(t){if(this._dragging&&QJ("moveOnMouseMove",t,this._opt)&&"pinch"!==t.gestureEvent&&!WJ(this._zr,"globalPan")){var e=t.offsetX,i=t.offsetY,n=this._x,r=this._y,o=e-n,s=i-r;this._x=e,this._y=i,this._opt.preventDefaultMouseMove&&jS(t.event),YJ(this,"pan","moveOnMouseMove",t,{dx:o,dy:s,oldX:n,oldY:r,newX:e,newY:i,isAvailableBehavior:null})}},e.prototype._mouseupHandler=function(t){HS(t)||(this._dragging=!1)},e.prototype._mousewheelHandler=function(t){var e=QJ("zoomOnMouseWheel",t,this._opt),i=QJ("moveOnMouseWheel",t,this._opt),n=t.wheelDelta,r=Math.abs(n),o=t.offsetX,s=t.offsetY;if(0!==n&&(e||i)){if(e){var a=r>3?1.4:r>1?1.2:1.1;ZJ(this,"zoom","zoomOnMouseWheel",t,{scale:n>0?a:1/a,originX:o,originY:s,isAvailableBehavior:null})}if(i){var l=Math.abs(n);ZJ(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:(n>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:o,originY:s,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(t){WJ(this._zr,"globalPan")||ZJ(this,"zoom",null,t,{scale:t.pinchScale>1?1.1:1/1.1,originX:t.pinchX,originY:t.pinchY,isAvailableBehavior:null})},e}(AS);function ZJ(t,e,i,n,r){t.pointerChecker&&t.pointerChecker(n,r.originX,r.originY)&&(jS(n.event),YJ(t,e,i,n,r))}function YJ(t,e,i,n,r){r.isAvailableBehavior=wE(QJ,null,i,n),t.trigger(e,r)}function QJ(t,e,i){var n=i[t];return!t||n&&(!ME(n)||e.event[n+"Key"])}var JJ=XJ;function KJ(t,e,i){var n=t.target;n.x+=e,n.y+=i,n.dirty()}function $J(t,e,i,n){var r=t.target,o=t.zoomLimit,s=t.zoom=t.zoom||1;if(s*=e,o){var a=o.min||0,l=o.max||1/0;s=Math.max(Math.min(l,s),a)}var c=s/t.zoom;t.zoom=s,r.x-=(i-r.x)*(c-1),r.y-=(n-r.y)*(c-1),r.scaleX*=c,r.scaleY*=c,r.dirty()}var tK,eK={axisPointer:1,tooltip:1,brush:1};function iK(t,e,i){var n=e.getComponentByElement(t.topTarget),r=n&&n.coordinateSystem;return n&&n!==i&&!eK.hasOwnProperty(n.mainType)&&r&&r.model!==i}function nK(t){ME(t)&&(t=(new DOMParser).parseFromString(t,"text/xml"));var e=t;for(9===e.nodeType&&(e=e.firstChild);"svg"!==e.nodeName.toLowerCase()||1!==e.nodeType;)e=e.nextSibling;return e}var rK={fill:"fill",stroke:"stroke","stroke-width":"lineWidth",opacity:"opacity","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-miterlimit":"miterLimit","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","text-anchor":"textAlign",visibility:"visibility",display:"display"},oK=bE(rK),sK={"alignment-baseline":"textBaseline","stop-color":"stopColor"},aK=bE(sK),lK=function(){function t(){this._defs={},this._root=null}return t.prototype.parse=function(t,e){e=e||{};var i=nK(t);if("production"!==process.env.NODE_ENV&&!i)throw new Error("Illegal svg");this._defsUsePending=[];var n=new xC;this._root=n;var r=[],o=i.getAttribute("viewBox")||"",s=parseFloat(i.getAttribute("width")||e.width),a=parseFloat(i.getAttribute("height")||e.height);isNaN(s)&&(s=null),isNaN(a)&&(a=null),fK(i,n,null,!0,!1);for(var l,c,u=i.firstChild;u;)this._parseNode(u,n,r,null,!1,!1),u=u.nextSibling;if(function(t,e){for(var i=0;i<e.length;i++){var n=e[i];n[0].style[n[1]]=t[n[2]]}}(this._defs,this._defsUsePending),this._defsUsePending=[],o){var h=vK(o);h.length>=4&&(l={x:parseFloat(h[0]||0),y:parseFloat(h[1]||0),width:parseFloat(h[2]),height:parseFloat(h[3])})}if(l&&null!=s&&null!=a&&(c=AK(l,{x:0,y:0,width:s,height:a}),!e.ignoreViewBox)){var p=n;(n=new xC).add(p),p.scaleX=p.scaleY=c.scale,p.x=c.x,p.y=c.y}return e.ignoreRootClip||null==s||null==a||n.setClipPath(new kD({shape:{x:0,y:0,width:s,height:a}})),{root:n,width:s,height:a,viewBoxRect:l,viewBoxTransform:c,named:r}},t.prototype._parseNode=function(t,e,i,n,r,o){var s,a=t.nodeName.toLowerCase(),l=n;if("defs"===a&&(r=!0),"text"===a&&(o=!0),"defs"===a||"switch"===a)s=e;else{if(!r){var c=tK[a];if(c&&$E(tK,a)){s=c.call(this,t,e);var u=t.getAttribute("name");if(u){var h={name:u,namedFrom:null,svgNodeTagLower:a,el:s};i.push(h),"g"===a&&(l=h)}else n&&i.push({name:n.name,namedFrom:n,svgNodeTagLower:a,el:s});e.add(s)}}var p=cK[a];if(p&&$E(cK,a)){var d=p.call(this,t),f=t.getAttribute("id");f&&(this._defs[f]=d)}}if(s&&s.isGroup)for(var m=t.firstChild;m;)1===m.nodeType?this._parseNode(m,s,i,l,r,o):3===m.nodeType&&o&&this._parseText(m,s),m=m.nextSibling},t.prototype._parseText=function(t,e){var i=new AD({style:{text:t.textContent},silent:!0,x:this._textX||0,y:this._textY||0});pK(e,i),fK(t,i,this._defsUsePending,!1,!1),function(t,e){var i=e.__selfStyle;if(i){var n=i.textBaseline,r=n;n&&"auto"!==n?"baseline"===n?r="alphabetic":"before-edge"===n||"text-before-edge"===n?r="top":"after-edge"===n||"text-after-edge"===n?r="bottom":"central"!==n&&"mathematical"!==n||(r="middle"):r="alphabetic",t.style.textBaseline=r}var o=e.__inheritedStyle;if(o){var s=o.textAlign,a=s;s&&("middle"===s&&(a="center"),t.style.textAlign=a)}}(i,e);var n=i.style,r=n.fontSize;r&&r<9&&(n.fontSize=9,i.scaleX*=r/9,i.scaleY*=r/9);var o=(n.fontSize||n.fontFamily)&&[n.fontStyle,n.fontWeight,(n.fontSize||12)+"px",n.fontFamily||"sans-serif"].join(" ");n.font=o;var s=i.getBoundingRect();return this._textX+=s.width,e.add(i),i},t.internalField=void(tK={g:function(t,e){var i=new xC;return pK(e,i),fK(t,i,this._defsUsePending,!1,!1),i},rect:function(t,e){var i=new kD;return pK(e,i),fK(t,i,this._defsUsePending,!1,!1),i.setShape({x:parseFloat(t.getAttribute("x")||"0"),y:parseFloat(t.getAttribute("y")||"0"),width:parseFloat(t.getAttribute("width")||"0"),height:parseFloat(t.getAttribute("height")||"0")}),i.silent=!0,i},circle:function(t,e){var i=new EO;return pK(e,i),fK(t,i,this._defsUsePending,!1,!1),i.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),r:parseFloat(t.getAttribute("r")||"0")}),i.silent=!0,i},line:function(t,e){var i=new nk;return pK(e,i),fK(t,i,this._defsUsePending,!1,!1),i.setShape({x1:parseFloat(t.getAttribute("x1")||"0"),y1:parseFloat(t.getAttribute("y1")||"0"),x2:parseFloat(t.getAttribute("x2")||"0"),y2:parseFloat(t.getAttribute("y2")||"0")}),i.silent=!0,i},ellipse:function(t,e){var i=new TO;return pK(e,i),fK(t,i,this._defsUsePending,!1,!1),i.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),rx:parseFloat(t.getAttribute("rx")||"0"),ry:parseFloat(t.getAttribute("ry")||"0")}),i.silent=!0,i},polygon:function(t,e){var i,n=t.getAttribute("points");n&&(i=dK(n));var r=new QO({shape:{points:i||[]},silent:!0});return pK(e,r),fK(t,r,this._defsUsePending,!1,!1),r},polyline:function(t,e){var i,n=t.getAttribute("points");n&&(i=dK(n));var r=new $O({shape:{points:i||[]},silent:!0});return pK(e,r),fK(t,r,this._defsUsePending,!1,!1),r},image:function(t,e){var i=new TD;return pK(e,i),fK(t,i,this._defsUsePending,!1,!1),i.setStyle({image:t.getAttribute("xlink:href")||t.getAttribute("href"),x:+t.getAttribute("x"),y:+t.getAttribute("y"),width:+t.getAttribute("width"),height:+t.getAttribute("height")}),i.silent=!0,i},text:function(t,e){var i=t.getAttribute("x")||"0",n=t.getAttribute("y")||"0",r=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0";this._textX=parseFloat(i)+parseFloat(r),this._textY=parseFloat(n)+parseFloat(o);var s=new xC;return pK(e,s),fK(t,s,this._defsUsePending,!1,!0),s},tspan:function(t,e){var i=t.getAttribute("x"),n=t.getAttribute("y");null!=i&&(this._textX=parseFloat(i)),null!=n&&(this._textY=parseFloat(n));var r=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0",s=new xC;return pK(e,s),fK(t,s,this._defsUsePending,!1,!0),this._textX+=parseFloat(r),this._textY+=parseFloat(o),s},path:function(t,e){var i=xO(t.getAttribute("d")||"");return pK(e,i),fK(t,i,this._defsUsePending,!1,!1),i.silent=!0,i}}),t}(),cK={lineargradient:function(t){var e=parseInt(t.getAttribute("x1")||"0",10),i=parseInt(t.getAttribute("y1")||"0",10),n=parseInt(t.getAttribute("x2")||"10",10),r=parseInt(t.getAttribute("y2")||"0",10),o=new mk(e,i,n,r);return uK(t,o),hK(t,o),o},radialgradient:function(t){var e=parseInt(t.getAttribute("cx")||"0",10),i=parseInt(t.getAttribute("cy")||"0",10),n=parseInt(t.getAttribute("r")||"0",10),r=new yk(e,i,n);return uK(t,r),hK(t,r),r}};function uK(t,e){"userSpaceOnUse"===t.getAttribute("gradientUnits")&&(e.global=!0)}function hK(t,e){for(var i=t.firstChild;i;){if(1===i.nodeType&&"stop"===i.nodeName.toLocaleLowerCase()){var n=i.getAttribute("offset"),r=void 0;r=n&&n.indexOf("%")>0?parseInt(n,10)/100:n?parseFloat(n):0;var o={};wK(i,o,o);var s=o.stopColor||i.getAttribute("stop-color")||"#000000";e.colorStops.push({offset:r,color:s})}i=i.nextSibling}}function pK(t,e){t&&t.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),dE(e.__inheritedStyle,t.__inheritedStyle))}function dK(t){for(var e=vK(t),i=[],n=0;n<e.length;n+=2){var r=parseFloat(e[n]),o=parseFloat(e[n+1]);i.push([r,o])}return i}function fK(t,e,i,n,r){var o=e,s=o.__inheritedStyle=o.__inheritedStyle||{},a={};1===t.nodeType&&(function(t,e){var i=t.getAttribute("transform");if(i){i=i.replace(/,/g," ");var n=[],r=null;i.replace(_K,(function(t,e,i){return n.push(e,i),""}));for(var o=n.length-1;o>0;o-=2){var s=n[o],a=n[o-1],l=vK(s);switch(r=r||[1,0,0,1,0,0],a){case"translate":JS(r,r,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":$S(r,r,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":KS(r,r,-parseFloat(l[0])*xK);break;case"skewX":QS(r,[1,0,Math.tan(parseFloat(l[0])*xK),1,0,0],r);break;case"skewY":QS(r,[1,Math.tan(parseFloat(l[0])*xK),0,1,0,0],r);break;case"matrix":r[0]=parseFloat(l[0]),r[1]=parseFloat(l[1]),r[2]=parseFloat(l[2]),r[3]=parseFloat(l[3]),r[4]=parseFloat(l[4]),r[5]=parseFloat(l[5])}}e.setLocalTransform(r)}}(t,e),wK(t,s,a),n||function(t,e,i){for(var n=0;n<oK.length;n++){var r=oK[n];null!=(o=t.getAttribute(r))&&(e[rK[r]]=o)}for(n=0;n<aK.length;n++){var o;r=aK[n];null!=(o=t.getAttribute(r))&&(i[sK[r]]=o)}}(t,s,a)),o.style=o.style||{},null!=s.fill&&(o.style.fill=gK(o,"fill",s.fill,i)),null!=s.stroke&&(o.style.stroke=gK(o,"stroke",s.stroke,i)),yE(["lineWidth","opacity","fillOpacity","strokeOpacity","miterLimit","fontSize"],(function(t){null!=s[t]&&(o.style[t]=parseFloat(s[t]))})),yE(["lineDashOffset","lineCap","lineJoin","fontWeight","fontFamily","fontStyle","textAlign"],(function(t){null!=s[t]&&(o.style[t]=s[t])})),r&&(o.__selfStyle=a),s.lineDash&&(o.style.lineDash=vE(vK(s.lineDash),(function(t){return parseFloat(t)}))),"hidden"!==s.visibility&&"collapse"!==s.visibility||(o.invisible=!0),"none"===s.display&&(o.ignore=!0)}var mK=/^url\(\s*#(.*?)\)/;function gK(t,e,i,n){var r=i&&i.match(mK);if(!r)return"none"===i&&(i=null),i;var o=GE(r[1]);n.push([t,e,o])}var yK=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function vK(t){return t.match(yK)||[]}var _K=/(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.eE,]*)\)/g,xK=Math.PI/180;var bK=/([^\s:;]+)\s*:\s*([^:;]+)/g;function wK(t,e,i){var n,r=t.getAttribute("style");if(r)for(bK.lastIndex=0;null!=(n=bK.exec(r));){var o=n[1],s=$E(rK,o)?rK[o]:null;s&&(e[s]=n[2]);var a=$E(sK,o)?sK[o]:null;a&&(i[a]=n[2])}}function AK(t,e){var i=e.width/t.width,n=e.height/t.height,r=Math.min(i,n);return{scale:r,x:-(t.x+t.width/2)*r+(e.x+e.width/2),y:-(t.y+t.height/2)*r+(e.y+e.height/2)}}var EK=YE(["rect","circle","line","ellipse","polygon","polyline","path","text","tspan","g"]),SK=function(){function t(t,e){this.type="geoSVG",this._usedGraphicMap=YE(),this._freedGraphics=[],this._mapName=t,this._parsedXML=nK(e)}return t.prototype.load=function(){var t=this._firstGraphic;if(!t){t=this._firstGraphic=this._buildGraphic(this._parsedXML),this._freedGraphics.push(t),this._boundingRect=this._firstGraphic.boundingRect.clone();var e=function(t){var e=[],i=YE();return yE(t,(function(t){if(null==t.namedFrom){var n=new cq(t.name,t.el);e.push(n),i.set(t.name,n)}})),{regions:e,regionsMap:i}}(t.named),i=e.regions,n=e.regionsMap;this._regions=i,this._regionsMap=n}return{boundingRect:this._boundingRect,regions:this._regions,regionsMap:this._regionsMap}},t.prototype._buildGraphic=function(t){var e,i,n,r;try{UE(null!=(i=(e=t&&(n=t,r={ignoreViewBox:!0,ignoreRootClip:!0},(new lK).parse(n,r))||{}).root))}catch(t){throw new Error("Invalid svg format\n"+t.message)}var o=new xC;o.add(i),o.isGeoSVGGraphicRoot=!0;var s=e.width,a=e.height,l=e.viewBoxRect,c=this._boundingRect;if(!c){var u=void 0,h=void 0,p=void 0,d=void 0;if(null!=s?(u=0,p=s):l&&(u=l.x,p=l.width),null!=a?(h=0,d=a):l&&(h=l.y,d=l.height),null==u||null==h){var f=i.getBoundingRect();null==u&&(u=f.x,p=f.width),null==h&&(h=f.y,d=f.height)}c=this._boundingRect=new pM(u,h,p,d)}if(l){var m=AK(l,c);i.scaleX=i.scaleY=m.scale,i.x=m.x,i.y=m.y}o.setClipPath(new kD({shape:c.plain()}));var g=[];return yE(e.named,(function(t){var e;null!=EK.get(t.svgNodeTagLower)&&(g.push(t),(e=t.el).silent=!1,e.isGroup&&e.traverse((function(t){t.silent=!1})))})),{root:o,boundingRect:c,named:g}},t.prototype.useGraphic=function(t){var e=this._usedGraphicMap,i=e.get(t);return i||(i=this._freedGraphics.pop()||this._buildGraphic(this._parsedXML),e.set(t,i),i)},t.prototype.freeGraphic=function(t){var e=this._usedGraphicMap,i=e.get(t);i&&(e.removeKey(t),this._freedGraphics.push(i))},t}();for(var MK=[126,25],TK="南海诸岛",IK=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]],CK=0;CK<IK.length;CK++)for(var PK=0;PK<IK[CK].length;PK++)IK[CK][PK][0]/=10.5,IK[CK][PK][1]/=-14,IK[CK][PK][0]+=MK[0],IK[CK][PK][1]+=MK[1];var LK={"南海诸岛":[32,80],"广东":[0,-10],"香港":[10,5],"澳门":[-10,10],"天津":[5,5]};var DK=[[[123.45165252685547,25.73527164402261],[123.49731445312499,25.73527164402261],[123.49731445312499,25.750734064600884],[123.45165252685547,25.750734064600884],[123.45165252685547,25.73527164402261]]];var RK=function(){function t(t,e,i){var n;this.type="geoJSON",this._parsedMap=YE(),this._mapName=t,this._specialAreas=i,this._geoJSON=ME(n=e)?"undefined"!=typeof JSON&&JSON.parse?JSON.parse(n):new Function("return ("+n+");")():n}return t.prototype.load=function(t,e){e=e||"name";var i=this._parsedMap.get(e);if(!i){var n=this._parseToRegions(e);i=this._parsedMap.set(e,{regions:n,boundingRect:OK(n)})}var r=YE(),o=[];return yE(i.regions,(function(e){var i=e.name;t&&$E(t,i)&&(e=e.cloneShallow(i=t[i])),o.push(e),r.set(i,e)})),{regions:o,boundingRect:i.boundingRect||new pM(0,0,0,0),regionsMap:r}},t.prototype._parseToRegions=function(t){var e,i=this._mapName,n=this._geoJSON;try{e=n?pq(n,t):[]}catch(t){throw new Error("Invalid geoJson format\n"+t.message)}return function(t,e){if("china"===t){for(var i=0;i<e.length;i++)if(e[i].name===TK)return;e.push(new lq(TK,vE(IK,(function(t){return{type:"polygon",exterior:t}})),MK))}}(i,e),yE(e,(function(t){var e=t.name;!function(t,e){if("china"===t){var i=LK[e.name];if(i){var n=e.getCenter();n[0]+=i[0]/10.5,n[1]+=-i[1]/14,e.setCenter(n)}}}(i,t),function(t,e){"china"===t&&"台湾"===e.name&&e.geometries.push({type:"polygon",exterior:DK[0]})}(i,t);var n=this._specialAreas&&this._specialAreas[e];n&&t.transformTo(n.left,n.top,n.width,n.height)}),this),e},t.prototype.getMapForUser=function(){return{geoJson:this._geoJSON,geoJSON:this._geoJSON,specialAreas:this._specialAreas}},t}();function OK(t){for(var e,i=0;i<t.length;i++){var n=t[i].getBoundingRect();(e=e||n.clone()).union(n)}return e}var kK=YE(),NK={registerMap:function(t,e,i){if(e.svg){var n=new SK(t,e.svg);kK.set(t,n)}else{var r=e.geoJson||e.geoJSON;r&&!e.features?i=e.specialAreas:r=e;n=new RK(t,r,i);kK.set(t,n)}},getGeoResource:function(t){return kK.get(t)},getMapForUser:function(t){var e=kK.get(t);return e&&"geoJSON"===e.type&&e.getMapForUser()},load:function(t,e,i){var n=kK.get(t);if(n)return n.load(e,i);"production"!==process.env.NODE_ENV&&console.error("Map "+t+" not exists. The GeoJSON of the map must be provided.")}},BK=["rect","circle","line","ellipse","polygon","polyline","path"],zK=YE(BK),FK=YE(BK.concat(["g"])),VK=YE(BK.concat(["g"])),UK=wP();function GK(t){var e=t.getItemStyle(),i=t.get("areaColor");return null!=i&&(e.fill=i),e}function jK(t){var e=t.style;e&&(e.stroke=e.stroke||e.fill,e.fill=null)}var HK=function(){function t(t){var e=new xC;this.uid=UN("ec_map_draw"),this._controller=new JJ(t.getZr()),this._controllerHost={target:e},this.group=e,e.add(this._regionsGroup=new xC),e.add(this._svgGroup=new xC)}return t.prototype.draw=function(t,e,i,n,r){var o="geo"===t.mainType,s=t.getData&&t.getData();o&&e.eachComponent({mainType:"series",subType:"map"},(function(e){s||e.getHostGeoModel()!==t||(s=e.getData())}));var a=t.coordinateSystem,l=this._regionsGroup,c=this.group,u=a.getTransformInfo(),h=u.raw,p=u.roam;!l.childAt(0)||r?(c.x=p.x,c.y=p.y,c.scaleX=p.scaleX,c.scaleY=p.scaleY,c.dirty()):Pk(c,p,t);var d=s&&s.getVisual("visualMeta")&&s.getVisual("visualMeta").length>0,f={api:i,geo:a,mapOrGeoModel:t,data:s,isVisualEncodedByVisualMap:d,isGeo:o,transformInfoRaw:h};"geoJSON"===a.resourceType?this._buildGeoJSON(f):"geoSVG"===a.resourceType&&this._buildSVG(f),this._updateController(t,e,i),this._updateMapSelectHandler(t,l,i,n)},t.prototype._buildGeoJSON=function(t){var e=this._regionsGroupByName=YE(),i=YE(),n=this._regionsGroup,r=t.transformInfoRaw,o=t.mapOrGeoModel,s=t.data,a=t.geo.projection,l=a&&a.stream;function c(t,e){return e&&(t=e(t)),t&&[t[0]*r.scaleX+r.x,t[1]*r.scaleY+r.y]}function u(t){for(var e=[],i=!l&&a&&a.project,n=0;n<t.length;++n){var r=c(t[n],i);r&&e.push(r)}return e}function h(t){return{shape:{points:u(t)}}}n.removeAll(),yE(t.geo.regions,(function(r){var u=r.name,p=e.get(u),d=i.get(u)||{},f=d.dataIdx,m=d.regionModel;p||(p=e.set(u,new xC),n.add(p),f=s?s.indexOfName(u):null,m=t.isGeo?o.getRegionModel(u):s?s.getItemModel(f):null,i.set(u,{dataIdx:f,regionModel:m}));var g=[],y=[];yE(r.geometries,(function(t){if("polygon"===t.type){var e=[t.exterior].concat(t.interiors||[]);l&&(e=QK(e,l)),yE(e,(function(t){g.push(new QO(h(t)))}))}else{var i=t.points;l&&(i=QK(i,l,!0)),yE(i,(function(t){y.push(new $O(h(t)))}))}}));var v=c(r.getCenter(),a&&a.project);function _(e,i){if(e.length){var n=new dk({culling:!0,segmentIgnoreThreshold:1,shape:{paths:e}});p.add(n),WK(t,n,f,m),qK(t,n,u,m,o,f,v),i&&(jK(n),yE(n.states,jK))}}_(g),_(y,!0)})),e.each((function(e,n){var r=i.get(n),s=r.dataIdx,a=r.regionModel;XK(t,e,n,a,o,s),ZK(t,e,n,a,o),YK(t,e,n,a,o)}),this)},t.prototype._buildSVG=function(t){var e=t.geo.map,i=t.transformInfoRaw;this._svgGroup.x=i.x,this._svgGroup.y=i.y,this._svgGroup.scaleX=i.scaleX,this._svgGroup.scaleY=i.scaleY,this._svgResourceChanged(e)&&(this._freeSVG(),this._useSVG(e));var n=this._svgDispatcherMap=YE(),r=!1;yE(this._svgGraphicRecord.named,(function(e){var i=e.name,o=t.mapOrGeoModel,s=t.data,a=e.svgNodeTagLower,l=e.el,c=s?s.indexOfName(i):null,u=o.getRegionModel(i);(null!=zK.get(a)&&l instanceof gL&&WK(t,l,c,u),l instanceof gL&&(l.culling=!0),l.z2EmphasisLift=0,e.namedFrom)||(null!=VK.get(a)&&qK(t,l,i,u,o,c,null),XK(t,l,i,u,o,c),ZK(t,l,i,u,o),null!=FK.get(a)&&("self"===YK(t,l,i,u,o)&&(r=!0),(n.get(i)||n.set(i,[])).push(l)))}),this),this._enableBlurEntireSVG(r,t)},t.prototype._enableBlurEntireSVG=function(t,e){if(t&&e.isGeo){var i=e.mapOrGeoModel.getModel(["blur","itemStyle"]).getItemStyle().opacity;this._svgGraphicRecord.root.traverse((function(t){if(!t.isGroup){PR(t);var e=t.ensureState("blur").style||{};null==e.opacity&&null!=i&&(e.opacity=i),t.ensureState("emphasis")}}))}},t.prototype.remove=function(){this._regionsGroup.removeAll(),this._regionsGroupByName=null,this._svgGroup.removeAll(),this._freeSVG(),this._controller.dispose(),this._controllerHost=null},t.prototype.findHighDownDispatchers=function(t,e){if(null==t)return[];var i=e.coordinateSystem;if("geoJSON"===i.resourceType){var n=this._regionsGroupByName;if(n){var r=n.get(t);return r?[r]:[]}}else if("geoSVG"===i.resourceType)return this._svgDispatcherMap&&this._svgDispatcherMap.get(t)||[]},t.prototype._svgResourceChanged=function(t){return this._svgMapName!==t},t.prototype._useSVG=function(t){var e=NK.getGeoResource(t);if(e&&"geoSVG"===e.type){var i=e.useGraphic(this.uid);this._svgGroup.add(i.root),this._svgGraphicRecord=i,this._svgMapName=t}},t.prototype._freeSVG=function(){var t=this._svgMapName;if(null!=t){var e=NK.getGeoResource(t);e&&"geoSVG"===e.type&&e.freeGraphic(this.uid),this._svgGraphicRecord=null,this._svgDispatcherMap=null,this._svgGroup.removeAll(),this._svgMapName=null}},t.prototype._updateController=function(t,e,i){var n=t.coordinateSystem,r=this._controller,o=this._controllerHost;o.zoomLimit=t.get("scaleLimit"),o.zoom=n.getZoom(),r.enable(t.get("roam")||!1);var s=t.mainType;function a(){var e={type:"geoRoam",componentType:s};return e[s+"Id"]=t.id,e}r.off("pan").on("pan",(function(t){this._mouseDownFlag=!1,KJ(o,t.dx,t.dy),i.dispatchAction(pE(a(),{dx:t.dx,dy:t.dy,animation:{duration:0}}))}),this),r.off("zoom").on("zoom",(function(t){this._mouseDownFlag=!1,$J(o,t.scale,t.originX,t.originY),i.dispatchAction(pE(a(),{zoom:t.scale,originX:t.originX,originY:t.originY,animation:{duration:0}}))}),this),r.setPointerChecker((function(e,r,o){return n.containPoint([r,o])&&!iK(e,i,t)}))},t.prototype.resetForLabelLayout=function(){this.group.traverse((function(t){var e=t.getTextContent();e&&(e.ignore=UK(e).ignore)}))},t.prototype._updateMapSelectHandler=function(t,e,i,n){var r=this;e.off("mousedown"),e.off("click"),t.get("selectedMode")&&(e.on("mousedown",(function(){r._mouseDownFlag=!0})),e.on("click",(function(t){r._mouseDownFlag&&(r._mouseDownFlag=!1)})))},t}();function WK(t,e,i,n){var r=n.getModel("itemStyle"),o=n.getModel(["emphasis","itemStyle"]),s=n.getModel(["blur","itemStyle"]),a=n.getModel(["select","itemStyle"]),l=GK(r),c=GK(o),u=GK(a),h=GK(s),p=t.data;if(p){var d=p.getItemVisual(i,"style"),f=p.getItemVisual(i,"decal");t.isVisualEncodedByVisualMap&&d.fill&&(l.fill=d.fill),f&&(l.decal=jG(f,t.api))}e.setStyle(l),e.style.strokeNoScale=!0,e.ensureState("emphasis").style=c,e.ensureState("select").style=u,e.ensureState("blur").style=h,PR(e)}function qK(t,e,i,n,r,o,s){var a=t.data,l=t.isGeo,c=a&&isNaN(a.get(a.mapDimension("value"),o)),u=a&&a.getItemLayout(o);if(l||c||u&&u.showLabel){var h=l?i:o,p=void 0;(!a||o>=0)&&(p=r);var d=s?{normal:{align:"center",verticalAlign:"middle"}}:null;dN(e,fN(n),{labelFetcher:p,labelDataIndex:h,defaultText:i},d);var f=e.getTextContent();if(f&&(UK(f).ignore=f.ignore,e.textConfig&&s)){var m=e.getBoundingRect().clone();e.textConfig.layoutRect=m,e.textConfig.position=[(s[0]-m.x)/m.width*100+"%",(s[1]-m.y)/m.height*100+"%"]}e.disableLabelAnimation=!0}else e.removeTextContent(),e.removeTextConfig(),e.disableLabelAnimation=null}function XK(t,e,i,n,r,o){t.data?t.data.setItemGraphicEl(o,e):KD(e).eventData={componentType:"geo",componentIndex:r.componentIndex,geoIndex:r.componentIndex,name:i,region:n&&n.option||{}}}function ZK(t,e,i,n,r){t.data||sN({el:e,componentModel:r,itemName:i,itemTooltipOption:n.get("tooltip")})}function YK(t,e,i,n,r){e.highDownSilentOnTouch=!!r.get("selectedMode");var o=n.getModel("emphasis"),s=o.get("focus");return XR(e,s,o.get("blurScope"),o.get("disabled")),t.isGeo&&function(t,e,i){var n=KD(t);n.componentMainType=e.mainType,n.componentIndex=e.componentIndex,n.componentHighDownName=i}(e,r,i),s}function QK(t,e,i){var n,r=[];function o(){n=[]}function s(){n.length&&(r.push(n),n=[])}var a=e({polygonStart:o,polygonEnd:s,lineStart:o,lineEnd:s,point:function(t,e){isFinite(t)&&isFinite(e)&&n.push([t,e])},sphere:function(){}});return!i&&a.polygonStart(),yE(t,(function(t){a.lineStart();for(var e=0;e<t.length;e++)a.point(t[e][0],t[e][1]);a.lineEnd()})),!i&&a.polygonEnd(),r}var JK=HK,KK=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.render=function(t,e,i,n){if(!n||"mapToggleSelect"!==n.type||n.from!==this.uid){var r=this.group;if(r.removeAll(),!t.getHostGeoModel()){if(this._mapDraw&&n&&"geoRoam"===n.type&&this._mapDraw.resetForLabelLayout(),n&&"geoRoam"===n.type&&"series"===n.componentType&&n.seriesId===t.id)(o=this._mapDraw)&&r.add(o.group);else if(t.needsDrawMap){var o=this._mapDraw||new JK(i);r.add(o.group),o.draw(t,e,i,this,n),this._mapDraw=o}else this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;t.get("showLegendSymbol")&&e.getComponent("legend")&&this._renderSymbols(t,e,i)}}},e.prototype.remove=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null,this.group.removeAll()},e.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},e.prototype._renderSymbols=function(t,e,i){var n=t.originalData,r=this.group;n.each(n.mapDimension("value"),(function(e,i){if(!isNaN(e)){var o=n.getItemLayout(i);if(o&&o.point){var s=o.point,a=o.offset,l=new EO({style:{fill:t.getData().getVisual("style").fill},shape:{cx:s[0]+9*a,cy:s[1],r:3},silent:!0,z2:8+(a?0:cR+1)});if(!a){var c=t.mainSeries.getData(),u=n.getName(i),h=c.indexOfName(u),p=n.getItemModel(i),d=p.getModel("label"),f=c.getItemGraphicEl(h);dN(l,fN(p),{labelFetcher:{getFormattedLabel:function(e,i){return t.getFormattedLabel(h,i)}},defaultText:u}),l.disableLabelAnimation=!0,d.get("position")||l.setTextConfig({position:"bottom"}),f.onHoverStateChange=function(t){IR(l,t)}}r.add(l)}}}))},e.type="map",e}(iU),$K=KK,t$=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.needsDrawMap=!1,i.seriesGroup=[],i.getTooltipPosition=function(t){if(null!=t){var e=this.getData().getName(t),i=this.coordinateSystem,n=i.getRegion(e);return n&&i.dataToPoint(n.getCenter())}},i}return zA(e,t),e.prototype.getInitialData=function(t){for(var e=uQ(this,{coordDimensions:["value"],encodeDefaulter:AE(hz,this)}),i=YE(),n=[],r=0,o=e.count();r<o;r++){var s=e.getName(r);i.set(s,!0)}return yE(NK.load(this.getMapType(),this.option.nameMap,this.option.nameProperty).regions,(function(t){var e=t.name;i.get(e)||n.push(e)})),e.appendValues([],n),e},e.prototype.getHostGeoModel=function(){var t=this.option.geoIndex;return null!=t?this.ecModel.getComponent("geo",t):null},e.prototype.getMapType=function(){return(this.getHostGeoModel()||this).option.map},e.prototype.getRawValue=function(t){var e=this.getData();return e.get(e.mapDimension("value"),t)},e.prototype.getRegionModel=function(t){var e=this.getData();return e.getItemModel(e.indexOfName(t))},e.prototype.formatTooltip=function(t,e,i){for(var n=this.getData(),r=this.getRawValue(t),o=n.getName(t),s=this.seriesGroup,a=[],l=0;l<s.length;l++){var c=s[l].originalData.indexOfName(o),u=n.mapDimension("value");isNaN(s[l].originalData.get(u,c))||a.push(s[l].name)}return xV("section",{header:a.join(", "),noHeader:!a.length,blocks:[xV("nameValue",{name:o,value:r})]})},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.getLegendIcon=function(t){var e=t.icon||"roundRect",i=pG(e,0,0,t.itemWidth,t.itemHeight,t.itemStyle.fill);return i.setStyle(t.itemStyle),i.style.stroke="none",e.indexOf("empty")>-1&&(i.style.stroke=i.style.fill,i.style.fill="#fff",i.style.lineWidth=2),i},e.type="series.map",e.dependencies=["geo"],e.layoutMode="box",e.defaultOption={z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},nameProperty:"name"},e}(HV),e$=t$;function i$(t){var e={};t.eachSeriesByType("map",(function(t){var i=t.getHostGeoModel(),n=i?"o"+i.id:"i"+t.getMapType();(e[n]=e[n]||[]).push(t)})),yE(e,(function(t,e){for(var i,n,r,o=(i=vE(t,(function(t){return t.getData()})),n=t[0].get("mapValueCalculation"),r={},yE(i,(function(t){t.each(t.mapDimension("value"),(function(e,i){var n="ec-"+t.getName(i);r[n]=r[n]||[],isNaN(e)||r[n].push(e)}))})),i[0].map(i[0].mapDimension("value"),(function(t,e){for(var o="ec-"+i[0].getName(e),s=0,a=1/0,l=-1/0,c=r[o].length,u=0;u<c;u++)a=Math.min(a,r[o][u]),l=Math.max(l,r[o][u]),s+=r[o][u];return 0===c?NaN:"min"===n?a:"max"===n?l:"average"===n?s/c:s}))),s=0;s<t.length;s++)t[s].originalData=t[s].getData();for(s=0;s<t.length;s++)t[s].seriesGroup=t,t[s].needsDrawMap=0===s&&!t[s].getHostGeoModel(),t[s].setData(o.cloneShallow()),t[s].mainSeries=t[0]}))}function n$(t){var e={};t.eachSeriesByType("map",(function(i){var n=i.getMapType();if(!i.getHostGeoModel()&&!e[n]){var r={};yE(i.seriesGroup,(function(e){var i=e.coordinateSystem,n=e.originalData;e.get("showLegendSymbol")&&t.getComponent("legend")&&n.each(n.mapDimension("value"),(function(t,e){var o=n.getName(e),s=i.getRegion(o);if(s&&!isNaN(t)){var a=r[o]||0,l=i.dataToPoint(s.getCenter());r[o]=a+1,n.setItemLayout(e,{point:l,offset:a})}}))}));var o=i.getData();o.each((function(t){var e=o.getName(t),i=o.getItemLayout(t)||{};i.showLabel=!r[e],o.setItemLayout(t,i)})),e[n]=!0}}))}var r$=gS,o$=function(t){function e(e){var i=t.call(this)||this;return i.type="view",i.dimensions=["x","y"],i._roamTransformable=new KI,i._rawTransformable=new KI,i.name=e,i}return zA(e,t),e.prototype.setBoundingRect=function(t,e,i,n){return this._rect=new pM(t,e,i,n),this._rect},e.prototype.getBoundingRect=function(){return this._rect},e.prototype.setViewRect=function(t,e,i,n){this._transformTo(t,e,i,n),this._viewRect=new pM(t,e,i,n)},e.prototype._transformTo=function(t,e,i,n){var r=this.getBoundingRect(),o=this._rawTransformable;o.transform=r.calculateTransform(new pM(t,e,i,n));var s=o.parent;o.parent=null,o.decomposeTransform(),o.parent=s,this._updateTransform()},e.prototype.setCenter=function(t,e){t&&(this._center=[IC(t[0],e.getWidth()),IC(t[1],e.getHeight())],this._updateCenterAndZoom())},e.prototype.setZoom=function(t){t=t||1;var e=this.zoomLimit;e&&(null!=e.max&&(t=Math.min(e.max,t)),null!=e.min&&(t=Math.max(e.min,t))),this._zoom=t,this._updateCenterAndZoom()},e.prototype.getDefaultCenter=function(){var t=this.getBoundingRect();return[t.x+t.width/2,t.y+t.height/2]},e.prototype.getCenter=function(){return this._center||this.getDefaultCenter()},e.prototype.getZoom=function(){return this._zoom||1},e.prototype.getRoamTransform=function(){return this._roamTransformable.getLocalTransform()},e.prototype._updateCenterAndZoom=function(){var t=this._rawTransformable.getLocalTransform(),e=this._roamTransformable,i=this.getDefaultCenter(),n=this.getCenter(),r=this.getZoom();n=gS([],n,t),i=gS([],i,t),e.originX=n[0],e.originY=n[1],e.x=i[0]-n[0],e.y=i[1]-n[1],e.scaleX=e.scaleY=r,this._updateTransform()},e.prototype._updateTransform=function(){var t=this._roamTransformable,e=this._rawTransformable;e.parent=t,t.updateTransform(),e.updateTransform(),YS(this.transform||(this.transform=[]),e.transform||[1,0,0,1,0,0]),this._rawTransform=e.getLocalTransform(),this.invTransform=this.invTransform||[],tM(this.invTransform,this.transform),this.decomposeTransform()},e.prototype.getTransformInfo=function(){var t=this._rawTransformable,e=this._roamTransformable,i=new KI;return i.transform=e.transform,i.decomposeTransform(),{roam:{x:i.x,y:i.y,scaleX:i.scaleX,scaleY:i.scaleY},raw:{x:t.x,y:t.y,scaleX:t.scaleX,scaleY:t.scaleY}}},e.prototype.getViewRect=function(){return this._viewRect},e.prototype.getViewRectAfterRoam=function(){var t=this.getBoundingRect().clone();return t.applyTransform(this.transform),t},e.prototype.dataToPoint=function(t,e,i){var n=e?this._rawTransform:this.transform;return i=i||[],n?r$(i,t,n):nS(i,t)},e.prototype.pointToData=function(t){var e=this.invTransform;return e?r$([],t,e):[t[0],t[1]]},e.prototype.convertToPixel=function(t,e,i){var n=s$(e);return n===this?n.dataToPoint(i):null},e.prototype.convertFromPixel=function(t,e,i){var n=s$(e);return n===this?n.pointToData(i):null},e.prototype.containPoint=function(t){return this.getViewRectAfterRoam().contain(t[0],t[1])},e.dimensions=["x","y"],e}(KI);function s$(t){var e=t.seriesModel;return e?e.coordinateSystem:null}var a$=o$,l$={geoJSON:{aspectScale:.75,invertLongitute:!0},geoSVG:{aspectScale:1,invertLongitute:!1}},c$=["lng","lat"],u$=function(t){function e(e,i,n){var r=t.call(this,e)||this;r.dimensions=c$,r.type="geo",r._nameCoordMap=YE(),r.map=i;var o,s=n.projection,a=NK.load(i,n.nameMap,n.nameProperty),l=NK.getGeoResource(i),c=r.resourceType=l?l.type:null,u=r.regions=a.regions,h=l$[l.type];if(r._regionsMap=a.regionsMap,r.regions=a.regions,"production"!==process.env.NODE_ENV&&s&&("geoSVG"===c&&("production"!==process.env.NODE_ENV&&$C("Map "+i+" with SVG source can't use projection. Only GeoJSON source supports projection."),s=null),s.project&&s.unproject||("production"!==process.env.NODE_ENV&&$C("project and unproject must be both provided in the projeciton."),s=null)),r.projection=s,s)for(var p=0;p<u.length;p++){var d=u[p].getBoundingRect(s);(o=o||d.clone()).union(d)}else o=a.boundingRect;return r.setBoundingRect(o.x,o.y,o.width,o.height),r.aspectScale=s?1:BE(n.aspectScale,h.aspectScale),r._invertLongitute=!s&&h.invertLongitute,r}return zA(e,t),e.prototype._transformTo=function(t,e,i,n){var r=this.getBoundingRect(),o=this._invertLongitute;r=r.clone(),o&&(r.y=-r.y-r.height);var s=this._rawTransformable;s.transform=r.calculateTransform(new pM(t,e,i,n));var a=s.parent;s.parent=null,s.decomposeTransform(),s.parent=a,o&&(s.scaleY=-s.scaleY),this._updateTransform()},e.prototype.getRegion=function(t){return this._regionsMap.get(t)},e.prototype.getRegionByCoord=function(t){for(var e=this.regions,i=0;i<e.length;i++){var n=e[i];if("geoJSON"===n.type&&n.contain(t))return e[i]}},e.prototype.addGeoCoord=function(t,e){this._nameCoordMap.set(t,e)},e.prototype.getGeoCoord=function(t){var e=this._regionsMap.get(t);return this._nameCoordMap.get(t)||e&&e.getCenter()},e.prototype.dataToPoint=function(t,e,i){if(ME(t)&&(t=this.getGeoCoord(t)),t){var n=this.projection;return n&&(t=n.project(t)),t&&this.projectedToPoint(t,e,i)}},e.prototype.pointToData=function(t){var e=this.projection;return e&&(t=e.unproject(t)),t&&this.pointToProjected(t)},e.prototype.pointToProjected=function(e){return t.prototype.pointToData.call(this,e)},e.prototype.projectedToPoint=function(e,i,n){return t.prototype.dataToPoint.call(this,e,i,n)},e.prototype.convertToPixel=function(t,e,i){var n=h$(e);return n===this?n.dataToPoint(i):null},e.prototype.convertFromPixel=function(t,e,i){var n=h$(e);return n===this?n.pointToData(i):null},e}(a$);function h$(t){var e=t.geoModel,i=t.seriesModel;return e?e.coordinateSystem:i?i.coordinateSystem||(i.getReferringComponents("geo",MP).models[0]||{}).coordinateSystem:null}mE(u$,a$);var p$=u$;function d$(t,e){var i=t.get("boundingCoords");if(null!=i){var n=i[0],r=i[1];if(isFinite(n[0])&&isFinite(n[1])&&isFinite(r[0])&&isFinite(r[1])){var o=this.projection;if(o){var s=n[0],a=n[1],l=r[0],c=r[1];n=[1/0,1/0],r=[-1/0,-1/0];var u=function(t,e,i,s){for(var a=i-t,l=s-e,c=0;c<=100;c++){var u=c/100,h=o.project([t+a*u,e+l*u]);yS(n,n,h),vS(r,r,h)}};u(s,a,l,a),u(l,a,l,c),u(l,c,s,c),u(s,c,l,a)}this.setBoundingRect(n[0],n[1],r[0]-n[0],r[1]-n[1])}else"production"!==process.env.NODE_ENV&&console.error("Invalid boundingCoords")}var h,p,d,f=this.getBoundingRect(),m=t.get("layoutCenter"),g=t.get("layoutSize"),y=e.getWidth(),v=e.getHeight(),_=f.width/f.height*this.aspectScale,x=!1;if(m&&g&&(h=[IC(m[0],y),IC(m[1],v)],p=IC(g,Math.min(y,v)),isNaN(h[0])||isNaN(h[1])||isNaN(p)?"production"!==process.env.NODE_ENV&&console.warn("Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead."):x=!0),x)d={},_>1?(d.width=p,d.height=p/_):(d.height=p,d.width=p*_),d.y=h[1]-d.height/2,d.x=h[0]-d.width/2;else{var b=t.getBoxLayoutParams();b.aspect=_,d=UB(b,{width:y,height:v})}this.setViewRect(d.x,d.y,d.width,d.height),this.setCenter(t.get("center"),e),this.setZoom(t.get("zoom"))}var f$=function(){function t(){this.dimensions=c$}return t.prototype.create=function(t,e){var i=[];function n(t){return{nameProperty:t.get("nameProperty"),aspectScale:t.get("aspectScale"),projection:t.get("projection")}}t.eachComponent("geo",(function(t,r){var o=t.get("map"),s=new p$(o+r,o,pE({nameMap:t.get("nameMap")},n(t)));s.zoomLimit=t.get("scaleLimit"),i.push(s),t.coordinateSystem=s,s.model=t,s.resize=d$,s.resize(t,e)})),t.eachSeries((function(t){if("geo"===t.get("coordinateSystem")){var e=t.get("geoIndex")||0;t.coordinateSystem=i[e]}}));var r={};return t.eachSeriesByType("map",(function(t){if(!t.getHostGeoModel()){var e=t.getMapType();r[e]=r[e]||[],r[e].push(t)}})),yE(r,(function(t,r){var o=vE(t,(function(t){return t.get("nameMap")})),s=new p$(r,r,pE({nameMap:hE(o)},n(t[0])));s.zoomLimit=NE.apply(null,vE(t,(function(t){return t.get("scaleLimit")}))),i.push(s),s.resize=d$,s.resize(t[0],e),yE(t,(function(t){t.coordinateSystem=s,function(t,e){yE(e.get("geoCoord"),(function(e,i){t.addGeoCoord(i,e)}))}(s,t)}))})),i},t.prototype.getFilledRegions=function(t,e,i,n){for(var r=(t||[]).slice(),o=YE(),s=0;s<r.length;s++)o.set(r[s].name,r[s]);return yE(NK.load(e,i,n).regions,(function(t){var e=t.name;!o.get(e)&&r.push({name:e})})),r},t}(),m$=new f$,g$=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.init=function(t,e,i){var n=NK.getGeoResource(t.map);if(n&&"geoJSON"===n.type){var r=t.itemStyle=t.itemStyle||{};"color"in r||(r.color="#eee")}this.mergeDefaultAndTheme(t,i),cP(t,"label",["show"])},e.prototype.optionUpdated=function(){var t=this,e=this.option;e.regions=m$.getFilledRegions(e.regions,e.map,e.nameMap,e.nameProperty);var i={};this._optionModelMap=_E(e.regions||[],(function(e,n){var r=n.name;return r&&(e.set(r,new FN(n,t,t.ecModel)),n.selected&&(i[r]=!0)),e}),YE()),e.selectedMap||(e.selectedMap=i)},e.prototype.getRegionModel=function(t){return this._optionModelMap.get(t)||new FN(null,this,this.ecModel)},e.prototype.getFormattedLabel=function(t,e){var i=this.getRegionModel(t),n="normal"===e?i.get(["label","formatter"]):i.get(["emphasis","label","formatter"]),r={name:t};return SE(n)?(r.status=e,n(r)):ME(n)?n.replace("{a}",null!=t?t:""):void 0},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.select=function(t){var e=this.option,i=e.selectedMode;i&&("multiple"!==i&&(e.selectedMap=null),(e.selectedMap||(e.selectedMap={}))[t]=!0)},e.prototype.unSelect=function(t){var e=this.option.selectedMap;e&&(e[t]=!1)},e.prototype.toggleSelected=function(t){this[this.isSelected(t)?"unSelect":"select"](t)},e.prototype.isSelected=function(t){var e=this.option.selectedMap;return!(!e||!e[t])},e.type="geo",e.layoutMode="box",e.defaultOption={z:0,show:!0,left:"center",top:"center",aspectScale:null,silent:!1,map:"",boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},regions:[]},e}(YB),y$=g$;function v$(t,e){return t.pointToProjected?t.pointToProjected(e):t.pointToData(e)}function _$(t,e,i,n){var r=t.getZoom(),o=t.getCenter(),s=e.zoom,a=t.projectedToPoint?t.projectedToPoint(o):t.dataToPoint(o);if(null!=e.dx&&null!=e.dy&&(a[0]-=e.dx,a[1]-=e.dy,t.setCenter(v$(t,a),n)),null!=s){if(i){var l=i.min||0,c=i.max||1/0;s=Math.max(Math.min(r*s,c),l)/r}t.scaleX*=s,t.scaleY*=s;var u=(e.originX-t.x)*(s-1),h=(e.originY-t.y)*(s-1);t.x-=u,t.y-=h,t.updateTransform(),t.setCenter(v$(t,a),n),t.setZoom(s*r)}return{center:t.getCenter(),zoom:t.getZoom()}}var x$=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.focusBlurEnabled=!0,i}return zA(e,t),e.prototype.init=function(t,e){this._api=e},e.prototype.render=function(t,e,i,n){if(this._model=t,!t.get("show"))return this._mapDraw&&this._mapDraw.remove(),void(this._mapDraw=null);this._mapDraw||(this._mapDraw=new JK(i));var r=this._mapDraw;r.draw(t,e,i,this,n),r.group.on("click",this._handleRegionClick,this),r.group.silent=t.get("silent"),this.group.add(r.group),this.updateSelectStatus(t,e,i)},e.prototype._handleRegionClick=function(t){var e;$U(t.target,(function(t){return null!=(e=KD(t).eventData)}),!0),e&&this._api.dispatchAction({type:"geoToggleSelect",geoId:this._model.id,name:e.name})},e.prototype.updateSelectStatus=function(t,e,i){var n=this;this._mapDraw.group.traverse((function(t){var e=KD(t).eventData;if(e)return n._model.isSelected(e.name)?i.enterSelect(t):i.leaveSelect(t),!0}))},e.prototype.findHighDownDispatchers=function(t){return this._mapDraw&&this._mapDraw.findHighDownDispatchers(t,this._model)},e.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove()},e.type="geo",e}(qV),b$=x$;function w$(t,e,i){NK.registerMap(t,e,i)}function A$(t){function e(e,i){i.update="geo:updateSelectStatus",t.registerAction(i,(function(t,i){var n={},r=[];return i.eachComponent({mainType:"geo",query:t},(function(i){i[e](t.name),yE(i.coordinateSystem.regions,(function(t){n[t.name]=i.isSelected(t.name)||!1}));var o=[];yE(n,(function(t,e){n[e]&&o.push(e)})),r.push({geoIndex:i.componentIndex,name:o})})),{selected:n,allSelected:r,name:t.name}}))}t.registerCoordinateSystem("geo",m$),t.registerComponentModel(y$),t.registerComponentView(b$),t.registerImpl("registerMap",w$),t.registerImpl("getMap",(function(t){return NK.getMapForUser(t)})),e("toggleSelected",{type:"geoToggleSelect",event:"geoselectchanged"}),e("select",{type:"geoSelect",event:"geoselected"}),e("unSelect",{type:"geoUnSelect",event:"geounselected"}),t.registerAction({type:"geoRoam",event:"geoRoam",update:"updateTransform"},(function(t,e,i){var n=t.componentType||"series";e.eachComponent({mainType:n,query:t},(function(e){var r=e.coordinateSystem;if("geo"===r.type){var o=_$(r,t,e.get("scaleLimit"),i);e.setCenter&&e.setCenter(o.center),e.setZoom&&e.setZoom(o.zoom),"series"===n&&yE(e.seriesGroup,(function(t){t.setCenter(o.center),t.setZoom(o.zoom)}))}}))}))}function E$(t,e){var i=t.isExpand?t.children:[],n=t.parentNode.children,r=t.hierNode.i?n[t.hierNode.i-1]:null;if(i.length){!function(t){var e=t.children,i=e.length,n=0,r=0;for(;--i>=0;){var o=e[i];o.hierNode.prelim+=n,o.hierNode.modifier+=n,r+=o.hierNode.change,n+=o.hierNode.shift+r}}(t);var o=(i[0].hierNode.prelim+i[i.length-1].hierNode.prelim)/2;r?(t.hierNode.prelim=r.hierNode.prelim+e(t,r),t.hierNode.modifier=t.hierNode.prelim-o):t.hierNode.prelim=o}else r&&(t.hierNode.prelim=r.hierNode.prelim+e(t,r));t.parentNode.hierNode.defaultAncestor=function(t,e,i,n){if(e){for(var r=t,o=t,s=o.parentNode.children[0],a=e,l=r.hierNode.modifier,c=o.hierNode.modifier,u=s.hierNode.modifier,h=a.hierNode.modifier;a=I$(a),o=C$(o),a&&o;){r=I$(r),s=C$(s),r.hierNode.ancestor=t;var p=a.hierNode.prelim+h-o.hierNode.prelim-c+n(a,o);p>0&&(L$(P$(a,t,i),t,p),c+=p,l+=p),h+=a.hierNode.modifier,c+=o.hierNode.modifier,l+=r.hierNode.modifier,u+=s.hierNode.modifier}a&&!I$(r)&&(r.hierNode.thread=a,r.hierNode.modifier+=h-l),o&&!C$(s)&&(s.hierNode.thread=o,s.hierNode.modifier+=c-u,i=t)}return i}(t,r,t.parentNode.hierNode.defaultAncestor||n[0],e)}function S$(t){var e=t.hierNode.prelim+t.parentNode.hierNode.modifier;t.setLayout({x:e},!0),t.hierNode.modifier+=t.parentNode.hierNode.modifier}function M$(t){return arguments.length?t:D$}function T$(t,e){return t-=Math.PI/2,{x:e*Math.cos(t),y:e*Math.sin(t)}}function I$(t){var e=t.children;return e.length&&t.isExpand?e[e.length-1]:t.hierNode.thread}function C$(t){var e=t.children;return e.length&&t.isExpand?e[0]:t.hierNode.thread}function P$(t,e,i){return t.hierNode.ancestor.parentNode===e.parentNode?t.hierNode.ancestor:i}function L$(t,e,i){var n=i/(e.hierNode.i-t.hierNode.i);e.hierNode.change-=n,e.hierNode.shift+=i,e.hierNode.modifier+=i,e.hierNode.prelim+=i,t.hierNode.change+=n}function D$(t,e){return t.parentNode===e.parentNode?1:2}var R$=function(){this.parentPoint=[],this.childPoints=[]},O$=function(t){function e(e){return t.call(this,e)||this}return zA(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new R$},e.prototype.buildPath=function(t,e){var i=e.childPoints,n=i.length,r=e.parentPoint,o=i[0],s=i[n-1];if(1===n)return t.moveTo(r[0],r[1]),void t.lineTo(o[0],o[1]);var a=e.orient,l="TB"===a||"BT"===a?0:1,c=1-l,u=IC(e.forkPosition,1),h=[];h[l]=r[l],h[c]=r[c]+(s[c]-r[c])*u,t.moveTo(r[0],r[1]),t.lineTo(h[0],h[1]),t.moveTo(o[0],o[1]),h[l]=o[l],t.lineTo(h[0],h[1]),h[l]=s[l],t.lineTo(h[0],h[1]),t.lineTo(s[0],s[1]);for(var p=1;p<n-1;p++){var d=i[p];t.moveTo(d[0],d[1]),h[l]=d[l],t.lineTo(h[0],h[1])}},e}(xD),k$=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i._mainGroup=new xC,i}return zA(e,t),e.prototype.init=function(t,e){this._controller=new JJ(e.getZr()),this._controllerHost={target:this.group},this.group.add(this._mainGroup)},e.prototype.render=function(t,e,i){var n=t.getData(),r=t.layoutInfo,o=this._mainGroup;"radial"===t.get("layout")?(o.x=r.x+r.width/2,o.y=r.y+r.height/2):(o.x=r.x,o.y=r.y),this._updateViewCoordSys(t,i),this._updateController(t,e,i);var s=this._data;n.diff(s).add((function(e){N$(n,e)&&B$(n,e,null,o,t)})).update((function(e,i){var r=s.getItemGraphicEl(i);N$(n,e)?B$(n,e,r,o,t):r&&V$(s,i,r,o,t)})).remove((function(e){var i=s.getItemGraphicEl(e);i&&V$(s,e,i,o,t)})).execute(),this._nodeScaleRatio=t.get("nodeScaleRatio"),this._updateNodeAndLinkScale(t),!0===t.get("expandAndCollapse")&&n.eachItemGraphicEl((function(e,n){e.off("click").on("click",(function(){i.dispatchAction({type:"treeExpandAndCollapse",seriesId:t.id,dataIndex:n})}))})),this._data=n},e.prototype._updateViewCoordSys=function(t,e){var i=t.getData(),n=[];i.each((function(t){var e=i.getItemLayout(t);!e||isNaN(e.x)||isNaN(e.y)||n.push([+e.x,+e.y])}));var r=[],o=[];SL(n,r,o);var s=this._min,a=this._max;o[0]-r[0]==0&&(r[0]=s?s[0]:r[0]-1,o[0]=a?a[0]:o[0]+1),o[1]-r[1]==0&&(r[1]=s?s[1]:r[1]-1,o[1]=a?a[1]:o[1]+1);var l=t.coordinateSystem=new a$;l.zoomLimit=t.get("scaleLimit"),l.setBoundingRect(r[0],r[1],o[0]-r[0],o[1]-r[1]),l.setCenter(t.get("center"),e),l.setZoom(t.get("zoom")),this.group.attr({x:l.x,y:l.y,scaleX:l.scaleX,scaleY:l.scaleY}),this._min=r,this._max=o},e.prototype._updateController=function(t,e,i){var n=this,r=this._controller,o=this._controllerHost,s=this.group;r.setPointerChecker((function(e,n,r){var o=s.getBoundingRect();return o.applyTransform(s.transform),o.contain(n,r)&&!iK(e,i,t)})),r.enable(t.get("roam")),o.zoomLimit=t.get("scaleLimit"),o.zoom=t.coordinateSystem.getZoom(),r.off("pan").off("zoom").on("pan",(function(e){KJ(o,e.dx,e.dy),i.dispatchAction({seriesId:t.id,type:"treeRoam",dx:e.dx,dy:e.dy})})).on("zoom",(function(e){$J(o,e.scale,e.originX,e.originY),i.dispatchAction({seriesId:t.id,type:"treeRoam",zoom:e.scale,originX:e.originX,originY:e.originY}),n._updateNodeAndLinkScale(t),i.updateLabelLayout()}))},e.prototype._updateNodeAndLinkScale=function(t){var e=t.getData(),i=this._getNodeGlobalScale(t);e.eachItemGraphicEl((function(t,e){t.setSymbolScale(i)}))},e.prototype._getNodeGlobalScale=function(t){var e=t.coordinateSystem;if("view"!==e.type)return 1;var i=this._nodeScaleRatio,n=e.scaleX||1;return((e.getZoom()-1)*i+1)/n},e.prototype.dispose=function(){this._controller&&this._controller.dispose(),this._controllerHost=null},e.prototype.remove=function(){this._mainGroup.removeAll(),this._data=null},e.type="tree",e}(iU);function N$(t,e){var i=t.getItemLayout(e);return i&&!isNaN(i.x)&&!isNaN(i.y)}function B$(t,e,i,n,r){var o=!i,s=t.tree.getNodeByDataIndex(e),a=s.getModel(),l=s.getVisual("style").fill,c=!1===s.isExpand&&0!==s.children.length?l:"#fff",u=t.tree.root,h=s.parentNode===u?s:s.parentNode||s,p=t.getItemGraphicEl(h.dataIndex),d=h.getLayout(),f=p?{x:p.__oldX,y:p.__oldY,rawX:p.__radialOldRawX,rawY:p.__radialOldRawY}:d,m=s.getLayout();o?((i=new FZ(t,e,null,{symbolInnerColor:c,useNameLabel:!0})).x=f.x,i.y=f.y):i.updateData(t,e,null,{symbolInnerColor:c,useNameLabel:!0}),i.__radialOldRawX=i.__radialRawX,i.__radialOldRawY=i.__radialRawY,i.__radialRawX=m.rawX,i.__radialRawY=m.rawY,n.add(i),t.setItemGraphicEl(e,i),i.__oldX=i.x,i.__oldY=i.y,Pk(i,{x:m.x,y:m.y},r);var g=i.getSymbolPath();if("radial"===r.get("layout")){var y=u.children[0],v=y.getLayout(),_=y.children.length,x=void 0,b=void 0;if(m.x===v.x&&!0===s.isExpand&&y.children.length){var w={x:(y.children[0].getLayout().x+y.children[_-1].getLayout().x)/2,y:(y.children[0].getLayout().y+y.children[_-1].getLayout().y)/2};(x=Math.atan2(w.y-v.y,w.x-v.x))<0&&(x=2*Math.PI+x),(b=w.x<v.x)&&(x-=Math.PI)}else(x=Math.atan2(m.y-v.y,m.x-v.x))<0&&(x=2*Math.PI+x),0===s.children.length||0!==s.children.length&&!1===s.isExpand?(b=m.x<v.x)&&(x-=Math.PI):(b=m.x>v.x)||(x-=Math.PI);var A=b?"left":"right",E=a.getModel("label"),S=E.get("rotate"),M=S*(Math.PI/180),T=g.getTextContent();T&&(g.setTextConfig({position:E.get("position")||A,rotation:null==S?-x:M,origin:"center"}),T.setStyle("verticalAlign","middle"))}var I=a.get(["emphasis","focus"]),C="relative"===I?QE(s.getAncestorsIndices(),s.getDescendantIndices()):"ancestor"===I?s.getAncestorsIndices():"descendant"===I?s.getDescendantIndices():null;C&&(KD(i).focus=C),function(t,e,i,n,r,o,s,a){var l=e.getModel(),c=t.get("edgeShape"),u=t.get("layout"),h=t.getOrient(),p=t.get(["lineStyle","curveness"]),d=t.get("edgeForkPosition"),f=l.getModel("lineStyle").getLineStyle(),m=n.__edge;if("curve"===c)e.parentNode&&e.parentNode!==i&&(m||(m=n.__edge=new lk({shape:U$(u,h,p,r,r)})),Pk(m,{shape:U$(u,h,p,o,s)},t));else if("polyline"===c)if("orthogonal"===u){if(e!==i&&e.children&&0!==e.children.length&&!0===e.isExpand){for(var g=e.children,y=[],v=0;v<g.length;v++){var _=g[v].getLayout();y.push([_.x,_.y])}m||(m=n.__edge=new O$({shape:{parentPoint:[s.x,s.y],childPoints:[[s.x,s.y]],orient:h,forkPosition:d}})),Pk(m,{shape:{parentPoint:[s.x,s.y],childPoints:y}},t)}}else if("production"!==process.env.NODE_ENV)throw new Error("The polyline edgeShape can only be used in orthogonal layout");m&&("polyline"!==c||e.isExpand)&&(m.useStyle(dE({strokeNoScale:!0,fill:null},f)),JR(m,l,"lineStyle"),PR(m),a.add(m))}(r,s,u,i,f,d,m,n),i.__edge&&(i.onHoverStateChange=function(e){if("blur"!==e){var n=s.parentNode&&t.getItemGraphicEl(s.parentNode.dataIndex);n&&n.hoverState===oR||IR(i.__edge,e)}})}function z$(t,e,i,n,r){var o=F$(e.tree.root,t),s=o.source,a=o.sourceLayout,l=e.getItemGraphicEl(t.dataIndex);if(l){var c=e.getItemGraphicEl(s.dataIndex).__edge,u=l.__edge||(!1===s.isExpand||1===s.children.length?c:void 0),h=n.get("edgeShape"),p=n.get("layout"),d=n.get("orient"),f=n.get(["lineStyle","curveness"]);u&&("curve"===h?Rk(u,{shape:U$(p,d,f,a,a),style:{opacity:0}},n,{cb:function(){i.remove(u)},removeOpt:r}):"polyline"===h&&"orthogonal"===n.get("layout")&&Rk(u,{shape:{parentPoint:[a.x,a.y],childPoints:[[a.x,a.y]]},style:{opacity:0}},n,{cb:function(){i.remove(u)},removeOpt:r}))}}function F$(t,e){for(var i,n=e.parentNode===t?e:e.parentNode||e;null==(i=n.getLayout());)n=n.parentNode===t?n:n.parentNode||n;return{source:n,sourceLayout:i}}function V$(t,e,i,n,r){var o=t.tree.getNodeByDataIndex(e),s=F$(t.tree.root,o).sourceLayout,a={duration:r.get("animationDurationUpdate"),easing:r.get("animationEasingUpdate")};Rk(i,{x:s.x+1,y:s.y+1},r,{cb:function(){n.remove(i),t.setItemGraphicEl(e,null)},removeOpt:a}),i.fadeOut(null,t.hostModel,{fadeLabel:!0,animation:a}),o.children.forEach((function(e){z$(e,t,n,r,a)})),z$(o,t,n,r,a)}function U$(t,e,i,n,r){var o,s,a,l,c,u,h,p;if("radial"===t){c=n.rawX,h=n.rawY,u=r.rawX,p=r.rawY;var d=T$(c,h),f=T$(c,h+(p-h)*i),m=T$(u,p+(h-p)*i),g=T$(u,p);return{x1:d.x||0,y1:d.y||0,x2:g.x||0,y2:g.y||0,cpx1:f.x||0,cpy1:f.y||0,cpx2:m.x||0,cpy2:m.y||0}}return c=n.x,h=n.y,u=r.x,p=r.y,"LR"!==e&&"RL"!==e||(o=c+(u-c)*i,s=h,a=u+(c-u)*i,l=p),"TB"!==e&&"BT"!==e||(o=c,s=h+(p-h)*i,a=u,l=p+(h-p)*i),{x1:c,y1:h,x2:u,y2:p,cpx1:o,cpy1:s,cpx2:a,cpy2:l}}var G$=k$,j$=wP();function H$(t){var e=t.mainData,i=t.datas;i||(i={main:e},t.datasAttr={main:"data"}),t.datas=t.mainData=null,Q$(e,i,t),yE(i,(function(i){yE(e.TRANSFERABLE_METHODS,(function(e){i.wrapMethod(e,AE(W$,t))}))})),e.wrapMethod("cloneShallow",AE(X$,t)),yE(e.CHANGABLE_METHODS,(function(i){e.wrapMethod(i,AE(q$,t))})),UE(i[e.dataType]===e)}function W$(t,e){if(j$(n=this).mainData===n){var i=pE({},j$(this).datas);i[this.dataType]=e,Q$(e,i,t)}else J$(e,this.dataType,j$(this).mainData,t);var n;return e}function q$(t,e){return t.struct&&t.struct.update(),e}function X$(t,e){return yE(j$(e).datas,(function(i,n){i!==e&&J$(i.cloneShallow(),n,e,t)})),e}function Z$(t){var e=j$(this).mainData;return null==t||null==e?e:j$(e).datas[t]}function Y$(){var t=j$(this).mainData;return null==t?[{data:t}]:vE(bE(j$(t).datas),(function(e){return{type:e,data:j$(t).datas[e]}}))}function Q$(t,e,i){j$(t).datas={},yE(e,(function(e,n){J$(e,n,t,i)}))}function J$(t,e,i,n){j$(i).datas[e]=t,j$(t).mainData=i,t.dataType=e,n.struct&&(t[n.structAttr]=n.struct,n.struct[n.datasAttr[e]]=t),t.getLinkedData=Z$,t.getLinkedDataAll=Y$}var K$=function(){function t(t,e){this.depth=0,this.height=0,this.dataIndex=-1,this.children=[],this.viewChildren=[],this.isExpand=!1,this.name=t||"",this.hostTree=e}return t.prototype.isRemoved=function(){return this.dataIndex<0},t.prototype.eachNode=function(t,e,i){SE(t)&&(i=e,e=t,t=null),ME(t=t||{})&&(t={order:t});var n,r=t.order||"preorder",o=this[t.attr||"children"];"preorder"===r&&(n=e.call(i,this));for(var s=0;!n&&s<o.length;s++)o[s].eachNode(t,e,i);"postorder"===r&&e.call(i,this)},t.prototype.updateDepthAndHeight=function(t){var e=0;this.depth=t;for(var i=0;i<this.children.length;i++){var n=this.children[i];n.updateDepthAndHeight(t+1),n.height>e&&(e=n.height)}this.height=e+1},t.prototype.getNodeById=function(t){if(this.getId()===t)return this;for(var e=0,i=this.children,n=i.length;e<n;e++){var r=i[e].getNodeById(t);if(r)return r}},t.prototype.contains=function(t){if(t===this)return!0;for(var e=0,i=this.children,n=i.length;e<n;e++){var r=i[e].contains(t);if(r)return r}},t.prototype.getAncestors=function(t){for(var e=[],i=t?this:this.parentNode;i;)e.push(i),i=i.parentNode;return e.reverse(),e},t.prototype.getAncestorsIndices=function(){for(var t=[],e=this;e;)t.push(e.dataIndex),e=e.parentNode;return t.reverse(),t},t.prototype.getDescendantIndices=function(){var t=[];return this.eachNode((function(e){t.push(e.dataIndex)})),t},t.prototype.getValue=function(t){var e=this.hostTree.data;return e.getStore().get(e.getDimensionIndex(t||"value"),this.dataIndex)},t.prototype.setLayout=function(t,e){this.dataIndex>=0&&this.hostTree.data.setItemLayout(this.dataIndex,t,e)},t.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},t.prototype.getModel=function(t){if(!(this.dataIndex<0))return this.hostTree.data.getItemModel(this.dataIndex).getModel(t)},t.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},t.prototype.setVisual=function(t,e){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,t,e)},t.prototype.getVisual=function(t){return this.hostTree.data.getItemVisual(this.dataIndex,t)},t.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},t.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},t.prototype.getChildIndex=function(){if(this.parentNode){for(var t=this.parentNode.children,e=0;e<t.length;++e)if(t[e]===this)return e;return-1}return-1},t.prototype.isAncestorOf=function(t){for(var e=t.parentNode;e;){if(e===this)return!0;e=e.parentNode}return!1},t.prototype.isDescendantOf=function(t){return t!==this&&t.isAncestorOf(this)},t}(),$$=function(){function t(t){this.type="tree",this._nodes=[],this.hostModel=t}return t.prototype.eachNode=function(t,e,i){this.root.eachNode(t,e,i)},t.prototype.getNodeByDataIndex=function(t){var e=this.data.getRawIndex(t);return this._nodes[e]},t.prototype.getNodeById=function(t){return this.root.getNodeById(t)},t.prototype.update=function(){for(var t=this.data,e=this._nodes,i=0,n=e.length;i<n;i++)e[i].dataIndex=-1;for(i=0,n=t.count();i<n;i++)e[t.getRawIndex(i)].dataIndex=i},t.prototype.clearLayouts=function(){this.data.clearItemLayouts()},t.createTree=function(e,i,n){var r=new t(i),o=[],s=1;!function t(e,i){var n=e.value;s=Math.max(s,EE(n)?n.length:1),o.push(e);var a=new K$(gP(e.name,""),r);i?function(t,e){var i=e.children;if(t.parentNode===e)return;i.push(t),t.parentNode=e}(a,i):r.root=a,r._nodes.push(a);var l=e.children;if(l)for(var c=0;c<l.length;c++)t(l[c],a)}(e),r.root.updateDepthAndHeight(0);var a=LH(o,{coordDimensions:["value"],dimensionsCount:s}).dimensions,l=new PH(a,i);return l.initData(o),n&&n(l),H$({mainData:l,struct:r,structAttr:"tree"}),r.update(),r},t}();var t0=$$;function e0(t,e,i){if(t&&fE(e,t.type)>=0){var n=i.getData().tree.root,r=t.targetNode;if(ME(r)&&(r=n.getNodeById(r)),r&&n.contains(r))return{node:r};var o=t.targetNodeId;if(null!=o&&(r=n.getNodeById(o)))return{node:r}}}function i0(t){for(var e=[];t;)(t=t.parentNode)&&e.push(t);return e.reverse()}function n0(t,e){return fE(i0(t),e)>=0}function r0(t,e){for(var i=[];t;){var n=t.dataIndex;i.push({name:t.name,dataIndex:n,value:e.getRawValue(n)}),t=t.parentNode}return i.reverse(),i}var o0=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.hasSymbolVisual=!0,e.ignoreStyleOnData=!0,e}return zA(e,t),e.prototype.getInitialData=function(t){var e={name:t.name,children:t.data},i=t.leaves||{},n=new FN(i,this,this.ecModel),r=t0.createTree(e,this,(function(t){t.wrapMethod("getItemModel",(function(t,e){var i=r.getNodeByDataIndex(e);return i&&i.children.length&&i.isExpand||(t.parentModel=n),t}))}));var o=0;r.eachNode("preorder",(function(t){t.depth>o&&(o=t.depth)}));var s=t.expandAndCollapse&&t.initialTreeDepth>=0?t.initialTreeDepth:o;return r.root.eachNode("preorder",(function(t){var e=t.hostTree.data.getRawDataItem(t.dataIndex);t.isExpand=e&&null!=e.collapsed?!e.collapsed:t.depth<=s})),r.data},e.prototype.getOrient=function(){var t=this.get("orient");return"horizontal"===t?t="LR":"vertical"===t&&(t="TB"),t},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.formatTooltip=function(t,e,i){for(var n=this.getData().tree,r=n.root.children[0],o=n.getNodeByDataIndex(t),s=o.getValue(),a=o.name;o&&o!==r;)a=o.parentNode.name+"."+a,o=o.parentNode;return xV("nameValue",{name:a,value:s,noValue:isNaN(s)||null==s})},e.prototype.getDataParams=function(e){var i=t.prototype.getDataParams.apply(this,arguments),n=this.getData().tree.getNodeByDataIndex(e);return i.treeAncestors=r0(n,this),i.collapsed=!n.isExpand,i},e.type="series.tree",e.layoutMode="box",e.defaultOption={z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},e}(HV),s0=o0;function a0(t,e){for(var i,n=[t];i=n.pop();)if(e(i),i.isExpand){var r=i.children;if(r.length)for(var o=r.length-1;o>=0;o--)n.push(r[o])}}function l0(t,e){t.eachSeriesByType("tree",(function(t){!function(t,e){var i=function(t,e){return UB(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}(t,e);t.layoutInfo=i;var n=t.get("layout"),r=0,o=0,s=null;"radial"===n?(r=2*Math.PI,o=Math.min(i.height,i.width)/2,s=M$((function(t,e){return(t.parentNode===e.parentNode?1:2)/t.depth}))):(r=i.width,o=i.height,s=M$());var a=t.getData().tree.root,l=a.children[0];if(l){!function(t){var e=t;e.hierNode={defaultAncestor:null,ancestor:e,prelim:0,modifier:0,change:0,shift:0,i:0,thread:null};for(var i,n,r=[e];i=r.pop();)if(n=i.children,i.isExpand&&n.length)for(var o=n.length-1;o>=0;o--){var s=n[o];s.hierNode={defaultAncestor:null,ancestor:s,prelim:0,modifier:0,change:0,shift:0,i:o,thread:null},r.push(s)}}(a),function(t,e,i){for(var n,r=[t],o=[];n=r.pop();)if(o.push(n),n.isExpand){var s=n.children;if(s.length)for(var a=0;a<s.length;a++)r.push(s[a])}for(;n=o.pop();)e(n,i)}(l,E$,s),a.hierNode.modifier=-l.hierNode.prelim,a0(l,S$);var c=l,u=l,h=l;a0(l,(function(t){var e=t.getLayout().x;e<c.getLayout().x&&(c=t),e>u.getLayout().x&&(u=t),t.depth>h.depth&&(h=t)}));var p=c===u?1:s(c,u)/2,d=p-c.getLayout().x,f=0,m=0,g=0,y=0;if("radial"===n)f=r/(u.getLayout().x+p+d),m=o/(h.depth-1||1),a0(l,(function(t){g=(t.getLayout().x+d)*f,y=(t.depth-1)*m;var e=T$(g,y);t.setLayout({x:e.x,y:e.y,rawX:g,rawY:y},!0)}));else{var v=t.getOrient();"RL"===v||"LR"===v?(m=o/(u.getLayout().x+p+d),f=r/(h.depth-1||1),a0(l,(function(t){y=(t.getLayout().x+d)*m,g="LR"===v?(t.depth-1)*f:r-(t.depth-1)*f,t.setLayout({x:g,y:y},!0)}))):"TB"!==v&&"BT"!==v||(f=r/(u.getLayout().x+p+d),m=o/(h.depth-1||1),a0(l,(function(t){g=(t.getLayout().x+d)*f,y="TB"===v?(t.depth-1)*m:o-(t.depth-1)*m,t.setLayout({x:g,y:y},!0)})))}}}(t,e)}))}function c0(t){t.eachSeriesByType("tree",(function(t){var e=t.getData();e.tree.eachNode((function(t){var i=t.getModel().getModel("itemStyle").getItemStyle();pE(e.ensureUniqueItemVisual(t.dataIndex,"style"),i)}))}))}var u0=["treemapZoomToNode","treemapRender","treemapMove"];function h0(t){var e=t.getData().tree,i={};e.eachNode((function(e){for(var n=e;n&&n.depth>1;)n=n.parentNode;var r=wz(t.ecModel,n.name||n.dataIndex+"",i);e.setVisual("decal",r)}))}var p0=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.preventUsingHoverLayer=!0,i}return zA(e,t),e.prototype.getInitialData=function(t,e){var i={name:t.name,children:t.data};d0(i);var n=t.levels||[],r=this.designatedVisualItemStyle={},o=new FN({itemStyle:r},this,e);n=t.levels=function(t,e){var i,n,r=lP(e.get("color")),o=lP(e.get(["aria","decal","decals"]));if(!r)return;t=t||[],yE(t,(function(t){var e=new FN(t),r=e.get("color"),o=e.get("decal");(e.get(["itemStyle","color"])||r&&"none"!==r)&&(i=!0),(e.get(["itemStyle","decal"])||o&&"none"!==o)&&(n=!0)}));var s=t[0]||(t[0]={});i||(s.color=r.slice());!n&&o&&(s.decal=o.slice());return t}(n,e);var s=vE(n||[],(function(t){return new FN(t,o,e)}),this),a=t0.createTree(i,this,(function(t){t.wrapMethod("getItemModel",(function(t,e){var i=a.getNodeByDataIndex(e),n=i?s[i.depth]:null;return t.parentModel=n||o,t}))}));return a.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.formatTooltip=function(t,e,i){var n=this.getData(),r=this.getRawValue(t);return xV("nameValue",{name:n.getName(t),value:r})},e.prototype.getDataParams=function(e){var i=t.prototype.getDataParams.apply(this,arguments),n=this.getData().tree.getNodeByDataIndex(e);return i.treeAncestors=r0(n,this),i.treePathInfo=i.treeAncestors,i},e.prototype.setLayoutInfo=function(t){this.layoutInfo=this.layoutInfo||{},pE(this.layoutInfo,t)},e.prototype.mapIdToIndex=function(t){var e=this._idIndexMap;e||(e=this._idIndexMap=YE(),this._idIndexMapCount=0);var i=e.get(t);return null==i&&e.set(t,i=this._idIndexMapCount++),i},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var e=this.getRawData().tree.root;t&&(t===e||e.contains(t))||(this._viewRoot=e)},e.prototype.enableAriaDecal=function(){h0(this)},e.type="series.treemap",e.layoutMode="box",e.defaultOption={progressive:0,left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.1024,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}},emphasis:{itemStyle:{color:"rgba(0,0,0,0.9)"}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},e}(HV);function d0(t){var e=0;yE(t.children,(function(t){d0(t);var i=t.value;EE(i)&&(i=i[0]),e+=i}));var i=t.value;EE(i)&&(i=i[0]),(null==i||isNaN(i))&&(i=e),i<0&&(i=0),EE(t.value)?t.value[0]=i:t.value=i}var f0=p0,m0=function(){function t(t){this.group=new xC,t.add(this.group)}return t.prototype.render=function(t,e,i,n){var r=t.getModel("breadcrumb"),o=this.group;if(o.removeAll(),r.get("show")&&i){var s=r.getModel("itemStyle"),a=r.getModel("emphasis"),l=s.getModel("textStyle"),c=a.getModel(["itemStyle","textStyle"]),u={pos:{left:r.get("left"),right:r.get("right"),top:r.get("top"),bottom:r.get("bottom")},box:{width:e.getWidth(),height:e.getHeight()},emptyItemWidth:r.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(i,u,l),this._renderContent(t,u,s,a,l,c,n),GB(o,u.pos,u.box)}},t.prototype._prepare=function(t,e,i){for(var n=t;n;n=n.parentNode){var r=gP(n.getModel().get("name"),""),o=i.getTextRect(r),s=Math.max(o.width+16,e.emptyItemWidth);e.totalWidth+=s+8,e.renderList.push({node:n,text:r,width:s})}},t.prototype._renderContent=function(t,e,i,n,r,o,s){for(var a,l,c,u,h,p,d,f,m,g=0,y=e.emptyItemWidth,v=t.get(["breadcrumb","height"]),_=(a=e.pos,l=e.box,u=l.width,h=l.height,p=IC(a.left,u),d=IC(a.top,h),f=IC(a.right,u),m=IC(a.bottom,h),(isNaN(p)||isNaN(parseFloat(a.left)))&&(p=0),(isNaN(f)||isNaN(parseFloat(a.right)))&&(f=u),(isNaN(d)||isNaN(parseFloat(a.top)))&&(d=0),(isNaN(m)||isNaN(parseFloat(a.bottom)))&&(m=h),c=CB(c||0),{width:Math.max(f-p-c[1]-c[3],0),height:Math.max(m-d-c[0]-c[2],0)}),x=e.totalWidth,b=e.renderList,w=n.getModel("itemStyle").getItemStyle(),A=b.length-1;A>=0;A--){var E=b[A],S=E.node,M=E.width,T=E.text;x>_.width&&(x-=M-y,M=y,T=null);var I=new QO({shape:{points:g0(g,0,M,v,A===b.length-1,0===A)},style:dE(i.getItemStyle(),{lineJoin:"bevel"}),textContent:new JD({style:mN(r,{text:T})}),textConfig:{position:"inside"},z2:1e4*cR,onclick:AE(s,S)});I.disableLabelAnimation=!0,I.getTextContent().ensureState("emphasis").style=mN(o,{text:T}),I.ensureState("emphasis").style=w,XR(I,n.get("focus"),n.get("blurScope"),n.get("disabled")),this.group.add(I),y0(I,t,S),g+=M+8}},t.prototype.remove=function(){this.group.removeAll()},t}();function g0(t,e,i,n,r,o){var s=[[r?t:t-5,e],[t+i,e],[t+i,e+n],[r?t:t-5,e+n]];return!o&&s.splice(2,0,[t+i+5,e+n/2]),!r&&s.push([t,e+n/2]),s}function y0(t,e,i){KD(t).eventData={componentType:"series",componentSubType:"treemap",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:i&&i.dataIndex,name:i&&i.name},treePathInfo:i&&r0(i,e)}}var v0=m0,_0=function(){function t(){this._storage=[],this._elExistsMap={}}return t.prototype.add=function(t,e,i,n,r){return!this._elExistsMap[t.id]&&(this._elExistsMap[t.id]=!0,this._storage.push({el:t,target:e,duration:i,delay:n,easing:r}),!0)},t.prototype.finished=function(t){return this._finishedCallback=t,this},t.prototype.start=function(){for(var t=this,e=this._storage.length,i=function(){--e<=0&&(t._storage.length=0,t._elExistsMap={},t._finishedCallback&&t._finishedCallback())},n=0,r=this._storage.length;n<r;n++){var o=this._storage[n];o.el.animateTo(o.target,{duration:o.duration,delay:o.delay,easing:o.easing,setToFinal:!0,done:i,aborted:i})}return this},t}();var x0=xC,b0=kD,w0="label",A0="upperLabel",E0=10*cR,S0=2*cR,M0=3*cR,T0=GP([["fill","color"],["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),I0=function(t){var e=T0(t);return e.stroke=e.fill=e.lineWidth=null,e},C0=wP(),P0=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i._state="ready",i._storage={nodeGroup:[],background:[],content:[]},i}return zA(e,t),e.prototype.render=function(t,e,i,n){if(!(fE(e.findComponents({mainType:"series",subType:"treemap",query:n}),t)<0)){this.seriesModel=t,this.api=i,this.ecModel=e;var r=e0(n,["treemapZoomToNode","treemapRootToNode"],t),o=n&&n.type,s=t.layoutInfo,a=!this._oldTree,l=this._storage,c="treemapRootToNode"===o&&r&&l?{rootNodeGroup:l.nodeGroup[r.node.getRawIndex()],direction:n.direction}:null,u=this._giveContainerGroup(s),h=t.get("animation"),p=this._doRender(u,t,c);!h||a||o&&"treemapZoomToNode"!==o&&"treemapRootToNode"!==o?p.renderFinally():this._doAnimation(u,p,t,c),this._resetController(i),this._renderBreadcrumb(t,i,r)}},e.prototype._giveContainerGroup=function(t){var e=this._containerGroup;return e||(e=this._containerGroup=new x0,this._initEvents(e),this.group.add(e)),e.x=t.x,e.y=t.y,e},e.prototype._doRender=function(t,e,i){var n=e.getData().tree,r=this._oldTree,o={nodeGroup:[],background:[],content:[]},s={nodeGroup:[],background:[],content:[]},a=this._storage,l=[];function c(t,n,r,c){return function(t,e,i,n,r,o,s,a,l,c){if(!s)return;var u=s.getLayout(),h=t.getData(),p=s.getModel();if(h.setItemGraphicEl(s.dataIndex,null),!u||!u.isInView)return;var d=u.width,f=u.height,m=u.borderWidth,g=u.invisible,y=s.getRawIndex(),v=a&&a.getRawIndex(),_=s.viewChildren,x=u.upperHeight,b=_&&_.length,w=p.getModel("itemStyle"),A=p.getModel(["emphasis","itemStyle"]),E=p.getModel(["blur","itemStyle"]),S=p.getModel(["select","itemStyle"]),M=w.get("borderRadius")||0,T=V("nodeGroup",x0);if(!T)return;if(l.add(T),T.x=u.x||0,T.y=u.y||0,T.markRedraw(),C0(T).nodeWidth=d,C0(T).nodeHeight=f,u.isAboveViewRoot)return T;var I=V("background",b0,c,S0);I&&k(T,I,b&&u.upperLabelHeight);var C=p.getModel("emphasis"),P=C.get("focus"),L=C.get("blurScope"),D=C.get("disabled"),R="ancestor"===P?s.getAncestorsIndices():"descendant"===P?s.getDescendantIndices():P;if(b)$R(T)&&KR(T,!1),I&&(KR(I,!D),h.setItemGraphicEl(s.dataIndex,I),ZR(I,R,L));else{var O=V("content",b0,c,M0);O&&N(T,O),I.disableMorphing=!0,I&&$R(I)&&KR(I,!1),KR(T,!D),h.setItemGraphicEl(s.dataIndex,T),ZR(T,R,L)}return T;function k(e,i,n){var r=KD(i);if(r.dataIndex=s.dataIndex,r.seriesIndex=t.seriesIndex,i.setShape({x:0,y:0,width:d,height:f,r:M}),g)B(i);else{i.invisible=!1;var o=s.getVisual("style"),a=o.stroke,l=I0(w);l.fill=a;var c=T0(A);c.fill=A.get("borderColor");var u=T0(E);u.fill=E.get("borderColor");var h=T0(S);if(h.fill=S.get("borderColor"),n){var p=d-2*m;z(i,a,o.opacity,{x:m,y:0,width:p,height:x})}else i.removeTextContent();i.setStyle(l),i.ensureState("emphasis").style=c,i.ensureState("blur").style=u,i.ensureState("select").style=h,PR(i)}e.add(i)}function N(e,i){var n=KD(i);n.dataIndex=s.dataIndex,n.seriesIndex=t.seriesIndex;var r=Math.max(d-2*m,0),o=Math.max(f-2*m,0);if(i.culling=!0,i.setShape({x:m,y:m,width:r,height:o,r:M}),g)B(i);else{i.invisible=!1;var a=s.getVisual("style"),l=a.fill,c=I0(w);c.fill=l,c.decal=a.decal;var u=T0(A),h=T0(E),p=T0(S);z(i,l,a.opacity,null),i.setStyle(c),i.ensureState("emphasis").style=u,i.ensureState("blur").style=h,i.ensureState("select").style=p,PR(i)}e.add(i)}function B(t){!t.invisible&&o.push(t)}function z(e,i,n,r){var o=p.getModel(r?A0:w0),a=gP(p.get("name"),null),l=o.getShallow("show");dN(e,fN(p,r?A0:w0),{defaultText:l?a:null,inheritColor:i,defaultOpacity:n,labelFetcher:t,labelDataIndex:s.dataIndex});var c=e.getTextContent();if(c){var h=c.style,d=VE(h.padding||0);r&&(e.setTextConfig({layoutRect:r}),c.disableLabelLayout=!0),c.beforeUpdate=function(){var t=Math.max((r?r.width:e.shape.width)-d[1]-d[3],0),i=Math.max((r?r.height:e.shape.height)-d[0]-d[2],0);h.width===t&&h.height===i||c.setStyle({width:t,height:i})},h.truncateMinChar=2,h.lineOverflow="truncate",F(h,r,u);var f=c.getState("emphasis");F(f?f.style:null,r,u)}}function F(e,i,n){var r=e?e.text:null;if(!i&&n.isLeafRoot&&null!=r){var o=t.get("drillDownIcon",!0);e.text=o?o+" "+r:r}}function V(t,n,o,s){var a=null!=v&&i[t][v],l=r[t];return a?(i[t][v]=null,U(l,a)):g||((a=new n)instanceof gL&&(a.z2=function(t,e){return t*E0+e}(o,s)),G(l,a)),e[t][y]=a}function U(t,e){var i=t[y]={};e instanceof x0?(i.oldX=e.x,i.oldY=e.y):i.oldShape=pE({},e.shape)}function G(t,e){var i=t[y]={},o=s.parentNode,a=e instanceof xC;if(o&&(!n||"drillDown"===n.direction)){var l=0,c=0,u=r.background[o.getRawIndex()];!n&&u&&u.oldShape&&(l=u.oldShape.width,c=u.oldShape.height),a?(i.oldX=0,i.oldY=c):i.oldShape={x:l,y:c,width:0,height:0}}i.fadein=!a}}(e,s,a,i,o,l,t,n,r,c)}!function t(e,i,n,r,o){r?(i=e,yE(e,(function(t,e){!t.isRemoved()&&a(e,e)}))):new oH(i,e,s,s).add(a).update(a).remove(AE(a,null)).execute();function s(t){return t.getId()}function a(s,a){var l=null!=s?e[s]:null,u=null!=a?i[a]:null,h=c(l,u,n,o);h&&t(l&&l.viewChildren||[],u&&u.viewChildren||[],h,r,o+1)}}(n.root?[n.root]:[],r&&r.root?[r.root]:[],t,n===r||!r,0);var u=function(t){var e={nodeGroup:[],background:[],content:[]};return t&&yE(t,(function(t,i){var n=e[i];yE(t,(function(t){t&&(n.push(t),C0(t).willDelete=!0)}))})),e}(a);return this._oldTree=n,this._storage=s,{lastsForAnimation:o,willDeleteEls:u,renderFinally:function(){yE(u,(function(t){yE(t,(function(t){t.parent&&t.parent.remove(t)}))})),yE(l,(function(t){t.invisible=!0,t.dirty()}))}}},e.prototype._doAnimation=function(t,e,i,n){var r=i.get("animationDurationUpdate"),o=i.get("animationEasing"),s=(SE(r)?0:r)||0,a=(SE(o)?null:o)||"cubicOut",l=new _0;yE(e.willDeleteEls,(function(t,e){yE(t,(function(t,i){if(!t.invisible){var r,o=t.parent,c=C0(o);if(n&&"drillDown"===n.direction)r=o===n.rootNodeGroup?{shape:{x:0,y:0,width:c.nodeWidth,height:c.nodeHeight},style:{opacity:0}}:{style:{opacity:0}};else{var u=0,h=0;c.willDelete||(u=c.nodeWidth/2,h=c.nodeHeight/2),r="nodeGroup"===e?{x:u,y:h,style:{opacity:0}}:{shape:{x:u,y:h,width:0,height:0},style:{opacity:0}}}r&&l.add(t,r,s,0,a)}}))})),yE(this._storage,(function(t,i){yE(t,(function(t,n){var r=e.lastsForAnimation[i][n],o={};r&&(t instanceof xC?null!=r.oldX&&(o.x=t.x,o.y=t.y,t.x=r.oldX,t.y=r.oldY):(r.oldShape&&(o.shape=pE({},t.shape),t.setShape(r.oldShape)),r.fadein?(t.setStyle("opacity",0),o.style={opacity:1}):1!==t.style.opacity&&(o.style={opacity:1})),l.add(t,o,s,0,a))}))}),this),this._state="animating",l.finished(wE((function(){this._state="ready",e.renderFinally()}),this)).start()},e.prototype._resetController=function(t){var e=this._controller;e||((e=this._controller=new JJ(t.getZr())).enable(this.seriesModel.get("roam")),e.on("pan",wE(this._onPan,this)),e.on("zoom",wE(this._onZoom,this)));var i=new pM(0,0,t.getWidth(),t.getHeight());e.setPointerChecker((function(t,e,n){return i.contain(e,n)}))},e.prototype._clearController=function(){var t=this._controller;t&&(t.dispose(),t=null)},e.prototype._onPan=function(t){if("animating"!==this._state&&(Math.abs(t.dx)>3||Math.abs(t.dy)>3)){var e=this.seriesModel.getData().tree.root;if(!e)return;var i=e.getLayout();if(!i)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:i.x+t.dx,y:i.y+t.dy,width:i.width,height:i.height}})}},e.prototype._onZoom=function(t){var e=t.originX,i=t.originY;if("animating"!==this._state){var n=this.seriesModel.getData().tree.root;if(!n)return;var r=n.getLayout();if(!r)return;var o=new pM(r.x,r.y,r.width,r.height),s=this.seriesModel.layoutInfo,a=[1,0,0,1,0,0];JS(a,a,[-(e-=s.x),-(i-=s.y)]),$S(a,a,[t.scale,t.scale]),JS(a,a,[e,i]),o.applyTransform(a),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:o.x,y:o.y,width:o.width,height:o.height}})}},e.prototype._initEvents=function(t){var e=this;t.on("click",(function(t){if("ready"===e._state){var i=e.seriesModel.get("nodeClick",!0);if(i){var n=e.findTarget(t.offsetX,t.offsetY);if(n){var r=n.node;if(r.getLayout().isLeafRoot)e._rootToNode(n);else if("zoomToNode"===i)e._zoomToNode(n);else if("link"===i){var o=r.hostTree.data.getItemModel(r.dataIndex),s=o.get("link",!0),a=o.get("target",!0)||"blank";s&&kB(s,a)}}}}}),this)},e.prototype._renderBreadcrumb=function(t,e,i){var n=this;i||(i=null!=t.get("leafDepth",!0)?{node:t.getViewRoot()}:this.findTarget(e.getWidth()/2,e.getHeight()/2))||(i={node:t.getData().tree.root}),(this._breadcrumb||(this._breadcrumb=new v0(this.group))).render(t,e,i.node,(function(e){"animating"!==n._state&&(n0(t.getViewRoot(),e)?n._rootToNode({node:e}):n._zoomToNode({node:e}))}))},e.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage={nodeGroup:[],background:[],content:[]},this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},e.prototype.dispose=function(){this._clearController()},e.prototype._zoomToNode=function(t){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype._rootToNode=function(t){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype.findTarget=function(t,e){var i;return this.seriesModel.getViewRoot().eachNode({attr:"viewChildren",order:"preorder"},(function(n){var r=this._storage.background[n.getRawIndex()];if(r){var o=r.transformCoordToLocal(t,e),s=r.shape;if(!(s.x<=o[0]&&o[0]<=s.x+s.width&&s.y<=o[1]&&o[1]<=s.y+s.height))return!1;i={node:n,offsetX:o[0],offsetY:o[1]}}}),this),i},e.type="treemap",e}(iU);var L0=P0,D0=yE,R0=CE,O0=-1,k0=function(){function t(e){var i=e.mappingMethod,n=e.type,r=this.option=cE(e);this.type=n,this.mappingMethod=i,this._normalizeData=W0[i];var o=t.visualHandlers[n];this.applyVisual=o.applyVisual,this.getColorMapper=o.getColorMapper,this._normalizedToVisual=o._normalizedToVisual[i],"piecewise"===i?(N0(r),function(t){var e=t.pieceList;t.hasSpecialVisual=!1,yE(e,(function(e,i){e.originIndex=i,null!=e.visual&&(t.hasSpecialVisual=!0)}))}(r)):"category"===i?r.categories?function(t){var e=t.categories,i=t.categoryMap={},n=t.visual;if(D0(e,(function(t,e){i[t]=e})),!EE(n)){var r=[];CE(n)?D0(n,(function(t,e){var n=i[e];r[null!=n?n:O0]=t})):r[O0]=n,n=H0(t,r)}for(var o=e.length-1;o>=0;o--)null==n[o]&&(delete i[e[o]],e.pop())}(r):N0(r,!0):(UE("linear"!==i||r.dataExtent),N0(r))}return t.prototype.mapValueToVisual=function(t){var e=this._normalizeData(t);return this._normalizedToVisual(e,t)},t.prototype.getNormalizer=function(){return wE(this._normalizeData,this)},t.listVisualTypes=function(){return bE(t.visualHandlers)},t.isValidType=function(e){return t.visualHandlers.hasOwnProperty(e)},t.eachVisual=function(t,e,i){CE(t)?yE(t,e,i):e.call(i,t)},t.mapVisual=function(e,i,n){var r,o=EE(e)?[]:CE(e)?{}:(r=!0,null);return t.eachVisual(e,(function(t,e){var s=i.call(n,t,e);r?o=s:o[e]=s})),o},t.retrieveVisuals=function(e){var i,n={};return e&&D0(t.visualHandlers,(function(t,r){e.hasOwnProperty(r)&&(n[r]=e[r],i=!0)})),i?n:null},t.prepareVisualTypes=function(t){if(EE(t))t=t.slice();else{if(!R0(t))return[];var e=[];D0(t,(function(t,i){e.push(i)})),t=e}return t.sort((function(t,e){return"color"===e&&"color"!==t&&0===t.indexOf("color")?1:-1})),t},t.dependsOn=function(t,e){return"color"===e?!(!t||0!==t.indexOf(e)):t===e},t.findPieceIndex=function(t,e,i){for(var n,r=1/0,o=0,s=e.length;o<s;o++){var a=e[o].value;if(null!=a){if(a===t||ME(a)&&a===t+"")return o;i&&h(a,o)}}for(o=0,s=e.length;o<s;o++){var l=e[o],c=l.interval,u=l.close;if(c){if(c[0]===-1/0){if(q0(u[1],t,c[1]))return o}else if(c[1]===1/0){if(q0(u[0],c[0],t))return o}else if(q0(u[0],c[0],t)&&q0(u[1],t,c[1]))return o;i&&h(c[0],o),i&&h(c[1],o)}}if(i)return t===1/0?e.length-1:t===-1/0?0:n;function h(e,i){var o=Math.abs(e-t);o<r&&(r=o,n=i)}},t.visualHandlers={color:{applyVisual:F0("color"),getColorMapper:function(){var t=this.option;return wE("category"===t.mappingMethod?function(t,e){return!e&&(t=this._normalizeData(t)),V0.call(this,t)}:function(e,i,n){var r=!!n;return!i&&(e=this._normalizeData(e)),n=OT(e,t.parsedVisual,n),r?n:BT(n,"rgba")},this)},_normalizedToVisual:{linear:function(t){return BT(OT(t,this.option.parsedVisual),"rgba")},category:V0,piecewise:function(t,e){var i=j0.call(this,e);return null==i&&(i=BT(OT(t,this.option.parsedVisual),"rgba")),i},fixed:U0}},colorHue:B0((function(t,e){return kT(t,e)})),colorSaturation:B0((function(t,e){return kT(t,null,e)})),colorLightness:B0((function(t,e){return kT(t,null,null,e)})),colorAlpha:B0((function(t,e){return NT(t,e)})),decal:{applyVisual:F0("decal"),_normalizedToVisual:{linear:null,category:V0,piecewise:null,fixed:null}},opacity:{applyVisual:F0("opacity"),_normalizedToVisual:G0([0,1])},liftZ:{applyVisual:F0("liftZ"),_normalizedToVisual:{linear:U0,category:U0,piecewise:U0,fixed:U0}},symbol:{applyVisual:function(t,e,i){i("symbol",this.mapValueToVisual(t))},_normalizedToVisual:{linear:z0,category:V0,piecewise:function(t,e){var i=j0.call(this,e);return null==i&&(i=z0.call(this,t)),i},fixed:U0}},symbolSize:{applyVisual:F0("symbolSize"),_normalizedToVisual:G0([0,1])}},t}();function N0(t,e){var i=t.visual,n=[];CE(i)?D0(i,(function(t){n.push(t)})):null!=i&&n.push(i);e||1!==n.length||{color:1,symbol:1}.hasOwnProperty(t.type)||(n[1]=n[0]),H0(t,n)}function B0(t){return{applyVisual:function(e,i,n){var r=this.mapValueToVisual(e);n("color",t(i("color"),r))},_normalizedToVisual:G0([0,1])}}function z0(t){var e=this.option.visual;return e[Math.round(TC(t,[0,1],[0,e.length-1],!0))]||{}}function F0(t){return function(e,i,n){n(t,this.mapValueToVisual(e))}}function V0(t){var e=this.option.visual;return e[this.option.loop&&t!==O0?t%e.length:t]}function U0(){return this.option.visual[0]}function G0(t){return{linear:function(e){return TC(e,t,this.option.visual,!0)},category:V0,piecewise:function(e,i){var n=j0.call(this,i);return null==n&&(n=TC(e,t,this.option.visual,!0)),n},fixed:U0}}function j0(t){var e=this.option,i=e.pieceList;if(e.hasSpecialVisual){var n=i[k0.findPieceIndex(t,i)];if(n&&n.visual)return n.visual[this.type]}}function H0(t,e){return t.visual=e,"color"===t.type&&(t.parsedVisual=vE(e,(function(t){var e=LT(t);return e||"production"===process.env.NODE_ENV||$C("'"+t+"' is an illegal color, fallback to '#000000'",!0),e||[0,0,0,1]}))),e}var W0={linear:function(t){return TC(t,this.option.dataExtent,[0,1],!0)},piecewise:function(t){var e=this.option.pieceList,i=k0.findPieceIndex(t,e,!0);if(null!=i)return TC(i,[0,e.length-1],[0,1],!0)},category:function(t){var e=this.option.categories?this.option.categoryMap[t]:t;return null==e?O0:e},fixed:tS};function q0(t,e,i){return t?e<=i:e<i}var X0=k0,Z0=wP(),Y0={seriesType:"treemap",reset:function(t){var e=t.getData().tree.root;e.isRemoved()||Q0(e,{},t.getViewRoot().getAncestors(),t)}};function Q0(t,e,i,n){var r=t.getModel(),o=t.getLayout(),s=t.hostTree.data;if(o&&!o.invisible&&o.isInView){var a,l=r.getModel("itemStyle"),c=function(t,e,i){var n=pE({},e),r=i.designatedVisualItemStyle;return yE(["color","colorAlpha","colorSaturation"],(function(i){r[i]=e[i];var o=t.get(i);r[i]=null,null!=o&&(n[i]=o)})),n}(l,e,n),u=s.ensureUniqueItemVisual(t.dataIndex,"style"),h=l.get("borderColor"),p=l.get("borderColorSaturation");null!=p&&(h=function(t,e){return null!=e?kT(e,null,null,t):null}(p,a=J0(c))),u.stroke=h;var d=t.viewChildren;if(d&&d.length){var f=function(t,e,i,n,r,o){if(!o||!o.length)return;var s=$0(e,"color")||null!=r.color&&"none"!==r.color&&($0(e,"colorAlpha")||$0(e,"colorSaturation"));if(!s)return;var a=e.get("visualMin"),l=e.get("visualMax"),c=i.dataExtent.slice();null!=a&&a<c[0]&&(c[0]=a),null!=l&&l>c[1]&&(c[1]=l);var u=e.get("colorMappingBy"),h={type:s.name,dataExtent:c,visual:s.range};"color"!==h.type||"index"!==u&&"id"!==u?h.mappingMethod="linear":(h.mappingMethod="category",h.loop=!0);var p=new X0(h);return Z0(p).drColorMappingBy=u,p}(0,r,o,0,c,d);yE(d,(function(t,e){if(t.depth>=i.length||t===i[t.depth]){var o=function(t,e,i,n,r,o){var s=pE({},e);if(r){var a=r.type,l="color"===a&&Z0(r).drColorMappingBy,c="index"===l?n:"id"===l?o.mapIdToIndex(i.getId()):i.getValue(t.get("visualDimension"));s[a]=r.mapValueToVisual(c)}return s}(r,c,t,e,f,n);Q0(t,o,i,n)}}))}else a=J0(c),u.fill=a}}function J0(t){var e=K0(t,"color");if(e){var i=K0(t,"colorAlpha"),n=K0(t,"colorSaturation");return n&&(e=kT(e,null,null,n)),i&&(e=NT(e,i)),e}}function K0(t,e){var i=t[e];if(null!=i&&"none"!==i)return i}function $0(t,e){var i=t.get(e);return EE(i)&&i.length?{name:e,range:i}:null}var t1=Math.max,e1=Math.min,i1=NE,n1=yE,r1=["itemStyle","borderWidth"],o1=["itemStyle","gapWidth"],s1=["upperLabel","show"],a1=["upperLabel","height"],l1={seriesType:"treemap",reset:function(t,e,i,n){var r=i.getWidth(),o=i.getHeight(),s=t.option,a=UB(t.getBoxLayoutParams(),{width:i.getWidth(),height:i.getHeight()}),l=s.size||[],c=IC(i1(a.width,l[0]),r),u=IC(i1(a.height,l[1]),o),h=n&&n.type,p=e0(n,["treemapZoomToNode","treemapRootToNode"],t),d="treemapRender"===h||"treemapMove"===h?n.rootRect:null,f=t.getViewRoot(),m=i0(f);if("treemapMove"!==h){var g="treemapZoomToNode"===h?function(t,e,i,n,r){var o,s=(e||{}).node,a=[n,r];if(!s||s===i)return a;var l=n*r,c=l*t.option.zoomToNodeRatio;for(;o=s.parentNode;){for(var u=0,h=o.children,p=0,d=h.length;p<d;p++)u+=h[p].getValue();var f=s.getValue();if(0===f)return a;c*=u/f;var m=o.getModel(),g=m.get(r1);(c+=4*g*g+(3*g+Math.max(g,d1(m)))*Math.pow(c,.5))>kC&&(c=kC),s=o}c<l&&(c=l);var y=Math.pow(c/l,.5);return[n*y,r*y]}(t,p,f,c,u):d?[d.width,d.height]:[c,u],y=s.sort;y&&"asc"!==y&&"desc"!==y&&(y="desc");var v={squareRatio:s.squareRatio,sort:y,leafDepth:s.leafDepth};f.hostTree.clearLayouts();var _={x:0,y:0,width:g[0],height:g[1],area:g[0]*g[1]};f.setLayout(_),c1(f,v,!1,0),_=f.getLayout(),n1(m,(function(t,e){var i=(m[e+1]||f).getValue();t.setLayout(pE({dataExtent:[i,i],borderWidth:0,upperHeight:0},_))}))}var x=t.getData().tree.root;x.setLayout(function(t,e,i){if(e)return{x:e.x,y:e.y};var n={x:0,y:0};if(!i)return n;var r=i.node,o=r.getLayout();if(!o)return n;var s=[o.width/2,o.height/2],a=r;for(;a;){var l=a.getLayout();s[0]+=l.x,s[1]+=l.y,a=a.parentNode}return{x:t.width/2-s[0],y:t.height/2-s[1]}}(a,d,p),!0),t.setLayoutInfo(a),p1(x,new pM(-a.x,-a.y,r,o),m,f,0)}};function c1(t,e,i,n){var r,o;if(!t.isRemoved()){var s=t.getLayout();r=s.width,o=s.height;var a=t.getModel(),l=a.get(r1),c=a.get(o1)/2,u=d1(a),h=Math.max(l,u),p=l-c,d=h-c;t.setLayout({borderWidth:l,upperHeight:h,upperLabelHeight:u},!0);var f=(r=t1(r-2*p,0))*(o=t1(o-p-d,0)),m=function(t,e,i,n,r,o){var s=t.children||[],a=n.sort;"asc"!==a&&"desc"!==a&&(a=null);var l=null!=n.leafDepth&&n.leafDepth<=o;if(r&&!l)return t.viewChildren=[];s=xE(s,(function(t){return!t.isRemoved()})),function(t,e){e&&t.sort((function(t,i){var n="asc"===e?t.getValue()-i.getValue():i.getValue()-t.getValue();return 0===n?"asc"===e?t.dataIndex-i.dataIndex:i.dataIndex-t.dataIndex:n}))}(s,a);var c=function(t,e,i){for(var n=0,r=0,o=e.length;r<o;r++)n+=e[r].getValue();var s,a=t.get("visualDimension");e&&e.length?"value"===a&&i?(s=[e[e.length-1].getValue(),e[0].getValue()],"asc"===i&&s.reverse()):(s=[1/0,-1/0],n1(e,(function(t){var e=t.getValue(a);e<s[0]&&(s[0]=e),e>s[1]&&(s[1]=e)}))):s=[NaN,NaN];return{sum:n,dataExtent:s}}(e,s,a);if(0===c.sum)return t.viewChildren=[];if(c.sum=function(t,e,i,n,r){if(!n)return i;for(var o=t.get("visibleMin"),s=r.length,a=s,l=s-1;l>=0;l--){var c=r["asc"===n?s-l-1:l].getValue();c/i*e<o&&(a=l,i-=c)}return"asc"===n?r.splice(0,s-a):r.splice(a,s-a),i}(e,i,c.sum,a,s),0===c.sum)return t.viewChildren=[];for(var u=0,h=s.length;u<h;u++){var p=s[u].getValue()/c.sum*i;s[u].setLayout({area:p})}l&&(s.length&&t.setLayout({isLeafRoot:!0},!0),s.length=0);return t.viewChildren=s,t.setLayout({dataExtent:c.dataExtent},!0),s}(t,a,f,e,i,n);if(m.length){var g={x:p,y:d,width:r,height:o},y=e1(r,o),v=1/0,_=[];_.area=0;for(var x=0,b=m.length;x<b;){var w=m[x];_.push(w),_.area+=w.getLayout().area;var A=u1(_,y,e.squareRatio);A<=v?(x++,v=A):(_.area-=_.pop().getLayout().area,h1(_,y,g,c,!1),y=e1(g.width,g.height),_.length=_.area=0,v=1/0)}if(_.length&&h1(_,y,g,c,!0),!i){var E=a.get("childrenVisibleMin");null!=E&&f<E&&(i=!0)}for(x=0,b=m.length;x<b;x++)c1(m[x],e,i,n+1)}}}function u1(t,e,i){for(var n=0,r=1/0,o=0,s=void 0,a=t.length;o<a;o++)(s=t[o].getLayout().area)&&(s<r&&(r=s),s>n&&(n=s));var l=t.area*t.area,c=e*e*i;return l?t1(c*n/l,l/(c*r)):1/0}function h1(t,e,i,n,r){var o=e===i.width?0:1,s=1-o,a=["x","y"],l=["width","height"],c=i[a[o]],u=e?t.area/e:0;(r||u>i[l[s]])&&(u=i[l[s]]);for(var h=0,p=t.length;h<p;h++){var d=t[h],f={},m=u?d.getLayout().area/u:0,g=f[l[s]]=t1(u-2*n,0),y=i[a[o]]+i[l[o]]-c,v=h===p-1||y<m?y:m,_=f[l[o]]=t1(v-2*n,0);f[a[s]]=i[a[s]]+e1(n,g/2),f[a[o]]=c+e1(n,_/2),c+=v,d.setLayout(f,!0)}i[a[s]]+=u,i[l[s]]-=u}function p1(t,e,i,n,r){var o=t.getLayout(),s=i[r],a=s&&s===t;if(!(s&&!a||r===i.length&&t!==n)){t.setLayout({isInView:!0,invisible:!a&&!e.intersect(o),isAboveViewRoot:a},!0);var l=new pM(e.x-o.x,e.y-o.y,e.width,e.height);n1(t.viewChildren||[],(function(t){p1(t,l,i,n,r+1)}))}}function d1(t){return t.get(s1)?t.get(a1):0}function f1(t){var e=t.findComponents({mainType:"legend"});e&&e.length&&t.eachSeriesByType("graph",(function(t){var i=t.getCategoriesData(),n=t.getGraph().data,r=i.mapArray(i.getName);n.filterSelf((function(t){var i=n.getItemModel(t).getShallow("category");if(null!=i){IE(i)&&(i=r[i]);for(var o=0;o<e.length;o++)if(!e[o].isSelected(i))return!1}return!0}))}))}function m1(t){var e={};t.eachSeriesByType("graph",(function(t){var i=t.getCategoriesData(),n=t.getData(),r={};i.each((function(n){var o=i.getName(n);r["ec-"+o]=n;var s=i.getItemModel(n),a=s.getModel("itemStyle").getItemStyle();a.fill||(a.fill=t.getColorFromPalette(o,e)),i.setItemVisual(n,"style",a);for(var l=["symbol","symbolSize","symbolKeepAspect"],c=0;c<l.length;c++){var u=s.getShallow(l[c],!0);null!=u&&i.setItemVisual(n,l[c],u)}})),i.count()&&n.each((function(t){var e=n.getItemModel(t).getShallow("category");if(null!=e){ME(e)&&(e=r["ec-"+e]);var o=i.getItemVisual(e,"style");pE(n.ensureUniqueItemVisual(t,"style"),o);for(var s=["symbol","symbolSize","symbolKeepAspect"],a=0;a<s.length;a++)n.setItemVisual(t,s[a],i.getItemVisual(e,s[a]))}}))}))}function g1(t){return t instanceof Array||(t=[t,t]),t}function y1(t){t.eachSeriesByType("graph",(function(t){var e=t.getGraph(),i=t.getEdgeData(),n=g1(t.get("edgeSymbol")),r=g1(t.get("edgeSymbolSize"));i.setVisual("fromSymbol",n&&n[0]),i.setVisual("toSymbol",n&&n[1]),i.setVisual("fromSymbolSize",r&&r[0]),i.setVisual("toSymbolSize",r&&r[1]),i.setVisual("style",t.getModel("lineStyle").getLineStyle()),i.each((function(t){var n=i.getItemModel(t),r=e.getEdgeByIndex(t),o=g1(n.getShallow("symbol",!0)),s=g1(n.getShallow("symbolSize",!0)),a=n.getModel("lineStyle").getLineStyle(),l=i.ensureUniqueItemVisual(t,"style");switch(pE(l,a),l.stroke){case"source":var c=r.node1.getVisual("style");l.stroke=c&&c.fill;break;case"target":c=r.node2.getVisual("style");l.stroke=c&&c.fill}o[0]&&r.setVisual("fromSymbol",o[0]),o[1]&&r.setVisual("toSymbol",o[1]),s[0]&&r.setVisual("fromSymbolSize",s[0]),s[1]&&r.setVisual("toSymbolSize",s[1])}))}))}var v1="--\x3e",_1=function(t){return t.get("autoCurveness")||null},x1=function(t,e){var i=_1(t),n=20,r=[];if(IE(i))n=i;else if(EE(i))return void(t.__curvenessList=i);e>n&&(n=e);var o=n%2?n+2:n+3;r=[];for(var s=0;s<o;s++)r.push((s%2?s+1:s)/10*(s%2?-1:1));t.__curvenessList=r},b1=function(t,e,i){var n=[t.id,t.dataIndex].join("."),r=[e.id,e.dataIndex].join(".");return[i.uid,n,r].join(v1)},w1=function(t){var e=t.split(v1);return[e[0],e[2],e[1]].join(v1)},A1=function(t,e){var i=b1(t.node1,t.node2,e);return e.__edgeMap[i]},E1=function(t,e){return S1(b1(t.node1,t.node2,e),e)+S1(b1(t.node2,t.node1,e),e)},S1=function(t,e){var i=e.__edgeMap;return i[t]?i[t].length:0};function M1(t,e,i,n){var r=_1(e),o=EE(r);if(!r)return null;var s=A1(t,e);if(!s)return null;for(var a=-1,l=0;l<s.length;l++)if(s[l]===i){a=l;break}var c=E1(t,e);x1(e,c),t.lineStyle=t.lineStyle||{};var u=b1(t.node1,t.node2,e),h=e.__curvenessList,p=o||c%2?0:1;if(s.isForward)return h[p+a];var d=w1(u),f=S1(d,e),m=h[a+f+p];return n?o?r&&0===r[0]?(f+p)%2?m:-m:((f%2?0:1)+p)%2?m:-m:(f+p)%2?m:-m:h[a+f+p]}function T1(t){var e=t.coordinateSystem;if(!e||"view"===e.type){var i=t.getGraph();i.eachNode((function(t){var e=t.getModel();t.setLayout([+e.get("x"),+e.get("y")])})),I1(i,t)}}function I1(t,e){t.eachEdge((function(t,i){var n=zE(t.getModel().get(["lineStyle","curveness"]),-M1(t,e,i,!0),0),r=rS(t.node1.getLayout()),o=rS(t.node2.getLayout()),s=[r,o];+n&&s.push([(r[0]+o[0])/2-(r[1]-o[1])*n,(r[1]+o[1])/2-(o[0]-r[0])*n]),t.setLayout(s)}))}function C1(t,e){t.eachSeriesByType("graph",(function(t){var e=t.get("layout"),i=t.coordinateSystem;if(i&&"view"!==i.type){var n=t.getData(),r=[];yE(i.dimensions,(function(t){r=r.concat(n.mapDimensionsAll(t))}));for(var o=0;o<n.count();o++){for(var s=[],a=!1,l=0;l<r.length;l++){var c=n.get(r[l],o);isNaN(c)||(a=!0),s.push(c)}a?n.setItemLayout(o,i.dataToPoint(s)):n.setItemLayout(o,[NaN,NaN])}I1(n.graph,t)}else e&&"none"!==e||T1(t)}))}function P1(t){var e=t.coordinateSystem;if("view"!==e.type)return 1;var i=t.option.nodeScaleRatio,n=e.scaleX;return((e.getZoom()-1)*i+1)/n}function L1(t){var e=t.getVisual("symbolSize");return e instanceof Array&&(e=(e[0]+e[1])/2),+e}var D1=Math.PI,R1=[];function O1(t,e,i,n){var r=t.coordinateSystem;if(!r||"view"===r.type){var o=r.getBoundingRect(),s=t.getData(),a=s.graph,l=o.width/2+o.x,c=o.height/2+o.y,u=Math.min(o.width,o.height)/2,h=s.count();if(s.setLayout({cx:l,cy:c}),h){if(i){var p=r.pointToData(n),d=p[0],f=p[1],m=[d-l,f-c];hS(m,m),uS(m,m,u),i.setLayout([l+m[0],c+m[1]],!0),N1(i,t.get(["circular","rotateLabel"]),l,c)}k1[e](t,a,s,u,l,c,h),a.eachEdge((function(e,i){var n,r=zE(e.getModel().get(["lineStyle","curveness"]),M1(e,t,i),0),o=rS(e.node1.getLayout()),s=rS(e.node2.getLayout()),a=(o[0]+s[0])/2,u=(o[1]+s[1])/2;+r&&(n=[l*(r*=3)+a*(1-r),c*r+u*(1-r)]),e.setLayout([o,s,n])}))}}}var k1={value:function(t,e,i,n,r,o,s){var a=0,l=i.getSum("value"),c=2*Math.PI/(l||s);e.eachNode((function(t){var e=t.getValue("value"),i=c*(l?e:1)/2;a+=i,t.setLayout([n*Math.cos(a)+r,n*Math.sin(a)+o]),a+=i}))},symbolSize:function(t,e,i,n,r,o,s){var a=0;R1.length=s;var l=P1(t);e.eachNode((function(t){var e=L1(t);isNaN(e)&&(e=2),e<0&&(e=0),e*=l;var i=Math.asin(e/2/n);isNaN(i)&&(i=D1/2),R1[t.dataIndex]=i,a+=2*i}));var c=(2*D1-a)/s/2,u=0;e.eachNode((function(t){var e=c+R1[t.dataIndex];u+=e,(!t.getLayout()||!t.getLayout().fixed)&&t.setLayout([n*Math.cos(u)+r,n*Math.sin(u)+o]),u+=e}))}};function N1(t,e,i,n){var r=t.getGraphicEl();if(r){var o=t.getModel().get(["label","rotate"])||0,s=r.getSymbolPath();if(e){var a=t.getLayout(),l=Math.atan2(a[1]-n,a[0]-i);l<0&&(l=2*Math.PI+l);var c=a[0]<i;c&&(l-=Math.PI);var u=c?"left":"right";s.setTextConfig({rotation:-l,position:u,origin:"center"});var h=s.ensureState("emphasis");pE(h.textConfig||(h.textConfig={}),{position:u})}else s.setTextConfig({rotation:o*=Math.PI/180})}}function B1(t){t.eachSeriesByType("graph",(function(t){"circular"===t.get("layout")&&O1(t,"symbolSize")}))}var z1=aS;function F1(t){t.eachSeriesByType("graph",(function(t){var e=t.coordinateSystem;if(!e||"view"===e.type)if("force"===t.get("layout")){var i=t.preservedPoints||{},n=t.getGraph(),r=n.data,o=n.edgeData,s=t.getModel("force"),a=s.get("initLayout");t.preservedPoints?r.each((function(t){var e=r.getId(t);r.setItemLayout(t,i[e]||[NaN,NaN])})):a&&"none"!==a?"circular"===a&&O1(t,"value"):T1(t);var l=r.getDataExtent("value"),c=o.getDataExtent("value"),u=s.get("repulsion"),h=s.get("edgeLength"),p=EE(u)?u:[u,u],d=EE(h)?h:[h,h];d=[d[1],d[0]];var f=r.mapArray("value",(function(t,e){var i=r.getItemLayout(e),n=TC(t,l,p);return isNaN(n)&&(n=(p[0]+p[1])/2),{w:n,rep:n,fixed:r.getItemModel(e).get("fixed"),p:!i||isNaN(i[0])||isNaN(i[1])?null:i}})),m=o.mapArray("value",(function(e,i){var r=n.getEdgeByIndex(i),o=TC(e,c,d);isNaN(o)&&(o=(d[0]+d[1])/2);var s=r.getModel(),a=zE(r.getModel().get(["lineStyle","curveness"]),-M1(r,t,i,!0),0);return{n1:f[r.node1.dataIndex],n2:f[r.node2.dataIndex],d:o,curveness:a,ignoreForceLayout:s.get("ignoreForceLayout")}})),g=e.getBoundingRect(),y=function(t,e,i){for(var n=t,r=e,o=i.rect,s=o.width,a=o.height,l=[o.x+s/2,o.y+a/2],c=null==i.gravity?.1:i.gravity,u=0;u<n.length;u++){var h=n[u];h.p||(h.p=iS(s*(Math.random()-.5)+l[0],a*(Math.random()-.5)+l[1])),h.pp=rS(h.p),h.edges=null}var p,d,f=null==i.friction?.6:i.friction,m=f;return{warmUp:function(){m=.8*f},setFixed:function(t){n[t].fixed=!0},setUnfixed:function(t){n[t].fixed=!1},beforeStep:function(t){p=t},afterStep:function(t){d=t},step:function(t){p&&p(n,r);for(var e=[],i=n.length,o=0;o<r.length;o++){var s=r[o];if(!s.ignoreForceLayout){var a=s.n1;lS(e,(g=s.n2).p,a.p);var u=cS(e)-s.d,h=g.w/(a.w+g.w);isNaN(h)&&(h=0),hS(e,e),!a.fixed&&z1(a.p,a.p,e,h*u*m),!g.fixed&&z1(g.p,g.p,e,-(1-h)*u*m)}}for(o=0;o<i;o++)(_=n[o]).fixed||(lS(e,l,_.p),z1(_.p,_.p,e,c*m));for(o=0;o<i;o++){a=n[o];for(var f=o+1;f<i;f++){var g;lS(e,(g=n[f]).p,a.p),0===(u=cS(e))&&(oS(e,Math.random()-.5,Math.random()-.5),u=1);var y=(a.rep+g.rep)/u/u;!a.fixed&&z1(a.pp,a.pp,e,y),!g.fixed&&z1(g.pp,g.pp,e,-y)}}var v=[];for(o=0;o<i;o++){var _;(_=n[o]).fixed||(lS(v,_.p,_.pp),z1(_.p,_.p,v,m),nS(_.pp,_.p))}var x=(m*=.992)<.01;d&&d(n,r,x),t&&t(x)}}}(f,m,{rect:g,gravity:s.get("gravity"),friction:s.get("friction")});y.beforeStep((function(t,e){for(var i=0,r=t.length;i<r;i++)t[i].fixed&&nS(t[i].p,n.getNodeByIndex(i).getLayout())})),y.afterStep((function(t,e,o){for(var s=0,a=t.length;s<a;s++)t[s].fixed||n.getNodeByIndex(s).setLayout(t[s].p),i[r.getId(s)]=t[s].p;for(s=0,a=e.length;s<a;s++){var l=e[s],c=n.getEdgeByIndex(s),u=l.n1.p,h=l.n2.p,p=c.getLayout();(p=p?p.slice():[])[0]=p[0]||[],p[1]=p[1]||[],nS(p[0],u),nS(p[1],h),+l.curveness&&(p[2]=[(u[0]+h[0])/2-(u[1]-h[1])*l.curveness,(u[1]+h[1])/2-(h[0]-u[0])*l.curveness]),c.setLayout(p)}})),t.forceLayout=y,t.preservedPoints=i,y.step()}else t.forceLayout=null}))}function V1(t,e){var i=[];return t.eachSeriesByType("graph",(function(t){var n=t.get("coordinateSystem");if(!n||"view"===n){var r=t.getData(),o=[],s=[];SL(r.mapArray((function(t){var e=r.getItemModel(t);return[+e.get("x"),+e.get("y")]})),o,s),s[0]-o[0]==0&&(s[0]+=1,o[0]-=1),s[1]-o[1]==0&&(s[1]+=1,o[1]-=1);var a=(s[0]-o[0])/(s[1]-o[1]),l=function(t,e,i){return UB(pE(t.getBoxLayoutParams(),{aspect:i}),{width:e.getWidth(),height:e.getHeight()})}(t,e,a);isNaN(a)&&(o=[l.x,l.y],s=[l.x+l.width,l.y+l.height]);var c=s[0]-o[0],u=s[1]-o[1],h=l.width,p=l.height,d=t.coordinateSystem=new a$;d.zoomLimit=t.get("scaleLimit"),d.setBoundingRect(o[0],o[1],c,u),d.setViewRect(l.x,l.y,h,p),d.setCenter(t.get("center"),e),d.setZoom(t.get("zoom")),i.push(d)}})),i}var U1=nk.prototype,G1=lk.prototype,j1=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1};function H1(t){return isNaN(+t.cpx1)||isNaN(+t.cpy1)}!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}zA(e,t)}(j1);var W1=function(t){function e(e){var i=t.call(this,e)||this;return i.type="ec-line",i}return zA(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new j1},e.prototype.buildPath=function(t,e){H1(e)?U1.buildPath.call(this,t,e):G1.buildPath.call(this,t,e)},e.prototype.pointAt=function(t){return H1(this.shape)?U1.pointAt.call(this,t):G1.pointAt.call(this,t)},e.prototype.tangentAt=function(t){var e=this.shape,i=H1(e)?[e.x2-e.x1,e.y2-e.y1]:G1.tangentAt.call(this,t);return hS(i,i)},e}(xD),q1=W1,X1=["fromSymbol","toSymbol"];function Z1(t){return"_"+t+"Type"}function Y1(t,e,i){var n=e.getItemVisual(i,t);if(!n||"none"===n)return n;var r=e.getItemVisual(i,t+"Size"),o=e.getItemVisual(i,t+"Rotate"),s=e.getItemVisual(i,t+"Offset"),a=e.getItemVisual(i,t+"KeepAspect"),l=dG(r);return n+l+fG(s||0,l)+(o||"")+(a||"")}function Q1(t,e,i){var n=e.getItemVisual(i,t);if(n&&"none"!==n){var r=e.getItemVisual(i,t+"Size"),o=e.getItemVisual(i,t+"Rotate"),s=e.getItemVisual(i,t+"Offset"),a=e.getItemVisual(i,t+"KeepAspect"),l=dG(r),c=fG(s||0,l),u=pG(n,-l[0]/2+c[0],-l[1]/2+c[1],l[0],l[1],null,a);return u.__specifiedRotation=null==o||isNaN(o)?void 0:+o*Math.PI/180||0,u.name=t,u}}function J1(t,e){t.x1=e[0][0],t.y1=e[0][1],t.x2=e[1][0],t.y2=e[1][1],t.percent=1;var i=e[2];i?(t.cpx1=i[0],t.cpy1=i[1]):(t.cpx1=NaN,t.cpy1=NaN)}var K1=function(t){function e(e,i,n){var r=t.call(this)||this;return r._createLine(e,i,n),r}return zA(e,t),e.prototype._createLine=function(t,e,i){var n=t.hostModel,r=function(t){var e=new q1({name:"line",subPixelOptimize:!0});return J1(e.shape,t),e}(t.getItemLayout(e));r.shape.percent=0,Lk(r,{shape:{percent:1}},n,e),this.add(r),yE(X1,(function(i){var n=Q1(i,t,e);this.add(n),this[Z1(i)]=Y1(i,t,e)}),this),this._updateCommonStl(t,e,i)},e.prototype.updateData=function(t,e,i){var n=t.hostModel,r=this.childOfName("line"),o=t.getItemLayout(e),s={shape:{}};J1(s.shape,o),Pk(r,s,n,e),yE(X1,(function(i){var n=Y1(i,t,e),r=Z1(i);if(this[r]!==n){this.remove(this.childOfName(i));var o=Q1(i,t,e);this.add(o)}this[r]=n}),this),this._updateCommonStl(t,e,i)},e.prototype.getLinePath=function(){return this.childAt(0)},e.prototype._updateCommonStl=function(t,e,i){var n=t.hostModel,r=this.childOfName("line"),o=i&&i.emphasisLineStyle,s=i&&i.blurLineStyle,a=i&&i.selectLineStyle,l=i&&i.labelStatesModels,c=i&&i.emphasisDisabled,u=i&&i.focus,h=i&&i.blurScope;if(!i||t.hasItemOption){var p=t.getItemModel(e),d=p.getModel("emphasis");o=d.getModel("lineStyle").getLineStyle(),s=p.getModel(["blur","lineStyle"]).getLineStyle(),a=p.getModel(["select","lineStyle"]).getLineStyle(),c=d.get("disabled"),u=d.get("focus"),h=d.get("blurScope"),l=fN(p)}var f=t.getItemVisual(e,"style"),m=f.stroke;r.useStyle(f),r.style.fill=null,r.style.strokeNoScale=!0,r.ensureState("emphasis").style=o,r.ensureState("blur").style=s,r.ensureState("select").style=a,yE(X1,(function(t){var e=this.childOfName(t);if(e){e.setColor(m),e.style.opacity=f.opacity;for(var i=0;i<aR.length;i++){var n=aR[i],o=r.getState(n);if(o){var s=o.style||{},a=e.ensureState(n),l=a.style||(a.style={});null!=s.stroke&&(l[e.__isEmptyBrush?"stroke":"fill"]=s.stroke),null!=s.opacity&&(l.opacity=s.opacity)}}e.markRedraw()}}),this);var g=n.getRawValue(e);dN(this,l,{labelDataIndex:e,labelFetcher:{getFormattedLabel:function(e,i){return n.getFormattedLabel(e,i,t.dataType)}},inheritColor:m||"#000",defaultOpacity:f.opacity,defaultText:(null==g?t.getName(e):isFinite(g)?CC(g):g)+""});var y=this.getTextContent();if(y){var v=l.normal;y.__align=y.style.align,y.__verticalAlign=y.style.verticalAlign,y.__position=v.get("position")||"middle";var _=v.get("distance");EE(_)||(_=[_,_]),y.__labelDistance=_}this.setTextConfig({position:null,local:!0,inside:!1}),XR(this,u,h,c)},e.prototype.highlight=function(){RR(this)},e.prototype.downplay=function(){OR(this)},e.prototype.updateLayout=function(t,e){this.setLinePoints(t.getItemLayout(e))},e.prototype.setLinePoints=function(t){var e=this.childOfName("line");J1(e.shape,t),e.dirty()},e.prototype.beforeUpdate=function(){var t=this,e=t.childOfName("fromSymbol"),i=t.childOfName("toSymbol"),n=t.getTextContent();if(e||i||n&&!n.ignore){for(var r=1,o=this.parent;o;)o.scaleX&&(r/=o.scaleX),o=o.parent;var s=t.childOfName("line");if(this.__dirty||s.__dirty){var a=s.shape.percent,l=s.pointAt(0),c=s.pointAt(a),u=lS([],c,l);if(hS(u,u),e&&(e.setPosition(l),A(e,0),e.scaleX=e.scaleY=r*a,e.markRedraw()),i&&(i.setPosition(c),A(i,1),i.scaleX=i.scaleY=r*a,i.markRedraw()),n&&!n.ignore){n.x=n.y=0,n.originX=n.originY=0;var h=void 0,p=void 0,d=n.__labelDistance,f=d[0]*r,m=d[1]*r,g=a/2,y=s.tangentAt(g),v=[y[1],-y[0]],_=s.pointAt(g);v[1]>0&&(v[0]=-v[0],v[1]=-v[1]);var x=y[0]<0?-1:1;if("start"!==n.__position&&"end"!==n.__position){var b=-Math.atan2(y[1],y[0]);c[0]<l[0]&&(b=Math.PI+b),n.rotation=b}var w=void 0;switch(n.__position){case"insideStartTop":case"insideMiddleTop":case"insideEndTop":case"middle":w=-m,p="bottom";break;case"insideStartBottom":case"insideMiddleBottom":case"insideEndBottom":w=m,p="top";break;default:w=0,p="middle"}switch(n.__position){case"end":n.x=u[0]*f+c[0],n.y=u[1]*m+c[1],h=u[0]>.8?"left":u[0]<-.8?"right":"center",p=u[1]>.8?"top":u[1]<-.8?"bottom":"middle";break;case"start":n.x=-u[0]*f+l[0],n.y=-u[1]*m+l[1],h=u[0]>.8?"right":u[0]<-.8?"left":"center",p=u[1]>.8?"bottom":u[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":n.x=f*x+l[0],n.y=l[1]+w,h=y[0]<0?"right":"left",n.originX=-f*x,n.originY=-w;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":n.x=_[0],n.y=_[1]+w,h="center",n.originY=-w;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":n.x=-f*x+c[0],n.y=c[1]+w,h=y[0]>=0?"right":"left",n.originX=f*x,n.originY=-w}n.scaleX=n.scaleY=r,n.setStyle({verticalAlign:n.__verticalAlign||p,align:n.__align||h})}}}function A(t,e){var i=t.__specifiedRotation;if(null==i){var n=s.tangentAt(e);t.attr("rotation",(1===e?-1:1)*Math.PI/2-Math.atan2(n[1],n[0]))}else t.attr("rotation",i)}},e}(xC),$1=K1;function t2(t){var e=t.hostModel,i=e.getModel("emphasis");return{lineStyle:e.getModel("lineStyle").getLineStyle(),emphasisLineStyle:i.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:e.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:e.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:i.get("disabled"),blurScope:i.get("blurScope"),focus:i.get("focus"),labelStatesModels:fN(e)}}function e2(t){return isNaN(t[0])||isNaN(t[1])}function i2(t){return t&&!e2(t[0])&&!e2(t[1])}var n2=function(){function t(t){this.group=new xC,this._LineCtor=t||$1}return t.prototype.updateData=function(t){var e=this;this._progressiveEls=null;var i=this,n=i.group,r=i._lineData;i._lineData=t,r||n.removeAll();var o=t2(t);t.diff(r).add((function(i){e._doAdd(t,i,o)})).update((function(i,n){e._doUpdate(r,t,n,i,o)})).remove((function(t){n.remove(r.getItemGraphicEl(t))})).execute()},t.prototype.updateLayout=function(){var t=this._lineData;t&&t.eachItemGraphicEl((function(e,i){e.updateLayout(t,i)}),this)},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=t2(t),this._lineData=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e){function i(t){t.isGroup||function(t){return t.animators&&t.animators.length>0}(t)||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[];for(var n=t.start;n<t.end;n++){if(i2(e.getItemLayout(n))){var r=new this._LineCtor(e,n,this._seriesScope);r.traverse(i),this.group.add(r),e.setItemGraphicEl(n,r),this._progressiveEls.push(r)}}},t.prototype.remove=function(){this.group.removeAll()},t.prototype.eachRendered=function(t){lN(this._progressiveEls||this.group,t)},t.prototype._doAdd=function(t,e,i){if(i2(t.getItemLayout(e))){var n=new this._LineCtor(t,e,i);t.setItemGraphicEl(e,n),this.group.add(n)}},t.prototype._doUpdate=function(t,e,i,n,r){var o=t.getItemGraphicEl(i);i2(e.getItemLayout(n))?(o?o.updateData(e,n,r):o=new this._LineCtor(e,n,r),e.setItemGraphicEl(n,o),this.group.add(o)):this.group.remove(o)},t}(),r2=[],o2=[],s2=[],a2=sT,l2=fS,c2=Math.abs;function u2(t,e,i){for(var n,r=t[0],o=t[1],s=t[2],a=1/0,l=i*i,c=.1,u=.1;u<=.9;u+=.1){r2[0]=a2(r[0],o[0],s[0],u),r2[1]=a2(r[1],o[1],s[1],u),(d=c2(l2(r2,e)-l))<a&&(a=d,n=u)}for(var h=0;h<32;h++){var p=n+c;o2[0]=a2(r[0],o[0],s[0],n),o2[1]=a2(r[1],o[1],s[1],n),s2[0]=a2(r[0],o[0],s[0],p),s2[1]=a2(r[1],o[1],s[1],p);var d=l2(o2,e)-l;if(c2(d)<.01)break;var f=l2(s2,e)-l;c/=2,d<0?f>=0?n+=c:n-=c:f>=0?n-=c:n+=c}return n}function h2(t,e){var i=[],n=cT,r=[[],[],[]],o=[[],[]],s=[];e/=2,t.eachEdge((function(t,a){var l=t.getLayout(),c=t.getVisual("fromSymbol"),u=t.getVisual("toSymbol");l.__original||(l.__original=[rS(l[0]),rS(l[1])],l[2]&&l.__original.push(rS(l[2])));var h=l.__original;if(null!=l[2]){if(nS(r[0],h[0]),nS(r[1],h[2]),nS(r[2],h[1]),c&&"none"!==c){var p=L1(t.node1),d=u2(r,h[0],p*e);n(r[0][0],r[1][0],r[2][0],d,i),r[0][0]=i[3],r[1][0]=i[4],n(r[0][1],r[1][1],r[2][1],d,i),r[0][1]=i[3],r[1][1]=i[4]}if(u&&"none"!==u){p=L1(t.node2),d=u2(r,h[1],p*e);n(r[0][0],r[1][0],r[2][0],d,i),r[1][0]=i[1],r[2][0]=i[2],n(r[0][1],r[1][1],r[2][1],d,i),r[1][1]=i[1],r[2][1]=i[2]}nS(l[0],r[0]),nS(l[1],r[2]),nS(l[2],r[1])}else{if(nS(o[0],h[0]),nS(o[1],h[1]),lS(s,o[1],o[0]),hS(s,s),c&&"none"!==c){p=L1(t.node1);aS(o[0],o[0],s,p*e)}if(u&&"none"!==u){p=L1(t.node2);aS(o[1],o[1],s,-p*e)}nS(l[0],o[0]),nS(l[1],o[1])}}))}function p2(t){return"view"===t.type}var d2=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.init=function(t,e){var i=new HZ,n=new n2,r=this.group;this._controller=new JJ(e.getZr()),this._controllerHost={target:r},r.add(i.group),r.add(n.group),this._symbolDraw=i,this._lineDraw=n,this._firstRender=!0},e.prototype.render=function(t,e,i){var n=this,r=t.coordinateSystem;this._model=t;var o=this._symbolDraw,s=this._lineDraw,a=this.group;if(p2(r)){var l={x:r.x,y:r.y,scaleX:r.scaleX,scaleY:r.scaleY};this._firstRender?a.attr(l):Pk(a,l,t)}h2(t.getGraph(),P1(t));var c=t.getData();o.updateData(c);var u=t.getEdgeData();s.updateData(u),this._updateNodeAndLinkScale(),this._updateController(t,e,i),clearTimeout(this._layoutTimeout);var h=t.forceLayout,p=t.get(["force","layoutAnimation"]);h&&this._startForceLayoutIteration(h,p);var d=t.get("layout");c.graph.eachNode((function(e){var i=e.dataIndex,r=e.getGraphicEl(),o=e.getModel();if(r){r.off("drag").off("dragend");var s=o.get("draggable");s&&r.on("drag",(function(o){switch(d){case"force":h.warmUp(),!n._layouting&&n._startForceLayoutIteration(h,p),h.setFixed(i),c.setItemLayout(i,[r.x,r.y]);break;case"circular":c.setItemLayout(i,[r.x,r.y]),e.setLayout({fixed:!0},!0),O1(t,"symbolSize",e,[o.offsetX,o.offsetY]),n.updateLayout(t);break;default:c.setItemLayout(i,[r.x,r.y]),I1(t.getGraph(),t),n.updateLayout(t)}})).on("dragend",(function(){h&&h.setUnfixed(i)})),r.setDraggable(s,!!o.get("cursor")),"adjacency"===o.get(["emphasis","focus"])&&(KD(r).focus=e.getAdjacentDataIndices())}})),c.graph.eachEdge((function(t){var e=t.getGraphicEl(),i=t.getModel().get(["emphasis","focus"]);e&&"adjacency"===i&&(KD(e).focus={edge:[t.dataIndex],node:[t.node1.dataIndex,t.node2.dataIndex]})}));var f="circular"===t.get("layout")&&t.get(["circular","rotateLabel"]),m=c.getLayout("cx"),g=c.getLayout("cy");c.graph.eachNode((function(t){N1(t,f,m,g)})),this._firstRender=!1},e.prototype.dispose=function(){this._controller&&this._controller.dispose(),this._controllerHost=null},e.prototype._startForceLayoutIteration=function(t,e){var i=this;!function n(){t.step((function(t){i.updateLayout(i._model),(i._layouting=!t)&&(e?i._layoutTimeout=setTimeout(n,16):n())}))}()},e.prototype._updateController=function(t,e,i){var n=this,r=this._controller,o=this._controllerHost,s=this.group;r.setPointerChecker((function(e,n,r){var o=s.getBoundingRect();return o.applyTransform(s.transform),o.contain(n,r)&&!iK(e,i,t)})),p2(t.coordinateSystem)?(r.enable(t.get("roam")),o.zoomLimit=t.get("scaleLimit"),o.zoom=t.coordinateSystem.getZoom(),r.off("pan").off("zoom").on("pan",(function(e){KJ(o,e.dx,e.dy),i.dispatchAction({seriesId:t.id,type:"graphRoam",dx:e.dx,dy:e.dy})})).on("zoom",(function(e){$J(o,e.scale,e.originX,e.originY),i.dispatchAction({seriesId:t.id,type:"graphRoam",zoom:e.scale,originX:e.originX,originY:e.originY}),n._updateNodeAndLinkScale(),h2(t.getGraph(),P1(t)),n._lineDraw.updateLayout(),i.updateLabelLayout()}))):r.disable()},e.prototype._updateNodeAndLinkScale=function(){var t=this._model,e=t.getData(),i=P1(t);e.eachItemGraphicEl((function(t,e){t&&t.setSymbolScale(i)}))},e.prototype.updateLayout=function(t){h2(t.getGraph(),P1(t)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},e.prototype.remove=function(t,e){this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()},e.type="graph",e}(iU),f2=d2;function m2(t){return"_EC_"+t}var g2=function(){function t(t){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=t||!1}return t.prototype.isDirected=function(){return this._directed},t.prototype.addNode=function(t,e){t=null==t?""+e:""+t;var i=this._nodesMap;if(!i[m2(t)]){var n=new y2(t,e);return n.hostGraph=this,this.nodes.push(n),i[m2(t)]=n,n}"production"!==process.env.NODE_ENV&&console.error("Graph nodes have duplicate name or id")},t.prototype.getNodeByIndex=function(t){var e=this.data.getRawIndex(t);return this.nodes[e]},t.prototype.getNodeById=function(t){return this._nodesMap[m2(t)]},t.prototype.addEdge=function(t,e,i){var n=this._nodesMap,r=this._edgesMap;if(IE(t)&&(t=this.nodes[t]),IE(e)&&(e=this.nodes[e]),t instanceof y2||(t=n[m2(t)]),e instanceof y2||(e=n[m2(e)]),t&&e){var o=t.id+"-"+e.id,s=new v2(t,e,i);return s.hostGraph=this,this._directed&&(t.outEdges.push(s),e.inEdges.push(s)),t.edges.push(s),t!==e&&e.edges.push(s),this.edges.push(s),r[o]=s,s}},t.prototype.getEdgeByIndex=function(t){var e=this.edgeData.getRawIndex(t);return this.edges[e]},t.prototype.getEdge=function(t,e){t instanceof y2&&(t=t.id),e instanceof y2&&(e=e.id);var i=this._edgesMap;return this._directed?i[t+"-"+e]:i[t+"-"+e]||i[e+"-"+t]},t.prototype.eachNode=function(t,e){for(var i=this.nodes,n=i.length,r=0;r<n;r++)i[r].dataIndex>=0&&t.call(e,i[r],r)},t.prototype.eachEdge=function(t,e){for(var i=this.edges,n=i.length,r=0;r<n;r++)i[r].dataIndex>=0&&i[r].node1.dataIndex>=0&&i[r].node2.dataIndex>=0&&t.call(e,i[r],r)},t.prototype.breadthFirstTraverse=function(t,e,i,n){if(e instanceof y2||(e=this._nodesMap[m2(e)]),e){for(var r="out"===i?"outEdges":"in"===i?"inEdges":"edges",o=0;o<this.nodes.length;o++)this.nodes[o].__visited=!1;if(!t.call(n,e,null))for(var s=[e];s.length;){var a=s.shift(),l=a[r];for(o=0;o<l.length;o++){var c=l[o],u=c.node1===a?c.node2:c.node1;if(!u.__visited){if(t.call(n,u,a))return;s.push(u),u.__visited=!0}}}}},t.prototype.update=function(){for(var t=this.data,e=this.edgeData,i=this.nodes,n=this.edges,r=0,o=i.length;r<o;r++)i[r].dataIndex=-1;for(r=0,o=t.count();r<o;r++)i[t.getRawIndex(r)].dataIndex=r;e.filterSelf((function(t){var i=n[e.getRawIndex(t)];return i.node1.dataIndex>=0&&i.node2.dataIndex>=0}));for(r=0,o=n.length;r<o;r++)n[r].dataIndex=-1;for(r=0,o=e.count();r<o;r++)n[e.getRawIndex(r)].dataIndex=r},t.prototype.clone=function(){for(var e=new t(this._directed),i=this.nodes,n=this.edges,r=0;r<i.length;r++)e.addNode(i[r].id,i[r].dataIndex);for(r=0;r<n.length;r++){var o=n[r];e.addEdge(o.node1.id,o.node2.id,o.dataIndex)}return e},t}(),y2=function(){function t(t,e){this.inEdges=[],this.outEdges=[],this.edges=[],this.dataIndex=-1,this.id=null==t?"":t,this.dataIndex=null==e?-1:e}return t.prototype.degree=function(){return this.edges.length},t.prototype.inDegree=function(){return this.inEdges.length},t.prototype.outDegree=function(){return this.outEdges.length},t.prototype.getModel=function(t){if(!(this.dataIndex<0))return this.hostGraph.data.getItemModel(this.dataIndex).getModel(t)},t.prototype.getAdjacentDataIndices=function(){for(var t={edge:[],node:[]},e=0;e<this.edges.length;e++){var i=this.edges[e];i.dataIndex<0||(t.edge.push(i.dataIndex),t.node.push(i.node1.dataIndex,i.node2.dataIndex))}return t},t.prototype.getTrajectoryDataIndices=function(){for(var t=YE(),e=YE(),i=0;i<this.edges.length;i++){var n=this.edges[i];if(!(n.dataIndex<0)){t.set(n.dataIndex,!0);for(var r=[n.node1],o=[n.node2],s=0;s<r.length;){var a=r[s];s++,e.set(a.dataIndex,!0);for(var l=0;l<a.inEdges.length;l++)t.set(a.inEdges[l].dataIndex,!0),r.push(a.inEdges[l].node1)}for(s=0;s<o.length;){var c=o[s];s++,e.set(c.dataIndex,!0);for(l=0;l<c.outEdges.length;l++)t.set(c.outEdges[l].dataIndex,!0),o.push(c.outEdges[l].node2)}}}return{edge:t.keys(),node:e.keys()}},t}(),v2=function(){function t(t,e,i){this.dataIndex=-1,this.node1=t,this.node2=e,this.dataIndex=null==i?-1:i}return t.prototype.getModel=function(t){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(t)},t.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},t.prototype.getTrajectoryDataIndices=function(){var t=YE(),e=YE();t.set(this.dataIndex,!0);for(var i=[this.node1],n=[this.node2],r=0;r<i.length;){var o=i[r];r++,e.set(o.dataIndex,!0);for(var s=0;s<o.inEdges.length;s++)t.set(o.inEdges[s].dataIndex,!0),i.push(o.inEdges[s].node1)}for(r=0;r<n.length;){var a=n[r];r++,e.set(a.dataIndex,!0);for(s=0;s<a.outEdges.length;s++)t.set(a.outEdges[s].dataIndex,!0),n.push(a.outEdges[s].node2)}return{edge:t.keys(),node:e.keys()}},t}();function _2(t,e){return{getValue:function(i){var n=this[t][e];return n.getStore().get(n.getDimensionIndex(i||"value"),this.dataIndex)},setVisual:function(i,n){this.dataIndex>=0&&this[t][e].setItemVisual(this.dataIndex,i,n)},getVisual:function(i){return this[t][e].getItemVisual(this.dataIndex,i)},setLayout:function(i,n){this.dataIndex>=0&&this[t][e].setItemLayout(this.dataIndex,i,n)},getLayout:function(){return this[t][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[t][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[t][e].getRawIndex(this.dataIndex)}}}mE(y2,_2("hostGraph","data")),mE(v2,_2("hostGraph","edgeData"));var x2=g2;function b2(t,e,i,n,r){for(var o=new x2(n),s=0;s<t.length;s++)o.addNode(NE(t[s].id,t[s].name,s),s);var a=[],l=[],c=0;for(s=0;s<e.length;s++){var u=e[s],h=u.source,p=u.target;o.addEdge(h,p,c)&&(l.push(u),a.push(NE(gP(u.id,null),h+" > "+p)),c++)}var d,f=i.get("coordinateSystem");if("cartesian2d"===f||"polar"===f)d=FH(t,i);else{var m=Bz.get(f),g=m&&m.dimensions||[];fE(g,"value")<0&&g.concat(["value"]);var y=LH(t,{coordDimensions:g,encodeDefine:i.getEncode()}).dimensions;(d=new PH(y,i)).initData(t)}var v=new PH(["value"],i);return v.initData(l,a),r&&r(d,v),H$({mainData:d,struct:o,structAttr:"graph",datas:{node:d,edge:v},datasAttr:{node:"data",edge:"edgeData"}}),o.update(),o}var w2=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.hasSymbolVisual=!0,i}return zA(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments);var i=this;function n(){return i._categoriesData}this.legendVisualProvider=new pQ(n,n),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},e.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},e.prototype.mergeDefaultAndTheme=function(e){t.prototype.mergeDefaultAndTheme.apply(this,arguments),cP(e,"edgeLabel",["show"])},e.prototype.getInitialData=function(t,e){var i,n=t.edges||t.links||[],r=t.data||t.nodes||[],o=this;if(r&&n){_1(i=this)&&(i.__curvenessList=[],i.__edgeMap={},x1(i));var s=b2(r,n,this,!0,(function(t,e){t.wrapMethod("getItemModel",(function(t){var e=o._categoriesModels[t.getShallow("category")];return e&&(e.parentModel=t.parentModel,t.parentModel=e),t}));var i=FN.prototype.getModel;function n(t,e){var n=i.call(this,t,e);return n.resolveParentPath=r,n}function r(t){if(t&&("label"===t[0]||"label"===t[1])){var e=t.slice();return"label"===t[0]?e[0]="edgeLabel":"label"===t[1]&&(e[1]="edgeLabel"),e}return t}e.wrapMethod("getItemModel",(function(t){return t.resolveParentPath=r,t.getModel=n,t}))}));return yE(s.edges,(function(t){!function(t,e,i,n){if(_1(i)){var r=b1(t,e,i),o=i.__edgeMap,s=o[w1(r)];o[r]&&!s?o[r].isForward=!0:s&&o[r]&&(s.isForward=!0,o[r].isForward=!1),o[r]=o[r]||[],o[r].push(n)}}(t.node1,t.node2,this,t.dataIndex)}),this),s.data}},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.getCategoriesData=function(){return this._categoriesData},e.prototype.formatTooltip=function(t,e,i){if("edge"===i){var n=this.getData(),r=this.getDataParams(t,i),o=n.graph.getEdgeByIndex(t),s=n.getName(o.node1.dataIndex),a=n.getName(o.node2.dataIndex),l=[];return null!=s&&l.push(s),null!=a&&l.push(a),xV("nameValue",{name:l.join(" > "),value:r.value,noValue:null==r.value})}return DV({series:this,dataIndex:t,multipleSeries:e})},e.prototype._updateCategoriesData=function(){var t=vE(this.option.categories||[],(function(t){return null!=t.value?t:pE({value:0},t)})),e=new PH(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray((function(t){return e.getItemModel(t)}))},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.isAnimationEnabled=function(){return t.prototype.isAnimationEnabled.call(this)&&!("force"===this.get("layout")&&this.get(["force","layoutAnimation"]))},e.type="series.graph",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(HV),A2=w2,E2={type:"graphRoam",event:"graphRoam",update:"none"};var S2=function(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0},M2=function(t){function e(e){var i=t.call(this,e)||this;return i.type="pointer",i}return zA(e,t),e.prototype.getDefaultShape=function(){return new S2},e.prototype.buildPath=function(t,e){var i=Math.cos,n=Math.sin,r=e.r,o=e.width,s=e.angle,a=e.x-i(s)*o*(o>=r/3?1:2),l=e.y-n(s)*o*(o>=r/3?1:2);s=e.angle-Math.PI/2,t.moveTo(a,l),t.lineTo(e.x+i(s)*o,e.y+n(s)*o),t.lineTo(e.x+i(e.angle)*r,e.y+n(e.angle)*r),t.lineTo(e.x-i(s)*o,e.y-n(s)*o),t.lineTo(a,l)},e}(xD),T2=M2;function I2(t,e){var i=null==t?"":t+"";return e&&(ME(e)?i=e.replace("{value}",i):SE(e)&&(i=e(t))),i}var C2=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.render=function(t,e,i){this.group.removeAll();var n=t.get(["axisLine","lineStyle","color"]),r=function(t,e){var i=t.get("center"),n=e.getWidth(),r=e.getHeight(),o=Math.min(n,r);return{cx:IC(i[0],e.getWidth()),cy:IC(i[1],e.getHeight()),r:IC(t.get("radius"),o/2)}}(t,i);this._renderMain(t,e,i,n,r),this._data=t.getData()},e.prototype.dispose=function(){},e.prototype._renderMain=function(t,e,i,n,r){var o=this.group,s=t.get("clockwise"),a=-t.get("startAngle")/180*Math.PI,l=-t.get("endAngle")/180*Math.PI,c=t.getModel("axisLine"),u=c.get("roundCap")?TY:jO,h=c.get("show"),p=c.getModel("lineStyle"),d=p.get("width"),f=[a,l];QL(f,!s);for(var m=(l=f[1])-(a=f[0]),g=a,y=[],v=0;h&&v<n.length;v++){var _=new u({shape:{startAngle:g,endAngle:l=a+m*Math.min(Math.max(n[v][0],0),1),cx:r.cx,cy:r.cy,clockwise:s,r0:r.r-d,r:r.r},silent:!0});_.setStyle({fill:n[v][1]}),_.setStyle(p.getLineStyle(["color","width"])),y.push(_),g=l}y.reverse(),yE(y,(function(t){return o.add(t)}));var x=function(t){if(t<=0)return n[0][1];var e;for(e=0;e<n.length;e++)if(n[e][0]>=t&&(0===e?0:n[e-1][0])<t)return n[e][1];return n[e-1][1]};this._renderTicks(t,e,i,x,r,a,l,s,d),this._renderTitleAndDetail(t,e,i,x,r),this._renderAnchor(t,r),this._renderPointer(t,e,i,x,r,a,l,s,d)},e.prototype._renderTicks=function(t,e,i,n,r,o,s,a,l){for(var c,u,h=this.group,p=r.cx,d=r.cy,f=r.r,m=+t.get("min"),g=+t.get("max"),y=t.getModel("splitLine"),v=t.getModel("axisTick"),_=t.getModel("axisLabel"),x=t.get("splitNumber"),b=v.get("splitNumber"),w=IC(y.get("length"),f),A=IC(v.get("length"),f),E=o,S=(s-o)/x,M=S/b,T=y.getModel("lineStyle").getLineStyle(),I=v.getModel("lineStyle").getLineStyle(),C=y.get("distance"),P=0;P<=x;P++){if(c=Math.cos(E),u=Math.sin(E),y.get("show")){var L=new nk({shape:{x1:c*(f-(D=C?C+l:l))+p,y1:u*(f-D)+d,x2:c*(f-w-D)+p,y2:u*(f-w-D)+d},style:T,silent:!0});"auto"===T.stroke&&L.setStyle({stroke:n(P/x)}),h.add(L)}if(_.get("show")){var D=_.get("distance")+C,R=I2(CC(P/x*(g-m)+m),_.get("formatter")),O=n(P/x),k=c*(f-w-D)+p,N=u*(f-w-D)+d,B=_.get("rotate"),z=0;"radial"===B?(z=-E+2*Math.PI)>Math.PI/2&&(z+=Math.PI):"tangential"===B?z=-E-Math.PI/2:IE(B)&&(z=B*Math.PI/180),0===z?h.add(new JD({style:mN(_,{text:R,x:k,y:N,verticalAlign:u<-.8?"top":u>.8?"bottom":"middle",align:c<-.4?"left":c>.4?"right":"center"},{inheritColor:O}),silent:!0})):h.add(new JD({style:mN(_,{text:R,x:k,y:N,verticalAlign:"middle",align:"center"},{inheritColor:O}),silent:!0,originX:k,originY:N,rotation:z}))}if(v.get("show")&&P!==x){D=(D=v.get("distance"))?D+l:l;for(var F=0;F<=b;F++){c=Math.cos(E),u=Math.sin(E);var V=new nk({shape:{x1:c*(f-D)+p,y1:u*(f-D)+d,x2:c*(f-A-D)+p,y2:u*(f-A-D)+d},silent:!0,style:I});"auto"===I.stroke&&V.setStyle({stroke:n((P+F/b)/x)}),h.add(V),E+=M}E-=M}else E+=S}},e.prototype._renderPointer=function(t,e,i,n,r,o,s,a,l){var c=this.group,u=this._data,h=this._progressEls,p=[],d=t.get(["pointer","show"]),f=t.getModel("progress"),m=f.get("show"),g=t.getData(),y=g.mapDimension("value"),v=+t.get("min"),_=+t.get("max"),x=[v,_],b=[o,s];function w(e,i){var n,o=g.getItemModel(e).getModel("pointer"),s=IC(o.get("width"),r.r),a=IC(o.get("length"),r.r),l=t.get(["pointer","icon"]),c=o.get("offsetCenter"),u=IC(c[0],r.r),h=IC(c[1],r.r),p=o.get("keepAspect");return(n=l?pG(l,u-s/2,h-a,s,a,null,p):new T2({shape:{angle:-Math.PI/2,width:s,r:a,x:u,y:h}})).rotation=-(i+Math.PI/2),n.x=r.cx,n.y=r.cy,n}function A(t,e){var i=f.get("roundCap")?TY:jO,n=f.get("overlap"),s=n?f.get("width"):l/g.count(),c=n?r.r-s:r.r-(t+1)*s,u=n?r.r:r.r-t*s,h=new i({shape:{startAngle:o,endAngle:e,cx:r.cx,cy:r.cy,clockwise:a,r0:c,r:u}});return n&&(h.z2=_-g.get(y,t)%_),h}(m||d)&&(g.diff(u).add((function(e){var i=g.get(y,e);if(d){var n=w(e,o);Lk(n,{rotation:-((isNaN(+i)?b[0]:TC(i,x,b,!0))+Math.PI/2)},t),c.add(n),g.setItemGraphicEl(e,n)}if(m){var r=A(e,o),s=f.get("clip");Lk(r,{shape:{endAngle:TC(i,x,b,s)}},t),c.add(r),$D(t.seriesIndex,g.dataType,e,r),p[e]=r}})).update((function(e,i){var n=g.get(y,e);if(d){var r=u.getItemGraphicEl(i),s=r?r.rotation:o,a=w(e,s);a.rotation=s,Pk(a,{rotation:-((isNaN(+n)?b[0]:TC(n,x,b,!0))+Math.PI/2)},t),c.add(a),g.setItemGraphicEl(e,a)}if(m){var l=h[i],v=A(e,l?l.shape.endAngle:o),_=f.get("clip");Pk(v,{shape:{endAngle:TC(n,x,b,_)}},t),c.add(v),$D(t.seriesIndex,g.dataType,e,v),p[e]=v}})).execute(),g.each((function(t){var e=g.getItemModel(t),i=e.getModel("emphasis"),r=i.get("focus"),o=i.get("blurScope"),s=i.get("disabled");if(d){var a=g.getItemGraphicEl(t),l=g.getItemVisual(t,"style"),c=l.fill;if(a instanceof TD){var u=a.style;a.useStyle(pE({image:u.image,x:u.x,y:u.y,width:u.width,height:u.height},l))}else a.useStyle(l),"pointer"!==a.type&&a.setColor(c);a.setStyle(e.getModel(["pointer","itemStyle"]).getItemStyle()),"auto"===a.style.fill&&a.setStyle("fill",n(TC(g.get(y,t),x,[0,1],!0))),a.z2EmphasisLift=0,JR(a,e),XR(a,r,o,s)}if(m){var h=p[t];h.useStyle(g.getItemVisual(t,"style")),h.setStyle(e.getModel(["progress","itemStyle"]).getItemStyle()),h.z2EmphasisLift=0,JR(h,e),XR(h,r,o,s)}})),this._progressEls=p)},e.prototype._renderAnchor=function(t,e){var i=t.getModel("anchor");if(i.get("show")){var n=i.get("size"),r=i.get("icon"),o=i.get("offsetCenter"),s=i.get("keepAspect"),a=pG(r,e.cx-n/2+IC(o[0],e.r),e.cy-n/2+IC(o[1],e.r),n,n,null,s);a.z2=i.get("showAbove")?1:0,a.setStyle(i.getModel("itemStyle").getItemStyle()),this.group.add(a)}},e.prototype._renderTitleAndDetail=function(t,e,i,n,r){var o=this,s=t.getData(),a=s.mapDimension("value"),l=+t.get("min"),c=+t.get("max"),u=new xC,h=[],p=[],d=t.isAnimationEnabled(),f=t.get(["pointer","showAbove"]);s.diff(this._data).add((function(t){h[t]=new JD({silent:!0}),p[t]=new JD({silent:!0})})).update((function(t,e){h[t]=o._titleEls[e],p[t]=o._detailEls[e]})).execute(),s.each((function(e){var i=s.getItemModel(e),o=s.get(a,e),m=new xC,g=n(TC(o,[l,c],[0,1],!0)),y=i.getModel("title");if(y.get("show")){var v=y.get("offsetCenter"),_=r.cx+IC(v[0],r.r),x=r.cy+IC(v[1],r.r);(I=h[e]).attr({z2:f?0:2,style:mN(y,{x:_,y:x,text:s.getName(e),align:"center",verticalAlign:"middle"},{inheritColor:g})}),m.add(I)}var b=i.getModel("detail");if(b.get("show")){var w=b.get("offsetCenter"),A=r.cx+IC(w[0],r.r),E=r.cy+IC(w[1],r.r),S=IC(b.get("width"),r.r),M=IC(b.get("height"),r.r),T=t.get(["progress","show"])?s.getItemVisual(e,"style").fill:g,I=p[e],C=b.get("formatter");I.attr({z2:f?0:2,style:mN(b,{x:A,y:E,text:I2(o,C),width:isNaN(S)?null:S,height:isNaN(M)?null:M,align:"center",verticalAlign:"middle"},{inheritColor:T})}),AN(I,{normal:b},o,(function(t){return I2(t,C)})),d&&EN(I,e,s,t,{getFormattedLabel:function(t,e,i,n,r,s){return I2(s?s.interpolatedValue:o,C)}}),m.add(I)}u.add(m)})),this.group.add(u),this._titleEls=h,this._detailEls=p},e.type="gauge",e}(iU),P2=C2,L2=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.visualStyleAccessPath="itemStyle",i}return zA(e,t),e.prototype.getInitialData=function(t,e){return uQ(this,["value"])},e.type="series.gauge",e.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:"#63677A",width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:"#464646",fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,offsetCenter:[0,"20%"],color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},e}(HV),D2=L2;var R2=["itemStyle","opacity"],O2=function(t){function e(e,i){var n=t.call(this)||this,r=n,o=new $O,s=new JD;return r.setTextContent(s),n.setTextGuideLine(o),n.updateData(e,i,!0),n}return zA(e,t),e.prototype.updateData=function(t,e,i){var n=this,r=t.hostModel,o=t.getItemModel(e),s=t.getItemLayout(e),a=o.getModel("emphasis"),l=o.get(R2);l=null==l?1:l,i||Nk(n),n.useStyle(t.getItemVisual(e,"style")),n.style.lineJoin="round",i?(n.setShape({points:s.points}),n.style.opacity=0,Lk(n,{style:{opacity:l}},r,e)):Pk(n,{style:{opacity:l},shape:{points:s.points}},r,e),JR(n,o),this._updateLabel(t,e),XR(this,a.get("focus"),a.get("blurScope"),a.get("disabled"))},e.prototype._updateLabel=function(t,e){var i=this,n=this.getTextGuideLine(),r=i.getTextContent(),o=t.hostModel,s=t.getItemModel(e),a=t.getItemLayout(e).label,l=t.getItemVisual(e,"style"),c=l.fill;dN(r,fN(s),{labelFetcher:t.hostModel,labelDataIndex:e,defaultOpacity:l.opacity,defaultText:t.getName(e)},{normal:{align:a.textAlign,verticalAlign:a.verticalAlign}}),i.setTextConfig({local:!0,inside:!!a.inside,insideStroke:c,outsideFill:c});var u=a.linePoints;n.setShape({points:u}),i.textGuideLineConfig={anchor:u?new iM(u[0][0],u[0][1]):null},Pk(r,{style:{x:a.x,y:a.y}},o,e),r.attr({rotation:a.rotation,originX:a.x,originY:a.y,z2:10}),Zq(i,Yq(s),{stroke:c})},e}(QO),k2=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.ignoreLabelLineUpdate=!0,i}return zA(e,t),e.prototype.render=function(t,e,i){var n=t.getData(),r=this._data,o=this.group;n.diff(r).add((function(t){var e=new O2(n,t);n.setItemGraphicEl(t,e),o.add(e)})).update((function(t,e){var i=r.getItemGraphicEl(e);i.updateData(n,t),o.add(i),n.setItemGraphicEl(t,i)})).remove((function(e){kk(r.getItemGraphicEl(e),t,e)})).execute(),this._data=n},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.prototype.dispose=function(){},e.type="funnel",e}(iU),N2=k2,B2=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new pQ(wE(this.getData,this),wE(this.getRawData,this)),this._defaultLabelLine(e)},e.prototype.getInitialData=function(t,e){return uQ(this,{coordDimensions:["value"],encodeDefaulter:AE(hz,this)})},e.prototype._defaultLabelLine=function(t){cP(t,"labelLine",["show"]);var e=t.labelLine,i=t.emphasis.labelLine;e.show=e.show&&t.label.show,i.show=i.show&&t.emphasis.label.show},e.prototype.getDataParams=function(e){var i=this.getData(),n=t.prototype.getDataParams.call(this,e),r=i.mapDimension("value"),o=i.getSum(r);return n.percent=o?+(i.get(r,e)/o*100).toFixed(2):0,n.$vars.push("percent"),n},e.type="series.funnel",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(HV),z2=B2;function F2(t,e){t.eachSeriesByType("funnel",(function(t){var i=t.getData(),n=i.mapDimension("value"),r=t.get("sort"),o=function(t,e){return UB(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}(t,e),s=t.get("orient"),a=o.width,l=o.height,c=function(t,e){for(var i=t.mapDimension("value"),n=t.mapArray(i,(function(t){return t})),r=[],o="ascending"===e,s=0,a=t.count();s<a;s++)r[s]=s;return SE(e)?r.sort(e):"none"!==e&&r.sort((function(t,e){return o?n[t]-n[e]:n[e]-n[t]})),r}(i,r),u=o.x,h=o.y,p="horizontal"===s?[IC(t.get("minSize"),l),IC(t.get("maxSize"),l)]:[IC(t.get("minSize"),a),IC(t.get("maxSize"),a)],d=i.getDataExtent(n),f=t.get("min"),m=t.get("max");null==f&&(f=Math.min(d[0],0)),null==m&&(m=d[1]);var g=t.get("funnelAlign"),y=t.get("gap"),v=(("horizontal"===s?a:l)-y*(i.count()-1))/i.count(),_=function(t,e){if("horizontal"===s){var r=TC(i.get(n,t)||0,[f,m],p,!0),o=void 0;switch(g){case"top":o=h;break;case"center":o=h+(l-r)/2;break;case"bottom":o=h+(l-r)}return[[e,o],[e,o+r]]}var c,d=TC(i.get(n,t)||0,[f,m],p,!0);switch(g){case"left":c=u;break;case"center":c=u+(a-d)/2;break;case"right":c=u+a-d}return[[c,e],[c+d,e]]};"ascending"===r&&(v=-v,y=-y,"horizontal"===s?u+=a:h+=l,c=c.reverse());for(var x=0;x<c.length;x++){var b=c[x],w=c[x+1],A=i.getItemModel(b);if("horizontal"===s){var E=A.get(["itemStyle","width"]);null==E?E=v:(E=IC(E,a),"ascending"===r&&(E=-E));var S=_(b,u),M=_(w,u+E);u+=E+y,i.setItemLayout(b,{points:S.concat(M.slice().reverse())})}else{var T=A.get(["itemStyle","height"]);null==T?T=v:(T=IC(T,l),"ascending"===r&&(T=-T));S=_(b,h),M=_(w,h+T);h+=T+y,i.setItemLayout(b,{points:S.concat(M.slice().reverse())})}}!function(t){var e=t.hostModel.get("orient");t.each((function(i){var n,r,o,s,a=t.getItemModel(i),l=a.getModel("label").get("position"),c=a.getModel("labelLine"),u=t.getItemLayout(i),h=u.points,p="inner"===l||"inside"===l||"center"===l||"insideLeft"===l||"insideRight"===l;if(p)"insideLeft"===l?(r=(h[0][0]+h[3][0])/2+5,o=(h[0][1]+h[3][1])/2,n="left"):"insideRight"===l?(r=(h[1][0]+h[2][0])/2-5,o=(h[1][1]+h[2][1])/2,n="right"):(r=(h[0][0]+h[1][0]+h[2][0]+h[3][0])/4,o=(h[0][1]+h[1][1]+h[2][1]+h[3][1])/4,n="center"),s=[[r,o],[r,o]];else{var d=void 0,f=void 0,m=void 0,g=void 0,y=c.get("length");"production"!==process.env.NODE_ENV&&("vertical"===e&&["top","bottom"].indexOf(l)>-1&&(l="left",console.warn("Position error: Funnel chart on vertical orient dose not support top and bottom.")),"horizontal"===e&&["left","right"].indexOf(l)>-1&&(l="bottom",console.warn("Position error: Funnel chart on horizontal orient dose not support left and right."))),"left"===l?(d=(h[3][0]+h[0][0])/2,f=(h[3][1]+h[0][1])/2,r=(m=d-y)-5,n="right"):"right"===l?(d=(h[1][0]+h[2][0])/2,f=(h[1][1]+h[2][1])/2,r=(m=d+y)+5,n="left"):"top"===l?(d=(h[3][0]+h[0][0])/2,o=(g=(f=(h[3][1]+h[0][1])/2)-y)-5,n="center"):"bottom"===l?(d=(h[1][0]+h[2][0])/2,o=(g=(f=(h[1][1]+h[2][1])/2)+y)+5,n="center"):"rightTop"===l?(d="horizontal"===e?h[3][0]:h[1][0],f="horizontal"===e?h[3][1]:h[1][1],"horizontal"===e?(o=(g=f-y)-5,n="center"):(r=(m=d+y)+5,n="top")):"rightBottom"===l?(d=h[2][0],f=h[2][1],"horizontal"===e?(o=(g=f+y)+5,n="center"):(r=(m=d+y)+5,n="bottom")):"leftTop"===l?(d=h[0][0],f="horizontal"===e?h[0][1]:h[1][1],"horizontal"===e?(o=(g=f-y)-5,n="center"):(r=(m=d-y)-5,n="right")):"leftBottom"===l?(d="horizontal"===e?h[1][0]:h[3][0],f="horizontal"===e?h[1][1]:h[2][1],"horizontal"===e?(o=(g=f+y)+5,n="center"):(r=(m=d-y)-5,n="right")):(d=(h[1][0]+h[2][0])/2,f=(h[1][1]+h[2][1])/2,"horizontal"===e?(o=(g=f+y)+5,n="center"):(r=(m=d+y)+5,n="left")),"horizontal"===e?r=m=d:o=g=f,s=[[d,f],[m,g]]}u.label={linePoints:s,x:r,y:o,verticalAlign:"middle",textAlign:n,inside:p}}))}(i)}))}var V2=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i._dataGroup=new xC,i._initialized=!1,i}return zA(e,t),e.prototype.init=function(){this.group.add(this._dataGroup)},e.prototype.render=function(t,e,i,n){this._progressiveEls=null;var r=this._dataGroup,o=t.getData(),s=this._data,a=t.coordinateSystem,l=a.dimensions,c=j2(t);if(o.diff(s).add((function(t){var e=G2(o,r,t,l,a);H2(e,o,t,c)})).update((function(e,i){var n=s.getItemGraphicEl(i),r=U2(o,e,l,a);o.setItemGraphicEl(e,n),Pk(n,{shape:{points:r}},t,e),Nk(n),H2(n,o,e,c)})).remove((function(t){var e=s.getItemGraphicEl(t);r.remove(e)})).execute(),!this._initialized){this._initialized=!0;var u=function(t,e,i){var n=t.model,r=t.getRect(),o=new kD({shape:{x:r.x,y:r.y,width:r.width,height:r.height}}),s="horizontal"===n.get("layout")?"width":"height";return o.setShape(s,0),Lk(o,{shape:{width:r.width,height:r.height}},e,i),o}(a,t,(function(){setTimeout((function(){r.removeClipPath()}))}));r.setClipPath(u)}this._data=o},e.prototype.incrementalPrepareRender=function(t,e,i){this._initialized=!0,this._data=null,this._dataGroup.removeAll()},e.prototype.incrementalRender=function(t,e,i){for(var n=e.getData(),r=e.coordinateSystem,o=r.dimensions,s=j2(e),a=this._progressiveEls=[],l=t.start;l<t.end;l++){var c=G2(n,this._dataGroup,l,o,r);c.incremental=!0,H2(c,n,l,s),a.push(c)}},e.prototype.remove=function(){this._dataGroup&&this._dataGroup.removeAll(),this._data=null},e.type="parallel",e}(iU);function U2(t,e,i,n){for(var r,o=[],s=0;s<i.length;s++){var a=i[s],l=t.get(t.mapDimension(a),e);r=l,("category"===n.getAxis(a).type?null==r:null==r||isNaN(r))||o.push(n.dataToPoint(l,a))}return o}function G2(t,e,i,n,r){var o=U2(t,i,n,r),s=new $O({shape:{points:o},z2:10});return e.add(s),t.setItemGraphicEl(i,s),s}function j2(t){var e=t.get("smooth",!0);return!0===e&&(e=.3),kE(e=HC(e))&&(e=0),{smooth:e}}function H2(t,e,i,n){t.useStyle(e.getItemVisual(i,"style")),t.style.fill=null,t.setShape("smooth",n.smooth);var r=e.getItemModel(i),o=r.getModel("emphasis");JR(t,r,"lineStyle"),XR(t,o.get("focus"),o.get("blurScope"),o.get("disabled"))}var W2=V2,q2=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.visualStyleAccessPath="lineStyle",i.visualDrawType="stroke",i}return zA(e,t),e.prototype.getInitialData=function(t,e){return FH(null,this,{useEncodeDefaulter:wE(X2,null,this)})},e.prototype.getRawIndicesByActiveState=function(t){var e=this.coordinateSystem,i=this.getData(),n=[];return e.eachActiveState(i,(function(e,r){t===e&&n.push(i.getRawIndex(r))})),n},e.type="series.parallel",e.dependencies=["parallel"],e.defaultOption={z:2,coordinateSystem:"parallel",parallelIndex:0,label:{show:!1},inactiveOpacity:.05,activeOpacity:1,lineStyle:{width:1,opacity:.45,type:"solid"},emphasis:{label:{show:!1}},progressive:500,smooth:!1,animationEasing:"linear"},e}(HV);function X2(t){var e=t.ecModel.getComponent("parallel",t.get("parallelIndex"));if(e){var i={};return yE(e.dimensions,(function(t){var e=+t.replace("dim","");i[t]=e})),i}}var Z2=q2,Y2=["lineStyle","opacity"],Q2={seriesType:"parallel",reset:function(t,e){var i=t.coordinateSystem,n={normal:t.get(["lineStyle","opacity"]),active:t.get("activeOpacity"),inactive:t.get("inactiveOpacity")};return{progress:function(t,e){i.eachActiveState(e,(function(t,i){var r=n[t];if("normal"===t&&e.hasItemOption){var o=e.getItemModel(i).get(Y2,!0);null!=o&&(r=o)}e.ensureUniqueItemVisual(i,"style").opacity=r}),t.start,t.end)}}}};function J2(t){!function(t){if(t.parallel)return;var e=!1;yE(t.series,(function(t){t&&"parallel"===t.type&&(e=!0)})),e&&(t.parallel=[{}])}(t),function(t){var e=lP(t.parallelAxis);yE(e,(function(e){if(CE(e)){var i=e.parallelIndex||0,n=lP(t.parallel)[i];n&&n.parallelAxisDefault&&uE(e,n.parallelAxisDefault,!1)}}))}(t)}var K2=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.render=function(t,e,i){this._model=t,this._api=i,this._handlers||(this._handlers={},yE($2,(function(t,e){i.getZr().on(e,this._handlers[e]=wE(t,this))}),this)),aU(this,"_throttledDispatchExpand",t.get("axisExpandRate"),"fixRate")},e.prototype.dispose=function(t,e){lU(this,"_throttledDispatchExpand"),yE(this._handlers,(function(t,i){e.getZr().off(i,t)})),this._handlers=null},e.prototype._throttledDispatchExpand=function(t){this._dispatchExpand(t)},e.prototype._dispatchExpand=function(t){t&&this._api.dispatchAction(pE({type:"parallelAxisExpand"},t))},e.type="parallel",e}(qV),$2={mousedown:function(t){t3(this,"click")&&(this._mouseDownPoint=[t.offsetX,t.offsetY])},mouseup:function(t){var e=this._mouseDownPoint;if(t3(this,"click")&&e){var i=[t.offsetX,t.offsetY];if(Math.pow(e[0]-i[0],2)+Math.pow(e[1]-i[1],2)>5)return;var n=this._model.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]);"none"!==n.behavior&&this._dispatchExpand({axisExpandWindow:n.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(t){if(!this._mouseDownPoint&&t3(this,"mousemove")){var e=this._model,i=e.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]),n=i.behavior;"jump"===n&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===n?null:{axisExpandWindow:i.axisExpandWindow,animation:"jump"===n?null:{duration:0}})}}};function t3(t,e){var i=t._model;return i.get("axisExpandable")&&i.get("axisExpandTriggerOn")===e}var e3=K2,i3=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.init=function(){t.prototype.init.apply(this,arguments),this.mergeOption({})},e.prototype.mergeOption=function(t){var e=this.option;t&&uE(e,t,!0),this._initDimensions()},e.prototype.contains=function(t,e){var i=t.get("parallelIndex");return null!=i&&e.getComponent("parallel",i)===this},e.prototype.setAxisExpand=function(t){yE(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],(function(e){t.hasOwnProperty(e)&&(this.option[e]=t[e])}),this)},e.prototype._initDimensions=function(){var t=this.dimensions=[],e=this.parallelAxisIndex=[];yE(xE(this.ecModel.queryComponents({mainType:"parallelAxis"}),(function(t){return(t.get("parallelIndex")||0)===this.componentIndex}),this),(function(i){t.push("dim"+i.get("dim")),e.push(i.componentIndex)}))},e.type="parallel",e.dependencies=["parallelAxis"],e.layoutMode="box",e.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},e}(YB),n3=i3,r3=function(t){function e(e,i,n,r,o){var s=t.call(this,e,i,n)||this;return s.type=r||"value",s.axisIndex=o,s}return zA(e,t),e.prototype.isHorizontal=function(){return"horizontal"!==this.coordinateSystem.getModel().get("layout")},e}(Sq),o3=r3;function s3(t,e,i,n,r,o){t=t||0;var s=i[1]-i[0];if(null!=r&&(r=l3(r,[0,s])),null!=o&&(o=Math.max(o,null!=r?r:0)),"all"===n){var a=Math.abs(e[1]-e[0]);a=l3(a,[0,s]),r=o=l3(a,[r,o]),n=0}e[0]=l3(e[0],i),e[1]=l3(e[1],i);var l=a3(e,n);e[n]+=t;var c,u=r||0,h=i.slice();return l.sign<0?h[0]+=u:h[1]-=u,e[n]=l3(e[n],h),c=a3(e,n),null!=r&&(c.sign!==l.sign||c.span<r)&&(e[1-n]=e[n]+l.sign*r),c=a3(e,n),null!=o&&c.span>o&&(e[1-n]=e[n]+c.sign*o),e}function a3(t,e){var i=t[e]-t[1-e];return{span:Math.abs(i),sign:i>0?-1:i<0?1:e?-1:1}}function l3(t,e){return Math.min(null!=e[1]?e[1]:1/0,Math.max(null!=e[0]?e[0]:-1/0,t))}var c3=yE,u3=Math.min,h3=Math.max,p3=Math.floor,d3=Math.ceil,f3=CC,m3=Math.PI,g3=function(){function t(t,e,i){this.type="parallel",this._axesMap=YE(),this._axesLayout={},this.dimensions=t.dimensions,this._model=t,this._init(t,e,i)}return t.prototype._init=function(t,e,i){var n=t.dimensions,r=t.parallelAxisIndex;c3(n,(function(t,i){var n=r[i],o=e.getComponent("parallelAxis",n),s=this._axesMap.set(t,new o3(t,WW(o),[0,0],o.get("type"),n)),a="category"===s.type;s.onBand=a&&o.get("boundaryGap"),s.inverse=o.get("inverse"),o.axis=s,s.model=o,s.coordinateSystem=o.coordinateSystem=this}),this)},t.prototype.update=function(t,e){this._updateAxesFromSeries(this._model,t)},t.prototype.containPoint=function(t){var e=this._makeLayoutInfo(),i=e.axisBase,n=e.layoutBase,r=e.pixelDimIndex,o=t[1-r],s=t[r];return o>=i&&o<=i+e.axisLength&&s>=n&&s<=n+e.layoutLength},t.prototype.getModel=function(){return this._model},t.prototype._updateAxesFromSeries=function(t,e){e.eachSeries((function(i){if(t.contains(i,e)){var n=i.getData();c3(this.dimensions,(function(t){var e=this._axesMap.get(t);e.scale.unionExtentFromData(n,n.mapDimension(t)),HW(e.scale,e.model)}),this)}}),this)},t.prototype.resize=function(t,e){this._rect=UB(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()}),this._layoutAxes()},t.prototype.getRect=function(){return this._rect},t.prototype._makeLayoutInfo=function(){var t,e=this._model,i=this._rect,n=["x","y"],r=["width","height"],o=e.get("layout"),s="horizontal"===o?0:1,a=i[r[s]],l=[0,a],c=this.dimensions.length,u=y3(e.get("axisExpandWidth"),l),h=y3(e.get("axisExpandCount")||0,[0,c]),p=e.get("axisExpandable")&&c>3&&c>h&&h>1&&u>0&&a>0,d=e.get("axisExpandWindow");d?(t=y3(d[1]-d[0],l),d[1]=d[0]+t):(t=y3(u*(h-1),l),(d=[u*(e.get("axisExpandCenter")||p3(c/2))-t/2])[1]=d[0]+t);var f=(a-t)/(c-h);f<3&&(f=0);var m=[p3(f3(d[0]/u,1))+1,d3(f3(d[1]/u,1))-1],g=f/u*d[0];return{layout:o,pixelDimIndex:s,layoutBase:i[n[s]],layoutLength:a,axisBase:i[n[1-s]],axisLength:i[r[1-s]],axisExpandable:p,axisExpandWidth:u,axisCollapseWidth:f,axisExpandWindow:d,axisCount:c,winInnerIndices:m,axisExpandWindow0Pos:g}},t.prototype._layoutAxes=function(){var t=this._rect,e=this._axesMap,i=this.dimensions,n=this._makeLayoutInfo(),r=n.layout;e.each((function(t){var e=[0,n.axisLength],i=t.inverse?1:0;t.setExtent(e[i],e[1-i])})),c3(i,(function(e,i){var o=(n.axisExpandable?_3:v3)(i,n),s={horizontal:{x:o.position,y:n.axisLength},vertical:{x:0,y:o.position}},a={horizontal:m3/2,vertical:0},l=[s[r].x+t.x,s[r].y+t.y],c=a[r],u=[1,0,0,1,0,0];KS(u,u,c),JS(u,u,l),this._axesLayout[e]={position:l,rotation:c,transform:u,axisNameAvailableWidth:o.axisNameAvailableWidth,axisLabelShow:o.axisLabelShow,nameTruncateMaxWidth:o.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}}),this)},t.prototype.getAxis=function(t){return this._axesMap.get(t)},t.prototype.dataToPoint=function(t,e){return this.axisCoordToPoint(this._axesMap.get(e).dataToCoord(t),e)},t.prototype.eachActiveState=function(t,e,i,n){null==i&&(i=0),null==n&&(n=t.count());var r=this._axesMap,o=this.dimensions,s=[],a=[];yE(o,(function(e){s.push(t.mapDimension(e)),a.push(r.get(e).model)}));for(var l=this.hasAxisBrushed(),c=i;c<n;c++){var u=void 0;if(l){u="active";for(var h=t.getValues(s,c),p=0,d=o.length;p<d;p++){if("inactive"===a[p].getActiveState(h[p])){u="inactive";break}}}else u="normal";e(u,c)}},t.prototype.hasAxisBrushed=function(){for(var t=this.dimensions,e=this._axesMap,i=!1,n=0,r=t.length;n<r;n++)"normal"!==e.get(t[n]).model.getActiveState()&&(i=!0);return i},t.prototype.axisCoordToPoint=function(t,e){return Jk([t,0],this._axesLayout[e].transform)},t.prototype.getAxisLayout=function(t){return cE(this._axesLayout[t])},t.prototype.getSlidedAxisExpandWindow=function(t){var e=this._makeLayoutInfo(),i=e.pixelDimIndex,n=e.axisExpandWindow.slice(),r=n[1]-n[0],o=[0,e.axisExpandWidth*(e.axisCount-1)];if(!this.containPoint(t))return{behavior:"none",axisExpandWindow:n};var s,a=t[i]-e.layoutBase-e.axisExpandWindow0Pos,l="slide",c=e.axisCollapseWidth,u=this._model.get("axisExpandSlideTriggerArea"),h=null!=u[0];if(c)h&&c&&a<r*u[0]?(l="jump",s=a-r*u[2]):h&&c&&a>r*(1-u[0])?(l="jump",s=a-r*(1-u[2])):(s=a-r*u[1])>=0&&(s=a-r*(1-u[1]))<=0&&(s=0),(s*=e.axisExpandWidth/c)?s3(s,n,o,"all"):l="none";else{var p=n[1]-n[0];(n=[h3(0,o[1]*a/p-p/2)])[1]=u3(o[1],n[0]+p),n[0]=n[1]-p}return{axisExpandWindow:n,behavior:l}},t}();function y3(t,e){return u3(h3(t,e[0]),e[1])}function v3(t,e){var i=e.layoutLength/(e.axisCount-1);return{position:i*t,axisNameAvailableWidth:i,axisLabelShow:!0}}function _3(t,e){var i,n,r=e.layoutLength,o=e.axisExpandWidth,s=e.axisCount,a=e.axisCollapseWidth,l=e.winInnerIndices,c=a,u=!1;return t<l[0]?(i=t*a,n=a):t<=l[1]?(i=e.axisExpandWindow0Pos+t*o-e.axisExpandWindow[0],c=o,u=!0):(i=r-(s-1-t)*a,n=a),{position:i,axisNameAvailableWidth:c,axisLabelShow:u,nameTruncateMaxWidth:n}}var x3=g3;var b3={create:function(t,e){var i=[];return t.eachComponent("parallel",(function(n,r){var o=new x3(n,t,e);o.name="parallel_"+r,o.resize(n,e),n.coordinateSystem=o,o.model=n,i.push(o)})),t.eachSeries((function(t){if("parallel"===t.get("coordinateSystem")){var e=t.getReferringComponents("parallel",MP).models[0];t.coordinateSystem=e.coordinateSystem}})),i}},w3=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.activeIntervals=[],i}return zA(e,t),e.prototype.getAreaSelectStyle=function(){return GP([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},e.prototype.setActiveIntervals=function(t){var e=this.activeIntervals=cE(t);if(e)for(var i=e.length-1;i>=0;i--)PC(e[i])},e.prototype.getActiveState=function(t){var e=this.activeIntervals;if(!e.length)return"normal";if(null==t||isNaN(+t))return"inactive";if(1===e.length){var i=e[0];if(i[0]<=t&&t<=i[1])return"active"}else for(var n=0,r=e.length;n<r;n++)if(e[n][0]<=t&&t<=e[n][1])return"active";return"inactive"},e}(YB);mE(w3,KW);var A3=w3,E3=!0,S3=Math.min,M3=Math.max,T3=Math.pow,I3=1e4,C3=6,P3=6,L3="globalPan",D3={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},R3={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},O3={brushStyle:{lineWidth:2,stroke:"rgba(210,219,238,0.3)",fill:"#D2DBEE"},transformable:!0,brushMode:"single",removeOnClick:!1},k3=0,N3=function(t){function e(e){var i=t.call(this)||this;return i._track=[],i._covers=[],i._handlers={},"production"!==process.env.NODE_ENV&&UE(e),i._zr=e,i.group=new xC,i._uid="brushController_"+k3++,yE(c5,(function(t,e){this._handlers[e]=wE(t,this)}),i),i}return zA(e,t),e.prototype.enableBrush=function(t){return"production"!==process.env.NODE_ENV&&UE(this._mounted),this._brushType&&this._doDisableBrush(),t.brushType&&this._doEnableBrush(t),this},e.prototype._doEnableBrush=function(t){var e=this._zr;this._enableGlobalPan||function(t,e,i){qJ(t)[e]=i}(e,L3,this._uid),yE(this._handlers,(function(t,i){e.on(i,t)})),this._brushType=t.brushType,this._brushOption=uE(cE(O3),t,!0)},e.prototype._doDisableBrush=function(){var t=this._zr;!function(t,e,i){var n=qJ(t);n[e]===i&&(n[e]=null)}(t,L3,this._uid),yE(this._handlers,(function(e,i){t.off(i,e)})),this._brushType=this._brushOption=null},e.prototype.setPanels=function(t){if(t&&t.length){var e=this._panels={};yE(t,(function(t){e[t.panelId]=cE(t)}))}else this._panels=null;return this},e.prototype.mount=function(t){t=t||{},"production"!==process.env.NODE_ENV&&(this._mounted=!0),this._enableGlobalPan=t.enableGlobalPan;var e=this.group;return this._zr.add(e),e.attr({x:t.x||0,y:t.y||0,rotation:t.rotation||0,scaleX:t.scaleX||1,scaleY:t.scaleY||1}),this._transform=e.getLocalTransform(),this},e.prototype.updateCovers=function(t){"production"!==process.env.NODE_ENV&&UE(this._mounted),t=vE(t,(function(t){return uE(cE(O3),t,!0)}));var e="\0-brush-index-",i=this._covers,n=this._covers=[],r=this,o=this._creatingCover;return new oH(i,t,(function(t,e){return s(t.__brushOption,e)}),s).add(a).update(a).remove((function(t){i[t]!==o&&r.group.remove(i[t])})).execute(),this;function s(t,i){return(null!=t.id?t.id:e+i)+"-"+t.brushType}function a(e,s){var a=t[e];if(null!=s&&i[s]===o)n[e]=i[s];else{var l=n[e]=null!=s?(i[s].__brushOption=a,i[s]):z3(r,B3(r,a));U3(r,l)}}},e.prototype.unmount=function(){if("production"===process.env.NODE_ENV||this._mounted)return this.enableBrush(!1),W3(this),this._zr.remove(this.group),"production"!==process.env.NODE_ENV&&(this._mounted=!1),this},e.prototype.dispose=function(){this.unmount(),this.off()},e}(AS);function B3(t,e){var i=h5[e.brushType].createCover(t,e);return i.__brushOption=e,V3(i,e),t.group.add(i),i}function z3(t,e){var i=G3(e);return i.endCreating&&(i.endCreating(t,e),V3(e,e.__brushOption)),e}function F3(t,e){var i=e.__brushOption;G3(e).updateCoverShape(t,e,i.range,i)}function V3(t,e){var i=e.z;null==i&&(i=I3),t.traverse((function(t){t.z=i,t.z2=i}))}function U3(t,e){G3(e).updateCommon(t,e),F3(t,e)}function G3(t){return h5[t.__brushOption.brushType]}function j3(t,e,i){var n,r=t._panels;if(!r)return E3;var o=t._transform;return yE(r,(function(t){t.isTargetByCursor(e,i,o)&&(n=t)})),n}function H3(t,e){var i=t._panels;if(!i)return E3;var n=e.__brushOption.panelId;return null!=n?i[n]:E3}function W3(t){var e=t._covers,i=e.length;return yE(e,(function(e){t.group.remove(e)}),t),e.length=0,!!i}function q3(t,e){var i=vE(t._covers,(function(t){var e=t.__brushOption,i=cE(e.range);return{brushType:e.brushType,panelId:e.panelId,range:i}}));t.trigger("brush",{areas:i,isEnd:!!e.isEnd,removeOnClick:!!e.removeOnClick})}function X3(t){var e=t.length-1;return e<0&&(e=0),[t[0],t[e]]}function Z3(t,e,i,n){var r=new xC;return r.add(new kD({name:"main",style:K3(i),silent:!0,draggable:!0,cursor:"move",drift:AE(e5,t,e,r,["n","s","w","e"]),ondragend:AE(q3,e,{isEnd:!0})})),yE(n,(function(i){r.add(new kD({name:i.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:AE(e5,t,e,r,i),ondragend:AE(q3,e,{isEnd:!0})}))})),r}function Y3(t,e,i,n){var r=n.brushStyle.lineWidth||0,o=M3(r,P3),s=i[0][0],a=i[1][0],l=s-r/2,c=a-r/2,u=i[0][1],h=i[1][1],p=u-o+r/2,d=h-o+r/2,f=u-s,m=h-a,g=f+r,y=m+r;J3(t,e,"main",s,a,f,m),n.transformable&&(J3(t,e,"w",l,c,o,y),J3(t,e,"e",p,c,o,y),J3(t,e,"n",l,c,g,o),J3(t,e,"s",l,d,g,o),J3(t,e,"nw",l,c,o,o),J3(t,e,"ne",p,c,o,o),J3(t,e,"sw",l,d,o,o),J3(t,e,"se",p,d,o,o))}function Q3(t,e){var i=e.__brushOption,n=i.transformable,r=e.childAt(0);r.useStyle(K3(i)),r.attr({silent:!n,cursor:n?"move":"default"}),yE([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],(function(i){var r=e.childOfName(i.join("")),o=1===i.length?t5(t,i[0]):function(t,e){var i=[t5(t,e[0]),t5(t,e[1])];return("e"===i[0]||"w"===i[0])&&i.reverse(),i.join("")}(t,i);r&&r.attr({silent:!n,invisible:!n,cursor:n?R3[o]+"-resize":null})}))}function J3(t,e,i,n,r,o,s){var a=e.childOfName(i);a&&a.setShape(function(t){var e=S3(t[0][0],t[1][0]),i=S3(t[0][1],t[1][1]),n=M3(t[0][0],t[1][0]),r=M3(t[0][1],t[1][1]);return{x:e,y:i,width:n-e,height:r-i}}(r5(t,e,[[n,r],[n+o,r+s]])))}function K3(t){return dE({strokeNoScale:!0},t.brushStyle)}function $3(t,e,i,n){var r=[S3(t,i),S3(e,n)],o=[M3(t,i),M3(e,n)];return[[r[0],o[0]],[r[1],o[1]]]}function t5(t,e){var i=Kk({w:"left",e:"right",n:"top",s:"bottom"}[e],function(t){return Qk(t.group)}(t));return{left:"w",right:"e",top:"n",bottom:"s"}[i]}function e5(t,e,i,n,r,o){var s=i.__brushOption,a=t.toRectRange(s.range),l=n5(e,r,o);yE(n,(function(t){var e=D3[t];a[e[0]][e[1]]+=l[e[0]]})),s.range=t.fromRectRange($3(a[0][0],a[1][0],a[0][1],a[1][1])),U3(e,i),q3(e,{isEnd:!1})}function i5(t,e,i,n){var r=e.__brushOption.range,o=n5(t,i,n);yE(r,(function(t){t[0]+=o[0],t[1]+=o[1]})),U3(t,e),q3(t,{isEnd:!1})}function n5(t,e,i){var n=t.group,r=n.transformCoordToLocal(e,i),o=n.transformCoordToLocal(0,0);return[r[0]-o[0],r[1]-o[1]]}function r5(t,e,i){var n=H3(t,e);return n&&n!==E3?n.clipPath(i,t._transform):cE(i)}function o5(t){var e=t.event;e.preventDefault&&e.preventDefault()}function s5(t,e,i){return t.childOfName("main").contain(e,i)}function a5(t,e,i,n){var r,o=t._creatingCover,s=t._creatingPanel,a=t._brushOption;if(t._track.push(i.slice()),function(t){var e=t._track;if(!e.length)return!1;var i=e[e.length-1],n=e[0],r=i[0]-n[0],o=i[1]-n[1];return T3(r*r+o*o,.5)>C3}(t)||o){if(s&&!o){"single"===a.brushMode&&W3(t);var l=cE(a);l.brushType=l5(l.brushType,s),l.panelId=s===E3?null:s.panelId,o=t._creatingCover=B3(t,l),t._covers.push(o)}if(o){var c=h5[l5(t._brushType,s)];o.__brushOption.range=c.getCreatingRange(r5(t,o,t._track)),n&&(z3(t,o),c.updateCommon(t,o)),F3(t,o),r={isEnd:n}}}else n&&"single"===a.brushMode&&a.removeOnClick&&j3(t,e,i)&&W3(t)&&(r={isEnd:n,removeOnClick:!0});return r}function l5(t,e){return"auto"===t?("production"!==process.env.NODE_ENV&&UE(e&&e.defaultBrushType,'MUST have defaultBrushType when brushType is "atuo"'),e.defaultBrushType):t}var c5={mousedown:function(t){if(this._dragging)u5(this,t);else if(!t.target||!t.target.draggable){o5(t);var e=this.group.transformCoordToLocal(t.offsetX,t.offsetY);this._creatingCover=null,(this._creatingPanel=j3(this,t,e))&&(this._dragging=!0,this._track=[e.slice()])}},mousemove:function(t){var e=t.offsetX,i=t.offsetY,n=this.group.transformCoordToLocal(e,i);if(function(t,e,i){if(t._brushType&&!function(t,e,i){var n=t._zr;return e<0||e>n.getWidth()||i<0||i>n.getHeight()}(t,e.offsetX,e.offsetY)){var n=t._zr,r=t._covers,o=j3(t,e,i);if(!t._dragging)for(var s=0;s<r.length;s++){var a=r[s].__brushOption;if(o&&(o===E3||a.panelId===o.panelId)&&h5[a.brushType].contain(r[s],i[0],i[1]))return}o&&n.setCursorStyle("crosshair")}}(this,t,n),this._dragging){o5(t);var r=a5(this,t,n,!1);r&&q3(this,r)}},mouseup:function(t){u5(this,t)}};function u5(t,e){if(t._dragging){o5(e);var i=e.offsetX,n=e.offsetY,r=t.group.transformCoordToLocal(i,n),o=a5(t,e,r,!0);t._dragging=!1,t._track=[],t._creatingCover=null,o&&q3(t,o)}}var h5={lineX:p5(0),lineY:p5(1),rect:{createCover:function(t,e){function i(t){return t}return Z3({toRectRange:i,fromRectRange:i},t,e,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(t){var e=X3(t);return $3(e[1][0],e[1][1],e[0][0],e[0][1])},updateCoverShape:function(t,e,i,n){Y3(t,e,i,n)},updateCommon:Q3,contain:s5},polygon:{createCover:function(t,e){var i=new xC;return i.add(new $O({name:"main",style:K3(e),silent:!0})),i},getCreatingRange:function(t){return t},endCreating:function(t,e){e.remove(e.childAt(0)),e.add(new QO({name:"main",draggable:!0,drift:AE(i5,t,e),ondragend:AE(q3,t,{isEnd:!0})}))},updateCoverShape:function(t,e,i,n){e.childAt(0).setShape({points:r5(t,e,i)})},updateCommon:Q3,contain:s5}};function p5(t){return{createCover:function(e,i){return Z3({toRectRange:function(e){var i=[e,[0,100]];return t&&i.reverse(),i},fromRectRange:function(e){return e[t]}},e,i,[[["w"],["e"]],[["n"],["s"]]][t])},getCreatingRange:function(e){var i=X3(e);return[S3(i[0][t],i[1][t]),M3(i[0][t],i[1][t])]},updateCoverShape:function(e,i,n,r){var o,s=H3(e,i);if(s!==E3&&s.getLinearBrushOtherExtent)o=s.getLinearBrushOtherExtent(t);else{var a=e._zr;o=[0,[a.getWidth(),a.getHeight()][1-t]]}var l=[n,o];t&&l.reverse(),Y3(e,i,l,r)},updateCommon:Q3,contain:s5}}var d5=N3;function f5(t){return t=y5(t),function(e){return eN(e,t)}}function m5(t,e){return t=y5(t),function(i){var n=null!=e?e:i,r=n?t.width:t.height,o=n?t.x:t.y;return[o,o+(r||0)]}}function g5(t,e,i){var n=y5(t);return function(t,r){return n.contain(r[0],r[1])&&!iK(t,e,i)}}function y5(t){return pM.create(t)}var v5=["axisLine","axisTickLabel","axisName"],_5=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.init=function(e,i){t.prototype.init.apply(this,arguments),(this._brushController=new d5(i.getZr())).on("brush",wE(this._onBrush,this))},e.prototype.render=function(t,e,i,n){if(!function(t,e,i){return i&&"axisAreaSelect"===i.type&&e.findComponents({mainType:"parallelAxis",query:i})[0]===t}(t,e,n)){this.axisModel=t,this.api=i,this.group.removeAll();var r=this._axisGroup;if(this._axisGroup=new xC,this.group.add(this._axisGroup),t.get("show")){var o=function(t,e){return e.getComponent("parallel",t.get("parallelIndex"))}(t,e),s=o.coordinateSystem,a=t.getAreaSelectStyle(),l=a.width,c=t.axis.dim,u=pE({strokeContainThreshold:l},s.getAxisLayout(c)),h=new nJ(t,u);yE(v5,h.add,h),this._axisGroup.add(h.getGroup()),this._refreshBrushController(u,a,t,o,l,i),tN(r,this._axisGroup,t)}}},e.prototype._refreshBrushController=function(t,e,i,n,r,o){var s=i.axis.getExtent(),a=s[1]-s[0],l=Math.min(30,.1*Math.abs(a)),c=pM.create({x:s[0],y:-r/2,width:a,height:r});c.x-=l,c.width+=2*l,this._brushController.mount({enableGlobalPan:!0,rotation:t.rotation,x:t.position[0],y:t.position[1]}).setPanels([{panelId:"pl",clipPath:f5(c),isTargetByCursor:g5(c,o,n),getLinearBrushOtherExtent:m5(c,0)}]).enableBrush({brushType:"lineX",brushStyle:e,removeOnClick:!0}).updateCovers(function(t){var e=t.axis;return vE(t.activeIntervals,(function(t){return{brushType:"lineX",panelId:"pl",range:[e.dataToCoord(t[0],!0),e.dataToCoord(t[1],!0)]}}))}(i))},e.prototype._onBrush=function(t){var e=t.areas,i=this.axisModel,n=i.axis,r=vE(e,(function(t){return[n.coordToData(t.range[0],!0),n.coordToData(t.range[1],!0)]}));(!i.option.realtime===t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:i.id,intervals:r})},e.prototype.dispose=function(){this._brushController.dispose()},e.type="parallelAxis",e}(qV);var x5=_5,b5={type:"axisAreaSelect",event:"axisAreaSelected"};var w5={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function A5(t){t.registerComponentView(e3),t.registerComponentModel(n3),t.registerCoordinateSystem("parallel",b3),t.registerPreprocessor(J2),t.registerComponentModel(A3),t.registerComponentView(x5),DQ(t,"parallel",A3,w5),function(t){t.registerAction(b5,(function(t,e){e.eachComponent({mainType:"parallelAxis",query:t},(function(e){e.axis.model.setActiveIntervals(t.intervals)}))})),t.registerAction("parallelAxisExpand",(function(t,e){e.eachComponent({mainType:"parallel",query:t},(function(e){e.setAxisExpand(t)}))}))}(t)}var E5=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0},S5=function(t){function e(e){return t.call(this,e)||this}return zA(e,t),e.prototype.getDefaultShape=function(){return new E5},e.prototype.buildPath=function(t,e){var i=e.extent;t.moveTo(e.x1,e.y1),t.bezierCurveTo(e.cpx1,e.cpy1,e.cpx2,e.cpy2,e.x2,e.y2),"vertical"===e.orient?(t.lineTo(e.x2+i,e.y2),t.bezierCurveTo(e.cpx2+i,e.cpy2,e.cpx1+i,e.cpy1,e.x1+i,e.y1)):(t.lineTo(e.x2,e.y2+i),t.bezierCurveTo(e.cpx2,e.cpy2+i,e.cpx1,e.cpy1+i,e.x1,e.y1+i)),t.closePath()},e.prototype.highlight=function(){RR(this)},e.prototype.downplay=function(){OR(this)},e}(xD),M5=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i._focusAdjacencyDisabled=!1,i}return zA(e,t),e.prototype.render=function(t,e,i){var n=this,r=t.getGraph(),o=this.group,s=t.layoutInfo,a=s.width,l=s.height,c=t.getData(),u=t.getData("edge"),h=t.get("orient");this._model=t,o.removeAll(),o.x=s.x,o.y=s.y,r.eachEdge((function(e){var i=new S5,n=KD(i);n.dataIndex=e.dataIndex,n.seriesIndex=t.seriesIndex,n.dataType="edge";var r,s,c,p,d,f,m,g,y=e.getModel(),v=y.getModel("lineStyle"),_=v.get("curveness"),x=e.node1.getLayout(),b=e.node1.getModel(),w=b.get("localX"),A=b.get("localY"),E=e.node2.getLayout(),S=e.node2.getModel(),M=S.get("localX"),T=S.get("localY"),I=e.getLayout();i.shape.extent=Math.max(1,I.dy),i.shape.orient=h,"vertical"===h?(r=(null!=w?w*a:x.x)+I.sy,s=(null!=A?A*l:x.y)+x.dy,c=(null!=M?M*a:E.x)+I.ty,d=r,f=s*(1-_)+(p=null!=T?T*l:E.y)*_,m=c,g=s*_+p*(1-_)):(r=(null!=w?w*a:x.x)+x.dx,s=(null!=A?A*l:x.y)+I.sy,d=r*(1-_)+(c=null!=M?M*a:E.x)*_,f=s,m=r*_+c*(1-_),g=p=(null!=T?T*l:E.y)+I.ty),i.setShape({x1:r,y1:s,x2:c,y2:p,cpx1:d,cpy1:f,cpx2:m,cpy2:g}),i.useStyle(v.getItemStyle()),T5(i.style,h,e);var C=""+y.get("value"),P=fN(y,"edgeLabel");dN(i,P,{labelFetcher:{getFormattedLabel:function(e,i,n,r,o,s){return t.getFormattedLabel(e,i,"edge",r,zE(o,P.normal&&P.normal.get("formatter"),C),s)}},labelDataIndex:e.dataIndex,defaultText:C}),i.setTextConfig({position:"inside"});var L=y.getModel("emphasis");JR(i,y,"lineStyle",(function(t){var i=t.getItemStyle();return T5(i,h,e),i})),o.add(i),u.setItemGraphicEl(e.dataIndex,i);var D=L.get("focus");XR(i,"adjacency"===D?e.getAdjacentDataIndices():"trajectory"===D?e.getTrajectoryDataIndices():D,L.get("blurScope"),L.get("disabled"))})),r.eachNode((function(e){var i=e.getLayout(),n=e.getModel(),r=n.get("localX"),s=n.get("localY"),u=n.getModel("emphasis"),h=new kD({shape:{x:null!=r?r*a:i.x,y:null!=s?s*l:i.y,width:i.dx,height:i.dy},style:n.getModel("itemStyle").getItemStyle(),z2:10});dN(h,fN(n),{labelFetcher:{getFormattedLabel:function(e,i){return t.getFormattedLabel(e,i,"node")}},labelDataIndex:e.dataIndex,defaultText:e.id}),h.disableLabelAnimation=!0,h.setStyle("fill",e.getVisual("color")),h.setStyle("decal",e.getVisual("style").decal),JR(h,n),o.add(h),c.setItemGraphicEl(e.dataIndex,h),KD(h).dataType="node";var p=u.get("focus");XR(h,"adjacency"===p?e.getAdjacentDataIndices():"trajectory"===p?e.getTrajectoryDataIndices():p,u.get("blurScope"),u.get("disabled"))})),c.eachItemGraphicEl((function(e,r){c.getItemModel(r).get("draggable")&&(e.drift=function(e,o){n._focusAdjacencyDisabled=!0,this.shape.x+=e,this.shape.y+=o,this.dirty(),i.dispatchAction({type:"dragNode",seriesId:t.id,dataIndex:c.getRawIndex(r),localX:this.shape.x/a,localY:this.shape.y/l})},e.ondragend=function(){n._focusAdjacencyDisabled=!1},e.draggable=!0,e.cursor="move")})),!this._data&&t.isAnimationEnabled()&&o.setClipPath(function(t,e,i){var n=new kD({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return Lk(n,{shape:{width:t.width+20}},e,i),n}(o.getBoundingRect(),t,(function(){o.removeClipPath()}))),this._data=t.getData()},e.prototype.dispose=function(){},e.type="sankey",e}(iU);function T5(t,e,i){switch(t.fill){case"source":t.fill=i.node1.getVisual("color"),t.decal=i.node1.getVisual("style").decal;break;case"target":t.fill=i.node2.getVisual("color"),t.decal=i.node2.getVisual("style").decal;break;case"gradient":var n=i.node1.getVisual("color"),r=i.node2.getVisual("color");ME(n)&&ME(r)&&(t.fill=new mk(0,0,+("horizontal"===e),+("vertical"===e),[{color:n,offset:0},{color:r,offset:1}]))}}var I5=M5,C5=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.getInitialData=function(t,e){var i=t.edges||t.links,n=t.data||t.nodes,r=t.levels;this.levelModels=[];for(var o=this.levelModels,s=0;s<r.length;s++)if(null!=r[s].depth&&r[s].depth>=0)o[r[s].depth]=new FN(r[s],this,e);else if("production"!==process.env.NODE_ENV)throw new Error("levels[i].depth is mandatory and should be natural number");if(n&&i){var a=b2(n,i,this,!0,(function(t,e){t.wrapMethod("getItemModel",(function(t,e){var i=t.parentModel,n=i.getData().getItemLayout(e);if(n){var r=n.depth,o=i.levelModels[r];o&&(t.parentModel=o)}return t})),e.wrapMethod("getItemModel",(function(t,e){var i=t.parentModel,n=i.getGraph().getEdgeByIndex(e).node1.getLayout();if(n){var r=n.depth,o=i.levelModels[r];o&&(t.parentModel=o)}return t}))}));return a.data}},e.prototype.setNodePosition=function(t,e){var i=(this.option.data||this.option.nodes)[t];i.localX=e[0],i.localY=e[1]},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.formatTooltip=function(t,e,i){function n(t){return isNaN(t)||null==t}if("edge"===i){var r=this.getDataParams(t,i),o=r.data,s=r.value;return xV("nameValue",{name:o.source+" -- "+o.target,value:s,noValue:n(s)})}var a=this.getGraph().getNodeByIndex(t).getLayout().value,l=this.getDataParams(t,i).data.name;return xV("nameValue",{name:null!=l?l+"":null,value:a,noValue:n(a)})},e.prototype.optionUpdated=function(){},e.prototype.getDataParams=function(e,i){var n=t.prototype.getDataParams.call(this,e,i);if(null==n.value&&"node"===i){var r=this.getGraph().getNodeByIndex(e).getLayout().value;n.value=r}return n},e.type="series.sankey",e.defaultOption={z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:"#212121"}},animationEasing:"linear",animationDuration:1e3},e}(HV),P5=C5;function L5(t,e){t.eachSeriesByType("sankey",(function(t){var i=t.get("nodeWidth"),n=t.get("nodeGap"),r=function(t,e){return UB(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}(t,e);t.layoutInfo=r;var o=r.width,s=r.height,a=t.getGraph(),l=a.nodes,c=a.edges;!function(t){yE(t,(function(t){var e=U5(t.outEdges,V5),i=U5(t.inEdges,V5),n=t.getValue()||0,r=Math.max(e,i,n);t.setLayout({value:r},!0)}))}(l);var u=xE(l,(function(t){return 0===t.getLayout().value}));!function(t,e,i,n,r,o,s,a,l){(function(t,e,i,n,r,o,s){for(var a=[],l=[],c=[],u=[],h=0,p=0;p<e.length;p++)a[p]=1;for(p=0;p<t.length;p++)l[p]=t[p].inEdges.length,0===l[p]&&c.push(t[p]);var d=-1;for(;c.length;){for(var f=0;f<c.length;f++){var m=c[f],g=m.hostGraph.data.getRawDataItem(m.dataIndex),y=null!=g.depth&&g.depth>=0;y&&g.depth>d&&(d=g.depth),m.setLayout({depth:y?g.depth:h},!0),"vertical"===o?m.setLayout({dy:i},!0):m.setLayout({dx:i},!0);for(var v=0;v<m.outEdges.length;v++){var _=m.outEdges[v];a[e.indexOf(_)]=0;var x=_.node2;0==--l[t.indexOf(x)]&&u.indexOf(x)<0&&u.push(x)}}++h,c=u,u=[]}for(p=0;p<a.length;p++)if(1===a[p])throw new Error("Sankey is a DAG, the original data has cycle!");var b=d>h-1?d:h-1;s&&"left"!==s&&function(t,e,i,n){if("right"===e){for(var r=[],o=t,s=0;o.length;){for(var a=0;a<o.length;a++){var l=o[a];l.setLayout({skNodeHeight:s},!0);for(var c=0;c<l.inEdges.length;c++){var u=l.inEdges[c];r.indexOf(u.node1)<0&&r.push(u.node1)}}o=r,r=[],++s}yE(t,(function(t){D5(t)||t.setLayout({depth:Math.max(0,n-t.getLayout().skNodeHeight)},!0)}))}else"justify"===e&&function(t,e){yE(t,(function(t){D5(t)||t.outEdges.length||t.setLayout({depth:e},!0)}))}(t,n)}(t,s,0,b);var w="vertical"===o?(r-i)/b:(n-i)/b;!function(t,e,i){yE(t,(function(t){var n=t.getLayout().depth*e;"vertical"===i?t.setLayout({y:n},!0):t.setLayout({x:n},!0)}))}(t,w,o)})(t,e,i,r,o,a,l),function(t,e,i,n,r,o,s){var a=function(t,e){var i=[],n="vertical"===e?"y":"x",r=PP(t,(function(t){return t.getLayout()[n]}));return r.keys.sort((function(t,e){return t-e})),yE(r.keys,(function(t){i.push(r.buckets.get(t))})),i}(t,s);(function(t,e,i,n,r,o){var s=1/0;yE(t,(function(t){var e=t.length,a=0;yE(t,(function(t){a+=t.getLayout().value}));var l="vertical"===o?(n-(e-1)*r)/a:(i-(e-1)*r)/a;l<s&&(s=l)})),yE(t,(function(t){yE(t,(function(t,e){var i=t.getLayout().value*s;"vertical"===o?(t.setLayout({x:e},!0),t.setLayout({dx:i},!0)):(t.setLayout({y:e},!0),t.setLayout({dy:i},!0))}))})),yE(e,(function(t){var e=+t.getValue()*s;t.setLayout({dy:e},!0)}))})(a,e,i,n,r,s),R5(a,r,i,n,s);for(var l=1;o>0;o--)O5(a,l*=.99,s),R5(a,r,i,n,s),G5(a,l,s),R5(a,r,i,n,s)}(t,e,o,r,n,s,a),function(t,e){var i="vertical"===e?"x":"y";yE(t,(function(t){t.outEdges.sort((function(t,e){return t.node2.getLayout()[i]-e.node2.getLayout()[i]})),t.inEdges.sort((function(t,e){return t.node1.getLayout()[i]-e.node1.getLayout()[i]}))})),yE(t,(function(t){var e=0,i=0;yE(t.outEdges,(function(t){t.setLayout({sy:e},!0),e+=t.getLayout().dy})),yE(t.inEdges,(function(t){t.setLayout({ty:i},!0),i+=t.getLayout().dy}))}))}(t,a)}(l,c,i,n,o,s,0!==u.length?0:t.get("layoutIterations"),t.get("orient"),t.get("nodeAlign"))}))}function D5(t){var e=t.hostGraph.data.getRawDataItem(t.dataIndex);return null!=e.depth&&e.depth>=0}function R5(t,e,i,n,r){var o="vertical"===r?"x":"y";yE(t,(function(t){var s,a,l;t.sort((function(t,e){return t.getLayout()[o]-e.getLayout()[o]}));for(var c=0,u=t.length,h="vertical"===r?"dx":"dy",p=0;p<u;p++)(l=c-(a=t[p]).getLayout()[o])>0&&(s=a.getLayout()[o]+l,"vertical"===r?a.setLayout({x:s},!0):a.setLayout({y:s},!0)),c=a.getLayout()[o]+a.getLayout()[h]+e;if((l=c-e-("vertical"===r?n:i))>0){s=a.getLayout()[o]-l,"vertical"===r?a.setLayout({x:s},!0):a.setLayout({y:s},!0),c=s;for(p=u-2;p>=0;--p)(l=(a=t[p]).getLayout()[o]+a.getLayout()[h]+e-c)>0&&(s=a.getLayout()[o]-l,"vertical"===r?a.setLayout({x:s},!0):a.setLayout({y:s},!0)),c=a.getLayout()[o]}}))}function O5(t,e,i){yE(t.slice().reverse(),(function(t){yE(t,(function(t){if(t.outEdges.length){var n=U5(t.outEdges,k5,i)/U5(t.outEdges,V5);if(isNaN(n)){var r=t.outEdges.length;n=r?U5(t.outEdges,N5,i)/r:0}if("vertical"===i){var o=t.getLayout().x+(n-F5(t,i))*e;t.setLayout({x:o},!0)}else{var s=t.getLayout().y+(n-F5(t,i))*e;t.setLayout({y:s},!0)}}}))}))}function k5(t,e){return F5(t.node2,e)*t.getValue()}function N5(t,e){return F5(t.node2,e)}function B5(t,e){return F5(t.node1,e)*t.getValue()}function z5(t,e){return F5(t.node1,e)}function F5(t,e){return"vertical"===e?t.getLayout().x+t.getLayout().dx/2:t.getLayout().y+t.getLayout().dy/2}function V5(t){return t.getValue()}function U5(t,e,i){for(var n=0,r=t.length,o=-1;++o<r;){var s=+e(t[o],i);isNaN(s)||(n+=s)}return n}function G5(t,e,i){yE(t,(function(t){yE(t,(function(t){if(t.inEdges.length){var n=U5(t.inEdges,B5,i)/U5(t.inEdges,V5);if(isNaN(n)){var r=t.inEdges.length;n=r?U5(t.inEdges,z5,i)/r:0}if("vertical"===i){var o=t.getLayout().x+(n-F5(t,i))*e;t.setLayout({x:o},!0)}else{var s=t.getLayout().y+(n-F5(t,i))*e;t.setLayout({y:s},!0)}}}))}))}function j5(t){t.eachSeriesByType("sankey",(function(t){var e=t.getGraph(),i=e.nodes,n=e.edges;if(i.length){var r=1/0,o=-1/0;yE(i,(function(t){var e=t.getLayout().value;e<r&&(r=e),e>o&&(o=e)})),yE(i,(function(e){var i=new X0({type:"color",mappingMethod:"linear",dataExtent:[r,o],visual:t.get("color")}).mapValueToVisual(e.getLayout().value),n=e.getModel().get(["itemStyle","color"]);null!=n?(e.setVisual("color",n),e.setVisual("style",{fill:n})):(e.setVisual("color",i),e.setVisual("style",{fill:i}))}))}n.length&&yE(n,(function(t){var e=t.getModel().get("lineStyle");t.setVisual("style",e)}))}))}var H5=function(){function t(){}return t.prototype.getInitialData=function(t,e){var i,n,r=e.getComponent("xAxis",this.get("xAxisIndex")),o=e.getComponent("yAxis",this.get("yAxisIndex")),s=r.get("type"),a=o.get("type");"category"===s?(t.layout="horizontal",i=r.getOrdinalMeta(),n=!0):"category"===a?(t.layout="vertical",i=o.getOrdinalMeta(),n=!0):t.layout=t.layout||"horizontal";var l=["x","y"],c="horizontal"===t.layout?0:1,u=this._baseAxisDim=l[c],h=l[1-c],p=[r,o],d=p[c].get("type"),f=p[1-c].get("type"),m=t.data;if(m&&n){var g=[];yE(m,(function(t,e){var i;EE(t)?(i=t.slice(),t.unshift(e)):EE(t.value)?((i=pE({},t)).value=i.value.slice(),t.value.unshift(e)):i=t,g.push(i)})),t.data=g}var y=this.defaultValueDimensions,v=[{name:u,type:lH(d),ordinalMeta:i,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:h,type:lH(f),dimsDef:y.slice()}];return uQ(this,{coordDimensions:v,dimensionsCount:y.length+1,encodeDefaulter:AE(uz,v,this)})},t.prototype.getBaseAxis=function(){var t=this._baseAxisDim;return this.ecModel.getComponent(t+"Axis",this.get(t+"AxisIndex")).axis},t}(),W5=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],i.visualDrawType="stroke",i}return zA(e,t),e.type="series.boxplot",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}},animationDuration:800},e}(HV);mE(W5,H5,!0);var q5=W5,X5=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.render=function(t,e,i){var n=t.getData(),r=this.group,o=this._data;this._data||r.removeAll();var s="horizontal"===t.get("layout")?1:0;n.diff(o).add((function(t){if(n.hasValue(t)){var e=Q5(n.getItemLayout(t),n,t,s,!0);n.setItemGraphicEl(t,e),r.add(e)}})).update((function(t,e){var i=o.getItemGraphicEl(e);if(n.hasValue(t)){var a=n.getItemLayout(t);i?(Nk(i),J5(a,i,n,t)):i=Q5(a,n,t,s),r.add(i),n.setItemGraphicEl(t,i)}else r.remove(i)})).remove((function(t){var e=o.getItemGraphicEl(t);e&&r.remove(e)})).execute(),this._data=n},e.prototype.remove=function(t){var e=this.group,i=this._data;this._data=null,i&&i.eachItemGraphicEl((function(t){t&&e.remove(t)}))},e.type="boxplot",e}(iU),Z5=function(){},Y5=function(t){function e(e){var i=t.call(this,e)||this;return i.type="boxplotBoxPath",i}return zA(e,t),e.prototype.getDefaultShape=function(){return new Z5},e.prototype.buildPath=function(t,e){var i=e.points,n=0;for(t.moveTo(i[n][0],i[n][1]),n++;n<4;n++)t.lineTo(i[n][0],i[n][1]);for(t.closePath();n<i.length;n++)t.moveTo(i[n][0],i[n][1]),n++,t.lineTo(i[n][0],i[n][1])},e}(xD);function Q5(t,e,i,n,r){var o=t.ends,s=new Y5({shape:{points:r?K5(o,n,t):o}});return J5(t,s,e,i,r),s}function J5(t,e,i,n,r){var o=i.hostModel;(0,cN[r?"initProps":"updateProps"])(e,{shape:{points:t.ends}},o,n),e.useStyle(i.getItemVisual(n,"style")),e.style.strokeNoScale=!0,e.z2=100;var s=i.getItemModel(n),a=s.getModel("emphasis");JR(e,s),XR(e,a.get("focus"),a.get("blurScope"),a.get("disabled"))}function K5(t,e,i){return vE(t,(function(t){return(t=t.slice())[e]=i.initBaseline,t}))}var $5=X5,t4=yE;function e4(t){var e=function(t){var e=[],i=[];return t.eachSeriesByType("boxplot",(function(t){var n=t.getBaseAxis(),r=fE(i,n);r<0&&(r=i.length,i[r]=n,e[r]={axis:n,seriesModels:[]}),e[r].seriesModels.push(t)})),e}(t);t4(e,(function(t){var e=t.seriesModels;e.length&&(!function(t){var e,i=t.axis,n=t.seriesModels,r=n.length,o=t.boxWidthList=[],s=t.boxOffsetList=[],a=[];if("category"===i.type)e=i.getBandWidth();else{var l=0;t4(n,(function(t){l=Math.max(l,t.getData().count())}));var c=i.getExtent();e=Math.abs(c[1]-c[0])/l}t4(n,(function(t){var i=t.get("boxWidth");EE(i)||(i=[i,i]),a.push([IC(i[0],e)||0,IC(i[1],e)||0])}));var u=.8*e-2,h=u/r*.3,p=(u-h*(r-1))/r,d=p/2-u/2;t4(n,(function(t,e){s.push(d),d+=h+p,o.push(Math.min(Math.max(p,a[e][0]),a[e][1]))}))}(t),t4(e,(function(e,i){!function(t,e,i){var n=t.coordinateSystem,r=t.getData(),o=i/2,s="horizontal"===t.get("layout")?0:1,a=1-s,l=["x","y"],c=r.mapDimension(l[s]),u=r.mapDimensionsAll(l[a]);if(null==c||u.length<5)return;for(var h=0;h<r.count();h++){var p=r.get(c,h),d=_(p,u[2],h),f=_(p,u[0],h),m=_(p,u[1],h),g=_(p,u[3],h),y=_(p,u[4],h),v=[];x(v,m,!1),x(v,g,!0),v.push(f,m,y,g),b(v,f),b(v,y),b(v,d),r.setItemLayout(h,{initBaseline:d[a],ends:v})}function _(t,i,o){var l,c=r.get(i,o),u=[];return u[s]=t,u[a]=c,isNaN(t)||isNaN(c)?l=[NaN,NaN]:(l=n.dataToPoint(u))[s]+=e,l}function x(t,e,i){var n=e.slice(),r=e.slice();n[s]+=o,r[s]-=o,i?t.push(n,r):t.push(r,n)}function b(t,e){var i=e.slice(),n=e.slice();i[s]-=o,n[s]+=o,t.push(i,n)}}(e,t.boxOffsetList[i],t.boxWidthList[i])})))}))}var i4={type:"echarts:boxplot",transform:function(t){var e=t.upstream;if(e.sourceFormat!==ez){var i="";"production"!==process.env.NODE_ENV&&(i=nP("source data is not applicable for this boxplot transform. Expect number[][].")),rP(i)}var n=function(t,e){for(var i=[],n=[],r=(e=e||{}).boundIQR,o="none"===r||0===r,s=0;s<t.length;s++){var a=PC(t[s].slice()),l=GC(a,.25),c=GC(a,.5),u=GC(a,.75),h=a[0],p=a[a.length-1],d=(null==r?1.5:r)*(u-l),f=o?h:Math.max(h,l-d),m=o?p:Math.min(p,u+d),g=e.itemNameFormatter,y=SE(g)?g({value:s}):ME(g)?g.replace("{value}",s+""):s+"";i.push([y,f,l,c,u,m]);for(var v=0;v<a.length;v++){var _=a[v];if(_<f||_>m){var x=[y,_];n.push(x)}}}return{boxData:i,outliers:n}}(e.getRawData(),t.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:n.boxData},{data:n.outliers}]}};var n4=["color","borderColor"],r4=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.render=function(t,e,i){this.group.removeClipPath(),this._progressiveEls=null,this._updateDrawMode(t),this._isLargeDraw?this._renderLarge(t):this._renderNormal(t)},e.prototype.incrementalPrepareRender=function(t,e,i){this._clear(),this._updateDrawMode(t)},e.prototype.incrementalRender=function(t,e,i,n){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(t,e):this._incrementalRenderNormal(t,e)},e.prototype.eachRendered=function(t){lN(this._progressiveEls||this.group,t)},e.prototype._updateDrawMode=function(t){var e=t.pipelineContext.large;null!=this._isLargeDraw&&e===this._isLargeDraw||(this._isLargeDraw=e,this._clear())},e.prototype._renderNormal=function(t){var e=t.getData(),i=this._data,n=this.group,r=e.getLayout("isSimpleBox"),o=t.get("clip",!0),s=t.coordinateSystem,a=s.getArea&&s.getArea();this._data||n.removeAll(),e.diff(i).add((function(i){if(e.hasValue(i)){var s=e.getItemLayout(i);if(o&&l4(a,s))return;var l=a4(s,i,!0);Lk(l,{shape:{points:s.ends}},t,i),c4(l,e,i,r),n.add(l),e.setItemGraphicEl(i,l)}})).update((function(s,l){var c=i.getItemGraphicEl(l);if(e.hasValue(s)){var u=e.getItemLayout(s);o&&l4(a,u)?n.remove(c):(c?(Pk(c,{shape:{points:u.ends}},t,s),Nk(c)):c=a4(u),c4(c,e,s,r),n.add(c),e.setItemGraphicEl(s,c))}else n.remove(c)})).remove((function(t){var e=i.getItemGraphicEl(t);e&&n.remove(e)})).execute(),this._data=e},e.prototype._renderLarge=function(t){this._clear(),d4(t,this.group);var e=t.get("clip",!0)?nY(t.coordinateSystem,!1,t):null;e?this.group.setClipPath(e):this.group.removeClipPath()},e.prototype._incrementalRenderNormal=function(t,e){for(var i,n=e.getData(),r=n.getLayout("isSimpleBox");null!=(i=t.next());){var o=a4(n.getItemLayout(i));c4(o,n,i,r),o.incremental=!0,this.group.add(o),this._progressiveEls.push(o)}},e.prototype._incrementalRenderLarge=function(t,e){d4(e,this.group,this._progressiveEls,!0)},e.prototype.remove=function(t){this._clear()},e.prototype._clear=function(){this.group.removeAll(),this._data=null},e.type="candlestick",e}(iU),o4=function(){},s4=function(t){function e(e){var i=t.call(this,e)||this;return i.type="normalCandlestickBox",i}return zA(e,t),e.prototype.getDefaultShape=function(){return new o4},e.prototype.buildPath=function(t,e){var i=e.points;this.__simpleBox?(t.moveTo(i[4][0],i[4][1]),t.lineTo(i[6][0],i[6][1])):(t.moveTo(i[0][0],i[0][1]),t.lineTo(i[1][0],i[1][1]),t.lineTo(i[2][0],i[2][1]),t.lineTo(i[3][0],i[3][1]),t.closePath(),t.moveTo(i[4][0],i[4][1]),t.lineTo(i[5][0],i[5][1]),t.moveTo(i[6][0],i[6][1]),t.lineTo(i[7][0],i[7][1]))},e}(xD);function a4(t,e,i){var n=t.ends;return new s4({shape:{points:i?u4(n,t):n},z2:100})}function l4(t,e){for(var i=!0,n=0;n<e.ends.length;n++)if(t.contain(e.ends[n][0],e.ends[n][1])){i=!1;break}return i}function c4(t,e,i,n){var r=e.getItemModel(i);t.useStyle(e.getItemVisual(i,"style")),t.style.strokeNoScale=!0,t.__simpleBox=n,JR(t,r)}function u4(t,e){return vE(t,(function(t){return(t=t.slice())[1]=e.initBaseline,t}))}var h4=function(){},p4=function(t){function e(e){var i=t.call(this,e)||this;return i.type="largeCandlestickBox",i}return zA(e,t),e.prototype.getDefaultShape=function(){return new h4},e.prototype.buildPath=function(t,e){for(var i=e.points,n=0;n<i.length;)if(this.__sign===i[n++]){var r=i[n++];t.moveTo(r,i[n++]),t.lineTo(r,i[n++])}else n+=3},e}(xD);function d4(t,e,i,n){var r=t.getData().getLayout("largePoints"),o=new p4({shape:{points:r},__sign:1,ignoreCoarsePointer:!0});e.add(o);var s=new p4({shape:{points:r},__sign:-1,ignoreCoarsePointer:!0});e.add(s);var a=new p4({shape:{points:r},__sign:0,ignoreCoarsePointer:!0});e.add(a),f4(1,o,t),f4(-1,s,t),f4(0,a,t),n&&(o.incremental=!0,s.incremental=!0),i&&i.push(o,s)}function f4(t,e,i,n){var r=i.get(["itemStyle",t>0?"borderColor":"borderColor0"])||i.get(["itemStyle",t>0?"color":"color0"]);0===t&&(r=i.get(["itemStyle","borderColorDoji"]));var o=i.getModel("itemStyle").getItemStyle(n4);e.useStyle(o),e.style.fill=null,e.style.stroke=r}var m4=r4,g4=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.defaultValueDimensions=[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],i}return zA(e,t),e.prototype.getShadowDim=function(){return"open"},e.prototype.brushSelector=function(t,e,i){var n=e.getItemLayout(t);return n&&i.rect(n.brushRect)},e.type="series.candlestick",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,clip:!0,itemStyle:{color:"#eb5454",color0:"#47b262",borderColor:"#eb5454",borderColor0:"#47b262",borderColorDoji:null,borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationEasing:"linear",animationDuration:300},e}(HV);mE(g4,H5,!0);var y4=g4;function v4(t){t&&EE(t.series)&&yE(t.series,(function(t){CE(t)&&"k"===t.type&&(t.type="candlestick")}))}var _4=["itemStyle","borderColor"],x4=["itemStyle","borderColor0"],b4=["itemStyle","borderColorDoji"],w4=["itemStyle","color"],A4=["itemStyle","color0"],E4={seriesType:"candlestick",plan:XV(),performRawSeries:!0,reset:function(t,e){function i(t,e){return e.get(t>0?w4:A4)}function n(t,e){return e.get(0===t?b4:t>0?_4:x4)}if(!e.isSeriesFiltered(t))return!t.pipelineContext.large&&{progress:function(t,e){for(var r;null!=(r=t.next());){var o=e.getItemModel(r),s=e.getItemLayout(r).sign,a=o.getItemStyle();a.fill=i(s,o),a.stroke=n(s,o)||a.fill,pE(e.ensureUniqueItemVisual(r,"style"),a)}}}}},S4=E4,M4={seriesType:"candlestick",plan:XV(),reset:function(t){var e=t.coordinateSystem,i=t.getData(),n=function(t,e){var i,n=t.getBaseAxis(),r="category"===n.type?n.getBandWidth():(i=n.getExtent(),Math.abs(i[1]-i[0])/e.count()),o=IC(BE(t.get("barMaxWidth"),r),r),s=IC(BE(t.get("barMinWidth"),1),r),a=t.get("barWidth");return null!=a?IC(a,r):Math.max(Math.min(r/2,o),s)}(t,i),r=["x","y"],o=i.getDimensionIndex(i.mapDimension(r[0])),s=vE(i.mapDimensionsAll(r[1]),i.getDimensionIndex,i),a=s[0],l=s[1],c=s[2],u=s[3];if(i.setLayout({candleWidth:n,isSimpleBox:n<=1.3}),!(o<0||s.length<4))return{progress:t.pipelineContext.large?function(i,n){var r,s,h=aW(4*i.count),p=0,d=[],f=[],m=n.getStore(),g=!!t.get(["itemStyle","borderColorDoji"]);for(;null!=(s=i.next());){var y=m.get(o,s),v=m.get(a,s),_=m.get(l,s),x=m.get(c,s),b=m.get(u,s);isNaN(y)||isNaN(x)||isNaN(b)?(h[p++]=NaN,p+=3):(h[p++]=T4(m,s,v,_,l,g),d[0]=y,d[1]=x,r=e.dataToPoint(d,null,f),h[p++]=r?r[0]:NaN,h[p++]=r?r[1]:NaN,d[1]=b,r=e.dataToPoint(d,null,f),h[p++]=r?r[1]:NaN)}n.setLayout("largePoints",h)}:function(t,i){var r,s=i.getStore();for(;null!=(r=t.next());){var h=s.get(o,r),p=s.get(a,r),d=s.get(l,r),f=s.get(c,r),m=s.get(u,r),g=Math.min(p,d),y=Math.max(p,d),v=E(g,h),_=E(y,h),x=E(f,h),b=E(m,h),w=[];S(w,_,0),S(w,v,1),w.push(T(b),T(_),T(x),T(v));var A=!!i.getItemModel(r).get(["itemStyle","borderColorDoji"]);i.setItemLayout(r,{sign:T4(s,r,p,d,l,A),initBaseline:p>d?_[1]:v[1],ends:w,brushRect:M(f,m,h)})}function E(t,i){var n=[];return n[0]=i,n[1]=t,isNaN(i)||isNaN(t)?[NaN,NaN]:e.dataToPoint(n)}function S(t,e,i){var r=e.slice(),o=e.slice();r[0]=Yk(r[0]+n/2,1,!1),o[0]=Yk(o[0]-n/2,1,!0),i?t.push(r,o):t.push(o,r)}function M(t,e,i){var r=E(t,i),o=E(e,i);return r[0]-=n/2,o[0]-=n/2,{x:r[0],y:r[1],width:n,height:o[1]-r[1]}}function T(t){return t[0]=Yk(t[0],1),t}}}}};function T4(t,e,i,n,r,o){return i>n?-1:i<n?1:o?0:e>0?t.get(r,e-1)<=n?1:-1:1}var I4=M4;function C4(t,e){var i=e.rippleEffectColor||e.color;t.eachChild((function(t){t.attr({z:e.z,zlevel:e.zlevel,style:{stroke:"stroke"===e.brushType?i:null,fill:"fill"===e.brushType?i:null}})}))}var P4=function(t){function e(e,i){var n=t.call(this)||this,r=new FZ(e,i),o=new xC;return n.add(r),n.add(o),n.updateData(e,i),n}return zA(e,t),e.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},e.prototype.startEffectAnimation=function(t){for(var e=t.symbolType,i=t.color,n=t.rippleNumber,r=this.childAt(1),o=0;o<n;o++){var s=pG(e,-1,-1,2,2,i);s.attr({style:{strokeNoScale:!0},z2:99,silent:!0,scaleX:.5,scaleY:.5});var a=-o/n*t.period+t.effectOffset;s.animate("",!0).when(t.period,{scaleX:t.rippleScale/2,scaleY:t.rippleScale/2}).delay(a).start(),s.animateStyle(!0).when(t.period,{opacity:0}).delay(a).start(),r.add(s)}C4(r,t)},e.prototype.updateEffectAnimation=function(t){for(var e=this._effectCfg,i=this.childAt(1),n=["symbolType","period","rippleScale","rippleNumber"],r=0;r<n.length;r++){var o=n[r];if(e[o]!==t[o])return this.stopEffectAnimation(),void this.startEffectAnimation(t)}C4(i,t)},e.prototype.highlight=function(){RR(this)},e.prototype.downplay=function(){OR(this)},e.prototype.getSymbolType=function(){var t=this.childAt(0);return t&&t.getSymbolType()},e.prototype.updateData=function(t,e){var i=this,n=t.hostModel;this.childAt(0).updateData(t,e);var r=this.childAt(1),o=t.getItemModel(e),s=t.getItemVisual(e,"symbol"),a=dG(t.getItemVisual(e,"symbolSize")),l=t.getItemVisual(e,"style"),c=l&&l.fill,u=o.getModel("emphasis");r.setScale(a),r.traverse((function(t){t.setStyle("fill",c)}));var h=fG(t.getItemVisual(e,"symbolOffset"),a);h&&(r.x=h[0],r.y=h[1]);var p=t.getItemVisual(e,"symbolRotate");r.rotation=(p||0)*Math.PI/180||0;var d={};d.showEffectOn=n.get("showEffectOn"),d.rippleScale=o.get(["rippleEffect","scale"]),d.brushType=o.get(["rippleEffect","brushType"]),d.period=1e3*o.get(["rippleEffect","period"]),d.effectOffset=e/t.count(),d.z=n.getShallow("z")||0,d.zlevel=n.getShallow("zlevel")||0,d.symbolType=s,d.color=c,d.rippleEffectColor=o.get(["rippleEffect","color"]),d.rippleNumber=o.get(["rippleEffect","number"]),"render"===d.showEffectOn?(this._effectCfg?this.updateEffectAnimation(d):this.startEffectAnimation(d),this._effectCfg=d):(this._effectCfg=null,this.stopEffectAnimation(),this.onHoverStateChange=function(t){"emphasis"===t?"render"!==d.showEffectOn&&i.startEffectAnimation(d):"normal"===t&&"render"!==d.showEffectOn&&i.stopEffectAnimation()}),this._effectCfg=d,XR(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},e.prototype.fadeOut=function(t){t&&t()},e}(xC),L4=P4,D4=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.init=function(){this._symbolDraw=new HZ(L4)},e.prototype.render=function(t,e,i){var n=t.getData(),r=this._symbolDraw;r.updateData(n,{clipShape:this._getClipShape(t)}),this.group.add(r.group)},e.prototype._getClipShape=function(t){var e=t.coordinateSystem,i=e&&e.getArea&&e.getArea();return t.get("clip",!0)?i:null},e.prototype.updateTransform=function(t,e,i){var n=t.getData();this.group.dirty();var r=yY("").reset(t,e,i);r.progress&&r.progress({start:0,end:n.count(),count:n.count()},n),this._symbolDraw.updateLayout()},e.prototype._updateGroupTransform=function(t){var e=t.coordinateSystem;e&&e.getRoamTransform&&(this.group.transform=function(t){var e=[1,0,0,1,0,0];return YS(e,t),e}(e.getRoamTransform()),this.group.decomposeTransform())},e.prototype.remove=function(t,e){this._symbolDraw&&this._symbolDraw.remove(!0)},e.type="effectScatter",e}(iU),R4=D4,O4=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.hasSymbolVisual=!0,i}return zA(e,t),e.prototype.getInitialData=function(t,e){return FH(null,this,{useEncodeDefaulter:!0})},e.prototype.brushSelector=function(t,e,i){return i.point(e.getItemLayout(t))},e.type="series.effectScatter",e.dependencies=["grid","polar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,effectType:"ripple",progressive:0,showEffectOn:"render",clip:!0,rippleEffect:{period:4,scale:2.5,brushType:"fill",number:3},universalTransition:{divideShape:"clone"},symbolSize:10},e}(HV),k4=O4;var N4=function(t){function e(e,i,n){var r=t.call(this)||this;return r.add(r.createLine(e,i,n)),r._updateEffectSymbol(e,i),r}return zA(e,t),e.prototype.createLine=function(t,e,i){return new $1(t,e,i)},e.prototype._updateEffectSymbol=function(t,e){var i=t.getItemModel(e).getModel("effect"),n=i.get("symbolSize"),r=i.get("symbol");EE(n)||(n=[n,n]);var o=t.getItemVisual(e,"style"),s=i.get("color")||o&&o.stroke,a=this.childAt(1);this._symbolType!==r&&(this.remove(a),(a=pG(r,-.5,-.5,1,1,s)).z2=100,a.culling=!0,this.add(a)),a&&(a.setStyle("shadowColor",s),a.setStyle(i.getItemStyle(["color"])),a.scaleX=n[0],a.scaleY=n[1],a.setColor(s),this._symbolType=r,this._symbolScale=n,this._updateEffectAnimation(t,i,e))},e.prototype._updateEffectAnimation=function(t,e,i){var n=this.childAt(1);if(n){var r=t.getItemLayout(i),o=1e3*e.get("period"),s=e.get("loop"),a=e.get("roundTrip"),l=e.get("constantSpeed"),c=NE(e.get("delay"),(function(e){return e/t.count()*o/3}));if(n.ignore=!0,this._updateAnimationPoints(n,r),l>0&&(o=this._getLineLength(n)/l*1e3),o!==this._period||s!==this._loop||a!==this._roundTrip){n.stopAnimation();var u=void 0;u=SE(c)?c(i):c,n.__t>0&&(u=-o*n.__t),this._animateSymbol(n,o,u,s,a)}this._period=o,this._loop=s,this._roundTrip=a}},e.prototype._animateSymbol=function(t,e,i,n,r){if(e>0){t.__t=0;var o=this,s=t.animate("",n).when(r?2*e:e,{__t:r?2:1}).delay(i).during((function(){o._updateSymbolPosition(t)}));n||s.done((function(){o.remove(t)})),s.start()}},e.prototype._getLineLength=function(t){return dS(t.__p1,t.__cp1)+dS(t.__cp1,t.__p2)},e.prototype._updateAnimationPoints=function(t,e){t.__p1=e[0],t.__p2=e[1],t.__cp1=e[2]||[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]},e.prototype.updateData=function(t,e,i){this.childAt(0).updateData(t,e,i),this._updateEffectSymbol(t,e)},e.prototype._updateSymbolPosition=function(t){var e=t.__p1,i=t.__p2,n=t.__cp1,r=t.__t<1?t.__t:2-t.__t,o=[t.x,t.y],s=o.slice(),a=sT,l=aT;o[0]=a(e[0],n[0],i[0],r),o[1]=a(e[1],n[1],i[1],r);var c=t.__t<1?l(e[0],n[0],i[0],r):l(i[0],n[0],e[0],1-r),u=t.__t<1?l(e[1],n[1],i[1],r):l(i[1],n[1],e[1],1-r);t.rotation=-Math.atan2(u,c)-Math.PI/2,"line"!==this._symbolType&&"rect"!==this._symbolType&&"roundRect"!==this._symbolType||(void 0!==t.__lastT&&t.__lastT<t.__t?(t.scaleY=1.05*dS(s,o),1===r&&(o[0]=s[0]+(o[0]-s[0])/2,o[1]=s[1]+(o[1]-s[1])/2)):1===t.__lastT?t.scaleY=2*dS(e,o):t.scaleY=this._symbolScale[1]),t.__lastT=t.__t,t.ignore=!1,t.x=o[0],t.y=o[1]},e.prototype.updateLayout=function(t,e){this.childAt(0).updateLayout(t,e);var i=t.getItemModel(e).getModel("effect");this._updateEffectAnimation(t,i,e)},e}(xC),B4=N4,z4=function(t){function e(e,i,n){var r=t.call(this)||this;return r._createPolyline(e,i,n),r}return zA(e,t),e.prototype._createPolyline=function(t,e,i){var n=t.getItemLayout(e),r=new $O({shape:{points:n}});this.add(r),this._updateCommonStl(t,e,i)},e.prototype.updateData=function(t,e,i){var n=t.hostModel;Pk(this.childAt(0),{shape:{points:t.getItemLayout(e)}},n,e),this._updateCommonStl(t,e,i)},e.prototype._updateCommonStl=function(t,e,i){var n=this.childAt(0),r=t.getItemModel(e),o=i&&i.emphasisLineStyle,s=i&&i.focus,a=i&&i.blurScope,l=i&&i.emphasisDisabled;if(!i||t.hasItemOption){var c=r.getModel("emphasis");o=c.getModel("lineStyle").getLineStyle(),l=c.get("disabled"),s=c.get("focus"),a=c.get("blurScope")}n.useStyle(t.getItemVisual(e,"style")),n.style.fill=null,n.style.strokeNoScale=!0,n.ensureState("emphasis").style=o,XR(this,s,a,l)},e.prototype.updateLayout=function(t,e){this.childAt(0).setShape("points",t.getItemLayout(e))},e}(xC),F4=z4,V4=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._lastFrame=0,e._lastFramePercent=0,e}return zA(e,t),e.prototype.createLine=function(t,e,i){return new F4(t,e,i)},e.prototype._updateAnimationPoints=function(t,e){this._points=e;for(var i=[0],n=0,r=1;r<e.length;r++){var o=e[r-1],s=e[r];n+=dS(o,s),i.push(n)}if(0!==n){for(r=0;r<i.length;r++)i[r]/=n;this._offsets=i,this._length=n}else this._length=0},e.prototype._getLineLength=function(){return this._length},e.prototype._updateSymbolPosition=function(t){var e=t.__t<1?t.__t:2-t.__t,i=this._points,n=this._offsets,r=i.length;if(n){var o,s=this._lastFrame;if(e<this._lastFramePercent){for(o=Math.min(s+1,r-1);o>=0&&!(n[o]<=e);o--);o=Math.min(o,r-2)}else{for(o=s;o<r&&!(n[o]>e);o++);o=Math.min(o-1,r-2)}var a=(e-n[o])/(n[o+1]-n[o]),l=i[o],c=i[o+1];t.x=l[0]*(1-a)+a*c[0],t.y=l[1]*(1-a)+a*c[1];var u=t.__t<1?c[0]-l[0]:l[0]-c[0],h=t.__t<1?c[1]-l[1]:l[1]-c[1];t.rotation=-Math.atan2(h,u)-Math.PI/2,this._lastFrame=o,this._lastFramePercent=e,t.ignore=!1}},e}(B4),U4=V4,G4=function(){this.polyline=!1,this.curveness=0,this.segs=[]},j4=function(t){function e(e){var i=t.call(this,e)||this;return i._off=0,i.hoverDataIdx=-1,i}return zA(e,t),e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new G4},e.prototype.buildPath=function(t,e){var i,n=e.segs,r=e.curveness;if(e.polyline)for(i=this._off;i<n.length;){var o=n[i++];if(o>0){t.moveTo(n[i++],n[i++]);for(var s=1;s<o;s++)t.lineTo(n[i++],n[i++])}}else for(i=this._off;i<n.length;){var a=n[i++],l=n[i++],c=n[i++],u=n[i++];if(t.moveTo(a,l),r>0){var h=(a+c)/2-(l-u)*r,p=(l+u)/2-(c-a)*r;t.quadraticCurveTo(h,p,c,u)}else t.lineTo(c,u)}this.incremental&&(this._off=i,this.notClear=!0)},e.prototype.findDataIndex=function(t,e){var i=this.shape,n=i.segs,r=i.curveness,o=this.style.lineWidth;if(i.polyline)for(var s=0,a=0;a<n.length;){var l=n[a++];if(l>0)for(var c=n[a++],u=n[a++],h=1;h<l;h++){if($L(c,u,p=n[a++],d=n[a++],o,t,e))return s}s++}else for(s=0,a=0;a<n.length;){c=n[a++],u=n[a++];var p=n[a++],d=n[a++];if(r>0){if(eD(c,u,(c+p)/2-(u-d)*r,(u+d)/2-(p-c)*r,p,d,o,t,e))return s}else if($L(c,u,p,d,o,t,e))return s;s++}return-1},e.prototype.contain=function(t,e){var i=this.transformCoordToLocal(t,e),n=this.getBoundingRect();return t=i[0],e=i[1],n.contain(t,e)?(this.hoverDataIdx=this.findDataIndex(t,e))>=0:(this.hoverDataIdx=-1,!1)},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var e=this.shape.segs,i=1/0,n=1/0,r=-1/0,o=-1/0,s=0;s<e.length;){var a=e[s++],l=e[s++];i=Math.min(a,i),r=Math.max(a,r),n=Math.min(l,n),o=Math.max(l,o)}t=this._rect=new pM(i,n,r,o)}return t},e}(xD),H4=function(){function t(){this.group=new xC}return t.prototype.updateData=function(t){this._clear();var e=this._create();e.setShape({segs:t.getLayout("linesPoints")}),this._setCommon(e,t)},t.prototype.incrementalPrepareUpdate=function(t){this.group.removeAll(),this._clear()},t.prototype.incrementalUpdate=function(t,e){var i=this._newAdded[0],n=e.getLayout("linesPoints"),r=i&&i.shape.segs;if(r&&r.length<2e4){var o=r.length,s=new Float32Array(o+n.length);s.set(r),s.set(n,o),i.setShape({segs:s})}else{this._newAdded=[];var a=this._create();a.incremental=!0,a.setShape({segs:n}),this._setCommon(a,e),a.__startIndex=t.start}},t.prototype.remove=function(){this._clear()},t.prototype.eachRendered=function(t){this._newAdded[0]&&t(this._newAdded[0])},t.prototype._create=function(){var t=new j4({cursor:"default",ignoreCoarsePointer:!0});return this._newAdded.push(t),this.group.add(t),t},t.prototype._setCommon=function(t,e,i){var n=e.hostModel;t.setShape({polyline:n.get("polyline"),curveness:n.get(["lineStyle","curveness"])}),t.useStyle(n.getModel("lineStyle").getLineStyle()),t.style.strokeNoScale=!0;var r=e.getVisual("style");r&&r.stroke&&t.setStyle("stroke",r.stroke),t.setStyle("fill",null);var o=KD(t);o.seriesIndex=n.seriesIndex,t.on("mousemove",(function(e){o.dataIndex=null;var i=t.hoverDataIdx;i>0&&(o.dataIndex=i+t.__startIndex)}))},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}(),W4={seriesType:"lines",plan:XV(),reset:function(t){var e=t.coordinateSystem;if(e){var i=t.get("polyline"),n=t.pipelineContext.large;return{progress:function(r,o){var s=[];if(n){var a=void 0,l=r.end-r.start;if(i){for(var c=0,u=r.start;u<r.end;u++)c+=t.getLineCoordsCount(u);a=new Float32Array(l+2*c)}else a=new Float32Array(4*l);var h=0,p=[];for(u=r.start;u<r.end;u++){var d=t.getLineCoords(u,s);i&&(a[h++]=d);for(var f=0;f<d;f++)p=e.dataToPoint(s[f],!1,p),a[h++]=p[0],a[h++]=p[1]}o.setLayout("linesPoints",a)}else for(u=r.start;u<r.end;u++){var m=o.getItemModel(u),g=(d=t.getLineCoords(u,s),[]);if(i)for(var y=0;y<d;y++)g.push(e.dataToPoint(s[y]));else{g[0]=e.dataToPoint(s[0]),g[1]=e.dataToPoint(s[1]);var v=m.get(["lineStyle","curveness"]);+v&&(g[2]=[(g[0][0]+g[1][0])/2-(g[0][1]-g[1][1])*v,(g[0][1]+g[1][1])/2-(g[1][0]-g[0][0])*v])}o.setItemLayout(u,g)}}}}"production"!==process.env.NODE_ENV&&tP("The lines series must have a coordinate system.")}},q4=W4,X4=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.render=function(t,e,i){var n=t.getData(),r=this._updateLineDraw(n,t),o=t.get("zlevel"),s=t.get(["effect","trailLength"]),a=i.getZr(),l="svg"===a.painter.getType();l||a.painter.getLayer(o).clear(!0),null==this._lastZlevel||l||a.configLayer(this._lastZlevel,{motionBlur:!1}),this._showEffect(t)&&s>0&&(l?"production"!==process.env.NODE_ENV&&console.warn("SVG render mode doesn't support lines with trail effect"):a.configLayer(o,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(s/10+.9,1),0)})),r.updateData(n);var c=t.get("clip",!0)&&nY(t.coordinateSystem,!1,t);c?this.group.setClipPath(c):this.group.removeClipPath(),this._lastZlevel=o,this._finished=!0},e.prototype.incrementalPrepareRender=function(t,e,i){var n=t.getData();this._updateLineDraw(n,t).incrementalPrepareUpdate(n),this._clearLayer(i),this._finished=!1},e.prototype.incrementalRender=function(t,e,i){this._lineDraw.incrementalUpdate(t,e.getData()),this._finished=t.end===e.getData().count()},e.prototype.eachRendered=function(t){this._lineDraw&&this._lineDraw.eachRendered(t)},e.prototype.updateTransform=function(t,e,i){var n=t.getData(),r=t.pipelineContext;if(!this._finished||r.large||r.progressiveRender)return{update:!0};var o=q4.reset(t,e,i);o.progress&&o.progress({start:0,end:n.count(),count:n.count()},n),this._lineDraw.updateLayout(),this._clearLayer(i)},e.prototype._updateLineDraw=function(t,e){var i=this._lineDraw,n=this._showEffect(e),r=!!e.get("polyline"),o=e.pipelineContext.large;return"production"!==process.env.NODE_ENV&&n&&o&&console.warn("Large lines not support effect"),i&&n===this._hasEffet&&r===this._isPolyline&&o===this._isLargeDraw||(i&&i.remove(),i=this._lineDraw=o?new H4:new n2(r?n?U4:F4:n?B4:$1),this._hasEffet=n,this._isPolyline=r,this._isLargeDraw=o),this.group.add(i.group),i},e.prototype._showEffect=function(t){return!!t.get(["effect","show"])},e.prototype._clearLayer=function(t){var e=t.getZr();"svg"===e.painter.getType()||null==this._lastZlevel||e.painter.getLayer(this._lastZlevel).clear(!0)},e.prototype.remove=function(t,e){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(e)},e.prototype.dispose=function(t,e){this.remove(t,e)},e.type="lines",e}(iU),Z4=X4,Y4="undefined"==typeof Uint32Array?Array:Uint32Array,Q4="undefined"==typeof Float64Array?Array:Float64Array;function J4(t){var e=t.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&("production"!==process.env.NODE_ENV&&console.warn("Lines data configuration has been changed to { coords:[[1,2],[2,3]] }"),t.data=vE(e,(function(t){var e={coords:[t[0].coord,t[1].coord]};return t[0].name&&(e.fromName=t[0].name),t[1].name&&(e.toName=t[1].name),hE([e,t[0],t[1]])})))}var K4=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.visualStyleAccessPath="lineStyle",i.visualDrawType="stroke",i}return zA(e,t),e.prototype.init=function(e){e.data=e.data||[],J4(e);var i=this._processFlatCoordsArray(e.data);this._flatCoords=i.flatCoords,this._flatCoordsOffset=i.flatCoordsOffset,i.flatCoords&&(e.data=new Float32Array(i.count)),t.prototype.init.apply(this,arguments)},e.prototype.mergeOption=function(e){if(J4(e),e.data){var i=this._processFlatCoordsArray(e.data);this._flatCoords=i.flatCoords,this._flatCoordsOffset=i.flatCoordsOffset,i.flatCoords&&(e.data=new Float32Array(i.count))}t.prototype.mergeOption.apply(this,arguments)},e.prototype.appendData=function(t){var e=this._processFlatCoordsArray(t.data);e.flatCoords&&(this._flatCoords?(this._flatCoords=QE(this._flatCoords,e.flatCoords),this._flatCoordsOffset=QE(this._flatCoordsOffset,e.flatCoordsOffset)):(this._flatCoords=e.flatCoords,this._flatCoordsOffset=e.flatCoordsOffset),t.data=new Float32Array(e.count)),this.getRawData().appendData(t.data)},e.prototype._getCoordsFromItemModel=function(t){var e=this.getData().getItemModel(t),i=e.option instanceof Array?e.option:e.getShallow("coords");if("production"!==process.env.NODE_ENV&&!(i instanceof Array&&i.length>0&&i[0]instanceof Array))throw new Error("Invalid coords "+JSON.stringify(i)+". Lines must have 2d coords array in data item.");return i},e.prototype.getLineCoordsCount=function(t){return this._flatCoordsOffset?this._flatCoordsOffset[2*t+1]:this._getCoordsFromItemModel(t).length},e.prototype.getLineCoords=function(t,e){if(this._flatCoordsOffset){for(var i=this._flatCoordsOffset[2*t],n=this._flatCoordsOffset[2*t+1],r=0;r<n;r++)e[r]=e[r]||[],e[r][0]=this._flatCoords[i+2*r],e[r][1]=this._flatCoords[i+2*r+1];return n}var o=this._getCoordsFromItemModel(t);for(r=0;r<o.length;r++)e[r]=e[r]||[],e[r][0]=o[r][0],e[r][1]=o[r][1];return o.length},e.prototype._processFlatCoordsArray=function(t){var e=0;if(this._flatCoords&&(e=this._flatCoords.length),IE(t[0])){for(var i=t.length,n=new Y4(i),r=new Q4(i),o=0,s=0,a=0,l=0;l<i;){a++;var c=t[l++];n[s++]=o+e,n[s++]=c;for(var u=0;u<c;u++){var h=t[l++],p=t[l++];if(r[o++]=h,r[o++]=p,l>i&&"production"!==process.env.NODE_ENV)throw new Error("Invalid data format.")}}return{flatCoordsOffset:new Uint32Array(n.buffer,0,s),flatCoords:r,count:a}}return{flatCoordsOffset:null,flatCoords:null,count:t.length}},e.prototype.getInitialData=function(t,e){if("production"!==process.env.NODE_ENV&&!Bz.get(t.coordinateSystem))throw new Error("Unknown coordinate system "+t.coordinateSystem);var i=new PH(["value"],this);return i.hasItemOption=!1,i.initData(t.data,[],(function(t,e,n,r){if(t instanceof Array)return NaN;i.hasItemOption=!0;var o=t.value;return null!=o?o instanceof Array?o[r]:o:void 0})),i},e.prototype.formatTooltip=function(t,e,i){var n=this.getData().getItemModel(t),r=n.get("name");if(r)return r;var o=n.get("fromName"),s=n.get("toName"),a=[];return null!=o&&a.push(o),null!=s&&a.push(s),xV("nameValue",{name:a.join(" > ")})},e.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},e.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?1e4:this.get("progressive"):t},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?2e4:this.get("progressiveThreshold"):t},e.prototype.getZLevelKey=function(){var t=this.getModel("effect"),e=t.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:t.get("show")&&e>0?e+"":""},e.type="series.lines",e.dependencies=["grid","polar","geo","calendar"],e.defaultOption={coordinateSystem:"geo",z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},e}(HV),$4=K4;function t6(t){return t instanceof Array||(t=[t,t]),t}var e6={seriesType:"lines",reset:function(t){var e=t6(t.get("symbol")),i=t6(t.get("symbolSize")),n=t.getData();return n.setVisual("fromSymbol",e&&e[0]),n.setVisual("toSymbol",e&&e[1]),n.setVisual("fromSymbolSize",i&&i[0]),n.setVisual("toSymbolSize",i&&i[1]),{dataEach:n.hasItemOption?function(t,e){var i=t.getItemModel(e),n=t6(i.getShallow("symbol",!0)),r=t6(i.getShallow("symbolSize",!0));n[0]&&t.setItemVisual(e,"fromSymbol",n[0]),n[1]&&t.setItemVisual(e,"toSymbol",n[1]),r[0]&&t.setItemVisual(e,"fromSymbolSize",r[0]),r[1]&&t.setItemVisual(e,"toSymbolSize",r[1])}:null}}};var i6=function(){function t(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var t=ZA.createCanvas();this.canvas=t}return t.prototype.update=function(t,e,i,n,r,o){var s=this._getBrush(),a=this._getGradient(r,"inRange"),l=this._getGradient(r,"outOfRange"),c=this.pointSize+this.blurSize,u=this.canvas,h=u.getContext("2d"),p=t.length;u.width=e,u.height=i;for(var d=0;d<p;++d){var f=t[d],m=f[0],g=f[1],y=n(f[2]);h.globalAlpha=y,h.drawImage(s,m-c,g-c)}if(!u.width||!u.height)return u;for(var v=h.getImageData(0,0,u.width,u.height),_=v.data,x=0,b=_.length,w=this.minOpacity,A=this.maxOpacity-w;x<b;){y=_[x+3]/256;var E=4*Math.floor(255*y);if(y>0){var S=o(y)?a:l;y>0&&(y=y*A+w),_[x++]=S[E],_[x++]=S[E+1],_[x++]=S[E+2],_[x++]=S[E+3]*y*256}else x+=4}return h.putImageData(v,0,0),u},t.prototype._getBrush=function(){var t=this._brushCanvas||(this._brushCanvas=ZA.createCanvas()),e=this.pointSize+this.blurSize,i=2*e;t.width=i,t.height=i;var n=t.getContext("2d");return n.clearRect(0,0,i,i),n.shadowOffsetX=i,n.shadowBlur=this.blurSize,n.shadowColor="#000",n.beginPath(),n.arc(-e,e,this.pointSize,0,2*Math.PI,!0),n.closePath(),n.fill(),t},t.prototype._getGradient=function(t,e){for(var i=this._gradientPixels,n=i[e]||(i[e]=new Uint8ClampedArray(1024)),r=[0,0,0,0],o=0,s=0;s<256;s++)t[e](s/255,!0,r),n[o++]=r[0],n[o++]=r[1],n[o++]=r[2],n[o++]=r[3];return n},t}(),n6=i6;function r6(t){var e=t.dimensions;return"lng"===e[0]&&"lat"===e[1]}var o6=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.render=function(t,e,i){var n;if(e.eachComponent("visualMap",(function(e){e.eachTargetSeries((function(i){i===t&&(n=e)}))})),"production"!==process.env.NODE_ENV&&!n)throw new Error("Heatmap must use with visualMap");this._progressiveEls=null,this.group.removeAll();var r=t.coordinateSystem;"cartesian2d"===r.type||"calendar"===r.type?this._renderOnCartesianAndCalendar(t,i,0,t.getData().count()):r6(r)&&this._renderOnGeo(r,t,n,i)},e.prototype.incrementalPrepareRender=function(t,e,i){this.group.removeAll()},e.prototype.incrementalRender=function(t,e,i,n){var r=e.coordinateSystem;r&&(r6(r)?this.render(e,i,n):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(e,n,t.start,t.end,!0)))},e.prototype.eachRendered=function(t){lN(this._progressiveEls||this.group,t)},e.prototype._renderOnCartesianAndCalendar=function(t,e,i,n,r){var o,s,a,l,c=t.coordinateSystem,u=rY(c,"cartesian2d");if(u){var h=c.getAxis("x"),p=c.getAxis("y");if("production"!==process.env.NODE_ENV){if("category"!==h.type||"category"!==p.type)throw new Error("Heatmap on cartesian must have two category axes");if(!h.onBand||!p.onBand)throw new Error("Heatmap on cartesian must have two axes with boundaryGap true")}o=h.getBandWidth()+.5,s=p.getBandWidth()+.5,a=h.scale.getExtent(),l=p.scale.getExtent()}for(var d=this.group,f=t.getData(),m=t.getModel(["emphasis","itemStyle"]).getItemStyle(),g=t.getModel(["blur","itemStyle"]).getItemStyle(),y=t.getModel(["select","itemStyle"]).getItemStyle(),v=t.get(["itemStyle","borderRadius"]),_=fN(t),x=t.getModel("emphasis"),b=x.get("focus"),w=x.get("blurScope"),A=x.get("disabled"),E=u?[f.mapDimension("x"),f.mapDimension("y"),f.mapDimension("value")]:[f.mapDimension("time"),f.mapDimension("value")],S=i;S<n;S++){var M=void 0,T=f.getItemVisual(S,"style");if(u){var I=f.get(E[0],S),C=f.get(E[1],S);if(isNaN(f.get(E[2],S))||isNaN(I)||isNaN(C)||I<a[0]||I>a[1]||C<l[0]||C>l[1])continue;var P=c.dataToPoint([I,C]);M=new kD({shape:{x:P[0]-o/2,y:P[1]-s/2,width:o,height:s},style:T})}else{if(isNaN(f.get(E[1],S)))continue;M=new kD({z2:1,shape:c.dataToRect([f.get(E[0],S)]).contentShape,style:T})}if(f.hasItemOption){var L=f.getItemModel(S),D=L.getModel("emphasis");m=D.getModel("itemStyle").getItemStyle(),g=L.getModel(["blur","itemStyle"]).getItemStyle(),y=L.getModel(["select","itemStyle"]).getItemStyle(),v=L.get(["itemStyle","borderRadius"]),b=D.get("focus"),w=D.get("blurScope"),A=D.get("disabled"),_=fN(L)}M.shape.r=v;var R=t.getRawValue(S),O="-";R&&null!=R[2]&&(O=R[2]+""),dN(M,_,{labelFetcher:t,labelDataIndex:S,defaultOpacity:T.opacity,defaultText:O}),M.ensureState("emphasis").style=m,M.ensureState("blur").style=g,M.ensureState("select").style=y,XR(M,b,w,A),M.incremental=r,r&&(M.states.emphasis.hoverLayer=!0),d.add(M),f.setItemGraphicEl(S,M),this._progressiveEls&&this._progressiveEls.push(M)}},e.prototype._renderOnGeo=function(t,e,i,n){var r=i.targetVisuals.inRange,o=i.targetVisuals.outOfRange,s=e.getData(),a=this._hmLayer||this._hmLayer||new n6;a.blurSize=e.get("blurSize"),a.pointSize=e.get("pointSize"),a.minOpacity=e.get("minOpacity"),a.maxOpacity=e.get("maxOpacity");var l=t.getViewRect().clone(),c=t.getRoamTransform();l.applyTransform(c);var u=Math.max(l.x,0),h=Math.max(l.y,0),p=Math.min(l.width+l.x,n.getWidth()),d=Math.min(l.height+l.y,n.getHeight()),f=p-u,m=d-h,g=[s.mapDimension("lng"),s.mapDimension("lat"),s.mapDimension("value")],y=s.mapArray(g,(function(e,i,n){var r=t.dataToPoint([e,i]);return r[0]-=u,r[1]-=h,r.push(n),r})),v=i.getExtent(),_="visualMap.continuous"===i.type?function(t,e){var i=t[1]-t[0];return e=[(e[0]-t[0])/i,(e[1]-t[0])/i],function(t){return t>=e[0]&&t<=e[1]}}(v,i.option.range):function(t,e,i){var n=t[1]-t[0],r=(e=vE(e,(function(e){return{interval:[(e.interval[0]-t[0])/n,(e.interval[1]-t[0])/n]}}))).length,o=0;return function(t){var n;for(n=o;n<r;n++)if((s=e[n].interval)[0]<=t&&t<=s[1]){o=n;break}if(n===r)for(n=o-1;n>=0;n--){var s;if((s=e[n].interval)[0]<=t&&t<=s[1]){o=n;break}}return n>=0&&n<r&&i[n]}}(v,i.getPieceList(),i.option.selected);a.update(y,f,m,r.color.getNormalizer(),{inRange:r.color.getColorMapper(),outOfRange:o.color.getColorMapper()},_);var x=new TD({style:{width:f,height:m,x:u,y:h,image:a.canvas},silent:!0});this.group.add(x)},e.type="heatmap",e}(iU),s6=o6,a6=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.getInitialData=function(t,e){return FH(null,this,{generateCoord:"value"})},e.prototype.preventIncremental=function(){var t=Bz.get(this.get("coordinateSystem"));if(t&&t.dimensions)return"lng"===t.dimensions[0]&&"lat"===t.dimensions[1]},e.type="series.heatmap",e.dependencies=["grid","geo","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:"#212121"}}},e}(HV),l6=a6;var c6=["itemStyle","borderWidth"],u6=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],h6=new EO,p6=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.render=function(t,e,i){var n=this.group,r=t.getData(),o=this._data,s=t.coordinateSystem,a=s.getBaseAxis().isHorizontal(),l=s.master.getRect(),c={ecSize:{width:i.getWidth(),height:i.getHeight()},seriesModel:t,coordSys:s,coordSysExtent:[[l.x,l.x+l.width],[l.y,l.y+l.height]],isHorizontal:a,valueDim:u6[+a],categoryDim:u6[1-+a]};return r.diff(o).add((function(t){if(r.hasValue(t)){var e=x6(r,t),i=d6(r,t,e,c),o=A6(r,c,i);r.setItemGraphicEl(t,o),n.add(o),I6(o,c,i)}})).update((function(t,e){var i=o.getItemGraphicEl(e);if(r.hasValue(t)){var s=x6(r,t),a=d6(r,t,s,c),l=S6(r,a);i&&l!==i.__pictorialShapeStr&&(n.remove(i),r.setItemGraphicEl(t,null),i=null),i?function(t,e,i){var n=i.animationModel,r=i.dataIndex,o=t.__pictorialBundle;Pk(o,{x:i.bundlePosition[0],y:i.bundlePosition[1]},n,r),i.symbolRepeat?g6(t,e,i,!0):y6(t,e,i,!0);v6(t,i,!0),_6(t,e,i,!0)}(i,c,a):i=A6(r,c,a,!0),r.setItemGraphicEl(t,i),i.__pictorialSymbolMeta=a,n.add(i),I6(i,c,a)}else n.remove(i)})).remove((function(t){var e=o.getItemGraphicEl(t);e&&E6(o,t,e.__pictorialSymbolMeta.animationModel,e)})).execute(),this._data=r,this.group},e.prototype.remove=function(t,e){var i=this.group,n=this._data;t.get("animation")?n&&n.eachItemGraphicEl((function(e){E6(n,KD(e).dataIndex,t,e)})):i.removeAll()},e.type="pictorialBar",e}(iU);function d6(t,e,i,n){var r=t.getItemLayout(e),o=i.get("symbolRepeat"),s=i.get("symbolClip"),a=i.get("symbolPosition")||"start",l=(i.get("symbolRotate")||0)*Math.PI/180||0,c=i.get("symbolPatternSize")||2,u=i.isAnimationEnabled(),h={dataIndex:e,layout:r,itemModel:i,symbolType:t.getItemVisual(e,"symbol")||"circle",style:t.getItemVisual(e,"style"),symbolClip:s,symbolRepeat:o,symbolRepeatDirection:i.get("symbolRepeatDirection"),symbolPatternSize:c,rotation:l,animationModel:u?i:null,hoverScale:u&&i.get(["emphasis","scale"]),z2:i.getShallow("z",!0)||0};!function(t,e,i,n,r){var o,s=n.valueDim,a=t.get("symbolBoundingData"),l=n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()),c=l.toGlobalCoord(l.dataToCoord(0)),u=1-+(i[s.wh]<=0);if(EE(a)){var h=[f6(l,a[0])-c,f6(l,a[1])-c];h[1]<h[0]&&h.reverse(),o=h[u]}else o=null!=a?f6(l,a)-c:e?n.coordSysExtent[s.index][u]-c:i[s.wh];r.boundingLength=o,e&&(r.repeatCutLength=i[s.wh]);r.pxSign=o>0?1:-1}(i,o,r,n,h),function(t,e,i,n,r,o,s,a,l,c){var u,h=l.valueDim,p=l.categoryDim,d=Math.abs(i[p.wh]),f=t.getItemVisual(e,"symbolSize");u=EE(f)?f.slice():null==f?["100%","100%"]:[f,f];u[p.index]=IC(u[p.index],d),u[h.index]=IC(u[h.index],n?d:Math.abs(o)),c.symbolSize=u;var m=c.symbolScale=[u[0]/a,u[1]/a];m[h.index]*=(l.isHorizontal?-1:1)*s}(t,e,r,o,0,h.boundingLength,h.pxSign,c,n,h),function(t,e,i,n,r){var o=t.get(c6)||0;o&&(h6.attr({scaleX:e[0],scaleY:e[1],rotation:i}),h6.updateTransform(),o/=h6.getLineScale(),o*=e[n.valueDim.index]);r.valueLineWidth=o||0}(i,h.symbolScale,l,n,h);var p=h.symbolSize,d=fG(i.get("symbolOffset"),p);return function(t,e,i,n,r,o,s,a,l,c,u,h){var p=u.categoryDim,d=u.valueDim,f=h.pxSign,m=Math.max(e[d.index]+a,0),g=m;if(n){var y=Math.abs(l),v=NE(t.get("symbolMargin"),"15%")+"",_=!1;v.lastIndexOf("!")===v.length-1&&(_=!0,v=v.slice(0,v.length-1));var x=IC(v,e[d.index]),b=Math.max(m+2*x,0),w=_?0:2*x,A=WC(n),E=A?n:C6((y+w)/b);b=m+2*(x=(y-E*m)/2/(_?E:Math.max(E-1,1))),w=_?0:2*x,A||"fixed"===n||(E=c?C6((Math.abs(c)+w)/b):0),g=E*b-w,h.repeatTimes=E,h.symbolMargin=x}var S=f*(g/2),M=h.pathPosition=[];M[p.index]=i[p.wh]/2,M[d.index]="start"===s?S:"end"===s?l-S:l/2,o&&(M[0]+=o[0],M[1]+=o[1]);var T=h.bundlePosition=[];T[p.index]=i[p.xy],T[d.index]=i[d.xy];var I=h.barRectShape=pE({},i);I[d.wh]=f*Math.max(Math.abs(i[d.wh]),Math.abs(M[d.index]+S)),I[p.wh]=i[p.wh];var C=h.clipShape={};C[p.xy]=-i[p.xy],C[p.wh]=u.ecSize[p.wh],C[d.xy]=0,C[d.wh]=i[d.wh]}(i,p,r,o,0,d,a,h.valueLineWidth,h.boundingLength,h.repeatCutLength,n,h),h}function f6(t,e){return t.toGlobalCoord(t.dataToCoord(t.scale.parse(e)))}function m6(t){var e=t.symbolPatternSize,i=pG(t.symbolType,-e/2,-e/2,e,e);return i.attr({culling:!0}),"image"!==i.type&&i.setStyle({strokeNoScale:!0}),i}function g6(t,e,i,n){var r=t.__pictorialBundle,o=i.symbolSize,s=i.valueLineWidth,a=i.pathPosition,l=e.valueDim,c=i.repeatTimes||0,u=0,h=o[e.valueDim.index]+s+2*i.symbolMargin;for(M6(t,(function(t){t.__pictorialAnimationIndex=u,t.__pictorialRepeatTimes=c,u<c?T6(t,null,f(u),i,n):T6(t,null,{scaleX:0,scaleY:0},i,n,(function(){r.remove(t)})),u++}));u<c;u++){var p=m6(i);p.__pictorialAnimationIndex=u,p.__pictorialRepeatTimes=c,r.add(p);var d=f(u);T6(p,{x:d.x,y:d.y,scaleX:0,scaleY:0},{scaleX:d.scaleX,scaleY:d.scaleY,rotation:d.rotation},i,n)}function f(t){var e=a.slice(),n=i.pxSign,r=t;return("start"===i.symbolRepeatDirection?n>0:n<0)&&(r=c-1-t),e[l.index]=h*(r-c/2+.5)+a[l.index],{x:e[0],y:e[1],scaleX:i.symbolScale[0],scaleY:i.symbolScale[1],rotation:i.rotation}}}function y6(t,e,i,n){var r=t.__pictorialBundle,o=t.__pictorialMainPath;o?T6(o,null,{x:i.pathPosition[0],y:i.pathPosition[1],scaleX:i.symbolScale[0],scaleY:i.symbolScale[1],rotation:i.rotation},i,n):(o=t.__pictorialMainPath=m6(i),r.add(o),T6(o,{x:i.pathPosition[0],y:i.pathPosition[1],scaleX:0,scaleY:0,rotation:i.rotation},{scaleX:i.symbolScale[0],scaleY:i.symbolScale[1]},i,n))}function v6(t,e,i){var n=pE({},e.barRectShape),r=t.__pictorialBarRect;r?T6(r,null,{shape:n},e,i):((r=t.__pictorialBarRect=new kD({z2:2,shape:n,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}})).disableMorphing=!0,t.add(r))}function _6(t,e,i,n){if(i.symbolClip){var r=t.__pictorialClipPath,o=pE({},i.clipShape),s=e.valueDim,a=i.animationModel,l=i.dataIndex;if(r)Pk(r,{shape:o},a,l);else{o[s.wh]=0,r=new kD({shape:o}),t.__pictorialBundle.setClipPath(r),t.__pictorialClipPath=r;var c={};c[s.wh]=i.clipShape[s.wh],cN[n?"updateProps":"initProps"](r,{shape:c},a,l)}}}function x6(t,e){var i=t.getItemModel(e);return i.getAnimationDelayParams=b6,i.isAnimationEnabled=w6,i}function b6(t){return{index:t.__pictorialAnimationIndex,count:t.__pictorialRepeatTimes}}function w6(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function A6(t,e,i,n){var r=new xC,o=new xC;return r.add(o),r.__pictorialBundle=o,o.x=i.bundlePosition[0],o.y=i.bundlePosition[1],i.symbolRepeat?g6(r,e,i):y6(r,0,i),v6(r,i,n),_6(r,e,i,n),r.__pictorialShapeStr=S6(t,i),r.__pictorialSymbolMeta=i,r}function E6(t,e,i,n){var r=n.__pictorialBarRect;r&&r.removeTextContent();var o=[];M6(n,(function(t){o.push(t)})),n.__pictorialMainPath&&o.push(n.__pictorialMainPath),n.__pictorialClipPath&&(i=null),yE(o,(function(t){Rk(t,{scaleX:0,scaleY:0},i,e,(function(){n.parent&&n.parent.remove(n)}))})),t.setItemGraphicEl(e,null)}function S6(t,e){return[t.getItemVisual(e.dataIndex,"symbol")||"none",!!e.symbolRepeat,!!e.symbolClip].join(":")}function M6(t,e,i){yE(t.__pictorialBundle.children(),(function(n){n!==t.__pictorialBarRect&&e.call(i,n)}))}function T6(t,e,i,n,r,o){e&&t.attr(e),n.symbolClip&&!r?i&&t.attr(i):i&&cN[r?"updateProps":"initProps"](t,i,n.animationModel,n.dataIndex,o)}function I6(t,e,i){var n=i.dataIndex,r=i.itemModel,o=r.getModel("emphasis"),s=o.getModel("itemStyle").getItemStyle(),a=r.getModel(["blur","itemStyle"]).getItemStyle(),l=r.getModel(["select","itemStyle"]).getItemStyle(),c=r.getShallow("cursor"),u=o.get("focus"),h=o.get("blurScope"),p=o.get("scale");M6(t,(function(t){if(t instanceof TD){var e=t.style;t.useStyle(pE({image:e.image,x:e.x,y:e.y,width:e.width,height:e.height},i.style))}else t.useStyle(i.style);var n=t.ensureState("emphasis");n.style=s,p&&(n.scaleX=1.1*t.scaleX,n.scaleY=1.1*t.scaleY),t.ensureState("blur").style=a,t.ensureState("select").style=l,c&&(t.cursor=c),t.z2=i.z2}));var d=e.valueDim.posDesc[+(i.boundingLength>0)];dN(t.__pictorialBarRect,fN(r),{labelFetcher:e.seriesModel,labelDataIndex:n,defaultText:kZ(e.seriesModel.getData(),n),inheritColor:i.style.fill,defaultOpacity:i.style.opacity,defaultOutsidePosition:d}),XR(t,u,h,o.get("disabled"))}function C6(t){var e=Math.round(t);return Math.abs(t-e)<1e-4?e:Math.ceil(t)}var P6=p6,L6=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.hasSymbolVisual=!0,i.defaultSymbol="roundRect",i}return zA(e,t),e.prototype.getInitialData=function(e){return e.stack=null,t.prototype.getInitialData.apply(this,arguments)},e.type="series.pictorialBar",e.dependencies=["grid"],e.defaultOption=GN(wY.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:"#212121"}}}),e}(wY),D6=L6;var R6=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i._layers=[],i}return zA(e,t),e.prototype.render=function(t,e,i){var n=t.getData(),r=this,o=this.group,s=t.getLayerSeries(),a=n.getLayout("layoutInfo"),l=a.rect,c=a.boundaryGap;function u(t){return t.name}o.x=0,o.y=l.y+c[0];var h=new oH(this._layersSeries||[],s,u,u),p=[];function d(e,i,a){var l=r._layers;if("remove"!==e){for(var c,u,h=[],d=[],f=s[i].indices,m=0;m<f.length;m++){var g=n.getItemLayout(f[m]),y=g.x,v=g.y0,_=g.y;h.push(y,v),d.push(y,v+_),c=n.getItemVisual(f[m],"style")}var x=n.getItemLayout(f[0]),b=t.getModel("label").get("margin"),w=t.getModel("emphasis");if("add"===e){var A=p[i]=new xC;u=new tY({shape:{points:h,stackedOnPoints:d,smooth:.4,stackedOnSmooth:.4,smoothConstraint:!1},z2:0}),A.add(u),o.add(A),t.isAnimationEnabled()&&u.setClipPath(function(t,e,i){var n=new kD({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return Lk(n,{shape:{x:t.x-50,width:t.width+100,height:t.height+20}},e,i),n}(u.getBoundingRect(),t,(function(){u.removeClipPath()})))}else{A=l[a];u=A.childAt(0),o.add(A),p[i]=A,Pk(u,{shape:{points:h,stackedOnPoints:d}},t),Nk(u)}dN(u,fN(t),{labelDataIndex:f[m-1],defaultText:n.getName(f[m-1]),inheritColor:c.fill},{normal:{verticalAlign:"middle"}}),u.setTextConfig({position:null,local:!0});var E=u.getTextContent();E&&(E.x=x.x-b,E.y=x.y0+x.y/2),u.useStyle(c),n.setItemGraphicEl(i,u),JR(u,t),XR(u,w.get("focus"),w.get("blurScope"),w.get("disabled"))}else o.remove(l[i])}h.add(wE(d,this,"add")).update(wE(d,this,"update")).remove(wE(d,this,"remove")).execute(),this._layersSeries=s,this._layers=p},e.type="themeRiver",e}(iU);var O6=R6,k6=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new pQ(wE(this.getData,this),wE(this.getRawData,this))},e.prototype.fixData=function(t){var e=t.length,i={},n=PP(t,(function(t){return i.hasOwnProperty(t[0]+"")||(i[t[0]+""]=-1),t[2]})),r=[];n.buckets.each((function(t,e){r.push({name:e,dataList:t})}));for(var o=r.length,s=0;s<o;++s){for(var a=r[s].name,l=0;l<r[s].dataList.length;++l){var c=r[s].dataList[l][0]+"";i[c]=s}for(var c in i)i.hasOwnProperty(c)&&i[c]!==s&&(i[c]=s,t[e]=[c,0,a],e++)}return t},e.prototype.getInitialData=function(t,e){for(var i=this.getReferringComponents("singleAxis",MP).models[0].get("type"),n=xE(t.data,(function(t){return void 0!==t[2]})),r=this.fixData(n||[]),o=[],s=this.nameMap=YE(),a=0,l=0;l<r.length;++l)o.push(r[l][2]),s.get(r[l][2])||(s.set(r[l][2],a),a++);var c=LH(r,{coordDimensions:["single"],dimensionsDefine:[{name:"time",type:lH(i)},{name:"value",type:"float"},{name:"name",type:"ordinal"}],encodeDefine:{single:0,value:1,itemName:2}}).dimensions,u=new PH(c,this);return u.initData(r),u},e.prototype.getLayerSeries=function(){for(var t=this.getData(),e=t.count(),i=[],n=0;n<e;++n)i[n]=n;var r=t.mapDimension("single"),o=PP(i,(function(e){return t.get("name",e)})),s=[];return o.buckets.each((function(e,i){e.sort((function(e,i){return t.get(r,e)-t.get(r,i)})),s.push({name:i,indices:e})})),s},e.prototype.getAxisTooltipData=function(t,e,i){EE(t)||(t=t?[t]:[]);for(var n,r=this.getData(),o=this.getLayerSeries(),s=[],a=o.length,l=0;l<a;++l){for(var c=Number.MAX_VALUE,u=-1,h=o[l].indices.length,p=0;p<h;++p){var d=r.get(t[0],o[l].indices[p]),f=Math.abs(d-e);f<=c&&(n=d,c=f,u=o[l].indices[p])}s.push(u)}return{dataIndices:s,nestestValue:n}},e.prototype.formatTooltip=function(t,e,i){var n=this.getData();return xV("nameValue",{name:n.getName(t),value:n.get(n.mapDimension("value"),t)})},e.type="series.themeRiver",e.dependencies=["singleAxis"],e.defaultOption={z:2,colorBy:"data",coordinateSystem:"singleAxis",boundaryGap:["10%","10%"],singleAxisIndex:0,animationEasing:"linear",label:{margin:4,show:!0,position:"left",fontSize:11},emphasis:{label:{show:!0}}},e}(HV),N6=k6;function B6(t,e){t.eachSeriesByType("themeRiver",(function(t){var e=t.getData(),i=t.coordinateSystem,n={},r=i.getRect();n.rect=r;var o=t.get("boundaryGap"),s=i.getAxis();(n.boundaryGap=o,"horizontal"===s.orient)?(o[0]=IC(o[0],r.height),o[1]=IC(o[1],r.height),z6(e,t,r.height-o[0]-o[1])):(o[0]=IC(o[0],r.width),o[1]=IC(o[1],r.width),z6(e,t,r.width-o[0]-o[1]));e.setLayout("layoutInfo",n)}))}function z6(t,e,i){if(t.count())for(var n,r=e.coordinateSystem,o=e.getLayerSeries(),s=t.mapDimension("single"),a=t.mapDimension("value"),l=vE(o,(function(e){return vE(e.indices,(function(e){var i=r.dataToPoint(t.get(s,e));return i[1]=t.get(a,e),i}))})),c=function(t){for(var e=t.length,i=t[0].length,n=[],r=[],o=0,s=0;s<i;++s){for(var a=0,l=0;l<e;++l)a+=t[l][s][1];a>o&&(o=a),n.push(a)}for(var c=0;c<i;++c)r[c]=(o-n[c])/2;o=0;for(var u=0;u<i;++u){var h=n[u]+r[u];h>o&&(o=h)}return{y0:r,max:o}}(l),u=c.y0,h=i/c.max,p=o.length,d=o[0].indices.length,f=0;f<d;++f){n=u[f]*h,t.setItemLayout(o[0].indices[f],{layerIndex:0,x:l[0][f][0],y0:n,y:l[0][f][1]*h});for(var m=1;m<p;++m)n+=l[m-1][f][1]*h,t.setItemLayout(o[m].indices[f],{layerIndex:m,x:l[m][f][0],y0:n,y:l[m][f][1]*h})}}var F6=function(t){function e(e,i,n,r){var o=t.call(this)||this;o.z2=2,o.textConfig={inside:!0},KD(o).seriesIndex=i.seriesIndex;var s=new JD({z2:4,silent:e.getModel().get(["label","silent"])});return o.setTextContent(s),o.updateData(!0,e,i,n,r),o}return zA(e,t),e.prototype.updateData=function(t,e,i,n,r){this.node=e,e.piece=this,i=i||this._seriesModel,n=n||this._ecModel;var o=this;KD(o).dataIndex=e.dataIndex;var s=e.getModel(),a=s.getModel("emphasis"),l=e.getLayout(),c=pE({},l);c.label=null;var u=e.getVisual("style");u.lineJoin="bevel";var h=e.getVisual("decal");h&&(u.decal=jG(h,r));var p=PY(s.getModel("itemStyle"),c,!0);pE(c,p),yE(aR,(function(t){var e=o.ensureState(t),i=s.getModel([t,"itemStyle"]);e.style=i.getItemStyle();var n=PY(i,c);n&&(e.shape=n)})),t?(o.setShape(c),o.shape.r=l.r0,Lk(o,{shape:{r:l.r}},i,e.dataIndex)):(Pk(o,{shape:c},i),Nk(o)),o.useStyle(u),this._updateLabel(i);var d=s.getShallow("cursor");d&&o.attr("cursor",d),this._seriesModel=i||this._seriesModel,this._ecModel=n||this._ecModel;var f=a.get("focus");XR(this,"ancestor"===f?e.getAncestorsIndices():"descendant"===f?e.getDescendantIndices():f,a.get("blurScope"),a.get("disabled"))},e.prototype._updateLabel=function(t){var e=this,i=this.node.getModel(),n=i.getModel("label"),r=this.node.getLayout(),o=r.endAngle-r.startAngle,s=(r.startAngle+r.endAngle)/2,a=Math.cos(s),l=Math.sin(s),c=this,u=c.getTextContent(),h=this.node.dataIndex,p=n.get("minAngle")/180*Math.PI,d=n.get("show")&&!(null!=p&&Math.abs(o)<p);function f(t,e){var i=t.get(e);return null==i?n.get(e):i}u.ignore=!d,yE(lR,(function(n){var p="normal"===n?i.getModel("label"):i.getModel([n,"label"]),d="normal"===n,m=d?u:u.ensureState(n),g=t.getFormattedLabel(h,n);d&&(g=g||e.node.name),m.style=mN(p,{},null,"normal"!==n,!0),g&&(m.style.text=g);var y=p.get("show");null==y||d||(m.ignore=!y);var v,_=f(p,"position"),x=d?c:c.states[n],b=x.style.fill;x.textConfig={outsideFill:"inherit"===p.get("color")?b:null,inside:"outside"!==_};var w=f(p,"distance")||0,A=f(p,"align");"outside"===_?(v=r.r+w,A=s>Math.PI/2?"right":"left"):A&&"center"!==A?"left"===A?(v=r.r0+w,s>Math.PI/2&&(A="right")):"right"===A&&(v=r.r-w,s>Math.PI/2&&(A="left")):(v=o===2*Math.PI&&0===r.r0?0:(r.r+r.r0)/2,A="center"),m.style.align=A,m.style.verticalAlign=f(p,"verticalAlign")||"middle",m.x=v*a+r.cx,m.y=v*l+r.cy;var E=f(p,"rotate"),S=0;"radial"===E?(S=nD(-s))>Math.PI/2&&S<1.5*Math.PI&&(S+=Math.PI):"tangential"===E?(S=Math.PI/2-s)>Math.PI/2?S-=Math.PI:S<-Math.PI/2&&(S+=Math.PI):IE(E)&&(S=E*Math.PI/180),m.rotation=nD(S)})),u.dirtyStyle()},e}(jO),V6=F6,U6="sunburstRootToNode",G6="sunburstHighlight",j6="sunburstUnhighlight";var H6=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.render=function(t,e,i,n){var r=this;this.seriesModel=t,this.api=i,this.ecModel=e;var o=t.getData(),s=o.tree.root,a=t.getViewRoot(),l=this.group,c=t.get("renderLabelForZeroData"),u=[];a.eachNode((function(t){u.push(t)}));var h=this._oldChildren||[];!function(n,r){if(0===n.length&&0===r.length)return;function a(t){return t.getId()}function u(a,u){!function(n,r){c||!n||n.getValue()||(n=null);if(n!==s&&r!==s)if(r&&r.piece)n?(r.piece.updateData(!1,n,t,e,i),o.setItemGraphicEl(n.dataIndex,r.piece)):function(t){if(!t)return;t.piece&&(l.remove(t.piece),t.piece=null)}(r);else if(n){var a=new V6(n,t,e,i);l.add(a),o.setItemGraphicEl(n.dataIndex,a)}}(null==a?null:n[a],null==u?null:r[u])}new oH(r,n,a,a).add(u).update(u).remove(AE(u,null)).execute()}(u,h),function(n,o){o.depth>0?(r.virtualPiece?r.virtualPiece.updateData(!1,n,t,e,i):(r.virtualPiece=new V6(n,t,e,i),l.add(r.virtualPiece)),o.piece.off("click"),r.virtualPiece.on("click",(function(t){r._rootToNode(o.parentNode)}))):r.virtualPiece&&(l.remove(r.virtualPiece),r.virtualPiece=null)}(s,a),this._initEvents(),this._oldChildren=u},e.prototype._initEvents=function(){var t=this;this.group.off("click"),this.group.on("click",(function(e){var i=!1;t.seriesModel.getViewRoot().eachNode((function(n){if(!i&&n.piece&&n.piece===e.target){var r=n.getModel().get("nodeClick");if("rootToNode"===r)t._rootToNode(n);else if("link"===r){var o=n.getModel(),s=o.get("link");if(s)kB(s,o.get("target",!0)||"_blank")}i=!0}}))}))},e.prototype._rootToNode=function(t){t!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:U6,from:this.uid,seriesId:this.seriesModel.id,targetNode:t})},e.prototype.containPoint=function(t,e){var i=e.getData().getItemLayout(0);if(i){var n=t[0]-i.cx,r=t[1]-i.cy,o=Math.sqrt(n*n+r*r);return o<=i.r&&o>=i.r0}},e.type="sunburst",e}(iU),W6=H6,q6=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.ignoreStyleOnData=!0,i}return zA(e,t),e.prototype.getInitialData=function(t,e){var i={name:t.name,children:t.data};X6(i);var n=this._levelModels=vE(t.levels||[],(function(t){return new FN(t,this,e)}),this),r=t0.createTree(i,this,(function(t){t.wrapMethod("getItemModel",(function(t,e){var i=r.getNodeByDataIndex(e),o=n[i.depth];return o&&(t.parentModel=o),t}))}));return r.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.getDataParams=function(e){var i=t.prototype.getDataParams.apply(this,arguments),n=this.getData().tree.getNodeByDataIndex(e);return i.treePathInfo=r0(n,this),i},e.prototype.getLevelModel=function(t){return this._levelModels&&this._levelModels[t.depth]},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var e=this.getRawData().tree.root;t&&(t===e||e.contains(t))||(this._viewRoot=e)},e.prototype.enableAriaDecal=function(){h0(this)},e.type="series.sunburst",e.defaultOption={z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],sort:"desc"},e}(HV);function X6(t){var e=0;yE(t.children,(function(t){X6(t);var i=t.value;EE(i)&&(i=i[0]),e+=i}));var i=t.value;EE(i)&&(i=i[0]),(null==i||isNaN(i))&&(i=e),i<0&&(i=0),EE(t.value)?t.value[0]=i:t.value=i}var Z6=q6,Y6=Math.PI/180;function Q6(t,e,i){e.eachSeriesByType(t,(function(t){var e=t.get("center"),n=t.get("radius");EE(n)||(n=[0,n]),EE(e)||(e=[e,e]);var r=i.getWidth(),o=i.getHeight(),s=Math.min(r,o),a=IC(e[0],r),l=IC(e[1],o),c=IC(n[0],s/2),u=IC(n[1],s/2),h=-t.get("startAngle")*Y6,p=t.get("minAngle")*Y6,d=t.getData().tree.root,f=t.getViewRoot(),m=f.depth,g=t.get("sort");null!=g&&J6(f,g);var y=0;yE(f.children,(function(t){!isNaN(t.getValue())&&y++}));var v=f.getValue(),_=Math.PI/(v||y)*2,x=f.depth>0,b=f.height-(x?-1:1),w=(u-c)/(b||1),A=t.get("clockwise"),E=t.get("stillShowZeroSum"),S=A?1:-1,M=function(e,i){if(e){var n=i;if(e!==d){var r=e.getValue(),o=0===v&&E?_:r*_;o<p&&(o=p),n=i+S*o;var u=e.depth-m-(x?-1:1),h=c+w*u,f=c+w*(u+1),g=t.getLevelModel(e);if(g){var y=g.get("r0",!0),b=g.get("r",!0),T=g.get("radius",!0);null!=T&&(y=T[0],b=T[1]),null!=y&&(h=IC(y,s/2)),null!=b&&(f=IC(b,s/2))}e.setLayout({angle:o,startAngle:i,endAngle:n,clockwise:A,cx:a,cy:l,r0:h,r:f})}if(e.children&&e.children.length){var I=0;yE(e.children,(function(t){I+=M(t,i+I)}))}return n-i}};if(x){var T=c,I=c+w,C=2*Math.PI;d.setLayout({angle:C,startAngle:h,endAngle:h+C,clockwise:A,cx:a,cy:l,r0:T,r:I})}M(f,h)}))}function J6(t,e){var i=t.children||[];t.children=function(t,e){if(SE(e)){var i=vE(t,(function(t,e){var i=t.getValue();return{params:{depth:t.depth,height:t.height,dataIndex:t.dataIndex,getValue:function(){return i}},index:e}}));return i.sort((function(t,i){return e(t.params,i.params)})),vE(i,(function(e){return t[e.index]}))}var n="asc"===e;return t.sort((function(t,e){var i=(t.getValue()-e.getValue())*(n?1:-1);return 0===i?(t.dataIndex-e.dataIndex)*(n?-1:1):i}))}(i,e),i.length&&yE(t.children,(function(t){J6(t,e)}))}function K6(t){var e={};t.eachSeriesByType("sunburst",(function(t){var i=t.getData(),n=i.tree;n.eachNode((function(r){var o=r.getModel().getModel("itemStyle").getItemStyle();o.fill||(o.fill=function(t,i,n){for(var r=t;r&&r.depth>1;)r=r.parentNode;var o=i.getColorFromPalette(r.name||r.dataIndex+"",e);return t.depth>1&&ME(o)&&(o=RT(o,(t.depth-1)/(n-1)*.5)),o}(r,t,n.root.height)),pE(i.ensureUniqueItemVisual(r.dataIndex,"style"),o)}))}))}var $6={color:"fill",borderColor:"stroke"},t9={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},e9=wP(),i9=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},e.prototype.getInitialData=function(t,e){return FH(null,this)},e.prototype.getDataParams=function(e,i,n){var r=t.prototype.getDataParams.call(this,e,i);return n&&(r.info=e9(n).info),r},e.type="series.custom",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,clip:!1},e}(HV),n9=i9;function r9(t,e){return e=e||[0,0],vE(["x","y"],(function(i,n){var r=this.getAxis(i),o=e[n],s=t[n]/2;return"category"===r.type?r.getBandWidth():Math.abs(r.dataToCoord(o-s)-r.dataToCoord(o+s))}),this)}function o9(t,e){return e=e||[0,0],vE([0,1],(function(i){var n=e[i],r=t[i]/2,o=[],s=[];return o[i]=n-r,s[i]=n+r,o[1-i]=s[1-i]=e[1-i],Math.abs(this.dataToPoint(o)[i]-this.dataToPoint(s)[i])}),this)}function s9(t,e){var i=this.getAxis(),n=e instanceof Array?e[0]:e,r=(t instanceof Array?t[0]:t)/2;return"category"===i.type?i.getBandWidth():Math.abs(i.dataToCoord(n-r)-i.dataToCoord(n+r))}function a9(t,e){return e=e||[0,0],vE(["Radius","Angle"],(function(i,n){var r=this["get"+i+"Axis"](),o=e[n],s=t[n]/2,a="category"===r.type?r.getBandWidth():Math.abs(r.dataToCoord(o-s)-r.dataToCoord(o+s));return"Angle"===i&&(a=a*Math.PI/180),a}),this)}var l9={};function c9(t,e,i,n){return t&&(t.legacy||!1!==t.legacy&&!i&&!n&&"tspan"!==e&&("text"===e||$E(t,"text")))}function u9(t,e,i){var n,r,o,s=t;if("text"===e)o=s;else{o={},$E(s,"text")&&(o.text=s.text),$E(s,"rich")&&(o.rich=s.rich),$E(s,"textFill")&&(o.fill=s.textFill),$E(s,"textStroke")&&(o.stroke=s.textStroke),$E(s,"fontFamily")&&(o.fontFamily=s.fontFamily),$E(s,"fontSize")&&(o.fontSize=s.fontSize),$E(s,"fontStyle")&&(o.fontStyle=s.fontStyle),$E(s,"fontWeight")&&(o.fontWeight=s.fontWeight),r={type:"text",style:o,silent:!0},n={};var a=$E(s,"textPosition");i?n.position=a?s.textPosition:"inside":a&&(n.position=s.textPosition),$E(s,"textPosition")&&(n.position=s.textPosition),$E(s,"textOffset")&&(n.offset=s.textOffset),$E(s,"textRotation")&&(n.rotation=s.textRotation),$E(s,"textDistance")&&(n.distance=s.textDistance)}return h9(o,t),yE(o.rich,(function(t){h9(t,t)})),{textConfig:n,textContent:r}}function h9(t,e){e&&(e.font=e.textFont||e.font,$E(e,"textStrokeWidth")&&(t.lineWidth=e.textStrokeWidth),$E(e,"textAlign")&&(t.align=e.textAlign),$E(e,"textVerticalAlign")&&(t.verticalAlign=e.textVerticalAlign),$E(e,"textLineHeight")&&(t.lineHeight=e.textLineHeight),$E(e,"textWidth")&&(t.width=e.textWidth),$E(e,"textHeight")&&(t.height=e.textHeight),$E(e,"textBackgroundColor")&&(t.backgroundColor=e.textBackgroundColor),$E(e,"textPadding")&&(t.padding=e.textPadding),$E(e,"textBorderColor")&&(t.borderColor=e.textBorderColor),$E(e,"textBorderWidth")&&(t.borderWidth=e.textBorderWidth),$E(e,"textBorderRadius")&&(t.borderRadius=e.textBorderRadius),$E(e,"textBoxShadowColor")&&(t.shadowColor=e.textBoxShadowColor),$E(e,"textBoxShadowBlur")&&(t.shadowBlur=e.textBoxShadowBlur),$E(e,"textBoxShadowOffsetX")&&(t.shadowOffsetX=e.textBoxShadowOffsetX),$E(e,"textBoxShadowOffsetY")&&(t.shadowOffsetY=e.textBoxShadowOffsetY))}function p9(t,e,i){var n=t;n.textPosition=n.textPosition||i.position||"inside",null!=i.offset&&(n.textOffset=i.offset),null!=i.rotation&&(n.textRotation=i.rotation),null!=i.distance&&(n.textDistance=i.distance);var r=n.textPosition.indexOf("inside")>=0,o=t.fill||"#000";d9(n,e);var s=null==n.textFill;return r?s&&(n.textFill=i.insideFill||"#fff",!n.textStroke&&i.insideStroke&&(n.textStroke=i.insideStroke),!n.textStroke&&(n.textStroke=o),null==n.textStrokeWidth&&(n.textStrokeWidth=2)):(s&&(n.textFill=t.fill||i.outsideFill||"#000"),!n.textStroke&&i.outsideStroke&&(n.textStroke=i.outsideStroke)),n.text=e.text,n.rich=e.rich,yE(e.rich,(function(t){d9(t,t)})),n}function d9(t,e){e&&($E(e,"fill")&&(t.textFill=e.fill),$E(e,"stroke")&&(t.textStroke=e.fill),$E(e,"lineWidth")&&(t.textStrokeWidth=e.lineWidth),$E(e,"font")&&(t.font=e.font),$E(e,"fontStyle")&&(t.fontStyle=e.fontStyle),$E(e,"fontWeight")&&(t.fontWeight=e.fontWeight),$E(e,"fontSize")&&(t.fontSize=e.fontSize),$E(e,"fontFamily")&&(t.fontFamily=e.fontFamily),$E(e,"align")&&(t.textAlign=e.align),$E(e,"verticalAlign")&&(t.textVerticalAlign=e.verticalAlign),$E(e,"lineHeight")&&(t.textLineHeight=e.lineHeight),$E(e,"width")&&(t.textWidth=e.width),$E(e,"height")&&(t.textHeight=e.height),$E(e,"backgroundColor")&&(t.textBackgroundColor=e.backgroundColor),$E(e,"padding")&&(t.textPadding=e.padding),$E(e,"borderColor")&&(t.textBorderColor=e.borderColor),$E(e,"borderWidth")&&(t.textBorderWidth=e.borderWidth),$E(e,"borderRadius")&&(t.textBorderRadius=e.borderRadius),$E(e,"shadowColor")&&(t.textBoxShadowColor=e.shadowColor),$E(e,"shadowBlur")&&(t.textBoxShadowBlur=e.shadowBlur),$E(e,"shadowOffsetX")&&(t.textBoxShadowOffsetX=e.shadowOffsetX),$E(e,"shadowOffsetY")&&(t.textBoxShadowOffsetY=e.shadowOffsetY),$E(e,"textShadowColor")&&(t.textShadowColor=e.textShadowColor),$E(e,"textShadowBlur")&&(t.textShadowBlur=e.textShadowBlur),$E(e,"textShadowOffsetX")&&(t.textShadowOffsetX=e.textShadowOffsetX),$E(e,"textShadowOffsetY")&&(t.textShadowOffsetY=e.textShadowOffsetY))}function f9(t,e){if("production"!==process.env.NODE_ENV){var i=t+"^_^"+e;l9[i]||(console.warn('[ECharts] DEPRECATED: "'+t+'" has been deprecated. '+e),l9[i]=!0)}}var m9={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},g9=bE(m9),y9=_E(QI,(function(t,e){return t[e]=1,t}),{}),v9=QI.join(", "),_9=["","style","shape","extra"],x9=wP();function b9(t,e,i,n,r){var o=t+"Animation",s=Ik(t,n,r)||{},a=x9(e).userDuring;return s.duration>0&&(s.during=a?wE(P9,{el:e,userDuring:a}):null,s.setToFinal=!0,s.scope=t),pE(s,i[o]),s}function w9(t,e,i,n){var r=(n=n||{}).dataIndex,o=n.isInit,s=n.clearStyle,a=i.isAnimationEnabled(),l=x9(t),c=e.style;l.userDuring=e.during;var u={},h={};if(function(t,e,i){for(var n=0;n<g9.length;n++){var r=g9[n],o=m9[r],s=e[r];s&&(i[o[0]]=s[0],i[o[1]]=s[1])}for(n=0;n<QI.length;n++){var a=QI[n];null!=e[a]&&(i[a]=e[a])}}(0,e,h),D9("shape",e,h),D9("extra",e,h),!o&&a&&(function(t,e,i){for(var n=e.transition,r=S9(n)?QI:lP(n||[]),o=0;o<r.length;o++){var s=r[o];if("style"!==s&&"shape"!==s&&"extra"!==s){var a=t[s];"production"!==process.env.NODE_ENV&&M9(s,"el.transition"),i[s]=a}}}(t,e,u),L9("shape",t,e,u),L9("extra",t,e,u),function(t,e,i,n){if(!i)return;var r,o=t.style;if(o){var s=i.transition,a=e.transition;if(s&&!S9(s)){var l=lP(s);!r&&(r=n.style={});for(var c=0;c<l.length;c++){var u=o[f=l[c]];r[f]=u}}else if(t.getAnimationStyleProps&&(S9(a)||S9(s)||fE(a,"style")>=0)){var h=t.getAnimationStyleProps(),p=h?h.style:null;if(p){!r&&(r=n.style={});var d=bE(i);for(c=0;c<d.length;c++){var f;if(p[f=d[c]]){u=o[f];r[f]=u}}}}}}(t,e,c,u)),h.style=c,function(t,e,i){var n=e.style;if(!t.isGroup&&n){if(i){t.useStyle({});for(var r=t.animators,o=0;o<r.length;o++){var s=r[o];"style"===s.targetName&&s.changeTarget(t.style)}}t.setStyle(n)}e&&(e.style=null,e&&t.attr(e),e.style=n)}(t,h,s),function(t,e){$E(e,"silent")&&(t.silent=e.silent),$E(e,"ignore")&&(t.ignore=e.ignore),t instanceof gL&&$E(e,"invisible")&&(t.invisible=e.invisible);t instanceof xD&&$E(e,"autoBatch")&&(t.autoBatch=e.autoBatch)}(t,e),a)if(o){var p={};yE(_9,(function(t){var i=t?e[t]:e;i&&i.enterFrom&&(t&&(p[t]=p[t]||{}),pE(t?p[t]:p,i.enterFrom))}));var d=b9("enter",t,e,i,r);d.duration>0&&t.animateFrom(p,d)}else!function(t,e,i,n,r){if(r){var o=b9("update",t,e,n,i);o.duration>0&&t.animateFrom(r,o)}}(t,e,r||0,i,u);A9(t,e),c?t.dirty():t.markRedraw()}function A9(t,e){for(var i=x9(t).leaveToProps,n=0;n<_9.length;n++){var r=_9[n],o=r?e[r]:e;o&&o.leaveTo&&(i||(i=x9(t).leaveToProps={}),r&&(i[r]=i[r]||{}),pE(r?i[r]:i,o.leaveTo))}}function E9(t,e,i,n){if(t){var r=t.parent,o=x9(t).leaveToProps;if(o){var s=b9("update",t,e,i,0);s.done=function(){r.remove(t),n&&n()},t.animateTo(o,s)}else r.remove(t),n&&n()}}function S9(t){return"all"===t}var M9,T9={},I9={setTransform:function(t,e){return"production"!==process.env.NODE_ENV&&UE($E(y9,t),"Only "+v9+" available in `setTransform`."),T9.el[t]=e,this},getTransform:function(t){return"production"!==process.env.NODE_ENV&&UE($E(y9,t),"Only "+v9+" available in `getTransform`."),T9.el[t]},setShape:function(t,e){"production"!==process.env.NODE_ENV&&C9(t);var i=T9.el;return(i.shape||(i.shape={}))[t]=e,i.dirtyShape&&i.dirtyShape(),this},getShape:function(t){"production"!==process.env.NODE_ENV&&C9(t);var e=T9.el.shape;if(e)return e[t]},setStyle:function(t,e){"production"!==process.env.NODE_ENV&&C9(t);var i=T9.el,n=i.style;return n&&("production"!==process.env.NODE_ENV&&kE(e)&&$C("style."+t+" must not be assigned with NaN."),n[t]=e,i.dirtyStyle&&i.dirtyStyle()),this},getStyle:function(t){"production"!==process.env.NODE_ENV&&C9(t);var e=T9.el.style;if(e)return e[t]},setExtra:function(t,e){return"production"!==process.env.NODE_ENV&&C9(t),(T9.el.extra||(T9.el.extra={}))[t]=e,this},getExtra:function(t){"production"!==process.env.NODE_ENV&&C9(t);var e=T9.el.extra;if(e)return e[t]}};function C9(t){if("production"!==process.env.NODE_ENV&&("transition"===t||"enterFrom"===t||"leaveTo"===t))throw new Error('key must not be "'+t+'"')}function P9(){var t=this,e=t.el;if(e){var i=x9(e).userDuring,n=t.userDuring;i===n?(T9.el=e,n(I9)):t.el=t.userDuring=null}}function L9(t,e,i,n){var r=i[t];if(r){var o,s=e[t];if(s){var a=i.transition,l=r.transition;if(l)if(!o&&(o=n[t]={}),S9(l))pE(o,s);else for(var c=lP(l),u=0;u<c.length;u++){var h=s[d=c[u]];o[d]=h}else if(S9(a)||fE(a,t)>=0){!o&&(o=n[t]={});var p=bE(s);for(u=0;u<p.length;u++){var d;h=s[d=p[u]];R9(r[d],h)&&(o[d]=h)}}}}}function D9(t,e,i){var n=e[t];if(n)for(var r=i[t]={},o=bE(n),s=0;s<o.length;s++){var a=o[s];r[a]=lI(n[a])}}function R9(t,e){return gE(t)?t!==e:null!=t&&isFinite(t)}"production"!==process.env.NODE_ENV&&(M9=function(t,e){$E(y9,t)||$C("Prop `"+t+"` is not a permitted in `"+e+"`. Only `"+bE(y9).join("`, `")+"` are permitted.")});var O9=wP(),k9=["percent","easing","shape","style","extra"];function N9(t){t.stopAnimation("keyframe"),t.attr(O9(t))}function B9(t,e,i){if(i.isAnimationEnabled()&&e)if(EE(e))yE(e,(function(e){B9(t,e,i)}));else{var n=e.keyframes,r=e.duration;if(i&&null==r){var o=Ik("enter",i,0);r=o&&o.duration}if(n&&r){var s=O9(t);yE(_9,(function(i){if(!i||t[i]){var o,a=!1;n.sort((function(t,e){return t.percent-e.percent})),yE(n,(function(n){var l=t.animators,c=i?n[i]:n;if("production"!==process.env.NODE_ENV&&n.percent>=1&&(a=!0),c){var u=bE(c);if(i||(u=xE(u,(function(t){return fE(k9,t)<0}))),u.length){o||((o=t.animate(i,e.loop,!0)).scope="keyframe");for(var h=0;h<l.length;h++)l[h]!==o&&l[h].targetName===o.targetName&&l[h].stopTracks(u);i&&(s[i]=s[i]||{});var p=i?s[i]:s;yE(u,(function(e){p[e]=((i?t[i]:t)||{})[e]})),o.whenWithKeys(r*n.percent,c,u,n.easing)}}})),o&&("production"!==process.env.NODE_ENV&&(a||$C("End frame with percent: 1 is missing in the keyframeAnimation.",!0)),o.delay(e.delay||0).duration(r).start(e.easing))}}))}}}var z9="emphasis",F9="normal",V9="blur",U9="select",G9=[F9,z9,V9,U9],j9={normal:["itemStyle"],emphasis:[z9,"itemStyle"],blur:[V9,"itemStyle"],select:[U9,"itemStyle"]},H9={normal:["label"],emphasis:[z9,"label"],blur:[V9,"label"],select:[U9,"label"]},W9=["x","y"],q9="e\0\0",X9={normal:{},emphasis:{},blur:{},select:{}},Z9={cartesian2d:function(t){var e=t.master.getRect();return{coordSys:{type:"cartesian2d",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(e){return t.dataToPoint(e)},size:wE(r9,t)}}},geo:function(t){var e=t.getBoundingRect();return{coordSys:{type:"geo",x:e.x,y:e.y,width:e.width,height:e.height,zoom:t.getZoom()},api:{coord:function(e){return t.dataToPoint(e)},size:wE(o9,t)}}},single:function(t){var e=t.getRect();return{coordSys:{type:"singleAxis",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(e){return t.dataToPoint(e)},size:wE(s9,t)}}},polar:function(t){var e=t.getRadiusAxis(),i=t.getAngleAxis(),n=e.getExtent();return n[0]>n[1]&&n.reverse(),{coordSys:{type:"polar",cx:t.cx,cy:t.cy,r:n[1],r0:n[0]},api:{coord:function(n){var r=e.dataToRadius(n[0]),o=i.dataToAngle(n[1]),s=t.coordToPoint([r,o]);return s.push(r,o*Math.PI/180),s},size:wE(a9,t)}}},calendar:function(t){var e=t.getRect(),i=t.getRangeInfo();return{coordSys:{type:"calendar",x:e.x,y:e.y,width:e.width,height:e.height,cellWidth:t.getCellWidth(),cellHeight:t.getCellHeight(),rangeInfo:{start:i.start,end:i.end,weeks:i.weeks,dayCount:i.allDay}},api:{coord:function(e,i){return t.dataToPoint(e,i)}}}}};function Y9(t){return t instanceof xD}function Q9(t){return t instanceof gL}var J9=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.render=function(t,e,i,n){this._progressiveEls=null;var r=this._data,o=t.getData(),s=this.group,a=n8(t,o,e,i);r||s.removeAll(),o.diff(r).add((function(e){o8(i,null,e,a(e,n),t,s,o)})).remove((function(e){var i=r.getItemGraphicEl(e);i&&E9(i,e9(i).option,t)})).update((function(e,l){var c=r.getItemGraphicEl(l);o8(i,c,e,a(e,n),t,s,o)})).execute();var l=t.get("clip",!0)?nY(t.coordinateSystem,!1,t):null;l?s.setClipPath(l):s.removeClipPath(),this._data=o},e.prototype.incrementalPrepareRender=function(t,e,i){this.group.removeAll(),this._data=null},e.prototype.incrementalRender=function(t,e,i,n,r){var o=e.getData(),s=n8(e,o,i,n),a=this._progressiveEls=[];function l(t){t.isGroup||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}for(var c=t.start;c<t.end;c++){var u=o8(null,null,c,s(c,r),e,this.group,o);u&&(u.traverse(l),a.push(u))}},e.prototype.eachRendered=function(t){lN(this._progressiveEls||this.group,t)},e.prototype.filterForExposedEvent=function(t,e,i,n){var r=e.element;if(null==r||i.name===r)return!0;for(;(i=i.__hostTarget||i.parent)&&i!==this.group;)if(i.name===r)return!0;return!1},e.type="custom",e}(iU),K9=J9;function $9(t){var e,i=t.type;if("path"===i){var n=t.shape,r=null!=n.width&&null!=n.height?{x:n.x||0,y:n.y||0,width:n.width,height:n.height}:null,o=m8(n);e=jk(o,null,r,n.layout||"center"),e9(e).customPathData=o}else if("image"===i)e=new TD({}),e9(e).customImagePath=t.style.image;else if("text"===i)e=new JD({});else if("group"===i)e=new xC;else{if("compoundPath"===i)throw new Error('"compoundPath" is not supported yet.');var s=Gk(i);if(!s){var a="";"production"!==process.env.NODE_ENV&&(a='graphic type "'+i+'" can not be found.'),rP(a)}e=new s}return e9(e).customGraphicType=i,e.name=t.name,e.z2EmphasisLift=1,e.z2SelectLift=1,e}function t8(t,e,i,n,r,o,s){N9(e);var a=r&&r.normal.cfg;a&&e.setTextConfig(a),n&&null==n.transition&&(n.transition=W9);var l=n&&n.style;if(l){if("text"===e.type){var c=l;$E(c,"textFill")&&(c.fill=c.textFill),$E(c,"textStroke")&&(c.stroke=c.textStroke)}var u=void 0,h=Y9(e)?l.decal:null;t&&h&&(h.dirty=!0,u=jG(h,t)),l.__decalPattern=u}Q9(e)&&(l&&(u=l.__decalPattern)&&(l.decal=u));w9(e,n,o,{dataIndex:i,isInit:s,clearStyle:!0}),B9(e,n.keyframeAnimation,o)}function e8(t,e,i,n,r){var o=e.isGroup?null:e,s=r&&r[t].cfg;if(o){var a=o.ensureState(t);if(!1===n){var l=o.getState(t);l&&(l.style=null)}else a.style=n||null;s&&(a.textConfig=s),PR(o)}}function i8(t,e,i){var n=i===F9,r=n?e:c8(e,i),o=r?r.z2:null;null!=o&&((n?t:t.ensureState(i)).z2=o||0)}function n8(t,e,i,n){var r=t.get("renderItem"),o=t.coordinateSystem,s={};o&&("production"!==process.env.NODE_ENV&&(UE(r,"series.render is required."),UE(o.prepareCustoms||Z9[o.type],"This coordSys does not support custom series.")),s=o.prepareCustoms?o.prepareCustoms(o):Z9[o.type](o));for(var a,l,c=dE({getWidth:n.getWidth,getHeight:n.getHeight,getZr:n.getZr,getDevicePixelRatio:n.getDevicePixelRatio,value:function(t,i){return null==i&&(i=a),e.getStore().get(e.getDimensionIndex(t||0),i)},style:function(i,n){"production"!==process.env.NODE_ENV&&f9("api.style","Please write literal style directly instead.");null==n&&(n=a);var r=e.getItemVisual(n,"style"),o=r&&r.fill,s=r&&r.opacity,l=v(n,F9).getItemStyle();null!=o&&(l.fill=o),null!=s&&(l.opacity=s);var c={inheritColor:ME(o)?o:"#000"},u=_(n,F9),h=mN(u,null,c,!1,!0);h.text=u.getShallow("show")?BE(t.getFormattedLabel(n,F9),kZ(e,n)):null;var p=gN(u,c,!1);return b(i,l),l=p9(l,h,p),i&&x(l,i),l.legacy=!0,l},ordinalRawValue:function(t,i){null==i&&(i=a),t=t||0;var n=e.getDimensionInfo(t);if(!n){var r=e.getDimensionIndex(t);return r>=0?e.getStore().get(r,i):void 0}var o=e.get(n.name,i),s=n&&n.ordinalMeta;return s?s.categories[o]:o},styleEmphasis:function(i,n){"production"!==process.env.NODE_ENV&&f9("api.styleEmphasis","Please write literal style directly instead.");null==n&&(n=a);var r=v(n,z9).getItemStyle(),o=_(n,z9),s=mN(o,null,null,!0,!0);s.text=o.getShallow("show")?zE(t.getFormattedLabel(n,z9),t.getFormattedLabel(n,F9),kZ(e,n)):null;var l=gN(o,null,!0);return b(i,r),r=p9(r,s,l),i&&x(r,i),r.legacy=!0,r},visual:function(t,i){if(null==i&&(i=a),$E($6,t)){var n=e.getItemVisual(i,"style");return n?n[$6[t]]:null}if($E(t9,t))return e.getItemVisual(i,t)},barLayout:function(t){if("cartesian2d"===o.type){return function(t){var e=[],i=t.axis,n="axis0";if("category"===i.type){for(var r=i.getBandWidth(),o=0;o<t.count;o++)e.push(dE({bandWidth:r,axisKey:n,stackId:lW+o},t));var s=dW(e),a=[];for(o=0;o<t.count;o++){var l=s[n][lW+o];l.offsetCenter=l.offset+l.width/2,a.push(l)}return a}}(dE({axis:o.getBaseAxis()},t))}},currentSeriesIndices:function(){return i.getCurrentSeriesIndices()},font:function(t){return bN(t,i)}},s.api||{}),u={context:{},seriesId:t.id,seriesName:t.name,seriesIndex:t.seriesIndex,coordSys:s.coordSys,dataInsideLength:e.count(),encode:r8(t.getData())},h={},p={},d={},f={},m=0;m<G9.length;m++){var g=G9[m];d[g]=t.getModel(j9[g]),f[g]=t.getModel(H9[g])}function y(t){return t===a?l||(l=e.getItemModel(t)):e.getItemModel(t)}function v(t,i){return e.hasItemOption?t===a?h[i]||(h[i]=y(t).getModel(j9[i])):y(t).getModel(j9[i]):d[i]}function _(t,i){return e.hasItemOption?t===a?p[i]||(p[i]=y(t).getModel(H9[i])):y(t).getModel(H9[i]):f[i]}return function(t,i){return a=t,l=null,h={},p={},r&&r(dE({dataIndexInside:t,dataIndex:e.getRawIndex(t),actionType:i?i.type:null},u),c)};function x(t,e){for(var i in e)$E(e,i)&&(t[i]=e[i])}function b(t,e){t&&(t.textFill&&(e.textFill=t.textFill),t.textPosition&&(e.textPosition=t.textPosition))}}function r8(t){var e={};return yE(t.dimensions,(function(i){var n=t.getDimensionInfo(i);if(!n.isExtraCoord){var r=n.coordDim;(e[r]=e[r]||[])[n.coordDimIndex]=t.getDimensionIndex(i)}})),e}function o8(t,e,i,n,r,o,s){if(n){var a=s8(t,e,i,n,r,o);return a&&s.setItemGraphicEl(i,a),a&&XR(a,n.focus,n.blurScope,n.emphasisDisabled),a}o.remove(e)}function s8(t,e,i,n,r,o){"production"!==process.env.NODE_ENV&&UE(n,"should not have an null/undefined element setting");var s=-1,a=e;e&&a8(e,n,r)&&(s=fE(o.childrenRef(),e),e=null);var l,c,u=!e,h=e;h?h.clearStates():(h=$9(n),a&&(l=a,(c=h).copyTransform(l),Q9(c)&&Q9(l)&&(c.setStyle(l.style),c.z=l.z,c.z2=l.z2,c.zlevel=l.zlevel,c.invisible=l.invisible,c.ignore=l.ignore,Y9(c)&&Y9(l)&&c.setShape(l.shape)))),!1===n.morph?h.disableMorphing=!0:h.disableMorphing&&(h.disableMorphing=!1),X9.normal.cfg=X9.normal.conOpt=X9.emphasis.cfg=X9.emphasis.conOpt=X9.blur.cfg=X9.blur.conOpt=X9.select.cfg=X9.select.conOpt=null,X9.isLegacy=!1,function(t,e,i,n,r,o){if(t.isGroup)return;l8(i,null,o),l8(i,z9,o);var s=o.normal.conOpt,a=o.emphasis.conOpt,l=o.blur.conOpt,c=o.select.conOpt;if(null!=s||null!=a||null!=c||null!=l){var u=t.getTextContent();if(!1===s)u&&t.removeTextContent();else{s=o.normal.conOpt=s||{type:"text"},u?u.clearStates():(u=$9(s),t.setTextContent(u)),t8(null,u,e,s,null,n,r);for(var h=s&&s.style,p=0;p<G9.length;p++){var d=G9[p];if(d!==F9){var f=o[d].conOpt;e8(d,u,0,u8(s,f,d),null)}}h?u.dirty():u.markRedraw()}}}(h,i,n,r,u,X9),function(t,e,i,n,r){var o=i.clipPath;if(!1===o)t&&t.getClipPath()&&t.removeClipPath();else if(o){var s=t.getClipPath();s&&a8(s,o,n)&&(s=null),s||(s=$9(o),"production"!==process.env.NODE_ENV&&UE(Y9(s),"Only any type of `path` can be used in `clipPath`, rather than "+s.type+"."),t.setClipPath(s)),t8(null,s,e,o,null,n,r)}}(h,i,n,r,u),t8(t,h,i,n,X9,r,u),$E(n,"info")&&(e9(h).info=n.info);for(var p=0;p<G9.length;p++){var d=G9[p];if(d!==F9){var f=c8(n,d);e8(d,h,0,u8(n,f,d),X9)}}return function(t,e,i){if(!t.isGroup){var n=t,r=i.currentZ,o=i.currentZLevel;n.z=r,n.zlevel=o;var s=e.z2;null!=s&&(n.z2=s||0);for(var a=0;a<G9.length;a++)i8(n,e,G9[a])}}(h,n,r),"group"===n.type&&function(t,e,i,n,r){var o=n.children,s=o?o.length:0,a=n.$mergeChildren,l="byName"===a||n.diffChildrenByName,c=!1===a;if(!s&&!l&&!c)return;if(l)return u={api:t,oldChildren:e.children()||[],newChildren:o||[],dataIndex:i,seriesModel:r,group:e},void new oH(u.oldChildren,u.newChildren,p8,p8,u).add(d8).update(d8).remove(f8).execute();var u;c&&e.removeAll();for(var h=0;h<s;h++){var p=o[h],d=e.childAt(h);p?(null==p.ignore&&(p.ignore=!1),s8(t,d,i,p,r,e)):("production"!==process.env.NODE_ENV&&UE(d,"renderItem should not return a group containing elements as null/undefined/{} if they do not exist before."),d.ignore=!0)}for(var f=e.childCount()-1;f>=h;f--){var m=e.childAt(f);h8(e,m,r)}}(t,h,i,n,r),s>=0?o.replaceAt(h,s):o.add(h),h}function a8(t,e,i){var n,r=e9(t),o=e.type,s=e.shape,a=e.style;return i.isUniversalTransitionEnabled()||null!=o&&o!==r.customGraphicType||"path"===o&&((n=s)&&($E(n,"pathData")||$E(n,"d")))&&m8(s)!==r.customPathData||"image"===o&&$E(a,"image")&&a.image!==r.customImagePath}function l8(t,e,i){var n=e?c8(t,e):t,r=e?u8(t,n,z9):t.style,o=t.type,s=n?n.textConfig:null,a=t.textContent,l=a?e?c8(a,e):a:null;if(r&&(i.isLegacy||c9(r,o,!!s,!!l))){i.isLegacy=!0;var c=u9(r,o,!e);!s&&c.textConfig&&(s=c.textConfig),!l&&c.textContent&&(l=c.textContent)}if(!e&&l){var u=l;!u.type&&(u.type="text"),"production"!==process.env.NODE_ENV&&UE("text"===u.type,'textContent.type must be "text"')}var h=e?i[e]:i.normal;h.cfg=s,h.conOpt=l}function c8(t,e){return e?t?t[e]:null:t}function u8(t,e,i){var n=e&&e.style;return null==n&&i===z9&&t&&(n=t.styleEmphasis),n}function h8(t,e,i){e&&E9(e,e9(t).option,i)}function p8(t,e){var i=t&&t.name;return null!=i?i:q9+e}function d8(t,e){var i=this.context,n=null!=t?i.newChildren[t]:null,r=null!=e?i.oldChildren[e]:null;s8(i.api,r,i.dataIndex,n,i.seriesModel,i.group)}function f8(t){var e=this.context,i=e.oldChildren[t];i&&E9(i,e9(i).option,e.seriesModel)}function m8(t){return t&&(t.pathData||t.d)}var g8=wP(),y8=cE,v8=wE,_8=function(){function t(){this._dragging=!1,this.animationThreshold=15}return t.prototype.render=function(t,e,i,n){var r=e.get("value"),o=e.get("status");if(this._axisModel=t,this._axisPointerModel=e,this._api=i,n||this._lastValue!==r||this._lastStatus!==o){this._lastValue=r,this._lastStatus=o;var s=this._group,a=this._handle;if(!o||"hide"===o)return s&&s.hide(),void(a&&a.hide());s&&s.show(),a&&a.show();var l={};this.makeElOption(l,r,t,e,i);var c=l.graphicKey;c!==this._lastGraphicKey&&this.clear(i),this._lastGraphicKey=c;var u=this._moveAnimation=this.determineAnimation(t,e);if(s){var h=AE(x8,e,u);this.updatePointerEl(s,l,h),this.updateLabelEl(s,l,h,e)}else s=this._group=new xC,this.createPointerEl(s,l,t,e),this.createLabelEl(s,l,t,e),i.getZr().add(s);E8(s,e,!0),this._renderHandle(r)}},t.prototype.remove=function(t){this.clear(t)},t.prototype.dispose=function(t){this.clear(t)},t.prototype.determineAnimation=function(t,e){var i=e.get("animation"),n=t.axis,r="category"===n.type,o=e.get("snap");if(!o&&!r)return!1;if("auto"===i||null==i){var s=this.animationThreshold;if(r&&n.getBandWidth()>s)return!0;if(o){var a=sJ(t).seriesDataCount,l=n.getExtent();return Math.abs(l[0]-l[1])/a>s}return!1}return!0===i},t.prototype.makeElOption=function(t,e,i,n,r){},t.prototype.createPointerEl=function(t,e,i,n){var r=e.pointer;if(r){var o=g8(t).pointerEl=new cN[r.type](y8(e.pointer));t.add(o)}},t.prototype.createLabelEl=function(t,e,i,n){if(e.label){var r=g8(t).labelEl=new JD(y8(e.label));t.add(r),w8(r,n)}},t.prototype.updatePointerEl=function(t,e,i){var n=g8(t).pointerEl;n&&e.pointer&&(n.setStyle(e.pointer.style),i(n,{shape:e.pointer.shape}))},t.prototype.updateLabelEl=function(t,e,i,n){var r=g8(t).labelEl;r&&(r.setStyle(e.label.style),i(r,{x:e.label.x,y:e.label.y}),w8(r,n))},t.prototype._renderHandle=function(t){if(!this._dragging&&this.updateHandleTransform){var e,i=this._axisPointerModel,n=this._api.getZr(),r=this._handle,o=i.getModel("handle"),s=i.get("status");if(!o.get("show")||!s||"hide"===s)return r&&n.remove(r),void(this._handle=null);this._handle||(e=!0,r=this._handle=iN(o.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){jS(t.event)},onmousedown:v8(this._onHandleDragMove,this,0,0),drift:v8(this._onHandleDragMove,this),ondragend:v8(this._onHandleDragEnd,this)}),n.add(r)),E8(r,i,!1),r.setStyle(o.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var a=o.get("size");EE(a)||(a=[a,a]),r.scaleX=a[0]/2,r.scaleY=a[1]/2,aU(this,"_doDispatchAxisPointer",o.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,e)}},t.prototype._moveHandleToValue=function(t,e){x8(this._axisPointerModel,!e&&this._moveAnimation,this._handle,A8(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},t.prototype._onHandleDragMove=function(t,e){var i=this._handle;if(i){this._dragging=!0;var n=this.updateHandleTransform(A8(i),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr(A8(n)),g8(i).lastProp=null,this._doDispatchAxisPointer()}},t.prototype._doDispatchAxisPointer=function(){if(this._handle){var t=this._payloadInfo,e=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:e.axis.dim,axisIndex:e.componentIndex}]})}},t.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var t=this._axisPointerModel.get("value");this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"})}},t.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),i=this._group,n=this._handle;e&&i&&(this._lastGraphicKey=null,i&&e.remove(i),n&&e.remove(n),this._group=null,this._handle=null,this._payloadInfo=null),lU(this,"_doDispatchAxisPointer")},t.prototype.doClear=function(){},t.prototype.buildLabel=function(t,e,i){return{x:t[i=i||0],y:t[1-i],width:e[i],height:e[1-i]}},t}();function x8(t,e,i,n){b8(g8(i).lastProp,n)||(g8(i).lastProp=n,e?Pk(i,n,t):(i.stopAnimation(),i.attr(n)))}function b8(t,e){if(CE(t)&&CE(e)){var i=!0;return yE(e,(function(e,n){i=i&&b8(t[n],e)})),!!i}return t===e}function w8(t,e){t[e.get(["label","show"])?"show":"hide"]()}function A8(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function E8(t,e,i){var n=e.get("z"),r=e.get("zlevel");t&&t.traverse((function(t){"group"!==t.type&&(null!=n&&(t.z=n),null!=r&&(t.zlevel=r),t.silent=i)}))}var S8=_8;function M8(t){var e,i=t.get("type"),n=t.getModel(i+"Style");return"line"===i?(e=n.getLineStyle()).fill=null:"shadow"===i&&((e=n.getAreaStyle()).stroke=null),e}function T8(t,e,i,n,r){var o=I8(i.get("value"),e.axis,e.ecModel,i.get("seriesDataIndices"),{precision:i.get(["label","precision"]),formatter:i.get(["label","formatter"])}),s=i.getModel("label"),a=CB(s.get("padding")||0),l=s.getFont(),c=iC(o,l),u=r.position,h=c.width+a[1]+a[3],p=c.height+a[0]+a[2],d=r.align;"right"===d&&(u[0]-=h),"center"===d&&(u[0]-=h/2);var f=r.verticalAlign;"bottom"===f&&(u[1]-=p),"middle"===f&&(u[1]-=p/2),function(t,e,i,n){var r=n.getWidth(),o=n.getHeight();t[0]=Math.min(t[0]+e,r)-e,t[1]=Math.min(t[1]+i,o)-i,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}(u,h,p,n);var m=s.get("backgroundColor");m&&"auto"!==m||(m=e.get(["axisLine","lineStyle","color"])),t.label={x:u[0],y:u[1],style:mN(s,{text:o,font:l,fill:s.getTextColor(),padding:a,backgroundColor:m}),z2:10}}function I8(t,e,i,n,r){t=e.scale.parse(t);var o=e.scale.getLabel({value:t},{precision:r.precision}),s=r.formatter;if(s){var a={value:XW(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};yE(n,(function(t){var e=i.getSeriesByIndex(t.seriesIndex),n=t.dataIndexInside,r=e&&e.getDataParams(n);r&&a.seriesData.push(r)})),ME(s)?o=s.replace("{value}",o):SE(s)&&(o=s(a))}return o}function C8(t,e,i){var n=[1,0,0,1,0,0];return KS(n,n,i.rotation),JS(n,n,i.position),Jk([t.dataToCoord(e),(i.labelOffset||0)+(i.labelDirection||1)*(i.labelMargin||0)],n)}function P8(t,e,i,n,r,o){var s=nJ.innerTextLayout(i.rotation,0,i.labelDirection);i.labelMargin=r.get(["label","margin"]),T8(e,n,r,o,{position:C8(n.axis,t,i),align:s.textAlign,verticalAlign:s.textVerticalAlign})}function L8(t,e,i){return{x1:t[i=i||0],y1:t[1-i],x2:e[i],y2:e[1-i]}}function D8(t,e,i){return{x:t[i=i||0],y:t[1-i],width:e[i],height:e[1-i]}}function R8(t,e,i,n,r,o){return{cx:t,cy:e,r0:i,r:n,startAngle:r,endAngle:o,clockwise:!0}}var O8=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return zA(e,t),e.prototype.makeElOption=function(t,e,i,n,r){var o=i.axis,s=o.grid,a=n.get("type"),l=k8(s,o).getOtherAxis(o).getGlobalExtent(),c=o.toGlobalCoord(o.dataToCoord(e,!0));if(a&&"none"!==a){var u=M8(n),h=N8[a](o,c,l);h.style=u,t.graphicKey=h.type,t.pointer=h}P8(e,t,VQ(s.model,i),i,n,r)},e.prototype.getHandleTransform=function(t,e,i){var n=VQ(e.axis.grid.model,e,{labelInside:!1});n.labelMargin=i.get(["handle","margin"]);var r=C8(e.axis,t,n);return{x:r[0],y:r[1],rotation:n.rotation+(n.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,e,i,n){var r=i.axis,o=r.grid,s=r.getGlobalExtent(!0),a=k8(o,r).getOtherAxis(r).getGlobalExtent(),l="x"===r.dim?0:1,c=[t.x,t.y];c[l]+=e[l],c[l]=Math.min(s[1],c[l]),c[l]=Math.max(s[0],c[l]);var u=(a[1]+a[0])/2,h=[u,u];h[l]=c[l];return{x:c[0],y:c[1],rotation:t.rotation,cursorPoint:h,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}},e}(S8);function k8(t,e){var i={};return i[e.dim+"AxisIndex"]=e.index,t.getCartesian(i)}var N8={line:function(t,e,i){return{type:"Line",subPixelOptimize:!0,shape:L8([e,i[0]],[e,i[1]],B8(t))}},shadow:function(t,e,i){var n=Math.max(1,t.getBandWidth()),r=i[1]-i[0];return{type:"Rect",shape:D8([e-n/2,i[0]],[n,r],B8(t))}}};function B8(t){return"x"===t.dim?0:1}var z8=O8,F8=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.type="axisPointer",e.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},e}(YB),V8=F8,U8=wP(),G8=yE;function j8(t,e,i){if(!UA.node){var n=e.getZr();U8(n).records||(U8(n).records={}),function(t,e){if(U8(t).initialized)return;function i(i,n){t.on(i,(function(i){var r=function(t){var e={showTip:[],hideTip:[]},i=function(n){var r=e[n.type];r?r.push(n):(n.dispatchAction=i,t.dispatchAction(n))};return{dispatchAction:i,pendings:e}}(e);G8(U8(t).records,(function(t){t&&n(t,i,r.dispatchAction)})),function(t,e){var i,n=t.showTip.length,r=t.hideTip.length;n?i=t.showTip[n-1]:r&&(i=t.hideTip[r-1]);i&&(i.dispatchAction=null,e.dispatchAction(i))}(r.pendings,e)}))}U8(t).initialized=!0,i("click",AE(W8,"click")),i("mousemove",AE(W8,"mousemove")),i("globalout",H8)}(n,e),(U8(n).records[t]||(U8(n).records[t]={})).handler=i}}function H8(t,e,i){t.handler("leave",null,i)}function W8(t,e,i,n){e.handler(t,i,n)}function q8(t,e){if(!UA.node){var i=e.getZr();(U8(i).records||{})[t]&&(U8(i).records[t]=null)}}var X8=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.render=function(t,e,i){var n=e.getComponent("tooltip"),r=t.get("triggerOn")||n&&n.get("triggerOn")||"mousemove|click";j8("axisPointer",i,(function(t,e,i){"none"!==r&&("leave"===t||r.indexOf(t)>=0)&&i({type:"updateAxisPointer",currTrigger:t,x:e&&e.offsetX,y:e&&e.offsetY})}))},e.prototype.remove=function(t,e){q8("axisPointer",e)},e.prototype.dispose=function(t,e){q8("axisPointer",e)},e.type="axisPointer",e}(qV),Z8=X8;function Y8(t,e){var i,n=[],r=t.seriesIndex;if(null==r||!(i=e.getSeriesByIndex(r)))return{point:[]};var o=i.getData(),s=bP(o,t);if(null==s||s<0||EE(s))return{point:[]};var a=o.getItemGraphicEl(s),l=i.coordinateSystem;if(i.getTooltipPosition)n=i.getTooltipPosition(s)||[];else if(l&&l.dataToPoint)if(t.isStacked){var c=l.getBaseAxis(),u=l.getOtherAxis(c).dim,h=c.dim,p="x"===u||"radius"===u?1:0,d=o.mapDimension(h),f=[];f[p]=o.get(d,s),f[1-p]=o.get(o.getCalculationInfo("stackResultDimension"),s),n=l.dataToPoint(f)||[]}else n=l.dataToPoint(o.getValues(vE(l.dimensions,(function(t){return o.mapDimension(t)})),s))||[];else if(a){var m=a.getBoundingRect().clone();m.applyTransform(a.transform),n=[m.x+m.width/2,m.y+m.height/2]}return{point:n,el:a}}var Q8=wP();function J8(t,e,i){var n=t.currTrigger,r=[t.x,t.y],o=t,s=t.dispatchAction||wE(i.dispatchAction,i),a=e.getComponent("axisPointer").coordSysAxesInfo;if(a){i7(r)&&(r=Y8({seriesIndex:o.seriesIndex,dataIndex:o.dataIndex},e).point);var l=i7(r),c=o.axesInfo,u=a.axesInfo,h="leave"===n||i7(r),p={},d={},f={list:[],map:{}},m={showPointer:AE($8,d),showTooltip:AE(t7,f)};yE(a.coordSysMap,(function(t,e){var i=l||t.containPoint(r);yE(a.coordSysAxesInfo[e],(function(t,e){var n=t.axis,o=function(t,e){for(var i=0;i<(t||[]).length;i++){var n=t[i];if(e.axis.dim===n.axisDim&&e.axis.model.componentIndex===n.axisIndex)return n}}(c,t);if(!h&&i&&(!c||o)){var s=o&&o.value;null!=s||l||(s=n.pointToData(r)),null!=s&&K8(t,s,m,!1,p)}}))}));var g={};return yE(u,(function(t,e){var i=t.linkGroup;i&&!d[e]&&yE(i.axesInfo,(function(e,n){var r=d[n];if(e!==t&&r){var o=r.value;i.mapper&&(o=t.axis.scale.parse(i.mapper(o,e7(e),e7(t)))),g[t.key]=o}}))})),yE(g,(function(t,e){K8(u[e],t,m,!0,p)})),function(t,e,i){var n=i.axesInfo=[];yE(e,(function(e,i){var r=e.axisPointerModel.option,o=t[i];o?(!e.useHandle&&(r.status="show"),r.value=o.value,r.seriesDataIndices=(o.payloadBatch||[]).slice()):!e.useHandle&&(r.status="hide"),"show"===r.status&&n.push({axisDim:e.axis.dim,axisIndex:e.axis.model.componentIndex,value:r.value})}))}(d,u,p),function(t,e,i,n){if(i7(e)||!t.list.length)return void n({type:"hideTip"});var r=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:i.tooltipOption,position:i.position,dataIndexInside:r.dataIndexInside,dataIndex:r.dataIndex,seriesIndex:r.seriesIndex,dataByCoordSys:t.list})}(f,r,t,s),function(t,e,i){var n=i.getZr(),r="axisPointerLastHighlights",o=Q8(n)[r]||{},s=Q8(n)[r]={};yE(t,(function(t,e){var i=t.axisPointerModel.option;"show"===i.status&&t.triggerEmphasis&&yE(i.seriesDataIndices,(function(t){var e=t.seriesIndex+" | "+t.dataIndex;s[e]=t}))}));var a=[],l=[];yE(o,(function(t,e){!s[e]&&l.push(t)})),yE(s,(function(t,e){!o[e]&&a.push(t)})),l.length&&i.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),a.length&&i.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:a})}(u,0,i),p}}function K8(t,e,i,n,r){var o=t.axis;if(!o.scale.isBlank()&&o.containData(e))if(t.involveSeries){var s=function(t,e){var i=e.axis,n=i.dim,r=t,o=[],s=Number.MAX_VALUE,a=-1;return yE(e.seriesModels,(function(e,l){var c,u,h=e.getData().mapDimensionsAll(n);if(e.getAxisTooltipData){var p=e.getAxisTooltipData(h,t,i);u=p.dataIndices,c=p.nestestValue}else{if(!(u=e.getData().indicesOfNearest(h[0],t,"category"===i.type?.5:null)).length)return;c=e.getData().get(h[0],u[0])}if(null!=c&&isFinite(c)){var d=t-c,f=Math.abs(d);f<=s&&((f<s||d>=0&&a<0)&&(s=f,a=d,r=c,o.length=0),yE(u,(function(t){o.push({seriesIndex:e.seriesIndex,dataIndexInside:t,dataIndex:e.getData().getRawIndex(t)})})))}})),{payloadBatch:o,snapToValue:r}}(e,t),a=s.payloadBatch,l=s.snapToValue;a[0]&&null==r.seriesIndex&&pE(r,a[0]),!n&&t.snap&&o.containData(l)&&null!=l&&(e=l),i.showPointer(t,e,a),i.showTooltip(t,s,l)}else i.showPointer(t,e)}function $8(t,e,i,n){t[e.key]={value:i,payloadBatch:n}}function t7(t,e,i,n){var r=i.payloadBatch,o=e.axis,s=o.model,a=e.axisPointerModel;if(e.triggerTooltip&&r.length){var l=e.coordSys.model,c=lJ(l),u=t.map[c];u||(u=t.map[c]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(u)),u.dataByAxis.push({axisDim:o.dim,axisIndex:s.componentIndex,axisType:s.type,axisId:s.id,value:n,valueLabelOpt:{precision:a.get(["label","precision"]),formatter:a.get(["label","formatter"])},seriesDataIndices:r.slice()})}}function e7(t){var e=t.axis.model,i={},n=i.axisDim=t.axis.dim;return i.axisIndex=i[n+"AxisIndex"]=e.componentIndex,i.axisName=i[n+"AxisName"]=e.name,i.axisId=i[n+"AxisId"]=e.id,i}function i7(t){return!t||null==t[0]||isNaN(t[0])||null==t[1]||isNaN(t[1])}function n7(t){hJ.registerAxisPointerClass("CartesianAxisPointer",z8),t.registerComponentModel(V8),t.registerComponentView(Z8),t.registerPreprocessor((function(t){if(t){(!t.axisPointer||0===t.axisPointer.length)&&(t.axisPointer={});var e=t.axisPointer.link;e&&!EE(e)&&(t.axisPointer.link=[e])}})),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,(function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=rJ(t,e)})),t.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},J8)}var r7=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return zA(e,t),e.prototype.makeElOption=function(t,e,i,n,r){var o=i.axis;"angle"===o.dim&&(this.animationThreshold=Math.PI/18);var s=o.polar,a=s.getOtherAxis(o).getExtent(),l=o.dataToCoord(e),c=n.get("type");if(c&&"none"!==c){var u=M8(n),h=o7[c](o,s,l,a);h.style=u,t.graphicKey=h.type,t.pointer=h}var p=function(t,e,i,n,r){var o=e.axis,s=o.dataToCoord(t),a=n.getAngleAxis().getExtent()[0];a=a/180*Math.PI;var l,c,u,h=n.getRadiusAxis().getExtent();if("radius"===o.dim){var p=[1,0,0,1,0,0];KS(p,p,a),JS(p,p,[n.cx,n.cy]),l=Jk([s,-r],p);var d=e.getModel("axisLabel").get("rotate")||0,f=nJ.innerTextLayout(a,d*Math.PI/180,-1);c=f.textAlign,u=f.textVerticalAlign}else{var m=h[1];l=n.coordToPoint([m+r,s]);var g=n.cx,y=n.cy;c=Math.abs(l[0]-g)/m<.3?"center":l[0]>g?"left":"right",u=Math.abs(l[1]-y)/m<.3?"middle":l[1]>y?"top":"bottom"}return{position:l,align:c,verticalAlign:u}}(e,i,0,s,n.get(["label","margin"]));T8(t,i,n,r,p)},e}(S8);var o7={line:function(t,e,i,n){return"angle"===t.dim?{type:"Line",shape:L8(e.coordToPoint([n[0],i]),e.coordToPoint([n[1],i]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r:i}}},shadow:function(t,e,i,n){var r=Math.max(1,t.getBandWidth()),o=Math.PI/180;return"angle"===t.dim?{type:"Sector",shape:R8(e.cx,e.cy,n[0],n[1],(-i-r/2)*o,(r/2-i)*o)}:{type:"Sector",shape:R8(e.cx,e.cy,i-r/2,i+r/2,0,2*Math.PI)}}},s7=r7,a7=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.findAxisModel=function(t){var e;return this.ecModel.eachComponent(t,(function(t){t.getCoordSysModel()===this&&(e=t)}),this),e},e.type="polar",e.dependencies=["radiusAxis","angleAxis"],e.defaultOption={z:0,center:["50%","50%"],radius:"80%"},e}(YB),l7=a7,c7=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return zA(e,t),e.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",MP).models[0]},e.type="polarAxis",e}(YB);mE(c7,KW);var u7=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.type="angleAxis",e}(c7),h7=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.type="radiusAxis",e}(c7),p7=function(t){function e(e,i){return t.call(this,"radius",e,i)||this}return zA(e,t),e.prototype.pointToData=function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},e}(Sq);p7.prototype.dataToRadius=Sq.prototype.dataToCoord,p7.prototype.radiusToData=Sq.prototype.coordToData;var d7=p7,f7=wP(),m7=function(t){function e(e,i){return t.call(this,"angle",e,i||[0,360])||this}return zA(e,t),e.prototype.pointToData=function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},e.prototype.calculateCategoryInterval=function(){var t=this,e=t.getLabelModel(),i=t.scale,n=i.getExtent(),r=i.count();if(n[1]-n[0]<1)return 0;var o=n[0],s=t.dataToCoord(o+1)-t.dataToCoord(o),a=Math.abs(s),l=iC(null==o?"":o+"",e.getFont(),"center","top"),c=Math.max(l.height,7)/a;isNaN(c)&&(c=1/0);var u=Math.max(0,Math.floor(c)),h=f7(t.model),p=h.lastAutoInterval,d=h.lastTickCount;return null!=p&&null!=d&&Math.abs(p-u)<=1&&Math.abs(d-r)<=1&&p>u?u=p:(h.lastTickCount=r,h.lastAutoInterval=u),u},e}(Sq);m7.prototype.dataToAngle=Sq.prototype.dataToCoord,m7.prototype.angleToData=Sq.prototype.coordToData;var g7=m7,y7=["radius","angle"],v7=function(){function t(t){this.dimensions=y7,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new d7,this._angleAxis=new g7,this.axisPointerEnabled=!0,this.name=t||"",this._radiusAxis.polar=this._angleAxis.polar=this}return t.prototype.containPoint=function(t){var e=this.pointToCoord(t);return this._radiusAxis.contain(e[0])&&this._angleAxis.contain(e[1])},t.prototype.containData=function(t){return this._radiusAxis.containData(t[0])&&this._angleAxis.containData(t[1])},t.prototype.getAxis=function(t){return this["_"+t+"Axis"]},t.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},t.prototype.getAxesByScale=function(t){var e=[],i=this._angleAxis,n=this._radiusAxis;return i.scale.type===t&&e.push(i),n.scale.type===t&&e.push(n),e},t.prototype.getAngleAxis=function(){return this._angleAxis},t.prototype.getRadiusAxis=function(){return this._radiusAxis},t.prototype.getOtherAxis=function(t){var e=this._angleAxis;return t===e?this._radiusAxis:e},t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},t.prototype.getTooltipAxes=function(t){var e=null!=t&&"auto"!==t?this.getAxis(t):this.getBaseAxis();return{baseAxes:[e],otherAxes:[this.getOtherAxis(e)]}},t.prototype.dataToPoint=function(t,e){return this.coordToPoint([this._radiusAxis.dataToRadius(t[0],e),this._angleAxis.dataToAngle(t[1],e)])},t.prototype.pointToData=function(t,e){var i=this.pointToCoord(t);return[this._radiusAxis.radiusToData(i[0],e),this._angleAxis.angleToData(i[1],e)]},t.prototype.pointToCoord=function(t){var e=t[0]-this.cx,i=t[1]-this.cy,n=this.getAngleAxis(),r=n.getExtent(),o=Math.min(r[0],r[1]),s=Math.max(r[0],r[1]);n.inverse?o=s-360:s=o+360;var a=Math.sqrt(e*e+i*i);e/=a,i/=a;for(var l=Math.atan2(-i,e)/Math.PI*180,c=l<o?1:-1;l<o||l>s;)l+=360*c;return[a,l]},t.prototype.coordToPoint=function(t){var e=t[0],i=t[1]/180*Math.PI;return[Math.cos(i)*e+this.cx,-Math.sin(i)*e+this.cy]},t.prototype.getArea=function(){var t=this.getAngleAxis(),e=this.getRadiusAxis().getExtent().slice();e[0]>e[1]&&e.reverse();var i=t.getExtent(),n=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:e[0],r:e[1],startAngle:-i[0]*n,endAngle:-i[1]*n,clockwise:t.inverse,contain:function(t,e){var i=t-this.cx,n=e-this.cy,r=i*i+n*n-1e-4,o=this.r,s=this.r0;return r<=o*o&&r>=s*s}}},t.prototype.convertToPixel=function(t,e,i){return _7(e)===this?this.dataToPoint(i):null},t.prototype.convertFromPixel=function(t,e,i){return _7(e)===this?this.pointToData(i):null},t}();function _7(t){var e=t.seriesModel,i=t.polarModel;return i&&i.coordinateSystem||e&&e.coordinateSystem}var x7=v7;function b7(t,e){var i=this,n=i.getAngleAxis(),r=i.getRadiusAxis();if(n.scale.setExtent(1/0,-1/0),r.scale.setExtent(1/0,-1/0),t.eachSeries((function(t){if(t.coordinateSystem===i){var e=t.getData();yE(JW(e,"radius"),(function(t){r.scale.unionExtentFromData(e,t)})),yE(JW(e,"angle"),(function(t){n.scale.unionExtentFromData(e,t)}))}})),HW(n.scale,n.model),HW(r.scale,r.model),"category"===n.type&&!n.onBand){var o=n.getExtent(),s=360/n.scale.count();n.inverse?o[1]+=s:o[1]-=s,n.setExtent(o[0],o[1])}}function w7(t,e){if(t.type=e.get("type"),t.scale=WW(e),t.onBand=e.get("boundaryGap")&&"category"===t.type,t.inverse=e.get("inverse"),function(t){return"angleAxis"===t.mainType}(e)){t.inverse=t.inverse!==e.get("clockwise");var i=e.get("startAngle");t.setExtent(i,i+(t.inverse?-360:360))}e.axis=t,t.model=e}var A7={dimensions:y7,create:function(t,e){var i=[];return t.eachComponent("polar",(function(t,n){var r=new x7(n+"");r.update=b7;var o=r.getRadiusAxis(),s=r.getAngleAxis(),a=t.findAxisModel("radiusAxis"),l=t.findAxisModel("angleAxis");w7(o,a),w7(s,l),function(t,e,i){var n=e.get("center"),r=i.getWidth(),o=i.getHeight();t.cx=IC(n[0],r),t.cy=IC(n[1],o);var s=t.getRadiusAxis(),a=Math.min(r,o)/2,l=e.get("radius");null==l?l=[0,"100%"]:EE(l)||(l=[0,l]);var c=[IC(l[0],a),IC(l[1],a)];s.inverse?s.setExtent(c[1],c[0]):s.setExtent(c[0],c[1])}(r,t,e),i.push(r),t.coordinateSystem=r,r.model=t})),t.eachSeries((function(t){if("polar"===t.get("coordinateSystem")){var e=t.getReferringComponents("polar",MP).models[0];if("production"!==process.env.NODE_ENV&&!e)throw new Error('Polar "'+NE(t.get("polarIndex"),t.get("polarId"),0)+'" not found');t.coordinateSystem=e.coordinateSystem}})),i}},E7=A7,S7=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function M7(t,e,i){e[1]>e[0]&&(e=e.slice().reverse());var n=t.coordToPoint([e[0],i]),r=t.coordToPoint([e[1],i]);return{x1:n[0],y1:n[1],x2:r[0],y2:r[1]}}function T7(t){return t.getRadiusAxis().inverse?0:1}function I7(t){var e=t[0],i=t[t.length-1];e&&i&&Math.abs(Math.abs(e.coord-i.coord)-360)<1e-4&&t.pop()}var C7=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.axisPointerClass="PolarAxisPointer",i}return zA(e,t),e.prototype.render=function(t,e){if(this.group.removeAll(),t.get("show")){var i=t.axis,n=i.polar,r=n.getRadiusAxis().getExtent(),o=i.getTicksCoords(),s=i.getMinorTicksCoords(),a=vE(i.getViewLabels(),(function(t){t=cE(t);var e=i.scale,n="ordinal"===e.type?e.getRawOrdinalNumber(t.tickValue):t.tickValue;return t.coord=i.dataToCoord(n),t}));I7(a),I7(o),yE(S7,(function(e){!t.get([e,"show"])||i.scale.isBlank()&&"axisLine"!==e||P7[e](this.group,t,n,o,s,r,a)}),this)}},e.type="angleAxis",e}(hJ),P7={axisLine:function(t,e,i,n,r,o){var s,a=e.getModel(["axisLine","lineStyle"]),l=T7(i),c=l?0:1;(s=0===o[c]?new EO({shape:{cx:i.cx,cy:i.cy,r:o[l]},style:a.getLineStyle(),z2:1,silent:!0}):new qO({shape:{cx:i.cx,cy:i.cy,r:o[l],r0:o[c]},style:a.getLineStyle(),z2:1,silent:!0})).style.fill=null,t.add(s)},axisTick:function(t,e,i,n,r,o){var s=e.getModel("axisTick"),a=(s.get("inside")?-1:1)*s.get("length"),l=o[T7(i)],c=vE(n,(function(t){return new nk({shape:M7(i,[l,l+a],t.coord)})}));t.add(qk(c,{style:dE(s.getModel("lineStyle").getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])})}))},minorTick:function(t,e,i,n,r,o){if(r.length){for(var s=e.getModel("axisTick"),a=e.getModel("minorTick"),l=(s.get("inside")?-1:1)*a.get("length"),c=o[T7(i)],u=[],h=0;h<r.length;h++)for(var p=0;p<r[h].length;p++)u.push(new nk({shape:M7(i,[c,c+l],r[h][p].coord)}));t.add(qk(u,{style:dE(a.getModel("lineStyle").getLineStyle(),dE(s.getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])}))}))}},axisLabel:function(t,e,i,n,r,o,s){var a=e.getCategories(!0),l=e.getModel("axisLabel"),c=l.get("margin"),u=e.get("triggerEvent");yE(s,(function(n,r){var s=l,h=n.tickValue,p=o[T7(i)],d=i.coordToPoint([p+c,n.coord]),f=i.cx,m=i.cy,g=Math.abs(d[0]-f)/p<.3?"center":d[0]>f?"left":"right",y=Math.abs(d[1]-m)/p<.3?"middle":d[1]>m?"top":"bottom";if(a&&a[h]){var v=a[h];CE(v)&&v.textStyle&&(s=new FN(v.textStyle,l,l.ecModel))}var _=new JD({silent:nJ.isLabelSilent(e),style:mN(s,{x:d[0],y:d[1],fill:s.getTextColor()||e.get(["axisLine","lineStyle","color"]),text:n.formattedLabel,align:g,verticalAlign:y})});if(t.add(_),u){var x=nJ.makeAxisEventDataBase(e);x.targetType="axisLabel",x.value=n.rawLabel,KD(_).eventData=x}}),this)},splitLine:function(t,e,i,n,r,o){var s=e.getModel("splitLine").getModel("lineStyle"),a=s.get("color"),l=0;a=a instanceof Array?a:[a];for(var c=[],u=0;u<n.length;u++){var h=l++%a.length;c[h]=c[h]||[],c[h].push(new nk({shape:M7(i,o,n[u].coord)}))}for(u=0;u<c.length;u++)t.add(qk(c[u],{style:dE({stroke:a[u%a.length]},s.getLineStyle()),silent:!0,z:e.get("z")}))},minorSplitLine:function(t,e,i,n,r,o){if(r.length){for(var s=e.getModel("minorSplitLine").getModel("lineStyle"),a=[],l=0;l<r.length;l++)for(var c=0;c<r[l].length;c++)a.push(new nk({shape:M7(i,o,r[l][c].coord)}));t.add(qk(a,{style:s.getLineStyle(),silent:!0,z:e.get("z")}))}},splitArea:function(t,e,i,n,r,o){if(n.length){var s=e.getModel("splitArea").getModel("areaStyle"),a=s.get("color"),l=0;a=a instanceof Array?a:[a];for(var c=[],u=Math.PI/180,h=-n[0].coord*u,p=Math.min(o[0],o[1]),d=Math.max(o[0],o[1]),f=e.get("clockwise"),m=1,g=n.length;m<=g;m++){var y=m===g?n[0].coord:n[m].coord,v=l++%a.length;c[v]=c[v]||[],c[v].push(new jO({shape:{cx:i.cx,cy:i.cy,r0:p,r:d,startAngle:h,endAngle:-y*u,clockwise:f},silent:!0})),h=-y*u}for(m=0;m<c.length;m++)t.add(qk(c[m],{style:dE({fill:a[m%a.length]},s.getAreaStyle()),silent:!0}))}}},L7=C7,D7=["axisLine","axisTickLabel","axisName"],R7=["splitLine","splitArea","minorSplitLine"],O7=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.axisPointerClass="PolarAxisPointer",i}return zA(e,t),e.prototype.render=function(t,e){if(this.group.removeAll(),t.get("show")){var i=this._axisGroup,n=this._axisGroup=new xC;this.group.add(n);var r=t.axis,o=r.polar,s=o.getAngleAxis(),a=r.getTicksCoords(),l=r.getMinorTicksCoords(),c=s.getExtent()[0],u=r.getExtent(),h=function(t,e,i){return{position:[t.cx,t.cy],rotation:i/180*Math.PI,labelDirection:-1,tickDirection:-1,nameDirection:1,labelRotate:e.getModel("axisLabel").get("rotate"),z2:1}}(o,t,c),p=new nJ(t,h);yE(D7,p.add,p),n.add(p.getGroup()),tN(i,n,t),yE(R7,(function(e){t.get([e,"show"])&&!r.scale.isBlank()&&k7[e](this.group,t,o,c,u,a,l)}),this)}},e.type="radiusAxis",e}(hJ),k7={splitLine:function(t,e,i,n,r,o){var s=e.getModel("splitLine").getModel("lineStyle"),a=s.get("color"),l=0;a=a instanceof Array?a:[a];for(var c=[],u=0;u<o.length;u++){var h=l++%a.length;c[h]=c[h]||[],c[h].push(new EO({shape:{cx:i.cx,cy:i.cy,r:Math.max(o[u].coord,0)}}))}for(u=0;u<c.length;u++)t.add(qk(c[u],{style:dE({stroke:a[u%a.length],fill:null},s.getLineStyle()),silent:!0}))},minorSplitLine:function(t,e,i,n,r,o,s){if(s.length){for(var a=e.getModel("minorSplitLine").getModel("lineStyle"),l=[],c=0;c<s.length;c++)for(var u=0;u<s[c].length;u++)l.push(new EO({shape:{cx:i.cx,cy:i.cy,r:s[c][u].coord}}));t.add(qk(l,{style:dE({fill:null},a.getLineStyle()),silent:!0}))}},splitArea:function(t,e,i,n,r,o){if(o.length){var s=e.getModel("splitArea").getModel("areaStyle"),a=s.get("color"),l=0;a=a instanceof Array?a:[a];for(var c=[],u=o[0].coord,h=1;h<o.length;h++){var p=l++%a.length;c[p]=c[p]||[],c[p].push(new jO({shape:{cx:i.cx,cy:i.cy,r0:u,r:o[h].coord,startAngle:0,endAngle:2*Math.PI},silent:!0})),u=o[h].coord}for(h=0;h<c.length;h++)t.add(qk(c[h],{style:dE({fill:a[h%a.length]},s.getAreaStyle()),silent:!0}))}}};var N7=O7;function B7(t){return t.get("stack")||"__ec_stack_"+t.seriesIndex}function z7(t,e){return e.dim+t.model.componentIndex}function F7(t,e,i){var n={},r=function(t){var e={};yE(t,(function(t,i){var n=t.getData(),r=t.coordinateSystem,o=r.getBaseAxis(),s=z7(r,o),a=o.getExtent(),l="category"===o.type?o.getBandWidth():Math.abs(a[1]-a[0])/n.count(),c=e[s]||{bandWidth:l,remainedWidth:l,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},u=c.stacks;e[s]=c;var h=B7(t);u[h]||c.autoWidthCount++,u[h]=u[h]||{width:0,maxWidth:0};var p=IC(t.get("barWidth"),l),d=IC(t.get("barMaxWidth"),l),f=t.get("barGap"),m=t.get("barCategoryGap");p&&!u[h].width&&(p=Math.min(c.remainedWidth,p),u[h].width=p,c.remainedWidth-=p),d&&(u[h].maxWidth=d),null!=f&&(c.gap=f),null!=m&&(c.categoryGap=m)}));var i={};return yE(e,(function(t,e){i[e]={};var n=t.stacks,r=t.bandWidth,o=IC(t.categoryGap,r),s=IC(t.gap,1),a=t.remainedWidth,l=t.autoWidthCount,c=(a-o)/(l+(l-1)*s);c=Math.max(c,0),yE(n,(function(t,e){var i=t.maxWidth;i&&i<c&&(i=Math.min(i,a),t.width&&(i=Math.min(i,t.width)),a-=i,t.width=i,l--)})),c=(a-o)/(l+(l-1)*s),c=Math.max(c,0);var u,h=0;yE(n,(function(t,e){t.width||(t.width=c),u=t,h+=t.width*(1+s)})),u&&(h-=u.width*s);var p=-h/2;yE(n,(function(t,n){i[e][n]=i[e][n]||{offset:p,width:t.width},p+=t.width*(1+s)}))})),i}(xE(e.getSeriesByType(t),(function(t){return!e.isSeriesFiltered(t)&&t.coordinateSystem&&"polar"===t.coordinateSystem.type})));e.eachSeriesByType(t,(function(t){if("polar"===t.coordinateSystem.type){var e=t.getData(),i=t.coordinateSystem,o=i.getBaseAxis(),s=z7(i,o),a=B7(t),l=r[s][a],c=l.offset,u=l.width,h=i.getOtherAxis(o),p=t.coordinateSystem.cx,d=t.coordinateSystem.cy,f=t.get("barMinHeight")||0,m=t.get("barMinAngle")||0;n[a]=n[a]||[];for(var g=e.mapDimension(h.dim),y=e.mapDimension(o.dim),v=BH(e,g),_="radius"!==o.dim||!t.get("roundCap",!0),x=h.dataToCoord(0),b=0,w=e.count();b<w;b++){var A=e.get(g,b),E=e.get(y,b),S=A>=0?"p":"n",M=x;v&&(n[a][E]||(n[a][E]={p:x,n:x}),M=n[a][E][S]);var T=void 0,I=void 0,C=void 0,P=void 0;if("radius"===h.dim){var L=h.dataToCoord(A)-x,D=o.dataToCoord(E);Math.abs(L)<f&&(L=(L<0?-1:1)*f),T=M,I=M+L,P=(C=D-c)-u,v&&(n[a][E][S]=I)}else{var R=h.dataToCoord(A,_)-x,O=o.dataToCoord(E);Math.abs(R)<m&&(R=(R<0?-1:1)*m),I=(T=O+c)+u,C=M,P=M+R,v&&(n[a][E][S]=P)}e.setItemLayout(b,{cx:p,cy:d,r0:T,r:I,startAngle:-C*Math.PI/180,endAngle:-P*Math.PI/180,clockwise:C>=P})}}}))}var V7={startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:0}},U7={splitNumber:5},G7=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.type="polar",e}(qV);function j7(t,e){e=e||{};var i=t.coordinateSystem,n=t.axis,r={},o=n.position,s=n.orient,a=i.getRect(),l=[a.x,a.x+a.width,a.y,a.y+a.height],c={horizontal:{top:l[2],bottom:l[3]},vertical:{left:l[0],right:l[1]}};r.position=["vertical"===s?c.vertical[o]:l[0],"horizontal"===s?c.horizontal[o]:l[3]];r.rotation=Math.PI/2*{horizontal:0,vertical:1}[s];r.labelDirection=r.tickDirection=r.nameDirection={top:-1,bottom:1,right:1,left:-1}[o],t.get(["axisTick","inside"])&&(r.tickDirection=-r.tickDirection),NE(e.labelInside,t.get(["axisLabel","inside"]))&&(r.labelDirection=-r.labelDirection);var u=e.rotate;return null==u&&(u=t.get(["axisLabel","rotate"])),r.labelRotation="top"===o?-u:u,r.z2=1,r}var H7=["axisLine","axisTickLabel","axisName"],W7=["splitArea","splitLine"],q7=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.axisPointerClass="SingleAxisPointer",i}return zA(e,t),e.prototype.render=function(e,i,n,r){var o=this.group;o.removeAll();var s=this._axisGroup;this._axisGroup=new xC;var a=j7(e),l=new nJ(e,a);yE(H7,l.add,l),o.add(this._axisGroup),o.add(l.getGroup()),yE(W7,(function(t){e.get([t,"show"])&&X7[t](this,this.group,this._axisGroup,e)}),this),tN(s,this._axisGroup,e),t.prototype.render.call(this,e,i,n,r)},e.prototype.remove=function(){fJ(this)},e.type="singleAxis",e}(hJ),X7={splitLine:function(t,e,i,n){var r=n.axis;if(!r.scale.isBlank()){var o=n.getModel("splitLine"),s=o.getModel("lineStyle"),a=s.get("color");a=a instanceof Array?a:[a];for(var l=s.get("width"),c=n.coordinateSystem.getRect(),u=r.isHorizontal(),h=[],p=0,d=r.getTicksCoords({tickModel:o}),f=[],m=[],g=0;g<d.length;++g){var y=r.toGlobalCoord(d[g].coord);u?(f[0]=y,f[1]=c.y,m[0]=y,m[1]=c.y+c.height):(f[0]=c.x,f[1]=y,m[0]=c.x+c.width,m[1]=y);var v=new nk({shape:{x1:f[0],y1:f[1],x2:m[0],y2:m[1]},silent:!0});Zk(v.shape,l);var _=p++%a.length;h[_]=h[_]||[],h[_].push(v)}var x=s.getLineStyle(["color"]);for(g=0;g<h.length;++g)e.add(qk(h[g],{style:dE({stroke:a[g%a.length]},x),silent:!0}))}},splitArea:function(t,e,i,n){dJ(t,i,n,n)}},Z7=q7,Y7=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.getCoordSysModel=function(){return this},e.type="singleAxis",e.layoutMode="box",e.defaultOption={left:"5%",top:"5%",right:"5%",bottom:"5%",type:"value",position:"bottom",orient:"horizontal",axisLine:{show:!0,lineStyle:{width:1,type:"solid"}},tooltip:{show:!0},axisTick:{show:!0,length:6,lineStyle:{width:1}},axisLabel:{show:!0,interval:"auto"},splitLine:{show:!0,lineStyle:{type:"dashed",opacity:.2}}},e}(YB);mE(Y7,KW.prototype);var Q7=Y7,J7=function(t){function e(e,i,n,r,o){var s=t.call(this,e,i,n)||this;return s.type=r||"value",s.position=o||"bottom",s}return zA(e,t),e.prototype.isHorizontal=function(){var t=this.position;return"top"===t||"bottom"===t},e.prototype.pointToData=function(t,e){return this.coordinateSystem.pointToData(t)[0]},e}(Sq),K7=J7,$7=["single"],ttt=function(){function t(t,e,i){this.type="single",this.dimension="single",this.dimensions=$7,this.axisPointerEnabled=!0,this.model=t,this._init(t,e,i)}return t.prototype._init=function(t,e,i){var n=this.dimension,r=new K7(n,WW(t),[0,0],t.get("type"),t.get("position")),o="category"===r.type;r.onBand=o&&t.get("boundaryGap"),r.inverse=t.get("inverse"),r.orient=t.get("orient"),t.axis=r,r.model=t,r.coordinateSystem=this,this._axis=r},t.prototype.update=function(t,e){t.eachSeries((function(t){if(t.coordinateSystem===this){var e=t.getData();yE(e.mapDimensionsAll(this.dimension),(function(t){this._axis.scale.unionExtentFromData(e,t)}),this),HW(this._axis.scale,this._axis.model)}}),this)},t.prototype.resize=function(t,e){this._rect=UB({left:t.get("left"),top:t.get("top"),right:t.get("right"),bottom:t.get("bottom"),width:t.get("width"),height:t.get("height")},{width:e.getWidth(),height:e.getHeight()}),this._adjustAxis()},t.prototype.getRect=function(){return this._rect},t.prototype._adjustAxis=function(){var t=this._rect,e=this._axis,i=e.isHorizontal(),n=i?[0,t.width]:[0,t.height],r=e.inverse?1:0;e.setExtent(n[r],n[1-r]),this._updateAxisTransform(e,i?t.x:t.y)},t.prototype._updateAxisTransform=function(t,e){var i=t.getExtent(),n=i[0]+i[1],r=t.isHorizontal();t.toGlobalCoord=r?function(t){return t+e}:function(t){return n-t+e},t.toLocalCoord=r?function(t){return t-e}:function(t){return n-t+e}},t.prototype.getAxis=function(){return this._axis},t.prototype.getBaseAxis=function(){return this._axis},t.prototype.getAxes=function(){return[this._axis]},t.prototype.getTooltipAxes=function(){return{baseAxes:[this.getAxis()],otherAxes:[]}},t.prototype.containPoint=function(t){var e=this.getRect(),i=this.getAxis();return"horizontal"===i.orient?i.contain(i.toLocalCoord(t[0]))&&t[1]>=e.y&&t[1]<=e.y+e.height:i.contain(i.toLocalCoord(t[1]))&&t[0]>=e.y&&t[0]<=e.y+e.height},t.prototype.pointToData=function(t){var e=this.getAxis();return[e.coordToData(e.toLocalCoord(t["horizontal"===e.orient?0:1]))]},t.prototype.dataToPoint=function(t){var e=this.getAxis(),i=this.getRect(),n=[],r="horizontal"===e.orient?0:1;return t instanceof Array&&(t=t[0]),n[r]=e.toGlobalCoord(e.dataToCoord(+t)),n[1-r]=0===r?i.y+i.height/2:i.x+i.width/2,n},t.prototype.convertToPixel=function(t,e,i){return ett(e)===this?this.dataToPoint(i):null},t.prototype.convertFromPixel=function(t,e,i){return ett(e)===this?this.pointToData(i):null},t}();function ett(t){var e=t.seriesModel,i=t.singleAxisModel;return i&&i.coordinateSystem||e&&e.coordinateSystem}var itt={create:function(t,e){var i=[];return t.eachComponent("singleAxis",(function(n,r){var o=new ttt(n,t,e);o.name="single_"+r,o.resize(n,e),n.coordinateSystem=o,i.push(o)})),t.eachSeries((function(t){if("singleAxis"===t.get("coordinateSystem")){var e=t.getReferringComponents("singleAxis",MP).models[0];t.coordinateSystem=e&&e.coordinateSystem}})),i},dimensions:$7},ntt=["x","y"],rtt=["width","height"],ott=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return zA(e,t),e.prototype.makeElOption=function(t,e,i,n,r){var o=i.axis,s=o.coordinateSystem,a=ltt(s,1-att(o)),l=s.dataToPoint(e)[0],c=n.get("type");if(c&&"none"!==c){var u=M8(n),h=stt[c](o,l,a);h.style=u,t.graphicKey=h.type,t.pointer=h}P8(e,t,j7(i),i,n,r)},e.prototype.getHandleTransform=function(t,e,i){var n=j7(e,{labelInside:!1});n.labelMargin=i.get(["handle","margin"]);var r=C8(e.axis,t,n);return{x:r[0],y:r[1],rotation:n.rotation+(n.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,e,i,n){var r=i.axis,o=r.coordinateSystem,s=att(r),a=ltt(o,s),l=[t.x,t.y];l[s]+=e[s],l[s]=Math.min(a[1],l[s]),l[s]=Math.max(a[0],l[s]);var c=ltt(o,1-s),u=(c[1]+c[0])/2,h=[u,u];return h[s]=l[s],{x:l[0],y:l[1],rotation:t.rotation,cursorPoint:h,tooltipOption:{verticalAlign:"middle"}}},e}(S8),stt={line:function(t,e,i){return{type:"Line",subPixelOptimize:!0,shape:L8([e,i[0]],[e,i[1]],att(t))}},shadow:function(t,e,i){var n=t.getBandWidth(),r=i[1]-i[0];return{type:"Rect",shape:D8([e-n/2,i[0]],[n,r],att(t))}}};function att(t){return t.isHorizontal()?0:1}function ltt(t,e){var i=t.getRect();return[i[ntt[e]],i[ntt[e]]+i[rtt[e]]]}var ctt=ott,utt=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.type="single",e}(qV);var htt=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.init=function(e,i,n){var r=WB(e);t.prototype.init.apply(this,arguments),ptt(e,r)},e.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),ptt(this.option,e)},e.prototype.getCellSize=function(){return this.option.cellSize},e.type="calendar",e.defaultOption={z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},e}(YB);function ptt(t,e){var i,n=t.cellSize;1===(i=EE(n)?n:t.cellSize=[n,n]).length&&(i[1]=i[0]);var r=vE([0,1],(function(t){return function(t,e){return null!=t[zB[e][0]]||null!=t[zB[e][1]]&&null!=t[zB[e][2]]}(e,t)&&(i[t]="auto"),null!=i[t]&&"auto"!==i[t]}));HB(t,e,{type:"box",ignoreSize:r})}var dtt=htt,ftt=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.render=function(t,e,i){var n=this.group;n.removeAll();var r=t.coordinateSystem,o=r.getRangeInfo(),s=r.getOrient(),a=e.getLocaleModel();this._renderDayRect(t,o,n),this._renderLines(t,o,s,n),this._renderYearText(t,o,s,n),this._renderMonthText(t,a,s,n),this._renderWeekText(t,a,o,s,n)},e.prototype._renderDayRect=function(t,e,i){for(var n=t.coordinateSystem,r=t.getModel("itemStyle").getItemStyle(),o=n.getCellWidth(),s=n.getCellHeight(),a=e.start.time;a<=e.end.time;a=n.getNextNDay(a,1).time){var l=n.dataToRect([a],!1).tl,c=new kD({shape:{x:l[0],y:l[1],width:o,height:s},cursor:"default",style:r});i.add(c)}},e.prototype._renderLines=function(t,e,i,n){var r=this,o=t.coordinateSystem,s=t.getModel(["splitLine","lineStyle"]).getLineStyle(),a=t.get(["splitLine","show"]),l=s.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var c=e.start,u=0;c.time<=e.end.time;u++){p(c.formatedDate),0===u&&(c=o.getDateInfo(e.start.y+"-"+e.start.m));var h=c.date;h.setMonth(h.getMonth()+1),c=o.getDateInfo(h)}function p(e){r._firstDayOfMonth.push(o.getDateInfo(e)),r._firstDayPoints.push(o.dataToRect([e],!1).tl);var l=r._getLinePointsOfOneWeek(t,e,i);r._tlpoints.push(l[0]),r._blpoints.push(l[l.length-1]),a&&r._drawSplitline(l,s,n)}p(o.getNextNDay(e.end.time,1).formatedDate),a&&this._drawSplitline(r._getEdgesPoints(r._tlpoints,l,i),s,n),a&&this._drawSplitline(r._getEdgesPoints(r._blpoints,l,i),s,n)},e.prototype._getEdgesPoints=function(t,e,i){var n=[t[0].slice(),t[t.length-1].slice()],r="horizontal"===i?0:1;return n[0][r]=n[0][r]-e/2,n[1][r]=n[1][r]+e/2,n},e.prototype._drawSplitline=function(t,e,i){var n=new $O({z2:20,shape:{points:t},style:e});i.add(n)},e.prototype._getLinePointsOfOneWeek=function(t,e,i){for(var n=t.coordinateSystem,r=n.getDateInfo(e),o=[],s=0;s<7;s++){var a=n.getNextNDay(r.time,s),l=n.dataToRect([a.time],!1);o[2*a.day]=l.tl,o[2*a.day+1]=l["horizontal"===i?"bl":"tr"]}return o},e.prototype._formatterLabel=function(t,e){return ME(t)&&t?function(t,e,i){return yE(e,(function(e,n){t=t.replace("{"+n+"}",i?RS(e):e)})),t}(t,e):SE(t)?t(e):e.nameMap},e.prototype._yearTextPositionControl=function(t,e,i,n,r){var o=e[0],s=e[1],a=["center","bottom"];"bottom"===n?(s+=r,a=["center","top"]):"left"===n?o-=r:"right"===n?(o+=r,a=["center","top"]):s-=r;var l=0;return"left"!==n&&"right"!==n||(l=Math.PI/2),{rotation:l,x:o,y:s,style:{align:a[0],verticalAlign:a[1]}}},e.prototype._renderYearText=function(t,e,i,n){var r=t.getModel("yearLabel");if(r.get("show")){var o=r.get("margin"),s=r.get("position");s||(s="horizontal"!==i?"top":"left");var a=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],l=(a[0][0]+a[1][0])/2,c=(a[0][1]+a[1][1])/2,u="horizontal"===i?0:1,h={top:[l,a[u][1]],bottom:[l,a[1-u][1]],left:[a[1-u][0],c],right:[a[u][0],c]},p=e.start.y;+e.end.y>+e.start.y&&(p=p+"-"+e.end.y);var d=r.get("formatter"),f={start:e.start.y,end:e.end.y,nameMap:p},m=this._formatterLabel(d,f),g=new JD({z2:30,style:mN(r,{text:m})});g.attr(this._yearTextPositionControl(g,h[s],i,s,o)),n.add(g)}},e.prototype._monthTextPositionControl=function(t,e,i,n,r){var o="left",s="top",a=t[0],l=t[1];return"horizontal"===i?(l+=r,e&&(o="center"),"start"===n&&(s="bottom")):(a+=r,e&&(s="middle"),"start"===n&&(o="right")),{x:a,y:l,align:o,verticalAlign:s}},e.prototype._renderMonthText=function(t,e,i,n){var r=t.getModel("monthLabel");if(r.get("show")){var o=r.get("nameMap"),s=r.get("margin"),a=r.get("position"),l=r.get("align"),c=[this._tlpoints,this._blpoints];o&&!ME(o)||(o&&(e=QN(o)||e),o=e.get(["time","monthAbbr"])||[]);var u="start"===a?0:1,h="horizontal"===i?0:1;s="start"===a?-s:s;for(var p="center"===l,d=0;d<c[u].length-1;d++){var f=c[u][d].slice(),m=this._firstDayOfMonth[d];if(p){var g=this._firstDayPoints[d];f[h]=(g[h]+c[0][d+1][h])/2}var y=r.get("formatter"),v=o[+m.m-1],_={yyyy:m.y,yy:(m.y+"").slice(2),MM:m.m,M:+m.m,nameMap:v},x=this._formatterLabel(y,_),b=new JD({z2:30,style:pE(mN(r,{text:x}),this._monthTextPositionControl(f,p,i,a,s))});n.add(b)}}},e.prototype._weekTextPositionControl=function(t,e,i,n,r){var o="center",s="middle",a=t[0],l=t[1],c="start"===i;return"horizontal"===e?(a=a+n+(c?1:-1)*r[0]/2,o=c?"right":"left"):(l=l+n+(c?1:-1)*r[1]/2,s=c?"bottom":"top"),{x:a,y:l,align:o,verticalAlign:s}},e.prototype._renderWeekText=function(t,e,i,n,r){var o=t.getModel("dayLabel");if(o.get("show")){var s=t.coordinateSystem,a=o.get("position"),l=o.get("nameMap"),c=o.get("margin"),u=s.getFirstDayOfWeek();if(!l||ME(l))l&&(e=QN(l)||e),l=e.get(["time","dayOfWeekShort"])||vE(e.get(["time","dayOfWeekAbbr"]),(function(t){return t[0]}));var h=s.getNextNDay(i.end.time,7-i.lweek).time,p=[s.getCellWidth(),s.getCellHeight()];c=IC(c,Math.min(p[1],p[0])),"start"===a&&(h=s.getNextNDay(i.start.time,-(7+i.fweek)).time,c=-c);for(var d=0;d<7;d++){var f,m=s.getNextNDay(h,d),g=s.dataToRect([m.time],!1).center;f=Math.abs((d+u)%7);var y=new JD({z2:30,style:pE(mN(o,{text:l[f]}),this._weekTextPositionControl(g,n,a,c,p))});r.add(y)}}},e.type="calendar",e}(qV),mtt=ftt,gtt=864e5,ytt=function(){function t(e,i,n){this.type="calendar",this.dimensions=t.dimensions,this.getDimensionsInfo=t.getDimensionsInfo,this._model=e}return t.getDimensionsInfo=function(){return[{name:"time",type:"time"},"value"]},t.prototype.getRangeInfo=function(){return this._rangeInfo},t.prototype.getModel=function(){return this._model},t.prototype.getRect=function(){return this._rect},t.prototype.getCellWidth=function(){return this._sw},t.prototype.getCellHeight=function(){return this._sh},t.prototype.getOrient=function(){return this._orient},t.prototype.getFirstDayOfWeek=function(){return this._firstDayOfWeek},t.prototype.getDateInfo=function(t){var e=(t=FC(t)).getFullYear(),i=t.getMonth()+1,n=i<10?"0"+i:""+i,r=t.getDate(),o=r<10?"0"+r:""+r,s=t.getDay();return{y:e+"",m:n,d:o,day:s=Math.abs((s+7-this.getFirstDayOfWeek())%7),time:t.getTime(),formatedDate:e+"-"+n+"-"+o,date:t}},t.prototype.getNextNDay=function(t,e){return 0===(e=e||0)||(t=new Date(this.getDateInfo(t).time)).setDate(t.getDate()+e),this.getDateInfo(t)},t.prototype.update=function(t,e){this._firstDayOfWeek=+this._model.getModel("dayLabel").get("firstDay"),this._orient=this._model.get("orient"),this._lineWidth=this._model.getModel("itemStyle").getItemStyle().lineWidth||0,this._rangeInfo=this._getRangeInfo(this._initRangeOption());var i=this._rangeInfo.weeks||1,n=["width","height"],r=this._model.getCellSize().slice(),o=this._model.getBoxLayoutParams(),s="horizontal"===this._orient?[i,7]:[7,i];yE([0,1],(function(t){c(r,t)&&(o[n[t]]=r[t]*s[t])}));var a={width:e.getWidth(),height:e.getHeight()},l=this._rect=UB(o,a);function c(t,e){return null!=t[e]&&"auto"!==t[e]}yE([0,1],(function(t){c(r,t)||(r[t]=l[n[t]]/s[t])})),this._sw=r[0],this._sh=r[1]},t.prototype.dataToPoint=function(t,e){EE(t)&&(t=t[0]),null==e&&(e=!0);var i=this.getDateInfo(t),n=this._rangeInfo,r=i.formatedDate;if(e&&!(i.time>=n.start.time&&i.time<n.end.time+gtt))return[NaN,NaN];var o=i.day,s=this._getRangeInfo([n.start.time,r]).nthWeek;return"vertical"===this._orient?[this._rect.x+o*this._sw+this._sw/2,this._rect.y+s*this._sh+this._sh/2]:[this._rect.x+s*this._sw+this._sw/2,this._rect.y+o*this._sh+this._sh/2]},t.prototype.pointToData=function(t){var e=this.pointToDate(t);return e&&e.time},t.prototype.dataToRect=function(t,e){var i=this.dataToPoint(t,e);return{contentShape:{x:i[0]-(this._sw-this._lineWidth)/2,y:i[1]-(this._sh-this._lineWidth)/2,width:this._sw-this._lineWidth,height:this._sh-this._lineWidth},center:i,tl:[i[0]-this._sw/2,i[1]-this._sh/2],tr:[i[0]+this._sw/2,i[1]-this._sh/2],br:[i[0]+this._sw/2,i[1]+this._sh/2],bl:[i[0]-this._sw/2,i[1]+this._sh/2]}},t.prototype.pointToDate=function(t){var e=Math.floor((t[0]-this._rect.x)/this._sw)+1,i=Math.floor((t[1]-this._rect.y)/this._sh)+1,n=this._rangeInfo.range;return"vertical"===this._orient?this._getDateByWeeksAndDay(i,e-1,n):this._getDateByWeeksAndDay(e,i-1,n)},t.prototype.convertToPixel=function(t,e,i){var n=vtt(e);return n===this?n.dataToPoint(i):null},t.prototype.convertFromPixel=function(t,e,i){var n=vtt(e);return n===this?n.pointToData(i):null},t.prototype.containPoint=function(t){return console.warn("Not implemented."),!1},t.prototype._initRangeOption=function(){var t,e=this._model.get("range");if(EE(e)&&1===e.length&&(e=e[0]),EE(e))t=e;else{var i=e.toString();if(/^\d{4}$/.test(i)&&(t=[i+"-01-01",i+"-12-31"]),/^\d{4}[\/|-]\d{1,2}$/.test(i)){var n=this.getDateInfo(i),r=n.date;r.setMonth(r.getMonth()+1);var o=this.getNextNDay(r,-1);t=[n.formatedDate,o.formatedDate]}/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(i)&&(t=[i,i])}if(!t)return"production"!==process.env.NODE_ENV&&lE("Invalid date range."),e;var s=this._getRangeInfo(t);return s.start.time>s.end.time&&t.reverse(),t},t.prototype._getRangeInfo=function(t){var e,i=[this.getDateInfo(t[0]),this.getDateInfo(t[1])];i[0].time>i[1].time&&(e=!0,i.reverse());var n=Math.floor(i[1].time/gtt)-Math.floor(i[0].time/gtt)+1,r=new Date(i[0].time),o=r.getDate(),s=i[1].date.getDate();r.setDate(o+n-1);var a=r.getDate();if(a!==s)for(var l=r.getTime()-i[1].time>0?1:-1;(a=r.getDate())!==s&&(r.getTime()-i[1].time)*l>0;)n-=l,r.setDate(a-l);var c=Math.floor((n+i[0].day+6)/7),u=e?1-c:c-1;return e&&i.reverse(),{range:[i[0].formatedDate,i[1].formatedDate],start:i[0],end:i[1],allDay:n,weeks:c,nthWeek:u,fweek:i[0].day,lweek:i[1].day}},t.prototype._getDateByWeeksAndDay=function(t,e,i){var n=this._getRangeInfo(i);if(t>n.weeks||0===t&&e<n.fweek||t===n.weeks&&e>n.lweek)return null;var r=7*(t-1)-n.fweek+e,o=new Date(n.start.time);return o.setDate(+n.start.d+r),this.getDateInfo(o)},t.create=function(e,i){var n=[];return e.eachComponent("calendar",(function(e){var i=new t(e);n.push(i),e.coordinateSystem=i})),e.eachSeries((function(t){"calendar"===t.get("coordinateSystem")&&(t.coordinateSystem=n[t.get("calendarIndex")||0])})),n},t.dimensions=["time","value"],t}();function vtt(t){var e=t.calendarModel,i=t.seriesModel;return e?e.coordinateSystem:i?i.coordinateSystem:null}var _tt=ytt;function xtt(t,e){var i;return yE(e,(function(e){null!=t[e]&&"auto"!==t[e]&&(i=!0)})),i}var btt=["transition","enterFrom","leaveTo"],wtt=btt.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function Att(t,e,i){if(i&&(!t[i]&&e[i]&&(t[i]={}),t=t[i],e=e[i]),t&&e)for(var n=i?btt:wtt,r=0;r<n.length;r++){var o=n[r];null==t[o]&&null!=e[o]&&(t[o]=e[o])}}var Ett=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.preventAutoZ=!0,i}return zA(e,t),e.prototype.mergeOption=function(e,i){var n=this.option.elements;this.option.elements=null,t.prototype.mergeOption.call(this,e,i),this.option.elements=n},e.prototype.optionUpdated=function(t,e){var i=this.option,n=(e?i:t).elements,r=i.elements=e?[]:i.elements,o=[];this._flatten(n,o,null);var s=dP(r,o,"normalMerge"),a=this._elOptionsToUpdate=[];yE(s,(function(t,e){var i=t.newOption;"production"!==process.env.NODE_ENV&&UE(CE(i)||t.existing,"Empty graphic option definition"),i&&(a.push(i),function(t,e){var i=t.existing;if(e.id=t.keyInfo.id,!e.type&&i&&(e.type=i.type),null==e.parentId){var n=e.parentOption;n?e.parentId=n.id:i&&(e.parentId=i.parentId)}e.parentOption=null}(t,i),function(t,e,i){var n=pE({},i),r=t[e],o=i.$action||"merge";if("merge"===o)if(r){if("production"!==process.env.NODE_ENV){var s=i.type;UE(!s||r.type===s,'Please set $action: "replace" to change `type`')}uE(r,n,!0),HB(r,n,{ignoreSize:!0}),qB(i,r),Att(i,r),Att(i,r,"shape"),Att(i,r,"style"),Att(i,r,"extra"),i.clipPath=r.clipPath}else t[e]=n;else"replace"===o?t[e]=n:"remove"===o&&r&&(t[e]=null)}(r,e,i),function(t,e){if(t&&(t.hv=e.hv=[xtt(e,["left","right"]),xtt(e,["top","bottom"])],"group"===t.type)){var i=t,n=e;null==i.width&&(i.width=n.width=0),null==i.height&&(i.height=n.height=0)}}(r[e],i))}),this),i.elements=xE(r,(function(t){return t&&delete t.$action,null!=t}))},e.prototype._flatten=function(t,e,i){yE(t,(function(t){if(t){i&&(t.parentOption=i),e.push(t);var n=t.children;n&&n.length&&this._flatten(n,e,t),delete t.children}}),this)},e.prototype.useElOptionsToUpdate=function(){var t=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,t},e.type="graphic",e.defaultOption={elements:[]},e}(YB),Stt={path:null,compoundPath:null,group:xC,image:TD,text:JD},Mtt=wP(),Ttt=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.init=function(){this._elMap=YE()},e.prototype.render=function(t,e,i){t!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=t,this._updateElements(t),this._relocate(t,i)},e.prototype._updateElements=function(t){var e=t.useElOptionsToUpdate();if(e){var i=this._elMap,n=this.group,r=t.get("z"),o=t.get("zlevel");yE(e,(function(e){var s=gP(e.id,null),a=null!=s?i.get(s):null,l=gP(e.parentId,null),c=null!=l?i.get(l):n,u=e.type,h=e.style;"text"===u&&h&&e.hv&&e.hv[1]&&(h.textVerticalAlign=h.textBaseline=h.verticalAlign=h.align=null);var p=e.textContent,d=e.textConfig;if(h&&c9(h,u,!!d,!!p)){var f=u9(h,u,!0);!d&&f.textConfig&&(d=e.textConfig=f.textConfig),!p&&f.textContent&&(p=f.textContent)}var m=function(t){return t=pE({},t),yE(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(BB),(function(e){delete t[e]})),t}(e);"production"!==process.env.NODE_ENV&&a&&UE(c===a.parent,"Changing parent is not supported.");var g=e.$action||"merge",y="merge"===g,v="replace"===g;if(y){var _=a;(M=!a)?_=Ctt(s,c,e.type,i):(_&&(Mtt(_).isNew=!1),N9(_)),_&&(w9(_,m,t,{isInit:M}),Ltt(_,e,r,o))}else if(v){Ptt(a,e,i,t);var x=Ctt(s,c,e.type,i);x&&(w9(x,m,t,{isInit:!0}),Ltt(x,e,r,o))}else"remove"===g&&(A9(a,e),Ptt(a,e,i,t));var b=i.get(s);if(b&&p)if(y){var w=b.getTextContent();w?w.attr(p):b.setTextContent(new JD(p))}else v&&b.setTextContent(new JD(p));if(b){var A=e.clipPath;if(A){var E=A.type,S=void 0,M=!1;if(y){var T=b.getClipPath();S=(M=!T||Mtt(T).type!==E)?Itt(E):T}else v&&(M=!0,S=Itt(E));b.setClipPath(S),w9(S,A,t,{isInit:M}),B9(S,A.keyframeAnimation,t)}var I=Mtt(b);b.setTextConfig(d),I.option=e,function(t,e,i){var n=KD(t).eventData;t.silent||t.ignore||n||(n=KD(t).eventData={componentType:"graphic",componentIndex:e.componentIndex,name:t.name});n&&(n.info=i.info)}(b,t,e),sN({el:b,componentModel:t,itemName:b.name,itemTooltipOption:e.tooltip}),B9(b,e.keyframeAnimation,t)}}))}},e.prototype._relocate=function(t,e){for(var i=t.option.elements,n=this.group,r=this._elMap,o=e.getWidth(),s=e.getHeight(),a=["x","y"],l=0;l<i.length;l++){if((f=null!=(d=gP((p=i[l]).id,null))?r.get(d):null)&&f.isGroup){var c=(m=f.parent)===n,u=Mtt(f),h=Mtt(m);u.width=IC(u.option.width,c?o:h.width)||0,u.height=IC(u.option.height,c?s:h.height)||0}}for(l=i.length-1;l>=0;l--){var p,d,f;if(f=null!=(d=gP((p=i[l]).id,null))?r.get(d):null){var m=f.parent,g=(h=Mtt(m),{}),y=GB(f,p,m===n?{width:o,height:s}:{width:h.width,height:h.height},null,{hv:p.hv,boundingMode:p.bounding},g);if(!Mtt(f).isNew&&y){for(var v=p.transition,_={},x=0;x<a.length;x++){var b=a[x],w=g[b];v&&(S9(v)||fE(v,b)>=0)?_[b]=w:f[b]=w}Pk(f,_,t,0)}else f.attr(g)}}},e.prototype._clear=function(){var t=this,e=this._elMap;e.each((function(i){Ptt(i,Mtt(i).option,e,t._lastGraphicModel)})),this._elMap=YE()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(qV);function Itt(t){"production"!==process.env.NODE_ENV&&UE(t,"graphic type MUST be set");var e=$E(Stt,t)?Stt[t]:Gk(t);"production"!==process.env.NODE_ENV&&UE(e,"graphic type "+t+" can not be found");var i=new e({});return Mtt(i).type=t,i}function Ctt(t,e,i,n){var r=Itt(i);return e.add(r),n.set(t,r),Mtt(r).id=t,Mtt(r).isNew=!0,r}function Ptt(t,e,i,n){t&&t.parent&&("group"===t.type&&t.traverse((function(t){Ptt(t,e,i,n)})),E9(t,e,n),i.removeKey(Mtt(t).id))}function Ltt(t,e,i,n){t.isGroup||yE([["cursor",gL.prototype.cursor],["zlevel",n||0],["z",i||0],["z2",0]],(function(i){var n=i[0];$E(e,n)?t[n]=BE(e[n],i[1]):null==t[n]&&(t[n]=i[1])})),yE(bE(e),(function(i){if(0===i.indexOf("on")){var n=e[i];t[i]=SE(n)?n:null}})),$E(e,"draggable")&&(t.draggable=e.draggable),null!=e.name&&(t.name=e.name),null!=e.id&&(t.id=e.id)}var Dtt=["x","y","radius","angle","single"],Rtt=["cartesian2d","polar","singleAxis"];function Ott(t){return"production"!==process.env.NODE_ENV&&UE(t),t+"Axis"}function ktt(t,e){var i,n=YE(),r=[],o=YE();t.eachComponent({mainType:"dataZoom",query:e},(function(t){o.get(t.uid)||a(t)}));do{i=!1,t.eachComponent("dataZoom",s)}while(i);function s(t){!o.get(t.uid)&&function(t){var e=!1;return t.eachTargetAxis((function(t,i){var r=n.get(t);r&&r[i]&&(e=!0)})),e}(t)&&(a(t),i=!0)}function a(t){o.set(t.uid,!0),r.push(t),t.eachTargetAxis((function(t,e){(n.get(t)||n.set(t,[]))[e]=!0}))}return r}function Ntt(t){var e=t.ecModel,i={infoList:[],infoMap:YE()};return t.eachTargetAxis((function(t,n){var r=e.getComponent(Ott(t),n);if(r){var o=r.getCoordSysModel();if(o){var s=o.uid,a=i.infoMap.get(s);a||(a={model:o,axisModels:[]},i.infoList.push(a),i.infoMap.set(s,a)),a.axisModels.push(r)}}})),i}var Btt=function(){function t(){this.indexList=[],this.indexMap=[]}return t.prototype.add=function(t){this.indexMap[t]||(this.indexList.push(t),this.indexMap[t]=!0)},t}(),ztt=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i._autoThrottle=!0,i._noTarget=!0,i._rangePropMode=["percent","percent"],i}return zA(e,t),e.prototype.init=function(t,e,i){var n=Ftt(t);this.settledOption=n,this.mergeDefaultAndTheme(t,i),this._doInit(n)},e.prototype.mergeOption=function(t){var e=Ftt(t);uE(this.option,t,!0),uE(this.settledOption,e,!0),this._doInit(e)},e.prototype._doInit=function(t){var e=this.option;this._setDefaultThrottle(t),this._updateRangeUse(t);var i=this.settledOption;yE([["start","startValue"],["end","endValue"]],(function(t,n){"value"===this._rangePropMode[n]&&(e[t[0]]=i[t[0]]=null)}),this),this._resetTarget()},e.prototype._resetTarget=function(){var t=this.get("orient",!0),e=this._targetAxisInfoMap=YE();this._fillSpecifiedTargetAxis(e)?this._orient=t||this._makeAutoOrientByTargetAxis():(this._orient=t||"horizontal",this._fillAutoTargetAxisByOrient(e,this._orient)),this._noTarget=!0,e.each((function(t){t.indexList.length&&(this._noTarget=!1)}),this)},e.prototype._fillSpecifiedTargetAxis=function(t){var e=!1;return yE(Dtt,(function(i){var n=this.getReferringComponents(Ott(i),TP);if(n.specified){e=!0;var r=new Btt;yE(n.models,(function(t){r.add(t.componentIndex)})),t.set(i,r)}}),this),e},e.prototype._fillAutoTargetAxisByOrient=function(t,e){var i=this.ecModel,n=!0;if(n){var r="vertical"===e?"y":"x";o(i.findComponents({mainType:r+"Axis"}),r)}n&&o(i.findComponents({mainType:"singleAxis",filter:function(t){return t.get("orient",!0)===e}}),"single");function o(e,i){var r=e[0];if(r){var o=new Btt;if(o.add(r.componentIndex),t.set(i,o),n=!1,"x"===i||"y"===i){var s=r.getReferringComponents("grid",MP).models[0];s&&yE(e,(function(t){r.componentIndex!==t.componentIndex&&s===t.getReferringComponents("grid",MP).models[0]&&o.add(t.componentIndex)}))}}}n&&yE(Dtt,(function(e){if(n){var r=i.findComponents({mainType:Ott(e),filter:function(t){return"category"===t.get("type",!0)}});if(r[0]){var o=new Btt;o.add(r[0].componentIndex),t.set(e,o),n=!1}}}),this)},e.prototype._makeAutoOrientByTargetAxis=function(){var t;return this.eachTargetAxis((function(e){!t&&(t=e)}),this),"y"===t?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(t){if(t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var e=this.ecModel.option;this.option.throttle=e.animation&&e.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(t){var e=this._rangePropMode,i=this.get("rangeMode");yE([["start","startValue"],["end","endValue"]],(function(n,r){var o=null!=t[n[0]],s=null!=t[n[1]];o&&!s?e[r]="percent":!o&&s?e[r]="value":i?e[r]=i[r]:o&&(e[r]="percent")}))},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var t;return this.eachTargetAxis((function(e,i){null==t&&(t=this.ecModel.getComponent(Ott(e),i))}),this),t},e.prototype.eachTargetAxis=function(t,e){this._targetAxisInfoMap.each((function(i,n){yE(i.indexList,(function(i){t.call(e,n,i)}))}))},e.prototype.getAxisProxy=function(t,e){var i=this.getAxisModel(t,e);if(i)return i.__dzAxisProxy},e.prototype.getAxisModel=function(t,e){"production"!==process.env.NODE_ENV&&UE(t&&null!=e);var i=this._targetAxisInfoMap.get(t);if(i&&i.indexMap[e])return this.ecModel.getComponent(Ott(t),e)},e.prototype.setRawRange=function(t){var e=this.option,i=this.settledOption;yE([["start","startValue"],["end","endValue"]],(function(n){null==t[n[0]]&&null==t[n[1]]||(e[n[0]]=i[n[0]]=t[n[0]],e[n[1]]=i[n[1]]=t[n[1]])}),this),this._updateRangeUse(t)},e.prototype.setCalculatedRange=function(t){var e=this.option;yE(["start","startValue","end","endValue"],(function(i){e[i]=t[i]}))},e.prototype.getPercentRange=function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},e.prototype.getValueRange=function(t,e){if(null!=t||null!=e)return this.getAxisProxy(t,e).getDataValueWindow();var i=this.findRepresentativeAxisProxy();return i?i.getDataValueWindow():void 0},e.prototype.findRepresentativeAxisProxy=function(t){if(t)return t.__dzAxisProxy;for(var e,i=this._targetAxisInfoMap.keys(),n=0;n<i.length;n++)for(var r=i[n],o=this._targetAxisInfoMap.get(r),s=0;s<o.indexList.length;s++){var a=this.getAxisProxy(r,o.indexList[s]);if(a.hostedBy(this))return a;e||(e=a)}return e},e.prototype.getRangePropMode=function(){return this._rangePropMode.slice()},e.prototype.getOrient=function(){return"production"!==process.env.NODE_ENV&&UE(this._orient),this._orient},e.type="dataZoom",e.dependencies=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","series","toolbox"],e.defaultOption={z:4,filterMode:"filter",start:0,end:100},e}(YB);function Ftt(t){var e={};return yE(["start","end","startValue","endValue","throttle"],(function(i){t.hasOwnProperty(i)&&(e[i]=t[i])})),e}var Vtt=ztt,Utt=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.type="dataZoom.select",e}(Vtt),Gtt=Utt,jtt=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.render=function(t,e,i,n){this.dataZoomModel=t,this.ecModel=e,this.api=i},e.type="dataZoom",e}(qV),Htt=jtt,Wtt=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.type="dataZoom.select",e}(Htt),qtt=Wtt,Xtt=yE,Ztt=PC,Ytt=function(){function t(t,e,i,n){this._dimName=t,this._axisIndex=e,this.ecModel=n,this._dataZoomModel=i}return t.prototype.hostedBy=function(t){return this._dataZoomModel===t},t.prototype.getDataValueWindow=function(){return this._valueWindow.slice()},t.prototype.getDataPercentWindow=function(){return this._percentWindow.slice()},t.prototype.getTargetSeriesModels=function(){var t=[];return this.ecModel.eachSeries((function(e){if(function(t){var e=t.get("coordinateSystem");return fE(Rtt,e)>=0}(e)){var i=Ott(this._dimName),n=e.getReferringComponents(i,MP).models[0];n&&this._axisIndex===n.componentIndex&&t.push(e)}}),this),t},t.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},t.prototype.getMinMaxSpan=function(){return cE(this._minMaxSpan)},t.prototype.calculateDataWindow=function(t){var e,i=this._dataExtent,n=this.getAxisModel().axis.scale,r=this._dataZoomModel.getRangePropMode(),o=[0,100],s=[],a=[];Xtt(["start","end"],(function(l,c){var u=t[l],h=t[l+"Value"];"percent"===r[c]?(null==u&&(u=o[c]),h=n.parse(TC(u,o,i))):(e=!0,u=TC(h=null==h?i[c]:n.parse(h),i,o)),a[c]=null==h||isNaN(h)?i[c]:h,s[c]=null==u||isNaN(u)?o[c]:u})),Ztt(a),Ztt(s);var l=this._minMaxSpan;function c(t,e,i,r,o){var s=o?"Span":"ValueSpan";s3(0,t,i,"all",l["min"+s],l["max"+s]);for(var a=0;a<2;a++)e[a]=TC(t[a],i,r,!0),o&&(e[a]=n.parse(e[a]))}return e?c(a,s,i,o,!1):c(s,a,o,i,!0),{valueWindow:a,percentWindow:s}},t.prototype.reset=function(t){if(t===this._dataZoomModel){var e=this.getTargetSeriesModels();this._dataExtent=function(t,e,i){var n=[1/0,-1/0];Xtt(i,(function(t){!function(t,e,i){e&&yE(JW(e,i),(function(i){var n=e.getApproximateExtent(i);n[0]<t[0]&&(t[0]=n[0]),n[1]>t[1]&&(t[1]=n[1])}))}(n,t.getData(),e)}));var r=t.getAxisModel(),o=UW(r.axis.scale,r,n).calculate();return[o.min,o.max]}(this,this._dimName,e),this._updateMinMaxSpan();var i=this.calculateDataWindow(t.settledOption);this._valueWindow=i.valueWindow,this._percentWindow=i.percentWindow,this._setAxisModel()}},t.prototype.filterData=function(t,e){if(t===this._dataZoomModel){var i=this._dimName,n=this.getTargetSeriesModels(),r=t.get("filterMode"),o=this._valueWindow;"none"!==r&&Xtt(n,(function(t){var e=t.getData(),n=e.mapDimensionsAll(i);if(n.length){if("weakFilter"===r){var s=e.getStore(),a=vE(n,(function(t){return e.getDimensionIndex(t)}),e);e.filterSelf((function(t){for(var e,i,r,l=0;l<n.length;l++){var c=s.get(a[l],t),u=!isNaN(c),h=c<o[0],p=c>o[1];if(u&&!h&&!p)return!0;u&&(r=!0),h&&(e=!0),p&&(i=!0)}return r&&e&&i}))}else Xtt(n,(function(i){if("empty"===r)t.setData(e=e.map(i,(function(t){return function(t){return t>=o[0]&&t<=o[1]}(t)?t:NaN})));else{var n={};n[i]=o,e.selectRange(n)}}));Xtt(n,(function(t){e.setApproximateExtent(o,t)}))}}))}},t.prototype._updateMinMaxSpan=function(){var t=this._minMaxSpan={},e=this._dataZoomModel,i=this._dataExtent;Xtt(["min","max"],(function(n){var r=e.get(n+"Span"),o=e.get(n+"ValueSpan");null!=o&&(o=this.getAxisModel().axis.scale.parse(o)),null!=o?r=TC(i[0]+o,i,[0,100],!0):null!=r&&(o=TC(r,[0,100],i,!0)-i[0]),t[n+"Span"]=r,t[n+"ValueSpan"]=o}),this)},t.prototype._setAxisModel=function(){var t=this.getAxisModel(),e=this._percentWindow,i=this._valueWindow;if(e){var n=RC(i,[0,500]);n=Math.min(n,20);var r=t.axis.scale.rawExtentInfo;0!==e[0]&&r.setDeterminedMinMax("min",+i[0].toFixed(n)),100!==e[1]&&r.setDeterminedMinMax("max",+i[1].toFixed(n)),r.freeze()}},t}();var Qtt=Ytt,Jtt={getTargetSeries:function(t){function e(e){t.eachComponent("dataZoom",(function(i){i.eachTargetAxis((function(n,r){var o=t.getComponent(Ott(n),r);e(n,r,o,i)}))}))}e((function(t,e,i,n){i.__dzAxisProxy=null}));var i=[];e((function(e,n,r,o){r.__dzAxisProxy||(r.__dzAxisProxy=new Qtt(e,n,o,t),i.push(r.__dzAxisProxy))}));var n=YE();return yE(i,(function(t){yE(t.getTargetSeriesModels(),(function(t){n.set(t.uid,t)}))})),n},overallReset:function(t,e){t.eachComponent("dataZoom",(function(t){t.eachTargetAxis((function(e,i){t.getAxisProxy(e,i).reset(t)})),t.eachTargetAxis((function(i,n){t.getAxisProxy(i,n).filterData(t,e)}))})),t.eachComponent("dataZoom",(function(t){var e=t.findRepresentativeAxisProxy();if(e){var i=e.getDataPercentWindow(),n=e.getDataValueWindow();t.setCalculatedRange({start:i[0],end:i[1],startValue:n[0],endValue:n[1]})}}))}};var Ktt=!1;function $tt(t){Ktt||(Ktt=!0,t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,Jtt),function(t){t.registerAction("dataZoom",(function(t,e){yE(ktt(e,t),(function(e){e.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})}))}))}(t),t.registerSubTypeDefaulter("dataZoom",(function(){return"slider"})))}function tet(t){t.registerComponentModel(Gtt),t.registerComponentView(qtt),$tt(t)}var eet=function(){},iet={};function net(t,e){iet[t]=e}function ret(t){return iet[t]}var oet=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.optionUpdated=function(){t.prototype.optionUpdated.apply(this,arguments);var e=this.ecModel;yE(this.option.feature,(function(t,i){var n=ret(i);n&&(n.getDefaultOption&&(n.defaultOption=n.getDefaultOption(e)),uE(t,n.defaultOption))}))},e.type="toolbox",e.layoutMode={type:"box",ignoreSize:!0},e.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1,position:"bottom"}},e}(YB),set=oet;function aet(t,e){var i=CB(e.get("padding")),n=e.getItemStyle(["color","opacity"]);return n.fill=e.get("backgroundColor"),t=new kD({shape:{x:t.x-i[3],y:t.y-i[0],width:t.width+i[1]+i[3],height:t.height+i[0]+i[2],r:e.get("borderRadius")},style:n,silent:!0,z2:-1})}var cet=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return zA(e,t),e.prototype.render=function(t,e,i,n){var r=this.group;if(r.removeAll(),t.get("show")){var o=+t.get("itemSize"),s="vertical"===t.get("orient"),a=t.get("feature")||{},l=this._features||(this._features={}),c=[];yE(a,(function(t,e){c.push(e)})),new oH(this._featureNames||[],c).add(u).update(u).remove(AE(u,null)).execute(),this._featureNames=c,function(t,e,i){var n=e.getBoxLayoutParams(),r=e.get("padding"),o={width:i.getWidth(),height:i.getHeight()},s=UB(n,o,r);VB(e.get("orient"),t,e.get("itemGap"),s.width,s.height),GB(t,n,o,r)}(r,t,i),r.add(aet(r.getBoundingRect(),t)),s||r.eachChild((function(t){var e=t.__title,n=t.ensureState("emphasis"),s=n.textConfig||(n.textConfig={}),a=t.getTextContent(),l=a&&a.ensureState("emphasis");if(l&&!SE(l)&&e){var c=l.style||(l.style={}),u=iC(e,JD.makeFont(c)),h=t.x+r.x,p=!1;t.y+r.y+o+u.height>i.getHeight()&&(s.position="top",p=!0);var d=p?-5-u.height:o+10;h+u.width/2>i.getWidth()?(s.position=["100%",d],c.align="right"):h-u.width/2<0&&(s.position=[0,d],c.align="left")}}))}function u(u,h){var p,d=c[u],f=c[h],m=a[d],g=new FN(m,t,t.ecModel);if(n&&null!=n.newTitle&&n.featureName===d&&(m.title=n.newTitle),d&&!f){if(function(t){return 0===t.indexOf("my")}(d))p={onclick:g.option.onclick,featureName:d};else{var y=ret(d);if(!y)return;p=new y}l[d]=p}else if(!(p=l[f]))return;p.uid=UN("toolbox-feature"),p.model=g,p.ecModel=e,p.api=i;var v=p instanceof eet;d||!f?!g.get("show")||v&&p.unusable?v&&p.remove&&p.remove(e,i):(!function(n,a,l){var c,u,h=n.getModel("iconStyle"),p=n.getModel(["emphasis","iconStyle"]),d=a instanceof eet&&a.getIcons?a.getIcons():n.get("icon"),f=n.get("title")||{};ME(d)?(c={})[l]=d:c=d;ME(f)?(u={})[l]=f:u=f;var m=n.iconPaths={};yE(c,(function(l,c){var d=iN(l,{},{x:-o/2,y:-o/2,width:o,height:o});d.setStyle(h.getItemStyle()),d.ensureState("emphasis").style=p.getItemStyle();var f=new JD({style:{text:u[c],align:p.get("textAlign"),borderRadius:p.get("textBorderRadius"),padding:p.get("textPadding"),fill:null},ignore:!0});d.setTextContent(f),sN({el:d,componentModel:t,itemName:c,formatterParamsExtra:{title:u[c]}}),d.__title=u[c],d.on("mouseover",(function(){var e=p.getItemStyle(),n=s?null==t.get("right")&&"right"!==t.get("left")?"right":"left":null==t.get("bottom")&&"bottom"!==t.get("top")?"bottom":"top";f.setStyle({fill:p.get("textFill")||e.fill||e.stroke||"#000",backgroundColor:p.get("textBackgroundColor")}),d.setTextConfig({position:p.get("textPosition")||n}),f.ignore=!t.get("showTitle"),i.enterEmphasis(this)})).on("mouseout",(function(){"emphasis"!==n.get(["iconStatus",c])&&i.leaveEmphasis(this),f.hide()})),("emphasis"===n.get(["iconStatus",c])?RR:OR)(d),r.add(d),d.on("click",wE(a.onclick,a,e,i,c)),m[c]=d}))}(g,p,d),g.setIconStatus=function(t,e){var i=this.option,n=this.iconPaths;i.iconStatus=i.iconStatus||{},i.iconStatus[t]=e,n[t]&&("emphasis"===e?RR:OR)(n[t])},p instanceof eet&&p.render&&p.render(g,e,i,n)):v&&p.dispose&&p.dispose(e,i)}},e.prototype.updateView=function(t,e,i,n){yE(this._features,(function(t){t instanceof eet&&t.updateView&&t.updateView(t.model,e,i,n)}))},e.prototype.remove=function(t,e){yE(this._features,(function(i){i instanceof eet&&i.remove&&i.remove(t,e)})),this.group.removeAll()},e.prototype.dispose=function(t,e){yE(this._features,(function(i){i instanceof eet&&i.dispose&&i.dispose(t,e)}))},e.type="toolbox",e}(qV);var uet=cet,het=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return zA(e,t),e.prototype.onclick=function(t,e){var i=this.model,n=i.get("name")||t.get("title.0.text")||"echarts",r="svg"===e.getZr().painter.getType(),o=r?"svg":i.get("type",!0)||"png",s=e.getConnectedDataURL({type:o,backgroundColor:i.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",connectedBackgroundColor:i.get("connectedBackgroundColor"),excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")}),a=UA.browser;if(SE(MouseEvent)&&(a.newEdge||!a.ie&&!a.edge)){var l=document.createElement("a");l.download=n+"."+o,l.target="_blank",l.href=s;var c=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});l.dispatchEvent(c)}else if(window.navigator.msSaveOrOpenBlob||r){var u=s.split(","),h=u[0].indexOf("base64")>-1,p=r?decodeURIComponent(u[1]):u[1];h&&(p=window.atob(p));var d=n+"."+o;if(window.navigator.msSaveOrOpenBlob){for(var f=p.length,m=new Uint8Array(f);f--;)m[f]=p.charCodeAt(f);var g=new Blob([m]);window.navigator.msSaveOrOpenBlob(g,d)}else{var y=document.createElement("iframe");document.body.appendChild(y);var v=y.contentWindow,_=v.document;_.open("image/svg+xml","replace"),_.write(p),_.close(),v.focus(),_.execCommand("SaveAs",!0,d),document.body.removeChild(y)}}else{var x=i.get("lang"),b='<body style="margin:0;"><img src="'+s+'" style="max-width:100%;" title="'+(x&&x[0]||"")+'" /></body>',w=window.open();w.document.write(b),w.document.title=n}},e.getDefaultOption=function(t){return{show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:t.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],lang:t.getLocaleModel().get(["toolbox","saveAsImage","lang"])}},e}(eet),pet=het,det="__ec_magicType_stack__",fet=[["line","bar"],["stack"]],met=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return zA(e,t),e.prototype.getIcons=function(){var t=this.model,e=t.get("icon"),i={};return yE(t.get("type"),(function(t){e[t]&&(i[t]=e[t])})),i},e.getDefaultOption=function(t){return{show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:t.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}}},e.prototype.onclick=function(t,e,i){var n=this.model,r=n.get(["seriesIndex",i]);if(get[i]){var o,s={series:[]};yE(fet,(function(t){fE(t,i)>=0&&yE(t,(function(t){n.setIconStatus(t,"normal")}))})),n.setIconStatus(i,"emphasis"),t.eachComponent({mainType:"series",query:null==r?null:{seriesIndex:r}},(function(t){var e=t.subType,r=t.id,o=get[i](e,r,t,n);o&&(dE(o,t.option),s.series.push(o));var a=t.coordinateSystem;if(a&&"cartesian2d"===a.type&&("line"===i||"bar"===i)){var l=a.getAxesByScale("ordinal")[0];if(l){var c=l.dim+"Axis",u=t.getReferringComponents(c,MP).models[0].componentIndex;s[c]=s[c]||[];for(var h=0;h<=u;h++)s[c][u]=s[c][u]||{};s[c][u].boundaryGap="bar"===i}}}));var a=i;"stack"===i&&(o=uE({stack:n.option.title.tiled,tiled:n.option.title.stack},n.option.title),"emphasis"!==n.get(["iconStatus",i])&&(a="tiled")),e.dispatchAction({type:"changeMagicType",currentType:a,newOption:s,newTitle:o,featureName:"magicType"})}},e}(eet),get={line:function(t,e,i,n){if("bar"===t)return uE({id:e,type:"line",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},n.get(["option","line"])||{},!0)},bar:function(t,e,i,n){if("line"===t)return uE({id:e,type:"bar",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},n.get(["option","bar"])||{},!0)},stack:function(t,e,i,n){var r=i.get("stack")===det;if("line"===t||"bar"===t)return n.setIconStatus("stack",r?"normal":"emphasis"),uE({id:e,stack:r?"":det},n.get(["option","stack"])||{},!0)}};qj({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},(function(t,e){e.mergeOption(t.newOption)}));var yet=met,vet=new Array(60).join("-"),_et="\t";function xet(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}var bet=new RegExp("["+_et+"]+","g");function wet(t,e){var i=t.split(new RegExp("\n*"+vet+"\n*","g")),n={series:[]};return yE(i,(function(t,i){if(function(t){if(t.slice(0,t.indexOf("\n")).indexOf(_et)>=0)return!0}(t)){var r=function(t){for(var e=t.split(/\n+/g),i=[],n=vE(xet(e.shift()).split(bet),(function(t){return{name:t,data:[]}})),r=0;r<e.length;r++){var o=xet(e[r]).split(bet);i.push(o.shift());for(var s=0;s<o.length;s++)n[s]&&(n[s].data[r]=o[s])}return{series:n,categories:i}}(t),o=e[i],s=o.axisDim+"Axis";o&&(n[s]=n[s]||[],n[s][o.axisIndex]={data:r.categories},n.series=n.series.concat(r.series))}else{r=function(t){for(var e=t.split(/\n+/g),i=xet(e.shift()),n=[],r=0;r<e.length;r++){var o=xet(e[r]);if(o){var s=o.split(bet),a="",l=void 0,c=!1;isNaN(s[0])?(c=!0,a=s[0],s=s.slice(1),n[r]={name:a,value:[]},l=n[r].value):l=n[r]=[];for(var u=0;u<s.length;u++)l.push(+s[u]);1===l.length&&(c?n[r].value=l[0]:n[r]=l[0])}}return{name:i,data:n}}(t);n.series.push(r)}})),n}var Aet=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return zA(e,t),e.prototype.onclick=function(t,e){setTimeout((function(){e.dispatchAction({type:"hideTip"})}));var i=e.getDom(),n=this.model;this._dom&&i.removeChild(this._dom);var r=document.createElement("div");r.style.cssText="position:absolute;top:0;bottom:0;left:0;right:0;padding:5px",r.style.backgroundColor=n.get("backgroundColor")||"#fff";var o=document.createElement("h4"),s=n.get("lang")||[];o.innerHTML=s[0]||n.get("title"),o.style.cssText="margin:10px 20px",o.style.color=n.get("textColor");var a=document.createElement("div"),l=document.createElement("textarea");a.style.cssText="overflow:auto";var c=n.get("optionToContent"),u=n.get("contentToOption"),h=function(t){var e,i,n,r=function(t){var e={},i=[],n=[];return t.eachRawSeries((function(t){var r=t.coordinateSystem;if(!r||"cartesian2d"!==r.type&&"polar"!==r.type)i.push(t);else{var o=r.getBaseAxis();if("category"===o.type){var s=o.dim+"_"+o.index;e[s]||(e[s]={categoryAxis:o,valueAxis:r.getOtherAxis(o),series:[]},n.push({axisDim:o.dim,axisIndex:o.index})),e[s].series.push(t)}else i.push(t)}})),{seriesGroupByCategoryAxis:e,other:i,meta:n}}(t);return{value:xE([(i=r.seriesGroupByCategoryAxis,n=[],yE(i,(function(t,e){var i=t.categoryAxis,r=t.valueAxis.dim,o=[" "].concat(vE(t.series,(function(t){return t.name}))),s=[i.model.getCategories()];yE(t.series,(function(t){var e=t.getRawData();s.push(t.getRawData().mapArray(e.mapDimension(r),(function(t){return t})))}));for(var a=[o.join(_et)],l=0;l<s[0].length;l++){for(var c=[],u=0;u<s.length;u++)c.push(s[u][l]);a.push(c.join(_et))}n.push(a.join("\n"))})),n.join("\n\n"+vet+"\n\n")),(e=r.other,vE(e,(function(t){var e=t.getRawData(),i=[t.name],n=[];return e.each(e.dimensions,(function(){for(var t=arguments.length,r=arguments[t-1],o=e.getName(r),s=0;s<t-1;s++)n[s]=arguments[s];i.push((o?o+_et:"")+n.join(_et))})),i.join("\n")})).join("\n\n"+vet+"\n\n"))],(function(t){return!!t.replace(/[\n\t\s]/g,"")})).join("\n\n"+vet+"\n\n"),meta:r.meta}}(t);if(SE(c)){var p=c(e.getOption());ME(p)?a.innerHTML=p:DE(p)&&a.appendChild(p)}else{l.readOnly=n.get("readOnly");var d=l.style;d.cssText="display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none",d.color=n.get("textColor"),d.borderColor=n.get("textareaBorderColor"),d.backgroundColor=n.get("textareaColor"),l.value=h.value,a.appendChild(l)}var f=h.meta,m=document.createElement("div");m.style.cssText="position:absolute;bottom:5px;left:0;right:0";var g="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",y=document.createElement("div"),v=document.createElement("div");g+=";background-color:"+n.get("buttonColor"),g+=";color:"+n.get("buttonTextColor");var _=this;function x(){i.removeChild(r),_._dom=null}US(y,"click",x),US(v,"click",(function(){if(null==u&&null!=c||null!=u&&null==c)return"production"!==process.env.NODE_ENV&&$C("It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored."),void x();var t;try{t=SE(u)?u(a,e.getOption()):wet(l.value,f)}catch(t){throw x(),new Error("Data view format error "+t)}t&&e.dispatchAction({type:"changeDataView",newOption:t}),x()})),y.innerHTML=s[1],v.innerHTML=s[2],v.style.cssText=y.style.cssText=g,!n.get("readOnly")&&m.appendChild(v),m.appendChild(y),r.appendChild(o),r.appendChild(a),r.appendChild(m),a.style.height=i.clientHeight-80+"px",i.appendChild(r),this._dom=r},e.prototype.remove=function(t,e){this._dom&&e.getDom().removeChild(this._dom)},e.prototype.dispose=function(t,e){this.remove(t,e)},e.getDefaultOption=function(t){return{show:!0,readOnly:!1,optionToContent:null,contentToOption:null,icon:"M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",title:t.getLocaleModel().get(["toolbox","dataView","title"]),lang:t.getLocaleModel().get(["toolbox","dataView","lang"]),backgroundColor:"#fff",textColor:"#000",textareaColor:"#fff",textareaBorderColor:"#333",buttonColor:"#c23531",buttonTextColor:"#fff"}},e}(eet);function Eet(t,e){return vE(t,(function(t,i){var n=e&&e[i];if(CE(n)&&!EE(n)){CE(t)&&!EE(t)||(t={value:t});var r=null!=n.name&&null==t.name;return t=dE(t,n),r&&delete t.name,t}return t}))}qj({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},(function(t,e){var i=[];yE(t.newOption.series,(function(t){var n=e.getSeriesByName(t.name)[0];if(n){var r=n.get("data");i.push({name:t.name,data:Eet(t.data,r)})}else i.push(pE({type:"scatter"},t))})),e.mergeOption(dE({series:i},t.newOption))}));var Met=Aet,Tet=yE,Iet=wP();function Cet(t){var e=Iet(t);return e.snapshots||(e.snapshots=[{}]),e.snapshots}var Pet=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return zA(e,t),e.prototype.onclick=function(t,e){!function(t){Iet(t).snapshots=null}(t),e.dispatchAction({type:"restore",from:this.uid})},e.getDefaultOption=function(t){return{show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:t.getLocaleModel().get(["toolbox","restore","title"])}},e}(eet);qj({type:"restore",event:"restore",update:"prepareAndUpdate"},(function(t,e){e.resetOption("recreate")}));var Let=Pet,Det=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],Ret=function(){function t(t,e,i){var n=this;this._targetInfoList=[];var r=ket(e,t);yE(Net,(function(t,e){(!i||!i.include||fE(i.include,e)>=0)&&t(r,n._targetInfoList)}))}return t.prototype.setOutputRanges=function(t,e){return this.matchOutputRanges(t,e,(function(t,e,i){if((t.coordRanges||(t.coordRanges=[])).push(e),!t.coordRange){t.coordRange=e;var n=Fet[t.brushType](0,i,e);t.__rangeOffset={offset:Uet[t.brushType](n.values,t.range,[1,1]),xyMinMax:n.xyMinMax}}})),t},t.prototype.matchOutputRanges=function(t,e,i){yE(t,(function(t){var n=this.findTargetInfo(t,e);n&&!0!==n&&yE(n.coordSyses,(function(n){var r=Fet[t.brushType](1,n,t.range,!0);i(t,r.values,n,e)}))}),this)},t.prototype.setInputRanges=function(t,e){yE(t,(function(t){var i,n,r,o,s,a=this.findTargetInfo(t,e);if("production"!==process.env.NODE_ENV&&(UE(!a||!0===a||t.coordRange,"coordRange must be specified when coord index specified."),UE(!a||!0!==a||t.range,"range must be specified in global brush.")),t.range=t.range||[],a&&!0!==a){t.panelId=a.panelId;var l=Fet[t.brushType](0,a.coordSys,t.coordRange),c=t.__rangeOffset;t.range=c?Uet[t.brushType](l.values,c.offset,(i=l.xyMinMax,n=c.xyMinMax,r=jet(i),o=jet(n),s=[r[0]/o[0],r[1]/o[1]],isNaN(s[0])&&(s[0]=1),isNaN(s[1])&&(s[1]=1),s)):l.values}}),this)},t.prototype.makePanelOpts=function(t,e){return vE(this._targetInfoList,(function(i){var n=i.getPanelRect();return{panelId:i.panelId,defaultBrushType:e?e(i):null,clipPath:f5(n),isTargetByCursor:g5(n,t,i.coordSysModel),getLinearBrushOtherExtent:m5(n)}}))},t.prototype.controlSeries=function(t,e,i){var n=this.findTargetInfo(t,i);return!0===n||n&&fE(n.coordSyses,e.coordinateSystem)>=0},t.prototype.findTargetInfo=function(t,e){for(var i=this._targetInfoList,n=ket(e,t),r=0;r<i.length;r++){var o=i[r],s=t.panelId;if(s){if(o.panelId===s)return o}else for(var a=0;a<Bet.length;a++)if(Bet[a](n,o))return o}return!0},t}();function Oet(t){return t[0]>t[1]&&t.reverse(),t}function ket(t,e){return EP(t,e,{includeMainTypes:Det})}var Net={grid:function(t,e){var i=t.xAxisModels,n=t.yAxisModels,r=t.gridModels,o=YE(),s={},a={};(i||n||r)&&(yE(i,(function(t){var e=t.axis.grid.model;o.set(e.id,e),s[e.id]=!0})),yE(n,(function(t){var e=t.axis.grid.model;o.set(e.id,e),a[e.id]=!0})),yE(r,(function(t){o.set(t.id,t),s[t.id]=!0,a[t.id]=!0})),o.each((function(t){var r=t.coordinateSystem,o=[];yE(r.getCartesians(),(function(t,e){(fE(i,t.getAxis("x").model)>=0||fE(n,t.getAxis("y").model)>=0)&&o.push(t)})),e.push({panelId:"grid--"+t.id,gridModel:t,coordSysModel:t,coordSys:o[0],coordSyses:o,getPanelRect:zet.grid,xAxisDeclared:s[t.id],yAxisDeclared:a[t.id]})})))},geo:function(t,e){yE(t.geoModels,(function(t){var i=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:i,coordSyses:[i],getPanelRect:zet.geo})}))}},Bet=[function(t,e){var i=t.xAxisModel,n=t.yAxisModel,r=t.gridModel;return!r&&i&&(r=i.axis.grid.model),!r&&n&&(r=n.axis.grid.model),r&&r===e.gridModel},function(t,e){var i=t.geoModel;return i&&i===e.geoModel}],zet={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var t=this.coordSys,e=t.getBoundingRect().clone();return e.applyTransform(Qk(t)),e}},Fet={lineX:AE(Vet,0),lineY:AE(Vet,1),rect:function(t,e,i,n){var r=t?e.pointToData([i[0][0],i[1][0]],n):e.dataToPoint([i[0][0],i[1][0]],n),o=t?e.pointToData([i[0][1],i[1][1]],n):e.dataToPoint([i[0][1],i[1][1]],n),s=[Oet([r[0],o[0]]),Oet([r[1],o[1]])];return{values:s,xyMinMax:s}},polygon:function(t,e,i,n){var r=[[1/0,-1/0],[1/0,-1/0]],o=vE(i,(function(i){var o=t?e.pointToData(i,n):e.dataToPoint(i,n);return r[0][0]=Math.min(r[0][0],o[0]),r[1][0]=Math.min(r[1][0],o[1]),r[0][1]=Math.max(r[0][1],o[0]),r[1][1]=Math.max(r[1][1],o[1]),o}));return{values:o,xyMinMax:r}}};function Vet(t,e,i,n){"production"!==process.env.NODE_ENV&&UE("cartesian2d"===i.type,"lineX/lineY brush is available only in cartesian2d.");var r=i.getAxis(["x","y"][t]),o=Oet(vE([0,1],(function(t){return e?r.coordToData(r.toLocalCoord(n[t]),!0):r.toGlobalCoord(r.dataToCoord(n[t]))}))),s=[];return s[t]=o,s[1-t]=[NaN,NaN],{values:o,xyMinMax:s}}var Uet={lineX:AE(Get,0),lineY:AE(Get,1),rect:function(t,e,i){return[[t[0][0]-i[0]*e[0][0],t[0][1]-i[0]*e[0][1]],[t[1][0]-i[1]*e[1][0],t[1][1]-i[1]*e[1][1]]]},polygon:function(t,e,i){return vE(t,(function(t,n){return[t[0]-i[0]*e[n][0],t[1]-i[1]*e[n][1]]}))}};function Get(t,e,i,n){return[e[0]-n[t]*i[0],e[1]-n[t]*i[1]]}function jet(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}var Het,Wet,qet=Ret,Xet=yE,Zet=aP+"toolbox-dataZoom_",Yet=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return zA(e,t),e.prototype.render=function(t,e,i,n){this._brushController||(this._brushController=new d5(i.getZr()),this._brushController.on("brush",wE(this._onBrush,this)).mount()),function(t,e,i,n,r){var o=i._isZoomActive;n&&"takeGlobalCursor"===n.type&&(o="dataZoomSelect"===n.key&&n.dataZoomSelectActive);i._isZoomActive=o,t.setIconStatus("zoom",o?"emphasis":"normal");var s=new qet(Jet(t),e,{include:["grid"]}),a=s.makePanelOpts(r,(function(t){return t.xAxisDeclared&&!t.yAxisDeclared?"lineX":!t.xAxisDeclared&&t.yAxisDeclared?"lineY":"rect"}));i._brushController.setPanels(a).enableBrush(!(!o||!a.length)&&{brushType:"auto",brushStyle:t.getModel("brushStyle").getItemStyle()})}(t,e,this,n,i),function(t,e){t.setIconStatus("back",function(t){return Cet(t).length}(e)>1?"emphasis":"normal")}(t,e)},e.prototype.onclick=function(t,e,i){Qet[i].call(this)},e.prototype.remove=function(t,e){this._brushController&&this._brushController.unmount()},e.prototype.dispose=function(t,e){this._brushController&&this._brushController.dispose()},e.prototype._onBrush=function(t){var e=t.areas;if(t.isEnd&&e.length){var i={},n=this.ecModel;this._brushController.updateCovers([]),new qet(Jet(this.model),n,{include:["grid"]}).matchOutputRanges(e,n,(function(t,e,i){if("cartesian2d"===i.type){var n=t.brushType;"rect"===n?(r("x",i,e[0]),r("y",i,e[1])):r({lineX:"x",lineY:"y"}[n],i,e)}})),function(t,e){var i=Cet(t);Tet(e,(function(e,n){for(var r=i.length-1;r>=0&&!i[r][n];r--);if(r<0){var o=t.queryComponents({mainType:"dataZoom",subType:"select",id:n})[0];if(o){var s=o.getPercentRange();i[0][n]={dataZoomId:n,start:s[0],end:s[1]}}}})),i.push(e)}(n,i),this._dispatchZoomAction(i)}function r(t,e,r){var o=e.getAxis(t),s=o.model,a=function(t,e,i){var n;return i.eachComponent({mainType:"dataZoom",subType:"select"},(function(i){i.getAxisModel(t,e.componentIndex)&&(n=i)})),n}(t,s,n),l=a.findRepresentativeAxisProxy(s).getMinMaxSpan();null==l.minValueSpan&&null==l.maxValueSpan||(r=s3(0,r.slice(),o.scale.getExtent(),0,l.minValueSpan,l.maxValueSpan)),a&&(i[a.id]={dataZoomId:a.id,startValue:r[0],endValue:r[1]})}},e.prototype._dispatchZoomAction=function(t){var e=[];Xet(t,(function(t,i){e.push(cE(t))})),e.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:e})},e.getDefaultOption=function(t){return{show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:t.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}}},e}(eet),Qet={zoom:function(){var t=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:t})},back:function(){this._dispatchZoomAction(function(t){var e=Cet(t),i=e[e.length-1];e.length>1&&e.pop();var n={};return Tet(i,(function(t,i){for(var r=e.length-1;r>=0;r--)if(t=e[r][i]){n[i]=t;break}})),n}(this.ecModel))}};function Jet(t){var e={xAxisIndex:t.get("xAxisIndex",!0),yAxisIndex:t.get("yAxisIndex",!0),xAxisId:t.get("xAxisId",!0),yAxisId:t.get("yAxisId",!0)};return null==e.xAxisIndex&&null==e.xAxisId&&(e.xAxisIndex="all"),null==e.yAxisIndex&&null==e.yAxisId&&(e.yAxisIndex="all"),e}Het="dataZoom",Wet=function(t){var e=t.getComponent("toolbox",0),i=["feature","dataZoom"];if(e&&null!=e.get(i)){var n=e.getModel(i),r=[],o=EP(t,Jet(n));return Xet(o.xAxisModels,(function(t){return s(t,"xAxis","xAxisIndex")})),Xet(o.yAxisModels,(function(t){return s(t,"yAxis","yAxisIndex")})),r}function s(t,e,i){var o=t.componentIndex,s={type:"select",$fromToolbox:!0,filterMode:n.get("filterMode",!0)||"filter",id:Zet+e+o};s[i]=o,r.push(s)}},UE(null==mz.get(Het)&&Wet),mz.set(Het,Wet);var Ket=Yet;var $et=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},e}(YB),tit=$et;function eit(t){var e=t.get("confine");return null!=e?!!e:"richText"===t.get("renderMode")}function iit(t){if(UA.domSupported)for(var e=document.documentElement.style,i=0,n=t.length;i<n;i++)if(t[i]in e)return t[i]}var nit=iit(["transform","webkitTransform","OTransform","MozTransform","msTransform"]);function rit(t,e){if(!t)return e;e=IB(e,!0);var i=t.indexOf(e);return(t=-1===i?e:"-"+t.slice(0,i)+"-"+e).toLowerCase()}var oit=rit(iit(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),"transition"),sit=rit(nit,"transform"),ait="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(UA.transform3dSupported?"will-change:transform;":"");function lit(t,e,i){var n=t.toFixed(0)+"px",r=e.toFixed(0)+"px";if(!UA.transformSupported)return i?"top:"+r+";left:"+n+";":[["top",r],["left",n]];var o=UA.transform3dSupported,s="translate"+(o?"3d":"")+"("+n+","+r+(o?",0":"")+")";return i?"top:0;left:0;"+sit+":"+s+";":[["top",0],["left",0],[nit,s]]}function cit(t,e,i){var n=[],r=t.get("transitionDuration"),o=t.get("backgroundColor"),s=t.get("shadowBlur"),a=t.get("shadowColor"),l=t.get("shadowOffsetX"),c=t.get("shadowOffsetY"),u=t.getModel("textStyle"),h=PV(t,"html"),p=l+"px "+c+"px "+s+"px "+a;return n.push("box-shadow:"+p),e&&r&&n.push(function(t,e){var i="cubic-bezier(0.23,1,0.32,1)",n=" "+t/2+"s "+i,r="opacity"+n+",visibility"+n;return e||(n=" "+t+"s "+i,r+=UA.transformSupported?","+sit+n:",left"+n+",top"+n),oit+":"+r}(r,i)),o&&n.push("background-color:"+o),yE(["width","color","radius"],(function(e){var i="border-"+e,r=IB(i),o=t.get(r);null!=o&&n.push(i+":"+o+("color"===e?"":"px"))})),n.push(function(t){var e=[],i=t.get("fontSize"),n=t.getTextColor();n&&e.push("color:"+n),e.push("font:"+t.getFont()),i&&e.push("line-height:"+Math.round(3*i/2)+"px");var r=t.get("textShadowColor"),o=t.get("textShadowBlur")||0,s=t.get("textShadowOffsetX")||0,a=t.get("textShadowOffsetY")||0;return r&&o&&e.push("text-shadow:"+s+"px "+a+"px "+o+"px "+r),yE(["decoration","align"],(function(i){var n=t.get(i);n&&e.push("text-"+i+":"+n)})),e.join(";")}(u)),null!=h&&n.push("padding:"+CB(h).join("px ")+"px"),n.join(";")+";"}function uit(t,e,i,n,r){var o=e&&e.painter;if(i){var s=o&&o.getViewportRoot();s&&function(t,e,i,n,r){CS(IS,e,n,r,!0)&&CS(t,i,IS[0],IS[1])}(t,s,document.body,n,r)}else{t[0]=n,t[1]=r;var a=o&&o.getViewportRootOffset();a&&(t[0]+=a.offsetLeft,t[1]+=a.offsetTop)}t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var hit=function(){function t(t,e,i){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,UA.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var r=this._zr=e.getZr(),o=this._appendToBody=i&&i.appendToBody;uit(this._styleCoord,r,o,e.getWidth()/2,e.getHeight()/2),o?document.body.appendChild(n):t.appendChild(n),this._container=t;var s=this;n.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},n.onmousemove=function(t){if(t=t||window.event,!s._enterable){var e=r.handler;VS(r.painter.getViewportRoot(),t,!0),e.dispatch("mousemove",t)}},n.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return t.prototype.update=function(t){var e,i,n,r=this._container,o=(i="position",(n=(e=r).currentStyle||document.defaultView&&document.defaultView.getComputedStyle(e))?i?n[i]:n:null),s=r.style;"absolute"!==s.position&&"absolute"!==o&&(s.position="relative");var a=t.get("alwaysShowContent");a&&this._moveIfResized(),this._alwaysShowContent=a,this.el.className=t.get("className")||""},t.prototype.show=function(t,e){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var i=this.el,n=i.style,r=this._styleCoord;i.innerHTML?n.cssText=ait+cit(t,!this._firstShow,this._longHide)+lit(r[0],r[1],!0)+"border-color:"+OB(e)+";"+(t.get("extraCssText")||"")+";pointer-events:"+(this._enterable?"auto":"none"):n.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},t.prototype.setContent=function(t,e,i,n,r){var o=this.el;if(null!=t){var s="";if(ME(r)&&"item"===i.get("trigger")&&!eit(i)&&(s=function(t,e,i){if(!ME(i)||"inside"===i)return"";var n=t.get("backgroundColor"),r=t.get("borderWidth");e=OB(e);var o,s,a="left"===(o=i)?"right":"right"===o?"left":"top"===o?"bottom":"top",l=Math.max(1.5*Math.round(r),6),c="",u=sit+":";fE(["left","right"],a)>-1?(c+="top:50%",u+="translateY(-50%) rotate("+(s="left"===a?-225:-45)+"deg)"):(c+="left:50%",u+="translateX(-50%) rotate("+(s="top"===a?225:45)+"deg)");var h=s*Math.PI/180,p=l+r,d=p*Math.abs(Math.cos(h))+p*Math.abs(Math.sin(h)),f=e+" solid "+r+"px;";return'<div style="'+["position:absolute;width:"+l+"px;height:"+l+"px;z-index:-1;",(c+=";"+a+":-"+Math.round(100*((d-Math.SQRT2*r)/2+Math.SQRT2*r-(d-p)/2))/100+"px")+";"+u+";","border-bottom:"+f,"border-right:"+f,"background-color:"+n+";"].join("")+'"></div>'}(i,n,r)),ME(t))o.innerHTML=t+s;else if(t){o.innerHTML="",EE(t)||(t=[t]);for(var a=0;a<t.length;a++)DE(t[a])&&t[a].parentNode!==o&&o.appendChild(t[a]);if(s&&o.childNodes.length){var l=document.createElement("div");l.innerHTML=s,o.appendChild(l)}}}else o.innerHTML=""},t.prototype.setEnterable=function(t){this._enterable=t},t.prototype.getSize=function(){var t=this.el;return[t.offsetWidth,t.offsetHeight]},t.prototype.moveTo=function(t,e){var i=this._styleCoord;if(uit(i,this._zr,this._appendToBody,t,e),null!=i[0]&&null!=i[1]){var n=this.el.style;yE(lit(i[0],i[1]),(function(t){n[t[0]]=t[1]}))}},t.prototype._moveIfResized=function(){var t=this._styleCoord[2],e=this._styleCoord[3];this.moveTo(t*this._zr.getWidth(),e*this._zr.getHeight())},t.prototype.hide=function(){var t=this,e=this.el.style;e.visibility="hidden",e.opacity="0",UA.transform3dSupported&&(e.willChange=""),this._show=!1,this._longHideTimeout=setTimeout((function(){return t._longHide=!0}),500)},t.prototype.hideLater=function(t){!this._show||this._inContent&&this._enterable||this._alwaysShowContent||(t?(this._hideDelay=t,this._show=!1,this._hideTimeout=setTimeout(wE(this.hide,this),t)):this.hide())},t.prototype.isShow=function(){return this._show},t.prototype.dispose=function(){this.el.parentNode.removeChild(this.el)},t}(),pit=hit;function dit(t){return Math.max(0,t)}function fit(t){var e=dit(t.shadowBlur||0),i=dit(t.shadowOffsetX||0),n=dit(t.shadowOffsetY||0);return{left:dit(e-i),right:dit(e+i),top:dit(e-n),bottom:dit(e+n)}}function mit(t,e,i,n){t[0]=i,t[1]=n,t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var git=function(){function t(t){this._show=!1,this._styleCoord=[0,0,0,0],this._alwaysShowContent=!1,this._enterable=!0,this._zr=t.getZr(),mit(this._styleCoord,this._zr,t.getWidth()/2,t.getHeight()/2)}return t.prototype.update=function(t){var e=t.get("alwaysShowContent");e&&this._moveIfResized(),this._alwaysShowContent=e},t.prototype.show=function(){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.show(),this._show=!0},t.prototype.setContent=function(t,e,i,n,r){var o=this;CE(t)&&rP("production"!==process.env.NODE_ENV?"Passing DOM nodes as content is not supported in richText tooltip!":""),this.el&&this._zr.remove(this.el);var s=i.getModel("textStyle");this.el=new JD({style:{rich:e.richTextStyles,text:t,lineHeight:22,borderWidth:1,borderColor:n,textShadowColor:s.get("textShadowColor"),fill:i.get(["textStyle","color"]),padding:PV(i,"richText"),verticalAlign:"top",align:"left"},z:i.get("z")}),yE(["backgroundColor","borderRadius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],(function(t){o.el.style[t]=i.get(t)})),yE(["textShadowBlur","textShadowOffsetX","textShadowOffsetY"],(function(t){o.el.style[t]=s.get(t)||0})),this._zr.add(this.el);var a=this;this.el.on("mouseover",(function(){a._enterable&&(clearTimeout(a._hideTimeout),a._show=!0),a._inContent=!0})),this.el.on("mouseout",(function(){a._enterable&&a._show&&a.hideLater(a._hideDelay),a._inContent=!1}))},t.prototype.setEnterable=function(t){this._enterable=t},t.prototype.getSize=function(){var t=this.el,e=this.el.getBoundingRect(),i=fit(t.style);return[e.width+i.left+i.right,e.height+i.top+i.bottom]},t.prototype.moveTo=function(t,e){var i=this.el;if(i){var n=this._styleCoord;mit(n,this._zr,t,e),t=n[0],e=n[1];var r=i.style,o=dit(r.borderWidth||0),s=fit(r);i.x=t+o+s.left,i.y=e+o+s.top,i.markRedraw()}},t.prototype._moveIfResized=function(){var t=this._styleCoord[2],e=this._styleCoord[3];this.moveTo(t*this._zr.getWidth(),e*this._zr.getHeight())},t.prototype.hide=function(){this.el&&this.el.hide(),this._show=!1},t.prototype.hideLater=function(t){!this._show||this._inContent&&this._enterable||this._alwaysShowContent||(t?(this._hideDelay=t,this._show=!1,this._hideTimeout=setTimeout(wE(this.hide,this),t)):this.hide())},t.prototype.isShow=function(){return this._show},t.prototype.dispose=function(){this._zr.remove(this.el)},t}(),yit=new kD({shape:{x:-1,y:-1,width:2,height:2}}),vit=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.init=function(t,e){if(!UA.node&&e.getDom()){var i,n=t.getComponent("tooltip"),r=this._renderMode="auto"===(i=n.get("renderMode"))?UA.domSupported?"html":"richText":i||"html";this._tooltipContent="richText"===r?new git(e):new pit(e.getDom(),e,{appendToBody:n.get("appendToBody",!0)})}},e.prototype.render=function(t,e,i){if(!UA.node&&i.getDom()){this.group.removeAll(),this._tooltipModel=t,this._ecModel=e,this._api=i;var n=this._tooltipContent;n.update(t),n.setEnterable(t.get("enterable")),this._initGlobalListener(),this._keepShow(),"richText"!==this._renderMode&&t.get("transitionDuration")?aU(this,"_updatePosition",50,"fixRate"):lU(this,"_updatePosition")}},e.prototype._initGlobalListener=function(){var t=this._tooltipModel.get("triggerOn");j8("itemTooltip",this._api,wE((function(e,i,n){"none"!==t&&(t.indexOf(e)>=0?this._tryShow(i,n):"leave"===e&&this._hide(n))}),this))},e.prototype._keepShow=function(){var t=this._tooltipModel,e=this._ecModel,i=this._api,n=t.get("triggerOn");if(null!=this._lastX&&null!=this._lastY&&"none"!==n&&"click"!==n){var r=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout((function(){!i.isDisposed()&&r.manuallyShowTip(t,e,i,{x:r._lastX,y:r._lastY,dataByCoordSys:r._lastDataByCoordSys})}))}},e.prototype.manuallyShowTip=function(t,e,i,n){if(n.from!==this.uid&&!UA.node&&i.getDom()){var r=xit(n,i);this._ticket="";var o=n.dataByCoordSys,s=function(t,e,i){var n=SP(t).queryOptionMap,r=n.keys()[0];if(!r||"series"===r)return;var o=IP(e,r,n.get(r),{useDefault:!1,enableAll:!1,enableNone:!1}),s=o.models[0];if(!s)return;var a,l=i.getViewOfComponentModel(s);if(l.group.traverse((function(e){var i=KD(e).tooltipConfig;if(i&&i.name===t.name)return a=e,!0})),a)return{componentMainType:r,componentIndex:s.componentIndex,el:a}}(n,e,i);if(s){var a=s.el.getBoundingRect().clone();a.applyTransform(s.el.transform),this._tryShow({offsetX:a.x+a.width/2,offsetY:a.y+a.height/2,target:s.el,position:n.position,positionDefault:"bottom"},r)}else if(n.tooltip&&null!=n.x&&null!=n.y){var l=yit;l.x=n.x,l.y=n.y,l.update(),KD(l).tooltipConfig={name:null,option:n.tooltip},this._tryShow({offsetX:n.x,offsetY:n.y,target:l},r)}else if(o)this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,dataByCoordSys:o,tooltipOption:n.tooltipOption},r);else if(null!=n.seriesIndex){if(this._manuallyAxisShowTip(t,e,i,n))return;var c=Y8(n,e),u=c.point[0],h=c.point[1];null!=u&&null!=h&&this._tryShow({offsetX:u,offsetY:h,target:c.el,position:n.position,positionDefault:"bottom"},r)}else null!=n.x&&null!=n.y&&(i.dispatchAction({type:"updateAxisPointer",x:n.x,y:n.y}),this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,target:i.getZr().findHover(n.x,n.y).target},r))}},e.prototype.manuallyHideTip=function(t,e,i,n){var r=this._tooltipContent;this._tooltipModel&&r.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,n.from!==this.uid&&this._hide(xit(n,i))},e.prototype._manuallyAxisShowTip=function(t,e,i,n){var r=n.seriesIndex,o=n.dataIndex,s=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=r&&null!=o&&null!=s){var a=e.getSeriesByIndex(r);if(a)if("axis"===_it([a.getData().getItemModel(o),a,(a.coordinateSystem||{}).model],this._tooltipModel).get("trigger"))return i.dispatchAction({type:"updateAxisPointer",seriesIndex:r,dataIndex:o,position:n.position}),!0}},e.prototype._tryShow=function(t,e){var i=t.target;if(this._tooltipModel){this._lastX=t.offsetX,this._lastY=t.offsetY;var n=t.dataByCoordSys;if(n&&n.length)this._showAxisTooltip(n,t);else if(i){var r,o;this._lastDataByCoordSys=null,$U(i,(function(t){return null!=KD(t).dataIndex?(r=t,!0):null!=KD(t).tooltipConfig?(o=t,!0):void 0}),!0),r?this._showSeriesItemTooltip(t,r,e):o?this._showComponentItemTooltip(t,o,e):this._hide(e)}else this._lastDataByCoordSys=null,this._hide(e)}},e.prototype._showOrMove=function(t,e){var i=t.get("showDelay");e=wE(e,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(e,i):e()},e.prototype._showAxisTooltip=function(t,e){var i=this._ecModel,n=this._tooltipModel,r=[e.offsetX,e.offsetY],o=_it([e.tooltipOption],n),s=this._renderMode,a=[],l=xV("section",{blocks:[],noHeader:!0}),c=[],u=new LV;yE(t,(function(t){yE(t.dataByAxis,(function(t){var e=i.getComponent(t.axisDim+"Axis",t.axisIndex),r=t.value;if(e&&null!=r){var o=I8(r,e.axis,i,t.seriesDataIndices,t.valueLabelOpt),h=xV("section",{header:o,noHeader:!GE(o),sortBlocks:!0,blocks:[]});l.blocks.push(h),yE(t.seriesDataIndices,(function(l){var p=i.getSeriesByIndex(l.seriesIndex),d=l.dataIndexInside,f=p.getDataParams(d);if(!(f.dataIndex<0)){f.axisDim=t.axisDim,f.axisIndex=t.axisIndex,f.axisType=t.axisType,f.axisId=t.axisId,f.axisValue=XW(e.axis,{value:r}),f.axisValueLabel=o,f.marker=u.makeTooltipMarker("item",OB(f.color),s);var m=NF(p.formatTooltip(d,!0,null)),g=m.frag;if(g){var y=_it([p],n).get("valueFormatter");h.blocks.push(y?pE({valueFormatter:y},g):g)}m.text&&c.push(m.text),a.push(f)}}))}}))})),l.blocks.reverse(),c.reverse();var h=e.position,p=o.get("order"),d=MV(l,u,s,p,i.get("useUTC"),o.get("textStyle"));d&&c.unshift(d);var f="richText"===s?"\n\n":"<br/>",m=c.join(f);this._showOrMove(o,(function(){this._updateContentNotChangedOnAxis(t,a)?this._updatePosition(o,h,r[0],r[1],this._tooltipContent,a):this._showTooltipContent(o,m,a,Math.random()+"",r[0],r[1],h,null,u)}))},e.prototype._showSeriesItemTooltip=function(t,e,i){var n=this._ecModel,r=KD(e),o=r.seriesIndex,s=n.getSeriesByIndex(o),a=r.dataModel||s,l=r.dataIndex,c=r.dataType,u=a.getData(c),h=this._renderMode,p=t.positionDefault,d=_it([u.getItemModel(l),a,s&&(s.coordinateSystem||{}).model],this._tooltipModel,p?{position:p}:null),f=d.get("trigger");if(null==f||"item"===f){var m=a.getDataParams(l,c),g=new LV;m.marker=g.makeTooltipMarker("item",OB(m.color),h);var y=NF(a.formatTooltip(l,!1,c)),v=d.get("order"),_=d.get("valueFormatter"),x=y.frag,b=x?MV(_?pE({valueFormatter:_},x):x,g,h,v,n.get("useUTC"),d.get("textStyle")):y.text,w="item_"+a.name+"_"+l;this._showOrMove(d,(function(){this._showTooltipContent(d,b,m,w,t.offsetX,t.offsetY,t.position,t.target,g)})),i({type:"showTip",dataIndexInside:l,dataIndex:u.getRawIndex(l),seriesIndex:o,from:this.uid})}},e.prototype._showComponentItemTooltip=function(t,e,i){var n=KD(e),r=n.tooltipConfig.option||{};if(ME(r)){r={content:r,formatter:r}}var o=[r],s=this._ecModel.getComponent(n.componentMainType,n.componentIndex);s&&o.push(s),o.push({formatter:r.content});var a=t.positionDefault,l=_it(o,this._tooltipModel,a?{position:a}:null),c=l.get("content"),u=Math.random()+"",h=new LV;this._showOrMove(l,(function(){var i=cE(l.get("formatterParams")||{});this._showTooltipContent(l,c,i,u,t.offsetX,t.offsetY,t.position,e,h)})),i({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(t,e,i,n,r,o,s,a,l){if(this._ticket="",t.get("showContent")&&t.get("show")){var c=this._tooltipContent;c.setEnterable(t.get("enterable"));var u=t.get("formatter");s=s||t.get("position");var h=e,p=this._getNearestPoint([r,o],i,t.get("trigger"),t.get("borderColor")).color;if(u)if(ME(u)){var d=t.ecModel.get("useUTC"),f=EE(i)?i[0]:i;h=u,f&&f.axisType&&f.axisType.indexOf("time")>=0&&(h=uB(f.axisValue,h,d)),h=RB(h,i,!0)}else if(SE(u)){var m=wE((function(e,n){e===this._ticket&&(c.setContent(n,l,t,p,s),this._updatePosition(t,s,r,o,c,i,a))}),this);this._ticket=n,h=u(i,n,m)}else h=u;c.setContent(h,l,t,p,s),c.show(t,p),this._updatePosition(t,s,r,o,c,i,a)}},e.prototype._getNearestPoint=function(t,e,i,n){return"axis"===i||EE(e)?{color:n||("html"===this._renderMode?"#fff":"none")}:EE(e)?void 0:{color:n||e.color||e.borderColor}},e.prototype._updatePosition=function(t,e,i,n,r,o,s){var a=this._api.getWidth(),l=this._api.getHeight();e=e||t.get("position");var c=r.getSize(),u=t.get("align"),h=t.get("verticalAlign"),p=s&&s.getBoundingRect().clone();if(s&&p.applyTransform(s.transform),SE(e)&&(e=e([i,n],o,r.el,p,{viewSize:[a,l],contentSize:c.slice()})),EE(e))i=IC(e[0],a),n=IC(e[1],l);else if(CE(e)){var d=e;d.width=c[0],d.height=c[1];var f=UB(d,{width:a,height:l});i=f.x,n=f.y,u=null,h=null}else if(ME(e)&&s){var m=function(t,e,i,n){var r=i[0],o=i[1],s=Math.ceil(Math.SQRT2*n)+8,a=0,l=0,c=e.width,u=e.height;switch(t){case"inside":a=e.x+c/2-r/2,l=e.y+u/2-o/2;break;case"top":a=e.x+c/2-r/2,l=e.y-o-s;break;case"bottom":a=e.x+c/2-r/2,l=e.y+u+s;break;case"left":a=e.x-r-s,l=e.y+u/2-o/2;break;case"right":a=e.x+c+s,l=e.y+u/2-o/2}return[a,l]}(e,p,c,t.get("borderWidth"));i=m[0],n=m[1]}else{m=function(t,e,i,n,r,o,s){var a=i.getSize(),l=a[0],c=a[1];null!=o&&(t+l+o+2>n?t-=l+o:t+=o);null!=s&&(e+c+s>r?e-=c+s:e+=s);return[t,e]}(i,n,r,a,l,u?null:20,h?null:20);i=m[0],n=m[1]}if(u&&(i-=bit(u)?c[0]/2:"right"===u?c[0]:0),h&&(n-=bit(h)?c[1]/2:"bottom"===h?c[1]:0),eit(t)){m=function(t,e,i,n,r){var o=i.getSize(),s=o[0],a=o[1];return t=Math.min(t+s,n)-s,e=Math.min(e+a,r)-a,t=Math.max(t,0),e=Math.max(e,0),[t,e]}(i,n,r,a,l);i=m[0],n=m[1]}r.moveTo(i,n)},e.prototype._updateContentNotChangedOnAxis=function(t,e){var i=this._lastDataByCoordSys,n=this._cbParamsList,r=!!i&&i.length===t.length;return r&&yE(i,(function(i,o){var s=i.dataByAxis||[],a=(t[o]||{}).dataByAxis||[];(r=r&&s.length===a.length)&&yE(s,(function(t,i){var o=a[i]||{},s=t.seriesDataIndices||[],l=o.seriesDataIndices||[];(r=r&&t.value===o.value&&t.axisType===o.axisType&&t.axisId===o.axisId&&s.length===l.length)&&yE(s,(function(t,e){var i=l[e];r=r&&t.seriesIndex===i.seriesIndex&&t.dataIndex===i.dataIndex})),n&&yE(t.seriesDataIndices,(function(t){var i=t.seriesIndex,o=e[i],s=n[i];o&&s&&s.data!==o.data&&(r=!1)}))}))})),this._lastDataByCoordSys=t,this._cbParamsList=e,!!r},e.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},e.prototype.dispose=function(t,e){!UA.node&&e.getDom()&&(lU(this,"_updatePosition"),this._tooltipContent.dispose(),q8("itemTooltip",e))},e.type="tooltip",e}(qV);function _it(t,e,i){var n,r=e.ecModel;i?(n=new FN(i,r,r),n=new FN(e.option,n,r)):n=e;for(var o=t.length-1;o>=0;o--){var s=t[o];s&&(s instanceof FN&&(s=s.get("tooltip",!0)),ME(s)&&(s={formatter:s}),s&&(n=new FN(s,n,r)))}return n}function xit(t,e){return t.dispatchAction||wE(e.dispatchAction,e)}function bit(t){return"center"===t||"middle"===t}var wit=vit;var Ait=["rect","polygon","keep","clear"];function Eit(t,e){var i=lP(t?t.brush:[]);if(i.length){var n=[];yE(i,(function(t){var e=t.hasOwnProperty("toolbox")?t.toolbox:[];e instanceof Array&&(n=n.concat(e))}));var r=t&&t.toolbox;EE(r)&&(r=r[0]),r||(r={feature:{}},t.toolbox=[r]);var o=r.feature||(r.feature={}),s=o.brush||(o.brush={}),a=s.type||(s.type=[]);a.push.apply(a,n),function(t){var e={};yE(t,(function(t){e[t]=1})),t.length=0,yE(e,(function(e,i){t.push(i)}))}(a),e&&!a.length&&a.push.apply(a,Ait)}}var Sit=yE;function Mit(t){if(t)for(var e in t)if(t.hasOwnProperty(e))return!0}function Tit(t,e,i){var n={};return Sit(e,(function(e){var r,o=n[e]=((r=function(){}).prototype.__hidden=r.prototype,new r);Sit(t[e],(function(t,n){if(X0.isValidType(n)){var r={type:n,visual:t};i&&i(r,e),o[n]=new X0(r),"opacity"===n&&((r=cE(r)).type="colorAlpha",o.__hidden.__alphaForOpacity=new X0(r))}}))})),n}function Iit(t,e,i){var n;yE(i,(function(t){e.hasOwnProperty(t)&&Mit(e[t])&&(n=!0)})),n&&yE(i,(function(i){e.hasOwnProperty(i)&&Mit(e[i])?t[i]=cE(e[i]):delete t[i]}))}var Cit={lineX:Pit(0),lineY:Pit(1),rect:{point:function(t,e,i){return t&&i.boundingRect.contain(t[0],t[1])},rect:function(t,e,i){return t&&i.boundingRect.intersect(t)}},polygon:{point:function(t,e,i){return t&&i.boundingRect.contain(t[0],t[1])&&eq(i.range,t[0],t[1])},rect:function(t,e,i){var n=i.range;if(!t||n.length<=1)return!1;var r=t.x,o=t.y,s=t.width,a=t.height,l=n[0];return!!(eq(n,r,o)||eq(n,r+s,o)||eq(n,r,o+a)||eq(n,r+s,o+a)||pM.create(t).contain(l[0],l[1])||nN(r,o,r+s,o,n)||nN(r,o,r,o+a,n)||nN(r+s,o,r+s,o+a,n)||nN(r,o+a,r+s,o+a,n))||void 0}}};function Pit(t){var e=["x","y"],i=["width","height"];return{point:function(e,i,n){if(e){var r=n.range;return Lit(e[t],r)}},rect:function(n,r,o){if(n){var s=o.range,a=[n[e[t]],n[e[t]]+n[i[t]]];return a[1]<a[0]&&a.reverse(),Lit(a[0],s)||Lit(a[1],s)||Lit(s[0],a)||Lit(s[1],a)}}}}function Lit(t,e){return e[0]<=t&&t<=e[1]}var Dit=["inBrush","outOfBrush"],Rit="__ecBrushSelect",Oit="__ecInBrushSelectEvent";function kit(t){t.eachComponent({mainType:"brush"},(function(e){(e.brushTargetManager=new qet(e.option,t)).setInputRanges(e.areas,t)}))}function Nit(t,e,i){var n,r,o=[];t.eachComponent({mainType:"brush"},(function(t){i&&"takeGlobalCursor"===i.type&&t.setBrushOption("brush"===i.key?i.brushOption:{brushType:!1})})),kit(t),t.eachComponent({mainType:"brush"},(function(e,i){var s={brushId:e.id,brushIndex:i,brushName:e.name,areas:cE(e.areas),selected:[]};o.push(s);var a=e.option,l=a.brushLink,c=[],u=[],h=[],p=!1;i||(n=a.throttleType,r=a.throttleDelay);var d=vE(e.areas,(function(t){var e=Fit[t.brushType],i=dE({boundingRect:e?e(t):void 0},t);return i.selectors=function(t){var e=t.brushType,i={point:function(n){return Cit[e].point(n,i,t)},rect:function(n){return Cit[e].rect(n,i,t)}};return i}(i),i})),f=Tit(e.option,Dit,(function(t){t.mappingMethod="fixed"}));function m(t){return"all"===l||!!c[t]}function g(t){return!!t.length}EE(l)&&yE(l,(function(t){c[t]=1})),t.eachSeries((function(i,n){var r=h[n]=[];"parallel"===i.subType?function(t,e){var i=t.coordinateSystem;p=p||i.hasAxisBrushed(),m(e)&&i.eachActiveState(t.getData(),(function(t,e){"active"===t&&(u[e]=1)}))}(i,n):function(i,n,r){if(!i.brushSelector||function(t,e){var i=t.option.seriesIndex;return null!=i&&"all"!==i&&(EE(i)?fE(i,e)<0:e!==i)}(e,n))return;if(yE(d,(function(n){e.brushTargetManager.controlSeries(n,i,t)&&r.push(n),p=p||g(r)})),m(n)&&g(r)){var o=i.getData();o.each((function(t){zit(i,r,o,t)&&(u[t]=1)}))}}(i,n,r)})),t.eachSeries((function(t,e){var i={seriesId:t.id,seriesIndex:e,seriesName:t.name,dataIndex:[]};s.selected.push(i);var n=h[e],r=t.getData(),o=m(e)?function(t){return u[t]?(i.dataIndex.push(r.getRawIndex(t)),"inBrush"):"outOfBrush"}:function(e){return zit(t,n,r,e)?(i.dataIndex.push(r.getRawIndex(e)),"inBrush"):"outOfBrush"};(m(e)?p:g(n))&&function(t,e,i,n,r,o){var s,a={};function l(t){return ZU(i,s,t)}function c(t,e){QU(i,s,t,e)}function u(t,u){s=null==o?t:u;var h=i.getRawDataItem(s);if(!h||!1!==h.visualMap)for(var p=n.call(r,t),d=e[p],f=a[p],m=0,g=f.length;m<g;m++){var y=f[m];d[y]&&d[y].applyVisual(t,l,c)}}yE(t,(function(t){var i=X0.prepareVisualTypes(e[t]);a[t]=i})),null==o?i.each(u):i.each([o],u)}(Dit,f,r,o)}))})),function(t,e,i,n,r){if(!r)return;var o=t.getZr();if(o[Oit])return;o[Rit]||(o[Rit]=Bit);var s=aU(o,Rit,i,e);s(t,n)}(e,n,r,o,i)}function Bit(t,e){if(!t.isDisposed()){var i=t.getZr();i[Oit]=!0,t.dispatchAction({type:"brushSelect",batch:e}),i[Oit]=!1}}function zit(t,e,i,n){for(var r=0,o=e.length;r<o;r++){var s=e[r];if(t.brushSelector(n,i,s.selectors,s))return!0}}var Fit={rect:function(t){return Vit(t.range)},polygon:function(t){for(var e,i=t.range,n=0,r=i.length;n<r;n++){e=e||[[1/0,-1/0],[1/0,-1/0]];var o=i[n];o[0]<e[0][0]&&(e[0][0]=o[0]),o[0]>e[0][1]&&(e[0][1]=o[0]),o[1]<e[1][0]&&(e[1][0]=o[1]),o[1]>e[1][1]&&(e[1][1]=o[1])}return e&&Vit(e)}};function Vit(t){return new pM(t[0][0],t[1][0],t[0][1]-t[0][0],t[1][1]-t[1][0])}var Uit=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.init=function(t,e){this.ecModel=t,this.api=e,this.model,(this._brushController=new d5(e.getZr())).on("brush",wE(this._onBrush,this)).mount()},e.prototype.render=function(t,e,i,n){this.model=t,this._updateController(t,e,i,n)},e.prototype.updateTransform=function(t,e,i,n){kit(e),this._updateController(t,e,i,n)},e.prototype.updateVisual=function(t,e,i,n){this.updateTransform(t,e,i,n)},e.prototype.updateView=function(t,e,i,n){this._updateController(t,e,i,n)},e.prototype._updateController=function(t,e,i,n){(!n||n.$from!==t.id)&&this._brushController.setPanels(t.brushTargetManager.makePanelOpts(i)).enableBrush(t.brushOption).updateCovers(t.areas.slice())},e.prototype.dispose=function(){this._brushController.dispose()},e.prototype._onBrush=function(t){var e=this.model.id,i=this.model.brushTargetManager.setOutputRanges(t.areas,this.ecModel);(!t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:e,areas:cE(i),$from:e}),t.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:e,areas:cE(i),$from:e})},e.type="brush",e}(qV),Git=Uit,jit=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.areas=[],i.brushOption={},i}return zA(e,t),e.prototype.optionUpdated=function(t,e){var i=this.option;!e&&Iit(i,t,["inBrush","outOfBrush"]);var n=i.inBrush=i.inBrush||{};i.outOfBrush=i.outOfBrush||{color:"#ddd"},n.hasOwnProperty("liftZ")||(n.liftZ=5)},e.prototype.setAreas=function(t){"production"!==process.env.NODE_ENV&&(UE(EE(t)),yE(t,(function(t){UE(t.brushType,"Illegal areas")}))),t&&(this.areas=vE(t,(function(t){return Hit(this.option,t)}),this))},e.prototype.setBrushOption=function(t){this.brushOption=Hit(this.option,t),this.brushType=this.brushOption.brushType},e.type="brush",e.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],e.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(210,219,238,0.3)",borderColor:"#D2DBEE"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},e}(YB);function Hit(t,e){return uE({brushType:t.brushType,brushMode:t.brushMode,transformable:t.transformable,brushStyle:new FN(t.brushStyle).getItemStyle(),removeOnClick:t.removeOnClick,z:t.z},e,!0)}var Wit=jit,qit=["rect","polygon","lineX","lineY","keep","clear"],Xit=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return zA(e,t),e.prototype.render=function(t,e,i){var n,r,o;e.eachComponent({mainType:"brush"},(function(t){n=t.brushType,r=t.brushOption.brushMode||"single",o=o||!!t.areas.length})),this._brushType=n,this._brushMode=r,yE(t.get("type",!0),(function(e){t.setIconStatus(e,("keep"===e?"multiple"===r:"clear"===e?o:e===n)?"emphasis":"normal")}))},e.prototype.updateView=function(t,e,i){this.render(t,e,i)},e.prototype.getIcons=function(){var t=this.model,e=t.get("icon",!0),i={};return yE(t.get("type",!0),(function(t){e[t]&&(i[t]=e[t])})),i},e.prototype.onclick=function(t,e,i){var n=this._brushType,r=this._brushMode;"clear"===i?(e.dispatchAction({type:"axisAreaSelect",intervals:[]}),e.dispatchAction({type:"brush",command:"clear",areas:[]})):e.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===i?n:n!==i&&i,brushMode:"keep"===i?"multiple"===r?"single":"multiple":r}})},e.getDefaultOption=function(t){return{show:!0,type:qit.slice(),icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:t.getLocaleModel().get(["toolbox","brush","title"])}},e}(eet),Zit=Xit;var Yit=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.layoutMode={type:"box",ignoreSize:!0},i}return zA(e,t),e.type="title",e.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},e}(YB),Qit=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.render=function(t,e,i){if(this.group.removeAll(),t.get("show")){var n=this.group,r=t.getModel("textStyle"),o=t.getModel("subtextStyle"),s=t.get("textAlign"),a=BE(t.get("textBaseline"),t.get("textVerticalAlign")),l=new JD({style:mN(r,{text:t.get("text"),fill:r.getTextColor()},{disableBox:!0}),z2:10}),c=l.getBoundingRect(),u=t.get("subtext"),h=new JD({style:mN(o,{text:u,fill:o.getTextColor(),y:c.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),p=t.get("link"),d=t.get("sublink"),f=t.get("triggerEvent",!0);l.silent=!p&&!f,h.silent=!d&&!f,p&&l.on("click",(function(){kB(p,"_"+t.get("target"))})),d&&h.on("click",(function(){kB(d,"_"+t.get("subtarget"))})),KD(l).eventData=KD(h).eventData=f?{componentType:"title",componentIndex:t.componentIndex}:null,n.add(l),u&&n.add(h);var m=n.getBoundingRect(),g=t.getBoxLayoutParams();g.width=m.width,g.height=m.height;var y=UB(g,{width:i.getWidth(),height:i.getHeight()},t.get("padding"));s||("middle"===(s=t.get("left")||t.get("right"))&&(s="center"),"right"===s?y.x+=y.width:"center"===s&&(y.x+=y.width/2)),a||("center"===(a=t.get("top")||t.get("bottom"))&&(a="middle"),"bottom"===a?y.y+=y.height:"middle"===a&&(y.y+=y.height/2),a=a||"top"),n.x=y.x,n.y=y.y,n.markRedraw();var v={align:s,verticalAlign:a};l.setStyle(v),h.setStyle(v),m=n.getBoundingRect();var _=y.margin,x=t.getItemStyle(["color","opacity"]);x.fill=t.get("backgroundColor");var b=new kD({shape:{x:m.x-_[3],y:m.y-_[0],width:m.width+_[1]+_[3],height:m.height+_[0]+_[2],r:t.get("borderRadius")},style:x,subPixelOptimize:!0,silent:!0});n.add(b)}},e.type="title",e}(qV);var Jit=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.layoutMode="box",i}return zA(e,t),e.prototype.init=function(t,e,i){this.mergeDefaultAndTheme(t,i),this._initData()},e.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),this._initData()},e.prototype.setCurrentIndex=function(t){null==t&&(t=this.option.currentIndex);var e=this._data.count();this.option.loop?t=(t%e+e)%e:(t>=e&&(t=e-1),t<0&&(t=0)),this.option.currentIndex=t},e.prototype.getCurrentIndex=function(){return this.option.currentIndex},e.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},e.prototype.setPlayState=function(t){this.option.autoPlay=!!t},e.prototype.getPlayState=function(){return!!this.option.autoPlay},e.prototype._initData=function(){var t,e=this.option,i=e.data||[],n=e.axisType,r=this._names=[];"category"===n?(t=[],yE(i,(function(e,i){var n,o=gP(hP(e),"");CE(e)?(n=cE(e)).value=i:n=i,t.push(n),r.push(o)}))):t=i;var o={category:"ordinal",time:"time",value:"number"}[n]||"number";(this._data=new PH([{name:"value",type:o}],this)).initData(t,r)},e.prototype.getData=function(){return this._data},e.prototype.getCategories=function(){if("category"===this.get("axisType"))return this._names.slice()},e.type="timeline",e.defaultOption={z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},e}(YB),Kit=Jit,$it=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.type="timeline.slider",e.defaultOption=GN(Kit.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:"#DAE1F5"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#A4B1D7"},itemStyle:{color:"#A4B1D7",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:15,color:"#316bf3",borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0, 0, 0, 0.3)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",prevIcon:"M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",prevBtnSize:18,nextBtnSize:18,color:"#A4B1D7",borderColor:"#A4B1D7",borderWidth:1},emphasis:{label:{show:!0,color:"#6f778d"},itemStyle:{color:"#316BF3"},controlStyle:{color:"#316BF3",borderColor:"#316BF3",borderWidth:2}},progress:{lineStyle:{color:"#316BF3"},itemStyle:{color:"#316BF3"},label:{color:"#6f778d"}},data:[]}),e}(Kit);mE($it,kF.prototype);var tnt=$it,ent=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.type="timeline",e}(qV),int=ent,nnt=function(t){function e(e,i,n,r){var o=t.call(this,e,i,n)||this;return o.type=r||"value",o}return zA(e,t),e.prototype.getLabelModel=function(){return this.model.getModel("label")},e.prototype.isHorizontal=function(){return"horizontal"===this.model.get("orient")},e}(Sq),rnt=nnt,ont=Math.PI,snt=wP(),ant=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.init=function(t,e){this.api=e},e.prototype.render=function(t,e,i){if(this.model=t,this.api=i,this.ecModel=e,this.group.removeAll(),t.get("show",!0)){var n=this._layout(t,i),r=this._createGroup("_mainGroup"),o=this._createGroup("_labelGroup"),s=this._axis=this._createAxis(n,t);t.formatTooltip=function(t){return xV("nameValue",{noName:!0,value:s.scale.getLabel({value:t})})},yE(["AxisLine","AxisTick","Control","CurrentPointer"],(function(e){this["_render"+e](n,r,s,t)}),this),this._renderAxisLabel(n,o,s,t),this._position(n,t)}this._doPlayStop(),this._updateTicksStatus()},e.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},e.prototype.dispose=function(){this._clearTimer()},e.prototype._layout=function(t,e){var i,n,r,o,s=t.get(["label","position"]),a=t.get("orient"),l=function(t,e){return UB(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()},t.get("padding"))}(t,e),c={horizontal:"center",vertical:(i=null==s||"auto"===s?"horizontal"===a?l.y+l.height/2<e.getHeight()/2?"-":"+":l.x+l.width/2<e.getWidth()/2?"+":"-":ME(s)?{horizontal:{top:"-",bottom:"+"},vertical:{left:"-",right:"+"}}[a][s]:s)>=0||"+"===i?"left":"right"},u={horizontal:i>=0||"+"===i?"top":"bottom",vertical:"middle"},h={horizontal:0,vertical:ont/2},p="vertical"===a?l.height:l.width,d=t.getModel("controlStyle"),f=d.get("show",!0),m=f?d.get("itemSize"):0,g=f?d.get("itemGap"):0,y=m+g,v=t.get(["label","rotate"])||0;v=v*ont/180;var _=d.get("position",!0),x=f&&d.get("showPlayBtn",!0),b=f&&d.get("showPrevBtn",!0),w=f&&d.get("showNextBtn",!0),A=0,E=p;"left"===_||"bottom"===_?(x&&(n=[0,0],A+=y),b&&(r=[A,0],A+=y),w&&(o=[E-m,0],E-=y)):(x&&(n=[E-m,0],E-=y),b&&(r=[0,0],A+=y),w&&(o=[E-m,0],E-=y));var S=[A,E];return t.get("inverse")&&S.reverse(),{viewRect:l,mainLength:p,orient:a,rotation:h[a],labelRotation:v,labelPosOpt:i,labelAlign:t.get(["label","align"])||c[a],labelBaseline:t.get(["label","verticalAlign"])||t.get(["label","baseline"])||u[a],playPosition:n,prevBtnPosition:r,nextBtnPosition:o,axisExtent:S,controlSize:m,controlGap:g}},e.prototype._position=function(t,e){var i=this._mainGroup,n=this._labelGroup,r=t.viewRect;if("vertical"===t.orient){var o=[1,0,0,1,0,0],s=r.x,a=r.y+r.height;JS(o,o,[-s,-a]),KS(o,o,-ont/2),JS(o,o,[s,a]),(r=r.clone()).applyTransform(o)}var l=g(r),c=g(i.getBoundingRect()),u=g(n.getBoundingRect()),h=[i.x,i.y],p=[n.x,n.y];p[0]=h[0]=l[0][0];var d,f=t.labelPosOpt;null==f||ME(f)?(y(h,c,l,1,d="+"===f?0:1),y(p,u,l,1,1-d)):(y(h,c,l,1,d=f>=0?0:1),p[1]=h[1]+f);function m(t){t.originX=l[0][0]-t.x,t.originY=l[1][0]-t.y}function g(t){return[[t.x,t.x+t.width],[t.y,t.y+t.height]]}function y(t,e,i,n,r){t[n]+=i[n][r]-e[n][r]}i.setPosition(h),n.setPosition(p),i.rotation=n.rotation=t.rotation,m(i),m(n)},e.prototype._createAxis=function(t,e){var i=e.getData(),n=e.get("axisType"),r=function(t,e){if(e=e||t.get("type"),e)switch(e){case"category":return new eW({ordinalMeta:t.getCategories(),extent:[1/0,-1/0]});case"time":return new MW({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC")});default:return new rW}}(e,n);r.getTicks=function(){return i.mapArray(["value"],(function(t){return{value:t}}))};var o=i.getDataExtent("value");r.setExtent(o[0],o[1]),r.calcNiceTicks();var s=new rnt("value",r,t.axisExtent,n);return s.model=e,s},e.prototype._createGroup=function(t){var e=this[t]=new xC;return this.group.add(e),e},e.prototype._renderAxisLine=function(t,e,i,n){var r=i.getExtent();if(n.get(["lineStyle","show"])){var o=new nk({shape:{x1:r[0],y1:0,x2:r[1],y2:0},style:pE({lineCap:"round"},n.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});e.add(o);var s=this._progressLine=new nk({shape:{x1:r[0],x2:this._currentPointer?this._currentPointer.x:r[0],y1:0,y2:0},style:dE({lineCap:"round",lineWidth:o.style.lineWidth},n.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});e.add(s)}},e.prototype._renderAxisTick=function(t,e,i,n){var r=this,o=n.getData(),s=i.scale.getTicks();this._tickSymbols=[],yE(s,(function(t){var s=i.dataToCoord(t.value),a=o.getItemModel(t.value),l=a.getModel("itemStyle"),c=a.getModel(["emphasis","itemStyle"]),u=a.getModel(["progress","itemStyle"]),h={x:s,y:0,onclick:wE(r._changeTimeline,r,t.value)},p=lnt(a,l,e,h);p.ensureState("emphasis").style=c.getItemStyle(),p.ensureState("progress").style=u.getItemStyle(),qR(p);var d=KD(p);a.get("tooltip")?(d.dataIndex=t.value,d.dataModel=n):d.dataIndex=d.dataModel=null,r._tickSymbols.push(p)}))},e.prototype._renderAxisLabel=function(t,e,i,n){var r=this;if(i.getLabelModel().get("show")){var o=n.getData(),s=i.getViewLabels();this._tickLabels=[],yE(s,(function(n){var s=n.tickValue,a=o.getItemModel(s),l=a.getModel("label"),c=a.getModel(["emphasis","label"]),u=a.getModel(["progress","label"]),h=i.dataToCoord(n.tickValue),p=new JD({x:h,y:0,rotation:t.labelRotation-t.rotation,onclick:wE(r._changeTimeline,r,s),silent:!1,style:mN(l,{text:n.formattedLabel,align:t.labelAlign,verticalAlign:t.labelBaseline})});p.ensureState("emphasis").style=mN(c),p.ensureState("progress").style=mN(u),e.add(p),qR(p),snt(p).dataIndex=s,r._tickLabels.push(p)}))}},e.prototype._renderControl=function(t,e,i,n){var r=t.controlSize,o=t.rotation,s=n.getModel("controlStyle").getItemStyle(),a=n.getModel(["emphasis","controlStyle"]).getItemStyle(),l=n.getPlayState(),c=n.get("inverse",!0);function u(t,i,l,c){if(t){var u=sC(BE(n.get(["controlStyle",i+"BtnSize"]),r),r),h=function(t,e,i,n){var r=n.style,o=iN(t.get(["controlStyle",e]),n||{},new pM(i[0],i[1],i[2],i[3]));r&&o.setStyle(r);return o}(n,i+"Icon",[0,-u/2,u,u],{x:t[0],y:t[1],originX:r/2,originY:0,rotation:c?-o:0,rectHover:!0,style:s,onclick:l});h.ensureState("emphasis").style=a,e.add(h),qR(h)}}u(t.nextBtnPosition,"next",wE(this._changeTimeline,this,c?"-":"+")),u(t.prevBtnPosition,"prev",wE(this._changeTimeline,this,c?"+":"-")),u(t.playPosition,l?"stop":"play",wE(this._handlePlayClick,this,!l),!0)},e.prototype._renderCurrentPointer=function(t,e,i,n){var r=n.getData(),o=n.getCurrentIndex(),s=r.getItemModel(o).getModel("checkpointStyle"),a=this,l={onCreate:function(t){t.draggable=!0,t.drift=wE(a._handlePointerDrag,a),t.ondragend=wE(a._handlePointerDragend,a),cnt(t,a._progressLine,o,i,n,!0)},onUpdate:function(t){cnt(t,a._progressLine,o,i,n)}};this._currentPointer=lnt(s,s,this._mainGroup,{},this._currentPointer,l)},e.prototype._handlePlayClick=function(t){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:t,from:this.uid})},e.prototype._handlePointerDrag=function(t,e,i){this._clearTimer(),this._pointerChangeTimeline([i.offsetX,i.offsetY])},e.prototype._handlePointerDragend=function(t){this._pointerChangeTimeline([t.offsetX,t.offsetY],!0)},e.prototype._pointerChangeTimeline=function(t,e){var i=this._toAxisCoord(t)[0],n=PC(this._axis.getExtent().slice());i>n[1]&&(i=n[1]),i<n[0]&&(i=n[0]),this._currentPointer.x=i,this._currentPointer.markRedraw();var r=this._progressLine;r&&(r.shape.x2=i,r.dirty());var o=this._findNearestTick(i),s=this.model;(e||o!==s.getCurrentIndex()&&s.get("realtime"))&&this._changeTimeline(o)},e.prototype._doPlayStop=function(){var t=this;this._clearTimer(),this.model.getPlayState()&&(this._timer=setTimeout((function(){var e=t.model;t._changeTimeline(e.getCurrentIndex()+(e.get("rewind",!0)?-1:1))}),this.model.get("playInterval")))},e.prototype._toAxisCoord=function(t){return Jk(t,this._mainGroup.getLocalTransform(),!0)},e.prototype._findNearestTick=function(t){var e,i=this.model.getData(),n=1/0,r=this._axis;return i.each(["value"],(function(i,o){var s=r.dataToCoord(i),a=Math.abs(s-t);a<n&&(n=a,e=o)})),e},e.prototype._clearTimer=function(){this._timer&&(clearTimeout(this._timer),this._timer=null)},e.prototype._changeTimeline=function(t){var e=this.model.getCurrentIndex();"+"===t?t=e+1:"-"===t&&(t=e-1),this.api.dispatchAction({type:"timelineChange",currentIndex:t,from:this.uid})},e.prototype._updateTicksStatus=function(){var t=this.model.getCurrentIndex(),e=this._tickSymbols,i=this._tickLabels;if(e)for(var n=0;n<e.length;n++)e&&e[n]&&e[n].toggleState("progress",n<t);if(i)for(n=0;n<i.length;n++)i&&i[n]&&i[n].toggleState("progress",snt(i[n]).dataIndex<=t)},e.type="timeline.slider",e}(int);function lnt(t,e,i,n,r,o){var s=e.get("color");r?(r.setColor(s),i.add(r),o&&o.onUpdate(r)):((r=pG(t.get("symbol"),-1,-1,2,2,s)).setStyle("strokeNoScale",!0),i.add(r),o&&o.onCreate(r));var a=e.getItemStyle(["color"]);r.setStyle(a),n=uE({rectHover:!0,z2:100},n,!0);var l=dG(t.get("symbolSize"));n.scaleX=l[0]/2,n.scaleY=l[1]/2;var c=fG(t.get("symbolOffset"),l);c&&(n.x=(n.x||0)+c[0],n.y=(n.y||0)+c[1]);var u=t.get("symbolRotate");return n.rotation=(u||0)*Math.PI/180||0,r.attr(n),r.updateTransform(),r}function cnt(t,e,i,n,r,o){if(!t.dragging){var s=r.getModel("checkpointStyle"),a=n.dataToCoord(r.getData().get("value",i));if(o||!s.get("animation",!0))t.attr({x:a,y:0}),e&&e.attr({shape:{x2:a}});else{var l={duration:s.get("animationDuration",!0),easing:s.get("animationEasing",!0)};t.stopAnimation(null,!0),t.animateTo({x:a,y:0},l),e&&e.animateTo({shape:{x2:a}},l)}}}var unt=ant;function hnt(t){var e=t&&t.timeline;EE(e)||(e=e?[e]:[]),yE(e,(function(t){t&&function(t){var e=t.type,i={number:"value",time:"time"};i[e]&&(t.axisType=i[e],delete t.type);if(pnt(t),dnt(t,"controlPosition")){var n=t.controlStyle||(t.controlStyle={});dnt(n,"position")||(n.position=t.controlPosition),"none"!==n.position||dnt(n,"show")||(n.show=!1,delete n.position),delete t.controlPosition}yE(t.data||[],(function(t){CE(t)&&!EE(t)&&(!dnt(t,"value")&&dnt(t,"name")&&(t.value=t.name),pnt(t))}))}(t)}))}function pnt(t){var e=t.itemStyle||(t.itemStyle={}),i=e.emphasis||(e.emphasis={}),n=t.label||t.label||{},r=n.normal||(n.normal={}),o={normal:1,emphasis:1};yE(n,(function(t,e){o[e]||dnt(r,e)||(r[e]=t)})),i.label&&!dnt(n,"emphasis")&&(n.emphasis=i.label,delete i.label)}function dnt(t,e){return t.hasOwnProperty(e)}function fnt(t,e){if(!t)return!1;for(var i=EE(t)?t:[t],n=0;n<i.length;n++)if(i[n]&&i[n][e])return!0;return!1}function mnt(t){cP(t,"label",["show"])}var gnt=wP(),ynt=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.createdBySelf=!1,i}return zA(e,t),e.prototype.init=function(t,e,i){if("production"!==process.env.NODE_ENV&&"marker"===this.type)throw new Error("Marker component is abstract component. Use markLine, markPoint, markArea instead.");this.mergeDefaultAndTheme(t,i),this._mergeOption(t,i,!1,!0)},e.prototype.isAnimationEnabled=function(){if(UA.node)return!1;var t=this.__hostSeries;return this.getShallow("animation")&&t&&t.isAnimationEnabled()},e.prototype.mergeOption=function(t,e){this._mergeOption(t,e,!1,!1)},e.prototype._mergeOption=function(t,e,i,n){var r=this.mainType;i||e.eachSeries((function(t){var i=t.get(this.mainType,!0),o=gnt(t)[r];i&&i.data?(o?o._mergeOption(i,e,!0):(n&&mnt(i),yE(i.data,(function(t){t instanceof Array?(mnt(t[0]),mnt(t[1])):mnt(t)})),pE(o=this.createMarkerModelFromSeries(i,this,e),{mainType:this.mainType,seriesIndex:t.seriesIndex,name:t.name,createdBySelf:!0}),o.__hostSeries=t),gnt(t)[r]=o):gnt(t)[r]=null}),this)},e.prototype.formatTooltip=function(t,e,i){var n=this.getData(),r=this.getRawValue(t),o=n.getName(t);return xV("section",{header:this.name,blocks:[xV("nameValue",{name:o,value:r,noName:!o,noValue:null==r})]})},e.prototype.getData=function(){return this._data},e.prototype.setData=function(t){this._data=t},e.getMarkerModelFromSeries=function(t,e){return gnt(t)[e]},e.type="marker",e.dependencies=["series","grid","polar","geo"],e}(YB);mE(ynt,kF.prototype);var vnt=ynt,_nt=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.createMarkerModelFromSeries=function(t,i,n){return new e(t,i,n)},e.type="markPoint",e.defaultOption={z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}},e}(vnt),xnt=_nt;function bnt(t){return!(isNaN(parseFloat(t.x))&&isNaN(parseFloat(t.y)))}function wnt(t,e,i,n,r,o){var s=[],a=BH(e,n)?e.getCalculationInfo("stackResultDimension"):n,l=Int(e,a,t),c=e.indicesOfNearest(a,l)[0];s[r]=e.get(i,c),s[o]=e.get(a,c);var u=e.get(n,c),h=LC(e.get(n,c));return(h=Math.min(h,20))>=0&&(s[o]=+s[o].toFixed(h)),[s,u]}var Ant={min:AE(wnt,"min"),max:AE(wnt,"max"),average:AE(wnt,"average"),median:AE(wnt,"median")};function Ent(t,e){if(e){var i=t.getData(),n=t.coordinateSystem,r=n&&n.dimensions;if(!function(t){return!isNaN(parseFloat(t.x))&&!isNaN(parseFloat(t.y))}(e)&&!EE(e.coord)&&EE(r)){var o=Snt(e,i,n,t);if((e=cE(e)).type&&Ant[e.type]&&o.baseAxis&&o.valueAxis){var s=fE(r,o.baseAxis.dim),a=fE(r,o.valueAxis.dim),l=Ant[e.type](i,o.baseDataDim,o.valueDataDim,s,a);e.coord=l[0],e.value=l[1]}else e.coord=[null!=e.xAxis?e.xAxis:e.radiusAxis,null!=e.yAxis?e.yAxis:e.angleAxis]}if(null!=e.coord&&EE(r))for(var c=e.coord,u=0;u<2;u++)Ant[c[u]]&&(c[u]=Int(i,i.mapDimension(r[u]),c[u]));else e.coord=[];return e}}function Snt(t,e,i,n){var r={};return null!=t.valueIndex||null!=t.valueDim?(r.valueDataDim=null!=t.valueIndex?e.getDimension(t.valueIndex):t.valueDim,r.valueAxis=i.getAxis(function(t,e){var i=t.getData().getDimensionInfo(e);return i&&i.coordDim}(n,r.valueDataDim)),r.baseAxis=i.getOtherAxis(r.valueAxis),r.baseDataDim=e.mapDimension(r.baseAxis.dim)):(r.baseAxis=n.getBaseAxis(),r.valueAxis=i.getOtherAxis(r.baseAxis),r.baseDataDim=e.mapDimension(r.baseAxis.dim),r.valueDataDim=e.mapDimension(r.valueAxis.dim)),r}function Mnt(t,e){return!(t&&t.containData&&e.coord&&!bnt(e))||t.containData(e.coord)}function Tnt(t,e){return t?function(t,i,n,r){return VF(r<2?t.coord&&t.coord[r]:t.value,e[r])}:function(t,i,n,r){return VF(t.value,e[r])}}function Int(t,e,i){if("average"===i){var n=0,r=0;return t.each(e,(function(t,e){isNaN(t)||(n+=t,r++)})),n/r}return"median"===i?t.getMedian(e):t.getDataExtent(e)["max"===i?1:0]}var Cnt=wP(),Pnt=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.init=function(){this.markerGroupMap=YE()},e.prototype.render=function(t,e,i){var n=this,r=this.markerGroupMap;r.each((function(t){Cnt(t).keep=!1})),e.eachSeries((function(t){var r=vnt.getMarkerModelFromSeries(t,n.type);r&&n.renderSeries(t,r,e,i)})),r.each((function(t){!Cnt(t).keep&&n.group.remove(t.group)}))},e.prototype.markKeep=function(t){Cnt(t).keep=!0},e.prototype.toggleBlurSeries=function(t,e){var i=this;yE(t,(function(t){var n=vnt.getMarkerModelFromSeries(t,i.type);n&&n.getData().eachItemGraphicEl((function(t){t&&(e?kR(t):NR(t))}))}))},e.type="marker",e}(qV),Lnt=Pnt;function Dnt(t,e,i){var n=e.coordinateSystem;t.each((function(r){var o,s=t.getItemModel(r),a=IC(s.get("x"),i.getWidth()),l=IC(s.get("y"),i.getHeight());if(isNaN(a)||isNaN(l)){if(e.getMarkerPosition)o=e.getMarkerPosition(t.getValues(t.dimensions,r));else if(n){var c=t.get(n.dimensions[0],r),u=t.get(n.dimensions[1],r);o=n.dataToPoint([c,u])}}else o=[a,l];isNaN(a)||(o[0]=a),isNaN(l)||(o[1]=l),t.setItemLayout(r,o)}))}var Rnt=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.updateTransform=function(t,e,i){e.eachSeries((function(t){var e=vnt.getMarkerModelFromSeries(t,"markPoint");e&&(Dnt(e.getData(),t,i),this.markerGroupMap.get(t.id).updateLayout())}),this)},e.prototype.renderSeries=function(t,e,i,n){var r=t.coordinateSystem,o=t.id,s=t.getData(),a=this.markerGroupMap,l=a.get(o)||a.set(o,new HZ),c=function(t,e,i){var n;n=t?vE(t&&t.dimensions,(function(t){return pE(pE({},e.getData().getDimensionInfo(e.getData().mapDimension(t))||{}),{name:t,ordinalMeta:null})})):[{name:"value",type:"float"}];var r=new PH(n,i),o=vE(i.get("data"),AE(Ent,e));t&&(o=xE(o,AE(Mnt,t)));var s=Tnt(!!t,n);return r.initData(o,null,s),r}(r,t,e);e.setData(c),Dnt(e.getData(),t,n),c.each((function(t){var i=c.getItemModel(t),n=i.getShallow("symbol"),r=i.getShallow("symbolSize"),o=i.getShallow("symbolRotate"),a=i.getShallow("symbolOffset"),l=i.getShallow("symbolKeepAspect");if(SE(n)||SE(r)||SE(o)||SE(a)){var u=e.getRawValue(t),h=e.getDataParams(t);SE(n)&&(n=n(u,h)),SE(r)&&(r=r(u,h)),SE(o)&&(o=o(u,h)),SE(a)&&(a=a(u,h))}var p=i.getModel("itemStyle").getItemStyle(),d=YU(s,"color");p.fill||(p.fill=d),c.setItemVisual(t,{symbol:n,symbolSize:r,symbolRotate:o,symbolOffset:a,symbolKeepAspect:l,style:p})})),l.updateData(c),this.group.add(l.group),c.eachItemGraphicEl((function(t){t.traverse((function(t){KD(t).dataModel=e}))})),this.markKeep(l),l.group.silent=e.get("silent")||t.get("silent")},e.type="markPoint",e}(Lnt);var Ont=Rnt;var knt=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.createMarkerModelFromSeries=function(t,i,n){return new e(t,i,n)},e.type="markLine",e.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},e}(vnt),Nnt=knt,Bnt=wP(),znt=function(t,e,i,n){var r,o=t.getData();if(EE(n))r=n;else{var s=n.type;if("min"===s||"max"===s||"average"===s||"median"===s||null!=n.xAxis||null!=n.yAxis){var a=void 0,l=void 0;if(null!=n.yAxis||null!=n.xAxis)a=e.getAxis(null!=n.yAxis?"y":"x"),l=NE(n.yAxis,n.xAxis);else{var c=Snt(n,o,e,t);a=c.valueAxis,l=Int(o,zH(o,c.valueDataDim),s)}var u="x"===a.dim?0:1,h=1-u,p=cE(n),d={coord:[]};p.type=null,p.coord=[],p.coord[h]=-1/0,d.coord[h]=1/0;var f=i.get("precision");f>=0&&IE(l)&&(l=+l.toFixed(Math.min(f,20))),p.coord[u]=d.coord[u]=l,r=[p,d,{type:s,valueIndex:n.valueIndex,value:l}]}else"production"!==process.env.NODE_ENV&&lE("Invalid markLine data."),r=[]}var m=[Ent(t,r[0]),Ent(t,r[1]),pE({},r[2])];return m[2].type=m[2].type||null,uE(m[2],m[0]),uE(m[2],m[1]),m};function Fnt(t){return!isNaN(t)&&!isFinite(t)}function Vnt(t,e,i,n){var r=1-t,o=n.dimensions[t];return Fnt(e[r])&&Fnt(i[r])&&e[t]===i[t]&&n.getAxis(o).containData(e[t])}function Unt(t,e){if("cartesian2d"===t.type){var i=e[0].coord,n=e[1].coord;if(i&&n&&(Vnt(1,i,n,t)||Vnt(0,i,n,t)))return!0}return Mnt(t,e[0])&&Mnt(t,e[1])}function Gnt(t,e,i,n,r){var o,s=n.coordinateSystem,a=t.getItemModel(e),l=IC(a.get("x"),r.getWidth()),c=IC(a.get("y"),r.getHeight());if(isNaN(l)||isNaN(c)){if(n.getMarkerPosition)o=n.getMarkerPosition(t.getValues(t.dimensions,e));else{var u=s.dimensions,h=t.get(u[0],e),p=t.get(u[1],e);o=s.dataToPoint([h,p])}if(rY(s,"cartesian2d")){var d=s.getAxis("x"),f=s.getAxis("y");u=s.dimensions;Fnt(t.get(u[0],e))?o[0]=d.toGlobalCoord(d.getExtent()[i?0:1]):Fnt(t.get(u[1],e))&&(o[1]=f.toGlobalCoord(f.getExtent()[i?0:1]))}isNaN(l)||(o[0]=l),isNaN(c)||(o[1]=c)}else o=[l,c];t.setItemLayout(e,o)}var jnt=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.updateTransform=function(t,e,i){e.eachSeries((function(t){var e=vnt.getMarkerModelFromSeries(t,"markLine");if(e){var n=e.getData(),r=Bnt(e).from,o=Bnt(e).to;r.each((function(e){Gnt(r,e,!0,t,i),Gnt(o,e,!1,t,i)})),n.each((function(t){n.setItemLayout(t,[r.getItemLayout(t),o.getItemLayout(t)])})),this.markerGroupMap.get(t.id).updateLayout()}}),this)},e.prototype.renderSeries=function(t,e,i,n){var r=t.coordinateSystem,o=t.id,s=t.getData(),a=this.markerGroupMap,l=a.get(o)||a.set(o,new n2);this.group.add(l.group);var c=function(t,e,i){var n;n=t?vE(t&&t.dimensions,(function(t){return pE(pE({},e.getData().getDimensionInfo(e.getData().mapDimension(t))||{}),{name:t,ordinalMeta:null})})):[{name:"value",type:"float"}];var r=new PH(n,i),o=new PH(n,i),s=new PH([],i),a=vE(i.get("data"),AE(znt,e,t,i));t&&(a=xE(a,AE(Unt,t)));var l=Tnt(!!t,n);return r.initData(vE(a,(function(t){return t[0]})),null,l),o.initData(vE(a,(function(t){return t[1]})),null,l),s.initData(vE(a,(function(t){return t[2]}))),s.hasItemOption=!0,{from:r,to:o,line:s}}(r,t,e),u=c.from,h=c.to,p=c.line;Bnt(e).from=u,Bnt(e).to=h,e.setData(p);var d=e.get("symbol"),f=e.get("symbolSize"),m=e.get("symbolRotate"),g=e.get("symbolOffset");function y(e,i,r){var o=e.getItemModel(i);Gnt(e,i,r,t,n);var a=o.getModel("itemStyle").getItemStyle();null==a.fill&&(a.fill=YU(s,"color")),e.setItemVisual(i,{symbolKeepAspect:o.get("symbolKeepAspect"),symbolOffset:BE(o.get("symbolOffset",!0),g[r?0:1]),symbolRotate:BE(o.get("symbolRotate",!0),m[r?0:1]),symbolSize:BE(o.get("symbolSize"),f[r?0:1]),symbol:BE(o.get("symbol",!0),d[r?0:1]),style:a})}EE(d)||(d=[d,d]),EE(f)||(f=[f,f]),EE(m)||(m=[m,m]),EE(g)||(g=[g,g]),c.from.each((function(t){y(u,t,!0),y(h,t,!1)})),p.each((function(t){var e=p.getItemModel(t).getModel("lineStyle").getLineStyle();p.setItemLayout(t,[u.getItemLayout(t),h.getItemLayout(t)]),null==e.stroke&&(e.stroke=u.getItemVisual(t,"style").fill),p.setItemVisual(t,{fromSymbolKeepAspect:u.getItemVisual(t,"symbolKeepAspect"),fromSymbolOffset:u.getItemVisual(t,"symbolOffset"),fromSymbolRotate:u.getItemVisual(t,"symbolRotate"),fromSymbolSize:u.getItemVisual(t,"symbolSize"),fromSymbol:u.getItemVisual(t,"symbol"),toSymbolKeepAspect:h.getItemVisual(t,"symbolKeepAspect"),toSymbolOffset:h.getItemVisual(t,"symbolOffset"),toSymbolRotate:h.getItemVisual(t,"symbolRotate"),toSymbolSize:h.getItemVisual(t,"symbolSize"),toSymbol:h.getItemVisual(t,"symbol"),style:e})})),l.updateData(p),c.line.eachItemGraphicEl((function(t){KD(t).dataModel=e,t.traverse((function(t){KD(t).dataModel=e}))})),this.markKeep(l),l.group.silent=e.get("silent")||t.get("silent")},e.type="markLine",e}(Lnt);var Hnt=jnt;var Wnt=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.createMarkerModelFromSeries=function(t,i,n){return new e(t,i,n)},e.type="markArea",e.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},e}(vnt),qnt=Wnt,Xnt=wP(),Znt=function(t,e,i,n){var r=n[0],o=n[1];if(r&&o){var s=Ent(t,r),a=Ent(t,o),l=s.coord,c=a.coord;l[0]=NE(l[0],-1/0),l[1]=NE(l[1],-1/0),c[0]=NE(c[0],1/0),c[1]=NE(c[1],1/0);var u=hE([{},s,a]);return u.coord=[s.coord,a.coord],u.x0=s.x,u.y0=s.y,u.x1=a.x,u.y1=a.y,u}};function Ynt(t){return!isNaN(t)&&!isFinite(t)}function Qnt(t,e,i,n){var r=1-t;return Ynt(e[r])&&Ynt(i[r])}function Jnt(t,e){var i=e.coord[0],n=e.coord[1],r={coord:i,x:e.x0,y:e.y0},o={coord:n,x:e.x1,y:e.y1};return rY(t,"cartesian2d")?!(!i||!n||!Qnt(1,i,n)&&!Qnt(0,i,n))||function(t,e,i){return!(t&&t.containZone&&e.coord&&i.coord&&!bnt(e)&&!bnt(i))||t.containZone(e.coord,i.coord)}(t,r,o):Mnt(t,r)||Mnt(t,o)}function Knt(t,e,i,n,r){var o,s=n.coordinateSystem,a=t.getItemModel(e),l=IC(a.get(i[0]),r.getWidth()),c=IC(a.get(i[1]),r.getHeight());if(isNaN(l)||isNaN(c)){if(n.getMarkerPosition){var u=t.getValues(["x0","y0"],e),h=t.getValues(["x1","y1"],e),p=s.clampData(u),d=s.clampData(h),f=[];"x0"===i[0]?f[0]=p[0]>d[0]?h[0]:u[0]:f[0]=p[0]>d[0]?u[0]:h[0],"y0"===i[1]?f[1]=p[1]>d[1]?h[1]:u[1]:f[1]=p[1]>d[1]?u[1]:h[1],o=n.getMarkerPosition(f,i,!0)}else{var m=[v=t.get(i[0],e),_=t.get(i[1],e)];s.clampData&&s.clampData(m,m),o=s.dataToPoint(m,!0)}if(rY(s,"cartesian2d")){var g=s.getAxis("x"),y=s.getAxis("y"),v=t.get(i[0],e),_=t.get(i[1],e);Ynt(v)?o[0]=g.toGlobalCoord(g.getExtent()["x0"===i[0]?0:1]):Ynt(_)&&(o[1]=y.toGlobalCoord(y.getExtent()["y0"===i[1]?0:1]))}isNaN(l)||(o[0]=l),isNaN(c)||(o[1]=c)}else o=[l,c];return o}var $nt=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],trt=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.updateTransform=function(t,e,i){e.eachSeries((function(t){var e=vnt.getMarkerModelFromSeries(t,"markArea");if(e){var n=e.getData();n.each((function(e){var r=vE($nt,(function(r){return Knt(n,e,r,t,i)}));n.setItemLayout(e,r),n.getItemGraphicEl(e).setShape("points",r)}))}}),this)},e.prototype.renderSeries=function(t,e,i,n){var r=t.coordinateSystem,o=t.id,s=t.getData(),a=this.markerGroupMap,l=a.get(o)||a.set(o,{group:new xC});this.group.add(l.group),this.markKeep(l);var c=function(t,e,i){var n,r,o=["x0","y0","x1","y1"];if(t){var s=vE(t&&t.dimensions,(function(t){var i=e.getData();return pE(pE({},i.getDimensionInfo(i.mapDimension(t))||{}),{name:t,ordinalMeta:null})}));r=vE(o,(function(t,e){return{name:t,type:s[e%2].type}})),n=new PH(r,i)}else n=new PH(r=[{name:"value",type:"float"}],i);var a=vE(i.get("data"),AE(Znt,e,t,i));t&&(a=xE(a,AE(Jnt,t)));var l=t?function(t,e,i,n){return VF(t.coord[Math.floor(n/2)][n%2],r[n])}:function(t,e,i,n){return VF(t.value,r[n])};return n.initData(a,null,l),n.hasItemOption=!0,n}(r,t,e);e.setData(c),c.each((function(e){var i=vE($nt,(function(i){return Knt(c,e,i,t,n)})),o=r.getAxis("x").scale,a=r.getAxis("y").scale,l=o.getExtent(),u=a.getExtent(),h=[o.parse(c.get("x0",e)),o.parse(c.get("x1",e))],p=[a.parse(c.get("y0",e)),a.parse(c.get("y1",e))];PC(h),PC(p);var d=!!(l[0]>h[1]||l[1]<h[0]||u[0]>p[1]||u[1]<p[0]);c.setItemLayout(e,{points:i,allClipped:d});var f=c.getItemModel(e).getModel("itemStyle").getItemStyle(),m=YU(s,"color");f.fill||(f.fill=m,ME(f.fill)&&(f.fill=NT(f.fill,.4))),f.stroke||(f.stroke=m),c.setItemVisual(e,"style",f)})),c.diff(Xnt(l).data).add((function(t){var e=c.getItemLayout(t);if(!e.allClipped){var i=new QO({shape:{points:e.points}});c.setItemGraphicEl(t,i),l.group.add(i)}})).update((function(t,i){var n=Xnt(l).data.getItemGraphicEl(i),r=c.getItemLayout(t);r.allClipped?n&&l.group.remove(n):(n?Pk(n,{shape:{points:r.points}},e,t):n=new QO({shape:{points:r.points}}),c.setItemGraphicEl(t,n),l.group.add(n))})).remove((function(t){var e=Xnt(l).data.getItemGraphicEl(t);l.group.remove(e)})).execute(),c.eachItemGraphicEl((function(t,i){var n=c.getItemModel(i),r=c.getItemVisual(i,"style");t.useStyle(c.getItemVisual(i,"style")),dN(t,fN(n),{labelFetcher:e,labelDataIndex:i,defaultText:c.getName(i)||"",inheritColor:ME(r.fill)?NT(r.fill,1):"#000"}),JR(t,n),XR(t,null,null,n.get(["emphasis","disabled"])),KD(t).dataModel=e})),Xnt(l).data=c,l.group.silent=e.get("silent")||t.get("silent")},e.type="markArea",e}(Lnt);var ert=trt;var irt=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.layoutMode={type:"box",ignoreSize:!0},i}return zA(e,t),e.prototype.init=function(t,e,i){this.mergeDefaultAndTheme(t,i),t.selected=t.selected||{},this._updateSelector(t)},e.prototype.mergeOption=function(e,i){t.prototype.mergeOption.call(this,e,i),this._updateSelector(e)},e.prototype._updateSelector=function(t){var e=t.selector,i=this.ecModel;!0===e&&(e=t.selector=["all","inverse"]),EE(e)&&yE(e,(function(t,n){ME(t)&&(t={type:t}),e[n]=uE(t,function(t,e){return"all"===e?{type:"all",title:t.getLocaleModel().get(["legend","selector","all"])}:"inverse"===e?{type:"inverse",title:t.getLocaleModel().get(["legend","selector","inverse"])}:void 0}(i,t.type))}))},e.prototype.optionUpdated=function(){this._updateData(this.ecModel);var t=this._data;if(t[0]&&"single"===this.get("selectedMode")){for(var e=!1,i=0;i<t.length;i++){var n=t[i].get("name");if(this.isSelected(n)){this.select(n),e=!0;break}}!e&&this.select(t[0].get("name"))}},e.prototype._updateData=function(t){var e=[],i=[];t.eachRawSeries((function(n){var r,o=n.name;if(i.push(o),n.legendVisualProvider){var s=n.legendVisualProvider.getAllNames();t.isSeriesFiltered(n)||(i=i.concat(s)),s.length?e=e.concat(s):r=!0}else r=!0;r&&_P(n)&&e.push(n.name)})),this._availableNames=i;var n=this.get("data")||e,r=YE(),o=vE(n,(function(t){return(ME(t)||IE(t))&&(t={name:t}),r.get(t.name)?null:(r.set(t.name,!0),new FN(t,this,this.ecModel))}),this);this._data=xE(o,(function(t){return!!t}))},e.prototype.getData=function(){return this._data},e.prototype.select=function(t){var e=this.option.selected;"single"===this.get("selectedMode")&&yE(this._data,(function(t){e[t.get("name")]=!1}));e[t]=!0},e.prototype.unSelect=function(t){"single"!==this.get("selectedMode")&&(this.option.selected[t]=!1)},e.prototype.toggleSelected=function(t){var e=this.option.selected;e.hasOwnProperty(t)||(e[t]=!0),this[e[t]?"unSelect":"select"](t)},e.prototype.allSelect=function(){var t=this._data,e=this.option.selected;yE(t,(function(t){e[t.get("name",!0)]=!0}))},e.prototype.inverseSelect=function(){var t=this._data,e=this.option.selected;yE(t,(function(t){var i=t.get("name",!0);e.hasOwnProperty(i)||(e[i]=!0),e[i]=!e[i]}))},e.prototype.isSelected=function(t){var e=this.option.selected;return!(e.hasOwnProperty(t)&&!e[t])&&fE(this._availableNames,t)>=0},e.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},e}(YB),nrt=irt,rrt=AE,ort=yE,srt=xC,art=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.newlineDisabled=!1,i}return zA(e,t),e.prototype.init=function(){this.group.add(this._contentGroup=new srt),this.group.add(this._selectorGroup=new srt),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(t,e,i){var n=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),t.get("show",!0)){var r=t.get("align"),o=t.get("orient");r&&"auto"!==r||(r="right"===t.get("left")&&"vertical"===o?"right":"left");var s=t.get("selector",!0),a=t.get("selectorPosition",!0);!s||a&&"auto"!==a||(a="horizontal"===o?"end":"start"),this.renderInner(r,t,e,i,s,o,a);var l=t.getBoxLayoutParams(),c={width:i.getWidth(),height:i.getHeight()},u=t.get("padding"),h=UB(l,c,u),p=this.layoutInner(t,r,h,n,s,a),d=UB(dE({width:p.width,height:p.height},l),c,u);this.group.x=d.x-p.x,this.group.y=d.y-p.y,this.group.markRedraw(),this.group.add(this._backgroundEl=aet(p,t))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(t,e,i,n,r,o,s){var a=this.getContentGroup(),l=YE(),c=e.get("selectedMode"),u=[];i.eachRawSeries((function(t){!t.get("legendHoverLink")&&u.push(t.id)})),ort(e.getData(),(function(r,o){var s=r.get("name");if(!this.newlineDisabled&&(""===s||"\n"===s)){var h=new srt;return h.newline=!0,void a.add(h)}var p=i.getSeriesByName(s)[0];if(!l.get(s)){if(p){var d=p.getData(),f=d.getVisual("legendLineStyle")||{},m=d.getVisual("legendIcon"),g=d.getVisual("style");this._createItem(p,s,o,r,e,t,f,g,m,c,n).on("click",rrt(lrt,s,null,n,u)).on("mouseover",rrt(urt,p.name,null,n,u)).on("mouseout",rrt(hrt,p.name,null,n,u)),l.set(s,!0)}else i.eachRawSeries((function(i){if(!l.get(s)&&i.legendVisualProvider){var a=i.legendVisualProvider;if(!a.containName(s))return;var h=a.indexOfName(s),p=a.getItemVisual(h,"style"),d=a.getItemVisual(h,"legendIcon"),f=LT(p.fill);f&&0===f[3]&&(f[3]=.2,p=pE(pE({},p),{fill:BT(f,"rgba")})),this._createItem(i,s,o,r,e,t,{},p,d,c,n).on("click",rrt(lrt,null,s,n,u)).on("mouseover",rrt(urt,null,s,n,u)).on("mouseout",rrt(hrt,null,s,n,u)),l.set(s,!0)}}),this);"production"!==process.env.NODE_ENV&&(l.get(s)||console.warn(s+" series not exists. Legend data should be same with series name or data name."))}}),this),r&&this._createSelector(r,e,n,o,s)},e.prototype._createSelector=function(t,e,i,n,r){var o=this.getSelectorGroup();ort(t,(function(t){var n=t.type,r=new JD({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:"all"===n?"legendAllSelect":"legendInverseSelect"})}});o.add(r),dN(r,{normal:e.getModel("selectorLabel"),emphasis:e.getModel(["emphasis","selectorLabel"])},{defaultText:t.title}),qR(r)}))},e.prototype._createItem=function(t,e,i,n,r,o,s,a,l,c,u){var h=t.visualDrawType,p=r.get("itemWidth"),d=r.get("itemHeight"),f=r.isSelected(e),m=n.get("symbolRotate"),g=n.get("symbolKeepAspect"),y=n.get("icon"),v=function(t,e,i,n,r,o,s){function a(t,e){"auto"===t.lineWidth&&(t.lineWidth=e.lineWidth>0?2:0),ort(t,(function(i,n){"inherit"===t[n]&&(t[n]=e[n])}))}var l=e.getModel("itemStyle"),c=l.getItemStyle(),u=0===t.lastIndexOf("empty",0)?"fill":"stroke",h=l.getShallow("decal");c.decal=h&&"inherit"!==h?jG(h,s):n.decal,"inherit"===c.fill&&(c.fill=n[r]);"inherit"===c.stroke&&(c.stroke=n[u]);"inherit"===c.opacity&&(c.opacity=("fill"===r?n:i).opacity);a(c,n);var p=e.getModel("lineStyle"),d=p.getLineStyle();if(a(d,i),"auto"===c.fill&&(c.fill=n.fill),"auto"===c.stroke&&(c.stroke=n.fill),"auto"===d.stroke&&(d.stroke=n.fill),!o){var f=e.get("inactiveBorderWidth"),m=c[u];c.lineWidth="auto"===f?n.lineWidth>0&&m?2:0:c.lineWidth,c.fill=e.get("inactiveColor"),c.stroke=e.get("inactiveBorderColor"),d.stroke=p.get("inactiveColor"),d.lineWidth=p.get("inactiveWidth")}return{itemStyle:c,lineStyle:d}}(l=y||l||"roundRect",n,s,a,h,f,u),_=new srt,x=n.getModel("textStyle");if(!SE(t.getLegendIcon)||y&&"inherit"!==y){var b="inherit"===y&&t.getData().getVisual("symbol")?"inherit"===m?t.getData().getVisual("symbolRotate"):m:0;_.add(function(t){var e=t.icon||"roundRect",i=pG(e,0,0,t.itemWidth,t.itemHeight,t.itemStyle.fill,t.symbolKeepAspect);i.setStyle(t.itemStyle),i.rotation=(t.iconRotate||0)*Math.PI/180,i.setOrigin([t.itemWidth/2,t.itemHeight/2]),e.indexOf("empty")>-1&&(i.style.stroke=i.style.fill,i.style.fill="#fff",i.style.lineWidth=2);return i}({itemWidth:p,itemHeight:d,icon:l,iconRotate:b,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}))}else _.add(t.getLegendIcon({itemWidth:p,itemHeight:d,icon:l,iconRotate:m,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}));var w="left"===o?p+5:-5,A=o,E=r.get("formatter"),S=e;ME(E)&&E?S=E.replace("{name}",null!=e?e:""):SE(E)&&(S=E(e));var M=f?x.getTextColor():n.get("inactiveColor");_.add(new JD({style:mN(x,{text:S,x:w,y:d/2,fill:M,align:A,verticalAlign:"middle"},{inheritColor:M})}));var T=new kD({shape:_.getBoundingRect(),invisible:!0}),I=n.getModel("tooltip");return I.get("show")&&sN({el:T,componentModel:r,itemName:e,itemTooltipOption:I.option}),_.add(T),_.eachChild((function(t){t.silent=!0})),T.silent=!c,this.getContentGroup().add(_),qR(_),_.__legendDataIndex=i,_},e.prototype.layoutInner=function(t,e,i,n,r,o){var s=this.getContentGroup(),a=this.getSelectorGroup();VB(t.get("orient"),s,t.get("itemGap"),i.width,i.height);var l=s.getBoundingRect(),c=[-l.x,-l.y];if(a.markRedraw(),s.markRedraw(),r){VB("horizontal",a,t.get("selectorItemGap",!0));var u=a.getBoundingRect(),h=[-u.x,-u.y],p=t.get("selectorButtonGap",!0),d=t.getOrient().index,f=0===d?"width":"height",m=0===d?"height":"width",g=0===d?"y":"x";"end"===o?h[d]+=l[f]+p:c[d]+=u[f]+p,h[1-d]+=l[m]/2-u[m]/2,a.x=h[0],a.y=h[1],s.x=c[0],s.y=c[1];var y={x:0,y:0};return y[f]=l[f]+p+u[f],y[m]=Math.max(l[m],u[m]),y[g]=Math.min(0,u[g]+h[1-d]),y}return s.x=c[0],s.y=c[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(qV);function lrt(t,e,i,n){hrt(t,e,i,n),i.dispatchAction({type:"legendToggleSelect",name:null!=t?t:e}),urt(t,e,i,n)}function crt(t){for(var e,i=t.getZr().storage.getDisplayList(),n=0,r=i.length;n<r&&!(e=i[n].states.emphasis);)n++;return e&&e.hoverLayer}function urt(t,e,i,n){crt(i)||i.dispatchAction({type:"highlight",seriesName:t,name:e,excludeSeriesId:n})}function hrt(t,e,i,n){crt(i)||i.dispatchAction({type:"downplay",seriesName:t,name:e,excludeSeriesId:n})}var prt=art;function drt(t){var e=t.findComponents({mainType:"legend"});e&&e.length&&t.filterSeries((function(t){for(var i=0;i<e.length;i++)if(!e[i].isSelected(t.name))return!1;return!0}))}function frt(t,e,i){var n,r={},o="toggleSelected"===t;return i.eachComponent("legend",(function(i){o&&null!=n?i[n?"select":"unSelect"](e.name):"allSelect"===t||"inverseSelect"===t?i[t]():(i[t](e.name),n=i.isSelected(e.name)),yE(i.getData(),(function(t){var e=t.get("name");if("\n"!==e&&""!==e){var n=i.isSelected(e);r.hasOwnProperty(e)?r[e]=r[e]&&n:r[e]=n}}))})),"allSelect"===t||"inverseSelect"===t?{selected:r}:{name:e.name,selected:r}}function mrt(t){t.registerComponentModel(nrt),t.registerComponentView(prt),t.registerProcessor(t.PRIORITY.PROCESSOR.SERIES_FILTER,drt),t.registerSubTypeDefaulter("legend",(function(){return"plain"})),function(t){t.registerAction("legendToggleSelect","legendselectchanged",AE(frt,"toggleSelected")),t.registerAction("legendAllSelect","legendselectall",AE(frt,"allSelect")),t.registerAction("legendInverseSelect","legendinverseselect",AE(frt,"inverseSelect")),t.registerAction("legendSelect","legendselected",AE(frt,"select")),t.registerAction("legendUnSelect","legendunselected",AE(frt,"unSelect"))}(t)}var grt=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.setScrollDataIndex=function(t){this.option.scrollDataIndex=t},e.prototype.init=function(e,i,n){var r=WB(e);t.prototype.init.call(this,e,i,n),yrt(this,e,r)},e.prototype.mergeOption=function(e,i){t.prototype.mergeOption.call(this,e,i),yrt(this,this.option,e)},e.type="legend.scroll",e.defaultOption=GN(nrt.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800}),e}(nrt);function yrt(t,e,i){var n=[1,1];n[t.getOrient().index]=0,HB(e,i,{type:"box",ignoreSize:!!n})}var vrt=grt,_rt=xC,xrt=["width","height"],brt=["x","y"],wrt=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.newlineDisabled=!0,i._currentIndex=0,i}return zA(e,t),e.prototype.init=function(){t.prototype.init.call(this),this.group.add(this._containerGroup=new _rt),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new _rt)},e.prototype.resetInner=function(){t.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},e.prototype.renderInner=function(e,i,n,r,o,s,a){var l=this;t.prototype.renderInner.call(this,e,i,n,r,o,s,a);var c=this._controllerGroup,u=i.get("pageIconSize",!0),h=EE(u)?u:[u,u];d("pagePrev",0);var p=i.getModel("pageTextStyle");function d(t,e){var n=t+"DataIndex",o=iN(i.get("pageIcons",!0)[i.getOrient().name][e],{onclick:wE(l._pageGo,l,n,i,r)},{x:-h[0]/2,y:-h[1]/2,width:h[0],height:h[1]});o.name=t,c.add(o)}c.add(new JD({name:"pageText",style:{text:"xx/xx",fill:p.getTextColor(),font:p.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),d("pageNext",1)},e.prototype.layoutInner=function(t,e,i,n,r,o){var s=this.getSelectorGroup(),a=t.getOrient().index,l=xrt[a],c=brt[a],u=xrt[1-a],h=brt[1-a];r&&VB("horizontal",s,t.get("selectorItemGap",!0));var p=t.get("selectorButtonGap",!0),d=s.getBoundingRect(),f=[-d.x,-d.y],m=cE(i);r&&(m[l]=i[l]-d[l]-p);var g=this._layoutContentAndController(t,n,m,a,l,u,h,c);if(r){if("end"===o)f[a]+=g[l]+p;else{var y=d[l]+p;f[a]-=y,g[c]-=y}g[l]+=d[l]+p,f[1-a]+=g[h]+g[u]/2-d[u]/2,g[u]=Math.max(g[u],d[u]),g[h]=Math.min(g[h],d[h]+f[1-a]),s.x=f[0],s.y=f[1],s.markRedraw()}return g},e.prototype._layoutContentAndController=function(t,e,i,n,r,o,s,a){var l=this.getContentGroup(),c=this._containerGroup,u=this._controllerGroup;VB(t.get("orient"),l,t.get("itemGap"),n?i.width:null,n?null:i.height),VB("horizontal",u,t.get("pageButtonItemGap",!0));var h=l.getBoundingRect(),p=u.getBoundingRect(),d=this._showController=h[r]>i[r],f=[-h.x,-h.y];e||(f[n]=l[a]);var m=[0,0],g=[-p.x,-p.y],y=BE(t.get("pageButtonGap",!0),t.get("itemGap",!0));d&&("end"===t.get("pageButtonPosition",!0)?g[n]+=i[r]-p[r]:m[n]+=p[r]+y);g[1-n]+=h[o]/2-p[o]/2,l.setPosition(f),c.setPosition(m),u.setPosition(g);var v={x:0,y:0};if(v[r]=d?i[r]:h[r],v[o]=Math.max(h[o],p[o]),v[s]=Math.min(0,p[s]+g[1-n]),c.__rectSize=i[r],d){var _={x:0,y:0};_[r]=Math.max(i[r]-p[r]-y,0),_[o]=v[o],c.setClipPath(new kD({shape:_})),c.__rectSize=_[r]}else u.eachChild((function(t){t.attr({invisible:!0,silent:!0})}));var x=this._getPageInfo(t);return null!=x.pageIndex&&Pk(l,{x:x.contentPosition[0],y:x.contentPosition[1]},d?t:null),this._updatePageInfoView(t,x),v},e.prototype._pageGo=function(t,e,i){var n=this._getPageInfo(e)[t];null!=n&&i.dispatchAction({type:"legendScroll",scrollDataIndex:n,legendId:e.id})},e.prototype._updatePageInfoView=function(t,e){var i=this._controllerGroup;yE(["pagePrev","pageNext"],(function(n){var r=null!=e[n+"DataIndex"],o=i.childOfName(n);o&&(o.setStyle("fill",r?t.get("pageIconColor",!0):t.get("pageIconInactiveColor",!0)),o.cursor=r?"pointer":"default")}));var n=i.childOfName("pageText"),r=t.get("pageFormatter"),o=e.pageIndex,s=null!=o?o+1:0,a=e.pageCount;n&&r&&n.setStyle("text",ME(r)?r.replace("{current}",null==s?"":s+"").replace("{total}",null==a?"":a+""):r({current:s,total:a}))},e.prototype._getPageInfo=function(t){var e=t.get("scrollDataIndex",!0),i=this.getContentGroup(),n=this._containerGroup.__rectSize,r=t.getOrient().index,o=xrt[r],s=brt[r],a=this._findTargetItemIndex(e),l=i.children(),c=l[a],u=l.length,h=u?1:0,p={contentPosition:[i.x,i.y],pageCount:h,pageIndex:h-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!c)return p;var d=v(c);p.contentPosition[r]=-d.s;for(var f=a+1,m=d,g=d,y=null;f<=u;++f)(!(y=v(l[f]))&&g.e>m.s+n||y&&!_(y,m.s))&&(m=g.i>m.i?g:y)&&(null==p.pageNextDataIndex&&(p.pageNextDataIndex=m.i),++p.pageCount),g=y;for(f=a-1,m=d,g=d,y=null;f>=-1;--f)(y=v(l[f]))&&_(g,y.s)||!(m.i<g.i)||(g=m,null==p.pagePrevDataIndex&&(p.pagePrevDataIndex=m.i),++p.pageCount,++p.pageIndex),m=y;return p;function v(t){if(t){var e=t.getBoundingRect(),i=e[s]+t[s];return{s:i,e:i+e[o],i:t.__legendDataIndex}}}function _(t,e){return t.e>=e&&t.s<=e+n}},e.prototype._findTargetItemIndex=function(t){return this._showController?(this.getContentGroup().eachChild((function(n,r){var o=n.__legendDataIndex;null==i&&null!=o&&(i=r),o===t&&(e=r)})),null!=e?e:i):0;var e,i},e.type="legend.scroll",e}(prt),Art=wrt;function Ert(t){eH(mrt),t.registerComponentModel(vrt),t.registerComponentView(Art),function(t){t.registerAction("legendScroll","legendscroll",(function(t,e){var i=t.scrollDataIndex;null!=i&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},(function(t){t.setScrollDataIndex(i)}))}))}(t)}var Srt=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.type="dataZoom.inside",e.defaultOption=GN(Vtt.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(Vtt),Mrt=Srt,Trt=wP();function Irt(t,e){if(e){t.removeKey(e.model.uid);var i=e.controller;i&&i.dispose()}}function Crt(t,e){t.isDisposed()||t.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:e})}function Prt(t,e,i,n){return t.coordinateSystem.containPoint([i,n])}function Lrt(t){t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,(function(t,e){var i=Trt(e),n=i.coordSysRecordMap||(i.coordSysRecordMap=YE());n.each((function(t){t.dataZoomInfoMap=null})),t.eachComponent({mainType:"dataZoom",subType:"inside"},(function(t){yE(Ntt(t).infoList,(function(i){var r=i.model.uid,o=n.get(r)||n.set(r,function(t,e){var i={model:e,containsPoint:AE(Prt,e),dispatchAction:AE(Crt,t),dataZoomInfoMap:null,controller:null},n=i.controller=new JJ(t.getZr());return yE(["pan","zoom","scrollMove"],(function(t){n.on(t,(function(e){var n=[];i.dataZoomInfoMap.each((function(r){if(e.isAvailableBehavior(r.model.option)){var o=(r.getRange||{})[t],s=o&&o(r.dzReferCoordSysInfo,i.model.mainType,i.controller,e);!r.model.get("disabled",!0)&&s&&n.push({dataZoomId:r.model.id,start:s[0],end:s[1]})}})),n.length&&i.dispatchAction(n)}))})),i}(e,i.model));(o.dataZoomInfoMap||(o.dataZoomInfoMap=YE())).set(t.uid,{dzReferCoordSysInfo:i,model:t,getRange:null})}))})),n.each((function(t){var e,i=t.controller,r=t.dataZoomInfoMap;if(r){var o=r.keys()[0];null!=o&&(e=r.get(o))}if(e){var s=function(t){var e,i="type_",n={type_true:2,type_move:1,type_false:0,type_undefined:-1},r=!0;return t.each((function(t){var o=t.model,s=!o.get("disabled",!0)&&(!o.get("zoomLock",!0)||"move");n[i+s]>n[i+e]&&(e=s),r=r&&o.get("preventDefaultMouseMove",!0)})),{controlType:e,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!r}}}(r);i.enable(s.controlType,s.opt),i.setPointerChecker(t.containsPoint),aU(t,"dispatchAction",e.model.get("throttle",!0),"fixRate")}else Irt(n,t)}))}))}var Drt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dataZoom.inside",e}return zA(e,t),e.prototype.render=function(e,i,n){t.prototype.render.apply(this,arguments),e.noTarget()?this._clear():(this.range=e.getPercentRange(),function(t,e,i){Trt(t).coordSysRecordMap.each((function(t){var n=t.dataZoomInfoMap.get(e.uid);n&&(n.getRange=i)}))}(n,e,{pan:wE(Rrt.pan,this),zoom:wE(Rrt.zoom,this),scrollMove:wE(Rrt.scrollMove,this)}))},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){!function(t,e){for(var i=Trt(t).coordSysRecordMap,n=i.keys(),r=0;r<n.length;r++){var o=n[r],s=i.get(o),a=s.dataZoomInfoMap;if(a){var l=e.uid;a.get(l)&&(a.removeKey(l),a.keys().length||Irt(i,s))}}}(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e}(Htt),Rrt={zoom:function(t,e,i,n){var r=this.range,o=r.slice(),s=t.axisModels[0];if(s){var a=krt[e](null,[n.originX,n.originY],s,i,t),l=(a.signal>0?a.pixelStart+a.pixelLength-a.pixel:a.pixel-a.pixelStart)/a.pixelLength*(o[1]-o[0])+o[0],c=Math.max(1/n.scale,0);o[0]=(o[0]-l)*c+l,o[1]=(o[1]-l)*c+l;var u=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return s3(0,o,[0,100],0,u.minSpan,u.maxSpan),this.range=o,r[0]!==o[0]||r[1]!==o[1]?o:void 0}},pan:Ort((function(t,e,i,n,r,o){var s=krt[n]([o.oldX,o.oldY],[o.newX,o.newY],e,r,i);return s.signal*(t[1]-t[0])*s.pixel/s.pixelLength})),scrollMove:Ort((function(t,e,i,n,r,o){return krt[n]([0,0],[o.scrollDelta,o.scrollDelta],e,r,i).signal*(t[1]-t[0])*o.scrollDelta}))};function Ort(t){return function(e,i,n,r){var o=this.range,s=o.slice(),a=e.axisModels[0];if(a)return s3(t(s,a,e,i,n,r),s,[0,100],"all"),this.range=s,o[0]!==s[0]||o[1]!==s[1]?s:void 0}}var krt={grid:function(t,e,i,n,r){var o=i.axis,s={},a=r.model.coordinateSystem.getRect();return t=t||[0,0],"x"===o.dim?(s.pixel=e[0]-t[0],s.pixelLength=a.width,s.pixelStart=a.x,s.signal=o.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=a.height,s.pixelStart=a.y,s.signal=o.inverse?-1:1),s},polar:function(t,e,i,n,r){var o=i.axis,s={},a=r.model.coordinateSystem,l=a.getRadiusAxis().getExtent(),c=a.getAngleAxis().getExtent();return t=t?a.pointToCoord(t):[0,0],e=a.pointToCoord(e),"radiusAxis"===i.mainType?(s.pixel=e[0]-t[0],s.pixelLength=l[1]-l[0],s.pixelStart=l[0],s.signal=o.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=c[1]-c[0],s.pixelStart=c[0],s.signal=o.inverse?-1:1),s},singleAxis:function(t,e,i,n,r){var o=i.axis,s=r.model.coordinateSystem.getRect(),a={};return t=t||[0,0],"horizontal"===o.orient?(a.pixel=e[0]-t[0],a.pixelLength=s.width,a.pixelStart=s.x,a.signal=o.inverse?1:-1):(a.pixel=e[1]-t[1],a.pixelLength=s.height,a.pixelStart=s.y,a.signal=o.inverse?-1:1),a}},Nrt=Drt;function Brt(t){$tt(t),t.registerComponentModel(Mrt),t.registerComponentView(Nrt),Lrt(t)}var zrt=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.type="dataZoom.slider",e.layoutMode="box",e.defaultOption=GN(Vtt.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),e}(Vtt),Frt=zrt,Vrt=kD,Urt="horizontal",Grt="vertical",jrt=["line","bar","candlestick","scatter"],Hrt={easing:"cubicOut",duration:100,delay:0},Wrt=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i._displayables={},i}return zA(e,t),e.prototype.init=function(t,e){this.api=e,this._onBrush=wE(this._onBrush,this),this._onBrushEnd=wE(this._onBrushEnd,this)},e.prototype.render=function(e,i,n,r){if(t.prototype.render.apply(this,arguments),aU(this,"_dispatchZoomAction",e.get("throttle"),"fixRate"),this._orient=e.getOrient(),!1!==e.get("show")){if(e.noTarget())return this._clear(),void this.group.removeAll();r&&"dataZoom"===r.type&&r.from===this.uid||this._buildView(),this._updateView()}else this.group.removeAll()},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){lU(this,"_dispatchZoomAction");var t=this.api.getZr();t.off("mousemove",this._onBrush),t.off("mouseup",this._onBrushEnd)},e.prototype._buildView=function(){var t=this.group;t.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var e=this._displayables.sliderGroup=new xC;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(e),this._positionGroup()},e.prototype._resetLocation=function(){var t=this.dataZoomModel,e=this.api,i=t.get("brushSelect")?7:0,n=this._findCoordRect(),r={width:e.getWidth(),height:e.getHeight()},o=this._orient===Urt?{right:r.width-n.x-n.width,top:r.height-30-7-i,width:n.width,height:30}:{right:7,top:n.y,width:30,height:n.height},s=WB(t.option);yE(["right","top","width","height"],(function(t){"ph"===s[t]&&(s[t]=o[t])}));var a=UB(s,r);this._location={x:a.x,y:a.y},this._size=[a.width,a.height],this._orient===Grt&&this._size.reverse()},e.prototype._positionGroup=function(){var t=this.group,e=this._location,i=this._orient,n=this.dataZoomModel.getFirstTargetAxisModel(),r=n&&n.get("inverse"),o=this._displayables.sliderGroup,s=(this._dataShadowInfo||{}).otherAxisInverse;o.attr(i!==Urt||r?i===Urt&&r?{scaleY:s?1:-1,scaleX:-1}:i!==Grt||r?{scaleY:s?-1:1,scaleX:-1,rotation:Math.PI/2}:{scaleY:s?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:s?1:-1,scaleX:1});var a=t.getBoundingRect([o]);t.x=e.x-a.x,t.y=e.y-a.y,t.markRedraw()},e.prototype._getViewExtent=function(){return[0,this._size[0]]},e.prototype._renderBackground=function(){var t=this.dataZoomModel,e=this._size,i=this._displayables.sliderGroup,n=t.get("brushSelect");i.add(new Vrt({silent:!0,shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:t.get("backgroundColor")},z2:-40}));var r=new Vrt({shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:"transparent"},z2:0,onclick:wE(this._onClickPanel,this)}),o=this.api.getZr();n?(r.on("mousedown",this._onBrushStart,this),r.cursor="crosshair",o.on("mousemove",this._onBrush),o.on("mouseup",this._onBrushEnd)):(o.off("mousemove",this._onBrush),o.off("mouseup",this._onBrushEnd)),i.add(r)},e.prototype._renderDataShadow=function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],t){var e=this._size,i=this._shadowSize||[],n=t.series,r=n.getRawData(),o=n.getShadowDim&&n.getShadowDim(),s=o&&r.getDimensionInfo(o)?n.getShadowDim():t.otherDim;if(null!=s){var a=this._shadowPolygonPts,l=this._shadowPolylinePts;if(r!==this._shadowData||s!==this._shadowDim||e[0]!==i[0]||e[1]!==i[1]){var c=r.getDataExtent(s),u=.3*(c[1]-c[0]);c=[c[0]-u,c[1]+u];var h,p=[0,e[1]],d=[0,e[0]],f=[[e[0],0],[0,0]],m=[],g=d[1]/(r.count()-1),y=0,v=Math.round(r.count()/e[0]);r.each([s],(function(t,e){if(v>0&&e%v)y+=g;else{var i=null==t||isNaN(t)||""===t,n=i?0:TC(t,c,p,!0);i&&!h&&e?(f.push([f[f.length-1][0],0]),m.push([m[m.length-1][0],0])):!i&&h&&(f.push([y,0]),m.push([y,0])),f.push([y,n]),m.push([y,n]),y+=g,h=i}})),a=this._shadowPolygonPts=f,l=this._shadowPolylinePts=m}this._shadowData=r,this._shadowDim=s,this._shadowSize=[e[0],e[1]];for(var _=this.dataZoomModel,x=0;x<3;x++){var b=w(1===x);this._displayables.sliderGroup.add(b),this._displayables.dataShadowSegs.push(b)}}}function w(t){var e=_.getModel(t?"selectedDataBackground":"dataBackground"),i=new xC,n=new QO({shape:{points:a},segmentIgnoreThreshold:1,style:e.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),r=new $O({shape:{points:l},segmentIgnoreThreshold:1,style:e.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return i.add(n),i.add(r),i}},e.prototype._prepareDataShadowInfo=function(){var t=this.dataZoomModel,e=t.get("showDataShadow");if(!1!==e){var i,n=this.ecModel;return t.eachTargetAxis((function(r,o){yE(t.getAxisProxy(r,o).getTargetSeriesModels(),(function(t){if(!(i||!0!==e&&fE(jrt,t.get("type"))<0)){var s,a=n.getComponent(Ott(r),o).axis,l=function(t){var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[t]}(r),c=t.coordinateSystem;null!=l&&c.getOtherAxis&&(s=c.getOtherAxis(a).inverse),l=t.getData().mapDimension(l),i={thisAxis:a,series:t,thisDim:r,otherDim:l,otherAxisInverse:s}}}),this)}),this),i}},e.prototype._renderHandle=function(){var t=this.group,e=this._displayables,i=e.handles=[null,null],n=e.handleLabels=[null,null],r=this._displayables.sliderGroup,o=this._size,s=this.dataZoomModel,a=this.api,l=s.get("borderRadius")||0,c=s.get("brushSelect"),u=e.filler=new Vrt({silent:c,style:{fill:s.get("fillerColor")},textConfig:{position:"inside"}});r.add(u),r.add(new Vrt({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:o[0],height:o[1],r:l},style:{stroke:s.get("dataBackgroundColor")||s.get("borderColor"),lineWidth:1,fill:"rgba(0,0,0,0)"}})),yE([0,1],(function(e){var o=s.get("handleIcon");!cG[o]&&o.indexOf("path://")<0&&o.indexOf("image://")<0&&(o="path://"+o,"production"!==process.env.NODE_ENV&&eP("handleIcon now needs 'path://' prefix when using a path string"));var a=pG(o,-1,0,2,2,null,!0);a.attr({cursor:qrt(this._orient),draggable:!0,drift:wE(this._onDragMove,this,e),ondragend:wE(this._onDragEnd,this),onmouseover:wE(this._showDataInfo,this,!0),onmouseout:wE(this._showDataInfo,this,!1),z2:5});var l=a.getBoundingRect(),c=s.get("handleSize");this._handleHeight=IC(c,this._size[1]),this._handleWidth=l.width/l.height*this._handleHeight,a.setStyle(s.getModel("handleStyle").getItemStyle()),a.style.strokeNoScale=!0,a.rectHover=!0,a.ensureState("emphasis").style=s.getModel(["emphasis","handleStyle"]).getItemStyle(),qR(a);var u=s.get("handleColor");null!=u&&(a.style.fill=u),r.add(i[e]=a);var h=s.getModel("textStyle");t.add(n[e]=new JD({silent:!0,invisible:!0,style:mN(h,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:h.getTextColor(),font:h.getFont()}),z2:10}))}),this);var h=u;if(c){var p=IC(s.get("moveHandleSize"),o[1]),d=e.moveHandle=new kD({style:s.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:o[1]-.5,height:p}}),f=.8*p,m=e.moveHandleIcon=pG(s.get("moveHandleIcon"),-f/2,-f/2,f,f,"#fff",!0);m.silent=!0,m.y=o[1]+p/2-.5,d.ensureState("emphasis").style=s.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var g=Math.min(o[1]/2,Math.max(p,10));(h=e.moveZone=new kD({invisible:!0,shape:{y:o[1]-g,height:p+g}})).on("mouseover",(function(){a.enterEmphasis(d)})).on("mouseout",(function(){a.leaveEmphasis(d)})),r.add(d),r.add(m),r.add(h)}h.attr({draggable:!0,cursor:qrt(this._orient),drift:wE(this._onDragMove,this,"all"),ondragstart:wE(this._showDataInfo,this,!0),ondragend:wE(this._onDragEnd,this),onmouseover:wE(this._showDataInfo,this,!0),onmouseout:wE(this._showDataInfo,this,!1)})},e.prototype._resetInterval=function(){var t=this._range=this.dataZoomModel.getPercentRange(),e=this._getViewExtent();this._handleEnds=[TC(t[0],[0,100],e,!0),TC(t[1],[0,100],e,!0)]},e.prototype._updateInterval=function(t,e){var i=this.dataZoomModel,n=this._handleEnds,r=this._getViewExtent(),o=i.findRepresentativeAxisProxy().getMinMaxSpan(),s=[0,100];s3(e,n,r,i.get("zoomLock")?"all":t,null!=o.minSpan?TC(o.minSpan,s,r,!0):null,null!=o.maxSpan?TC(o.maxSpan,s,r,!0):null);var a=this._range,l=this._range=PC([TC(n[0],r,s,!0),TC(n[1],r,s,!0)]);return!a||a[0]!==l[0]||a[1]!==l[1]},e.prototype._updateView=function(t){var e=this._displayables,i=this._handleEnds,n=PC(i.slice()),r=this._size;yE([0,1],(function(t){var n=e.handles[t],o=this._handleHeight;n.attr({scaleX:o/2,scaleY:o/2,x:i[t]+(t?-1:1),y:r[1]/2-o/2})}),this),e.filler.setShape({x:n[0],y:0,width:n[1]-n[0],height:r[1]});var o={x:n[0],width:n[1]-n[0]};e.moveHandle&&(e.moveHandle.setShape(o),e.moveZone.setShape(o),e.moveZone.getBoundingRect(),e.moveHandleIcon&&e.moveHandleIcon.attr("x",o.x+o.width/2));for(var s=e.dataShadowSegs,a=[0,n[0],n[1],r[0]],l=0;l<s.length;l++){var c=s[l],u=c.getClipPath();u||(u=new kD,c.setClipPath(u)),u.setShape({x:a[l],y:0,width:a[l+1]-a[l],height:r[1]})}this._updateDataInfo(t)},e.prototype._updateDataInfo=function(t){var e=this.dataZoomModel,i=this._displayables,n=i.handleLabels,r=this._orient,o=["",""];if(e.get("showDetail")){var s=e.findRepresentativeAxisProxy();if(s){var a=s.getAxisModel().axis,l=this._range,c=t?s.calculateDataWindow({start:l[0],end:l[1]}).valueWindow:s.getDataValueWindow();o=[this._formatLabel(c[0],a),this._formatLabel(c[1],a)]}}var u=PC(this._handleEnds.slice());function h(t){var e=Qk(i.handles[t].parent,this.group),s=Kk(0===t?"right":"left",e),a=this._handleWidth/2+5,l=Jk([u[t]+(0===t?-a:a),this._size[1]/2],e);n[t].setStyle({x:l[0],y:l[1],verticalAlign:r===Urt?"middle":s,align:r===Urt?s:"center",text:o[t]})}h.call(this,0),h.call(this,1)},e.prototype._formatLabel=function(t,e){var i=this.dataZoomModel,n=i.get("labelFormatter"),r=i.get("labelPrecision");null!=r&&"auto"!==r||(r=e.getPixelPrecision());var o=null==t||isNaN(t)?"":"category"===e.type||"time"===e.type?e.scale.getLabel({value:Math.round(t)}):t.toFixed(Math.min(r,20));return SE(n)?n(t,o):ME(n)?n.replace("{value}",o):o},e.prototype._showDataInfo=function(t){t=this._dragging||t;var e=this._displayables,i=e.handleLabels;i[0].attr("invisible",!t),i[1].attr("invisible",!t),e.moveHandle&&this.api[t?"enterEmphasis":"leaveEmphasis"](e.moveHandle,1)},e.prototype._onDragMove=function(t,e,i,n){this._dragging=!0,jS(n.event);var r=Jk([e,i],this._displayables.sliderGroup.getLocalTransform(),!0),o=this._updateInterval(t,r[0]),s=this.dataZoomModel.get("realtime");this._updateView(!s),o&&s&&this._dispatchZoomAction(!0)},e.prototype._onDragEnd=function(){this._dragging=!1,this._showDataInfo(!1),!this.dataZoomModel.get("realtime")&&this._dispatchZoomAction(!1)},e.prototype._onClickPanel=function(t){var e=this._size,i=this._displayables.sliderGroup.transformCoordToLocal(t.offsetX,t.offsetY);if(!(i[0]<0||i[0]>e[0]||i[1]<0||i[1]>e[1])){var n=this._handleEnds,r=(n[0]+n[1])/2,o=this._updateInterval("all",i[0]-r);this._updateView(),o&&this._dispatchZoomAction(!1)}},e.prototype._onBrushStart=function(t){var e=t.offsetX,i=t.offsetY;this._brushStart=new iM(e,i),this._brushing=!0,this._brushStartTime=+new Date},e.prototype._onBrushEnd=function(t){if(this._brushing){var e=this._displayables.brushRect;if(this._brushing=!1,e){e.attr("ignore",!0);var i=e.shape;if(!(+new Date-this._brushStartTime<200&&Math.abs(i.width)<5)){var n=this._getViewExtent(),r=[0,100];this._range=PC([TC(i.x,n,r,!0),TC(i.x+i.width,n,r,!0)]),this._handleEnds=[i.x,i.x+i.width],this._updateView(),this._dispatchZoomAction(!1)}}}},e.prototype._onBrush=function(t){this._brushing&&(jS(t.event),this._updateBrushRect(t.offsetX,t.offsetY))},e.prototype._updateBrushRect=function(t,e){var i=this._displayables,n=this.dataZoomModel,r=i.brushRect;r||(r=i.brushRect=new Vrt({silent:!0,style:n.getModel("brushStyle").getItemStyle()}),i.sliderGroup.add(r)),r.attr("ignore",!1);var o=this._brushStart,s=this._displayables.sliderGroup,a=s.transformCoordToLocal(t,e),l=s.transformCoordToLocal(o.x,o.y),c=this._size;a[0]=Math.max(Math.min(c[0],a[0]),0),r.setShape({x:l[0],y:0,width:a[0]-l[0],height:c[1]})},e.prototype._dispatchZoomAction=function(t){var e=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:t?Hrt:null,start:e[0],end:e[1]})},e.prototype._findCoordRect=function(){var t,e=Ntt(this.dataZoomModel).infoList;if(!t&&e.length){var i=e[0].model.coordinateSystem;t=i.getRect&&i.getRect()}if(!t){var n=this.api.getWidth(),r=this.api.getHeight();t={x:.2*n,y:.2*r,width:.6*n,height:.6*r}}return t},e.type="dataZoom.slider",e}(Htt);function qrt(t){return"vertical"===t?"ns-resize":"ew-resize"}var Xrt=Wrt;function Zrt(t){t.registerComponentModel(Frt),t.registerComponentView(Xrt),$tt(t)}var Yrt={get:function(t,e,i){var n=cE((Qrt[t]||{})[e]);return i&&EE(n)?n[n.length-1]:n}},Qrt={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},Jrt=Yrt,Krt=X0.mapVisual,$rt=X0.eachVisual,tot=EE,eot=yE,iot=PC,not=TC,rot=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.stateList=["inRange","outOfRange"],i.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],i.layoutMode={type:"box",ignoreSize:!0},i.dataBound=[-1/0,1/0],i.targetVisuals={},i.controllerVisuals={},i}return zA(e,t),e.prototype.init=function(t,e,i){this.mergeDefaultAndTheme(t,i)},e.prototype.optionUpdated=function(t,e){var i=this.option;!e&&Iit(i,t,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},e.prototype.resetVisual=function(t){var e=this.stateList;t=wE(t,this),this.controllerVisuals=Tit(this.option.controller,e,t),this.targetVisuals=Tit(this.option.target,e,t)},e.prototype.getItemSymbol=function(){return null},e.prototype.getTargetSeriesIndices=function(){var t=this.option.seriesIndex,e=[];return null==t||"all"===t?this.ecModel.eachSeries((function(t,i){e.push(i)})):e=lP(t),e},e.prototype.eachTargetSeries=function(t,e){yE(this.getTargetSeriesIndices(),(function(i){var n=this.ecModel.getSeriesByIndex(i);n&&t.call(e,n)}),this)},e.prototype.isTargetSeries=function(t){var e=!1;return this.eachTargetSeries((function(i){i===t&&(e=!0)})),e},e.prototype.formatValueText=function(t,e,i){var n,r=this.option,o=r.precision,s=this.dataBound,a=r.formatter;i=i||["<",">"],EE(t)&&(t=t.slice(),n=!0);var l=e?t:n?[c(t[0]),c(t[1])]:c(t);return ME(a)?a.replace("{value}",n?l[0]:l).replace("{value2}",n?l[1]:l):SE(a)?n?a(t[0],t[1]):a(t):n?t[0]===s[0]?i[0]+" "+l[1]:t[1]===s[1]?i[1]+" "+l[0]:l[0]+" - "+l[1]:l;function c(t){return t===s[0]?"min":t===s[1]?"max":(+t).toFixed(Math.min(o,20))}},e.prototype.resetExtent=function(){var t=this.option,e=iot([t.min,t.max]);this._dataExtent=e},e.prototype.getDataDimensionIndex=function(t){var e=this.option.dimension;if(null!=e)return t.getDimensionIndex(e);for(var i=t.dimensions,n=i.length-1;n>=0;n--){var r=i[n],o=t.getDimensionInfo(r);if(!o.isCalculationCoord)return o.storeDimIndex}},e.prototype.getExtent=function(){return this._dataExtent.slice()},e.prototype.completeVisualOption=function(){var t=this.ecModel,e=this.option,i={inRange:e.inRange,outOfRange:e.outOfRange},n=e.target||(e.target={}),r=e.controller||(e.controller={});uE(n,i),uE(r,i);var o=this.isCategory();function s(i){tot(e.color)&&!i.inRange&&(i.inRange={color:e.color.slice().reverse()}),i.inRange=i.inRange||{color:t.get("gradientColor")}}s.call(this,n),s.call(this,r),function(t,e,i){var n=t[e],r=t[i];n&&!r&&(r=t[i]={},eot(n,(function(t,e){if(X0.isValidType(e)){var i=Jrt.get(e,"inactive",o);null!=i&&(r[e]=i,"color"!==e||r.hasOwnProperty("opacity")||r.hasOwnProperty("colorAlpha")||(r.opacity=[0,0]))}})))}.call(this,n,"inRange","outOfRange"),function(t){var e=(t.inRange||{}).symbol||(t.outOfRange||{}).symbol,i=(t.inRange||{}).symbolSize||(t.outOfRange||{}).symbolSize,n=this.get("inactiveColor"),r=this.getItemSymbol()||"roundRect";eot(this.stateList,(function(s){var a=this.itemSize,l=t[s];l||(l=t[s]={color:o?n:[n]}),null==l.symbol&&(l.symbol=e&&cE(e)||(o?r:[r])),null==l.symbolSize&&(l.symbolSize=i&&cE(i)||(o?a[0]:[a[0],a[0]])),l.symbol=Krt(l.symbol,(function(t){return"none"===t?r:t}));var c=l.symbolSize;if(null!=c){var u=-1/0;$rt(c,(function(t){t>u&&(u=t)})),l.symbolSize=Krt(c,(function(t){return not(t,[0,u],[0,a[0]],!0)}))}}),this)}.call(this,r)},e.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},e.prototype.isCategory=function(){return!!this.option.categories},e.prototype.setSelected=function(t){},e.prototype.getSelected=function(){return null},e.prototype.getValueState=function(t){return null},e.prototype.getVisualMeta=function(t){return null},e.type="visualMap",e.dependencies=["series"],e.defaultOption={show:!0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},e}(YB),oot=rot,sot=[20,140],aot=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.optionUpdated=function(e,i){t.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual((function(t){t.mappingMethod="linear",t.dataExtent=this.getExtent()})),this._resetRange()},e.prototype.resetItemSize=function(){t.prototype.resetItemSize.apply(this,arguments);var e=this.itemSize;(null==e[0]||isNaN(e[0]))&&(e[0]=sot[0]),(null==e[1]||isNaN(e[1]))&&(e[1]=sot[1])},e.prototype._resetRange=function(){var t=this.getExtent(),e=this.option.range;!e||e.auto?(t.auto=1,this.option.range=t):EE(e)&&(e[0]>e[1]&&e.reverse(),e[0]=Math.max(e[0],t[0]),e[1]=Math.min(e[1],t[1]))},e.prototype.completeVisualOption=function(){t.prototype.completeVisualOption.apply(this,arguments),yE(this.stateList,(function(t){var e=this.option.controller[t].symbolSize;e&&e[0]!==e[1]&&(e[0]=e[1]/3)}),this)},e.prototype.setSelected=function(t){this.option.range=t.slice(),this._resetRange()},e.prototype.getSelected=function(){var t=this.getExtent(),e=PC((this.get("range")||[]).slice());return e[0]>t[1]&&(e[0]=t[1]),e[1]>t[1]&&(e[1]=t[1]),e[0]<t[0]&&(e[0]=t[0]),e[1]<t[0]&&(e[1]=t[0]),e},e.prototype.getValueState=function(t){var e=this.option.range,i=this.getExtent();return(e[0]<=i[0]||e[0]<=t)&&(e[1]>=i[1]||t<=e[1])?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var e=[];return this.eachTargetSeries((function(i){var n=[],r=i.getData();r.each(this.getDataDimensionIndex(r),(function(e,i){t[0]<=e&&e<=t[1]&&n.push(i)}),this),e.push({seriesId:i.id,dataIndex:n})}),this),e},e.prototype.getVisualMeta=function(t){var e=lot(this,"outOfRange",this.getExtent()),i=lot(this,"inRange",this.option.range.slice()),n=[];function r(e,i){n.push({value:e,color:t(e,i)})}for(var o=0,s=0,a=i.length,l=e.length;s<l&&(!i.length||e[s]<=i[0]);s++)e[s]<i[o]&&r(e[s],"outOfRange");for(var c=1;o<a;o++,c=0)c&&n.length&&r(i[o],"outOfRange"),r(i[o],"inRange");for(c=1;s<l;s++)(!i.length||i[i.length-1]<e[s])&&(c&&(n.length&&r(n[n.length-1].value,"outOfRange"),c=0),r(e[s],"outOfRange"));var u=n.length;return{stops:n,outerColors:[u?n[0].color:"transparent",u?n[u-1].color:"transparent"]}},e.type="visualMap.continuous",e.defaultOption=GN(oot.defaultOption,{align:"auto",calculable:!1,hoverLink:!0,realtime:!0,handleIcon:"path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z",handleSize:"120%",handleStyle:{borderColor:"#fff",borderWidth:1},indicatorIcon:"circle",indicatorSize:"50%",indicatorStyle:{borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}}),e}(oot);function lot(t,e,i){if(i[0]===i[1])return i.slice();for(var n=(i[1]-i[0])/200,r=i[0],o=[],s=0;s<=200&&r<i[1];s++)o.push(r),r+=n;return o.push(i[1]),o}var cot=aot,uot=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i.autoPositionValues={left:1,right:1,top:1,bottom:1},i}return zA(e,t),e.prototype.init=function(t,e){this.ecModel=t,this.api=e},e.prototype.render=function(t,e,i,n){this.visualMapModel=t,!1!==t.get("show")?this.doRender(t,e,i,n):this.group.removeAll()},e.prototype.renderBackground=function(t){var e=this.visualMapModel,i=CB(e.get("padding")||0),n=t.getBoundingRect();t.add(new kD({z2:-1,silent:!0,shape:{x:n.x-i[3],y:n.y-i[0],width:n.width+i[3]+i[1],height:n.height+i[0]+i[2]},style:{fill:e.get("backgroundColor"),stroke:e.get("borderColor"),lineWidth:e.get("borderWidth")}}))},e.prototype.getControllerVisual=function(t,e,i){var n=(i=i||{}).forceState,r=this.visualMapModel,o={};if("color"===e){var s=r.get("contentColor");o.color=s}function a(t){return o[t]}function l(t,e){o[t]=e}var c=r.controllerVisuals[n||r.getValueState(t)];return yE(X0.prepareVisualTypes(c),(function(n){var r=c[n];i.convertOpacityToAlpha&&"opacity"===n&&(n="colorAlpha",r=c.__alphaForOpacity),X0.dependsOn(n,e)&&r&&r.applyVisual(t,a,l)})),o[e]},e.prototype.positionGroup=function(t){var e=this.visualMapModel,i=this.api;GB(t,e.getBoxLayoutParams(),{width:i.getWidth(),height:i.getHeight()})},e.prototype.doRender=function(t,e,i,n){},e.type="visualMap",e}(qV),hot=uot,pot=[["left","right","width"],["top","bottom","height"]];function dot(t,e,i){var n=t.option,r=n.align;if(null!=r&&"auto"!==r)return r;for(var o={width:e.getWidth(),height:e.getHeight()},s="horizontal"===n.orient?1:0,a=pot[s],l=[0,null,10],c={},u=0;u<3;u++)c[pot[1-s][u]]=l[u],c[a[u]]=2===u?i[0]:n[a[u]];var h=[["x","width",3],["y","height",0]][s],p=UB(c,o,n.padding);return a[(p.margin[h[2]]||0)+p[h[0]]+.5*p[h[1]]<.5*o[h[1]]?0:1]}function fot(t,e){return yE(t||[],(function(t){null!=t.dataIndex&&(t.dataIndexInside=t.dataIndex,t.dataIndex=null),t.highlightKey="visualMap"+(e?e.componentIndex:"")})),t}var mot=TC,got=yE,yot=Math.min,vot=Math.max,_ot=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i._shapes={},i._dataInterval=[],i._handleEnds=[],i._hoverLinkDataIndices=[],i}return zA(e,t),e.prototype.doRender=function(t,e,i,n){this._api=i,n&&"selectDataRange"===n.type&&n.from===this.uid||this._buildView()},e.prototype._buildView=function(){this.group.removeAll();var t=this.visualMapModel,e=this.group;this._orient=t.get("orient"),this._useHandle=t.get("calculable"),this._resetInterval(),this._renderBar(e);var i=t.get("text");this._renderEndsText(e,i,0),this._renderEndsText(e,i,1),this._updateView(!0),this.renderBackground(e),this._updateView(),this._enableHoverLinkToSeries(),this._enableHoverLinkFromSeries(),this.positionGroup(e)},e.prototype._renderEndsText=function(t,e,i){if(e){var n=e[1-i];n=null!=n?n+"":"";var r=this.visualMapModel,o=r.get("textGap"),s=r.itemSize,a=this._shapes.mainGroup,l=this._applyTransform([s[0]/2,0===i?-o:s[1]+o],a),c=this._applyTransform(0===i?"bottom":"top",a),u=this._orient,h=this.visualMapModel.textStyleModel;this.group.add(new JD({style:mN(h,{x:l[0],y:l[1],verticalAlign:"horizontal"===u?"middle":c,align:"horizontal"===u?c:"center",text:n})}))}},e.prototype._renderBar=function(t){var e=this.visualMapModel,i=this._shapes,n=e.itemSize,r=this._orient,o=this._useHandle,s=dot(e,this.api,n),a=i.mainGroup=this._createBarGroup(s),l=new xC;a.add(l),l.add(i.outOfRange=xot()),l.add(i.inRange=xot(null,o?wot(this._orient):null,wE(this._dragHandle,this,"all",!1),wE(this._dragHandle,this,"all",!0))),l.setClipPath(new kD({shape:{x:0,y:0,width:n[0],height:n[1],r:3}}));var c=e.textStyleModel.getTextRect("国"),u=vot(c.width,c.height);o&&(i.handleThumbs=[],i.handleLabels=[],i.handleLabelPoints=[],this._createHandle(e,a,0,n,u,r),this._createHandle(e,a,1,n,u,r)),this._createIndicator(e,a,n,u,r),t.add(a)},e.prototype._createHandle=function(t,e,i,n,r,o){var s=wE(this._dragHandle,this,i,!1),a=wE(this._dragHandle,this,i,!0),l=sC(t.get("handleSize"),n[0]),c=pG(t.get("handleIcon"),-l/2,-l/2,l,l,null,!0),u=wot(this._orient);c.attr({cursor:u,draggable:!0,drift:s,ondragend:a,onmousemove:function(t){jS(t.event)}}),c.x=n[0]/2,c.useStyle(t.getModel("handleStyle").getItemStyle()),c.setStyle({strokeNoScale:!0,strokeFirst:!0}),c.style.lineWidth*=2,c.ensureState("emphasis").style=t.getModel(["emphasis","handleStyle"]).getItemStyle(),KR(c,!0),e.add(c);var h=this.visualMapModel.textStyleModel,p=new JD({cursor:u,draggable:!0,drift:s,onmousemove:function(t){jS(t.event)},ondragend:a,style:mN(h,{x:0,y:0,text:""})});p.ensureState("blur").style={opacity:.1},p.stateTransition={duration:200},this.group.add(p);var d=[l,0],f=this._shapes;f.handleThumbs[i]=c,f.handleLabelPoints[i]=d,f.handleLabels[i]=p},e.prototype._createIndicator=function(t,e,i,n,r){var o=sC(t.get("indicatorSize"),i[0]),s=pG(t.get("indicatorIcon"),-o/2,-o/2,o,o,null,!0);s.attr({cursor:"move",invisible:!0,silent:!0,x:i[0]/2});var a=t.getModel("indicatorStyle").getItemStyle();if(s instanceof TD){var l=s.style;s.useStyle(pE({image:l.image,x:l.x,y:l.y,width:l.width,height:l.height},a))}else s.useStyle(a);e.add(s);var c=this.visualMapModel.textStyleModel,u=new JD({silent:!0,invisible:!0,style:mN(c,{x:0,y:0,text:""})});this.group.add(u);var h=[("horizontal"===r?n/2:6)+i[0]/2,0],p=this._shapes;p.indicator=s,p.indicatorLabel=u,p.indicatorLabelPoint=h,this._firstShowIndicator=!0},e.prototype._dragHandle=function(t,e,i,n){if(this._useHandle){if(this._dragging=!e,!e){var r=this._applyTransform([i,n],this._shapes.mainGroup,!0);this._updateInterval(t,r[1]),this._hideIndicator(),this._updateView()}e===!this.visualMapModel.get("realtime")&&this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:this._dataInterval.slice()}),e?!this._hovering&&this._clearHoverLinkToSeries():bot(this.visualMapModel)&&this._doHoverLinkToSeries(this._handleEnds[t],!1)}},e.prototype._resetInterval=function(){var t=this.visualMapModel,e=this._dataInterval=t.getSelected(),i=t.getExtent(),n=[0,t.itemSize[1]];this._handleEnds=[mot(e[0],i,n,!0),mot(e[1],i,n,!0)]},e.prototype._updateInterval=function(t,e){e=e||0;var i=this.visualMapModel,n=this._handleEnds,r=[0,i.itemSize[1]];s3(e,n,r,t,0);var o=i.getExtent();this._dataInterval=[mot(n[0],r,o,!0),mot(n[1],r,o,!0)]},e.prototype._updateView=function(t){var e=this.visualMapModel,i=e.getExtent(),n=this._shapes,r=[0,e.itemSize[1]],o=t?r:this._handleEnds,s=this._createBarVisual(this._dataInterval,i,o,"inRange"),a=this._createBarVisual(i,i,r,"outOfRange");n.inRange.setStyle({fill:s.barColor}).setShape("points",s.barPoints),n.outOfRange.setStyle({fill:a.barColor}).setShape("points",a.barPoints),this._updateHandle(o,s)},e.prototype._createBarVisual=function(t,e,i,n){var r={forceState:n,convertOpacityToAlpha:!0},o=this._makeColorGradient(t,r),s=[this.getControllerVisual(t[0],"symbolSize",r),this.getControllerVisual(t[1],"symbolSize",r)],a=this._createBarPoints(i,s);return{barColor:new mk(0,0,0,1,o),barPoints:a,handlesColor:[o[0].color,o[o.length-1].color]}},e.prototype._makeColorGradient=function(t,e){var i=[],n=(t[1]-t[0])/100;i.push({color:this.getControllerVisual(t[0],"color",e),offset:0});for(var r=1;r<100;r++){var o=t[0]+n*r;if(o>t[1])break;i.push({color:this.getControllerVisual(o,"color",e),offset:r/100})}return i.push({color:this.getControllerVisual(t[1],"color",e),offset:1}),i},e.prototype._createBarPoints=function(t,e){var i=this.visualMapModel.itemSize;return[[i[0]-e[0],t[0]],[i[0],t[0]],[i[0],t[1]],[i[0]-e[1],t[1]]]},e.prototype._createBarGroup=function(t){var e=this._orient,i=this.visualMapModel.get("inverse");return new xC("horizontal"!==e||i?"horizontal"===e&&i?{scaleX:"bottom"===t?-1:1,rotation:-Math.PI/2}:"vertical"!==e||i?{scaleX:"left"===t?1:-1}:{scaleX:"left"===t?1:-1,scaleY:-1}:{scaleX:"bottom"===t?1:-1,rotation:Math.PI/2})},e.prototype._updateHandle=function(t,e){if(this._useHandle){var i=this._shapes,n=this.visualMapModel,r=i.handleThumbs,o=i.handleLabels,s=n.itemSize,a=n.getExtent();got([0,1],(function(l){var c=r[l];c.setStyle("fill",e.handlesColor[l]),c.y=t[l];var u=mot(t[l],[0,s[1]],a,!0),h=this.getControllerVisual(u,"symbolSize");c.scaleX=c.scaleY=h/s[0],c.x=s[0]-h/2;var p=Jk(i.handleLabelPoints[l],Qk(c,this.group));o[l].setStyle({x:p[0],y:p[1],text:n.formatValueText(this._dataInterval[l]),verticalAlign:"middle",align:"vertical"===this._orient?this._applyTransform("left",i.mainGroup):"center"})}),this)}},e.prototype._showIndicator=function(t,e,i,n){var r=this.visualMapModel,o=r.getExtent(),s=r.itemSize,a=[0,s[1]],l=this._shapes,c=l.indicator;if(c){c.attr("invisible",!1);var u=this.getControllerVisual(t,"color",{convertOpacityToAlpha:!0}),h=this.getControllerVisual(t,"symbolSize"),p=mot(t,o,a,!0),d=s[0]-h/2,f={x:c.x,y:c.y};c.y=p,c.x=d;var m=Jk(l.indicatorLabelPoint,Qk(c,this.group)),g=l.indicatorLabel;g.attr("invisible",!1);var y=this._applyTransform("left",l.mainGroup),v="horizontal"===this._orient;g.setStyle({text:(i||"")+r.formatValueText(e),verticalAlign:v?y:"middle",align:v?"center":y});var _={x:d,y:p,style:{fill:u}},x={style:{x:m[0],y:m[1]}};if(r.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var b={duration:100,easing:"cubicInOut",additive:!0};c.x=f.x,c.y=f.y,c.animateTo(_,b),g.animateTo(x,b)}else c.attr(_),g.attr(x);this._firstShowIndicator=!1;var w=this._shapes.handleLabels;if(w)for(var A=0;A<w.length;A++)this._api.enterBlur(w[A])}},e.prototype._enableHoverLinkToSeries=function(){var t=this;this._shapes.mainGroup.on("mousemove",(function(e){if(t._hovering=!0,!t._dragging){var i=t.visualMapModel.itemSize,n=t._applyTransform([e.offsetX,e.offsetY],t._shapes.mainGroup,!0,!0);n[1]=yot(vot(0,n[1]),i[1]),t._doHoverLinkToSeries(n[1],0<=n[0]&&n[0]<=i[0])}})).on("mouseout",(function(){t._hovering=!1,!t._dragging&&t._clearHoverLinkToSeries()}))},e.prototype._enableHoverLinkFromSeries=function(){var t=this.api.getZr();this.visualMapModel.option.hoverLink?(t.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),t.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},e.prototype._doHoverLinkToSeries=function(t,e){var i=this.visualMapModel,n=i.itemSize;if(i.option.hoverLink){var r=[0,n[1]],o=i.getExtent();t=yot(vot(r[0],t),r[1]);var s=function(t,e,i){var n=6,r=t.get("hoverLinkDataSize");r&&(n=mot(r,e,i,!0)/2);return n}(i,o,r),a=[t-s,t+s],l=mot(t,r,o,!0),c=[mot(a[0],r,o,!0),mot(a[1],r,o,!0)];a[0]<r[0]&&(c[0]=-1/0),a[1]>r[1]&&(c[1]=1/0),e&&(c[0]===-1/0?this._showIndicator(l,c[1],"< ",s):c[1]===1/0?this._showIndicator(l,c[0],"> ",s):this._showIndicator(l,l,"≈ ",s));var u=this._hoverLinkDataIndices,h=[];(e||bot(i))&&(h=this._hoverLinkDataIndices=i.findTargetDataIndices(c));var p=function(t,e){var i={},n={};return r(t||[],i),r(e||[],n,i),[o(i),o(n)];function r(t,e,i){for(var n=0,r=t.length;n<r;n++){var o=gP(t[n].seriesId,null);if(null==o)return;for(var s=lP(t[n].dataIndex),a=i&&i[o],l=0,c=s.length;l<c;l++){var u=s[l];a&&a[u]?a[u]=null:(e[o]||(e[o]={}))[u]=1}}}function o(t,e){var i=[];for(var n in t)if(t.hasOwnProperty(n)&&null!=t[n])if(e)i.push(+n);else{var r=o(t[n],!0);r.length&&i.push({seriesId:n,dataIndex:r})}return i}}(u,h);this._dispatchHighDown("downplay",fot(p[0],i)),this._dispatchHighDown("highlight",fot(p[1],i))}},e.prototype._hoverLinkFromSeriesMouseOver=function(t){var e;if($U(t.target,(function(t){var i=KD(t);if(null!=i.dataIndex)return e=i,!0}),!0),e){var i=this.ecModel.getSeriesByIndex(e.seriesIndex),n=this.visualMapModel;if(n.isTargetSeries(i)){var r=i.getData(e.dataType),o=r.getStore().get(n.getDataDimensionIndex(r),e.dataIndex);isNaN(o)||this._showIndicator(o,o)}}},e.prototype._hideIndicator=function(){var t=this._shapes;t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0);var e=this._shapes.handleLabels;if(e)for(var i=0;i<e.length;i++)this._api.leaveBlur(e[i])},e.prototype._clearHoverLinkToSeries=function(){this._hideIndicator();var t=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",fot(t,this.visualMapModel)),t.length=0},e.prototype._clearHoverLinkFromSeries=function(){this._hideIndicator();var t=this.api.getZr();t.off("mouseover",this._hoverLinkFromSeriesMouseOver),t.off("mouseout",this._hideIndicator)},e.prototype._applyTransform=function(t,e,i,n){var r=Qk(e,n?null:this.group);return EE(t)?Jk(t,r,i):Kk(t,r,i)},e.prototype._dispatchHighDown=function(t,e){e&&e.length&&this.api.dispatchAction({type:t,batch:e})},e.prototype.dispose=function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},e.prototype.remove=function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},e.type="visualMap.continuous",e}(hot);function xot(t,e,i,n){return new QO({shape:{points:t},draggable:!!i,cursor:e,drift:i,onmousemove:function(t){jS(t.event)},ondragend:n})}function bot(t){var e=t.get("hoverLinkOnHandle");return!!(null==e?t.get("realtime"):e)}function wot(t){return"vertical"===t?"ns-resize":"ew-resize"}var Aot=_ot,Eot={type:"selectDataRange",event:"dataRangeSelected",update:"update"},Sot=function(t,e){e.eachComponent({mainType:"visualMap",query:t},(function(e){e.setSelected(t.selected)}))},Mot=[{createOnAllSeries:!0,reset:function(t,e){var i=[];return e.eachComponent("visualMap",(function(e){var n,r,o,s,a,l=t.pipelineContext;!e.isTargetSeries(t)||l&&l.large||i.push((n=e.stateList,r=e.targetVisuals,o=wE(e.getValueState,e),s=e.getDataDimensionIndex(t.getData()),a={},yE(n,(function(t){var e=X0.prepareVisualTypes(r[t]);a[t]=e})),{progress:function(t,e){var i,n;function l(t){return ZU(e,n,t)}function c(t,i){QU(e,n,t,i)}null!=s&&(i=e.getDimensionIndex(s));for(var u=e.getStore();null!=(n=t.next());){var h=e.getRawDataItem(n);if(!h||!1!==h.visualMap)for(var p=null!=s?u.get(i,n):n,d=o(p),f=r[d],m=a[d],g=0,y=m.length;g<y;g++){var v=m[g];f[v]&&f[v].applyVisual(p,l,c)}}}}))})),i}},{createOnAllSeries:!0,reset:function(t,e){var i=t.getData(),n=[];e.eachComponent("visualMap",(function(e){if(e.isTargetSeries(t)){var r=e.getVisualMeta(wE(Tot,null,t,e))||{stops:[],outerColors:[]},o=e.getDataDimensionIndex(i);o>=0&&(r.dimension=o,n.push(r))}})),t.getData().setVisual("visualMeta",n)}}];function Tot(t,e,i,n){for(var r=e.targetVisuals[n],o=X0.prepareVisualTypes(r),s={color:YU(t.getData(),"color")},a=0,l=o.length;a<l;a++){var c=o[a],u=r["opacity"===c?"__alphaForOpacity":c];u&&u.applyVisual(i,h,p)}return s.color;function h(t){return s[t]}function p(t,e){s[t]=e}}var Iot=yE;function Cot(t){var e=t&&t.visualMap;EE(e)||(e=e?[e]:[]),Iot(e,(function(t){if(t){Pot(t,"splitList")&&!Pot(t,"pieces")&&(t.pieces=t.splitList,delete t.splitList);var e=t.pieces;e&&EE(e)&&Iot(e,(function(t){CE(t)&&(Pot(t,"start")&&!Pot(t,"min")&&(t.min=t.start),Pot(t,"end")&&!Pot(t,"max")&&(t.max=t.end))}))}}))}function Pot(t,e){return t&&t.hasOwnProperty&&t.hasOwnProperty(e)}var Lot=!1;function Dot(t){Lot||(Lot=!0,t.registerSubTypeDefaulter("visualMap",(function(t){return t.categories||(t.pieces?t.pieces.length>0:t.splitNumber>0)&&!t.calculable?"piecewise":"continuous"})),t.registerAction(Eot,Sot),yE(Mot,(function(e){t.registerVisual(t.PRIORITY.VISUAL.COMPONENT,e)})),t.registerPreprocessor(Cot))}function Rot(t){t.registerComponentModel(cot),t.registerComponentView(Aot),Dot(t)}var Oot=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i._pieceList=[],i}return zA(e,t),e.prototype.optionUpdated=function(e,i){t.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var n=this._mode=this._determineMode();this._pieceList=[],kot[this._mode].call(this,this._pieceList),this._resetSelected(e,i);var r=this.option.categories;this.resetVisual((function(t,e){"categories"===n?(t.mappingMethod="category",t.categories=cE(r)):(t.dataExtent=this.getExtent(),t.mappingMethod="piecewise",t.pieceList=vE(this._pieceList,(function(t){return t=cE(t),"inRange"!==e&&(t.visual=null),t})))}))},e.prototype.completeVisualOption=function(){var e=this.option,i={},n=X0.listVisualTypes(),r=this.isCategory();function o(t,e,i){return t&&t[e]&&t[e].hasOwnProperty(i)}yE(e.pieces,(function(t){yE(n,(function(e){t.hasOwnProperty(e)&&(i[e]=1)}))})),yE(i,(function(t,i){var n=!1;yE(this.stateList,(function(t){n=n||o(e,t,i)||o(e.target,t,i)}),this),!n&&yE(this.stateList,(function(t){(e[t]||(e[t]={}))[i]=Jrt.get(i,"inRange"===t?"active":"inactive",r)}))}),this),t.prototype.completeVisualOption.apply(this,arguments)},e.prototype._resetSelected=function(t,e){var i=this.option,n=this._pieceList,r=(e?i:t).selected||{};if(i.selected=r,yE(n,(function(t,e){var i=this.getSelectedMapKey(t);r.hasOwnProperty(i)||(r[i]=!0)}),this),"single"===i.selectedMode){var o=!1;yE(n,(function(t,e){var i=this.getSelectedMapKey(t);r[i]&&(o?r[i]=!1:o=!0)}),this)}},e.prototype.getItemSymbol=function(){return this.get("itemSymbol")},e.prototype.getSelectedMapKey=function(t){return"categories"===this._mode?t.value+"":t.index+""},e.prototype.getPieceList=function(){return this._pieceList},e.prototype._determineMode=function(){var t=this.option;return t.pieces&&t.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},e.prototype.setSelected=function(t){this.option.selected=cE(t)},e.prototype.getValueState=function(t){var e=X0.findPieceIndex(t,this._pieceList);return null!=e&&this.option.selected[this.getSelectedMapKey(this._pieceList[e])]?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var e=[],i=this._pieceList;return this.eachTargetSeries((function(n){var r=[],o=n.getData();o.each(this.getDataDimensionIndex(o),(function(e,n){X0.findPieceIndex(e,i)===t&&r.push(n)}),this),e.push({seriesId:n.id,dataIndex:r})}),this),e},e.prototype.getRepresentValue=function(t){var e;if(this.isCategory())e=t.value;else if(null!=t.value)e=t.value;else{var i=t.interval||[];e=i[0]===-1/0&&i[1]===1/0?0:(i[0]+i[1])/2}return e},e.prototype.getVisualMeta=function(t){if(!this.isCategory()){var e=[],i=["",""],n=this,r=this._pieceList.slice();if(r.length){var o=r[0].interval[0];o!==-1/0&&r.unshift({interval:[-1/0,o]}),(o=r[r.length-1].interval[1])!==1/0&&r.push({interval:[o,1/0]})}else r.push({interval:[-1/0,1/0]});var s=-1/0;return yE(r,(function(t){var e=t.interval;e&&(e[0]>s&&a([s,e[0]],"outOfRange"),a(e.slice()),s=e[1])}),this),{stops:e,outerColors:i}}function a(r,o){var s=n.getRepresentValue({interval:r});o||(o=n.getValueState(s));var a=t(s,o);r[0]===-1/0?i[0]=a:r[1]===1/0?i[1]=a:e.push({value:r[0],color:a},{value:r[1],color:a})}},e.type="visualMap.piecewise",e.defaultOption=GN(oot.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),e}(oot),kot={splitNumber:function(t){var e=this.option,i=Math.min(e.precision,20),n=this.getExtent(),r=e.splitNumber;r=Math.max(parseInt(r,10),1),e.splitNumber=r;for(var o=(n[1]-n[0])/r;+o.toFixed(i)!==o&&i<5;)i++;e.precision=i,o=+o.toFixed(i),e.minOpen&&t.push({interval:[-1/0,n[0]],close:[0,0]});for(var s=0,a=n[0];s<r;a+=o,s++){var l=s===r-1?n[1]:a+o;t.push({interval:[a,l],close:[1,1]})}e.maxOpen&&t.push({interval:[n[1],1/0],close:[0,0]}),jC(t),yE(t,(function(t,e){t.index=e,t.text=this.formatValueText(t.interval)}),this)},categories:function(t){var e=this.option;yE(e.categories,(function(e){t.push({text:this.formatValueText(e,!0),value:e})}),this),Not(e,t)},pieces:function(t){var e=this.option;yE(e.pieces,(function(e,i){CE(e)||(e={value:e});var n={text:"",index:i};if(null!=e.label&&(n.text=e.label),e.hasOwnProperty("value")){var r=n.value=e.value;n.interval=[r,r],n.close=[1,1]}else{for(var o=n.interval=[],s=n.close=[0,0],a=[1,0,1],l=[-1/0,1/0],c=[],u=0;u<2;u++){for(var h=[["gte","gt","min"],["lte","lt","max"]][u],p=0;p<3&&null==o[u];p++)o[u]=e[h[p]],s[u]=a[p],c[u]=2===p;null==o[u]&&(o[u]=l[u])}c[0]&&o[1]===1/0&&(s[0]=0),c[1]&&o[0]===-1/0&&(s[1]=0),"production"!==process.env.NODE_ENV&&o[0]>o[1]&&console.warn("Piece "+i+"is illegal: "+o+" lower bound should not greater then uppper bound."),o[0]===o[1]&&s[0]&&s[1]&&(n.value=o[0])}n.visual=X0.retrieveVisuals(e),t.push(n)}),this),Not(e,t),jC(t),yE(t,(function(t){var e=t.close,i=[["<","≤"][e[1]],[">","≥"][e[0]]];t.text=t.text||this.formatValueText(null!=t.value?t.value:t.interval,!1,i)}),this)}};function Not(t,e){var i=t.inverse;("vertical"===t.orient?!i:i)&&e.reverse()}var Bot=Oot,zot=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.type=e.type,i}return zA(e,t),e.prototype.doRender=function(){var t=this.group;t.removeAll();var e=this.visualMapModel,i=e.get("textGap"),n=e.textStyleModel,r=n.getFont(),o=n.getTextColor(),s=this._getItemAlign(),a=e.itemSize,l=this._getViewData(),c=l.endsText,u=NE(e.get("showLabel",!0),!c);c&&this._renderEndsText(t,c[0],a,u,s),yE(l.viewPieceList,(function(n){var l=n.piece,c=new xC;c.onclick=wE(this._onItemClick,this,l),this._enableHoverLink(c,n.indexInModelPieceList);var h=e.getRepresentValue(l);if(this._createItemSymbol(c,h,[0,0,a[0],a[1]]),u){var p=this.visualMapModel.getValueState(h);c.add(new JD({style:{x:"right"===s?-i:a[0]+i,y:a[1]/2,text:l.text,verticalAlign:"middle",align:s,font:r,fill:o,opacity:"outOfRange"===p?.5:1}}))}t.add(c)}),this),c&&this._renderEndsText(t,c[1],a,u,s),VB(e.get("orient"),t,e.get("itemGap")),this.renderBackground(t),this.positionGroup(t)},e.prototype._enableHoverLink=function(t,e){var i=this;t.on("mouseover",(function(){return n("highlight")})).on("mouseout",(function(){return n("downplay")}));var n=function(t){var n=i.visualMapModel;n.option.hoverLink&&i.api.dispatchAction({type:t,batch:fot(n.findTargetDataIndices(e),n)})}},e.prototype._getItemAlign=function(){var t=this.visualMapModel,e=t.option;if("vertical"===e.orient)return dot(t,this.api,t.itemSize);var i=e.align;return i&&"auto"!==i||(i="left"),i},e.prototype._renderEndsText=function(t,e,i,n,r){if(e){var o=new xC,s=this.visualMapModel.textStyleModel;o.add(new JD({style:mN(s,{x:n?"right"===r?i[0]:0:i[0]/2,y:i[1]/2,verticalAlign:"middle",align:n?r:"center",text:e})})),t.add(o)}},e.prototype._getViewData=function(){var t=this.visualMapModel,e=vE(t.getPieceList(),(function(t,e){return{piece:t,indexInModelPieceList:e}})),i=t.get("text"),n=t.get("orient"),r=t.get("inverse");return("horizontal"===n?r:!r)?e.reverse():i&&(i=i.slice().reverse()),{viewPieceList:e,endsText:i}},e.prototype._createItemSymbol=function(t,e,i){t.add(pG(this.getControllerVisual(e,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(e,"color")))},e.prototype._onItemClick=function(t){var e=this.visualMapModel,i=e.option,n=i.selectedMode;if(n){var r=cE(i.selected),o=e.getSelectedMapKey(t);"single"===n||!0===n?(r[o]=!0,yE(r,(function(t,e){r[e]=e===o}))):r[o]=!r[o],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:r})}},e.type="visualMap.piecewise",e}(hot),Fot=zot;function Vot(t){t.registerComponentModel(Bot),t.registerComponentView(Fot),Dot(t)}var Uot={label:{enabled:!0},decal:{show:!1}},Got=wP(),jot={};function Hot(t,e){var i=t.getModel("aria");if(i.get("enabled")){var n=cE(Uot);uE(n.label,t.getLocaleModel().get("aria"),!1),uE(i.option,n,!1),function(){if(i.getModel("decal").get("show")){var e=YE();t.eachSeries((function(t){if(!t.isColorBySeries()){var i=e.get(t.type);i||(i={},e.set(t.type,i)),Got(t).scope=i}})),t.eachRawSeries((function(e){if(!t.isSeriesFiltered(e))if(SE(e.enableAriaDecal))e.enableAriaDecal();else{var i=e.getData();if(e.isColorBySeries()){var n=wz(e.ecModel,e.name,jot,t.getSeriesCount()),r=i.getVisual("decal");i.setVisual("decal",c(r,n))}else{var o=e.getRawData(),s={},a=Got(e).scope;i.each((function(t){var e=i.getRawIndex(t);s[e]=t}));var l=o.count();o.each((function(t){var n=s[t],r=o.getName(t)||t+"",u=wz(e.ecModel,r,a,l),h=i.getItemVisual(n,"decal");i.setItemVisual(n,"decal",c(h,u))}))}}function c(t,e){var i=t?pE(pE({},e),t):e;return i.dirty=!0,i}}))}}(),function(){var n=t.getLocaleModel().get("aria"),o=i.getModel("label");if(o.option=dE(o.option,n),!o.get("enabled"))return;var s=e.getZr().dom;if(o.get("description"))return void s.setAttribute("aria-label",o.get("description"));var a,l=t.getSeriesCount(),c=o.get(["data","maxCount"])||10,u=o.get(["series","maxCount"])||10,h=Math.min(l,u);if(l<1)return;var p=function(){var e=t.get("title");e&&e.length&&(e=e[0]);return e&&e.text}();a=p?r(o.get(["general","withTitle"]),{title:p}):o.get(["general","withoutTitle"]);var d=[];a+=r(l>1?o.get(["series","multiple","prefix"]):o.get(["series","single","prefix"]),{seriesCount:l}),t.eachSeries((function(e,i){if(i<h){var n=void 0,s=e.get("name")?"withName":"withoutName";n=r(n=l>1?o.get(["series","multiple",s]):o.get(["series","single",s]),{seriesId:e.seriesIndex,seriesName:e.get("name"),seriesType:(_=e.subType,t.getLocaleModel().get(["series","typeNames"])[_]||"自定义图")});var a=e.getData();if(a.count()>c)n+=r(o.get(["data","partialData"]),{displayCnt:c});else n+=o.get(["data","allData"]);for(var u=o.get(["data","separator","middle"]),p=o.get(["data","separator","end"]),f=[],m=0;m<a.count();m++)if(m<c){var g=a.getName(m),y=a.getValues(m),v=o.get(["data",g?"withName":"withoutName"]);f.push(r(v,{name:g,value:y.join(u)}))}n+=f.join(u)+p,d.push(n)}var _}));var f=o.getModel(["series","multiple","separator"]),m=f.get("middle"),g=f.get("end");a+=d.join(m)+g,s.setAttribute("aria-label",a)}()}function r(t,e){if(!ME(t))return t;var i=t;return yE(e,(function(t,e){i=i.replace(new RegExp("\\{\\s*"+e+"\\s*\\}","g"),t)})),i}}function Wot(t){if(t&&t.aria){var e=t.aria;null!=e.show&&(e.enabled=e.show),e.label=e.label||{},yE(["description","general","series","data"],(function(t){null!=e[t]&&(e.label[t]=e[t])}))}}var qot={value:"eq","<":"lt","<=":"lte",">":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},Xot=function(){function t(t){if(null==(this._condVal=ME(t)?new RegExp(t):OE(t)?t:null)){var e="";"production"!==process.env.NODE_ENV&&(e=nP("Illegal regexp",t,"in")),rP(e)}}return t.prototype.evaluate=function(t){var e=typeof t;return ME(e)?this._condVal.test(t):!!IE(e)&&this._condVal.test(t+"")},t}(),Zot=function(){function t(){}return t.prototype.evaluate=function(){return this.value},t}(),Yot=function(){function t(){}return t.prototype.evaluate=function(){for(var t=this.children,e=0;e<t.length;e++)if(!t[e].evaluate())return!1;return!0},t}(),Qot=function(){function t(){}return t.prototype.evaluate=function(){for(var t=this.children,e=0;e<t.length;e++)if(t[e].evaluate())return!0;return!1},t}(),Jot=function(){function t(){}return t.prototype.evaluate=function(){return!this.child.evaluate()},t}(),Kot=function(){function t(){}return t.prototype.evaluate=function(){for(var t=!!this.valueParser,e=(0,this.getValue)(this.valueGetterParam),i=t?this.valueParser(e):null,n=0;n<this.subCondList.length;n++)if(!this.subCondList[n].evaluate(t?i:e))return!1;return!0},t}();function $ot(t,e){if(!0===t||!1===t){var i=new Zot;return i.value=t,i}var n="";return est(t)||("production"!==process.env.NODE_ENV&&(n=nP("Illegal config. Expect a plain object but actually",t)),rP(n)),t.and?tst("and",t,e):t.or?tst("or",t,e):t.not?function(t,e){var i=t.not,n="";"production"!==process.env.NODE_ENV&&(n=nP('"not" condition should only be `not: {}`.',"Illegal condition:",t));est(i)||rP(n);var r=new Jot;r.child=$ot(i,e),r.child||rP(n);return r}(t,e):function(t,e){for(var i="",n=e.prepareGetValue(t),r=[],o=bE(t),s=t.parser,a=s?GF(s):null,l=0;l<o.length;l++){var c=o[l];if("parser"!==c&&!e.valueGetterAttrMap.get(c)){var u=$E(qot,c)?qot[c]:c,h=t[c],p=a?a(h):h,d=XF(u,p)||"reg"===u&&new Xot(p);d||("production"!==process.env.NODE_ENV&&(i=nP('Illegal relational operation: "'+c+'" in condition:',t)),rP(i)),r.push(d)}}r.length||("production"!==process.env.NODE_ENV&&(i=nP("Relational condition must have at least one operator.","Illegal condition:",t)),rP(i));var f=new Kot;return f.valueGetterParam=n,f.valueParser=a,f.getValue=e.getValue,f.subCondList=r,f}(t,e)}function tst(t,e,i){var n=e[t],r="";"production"!==process.env.NODE_ENV&&(r=nP('"and"/"or" condition should only be `'+t+": [...]` and must not be empty array.","Illegal condition:",e)),EE(n)||rP(r),n.length||rP(r);var o="and"===t?new Yot:new Qot;return o.children=vE(n,(function(t){return $ot(t,i)})),o.children.length||rP(r),o}function est(t){return CE(t)&&!gE(t)}var ist=function(){function t(t,e){this._cond=$ot(t,e)}return t.prototype.evaluate=function(){return this._cond.evaluate()},t}();var nst={type:"echarts:filter",transform:function(t){for(var e,i,n,r=t.upstream,o=(i=t.config,n={valueGetterAttrMap:YE({dimension:!0}),prepareGetValue:function(t){var e="",i=t.dimension;$E(t,"dimension")||("production"!==process.env.NODE_ENV&&(e=nP('Relation condition must has prop "dimension" specified.',"Illegal condition:",t)),rP(e));var n=r.getDimensionInfo(i);return n||("production"!==process.env.NODE_ENV&&(e=nP("Can not find dimension info via: "+i+".\n","Existing dimensions: ",r.cloneAllDimensionInfo(),".\n","Illegal condition:",t,".\n")),rP(e)),{dimIdx:n.index}},getValue:function(t){return r.retrieveValueFromItem(e,t.dimIdx)}},new ist(i,n)),s=[],a=0,l=r.count();a<l;a++)e=r.getRawDataItem(a),o.evaluate()&&s.push(e);return{data:s}}},rst="";"production"!==process.env.NODE_ENV&&(rst=["Valid config is like:",'{ dimension: "age", order: "asc" }','or [{ dimension: "age", order: "asc"], { dimension: "date", order: "desc" }]'].join(" "));var ost={type:"echarts:sort",transform:function(t){var e=t.upstream,i=t.config,n="",r=lP(i);r.length||("production"!==process.env.NODE_ENV&&(n="Empty `config` in sort transform."),rP(n));var o=[];yE(r,(function(t){var i=t.dimension,r=t.order,s=t.parser,a=t.incomparable;if(null==i&&("production"!==process.env.NODE_ENV&&(n='Sort transform config must has "dimension" specified.'+rst),rP(n)),"asc"!==r&&"desc"!==r&&("production"!==process.env.NODE_ENV&&(n='Sort transform config must has "order" specified.'+rst),rP(n)),a&&"min"!==a&&"max"!==a){var l="";"production"!==process.env.NODE_ENV&&(l='incomparable must be "min" or "max" rather than "'+a+'".'),rP(l)}if("asc"!==r&&"desc"!==r){var c="";"production"!==process.env.NODE_ENV&&(c='order must be "asc" or "desc" rather than "'+r+'".'),rP(c)}var u=e.getDimensionInfo(i);u||("production"!==process.env.NODE_ENV&&(n=nP("Can not find dimension info via: "+i+".\n","Existing dimensions: ",e.cloneAllDimensionInfo(),".\n","Illegal config:",t,".\n")),rP(n));var h=s?GF(s):null;s&&!h&&("production"!==process.env.NODE_ENV&&(n=nP("Invalid parser name "+s+".\n","Illegal config:",t,".\n")),rP(n)),o.push({dimIdx:u.index,parser:h,comparator:new WF(r,a)})}));var s=e.sourceFormat;s!==ez&&s!==iz&&("production"!==process.env.NODE_ENV&&(n='sourceFormat "'+s+'" is not supported yet'),rP(n));for(var a=[],l=0,c=e.count();l<c;l++)a.push(e.getRawDataItem(l));return a.sort((function(t,i){for(var n=0;n<o.length;n++){var r=o[n],s=e.retrieveValueFromItem(t,r.dimIdx),a=e.retrieveValueFromItem(i,r.dimIdx);r.parser&&(s=r.parser(s),a=r.parser(a));var l=r.comparator.evaluate(s,a);if(0!==l)return l}return 0})),{data:a}}};var sst=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dataset",e}return zA(e,t),e.prototype.init=function(e,i,n){t.prototype.init.call(this,e,i,n),this._sourceManager=new pV(this),dV(this)},e.prototype.mergeOption=function(e,i){t.prototype.mergeOption.call(this,e,i),dV(this)},e.prototype.optionUpdated=function(){this._sourceManager.dirty()},e.prototype.getSourceManager=function(){return this._sourceManager},e.type="dataset",e.defaultOption={seriesLayoutBy:sz},e}(YB),ast=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dataset",e}return zA(e,t),e.type="dataset",e}(qV);var lst=KL.CMD;function cst(t,e){return Math.abs(t-e)<1e-5}function ust(t){var e,i,n,r,o,s=t.data,a=t.len(),l=[],c=0,u=0,h=0,p=0;function d(t,i){e&&e.length>2&&l.push(e),e=[t,i]}function f(t,i,n,r){cst(t,n)&&cst(i,r)||e.push(t,i,n,r,n,r)}function m(t,i,n,r,o,s){var a=Math.abs(i-t),l=4*Math.tan(a/4)/3,c=i<t?-1:1,u=Math.cos(t),h=Math.sin(t),p=Math.cos(i),d=Math.sin(i),f=u*o+n,m=h*s+r,g=p*o+n,y=d*s+r,v=o*l*c,_=s*l*c;e.push(f-v*h,m+_*u,g+v*d,y-_*p,g,y)}for(var g=0;g<a;){var y=s[g++],v=1===g;switch(v&&(h=c=s[g],p=u=s[g+1],y!==lst.L&&y!==lst.C&&y!==lst.Q||(e=[h,p])),y){case lst.M:c=h=s[g++],u=p=s[g++],d(h,p);break;case lst.L:f(c,u,i=s[g++],n=s[g++]),c=i,u=n;break;case lst.C:e.push(s[g++],s[g++],s[g++],s[g++],c=s[g++],u=s[g++]);break;case lst.Q:i=s[g++],n=s[g++],r=s[g++],o=s[g++],e.push(c+2/3*(i-c),u+2/3*(n-u),r+2/3*(i-r),o+2/3*(n-o),r,o),c=r,u=o;break;case lst.A:var _=s[g++],x=s[g++],b=s[g++],w=s[g++],A=s[g++],E=s[g++]+A;g+=1;var S=!s[g++];i=Math.cos(A)*b+_,n=Math.sin(A)*w+x,v?d(h=i,p=n):f(c,u,i,n),c=Math.cos(E)*b+_,u=Math.sin(E)*w+x;for(var M=(S?-1:1)*Math.PI/2,T=A;S?T>E:T<E;T+=M){m(T,S?Math.max(T+M,E):Math.min(T+M,E),_,x,b,w)}break;case lst.R:h=c=s[g++],p=u=s[g++],i=h+s[g++],n=p+s[g++],d(i,p),f(i,p,i,n),f(i,n,h,n),f(h,n,h,p),f(h,p,i,p);break;case lst.Z:e&&f(c,u,h,p),c=h,u=p}}return e&&e.length>2&&l.push(e),l}function hst(t,e,i,n,r,o,s,a,l,c){if(cst(t,i)&&cst(e,n)&&cst(r,s)&&cst(o,a))l.push(s,a);else{var u=2/c,h=u*u,p=s-t,d=a-e,f=Math.sqrt(p*p+d*d);p/=f,d/=f;var m=i-t,g=n-e,y=r-s,v=o-a,_=m*m+g*g,x=y*y+v*v;if(_<h&&x<h)l.push(s,a);else{var b=p*m+d*g,w=-p*y-d*v;if(_-b*b<h&&b>=0&&x-w*w<h&&w>=0)l.push(s,a);else{var A=[],E=[];nT(t,i,r,s,.5,A),nT(e,n,o,a,.5,E),hst(A[0],E[0],A[1],E[1],A[2],E[2],A[3],E[3],l,c),hst(A[4],E[4],A[5],E[5],A[6],E[6],A[7],E[7],l,c)}}}}function pst(t,e,i){var n=t[e],r=t[1-e],o=Math.abs(n/r),s=Math.ceil(Math.sqrt(o*i)),a=Math.floor(i/s);0===a&&(a=1,s=i);for(var l=[],c=0;c<s;c++)l.push(a);var u=i-s*a;if(u>0)for(c=0;c<u;c++)l[c%s]+=1;return l}function dst(t,e,i){for(var n=t.r0,r=t.r,o=t.startAngle,s=t.endAngle,a=Math.abs(s-o),l=a*r,c=r-n,u=l>Math.abs(c),h=pst([l,c],u?0:1,e),p=(u?a:c)/h.length,d=0;d<h.length;d++)for(var f=(u?c:a)/h[d],m=0;m<h[d];m++){var g={};u?(g.startAngle=o+p*d,g.endAngle=o+p*(d+1),g.r0=n+f*m,g.r=n+f*(m+1)):(g.startAngle=o+f*m,g.endAngle=o+f*(m+1),g.r0=n+p*d,g.r=n+p*(d+1)),g.clockwise=t.clockwise,g.cx=t.cx,g.cy=t.cy,i.push(g)}}function fst(t,e,i,n){return t*n-i*e}function mst(t,e,i,n,r,o,s,a){var l=i-t,c=n-e,u=s-r,h=a-o,p=fst(u,h,l,c);if(Math.abs(p)<1e-6)return null;var d=fst(t-r,e-o,u,h)/p;return d<0||d>1?null:new iM(d*l+t,d*c+e)}function gst(t,e,i){var n=new iM;iM.sub(n,i,e),n.normalize();var r=new iM;return iM.sub(r,t,e),r.dot(n)}function yst(t,e){var i=t[t.length-1];i&&i[0]===e[0]&&i[1]===e[1]||t.push(e)}function vst(t){var e=t.points,i=[],n=[];SL(e,i,n);var r=new pM(i[0],i[1],n[0]-i[0],n[1]-i[1]),o=r.width,s=r.height,a=r.x,l=r.y,c=new iM,u=new iM;return o>s?(c.x=u.x=a+o/2,c.y=l,u.y=l+s):(c.y=u.y=l+s/2,c.x=a,u.x=a+o),function(t,e,i){for(var n=t.length,r=[],o=0;o<n;o++){var s=t[o],a=t[(o+1)%n],l=mst(s[0],s[1],a[0],a[1],e.x,e.y,i.x,i.y);l&&r.push({projPt:gst(l,e,i),pt:l,idx:o})}if(r.length<2)return[{points:t},{points:t}];r.sort((function(t,e){return t.projPt-e.projPt}));var c=r[0],u=r[r.length-1];if(u.idx<c.idx){var h=c;c=u,u=h}var p=[c.pt.x,c.pt.y],d=[u.pt.x,u.pt.y],f=[p],m=[d];for(o=c.idx+1;o<=u.idx;o++)yst(f,t[o].slice());for(yst(f,d),yst(f,p),o=u.idx+1;o<=c.idx+n;o++)yst(m,t[o%n].slice());return yst(m,p),yst(m,d),[{points:f},{points:m}]}(e,c,u)}function _st(t,e,i,n){if(1===i)n.push(e);else{var r=Math.floor(i/2),o=t(e);_st(t,o[0],r,n),_st(t,o[1],i-r,n)}return n}function xst(t,e){e.setStyle(t.style),e.z=t.z,e.z2=t.z2,e.zlevel=t.zlevel}function bst(t,e){var i,n=[],r=t.shape;switch(t.type){case"rect":!function(t,e,i){for(var n=t.width,r=t.height,o=n>r,s=pst([n,r],o?0:1,e),a=o?"width":"height",l=o?"height":"width",c=o?"x":"y",u=o?"y":"x",h=t[a]/s.length,p=0;p<s.length;p++)for(var d=t[l]/s[p],f=0;f<s[p];f++){var m={};m[c]=p*h,m[u]=f*d,m[a]=h,m[l]=d,m.x+=t.x,m.y+=t.y,i.push(m)}}(r,e,n),i=kD;break;case"sector":dst(r,e,n),i=jO;break;case"circle":dst({r0:0,r:r.r,startAngle:0,endAngle:2*Math.PI,cx:r.cx,cy:r.cy},e,n),i=jO;break;default:var o=t.getComputedTransform(),s=o?Math.sqrt(Math.max(o[0]*o[0]+o[1]*o[1],o[2]*o[2]+o[3]*o[3])):1,a=vE(function(t,e){var i=ust(t),n=[];e=e||1;for(var r=0;r<i.length;r++){var o=i[r],s=[],a=o[0],l=o[1];s.push(a,l);for(var c=2;c<o.length;){var u=o[c++],h=o[c++],p=o[c++],d=o[c++],f=o[c++],m=o[c++];hst(a,l,u,h,p,d,f,m,s,e),a=f,l=m}n.push(s)}return n}(t.getUpdatedPathProxy(),s),(function(t){return function(t){for(var e=[],i=0;i<t.length;)e.push([t[i++],t[i++]]);return e}(t)})),l=a.length;if(0===l)_st(vst,{points:a[0]},e,n);else if(l===e)for(var c=0;c<l;c++)n.push({points:a[c]});else{var u=0,h=vE(a,(function(t){var e=[],i=[];SL(t,e,i);var n=(i[1]-e[1])*(i[0]-e[0]);return u+=n,{poly:t,area:n}}));h.sort((function(t,e){return e.area-t.area}));var p=e;for(c=0;c<l;c++){var d=h[c];if(p<=0)break;var f=c===l-1?p:Math.ceil(d.area/u*e);f<0||(_st(vst,{points:d.poly},f,n),p-=f)}}i=QO}if(!i)return function(t,e){for(var i=[],n=0;n<e;n++)i.push(bO(t));return i}(t,e);var m=[];for(c=0;c<n.length;c++){var g=new i;g.setShape(n[c]),xst(t,g),m.push(g)}return m}function wst(t,e){var i=t.length,n=e.length;if(i===n)return[t,e];for(var r=[],o=[],s=i<n?t:e,a=Math.min(i,n),l=Math.abs(n-i)/6,c=(a-2)/6,u=Math.ceil(l/c)+1,h=[s[0],s[1]],p=l,d=2;d<a;){var f=s[d-2],m=s[d-1],g=s[d++],y=s[d++],v=s[d++],_=s[d++],x=s[d++],b=s[d++];if(p<=0)h.push(g,y,v,_,x,b);else{for(var w=Math.min(p,u-1)+1,A=1;A<=w;A++){var E=A/w;nT(f,g,v,x,E,r),nT(m,y,_,b,E,o),f=r[3],m=o[3],h.push(r[1],o[1],r[2],o[2],f,m),g=r[5],y=o[5],v=r[6],_=o[6]}p-=w-1}}return s===t?[h,e]:[t,h]}function Ast(t,e){for(var i=t.length,n=t[i-2],r=t[i-1],o=[],s=0;s<e.length;)o[s++]=n,o[s++]=r;return o}function Est(t){for(var e=0,i=0,n=0,r=t.length,o=0,s=r-2;o<r;s=o,o+=2){var a=t[s],l=t[s+1],c=t[o],u=t[o+1],h=a*u-c*l;e+=h,i+=(a+c)*h,n+=(l+u)*h}return 0===e?[t[0]||0,t[1]||0]:[i/e/3,n/e/3,e]}function Sst(t,e,i,n){for(var r=(t.length-2)/6,o=1/0,s=0,a=t.length,l=a-2,c=0;c<r;c++){for(var u=6*c,h=0,p=0;p<a;p+=2){var d=0===p?u:(u+p-2)%l+2,f=t[d]-i[0],m=t[d+1]-i[1],g=e[p]-n[0]-f,y=e[p+1]-n[1]-m;h+=g*g+y*y}h<o&&(o=h,s=c)}return s}function Mst(t){for(var e=[],i=t.length,n=0;n<i;n+=2)e[n]=t[i-n-2],e[n+1]=t[i-n-1];return e}function Tst(t){return t.__isCombineMorphing}var Ist="__mOriginal_";function Cst(t,e,i){var n=Ist+e,r=t[n]||t[e];t[n]||(t[n]=t[e]);var o=i.replace,s=i.after,a=i.before;t[e]=function(){var t,e=arguments;return a&&a.apply(this,e),t=o?o.apply(this,e):r.apply(this,e),s&&s.apply(this,e),t}}function Pst(t,e){var i=Ist+e;t[i]&&(t[e]=t[i],t[i]=null)}function Lst(t,e){for(var i=0;i<t.length;i++)for(var n=t[i],r=0;r<n.length;){var o=n[r],s=n[r+1];n[r++]=e[0]*o+e[2]*s+e[4],n[r++]=e[1]*o+e[3]*s+e[5]}}function Dst(t,e){var i=t.getUpdatedPathProxy(),n=e.getUpdatedPathProxy(),r=function(t,e){for(var i,n,r,o=[],s=[],a=0;a<Math.max(t.length,e.length);a++){var l=t[a],c=e[a],u=void 0,h=void 0;l?c?(n=u=(i=wst(l,c))[0],r=h=i[1]):(h=Ast(r||l,l),u=l):(u=Ast(n||c,c),h=c),o.push(u),s.push(h)}return[o,s]}(ust(i),ust(n)),o=r[0],s=r[1],a=t.getComputedTransform(),l=e.getComputedTransform();a&&Lst(o,a),l&&Lst(s,l),Cst(e,"updateTransform",{replace:function(){this.transform=null}}),e.transform=null;var c=function(t,e,i,n){for(var r,o=[],s=0;s<t.length;s++){var a=t[s],l=e[s],c=Est(a),u=Est(l);null==r&&(r=c[2]<0!=u[2]<0);var h=[],p=[],d=0,f=1/0,m=[],g=a.length;r&&(a=Mst(a));for(var y=6*Sst(a,l,c,u),v=g-2,_=0;_<v;_+=2){var x=(y+_)%v+2;h[_+2]=a[x]-c[0],h[_+3]=a[x+1]-c[1]}if(h[0]=a[y]-c[0],h[1]=a[y+1]-c[1],i>0)for(var b=n/i,w=-n/2;w<=n/2;w+=b){var A=Math.sin(w),E=Math.cos(w),S=0;for(_=0;_<a.length;_+=2){var M=h[_],T=h[_+1],I=l[_]-u[0],C=l[_+1]-u[1],P=I*E-C*A,L=I*A+C*E;m[_]=P,m[_+1]=L;var D=P-M,R=L-T;S+=D*D+R*R}if(S<f){f=S,d=w;for(var O=0;O<m.length;O++)p[O]=m[O]}}else for(var k=0;k<g;k+=2)p[k]=l[k]-u[0],p[k+1]=l[k+1]-u[1];o.push({from:h,to:p,fromCp:c,toCp:u,rotation:-d})}return o}(o,s,10,Math.PI),u=[];Cst(e,"buildPath",{replace:function(t){for(var i=e.__morphT,n=1-i,r=[],o=0;o<c.length;o++){var s=c[o],a=s.from,l=s.to,h=s.rotation*i,p=s.fromCp,d=s.toCp,f=Math.sin(h),m=Math.cos(h);mS(r,p,d,i);for(var g=0;g<a.length;g+=2){var y=a[g],v=a[g+1],_=y*n+(A=l[g])*i,x=v*n+(E=l[g+1])*i;u[g]=_*m-x*f+r[0],u[g+1]=_*f+x*m+r[1]}var b=u[0],w=u[1];t.moveTo(b,w);for(g=2;g<a.length;){var A=u[g++],E=u[g++],S=u[g++],M=u[g++],T=u[g++],I=u[g++];b===A&&w===E&&S===T&&M===I?t.lineTo(T,I):t.bezierCurveTo(A,E,S,M,T,I),b=T,w=I}}}})}function Rst(t,e,i){if(!t||!e)return e;var n=i.done,r=i.during;return Dst(t,e),e.__morphT=0,e.animateTo({__morphT:1},dE({during:function(t){e.dirtyShape(),r&&r(t)},done:function(){Pst(e,"buildPath"),Pst(e,"updateTransform"),e.__morphT=-1,e.createPathProxy(),e.dirtyShape(),n&&n()}},i)),e}function Ost(t,e,i,n,r,o){t=r===i?0:Math.round(32767*(t-i)/(r-i)),e=o===n?0:Math.round(32767*(e-n)/(o-n));for(var s,a=0,l=32768;l>0;l/=2){var c=0,u=0;(t&l)>0&&(c=1),(e&l)>0&&(u=1),a+=l*l*(3*c^u),0===u&&(1===c&&(t=l-1-t,e=l-1-e),s=t,t=e,e=s)}return a}function kst(t){var e=1/0,i=1/0,n=-1/0,r=-1/0,o=vE(t,(function(t){var o=t.getBoundingRect(),s=t.getComputedTransform(),a=o.x+o.width/2+(s?s[4]:0),l=o.y+o.height/2+(s?s[5]:0);return e=Math.min(a,e),i=Math.min(l,i),n=Math.max(a,n),r=Math.max(l,r),[a,l]}));return vE(o,(function(o,s){return{cp:o,z:Ost(o[0],o[1],e,i,n,r),path:t[s]}})).sort((function(t,e){return t.z-e.z})).map((function(t){return t.path}))}function Nst(t){return bst(t.path,t.count)}function Bst(t){return EE(t[0])}function zst(t,e){for(var i=[],n=t.length,r=0;r<n;r++)i.push({one:t[r],many:[]});for(r=0;r<e.length;r++){var o=e[r].length,s=void 0;for(s=0;s<o;s++)i[s%n].many.push(e[r][s])}var a=0;for(r=n-1;r>=0;r--)if(!i[r].many.length){var l=i[a].many;if(l.length<=1){if(!a)return i;a=0}o=l.length;var c=Math.ceil(o/2);i[r].many=l.slice(c,o),i[a].many=l.slice(0,c),a++}return i}var Fst={clone:function(t){for(var e=[],i=1-Math.pow(1-t.path.style.opacity,1/t.count),n=0;n<t.count;n++){var r=bO(t.path);r.setStyle("opacity",i),e.push(r)}return e},split:null};function Vst(t,e,i,n,r,o){if(t.length&&e.length){var s=Ik("update",n,r);if(s&&s.duration>0){var a,l,c=n.getModel("universalTransition").get("delay"),u=Object.assign({setToFinal:!0},s);Bst(t)&&(a=t,l=e),Bst(e)&&(a=e,l=t);for(var h=a?a===t:t.length>e.length,p=a?zst(l,a):zst(h?e:t,[h?t:e]),d=0,f=0;f<p.length;f++)d+=p[f].many.length;var m=0;for(f=0;f<p.length;f++)g(p[f],h,m,d),m+=p[f].many.length}}function g(t,e,n,r,s){var a=t.many,l=t.one;if(1!==a.length||s)for(var h=dE({dividePath:Fst[i],individualDelay:c&&function(t,e,i,o){return c(t+n,r)}},u),p=e?function(t,e,i){var n=[];!function t(e){for(var i=0;i<e.length;i++){var r=e[i];Tst(r)?t(r.childrenRef()):r instanceof xD&&n.push(r)}}(t);var r=n.length;if(!r)return{fromIndividuals:[],toIndividuals:[],count:0};var o=(i.dividePath||Nst)({path:e,count:r});if(o.length!==r)return console.error("Invalid morphing: unmatched splitted path"),{fromIndividuals:[],toIndividuals:[],count:0};n=kst(n),o=kst(o);for(var s=i.done,a=i.during,l=i.individualDelay,c=new KI,u=0;u<r;u++){var h=n[u],p=o[u];p.parent=e,p.copyTransform(c),l||Dst(h,p)}function d(t){for(var e=0;e<o.length;e++)o[e].addSelfToZr(t)}function f(){e.__isCombineMorphing=!1,e.__morphT=-1,e.childrenRef=null,Pst(e,"addSelfToZr"),Pst(e,"removeSelfFromZr")}e.__isCombineMorphing=!0,e.childrenRef=function(){return o},Cst(e,"addSelfToZr",{after:function(t){d(t)}}),Cst(e,"removeSelfFromZr",{after:function(t){for(var e=0;e<o.length;e++)o[e].removeSelfFromZr(t)}});var m=o.length;if(l){var g=m,y=function(){0==--g&&(f(),s&&s())};for(u=0;u<m;u++){var v=l?dE({delay:(i.delay||0)+l(u,m,n[u],o[u]),done:y},i):i;Rst(n[u],o[u],v)}}else e.__morphT=0,e.animateTo({__morphT:1},dE({during:function(t){for(var i=0;i<m;i++){var n=o[i];n.__morphT=e.__morphT,n.dirtyShape()}a&&a(t)},done:function(){f();for(var e=0;e<t.length;e++)Pst(t[e],"updateTransform");s&&s()}},i));return e.__zr&&d(e.__zr),{fromIndividuals:n,toIndividuals:o,count:m}}(a,l,h):function(t,e,i){var n=e.length,r=[],o=i.dividePath||Nst;if(Tst(t)){!function t(e){for(var i=0;i<e.length;i++){var n=e[i];Tst(n)?t(n.childrenRef()):n instanceof xD&&r.push(n)}}(t.childrenRef());var s=r.length;if(s<n)for(var a=0,l=s;l<n;l++)r.push(bO(r[a++%s]));r.length=n}else{r=o({path:t,count:n});var c=t.getComputedTransform();for(l=0;l<r.length;l++)r[l].setLocalTransform(c);if(r.length!==n)return console.error("Invalid morphing: unmatched splitted path"),{fromIndividuals:[],toIndividuals:[],count:0}}r=kst(r),e=kst(e);var u=i.individualDelay;for(l=0;l<n;l++){var h=u?dE({delay:(i.delay||0)+u(l,n,r[l],e[l])},i):i;Rst(r[l],e[l],h)}return{fromIndividuals:r,toIndividuals:e,count:e.length}}(l,a,h),d=p.fromIndividuals,f=p.toIndividuals,m=d.length,y=0;y<m;y++){v=c?dE({delay:c(y,m)},u):u;o(d[y],f[y],e?a[y]:t.one,e?t.one:a[y],v)}else{var v,_=e?a[0]:l,x=e?l:a[0];if(Tst(_))g({many:[_],one:x},!0,n,r,!0);else Rst(_,x,v=c?dE({delay:c(n,r)},u):u),o(_,x,_,x,v)}}}function Ust(t){if(!t)return[];if(EE(t)){for(var e=[],i=0;i<t.length;i++)e.push(Ust(t[i]));return e}var n=[];return t.traverse((function(t){t instanceof xD&&!t.disableMorphing&&!t.invisible&&!t.ignore&&n.push(t)})),n}var Gst=1e4,jst=wP();function Hst(t){var e=[];return yE(t,(function(t){var i=t.data;if(i.count()>Gst)"production"!==process.env.NODE_ENV&&$C("Universal transition is disabled on large data > 10k.");else for(var n=i.getIndices(),r=function(t){for(var e=t.dimensions,i=0;i<e.length;i++){var n=t.getDimensionInfo(e[i]);if(n&&0===n.otherDims.itemGroupId)return e[i]}}(i),o=0;o<n.length;o++)e.push({dataGroupId:t.dataGroupId,data:i,dim:t.dim||r,divide:t.divide,dataIndex:o})})),e}function Wst(t,e,i){t.traverse((function(t){t instanceof xD&&Lk(t,{style:{opacity:0}},e,{dataIndex:i,isFrom:!0})}))}function qst(t){if(t.parent){var e=t.getComputedTransform();t.setLocalTransform(e),t.parent.remove(t)}}function Xst(t){t.stopAnimation(),t.isGroup&&t.traverse((function(t){t.stopAnimation()}))}function Zst(t,e,i){var n=Ik("update",i,e);n&&t.traverse((function(t){if(t instanceof gL){var e=function(t){return Tk(t).oldStyle}(t);e&&t.animateFrom({style:e},n)}}))}function Yst(t,e,i){var n=Hst(t),r=Hst(e);function o(t,e,i,n,r){(i||t)&&e.animateFrom({style:i&&i!==t?pE(pE({},i.style),t.style):t.style},r)}function s(t){for(var e=0;e<t.length;e++)if(t[e].dim)return t[e].dim}var a=s(n),l=s(r),c=!1;function u(t,e){return function(i){var n=i.data,r=i.dataIndex;if(e)return n.getId(r);var o=i.dataGroupId,s=t?a||l:l||a,c=s&&n.getDimensionInfo(s),u=c&&c.ordinalMeta;if(c){var h=n.get(c.name,r);return u&&u.categories[h]||h+""}var p=n.getRawDataItem(r);return p&&p.groupId?p.groupId+"":o||n.getId(r)}}var h=function(t,e){var i=t.length;if(i!==e.length)return!1;for(var n=0;n<i;n++){var r=t[n],o=e[n];if(r.data.getId(r.dataIndex)!==o.data.getId(o.dataIndex))return!1}return!0}(n,r),p={};if(!h)for(var d=0;d<r.length;d++){var f=r[d],m=f.data.getItemGraphicEl(f.dataIndex);m&&(p[m.id]=!0)}function g(t,e){var i=n[e],s=r[t],a=s.data.hostModel,l=i.data.getItemGraphicEl(i.dataIndex),u=s.data.getItemGraphicEl(s.dataIndex);l!==u?l&&p[l.id]||u&&(Xst(u),l?(Xst(l),qst(l),c=!0,Vst(Ust(l),Ust(u),s.divide,a,t,o)):Wst(u,a,t)):u&&Zst(u,s.dataIndex,a)}new oH(n,r,u(!0,h),u(!1,h),null,"multiple").update(g).updateManyToOne((function(t,e){var i=r[t],s=i.data,a=s.hostModel,l=s.getItemGraphicEl(i.dataIndex),u=xE(vE(e,(function(t){return n[t].data.getItemGraphicEl(n[t].dataIndex)})),(function(t){return t&&t!==l&&!p[t.id]}));l&&(Xst(l),u.length?(yE(u,(function(t){Xst(t),qst(t)})),c=!0,Vst(Ust(u),Ust(l),i.divide,a,t,o)):Wst(l,a,i.dataIndex))})).updateOneToMany((function(t,e){var i=n[e],s=i.data.getItemGraphicEl(i.dataIndex);if(!s||!p[s.id]){var a=xE(vE(t,(function(t){return r[t].data.getItemGraphicEl(r[t].dataIndex)})),(function(t){return t&&t!==s})),l=r[t[0]].data.hostModel;a.length&&(yE(a,(function(t){return Xst(t)})),s?(Xst(s),qst(s),c=!0,Vst(Ust(s),Ust(a),i.divide,l,t[0],o)):yE(a,(function(e){return Wst(e,l,t[0])})))}})).updateManyToMany((function(t,e){new oH(e,t,(function(t){return n[t].data.getId(n[t].dataIndex)}),(function(t){return r[t].data.getId(r[t].dataIndex)})).update((function(i,n){g(t[i],e[n])})).execute()})).execute(),c&&yE(e,(function(t){var e=t.data.hostModel,n=e&&i.getViewOfSeriesModel(e),r=Ik("update",e,0);n&&e.isAnimationEnabled()&&r&&r.duration>0&&n.group.traverse((function(t){t instanceof xD&&!t.animators.length&&t.animateFrom({style:{opacity:0}},r)}))}))}function Qst(t){var e=t.getModel("universalTransition").get("seriesKey");return e||t.id}function Jst(t){return EE(t)?t.sort().join(","):t}function Kst(t){if(t.hostModel)return t.hostModel.getModel("universalTransition").get("divideShape")}function $st(t,e){for(var i=0;i<t.length;i++){if(null!=e.seriesIndex&&e.seriesIndex===t[i].seriesIndex||null!=e.seriesId&&e.seriesId===t[i].id)return i}}eH([function(t){t.registerPainter("canvas",DZ)}]),eH([function(t){t.registerPainter("svg",EZ)}]),eH([function(t){t.registerChartView(gY),t.registerSeriesModel(OZ),t.registerLayout(yY("line",!0)),t.registerVisual({seriesType:"line",reset:function(t){var e=t.getData(),i=t.getModel("lineStyle").getLineStyle();i&&!i.stroke&&(i.stroke=e.getVisual("style").fill),e.setVisual("legendLineStyle",i)}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,xY("line"))},function(t){t.registerChartView(YY),t.registerSeriesModel(EY),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,AE(fW,"bar")),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,mW("bar")),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,xY("bar")),t.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},(function(t,e){var i=t.componentType||"series";e.eachComponent({mainType:i,query:t},(function(e){t.sortInfo&&e.axis.setCategorySortInfo(t.sortInfo)}))}))},function(t){t.registerChartView(cQ),t.registerSeriesModel(mQ),JU("pie",t.registerAction),t.registerLayout(AE(tQ,"pie")),t.registerProcessor(eQ("pie")),t.registerProcessor(function(t){return{seriesType:t,reset:function(t,e){var i=t.getData();i.filterSelf((function(t){var e=i.mapDimension("value"),n=i.get(e,t);return!(IE(n)&&!isNaN(n)&&n<0)}))}}}("pie"))},function(t){eH(AJ),t.registerSeriesModel(yQ),t.registerChartView(AQ),t.registerLayout(yY("scatter"))},function(t){eH(jJ),t.registerChartView(CJ),t.registerSeriesModel(LJ),t.registerLayout(EJ),t.registerProcessor(eQ("radar")),t.registerPreprocessor(TJ)},function(t){eH(A$),t.registerChartView($K),t.registerSeriesModel(e$),t.registerLayout(n$),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,i$),JU("map",t.registerAction)},function(t){t.registerChartView(G$),t.registerSeriesModel(s0),t.registerLayout(l0),t.registerVisual(c0),function(t){t.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},(function(t,e){e.eachComponent({mainType:"series",subType:"tree",query:t},(function(e){var i=t.dataIndex,n=e.getData().tree.getNodeByDataIndex(i);n.isExpand=!n.isExpand}))})),t.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},(function(t,e,i){e.eachComponent({mainType:"series",subType:"tree",query:t},(function(e){var n=_$(e.coordinateSystem,t,void 0,i);e.setCenter&&e.setCenter(n.center),e.setZoom&&e.setZoom(n.zoom)}))}))}(t)},function(t){t.registerSeriesModel(f0),t.registerChartView(L0),t.registerVisual(Y0),t.registerLayout(l1),function(t){for(var e=0;e<u0.length;e++)t.registerAction({type:u0[e],update:"updateView"},tS);t.registerAction({type:"treemapRootToNode",update:"updateView"},(function(t,e){e.eachComponent({mainType:"series",subType:"treemap",query:t},(function(e,i){var n=e0(t,["treemapZoomToNode","treemapRootToNode"],e);if(n){var r=e.getViewRoot();r&&(t.direction=n0(r,n.node)?"rollUp":"drillDown"),e.resetViewRoot(n.node)}}))}))}(t)},function(t){t.registerChartView(f2),t.registerSeriesModel(A2),t.registerProcessor(f1),t.registerVisual(m1),t.registerVisual(y1),t.registerLayout(C1),t.registerLayout(t.PRIORITY.VISUAL.POST_CHART_LAYOUT,B1),t.registerLayout(F1),t.registerCoordinateSystem("graphView",{dimensions:a$.dimensions,create:V1}),t.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},tS),t.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},tS),t.registerAction(E2,(function(t,e,i){e.eachComponent({mainType:"series",query:t},(function(e){var n=_$(e.coordinateSystem,t,void 0,i);e.setCenter&&e.setCenter(n.center),e.setZoom&&e.setZoom(n.zoom)}))}))},function(t){t.registerChartView(P2),t.registerSeriesModel(D2)},function(t){t.registerChartView(N2),t.registerSeriesModel(z2),t.registerLayout(F2),t.registerProcessor(eQ("funnel"))},function(t){eH(A5),t.registerChartView(W2),t.registerSeriesModel(Z2),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,Q2)},function(t){t.registerChartView(I5),t.registerSeriesModel(P5),t.registerLayout(L5),t.registerVisual(j5),t.registerAction({type:"dragNode",event:"dragnode",update:"update"},(function(t,e){e.eachComponent({mainType:"series",subType:"sankey",query:t},(function(e){e.setNodePosition(t.dataIndex,[t.localX,t.localY])}))}))},function(t){t.registerSeriesModel(q5),t.registerChartView($5),t.registerLayout(e4),t.registerTransform(i4)},function(t){t.registerChartView(m4),t.registerSeriesModel(y4),t.registerPreprocessor(v4),t.registerVisual(S4),t.registerLayout(I4)},function(t){t.registerChartView(R4),t.registerSeriesModel(k4),t.registerLayout(yY("effectScatter"))},function(t){t.registerChartView(Z4),t.registerSeriesModel($4),t.registerLayout(q4),t.registerVisual(e6)},function(t){t.registerChartView(s6),t.registerSeriesModel(l6)},function(t){t.registerChartView(P6),t.registerSeriesModel(D6),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,AE(fW,"pictorialBar")),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,mW("pictorialBar"))},function(t){t.registerChartView(O6),t.registerSeriesModel(N6),t.registerLayout(B6),t.registerProcessor(eQ("themeRiver"))},function(t){t.registerChartView(W6),t.registerSeriesModel(Z6),t.registerLayout(AE(Q6,"sunburst")),t.registerProcessor(AE(eQ,"sunburst")),t.registerVisual(K6),function(t){t.registerAction({type:U6,update:"updateView"},(function(t,e){e.eachComponent({mainType:"series",subType:"sunburst",query:t},(function(e,i){var n=e0(t,[U6],e);if(n){var r=e.getViewRoot();r&&(t.direction=n0(r,n.node)?"rollUp":"drillDown"),e.resetViewRoot(n.node)}}))})),t.registerAction({type:G6,update:"none"},(function(t,e,i){t=pE({},t),e.eachComponent({mainType:"series",subType:"sunburst",query:t},(function(e){var i=e0(t,[G6],e);i&&(t.dataIndex=i.node.dataIndex)})),"production"!==process.env.NODE_ENV&&iP("sunburstHighlight","highlight"),i.dispatchAction(pE(t,{type:"highlight"}))})),t.registerAction({type:j6,update:"updateView"},(function(t,e,i){t=pE({},t),"production"!==process.env.NODE_ENV&&iP("sunburstUnhighlight","downplay"),i.dispatchAction(pE(t,{type:"downplay"}))}))}(t)},function(t){t.registerChartView(K9),t.registerSeriesModel(n9)}]),eH((function(t){eH(AJ),eH(n7)})),eH((function(t){eH(n7),hJ.registerAxisPointerClass("PolarAxisPointer",s7),t.registerCoordinateSystem("polar",E7),t.registerComponentModel(l7),t.registerComponentView(G7),DQ(t,"angle",u7,V7),DQ(t,"radius",h7,U7),t.registerComponentView(L7),t.registerComponentView(N7),t.registerLayout(AE(F7,"bar"))})),eH(A$),eH((function(t){eH(n7),hJ.registerAxisPointerClass("SingleAxisPointer",ctt),t.registerComponentView(utt),t.registerComponentView(Z7),t.registerComponentModel(Q7),DQ(t,"single",Q7,Q7.defaultOption),t.registerCoordinateSystem("single",itt)})),eH(A5),eH((function(t){t.registerComponentModel(dtt),t.registerComponentView(mtt),t.registerCoordinateSystem("calendar",_tt)})),eH((function(t){t.registerComponentModel(Ett),t.registerComponentView(Ttt),t.registerPreprocessor((function(t){var e=t.graphic;EE(e)?e[0]&&e[0].elements?t.graphic=[t.graphic[0]]:t.graphic=[{elements:e}]:e&&!e.elements&&(t.graphic=[{elements:[e]}])}))})),eH((function(t){t.registerComponentModel(set),t.registerComponentView(uet),net("saveAsImage",pet),net("magicType",yet),net("dataView",Met),net("dataZoom",Ket),net("restore",Let),eH(tet)})),eH((function(t){eH(n7),t.registerComponentModel(tit),t.registerComponentView(wit),t.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},tS),t.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},tS)})),eH(n7),eH((function(t){t.registerComponentView(Git),t.registerComponentModel(Wit),t.registerPreprocessor(Eit),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,Nit),t.registerAction({type:"brush",event:"brush",update:"updateVisual"},(function(t,e){e.eachComponent({mainType:"brush",query:t},(function(e){e.setAreas(t.areas)}))})),t.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},tS),t.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},tS),net("brush",Zit)})),eH((function(t){t.registerComponentModel(Yit),t.registerComponentView(Qit)})),eH((function(t){t.registerComponentModel(tnt),t.registerComponentView(unt),t.registerSubTypeDefaulter("timeline",(function(){return"slider"})),function(t){t.registerAction({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},(function(t,e,i){var n=e.getComponent("timeline");return n&&null!=t.currentIndex&&(n.setCurrentIndex(t.currentIndex),!n.get("loop",!0)&&n.isIndexMax()&&n.getPlayState()&&(n.setPlayState(!1),i.dispatchAction({type:"timelinePlayChange",playState:!1,from:t.from}))),e.resetOption("timeline",{replaceMerge:n.get("replaceMerge",!0)}),dE({currentIndex:n.option.currentIndex},t)})),t.registerAction({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},(function(t,e){var i=e.getComponent("timeline");i&&null!=t.playState&&i.setPlayState(t.playState)}))}(t),t.registerPreprocessor(hnt)})),eH((function(t){t.registerComponentModel(xnt),t.registerComponentView(Ont),t.registerPreprocessor((function(t){fnt(t.series,"markPoint")&&(t.markPoint=t.markPoint||{})}))})),eH((function(t){t.registerComponentModel(Nnt),t.registerComponentView(Hnt),t.registerPreprocessor((function(t){fnt(t.series,"markLine")&&(t.markLine=t.markLine||{})}))})),eH((function(t){t.registerComponentModel(qnt),t.registerComponentView(ert),t.registerPreprocessor((function(t){fnt(t.series,"markArea")&&(t.markArea=t.markArea||{})}))})),eH((function(t){eH(mrt),eH(Ert)})),eH((function(t){eH(Brt),eH(Zrt)})),eH(Brt),eH(Zrt),eH((function(t){eH(Rot),eH(Vot)})),eH(Rot),eH(Vot),eH((function(t){t.registerPreprocessor(Wot),t.registerVisual(t.PRIORITY.VISUAL.ARIA,Hot)})),eH((function(t){t.registerTransform(nst),t.registerTransform(ost)})),eH((function(t){t.registerComponentModel(sst),t.registerComponentView(ast)})),eH((function(t){t.registerUpdateLifecycle("series:beforeupdate",(function(t,e,i){yE(lP(i.seriesTransition),(function(t){yE(lP(t.to),(function(t){for(var e=i.updatedSeries,n=0;n<e.length;n++)(null!=t.seriesIndex&&t.seriesIndex===e[n].seriesIndex||null!=t.seriesId&&t.seriesId===e[n].id)&&(e[n][kV]=!0)}))}))})),t.registerUpdateLifecycle("series:transition",(function(t,e,i){var n=jst(e);if(n.oldSeries&&i.updatedSeries&&i.optionChanged){var r=i.seriesTransition;if(r)yE(lP(r),(function(t){!function(t,e,i,n){var r=[],o=[];yE(lP(t.from),(function(t){var i=$st(e.oldSeries,t);i>=0&&r.push({dataGroupId:e.oldDataGroupIds[i],data:e.oldData[i],divide:Kst(e.oldData[i]),dim:t.dimension})})),yE(lP(t.to),(function(t){var n=$st(i.updatedSeries,t);if(n>=0){var r=i.updatedSeries[n].getData();o.push({dataGroupId:e.oldDataGroupIds[n],data:r,divide:Kst(r),dim:t.dimension})}})),r.length>0&&o.length>0&&Yst(r,o,n)}(t,n,i,e)}));else{var o=function(t,e){var i=YE(),n=YE(),r=YE();function o(t){i.get(t)&&$C("Duplicated seriesKey in universalTransition "+t)}return yE(t.oldSeries,(function(e,i){var o=t.oldDataGroupIds[i],s=t.oldData[i],a=Qst(e),l=Jst(a);n.set(l,{dataGroupId:o,data:s}),EE(a)&&yE(a,(function(t){r.set(t,{key:l,dataGroupId:o,data:s})}))})),yE(e.updatedSeries,(function(t){if(t.isUniversalTransitionEnabled()&&t.isAnimationEnabled()){var e=t.get("dataGroupId"),s=t.getData(),a=Qst(t),l=Jst(a),c=n.get(l);if(c)"production"!==process.env.NODE_ENV&&o(l),i.set(l,{oldSeries:[{dataGroupId:c.dataGroupId,divide:Kst(c.data),data:c.data}],newSeries:[{dataGroupId:e,divide:Kst(s),data:s}]});else if(EE(a)){"production"!==process.env.NODE_ENV&&o(l);var u=[];yE(a,(function(t){var e=n.get(t);e.data&&u.push({dataGroupId:e.dataGroupId,divide:Kst(e.data),data:e.data})})),u.length&&i.set(l,{oldSeries:u,newSeries:[{dataGroupId:e,data:s,divide:Kst(s)}]})}else{var h=r.get(a);if(h){var p=i.get(h.key);p||(p={oldSeries:[{dataGroupId:h.dataGroupId,data:h.data,divide:Kst(h.data)}],newSeries:[]},i.set(h.key,p)),p.newSeries.push({dataGroupId:e,data:s,divide:Kst(s)})}}}})),i}(n,i);yE(o.keys(),(function(t){var i=o.get(t);Yst(i.oldSeries,i.newSeries,e)}))}yE(i.updatedSeries,(function(t){t[kV]&&(t[kV]=!1)}))}for(var s=t.getSeries(),a=n.oldSeries=[],l=n.oldDataGroupIds=[],c=n.oldData=[],u=0;u<s.length;u++){var h=s[u].getData();h.count()<Gst&&(a.push(s[u]),l.push(s[u].get("dataGroupId")),c.push(h))}}))})),eH((function(t){t.registerUpdateLifecycle("series:beforeupdate",(function(t,e,i){var n=uX(e).labelManager;n||(n=uX(e).labelManager=new cX),n.clearLabels()})),t.registerUpdateLifecycle("series:layoutlabels",(function(t,e,i){var n=uX(e).labelManager;i.updatedSeries.forEach((function(t){n.addLabelsOfSeries(e.getViewOfSeriesModel(t))})),n.updateLayoutConfig(e),n.layout(e),n.processLabelsOverall()}))}));class tat{id;dimensions=["x","y"];_map;_mapOffset=[0,0];constructor(t,e){this.id=t,this._map=e}create(t){t.eachSeries((t=>{t.get("coordinateSystem")===this.id&&(t.coordinateSystem=new tat(this.id,this._map))}))}dataToPoint(t){const e=this._map.project(t),i=this._mapOffset;return[e.x-i[0],e.y-i[1]]}pointToData(t){const e=this._mapOffset,i=this._map.unproject([t[0]+e[0],t[1]+e[1]]);return[i.lng,i.lat]}}class eat{id;type;renderingMode;_container;_map;_ec;_coordSystemName;_ecOption;constructor(t,e){this.id=t,this.type="custom",this.renderingMode="2d",this._coordSystemName="mapboxgl-echarts-"+Math.random().toString(16).substring(2),this._ecOption=e}onAdd(t){if(this._map=t,this._createLayerContainer(),!function(t){var e=Bz.get(t);if(e)return e.getDimensionsInfo?e.getDimensionsInfo():e.dimensions.slice()}(this._coordSystemName)){const t=new tat(this._coordSystemName,this._map);Xj(this._coordSystemName,t)}}destroy(){this._ec&&this._ec.dispose(),this._removeLayerContainer(),this._map.removeLayer(this.id)}update(t){if(this._ec){const e=this._ec.getOption();e.series.map((e=>{e.data=t})),this._ec.setOption(e)}}render(){this._container||this._createLayerContainer(),this._ec?this._map.isMoving()?this._ec.clear():(this._ec.resize({width:this._map.getCanvas().width,height:this._map.getCanvas().height}),this._ec.setOption(this._ecOption)):(this._ec=Uj(this._container),this._prepareECharts(),this._ec.setOption(this._ecOption))}_prepareECharts(){const t=this._ecOption.series;if(t)for(let e=t.length-1;e>=0;e--)t[e].coordinateSystem=this._coordSystemName}_createLayerContainer(){const t=this._map.getCanvasContainer();this._container=document.createElement("div"),this._container.style.width=this._map.getCanvas().style.width,this._container.style.height=this._map.getCanvas().style.height,t.appendChild(this._container)}_removeLayerContainer(){this._container&&this._container.parentNode&&this._container.parentNode.removeChild(this._container)}}class iat{id;_data;_options;_index;_count;_step;_flag;_play;_startPoint;constructor(t,e,i){this.id=i||d(0,5),this._options=Object.assign({speed:10,width:1,color:"#fff",isAgain:!0,isFly:!0,isShowLine:!0,isShowBgLine:!0,angle:0,play:!1,isArrow:!1,arrowSize:10},e),this._data=t,this._index=0,this._count=1e3*this._options.speed,this._step=ye(this._data)/this._count,this._flag=0,this._play=this._options.play,this._startPoint=[]}render(){!cNt.value.getSource(this.id+"source")&&cNt.value.addSource(this.id+"source",{type:"geojson",data:this._data}),!cNt.value.getSource(this.id+"-played")&&cNt.value.addSource(this.id+"-played",{type:"geojson",data:{type:"Feature",geometry:{type:"LineString",coordinates:[]}}}),this._options.isShowLine&&(this._options.isShowBgLine&&(!cNt.value.getLayer(this.id)&&cNt.value.addLayer({id:this.id,type:"line",source:this.id+"source",layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#aaaaaa","line-width":this._options.width}}),this._options.isArrow&&TA(this.id,this._options.arrowSize)),!cNt.value.getLayer(this.id+"-played")&&cNt.value.addLayer({id:this.id+"-played",type:"line",source:this.id+"-played",layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this._options.color,"line-width":this._options.width}})),cNt.value.loadImage(this._options.image,((t,e)=>{if(this._options.image){if(t)throw t;!cNt.value.hasImage(this.id+"-icon")&&cNt.value.addImage(this.id+"-icon",e),this._renderIcon(),this._animatePath()}else this._renderIcon(),this._animatePath()}))}_renderIcon(){!cNt.value.getSource(this.id+"-point")&&cNt.value.addSource(this.id+"-point",{type:"geojson",data:this._getDataByCoords()}),this._options.image&&!cNt.value.getLayer(this.id+"-point")&&cNt.value.addLayer({id:this.id+"-point",source:this.id+"-point",type:"symbol",layout:{"icon-image":this._options.image?this.id+"-icon":null,"icon-size":.75,"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-pitch-alignment":"map","icon-rotate":50,visibility:this._options.image?"visible":"none"}})}_animatePath(){if(this._index>this._count)this._options.isAgain?(this._index=0,this._options.isFly&&this._startPoint&&this._startPoint.length&&cNt.value.easeTo({center:this._startPoint,duration:0}),this._animatePath()):window.cancelAnimationFrame(this._flag);else{const t=ge(this._data,this._step*this._index).geometry.coordinates,e=ge(this._data,0).geometry.coordinates;cNt.value.getSource(this.id+"-played").setData(function(t,e,i){var n=tt(i);if("LineString"!==it(i))throw new Error("line must be a LineString");for(var r,o=ue(i,t),s=ue(i,e),a=[(r=o.properties.index<=s.properties.index?[o,s]:[s,o])[0].geometry.coordinates],l=r[0].properties.index+1;l<r[1].properties.index+1;l++)a.push(n[l]);return a.push(r[1].geometry.coordinates),k(a,i.properties)}(e,t,this._data)),this._options.isFly&&cNt.value.flyTo({center:t}),0==this._index&&(this._startPoint=t),cNt.value.getSource(this.id+"-point").setData(this._getDataByCoords(t));const i=this._index===this._count?this._count-1:this._index+1,n=ge(this._data,this._step*i).geometry.coordinates;let r=xt(R(t),R(n))-(0|this._options.angle);this._index===this._count&&(r+=180),this._options.image&&cNt.value.setLayoutProperty(this.id+"-point","icon-rotate",r),this._index++,this._play&&(this._flag=requestAnimationFrame((()=>{this._animatePath()})))}}_getDataByCoords(t){return t&&2===t.length?R(t,{label:this._formatDistance(this._step*this._index)}):null}_formatDistance(t){return t<1?(t*=1e3).toFixed(0)+"米":t.toFixed(2)+"千米"}start(){this._index=0,this._options.isFly&&this._startPoint&&this._startPoint.length&&cNt.value.easeTo({center:this._startPoint,duration:0}),this.render(),this._play=!0}pause(t){this._play=t,t&&this._animatePath()}destroy(){this._index=0,window.cancelAnimationFrame(this._flag),cNt.value.getSource(this.id+"-point")&&(cNt.value.removeLayer(this.id+"-point"),cNt.value.removeSource(this.id+"-point")),cNt.value.getSource(this.id+"-played")&&(cNt.value.removeLayer(this.id+"-played"),cNt.value.removeSource(this.id+"-played")),cNt.value.hasImage(this.id+"-icon")&&cNt.value.removeImage(this.id+"-icon"),cNt.value.getLayer(this.id+"arrow")&&cNt.value.removeLayer(this.id+"arrow"),cNt.value.getSource(this.id+"source")&&(cNt.value.removeLayer(this.id),cNt.value.removeSource(this.id+"source"))}}const nat=u({length:{},playing:{}});class rat extends(m(C)){id;sourceId;sourceTraveledId;trajectorys;_data;_options;eventListeners;EVENT={playing:"PLAYING",length:"LENGTH",start:"START"};constructor(t,e,i){super(),this.id=i||d(0,5),this.sourceId=this.id+"source",this.sourceTraveledId=this.id+"sourceTraveled",this._data=t,this.eventListeners={};for(const t in this.EVENT)this.eventListeners[t]=[];this._options=Object.assign({speed:1,width:5,color:"#fff",traveledColor:"red",isAgain:!0,isFly:!0,isShowLine:!0,isShowTraveledLine:!0,angle:0,isArrow:!0,arrowSize:10,imageWidth:50,imageHeight:50},e),this.trajectorys=[],this.render(),this._options.isFly&&td(this._data,!0)}render(){!cNt.value.getSource(this.sourceId)&&cNt.value.addSource(this.sourceId,{type:"geojson",data:this._data}),!cNt.value.getLayer(this.id)&&cNt.value.addLayer({id:this.id,type:"line",source:this.sourceId,layout:{"line-cap":"round","line-join":"round",visibility:this._options.isShowLine?"visible":"none"},paint:{"line-color":this._options.color,"line-width":this._options.width}}),this._options.isShowTraveledLine&&(!cNt.value.getSource(this.sourceTraveledId)&&cNt.value.addSource(this.sourceTraveledId,{type:"geojson",data:{type:"FeatureCollection",features:[]}}),!cNt.value.getLayer(this.sourceTraveledId)&&cNt.value.addLayer({id:this.sourceTraveledId,type:"line",source:this.sourceTraveledId,layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":this._options.traveledColor,"line-width":this._options.width}})),this._options.isShowLine&&this._options.isArrow&&TA(this.id,this._options.arrowSize),this._createTrack()}_createTrack(){const t=[];this._data.features.forEach((e=>{if(e.properties){const i=e.properties.image?e.properties.image:this._options.image,n=this._startPlay(i,e,e.properties.id,{width:this._options.imageWidth,height:this._options.imageHeight});t.push(n)}})),this.trajectorys=t}_startPlay(t,e,i,n){const r=A({tag:"div",attrs:{className:i+"icon",style:{backgroundImage:`url(${t})`,width:`${n.width}px`,height:`${n.height}px`,backgroundSize:"100% 100%"}}}),o=new cNt.value.mapboxgl.Marker(r).setLngLat(e.geometry.coordinates[0]).addTo(cNt.value),s=new IA(e,o,this._options);return s.on(s.EVENT.PLAYING,(t=>{const e=t.traveldData;e.features[0].properties.id=i,this.updateTraveled(e)})),s.id=i,s}updateTraveled(t){const e=cNt.value.getSource(this.sourceTraveledId);if(e){const i=e._data,n=i.features.findIndex((e=>e.properties.id===t.features[0].properties.id));-1!==n&&i.features.splice(n,1),i.features.push(t.features[0]),e.setData(i)}}getIconPostion(){const t=[];return this.trajectorys.forEach((e=>{t.push({postion:[e.icon._lngLat.lng,e.icon._lngLat.lat],...e._line.properties})})),t}pause(t){this.trajectorys.forEach((e=>{e.pause(t)}))}destroy(){this.trajectorys.forEach((t=>{nat.value.playing[this.id]&&t.off("PLAYING",nat.value.playing[this.id]),nat.value.length[this.id]&&t.off("LENGTH",nat.value.length[this.id]),t.destroy()})),cNt.value.getSource(this.sourceTraveledId)&&(cNt.value.removeLayer(this.sourceTraveledId),cNt.value.removeSource(this.sourceTraveledId)),cNt.value.getSource(this.sourceId)&&(cNt.value.getLayer(this.id+"arrow")&&cNt.value.removeLayer(this.id+"arrow"),cNt.value.removeLayer(this.id),cNt.value.removeSource(this.sourceId))}start(){this.trajectorys.forEach((t=>{t.start()}))}update(t,e){let i=[];if(cNt.value.getSource(this.sourceId)){const n=cNt.value.getSource(this.sourceId)._data;n.features.forEach((n=>{n.properties.id==t&&(n.geometry.coordinates=[...new Set([...n.geometry.coordinates,...e])],i=n.geometry.coordinates)})),cNt.value.getSource(this.sourceId).setData(n);const r=this.trajectorys.find((e=>e.id==t));r&&r.update(k(i))}}setSpeed(t){this.trajectorys.forEach((e=>{e.setSpeed(t)}))}on(t,e){const i=[];switch(t){case"length":nat.value.length[this.id]=t=>{const n=i.findIndex((e=>e.id===t.currentId));-1!==n&&i.splice(n,1),i.push(t),e(JSON.parse(JSON.stringify(i)))},this.trajectorys.forEach((t=>{t.on(t.EVENT.LENGTH,nat.value.length[this.id])}));break;case"playing":nat.value.playing[this.id]=t=>{e(t)},this.trajectorys.forEach((t=>{t.on(t.EVENT.PLAYING,nat.value.playing[this.id])}))}}off(t){if(!this.eventListeners[t])throw new Error("Unknown event: "+t);this.trajectorys.forEach((e=>{const i=t.toUpperCase();e.off(i,nat.value[t][this.id])}))}}class oat{markerList=[];chartList=[];id;size;constructor(t,e,i){this.id=e,this.size=i,this.addMaker(t)}addMaker(t){t.forEach(((t,e)=>{const i=document.createElement("div");i.id=this.id+e,i.style=`height:${this.size[1]}px;width:${this.size[0]}px;`;const n=new Lm.Marker({element:i,offset:[this.size[0]/2,-this.size[1]/2],anchor:"center"}).setLngLat(t.position).addTo(cNt.value);this.markerList.push(n),this.chartList.push(this.initChart(t.option,this.id+e))}))}initChart(t,e){const i=Uj(document.getElementById(e));return i.setOption(t),i}destroyAll(){this.markerList.forEach((t=>{t&&t.remove()})),this.chartList.forEach(((t,e)=>{if(t){t.dispose();const i=document.getElementById(this.id+e);i&&i.remove}}))}destroy(t){this.markerList.forEach(((e,i)=>{e&&t===i&&e.remove()})),this.chartList.forEach(((e,i)=>{if(e&&t===i){e.dispose();const t=document.getElementById(this.id+i);t&&t.remove}}))}}const sat={showLabel:!0,fontSize:14,fontColor:"#fff",size:[20,200],color:["rgba(0,244,255,1)","rgba(0,77,167,1)"]};function aat(t){return aat="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},aat(t)}function lat(t){var e=function(t,e){if("object"!==aat(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!==aat(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===aat(e)?e:String(e)}function cat(t,e,i){return(e=lat(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function uat(t,e){if(!t)throw new Error(e||"loader assertion failed.")}const hat=Boolean("object"!=typeof process||"[object process]"!==String(process)||process.browser),pat=void 0!==process&&process.version&&/v([0-9]*)/.exec(process.version);pat&&parseFloat(pat[1]);const dat="3.4.14";function fat(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}const mat={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},gat=mat.global||mat.self||mat.window||{},yat="object"!=typeof process||"[object process]"!==String(process)||process.browser,vat="function"==typeof importScripts,_at="undefined"!=typeof window&&void 0!==window.orientation,xat=void 0!==process&&process.version&&/v([0-9]*)/.exec(process.version);xat&&parseFloat(xat[1]);class bat{constructor(t,e){cat(this,"name",void 0),cat(this,"workerThread",void 0),cat(this,"isRunning",!0),cat(this,"result",void 0),cat(this,"_resolve",(()=>{})),cat(this,"_reject",(()=>{})),this.name=t,this.workerThread=e,this.result=new Promise(((t,e)=>{this._resolve=t,this._reject=e}))}postMessage(t,e){this.workerThread.postMessage({source:"loaders.gl",type:t,payload:e})}done(t){fat(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){fat(this.isRunning),this.isRunning=!1,this._reject(t)}}const wat=s.Worker,Aat=new Map;function Eat(t){fat(t.source&&!t.url||!t.source&&t.url);let e=Aat.get(t.source||t.url);return e||(t.url&&(e=function(t){if(!t.startsWith("http"))return t;return Sat((e=t,"try {\n importScripts('".concat(e,"');\n} catch (error) {\n console.error(error);\n throw error;\n}")));var e}(t.url),Aat.set(t.url,e)),t.source&&(e=Sat(t.source),Aat.set(t.source,e))),fat(e),e}function Sat(t){const e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function Mat(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0;const n=i||new Set;if(t){if(Tat(t))n.add(t);else if(Tat(t.buffer))n.add(t.buffer);else if(ArrayBuffer.isView(t));else if(e&&"object"==typeof t)for(const i in t)Mat(t[i],e,n)}else;return void 0===i?Array.from(n):[]}function Tat(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&t instanceof MessagePort||("undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}const Iat=()=>{};class Cat{static isSupported(){return"undefined"!=typeof Worker&&yat||void 0!==wat&&!yat}constructor(t){cat(this,"name",void 0),cat(this,"source",void 0),cat(this,"url",void 0),cat(this,"terminated",!1),cat(this,"worker",void 0),cat(this,"onMessage",void 0),cat(this,"onError",void 0),cat(this,"_loadableURL","");const{name:e,source:i,url:n}=t;fat(i||n),this.name=e,this.source=i,this.url=n,this.onMessage=Iat,this.onError=t=>console.log(t),this.worker=yat?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=Iat,this.onError=Iat,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(t,e){e=e||Mat(t),this.worker.postMessage(t,e)}_getErrorFromErrorEvent(t){let e="Failed to load ";return e+="worker ".concat(this.name," from ").concat(this.url,". "),t.message&&(e+="".concat(t.message," in ")),t.lineno&&(e+=":".concat(t.lineno,":").concat(t.colno)),new Error(e)}_createBrowserWorker(){this._loadableURL=Eat({source:this.source,url:this.url});const t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},t.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},t.onmessageerror=t=>console.error(t),t}_createNodeWorker(){let t;if(this.url){const e=this.url.includes(":/")||this.url.startsWith("/")?this.url:"./".concat(this.url);t=new wat(e,{eval:!1})}else{if(!this.source)throw new Error("no worker");t=new wat(this.source,{eval:!0})}return t.on("message",(t=>{this.onMessage(t)})),t.on("error",(t=>{this.onError(t)})),t.on("exit",(t=>{})),t}}class Pat{static isSupported(){return Cat.isSupported()}constructor(t){cat(this,"name","unnamed"),cat(this,"source",void 0),cat(this,"url",void 0),cat(this,"maxConcurrency",1),cat(this,"maxMobileConcurrency",1),cat(this,"onDebug",(()=>{})),cat(this,"reuseWorkers",!0),cat(this,"props",{}),cat(this,"jobQueue",[]),cat(this,"idleQueue",[]),cat(this,"count",0),cat(this,"isDestroyed",!1),this.source=t.source,this.url=t.url,this.setProps(t)}destroy(){this.idleQueue.forEach((t=>t.destroy())),this.isDestroyed=!0}setProps(t){this.props={...this.props,...t},void 0!==t.name&&(this.name=t.name),void 0!==t.maxConcurrency&&(this.maxConcurrency=t.maxConcurrency),void 0!==t.maxMobileConcurrency&&(this.maxMobileConcurrency=t.maxMobileConcurrency),void 0!==t.reuseWorkers&&(this.reuseWorkers=t.reuseWorkers),void 0!==t.onDebug&&(this.onDebug=t.onDebug)}async startJob(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(t,e,i)=>t.done(i),i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(t,e)=>t.error(e);const n=new Promise((n=>(this.jobQueue.push({name:t,onMessage:e,onError:i,onStart:n}),this)));return this._startQueuedJob(),await n}async _startQueuedJob(){if(!this.jobQueue.length)return;const t=this._getAvailableWorker();if(!t)return;const e=this.jobQueue.shift();if(e){this.onDebug({message:"Starting job",name:e.name,workerThread:t,backlog:this.jobQueue.length});const i=new bat(e.name,t);t.onMessage=t=>e.onMessage(i,t.type,t.payload),t.onError=t=>e.onError(i,t),e.onStart(i);try{await i.result}finally{this.returnWorkerToQueue(t)}}}returnWorkerToQueue(t){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(t.destroy(),this.count--):this.idleQueue.push(t),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;const t="".concat(this.name.toLowerCase()," (#").concat(this.count," of ").concat(this.maxConcurrency,")");return new Cat({name:t,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return _at?this.maxMobileConcurrency:this.maxConcurrency}}const Lat={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}};class Dat{static isSupported(){return Cat.isSupported()}static getWorkerFarm(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Dat._workerFarm=Dat._workerFarm||new Dat({}),Dat._workerFarm.setProps(t),Dat._workerFarm}constructor(t){cat(this,"props",void 0),cat(this,"workerPools",new Map),this.props={...Lat},this.setProps(t),this.workerPools=new Map}destroy(){for(const t of this.workerPools.values())t.destroy();this.workerPools=new Map}setProps(t){this.props={...this.props,...t};for(const t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(t){const{name:e,source:i,url:n}=t;let r=this.workerPools.get(e);return r||(r=new Pat({name:e,source:i,url:n}),r.setProps(this._getWorkerPoolProps()),this.workerPools.set(e,r)),r}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}cat(Dat,"_workerFarm",void 0);const Rat="latest";async function Oat(t){if(t.startsWith("http")){const e=await fetch(t);return kat(await e.text())}return t.startsWith("/")||(t="".concat(process.cwd(),"/").concat(t)),require(t)}function kat(t){var e,i;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0;if("object"==typeof n&&(r=n,n=""),"string"!=typeof t)throw new Error("code must be a string, not ".concat(typeof t));const o=a.default._nodeModulePaths(l.default.dirname(n)),s=module.parent,c=new a.default(n,s);return c.filename=n,c.paths=[].concat((null===(e=r)||void 0===e?void 0:e.prependPaths)||[]).concat(o).concat((null===(i=r)||void 0===i?void 0:i.appendPaths)||[]),c._compile(t,n),s&&s.children&&s.children.splice(s.children.indexOf(c),1),c.exports}var Nat=Object.freeze({__proto__:null,requireFromFile:Oat,requireFromString:kat});const Bat="3.4.14",zat={};async function Fat(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e&&(t=function(t,e,i){if(t.startsWith("http"))return t;const n=i.modules||{};if(n[t])return n[t];if(!yat)return"modules/".concat(e,"/dist/libs/").concat(t);if(i.CDN)return fat(i.CDN.startsWith("http")),"".concat(i.CDN,"/").concat(e,"@").concat(Bat,"/dist/libs/").concat(t);if(vat)return"../src/libs/".concat(t);return"modules/".concat(e,"/src/libs/").concat(t)}(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})),zat[t]=zat[t]||async function(t){if(t.endsWith("wasm")){const e=await fetch(t);return await e.arrayBuffer()}if(!yat)try{return Nat&&Oat&&await Oat(t)}catch{return null}if(vat)return importScripts(t);const e=await fetch(t);return function(t,e){if(!yat)return kat&&kat(t,e);if(vat)return eval.call(gat,t),null;const i=document.createElement("script");i.id=e;try{i.appendChild(document.createTextNode(t))}catch(e){i.text=t}return document.body.appendChild(i),null}(await e.text(),t)}(t),await zat[t]}async function Vat(t,e,i,n,r){const o=t.id,s=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=e[t.id]||{},n="".concat(t.id,"-worker.js");let r=i.workerUrl;if(r||"compression"!==t.id||(r=e.workerUrl),"test"===e._workerType&&(r="modules/".concat(t.module,"/dist/").concat(n)),!r){let e=t.version;"latest"===e&&(e=Rat);const i=e?"@".concat(e):"";r="https://unpkg.com/@loaders.gl/".concat(t.module).concat(i,"/dist/").concat(n)}return fat(r),r}(t,i),a=Dat.getWorkerFarm(i).getWorkerPool({name:o,url:s});i=JSON.parse(JSON.stringify(i)),n=JSON.parse(JSON.stringify(n||{}));const l=await a.startJob("process-on-worker",Uat.bind(null,r));l.postMessage("process",{input:e,options:i,context:n});const c=await l.result;return await c.result}async function Uat(t,e,i,n){switch(i){case"done":e.done(n);break;case"error":e.error(new Error(n.error));break;case"process":const{id:r,input:o,options:s}=n;try{const i=await t(o,s);e.postMessage("done",{id:r,result:i})}catch(t){const i=t instanceof Error?t.message:"unknown error";e.postMessage("error",{id:r,error:i})}break;default:console.warn("parse-with-worker unknown message ".concat(i))}}function Gat(t,e,i){if(t.byteLength<=e+i)return"";const n=new DataView(t);let r="";for(let t=0;t<i;t++)r+=String.fromCharCode(n.getUint8(e+t));return r}function jat(t){try{return JSON.parse(t)}catch(e){throw new Error('Failed to parse JSON from data starting with "'.concat(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"==typeof t)return t.slice(0,e);if(ArrayBuffer.isView(t))return Gat(t.buffer,t.byteOffset,e);if(t instanceof ArrayBuffer)return Gat(t,0,e);return""}(t),'"'))}}function Hat(t,e,i){const n=void 0!==i?new Uint8Array(t).subarray(e,e+i):new Uint8Array(t).subarray(e);return new Uint8Array(n).buffer}function Wat(t,e){return uat(t>=0),uat(e>0),t+(e-1)&~(e-1)}function qat(t,e,i){let n;if(t instanceof ArrayBuffer)n=new Uint8Array(t);else{const e=t.byteOffset,i=t.byteLength;n=new Uint8Array(t.buffer||t.arrayBuffer,e,i)}return e.set(n,i),i+Wat(n.byteLength,4)}async function Xat(t){const e=[];for await(const i of t)e.push(i);return function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];const n=e.map((t=>t instanceof ArrayBuffer?new Uint8Array(t):t)),r=n.reduce(((t,e)=>t+e.byteLength),0),o=new Uint8Array(r);let s=0;for(const t of n)o.set(t,s),s+=t.byteLength;return o.buffer}(...e)}function Zat(){let t;if("undefined"!=typeof window&&window.performance)t=window.performance.now();else if(void 0!==process&&process.hrtime){const e=process.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}class Yat{constructor(t,e){this.name=void 0,this.type=void 0,this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=t,this.type=e,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Zat(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Zat()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class Qat{constructor(t){this.id=void 0,this.stats={},this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"count";return this._getOrCreate({name:t,type:e})}get size(){return Object.keys(this.stats).length}reset(){for(const t of Object.values(this.stats))t.reset();return this}forEach(t){for(const e of Object.values(this.stats))t(e)}getTable(){const t={};return this.forEach((e=>{t[e.name]={time:e.time||0,count:e.count||0,average:e.getAverageTime()||0,hz:e.getHz()||0}})),t}_initializeStats(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((t=>this._getOrCreate(t)))}_getOrCreate(t){const{name:e,type:i}=t;let n=this.stats[e];return n||(n=t instanceof Yat?t:new Yat(e,i),this.stats[e]=n),n}}const Jat={id:"request-scheduler",throttleRequests:!0,maxRequests:6};class Kat{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};cat(this,"props",void 0),cat(this,"stats",void 0),cat(this,"activeRequestCount",0),cat(this,"requestQueue",[]),cat(this,"requestMap",new Map),cat(this,"deferredUpdate",null),this.props={...Jat,...t},this.stats=new Qat({id:this.props.id}),this.stats.get("Queued Requests"),this.stats.get("Active Requests"),this.stats.get("Cancelled Requests"),this.stats.get("Queued Requests Ever"),this.stats.get("Active Requests Ever")}scheduleRequest(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>0;if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(t))return this.requestMap.get(t);const i={handle:t,priority:0,getPriority:e},n=new Promise((t=>(i.resolve=t,i)));return this.requestQueue.push(i),this.requestMap.set(t,n),this._issueNewRequests(),n}_issueRequest(t){const{handle:e,resolve:i}=t;let n=!1;const r=()=>{n||(n=!0,this.requestMap.delete(e),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,i?i({done:r}):Promise.resolve({done:r})}_issueNewRequests(){this.deferredUpdate||(this.deferredUpdate=setTimeout((()=>this._issueNewRequestsAsync()),0))}_issueNewRequestsAsync(){this.deferredUpdate=null;const t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(0!==t){this._updateAllRequests();for(let e=0;e<t;++e){const t=this.requestQueue.shift();t&&this._issueRequest(t)}}}_updateAllRequests(){const t=this.requestQueue;for(let e=0;e<t.length;++e){const i=t[e];this._updateRequest(i)||(t.splice(e,1),this.requestMap.delete(i.handle),e--)}t.sort(((t,e)=>t.priority-e.priority))}_updateRequest(t){return t.priority=t.getPriority(t.handle),!(t.priority<0)||(t.resolve(null),!1)}}let $at="";const tlt={};function elt(t){if((e=t)&&"object"==typeof e&&e.isBuffer)return function(t){if(Buffer.isBuffer(t))return new Uint8Array(t.buffer,t.byteOffset,t.length).slice().buffer;return t}(t);var e;if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return 0===t.byteOffset&&t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);if("string"==typeof t){const e=t;return(new TextEncoder).encode(e).buffer}if(t&&"object"==typeof t&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}function ilt(t){const e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(e+1):""}function nlt(t){const e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(0,e):""}const rlt=t=>"function"==typeof t,olt=t=>null!==t&&"object"==typeof t,slt=t=>olt(t)&&t.constructor==={}.constructor,alt=t=>t&&"function"==typeof t[Symbol.iterator],llt=t=>t&&"function"==typeof t[Symbol.asyncIterator],clt=t=>"undefined"!=typeof Response&&t instanceof Response||t&&t.arrayBuffer&&t.text&&t.json,ult=t=>"undefined"!=typeof Blob&&t instanceof Blob,hlt=t=>t&&"object"==typeof t&&t.isBuffer,plt=t=>(t=>"undefined"!=typeof ReadableStream&&t instanceof ReadableStream||olt(t)&&rlt(t.tee)&&rlt(t.cancel)&&rlt(t.getReader))(t)||(t=>olt(t)&&rlt(t.read)&&rlt(t.pipe)&&(t=>"boolean"==typeof t)(t.readable))(t),dlt=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,flt=/^([-\w.]+\/[-\w.+]+)/;function mlt(t){const e=dlt.exec(t);return e?e[1]:""}const glt=/\?.*/;function ylt(t){return t.replace(glt,"")}function vlt(t){if(clt(t)){return t.url}if(ult(t)){return t.name||""}return"string"==typeof t?t:""}function _lt(t){if(clt(t)){const e=t,i=e.headers.get("content-type")||"",n=ylt(e.url);return function(t){const e=flt.exec(t);return e?e[1]:t}(i)||mlt(n)}if(ult(t)){return t.type||""}return"string"==typeof t?mlt(t):""}async function xlt(t){if(clt(t))return t;const e={},i=function(t){if(clt(t))return t.headers["content-length"]||-1;if(ult(t))return t.size;return"string"==typeof t?t.length:t instanceof ArrayBuffer||ArrayBuffer.isView(t)?t.byteLength:-1}(t);i>=0&&(e["content-length"]=String(i));const n=vlt(t),r=_lt(t);r&&(e["content-type"]=r);const o=await async function(t){const e=5;if("string"==typeof t)return"data:,".concat(t.slice(0,e));if(t instanceof Blob){const e=t.slice(0,5);return await new Promise((t=>{const i=new FileReader;i.onload=e=>{var i;return t(null==e||null===(i=e.target)||void 0===i?void 0:i.result)},i.readAsDataURL(e)}))}if(t instanceof ArrayBuffer){const i=function(t){let e="";const i=new Uint8Array(t);for(let t=0;t<i.byteLength;t++)e+=String.fromCharCode(i[t]);return btoa(e)}(t.slice(0,e));return"data:base64,".concat(i)}return null}(t);o&&(e["x-first-bytes"]=o),"string"==typeof t&&(t=(new TextEncoder).encode(t));const s=new Response(t,{headers:e});return Object.defineProperty(s,"url",{value:n}),s}async function blt(t,e){if("string"==typeof t){t=function(t){for(const e in tlt)if(t.startsWith(e)){const i=tlt[e];t=t.replace(e,i)}return t.startsWith("http://")||t.startsWith("https://")||(t="".concat($at).concat(t)),t}(t);let i=e;return null!=e&&e.fetch&&"function"!=typeof(null==e?void 0:e.fetch)&&(i=e.fetch),await fetch(t,i)}return await xlt(t)}function wlt(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||function(t){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type)return!0;if(void 0!==process&&"object"==typeof process.versions&&Boolean(process.versions.electron))return!0;const e="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,i=t||e;return!!(i&&i.indexOf("Electron")>=0)}()}const Alt=globalThis.window||globalThis.self||globalThis.global,Elt=globalThis.process||{},Slt="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source";wlt();class Mlt{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";this.storage=void 0,this.id=void 0,this.config=void 0,this.storage=function(t){try{const e=window[t],i="__storage_test__";return e.setItem(i,i),e.removeItem(i),e}catch(t){return null}}(i),this.id=t,this.config=e,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let t={};if(this.storage){const e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}}function Tlt(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600;const r=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>n&&(i=Math.min(i,n/t.width));const o=t.width*i,s=t.height*i,a=["font-size:1px;","padding:".concat(Math.floor(s/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(s,"px;"),"background:url(".concat(r,");"),"background-size:".concat(o,"px ").concat(s,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),a]}let Ilt;!function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"}(Ilt||(Ilt={}));const Clt=10;function Plt(t){return"string"!=typeof t?t:(t=t.toUpperCase(),Ilt[t]||Ilt.WHITE)}function Llt(t,e){if(!t)throw new Error(e||"Assertion failed")}function Dlt(){let t;var e,i;if(wlt()&&Alt.performance)t=null==Alt||null===(e=Alt.performance)||void 0===e||null===(i=e.now)||void 0===i?void 0:i.call(e);else if("hrtime"in Elt){var n;const e=null==Elt||null===(n=Elt.hrtime)||void 0===n?void 0:n.call(Elt);t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}const Rlt={debug:wlt()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Olt={enabled:!0,level:0};function klt(){}const Nlt={},Blt={once:!0};class zlt{constructor(){let{id:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""};this.id=void 0,this.VERSION=Slt,this._startTs=Dlt(),this._deltaTs=Dlt(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new Mlt("__probe-".concat(this.id,"__"),Olt),this.timeStamp("".concat(this.id," started")),function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"];const i=Object.getPrototypeOf(t),n=Object.getOwnPropertyNames(i),r=t;for(const i of n){const n=r[i];"function"==typeof n&&(e.find((t=>i===t))||(r[i]=n.bind(t)))}}(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Dlt()-this._startTs).toPrecision(10))}getDelta(){return Number((Dlt()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,e){this._storage.setConfiguration({[t]:e})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,e){Llt(t,e)}warn(t){return this._getLogFunction(0,t,Rlt.warn,arguments,Blt)}error(t){return this._getLogFunction(0,t,Rlt.error,arguments)}deprecated(t,e){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(e,"` instead"))}removed(t,e){return this.error("`".concat(t,"` has been removed. Use `").concat(e,"` instead"))}probe(t,e){return this._getLogFunction(t,e,Rlt.log,arguments,{time:!0,once:!0})}log(t,e){return this._getLogFunction(t,e,Rlt.debug,arguments)}info(t,e){return this._getLogFunction(t,e,console.info,arguments)}once(t,e){return this._getLogFunction(t,e,Rlt.debug||Rlt.info,arguments,Blt)}table(t,e,i){return e?this._getLogFunction(t,e,console.table||klt,i&&[i],{tag:Ult(e)}):klt}image(t){let{logLevel:e,priority:i,image:n,message:r="",scale:o=1}=t;return this._shouldLog(e||i)?wlt()?function(t){let{image:e,message:i="",scale:n=1}=t;if("string"==typeof e){const t=new Image;return t.onload=()=>{const e=Tlt(t,i,n);console.log(...e)},t.src=e,klt}const r=e.nodeName||"";if("img"===r.toLowerCase())return console.log(...Tlt(e,i,n)),klt;if("canvas"===r.toLowerCase()){const t=new Image;return t.onload=()=>console.log(...Tlt(t,i,n)),t.src=e.toDataURL(),klt}return klt}({image:n,message:r,scale:o}):(console.warn("removed"),klt):klt}time(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}timeEnd(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,e){return this._getLogFunction(t,e,console.timeStamp||klt)}group(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1};const n=Vlt({logLevel:t,message:e,opts:i}),{collapsed:r}=i;return n.method=(r?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(t,e,Object.assign({},i,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||klt)}withGroup(t,e,i){this.group(t,e)();try{i()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=Flt(t)}_getLogFunction(t,e,i,n,r){if(this._shouldLog(t)){r=Vlt({logLevel:t,message:e,args:n,opts:r}),Llt(i=i||r.method),r.total=this.getTotal(),r.delta=this.getDelta(),this._deltaTs=Dlt();const o=r.tag||r.message;if(r.once&&o){if(Nlt[o])return klt;Nlt[o]=Dlt()}return e=function(t,e,i){if("string"==typeof e){const n=i.time?function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;const i=Math.max(e-t.length,0);return"".concat(" ".repeat(i)).concat(t)}(function(t){let e;return e=t<10?"".concat(t.toFixed(2),"ms"):t<100?"".concat(t.toFixed(1),"ms"):t<1e3?"".concat(t.toFixed(0),"ms"):"".concat((t/1e3).toFixed(2),"s"),e}(i.total)):"";e=function(t,e,i){if(!wlt&&"string"==typeof t){if(e){const i=Plt(e);t="[".concat(i,"m").concat(t,"[39m")}if(i){const e=Plt(i);t="[".concat(e+Clt,"m").concat(t,"[49m")}}return t}(e=i.time?"".concat(t,": ").concat(n," ").concat(e):"".concat(t,": ").concat(e),i.color,i.background)}return e}(this.id,r.message,r),i.bind(console,e,...r.args)}return klt}}function Flt(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return Llt(Number.isFinite(e)&&e>=0),e}function Vlt(t){const{logLevel:e,message:i}=t;t.logLevel=Flt(e);const n=t.args?Array.from(t.args):[];for(;n.length&&n.shift()!==i;);switch(typeof e){case"string":case"function":void 0!==i&&n.unshift(i),t.message=e;break;case"object":Object.assign(t,e)}"function"==typeof t.message&&(t.message=t.message());const r=typeof t.message;return Llt("string"===r||"object"===r),Object.assign(t,{args:n},t.opts)}function Ult(t){for(const e in t)for(const i in t[e])return i||"untitled";return"empty"}zlt.VERSION=Slt;const Glt=new zlt({id:"loaders.gl"});class jlt{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const Hlt={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){cat(this,"console",void 0),this.console=console}log(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this.console.log.bind(this.console,...e)}info(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this.console.info.bind(this.console,...e)}warn(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this.console.warn.bind(this.console,...e)}error(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this.console.error.bind(this.console,...e)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:hat,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},Wlt={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function qlt(){globalThis.loaders=globalThis.loaders||{};const{loaders:t}=globalThis;return t._state=t._state||{},t._state}const Xlt=()=>{const t=qlt();return t.globalOptions=t.globalOptions||{...Hlt},t.globalOptions};function Zlt(t,e,i,n){return i=i||[],function(t,e){Ylt(t,null,Hlt,Wlt,e);for(const i of e){const n=t&&t[i.id]||{},r=i.options&&i.options[i.id]||{},o=i.deprecatedOptions&&i.deprecatedOptions[i.id]||{};Ylt(n,i.id,r,o,e)}}(t,i=Array.isArray(i)?i:[i]),function(t,e,i){const n=t.options||{},r={...n};(function(t,e){e&&!("baseUri"in t)&&(t.baseUri=e)})(r,i),null===r.log&&(r.log=new jlt);return Jlt(r,Xlt()),Jlt(r,e),r}(e,t,n)}function Ylt(t,e,i,n,r){const o=e||"Top level",s=e?"".concat(e,"."):"";for(const a in t){const l=!e&&olt(t[a]);if(!(a in i)&&!("baseUri"===a&&!e)&&!("workerUrl"===a&&e))if(a in n)Glt.warn("".concat(o," loader option '").concat(s).concat(a,"' no longer supported, use '").concat(n[a],"'"))();else if(!l){const t=Qlt(a,r);Glt.warn("".concat(o," loader option '").concat(s).concat(a,"' not recognized. ").concat(t))()}}}function Qlt(t,e){const i=t.toLowerCase();let n="";for(const r of e)for(const e in r.options){if(t===e)return"Did you mean '".concat(r.id,".").concat(e,"'?");const o=e.toLowerCase();(i.startsWith(o)||o.startsWith(i))&&(n=n||"Did you mean '".concat(r.id,".").concat(e,"'?"))}return n}function Jlt(t,e){for(const i in e)if(i in e){const n=e[i];slt(n)&&slt(t[i])?t[i]={...t[i],...e[i]}:t[i]=e[i]}}function Klt(t){var e;if(!t)return!1;Array.isArray(t)&&(t=t[0]);return Array.isArray(null===(e=t)||void 0===e?void 0:e.extensions)}function $lt(t){var e,i;let n;return uat(t,"null loader"),uat(Klt(t),"invalid loader"),Array.isArray(t)&&(n=t[1],t=t[0],t={...t,options:{...t.options,...n}}),(null!==(e=t)&&void 0!==e&&e.parseTextSync||null!==(i=t)&&void 0!==i&&i.parseText)&&(t.text=!0),t.text||(t.binary=!0),t}const tct=()=>{const t=qlt();return t.loaderRegistry=t.loaderRegistry||[],t.loaderRegistry};const ect=new zlt({id:"loaders.gl"}),ict=/\.([^.]+)$/;function nct(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;if(!rct(t))return null;if(e&&!Array.isArray(e))return $lt(e);let r=[];e&&(r=r.concat(e)),null!=i&&i.ignoreRegisteredLoaders||r.push(...tct()),function(t){for(const e of t)$lt(e)}(r);const o=function(t,e,i,n){const r=vlt(t),o=_lt(t),s=ylt(r)||(null==n?void 0:n.url);let a=null,l="";null!=i&&i.mimeType&&(a=sct(e,null==i?void 0:i.mimeType),l="match forced by supplied MIME type ".concat(null==i?void 0:i.mimeType));var c;a=a||function(t,e){const i=e&&ict.exec(e),n=i&&i[1];return n?function(t,e){e=e.toLowerCase();for(const i of t)for(const t of i.extensions)if(t.toLowerCase()===e)return i;return null}(t,n):null}(e,s),l=l||(a?"matched url ".concat(s):""),a=a||sct(e,o),l=l||(a?"matched MIME type ".concat(o):""),a=a||function(t,e){if(!e)return null;for(const i of t)if("string"==typeof e){if(act(e,i))return i}else if(ArrayBuffer.isView(e)){if(lct(e.buffer,e.byteOffset,i))return i}else if(e instanceof ArrayBuffer){if(lct(e,0,i))return i}return null}(e,t),l=l||(a?"matched initial data ".concat(cct(t)):""),a=a||sct(e,null==i?void 0:i.fallbackMimeType),l=l||(a?"matched fallback MIME type ".concat(o):""),l&&ect.log(1,"selectLoader selected ".concat(null===(c=a)||void 0===c?void 0:c.name,": ").concat(l,"."));return a}(t,r,i,n);if(!(o||null!=i&&i.nothrow))throw new Error(oct(t));return o}function rct(t){return!(t instanceof Response&&204===t.status)}function oct(t){const e=vlt(t),i=_lt(t);let n="No valid loader found (";n+=e?"".concat(ilt(e),", "):"no url provided, ",n+="MIME type: ".concat(i?'"'.concat(i,'"'):"not provided",", ");const r=t?cct(t):"";return n+=r?' first bytes: "'.concat(r,'"'):"first bytes: not available",n+=")",n}function sct(t,e){for(const i of t){if(i.mimeTypes&&i.mimeTypes.includes(e))return i;if(e==="application/x.".concat(i.id))return i}return null}function act(t,e){if(e.testText)return e.testText(t);return(Array.isArray(e.tests)?e.tests:[e.tests]).some((e=>t.startsWith(e)))}function lct(t,e,i){return(Array.isArray(i.tests)?i.tests:[i.tests]).some((n=>function(t,e,i,n){if(n instanceof ArrayBuffer)return function(t,e,i){if(i=i||t.byteLength,t.byteLength<i||e.byteLength<i)return!1;const n=new Uint8Array(t),r=new Uint8Array(e);for(let t=0;t<n.length;++t)if(n[t]!==r[t])return!1;return!0}(n,t,n.byteLength);switch(typeof n){case"function":return n(t,i);case"string":return n===uct(t,e,n.length);default:return!1}}(t,e,i,n)))}function cct(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"==typeof t)return t.slice(0,e);if(ArrayBuffer.isView(t))return uct(t.buffer,t.byteOffset,e);if(t instanceof ArrayBuffer){return uct(t,0,e)}return""}function uct(t,e,i){if(t.byteLength<e+i)return"";const n=new DataView(t);let r="";for(let t=0;t<i;t++)r+=String.fromCharCode(n.getUint8(e+t));return r}const hct=262144;const pct=262144;const dct=1048576;function fct(t,e){return hat?async function*(t,e){const i=t.getReader();let n;try{for(;;){const t=n||i.read();null!=e&&e._streamReadAhead&&(n=i.read());const{done:r,value:o}=await t;if(r)return;yield elt(o)}}catch(t){i.releaseLock()}}(t,e):async function*(t,e){for await(const e of t)yield elt(e)}(t)}function mct(t,e){if("string"==typeof t)return function*(t,e){const i=(null==e?void 0:e.chunkSize)||hct;let n=0;const r=new TextEncoder;for(;n<t.length;){const e=Math.min(t.length-n,i),o=t.slice(n,n+e);n+=e,yield r.encode(o)}}(t,e);if(t instanceof ArrayBuffer)return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){const{chunkSize:i=pct}=e;let n=0;for(;n<t.byteLength;){const e=Math.min(t.byteLength-n,i),r=new ArrayBuffer(e),o=new Uint8Array(t,n,e);new Uint8Array(r).set(o),n+=e,yield r}}()}(t,e);if(ult(t))return async function*(t,e){const i=(null==e?void 0:e.chunkSize)||dct;let n=0;for(;n<t.size;){const e=n+i,r=await t.slice(n,e).arrayBuffer();n=e,yield r}}(t,e);if(plt(t))return fct(t,e);if(clt(t)){return fct(t.body,e)}throw new Error("makeIterator")}const gct="Cannot convert supplied data type";async function yct(t,e,i){const n=t instanceof ArrayBuffer||ArrayBuffer.isView(t);if("string"==typeof t||n)return function(t,e,i){if(e.text&&"string"==typeof t)return t;if(hlt(t)&&(t=t.buffer),t instanceof ArrayBuffer){const i=t;return e.text&&!e.binary?new TextDecoder("utf8").decode(i):i}if(ArrayBuffer.isView(t)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(t);let i=t.buffer;const n=t.byteLength||t.length;return 0===t.byteOffset&&n===i.byteLength||(i=i.slice(t.byteOffset,t.byteOffset+n)),i}throw new Error(gct)}(t,e);if(ult(t)&&(t=await xlt(t)),clt(t)){const i=t;return await async function(t){if(!t.ok){const e=await async function(t){let e="Failed to fetch resource ".concat(t.url," (").concat(t.status,"): ");try{const i=t.headers.get("Content-Type");let n=t.statusText;i.includes("application/json")&&(n+=" ".concat(await t.text())),e+=n,e=e.length>60?"".concat(e.slice(0,60),"..."):e}catch(t){}return e}(t);throw new Error(e)}}(i),e.binary?await i.arrayBuffer():await i.text()}if(plt(t)&&(t=mct(t,i)),alt(t)||llt(t))return Xat(t);throw new Error(gct)}function vct(t,e){const i=Xlt(),n=t||i;return"function"==typeof n.fetch?n.fetch:olt(n.fetch)?t=>blt(t,n):null!=e&&e.fetch?null==e?void 0:e.fetch:blt}function _ct(t,e,i){if(i)return i;const n={fetch:vct(e,t),...t};if(n.url){const t=ylt(n.url);n.baseUrl=t,n.queryString=function(t){const e=t.match(glt);return e&&e[0]}(n.url),n.filename=ilt(t),n.baseUrl=nlt(t)}return Array.isArray(n.loaders)||(n.loaders=null),n}async function xct(t,e,i,n){fat(!n||"object"==typeof n),!e||Array.isArray(e)||Klt(e)||(n=void 0,i=e,e=void 0),i=i||{};const r=vlt(t=await t),o=function(t,e){if(!e&&t&&!Array.isArray(t))return t;let i;if(t&&(i=Array.isArray(t)?t:[t]),e&&e.loaders){const t=Array.isArray(e.loaders)?e.loaders:[e.loaders];i=i?[...i,...t]:t}return i&&i.length?i:null}(e,n),s=await async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;if(!rct(t))return null;let r=nct(t,e,{...i,nothrow:!0},n);if(r)return r;if(ult(t)&&(r=nct(t=await t.slice(0,10).arrayBuffer(),e,i,n)),!(r||null!=i&&i.nothrow))throw new Error(oct(t));return r}(t,o,i);return s?(n=_ct({url:r,parse:xct,loaders:o},i=Zlt(i,s,o,r),n||null),await async function(t,e,i,n){if(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dat;fat(t,"no worker provided");const i=t.version}(t),clt(e)){const t=e,{ok:i,redirected:r,status:o,statusText:s,type:a,url:l}=t,c=Object.fromEntries(t.headers.entries());n.response={headers:c,ok:i,redirected:r,status:o,statusText:s,type:a,url:l}}if(e=await yct(e,t,i),t.parseTextSync&&"string"==typeof e)return i.dataType="text",t.parseTextSync(e,i,n,t);if(function(t,e){return!!Dat.isSupported()&&!!(yat||null!=e&&e._nodeWorkers)&&t.worker&&(null==e?void 0:e.worker)}(t,i))return await Vat(t,e,i,n,xct);if(t.parseText&&"string"==typeof e)return await t.parseText(e,i,n,t);if(t.parse)return await t.parse(e,i,n,t);throw fat(!t.parseSync),new Error("".concat(t.id," loader - no parser found and worker is disabled"))}(s,t,i,n)):null}async function bct(t,e,i,n){Array.isArray(e)||Klt(e)||(i=e,e=void 0);const r=vct(i);let o=t;return"string"==typeof t&&(o=await r(t)),ult(t)&&(o=await r(t)),await xct(o,e,i)}const{_parseImageNode:wct}=globalThis,Act="undefined"!=typeof Image,Ect="undefined"!=typeof ImageBitmap,Sct=Boolean(wct),Mct=!!hat||Sct;function Tct(t){const e=function(t){if("undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap)return"imagebitmap";if("undefined"!=typeof Image&&t instanceof Image)return"image";if(t&&"object"==typeof t&&t.data&&t.width&&t.height)return"data";return null}(t);if(!e)throw new Error("Not an image");return e}const Ict=/^data:image\/svg\+xml/,Cct=/\.svg((\?|#).*)?$/;function Pct(t){return t&&(Ict.test(t)||Cct.test(t))}function Lct(t,e){if(Pct(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function Dct(t,e,i){const n=function(t,e){if(Pct(e)){let e=(new TextDecoder).decode(t);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(e=unescape(encodeURIComponent(e)))}catch(t){throw new Error(t.message)}return"data:image/svg+xml;base64,".concat(btoa(e))}return Lct(t,e)}(t,i),r=self.URL||self.webkitURL,o="string"!=typeof n&&r.createObjectURL(n);try{return await async function(t,e){const i=new Image;if(i.src=t,e.image&&e.image.decode&&i.decode)return await i.decode(),i;return await new Promise(((e,n)=>{try{i.onload=()=>e(i),i.onerror=e=>n(new Error("Could not load image ".concat(t,": ").concat(e)))}catch(t){n(t)}}))}(o||n,e)}finally{o&&r.revokeObjectURL(o)}}const Rct={};let Oct=!0;async function kct(t,e,i){let n;if(Pct(i)){n=await Dct(t,e,i)}else n=Lct(t,i);const r=e&&e.imagebitmap;return await async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;!function(t){for(const e in t||Rct)return!1;return!0}(e)&&Oct||(e=null);if(e)try{return await createImageBitmap(t,e)}catch(t){console.warn(t),Oct=!1}return await createImageBitmap(t)}(n,r)}function Nct(t){return function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=(r=e,[...r].map((t=>t.charCodeAt(0))));var r;for(let e=0;e<n.length;++e)if(n[e]!==t[e+i])return!1;return!0}(t,"ftyp",4)?0==(96&t[8])?null:function(t){switch(function(t,e,i){return String.fromCharCode(...t.slice(e,i))}(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}(t):null}const Bct=!1,zct=!0;function Fct(t){const e=Vct(t);return function(t){const e=Vct(t),i=e.byteLength>=24&&2303741511===e.getUint32(0,Bct);if(!i)return null;return{mimeType:"image/png",width:e.getUint32(16,Bct),height:e.getUint32(20,Bct)}}(e)||function(t){const e=Vct(t),i=e.byteLength>=3&&65496===e.getUint16(0,Bct)&&255===e.getUint8(2);if(!i)return null;const{tableMarkers:n,sofMarkers:r}=function(){const t=new Set([65499,65476,65484,65501,65534]);for(let e=65504;e<65520;++e)t.add(e);const e=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:t,sofMarkers:e}}();let o=2;for(;o+9<e.byteLength;){const t=e.getUint16(o,Bct);if(r.has(t))return{mimeType:"image/jpeg",height:e.getUint16(o+5,Bct),width:e.getUint16(o+7,Bct)};if(!n.has(t))return null;o+=2,o+=e.getUint16(o,Bct)}return null}(e)||function(t){const e=Vct(t),i=e.byteLength>=10&&1195984440===e.getUint32(0,Bct);if(!i)return null;return{mimeType:"image/gif",width:e.getUint16(6,zct),height:e.getUint16(8,zct)}}(e)||function(t){const e=Vct(t),i=e.byteLength>=14&&16973===e.getUint16(0,Bct)&&e.getUint32(2,zct)===e.byteLength;if(!i)return null;return{mimeType:"image/bmp",width:e.getUint32(18,zct),height:e.getUint32(22,zct)}}(e)||function(t){const e=new Uint8Array(t instanceof DataView?t.buffer:t),i=Nct(e);if(!i)return null;return{mimeType:i.mimeType,width:0,height:0}}(e)}function Vct(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}const Uct={id:"image",module:"images",name:"Images",version:"3.4.14",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],parse:async function(t,e,i){const n=((e=e||{}).image||{}).type||"auto",{url:r}=i||{};let o;switch(function(t){switch(t){case"auto":case"data":return function(){if(Ect)return"imagebitmap";if(Act)return"image";if(Mct)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(t){switch(t){case"auto":return Ect||Act||Mct;case"imagebitmap":return Ect;case"image":return Act;case"data":return Mct;default:throw new Error("@loaders.gl/images: image ".concat(t," not supported in this environment"))}}(t),t}}(n)){case"imagebitmap":o=await kct(t,e,r);break;case"image":o=await Dct(t,e,r);break;case"data":o=await async function(t,e){const{mimeType:i}=Fct(t)||{},n=globalThis._parseImageNode;return uat(n),await n(t,i)}(t);break;default:uat(!1)}return"data"===n&&(o=function(t){switch(Tct(t)){case"data":return t;case"image":case"imagebitmap":const e=document.createElement("canvas"),i=e.getContext("2d");if(!i)throw new Error("getImageData");return e.width=t.width,e.height=t.height,i.drawImage(t,0,0),i.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}(o)),o},tests:[t=>Boolean(Fct(new DataView(t)))],options:{image:{type:"auto",decode:!0}}},Gct={};function jct(t){if(void 0===Gct[t]){const e=hat?function(t){switch(t){case"image/avif":case"image/webp":return function(t){try{const e=document.createElement("canvas");return 0===e.toDataURL(t).indexOf("data:".concat(t))}catch{return!1}}(t);default:return!0}}(t):function(t){const e=["image/png","image/jpeg","image/gif"],{_parseImageNode:i,_imageFormatsNode:n=e}=globalThis;return Boolean(i)&&n.includes(t)}(t);Gct[t]=e}return Gct[t]}function Hct(t){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type)return!0;if(void 0!==process&&"object"==typeof process.versions&&Boolean(process.versions.electron))return!0;const e="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,i=t||e;return!!(i&&i.indexOf("Electron")>=0)}function Wct(){return!("object"==typeof process&&"[object process]"===String(process)&&!process.browser)||Hct()}const qct={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"==typeof process&&process},Xct=qct.window||qct.self||qct.global,Zct=qct.process||{},Yct="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source";Wct();const Qct=globalThis;function Jct(t){if(!t&&!Wct())return"Node";if(Hct(t))return"Electron";const e="undefined"!=typeof navigator?navigator:{},i=t||e.userAgent||"";if(i.indexOf("Edge")>-1)return"Edge";const n=-1!==i.indexOf("MSIE "),r=-1!==i.indexOf("Trident/");return n||r?"IE":Qct.chrome?"Chrome":Qct.safari?"Safari":Qct.mozInnerScreenX?"Firefox":"Unknown"}class Kct{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";cat(this,"storage",void 0),cat(this,"id",void 0),cat(this,"config",void 0),this.storage=function(t){try{const e=window[t],i="__storage_test__";return e.setItem(i,i),e.removeItem(i),e}catch(t){return null}}(i),this.id=t,this.config=e,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let t={};if(this.storage){const e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}}function $ct(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600;const r=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>n&&(i=Math.min(i,n/t.width));const o=t.width*i,s=t.height*i,a=["font-size:1px;","padding:".concat(Math.floor(s/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(s,"px;"),"background:url(".concat(r,");"),"background-size:".concat(o,"px ").concat(s,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),a]}let tut;function eut(t){return"string"==typeof t?tut[t.toUpperCase()]||tut.WHITE:t}function iut(t,e){if(!t)throw new Error(e||"Assertion failed")}function nut(){let t;var e,i;if(Wct&&"performance"in Xct)t=null==Xct||null===(e=Xct.performance)||void 0===e||null===(i=e.now)||void 0===i?void 0:i.call(e);else if("hrtime"in Zct){var n;const e=null==Zct||null===(n=Zct.hrtime)||void 0===n?void 0:n.call(Zct);t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}!function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"}(tut||(tut={}));const rut={debug:Wct&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},out={enabled:!0,level:0};function sut(){}const aut={},lut={once:!0};class cut{constructor(){let{id:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""};cat(this,"id",void 0),cat(this,"VERSION",Yct),cat(this,"_startTs",nut()),cat(this,"_deltaTs",nut()),cat(this,"_storage",void 0),cat(this,"userData",{}),cat(this,"LOG_THROTTLE_TIMEOUT",0),this.id=t,this.userData={},this._storage=new Kct("__probe-".concat(this.id,"__"),out),this.timeStamp("".concat(this.id," started")),function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"];const i=Object.getPrototypeOf(t),n=Object.getOwnPropertyNames(i);for(const i of n)"function"==typeof t[i]&&(e.find((t=>i===t))||(t[i]=t[i].bind(t)))}(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((nut()-this._startTs).toPrecision(10))}getDelta(){return Number((nut()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,e){this._storage.setConfiguration({[t]:e})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,e){iut(t,e)}warn(t){return this._getLogFunction(0,t,rut.warn,arguments,lut)}error(t){return this._getLogFunction(0,t,rut.error,arguments)}deprecated(t,e){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(e,"` instead"))}removed(t,e){return this.error("`".concat(t,"` has been removed. Use `").concat(e,"` instead"))}probe(t,e){return this._getLogFunction(t,e,rut.log,arguments,{time:!0,once:!0})}log(t,e){return this._getLogFunction(t,e,rut.debug,arguments)}info(t,e){return this._getLogFunction(t,e,console.info,arguments)}once(t,e){for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];return this._getLogFunction(t,e,rut.debug||rut.info,arguments,lut)}table(t,e,i){return e?this._getLogFunction(t,e,console.table||sut,i&&[i],{tag:put(e)}):sut}image(t){let{logLevel:e,priority:i,image:n,message:r="",scale:o=1}=t;return this._shouldLog(e||i)?Wct?function(t){let{image:e,message:i="",scale:n=1}=t;if("string"==typeof e){const t=new Image;return t.onload=()=>{const e=$ct(t,i,n);console.log(...e)},t.src=e,sut}const r=e.nodeName||"";if("img"===r.toLowerCase())return console.log(...$ct(e,i,n)),sut;if("canvas"===r.toLowerCase()){const t=new Image;return t.onload=()=>console.log(...$ct(t,i,n)),t.src=e.toDataURL(),sut}return sut}({image:n,message:r,scale:o}):(console.warn("removed"),sut):sut}time(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}timeEnd(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,e){return this._getLogFunction(t,e,console.timeStamp||sut)}group(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1};const n=hut({logLevel:t,message:e,opts:i}),{collapsed:r}=i;return n.method=(r?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(t,e,Object.assign({},i,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||sut)}withGroup(t,e,i){this.group(t,e)();try{i()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=uut(t)}_getLogFunction(t,e,i,n,r){if(this._shouldLog(t)){r=hut({logLevel:t,message:e,args:n,opts:r}),iut(i=i||r.method),r.total=this.getTotal(),r.delta=this.getDelta(),this._deltaTs=nut();const o=r.tag||r.message;if(r.once){if(aut[o])return sut;aut[o]=nut()}return e=function(t,e,i){if("string"==typeof e){const s=i.time?function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;const i=Math.max(e-t.length,0);return"".concat(" ".repeat(i)).concat(t)}(function(t){let e;return e=t<10?"".concat(t.toFixed(2),"ms"):t<100?"".concat(t.toFixed(1),"ms"):t<1e3?"".concat(t.toFixed(0),"ms"):"".concat((t/1e3).toFixed(2),"s"),e}(i.total)):"";e=i.time?"".concat(t,": ").concat(s," ").concat(e):"".concat(t,": ").concat(e),n=e,r=i.color,o=i.background,Wct||"string"!=typeof n||(r&&(r=eut(r),n="[".concat(r,"m").concat(n,"[39m")),o&&(r=eut(o),n="[".concat(o+10,"m").concat(n,"[49m"))),e=n}var n,r,o;return e}(this.id,r.message,r),i.bind(console,e,...r.args)}return sut}}function uut(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return iut(Number.isFinite(e)&&e>=0),e}function hut(t){const{logLevel:e,message:i}=t;t.logLevel=uut(e);const n=t.args?Array.from(t.args):[];for(;n.length&&n.shift()!==i;);switch(typeof e){case"string":case"function":void 0!==i&&n.unshift(i),t.message=e;break;case"object":Object.assign(t,e)}"function"==typeof t.message&&(t.message=t.message());const r=typeof t.message;return iut("string"===r||"object"===r),Object.assign(t,{args:n},t.opts)}function put(t){for(const e in t)for(const i in t[e])return i||"untitled";return"empty"}cat(cut,"VERSION",Yct);var dut=new cut({id:"deck"});const fut={attributeUpdateStart:-1,attributeManagerUpdateStart:-1,attributeUpdateMessages:[]};let mut={};function gut(t){mut=t}function yut(t,e,i,n){dut.level>0&&mut[t]&&mut[t].call(null,e,i,n)}"production"!==process.env.NODE_ENV&&(mut=(t=>({"layer.changeFlag":(e,i,n)=>{t.log(3,"".concat(e.id," ").concat(i,": "),n[i])()},"layer.initialize":e=>{t.log(1,"Initializing ".concat(e))()},"layer.update":(e,i)=>{if(i){const i=e.getChangeFlags();t.log(2,"Updating ".concat(e," because: ").concat(Object.keys(i).filter((t=>i[t])).join(", ")))()}else t.log(4,"".concat(e," does not need update"))()},"layer.matched":(e,i)=>{i&&t.log(4,"Matched ".concat(e,", state transfered"))()},"layer.finalize":e=>{t.log(1,"Finalizing ".concat(e))()},"compositeLayer.renderLayers":(e,i,n)=>{i?t.log(2,"Composite layer rendered new subLayers ".concat(e),n)():t.log(4,"Composite layer reused subLayers ".concat(e),n)()},"layerManager.setLayers":(e,i,n)=>{i&&t.log(2,"Updating ".concat(n.length," deck layers"))()},"layerManager.activateViewport":(e,i)=>{t.log(3,"Viewport changed",i)()},"attributeManager.invalidate":(e,i,n)=>{t.log(1,n?"invalidated attributes ".concat(n," (").concat(i,") for ").concat(e.id):"invalidated all attributes for ".concat(e.id))()},"attributeManager.updateStart":t=>{fut.attributeUpdateMessages.length=0,fut.attributeManagerUpdateStart=Date.now()},"attributeManager.updateEnd":(e,i)=>{const n=Math.round(Date.now()-fut.attributeManagerUpdateStart);t.groupCollapsed(2,"Updated attributes for ".concat(i," instances in ").concat(e.id," in ").concat(n,"ms"))();for(const e of fut.attributeUpdateMessages)t.log(3,e)();t.groupEnd(2)()},"attribute.updateStart":t=>{fut.attributeUpdateStart=Date.now()},"attribute.allocate":(t,e)=>{const i="".concat(t.id," allocated ").concat(e);fut.attributeUpdateMessages.push(i)},"attribute.updateEnd":(t,e)=>{const i=Math.round(Date.now()-fut.attributeUpdateStart),n="".concat(t.id," updated ").concat(e," in ").concat(i,"ms");fut.attributeUpdateMessages.push(n)},"deckRenderer.renderLayers":(e,i,n)=>{const{pass:r,redrawReason:o,stats:s}=n;for(const n of i){const{totalCount:i,visibleCount:a,compositeCount:l,pickableCount:c}=n,u=i-l-a;t.log(2,"RENDER #".concat(e.renderCount," ").concat(a," (of ").concat(i," layers) to ").concat(r," because ").concat(o," (").concat(u," hidden, ").concat(l," composite ").concat(c," pickable)"))(),s&&s.get("Redraw Layers").add(a)}}}))(dut));var vut={id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:function(t){const e=t[0],i=t[t.length-1];return"{"===e&&"}"===i||"["===e&&"]"===i},parseTextSync:JSON.parse};const _ut=function(){const t="8.9.34",e=globalThis.deck&&globalThis.deck.VERSION;if(e&&e!==t)throw new Error("deck.gl - multiple versions detected: ".concat(e," vs ").concat(t));return e||(dut.log(1,"deck.gl ".concat(t))(),globalThis.deck={...globalThis.deck,VERSION:t,version:t,log:dut,_registerLoggers:gut},function(t){const e=tct();t=Array.isArray(t)?t:[t];for(const i of t){const t=$lt(i);e.find((e=>t===e))||e.unshift(t)}}([vut,[Uct,{imagebitmap:{premultiplyAlpha:"none"}}]])),t}(),xut={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(xut,"IDENTITY",{get:()=>(dut.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")(),0)});const but={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},wut={common:0,meters:1,pixels:2},Aut={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},Eut=new cut({id:"luma.gl"});function Sut(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}const Mut="Requires WebGL2";function Tut(t){return"undefined"!=typeof WebGLRenderingContext&&t instanceof WebGLRenderingContext||("undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&Number.isFinite(t._version)))}function Iut(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&2===t._version)}function Cut(t){return Sut(Tut(t),"Invalid WebGLRenderingContext"),t}function Put(t){return Sut(Iut(t),Mut),t}const Lut={};function Dut(t,e){var i;Lut[t]=!0,void 0!==e&&(i=e,globalThis.console&&globalThis.console.error&&globalThis.console.error(i))}const Rut=function t(e){const i=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(let e=0;e<this.attribs.length;e++){const n=new t.VertexAttrib(i);this.attribs[e]=n}this.maxAttrib=0};(Rut.VertexAttrib=function(t){this.enabled=!1,this.buffer=null,this.size=4,this.type=5126,this.normalized=!1,this.stride=16,this.offset=0,this.cached="",this.recache()}).prototype.recache=function(){this.cached=[this.size,this.type,this.normalized,this.stride,this.offset].join(":")};const Out=function(t){const e=this;this.gl=t,function(t){const e=t.getError;t.getError=function(){let i;do{i=e.apply(t),0!==i&&(Lut[i]=!0)}while(0!==i);for(i in Lut)if(Lut[i])return delete Lut[i],parseInt(i,10);return 0}}(t);const i=this.original={getParameter:t.getParameter,enableVertexAttribArray:t.enableVertexAttribArray,disableVertexAttribArray:t.disableVertexAttribArray,bindBuffer:t.bindBuffer,getVertexAttrib:t.getVertexAttrib,vertexAttribPointer:t.vertexAttribPointer};t.getParameter=function(t){return t===e.VERTEX_ARRAY_BINDING_OES?e.currentVertexArrayObject===e.defaultVertexArrayObject?null:e.currentVertexArrayObject:i.getParameter.apply(this,arguments)},t.enableVertexAttribArray=function(t){const n=e.currentVertexArrayObject;n.maxAttrib=Math.max(n.maxAttrib,t);return n.attribs[t].enabled=!0,i.enableVertexAttribArray.apply(this,arguments)},t.disableVertexAttribArray=function(t){const n=e.currentVertexArrayObject;n.maxAttrib=Math.max(n.maxAttrib,t);return n.attribs[t].enabled=!1,i.disableVertexAttribArray.apply(this,arguments)},t.bindBuffer=function(t,n){switch(t){case 34962:e.currentArrayBuffer=n;break;case 34963:e.currentVertexArrayObject.elementArrayBuffer=n}return i.bindBuffer.apply(this,arguments)},t.getVertexAttrib=function(t,n){const r=e.currentVertexArrayObject.attribs[t];switch(n){case 34975:return r.buffer;case 34338:return r.enabled;case 34339:return r.size;case 34340:return r.stride;case 34341:return r.type;case 34922:return r.normalized;default:return i.getVertexAttrib.apply(this,arguments)}},t.vertexAttribPointer=function(t,n,r,o,s,a){const l=e.currentVertexArrayObject;l.maxAttrib=Math.max(l.maxAttrib,t);const c=l.attribs[t];return c.buffer=e.currentArrayBuffer,c.size=n,c.type=r,c.normalized=o,c.stride=s,c.offset=a,c.recache(),i.vertexAttribPointer.apply(this,arguments)},t.instrumentExtension&&t.instrumentExtension(this,"OES_vertex_array_object"),t.canvas&&t.canvas.addEventListener("webglcontextrestored",(()=>{var t;t="OESVertexArrayObject emulation library context restored",globalThis.console&&globalThis.console.log&&globalThis.console.log(t),e.reset_()}),!0),this.reset_()};Out.prototype.VERTEX_ARRAY_BINDING_OES=34229,Out.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let t=0;t<this.vertexArrayObjects.length;++t)this.vertexArrayObjects.isAlive=!1;const t=this.gl;this.maxVertexAttribs=t.getParameter(34921),this.defaultVertexArrayObject=new Rut(this),this.currentVertexArrayObject=null,this.currentArrayBuffer=null,this.vertexArrayObjects=[this.defaultVertexArrayObject],this.bindVertexArrayOES(null)},Out.prototype.createVertexArrayOES=function(){const t=new Rut(this);return this.vertexArrayObjects.push(t),t},Out.prototype.deleteVertexArrayOES=function(t){t.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(t),1),this.currentVertexArrayObject===t&&this.bindVertexArrayOES(null)},Out.prototype.isVertexArrayOES=function(t){return!!(t&&t instanceof Rut&&t.hasBeenBound&&t.ext===this)},Out.prototype.bindVertexArrayOES=function(t){const e=this.gl;if(t&&!t.isAlive)return void Dut(1282,"bindVertexArrayOES: attempt to bind deleted arrayObject");const i=this.original,n=this.currentVertexArrayObject;this.currentVertexArrayObject=t||this.defaultVertexArrayObject,this.currentVertexArrayObject.hasBeenBound=!0;const r=this.currentVertexArrayObject;if(n===r)return;n&&r.elementArrayBuffer===n.elementArrayBuffer||i.bindBuffer.call(e,34963,r.elementArrayBuffer);let o=this.currentArrayBuffer;const s=Math.max(n?n.maxAttrib:0,r.maxAttrib);for(let t=0;t<=s;t++){const s=r.attribs[t],a=n?n.attribs[t]:null;if(n&&s.enabled===a.enabled||(s.enabled?i.enableVertexAttribArray.call(e,t):i.disableVertexAttribArray.call(e,t)),s.enabled){let r=!1;n&&s.buffer===a.buffer||(o!==s.buffer&&(i.bindBuffer.call(e,34962,s.buffer),o=s.buffer),r=!0),(r||s.cached!==a.cached)&&i.vertexAttribPointer.call(e,t,s.size,s.type,s.normalized,s.stride,s.offset)}}this.currentArrayBuffer!==o&&i.bindBuffer.call(e,34962,this.currentArrayBuffer)};const kut="OES_element_index",Nut="WEBGL_draw_buffers",But="WEBGL_debug_renderer_info",zut=t=>Iut(t)?void 0:0,Fut={3074:t=>Iut(t)?void 0:36064,35723:t=>Iut(t)?void 0:4352,35977:zut,32937:zut,36795:(t,e)=>{const i=Iut(t)?t.getExtension("EXT_disjoint_timer_query_webgl2"):t.getExtension("EXT_disjoint_timer_query");return i&&i.GPU_DISJOINT_EXT?e(i.GPU_DISJOINT_EXT):0},37445:(t,e)=>{const i=t.getExtension(But);return e(i&&i.UNMASKED_VENDOR_WEBGL||7936)},37446:(t,e)=>{const i=t.getExtension(But);return e(i&&i.UNMASKED_RENDERER_WEBGL||7937)},34047:(t,e)=>{const i=t.luma.extensions.EXT_texture_filter_anisotropic;return i?e(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1},32883:zut,35071:zut,37447:zut,36063:(t,e)=>{if(!Iut(t)){const i=t.getExtension(Nut);return i?e(i.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:zut,35374:zut,35377:zut,34852:t=>{if(!Iut(t)){const e=t.getExtension(Nut);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:t=>t.getExtension(kut)?2147483647:65535,33001:t=>t.getExtension(kut)?16777216:65535,33e3:t=>16777216,37157:zut,35373:zut,35657:zut,36183:zut,37137:zut,34045:zut,35978:zut,35979:zut,35968:zut,35376:zut,35375:zut,35659:zut,37154:zut,35371:zut,35658:zut,35076:zut,35077:zut,35380:zut};const Vut="ANGLE_instanced_arrays";const Uut={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{Sut(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[Vut]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(t,e){Sut(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{Sut(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{Sut(!1)},deleteQuery:()=>{Sut(!1)},beginQuery:()=>{Sut(!1)},endQuery:()=>{},getQuery(t,e){return this.getQueryObject(t,e)},getQueryParameter(t,e){return this.getQueryObject(t,e)},getQueryObject:()=>{}}},Gut={readBuffer:(t,e,i)=>{Iut(t)&&e(i)},getVertexAttrib:(t,e,i,n)=>{const{webgl2:r,ext:o}=function(t,e){return{webgl2:Iut(t),ext:t.getExtension(e)}}(t,Vut);let s;switch(n){case 35069:s=!!r&&void 0;break;case 35070:s=r||o?void 0:0}return void 0!==s?s:e(i,n)},getProgramParameter:(t,e,i,n)=>{if(!Iut(t))switch(n){case 35967:return 35981;case 35971:case 35382:return 0}return e(i,n)},getInternalformatParameter:(t,e,i,n,r)=>Iut(t)||32937!==r?t.getInternalformatParameter(i,n,r):new Int32Array([0]),getTexParameter(t,e,i,n){if(34046===n){const{extensions:e}=t.luma,i=e.EXT_texture_filter_anisotropic;n=i&&i.TEXTURE_MAX_ANISOTROPY_EXT||34046}return e(i,n)},getParameter:function(t,e,i){const n=Fut[i],r="function"==typeof n?n(t,e,i):n;return void 0!==r?r:e(i)},hint:(t,e,i,n)=>e(i,n)};function jut(t,e){let{extension:i,target:n,target2:r}=e;const o=Uut[i];Sut(o);const{meta:s={}}=o,{suffix:a=""}=s,l=t.getExtension(i);for(const e of Object.keys(o)){const i="".concat(e).concat(a);let s=null;"meta"===e||"function"==typeof t[e]||(l&&"function"==typeof l[i]?s=function(){return l[i](...arguments)}:"function"==typeof o[e]&&(s=o[e].bind(n))),s&&(n[e]=s,r[e]=s)}}globalThis.polyfillContext=function(t){t.luma=t.luma||{};const{luma:e}=t;return e.polyfilled||(!function(t){if("function"==typeof t.createVertexArray)return;const e=t.getSupportedExtensions;t.getSupportedExtensions=function(){const t=e.call(this)||[];return t.indexOf("OES_vertex_array_object")<0&&t.push("OES_vertex_array_object"),t};const i=t.getExtension;t.getExtension=function(e){return i.call(this,e)||("OES_vertex_array_object"!==e?null:(t.__OESVertexArrayObject||(this.__OESVertexArrayObject=new Out(this)),this.__OESVertexArrayObject))}}(t),function(t){t.luma.extensions={};const e=t.getSupportedExtensions()||[];for(const i of e)t.luma[i]=t.getExtension(i)}(t),function(t,e){for(const i of Object.getOwnPropertyNames(e))"overrides"!==i&&jut(t,{extension:i,target:t.luma,target2:t})}(t,Uut),function(t,e){let{target:i,target2:n}=e;Object.keys(Gut).forEach((e=>{if("function"==typeof Gut[e]){const r=t[e]?t[e].bind(t):()=>{},o=Gut[e].bind(null,t,r);i[e]=o,n[e]=o}}))}(t,{target:e,target2:t}),e.polyfilled=!0),t};const Hut={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,36006:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],3333:4,3317:4,37440:!1,37441:!1,37443:37444,35723:4352,36010:null,35977:!1,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},Wut=(t,e,i)=>e?t.enable(i):t.disable(i),qut=(t,e,i)=>t.hint(i,e),Xut=(t,e,i)=>t.pixelStorei(i,e);function Zut(t){return Array.isArray(t)||ArrayBuffer.isView(t)}const Yut={3042:Wut,32773:(t,e)=>t.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(t,e)=>t.clearColor(...e),3107:(t,e)=>t.colorMask(...e),2884:Wut,2885:(t,e)=>t.cullFace(e),2929:Wut,2931:(t,e)=>t.clearDepth(e),2932:(t,e)=>t.depthFunc(e),2928:(t,e)=>t.depthRange(...e),2930:(t,e)=>t.depthMask(e),3024:Wut,35723:qut,36006:(t,e)=>{const i=Iut(t)?36009:36160;return t.bindFramebuffer(i,e)},2886:(t,e)=>t.frontFace(e),33170:qut,2849:(t,e)=>t.lineWidth(e),32823:Wut,32824:"polygonOffset",10752:"polygonOffset",35977:Wut,32938:"sampleCoverage",32939:"sampleCoverage",3089:Wut,3088:(t,e)=>t.scissor(...e),2960:Wut,2961:(t,e)=>t.clearStencil(e),2968:(t,e)=>t.stencilMaskSeparate(1028,e),36005:(t,e)=>t.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(t,e)=>t.viewport(...e),3333:Xut,3317:Xut,37440:Xut,37441:Xut,37443:Xut,3330:Xut,3332:Xut,3331:Xut,36010:(t,e)=>t.bindFramebuffer(36008,e),3314:Xut,32878:Xut,3316:Xut,3315:Xut,32877:Xut,framebuffer:(t,e)=>{const i=e&&"handle"in e?e.handle:e;return t.bindFramebuffer(36160,i)},blend:(t,e)=>e?t.enable(3042):t.disable(3042),blendColor:(t,e)=>t.blendColor(...e),blendEquation:(t,e)=>{e=Zut(e)?e:[e,e],t.blendEquationSeparate(...e)},blendFunc:(t,e)=>{e=Zut(e)&&2===e.length?[...e,...e]:e,t.blendFuncSeparate(...e)},clearColor:(t,e)=>t.clearColor(...e),clearDepth:(t,e)=>t.clearDepth(e),clearStencil:(t,e)=>t.clearStencil(e),colorMask:(t,e)=>t.colorMask(...e),cull:(t,e)=>e?t.enable(2884):t.disable(2884),cullFace:(t,e)=>t.cullFace(e),depthTest:(t,e)=>e?t.enable(2929):t.disable(2929),depthFunc:(t,e)=>t.depthFunc(e),depthMask:(t,e)=>t.depthMask(e),depthRange:(t,e)=>t.depthRange(...e),dither:(t,e)=>e?t.enable(3024):t.disable(3024),derivativeHint:(t,e)=>{t.hint(35723,e)},frontFace:(t,e)=>t.frontFace(e),mipmapHint:(t,e)=>t.hint(33170,e),lineWidth:(t,e)=>t.lineWidth(e),polygonOffsetFill:(t,e)=>e?t.enable(32823):t.disable(32823),polygonOffset:(t,e)=>t.polygonOffset(...e),sampleCoverage:(t,e)=>t.sampleCoverage(...e),scissorTest:(t,e)=>e?t.enable(3089):t.disable(3089),scissor:(t,e)=>t.scissor(...e),stencilTest:(t,e)=>e?t.enable(2960):t.disable(2960),stencilMask:(t,e)=>{e=Zut(e)?e:[e,e];const[i,n]=e;t.stencilMaskSeparate(1028,i),t.stencilMaskSeparate(1029,n)},stencilFunc:(t,e)=>{e=Zut(e)&&3===e.length?[...e,...e]:e;const[i,n,r,o,s,a]=e;t.stencilFuncSeparate(1028,i,n,r),t.stencilFuncSeparate(1029,o,s,a)},stencilOp:(t,e)=>{e=Zut(e)&&3===e.length?[...e,...e]:e;const[i,n,r,o,s,a]=e;t.stencilOpSeparate(1028,i,n,r),t.stencilOpSeparate(1029,o,s,a)},viewport:(t,e)=>t.viewport(...e)};function Qut(t,e,i){return void 0!==e[t]?e[t]:i[t]}const Jut={blendEquation:(t,e,i)=>t.blendEquationSeparate(Qut(32777,e,i),Qut(34877,e,i)),blendFunc:(t,e,i)=>t.blendFuncSeparate(Qut(32969,e,i),Qut(32968,e,i),Qut(32971,e,i),Qut(32970,e,i)),polygonOffset:(t,e,i)=>t.polygonOffset(Qut(32824,e,i),Qut(10752,e,i)),sampleCoverage:(t,e,i)=>t.sampleCoverage(Qut(32938,e,i),Qut(32939,e,i)),stencilFuncFront:(t,e,i)=>t.stencilFuncSeparate(1028,Qut(2962,e,i),Qut(2967,e,i),Qut(2963,e,i)),stencilFuncBack:(t,e,i)=>t.stencilFuncSeparate(1029,Qut(34816,e,i),Qut(36003,e,i),Qut(36004,e,i)),stencilOpFront:(t,e,i)=>t.stencilOpSeparate(1028,Qut(2964,e,i),Qut(2965,e,i),Qut(2966,e,i)),stencilOpBack:(t,e,i)=>t.stencilOpSeparate(1029,Qut(34817,e,i),Qut(34818,e,i),Qut(34819,e,i))},Kut={enable:(t,e)=>t({[e]:!0}),disable:(t,e)=>t({[e]:!1}),pixelStorei:(t,e,i)=>t({[e]:i}),hint:(t,e,i)=>t({[e]:i}),bindFramebuffer:(t,e,i)=>{switch(e){case 36160:return t({36006:i,36010:i});case 36009:return t({36006:i});case 36008:return t({36010:i});default:return null}},blendColor:(t,e,i,n,r)=>t({32773:new Float32Array([e,i,n,r])}),blendEquation:(t,e)=>t({32777:e,34877:e}),blendEquationSeparate:(t,e,i)=>t({32777:e,34877:i}),blendFunc:(t,e,i)=>t({32969:e,32968:i,32971:e,32970:i}),blendFuncSeparate:(t,e,i,n,r)=>t({32969:e,32968:i,32971:n,32970:r}),clearColor:(t,e,i,n,r)=>t({3106:new Float32Array([e,i,n,r])}),clearDepth:(t,e)=>t({2931:e}),clearStencil:(t,e)=>t({2961:e}),colorMask:(t,e,i,n,r)=>t({3107:[e,i,n,r]}),cullFace:(t,e)=>t({2885:e}),depthFunc:(t,e)=>t({2932:e}),depthRange:(t,e,i)=>t({2928:new Float32Array([e,i])}),depthMask:(t,e)=>t({2930:e}),frontFace:(t,e)=>t({2886:e}),lineWidth:(t,e)=>t({2849:e}),polygonOffset:(t,e,i)=>t({32824:e,10752:i}),sampleCoverage:(t,e,i)=>t({32938:e,32939:i}),scissor:(t,e,i,n,r)=>t({3088:new Int32Array([e,i,n,r])}),stencilMask:(t,e)=>t({2968:e,36005:e}),stencilMaskSeparate:(t,e,i)=>t({[1028===e?2968:36005]:i}),stencilFunc:(t,e,i,n)=>t({2962:e,2967:i,2963:n,34816:e,36003:i,36004:n}),stencilFuncSeparate:(t,e,i,n,r)=>t({[1028===e?2962:34816]:i,[1028===e?2967:36003]:n,[1028===e?2963:36004]:r}),stencilOp:(t,e,i,n)=>t({2964:e,2965:i,2966:n,34817:e,34818:i,34819:n}),stencilOpSeparate:(t,e,i,n,r)=>t({[1028===e?2964:34817]:i,[1028===e?2965:34818]:n,[1028===e?2966:34819]:r}),viewport:(t,e,i,n,r)=>t({2978:[e,i,n,r]})},$ut=(t,e)=>t.isEnabled(e),tht={3042:$ut,2884:$ut,2929:$ut,3024:$ut,32823:$ut,32926:$ut,32928:$ut,3089:$ut,2960:$ut,35977:$ut};function eht(t){for(const e in t)return!1;return!0}function iht(t,e){if(t===e)return!0;const i=Array.isArray(t)||ArrayBuffer.isView(t),n=Array.isArray(e)||ArrayBuffer.isView(e);if(i&&n&&t.length===e.length){for(let i=0;i<t.length;++i)if(t[i]!==e[i])return!1;return!0}return!1}function nht(t,e){const i=t[e].bind(t);t[e]=function(){const e=arguments.length<=0?void 0:arguments[0];return e in t.state.cache&&t.state.enable?t.state.cache[e]:i(...arguments)},Object.defineProperty(t[e],"name",{value:"".concat(e,"-from-cache"),configurable:!1})}function rht(t,e,i){const n=t[e].bind(t);t[e]=function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];const{valueChanged:s,oldValue:a}=i(t.state._updateCache,...r);return s&&n(...r),a},Object.defineProperty(t[e],"name",{value:"".concat(e,"-to-cache"),configurable:!1})}class oht{constructor(t){let{copyState:e=!1,log:i=(()=>{})}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.gl=t,this.program=null,this.stateStack=[],this.enable=!0,this.cache=e?cht(t):Object.assign({},Hut),this.log=i,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(){this.stateStack.push({})}pop(){Sut(this.stateStack.length>0);const t=this.stateStack[this.stateStack.length-1];lht(this.gl,t),this.stateStack.pop()}_updateCache(t){let e,i=!1;const n=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(const r in t){Sut(void 0!==r);const o=t[r],s=this.cache[r];iht(o,s)||(i=!0,e=s,n&&!(r in n)&&(n[r]=s),this.cache[r]=o)}return{valueChanged:i,oldValue:e}}}function sht(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{enable:i=!0,copyState:n}=e;if(Sut(void 0!==n),!t.state){const{polyfillContext:e}=globalThis;e&&e(t),t.state=new oht(t,{copyState:n}),function(t){const e=t.useProgram.bind(t);t.useProgram=function(i){t.state.program!==i&&(e(i),t.state.program=i)}}(t);for(const e in Kut){rht(t,e,Kut[e])}nht(t,"getParameter"),nht(t,"isEnabled")}return t.state.enable=i,t}function aht(t){Sut(t.state),t.state.pop()}function lht(t,e){if(Sut(Tut(t),"setParameters requires a WebGL context"),eht(e))return;const i={};for(const n in e){const r=Number(n),o=Yut[n];o&&("string"==typeof o?i[o]=!0:o(t,e[n],r))}const n=t.state&&t.state.cache;if(n)for(const r in i){(0,Jut[r])(t,e,n)}}function cht(t,e){if("number"==typeof(e=e||Hut)){const i=e,n=tht[i];return n?n(t,i):t.getParameter(i)}const i=Array.isArray(e)?e:Object.keys(e),n={};for(const e of i){const i=tht[e];n[e]=i?i(t,Number(e)):t.getParameter(Number(e))}return n}function uht(t,e,i){if(eht(e))return i(t);const{nocatch:n=!0}=e;let r;if(function(t){t.state||sht(t,{copyState:!1}),t.state.push()}(t),lht(t,e),n)r=i(t),aht(t);else try{r=i(t)}finally{aht(t)}return r}function hht(t){const{luma:e}=t;if(t.canvas&&e){const i=e.canvasSizeInfo,n="clientWidth"in i?i.clientWidth:t.canvas.clientWidth;return n?t.drawingBufferWidth/n:1}return 1}function pht(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(t,e,i,n,r){const o=dht(t[0],e,i);let s=fht(t[1],e,n,r),a=dht(t[0]+1,e,i);const l=a===i-1?a:a-1;let c;a=fht(t[1]+1,e,n,r),r?(a=0===a?a:a+1,c=s,s=a):c=a===n-1?a:a-1;return{x:o,y:s,width:Math.max(l-o+1,1),height:Math.max(c-s+1,1)}}(e,hht(t),t.drawingBufferWidth,t.drawingBufferHeight,i)}function dht(t,e,i){return Math.min(Math.round(t*e),i-1)}function fht(t,e,i,n){return n?Math.max(0,i-1-Math.round(t*e)):Math.min(Math.round(t*e),i-1)}const mht=Wct(),ght=mht&&"undefined"!=typeof document,yht={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function vht(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Sut(mht,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),t=Object.assign({},yht,t);const{width:e,height:i}=t;function n(e){if(t.throwOnError)throw new Error(e);return console.error(e),null}let r;t.onError=n;const{canvas:o}=t,s=function(t){let e,{canvas:i,width:n=800,height:r=600,onError:o}=t;if("string"==typeof i){ght&&"complete"===document.readyState||o("createGLContext called on canvas '".concat(i,"' before page was loaded")),e=document.getElementById(i)}else i?e=i:(e=document.createElement("canvas"),e.id="lumagl-canvas",e.style.width=Number.isFinite(n)?"".concat(n,"px"):"100%",e.style.height=Number.isFinite(r)?"".concat(r,"px"):"100%",document.body.insertBefore(e,document.body.firstChild));return e}({canvas:o,width:e,height:i,onError:n});return r=function(t,e){const{onError:i}=e;let n=null;const r=t=>n=t.statusMessage||n;t.addEventListener("webglcontextcreationerror",r,!1);const{webgl1:o=!0,webgl2:s=!0}=e;let a=null;s&&(a=a||t.getContext("webgl2",e),a=a||t.getContext("experimental-webgl2",e));o&&(a=a||t.getContext("webgl",e),a=a||t.getContext("experimental-webgl",e));if(t.removeEventListener("webglcontextcreationerror",r,!1),!a)return i("Failed to create ".concat(s&&!o?"WebGL2":"WebGL"," context: ").concat(n||"Unknown error"));e.onContextLost&&t.addEventListener("webglcontextlost",e.onContextLost,!1);e.onContextRestored&&t.addEventListener("webglcontextrestored",e.onContextRestored,!1);return a}(s,t),r?(r=_ht(r,t),function(t){const e=Iut(t)?"WebGL2":"WebGL1",i=function(t){const e=t.getParameter(7936),i=t.getParameter(7937),n=t.getExtension("WEBGL_debug_renderer_info"),r=n&&t.getParameter(n.UNMASKED_VENDOR_WEBGL||7936),o=n&&t.getParameter(n.UNMASKED_RENDERER_WEBGL||7937);return{vendor:r||e,renderer:o||i,vendorMasked:e,rendererMasked:i,version:t.getParameter(7938),shadingLanguageVersion:t.getParameter(35724)}}(t),n=i?"(".concat(i.vendor,",").concat(i.renderer,")"):"",r=t.debug?" debug":"";Eut.info(1,"".concat(e).concat(r," context ").concat(n))()}(r),r):null}function _ht(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t||t._instrumented)return t;t._version=t._version||function(t){if("undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext)return 2;return 1}(t),t.luma=t.luma||{},t.luma.canvasSizeInfo=t.luma.canvasSizeInfo||{},e=Object.assign({},yht,e);const{manageState:i,debug:n}=e;return i&&sht(t,{copyState:!1,log:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return Eut.log(1,...e)()}}),mht&&n&&(globalThis.makeDebugContext?(t=globalThis.makeDebugContext(t,e),Eut.level=Math.max(Eut.level,1)):Eut.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),t._instrumented=!0,t}function xht(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t.canvas){return void function(t,e,i){let n="width"in i?i.width:t.canvas.clientWidth,r="height"in i?i.height:t.canvas.clientHeight;n&&r||(Eut.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,n=t.canvas.width||1,r=t.canvas.height||1);t.luma=t.luma||{},t.luma.canvasSizeInfo=t.luma.canvasSizeInfo||{};const o=t.luma.canvasSizeInfo;if(o.clientWidth!==n||o.clientHeight!==r||o.devicePixelRatio!==e){let i=e;const o=Math.floor(n*i),s=Math.floor(r*i);t.canvas.width=o,t.canvas.height=s,t.drawingBufferWidth===o&&t.drawingBufferHeight===s||(Eut.warn("Device pixel ratio clamped")(),i=Math.min(t.drawingBufferWidth/n,t.drawingBufferHeight/r),t.canvas.width=Math.floor(n*i),t.canvas.height=Math.floor(r*i)),Object.assign(t.luma.canvasSizeInfo,{clientWidth:n,clientHeight:r,devicePixelRatio:e})}}(t,function(t){const e="undefined"==typeof window?1:window.devicePixelRatio||1;return Number.isFinite(t)?t<=0?1:t:t?e:1}(e.useDevicePixels),e)}const i=t.getExtension("STACKGL_resize_drawingbuffer");i&&"width"in e&&"height"in e&&i.resize(e.width,e.height)}function bht(){let t;if("undefined"!=typeof window&&window.performance)t=window.performance.now();else if(void 0!==process&&process.hrtime){const e=process.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}class wht{constructor(t,e){cat(this,"name",void 0),cat(this,"type",void 0),cat(this,"sampleSize",1),cat(this,"time",void 0),cat(this,"count",void 0),cat(this,"samples",void 0),cat(this,"lastTiming",void 0),cat(this,"lastSampleTime",void 0),cat(this,"lastSampleCount",void 0),cat(this,"_count",0),cat(this,"_time",0),cat(this,"_samples",0),cat(this,"_startTime",0),cat(this,"_timerPending",!1),this.name=t,this.type=e,this.reset()}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=bht(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(bht()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class Aht{constructor(t){cat(this,"id",void 0),cat(this,"stats",{}),this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"count";return this._getOrCreate({name:t,type:e})}get size(){return Object.keys(this.stats).length}reset(){for(const t in this.stats)this.stats[t].reset();return this}forEach(t){for(const e in this.stats)t(this.stats[e])}getTable(){const t={};return this.forEach((e=>{t[e.name]={time:e.time||0,count:e.count||0,average:e.getAverageTime()||0,hz:e.getHz()||0}})),t}_initializeStats(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((t=>this._getOrCreate(t)))}_getOrCreate(t){if(!t||!t.name)return null;const{name:e,type:i}=t;return this.stats[e]||(this.stats[e]=t instanceof wht?t:new wht(e,i)),this.stats[e]}}const Eht="8.5.21";const Sht=new class{constructor(){this.stats=new Map}get(t){return this.stats.has(t)||this.stats.set(t,new Aht({id:t})),this.stats.get(t)}};if(globalThis.luma&&globalThis.luma.VERSION!==Eht)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat(Eht));function Mht(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}function Tht(t,e){if("string"!=typeof e)return e;const i=Number(e);if(!isNaN(i))return i;const n=t[e=e.replace(/^.*\./,"")];return Mht(void 0!==n,"Accessing undefined constant GL.".concat(e)),n}function Iht(t,e){e=Number(e);for(const i in t)if(t[i]===e)return"GL.".concat(i);return String(e)}globalThis.luma||(Wct()&&Eut.log(1,"luma.gl ".concat(Eht," - ").concat("set luma.log.level=1 (or higher) to trace rendering"))(),globalThis.luma=globalThis.luma||{VERSION:Eht,version:Eht,log:Eut,stats:Sht,globals:{modules:{},nodeIO:{}}});const Cht={};function Pht(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";Cht[t]=Cht[t]||1;const e=Cht[t]++;return"".concat(t,"-").concat(e)}function Lht(t){return Mht("number"==typeof t,"Input must be a number"),t&&0==(t&t-1)}function Dht(t){let e=!0;for(const i in t){e=!1;break}return e}function Rht(t,e,i,n){const r="See luma.gl ".concat(i," Upgrade Guide at https://luma.gl/docs/upgrade-guide"),o=Object.getPrototypeOf(t);n.forEach((t=>{o.methodName||(o[t]=()=>{throw Eut.removed("Calling removed method ".concat(e,".").concat(t,": "),r)(),new Error(t)})}))}const Oht="Resource subclass must define virtual methods";class kht{get[Symbol.toStringTag](){return"Resource"}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Cut(t);const{id:i,userData:n={}}=e;this.gl=t,this.gl2=t,this.id=i||Pht(this[Symbol.toStringTag]),this.userData=n,this._bound=!1,this._handle=e.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}toString(){return"".concat(this[Symbol.toStringTag]||this.constructor.name,"(").concat(this.id,")")}get handle(){return this._handle}delete(){let{deleteChildren:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,e&&t&&e.filter(Boolean).forEach((t=>t.delete())),this}bind(){let t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!=typeof e?(this._bindHandle(e),this):(this._bound?t=e():(this._bindHandle(this.handle),this._bound=!0,t=e(),this._bound=!1,this._bindHandle(null)),t)}unbind(){this.bind(null)}getParameter(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Mht(t=Tht(this.gl,t));const i=(this.constructor.PARAMETERS||{})[t];if(i){const t=Iut(this.gl);if(!((!("webgl2"in i)||t)&&(!("extension"in i)||this.gl.getExtension(i.extension)))){const e=i.webgl1,n="webgl2"in i?i.webgl2:i.webgl1;return t?n:e}}return this._getParameter(t,e)}getParameters(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{parameters:e,keys:i}=t,n=this.constructor.PARAMETERS||{},r=Iut(this.gl),o={},s=e||Object.keys(n);for(const e of s){const s=n[e];if(s&&(!("webgl2"in s)||r)&&(!("extension"in s)||this.gl.getExtension(s.extension))){const n=i?Iht(this.gl,e):e;o[n]=this.getParameter(e,t),i&&"GLenum"===s.type&&(o[n]=Iht(this.gl,o[n]))}}return o}setParameter(t,e){Mht(t=Tht(this.gl,t));const i=(this.constructor.PARAMETERS||{})[t];if(i){const t=Iut(this.gl);if(!((!("webgl2"in i)||t)&&(!("extension"in i)||this.gl.getExtension(i.extension))))throw new Error("Parameter not available on this platform");"GLenum"===i.type&&(e=Tht(e))}return this._setParameter(t,e),this}setParameters(t){for(const e in t)this.setParameter(e,t[e]);return this}stubRemovedMethods(t,e,i){return Rht(this,t,e,i)}initialize(t){}_createHandle(){throw new Error(Oht)}_deleteHandle(){throw new Error(Oht)}_bindHandle(t){throw new Error(Oht)}_getOptsFromHandle(){throw new Error(Oht)}_getParameter(t,e){throw new Error(Oht)}_setParameter(t,e){throw new Error(Oht)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const t=this[Symbol.toStringTag],e=Sht.get("Resource Counts");e.get("Resources Created").incrementCount(),e.get("".concat(t,"s Created")).incrementCount(),e.get("".concat(t,"s Active")).incrementCount()}_removeStats(){const t=this[Symbol.toStringTag];Sht.get("Resource Counts").get("".concat(t,"s Active")).decrementCount()}_trackAllocatedMemory(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this[Symbol.toStringTag];this._trackAllocatedMemoryForContext(t,e),this._trackAllocatedMemoryForContext(t,e,this.gl.canvas&&this.gl.canvas.id),this.byteLength=t}_trackAllocatedMemoryForContext(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this[Symbol.toStringTag],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n=Sht.get("Memory Usage".concat(i));n.get("GPU Memory").addCount(t),n.get("".concat(e," Memory")).addCount(t)}_trackDeallocatedMemory(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this[Symbol.toStringTag];this._trackDeallocatedMemoryForContext(t),this._trackDeallocatedMemoryForContext(t,this.gl.canvas&&this.gl.canvas.id),this.byteLength=0}_trackDeallocatedMemoryForContext(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this[Symbol.toStringTag],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const i=Sht.get("Memory Usage".concat(e));i.get("GPU Memory").subtractCount(this.byteLength),i.get("".concat(t," Memory")).subtractCount(this.byteLength)}}const Nht="Failed to deduce GL constant from typed array";function Bht(t){switch(ArrayBuffer.isView(t)?t.constructor:t){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(Nht)}}function zht(t){let{clamped:e=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(t){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return e?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function Fht(t){let{data:e,width:i,height:n}=t;const r=Math.round(i/2),o=Math.round(n/2),s=new Uint8Array(r*o*4);for(let t=0;t<o;t++)for(let n=0;n<r;n++)for(let o=0;o<4;o++)s[4*(t*r+n)+o]=e[4*(2*t*i+2*n)+o];return{data:s,width:r,height:o}}function Vht(t,e,i){const{removedProps:n={},deprecatedProps:r={},replacedProps:o={}}=i;for(const i in n)if(i in e){const e=n[i]?"".concat(t,".").concat(n[i]):"N/A";Eut.removed("".concat(t,".").concat(i),e)()}for(const i in r)if(i in e){const e=r[i];Eut.deprecated("".concat(t,".").concat(i),"".concat(t,".").concat(e))()}let s=null;for(const i in o)if(i in e){const n=o[i];Eut.deprecated("".concat(t,".").concat(i),"".concat(t,".").concat(n))(),s=s||Object.assign({},e),s[n]=e[i],delete s[i]}return s||e}const Uht={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},Ght={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}};class jht{static getBytesPerElement(t){return zht(t.type||5126).BYTES_PER_ELEMENT}static getBytesPerVertex(t){Mht(t.size);return zht(t.type||5126).BYTES_PER_ELEMENT*t.size}static resolve(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return new jht(...[Uht,...e])}constructor(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];e.forEach((t=>this._assign(t))),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return jht.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return jht.getBytesPerVertex(this)}_assign(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=Vht("Accessor",t,Ght),void 0!==t.type&&(this.type=t.type,5124!==t.type&&5125!==t.type||(this.integer=!0)),void 0!==t.size&&(this.size=t.size),void 0!==t.offset&&(this.offset=t.offset),void 0!==t.stride&&(this.stride=t.stride),void 0!==t.normalized&&(this.normalized=t.normalized),void 0!==t.integer&&(this.integer=t.integer),void 0!==t.divisor&&(this.divisor=t.divisor),void 0!==t.buffer&&(this.buffer=t.buffer),void 0!==t.index&&("boolean"==typeof t.index?this.index=t.index?1:0:this.index=t.index),void 0!==t.instanced&&(this.divisor=t.instanced?1:0),void 0!==t.isInstanced&&(this.divisor=t.isInstanced?1:0),this}}const Hht={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},Wht={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:Hht},qht={removedProps:Hht};class Xht extends kht{get[Symbol.toStringTag](){return"Buffer"}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,e),this.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),this.target=e.target||(this.gl.webgl2?36662:34962),this.initialize(e),Object.seal(this)}getElementCount(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/jht.getBytesPerElement(t))}getVertexCount(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/jht.getBytesPerVertex(t))}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ArrayBuffer.isView(t)&&(t={data:t}),Number.isFinite(t)&&(t={byteLength:t}),t=Vht("Buffer",t,Wht),this.usage=t.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},t,t.accessor)),t.data?this._setData(t.data,t.offset,t.byteLength):this._setByteLength(t.byteLength||0),this}setProps(t){return"accessor"in(t=Vht("Buffer",t,qht))&&this.setAccessor(t.accessor),this}setAccessor(t){return delete(t=Object.assign({},t)).buffer,this.accessor=new jht(t),this}reallocate(t){return t>this.byteLength?(this._setByteLength(t),!0):(this.bytesUsed=t,!1)}setData(t){return this.initialize(t)}subData(t){ArrayBuffer.isView(t)&&(t={data:t});const{data:e,offset:i=0,srcOffset:n=0}=t,r=t.byteLength||t.length;Mht(e);const o=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(o,this.handle),0!==n||void 0!==r?(Put(this.gl),this.gl.bufferSubData(this.target,i,e,n,r)):this.gl.bufferSubData(o,i,e),this.gl.bindBuffer(o,null),this.debugData=null,this._inferType(e),this}copyData(t){let{sourceBuffer:e,readOffset:i=0,writeOffset:n=0,size:r}=t;const{gl:o}=this;return Put(o),o.bindBuffer(36662,e.handle),o.bindBuffer(36663,this.handle),o.copyBufferSubData(36662,36663,i,n,r),o.bindBuffer(36662,null),o.bindBuffer(36663,null),this.debugData=null,this}getData(){let{dstData:t=null,srcByteOffset:e=0,dstOffset:i=0,length:n=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Put(this.gl);const r=zht(this.accessor.type||5126,{clamped:!1}),o=this._getAvailableElementCount(e),s=i;let a,l;t?(l=t.length,a=l-s):(a=Math.min(o,n||o),l=s+a);const c=Math.min(o,a);return n=n||c,Mht(n<=c),t=t||new r(l),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,e,t,i,n),this.gl.bindBuffer(36662,null),t}bind(){let{target:t=this.target,index:e=this.accessor&&this.accessor.index,offset:i=0,size:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return 35345===t||35982===t?void 0!==n?this.gl.bindBufferRange(t,e,this.handle,i,n):(Mht(0===i),this.gl.bindBufferBase(t,e,this.handle)):this.gl.bindBuffer(t,this.handle),this}unbind(){let{target:t=this.target,index:e=this.accessor&&this.accessor.index}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return 35345===t||35982===t?this.gl.bindBufferBase(t,e,null):this.gl.bindBuffer(t,null),this}getDebugData(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}invalidateDebugData(){this.debugData=null}_setData(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.byteLength+e;Mht(ArrayBuffer.isView(t)),this._trackDeallocatedMemory();const n=this._getTarget();this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,i,this.usage),this.gl.bufferSubData(n,e,t),this.gl.bindBuffer(n,null),this.debugData=t.slice(0,10),this.bytesUsed=i,this._trackAllocatedMemory(i);const r=Bht(t);return Mht(r),this.setAccessor(new jht(this.accessor,{type:r})),this}_setByteLength(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Mht(t>=0),this._trackDeallocatedMemory();let i=t;0===t&&(i=new Float32Array(0));const n=this._getTarget();return this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,i,e),this.gl.bindBuffer(n,null),this.usage=e,this.debugData=null,this.bytesUsed=t,this._trackAllocatedMemory(t),this}_getTarget(){return this.gl.webgl2?36663:this.target}_getAvailableElementCount(t){const e=t/zht(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-e}_inferType(t){this.accessor.type||this.setAccessor(new jht(this.accessor,{type:Bht(t)}))}_createHandle(){return this.gl.createBuffer()}_deleteHandle(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}_getParameter(t){this.gl.bindBuffer(this.target,this.handle);const e=this.gl.getBufferParameter(this.target,t);return this.gl.bindBuffer(this.target,null),e}get type(){return Eut.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return Eut.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(t){return Eut.deprecated("setByteLength","reallocate")(),this.reallocate(t)}updateAccessor(t){return Eut.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new jht(this.accessor,t),this}}const Zht={6407:{dataFormat:6407,types:[5121,33635]},6408:{dataFormat:6408,types:[5121,32819,32820]},6406:{dataFormat:6406,types:[5121]},6409:{dataFormat:6409,types:[5121]},6410:{dataFormat:6410,types:[5121]},33326:{dataFormat:6403,types:[5126],gl2:!0},33328:{dataFormat:33319,types:[5126],gl2:!0},34837:{dataFormat:6407,types:[5126],gl2:!0},34836:{dataFormat:6408,types:[5126],gl2:!0}},Yht={6403:1,36244:1,33319:2,33320:2,6407:3,36248:3,6408:4,36249:4,6402:1,34041:1,6406:1,6409:1,6410:2},Qht={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1};const Jht=[9729,9728],Kht=globalThis.WebGLBuffer||function(){};class $ht extends kht{get[Symbol.toStringTag](){return"Texture"}static isSupported(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{format:i,linearFiltering:n}=e;let r=!0;return i&&(r=r&&function(t,e){const i=Zht[e];if(!i)return!1;if(void 0===i.gl1&&void 0===i.gl2)return!0;const n=Iut(t)&&i.gl2||i.gl1;return"string"==typeof n?t.getExtension(n):n}(t,i),r=r&&(!n||function(t,e){const i=Zht[e];switch(i&&i.types[0]){case 5126:return t.getExtension("OES_texture_float_linear");case 5131:return t.getExtension("OES_texture_half_float_linear");default:return!0}}(t,i))),r}constructor(t,e){const{id:i=Pht("texture"),handle:n,target:r}=e;super(t,{id:i,handle:n}),this.target=r,this.textureUnit=void 0,this.loaded=!1,this.width=void 0,this.height=void 0,this.depth=void 0,this.format=void 0,this.type=void 0,this.dataFormat=void 0,this.border=void 0,this.textureUnit=void 0,this.mipmaps=void 0}toString(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.data;if(e instanceof Promise)return e.then((e=>this.initialize(Object.assign({},t,{pixels:e,data:e})))),this;const i="undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement;if(i&&e.readyState<HTMLVideoElement.HAVE_METADATA)return this._video=null,e.addEventListener("loadeddata",(()=>this.initialize(t))),this;const{pixels:n=null,format:r=6408,border:o=0,recreate:s=!1,parameters:a={},pixelStore:l={},textureUnit:c}=t;e||(e=n);let{width:u,height:h,dataFormat:p,type:d,compressed:f=!1,mipmaps:m=!0}=t;const{depth:g=0}=t;return({width:u,height:h,compressed:f,dataFormat:p,type:d}=this._deduceParameters({format:r,type:d,dataFormat:p,compressed:f,data:e,width:u,height:h})),this.width=u,this.height=h,this.depth=g,this.format=r,this.type=d,this.dataFormat=p,this.border=o,this.textureUnit=c,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),m&&this._isNPOT()&&(Eut.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),m=!1,this._updateForNPOT(a)),this.mipmaps=m,this.setImageData({data:e,width:u,height:h,depth:g,format:r,type:d,dataFormat:p,border:o,mipmaps:m,parameters:l,compressed:f}),m&&this.generateMipmap(),this.setParameters(a),s&&(this.data=e),i&&(this._video={video:e,parameters:a,lastTime:e.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?e.currentTime:-1}),this}update(){if(this._video){const{video:t,parameters:e,lastTime:i}=this._video;if(i===t.currentTime||t.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:t,parameters:e}),this.mipmaps&&this.generateMipmap(),this._video.lastTime=t.currentTime}}resize(t){let{height:e,width:i,mipmaps:n=!1}=t;return i!==this.width||e!==this.height?this.initialize({width:i,height:e,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:n}):this}generateMipmap(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isNPOT()?(Eut.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),uht(this.gl,t,(()=>{this.gl.generateMipmap(this.target)})),this.gl.bindTexture(this.target,null),this)}setImageData(t){this._trackDeallocatedMemory("Texture");const{target:e=this.target,pixels:i=null,level:n=0,format:r=this.format,border:o=this.border,offset:s=0,parameters:a={}}=t;let{data:l=null,type:c=this.type,width:u=this.width,height:h=this.height,dataFormat:p=this.dataFormat,compressed:d=!1}=t;l||(l=i),({type:c,dataFormat:p,compressed:d,width:u,height:h}=this._deduceParameters({format:r,type:c,dataFormat:p,compressed:d,data:l,width:u,height:h}));const{gl:f}=this;f.bindTexture(this.target,this.handle);let m,g=null;({data:l,dataType:g}=this._getDataType({data:l,compressed:d}));let y=0;if(uht(this.gl,a,(()=>{switch(g){case"null":f.texImage2D(e,n,r,u,h,o,p,c,l);break;case"typed-array":f.texImage2D(e,n,r,u,h,o,p,c,l,s);break;case"buffer":m=Put(f),m.bindBuffer(35052,l.handle||l),m.texImage2D(e,n,r,u,h,o,p,c,s),m.bindBuffer(35052,null);break;case"browser-object":Iut(f)?f.texImage2D(e,n,r,u,h,o,p,c,l):f.texImage2D(e,n,r,p,c,l);break;case"compressed":for(const[t,i]of l.entries())f.compressedTexImage2D(e,t,i.format,i.width,i.height,o,i.data),y+=i.levelSize;break;default:Mht(!1,"Unknown image data type")}})),"compressed"===g)this._trackAllocatedMemory(y,"Texture");else if(l&&l.byteLength)this._trackAllocatedMemory(l.byteLength,"Texture");else{const t=Yht[this.dataFormat]||4,e=Qht[this.type]||1;this._trackAllocatedMemory(this.width*this.height*t*e,"Texture")}return this.loaded=!0,this}setSubImageData(t){let{target:e=this.target,pixels:i=null,data:n=null,x:r=0,y:o=0,width:s=this.width,height:a=this.height,level:l=0,format:c=this.format,type:u=this.type,dataFormat:h=this.dataFormat,compressed:p=!1,offset:d=0,border:f=this.border,parameters:m={}}=t;if(({type:u,dataFormat:h,compressed:p,width:s,height:a}=this._deduceParameters({format:c,type:u,dataFormat:h,compressed:p,data:n,width:s,height:a})),Mht(0===this.depth,"texSubImage not supported for 3D textures"),n||(n=i),n&&n.data){const t=n;n=t.data,s=t.shape[0],a=t.shape[1]}n instanceof Xht&&(n=n.handle),this.gl.bindTexture(this.target,this.handle),uht(this.gl,m,(()=>{if(p)this.gl.compressedTexSubImage2D(e,l,r,o,s,a,c,n);else if(null===n)this.gl.texSubImage2D(e,l,r,o,s,a,h,u,null);else if(ArrayBuffer.isView(n))this.gl.texSubImage2D(e,l,r,o,s,a,h,u,n,d);else if(n instanceof Kht){const t=Put(this.gl);t.bindBuffer(35052,n),t.texSubImage2D(e,l,r,o,s,a,h,u,d),t.bindBuffer(35052,null)}else if(Iut(this.gl)){Put(this.gl).texSubImage2D(e,l,r,o,s,a,h,u,n)}else this.gl.texSubImage2D(e,l,r,o,h,u,n)})),this.gl.bindTexture(this.target,null)}copyFramebuffer(){return Eut.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit;const{gl:e}=this;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,this.handle),t}unbind(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit;const{gl:e}=this;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,null),t}_getDataType(t){let{data:e,compressed:i=!1}=t;return i?{data:e,dataType:"compressed"}:null===e?{data:e,dataType:"null"}:ArrayBuffer.isView(e)?{data:e,dataType:"typed-array"}:e instanceof Xht?{data:e.handle,dataType:"buffer"}:e instanceof Kht?{data:e,dataType:"buffer"}:{data:e,dataType:"browser-object"}}_deduceParameters(t){const{format:e,data:i}=t;let{width:n,height:r,dataFormat:o,type:s,compressed:a}=t;const l=Zht[e];return o=o||l&&l.dataFormat,s=s||l&&l.types[0],a=a||l&&l.compressed,({width:n,height:r}=this._deduceImageSize(i,n,r)),{dataFormat:o,type:s,compressed:a,width:n,height:r,format:e,data:i}}_deduceImageSize(t,e,i){let n;return n="undefined"!=typeof ImageData&&t instanceof ImageData?{width:t.width,height:t.height}:"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement?{width:t.naturalWidth,height:t.naturalHeight}:"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?{width:t.width,height:t.height}:"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t?{width:e,height:i}:{width:e>=0?e:1,height:i>=0?i:1},Mht(n,"Could not deduced texture size"),Mht(void 0===e||n.width===e,"Deduced texture width does not match supplied width"),Mht(void 0===i||n.height===i,"Deduced texture height does not match supplied height"),n}_createHandle(){return this.gl.createTexture()}_deleteHandle(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}_getParameter(t){switch(t){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);const e=this.gl.getTexParameter(this.target,t);return this.gl.bindTexture(this.target,null),e}}_setParameter(t,e){switch(this.gl.bindTexture(this.target,this.handle),e=this._getNPOTParam(t,e),t){case 33082:case 33083:this.gl.texParameterf(this.handle,t,e);break;case 4096:case 4097:Mht(!1);break;default:this.gl.texParameteri(this.target,t,e)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!Iut(this.gl)&&(!(!this.width||!this.height)&&(!Lht(this.width)||!Lht(this.height)))}_updateForNPOT(t){void 0===t[this.gl.TEXTURE_MIN_FILTER]&&(t[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===t[this.gl.TEXTURE_WRAP_S]&&(t[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===t[this.gl.TEXTURE_WRAP_T]&&(t[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}_getNPOTParam(t,e){if(this._isNPOT())switch(t){case 10241:-1===Jht.indexOf(e)&&(e=9729);break;case 10242:case 10243:33071!==e&&(e=33071)}return e}}class tpt extends $ht{get[Symbol.toStringTag](){return"Texture2D"}static isSupported(t,e){return $ht.isSupported(t,e)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,n;Cut(t),(e instanceof Promise||"string"==typeof e)&&(e={data:e}),"string"==typeof e.data&&(e=Object.assign({},e,{data:(i=e.data,Mht("string"==typeof i),i=""+i,new Promise(((t,e)=>{try{const r=new Image;r.onload=()=>t(r),r.onerror=()=>e(new Error("Could not load image ".concat(i,"."))),r.crossOrigin=n&&n.crossOrigin||"anonymous",r.src=i}catch(t){e(t)}})))})),super(t,Object.assign({},e,{target:3553})),this.initialize(e),Object.seal(this)}}const ept=[34069,34070,34071,34072,34073,34074];class ipt extends $ht{get[Symbol.toStringTag](){return"TextureCube"}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Cut(t),super(t,Object.assign({},e,{target:34067})),this.initialize(e),Object.seal(this)}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{mipmaps:e=!0,parameters:i={}}=t;return this.opts=t,this.setCubeMapImageData(t).then((()=>{this.loaded=!0,e&&this.generateMipmap(t),this.setParameters(i)})),this}subImage(t){let{face:e,data:i,x:n=0,y:r=0,mipmapLevel:o=0}=t;return this._subImage({target:e,data:i,x:n,y:r,mipmapLevel:o})}async setCubeMapImageData(t){let{width:e,height:i,pixels:n,data:r,border:o=0,format:s=6408,type:a=5121}=t;const{gl:l}=this,c=n||r,u=await Promise.all(ept.map((t=>{const e=c[t];return Promise.all(Array.isArray(e)?e:[e])})));this.bind(),ept.forEach(((t,n)=>{u[n].length>1&&!1!==this.opts.mipmaps&&Eut.warn("".concat(this.id," has mipmap and multiple LODs."))(),u[n].forEach(((n,r)=>{e&&i?l.texImage2D(t,r,s,e,i,o,s,a,n):l.texImage2D(t,r,s,s,a,n)}))})),this.unbind()}setImageDataForFace(t){const{face:e,width:i,height:n,pixels:r,data:o,border:s=0,format:a=6408,type:l=5121}=t,{gl:c}=this,u=r||o;return this.bind(),u instanceof Promise?u.then((i=>this.setImageDataForFace(Object.assign({},t,{face:e,data:i,pixels:i})))):this.width||this.height?c.texImage2D(e,0,a,i,n,s,a,l,u):c.texImage2D(e,0,a,a,l,u),this}}ipt.FACES=ept;class npt extends $ht{get[Symbol.toStringTag](){return"Texture3D"}static isSupported(t){return Iut(t)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Put(t),e=Object.assign({depth:1},e,{target:32879,unpackFlipY:!1}),super(t,e),this.initialize(e),Object.seal(this)}setImageData(t){let{level:e=0,dataFormat:i=6408,width:n,height:r,depth:o=1,border:s=0,format:a,type:l=5121,offset:c=0,data:u,parameters:h={}}=t;if(this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),uht(this.gl,h,(()=>{ArrayBuffer.isView(u)&&this.gl.texImage3D(this.target,e,i,n,r,o,s,a,l,u),u instanceof Xht&&(this.gl.bindBuffer(35052,u.handle),this.gl.texImage3D(this.target,e,i,n,r,o,s,a,l,c))})),u&&u.byteLength)this._trackAllocatedMemory(u.byteLength,"Texture");else{const t=Yht[this.dataFormat]||4,e=Qht[this.type]||1;this._trackAllocatedMemory(this.width*this.height*this.depth*t*e,"Texture")}return this.loaded=!0,this}}const rpt="EXT_color_buffer_float";var opt={33189:{bpp:2},33190:{gl2:!0,bpp:3},36012:{gl2:!0,bpp:4},36168:{bpp:1},34041:{bpp:4},35056:{gl2:!0,bpp:4},36013:{gl2:!0,bpp:5},32854:{bpp:2},36194:{bpp:2},32855:{bpp:2},33321:{gl2:!0,bpp:1},33330:{gl2:!0,bpp:1},33329:{gl2:!0,bpp:1},33332:{gl2:!0,bpp:2},33331:{gl2:!0,bpp:2},33334:{gl2:!0,bpp:4},33333:{gl2:!0,bpp:4},33323:{gl2:!0,bpp:2},33336:{gl2:!0,bpp:2},33335:{gl2:!0,bpp:2},33338:{gl2:!0,bpp:4},33337:{gl2:!0,bpp:4},33340:{gl2:!0,bpp:8},33339:{gl2:!0,bpp:8},32849:{gl2:!0,bpp:3},32856:{gl2:!0,bpp:4},32857:{gl2:!0,bpp:4},36220:{gl2:!0,bpp:4},36238:{gl2:!0,bpp:4},36975:{gl2:!0,bpp:4},36214:{gl2:!0,bpp:8},36232:{gl2:!0,bpp:8},36226:{gl2:!0,bpp:16},36208:{gl2:!0,bpp:16},33325:{gl2:rpt,bpp:2},33327:{gl2:rpt,bpp:4},34842:{gl2:rpt,bpp:8},33326:{gl2:rpt,bpp:4},33328:{gl2:rpt,bpp:8},34836:{gl2:rpt,bpp:16},35898:{gl2:rpt,bpp:4}};class spt extends kht{get[Symbol.toStringTag](){return"Renderbuffer"}static isSupported(t){let{format:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{format:null};return!e||function(t,e,i){const n=i[e];if(!n)return!1;const r=Iut(t)&&n.gl2||n.gl1;return"string"==typeof r?t.getExtension(r):r}(t,e,opt)}static getSamplesForFormat(t,e){let{format:i}=e;return t.getInternalformatParameter(36161,i,32937)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,e),this.initialize(e),Object.seal(this)}initialize(t){let{format:e,width:i=1,height:n=1,samples:r=0}=t;return Mht(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==r&&Iut(this.gl)?this.gl.renderbufferStorageMultisample(36161,r,e,i,n):this.gl.renderbufferStorage(36161,e,i,n),this.format=e,this.width=i,this.height=n,this.samples=r,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*opt[this.format].bpp),this}resize(t){let{width:e,height:i}=t;return e!==this.width||i!==this.height?this.initialize({width:e,height:i,format:this.format,samples:this.samples}):this}_createHandle(){return this.gl.createRenderbuffer()}_deleteHandle(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}_bindHandle(t){this.gl.bindRenderbuffer(36161,t)}_syncHandle(t){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}_getParameter(t){this.gl.bindRenderbuffer(36161,this.handle);return this.gl.getRenderbufferParameter(36161,t)}}const apt=6144,lpt="clear: bad arguments";function cpt(t){let{framebuffer:e=null,color:i=null,depth:n=null,stencil:r=null}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const o={};e&&(o.framebuffer=e);let s=0;i&&(s|=16384,!0!==i&&(o.clearColor=i)),n&&(s|=256,!0!==n&&(o.clearDepth=n)),r&&(s|=1024,!0!==n&&(o.clearStencil=n)),Mht(0!==s,lpt),uht(t,o,(()=>{t.clear(s)}))}function upt(t){switch(t){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return Mht(!1),0}}function hpt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{sourceX:i=0,sourceY:n=0,sourceFormat:r=6408}=e;let{sourceAttachment:o=36064,target:s=null,sourceWidth:a,sourceHeight:l,sourceType:c}=e;const{framebuffer:u,deleteFramebuffer:h}=fpt(t);Mht(u);const{gl:p,handle:d,attachments:f}=u;a=a||u.width,l=l||u.height,36064===o&&null===d&&(o=1028),Mht(f[o]),c=c||f[o].type,s=function(t,e,i,n,r){if(t)return t;const o=zht(e=e||5121,{clamped:!1}),s=upt(i);return new o(n*r*s)}(s,c,r,a,l),c=c||Bht(s);const m=p.bindFramebuffer(36160,d);return p.readPixels(i,n,a,l,r,c,s),p.bindFramebuffer(36160,m||null),h&&u.delete(),s}function ppt(t,e){let{sourceX:i=0,sourceY:n=0,sourceFormat:r=6408,target:o=null,targetByteOffset:s=0,sourceWidth:a,sourceHeight:l,sourceType:c}=e;const{framebuffer:u,deleteFramebuffer:h}=fpt(t);Mht(u),a=a||u.width,l=l||u.height;const p=Put(u.gl);if(c=c||(o?o.type:5121),!o){const t=upt(r),e=function(t){switch(t){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return Mht(!1),0}}(c);o=new Xht(p,{byteLength:s+a*l*t*e,accessor:{type:c,size:t}})}return o.bind({target:35051}),uht(p,{framebuffer:u},(()=>{p.readPixels(i,n,a,l,r,c,s)})),o.unbind({target:35051}),h&&u.delete(),o}function dpt(t){let{sourceAttachment:e=36064,targetMaxHeight:i=Number.MAX_SAFE_INTEGER}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=hpt(t,{sourceAttachment:e}),{width:r,height:o}=t;for(;o>i;)({data:n,width:r,height:o}=Fht({data:n,width:r,height:o}));!function(t){let{data:e,width:i,height:n,bytesPerPixel:r=4,temp:o}=t;const s=i*r;o=o||new Uint8Array(s);for(let t=0;t<n/2;++t){const i=t*s,r=(n-t-1)*s;o.set(e.subarray(i,i+s)),e.copyWithin(i,r,r+s),e.set(o,r)}}({data:n,width:r,height:o});const s=document.createElement("canvas");s.width=r,s.height=o;const a=s.getContext("2d"),l=a.createImageData(r,o);return l.data.set(n),a.putImageData(l,0,0),s.toDataURL()}function fpt(t){return t instanceof Ppt?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:Lpt(t),deleteFramebuffer:!0}}const mpt="WEBGL2",gpt="TIMER_QUERY",ypt="ELEMENT_INDEX_UINT32",vpt="BLEND_EQUATION_MINMAX",_pt="FLOAT_BLEND",xpt="TEXTURE_FLOAT",bpt="COLOR_ATTACHMENT_RGBA32F",wpt="GLSL_DERIVATIVES",Apt="GLSL_TEXTURE_LOD";var Ept={[mpt]:[!1,!0],["VERTEX_ARRAY_OBJECT"]:["OES_vertex_array_object",!0],[gpt]:["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],["INSTANCED_RENDERING"]:["ANGLE_instanced_arrays",!0],["MULTIPLE_RENDER_TARGETS"]:["WEBGL_draw_buffers",!0],[ypt]:["OES_element_index_uint",!0],[vpt]:["EXT_blend_minmax",!0],[_pt]:["EXT_float_blend"],["COLOR_ENCODING_SRGB"]:["EXT_sRGB",!0],["TEXTURE_DEPTH"]:["WEBGL_depth_texture",!0],[xpt]:["OES_texture_float",!0],["TEXTURE_HALF_FLOAT"]:["OES_texture_half_float",!0],["TEXTURE_FILTER_LINEAR_FLOAT"]:["OES_texture_float_linear"],["TEXTURE_FILTER_LINEAR_HALF_FLOAT"]:["OES_texture_half_float_linear"],["TEXTURE_FILTER_ANISOTROPIC"]:["EXT_texture_filter_anisotropic"],[bpt]:[function(t){const e=new tpt(t,{format:6408,type:5126,dataFormat:6408}),i=new Ppt(t,{id:"test-framebuffer",check:!1,attachments:{36064:e}}),n=i.getStatus();return e.delete(),i.delete(),36053===n},"EXT_color_buffer_float"],["COLOR_ATTACHMENT_FLOAT"]:[!1,"EXT_color_buffer_float"],["COLOR_ATTACHMENT_HALF_FLOAT"]:["EXT_color_buffer_half_float"],["GLSL_FRAG_DATA"]:["WEBGL_draw_buffers",!0],["GLSL_FRAG_DEPTH"]:["EXT_frag_depth",!0],[wpt]:["OES_standard_derivatives",!0],[Apt]:["EXT_shader_texture_lod",!0]};const Spt=2;function Mpt(t,e){return Tpt(t,e)}function Tpt(t,e){return(e=Array.isArray(e)?e:[e]).every((e=>Ipt(t,e)))}function Ipt(t,e){return t.luma=t.luma||{},t.luma.caps=t.luma.caps||{},void 0===t.luma.caps[e]&&(t.luma.caps[e]=function(t,e){const i=Ept[e];let n;Mht(i,e);const r=Iut(t)&&i[1]||i[0];if("function"==typeof r)n=r(t);else if(Array.isArray(r)){n=!0;for(const e of r)n=n&&Boolean(t.getExtension(e))}else"string"==typeof r?n=Boolean(t.getExtension(r)):"boolean"==typeof r?n=r:Mht(!1);return n}(t,e)),t.luma.caps[e]||Eut.log(Spt,"Feature: ".concat(e," not supported"))(),t.luma.caps[e]}const Cpt="Multiple render targets not supported";class Ppt extends kht{get[Symbol.toStringTag](){return"Framebuffer"}static isSupported(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{colorBufferFloat:i,colorBufferHalfFloat:n}=e;let r=!0;return i&&(r=Boolean(t.getExtension("EXT_color_buffer_float")||t.getExtension("WEBGL_color_buffer_float")||t.getExtension("OES_texture_float"))),n&&(r=r&&Boolean(t.getExtension("EXT_color_buffer_float")||t.getExtension("EXT_color_buffer_half_float"))),r}static getDefaultFramebuffer(t){return t.luma=t.luma||{},t.luma.defaultFramebuffer=t.luma.defaultFramebuffer||new Ppt(t,{id:"default-framebuffer",handle:null,attachments:{}}),t.luma.defaultFramebuffer}get MAX_COLOR_ATTACHMENTS(){const t=Put(this.gl);return t.getParameter(t.MAX_COLOR_ATTACHMENTS)}get MAX_DRAW_BUFFERS(){const t=Put(this.gl);return t.getParameter(t.MAX_DRAW_BUFFERS)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,e),this.width=null,this.height=null,this.attachments={},this.readBuffer=36064,this.drawBuffers=[36064],this.ownResources=[],this.initialize(e),Object.seal(this)}get color(){return this.attachments[36064]||null}get texture(){return this.attachments[36064]||null}get depth(){return this.attachments[36096]||this.attachments[33306]||null}get stencil(){return this.attachments[36128]||this.attachments[33306]||null}initialize(t){let{width:e=1,height:i=1,attachments:n=null,color:r=!0,depth:o=!0,stencil:s=!1,check:a=!0,readBuffer:l,drawBuffers:c}=t;if(Mht(e>=0&&i>=0,"Width and height need to be integers"),this.width=e,this.height=i,n)for(const t in n){const r=n[t];(Array.isArray(r)?r[0]:r).resize({width:e,height:i})}else n=this._createDefaultAttachments(r,o,s,e,i);this.update({clearAttachments:!0,attachments:n,readBuffer:l,drawBuffers:c}),n&&a&&this.checkStatus()}delete(){for(const t of this.ownResources)t.delete();return super.delete(),this}update(t){let{attachments:e={},readBuffer:i,drawBuffers:n,clearAttachments:r=!1,resizeAttachments:o=!0}=t;this.attach(e,{clearAttachments:r,resizeAttachments:o});const{gl:s}=this,a=s.bindFramebuffer(36160,this.handle);return i&&this._setReadBuffer(i),n&&this._setDrawBuffers(n),s.bindFramebuffer(36160,a||null),this}resize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{width:e,height:i}=t;if(null===this.handle)return Mht(void 0===e&&void 0===i),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;void 0===e&&(e=this.gl.drawingBufferWidth),void 0===i&&(i=this.gl.drawingBufferHeight),e!==this.width&&i!==this.height&&Eut.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(e,"x").concat(i))();for(const t in this.attachments)this.attachments[t].resize({width:e,height:i});return this.width=e,this.height=i,this}attach(t){let{clearAttachments:e=!1,resizeAttachments:i=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={};e&&Object.keys(this.attachments).forEach((t=>{n[t]=null})),Object.assign(n,t);const r=this.gl.bindFramebuffer(36160,this.handle);for(const t in n){Mht(void 0!==t,"Misspelled framebuffer binding point?");const e=Number(t),r=n[e];let o=r;if(o)if(o instanceof spt)this._attachRenderbuffer({attachment:e,renderbuffer:o});else if(Array.isArray(r)){const[t,i=0,n=0]=r;o=t,this._attachTexture({attachment:e,texture:t,layer:i,level:n})}else this._attachTexture({attachment:e,texture:o,layer:0,level:0});else this._unattach(e);i&&o&&o.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,r||null),Object.assign(this.attachments,t),Object.keys(this.attachments).filter((t=>!this.attachments[t])).forEach((t=>{delete this.attachments[t]}))}checkStatus(){const t=this.getStatus();if(36053!==t)throw new Error(function(t){const e=Ppt.STATUS||{};return e[t]||"Framebuffer error ".concat(t)}(t));return this}getStatus(){const{gl:t}=this,e=t.bindFramebuffer(36160,this.handle),i=t.checkFramebufferStatus(36160);return t.bindFramebuffer(36160,e||null),i}clear(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{color:e,depth:i,stencil:n,drawBuffers:r=[]}=t,o=this.gl.bindFramebuffer(36160,this.handle);return(e||i||n)&&cpt(this.gl,{color:e,depth:i,stencil:n}),r.forEach(((t,e)=>{!function(t){let{framebuffer:e=null,buffer:i=apt,drawBuffer:n=0,value:r=[0,0,0,0]}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Put(t),uht(t,{framebuffer:e},(()=>{switch(i){case apt:switch(r.constructor){case Int32Array:t.clearBufferiv(i,n,r);break;case Uint32Array:t.clearBufferuiv(i,n,r);break;case Float32Array:default:t.clearBufferfv(i,n,r)}break;case 6145:t.clearBufferfv(6145,0,[r]);break;case 6146:t.clearBufferiv(6146,0,[r]);break;case 34041:const[e,o]=r;t.clearBufferfi(34041,0,e,o);break;default:Mht(!1,lpt)}}))}(this.gl,{drawBuffer:e,value:t})})),this.gl.bindFramebuffer(36160,o||null),this}readPixels(){return Eut.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(){return Eut.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(){return Eut.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(){return Eut.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(){return Eut.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(){return Eut.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}invalidate(t){let{attachments:e=[],x:i=0,y:n=0,width:r,height:o}=t;const s=Put(this.gl),a=s.bindFramebuffer(36008,this.handle);return 0===i&&0===n&&void 0===r&&void 0===o?s.invalidateFramebuffer(36008,e):s.invalidateFramebuffer(36008,e,i,n,r,o),s.bindFramebuffer(36008,a),this}getAttachmentParameter(t,e,i){let n=this._getAttachmentParameterFallback(e);return null===n&&(this.gl.bindFramebuffer(36160,this.handle),n=this.gl.getFramebufferAttachmentParameter(36160,t,e),this.gl.bindFramebuffer(36160,null)),i&&n>1e3&&(n=Iht(this.gl,n)),n}getAttachmentParameters(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36064,e=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[];const n={};for(const r of i){n[e?Iht(this.gl,r):r]=this.getAttachmentParameter(t,r,e)}return n}getParameters(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=Object.keys(this.attachments),i={};for(const n of e){const e=Number(n);i[t?Iht(this.gl,e):e]=this.getAttachmentParameters(e,t)}return i}show(){return"undefined"!=typeof window&&window.open(dpt(this),"luma-debug-texture"),this}log(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t>Eut.level||"undefined"==typeof window)return this;e=e||"Framebuffer ".concat(this.id);const i=dpt(this,{targetMaxHeight:100});return Eut.image({logLevel:t,message:e,image:i},e)(),this}bind(){let{target:t=36160}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.gl.bindFramebuffer(t,this.handle),this}unbind(){let{target:t=36160}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.gl.bindFramebuffer(t,null),this}_createDefaultAttachments(t,e,i,n,r){let o=null;return t&&(o=o||{},o[36064]=new tpt(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:n,height:r,mipmaps:!1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.ownResources.push(o[36064])),e&&i?(o=o||{},o[33306]=new spt(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:n,height:111}),this.ownResources.push(o[33306])):e?(o=o||{},o[36096]=new spt(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:n,height:r}),this.ownResources.push(o[36096])):i&&Mht(!1),o}_unattach(t){const e=this.attachments[t];e&&(e instanceof spt?this.gl.framebufferRenderbuffer(36160,t,36161,null):this.gl.framebufferTexture2D(36160,t,3553,null,0),delete this.attachments[t])}_attachRenderbuffer(t){let{attachment:e=36064,renderbuffer:i}=t;const{gl:n}=this;n.framebufferRenderbuffer(36160,e,36161,i.handle),this.attachments[e]=i}_attachTexture(t){let{attachment:e=36064,texture:i,layer:n,level:r}=t;const{gl:o}=this;switch(o.bindTexture(i.target,i.handle),i.target){case 35866:case 32879:Put(o).framebufferTextureLayer(36160,e,i.target,r,n);break;case 34067:const t=function(t){return t<34069?t+34069:t}(n);o.framebufferTexture2D(36160,e,t,i.handle,r);break;case 3553:o.framebufferTexture2D(36160,e,3553,i.handle,r);break;default:Mht(!1,"Illegal texture type")}o.bindTexture(i.target,null),this.attachments[e]=i}_setReadBuffer(t){const e=Iut(i=this.gl)?i:null;var i;e?e.readBuffer(t):Mht(36064===t||1029===t,Cpt),this.readBuffer=t}_setDrawBuffers(t){const{gl:e}=this,i=Put(e);if(i)i.drawBuffers(t);else{const i=e.getExtension("WEBGL_draw_buffers");i?i.drawBuffersWEBGL(t):Mht(1===t.length&&(36064===t[0]||1029===t[0]),Cpt)}this.drawBuffers=t}_getAttachmentParameterFallback(t){const e=function(t){t.luma=t.luma||{},t.luma.caps=t.luma.caps||{};for(const e in Ept)void 0===t.luma.caps[e]&&(t.luma.caps[e]=Ipt(t,e));return t.luma.caps}(this.gl);switch(t){case 36052:return e.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return e.WEBGL2?null:8;case 33297:return e.WEBGL2?null:5125;case 33296:return e.WEBGL2||e.EXT_sRGB?null:9729;default:return null}}_createHandle(){return this.gl.createFramebuffer()}_deleteHandle(){this.gl.deleteFramebuffer(this.handle)}_bindHandle(t){return this.gl.bindFramebuffer(36160,t)}}function Lpt(t,e){const{gl:i,width:n,height:r,id:o}=t;return new Ppt(i,Object.assign({},e,{id:"framebuffer-for-".concat(o),width:n,height:r,attachments:{36064:t}}))}function Dpt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unnamed";const i=t.match(/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/);return i?i[1]:e}Ppt.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303];const Rpt=35632,Opt=35633;function kpt(t,e,i,n){const r=t.split(/\r?\n/),o={},s={},a=n||Dpt(e)||"(unnamed)",l="".concat(function(t){switch(t){case Rpt:return"fragment";case Opt:return"vertex";default:return"unknown type"}}(i)," shader ").concat(a);for(let e=0;e<r.length;e++){const i=r[e];if(i.length<=1)continue;const n=i.split(":"),a=n[0],c=parseInt(n[2],10);if(isNaN(c))throw new Error("GLSL compilation error in ".concat(l,": ").concat(t));"WARNING"!==a?o[c]=i:s[c]=i}const c=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:": ";const n=t.split(/\r?\n/),r=String(n.length+e-1).length;return n.map(((t,n)=>{const o=String(n+e),s=o.length;return Bpt(o,r-s)+i+t}))}(e);return{shaderName:l,errors:Npt(o,c),warnings:Npt(s,c)}}function Npt(t,e){let i="";for(let n=0;n<e.length;n++){const r=e[n];if((t[n+3]||t[n+2]||t[n+1])&&(i+="".concat(r,"\n"),t[n+1])){const e=t[n+1],r=e.split(":",3),o=r[0],s=parseInt(r[1],10)||0,a=e.substring(r.join(":").length+1).trim();i+=Bpt("^^^ ".concat(o,": ").concat(a,"\n\n"),s)}}return i}function Bpt(t,e){let i="";for(let t=0;t<e;++t)i+=" ";return"".concat(i).concat(t)}function zpt(t){let e=100;const i=t.match(/[^\s]+/g);if(i.length>=2&&"#version"===i[0]){const t=parseInt(i[1],10);Number.isFinite(t)&&(e=t)}return e}class Fpt extends kht{get[Symbol.toStringTag](){return"Shader"}static getTypeName(t){switch(t){case 35633:return"vertex-shader";case 35632:return"fragment-shader";default:return Mht(!1),"unknown"}}constructor(t,e){Cut(t),Mht("string"==typeof e.source,"Shader: GLSL source code must be a JavaScript string");super(t,{id:Dpt(e.source,null)||e.id||Pht("unnamed ".concat(Fpt.getTypeName(e.shaderType)))}),this.shaderType=e.shaderType,this.source=e.source,this.initialize(e)}initialize(t){let{source:e}=t;const i=Dpt(e,null);i&&(this.id=Pht(i)),this._compile(e)}getParameter(t){return this.gl.getShaderParameter(this.handle,t)}toString(){return"".concat(Fpt.getTypeName(this.shaderType),":").concat(this.id)}getName(){return Dpt(this.source)||"unnamed-shader"}getSource(){return this.gl.getShaderSource(this.handle)}getTranslatedSource(){const t=this.gl.getExtension("WEBGL_debug_shaders");return t?t.getTranslatedShaderSource(this.handle):"No translated source available. WEBGL_debug_shaders not implemented"}_compile(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.source;t.startsWith("#version ")||(t="#version 100\n".concat(t)),this.source=t,this.gl.shaderSource(this.handle,this.source),this.gl.compileShader(this.handle);if(!this.getParameter(35713)){const t=this.gl.getShaderInfoLog(this.handle),{shaderName:e,errors:i,warnings:n}=kpt(t,this.source,this.shaderType,this.id);throw Eut.error("GLSL compilation errors in ".concat(e,"\n").concat(i))(),Eut.warn("GLSL compilation warnings in ".concat(e,"\n").concat(n))(),new Error("GLSL compilation errors in ".concat(e))}}_deleteHandle(){this.gl.deleteShader(this.handle)}_getOptsFromHandle(){return{type:this.getParameter(35663),source:this.getSource()}}}class Vpt extends Fpt{get[Symbol.toStringTag](){return"VertexShader"}constructor(t,e){"string"==typeof e&&(e={source:e}),super(t,Object.assign({},e,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class Upt extends Fpt{get[Symbol.toStringTag](){return"FragmentShader"}constructor(t,e){"string"==typeof e&&(e={source:e}),super(t,Object.assign({},e,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}const Gpt={5126:idt.bind(null,"uniform1fv",Zpt,1,ndt),35664:idt.bind(null,"uniform2fv",Zpt,2,ndt),35665:idt.bind(null,"uniform3fv",Zpt,3,ndt),35666:idt.bind(null,"uniform4fv",Zpt,4,ndt),5124:idt.bind(null,"uniform1iv",Ypt,1,ndt),35667:idt.bind(null,"uniform2iv",Ypt,2,ndt),35668:idt.bind(null,"uniform3iv",Ypt,3,ndt),35669:idt.bind(null,"uniform4iv",Ypt,4,ndt),35670:idt.bind(null,"uniform1iv",Ypt,1,ndt),35671:idt.bind(null,"uniform2iv",Ypt,2,ndt),35672:idt.bind(null,"uniform3iv",Ypt,3,ndt),35673:idt.bind(null,"uniform4iv",Ypt,4,ndt),35674:idt.bind(null,"uniformMatrix2fv",Zpt,4,rdt),35675:idt.bind(null,"uniformMatrix3fv",Zpt,9,rdt),35676:idt.bind(null,"uniformMatrix4fv",Zpt,16,rdt),35678:edt,35680:edt,5125:idt.bind(null,"uniform1uiv",Qpt,1,ndt),36294:idt.bind(null,"uniform2uiv",Qpt,2,ndt),36295:idt.bind(null,"uniform3uiv",Qpt,3,ndt),36296:idt.bind(null,"uniform4uiv",Qpt,4,ndt),35685:idt.bind(null,"uniformMatrix2x3fv",Zpt,6,rdt),35686:idt.bind(null,"uniformMatrix2x4fv",Zpt,8,rdt),35687:idt.bind(null,"uniformMatrix3x2fv",Zpt,6,rdt),35688:idt.bind(null,"uniformMatrix3x4fv",Zpt,12,rdt),35689:idt.bind(null,"uniformMatrix4x2fv",Zpt,8,rdt),35690:idt.bind(null,"uniformMatrix4x3fv",Zpt,12,rdt),35678:edt,35680:edt,35679:edt,35682:edt,36289:edt,36292:edt,36293:edt,36298:edt,36299:edt,36300:edt,36303:edt,36306:edt,36307:edt,36308:edt,36311:edt},jpt={},Hpt={},Wpt={},qpt=[0];function Xpt(t,e,i,n){1===e&&"boolean"==typeof t&&(t=t?1:0),Number.isFinite(t)&&(qpt[0]=t,t=qpt);const r=t.length;if(r%e&&Eut.warn("Uniform size should be multiples of ".concat(e),t)(),t instanceof i)return t;let o=n[r];o||(o=new i(r),n[r]=o);for(let e=0;e<r;e++)o[e]=t[e];return o}function Zpt(t,e){return Xpt(t,e,Float32Array,jpt)}function Ypt(t,e){return Xpt(t,e,Int32Array,Hpt)}function Qpt(t,e){return Xpt(t,e,Uint32Array,Wpt)}function Jpt(t,e,i){const n=Gpt[i.type];if(!n)throw new Error("Unknown GLSL uniform type ".concat(i.type));return n().bind(null,t,e)}function Kpt(t){if("]"!==t[t.length-1])return{name:t,length:1,isArray:!1};const e=t.match(/([^[]*)(\[[0-9]+\])?/);if(!e||e.length<2)throw new Error("Failed to parse GLSL uniform name ".concat(t));return{name:e[1],length:e[2]||1,isArray:Boolean(e[2])}}function $pt(t){return Array.isArray(t)||ArrayBuffer.isView(t)?function(t){if(0===t.length)return!1;const e=Math.min(t.length,16);for(let i=0;i<e;++i)if(!Number.isFinite(t[i]))return!1;return!0}(t):!!isFinite(t)||(!0===t||!1===t||(t instanceof $ht||(t instanceof spt||t instanceof Ppt&&Boolean(t.texture))))}function tdt(t,e,i){if(Array.isArray(i)||ArrayBuffer.isView(i))if(t[e]){const n=t[e];for(let t=0,e=i.length;t<e;++t)n[t]=i[t]}else t[e]=i.slice();else t[e]=i}function edt(){let t=null;return(e,i,n)=>{const r=t!==n;return r&&(e.uniform1i(i,n),t=n),r}}function idt(t,e,i,n){let r=null,o=null;return(s,a,l)=>{const c=e(l,i),u=c.length;let h=!1;if(null===r)r=new Float32Array(u),o=u,h=!0;else{Mht(o===u,"Uniform length cannot change.");for(let t=0;t<u;++t)if(c[t]!==r[t]){h=!0;break}}return h&&(n(s,t,a,c),r.set(c)),h}}function ndt(t,e,i,n){t[e](i,n)}function rdt(t,e,i,n){t[e](i,!1,n)}const odt=5120,sdt=5121,adt=5122,ldt=5123,cdt=5126,udt=5124,hdt=5125,pdt={[cdt]:[cdt,1,"float"],35664:[cdt,2,"vec2"],35665:[cdt,3,"vec3"],35666:[cdt,4,"vec4"],[udt]:[udt,1,"int"],35667:[udt,2,"ivec2"],35668:[udt,3,"ivec3"],35669:[udt,4,"ivec4"],[hdt]:[hdt,1,"uint"],36294:[hdt,2,"uvec2"],36295:[hdt,3,"uvec3"],36296:[hdt,4,"uvec4"],35670:[cdt,1,"bool"],35671:[cdt,2,"bvec2"],35672:[cdt,3,"bvec3"],35673:[cdt,4,"bvec4"],35674:[cdt,8,"mat2"],35685:[cdt,8,"mat2x3"],35686:[cdt,8,"mat2x4"],35675:[cdt,12,"mat3"],35687:[cdt,12,"mat3x2"],35688:[cdt,12,"mat3x4"],35676:[cdt,16,"mat4"],35689:[cdt,16,"mat4x2"],35690:[cdt,16,"mat4x3"]};function ddt(t){const e=pdt[t];if(!e)return null;const[i,n]=e;return{type:i,components:n}}function fdt(t,e){switch(t){case odt:case sdt:case adt:case ldt:t=cdt}for(const i in pdt){const[n,r,o]=pdt[i];if(n===t&&r===e)return{glType:i,name:o}}return null}class mdt{constructor(t){this.id=t.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(t),this._readVaryingsFromProgram(t)}getAttributeInfo(t){const e=Number(t);return Number.isFinite(e)?this.attributeInfosByLocation[e]:this.attributeInfosByName[t]||null}getAttributeLocation(t){const e=this.getAttributeInfo(t);return e?e.location:-1}getAttributeAccessor(t){const e=this.getAttributeInfo(t);return e?e.accessor:null}getVaryingInfo(t){const e=Number(t);return Number.isFinite(e)?this.varyingInfos[e]:this.varyingInfosByName[t]||null}getVaryingIndex(t){const e=this.getVaryingInfo();return e?e.location:-1}getVaryingAccessor(t){const e=this.getVaryingInfo();return e?e.accessor:null}_readAttributesFromProgram(t){const{gl:e}=t,i=e.getProgramParameter(t.handle,35721);for(let n=0;n<i;n++){const{name:i,type:r,size:o}=e.getActiveAttrib(t.handle,n),s=e.getAttribLocation(t.handle,i);s>=0&&this._addAttribute(s,i,r,o)}this.attributeInfos.sort(((t,e)=>t.location-e.location))}_readVaryingsFromProgram(t){const{gl:e}=t;if(!Iut(e))return;const i=e.getProgramParameter(t.handle,35971);for(let n=0;n<i;n++){const{name:i,type:r,size:o}=e.getTransformFeedbackVarying(t.handle,n);this._addVarying(n,i,r,o)}this.varyingInfos.sort(((t,e)=>t.location-e.location))}_addAttribute(t,e,i,n){const{type:r,components:o}=ddt(i),s={type:r,size:n*o};this._inferProperties(t,e,s);const a={location:t,name:e,accessor:new jht(s)};this.attributeInfos.push(a),this.attributeInfosByLocation[t]=a,this.attributeInfosByName[a.name]=a}_inferProperties(t,e,i){/instance/i.test(e)&&(i.divisor=1)}_addVarying(t,e,i,n){const{type:r,components:o}=ddt(i),s={location:t,name:e,accessor:new jht({type:r,size:n*o})};this.varyingInfos.push(s),this.varyingInfosByName[s.name]=s}}const gdt=35981,ydt=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class vdt extends kht{get[Symbol.toStringTag](){return"Program"}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,e),this.stubRemovedMethods("Program","v6.0",ydt),this._isCached=!1,this.initialize(e),Object.seal(this),this._setId(e.id)}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{hash:e,vs:i,fs:n,varyings:r,bufferMode:o=gdt}=t;return this.hash=e||"",this.vs="string"==typeof i?new Vpt(this.gl,{id:"".concat(t.id,"-vs"),source:i}):i,this.fs="string"==typeof n?new Upt(this.gl,{id:"".concat(t.id,"-fs"),source:n}):n,Mht(this.vs instanceof Vpt),Mht(this.fs instanceof Upt),this.uniforms={},this._textureUniforms={},r&&r.length>0&&(Put(this.gl),this.varyings=r,this.gl2.transformFeedbackVaryings(this.handle,r,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new mdt(this),this.setProps(t)}delete(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isCached?this:super.delete(t)}setProps(t){return"uniforms"in t&&this.setUniforms(t.uniforms),this}draw(t){let{logPriority:e,drawMode:i=4,vertexCount:n,offset:r=0,start:o,end:s,isIndexed:a=!1,indexType:l=5123,instanceCount:c=0,isInstanced:u=c>0,vertexArray:h=null,transformFeedback:p,framebuffer:d,parameters:f={},uniforms:m,samplers:g}=t;if((m||g)&&(Eut.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(m||{})),Eut.priority>=e){const t=d?d.id:"default",r="mode=".concat(Iht(this.gl,i)," verts=").concat(n," ")+"instances=".concat(c," indexType=").concat(Iht(this.gl,l)," ")+"isInstanced=".concat(u," isIndexed=").concat(a," ")+"Framebuffer=".concat(t);Eut.log(e,r)()}return Mht(h),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===n||u&&0===c)&&(h.bindForDraw(n,c,(()=>{if(void 0!==d&&(f=Object.assign({},f,{framebuffer:d})),p){const t=function(t){switch(t){case 0:return 0;case 1:case 3:case 2:return 1;case 4:case 5:case 6:return 4;default:return Mht(!1),0}}(i);p.begin(t)}this._bindTextures(),uht(this.gl,f,(()=>{a&&u?this.gl2.drawElementsInstanced(i,n,l,r,c):a&&Iut(this.gl)&&!isNaN(o)&&!isNaN(s)?this.gl2.drawRangeElements(i,o,s,n,l,r):a?this.gl.drawElements(i,n,l,r):u?this.gl2.drawArraysInstanced(i,r,n,c):this.gl.drawArrays(i,r,n)})),p&&p.end()})),!0)}setUniforms(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Eut.priority>=2&&function(t,e,i){for(const n in t){const r=t[n];if((!i||Boolean(i[n]))&&!$pt(r))throw e=e?"".concat(e," "):"",console.error("".concat(e," Bad uniform ").concat(n),r),new Error("".concat(e," Bad uniform ").concat(n))}}(t,this.id,this._uniformSetters),this.gl.useProgram(this.handle);for(const e in t){const i=t[e],n=this._uniformSetters[e];if(n){let t=i,r=!1;if(t instanceof Ppt&&(t=t.texture),t instanceof $ht)if(r=this.uniforms[e]!==i,r){void 0===n.textureIndex&&(n.textureIndex=this._textureIndexCounter++);const i=t,{textureIndex:r}=n;i.bind(r),t=r,this._textureUniforms[e]=i}else t=n.textureIndex;else this._textureUniforms[e]&&delete this._textureUniforms[e];(n(t)||r)&&tdt(this.uniforms,e,i)}}return this}_areTexturesRenderable(){let t=!0;for(const e in this._textureUniforms){const i=this._textureUniforms[e];i.update(),t=t&&i.loaded}return t}_bindTextures(){for(const t in this._textureUniforms){const e=this._uniformSetters[t].textureIndex;this._textureUniforms[t].bind(e)}}_createHandle(){return this.gl.createProgram()}_deleteHandle(){this.gl.deleteProgram(this.handle)}_getOptionsFromHandle(t){const e=this.gl.getAttachedShaders(t),i={};for(const t of e){switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:i.vs=new Vpt({handle:t});break;case 35632:i.fs=new Upt({handle:t})}}return i}_getParameter(t){return this.gl.getProgramParameter(this.handle,t)}_setId(t){if(!t){const t=this._getName();this.id=Pht(t)}}_getName(){let t=this.vs.getName()||this.fs.getName();return t=t.replace(/shader/i,""),t=t?"".concat(t,"-program"):"program",t}_compileAndLink(){const{gl:t}=this;if(t.attachShader(this.handle,this.vs.handle),t.attachShader(this.handle,this.fs.handle),Eut.time(4,"linkProgram for ".concat(this._getName()))(),t.linkProgram(this.handle),Eut.timeEnd(4,"linkProgram for ".concat(this._getName()))(),t.debug||Eut.level>0){if(!t.getProgramParameter(this.handle,35714))throw new Error("Error linking: ".concat(t.getProgramInfoLog(this.handle)));t.validateProgram(this.handle);if(!t.getProgramParameter(this.handle,35715))throw new Error("Error validating: ".concat(t.getProgramInfoLog(this.handle)))}}_readUniformLocationsFromLinkedProgram(){const{gl:t}=this;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(let e=0;e<this._uniformCount;e++){const i=this.gl.getActiveUniform(this.handle,e),{name:n}=Kpt(i.name);let r=t.getUniformLocation(this.handle,n);if(this._uniformSetters[n]=Jpt(t,r,i),i.size>1)for(let e=0;e<i.size;e++)r=t.getUniformLocation(this.handle,"".concat(n,"[").concat(e,"]")),this._uniformSetters["".concat(n,"[").concat(e,"]")]=Jpt(t,r,i)}this._textureIndexCounter=0}getActiveUniforms(t,e){return this.gl2.getActiveUniforms(this.handle,t,e)}getUniformBlockIndex(t){return this.gl2.getUniformBlockIndex(this.handle,t)}getActiveUniformBlockParameter(t,e){return this.gl2.getActiveUniformBlockParameter(this.handle,t,e)}uniformBlockBinding(t,e){this.gl2.uniformBlockBinding(this.handle,t,e)}}class _dt extends kht{get[Symbol.toStringTag](){return"Query"}static isSupported(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const i=Iut(t),n=Tpt(t,gpt);let r=i||n;for(const t of e)switch(t){case"queries":r=r&&i;break;case"timers":r=r&&n;break;default:Mht(!1)}return r}constructor(t){super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this.target=null,this._queryPending=!1,this._pollingPromise=null,Object.seal(this)}beginTimeElapsedQuery(){return this.begin(35007)}beginOcclusionQuery(){let{conservative:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.begin(t?36202:35887)}beginTransformFeedbackQuery(){return this.begin(35976)}begin(t){return this._queryPending||(this.target=t,this.gl2.beginQuery(this.target,this.handle)),this}end(){return this._queryPending||this.target&&(this.gl2.endQuery(this.target),this.target=null,this._queryPending=!0),this}isResultAvailable(){if(!this._queryPending)return!1;const t=this.gl2.getQueryParameter(this.handle,34919);return t&&(this._queryPending=!1),t}isTimerDisjoint(){return this.gl2.getParameter(36795)}getResult(){return this.gl2.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}createPoll(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY;if(this._pollingPromise)return this._pollingPromise;let e=0;return this._pollingPromise=new Promise(((i,n)=>{const r=()=>{this.isResultAvailable()?(i(this.getResult()),this._pollingPromise=null):e++>t?(n("Timed out"),this._pollingPromise=null):requestAnimationFrame(r)};requestAnimationFrame(r)})),this._pollingPromise}_createHandle(){return _dt.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}class xdt extends kht{get[Symbol.toStringTag](){return"TransformFeedback"}static isSupported(t){return Iut(t)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Put(t),super(t,e),this.initialize(e),this.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(this)}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,Dht(this.buffers)||this.bind((()=>this._unbindBuffers())),this.setProps(t),this}setProps(t){"program"in t&&(this.configuration=t.program&&t.program.configuration),"configuration"in t&&(this.configuration=t.configuration),"bindOnUse"in t&&(t=t.bindOnUse),"buffers"in t&&this.setBuffers(t.buffers)}setBuffers(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.bind((()=>{for(const e in t)this.setBuffer(e,t[e])})),this}setBuffer(t,e){const i=this._getVaryingIndex(t),{buffer:n,byteSize:r,byteOffset:o}=this._getBufferParams(e);return i<0?(this.unused[t]=n,Eut.warn("".concat(this.id," unused varying buffer ").concat(t))(),this):(this.buffers[i]=e,this.bindOnUse||this._bindBuffer(i,n,o,r),this)}begin(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(t),this}end(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}_getBufferParams(t){let e,i,n;return t instanceof Xht==!1?(n=t.buffer,i=t.byteSize,e=t.byteOffset):n=t,void 0===e&&void 0===i||(e=e||0,i=i||n.byteLength-e),{buffer:n,byteOffset:e,byteSize:i}}_getVaryingInfo(t){return this.configuration&&this.configuration.getVaryingInfo(t)}_getVaryingIndex(t){if(this.configuration)return this.configuration.getVaryingInfo(t).location;const e=Number(t);return Number.isFinite(e)?e:-1}_bindBuffers(){if(this.bindOnUse)for(const t in this.buffers){const{buffer:e,byteSize:i,byteOffset:n}=this._getBufferParams(this.buffers[t]);this._bindBuffer(t,e,n,i)}}_unbindBuffers(){if(this.bindOnUse)for(const t in this.buffers)this._bindBuffer(t,null)}_bindBuffer(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;const r=e&&e.handle;return r&&void 0!==n?this.gl.bindBufferRange(35982,t,r,i,n):this.gl.bindBufferBase(35982,t,r),this}_createHandle(){return this.gl.createTransformFeedback()}_deleteHandle(){this.gl.deleteTransformFeedback(this.handle)}_bindHandle(t){this.gl.bindTransformFeedback(36386,this.handle)}}let bdt=null;function wdt(t,e){var i;return new t((i=t.BYTES_PER_ELEMENT*e,(!bdt||bdt.byteLength<i)&&(bdt=new ArrayBuffer(i)),bdt),0,e)}class Adt extends kht{get[Symbol.toStringTag](){return"VertexArrayObject"}static isSupported(t){return!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).constantAttributeZero||(Iut(t)||"Chrome"===Jct())}static getDefaultArray(t){return t.luma=t.luma||{},t.luma.defaultVertexArray||(t.luma.defaultVertexArray=new Adt(t,{handle:null,isDefaultArray:!0})),t.luma.defaultVertexArray}static getMaxAttributes(t){return Adt.MAX_ATTRIBUTES=Adt.MAX_ATTRIBUTES||t.getParameter(34921),Adt.MAX_ATTRIBUTES}static setConstant(t,e,i){switch(i.constructor){case Float32Array:Adt._setConstantFloatArray(t,e,i);break;case Int32Array:Adt._setConstantIntArray(t,e,i);break;case Uint32Array:Adt._setConstantUintArray(t,e,i);break;default:Mht(!1)}}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=e.id||e.program&&e.program.id;super(t,Object.assign({},e,{id:i})),this.buffer=null,this.bufferValue=null,this.isDefaultArray=e.isDefaultArray||!1,this.gl2=t,this.initialize(e),Object.seal(this)}delete(){return super.delete(),this.buffer&&this.buffer.delete(),this}get MAX_ATTRIBUTES(){return Adt.getMaxAttributes(this.gl)}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setProps(t)}setProps(t){return this}setElementBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return Mht(!t||34963===t.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind((()=>{this.gl.bindBuffer(34963,t?t.handle:null)})),this}setBuffer(t,e,i){if(34963===e.target)return this.setElementBuffer(e,i);const{size:n,type:r,stride:o,offset:s,normalized:a,integer:l,divisor:c}=i,{gl:u,gl2:h}=this;return t=Number(t),this.bind((()=>{u.bindBuffer(34962,e.handle),l?(Mht(Iut(u)),h.vertexAttribIPointer(t,n,r,o,s)):u.vertexAttribPointer(t,n,r,a,o,s),u.enableVertexAttribArray(t),h.vertexAttribDivisor(t,c||0)})),this}enable(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!e&&0===t&&!Adt.isSupported(this.gl,{constantAttributeZero:!0})||(t=Number(t),this.bind((()=>e?this.gl.enableVertexAttribArray(t):this.gl.disableVertexAttribArray(t)))),this}getConstantBuffer(t,e){const i=this._normalizeConstantArrayValue(e),n=i.byteLength*t,r=i.length*t;let o=!this.buffer;if(this.buffer=this.buffer||new Xht(this.gl,n),o=o||this.buffer.reallocate(n),o=o||!this._compareConstantArrayValues(i,this.bufferValue),o){const t=wdt(e.constructor,r);!function(t){let{target:e,source:i,start:n=0,count:r=1}=t;const o=i.length,s=r*o;let a=0;for(let t=n;a<o;a++)e[t++]=i[a];for(;a<s;)a<s-a?(e.copyWithin(n+a,n,n+a),a*=2):(e.copyWithin(n+a,n,n+s-a),a=s)}({target:t,source:i,start:0,count:r}),this.buffer.subData(t),this.bufferValue=e}return this.buffer}_normalizeConstantArrayValue(t){return Array.isArray(t)?new Float32Array(t):t}_compareConstantArrayValues(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(let i=0;i<t.length;++i)if(t[i]!==e[i])return!1;return!0}static _setConstantFloatArray(t,e,i){switch(i.length){case 1:t.vertexAttrib1fv(e,i);break;case 2:t.vertexAttrib2fv(e,i);break;case 3:t.vertexAttrib3fv(e,i);break;case 4:t.vertexAttrib4fv(e,i);break;default:Mht(!1)}}static _setConstantIntArray(t,e,i){switch(Mht(Iut(t)),i.length){case 1:t.vertexAttribI1iv(e,i);break;case 2:t.vertexAttribI2iv(e,i);break;case 3:t.vertexAttribI3iv(e,i);break;case 4:t.vertexAttribI4iv(e,i);break;default:Mht(!1)}}static _setConstantUintArray(t,e,i){switch(Mht(Iut(t)),i.length){case 1:t.vertexAttribI1uiv(e,i);break;case 2:t.vertexAttribI2uiv(e,i);break;case 3:t.vertexAttribI3uiv(e,i);break;case 4:t.vertexAttribI4uiv(e,i);break;default:Mht(!1)}}_createHandle(){return this.gl.createVertexArray()}_deleteHandle(t){return this.gl2.deleteVertexArray(t),[this.elements]}_bindHandle(t){this.gl2.bindVertexArray(t)}_getParameter(t,e){let{location:i}=e;return Mht(Number.isFinite(i)),this.bind((()=>34373===t?this.gl.getVertexAttribOffset(i,t):this.gl.getVertexAttrib(i,t)))}}const Edt=/^(.+)__LOCATION_([0-9]+)$/,Sdt=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class Mdt{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=e.id||e.program&&e.program.id;this.id=i,this.gl=t,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={},this.vertexArrayObject=new Adt(t),Rht(this,"VertexArray","v6.0",Sdt),this.initialize(e),Object.seal(this)}delete(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(t)}reset(){this.elements=null,this.elementsAccessor=null;const{MAX_ATTRIBUTES:t}=this.vertexArrayObject;return this.values=new Array(t).fill(null),this.accessors=new Array(t).fill(null),this.unused={},this.drawParams=null,this}setProps(t){return"program"in t&&(this.configuration=t.program&&t.program.configuration),"configuration"in t&&(this.configuration=t.configuration),"attributes"in t&&this.setAttributes(t.attributes),"elements"in t&&this.setElementBuffer(t.elements),"bindOnUse"in t&&(t=t.bindOnUse),this}clearDrawParams(){this.drawParams=null}getDrawParams(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}setAttributes(t){return Object.assign(this.attributes,t),this.vertexArrayObject.bind((()=>{for(const e in t){const i=t[e];this._setAttribute(e,i)}this.gl.bindBuffer(34962,null)})),this}setElementBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.elements=t,this.elementsAccessor=e,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(t,e),this}setBuffer(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(34963===e.target)return this.setElementBuffer(e,i);const{location:n,accessor:r}=this._resolveLocationAndAccessor(t,e,e.accessor,i);return n>=0&&(this.values[n]=e,this.accessors[n]=r,this.clearDrawParams(),this.vertexArrayObject.setBuffer(n,e,r)),this}setConstant(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{location:n,accessor:r}=this._resolveLocationAndAccessor(t,e,Object.assign({size:e.length},i));return n>=0&&(e=this.vertexArrayObject._normalizeConstantArrayValue(e),this.values[n]=e,this.accessors[n]=r,this.clearDrawParams(),this.vertexArrayObject.enable(n,!1)),this}unbindBuffers(){return this.vertexArrayObject.bind((()=>{this.elements&&this.vertexArrayObject.setElementBuffer(null),this.buffer=this.buffer||new Xht(this.gl,{accessor:{size:4}});for(let t=0;t<this.vertexArrayObject.MAX_ATTRIBUTES;t++)this.values[t]instanceof Xht&&(this.gl.disableVertexAttribArray(t),this.gl.bindBuffer(34962,this.buffer.handle),this.gl.vertexAttribPointer(t,1,5126,!1,0,0))})),this}bindBuffers(){return this.vertexArrayObject.bind((()=>{this.elements&&this.setElementBuffer(this.elements);for(let t=0;t<this.vertexArrayObject.MAX_ATTRIBUTES;t++){const e=this.values[t];e instanceof Xht&&this.setBuffer(t,e)}})),this}bindForDraw(t,e,i){let n;return this.vertexArrayObject.bind((()=>{this._setConstantAttributes(t,e),n=i()})),n}_resolveLocationAndAccessor(t,e,i,n){const r={location:-1,accessor:null},{location:o,name:s}=this._getAttributeIndex(t);if(!Number.isFinite(o)||o<0)return this.unused[t]=e,Eut.once(3,(()=>"unused value ".concat(t," in ").concat(this.id)))(),r;const a=this._getAttributeInfo(s||o);if(!a)return r;const l=this.accessors[o]||{},c=jht.resolve(a.accessor,l,i,n),{size:u,type:h}=c;return Mht(Number.isFinite(u)&&Number.isFinite(h)),{location:o,accessor:c}}_getAttributeInfo(t){return this.configuration&&this.configuration.getAttributeInfo(t)}_getAttributeIndex(t){const e=Number(t);if(Number.isFinite(e))return{location:e};const i=Edt.exec(t),n=i?i[1]:t,r=i?Number(i[2]):0;return this.configuration?{location:this.configuration.getAttributeLocation(n)+r,name:n}:{location:-1}}_setAttribute(t,e){if(e instanceof Xht)this.setBuffer(t,e);else if(Array.isArray(e)&&e.length&&e[0]instanceof Xht){const i=e[0],n=e[1];this.setBuffer(t,i,n)}else if(ArrayBuffer.isView(e)||Array.isArray(e)){const i=e;this.setConstant(t,i)}else{if(!(e.buffer instanceof Xht))throw new Error("VertexArray: attributes must be Buffers or constants (i.e. typed array)");{const i=e;this.setBuffer(t,i.buffer,i)}}}_setConstantAttributes(t,e){const i=Math.max(0|t,0|e);let n=this.values[0];ArrayBuffer.isView(n)&&this._setConstantAttributeZero(n,i);for(let t=1;t<this.vertexArrayObject.MAX_ATTRIBUTES;t++)n=this.values[t],ArrayBuffer.isView(n)&&this._setConstantAttribute(t,n)}_setConstantAttributeZero(t,e){if(Adt.isSupported(this.gl,{constantAttributeZero:!0}))return void this._setConstantAttribute(0,t);const i=this.vertexArrayObject.getConstantBuffer(e,t);this.vertexArrayObject.setBuffer(0,i,this.accessors[0])}_setConstantAttribute(t,e){Adt.setConstant(this.gl,t,e)}_updateDrawParams(){const t={isIndexed:!1,isInstanced:!1,indexCount:1/0,vertexCount:1/0,instanceCount:1/0};for(let e=0;e<this.vertexArrayObject.MAX_ATTRIBUTES;e++)this._updateDrawParamsForLocation(t,e);return this.elements&&(t.elementCount=this.elements.getElementCount(this.elements.accessor),t.isIndexed=!0,t.indexType=this.elementsAccessor.type||this.elements.accessor.type,t.indexOffset=this.elementsAccessor.offset||0),t.indexCount===1/0&&(t.indexCount=0),t.vertexCount===1/0&&(t.vertexCount=0),t.instanceCount===1/0&&(t.instanceCount=0),t}_updateDrawParamsForLocation(t,e){const i=this.values[e],n=this.accessors[e];if(!i)return;const{divisor:r}=n,o=r>0;if(t.isInstanced=t.isInstanced||o,i instanceof Xht){const e=i;if(o){const i=e.getVertexCount(n);t.instanceCount=Math.min(t.instanceCount,i)}else{const i=e.getVertexCount(n);t.vertexCount=Math.min(t.vertexCount,i)}}}setElements(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Eut.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(t,e)}}function Tdt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{isInteger:i=!1}=e;if(Array.isArray(t)||ArrayBuffer.isView(t))return function(t,e){const{maxElts:i=16,size:n=1}=e;let r="[";for(let o=0;o<t.length&&o<i;++o)o>0&&(r+=",".concat(o%n==0?" ":"")),r+=Tdt(t[o],e);const o=t.length>i?"...":"]";return"".concat(r).concat(o)}(t,e);if(!Number.isFinite(t))return String(t);if(Math.abs(t)<1e-16)return i?"0":"0.";if(i)return t.toFixed(0);if(Math.abs(t)>100&&Math.abs(t)<1e4)return t.toFixed(0);const n=t.toPrecision(2);return n.indexOf(".0")===n.length-2?n.slice(0,-1):n}function Idt(t){let{header:e="Uniforms",program:i,uniforms:n,undefinedOnly:r=!1}=t;Mht(i);const o=".*Matrix",s=i._uniformSetters,a={},l=Object.keys(s).sort();let c=0;for(const t of l)t.match(".*_.*")||t.match(o)||Cdt({table:a,header:e,uniforms:n,uniformName:t,undefinedOnly:r})&&c++;for(const t of l)t.match(o)&&Cdt({table:a,header:e,uniforms:n,uniformName:t,undefinedOnly:r})&&c++;for(const t of l)a[t]||Cdt({table:a,header:e,uniforms:n,uniformName:t,undefinedOnly:r})&&c++;let u=0;const h={};if(!r)for(const t in n){const i=n[t];a[t]||(u++,h[t]={Type:"NOT USED: ".concat(i),[e]:Tdt(i)})}return{table:a,count:c,unusedTable:h,unusedCount:u}}function Cdt(t){let{table:e,header:i,uniforms:n,uniformName:r,undefinedOnly:o}=t;const s=n[r],a=function(t){return null!=t}(s);return(!o||!a)&&(e[r]={[i]:a?Tdt(s):"N/A","Uniform Type":a?s:"NOT PROVIDED"},!0)}function Pdt(t,e,i,n){const{gl:r}=t;if(!e)return{[n]:"null","Format ":"N/A"};let o,s,a,l="NOT PROVIDED",c=1,u=0,h=0;if(i&&(l=i.type,c=i.size,l=String(l).replace("Array",""),o=-1!==l.indexOf("nt")),e instanceof Xht){const t=e,{data:p,changed:d}=t.getDebugData();let f;if(s=d?"*":"",a=p,h=t.byteLength,u=h/p.BYTES_PER_ELEMENT/c,i){const t=i.divisor>0;f="".concat(t?"I ":"P "," ").concat(u," (x").concat(c,"=").concat(h," bytes ").concat(Iht(r,l),")")}else o=!0,f="".concat(h," bytes");return{[n]:"".concat(s).concat(Tdt(a,{size:c,isInteger:o})),"Format ":f}}return a=e,c=e.length,l=String(e.constructor.name).replace("Array",""),o=-1!==l.indexOf("nt"),{[n]:"".concat(Tdt(a,{size:c,isInteger:o})," (constant)"),"Format ":"".concat(c,"x").concat(l," (constant)")}}function Ldt(t,e){const{type:i,size:n}=e,r=fdt(i,n);return r?"".concat(t," (").concat(r.name,")"):t}function Ddt(t){const{type:e,size:i}=t.accessor,n=fdt(e,i);return n?"".concat(n.name," ").concat(t.name):t.name}const Rdt=Wct()&&"undefined"!=typeof document;let Odt=0;class kdt{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{onCreateContext:e=(t=>vht(t)),onAddHTML:i=null,onInitialize:n=(()=>{}),onRender:r=(()=>{}),onFinalize:o=(()=>{}),onError:s,gl:a=null,glOptions:l={},debug:c=!1,createFramebuffer:u=!1,autoResizeViewport:h=!0,autoResizeDrawingBuffer:p=!0,stats:d=Sht.get("animation-loop-".concat(Odt++))}=t;let{useDevicePixels:f=!0}=t;"useDevicePixelRatio"in t&&(Eut.deprecated("useDevicePixelRatio","useDevicePixels")(),f=t.useDevicePixelRatio),this.props={onCreateContext:e,onAddHTML:i,onInitialize:n,onRender:r,onFinalize:o,onError:s,gl:a,glOptions:l,debug:c,createFramebuffer:u},this.gl=a,this.needsRedraw=null,this.timeline=null,this.stats=d,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:h,autoResizeDrawingBuffer:p,useDevicePixels:f}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._pageLoadPromise=null,this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}delete(){this.stop(),this._setDisplay(null)}setNeedsRedraw(t){return Mht("string"==typeof t),this.needsRedraw=this.needsRedraw||t,this}setProps(t){return"autoResizeViewport"in t&&(this.autoResizeViewport=t.autoResizeViewport),"autoResizeDrawingBuffer"in t&&(this.autoResizeDrawingBuffer=t.autoResizeDrawingBuffer),"useDevicePixels"in t&&(this.useDevicePixels=t.useDevicePixels),this}start(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._running)return this;this._running=!0;const e=this._getPageLoadPromise().then((()=>!this._running||this._initialized?null:(this._createWebGLContext(t),this._createFramebuffer(),this._startEventHandling(),this._initializeCallbackData(),this._updateCallbackData(),this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._gpuTimeQuery=_dt.isSupported(this.gl,["timers"])?new _dt(this.gl):null,this._initialized=!0,this.onInitialize(this.animationProps)))).then((t=>{this._running&&(this._addCallbackData(t||{}),!1!==t&&this._startLoop())}));return this.props.onError&&e.catch(this.props.onError),this}redraw(){return this.isContextLost()||(this._beginTimers(),this._setupFrame(),this._updateCallbackData(),this._renderFrame(this.animationProps),this._clearNeedsRedraw(),this.offScreen&&this.gl.commit&&this.gl.commit(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endTimers()),this}stop(){return this._running&&(this._finalizeCallbackData(),this._cancelAnimationFrame(this._animationFrameId),this._nextFramePromise=null,this._resolveNextFrame=null,this._animationFrameId=null,this._running=!1),this}attachTimeline(t){return this.timeline=t,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise((t=>{this._resolveNextFrame=t}))),this._nextFramePromise}async toDataURL(){return this.setNeedsRedraw("toDataURL"),await this.waitForRender(),this.gl.canvas.toDataURL()}isContextLost(){return this.gl.isContextLost()}onCreateContext(){return this.props.onCreateContext(...arguments)}onInitialize(){return this.props.onInitialize(...arguments)}onRender(){return this.props.onRender(...arguments)}onFinalize(){return this.props.onFinalize(...arguments)}getHTMLControlValue(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const i=document.getElementById(t);return i?Number(i.value):e}setViewParameters(){return Eut.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}_startLoop(){const t=()=>{this._running&&(this.redraw(),this._animationFrameId=this._requestAnimationFrame(t))};this._cancelAnimationFrame(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(t)}_getPageLoadPromise(){return this._pageLoadPromise||(this._pageLoadPromise=Rdt?new Promise(((t,e)=>{Rdt&&"complete"===document.readyState?t(document):window.addEventListener("load",(()=>{t(document)}))})):Promise.resolve({})),this._pageLoadPromise}_setDisplay(t){this.display&&(this.display.delete(),this.display.animationLoop=null),t&&(t.animationLoop=this),this.display=t}_cancelAnimationFrame(t){return this.display&&this.display.cancelAnimationFrame?this.display.cancelAnimationFrame(t):(e=t,"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(e):clearTimeout(e));var e}_requestAnimationFrame(t){if(this._running)return this.display&&this.display.requestAnimationFrame?this.display.requestAnimationFrame(t):(e=t,"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(e):setTimeout(e,1e3/60));var e}_renderFrame(){this.display?this.display._renderFrame(...arguments):this.onRender(...arguments)}_clearNeedsRedraw(){this.needsRedraw=null}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._resizeFramebuffer()}_initializeCallbackData(){this.animationProps={gl:this.gl,stop:this.stop,canvas:this.gl.canvas,framebuffer:this.framebuffer,useDevicePixels:this.useDevicePixels,needsRedraw:null,startTime:Date.now(),engineTime:0,tick:0,tock:0,time:0,_timeline:this.timeline,_loop:this,_animationLoop:this,_mousePosition:null}}_updateCallbackData(){const{width:t,height:e,aspect:i}=this._getSizeAndAspect();t===this.animationProps.width&&e===this.animationProps.height||this.setNeedsRedraw("drawing buffer resized"),i!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=t,this.animationProps.height=e,this.animationProps.aspect=i,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime,this.animationProps._offScreen=this.offScreen}_finalizeCallbackData(){this.onFinalize(this.animationProps)}_addCallbackData(t){"object"==typeof t&&null!==t&&(this.animationProps=Object.assign({},this.animationProps,t))}_createWebGLContext(t){if(this.offScreen=t.canvas&&"undefined"!=typeof OffscreenCanvas&&t.canvas instanceof OffscreenCanvas,t=Object.assign({},t,this.props.glOptions),this.gl=this.props.gl?_ht(this.props.gl,t):this.onCreateContext(t),!Tut(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");lht(this.gl,Hut),this._createInfoDiv()}_createInfoDiv(){if(this.gl.canvas&&this.props.onAddHTML){const t=document.createElement("div");document.body.appendChild(t),t.style.position="relative";const e=document.createElement("div");e.style.position="absolute",e.style.left="10px",e.style.bottom="10px",e.style.width="300px",e.style.background="white",t.appendChild(this.gl.canvas),t.appendChild(e);const i=this.props.onAddHTML(e);i&&(e.innerHTML=i)}}_getSizeAndAspect(){const t=this.gl.drawingBufferWidth,e=this.gl.drawingBufferHeight;let i=1;const{canvas:n}=this.gl;return n&&n.clientHeight?i=n.clientWidth/n.clientHeight:t>0&&e>0&&(i=t/e),{width:t,height:e,aspect:i}}_resizeViewport(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){this.autoResizeDrawingBuffer&&xht(this.gl,{useDevicePixels:this.useDevicePixels})}_createFramebuffer(){this.props.createFramebuffer&&(this.framebuffer=new Ppt(this.gl))}_resizeFramebuffer(){this.framebuffer&&this.framebuffer.resize({width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight})}_beginTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this._gpuTimeQuery&&this._gpuTimeQuery.isResultAvailable()&&!this._gpuTimeQuery.isTimerDisjoint()&&this.stats.get("GPU Time").addTime(this._gpuTimeQuery.getTimerMilliseconds()),this._gpuTimeQuery&&this._gpuTimeQuery.beginTimeElapsedQuery(),this.cpuTime.timeStart()}_endTimers(){this.cpuTime.timeEnd(),this._gpuTimeQuery&&this._gpuTimeQuery.end()}_startEventHandling(){const{canvas:t}=this.gl;t&&(t.addEventListener("mousemove",this._onMousemove),t.addEventListener("mouseleave",this._onMouseleave))}_onMousemove(t){this.animationProps._mousePosition=[t.offsetX,t.offsetY]}_onMouseleave(t){this.animationProps._mousePosition=null}}const Ndt="vs",Bdt="fs";function zdt(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}const Fdt={number:{validate:(t,e)=>Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)},array:{validate:(t,e)=>Array.isArray(t)||ArrayBuffer.isView(t)}};function Vdt(t){let e=Udt(t);return"object"===e?t?"type"in t?Object.assign({},t,Fdt[t.type]):"value"in t?(e=Udt(t.value),Object.assign({type:e},t,Fdt[e])):{type:"object",value:t}:{type:"object",value:null}:Object.assign({type:e,value:t},Fdt[e])}function Udt(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":typeof t}class Gdt{constructor(t){let{name:e,vs:i,fs:n,dependencies:r=[],uniforms:o,getUniforms:s,deprecations:a=[],defines:l={},inject:c={},vertexShader:u,fragmentShader:h}=t;zdt("string"==typeof e),this.name=e,this.vs=i||u,this.fs=n||h,this.getModuleUniforms=s,this.dependencies=r,this.deprecations=this._parseDeprecationDefinitions(a),this.defines=l,this.injections=function(t){const e={vs:{},fs:{}};for(const i in t){let n=t[i];"string"==typeof n&&(n={order:0,injection:n}),e[i.slice(0,2)][i]=n}return e}(c),o&&(this.uniforms=function(t){const e={};for(const i in t){const n=Vdt(t[i]);e[i]=n}return e}(o))}getModuleSource(t){let e;switch(t){case"vs":e=this.vs||"";break;case"fs":e=this.fs||"";break;default:zdt(!1)}return"#define MODULE_".concat(this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_"),"\n").concat(e,"// END MODULE_").concat(this.name,"\n\n")}getUniforms(t,e){return this.getModuleUniforms?this.getModuleUniforms(t,e):this.uniforms?this._defaultGetUniforms(t):{}}getDefines(){return this.defines}checkDeprecations(t,e){this.deprecations.forEach((i=>{i.regex.test(t)&&(i.deprecated?e.deprecated(i.old,i.new)():e.removed(i.old,i.new)())}))}_parseDeprecationDefinitions(t){return t.forEach((t=>{if("function"===t.type)t.regex=new RegExp("\\b".concat(t.old,"\\("));else t.regex=new RegExp("".concat(t.type," ").concat(t.old,";"))})),t}_defaultGetUniforms(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e={},i=this.uniforms;for(const n in i){const r=i[n];n in t&&!r.private?(r.validate&&zdt(r.validate(t[n],r),"".concat(this.name,": invalid ").concat(n)),e[n]=t[n]):e[n]=r.value}return e}}function jdt(t){return function(t){const e={},i={};return Hdt({modules:t,level:0,moduleMap:e,moduleDepth:i}),Object.keys(i).sort(((t,e)=>i[e]-i[t])).map((t=>e[t]))}(Wdt(t))}function Hdt(t){let{modules:e,level:i,moduleMap:n,moduleDepth:r}=t;if(i>=5)throw new Error("Possible loop in shader dependency graph");for(const t of e)n[t.name]=t,(void 0===r[t.name]||r[t.name]<i)&&(r[t.name]=i);for(const t of e)t.dependencies&&Hdt({modules:t.dependencies,level:i+1,moduleMap:n,moduleDepth:r})}function Wdt(t,e){return t.map((t=>(t instanceof Gdt||(zdt("string"!=typeof t,"Shader module use by name is deprecated. Import shader module '".concat(t,"' and use it directly.")),zdt(t.name,"shader module has no name"),(t=new Gdt(t)).dependencies=Wdt(t.dependencies)),t)))}const qdt=7936,Xdt=7937,Zdt=7938,Ydt=35724,Qdt={GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]},Jdt={};Object.keys(Qdt).forEach((t=>{Jdt[t]=t}));const Kdt={};function $dt(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=Qdt[e];if(zdt(n,e),!function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e="undefined"!=typeof window&&window.navigator||{},i=t.userAgent||e.userAgent||"",n=-1!==i.indexOf("MSIE "),r=-1!==i.indexOf("Trident/");return n||r}(i))return!0;if(e in Kdt)return Kdt[e];const r=n[0],o=i.behavior||"enable",s="#extension GL_".concat(r," : ").concat(o,"\nvoid main(void) {}"),a=t.createShader(35633);t.shaderSource(a,s),t.compileShader(a);const l=t.getShaderParameter(a,35713);return t.deleteShader(a),Kdt[e]=l,l}function tft(t,e){const i=Qdt[e];zdt(i,e);const n=function(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&2===t._version)}(t)&&i[1]||i[0],r="string"==typeof n?Boolean(t.getExtension(n)):n;return zdt(!1===r||!0===r),r}function eft(t,e){return(e=Array.isArray(e)?e:[e]).every((e=>tft(t,e)))}function ift(t){const e=function(t){const e=t.getExtension("WEBGL_debug_renderer_info"),i=t.getParameter(e&&e.UNMASKED_VENDOR_WEBGL||qdt),n=t.getParameter(e&&e.UNMASKED_RENDERER_WEBGL||Xdt);return{gpuVendor:function(t,e){return t.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":t.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":t.match(/AMD/i)||e.match(/AMD/i)||t.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN GPU"}(i,n),vendor:i,renderer:n,version:t.getParameter(Zdt),shadingLanguageVersion:t.getParameter(Ydt)}}(t);switch(e.gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n"}}const nft={[Ndt]:"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n",[Bdt]:"#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"},rft="__LUMA_INJECT_DECLARATIONS__",oft=/void\s+main\s*\([^)]*\)\s*\{\n?/,sft=/}\n?[^{}]*$/,aft=[];function lft(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=e===Ndt;for(const e in i){const n=i[e];n.sort(((t,e)=>t.order-e.order)),aft.length=n.length;for(let t=0,e=n.length;t<e;++t)aft[t]=n[t].injection;const o="".concat(aft.join("\n"),"\n");switch(e){case"vs:#decl":r&&(t=t.replace(rft,o));break;case"vs:#main-start":r&&(t=t.replace(oft,(t=>t+o)));break;case"vs:#main-end":r&&(t=t.replace(sft,(t=>o+t)));break;case"fs:#decl":r||(t=t.replace(rft,o));break;case"fs:#main-start":r||(t=t.replace(oft,(t=>t+o)));break;case"fs:#main-end":r||(t=t.replace(sft,(t=>o+t)));break;default:t=t.replace(e,(t=>t+o))}}return t=t.replace(rft,""),n&&(t=t.replace(/\}\s*$/,(t=>t+nft[e]))),t}function cft(t){const e={};return zdt(Array.isArray(t)&&t.length>1),t.forEach((t=>{for(const i in t)e[i]=e[i]?"".concat(e[i],"\n").concat(t[i]):t[i]})),e}function uft(t){return new RegExp("\\b".concat(t,"[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)"),"g")}const hft=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,"#version 300 es\n"],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],pft=[...hft,[uft("attribute"),"in $1"],[uft("varying"),"out $1"]],dft=[...hft,[uft("varying"),"in $1"]],fft=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],mft=[...fft,[uft("in"),"attribute $1"],[uft("out"),"varying $1"]],gft=[...fft,[uft("in"),"varying $1"]],yft="gl_FragColor",vft=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,_ft=/void\s+main\s*\([^)]*\)\s*\{\n?/;function xft(t,e,i){switch(e){case 300:return i?bft(t,pft):function(t){t=bft(t,dft);const e=t.match(vft);if(e){const i=e[1];t=t.replace(new RegExp("\\b".concat(yft,"\\b"),"g"),i)}else{const e="fragmentColor";t=t.replace(_ft,(t=>"out vec4 ".concat(e,";\n").concat(t))).replace(new RegExp("\\b".concat(yft,"\\b"),"g"),e)}return t}(t);case 100:return i?bft(t,mft):function(t){t=bft(t,gft);const e=t.match(vft);if(e){const i=e[1];t=t.replace(vft,"").replace(new RegExp("\\b".concat(i,"\\b"),"g"),yft)}return t}(t);default:throw new Error("unknown GLSL version ".concat(e))}}function bft(t,e){for(const[i,n]of e)t=t.replace(i,n);return t}const wft="\n\n".concat(rft,"\n\n"),Aft={[Ndt]:"vertex",[Bdt]:"fragment"},Eft="precision highp float;\n\n";function Sft(t,e){let{id:i,source:n,type:r,modules:o,defines:s={},hookFunctions:a=[],inject:l={},transpileToGLSL100:c=!1,prologue:u=!0,log:h}=e;zdt("string"==typeof n,"shader source must be a string");const p=r===Ndt,d=n.split("\n");let f=100,m="",g=n;0===d[0].indexOf("#version ")?(f=300,m=d[0],g=d.slice(1).join("\n")):m="#version ".concat(f);const y={};o.forEach((t=>{Object.assign(y,t.getDefines())})),Object.assign(y,s);let v=u?"".concat(m,"\n").concat(function(t){let{id:e,source:i,type:n}=t;const r=e&&"string"==typeof e&&-1===i.indexOf("SHADER_NAME");return r?"\n#define SHADER_NAME ".concat(e,"_").concat(Aft[n],"\n\n"):""}({id:i,source:n,type:r}),"\n").concat(function(t){let{type:e}=t;return"\n#define SHADER_TYPE_".concat(Aft[e].toUpperCase(),"\n")}({type:r}),"\n").concat(ift(t),"\n").concat(function(t,e,i){let n="#if (__VERSION__ > 120)\n\n# define FEATURE_GLSL_DERIVATIVES\n# define FEATURE_GLSL_DRAW_BUFFERS\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FEATURE_GLSL_TEXTURE_LOD\n\n// DEPRECATED FLAGS, remove in v9\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return eft(t,Jdt.GLSL_FRAG_DEPTH)&&(n+="\n// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),eft(t,Jdt.GLSL_DERIVATIVES)&&$dt(t,Jdt.GLSL_DERIVATIVES)&&(n+="\n// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define FEATURE_GLSL_DERIVATIVES\n# define DERIVATIVES\n#endif\n"),eft(t,Jdt.GLSL_FRAG_DATA)&&$dt(t,Jdt.GLSL_FRAG_DATA,{behavior:"require"})&&(n+="\n// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define FEATURE_GLSL_DRAW_BUFFERS\n#define DRAW_BUFFERS\n#endif\n"),eft(t,Jdt.GLSL_TEXTURE_LOD)&&(n+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n\n# define FEATURE_GLSL_TEXTURE_LOD\n# define TEXTURE_LOD\n\n#endif\n"),n}(t),"\n").concat(function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=0,i="";for(const n in t){0===e&&(i+="\n// APPLICATION DEFINES\n"),e++;const r=t[n];(r||Number.isFinite(r))&&(i+="#define ".concat(n.toUpperCase()," ").concat(t[n],"\n"))}0===e&&(i+="\n");return i}(y),"\n").concat(p?"":Eft,"\n"):"".concat(m,"\n");const _=function(t){const e={vs:{},fs:{}};return t.forEach((t=>{let i;"string"!=typeof t?(i=t,t=i.hook):i={},t=t.trim();const[n,r]=t.split(":"),o=t.replace(/\(.+/,"");e[n][o]=Object.assign(i,{signature:r})})),e}(a),x={},b={},w={};for(const t in l){const e="string"==typeof l[t]?{injection:l[t],order:0}:l[t],i=t.match(/^(v|f)s:(#)?([\w-]+)$/);if(i){const n=i[2],r=i[3];n?"decl"===r?b[t]=[e]:w[t]=[e]:x[t]=[e]}else w[t]=[e]}for(const t of o){h&&t.checkDeprecations(g,h);v+=t.getModuleSource(r,f);const e=t.injections[r];for(const t in e){const i=t.match(/^(v|f)s:#([\w-]+)$/);if(i){const n="decl"===i[2]?b:w;n[t]=n[t]||[],n[t].push(e[t])}else x[t]=x[t]||[],x[t].push(e[t])}}return v+=wft,v=lft(v,r,b),v+=function(t,e){let i="";for(const n in t){const r=t[n];if(i+="void ".concat(r.signature," {\n"),r.header&&(i+=" ".concat(r.header)),e[n]){const t=e[n];t.sort(((t,e)=>t.order-e.order));for(const e of t)i+=" ".concat(e.injection,"\n")}r.footer&&(i+=" ".concat(r.footer)),i+="}\n"}return i}(_[r],x),v+=g,v=lft(v,r,w),v=xft(v,c?100:f,p),v}function Mft(t){return function(e){const i={};for(const n of t){const t=n.getUniforms(e,i);Object.assign(i,t)}return i}}const Tft="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",Ift="#version 300 es\n".concat(Tft);function Cft(t,e){e=Array.isArray(e)?e:[e];const i=t.replace(/^\s+/,"").split(/\s+/),[n,r,o]=i;if(!e.includes(n)||!r||!o)return null;return{qualifier:n,type:r,name:o.split(";")[0]}}function Pft(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{version:e=100,input:i,inputType:n,output:r}=t;if(!i)return 300===e?Ift:e>300?"#version ".concat(e,"\n").concat(Tft):"void main() {gl_FragColor = vec4(0);}";const o=function(t,e){switch(e){case"float":return"vec4(".concat(t,", 0.0, 0.0, 1.0)");case"vec2":return"vec4(".concat(t,", 0.0, 1.0)");case"vec3":return"vec4(".concat(t,", 1.0)");case"vec4":return t;default:return zdt(!1),null}}(i,n);return e>=300?"#version ".concat(e," ").concat(300===e?"es":"","\nin ").concat(n," ").concat(i,";\nout vec4 ").concat(r,";\nvoid main() {\n ").concat(r," = ").concat(o,";\n}"):"varying ".concat(n," ").concat(i,";\nvoid main() {\n gl_FragColor = ").concat(o,";\n}")}const Lft={name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n float r, s, t, x;\n\n if (a == 0.0) {\n return 0.0;\n }\n\n x = -a * a;\n s = a;\n r = a;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_3;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_5;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_7;\n s = s + t;\n\n r = r * x;\n t = r * INVERSE_FACTORIAL_9;\n s = s + t;\n\n return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n if (a == 0.0) {\n sin_t = 0.0;\n cos_t = 1.0;\n }\n sin_t = sin_taylor_fp32(a);\n cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n float sin_a;\n float cos_a;\n\n if (a == 0.0) {\n return 0.0;\n }\n float z = floor(a / TWO_PI);\n float r = a - TWO_PI * z;\n\n float t;\n float q = floor(r / PI_2 + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return 1.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 1.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null};function Dft(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=Math.fround(t),r=t-n;return e[i]=n,e[i+1]=r,e}const Rft={ONE:1};const Oft={name:"fp64-arithmetic",vs:"uniform float ONE;\nvec2 split(float a) {\n const float SPLIT = 4097.0;\n float t = a * SPLIT;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float a_hi = t * ONE - (t - a);\n float a_lo = a * ONE - a_hi;\n#else\n float a_hi = t - (t - a);\n float a_lo = a - a_hi;\n#endif\n return vec2(a_hi, a_lo);\n}\nvec2 split2(vec2 a) {\n vec2 b = split(a.x);\n b.y += a.y;\n return b;\n}\nvec2 quickTwoSum(float a, float b) {\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float sum = (a + b) * ONE;\n float err = b - (sum - a) * ONE;\n#else\n float sum = a + b;\n float err = b - (sum - a);\n#endif\n return vec2(sum, err);\n}\nvec2 twoSum(float a, float b) {\n float s = (a + b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE + (b - v);\n#else\n float v = s - a;\n float err = (a - (s - v)) + (b - v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSub(float a, float b) {\n float s = (a - b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE - (b + v);\n#else\n float v = s - a;\n float err = (a - (s - v)) - (b + v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSqr(float a) {\n float prod = a * a;\n vec2 a_fp64 = split(a);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float err = ((a_fp64.x * a_fp64.x - prod) * ONE + 2.0 * a_fp64.x *\n a_fp64.y * ONE * ONE) + a_fp64.y * a_fp64.y * ONE * ONE * ONE;\n#else\n float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y;\n#endif\n return vec2(prod, err);\n}\n\nvec2 twoProd(float a, float b) {\n float prod = a * b;\n vec2 a_fp64 = split(a);\n vec2 b_fp64 = split(b);\n float err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y +\n a_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y;\n return vec2(prod, err);\n}\n\nvec2 sum_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSum(a.x, b.x);\n t = twoSum(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 sub_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSub(a.x, b.x);\n t = twoSub(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 mul_fp64(vec2 a, vec2 b) {\n vec2 prod = twoProd(a.x, b.x);\n prod.y += a.x * b.y;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n prod.y += a.y * b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n return prod;\n}\n\nvec2 div_fp64(vec2 a, vec2 b) {\n float xn = 1.0 / b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n vec2 yn = mul_fp64(a, vec2(xn, 0));\n#else\n vec2 yn = a * xn;\n#endif\n float diff = (sub_fp64(a, mul_fp64(b, yn))).x;\n vec2 prod = twoProd(xn, diff);\n return sum_fp64(yn, prod);\n}\n\nvec2 sqrt_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n\n float x = 1.0 / sqrt(a.x);\n float yn = a.x * x;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n vec2 yn_sqr = twoSqr(yn) * ONE;\n#else\n vec2 yn_sqr = twoSqr(yn);\n#endif\n float diff = sub_fp64(a, yn_sqr).x;\n vec2 prod = twoProd(x * 0.5, diff);\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n return sum_fp64(split(yn), prod);\n#else\n return sum_fp64(vec2(yn, 0.0), prod);\n#endif\n}\n",fs:null,getUniforms:function(){return Rft},fp64ify:Dft,fp64LowPart:function(t){return t-Math.fround(t)},fp64ifyMatrix4:function(t){const e=new Float32Array(32);for(let i=0;i<4;++i)for(let n=0;n<4;++n){const r=4*i+n;Dft(t[4*n+i],e,2*r)}return e}};function kft(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}const Nft=1/Math.PI*180,Bft=1/180*Math.PI,zft={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0};function Fft(t,{precision:e=zft.precision}={}){return t=function(t){return Math.round(t/zft.EPSILON)*zft.EPSILON}(t),"".concat(parseFloat(t.toPrecision(e)))}function Vft(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Uft(t){return function(t,e){return Xft(t,(t=>t*Bft),e)}(t)}function Gft(t){return jft(t)}function jft(t,e){return Xft(t,(t=>t*Nft),e)}function Hft(t,e,i){return Xft(t,(t=>Math.max(e,Math.min(i,t))))}function Wft(t,e,i){return Vft(t)?t.map(((t,n)=>Wft(t,e[n],i))):i*e+(1-i)*t}function qft(t,e,i){const n=zft.EPSILON;i&&(zft.EPSILON=i);try{if(t===e)return!0;if(Vft(t)&&Vft(e)){if(t.length!==e.length)return!1;for(let i=0;i<t.length;++i)if(!qft(t[i],e[i]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):"number"==typeof t&&"number"==typeof e&&Math.abs(t-e)<=zft.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{zft.EPSILON=n}}function Xft(t,e,i){if(Vft(t)){const n=t;i=i||function(t){return t.clone?t.clone():new Array(t.length)}(n);for(let r=0;r<i.length&&r<n.length;++r)i[r]=e(t[r],r,i);return i}return e(t)}class Zft extends(function(t){function e(){var e=Reflect.construct(t,Array.from(arguments));return Object.setPrototypeOf(e,Object.getPrototypeOf(this)),e}return e.prototype=Object.create(t.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t,e}(Array)){clone(){return(new this.constructor).copy(this)}fromArray(t,e=0){for(let i=0;i<this.ELEMENTS;++i)this[i]=t[i+e];return this.check()}toArray(t=[],e=0){for(let i=0;i<this.ELEMENTS;++i)t[e+i]=this[i];return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:Vft(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(zft)}formatString(t){let e="";for(let i=0;i<this.ELEMENTS;++i)e+=(i>0?", ":"")+Fft(this[i],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(e,"]")}equals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(!qft(this[e],t[e]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,e,i){if(void 0===i)return this.lerp(this,t,e);for(let n=0;n<this.ELEMENTS;++n){const r=t[n];this[n]=r+i*(e[n]-r)}return this.check()}min(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}max(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}clamp(t,e){for(let i=0;i<this.ELEMENTS;++i)this[i]=Math.min(Math.max(this[i],t[i]),e[i]);return this.check()}add(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]+=e[t];return this.check()}subtract(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]-=e[t];return this.check()}scale(t){if("number"==typeof t)for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;else for(let e=0;e<this.ELEMENTS&&e<t.length;++e)this[e]*=t[e];return this.check()}multiplyByScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}check(){if(zft.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let t=this.length===this.ELEMENTS;for(let e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}addScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,e){for(let i=0;i<this.ELEMENTS;++i)this[i]=Math.min(Math.max(this[i],t),e);return this.check()}get elements(){return this}}function Yft(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(t));return t}function Qft(t,e,i=""){if(zft.debug&&!function(t,e){if(t.length!==e)return!1;for(let e=0;e<t.length;++e)if(!Number.isFinite(t[e]))return!1;return!0}(t,e))throw new Error("math.gl: ".concat(i," some fields set to invalid numbers'"));return t}class Jft extends Zft{get x(){return this[0]}set x(t){this[0]=Yft(t)}get y(){return this[1]}set y(t){this[1]=Yft(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let e=0;for(let i=0;i<this.ELEMENTS;++i){const n=this[i]-t[i];e+=n*n}return Yft(e)}dot(t){let e=0;for(let i=0;i<this.ELEMENTS;++i)e+=this[i]*t[i];return Yft(e)}normalize(){const t=this.magnitude();if(0!==t)for(let e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}multiply(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]*=e[t];return this.check()}divide(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]/=e[t];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return kft(t>=0&&t<this.ELEMENTS,"index is out of range"),Yft(this[t])}setComponent(t,e){return kft(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}addVectors(t,e){return this.copy(t).add(e)}subVectors(t,e){return this.copy(t).subtract(e)}multiplyVectors(t,e){return this.copy(t).multiply(e)}addScaledVector(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}}var Kft=1e-6,$ft="undefined"!=typeof Float32Array?Float32Array:Array;function tmt(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t}function emt(t,e,i,n){var r=e[0],o=e[1];return t[0]=r+n*(i[0]-r),t[1]=o+n*(i[1]-o),t}function imt(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[3]*r+i[6],t[1]=i[1]*n+i[4]*r+i[7],t}function nmt(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[4]*r+i[12],t[1]=i[1]*n+i[5]*r+i[13],t}function rmt(t,e,i){const n=e[0],r=e[1],o=i[3]*n+i[7]*r||1;return t[0]=(i[0]*n+i[4]*r)/o,t[1]=(i[1]*n+i[5]*r)/o,t}function omt(t,e,i){const n=e[0],r=e[1],o=e[2],s=i[3]*n+i[7]*r+i[11]*o||1;return t[0]=(i[0]*n+i[4]*r+i[8]*o)/s,t[1]=(i[1]*n+i[5]*r+i[9]*o)/s,t[2]=(i[2]*n+i[6]*r+i[10]*o)/s,t}function smt(t,e,i){const n=e[0],r=e[1],o=e[2];return t[0]=i[0]*n+i[3]*r+i[6]*o,t[1]=i[1]*n+i[4]*r+i[7]*o,t[2]=i[2]*n+i[5]*r+i[8]*o,t[3]=e[3],t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)}),function(){var t=new $ft(2);$ft!=Float32Array&&(t[0]=0,t[1]=0)}();class amt extends Jft{constructor(t=0,e=0){super(2),Vft(t)&&1===arguments.length?this.copy(t):(zft.debug&&(Yft(t),Yft(e)),this[0]=t,this[1]=e)}set(t,e){return this[0]=t,this[1]=e,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this.check()}fromObject(t){return zft.debug&&(Yft(t.x),Yft(t.y)),this[0]=t.x,this[1]=t.y,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return nmt(this,this,t),this.check()}transformAsVector(t){return rmt(this,this,t),this.check()}transformByMatrix3(t){return imt(this,this,t),this.check()}transformByMatrix2x3(t){return function(t,e,i){var n=e[0],r=e[1];t[0]=i[0]*n+i[2]*r+i[4],t[1]=i[1]*n+i[3]*r+i[5]}(this,this,t),this.check()}transformByMatrix2(t){return function(t,e,i){var n=e[0],r=e[1];t[0]=i[0]*n+i[2]*r,t[1]=i[1]*n+i[3]*r}(this,this,t),this.check()}}function lmt(){var t=new $ft(3);return $ft!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function cmt(t){var e=t[0],i=t[1],n=t[2];return Math.hypot(e,i,n)}function umt(t,e,i){var n=new $ft(3);return n[0]=t,n[1]=e,n[2]=i,n}function hmt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function pmt(t,e,i){var n=e[0],r=e[1],o=e[2],s=i[0],a=i[1],l=i[2];return t[0]=r*l-o*a,t[1]=o*s-n*l,t[2]=n*a-r*s,t}function dmt(t,e,i){var n=e[0],r=e[1],o=e[2],s=i[3]*n+i[7]*r+i[11]*o+i[15];return s=s||1,t[0]=(i[0]*n+i[4]*r+i[8]*o+i[12])/s,t[1]=(i[1]*n+i[5]*r+i[9]*o+i[13])/s,t[2]=(i[2]*n+i[6]*r+i[10]*o+i[14])/s,t}function fmt(t,e,i){var n=e[0],r=e[1],o=e[2];return t[0]=n*i[0]+r*i[3]+o*i[6],t[1]=n*i[1]+r*i[4]+o*i[7],t[2]=n*i[2]+r*i[5]+o*i[8],t}function mmt(t,e,i){var n=i[0],r=i[1],o=i[2],s=i[3],a=e[0],l=e[1],c=e[2],u=r*c-o*l,h=o*a-n*c,p=n*l-r*a,d=r*p-o*h,f=o*u-n*p,m=n*h-r*u,g=2*s;return u*=g,h*=g,p*=g,d*=2,f*=2,m*=2,t[0]=a+u+d,t[1]=l+h+f,t[2]=c+p+m,t}var gmt=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t},ymt=cmt;!function(){var t=lmt()}();const vmt=[0,0,0];let _mt,xmt;class bmt extends Jft{static get ZERO(){return _mt||(_mt=new bmt(0,0,0),Object.freeze(_mt)),_mt}constructor(t=0,e=0,i=0){super(-0,-0,-0),1===arguments.length&&Vft(t)?this.copy(t):(zft.debug&&(Yft(t),Yft(e),Yft(i)),this[0]=t,this[1]=e,this[2]=i)}set(t,e,i){return this[0]=t,this[1]=e,this[2]=i,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return zft.debug&&(Yft(t.x),Yft(t.y),Yft(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=Yft(t)}angle(t){return function(t,e){var i=t[0],n=t[1],r=t[2],o=e[0],s=e[1],a=e[2],l=Math.sqrt(i*i+n*n+r*r)*Math.sqrt(o*o+s*s+a*a),c=l&&hmt(t,e)/l;return Math.acos(Math.min(Math.max(c,-1),1))}(this,t)}cross(t){return pmt(this,this,t),this.check()}rotateX({radians:t,origin:e=vmt}){return function(t,e,i,n){var r=[],o=[];r[0]=e[0]-i[0],r[1]=e[1]-i[1],r[2]=e[2]-i[2],o[0]=r[0],o[1]=r[1]*Math.cos(n)-r[2]*Math.sin(n),o[2]=r[1]*Math.sin(n)+r[2]*Math.cos(n),t[0]=o[0]+i[0],t[1]=o[1]+i[1],t[2]=o[2]+i[2]}(this,this,e,t),this.check()}rotateY({radians:t,origin:e=vmt}){return function(t,e,i,n){var r=[],o=[];r[0]=e[0]-i[0],r[1]=e[1]-i[1],r[2]=e[2]-i[2],o[0]=r[2]*Math.sin(n)+r[0]*Math.cos(n),o[1]=r[1],o[2]=r[2]*Math.cos(n)-r[0]*Math.sin(n),t[0]=o[0]+i[0],t[1]=o[1]+i[1],t[2]=o[2]+i[2]}(this,this,e,t),this.check()}rotateZ({radians:t,origin:e=vmt}){return function(t,e,i,n){var r=[],o=[];r[0]=e[0]-i[0],r[1]=e[1]-i[1],r[2]=e[2]-i[2],o[0]=r[0]*Math.cos(n)-r[1]*Math.sin(n),o[1]=r[0]*Math.sin(n)+r[1]*Math.cos(n),o[2]=r[2],t[0]=o[0]+i[0],t[1]=o[1]+i[1],t[2]=o[2]+i[2]}(this,this,e,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return dmt(this,this,t),this.check()}transformAsVector(t){return omt(this,this,t),this.check()}transformByMatrix3(t){return fmt(this,this,t),this.check()}transformByMatrix2(t){return function(t,e,i){const n=e[0],r=e[1];t[0]=i[0]*n+i[2]*r,t[1]=i[1]*n+i[3]*r,t[2]=e[2]}(this,this,t),this.check()}transformByQuaternion(t){return mmt(this,this,t),this.check()}}class wmt extends Jft{static get ZERO(){return xmt||(xmt=new wmt(0,0,0,0),Object.freeze(xmt)),xmt}constructor(t=0,e=0,i=0,n=0){super(-0,-0,-0,-0),Vft(t)&&1===arguments.length?this.copy(t):(zft.debug&&(Yft(t),Yft(e),Yft(i),Yft(n)),this[0]=t,this[1]=e,this[2]=i,this[3]=n)}set(t,e,i,n){return this[0]=t,this[1]=e,this[2]=i,this[3]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}fromObject(t){return zft.debug&&(Yft(t.x),Yft(t.y),Yft(t.z),Yft(t.w)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t.w=this[3],t}get ELEMENTS(){return 4}get z(){return this[2]}set z(t){this[2]=Yft(t)}get w(){return this[3]}set w(t){this[3]=Yft(t)}transform(t){return dmt(this,this,t),this.check()}transformByMatrix3(t){return smt(this,this,t),this.check()}transformByMatrix2(t){return function(t,e,i){const n=e[0],r=e[1];t[0]=i[0]*n+i[2]*r,t[1]=i[1]*n+i[3]*r,t[2]=e[2],t[3]=e[3]}(this,this,t),this.check()}transformByQuaternion(t){return mmt(this,this,t),this.check()}applyMatrix4(t){return t.transform(this,this),this}}class Amt extends Zft{toString(){let t="[";if(zft.printRowMajor){t+="row-major:";for(let e=0;e<this.RANK;++e)for(let i=0;i<this.RANK;++i)t+=" ".concat(this[i*this.RANK+e])}else{t+="column-major:";for(let e=0;e<this.ELEMENTS;++e)t+=" ".concat(this[e])}return t+="]",t}getElementIndex(t,e){return e*this.RANK+t}getElement(t,e){return this[e*this.RANK+t]}setElement(t,e,i){return this[e*this.RANK+t]=Yft(i),this}getColumn(t,e=new Array(this.RANK).fill(-0)){const i=t*this.RANK;for(let t=0;t<this.RANK;++t)e[t]=this[i+t];return e}setColumn(t,e){const i=t*this.RANK;for(let t=0;t<this.RANK;++t)this[i+t]=e[t];return this}}function Emt(t,e,i){var n=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],p=i[0],d=i[1],f=i[2],m=i[3],g=i[4],y=i[5],v=i[6],_=i[7],x=i[8];return t[0]=p*n+d*s+f*c,t[1]=p*r+d*a+f*u,t[2]=p*o+d*l+f*h,t[3]=m*n+g*s+y*c,t[4]=m*r+g*a+y*u,t[5]=m*o+g*l+y*h,t[6]=v*n+_*s+x*c,t[7]=v*r+_*a+x*u,t[8]=v*o+_*l+x*h,t}function Smt(t,e,i){var n=i[0],r=i[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=r*e[3],t[4]=r*e[4],t[5]=r*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}var Mmt;!function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL1ROW0=3]="COL1ROW0",t[t.COL1ROW1=4]="COL1ROW1",t[t.COL1ROW2=5]="COL1ROW2",t[t.COL2ROW0=6]="COL2ROW0",t[t.COL2ROW1=7]="COL2ROW1",t[t.COL2ROW2=8]="COL2ROW2"}(Mmt||(Mmt={}));const Tmt=Object.freeze([1,0,0,0,1,0,0,0,1]);class Imt extends Amt{static get IDENTITY(){return function(){Pmt||(Pmt=new Imt,Object.freeze(Pmt));return Pmt}()}static get ZERO(){return function(){Cmt||(Cmt=new Imt([0,0,0,0,0,0,0,0,0]),Object.freeze(Cmt));return Cmt}()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return Mmt}constructor(t,...e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?this.copy(t):e.length>0?this.copy([t,...e]):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(Tmt)}fromObject(t){return this.check()}fromQuaternion(t){return function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=i+i,a=n+n,l=r+r,c=i*s,u=n*s,h=n*a,p=r*s,d=r*a,f=r*l,m=o*s,g=o*a,y=o*l;t[0]=1-h-f,t[3]=u-y,t[6]=p+g,t[1]=u+y,t[4]=1-c-f,t[7]=d-m,t[2]=p-g,t[5]=d+m,t[8]=1-c-h}(this,t),this.check()}set(t,e,i,n,r,o,s,a,l){return this[0]=t,this[1]=e,this[2]=i,this[3]=n,this[4]=r,this[5]=o,this[6]=s,this[7]=a,this[8]=l,this.check()}setRowMajor(t,e,i,n,r,o,s,a,l){return this[0]=t,this[1]=n,this[2]=s,this[3]=e,this[4]=r,this[5]=a,this[6]=i,this[7]=o,this[8]=l,this.check()}determinant(){return function(t){var e=t[0],i=t[1],n=t[2],r=t[3],o=t[4],s=t[5],a=t[6],l=t[7],c=t[8];return e*(c*o-s*l)+i*(-c*r+s*a)+n*(l*r-o*a)}(this)}transpose(){return function(t,e){if(t===e){var i=e[1],n=e[2],r=e[5];t[1]=e[3],t[2]=e[6],t[3]=i,t[5]=e[7],t[6]=n,t[7]=r}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8]}(this,this),this.check()}invert(){return function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*s-a*c,p=-u*o+a*l,d=c*o-s*l,f=i*h+n*p+r*d;f&&(f=1/f,t[0]=h*f,t[1]=(-u*n+r*c)*f,t[2]=(a*n-r*s)*f,t[3]=p*f,t[4]=(u*i-r*l)*f,t[5]=(-a*i+r*o)*f,t[6]=d*f,t[7]=(-c*i+n*l)*f,t[8]=(s*i-n*o)*f)}(this,this),this.check()}multiplyLeft(t){return Emt(this,t,this),this.check()}multiplyRight(t){return Emt(this,this,t),this.check()}rotate(t){return function(t,e,i){var n=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],p=Math.sin(i),d=Math.cos(i);t[0]=d*n+p*s,t[1]=d*r+p*a,t[2]=d*o+p*l,t[3]=d*s-p*n,t[4]=d*a-p*r,t[5]=d*l-p*o,t[6]=c,t[7]=u,t[8]=h}(this,this,t),this.check()}scale(t){return Array.isArray(t)?Smt(this,this,t):Smt(this,this,[t,t]),this.check()}translate(t){return function(t,e,i){var n=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],p=i[0],d=i[1];t[0]=n,t[1]=r,t[2]=o,t[3]=s,t[4]=a,t[5]=l,t[6]=p*n+d*s+c,t[7]=p*r+d*a+u,t[8]=p*o+d*l+h}(this,this,t),this.check()}transform(t,e){let i;switch(t.length){case 2:i=imt(e||[-0,-0],t,this);break;case 3:i=fmt(e||[-0,-0,-0],t,this);break;case 4:i=smt(e||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Qft(i,t.length),i}transformVector(t,e){return this.transform(t,e)}transformVector2(t,e){return this.transform(t,e)}transformVector3(t,e){return this.transform(t,e)}}let Cmt,Pmt;function Lmt(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],p=e[10],d=e[11],f=e[12],m=e[13],g=e[14],y=e[15],v=i*a-n*s,_=i*l-r*s,x=i*c-o*s,b=n*l-r*a,w=n*c-o*a,A=r*c-o*l,E=u*m-h*f,S=u*g-p*f,M=u*y-d*f,T=h*g-p*m,I=h*y-d*m,C=p*y-d*g,P=v*C-_*I+x*T+b*M-w*S+A*E;return P?(P=1/P,t[0]=(a*C-l*I+c*T)*P,t[1]=(r*I-n*C-o*T)*P,t[2]=(m*A-g*w+y*b)*P,t[3]=(p*w-h*A-d*b)*P,t[4]=(l*M-s*C-c*S)*P,t[5]=(i*C-r*M+o*S)*P,t[6]=(g*x-f*A-y*_)*P,t[7]=(u*A-p*x+d*_)*P,t[8]=(s*I-a*M+c*E)*P,t[9]=(n*M-i*I-o*E)*P,t[10]=(f*w-m*x+y*v)*P,t[11]=(h*x-u*w-d*v)*P,t[12]=(a*S-s*T-l*E)*P,t[13]=(i*T-n*S+r*E)*P,t[14]=(m*_-f*b-g*v)*P,t[15]=(u*b-h*_+p*v)*P,t):null}function Dmt(t,e,i){var n=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],p=e[9],d=e[10],f=e[11],m=e[12],g=e[13],y=e[14],v=e[15],_=i[0],x=i[1],b=i[2],w=i[3];return t[0]=_*n+x*a+b*h+w*m,t[1]=_*r+x*l+b*p+w*g,t[2]=_*o+x*c+b*d+w*y,t[3]=_*s+x*u+b*f+w*v,_=i[4],x=i[5],b=i[6],w=i[7],t[4]=_*n+x*a+b*h+w*m,t[5]=_*r+x*l+b*p+w*g,t[6]=_*o+x*c+b*d+w*y,t[7]=_*s+x*u+b*f+w*v,_=i[8],x=i[9],b=i[10],w=i[11],t[8]=_*n+x*a+b*h+w*m,t[9]=_*r+x*l+b*p+w*g,t[10]=_*o+x*c+b*d+w*y,t[11]=_*s+x*u+b*f+w*v,_=i[12],x=i[13],b=i[14],w=i[15],t[12]=_*n+x*a+b*h+w*m,t[13]=_*r+x*l+b*p+w*g,t[14]=_*o+x*c+b*d+w*y,t[15]=_*s+x*u+b*f+w*v,t}function Rmt(t,e,i){var n,r,o,s,a,l,c,u,h,p,d,f,m=i[0],g=i[1],y=i[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*y+e[12],t[13]=e[1]*m+e[5]*g+e[9]*y+e[13],t[14]=e[2]*m+e[6]*g+e[10]*y+e[14],t[15]=e[3]*m+e[7]*g+e[11]*y+e[15]):(n=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],p=e[9],d=e[10],f=e[11],t[0]=n,t[1]=r,t[2]=o,t[3]=s,t[4]=a,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=p,t[10]=d,t[11]=f,t[12]=n*m+a*g+h*y+e[12],t[13]=r*m+l*g+p*y+e[13],t[14]=o*m+c*g+d*y+e[14],t[15]=s*m+u*g+f*y+e[15]),t}function Omt(t,e,i){var n=i[0],r=i[1],o=i[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function kmt(t,e,i){var n=Math.sin(i),r=Math.cos(i),o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u=e[9],h=e[10],p=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*r+c*n,t[5]=s*r+u*n,t[6]=a*r+h*n,t[7]=l*r+p*n,t[8]=c*r-o*n,t[9]=u*r-s*n,t[10]=h*r-a*n,t[11]=p*r-l*n,t}function Nmt(t,e,i){var n=Math.sin(i),r=Math.cos(i),o=e[0],s=e[1],a=e[2],l=e[3],c=e[4],u=e[5],h=e[6],p=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*r+c*n,t[1]=s*r+u*n,t[2]=a*r+h*n,t[3]=l*r+p*n,t[4]=c*r-o*n,t[5]=u*r-s*n,t[6]=h*r-a*n,t[7]=p*r-l*n,t}var Bmt=function(t,e,i,n,r){var o,s=1/Math.tan(e/2);return t[0]=s/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0?(o=1/(n-r),t[10]=(r+n)*o,t[14]=2*r*n*o):(t[10]=-1,t[14]=-2*n),t};var zmt,Fmt=function(t,e,i,n,r,o,s){var a=1/(e-i),l=1/(n-r),c=1/(o-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+i)*a,t[13]=(r+n)*l,t[14]=(s+o)*c,t[15]=1,t};function Vmt(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t}function Umt(t,e,i){var n=e[0],r=e[1],o=e[2],s=e[3];return t[0]=i[0]*n+i[4]*r+i[8]*o+i[12]*s,t[1]=i[1]*n+i[5]*r+i[9]*o+i[13]*s,t[2]=i[2]*n+i[6]*r+i[10]*o+i[14]*s,t[3]=i[3]*n+i[7]*r+i[11]*o+i[15]*s,t}!function(){var t=function(){var t=new $ft(4);return $ft!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}()}(),function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL0ROW3=3]="COL0ROW3",t[t.COL1ROW0=4]="COL1ROW0",t[t.COL1ROW1=5]="COL1ROW1",t[t.COL1ROW2=6]="COL1ROW2",t[t.COL1ROW3=7]="COL1ROW3",t[t.COL2ROW0=8]="COL2ROW0",t[t.COL2ROW1=9]="COL2ROW1",t[t.COL2ROW2=10]="COL2ROW2",t[t.COL2ROW3=11]="COL2ROW3",t[t.COL3ROW0=12]="COL3ROW0",t[t.COL3ROW1=13]="COL3ROW1",t[t.COL3ROW2=14]="COL3ROW2",t[t.COL3ROW3=15]="COL3ROW3"}(zmt||(zmt={}));const Gmt=45*Math.PI/180,jmt=1,Hmt=.1,Wmt=500,qmt=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);class Xmt extends Amt{static get IDENTITY(){return function(){Ymt||(Ymt=new Xmt,Object.freeze(Ymt));return Ymt}()}static get ZERO(){return function(){Zmt||(Zmt=new Xmt([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Zmt));return Zmt}()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return zmt}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,e,i,n,r,o,s,a,l,c,u,h,p,d,f,m){return this[0]=t,this[1]=e,this[2]=i,this[3]=n,this[4]=r,this[5]=o,this[6]=s,this[7]=a,this[8]=l,this[9]=c,this[10]=u,this[11]=h,this[12]=p,this[13]=d,this[14]=f,this[15]=m,this.check()}setRowMajor(t,e,i,n,r,o,s,a,l,c,u,h,p,d,f,m){return this[0]=t,this[1]=r,this[2]=l,this[3]=p,this[4]=e,this[5]=o,this[6]=c,this[7]=d,this[8]=i,this[9]=s,this[10]=u,this[11]=f,this[12]=n,this[13]=a,this[14]=h,this[15]=m,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(qmt)}fromObject(t){return this.check()}fromQuaternion(t){return function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=i+i,a=n+n,l=r+r,c=i*s,u=n*s,h=n*a,p=r*s,d=r*a,f=r*l,m=o*s,g=o*a,y=o*l;t[0]=1-h-f,t[1]=u+y,t[2]=p-g,t[3]=0,t[4]=u-y,t[5]=1-c-f,t[6]=d+m,t[7]=0,t[8]=p+g,t[9]=d-m,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1}(this,t),this.check()}frustum(t){const{left:e,right:i,bottom:n,top:r,near:o=Hmt,far:s=Wmt}=t;return s===1/0?function(t,e,i,n,r,o){const s=2*o/(i-e),a=2*o/(r-n),l=(i+e)/(i-e),c=(r+n)/(r-n),u=-1,h=-1,p=-2*o;t[0]=s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=l,t[9]=c,t[10]=u,t[11]=h,t[12]=0,t[13]=0,t[14]=p,t[15]=0}(this,e,i,n,r,o):function(t,e,i,n,r,o,s){var a=1/(i-e),l=1/(r-n),c=1/(o-s);t[0]=2*o*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*l,t[6]=0,t[7]=0,t[8]=(i+e)*a,t[9]=(r+n)*l,t[10]=(s+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=s*o*2*c,t[15]=0}(this,e,i,n,r,o,s),this.check()}lookAt(t){const{eye:e,center:i=[0,0,0],up:n=[0,1,0]}=t;return function(t,e,i,n){var r,o,s,a,l,c,u,h,p,d,f=e[0],m=e[1],g=e[2],y=n[0],v=n[1],_=n[2],x=i[0],b=i[1],w=i[2];Math.abs(f-x)<Kft&&Math.abs(m-b)<Kft&&Math.abs(g-w)<Kft?function(t){t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1}(t):(u=f-x,h=m-b,p=g-w,r=v*(p*=d=1/Math.hypot(u,h,p))-_*(h*=d),o=_*(u*=d)-y*p,s=y*h-v*u,(d=Math.hypot(r,o,s))?(r*=d=1/d,o*=d,s*=d):(r=0,o=0,s=0),a=h*s-p*o,l=p*r-u*s,c=u*o-h*r,(d=Math.hypot(a,l,c))?(a*=d=1/d,l*=d,c*=d):(a=0,l=0,c=0),t[0]=r,t[1]=a,t[2]=u,t[3]=0,t[4]=o,t[5]=l,t[6]=h,t[7]=0,t[8]=s,t[9]=c,t[10]=p,t[11]=0,t[12]=-(r*f+o*m+s*g),t[13]=-(a*f+l*m+c*g),t[14]=-(u*f+h*m+p*g),t[15]=1)}(this,e,i,n),this.check()}ortho(t){const{left:e,right:i,bottom:n,top:r,near:o=Hmt,far:s=Wmt}=t;return Fmt(this,e,i,n,r,o,s),this.check()}orthographic(t){const{fovy:e=Gmt,aspect:i=jmt,focalDistance:n=1,near:r=Hmt,far:o=Wmt}=t;Qmt(e);const s=e/2,a=n*Math.tan(s),l=a*i;return this.ortho({left:-l,right:l,bottom:-a,top:a,near:r,far:o})}perspective(t){const{fovy:e=45*Math.PI/180,aspect:i=1,near:n=.1,far:r=500}=t;return Qmt(e),Bmt(this,e,i,n,r),this.check()}determinant(){return function(t){var e=t[0],i=t[1],n=t[2],r=t[3],o=t[4],s=t[5],a=t[6],l=t[7],c=t[8],u=t[9],h=t[10],p=t[11],d=t[12],f=t[13],m=t[14],g=t[15];return(e*s-i*o)*(h*g-p*m)-(e*a-n*o)*(u*g-p*f)+(e*l-r*o)*(u*m-h*f)+(i*a-n*s)*(c*g-p*d)-(i*l-r*s)*(c*m-h*d)+(n*l-r*a)*(c*f-u*d)}(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,e){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=e||[-0,-0,-0];const i=this.getScale(e),n=1/i[0],r=1/i[1],o=1/i[2];return t[0]=this[0]*n,t[1]=this[1]*r,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*n,t[5]=this[5]*r,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*n,t[9]=this[9]*r,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,e){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=e||[-0,-0,-0];const i=this.getScale(e),n=1/i[0],r=1/i[1],o=1/i[2];return t[0]=this[0]*n,t[1]=this[1]*r,t[2]=this[2]*o,t[3]=this[4]*n,t[4]=this[5]*r,t[5]=this[6]*o,t[6]=this[8]*n,t[7]=this[9]*r,t[8]=this[10]*o,t}transpose(){return function(t,e){if(t===e){var i=e[1],n=e[2],r=e[3],o=e[6],s=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=i,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=o,t[11]=e[14],t[12]=r,t[13]=s,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15]}(this,this),this.check()}invert(){return Lmt(this,this),this.check()}multiplyLeft(t){return Dmt(this,t,this),this.check()}multiplyRight(t){return Dmt(this,this,t),this.check()}rotateX(t){return kmt(this,this,t),this.check()}rotateY(t){return function(t,e,i){var n=Math.sin(i),r=Math.cos(i),o=e[0],s=e[1],a=e[2],l=e[3],c=e[8],u=e[9],h=e[10],p=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*r-c*n,t[1]=s*r-u*n,t[2]=a*r-h*n,t[3]=l*r-p*n,t[8]=o*n+c*r,t[9]=s*n+u*r,t[10]=a*n+h*r,t[11]=l*n+p*r}(this,this,t),this.check()}rotateZ(t){return Nmt(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,e){return function(t,e,i,n){var r,o,s,a,l,c,u,h,p,d,f,m,g,y,v,_,x,b,w,A,E,S,M,T,I=n[0],C=n[1],P=n[2],L=Math.hypot(I,C,P);L<Kft||(I*=L=1/L,C*=L,P*=L,r=Math.sin(i),s=1-(o=Math.cos(i)),a=e[0],l=e[1],c=e[2],u=e[3],h=e[4],p=e[5],d=e[6],f=e[7],m=e[8],g=e[9],y=e[10],v=e[11],_=I*I*s+o,x=C*I*s+P*r,b=P*I*s-C*r,w=I*C*s-P*r,A=C*C*s+o,E=P*C*s+I*r,S=I*P*s+C*r,M=C*P*s-I*r,T=P*P*s+o,t[0]=a*_+h*x+m*b,t[1]=l*_+p*x+g*b,t[2]=c*_+d*x+y*b,t[3]=u*_+f*x+v*b,t[4]=a*w+h*A+m*E,t[5]=l*w+p*A+g*E,t[6]=c*w+d*A+y*E,t[7]=u*w+f*A+v*E,t[8]=a*S+h*M+m*T,t[9]=l*S+p*M+g*T,t[10]=c*S+d*M+y*T,t[11]=u*S+f*M+v*T,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]))}(this,this,t,e),this.check()}scale(t){return Omt(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return Rmt(this,this,t),this.check()}transform(t,e){return 4===t.length?(Qft(e=Umt(e||[-0,-0,-0,-0],t,this),4),e):this.transformAsPoint(t,e)}transformAsPoint(t,e){const{length:i}=t;let n;switch(i){case 2:n=nmt(e||[-0,-0],t,this);break;case 3:n=dmt(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Qft(n,t.length),n}transformAsVector(t,e){let i;switch(t.length){case 2:i=rmt(e||[-0,-0],t,this);break;case 3:i=omt(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Qft(i,t.length),i}transformPoint(t,e){return this.transformAsPoint(t,e)}transformVector(t,e){return this.transformAsPoint(t,e)}transformDirection(t,e){return this.transformAsVector(t,e)}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,e,i){return this.identity().translate([t,e,i])}}let Zmt,Ymt;function Qmt(t){if(t>2*Math.PI)throw Error("expected radians")}function Jmt(){var t=new $ft(4);return $ft!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Kmt(t,e,i){i*=.5;var n=Math.sin(i);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(i),t}function $mt(t,e,i){var n=e[0],r=e[1],o=e[2],s=e[3],a=i[0],l=i[1],c=i[2],u=i[3];return t[0]=n*u+s*a+r*c-o*l,t[1]=r*u+s*l+o*a-n*c,t[2]=o*u+s*c+n*l-r*a,t[3]=s*u-n*a-r*l-o*c,t}function tgt(t,e,i,n){var r,o,s,a,l,c=e[0],u=e[1],h=e[2],p=e[3],d=i[0],f=i[1],m=i[2],g=i[3];return(o=c*d+u*f+h*m+p*g)<0&&(o=-o,d=-d,f=-f,m=-m,g=-g),1-o>Kft?(r=Math.acos(o),s=Math.sin(r),a=Math.sin((1-n)*r)/s,l=Math.sin(n*r)/s):(a=1-n,l=n),t[0]=a*c+l*d,t[1]=a*u+l*f,t[2]=a*h+l*m,t[3]=a*p+l*g,t}function egt(t,e){var i,n=e[0]+e[4]+e[8];if(n>0)i=Math.sqrt(n+1),t[3]=.5*i,i=.5/i,t[0]=(e[5]-e[7])*i,t[1]=(e[6]-e[2])*i,t[2]=(e[1]-e[3])*i;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var o=(r+1)%3,s=(r+2)%3;i=Math.sqrt(e[3*r+r]-e[3*o+o]-e[3*s+s]+1),t[r]=.5*i,i=.5/i,t[3]=(e[3*o+s]-e[3*s+o])*i,t[o]=(e[3*o+r]+e[3*r+o])*i,t[s]=(e[3*s+r]+e[3*r+s])*i}return t}var igt,ngt,rgt,ogt=function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t},sgt=Vmt,agt=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},lgt=function(t,e,i,n){var r=e[0],o=e[1],s=e[2],a=e[3];return t[0]=r+n*(i[0]-r),t[1]=o+n*(i[1]-o),t[2]=s+n*(i[2]-s),t[3]=a+n*(i[3]-a),t},cgt=function(t){var e=t[0],i=t[1],n=t[2],r=t[3];return Math.hypot(e,i,n,r)},ugt=function(t){var e=t[0],i=t[1],n=t[2],r=t[3];return e*e+i*i+n*n+r*r},hgt=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=i*i+n*n+r*r+o*o;return s>0&&(s=1/Math.sqrt(s)),t[0]=i*s,t[1]=n*s,t[2]=r*s,t[3]=o*s,t},pgt=(igt=lmt(),ngt=umt(1,0,0),rgt=umt(0,1,0),function(t,e,i){var n=hmt(e,i);return n<-.999999?(pmt(igt,ngt,e),ymt(igt)<1e-6&&pmt(igt,rgt,e),function(t,e){var i=e[0],n=e[1],r=e[2],o=i*i+n*n+r*r;o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o}(igt,igt),Kmt(t,igt,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(pmt(igt,e,i),t[0]=igt[0],t[1]=igt[1],t[2]=igt[2],t[3]=1+n,hgt(t,t))});Jmt(),Jmt(),function(){var t=new $ft(9);$ft!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1}();const dgt=[0,0,0,1];class fgt extends Zft{constructor(t=0,e=0,i=0,n=1){super(-0,-0,-0,-0),Array.isArray(t)&&1===arguments.length?this.copy(t):this.set(t,e,i,n)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,e,i,n){return this[0]=t,this[1]=e,this[2]=i,this[3]=n,this.check()}fromObject(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}fromMatrix3(t){return egt(this,t),this.check()}fromAxisRotation(t,e){return Kmt(this,t,e),this.check()}identity(){return function(t){t[0]=0,t[1]=0,t[2]=0,t[3]=1}(this),this.check()}setAxisAngle(t,e){return this.fromAxisRotation(t,e)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=Yft(t)}get y(){return this[1]}set y(t){this[1]=Yft(t)}get z(){return this[2]}set z(t){this[2]=Yft(t)}get w(){return this[3]}set w(t){this[3]=Yft(t)}len(){return cgt(this)}lengthSquared(){return ugt(this)}dot(t){return agt(this,t)}rotationTo(t,e){return pgt(this,t,e),this.check()}add(t){return ogt(this,this,t),this.check()}calculateW(){return function(t,e){var i=e[0],n=e[1],r=e[2];t[0]=i,t[1]=n,t[2]=r,t[3]=Math.sqrt(Math.abs(1-i*i-n*n-r*r))}(this,this),this.check()}conjugate(){return function(t,e){t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3]}(this,this),this.check()}invert(){return function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=i*i+n*n+r*r+o*o,a=s?1/s:0;t[0]=-i*a,t[1]=-n*a,t[2]=-r*a,t[3]=o*a}(this,this),this.check()}lerp(t,e,i){return void 0===i?this.lerp(this,t,e):(lgt(this,t,e,i),this.check())}multiplyRight(t){return $mt(this,this,t),this.check()}multiplyLeft(t){return $mt(this,t,this),this.check()}normalize(){const t=this.len(),e=t>0?1/t:0;return this[0]=this[0]*e,this[1]=this[1]*e,this[2]=this[2]*e,this[3]=this[3]*e,0===t&&(this[3]=1),this.check()}rotateX(t){return function(t,e,i){i*=.5;var n=e[0],r=e[1],o=e[2],s=e[3],a=Math.sin(i),l=Math.cos(i);t[0]=n*l+s*a,t[1]=r*l+o*a,t[2]=o*l-r*a,t[3]=s*l-n*a}(this,this,t),this.check()}rotateY(t){return function(t,e,i){i*=.5;var n=e[0],r=e[1],o=e[2],s=e[3],a=Math.sin(i),l=Math.cos(i);t[0]=n*l-o*a,t[1]=r*l+s*a,t[2]=o*l+n*a,t[3]=s*l-r*a}(this,this,t),this.check()}rotateZ(t){return function(t,e,i){i*=.5;var n=e[0],r=e[1],o=e[2],s=e[3],a=Math.sin(i),l=Math.cos(i);t[0]=n*l+r*a,t[1]=r*l-n*a,t[2]=o*l+s*a,t[3]=s*l-o*a}(this,this,t),this.check()}scale(t){return sgt(this,this,t),this.check()}slerp(t,e,i){let n,r,o;switch(arguments.length){case 1:({start:n=dgt,target:r,ratio:o}=t);break;case 2:n=this,r=t,o=e;break;default:n=t,r=e,o=i}return tgt(this,n,r,o),this.check()}transformVector4(t,e=new wmt){return function(t,e,i){var n=e[0],r=e[1],o=e[2],s=i[0],a=i[1],l=i[2],c=i[3],u=c*n+a*o-l*r,h=c*r+l*n-s*o,p=c*o+s*r-a*n,d=-s*n-a*r-l*o;t[0]=u*c+d*-s+h*-l-p*-a,t[1]=h*c+d*-a+p*-s-u*-l,t[2]=p*c+d*-l+u*-a-h*-s,t[3]=e[3]}(e,t,this),Qft(e,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,e){return this.setAxisAngle(t,e)}premultiply(t){return this.multiplyLeft(t)}multiply(t){return this.multiplyRight(t)}}var mgt={EPSILON1:.1,EPSILON2:.01,EPSILON3:.001,EPSILON4:1e-4,EPSILON5:1e-5,EPSILON6:1e-6,EPSILON7:1e-7,EPSILON8:1e-8,EPSILON9:1e-9,EPSILON10:1e-10,EPSILON11:1e-11,EPSILON12:1e-12,EPSILON13:1e-13,EPSILON14:1e-14,EPSILON15:1e-15,EPSILON16:1e-16,EPSILON17:1e-17,EPSILON18:1e-18,EPSILON19:1e-19,EPSILON20:1e-20,PI_OVER_TWO:Math.PI/2,PI_OVER_FOUR:Math.PI/4,PI_OVER_SIX:Math.PI/6,TWO_PI:2*Math.PI},ggt="#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\n\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation;\n};\n\nstruct DirectionalLight {\n vec3 color;\n vec3 direction;\n};\n\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\n\nuniform bool lighting_uEnabled;\n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n return pointLight.attenuation.x\n + pointLight.attenuation.y * distance\n + pointLight.attenuation.z * distance * distance;\n}\n\n#endif\n";const ygt={lightSources:{}};function vgt(){let{color:t=[0,0,0],intensity:e=1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.map((t=>t*e/255))}const _gt={name:"lights",vs:ggt,fs:ggt,getUniforms:function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ygt;if("lightSources"in e){const{ambientLight:t,pointLights:i,directionalLights:n}=e.lightSources||{};return t||i&&i.length>0||n&&n.length>0?Object.assign({},function(t){let{ambientLight:e,pointLights:i=[],directionalLights:n=[]}=t;const r={};return r["lighting_uAmbientLight.color"]=e?vgt(e):[0,0,0],i.forEach(((t,e)=>{r["lighting_uPointLight[".concat(e,"].color")]=vgt(t),r["lighting_uPointLight[".concat(e,"].position")]=t.position,r["lighting_uPointLight[".concat(e,"].attenuation")]=t.attenuation||[1,0,0]})),r.lighting_uPointLightCount=i.length,n.forEach(((t,e)=>{r["lighting_uDirectionalLight[".concat(e,"].color")]=vgt(t),r["lighting_uDirectionalLight[".concat(e,"].direction")]=t.direction})),r.lighting_uDirectionalLightCount=n.length,r}({ambientLight:t,pointLights:i,directionalLights:n}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in e){const i={pointLights:[],directionalLights:[]};for(const t of e.lights||[])switch(t.type){case"ambient":i.ambientLight=t;break;case"directional":i.directionalLights.push(t);break;case"point":i.pointLights.push(t)}return t({lightSources:i})}return{}},defines:{MAX_LIGHTS:3}},xgt={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1};const bgt={name:"picking",vs:"uniform bool picking_uActive;\nuniform bool picking_uAttribute;\nuniform vec3 picking_uSelectedColor;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Avalid;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool picking_isColorValid(vec3 color) {\n return dot(color, vec3(1.0)) > 0.001;\n}\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n !picking_isColorValid(abs(vertexColor - picking_uSelectedColor));\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n if (picking_uActive) {\n picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));\n\n if (!picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = pickingColor * COLOR_SCALE;\n }\n } else {\n picking_vRGBcolor_Avalid.a = float(isVertexPicked(pickingColor));\n }\n}\n\nvoid picking_setPickingAttribute(float value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.r = value;\n }\n}\nvoid picking_setPickingAttribute(vec2 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rg = value;\n }\n}\nvoid picking_setPickingAttribute(vec3 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = value;\n }\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Avalid;\nvec4 picking_filterHighlightColor(vec4 color) {\n if (picking_uActive) {\n return color;\n }\n bool selected = bool(picking_vRGBcolor_Avalid.a);\n\n if (selected) {\n float highLightAlpha = picking_uHighlightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, picking_uHighlightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n if (picking_uActive) {\n if (picking_vRGBcolor_Avalid.a == 0.0) {\n discard;\n }\n return picking_vRGBcolor_Avalid;\n }\n return color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:xgt;const e={};if(void 0!==t.pickingSelectedColor)if(t.pickingSelectedColor){const i=t.pickingSelectedColor.slice(0,3);e.picking_uSelectedColorValid=1,e.picking_uSelectedColor=i}else e.picking_uSelectedColorValid=0;if(t.pickingHighlightColor){const i=Array.from(t.pickingHighlightColor,(t=>t/255));Number.isFinite(i[3])||(i[3]=1),e.picking_uHighlightColor=i}return void 0!==t.pickingActive&&(e.picking_uActive=Boolean(t.pickingActive),e.picking_uAttribute=Boolean(t.pickingAttribute)),e}};var wgt="\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3 lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n vec3 halfway_direction = normalize(light_direction + view_direction);\n float lambertian = dot(light_direction, normal_worldspace);\n float specular = 0.0;\n if (lambertian > 0.0) {\n float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n specular = pow(specular_angle, lighting_uShininess);\n }\n lambertian = max(lambertian, 0.0);\n return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = surfaceColor;\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n vec3 lightColor = vec3(0, 0, 0);\n vec3 surfaceColor = vec3(0, 0, 0);\n\n if (lighting_uEnabled) {\n vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uPointLightCount) {\n break;\n }\n PointLight pointLight = lighting_uPointLight[i];\n vec3 light_position_worldspace = pointLight.position;\n vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n }\n\n for (int i = 0; i < MAX_LIGHTS; i++) {\n if (i >= lighting_uDirectionalLightCount) {\n break;\n }\n DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n }\n }\n return lightColor;\n}\n";const Agt={};function Egt(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Agt;if(!("material"in t))return{};const{material:e}=t;return e?function(t){const{ambient:e=.35,diffuse:i=.6,shininess:n=32,specularColor:r=[30,30,30]}=t;return{lighting_uAmbient:e,lighting_uDiffuse:i,lighting_uShininess:n,lighting_uSpecularColor:r.map((t=>t/255))}}(e):{lighting_uEnabled:!1}}const Sgt={name:"gouraud-lighting",dependencies:[_gt],vs:wgt,defines:{LIGHTING_VERTEX:1},getUniforms:Egt},Mgt={name:"phong-lighting",dependencies:[_gt],fs:wgt,defines:{LIGHTING_FRAGMENT:1},getUniforms:Egt};const Tgt={name:"pbr",vs:"uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n\nvarying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if defined(USE_TEX_LOD) && !defined(FEATURE_GLSL_TEXTURE_LOD)\n# error PBR fragment shader: Texture LOD is not available\n#endif\n\n#if !defined(HAS_TANGENTS) && !defined(FEATURE_GLSL_DERIVATIVES)\n# error PBR fragment shader: Derivatives are not available\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\nuniform bool pbr_uUnlit;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLod(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 color = vec3(0, 0, 0);\n\n if(pbr_uUnlit){\n color.rgb = baseColor.rgb;\n }\n else{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n }\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[_gt]},Igt={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n float xIndex = transform_elementID - (yIndex * texSize[0]);\n return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n vec2 coord = indices / size + pixelSizeHalf;\n return coord;\n}\nvec2 transform_getPos(vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n vec2 texCoord = transform_getTexCoord(size);\n vec4 textureColor = texture2D(texSampler, texCoord);\n return textureColor;\n}\n",fs:null};class Cgt{static getDefaultProgramManager(t){return t.luma=t.luma||{},t.luma.defaultProgramManager=t.luma.defaultProgramManager||new Cgt(t),t.luma.defaultProgramManager}constructor(t){this.gl=t,this._programCache={},this._getUniforms={},this._registeredModules={},this._hookFunctions=[],this._defaultModules=[],this._hashes={},this._hashCounter=0,this.stateHash=0,this._useCounts={}}addDefaultModule(t){this._defaultModules.find((e=>e.name===t.name))||this._defaultModules.push(t),this.stateHash++}removeDefaultModule(t){const e="string"==typeof t?t:t.name;this._defaultModules=this._defaultModules.filter((t=>t.name!==e)),this.stateHash++}addShaderHook(t,e){e&&(t=Object.assign(e,{hook:t})),this._hookFunctions.push(t),this.stateHash++}get(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{vs:e="",fs:i="",defines:n={},inject:r={},varyings:o=[],bufferMode:s=35981,transpileToGLSL100:a=!1}=t,l=this._getModuleList(t.modules),c=this._getHash(e),u=this._getHash(i),h=l.map((t=>this._getHash(t.name))).sort(),p=o.map((t=>this._getHash(t))),d=Object.keys(n).sort(),f=Object.keys(r).sort(),m=[],g=[];for(const t of d)m.push(this._getHash(t)),m.push(this._getHash(n[t]));for(const t of f)g.push(this._getHash(t)),g.push(this._getHash(r[t]));const y="".concat(c,"/").concat(u,"D").concat(m.join("/"),"M").concat(h.join("/"),"I").concat(g.join("/"),"V").concat(p.join("/"),"H").concat(this.stateHash,"B").concat(s).concat(a?"T":"");if(!this._programCache[y]){const t=function(t,e){const{vs:i,fs:n}=e,r=jdt(e.modules||[]);return{gl:t,vs:Sft(t,Object.assign({},e,{source:i,type:Ndt,modules:r})),fs:Sft(t,Object.assign({},e,{source:n,type:Bdt,modules:r})),getUniforms:Mft(r)}}(this.gl,{vs:e,fs:i,modules:l,inject:r,defines:n,hookFunctions:this._hookFunctions,transpileToGLSL100:a});this._programCache[y]=new vdt(this.gl,{hash:y,vs:t.vs,fs:t.fs,varyings:o,bufferMode:s}),this._getUniforms[y]=t.getUniforms||(t=>{}),this._useCounts[y]=0}return this._useCounts[y]++,this._programCache[y]}getUniforms(t){return this._getUniforms[t.hash]||null}release(t){const e=t.hash;this._useCounts[e]--,0===this._useCounts[e]&&(this._programCache[e].delete(),delete this._programCache[e],delete this._getUniforms[e],delete this._useCounts[e])}_getHash(t){return void 0===this._hashes[t]&&(this._hashes[t]=this._hashCounter++),this._hashes[t]}_getModuleList(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const e=new Array(this._defaultModules.length+t.length),i={};let n=0;for(let t=0,r=this._defaultModules.length;t<r;++t){const r=this._defaultModules[t],o=r.name;e[n++]=r,i[o]=!0}for(let r=0,o=t.length;r<o;++r){const o=t[r],s=o.name;i[s]||(e[n++]=o,i[s]=!0)}return e.length=n,e}}const Pgt={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function Lgt(t,e){const{attributeMap:i=Pgt}=e||{};return i&&i[t]||t}function Dgt(t,e){let i;switch(t){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":i="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":i="vectors"}switch(i){case"vectors":e.size=e.size||3;break;case"uvs":e.size=e.size||2}Mht(Number.isFinite(e.size),"attribute ".concat(t," needs size"))}const Rgt=()=>{},Ogt={};class kgt{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{id:i=Pht("model")}=e;Mht(Tut(t)),this.id=i,this.gl=t,this.id=e.id||Pht("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(e)}initialize(t){this.props={},this.programManager=t.programManager||Cgt.getDefaultProgramManager(this.gl),this._programManagerState=-1,this._managedProgram=!1;const{program:e=null,vs:i,fs:n,modules:r,defines:o,inject:s,varyings:a,bufferMode:l,transpileToGLSL100:c}=t;this.programProps={program:e,vs:i,fs:n,modules:r,defines:o,inject:s,varyings:a,bufferMode:l,transpileToGLSL100:c},this.program=null,this.vertexArray=null,this._programDirty=!0,this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.uniforms={},this.pickable=!0,this._checkProgram(),this.setUniforms(Object.assign({},this.getModuleUniforms(t.moduleSettings))),this.drawMode=void 0!==t.drawMode?t.drawMode:4,this.vertexCount=t.vertexCount||0,this.geometryBuffers={},this.isInstanced=t.isInstanced||t.instanced||t.instanceCount>0,this._setModelProps(t),this.geometry={},Mht(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}setProps(t){this._setModelProps(t)}delete(){for(const t in this._attributes)this._attributes[t]!==this.attributes[t]&&this._attributes[t].delete();this._managedProgram&&(this.programManager.release(this.program),this._managedProgram=!1),this.vertexArray.delete(),this._deleteGeometryBuffers()}getDrawMode(){return this.drawMode}getVertexCount(){return this.vertexCount}getInstanceCount(){return this.instanceCount}getAttributes(){return this.attributes}getProgram(){return this.program}setProgram(t){const{program:e,vs:i,fs:n,modules:r,defines:o,inject:s,varyings:a,bufferMode:l,transpileToGLSL100:c}=t;this.programProps={program:e,vs:i,fs:n,modules:r,defines:o,inject:s,varyings:a,bufferMode:l,transpileToGLSL100:c},this._programDirty=!0}getUniforms(){return this.uniforms}setDrawMode(t){return this.drawMode=t,this}setVertexCount(t){return Mht(Number.isFinite(t)),this.vertexCount=t,this}setInstanceCount(t){return Mht(Number.isFinite(t)),this.instanceCount=t,this}setGeometry(t){return this.drawMode=t.drawMode,this.vertexCount=t.getVertexCount(),this._deleteGeometryBuffers(),this.geometryBuffers=function(t,e,i){const n={};let r=e.indices;for(const o in e.attributes){const s=e.attributes[o],a=Lgt(o,i);if("indices"===o)r=s;else if(s.constant)n[a]=s.value;else{const e=s.value,i={...s};delete i.value,n[a]=[new Xht(t,e),i],Dgt(o,i)}}if(r){const e=r.value||r;Mht(e instanceof Uint16Array||e instanceof Uint32Array,'attribute array for "indices" must be of integer type');const i={size:1,isIndexed:void 0===r.isIndexed||r.isIndexed};n.indices=[new Xht(t,{data:e,target:34963}),i]}return n}(this.gl,t),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Dht(t))return this;const e={};for(const i in t){const n=t[i];e[i]=n.getValue?n.getValue():n}return this.vertexArray.setAttributes(e),this}setUniforms(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(this.uniforms,t),this}getModuleUniforms(t){this._checkProgram();const e=this.programManager.getUniforms(this.program);return e?e(t):{}}updateModuleSettings(t){const e=this.getModuleUniforms(t||{});return this.setUniforms(e)}clear(t){return cpt(this.program.gl,t),this}draw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._checkProgram();const{moduleSettings:e=null,framebuffer:i,uniforms:n={},attributes:r={},transformFeedback:o=this.transformFeedback,parameters:s={},vertexArray:a=this.vertexArray}=t;let l;this.setAttributes(r),this.updateModuleSettings(e),this.setUniforms(n),Eut.priority>=2&&(l=this._logDrawCallStart(2));const c=this.vertexArray.getDrawParams(),{isIndexed:u=c.isIndexed,indexType:h=c.indexType,indexOffset:p=c.indexOffset,vertexArrayInstanced:d=c.isInstanced}=this.props;d&&!this.isInstanced&&Eut.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:f,instanceCount:m}=this,{onBeforeRender:g=Rgt,onAfterRender:y=Rgt}=this.props;g(),this.program.setUniforms(this.uniforms);const v=this.program.draw(Object.assign(Ogt,t,{logPriority:l,uniforms:null,framebuffer:i,parameters:s,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:a,transformFeedback:o,isIndexed:u,indexType:h,isInstanced:f,instanceCount:m,offset:u?p:0}));return y(),Eut.priority>=2&&this._logDrawCallEnd(l,a,i),v}transform(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{discard:e=!0,feedbackBuffers:i,unbindModels:n=[]}=t;let{parameters:r}=t;i&&this._setFeedbackBuffers(i),e&&(r=Object.assign({},r,{35977:e})),n.forEach((t=>t.vertexArray.unbindBuffers()));try{this.draw(Object.assign({},t,{parameters:r}))}finally{n.forEach((t=>t.vertexArray.bindBuffers()))}return this}render(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Eut.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(t).draw()}_setModelProps(t){Object.assign(this.props,t),"uniforms"in t&&this.setUniforms(t.uniforms),"pickable"in t&&(this.pickable=t.pickable),"instanceCount"in t&&(this.instanceCount=t.instanceCount),"geometry"in t&&this.setGeometry(t.geometry),"attributes"in t&&this.setAttributes(t.attributes),"_feedbackBuffers"in t&&this._setFeedbackBuffers(t._feedbackBuffers)}_checkProgram(){if(!(this._programDirty||this.programManager.stateHash!==this._programManagerState))return;let{program:t}=this.programProps;if(t)this._managedProgram=!1;else{const{vs:e,fs:i,modules:n,inject:r,defines:o,varyings:s,bufferMode:a,transpileToGLSL100:l}=this.programProps;t=this.programManager.get({vs:e,fs:i,modules:n,inject:r,defines:o,varyings:s,bufferMode:a,transpileToGLSL100:l}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}Mht(t instanceof vdt,"Model needs a program"),this._programDirty=!1,t!==this.program&&(this.program=t,this.vertexArray?this.vertexArray.setProps({program:this.program,attributes:this.vertexArray.attributes}):this.vertexArray=new Mdt(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}_deleteGeometryBuffers(){for(const t in this.geometryBuffers){const e=this.geometryBuffers[t][0]||this.geometryBuffers[t];e instanceof Xht&&e.delete()}}_setAnimationProps(t){this.animated&&Mht(t,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Dht(t))return this;const{gl:e}=this.program;return this.transformFeedback=this.transformFeedback||new xdt(e,{program:this.program}),this.transformFeedback.setBuffers(t),this}_logDrawCallStart(t){const e=t>3?0:1e4;if(!(Date.now()-this.lastLogTime<e))return this.lastLogTime=Date.now(),Eut.group(2,">>> DRAWING MODEL ".concat(this.id),{collapsed:Eut.level<=2})(),t}_logDrawCallEnd(t,e,i,n){if(void 0===t)return;const r=function(t){let{vertexArray:e,header:i="Attributes"}=t;if(!e.configuration)return{};const n={};e.elements&&(n.ELEMENT_ARRAY_BUFFER=Pdt(e,e.elements,null,i));const r=e.values;for(const t in r){const o=e._getAttributeInfo(t);if(o){let s="".concat(t,": ").concat(o.name);const a=e.accessors[o.location];a&&(s="".concat(t,": ").concat(Ldt(o.name,a))),n[s]=Pdt(e,r[t],a,i)}}return n}({vertexArray:e,header:"".concat(this.id," attributes"),attributes:this._attributes}),{table:o,unusedTable:s,unusedCount:a}=Idt({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,i)}),{table:l,count:c}=Idt({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,i),undefinedOnly:!0});c>0&&Eut.log("MISSING UNIFORMS",Object.keys(l))(),a>0&&Eut.log("UNUSED UNIFORMS",Object.keys(s))();const u=function(t){const e={},i="Accessors for ".concat(t.id);for(const n of t.attributeInfos)if(n){const t=Ddt(n);e["in ".concat(t)]={[i]:JSON.stringify(n.accessor)}}for(const n of t.varyingInfos)if(n){const t=Ddt(n);e["out ".concat(t)]={[i]:JSON.stringify(n.accessor)}}return e}(this.vertexArray.configuration);Eut.table(t,r)(),Eut.table(t,o)(),Eut.table(t+1,u)(),n&&n.log({logLevel:2,message:"Rendered to ".concat(n.id)}),Eut.groupEnd(2)()}}class Ngt{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.gl=t,this.currentIndex=0,this.feedbackMap={},this.varyings=null,this.bindings=[],this.resources={},this._initialize(e),Object.seal(this)}setupResources(t){for(const e of this.bindings)this._setupTransformFeedback(e,t)}updateModelProps(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{varyings:e}=this;return e.length>0&&(t=Object.assign({},t,{varyings:e})),t}getDrawOptions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this.bindings[this.currentIndex],{sourceBuffers:i,transformFeedback:n}=e;return{attributes:Object.assign({},i,t.attributes),transformFeedback:n}}swap(){return!!this.feedbackMap&&(this.currentIndex=this._getNextIndex(),!0)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setupBuffers(t)}getBuffer(t){const{feedbackBuffers:e}=this.bindings[this.currentIndex],i=t?e[t]:null;return i?i instanceof Xht?i:i.buffer:null}getData(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{varyingName:e}=t,i=this.getBuffer(e);return i?i.getData():null}delete(){for(const t in this.resources)this.resources[t].delete()}_initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setupBuffers(t),this.varyings=t.varyings||Object.keys(this.bindings[this.currentIndex].feedbackBuffers),this.varyings.length>0&&Mht(Iut(this.gl))}_getFeedbackBuffers(t){const{sourceBuffers:e={}}=t,i={};if(this.bindings[this.currentIndex]&&Object.assign(i,this.bindings[this.currentIndex].feedbackBuffers),this.feedbackMap)for(const t in this.feedbackMap){const n=this.feedbackMap[t];t in e&&(i[n]=t)}Object.assign(i,t.feedbackBuffers);for(const t in i){const n=i[t];if("string"==typeof n){const r=e[n],{byteLength:o,usage:s,accessor:a}=r;i[t]=this._createNewBuffer(t,{byteLength:o,usage:s,accessor:a})}}return i}_setupBuffers(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{sourceBuffers:e=null}=t;Object.assign(this.feedbackMap,t.feedbackMap);const i=this._getFeedbackBuffers(t);this._updateBindings({sourceBuffers:e,feedbackBuffers:i})}_setupTransformFeedback(t,e){let{model:i}=e;const{program:n}=i;t.transformFeedback=new xdt(this.gl,{program:n,buffers:t.feedbackBuffers})}_updateBindings(t){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],t),this.feedbackMap){const{sourceBuffers:t,feedbackBuffers:e}=this._swapBuffers(this.bindings[this.currentIndex]),i=this._getNextIndex();this.bindings[i]=this._updateBinding(this.bindings[i],{sourceBuffers:t,feedbackBuffers:e})}}_updateBinding(t,e){return t?(Object.assign(t.sourceBuffers,e.sourceBuffers),Object.assign(t.feedbackBuffers,e.feedbackBuffers),t.transformFeedback&&t.transformFeedback.setBuffers(t.feedbackBuffers),t):{sourceBuffers:Object.assign({},e.sourceBuffers),feedbackBuffers:Object.assign({},e.feedbackBuffers)}}_swapBuffers(t){if(!this.feedbackMap)return null;const e=Object.assign({},t.sourceBuffers),i=Object.assign({},t.feedbackBuffers);for(const n in this.feedbackMap){const r=this.feedbackMap[n];e[n]=t.feedbackBuffers[r],i[r]=t.sourceBuffers[n],Mht(i[r]instanceof Xht)}return{sourceBuffers:e,feedbackBuffers:i}}_createNewBuffer(t,e){const i=new Xht(this.gl,e);return this.resources[t]&&this.resources[t].delete(),this.resources[t]=i,i}_getNextIndex(){return(this.currentIndex+1)%2}}const Bgt="transform_uSampler_",zgt="transform_uSize_",Fgt="transform_position";function Vgt(t){let{vs:e,sourceTextureMap:i,targetTextureVarying:n,targetTexture:r}=t;let o=Object.keys(i).length,s=null;const a={};let l=e,c={};if(o>0||n){const t=l.split("\n"),e=t.slice();if(t.forEach(((t,r,l)=>{if(o>0){const n=function(t,e){const i={},n=function(t){return Cft(t,["attribute","in"])}(t);if(!n)return null;const{type:r,name:o}=n;if(o&&e[o]){const e="// ".concat(t," => Replaced by Transform with a sampler"),{samplerName:n,sizeName:s,uniformDeclerations:a}=function(t){const e="".concat(Bgt).concat(t),i="".concat(zgt).concat(t),n=" uniform sampler2D ".concat(e,";\n uniform vec2 ").concat(i,";");return{samplerName:e,sizeName:i,uniformDeclerations:n}}(o),l=function(t){switch(t){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return zdt(!1),null}}(r),c=" ".concat(r," ").concat(o," = transform_getInput(").concat(n,", ").concat(s,").").concat(l,";\n");i[n]=o;return{updatedLine:e,inject:{"vs:#decl":a,"vs:#main-start":c},samplerTextureMap:i}}return null}(t,i);if(n){const{updatedLine:t,inject:i}=n;e[r]=t,c=cft([c,i]),Object.assign(a,n.samplerTextureMap),o--}}n&&!s&&(s=function(t,e){const i=Cft(t,["varying","out"]);if(!i)return null;return i.name===e?i.type:null}(t,n))})),n){Mht(r);const t="".concat(zgt).concat(n),e="uniform vec2 ".concat(t,";\n"),i=" vec2 ".concat(Fgt," = transform_getPos(").concat(t,");\n gl_Position = vec4(").concat(Fgt,", 0, 1.);\n");c=cft([c,{"vs:#decl":e,"vs:#main-start":i}])}l=e.join("\n")}return{vs:l,targetTextureType:s,inject:c,samplerTextureMap:a}}const Ugt={10241:9728,10240:9728,10242:33071,10243:33071};class Ggt{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.gl=t,this.id=this.currentIndex=0,this._swapTexture=null,this.targetTextureVarying=null,this.targetTextureType=null,this.samplerTextureMap=null,this.bindings=[],this.resources={},this._initialize(e),Object.seal(this)}updateModelProps(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this._processVertexShader(t);return Object.assign({},t,e)}getDrawOptions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{sourceBuffers:e,sourceTextures:i,framebuffer:n,targetTexture:r}=this.bindings[this.currentIndex],o=Object.assign({},e,t.attributes),s=Object.assign({},t.uniforms),a=Object.assign({},t.parameters);let l=t.discard;if(this.hasSourceTextures||this.hasTargetTexture){o.transform_elementID=this.elementIDBuffer;for(const t in this.samplerTextureMap){const e=this.samplerTextureMap[t];s[t]=i[e]}this._setSourceTextureParameters();const t=function(t){let{sourceTextureMap:e,targetTextureVarying:i,targetTexture:n}=t;const r={};let o,s;i&&(({width:o,height:s}=n),r["".concat(zgt).concat(i)]=[o,s]);for(const t in e)({width:o,height:s}=e[t]),r["".concat(zgt).concat(t)]=[o,s];return r}({sourceTextureMap:i,targetTextureVarying:this.targetTextureVarying,targetTexture:r});Object.assign(s,t)}return this.hasTargetTexture&&(l=!1,a.viewport=[0,0,n.width,n.height]),{attributes:o,framebuffer:n,uniforms:s,discard:l,parameters:a}}swap(){return!!this._swapTexture&&(this.currentIndex=this._getNextIndex(),!0)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setupTextures(t)}getTargetTexture(){const{targetTexture:t}=this.bindings[this.currentIndex];return t}getData(){let{packed:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{framebuffer:e}=this.bindings[this.currentIndex],i=hpt(e);if(!t)return i;const n=i.constructor,r=function(t){switch(t){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return zdt(!1),null}}(this.targetTextureType),o=new n(i.length*r/4);let s=0;for(let t=0;t<i.length;t+=4)for(let e=0;e<r;e++)o[s++]=i[t+e];return o}getFramebuffer(){return this.bindings[this.currentIndex].framebuffer}delete(){this.ownTexture&&this.ownTexture.delete(),this.elementIDBuffer&&this.elementIDBuffer.delete()}_initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{_targetTextureVarying:e,_swapTexture:i}=t;this._swapTexture=i,this.targetTextureVarying=e,this.hasTargetTexture=e,this._setupTextures(t)}_createTargetTexture(t){const{sourceTextures:e,textureOrReference:i}=t;if(i instanceof tpt)return i;const n=e[i];return n?(this._targetRefTexName=i,this._createNewTexture(n)):null}_setupTextures(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{sourceBuffers:e,_sourceTextures:i={},_targetTexture:n}=t,r=this._createTargetTexture({sourceTextures:i,textureOrReference:n});this.hasSourceTextures=this.hasSourceTextures||i&&Object.keys(i).length>0,this._updateBindings({sourceBuffers:e,sourceTextures:i,targetTexture:r}),"elementCount"in t&&this._updateElementIDBuffer(t.elementCount)}_updateElementIDBuffer(t){if("number"!=typeof t||this.elementCount>=t)return;const e=new Float32Array(t);e.forEach(((t,e,i)=>{i[e]=e})),this.elementIDBuffer?this.elementIDBuffer.setData({data:e}):this.elementIDBuffer=new Xht(this.gl,{data:e,accessor:{size:1}}),this.elementCount=t}_updateBindings(t){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],t),this._swapTexture){const{sourceTextures:t,targetTexture:e}=this._swapTextures(this.bindings[this.currentIndex]),i=this._getNextIndex();this.bindings[i]=this._updateBinding(this.bindings[i],{sourceTextures:t,targetTexture:e})}}_updateBinding(t,e){const{sourceBuffers:i,sourceTextures:n,targetTexture:r}=e;if(t||(t={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(t.sourceTextures,n),Object.assign(t.sourceBuffers,i),r){t.targetTexture=r;const{width:e,height:i}=r,{framebuffer:n}=t;n?(n.update({attachments:{36064:r},resizeAttachments:!1}),n.resize({width:e,height:i})):t.framebuffer=new Ppt(this.gl,{id:"transform-framebuffer",width:e,height:i,attachments:{36064:r}})}return t}_setSourceTextureParameters(){const t=this.currentIndex,{sourceTextures:e}=this.bindings[t];for(const t in e)e[t].setParameters(Ugt)}_swapTextures(t){if(!this._swapTexture)return null;const e=Object.assign({},t.sourceTextures);e[this._swapTexture]=t.targetTexture;return{sourceTextures:e,targetTexture:t.sourceTextures[this._swapTexture]}}_createNewTexture(t){const e=function(t,e){Mht(t instanceof tpt||t instanceof ipt||t instanceof npt);const i=t.constructor,{gl:n,width:r,height:o,format:s,type:a,dataFormat:l,border:c,mipmaps:u}=t;return new i(n,Object.assign({width:r,height:o,format:s,type:a,dataFormat:l,border:c,mipmaps:u},e))}(t,{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}});return this.ownTexture&&this.ownTexture.delete(),this.ownTexture=e,e}_getNextIndex(){return(this.currentIndex+1)%2}_processVertexShader(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{sourceTextures:e,targetTexture:i}=this.bindings[this.currentIndex],{vs:n,uniforms:r,targetTextureType:o,inject:s,samplerTextureMap:a}=Vgt({vs:t.vs,sourceTextureMap:e,targetTextureVarying:this.targetTextureVarying,targetTexture:i}),l=cft([t.inject||{},s]);this.targetTextureType=o,this.samplerTextureMap=a;return{vs:n,fs:t._fs||Pft({version:zpt(n),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[Igt].concat(t.modules||[]):t.modules,uniforms:r,inject:l}}}class jgt{static isSupported(t){return Iut(t)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.gl=t,this.model=null,this.elementCount=0,this.bufferTransform=null,this.textureTransform=null,this.elementIDBuffer=null,this._initialize(e),Object.seal(this)}delete(){const{model:t,bufferTransform:e,textureTransform:i}=this;t&&t.delete(),e&&e.delete(),i&&i.delete()}run(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clearRenderTarget:e=!0}=t,i=this._updateDrawOptions(t);e&&i.framebuffer&&i.framebuffer.clear({color:!0}),this.model.transform(i)}swap(){let t=!1;const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of e)t=t||i.swap();Mht(t,"Nothing to swap")}getBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this.bufferTransform&&this.bufferTransform.getBuffer(t)}getData(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of e){const e=i.getData(t);if(e)return e}return null}getFramebuffer(){return this.textureTransform&&this.textureTransform.getFramebuffer()}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"elementCount"in t&&this.model.setVertexCount(t.elementCount);const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of e)i.update(t)}_initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{gl:e}=this;this._buildResourceTransforms(e,t),t=this._updateModelProps(t),this.model=new kgt(e,Object.assign({},t,{fs:t.fs||Pft({version:zpt(t.vs)}),id:t.id||"transform-model",drawMode:t.drawMode||0,vertexCount:t.elementCount})),this.bufferTransform&&this.bufferTransform.setupResources({model:this.model})}_updateModelProps(t){let e=Object.assign({},t);const i=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const t of i)e=t.updateModelProps(e);return e}_buildResourceTransforms(t,e){(function(t){if(!Dht(t.feedbackBuffers)||!Dht(t.feedbackMap)||t.varyings&&t.varyings.length>0)return!0;return!1})(e)&&(this.bufferTransform=new Ngt(t,e)),function(t){if(!Dht(t._sourceTextures)||t._targetTexture||t._targetTextureVarying)return!0;return!1}(e)&&(this.textureTransform=new Ggt(t,e)),Mht(this.bufferTransform||this.textureTransform,"must provide source/feedback buffers or source/target textures")}_updateDrawOptions(t){let e=Object.assign({},t);const i=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const t of i)e=Object.assign(e,t.getDrawOptions(e));return e}}const Hgt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class Wgt{static get DRAW_MODE(){return Hgt}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{id:e=Pht("geometry"),drawMode:i=Hgt.TRIANGLES,attributes:n={},indices:r=null,vertexCount:o=null}=t;this.id=e,this.drawMode=0|i,this.attributes={},this.userData={},this._setAttributes(n,r),this.vertexCount=o||this._calculateVertexCount(this.attributes,this.indices)}get mode(){return this.drawMode}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?{indices:this.indices,...this.attributes}:this.attributes}_print(t){return"Geometry ".concat(this.id," attribute ").concat(t)}_setAttributes(t,e){e&&(this.indices=ArrayBuffer.isView(e)?{value:e,size:1}:e);for(const e in t){let i=t[e];i=ArrayBuffer.isView(i)?{value:i}:i,Mht(ArrayBuffer.isView(i.value),"".concat(this._print(e),": must be typed array or object with value as typed array")),"POSITION"!==e&&"positions"!==e||i.size||(i.size=3),"indices"===e?(Mht(!this.indices),this.indices=i):this.attributes[e]=i}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}_calculateVertexCount(t,e){if(e)return e.value.length;let i=1/0;for(const e in t){const n=t[e],{value:r,size:o,constant:s}=n;!s&&r&&o>=1&&(i=Math.min(i,r.length/o))}return Mht(Number.isFinite(i)),i}}const qgt=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),Xgt=new Float32Array([-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,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,-1,1,-1,1,1,-1,1,-1]),Zgt=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),Ygt=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),Qgt={POSITION:{size:3,value:new Float32Array(Xgt)},NORMAL:{size:3,value:new Float32Array(Zgt)},TEXCOORD_0:{size:2,value:new Float32Array(Ygt)}};class Jgt extends Wgt{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{id:e=Pht("cube-geometry")}=t;super({...t,id:e,indices:{size:1,value:new Uint16Array(qgt)},attributes:{...Qgt,...t.attributes}})}}let Kgt=1,$gt=1;class tyt{constructor(){this.time=0,this.channels=new Map,this.animations=new Map,this.playing=!1,this.lastEngineTime=-1}addChannel(t){const{delay:e=0,duration:i=Number.POSITIVE_INFINITY,rate:n=1,repeat:r=1}=t,o=Kgt++,s={time:0,delay:e,duration:i,rate:n,repeat:r};return this._setChannelTime(s,this.time),this.channels.set(o,s),o}removeChannel(t){this.channels.delete(t);for(const[e,i]of this.animations)i.channel===t&&this.detachAnimation(e)}isFinished(t){const e=this.channels.get(t);return void 0!==e&&this.time>=e.delay+e.duration*e.repeat}getTime(t){if(void 0===t)return this.time;const e=this.channels.get(t);return void 0===e?-1:e.time}setTime(t){this.time=Math.max(0,t);const e=this.channels.values();for(const t of e)this._setChannelTime(t,this.time);const i=this.animations.values();for(const t of i){const{animation:e,channel:i}=t;e.setTime(this.getTime(i))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(t,e){const i=$gt++;return this.animations.set(i,{animation:t,channel:e}),t.setTime(this.getTime(e)),i}detachAnimation(t){this.animations.delete(t)}update(t){this.playing&&(-1===this.lastEngineTime&&(this.lastEngineTime=t),this.setTime(this.time+(t-this.lastEngineTime)),this.lastEngineTime=t)}_setChannelTime(t,e){const i=e-t.delay;i>=t.duration*t.repeat?t.time=t.duration*t.rate:(t.time=Math.max(0,i)%t.duration,t.time*=t.rate)}}const eyt=[255,255,255],iyt=1;let nyt=0;class ryt{constructor(t={}){cat(this,"id",void 0),cat(this,"color",void 0),cat(this,"intensity",void 0),cat(this,"type","ambient");const{color:e=eyt}=t,{intensity:i=iyt}=t;this.id=t.id||"ambient-".concat(nyt++),this.color=e,this.intensity=i}}const oyt=[255,255,255],syt=1,ayt=[0,0,-1];let lyt=0;class cyt{constructor(t={}){cat(this,"id",void 0),cat(this,"color",void 0),cat(this,"intensity",void 0),cat(this,"type","directional"),cat(this,"direction",void 0),cat(this,"shadow",void 0);const{color:e=oyt}=t,{intensity:i=syt}=t,{direction:n=ayt}=t,{_shadow:r=!1}=t;this.id=t.id||"directional-".concat(lyt++),this.color=e,this.intensity=i,this.type="directional",this.direction=new bmt(n).normalize().toArray(),this.shadow=r}getProjectedLight(t){return this}}class uyt{constructor(t,e={id:"pass"}){cat(this,"id",void 0),cat(this,"gl",void 0),cat(this,"props",void 0);const{id:i}=e;this.id=i,this.gl=t,this.props={...e}}setProps(t){Object.assign(this.props,t)}render(t){}cleanup(){}}class hyt extends uyt{constructor(...t){super(...t),cat(this,"_lastRenderIndex",-1)}render(t){return lht(this.gl,{framebuffer:t.target}),this._drawLayers(t)}_drawLayers(t){const{target:e,moduleParameters:i,viewports:n,views:r,onViewportActive:o,clearStack:s=!0,clearCanvas:a=!0}=t;t.pass=t.pass||"unknown";const l=this.gl;a&&function(t,e){const i=e?e.width:t.drawingBufferWidth,n=e?e.height:t.drawingBufferHeight;lht(t,{viewport:[0,0,i,n]}),t.clear(16640)}(l,e),s&&(this._lastRenderIndex=-1);const c=[];for(const s of n){const n=r&&r[s.id];null==o||o(s);const a=this._getDrawLayerParams(s,t),u=s.subViewports||[s];for(const r of u){const o=this._drawLayersInViewport(l,{target:e,moduleParameters:i,viewport:r,view:n,pass:t.pass,layers:t.layers},a);c.push(o)}}return c}_getDrawLayerParams(t,{layers:e,pass:i,isPicking:n=!1,layerFilter:r,cullRect:o,effects:s,moduleParameters:a},l=!1){const c=[],u=pyt(this._lastRenderIndex+1),h={layer:e[0],viewport:t,isPicking:n,renderPass:i,cullRect:o},p={};for(let n=0;n<e.length;n++){const o=e[n],d=this._shouldDrawLayer(o,h,r,p),f={shouldDrawLayer:d};d&&!l&&(f.layerRenderIndex=u(o,d),f.moduleParameters=this._getModuleParameters(o,s,i,a),f.layerParameters=this.getLayerParameters(o,n,t)),c[n]=f}return c}_drawLayersInViewport(t,{layers:e,moduleParameters:i,pass:n,target:r,viewport:o,view:s},a){const l=function(t,{moduleParameters:e,target:i,viewport:n}){const r=i&&"default-framebuffer"!==i.id,o=e&&e.devicePixelRatio||hht(t),s=r?i.height:t.drawingBufferHeight,a=n;return[a.x*o,s-(a.y+a.height)*o,a.width*o,a.height*o]}(t,{moduleParameters:i,target:r,viewport:o});if(s&&s.props.clear){const e=!0===s.props.clear?{color:!0,depth:!0}:s.props.clear;uht(t,{scissorTest:!0,scissor:l},(()=>cpt(t,e)))}const c={totalCount:e.length,visibleCount:0,compositeCount:0,pickableCount:0};lht(t,{viewport:l});for(let t=0;t<e.length;t++){const i=e[t],{shouldDrawLayer:r,layerRenderIndex:s,moduleParameters:l,layerParameters:u}=a[t];if(r&&i.props.pickable&&c.pickableCount++,i.isComposite)c.compositeCount++;else if(r){c.visibleCount++,this._lastRenderIndex=Math.max(this._lastRenderIndex,s),l.viewport=o;try{i._drawLayer({moduleParameters:l,uniforms:{layerIndex:s},parameters:u})}catch(t){i.raiseError(t,"drawing ".concat(i," to ").concat(n))}}}return c}shouldDrawLayer(t){return!0}getModuleParameters(t,e){return null}getLayerParameters(t,e,i){return t.props.parameters}_shouldDrawLayer(t,e,i,n){if(!(t.props.visible&&this.shouldDrawLayer(t)))return!1;e.layer=t;let r=t.parent;for(;r;){if(!r.props.visible||!r.filterSubLayer(e))return!1;e.layer=r,r=r.parent}if(i){const t=e.layer.id;if(t in n||(n[t]=i(e)),!n[t])return!1}return t.activateViewport(e.viewport),!0}_getModuleParameters(t,e,i,n){var r;const o=Object.assign(Object.create((null===(r=t.internalState)||void 0===r?void 0:r.propsInTransition)||t.props),{autoWrapLongitude:t.wrapLongitude,viewport:t.context.viewport,mousePosition:t.context.mousePosition,pickingActive:0,devicePixelRatio:hht(this.gl)});if(e)for(const i of e){var s;Object.assign(o,null===(s=i.getModuleParameters)||void 0===s?void 0:s.call(i,t))}return Object.assign(o,this.getModuleParameters(t,e),n)}}function pyt(t=0,e={}){const i={},n=(r,o)=>{const s=r.props._offset,a=r.id,l=r.parent&&r.parent.id;let c;if(l&&!(l in e)&&n(r.parent,!1),l in i){const t=i[l]=i[l]||pyt(e[l],e);c=t(r,o),i[a]=t}else Number.isFinite(s)?(c=s+(e[l]||0),i[a]=null):c=t;return o&&c>=t&&(t=c+1),e[a]=c,c};return n}class dyt extends hyt{constructor(t,e){super(t,e),cat(this,"shadowMap",void 0),cat(this,"depthBuffer",void 0),cat(this,"fbo",void 0),this.shadowMap=new tpt(t,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new spt(t,{format:33189,width:1,height:1}),this.fbo=new Ppt(t,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(t){const e=this.fbo;uht(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},(()=>{const i=t.viewports[0],n=hht(this.gl),r=i.width*n,o=i.height*n;r===e.width&&o===e.height||e.resize({width:r,height:o}),super.render({...t,target:e,pass:"shadow"})}))}shouldDrawLayer(t){return!1!==t.props.shadowEnabled}getModuleParameters(){return{drawToShadowMap:!0}}delete(){this.fbo&&(this.fbo.delete(),this.fbo=null),this.shadowMap&&(this.shadowMap.delete(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.delete(),this.depthBuffer=null)}}const fyt="#define SMOOTH_EDGE_RADIUS 0.5";var myt={name:"geometry",vs:"\n".concat(fyt,"\n\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n vec3 pickingColor;\n} geometry = VertexGeometry(\n vec4(0.0, 0.0, 1.0, 0.0),\n vec3(0.0),\n vec3(0.0),\n vec3(0.0),\n vec2(0.0),\n vec3(0.0)\n);\n"),fs:"\n".concat(fyt,"\n\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n\nfloat smoothedge(float edge, float x) {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n")};const gyt=Object.keys(xut).map((t=>"const int COORDINATE_SYSTEM_".concat(t," = ").concat(xut[t],";"))).join(""),yyt=Object.keys(but).map((t=>"const int PROJECTION_MODE_".concat(t," = ").concat(but[t],";"))).join(""),vyt=Object.keys(wut).map((t=>"const int UNIT_".concat(t.toUpperCase()," = ").concat(wut[t],";"))).join("");var _yt="".concat(gyt,"\n").concat(yyt,"\n").concat(vyt,"\n\nuniform int project_uCoordinateSystem;\nuniform int project_uProjectionMode;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\nuniform vec3 project_uCommonOrigin;\nuniform bool project_uPseudoMeters;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0;\nconst float GLOBE_RADIUS = 256.0;\nfloat project_size_at_latitude(float lat) {\n float y = clamp(lat, -89.9, 89.9);\n return 1.0 / cos(radians(y));\n}\n\nfloat project_size() {\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR &&\n project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT &&\n project_uPseudoMeters == false) {\n \n if (geometry.position.w == 0.0) {\n return project_size_at_latitude(geometry.worldPosition.y);\n }\n \n float y = geometry.position.y / TILE_SIZE * 2.0 - 1.0;\n float y2 = y * y;\n float y4 = y2 * y2;\n float y6 = y4 * y2;\n return 1.0 + 4.9348 * y2 + 4.0587 * y4 + 1.5642 * y6;\n }\n return 1.0;\n}\n\nfloat project_size_at_latitude(float meters, float lat) {\n return meters * project_uCommonUnitsPerMeter.z * project_size_at_latitude(lat);\n}\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z * project_size();\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy * project_size();\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter * project_size();\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nmat3 project_get_orientation_matrix(vec3 up) {\n vec3 uz = normalize(up);\n vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\n vec3 uy = cross(uz, ux);\n return mat3(ux, uy, uz);\n}\n\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n transform = project_get_orientation_matrix(commonPosition);\n return true;\n }\n return false;\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n vec3 n = normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n mat3 rotation;\n if (project_needs_rotation(geometry.position.xyz, rotation)) {\n n = rotation * n;\n }\n return n;\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x + 180., 360.0) - 180.;\n }\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\nvec3 project_globe_(vec3 lnglatz) {\n float lambda = radians(lnglatz.x);\n float phi = radians(lnglatz.y);\n float cosPhi = cos(phi);\n float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n\n return vec3(\n sin(lambda) * cosPhi,\n -cos(lambda) * cosPhi,\n sin(phi)\n ) * D;\n}\nvec4 project_position(vec4 position, vec3 position64Low) {\n vec4 position_world = project_uModelMatrix * position;\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_mercator_(position_world.xy),\n project_size_at_latitude(position_world.z, position_world.y),\n position_world.w\n );\n }\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n position_world.xyz += project_uCoordinateOrigin;\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_globe_(position_world.xyz),\n position_world.w\n );\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n if (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) {\n return vec4(\n project_mercator_(position_world.xy) - project_uCommonOrigin.xy,\n project_size(position_world.z),\n position_world.w\n );\n }\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||\n (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n position_world.xyz -= project_uCoordinateOrigin;\n }\n return project_offset_(position_world + project_uModelMatrix * vec4(position64Low, 0.0));\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_LOW);\n}\n\nvec3 project_position(vec3 position, vec3 position64Low) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64Low);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters) * project_uScale;\n}\nfloat project_size_to_pixel(float size, int unit) {\n if (unit == UNIT_METERS) return project_size_to_pixel(size);\n if (unit == UNIT_COMMON) return size * project_uScale;\n return size;\n}\nfloat project_pixel_size(float pixels) {\n return pixels / project_uScale;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels / project_uScale;\n}\n");function xyt(t,e){if(t===e)return!0;if(Array.isArray(t)){const i=t.length;if(!e||e.length!==i)return!1;for(let n=0;n<i;n++)if(t[n]!==e[n])return!1;return!0}return!1}function byt(t){let e,i={};return n=>{for(const r in n)if(!xyt(n[r],i[r])){e=t(n),i=n;break}return e}}const wyt=[0,0,0,0],Ayt=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],Eyt=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],Syt=[0,0,0],Myt=[0,0,0],Tyt=byt((function({viewport:t,devicePixelRatio:e,coordinateSystem:i,coordinateOrigin:n}){const{projectionCenter:r,viewProjectionMatrix:o,originCommon:s,cameraPosCommon:a,shaderCoordinateOrigin:l,geospatialOrigin:c}=function(t,e,i){const{viewMatrixUncentered:n,projectionMatrix:r}=t;let{viewMatrix:o,viewProjectionMatrix:s}=t,a=wyt,l=wyt,c=t.cameraPosition;const{geospatialOrigin:u,shaderCoordinateOrigin:h,offsetMode:p}=Iyt(t,e,i);p&&(l=t.projectPosition(u||h),c=[c[0]-l[0],c[1]-l[1],c[2]-l[2]],l[3]=1,a=Umt([],l,s),o=n||o,s=Dmt([],r,o),s=Dmt([],s,Ayt));return{viewMatrix:o,viewProjectionMatrix:s,projectionCenter:a,originCommon:l,cameraPosCommon:c,shaderCoordinateOrigin:h,geospatialOrigin:u}}(t,i,n),u=t.getDistanceScales(),h=[t.width*e,t.height*e],p=Umt([],[0,0,-t.focalDistance,1],t.projectionMatrix)[3]||1,d={project_uCoordinateSystem:i,project_uProjectionMode:t.projectionMode,project_uCoordinateOrigin:l,project_uCommonOrigin:s.slice(0,3),project_uCenter:r,project_uPseudoMeters:Boolean(t._pseudoMeters),project_uViewportSize:h,project_uDevicePixelRatio:e,project_uFocalDistance:p,project_uCommonUnitsPerMeter:u.unitsPerMeter,project_uCommonUnitsPerWorldUnit:u.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:Syt,project_uScale:t.scale,project_uWrapLongitude:!1,project_uViewProjectionMatrix:o,project_uModelMatrix:Eyt,project_uCameraPosition:a};if(c){const e=t.getDistanceScales(c);switch(i){case xut.METER_OFFSETS:d.project_uCommonUnitsPerWorldUnit=e.unitsPerMeter,d.project_uCommonUnitsPerWorldUnit2=e.unitsPerMeter2;break;case xut.LNGLAT:case xut.LNGLAT_OFFSETS:t._pseudoMeters||(d.project_uCommonUnitsPerMeter=e.unitsPerMeter),d.project_uCommonUnitsPerWorldUnit=e.unitsPerDegree,d.project_uCommonUnitsPerWorldUnit2=e.unitsPerDegree2;break;case xut.CARTESIAN:d.project_uCommonUnitsPerWorldUnit=[1,1,e.unitsPerMeter[2]],d.project_uCommonUnitsPerWorldUnit2=[0,0,e.unitsPerMeter2[2]]}}return d}));function Iyt(t,e,i=Myt){i.length<3&&(i=[i[0],i[1],0]);let n,r=i,o=!0;switch(n=e===xut.LNGLAT_OFFSETS||e===xut.METER_OFFSETS?i:t.isGeospatial?[Math.fround(t.longitude),Math.fround(t.latitude),0]:null,t.projectionMode){case but.WEB_MERCATOR:e!==xut.LNGLAT&&e!==xut.CARTESIAN||(n=[0,0,0],o=!1);break;case but.WEB_MERCATOR_AUTO_OFFSET:e===xut.LNGLAT?r=n:e===xut.CARTESIAN&&(r=[Math.fround(t.center[0]),Math.fround(t.center[1]),0],n=t.unprojectPosition(r),r[0]-=i[0],r[1]-=i[1],r[2]-=i[2]);break;case but.IDENTITY:r=t.position.map(Math.fround),r[2]=r[2]||0;break;case but.GLOBE:o=!1,n=null;break;default:o=!1}return{geospatialOrigin:n,shaderCoordinateOrigin:r,offsetMode:o}}const Cyt={};var Pyt={name:"project",dependencies:[Lft,myt],vs:_yt,getUniforms:function(t=Cyt){return"viewport"in t?function({viewport:t,devicePixelRatio:e=1,modelMatrix:i=null,coordinateSystem:n=xut.DEFAULT,coordinateOrigin:r=Myt,autoWrapLongitude:o=!1}){n===xut.DEFAULT&&(n=t.isGeospatial?xut.LNGLAT:xut.CARTESIAN);const s=Tyt({viewport:t,devicePixelRatio:e,coordinateSystem:n,coordinateOrigin:r});return s.project_uWrapLongitude=o,s.project_uModelMatrix=i||Eyt,s}(t):{}}};function Lyt(t,e){const i=Umt([],e,t);return Vmt(i,i,1/i[3]),i}function Dyt(t,e){const i=t%e;return i<0?e+i:i}function Ryt(t,e,i){return t<e?e:t>i?i:t}const Oyt=Math.log2||function(t){return Math.log(t)*Math.LOG2E};function kyt(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const Nyt=Math.PI,Byt=Nyt/4,zyt=Nyt/180,Fyt=180/Nyt,Vyt=512,Uyt=4003e4,Gyt=85.051129,jyt=1.5;function Hyt(t){const[e,i]=t;kyt(Number.isFinite(e)),kyt(Number.isFinite(i)&&i>=-90&&i<=90,"invalid latitude");const n=i*zyt;return[Vyt*(e*zyt+Nyt)/(2*Nyt),Vyt*(Nyt+Math.log(Math.tan(Byt+.5*n)))/(2*Nyt)]}function Wyt(t){const[e,i]=t,n=e/Vyt*(2*Nyt)-Nyt,r=2*(Math.atan(Math.exp(i/Vyt*(2*Nyt)-Nyt))-Byt);return[n*Fyt,r*Fyt]}function qyt(t){const{latitude:e}=t;kyt(Number.isFinite(e));const i=Math.cos(e*zyt);return function(t){return Oyt(t)}(Uyt*i)-9}function Xyt(t){const e=Math.cos(t*zyt);return Vyt/Uyt/e}function Zyt(t){const{latitude:e,longitude:i,highPrecision:n=!1}=t;kyt(Number.isFinite(e)&&Number.isFinite(i));const r=Vyt,o=Math.cos(e*zyt),s=r/360,a=s/o,l=r/Uyt/o,c={unitsPerMeter:[l,l,l],metersPerUnit:[1/l,1/l,1/l],unitsPerDegree:[s,a,l],degreesPerUnit:[1/s,1/a,1/l]};if(n){const t=zyt*Math.tan(e*zyt)/o,i=s*t/2,n=r/Uyt*t,u=n/a*l;c.unitsPerDegree2=[0,i,n],c.unitsPerMeter2=[u,0,u]}return c}function Yyt(t,e){const[i,n,r]=t,[o,s,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=Zyt({longitude:i,latitude:n,highPrecision:!0}),u=Hyt(t);u[0]+=o*(l[0]+c[0]*s),u[1]+=s*(l[1]+c[1]*s);const h=Wyt(u),p=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[h[0],h[1],p]:h}function Qyt(t){return 2*Math.atan(.5/t)*Fyt}function Jyt(t){return.5/Math.tan(.5*t*zyt)}function Kyt(t,e){const[i,n,r=0]=t;return kyt(Number.isFinite(i)&&Number.isFinite(n)&&Number.isFinite(r)),Lyt(e,[i,n,r,1])}function $yt(t,e,i=0){const[n,r,o]=t;if(kyt(Number.isFinite(n)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(o)){return Lyt(e,[n,r,o,1])}const s=Lyt(e,[n,r,0,1]),a=Lyt(e,[n,r,1,1]),l=s[2],c=a[2];return emt([],s,a,l===c?0:((i||0)-l)/(c-l))}function tvt(t){const{width:e,height:i,bounds:n,minExtent:r=0,maxZoom:o=24,offset:s=[0,0]}=t,[[a,l],[c,u]]=n,h=function(t=0){if("number"==typeof t)return{top:t,bottom:t,left:t,right:t};return kyt(Number.isFinite(t.top)&&Number.isFinite(t.bottom)&&Number.isFinite(t.left)&&Number.isFinite(t.right)),t}(t.padding),p=Hyt([a,Ryt(u,-85.051129,Gyt)]),d=Hyt([c,Ryt(l,-85.051129,Gyt)]),f=[Math.max(Math.abs(d[0]-p[0]),r),Math.max(Math.abs(d[1]-p[1]),r)],m=[e-h.left-h.right-2*Math.abs(s[0]),i-h.top-h.bottom-2*Math.abs(s[1])];kyt(m[0]>0&&m[1]>0);const g=m[0]/f[0],y=m[1]/f[1],v=(h.right-h.left)/2/g,_=(h.top-h.bottom)/2/y,x=Wyt([(d[0]+p[0])/2+v,(d[1]+p[1])/2+_]),b=Math.min(o,Oyt(Math.abs(Math.min(g,y))));return kyt(Number.isFinite(b)),{longitude:x[0],latitude:x[1],zoom:b}}const evt=Math.PI/180;function ivt(t,e,i){const{pixelUnprojectionMatrix:n}=t,r=Lyt(n,[e,0,1,1]),o=Lyt(n,[e,t.height,1,1]),s=Wyt(emt([],r,o,(i*t.distanceScales.unitsPerMeter[2]-r[2])/(o[2]-r[2])));return s.push(i),s}const nvt=byt((function({viewport:t,center:e}){return new Xmt(t.viewProjectionMatrix).invert().transform(e)})),rvt=byt((function({viewport:t,shadowMatrices:e}){const i=[],n=t.pixelUnprojectionMatrix,r=t.isGeospatial?void 0:1,o=[[0,0,r],[t.width,0,r],[0,t.height,r],[t.width,t.height,r],[0,0,-1],[t.width,0,-1],[0,t.height,-1],[t.width,t.height,-1]].map((t=>function(t,e){const[i,n,r]=t,o=$yt([i,n,r],e);if(Number.isFinite(r))return o;return[o[0],o[1],0]}(t,n)));for(const n of e){const e=n.clone().translate(new bmt(t.center).negate()),r=o.map((t=>e.transform(t))),s=(new Xmt).ortho({left:Math.min(...r.map((t=>t[0]))),right:Math.max(...r.map((t=>t[0]))),bottom:Math.min(...r.map((t=>t[1]))),top:Math.max(...r.map((t=>t[1]))),near:Math.min(...r.map((t=>-t[2]))),far:Math.max(...r.map((t=>-t[2])))});i.push(s.multiplyRight(n))}return i})),ovt=[0,0,0,1],svt=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];var avt={name:"shadow",dependencies:[Pyt],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n if(shadow_uLightCount > 1.0) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n }\n shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n position = shadow_setVertexPosition(geometry.position);\n ","fs:DECKGL_FILTER_COLOR":"\n color = shadow_filterShadowColor(color);\n "},getUniforms:(t={},e={})=>"viewport"in t&&(t.drawToShadowMap||t.shadowMaps&&t.shadowMaps.length>0)?function(t,e){const{shadowEnabled:i=!0}=t;if(!i||!t.shadowMatrices||!t.shadowMatrices.length)return{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1};const n={shadow_uDrawShadowMap:Boolean(t.drawToShadowMap),shadow_uUseShadowMap:!!t.shadowMaps&&t.shadowMaps.length>0,shadow_uColor:t.shadowColor||ovt,shadow_uLightId:t.shadowLightId||0,shadow_uLightCount:t.shadowMatrices.length},r=nvt({viewport:t.viewport,center:e.project_uCenter}),o=[],s=rvt({shadowMatrices:t.shadowMatrices,viewport:t.viewport}).slice();for(let i=0;i<t.shadowMatrices.length;i++){const n=s[i],a=n.clone().translate(new bmt(t.viewport.center).negate());e.project_uCoordinateSystem===xut.LNGLAT&&e.project_uProjectionMode===but.WEB_MERCATOR?(s[i]=a,o[i]=r):(s[i]=n.clone().multiplyRight(svt),o[i]=a.transform(r))}for(let e=0;e<s.length;e++)n["shadow_uViewProjectionMatrices[".concat(e,"]")]=s[e],n["shadow_uProjectCenters[".concat(e,"]")]=o[e],t.shadowMaps&&t.shadowMaps.length>0?n["shadow_uShadowMap".concat(e)]=t.shadowMaps[e]:n["shadow_uShadowMap".concat(e)]=t.dummyShadowMap;return n}(t,e):{}};const lvt={color:[255,255,255],intensity:1},cvt=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],uvt=[0,0,0,200/255];class hvt{constructor(t={}){cat(this,"id","lighting-effect"),cat(this,"props",void 0),cat(this,"shadowColor",uvt),cat(this,"shadow",void 0),cat(this,"ambientLight",void 0),cat(this,"directionalLights",void 0),cat(this,"pointLights",void 0),cat(this,"shadowPasses",[]),cat(this,"shadowMaps",[]),cat(this,"dummyShadowMap",null),cat(this,"programManager",void 0),cat(this,"shadowMatrices",void 0),this.setProps(t)}setProps(t){this.ambientLight=null,this.directionalLights=[],this.pointLights=[];for(const e in t){const i=t[e];switch(i.type){case"ambient":this.ambientLight=i;break;case"directional":this.directionalLights.push(i);break;case"point":this.pointLights.push(i)}}this._applyDefaultLights(),this.shadow=this.directionalLights.some((t=>t.shadow)),this.props=t}preRender(t,{layers:e,layerFilter:i,viewports:n,onViewportActive:r,views:o}){if(this.shadow){this.shadowMatrices=this._calculateMatrices(),0===this.shadowPasses.length&&this._createShadowPasses(t),this.programManager||(this.programManager=Cgt.getDefaultProgramManager(t),avt&&this.programManager.addDefaultModule(avt)),this.dummyShadowMap||(this.dummyShadowMap=new tpt(t,{width:1,height:1}));for(let t=0;t<this.shadowPasses.length;t++){this.shadowPasses[t].render({layers:e,layerFilter:i,viewports:n,onViewportActive:r,views:o,moduleParameters:{shadowLightId:t,dummyShadowMap:this.dummyShadowMap,shadowMatrices:this.shadowMatrices}})}}}getModuleParameters(t){const e=this.shadow?{shadowMaps:this.shadowMaps,dummyShadowMap:this.dummyShadowMap,shadowColor:this.shadowColor,shadowMatrices:this.shadowMatrices}:{};return e.lightSources={ambientLight:this.ambientLight,directionalLights:this.directionalLights.map((e=>e.getProjectedLight({layer:t}))),pointLights:this.pointLights.map((e=>e.getProjectedLight({layer:t})))},e}cleanup(){for(const t of this.shadowPasses)t.delete();this.shadowPasses.length=0,this.shadowMaps.length=0,this.dummyShadowMap&&(this.dummyShadowMap.delete(),this.dummyShadowMap=null),this.shadow&&this.programManager&&(this.programManager.removeDefaultModule(avt),this.programManager=null)}_calculateMatrices(){const t=[];for(const e of this.directionalLights){const i=(new Xmt).lookAt({eye:new bmt(e.direction).negate()});t.push(i)}return t}_createShadowPasses(t){for(let e=0;e<this.directionalLights.length;e++){const i=new dyt(t);this.shadowPasses[e]=i,this.shadowMaps[e]=i.shadowMap}}_applyDefaultLights(){const{ambientLight:t,pointLights:e,directionalLights:i}=this;t||0!==e.length||0!==i.length||(this.ambientLight=new ryt(lvt),this.directionalLights.push(new cyt(cvt[0]),new cyt(cvt[1])))}}var pvt=new class{constructor(t={}){cat(this,"_pool",[]),cat(this,"opts",{overAlloc:2,poolSize:100}),this.setOptions(t)}setOptions(t){Object.assign(this.opts,t)}allocate(t,e,{size:i=1,type:n,padding:r=0,copy:o=!1,initialize:s=!1,maxCount:a}){const l=n||t&&t.constructor||Float32Array,c=e*i+r;if(ArrayBuffer.isView(t)){if(c<=t.length)return t;if(c*t.BYTES_PER_ELEMENT<=t.buffer.byteLength)return new l(t.buffer,0,c)}let u=1/0;a&&(u=a*i+r);const h=this._allocate(l,c,s,u);return t&&o?h.set(t):s||h.fill(0,0,4),this._release(t),h}release(t){this._release(t)}_allocate(t,e,i,n){let r=Math.max(Math.ceil(e*this.opts.overAlloc),1);r>n&&(r=n);const o=this._pool,s=t.BYTES_PER_ELEMENT*r,a=o.findIndex((t=>t.byteLength>=s));if(a>=0){const e=new t(o.splice(a,1)[0],0,r);return i&&e.fill(0),e}return new t(r)}_release(t){if(!ArrayBuffer.isView(t))return;const e=this._pool,{buffer:i}=t,{byteLength:n}=i,r=e.findIndex((t=>t.byteLength>=n));r<0?e.push(i):(r>0||e.length<this.opts.poolSize)&&e.splice(r,0,i),e.length>this.opts.poolSize&&e.shift()}};const dvt=new bmt;function fvt(t,e,i,n){dvt.set(t,e,i);const r=dvt.len();return{distance:n/r,normal:new bmt(-t/r,-e/r,-i/r)}}function mvt(t){return t-Math.fround(t)}let gvt;function yvt(t,e){const{size:i=1,startIndex:n=0}=e,r=void 0!==e.endIndex?e.endIndex:t.length,o=(r-n)/i;gvt=pvt.allocate(gvt,o,{type:Float32Array,size:2*i});let s=n,a=0;for(;s<r;){for(let e=0;e<i;e++){const n=t[s++];gvt[a+e]=n,gvt[a+e+i]=mvt(n)}a+=2*i}return gvt.subarray(0,o*i*2)}function vvt(t){let e=null,i=!1;for(const n of t)n&&(e?(i||(e=[[e[0][0],e[0][1]],[e[1][0],e[1][1]]],i=!0),e[0][0]=Math.min(e[0][0],n[0][0]),e[0][1]=Math.min(e[0][1],n[0][1]),e[1][0]=Math.max(e[1][0],n[1][0]),e[1][1]=Math.max(e[1][1],n[1][1])):e=n);return e}const _vt=Math.PI/180,xvt=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],bvt=[0,0,0],wvt={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};class Avt{constructor(t={}){cat(this,"id",void 0),cat(this,"x",void 0),cat(this,"y",void 0),cat(this,"width",void 0),cat(this,"height",void 0),cat(this,"padding",void 0),cat(this,"isGeospatial",void 0),cat(this,"zoom",void 0),cat(this,"focalDistance",void 0),cat(this,"position",void 0),cat(this,"modelMatrix",void 0),cat(this,"distanceScales",void 0),cat(this,"scale",void 0),cat(this,"center",void 0),cat(this,"cameraPosition",void 0),cat(this,"projectionMatrix",void 0),cat(this,"viewMatrix",void 0),cat(this,"viewMatrixUncentered",void 0),cat(this,"viewMatrixInverse",void 0),cat(this,"viewProjectionMatrix",void 0),cat(this,"pixelProjectionMatrix",void 0),cat(this,"pixelUnprojectionMatrix",void 0),cat(this,"resolution",void 0),cat(this,"_frustumPlanes",{}),this.id=t.id||this.constructor.displayName||"viewport",this.x=t.x||0,this.y=t.y||0,this.width=t.width||1,this.height=t.height||1,this.zoom=t.zoom||0,this.padding=t.padding,this.distanceScales=t.distanceScales||wvt,this.focalDistance=t.focalDistance||1,this.position=t.position||bvt,this.modelMatrix=t.modelMatrix||null;const{longitude:e,latitude:i}=t;this.isGeospatial=Number.isFinite(i)&&Number.isFinite(e),this._initProps(t),this._initMatrices(t),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get subViewports(){return null}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?but.WEB_MERCATOR:but.WEB_MERCATOR_AUTO_OFFSET:but.IDENTITY}equals(t){return t instanceof Avt&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&qft(t.projectionMatrix,this.projectionMatrix)&&qft(t.viewMatrix,this.viewMatrix))}project(t,{topLeft:e=!0}={}){const i=Kyt(this.projectPosition(t),this.pixelProjectionMatrix),[n,r]=i,o=e?r:this.height-r;return 2===t.length?[n,o]:[n,o,i[2]]}unproject(t,{topLeft:e=!0,targetZ:i}={}){const[n,r,o]=t,s=e?r:this.height-r,a=i&&i*this.distanceScales.unitsPerMeter[2],l=$yt([n,s,o],this.pixelUnprojectionMatrix,a),[c,u,h]=this.unprojectPosition(l);return Number.isFinite(o)?[c,u,h]:Number.isFinite(i)?[c,u,i]:[c,u]}projectPosition(t){const[e,i]=this.projectFlat(t);return[e,i,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[e,i]=this.unprojectFlat(t);return[e,i,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){if(this.isGeospatial){const e=Hyt(t);return e[1]=Hft(e[1],-318,830),e}return t}unprojectFlat(t){return this.isGeospatial?Wyt(t):t}getBounds(t={}){const e={targetZ:t.z||0},i=this.unproject([0,0],e),n=this.unproject([this.width,0],e),r=this.unproject([0,this.height],e),o=this.unproject([this.width,this.height],e);return[Math.min(i[0],n[0],r[0],o[0]),Math.min(i[1],n[1],r[1],o[1]),Math.max(i[0],n[0],r[0],o[0]),Math.max(i[1],n[1],r[1],o[1])]}getDistanceScales(t){return t?Zyt({longitude:t[0],latitude:t[1],highPrecision:!0}):this.distanceScales}containsPixel({x:t,y:e,width:i=1,height:n=1}){return t<this.x+this.width&&this.x<t+i&&e<this.y+this.height&&this.y<e+n}getFrustumPlanes(){return this._frustumPlanes.near||Object.assign(this._frustumPlanes,{left:fvt((t=this.viewProjectionMatrix)[3]+t[0],t[7]+t[4],t[11]+t[8],t[15]+t[12]),right:fvt(t[3]-t[0],t[7]-t[4],t[11]-t[8],t[15]-t[12]),bottom:fvt(t[3]+t[1],t[7]+t[5],t[11]+t[9],t[15]+t[13]),top:fvt(t[3]-t[1],t[7]-t[5],t[11]-t[9],t[15]-t[13]),near:fvt(t[3]+t[2],t[7]+t[6],t[11]+t[10],t[15]+t[14]),far:fvt(t[3]-t[2],t[7]-t[6],t[11]-t[10],t[15]-t[14])}),this._frustumPlanes;var t}panByPosition(t,e){return null}_initProps(t){const e=t.longitude,i=t.latitude;this.isGeospatial&&(Number.isFinite(t.zoom)||(this.zoom=qyt({latitude:i})+Math.log2(this.focalDistance)),this.distanceScales=t.distanceScales||Zyt({latitude:i,longitude:e}));const n=Math.pow(2,this.zoom);this.scale=n;const{position:r,modelMatrix:o}=t;let s=bvt;if(r&&(s=o?new Xmt(o).transformAsVector(r,[]):r),this.isGeospatial){const t=this.projectPosition([e,i,0]);this.center=new bmt(s).scale(this.distanceScales.unitsPerMeter).add(t)}else this.center=this.projectPosition(s)}_initMatrices(t){const{viewMatrix:e=xvt,projectionMatrix:i=null,orthographic:n=!1,fovyRadians:r,fovy:o=75,near:s=.1,far:a=1e3,padding:l=null,focalDistance:c=1}=t;this.viewMatrixUncentered=e,this.viewMatrix=(new Xmt).multiplyRight(e).translate(new bmt(this.center).negate()),this.projectionMatrix=i||function({width:t,height:e,orthographic:i,fovyRadians:n,focalDistance:r,padding:o,near:s,far:a}){const l=t/e,c=i?(new Xmt).orthographic({fovy:n,aspect:l,focalDistance:r,near:s,far:a}):(new Xmt).perspective({fovy:n,aspect:l,near:s,far:a});if(o){const{left:i=0,right:n=0,top:r=0,bottom:s=0}=o,a=Hft((i+t-n)/2,0,t)-t/2,l=Hft((r+e-s)/2,0,e)-e/2;c[8]-=2*a/t,c[9]+=2*l/e}return c}({width:this.width,height:this.height,orthographic:n,fovyRadians:r||o*_vt,focalDistance:c,padding:l,near:s,far:a});const u=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];var h;Dmt(u,u,this.projectionMatrix),Dmt(u,u,this.viewMatrix),this.viewProjectionMatrix=u,this.viewMatrixInverse=Lmt([],this.viewMatrix)||this.viewMatrix,this.cameraPosition=[(h=this.viewMatrixInverse)[12],h[13],h[14]];const p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],d=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Omt(p,p,[this.width/2,-this.height/2,1]),Rmt(p,p,[1,-1,0]),Dmt(d,p,this.viewProjectionMatrix),this.pixelProjectionMatrix=d,this.pixelUnprojectionMatrix=Lmt([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],this.pixelProjectionMatrix),this.pixelUnprojectionMatrix||dut.warn("Pixel project matrix not invertible")()}}cat(Avt,"displayName","Viewport");class Evt extends Avt{constructor(t={}){const{latitude:e=0,longitude:i=0,zoom:n=0,pitch:r=0,bearing:o=0,nearZMultiplier:s=.1,farZMultiplier:a=1.01,nearZ:l,farZ:c,orthographic:u=!1,projectionMatrix:h,repeat:p=!1,worldOffset:d=0,position:f,padding:m,legacyMeterSizes:g=!1}=t;let{width:y,height:v,altitude:_=1.5}=t;const x=Math.pow(2,n);let b;y=y||1,v=v||1;let w=null;if(h)_=h[5]/2,b=Qyt(_);else{let i;if(t.fovy?(b=t.fovy,_=Jyt(b)):b=Qyt(_),m){const{top:t=0,bottom:e=0}=m;i=[0,Hft((t+v-e)/2,0,v)-v/2]}w=function(t){const{width:e,height:i,altitude:n,pitch:r=0,offset:o,center:s,scale:a,nearZMultiplier:l=1,farZMultiplier:c=1}=t;let{fovy:u=Qyt(jyt)}=t;void 0!==n&&(u=Qyt(n));const h=u*zyt,p=r*zyt,d=Jyt(u);let f=d;s&&(f+=s[2]*a/Math.cos(p)/i);const m=h*(.5+(o?o[1]:0)/i),g=Math.sin(m)*f/Math.sin(Ryt(Math.PI/2-p-m,.01,Math.PI-.01)),y=Math.sin(p)*g+f,v=10*f;return{fov:h,aspect:e/i,focalDistance:d,near:l,far:Math.min(y*c,v)}}({width:y,height:v,scale:x,center:f&&[0,0,f[2]*Xyt(e)],offset:i,pitch:r,fovy:b,nearZMultiplier:s,farZMultiplier:a}),Number.isFinite(l)&&(w.near=l),Number.isFinite(c)&&(w.far=c)}let A=function(t){const{height:e,pitch:i,bearing:n,altitude:r,scale:o,center:s}=t,a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Rmt(a,a,[0,0,-r]),kmt(a,a,-i*zyt),Nmt(a,a,n*zyt);const l=o/e;return Omt(a,a,[l,l,l]),s&&Rmt(a,a,function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}([],s)),a}({height:v,pitch:r,bearing:o,scale:x,altitude:_});if(d){A=(new Xmt).translate([512*d,0,0]).multiplyLeft(A)}super({...t,width:y,height:v,viewMatrix:A,longitude:i,latitude:e,zoom:n,...w,fovy:b,focalDistance:_}),cat(this,"longitude",void 0),cat(this,"latitude",void 0),cat(this,"pitch",void 0),cat(this,"bearing",void 0),cat(this,"altitude",void 0),cat(this,"fovy",void 0),cat(this,"orthographic",void 0),cat(this,"_subViewports",void 0),cat(this,"_pseudoMeters",void 0),this.latitude=e,this.longitude=i,this.zoom=n,this.pitch=r,this.bearing=o,this.altitude=_,this.fovy=b,this.orthographic=u,this._subViewports=p?[]:null,this._pseudoMeters=g,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){const t=this.getBounds(),e=Math.floor((t[0]+180)/360),i=Math.ceil((t[2]-180)/360);for(let t=e;t<=i;t++){const e=t?new Evt({...this,worldOffset:t}):this;this._subViewports.push(e)}}return this._subViewports}projectPosition(t){if(this._pseudoMeters)return super.projectPosition(t);const[e,i]=this.projectFlat(t);return[e,i,(t[2]||0)*Xyt(t[1])]}unprojectPosition(t){if(this._pseudoMeters)return super.unprojectPosition(t);const[e,i]=this.unprojectFlat(t);return[e,i,(t[2]||0)/Xyt(i)]}addMetersToLngLat(t,e){return Yyt(t,e)}panByPosition(t,e){const i=$yt(e,this.pixelUnprojectionMatrix),n=tmt([],this.projectFlat(t),function(t,e){return t[0]=-e[0],t[1]=-e[1],t}([],i)),r=tmt([],this.center,n),[o,s]=this.unprojectFlat(r);return{longitude:o,latitude:s}}getBounds(t={}){const e=function(t,e=0){const{width:i,height:n,unproject:r}=t,o={targetZ:e},s=r([0,n],o),a=r([i,n],o);let l,c;return(t.fovy?.5*t.fovy*evt:Math.atan(.5/t.altitude))>(90-t.pitch)*evt-.01?(l=ivt(t,0,e),c=ivt(t,i,e)):(l=r([0,0],o),c=r([i,0],o)),[s,a,c,l]}(this,t.z||0);return[Math.min(e[0][0],e[1][0],e[2][0],e[3][0]),Math.min(e[0][1],e[1][1],e[2][1],e[3][1]),Math.max(e[0][0],e[1][0],e[2][0],e[3][0]),Math.max(e[0][1],e[1][1],e[2][1],e[3][1])]}fitBounds(t,e={}){const{width:i,height:n}=this,{longitude:r,latitude:o,zoom:s}=tvt({width:i,height:n,bounds:t,...e});return new Evt({width:i,height:n,longitude:r,latitude:o,zoom:s})}}cat(Evt,"displayName","WebMercatorViewport");const Svt=[0,0,0];function Mvt(t,e,i=!1){const n=e.projectPosition(t);if(i&&e instanceof Evt){const[i,r,o=0]=t,s=e.getDistanceScales([i,r]);n[2]=o*s.unitsPerMeter[2]}return n}function Tvt(t,{viewport:e,modelMatrix:i,coordinateSystem:n,coordinateOrigin:r,offsetMode:o}){let[s,a,l=0]=t;switch(i&&([s,a,l]=Umt([],[s,a,l,1],i)),n){case xut.LNGLAT:return Mvt([s,a,l],e,o);case xut.LNGLAT_OFFSETS:return Mvt([s+r[0],a+r[1],l+(r[2]||0)],e,o);case xut.METER_OFFSETS:return Mvt(Yyt(r,[s,a,l]),e,o);case xut.CARTESIAN:default:return e.isGeospatial?[s+r[0],a+r[1],l+r[2]]:e.projectPosition([s,a,l])}}function Ivt(t,e){const{viewport:i,coordinateSystem:n,coordinateOrigin:r,modelMatrix:o,fromCoordinateSystem:s,fromCoordinateOrigin:a}=function(t){const{viewport:e,modelMatrix:i,coordinateOrigin:n}=t;let{coordinateSystem:r,fromCoordinateSystem:o,fromCoordinateOrigin:s}=t;return r===xut.DEFAULT&&(r=e.isGeospatial?xut.LNGLAT:xut.CARTESIAN),void 0===o&&(o=r),void 0===s&&(s=n),{viewport:e,coordinateSystem:r,coordinateOrigin:n,modelMatrix:i,fromCoordinateSystem:o,fromCoordinateOrigin:s}}(e),{autoOffset:l=!0}=e,{geospatialOrigin:c=Svt,shaderCoordinateOrigin:u=Svt,offsetMode:h=!1}=l?Iyt(i,n,r):{},p=Tvt(t,{viewport:i,modelMatrix:o,coordinateSystem:s,coordinateOrigin:a,offsetMode:h});if(h){const t=i.projectPosition(c||u);gmt(p,p,t)}return p}const Cvt={blendFunc:[1,0,32771,0],blendEquation:32774};class Pvt extends hyt{constructor(...t){super(...t),cat(this,"pickZ",void 0),cat(this,"_colorEncoderState",null)}render(t){return"pickingFBO"in t?this._drawPickingBuffer(t):super.render(t)}_drawPickingBuffer({layers:t,layerFilter:e,views:i,viewports:n,onViewportActive:r,pickingFBO:o,deviceRect:{x:s,y:a,width:l,height:c},cullRect:u,effects:h,pass:p="picking",pickZ:d,moduleParameters:f}){const m=this.gl;this.pickZ=d;const g=this._resetColorEncoder(d),y=uht(m,{scissorTest:!0,scissor:[s,a,l,c],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0],...Cvt,blend:!d},(()=>super.render({target:o,layers:t,layerFilter:e,views:i,viewports:n,onViewportActive:r,cullRect:u,effects:null==h?void 0:h.filter((t=>t.useInPicking)),pass:p,isPicking:!0,moduleParameters:f})));this._colorEncoderState=null;return{decodePickingColor:g&&Lvt.bind(null,g),stats:y}}shouldDrawLayer(t){const{pickable:e,operation:i}=t.props;return e&&i.includes("draw")||i.includes("terrain")||i.includes("mask")}getModuleParameters(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}getLayerParameters(t,e,i){const n={...t.props.parameters},{pickable:r,operation:o}=t.props;return this._colorEncoderState?r&&o.includes("draw")&&(Object.assign(n,Cvt),n.blend=!0,n.blendColor=function(t,e,i){const{byLayer:n,byAlpha:r}=t;let o,s=n.get(e);s?(s.viewports.push(i),o=s.a):(o=n.size+1,o<=255?(s={a:o,layer:e,viewports:[i]},n.set(e,s),r[o]=s):(dut.warn("Too many pickable layers, only picking the first 255")(),o=0));return[0,0,0,o/255]}(this._colorEncoderState,t,i)):n.blend=!1,o.includes("terrain")&&(n.blend=!1),n}_resetColorEncoder(t){return this._colorEncoderState=t?null:{byLayer:new Map,byAlpha:[]},this._colorEncoderState}}function Lvt(t,e){const i=t.byAlpha[e[3]];return i&&{pickedLayer:i.layer,pickedViewports:i.viewports,pickedObjectIndex:i.layer.decodePickingColor(e)}}const Dvt="Awaiting state",Rvt="Matched. State transferred from previous layer",Ovt="Initialized",kvt="Discarded. Awaiting garbage collection",Nvt="No longer matched. Awaiting garbage collection",Bvt="Finalized! Awaiting garbage collection",zvt=Symbol.for("component"),Fvt=Symbol.for("propTypes"),Vvt=Symbol.for("deprecatedProps"),Uvt=Symbol.for("asyncPropDefaults"),Gvt=Symbol.for("asyncPropOriginal"),jvt=Symbol.for("asyncPropResolved");function Hvt(t,e=(()=>!0)){return Array.isArray(t)?Wvt(t,e,[]):e(t)?[t]:[]}function Wvt(t,e,i){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Wvt(r,e,i):e(r)&&i.push(r)}return i}function qvt({target:t,source:e,start:i=0,count:n=1}){const r=e.length,o=n*r;let s=0;for(let n=i;s<r;s++)t[n++]=e[s];for(;s<o;)s<o-s?(t.copyWithin(i+s,i,i+s),s*=2):(t.copyWithin(i+s,i,i+o-s),s=o);return t}class Xvt{constructor(t,e,i){cat(this,"id",void 0),cat(this,"context",void 0),cat(this,"isLoaded",void 0),cat(this,"persistent",void 0),cat(this,"_loadCount",0),cat(this,"_subscribers",new Set),cat(this,"_data",void 0),cat(this,"_loader",void 0),cat(this,"_error",void 0),cat(this,"_content",void 0),this.id=t,this.context=i,this.setData(e)}subscribe(t){this._subscribers.add(t)}unsubscribe(t){this._subscribers.delete(t)}inUse(){return this._subscribers.size>0}delete(){}getData(){return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then((()=>this.getData()))}setData(t,e){if(t===this._data&&!e)return;this._data=t;const i=++this._loadCount;let n=t;"string"==typeof t&&(n=bct(t)),n instanceof Promise?(this.isLoaded=!1,this._loader=n.then((t=>{this._loadCount===i&&(this.isLoaded=!0,this._error=void 0,this._content=t)})).catch((t=>{this._loadCount===i&&(this.isLoaded=!0,this._error=t||!0)}))):(this.isLoaded=!0,this._error=void 0,this._content=t);for(const t of this._subscribers)t.onChange(this.getData())}}class Zvt{constructor({gl:t,protocol:e}){cat(this,"protocol",void 0),cat(this,"_context",void 0),cat(this,"_resources",void 0),cat(this,"_consumers",void 0),cat(this,"_pruneRequest",void 0),this.protocol=e||"resource://",this._context={gl:t,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(t){return!!t.startsWith(this.protocol)||t in this._resources}add({resourceId:t,data:e,forceUpdate:i=!1,persistent:n=!0}){let r=this._resources[t];r?r.setData(e,i):(r=new Xvt(t,e,this._context),this._resources[t]=r),r.persistent=n}remove(t){const e=this._resources[t];e&&(e.delete(),delete this._resources[t])}unsubscribe({consumerId:t}){const e=this._consumers[t];if(e){for(const t in e){const i=e[t],n=this._resources[i.resourceId];n&&n.unsubscribe(i)}delete this._consumers[t],this.prune()}}subscribe({resourceId:t,onChange:e,consumerId:i,requestId:n="default"}){const{_resources:r,protocol:o}=this;t.startsWith(o)&&(r[t=t.replace(o,"")]||this.add({resourceId:t,data:null,persistent:!1}));const s=r[t];if(this._track(i,n,s,e),s)return s.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout((()=>this._prune()),0))}finalize(){for(const t in this._resources)this._resources[t].delete()}_track(t,e,i,n){const r=this._consumers,o=r[t]=r[t]||{},s=o[e]||{},a=s.resourceId&&this._resources[s.resourceId];a&&(a.unsubscribe(s),this.prune()),i&&(o[e]=s,s.onChange=n,s.resourceId=i.id,i.subscribe(s))}_prune(){this._pruneRequest=null;for(const t of Object.keys(this._resources)){const e=this._resources[t];e.persistent||e.inUse()||(e.delete(),delete this._resources[t])}}}var Yvt={name:"project32",dependencies:[Pyt],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64Low);\n mat3 rotation;\n if (project_needs_rotation(projectedPosition, rotation)) {\n // offset is specified as ENU\n // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n offset = rotation * offset;\n }\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n"},Qvt={inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n // for picking depth values\n picking_setPickingAttribute(position.z / position.w);\n ","vs:DECKGL_FILTER_COLOR":"\n picking_setPickingColor(geometry.pickingColor);\n ","fs:#decl":"\nuniform bool picking_uAttribute;\n ","fs:DECKGL_FILTER_COLOR":{order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n "}},...bgt};const Jvt=[Pyt],Kvt=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function $vt(t){const e=Cgt.getDefaultProgramManager(t);for(const t of Jvt)e.addDefaultModule(t);for(const t of Kvt)e.addShaderHook(t);return e}class t_t{constructor(t,{deck:e,stats:i,viewport:n,timeline:r}={}){cat(this,"layers",void 0),cat(this,"context",void 0),cat(this,"resourceManager",void 0),cat(this,"_lastRenderedLayers",[]),cat(this,"_needsRedraw",!1),cat(this,"_needsUpdate",!1),cat(this,"_nextLayers",null),cat(this,"_debug",!1),cat(this,"activateViewport",(t=>{yut("layerManager.activateViewport",this,t),t&&(this.context.viewport=t)})),this.layers=[],this.resourceManager=new Zvt({gl:t,protocol:"deck://"}),this.context={mousePosition:null,userData:{},layerManager:this,gl:t,deck:e,programManager:t&&$vt(t),stats:i||new Aht({id:"deck.gl"}),viewport:n||new Avt({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:r||new tyt,resourceManager:this.resourceManager,onError:void 0},Object.seal(this)}finalize(){this.resourceManager.finalize();for(const t of this.layers)this._finalizeLayer(t)}needsRedraw(t={clearRedrawFlags:!1}){let e=this._needsRedraw;t.clearRedrawFlags&&(this._needsRedraw=!1);for(const i of this.layers){const n=i.getNeedsRedraw(t);e=e||n}return e}needsUpdate(){return this._nextLayers&&this._nextLayers!==this._lastRenderedLayers?"layers changed":this._needsUpdate}setNeedsRedraw(t){this._needsRedraw=this._needsRedraw||t}setNeedsUpdate(t){this._needsUpdate=this._needsUpdate||t}getLayers({layerIds:t}={}){return t?this.layers.filter((e=>t.find((t=>0===e.id.indexOf(t))))):this.layers}setProps(t){"debug"in t&&(this._debug=t.debug),"userData"in t&&(this.context.userData=t.userData),"layers"in t&&(this._nextLayers=t.layers),"onError"in t&&(this.context.onError=t.onError)}setLayers(t,e){yut("layerManager.setLayers",this,e,t),this._lastRenderedLayers=t;const i=Hvt(t,Boolean);for(const t of i)t.context=this.context;this._updateLayers(this.layers,i)}updateLayers(){const t=this.needsUpdate();t&&(this.setNeedsRedraw("updating layers: ".concat(t)),this.setLayers(this._nextLayers||this._lastRenderedLayers,t)),this._nextLayers=null}_handleError(t,e,i){i.raiseError(e,"".concat(t," of ").concat(i))}_updateLayers(t,e){const i={};for(const e of t)i[e.id]?dut.warn("Multiple old layers with same id ".concat(e.id))():i[e.id]=e;const n=[];this._updateSublayersRecursively(e,i,n),this._finalizeOldLayers(i);let r=!1;for(const t of n)if(t.hasUniformTransition()){r="Uniform transition in ".concat(t);break}this._needsUpdate=r,this.layers=n}_updateSublayersRecursively(t,e,i){for(const n of t){n.context=this.context;const t=e[n.id];null===t&&dut.warn("Multiple new layers with same id ".concat(n.id))(),e[n.id]=null;let r=null;try{this._debug&&t!==n&&n.validateProps(),t?(this._transferLayerState(t,n),this._updateLayer(n)):this._initializeLayer(n),i.push(n),r=n.isComposite?n.getSubLayers():null}catch(t){this._handleError("matching",t,n)}r&&this._updateSublayersRecursively(r,e,i)}}_finalizeOldLayers(t){for(const e in t){const i=t[e];i&&this._finalizeLayer(i)}}_initializeLayer(t){try{t._initialize(),t.lifecycle=Ovt}catch(e){this._handleError("initialization",e,t)}}_transferLayerState(t,e){e._transferState(t),e.lifecycle=Rvt,e!==t&&(t.lifecycle=kvt)}_updateLayer(t){try{t._update()}catch(e){this._handleError("update",e,t)}}_finalizeLayer(t){this._needsRedraw=this._needsRedraw||"finalized ".concat(t),t.lifecycle=Nvt;try{t._finalize(),t.lifecycle=Bvt}catch(e){this._handleError("finalization",e,t)}}}function e_t(t,e,i){if(t===e)return!0;if(!i||!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!e_t(t[n],e[n],i-1))return!1;return!0}if(Array.isArray(e))return!1;if("object"==typeof t&&"object"==typeof e){const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const r of n){if(!e.hasOwnProperty(r))return!1;if(!e_t(t[r],e[r],i-1))return!1}return!0}return!1}class i_t{constructor(t){cat(this,"width",void 0),cat(this,"height",void 0),cat(this,"views",void 0),cat(this,"viewState",void 0),cat(this,"controllers",void 0),cat(this,"timeline",void 0),cat(this,"_viewports",void 0),cat(this,"_viewportMap",void 0),cat(this,"_isUpdating",void 0),cat(this,"_needsRedraw",void 0),cat(this,"_needsUpdate",void 0),cat(this,"_eventManager",void 0),cat(this,"_eventCallbacks",void 0),this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=t.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="First render",this._needsUpdate="Initialize",this._eventManager=t.eventManager,this._eventCallbacks={onViewStateChange:t.onViewStateChange,onInteractionStateChange:t.onInteractionStateChange},Object.seal(this),this.setProps(t)}finalize(){for(const t in this.controllers){const e=this.controllers[t];e&&e.finalize()}this.controllers={}}needsRedraw(t={clearRedrawFlags:!1}){const e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}setNeedsUpdate(t){this._needsUpdate=this._needsUpdate||t,this._needsRedraw=this._needsRedraw||t}updateViewStates(){for(const t in this.controllers){const e=this.controllers[t];e&&e.updateTransition()}}getViewports(t){return t?this._viewports.filter((e=>e.containsPixel(t))):this._viewports}getViews(){const t={};return this.views.forEach((e=>{t[e.id]=e})),t}getView(t){return this.views.find((e=>e.id===t))}getViewState(t){const e="string"==typeof t?this.getView(t):t,i=e&&this.viewState[e.getViewStateId()]||this.viewState;return e?e.filterViewState(i):i}getViewport(t){return this._viewportMap[t]}unproject(t,e){const i=this.getViewports(),n={x:t[0],y:t[1]};for(let r=i.length-1;r>=0;--r){const o=i[r];if(o.containsPixel(n)){const i=t.slice();return i[0]-=o.x,i[1]-=o.y,o.unproject(i,e)}}return null}setProps(t){t.views&&this._setViews(t.views),t.viewState&&this._setViewState(t.viewState),("width"in t||"height"in t)&&this._setSize(t.width,t.height),this._isUpdating||this._update()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(t,e){t===this.width&&e===this.height||(this.width=t,this.height=e,this.setNeedsUpdate("Size changed"))}_setViews(t){t=Hvt(t,Boolean);this._diffViews(t,this.views)&&this.setNeedsUpdate("views changed"),this.views=t}_setViewState(t){if(t){!e_t(t,this.viewState,3)&&this.setNeedsUpdate("viewState changed"),this.viewState=t}else dut.warn("missing `viewState` or `initialViewState`")()}_onViewStateChange(t,e){this._eventCallbacks.onViewStateChange&&this._eventCallbacks.onViewStateChange({...e,viewId:t})}_createController(t,e){return new(0,e.type)({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,e.id),onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:e=>{var i;return null===(i=this.getView(t.id))||void 0===i?void 0:i.makeViewport({viewState:e,width:this.width,height:this.height})}})}_updateController(t,e,i,n){const r=t.controller;if(r&&i){const o={...e,...r,id:t.id,x:i.x,y:i.y,width:i.width,height:i.height};return n&&n.constructor===r.type||(n=this._createController(t,o)),n&&n.setProps(o),n}return null}_rebuildViewports(){const{views:t}=this,e=this.controllers;this._viewports=[],this.controllers={};let i=!1;for(let n=t.length;n--;){const r=t[n],o=this.getViewState(r),s=r.makeViewport({viewState:o,width:this.width,height:this.height});let a=e[r.id];const l=Boolean(r.controller);l&&!a&&(i=!0),!i&&l||!a||(a.finalize(),a=null),this.controllers[r.id]=this._updateController(r,o,s,a),s&&this._viewports.unshift(s)}for(const t in e){const i=e[t];i&&!this.controllers[t]&&i.finalize()}this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach((t=>{t.id&&(this._viewportMap[t.id]=this._viewportMap[t.id]||t)}))}_diffViews(t,e){return t.length!==e.length||t.some(((i,n)=>!t[n].equals(e[n])))}}const n_t=/([0-9]+\.?[0-9]*)(%|px)/;function r_t(t){switch(typeof t){case"number":return{position:t,relative:!1};case"string":const e=n_t.exec(t);if(e&&e.length>=3){const t="%"===e[2],i=parseFloat(e[1]);return{position:t?i/100:i,relative:t}}default:throw new Error("Could not parse position string ".concat(t))}}function o_t(t,e){return t.relative?Math.round(t.position*e):t.position}function s_t(t,e){if(!t)throw new Error(e||"deck.gl: assertion failed.")}class a_t{constructor(t){cat(this,"id",void 0),cat(this,"viewportInstance",void 0),cat(this,"_x",void 0),cat(this,"_y",void 0),cat(this,"_width",void 0),cat(this,"_height",void 0),cat(this,"_padding",void 0),cat(this,"props",void 0);const{id:e,x:i=0,y:n=0,width:r="100%",height:o="100%",padding:s=null,viewportInstance:a}=t||{};s_t(!a||a instanceof Avt),this.viewportInstance=a,this.id=e||this.constructor.displayName||"view",this.props={...t,id:this.id},this._x=r_t(i),this._y=r_t(n),this._width=r_t(r),this._height=r_t(o),this._padding=s&&{left:r_t(s.left||0),right:r_t(s.right||0),top:r_t(s.top||0),bottom:r_t(s.bottom||0)},this.equals=this.equals.bind(this),Object.seal(this)}equals(t){return this===t||(this.viewportInstance?!!t.viewportInstance&&this.viewportInstance.equals(t.viewportInstance):this.ViewportType===t.ViewportType&&e_t(this.props,t.props,2))}makeViewport({width:t,height:e,viewState:i}){if(this.viewportInstance)return this.viewportInstance;i=this.filterViewState(i);const n=this.getDimensions({width:t,height:e});return n.height&&n.width?new this.ViewportType({...i,...this.props,...n}):null}getViewStateId(){const{viewState:t}=this.props;return"string"==typeof t?t:(null==t?void 0:t.id)||this.id}filterViewState(t){if(this.props.viewState&&"object"==typeof this.props.viewState){if(!this.props.viewState.id)return this.props.viewState;const e={...t};for(const t in this.props.viewState)"id"!==t&&(e[t]=this.props.viewState[t]);return e}return t}getDimensions({width:t,height:e}){const i={x:o_t(this._x,t),y:o_t(this._y,e),width:o_t(this._width,t),height:o_t(this._height,e)};return this._padding&&(i.padding={left:o_t(this._padding.left,t),top:o_t(this._padding.top,e),right:o_t(this._padding.right,t),bottom:o_t(this._padding.bottom,e)}),i}get controller(){const t=this.props.controller;return t?!0===t?{type:this.ControllerType}:"function"==typeof t?{type:t}:{type:this.ControllerType,...t}:null}}class l_t{constructor(t){cat(this,"_inProgress",void 0),cat(this,"_handle",void 0),cat(this,"_timeline",void 0),cat(this,"time",void 0),cat(this,"settings",void 0),this._inProgress=!1,this._handle=null,this._timeline=t,this.time=0,this.settings={duration:0}}get inProgress(){return this._inProgress}start(t){var e,i;this.cancel(),this.settings=t,this._inProgress=!0,null===(e=(i=this.settings).onStart)||void 0===e||e.call(i,this)}end(){var t,e;this._inProgress&&(this._timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,null===(t=(e=this.settings).onEnd)||void 0===t||t.call(e,this))}cancel(){var t,e;this._inProgress&&(null===(t=(e=this.settings).onInterrupt)||void 0===t||t.call(e,this),this._timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){var t,e;if(!this._inProgress)return!1;if(null===this._handle){const{_timeline:t,settings:e}=this;this._handle=t.addChannel({delay:t.getTime(),duration:e.duration})}return this.time=this._timeline.getTime(this._handle),this._onUpdate(),null===(t=(e=this.settings).onUpdate)||void 0===t||t.call(e,this),this._timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}const c_t=()=>{},u_t=2,h_t=3,p_t=t=>t,d_t=1;class f_t{constructor(t){cat(this,"getControllerState",void 0),cat(this,"props",void 0),cat(this,"propsInTransition",void 0),cat(this,"transition",void 0),cat(this,"onViewStateChange",void 0),cat(this,"onStateChange",void 0),cat(this,"_onTransitionUpdate",(t=>{const{time:e,settings:{interpolator:i,startProps:n,endProps:r,duration:o,easing:s}}=t,a=s(e/o),l=i.interpolateProps(n,r,a);this.propsInTransition=this.getControllerState({...this.props,...l}).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})})),this.getControllerState=t.getControllerState,this.propsInTransition=null,this.transition=new l_t(t.timeline),this.onViewStateChange=t.onViewStateChange||c_t,this.onStateChange=t.onStateChange||c_t}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(t){let e=!1;const i=this.props;if(this.props=t,!i||this._shouldIgnoreViewportChange(i,t))return!1;if(this._isTransitionEnabled(t)){let n=i;if(this.transition.inProgress){const{interruption:t,endProps:e}=this.transition.settings;n={...i,...t===u_t?e:this.propsInTransition||i}}this._triggerTransition(n,t),e=!0}else this.transition.cancel();return e}updateTransition(){this.transition.update()}_isTransitionEnabled(t){const{transitionDuration:e,transitionInterpolator:i}=t;return(e>0||"auto"===e)&&Boolean(i)}_isUpdateDueToCurrentTransition(t){return!(!this.transition.inProgress||!this.propsInTransition)&&this.transition.settings.interpolator.arePropsEqual(t,this.propsInTransition)}_shouldIgnoreViewportChange(t,e){return this.transition.inProgress?this.transition.settings.interruption===h_t||this._isUpdateDueToCurrentTransition(e):!this._isTransitionEnabled(e)||e.transitionInterpolator.arePropsEqual(t,e)}_triggerTransition(t,e){const i=this.getControllerState(t),n=this.getControllerState(e).shortestPathFrom(i),r=e.transitionInterpolator,o=r.getDuration?r.getDuration(t,e):e.transitionDuration;if(0===o)return;const s=r.initializeProps(t,n);this.propsInTransition={};const a={duration:o,easing:e.transitionEasing||p_t,interpolator:r,interruption:e.transitionInterruption||d_t,startProps:s.start,endProps:s.end,onStart:e.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(e.onTransitionInterrupt),onEnd:this._onTransitionEnd(e.onTransitionEnd)};this.transition.start(a),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(t){return e=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),null==t||t(e)}}}class m_t{constructor(t){cat(this,"_propsToCompare",void 0),cat(this,"_propsToExtract",void 0),cat(this,"_requiredProps",void 0);const{compare:e,extract:i,required:n}=t;this._propsToCompare=e,this._propsToExtract=i||e,this._requiredProps=n}arePropsEqual(t,e){for(const i of this._propsToCompare)if(!(i in t)||!(i in e)||!qft(t[i],e[i]))return!1;return!0}initializeProps(t,e){const i={},n={};for(const r of this._propsToExtract)(r in t||r in e)&&(i[r]=t[r],n[r]=e[r]);return this._checkRequiredProps(i),this._checkRequiredProps(n),{start:i,end:n}}getDuration(t,e){return e.transitionDuration}_checkRequiredProps(t){this._requiredProps&&this._requiredProps.forEach((e=>{const i=t[e];s_t(Number.isFinite(i)||Array.isArray(i),"".concat(e," is required for transition"))}))}}const g_t=["longitude","latitude","zoom","bearing","pitch"],y_t=["longitude","latitude","zoom"];class v_t extends m_t{constructor(t={}){const e=Array.isArray(t)?t:t.transitionProps,i=Array.isArray(t)?{}:t;i.transitionProps=Array.isArray(e)?{compare:e,required:e}:e||{compare:g_t,required:y_t},super(i.transitionProps),cat(this,"opts",void 0),this.opts=i}initializeProps(t,e){const i=super.initializeProps(t,e),{makeViewport:n,around:r}=this.opts;if(n&&r){const o=n(t),s=n(e),a=o.unproject(r);i.start.around=r,Object.assign(i.end,{around:s.project(a),aroundPosition:a,width:e.width,height:e.height})}return i}interpolateProps(t,e,i){const n={};for(const r of this._propsToExtract)n[r]=Wft(t[r]||0,e[r]||0,i);if(e.aroundPosition&&this.opts.makeViewport){const r=this.opts.makeViewport({...e,...n});Object.assign(n,r.panByPosition(e.aroundPosition,Wft(t.around,e.around,i)))}return n}}const __t={transitionDuration:0},x_t=t=>1-(1-t)*(1-t),b_t=["wheel"],w_t=["panstart","panmove","panend"],A_t=["pinchstart","pinchmove","pinchend"],E_t=["tripanstart","tripanmove","tripanend"],S_t=["doubletap"],M_t=["keydown"],T_t={};class I_t{constructor(t){cat(this,"props",void 0),cat(this,"state",{}),cat(this,"transitionManager",void 0),cat(this,"eventManager",void 0),cat(this,"onViewStateChange",void 0),cat(this,"onStateChange",void 0),cat(this,"makeViewport",void 0),cat(this,"_controllerState",void 0),cat(this,"_events",{}),cat(this,"_interactionState",{isDragging:!1}),cat(this,"_customEvents",[]),cat(this,"_eventStartBlocked",null),cat(this,"_panMove",!1),cat(this,"invertPan",!1),cat(this,"dragMode","rotate"),cat(this,"inertia",0),cat(this,"scrollZoom",!0),cat(this,"dragPan",!0),cat(this,"dragRotate",!0),cat(this,"doubleClickZoom",!0),cat(this,"touchZoom",!0),cat(this,"touchRotate",!1),cat(this,"keyboard",!0),this.transitionManager=new f_t({...t,getControllerState:t=>new this.ControllerState(t),onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}),this.handleEvent=this.handleEvent.bind(this),this.eventManager=t.eventManager,this.onViewStateChange=t.onViewStateChange||(()=>{}),this.onStateChange=t.onStateChange||(()=>{}),this.makeViewport=t.makeViewport}set events(t){this.toggleEvents(this._customEvents,!1),this.toggleEvents(t,!0),this._customEvents=t,this.props&&this.setProps(this.props)}finalize(){for(const e in this._events){var t;if(this._events[e])null===(t=this.eventManager)||void 0===t||t.off(e,this.handleEvent)}this.transitionManager.finalize()}handleEvent(t){this._controllerState=void 0;const e=this._eventStartBlocked;switch(t.type){case"panstart":return!e&&this._onPanStart(t);case"panmove":return this._onPan(t);case"panend":return this._onPanEnd(t);case"pinchstart":return!e&&this._onPinchStart(t);case"pinchmove":return this._onPinch(t);case"pinchend":return this._onPinchEnd(t);case"tripanstart":return!e&&this._onTriplePanStart(t);case"tripanmove":return this._onTriplePan(t);case"tripanend":return this._onTriplePanEnd(t);case"doubletap":return this._onDoubleTap(t);case"wheel":return this._onWheel(t);case"keydown":return this._onKeyDown(t);default:return!1}}get controllerState(){return this._controllerState=this._controllerState||new this.ControllerState({makeViewport:this.makeViewport,...this.props,...this.state}),this._controllerState}getCenter(t){const{x:e,y:i}=this.props,{offsetCenter:n}=t;return[n.x-e,n.y-i]}isPointInBounds(t,e){const{width:i,height:n}=this.props;if(e&&e.handled)return!1;const r=t[0]>=0&&t[0]<=i&&t[1]>=0&&t[1]<=n;return r&&e&&e.stopPropagation(),r}isFunctionKeyPressed(t){const{srcEvent:e}=t;return Boolean(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}isDragging(){return this._interactionState.isDragging||!1}blockEvents(t){const e=setTimeout((()=>{this._eventStartBlocked===e&&(this._eventStartBlocked=null)}),t);this._eventStartBlocked=e}setProps(t){t.dragMode&&(this.dragMode=t.dragMode),this.props=t,"transitionInterpolator"in t||(t.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(t);const{inertia:e}=t;this.inertia=Number.isFinite(e)?e:!0===e?300:0;const{scrollZoom:i=!0,dragPan:n=!0,dragRotate:r=!0,doubleClickZoom:o=!0,touchZoom:s=!0,touchRotate:a=!1,keyboard:l=!0}=t,c=Boolean(this.onViewStateChange);this.toggleEvents(b_t,c&&i),this.toggleEvents(w_t,c),this.toggleEvents(A_t,c&&(s||a)),this.toggleEvents(E_t,c&&a),this.toggleEvents(S_t,c&&o),this.toggleEvents(M_t,c&&l),this.scrollZoom=i,this.dragPan=n,this.dragRotate=r,this.doubleClickZoom=o,this.touchZoom=s,this.touchRotate=a,this.keyboard=l}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(t,e){this.eventManager&&t.forEach((t=>{this._events[t]!==e&&(this._events[t]=e,e?this.eventManager.on(t,this.handleEvent):this.eventManager.off(t,this.handleEvent))}))}updateViewport(t,e=null,i={}){const n={...t.getViewportProps(),...e},r=this.controllerState!==t;if(this.state=t.getState(),this._setInteractionState(i),r){const t=this.controllerState&&this.controllerState.getViewportProps();this.onViewStateChange&&this.onViewStateChange({viewState:n,interactionState:this._interactionState,oldViewState:t})}}_onTransition(t){this.onViewStateChange({...t,interactionState:this._interactionState})}_setInteractionState(t){Object.assign(this._interactionState,t),this.onStateChange(this._interactionState)}_onPanStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;let i=this.isFunctionKeyPressed(t)||t.rightButton||!1;(this.invertPan||"pan"===this.dragMode)&&(i=!i);const n=this.controllerState[i?"panStart":"rotateStart"]({pos:e});return this._panMove=i,this.updateViewport(n,__t,{isDragging:!0}),!0}_onPan(t){return!!this.isDragging()&&(this._panMove?this._onPanMove(t):this._onPanRotate(t))}_onPanEnd(t){return!!this.isDragging()&&(this._panMove?this._onPanMoveEnd(t):this._onPanRotateEnd(t))}_onPanMove(t){if(!this.dragPan)return!1;const e=this.getCenter(t),i=this.controllerState.pan({pos:e});return this.updateViewport(i,__t,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(t){const{inertia:e}=this;if(this.dragPan&&e&&t.velocity){const i=this.getCenter(t),n=[i[0]+t.velocityX*e/2,i[1]+t.velocityY*e/2],r=this.controllerState.pan({pos:n}).panEnd();this.updateViewport(r,{...this._getTransitionProps(),transitionDuration:e,transitionEasing:x_t},{isDragging:!1,isPanning:!0})}else{const t=this.controllerState.panEnd();this.updateViewport(t,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(t){if(!this.dragRotate)return!1;const e=this.getCenter(t),i=this.controllerState.rotate({pos:e});return this.updateViewport(i,__t,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(t){const{inertia:e}=this;if(this.dragRotate&&e&&t.velocity){const i=this.getCenter(t),n=[i[0]+t.velocityX*e/2,i[1]+t.velocityY*e/2],r=this.controllerState.rotate({pos:n}).rotateEnd();this.updateViewport(r,{...this._getTransitionProps(),transitionDuration:e,transitionEasing:x_t},{isDragging:!1,isRotating:!0})}else{const t=this.controllerState.rotateEnd();this.updateViewport(t,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(t){if(!this.scrollZoom)return!1;const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;t.srcEvent.preventDefault();const{speed:i=.01,smooth:n=!1}=!0===this.scrollZoom?{}:this.scrollZoom,{delta:r}=t;let o=2/(1+Math.exp(-Math.abs(r*i)));r<0&&0!==o&&(o=1/o);const s=this.controllerState.zoom({pos:e,scale:o});return this.updateViewport(s,{...this._getTransitionProps({around:e}),transitionDuration:n?250:1},{isZooming:!0,isPanning:!0}),!0}_onTriplePanStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const i=this.controllerState.rotateStart({pos:e});return this.updateViewport(i,__t,{isDragging:!0}),!0}_onTriplePan(t){if(!this.touchRotate)return!1;if(!this.isDragging())return!1;const e=this.getCenter(t);e[0]-=t.deltaX;const i=this.controllerState.rotate({pos:e});return this.updateViewport(i,__t,{isDragging:!0,isRotating:!0}),!0}_onTriplePanEnd(t){if(!this.isDragging())return!1;const{inertia:e}=this;if(this.touchRotate&&e&&t.velocityY){const i=this.getCenter(t),n=[i[0],i[1]+=t.velocityY*e/2],r=this.controllerState.rotate({pos:n});this.updateViewport(r,{...this._getTransitionProps(),transitionDuration:e,transitionEasing:x_t},{isDragging:!1,isRotating:!0}),this.blockEvents(e)}else{const t=this.controllerState.rotateEnd();this.updateViewport(t,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const i=this.controllerState.zoomStart({pos:e}).rotateStart({pos:e});return T_t._startPinchRotation=t.rotation,T_t._lastPinchEvent=t,this.updateViewport(i,__t,{isDragging:!0}),!0}_onPinch(t){if(!this.touchZoom&&!this.touchRotate)return!1;if(!this.isDragging())return!1;let e=this.controllerState;if(this.touchZoom){const{scale:i}=t,n=this.getCenter(t);e=e.zoom({pos:n,scale:i})}if(this.touchRotate){const{rotation:i}=t;e=e.rotate({deltaAngleX:T_t._startPinchRotation-i})}return this.updateViewport(e,__t,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),T_t._lastPinchEvent=t,!0}_onPinchEnd(t){if(!this.isDragging())return!1;const{inertia:e}=this,{_lastPinchEvent:i}=T_t;if(this.touchZoom&&e&&i&&t.scale!==i.scale){const n=this.getCenter(t);let r=this.controllerState.rotateEnd();const o=Math.log2(t.scale),s=(o-Math.log2(i.scale))/(t.deltaTime-i.deltaTime),a=Math.pow(2,o+s*e/2);r=r.zoom({pos:n,scale:a}).zoomEnd(),this.updateViewport(r,{...this._getTransitionProps({around:n}),transitionDuration:e,transitionEasing:x_t},{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(e)}else{const t=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return T_t._startPinchRotation=null,T_t._lastPinchEvent=null,!0}_onDoubleTap(t){if(!this.doubleClickZoom)return!1;const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const i=this.isFunctionKeyPressed(t),n=this.controllerState.zoom({pos:e,scale:i?.5:2});return this.updateViewport(n,this._getTransitionProps({around:e}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(t){if(!this.keyboard)return!1;const e=this.isFunctionKeyPressed(t),{zoomSpeed:i,moveSpeed:n,rotateSpeedX:r,rotateSpeedY:o}=!0===this.keyboard?{}:this.keyboard,{controllerState:s}=this;let a;const l={};switch(t.srcEvent.code){case"Minus":a=e?s.zoomOut(i).zoomOut(i):s.zoomOut(i),l.isZooming=!0;break;case"Equal":a=e?s.zoomIn(i).zoomIn(i):s.zoomIn(i),l.isZooming=!0;break;case"ArrowLeft":e?(a=s.rotateLeft(r),l.isRotating=!0):(a=s.moveLeft(n),l.isPanning=!0);break;case"ArrowRight":e?(a=s.rotateRight(r),l.isRotating=!0):(a=s.moveRight(n),l.isPanning=!0);break;case"ArrowUp":e?(a=s.rotateUp(o),l.isRotating=!0):(a=s.moveUp(n),l.isPanning=!0);break;case"ArrowDown":e?(a=s.rotateDown(o),l.isRotating=!0):(a=s.moveDown(n),l.isPanning=!0);break;default:return!1}return this.updateViewport(a,this._getTransitionProps(),l),!0}_getTransitionProps(t){const{transition:e}=this;return e&&e.transitionInterpolator?t?{...e,transitionInterpolator:new v_t({...t,...e.transitionInterpolator.opts,makeViewport:this.controllerState.makeViewport})}:e:__t}}class C_t{constructor(t,e){cat(this,"_viewportProps",void 0),cat(this,"_state",void 0),this._viewportProps=this.applyConstraints(t),this._state=e}getViewportProps(){return this._viewportProps}getState(){return this._state}}class P_t extends C_t{constructor(t){const{width:e,height:i,latitude:n,longitude:r,zoom:o,bearing:s=0,pitch:a=0,altitude:l=1.5,position:c=[0,0,0],maxZoom:u=20,minZoom:h=0,maxPitch:p=60,minPitch:d=0,startPanLngLat:f,startZoomLngLat:m,startRotatePos:g,startBearing:y,startPitch:v,startZoom:_,normalize:x=!0}=t;s_t(Number.isFinite(r)),s_t(Number.isFinite(n)),s_t(Number.isFinite(o)),super({width:e,height:i,latitude:n,longitude:r,zoom:o,bearing:s,pitch:a,altitude:l,maxZoom:u,minZoom:h,maxPitch:p,minPitch:d,normalize:x,position:c},{startPanLngLat:f,startZoomLngLat:m,startRotatePos:g,startBearing:y,startPitch:v,startZoom:_}),cat(this,"makeViewport",void 0),this.makeViewport=t.makeViewport}panStart({pos:t}){return this._getUpdatedState({startPanLngLat:this._unproject(t)})}pan({pos:t,startPos:e}){const i=this.getState().startPanLngLat||this._unproject(e);if(!i)return this;const n=this.makeViewport(this.getViewportProps()).panByPosition(i,t);return this._getUpdatedState(n)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart({pos:t}){return this._getUpdatedState({startRotatePos:t,startBearing:this.getViewportProps().bearing,startPitch:this.getViewportProps().pitch})}rotate({pos:t,deltaAngleX:e=0,deltaAngleY:i=0}){const{startRotatePos:n,startBearing:r,startPitch:o}=this.getState();if(!n||void 0===r||void 0===o)return this;let s;return s=t?this._getNewRotation(t,n,o,r):{bearing:r+e,pitch:o+i},this._getUpdatedState(s)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart({pos:t}){return this._getUpdatedState({startZoomLngLat:this._unproject(t),startZoom:this.getViewportProps().zoom})}zoom({pos:t,startPos:e,scale:i}){let{startZoom:n,startZoomLngLat:r}=this.getState();if(r||(n=this.getViewportProps().zoom,r=this._unproject(e)||this._unproject(t)),!r)return this;const{maxZoom:o,minZoom:s}=this.getViewportProps();let a=n+Math.log2(i);a=Hft(a,s,o);const l=this.makeViewport({...this.getViewportProps(),zoom:a});return this._getUpdatedState({zoom:a,...l.panByPosition(r,t)})}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(t=2){return this._zoomFromCenter(t)}zoomOut(t=2){return this._zoomFromCenter(1/t)}moveLeft(t=100){return this._panFromCenter([t,0])}moveRight(t=100){return this._panFromCenter([-t,0])}moveUp(t=100){return this._panFromCenter([0,t])}moveDown(t=100){return this._panFromCenter([0,-t])}rotateLeft(t=15){return this._getUpdatedState({bearing:this.getViewportProps().bearing-t})}rotateRight(t=15){return this._getUpdatedState({bearing:this.getViewportProps().bearing+t})}rotateUp(t=10){return this._getUpdatedState({pitch:this.getViewportProps().pitch+t})}rotateDown(t=10){return this._getUpdatedState({pitch:this.getViewportProps().pitch-t})}shortestPathFrom(t){const e=t.getViewportProps(),i={...this.getViewportProps()},{bearing:n,longitude:r}=i;return Math.abs(n-e.bearing)>180&&(i.bearing=n<0?n+360:n-360),Math.abs(r-e.longitude)>180&&(i.longitude=r<0?r+360:r-360),i}applyConstraints(t){const{maxZoom:e,minZoom:i,zoom:n}=t;t.zoom=Hft(n,i,e);const{maxPitch:r,minPitch:o,pitch:s}=t;t.pitch=Hft(s,o,r);const{normalize:a=!0}=t;return a&&Object.assign(t,function(t){const{width:e,height:i,pitch:n=0}=t;let{longitude:r,latitude:o,zoom:s,bearing:a=0}=t;(r<-180||r>180)&&(r=Dyt(r+180,360)-180),(a<-180||a>180)&&(a=Dyt(a+180,360)-180);const l=Oyt(i/512);if(s<=l)s=l,o=0;else{const t=i/2/Math.pow(2,s),e=Wyt([0,t])[1];if(o<e)o=e;else{const e=Wyt([0,512-t])[1];o>e&&(o=e)}}return{width:e,height:i,longitude:r,latitude:o,zoom:s,pitch:n,bearing:a}}(t)),t}_zoomFromCenter(t){const{width:e,height:i}=this.getViewportProps();return this.zoom({pos:[e/2,i/2],scale:t})}_panFromCenter(t){const{width:e,height:i}=this.getViewportProps();return this.pan({startPos:[e/2,i/2],pos:[e/2+t[0],i/2+t[1]]})}_getUpdatedState(t){return new this.constructor({makeViewport:this.makeViewport,...this.getViewportProps(),...this.getState(),...t})}_unproject(t){const e=this.makeViewport(this.getViewportProps());return t&&e.unproject(t)}_getNewRotation(t,e,i,n){const r=t[0]-e[0],o=t[1]-e[1],s=t[1],a=e[1],{width:l,height:c}=this.getViewportProps(),u=r/l;let h=0;o>0?Math.abs(c-a)>5&&(h=o/(a-c)*1.2):o<0&&a>5&&(h=1-s/a),h=Hft(h,-1,1);const{minPitch:p,maxPitch:d}=this.getViewportProps();let f=i;return h>0?f=i+h*(d-i):h<0&&(f=i-h*(p-i)),{pitch:f,bearing:n+180*u}}}class L_t extends I_t{constructor(...t){super(...t),cat(this,"ControllerState",P_t),cat(this,"transition",{transitionDuration:300,transitionInterpolator:new v_t({transitionProps:{compare:["longitude","latitude","zoom","bearing","pitch","position"],required:["longitude","latitude","zoom"]}})}),cat(this,"dragMode","pan")}setProps(t){t.position=t.position||[0,0,0];const e=this.props;super.setProps(t);(!e||e.height!==t.height)&&this.updateViewport(new this.ControllerState({makeViewport:this.makeViewport,...t,...this.state}))}}class D_t extends a_t{get ViewportType(){return Evt}get ControllerType(){return L_t}}cat(D_t,"displayName","MapView");const R_t=new hvt;class O_t{constructor(){cat(this,"effects",void 0),cat(this,"_resolvedEffects",[]),cat(this,"_defaultEffects",[]),cat(this,"_needsRedraw",void 0),this.effects=[],this._needsRedraw="Initial render",this._setEffects([])}addDefaultEffect(t){const e=this._defaultEffects;if(!e.find((e=>e.id===t.id))){const i=e.findIndex((e=>{return i=t,(null!==(n=e.order)&&void 0!==n?n:1/0)-(null!==(r=i.order)&&void 0!==r?r:1/0)>0;var i,n,r}));i<0?e.push(t):e.splice(i,0,t),this._setEffects(this.effects)}}setProps(t){"effects"in t&&(e_t(t.effects,this.effects,1)||this._setEffects(t.effects))}needsRedraw(t={clearRedrawFlags:!1}){const e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}getEffects(){return this._resolvedEffects}_setEffects(t){const e={};for(const t of this.effects)e[t.id]=t;const i=[];for(const n of t){const t=e[n.id];t&&t!==n?t.setProps?(t.setProps(n.props),i.push(t)):(t.cleanup(),i.push(n)):i.push(n),delete e[n.id]}for(const t in e)e[t].cleanup();this.effects=i,this._resolvedEffects=i.concat(this._defaultEffects),t.some((t=>t instanceof hvt))||this._resolvedEffects.push(R_t),this._needsRedraw="effects changed"}finalize(){for(const t of this._resolvedEffects)t.cleanup();this.effects.length=0,this._resolvedEffects.length=0,this._defaultEffects.length=0}}class k_t extends hyt{shouldDrawLayer(t){const{operation:e}=t.props;return e.includes("draw")||e.includes("terrain")}}class N_t{constructor(t){cat(this,"gl",void 0),cat(this,"layerFilter",void 0),cat(this,"drawPickingColors",void 0),cat(this,"drawLayersPass",void 0),cat(this,"pickLayersPass",void 0),cat(this,"renderCount",void 0),cat(this,"_needsRedraw",void 0),cat(this,"renderBuffers",void 0),cat(this,"lastPostProcessEffect",void 0),this.gl=t,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new k_t(t),this.pickLayersPass=new Pvt(t),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(t){this.layerFilter!==t.layerFilter&&(this.layerFilter=t.layerFilter,this._needsRedraw="layerFilter changed"),this.drawPickingColors!==t.drawPickingColors&&(this.drawPickingColors=t.drawPickingColors,this._needsRedraw="drawPickingColors changed")}renderLayers(t){if(!t.viewports.length)return;const e=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass,i={layerFilter:this.layerFilter,isPicking:this.drawPickingColors,...t,target:t.target||Ppt.getDefaultFramebuffer(this.gl)};i.effects&&this._preRender(i.effects,i);const n=this.lastPostProcessEffect?this.renderBuffers[0]:i.target,r=e.render({...i,target:n});i.effects&&this._postRender(i.effects,i),this.renderCount++,yut("deckRenderer.renderLayers",this,r,t)}needsRedraw(t={clearRedrawFlags:!1}){const e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}finalize(){const{renderBuffers:t}=this;for(const e of t)e.delete();t.length=0}_preRender(t,e){this.lastPostProcessEffect=null,e.preRenderStats=e.preRenderStats||{};for(const i of t)e.preRenderStats[i.id]=i.preRender(this.gl,e),i.postRender&&(this.lastPostProcessEffect=i.id);this.lastPostProcessEffect&&this._resizeRenderBuffers()}_resizeRenderBuffers(){const{renderBuffers:t}=this;0===t.length&&t.push(new Ppt(this.gl),new Ppt(this.gl));for(const e of t)e.resize()}_postRender(t,e){const{renderBuffers:i}=this,n={...e,inputBuffer:i[0],swapBuffer:i[1],target:null};for(const r of t)if(r.postRender){if(r.id===this.lastPostProcessEffect){n.target=e.target,r.postRender(this.gl,n);break}const t=r.postRender(this.gl,n);n.inputBuffer=t,n.swapBuffer=t===i[0]?i[1]:i[0]}}}const B_t={pickedColor:null,pickedObjectIndex:-1};function z_t({pickedColors:t,decodePickingColor:e,deviceX:i,deviceY:n,deviceRadius:r,deviceRect:o}){const{x:s,y:a,width:l,height:c}=o;let u=r*r,h=-1,p=0;for(let e=0;e<c;e++){const r=e+a-n,o=r*r;if(o>u)p+=4*l;else for(let e=0;e<l;e++){if(t[p+3]-1>=0){const t=e+s-i,n=t*t+o;n<=u&&(u=n,h=p)}p+=4}}if(h>=0){const i=t.slice(h,h+4),n=e(i);if(n){const t=Math.floor(h/4/l),e=h/4-t*l;return{...n,pickedColor:i,pickedX:s+e,pickedY:a+t}}dut.error("Picked non-existent layer. Is picking buffer corrupt?")()}return B_t}function F_t({pickInfo:t,viewports:e,pixelRatio:i,x:n,y:r,z:o}){let s,a=e[0];if(e.length>1&&(a=function(t,e){for(let i=t.length-1;i>=0;i--){const n=t[i];if(n.containsPixel(e))return n}return t[0]}((null==t?void 0:t.pickedViewports)||e,{x:n,y:r})),a){const t=[n-a.x,r-a.y];void 0!==o&&(t[2]=o),s=a.unproject(t)}return{color:null,layer:null,viewport:a,index:-1,picked:!1,x:n,y:r,pixel:[n,r],coordinate:s,devicePixel:t&&"pickedX"in t?[t.pickedX,t.pickedY]:void 0,pixelRatio:i}}function V_t(t){const{pickInfo:e,lastPickedInfo:i,mode:n,layers:r}=t,{pickedColor:o,pickedLayer:s,pickedObjectIndex:a}=e,l=s?[s]:[];if("hover"===n){const t=i.index,e=i.layerId,n=s?s.props.id:null;if(n!==e||a!==t){if(n!==e){const t=r.find((t=>t.props.id===e));t&&l.unshift(t)}i.layerId=n,i.index=a,i.info=null}}const c=F_t(t),u=new Map;return u.set(null,c),l.forEach((t=>{let e={...c};t===s&&(e.color=o,e.index=a,e.picked=!0),e=U_t({layer:t,info:e,mode:n});const r=e.layer;t===s&&"hover"===n&&(i.info=e),u.set(r.id,e),"hover"===n&&r.updateAutoHighlight(e)})),u}function U_t({layer:t,info:e,mode:i}){for(;t&&e;){const n=e.layer||null;e.sourceLayer=n,e.layer=t,e=t.getPickingInfo({info:e,mode:i,sourceLayer:n}),t=t.parent}return e}class G_t{constructor(t){cat(this,"gl",void 0),cat(this,"pickingFBO",void 0),cat(this,"depthFBO",void 0),cat(this,"pickLayersPass",void 0),cat(this,"layerFilter",void 0),cat(this,"lastPickedInfo",void 0),cat(this,"_pickable",!0),this.gl=t,this.pickLayersPass=new Pvt(t),this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(t){"layerFilter"in t&&(this.layerFilter=t.layerFilter),"_pickable"in t&&(this._pickable=t._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.delete(),this.depthFBO&&(this.depthFBO.color.delete(),this.depthFBO.delete())}pickObject(t){return this._pickClosestObject(t)}pickObjects(t){return this._pickVisibleObjects(t)}getLastPickedObject({x:t,y:e,layers:i,viewports:n},r=this.lastPickedInfo.info){const o=r&&r.layer&&r.layer.id,s=r&&r.viewport&&r.viewport.id,a=o?i.find((t=>t.id===o)):null,l=s&&n.find((t=>t.id===s))||n[0],c=l&&l.unproject([t-l.x,e-l.y]),u={x:t,y:e,viewport:l,coordinate:c,layer:a};return{...r,...u}}_resizeBuffer(){var t,e;const{gl:i}=this;if(!this.pickingFBO&&(this.pickingFBO=new Ppt(i),Ppt.isSupported(i,{colorBufferFloat:!0}))){const t=new Ppt(i);t.attach({36064:new tpt(i,{format:Iut(i)?34836:6408,type:5126})}),this.depthFBO=t}null===(t=this.pickingFBO)||void 0===t||t.resize({width:i.canvas.width,height:i.canvas.height}),null===(e=this.depthFBO)||void 0===e||e.resize({width:i.canvas.width,height:i.canvas.height})}_getPickable(t){if(!1===this._pickable)return null;const e=t.filter((t=>this.pickLayersPass.shouldDrawLayer(t)&&!t.isComposite));return e.length?e:null}_pickClosestObject({layers:t,views:e,viewports:i,x:n,y:r,radius:o=0,depth:s=1,mode:a="query",unproject3D:l,onViewportActive:c,effects:u}){const h=this._getPickable(t),p=hht(this.gl);if(!h)return{result:[],emptyInfo:F_t({viewports:i,x:n,y:r,pixelRatio:p})};this._resizeBuffer();const d=pht(this.gl,[n,r],!0),f=[d.x+Math.floor(d.width/2),d.y+Math.floor(d.height/2)],m=Math.round(o*p),{width:g,height:y}=this.pickingFBO,v=this._getPickingRect({deviceX:f[0],deviceY:f[1],deviceRadius:m,deviceWidth:g,deviceHeight:y}),_={x:n-o,y:r-o,width:2*o+1,height:2*o+1};let x;const b=[],w=new Set;for(let t=0;t<s;t++){let o,d;if(v){o=z_t({...this._drawAndSample({layers:h,views:e,viewports:i,onViewportActive:c,deviceRect:v,cullRect:_,effects:u,pass:"picking:".concat(a)}),deviceX:f[0],deviceY:f[1],deviceRadius:m,deviceRect:v})}else o={pickedColor:null,pickedObjectIndex:-1};if(o.pickedLayer&&l&&this.depthFBO){const{pickedColors:t}=this._drawAndSample({layers:[o.pickedLayer],views:e,viewports:i,onViewportActive:c,deviceRect:{x:o.pickedX,y:o.pickedY,width:1,height:1},cullRect:_,effects:u,pass:"picking:".concat(a,":z")},!0);t[3]&&(d=t[0])}o.pickedLayer&&t+1<s&&(w.add(o.pickedLayer),o.pickedLayer.disablePickingIndex(o.pickedObjectIndex)),x=V_t({pickInfo:o,lastPickedInfo:this.lastPickedInfo,mode:a,layers:h,viewports:i,x:n,y:r,z:d,pixelRatio:p});for(const t of x.values())t.layer&&b.push(t);if(!o.pickedColor)break}for(const t of w)t.restorePickingColors();return{result:b,emptyInfo:x.get(null)}}_pickVisibleObjects({layers:t,views:e,viewports:i,x:n,y:r,width:o=1,height:s=1,mode:a="query",maxObjects:l=null,onViewportActive:c,effects:u}){const h=this._getPickable(t);if(!h)return[];this._resizeBuffer();const p=hht(this.gl),d=pht(this.gl,[n,r],!0),f=d.x,m=d.y+d.height,g=pht(this.gl,[n+o,r+s],!0),y=g.x+g.width,v=g.y,_={x:f,y:v,width:y-f,height:m-v},x=function({pickedColors:t,decodePickingColor:e}){const i=new Map;if(t)for(let n=0;n<t.length;n+=4)if(t[n+3]-1>=0){const r=t.slice(n,n+4),o=r.join(",");if(!i.has(o)){const t=e(r);t?i.set(o,{...t,color:r}):dut.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return Array.from(i.values())}(this._drawAndSample({layers:h,views:e,viewports:i,onViewportActive:c,deviceRect:_,cullRect:{x:n,y:r,width:o,height:s},effects:u,pass:"picking:".concat(a)})),b=new Map,w=Number.isFinite(l);for(let t=0;t<x.length;t++){var A;if(w&&l&&b.size>=l)break;const e=x[t];let i={color:e.pickedColor,layer:null,index:e.pickedObjectIndex,picked:!0,x:n,y:r,pixelRatio:p};i=U_t({layer:e.pickedLayer,info:i,mode:a});const o=null!==(A=i.object)&&void 0!==A?A:"".concat(i.layer.id,"[").concat(i.index,"]");b.has(o)||b.set(o,i)}return Array.from(b.values())}_drawAndSample({layers:t,views:e,viewports:i,onViewportActive:n,deviceRect:r,cullRect:o,effects:s,pass:a},l=!1){const c=l?this.depthFBO:this.pickingFBO,u={layers:t,layerFilter:this.layerFilter,views:e,viewports:i,onViewportActive:n,pickingFBO:c,deviceRect:r,cullRect:o,effects:s,pass:a,pickZ:l,preRenderStats:{}};for(const t of s)t.useInPicking&&(u.preRenderStats[t.id]=t.preRender(this.gl,u));const{decodePickingColor:h}=this.pickLayersPass.render(u),{x:p,y:d,width:f,height:m}=r,g=new(l?Float32Array:Uint8Array)(f*m*4);return hpt(c,{sourceX:p,sourceY:d,sourceWidth:f,sourceHeight:m,target:g}),{pickedColors:g,decodePickingColor:h}}_getPickingRect({deviceX:t,deviceY:e,deviceRadius:i,deviceWidth:n,deviceHeight:r}){const o=Math.max(0,t-i),s=Math.max(0,e-i),a=Math.min(n,t+i+1)-o,l=Math.min(r,e+i+1)-s;return a<=0||l<=0?null:{x:o,y:s,width:a,height:l}}}const j_t={zIndex:"1",position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:"0",left:"0",display:"none"};class H_t{constructor(t){cat(this,"el",null),cat(this,"isVisible",!1);const e=t.parentElement;e&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,j_t),e.appendChild(this.el))}setTooltip(t,e,i){const n=this.el;if(n){if("string"==typeof t)n.innerText=t;else{if(!t)return this.isVisible=!1,void(n.style.display="none");t.text&&(n.innerText=t.text),t.html&&(n.innerHTML=t.html),t.className&&(n.className=t.className)}this.isVisible=!0,n.style.display="block",n.style.transform="translate(".concat(e,"px, ").concat(i,"px)"),t&&"object"==typeof t&&"style"in t&&Object.assign(n.style,t.style)}}remove(){this.el&&(this.el.remove(),this.el=null)}}const W_t=class{constructor(){this.get=()=>null,this.set=()=>this,this.on=()=>this,this.off=()=>this,this.destroy=()=>this,this.emit=()=>this}};class q_t{constructor(t,e,i){this.element=t,this.callback=e,this.options={enable:!0,...i}}}const X_t={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},Z_t={doubletap:["tap"]},Y_t={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},Q_t={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},J_t={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},K_t={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},$_t="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",txt="undefined"!=typeof window?window:global;let ext=!1;try{const t={get passive(){return ext=!0,!0}};txt.addEventListener("test",null,t),txt.removeEventListener("test",null)}catch(t){ext=!1}const ixt=-1!==$_t.indexOf("firefox"),{WHEEL_EVENTS:nxt}=Q_t,rxt="wheel",oxt=4.000244140625;class sxt extends q_t{constructor(t,e,i){super(t,e,i),this.handleEvent=t=>{if(!this.options.enable)return;let e=t.deltaY;txt.WheelEvent&&(ixt&&t.deltaMode===txt.WheelEvent.DOM_DELTA_PIXEL&&(e/=txt.devicePixelRatio),t.deltaMode===txt.WheelEvent.DOM_DELTA_LINE&&(e*=40)),0!==e&&e%oxt==0&&(e=Math.floor(e/oxt)),t.shiftKey&&e&&(e*=.25),this.callback({type:rxt,center:{x:t.clientX,y:t.clientY},delta:-e,srcEvent:t,pointerType:"mouse",target:t.target})},this.events=(this.options.events||[]).concat(nxt),this.events.forEach((e=>t.addEventListener(e,this.handleEvent,!!ext&&{passive:!1})))}destroy(){this.events.forEach((t=>this.element.removeEventListener(t,this.handleEvent)))}enableEventType(t,e){t===rxt&&(this.options.enable=e)}}const{MOUSE_EVENTS:axt}=Q_t,lxt="pointermove",cxt="pointerover",uxt="pointerout",hxt="pointerenter",pxt="pointerleave";class dxt extends q_t{constructor(t,e,i){super(t,e,i),this.handleEvent=t=>{this.handleOverEvent(t),this.handleOutEvent(t),this.handleEnterEvent(t),this.handleLeaveEvent(t),this.handleMoveEvent(t)},this.pressed=!1;const{enable:n}=this.options;this.enableMoveEvent=n,this.enableLeaveEvent=n,this.enableEnterEvent=n,this.enableOutEvent=n,this.enableOverEvent=n,this.events=(this.options.events||[]).concat(axt),this.events.forEach((e=>t.addEventListener(e,this.handleEvent)))}destroy(){this.events.forEach((t=>this.element.removeEventListener(t,this.handleEvent)))}enableEventType(t,e){t===lxt&&(this.enableMoveEvent=e),t===cxt&&(this.enableOverEvent=e),t===uxt&&(this.enableOutEvent=e),t===hxt&&(this.enableEnterEvent=e),t===pxt&&(this.enableLeaveEvent=e)}handleOverEvent(t){this.enableOverEvent&&"mouseover"===t.type&&this._emit(cxt,t)}handleOutEvent(t){this.enableOutEvent&&"mouseout"===t.type&&this._emit(uxt,t)}handleEnterEvent(t){this.enableEnterEvent&&"mouseenter"===t.type&&this._emit(hxt,t)}handleLeaveEvent(t){this.enableLeaveEvent&&"mouseleave"===t.type&&this._emit(pxt,t)}handleMoveEvent(t){if(this.enableMoveEvent)switch(t.type){case"mousedown":t.button>=0&&(this.pressed=!0);break;case"mousemove":0===t.which&&(this.pressed=!1),this.pressed||this._emit(lxt,t);break;case"mouseup":this.pressed=!1}}_emit(t,e){this.callback({type:t,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const{KEY_EVENTS:fxt}=Q_t,mxt="keydown",gxt="keyup";class yxt extends q_t{constructor(t,e,i){super(t,e,i),this.handleEvent=t=>{const e=t.target||t.srcElement;"INPUT"===e.tagName&&"text"===e.type||"TEXTAREA"===e.tagName||(this.enableDownEvent&&"keydown"===t.type&&this.callback({type:mxt,srcEvent:t,key:t.key,target:t.target}),this.enableUpEvent&&"keyup"===t.type&&this.callback({type:gxt,srcEvent:t,key:t.key,target:t.target}))},this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=(this.options.events||[]).concat(fxt),t.tabIndex=this.options.tabIndex||0,t.style.outline="none",this.events.forEach((e=>t.addEventListener(e,this.handleEvent)))}destroy(){this.events.forEach((t=>this.element.removeEventListener(t,this.handleEvent)))}enableEventType(t,e){t===mxt&&(this.enableDownEvent=e),t===gxt&&(this.enableUpEvent=e)}}const vxt="contextmenu";class _xt extends q_t{constructor(t,e,i){super(t,e,i),this.handleEvent=t=>{this.options.enable&&this.callback({type:vxt,center:{x:t.clientX,y:t.clientY},srcEvent:t,pointerType:"mouse",target:t.target})},t.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(t,e){t===vxt&&(this.options.enable=e)}}const xxt={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4};function bxt(t){const e=xxt[t.srcEvent.type];if(!e)return null;const{buttons:i,button:n,which:r}=t.srcEvent;let o=!1,s=!1,a=!1;return 4===e||2===e&&!Number.isFinite(i)?(o=1===r,s=2===r,a=3===r):2===e?(o=Boolean(1&i),s=Boolean(4&i),a=Boolean(2&i)):1===e&&(o=0===n,s=1===n,a=2===n),{leftButton:o,middleButton:s,rightButton:a}}function wxt(t,e){const i=t.center;if(!i)return null;const n=e.getBoundingClientRect(),r=n.width/e.offsetWidth||1,o=n.height/e.offsetHeight||1;return{center:i,offsetCenter:{x:(i.x-n.left-e.clientLeft)/r,y:(i.y-n.top-e.clientTop)/o}}}const Axt={srcElement:"root",priority:0};class Ext{constructor(t){this.handleEvent=t=>{if(this.isEmpty())return;const e=this._normalizeEvent(t);let i=t.srcEvent.target;for(;i&&i!==e.rootElement;){if(this._emit(e,i),e.handled)return;i=i.parentNode}this._emit(e,"root")},this.eventManager=t,this.handlers=[],this.handlersByElement=new Map,this._active=!1}isEmpty(){return!this._active}add(t,e,i,n=!1,r=!1){const{handlers:o,handlersByElement:s}=this;let a=Axt;"string"==typeof i||i&&i.addEventListener?a={...Axt,srcElement:i}:i&&(a={...Axt,...i});let l=s.get(a.srcElement);l||(l=[],s.set(a.srcElement,l));const c={type:t,handler:e,srcElement:a.srcElement,priority:a.priority};n&&(c.once=!0),r&&(c.passive=!0),o.push(c),this._active=this._active||!c.passive;let u=l.length-1;for(;u>=0&&!(l[u].priority>=c.priority);)u--;l.splice(u+1,0,c)}remove(t,e){const{handlers:i,handlersByElement:n}=this;for(let r=i.length-1;r>=0;r--){const o=i[r];if(o.type===t&&o.handler===e){i.splice(r,1);const t=n.get(o.srcElement);t.splice(t.indexOf(o),1),0===t.length&&n.delete(o.srcElement)}}this._active=i.some((t=>!t.passive))}_emit(t,e){const i=this.handlersByElement.get(e);if(i){let e=!1;const n=()=>{t.handled=!0},r=()=>{t.handled=!0,e=!0},o=[];for(let s=0;s<i.length;s++){const{type:a,handler:l,once:c}=i[s];if(l({...t,type:a,stopPropagation:n,stopImmediatePropagation:r}),c&&o.push(i[s]),e)break}for(let t=0;t<o.length;t++){const{type:e,handler:i}=o[t];this.remove(e,i)}}}_normalizeEvent(t){const e=this.eventManager.getElement();return{...t,...bxt(t),...wxt(t,e),preventDefault:()=>{t.srcEvent.preventDefault()},stopImmediatePropagation:null,stopPropagation:null,handled:!1,rootElement:e}}}const Sxt={events:null,recognizers:null,recognizerOptions:{},Manager:W_t,touchAction:"none",tabIndex:0};class Mxt{constructor(t=null,e){this._onBasicInput=t=>{const{srcEvent:e}=t,i=Y_t[e.type];i&&this.manager.emit(i,t)},this._onOtherEvent=t=>{this.manager.emit(t.type,t)},this.options={...Sxt,...e},this.events=new Map,this.setElement(t);const{events:i}=this.options;i&&this.on(i)}getElement(){return this.element}setElement(t){if(this.element&&this.destroy(),this.element=t,!t)return;const{options:e}=this,i=e.Manager;this.manager=new i(t,{touchAction:e.touchAction,recognizers:e.recognizers||null}).on("hammer.input",this._onBasicInput),e.recognizers||Object.keys(X_t).forEach((t=>{const e=this.manager.get(t);e&&X_t[t].forEach((t=>{e.recognizeWith(t)}))}));for(const t in e.recognizerOptions){const i=this.manager.get(t);if(i){const n=e.recognizerOptions[t];delete n.enable,i.set(n)}}this.wheelInput=new sxt(t,this._onOtherEvent,{enable:!1}),this.moveInput=new dxt(t,this._onOtherEvent,{enable:!1}),this.keyInput=new yxt(t,this._onOtherEvent,{enable:!1,tabIndex:e.tabIndex}),this.contextmenuInput=new _xt(t,this._onOtherEvent,{enable:!1});for(const[t,e]of this.events)e.isEmpty()||(this._toggleRecognizer(e.recognizerName,!0),this.manager.on(t,e.handleEvent))}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}on(t,e,i){this._addEventHandler(t,e,i,!1)}once(t,e,i){this._addEventHandler(t,e,i,!0)}watch(t,e,i){this._addEventHandler(t,e,i,!1,!0)}off(t,e){this._removeEventHandler(t,e)}_toggleRecognizer(t,e){const{manager:i}=this;if(!i)return;const n=i.get(t);if(n&&n.options.enable!==e){n.set({enable:e});const r=Z_t[t];r&&!this.options.recognizers&&r.forEach((r=>{const o=i.get(r);e?(o.requireFailure(t),n.dropRequireFailure(r)):o.dropRequireFailure(t)}))}this.wheelInput.enableEventType(t,e),this.moveInput.enableEventType(t,e),this.keyInput.enableEventType(t,e),this.contextmenuInput.enableEventType(t,e)}_addEventHandler(t,e,i,n,r){if("string"!=typeof t){i=e;for(const e in t)this._addEventHandler(e,t[e],i,n,r);return}const{manager:o,events:s}=this,a=K_t[t]||t;let l=s.get(a);l||(l=new Ext(this),s.set(a,l),l.recognizerName=J_t[a]||a,o&&o.on(a,l.handleEvent)),l.add(t,e,i,n,r),l.isEmpty()||this._toggleRecognizer(l.recognizerName,!0)}_removeEventHandler(t,e){if("string"!=typeof t){for(const e in t)this._removeEventHandler(e,t[e]);return}const{events:i}=this,n=K_t[t]||t,r=i.get(n);if(r&&(r.remove(t,e),r.isEmpty())){const{recognizerName:t}=r;let e=!1;for(const n of i.values())if(n.recognizerName===t&&!n.isEmpty()){e=!0;break}e||this._toggleRecognizer(t,!1)}}}function Txt(){}const Ixt={id:"",width:"100%",height:"100%",style:null,viewState:null,initialViewState:null,pickingRadius:0,layerFilter:null,glOptions:{},parameters:{},parent:null,gl:null,canvas:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},_customRender:null,onWebGLInitialized:Txt,onResize:Txt,onViewStateChange:Txt,onInteractionStateChange:Txt,onBeforeRender:Txt,onAfterRender:Txt,onLoad:Txt,onError:t=>dut.error(t.message,t.cause)(),onHover:null,onClick:null,onDragStart:null,onDrag:null,onDragEnd:null,_onMetrics:null,getCursor:({isDragging:t})=>t?"grabbing":"grab",getTooltip:null,debug:!1,drawPickingColors:!1};class Cxt{constructor(t){cat(this,"props",void 0),cat(this,"width",0),cat(this,"height",0),cat(this,"userData",{}),cat(this,"canvas",null),cat(this,"viewManager",null),cat(this,"layerManager",null),cat(this,"effectManager",null),cat(this,"deckRenderer",null),cat(this,"deckPicker",null),cat(this,"eventManager",null),cat(this,"tooltip",null),cat(this,"metrics",void 0),cat(this,"animationLoop",void 0),cat(this,"stats",void 0),cat(this,"viewState",void 0),cat(this,"cursorState",void 0),cat(this,"_needsRedraw",void 0),cat(this,"_pickRequest",void 0),cat(this,"_lastPointerDownInfo",null),cat(this,"_metricsCounter",void 0),cat(this,"_onPointerMove",(t=>{const{_pickRequest:e}=this;if("pointerleave"===t.type)e.x=-1,e.y=-1,e.radius=0;else{if(t.leftButton||t.rightButton)return;{const i=t.offsetCenter;if(!i)return;e.x=i.x,e.y=i.y,e.radius=this.props.pickingRadius}}this.layerManager&&(this.layerManager.context.mousePosition={x:e.x,y:e.y}),e.event=t})),cat(this,"_onEvent",(t=>{const e=Aut[t.type],i=t.offsetCenter;if(!e||!i||!this.layerManager)return;const n=this.layerManager.getLayers(),r=this.deckPicker.getLastPickedObject({x:i.x,y:i.y,layers:n,viewports:this.getViewports(i)},this._lastPointerDownInfo),{layer:o}=r,s=o&&(o[e.handler]||o.props[e.handler]),a=this.props[e.handler];let l=!1;s&&(l=s.call(o,r,t)),!l&&a&&a(r,t)})),cat(this,"_onPointerDown",(t=>{const e=t.offsetCenter,i=this._pick("pickObject","pickObject Time",{x:e.x,y:e.y,radius:this.props.pickingRadius});this._lastPointerDownInfo=i.result[0]||i.emptyInfo})),this.props={...Ixt,...t},t=this.props,this._needsRedraw="Initial render",this._pickRequest={mode:"hover",x:-1,y:-1,radius:0,event:null},this.cursorState={isHovering:!1,isDragging:!1},t.viewState&&t.initialViewState&&dut.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===Jct()&&dut.warn("IE 11 is not supported")(),this.viewState=t.initialViewState,t.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(t)),this.animationLoop=this._createAnimationLoop(t),this.stats=new Aht({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(t),t._typedArrayManagerProps&&pvt.setOptions(t._typedArrayManagerProps),this.animationLoop.start()}finalize(){var t,e,i,n,r,o,s,a,l;(null===(t=this.animationLoop)||void 0===t||t.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,null===(e=this.layerManager)||void 0===e||e.finalize(),this.layerManager=null,null===(i=this.viewManager)||void 0===i||i.finalize(),this.viewManager=null,null===(n=this.effectManager)||void 0===n||n.finalize(),this.effectManager=null,null===(r=this.deckRenderer)||void 0===r||r.finalize(),this.deckRenderer=null,null===(o=this.deckPicker)||void 0===o||o.finalize(),this.deckPicker=null,null===(s=this.eventManager)||void 0===s||s.destroy(),this.eventManager=null,null===(a=this.tooltip)||void 0===a||a.remove(),this.tooltip=null,this.props.canvas||this.props.gl||!this.canvas)||(null===(l=this.canvas.parentElement)||void 0===l||l.removeChild(this.canvas),this.canvas=null)}setProps(t){this.stats.get("setProps Time").timeStart(),"onLayerHover"in t&&dut.removed("onLayerHover","onHover")(),"onLayerClick"in t&&dut.removed("onLayerClick","onClick")(),t.initialViewState&&!e_t(this.props.initialViewState,t.initialViewState,3)&&(this.viewState=t.initialViewState),Object.assign(this.props,t),this._setCanvasSize(this.props);const e=Object.create(this.props);Object.assign(e,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),this.animationLoop.setProps(e),this.layerManager&&(this.viewManager.setProps(e),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(e),this.effectManager.setProps(e),this.deckRenderer.setProps(e),this.deckPicker.setProps(e)),this.stats.get("setProps Time").timeEnd()}needsRedraw(t={clearRedrawFlags:!1}){if(!this.layerManager)return!1;if(this.props._animate)return"Deck._animate";let e=this._needsRedraw;t.clearRedrawFlags&&(this._needsRedraw=!1);const i=this.viewManager.needsRedraw(t),n=this.layerManager.needsRedraw(t),r=this.effectManager.needsRedraw(t),o=this.deckRenderer.needsRedraw(t);return e=e||i||n||r||o,e}redraw(t){if(!this.layerManager)return;let e=this.needsRedraw({clearRedrawFlags:!0});e=t||e,e&&(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(e):this._drawLayers(e))}get isInitialized(){return null!==this.viewManager}getViews(){return s_t(this.viewManager),this.viewManager.views}getViewports(t){return s_t(this.viewManager),this.viewManager.getViewports(t)}getCanvas(){return this.canvas}pickObject(t){const e=this._pick("pickObject","pickObject Time",t).result;return e.length?e[0]:null}pickMultipleObjects(t){return t.depth=t.depth||10,this._pick("pickObject","pickMultipleObjects Time",t).result}pickObjects(t){return this._pick("pickObjects","pickObjects Time",t)}_addResources(t,e=!1){for(const i in t)this.layerManager.resourceManager.add({resourceId:i,data:t[i],forceUpdate:e})}_removeResources(t){for(const e of t)this.layerManager.resourceManager.remove(e)}_addDefaultEffect(t){this.effectManager.addDefaultEffect(t)}_pick(t,e,i){s_t(this.deckPicker);const{stats:n}=this;n.get("Pick Count").incrementCount(),n.get(e).timeStart();const r=this.deckPicker[t]({layers:this.layerManager.getLayers(i),views:this.viewManager.getViews(),viewports:this.getViewports(i),onViewportActive:this.layerManager.activateViewport,effects:this.effectManager.getEffects(),...i});return n.get(e).timeEnd(),r}_createCanvas(t){let e=t.canvas;if("string"==typeof e&&(e=document.getElementById(e),s_t(e)),!e){e=document.createElement("canvas"),e.id=t.id||"deckgl-overlay";(t.parent||document.body).appendChild(e)}return Object.assign(e.style,t.style),e}_setCanvasSize(t){if(!this.canvas)return;const{width:e,height:i}=t;if(e||0===e){const t=Number.isFinite(e)?"".concat(e,"px"):e;this.canvas.style.width=t}if(i||0===i){var n;const e=Number.isFinite(i)?"".concat(i,"px"):i;this.canvas.style.position=(null===(n=t.style)||void 0===n?void 0:n.position)||"absolute",this.canvas.style.height=e}}_updateCanvasSize(){var t,e;const{canvas:i}=this;if(!i)return;const n=null!==(t=i.clientWidth)&&void 0!==t?t:i.width,r=null!==(e=i.clientHeight)&&void 0!==e?e:i.height;var o,s;n===this.width&&r===this.height||(this.width=n,this.height=r,null===(o=this.viewManager)||void 0===o||o.setProps({width:n,height:r}),null===(s=this.layerManager)||void 0===s||s.activateViewport(this.getViewports()[0]),this.props.onResize({width:n,height:r}))}_createAnimationLoop(t){const{width:e,height:i,gl:n,glOptions:r,debug:o,onError:s,onBeforeRender:a,onAfterRender:l,useDevicePixels:c}=t;return new kdt({width:e,height:i,useDevicePixels:c,autoResizeDrawingBuffer:!n,autoResizeViewport:!1,gl:n,onCreateContext:t=>vht({...r,...t,canvas:this.canvas,debug:o,onContextLost:()=>this._onContextLost()}),onInitialize:t=>this._setGLContext(t.gl),onRender:this._onRenderFrame.bind(this),onBeforeRender:a,onAfterRender:l,onError:s})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){let t=this.props.views||[new D_t({id:"default-view"})];return t=Array.isArray(t)?t:[t],t.length&&this.props.controller&&(t[0].props.controller=this.props.controller),t}_onContextLost(){const{onError:t}=this.props;this.animationLoop&&t&&t(new Error("WebGL context is lost"))}_pickAndCallback(){const{_pickRequest:t}=this;if(t.event){const{result:i,emptyInfo:n}=this._pick("pickObject","pickObject Time",t);this.cursorState.isHovering=i.length>0;let r=n,o=!1;for(const n of i){var e;r=n,o=(null===(e=n.layer)||void 0===e?void 0:e.onHover(n,t.event))||o}if(!o&&this.props.onHover&&this.props.onHover(r,t.event),this.props.getTooltip&&this.tooltip){const t=this.props.getTooltip(r);this.tooltip.setTooltip(t,r.x,r.y)}t.event=null}}_updateCursor(){const t=this.props.parent||this.canvas;t&&(t.style.cursor=this.props.getCursor(this.cursorState))}_setGLContext(t){if(this.layerManager)return;this.canvas||(this.canvas=t.canvas,_ht(t,{enable:!0,copyState:!0})),this.tooltip=new H_t(this.canvas),lht(t,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(t);const e=new tyt;e.play(),this.animationLoop.attachTimeline(e),this.eventManager=new Mxt(this.props.parent||t.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(const t in Aut)this.eventManager.on(t,this._onEvent);this.viewManager=new i_t({timeline:e,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});const i=this.viewManager.getViewports()[0];this.layerManager=new t_t(t,{deck:this,stats:this.stats,viewport:i,timeline:e}),this.effectManager=new O_t,this.deckRenderer=new N_t(t),this.deckPicker=new G_t(t),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(t,e){const{gl:i}=this.layerManager.context;lht(i,this.props.parameters),this.props.onBeforeRender({gl:i}),this.deckRenderer.renderLayers({target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",effects:this.effectManager.getEffects(),...e}),this.props.onAfterRender({gl:i})}_onRenderFrame(t){this._getFrameStats(),this._metricsCounter++%60==0&&(this._getMetrics(),this.stats.reset(),dut.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.tooltip.isVisible&&this.viewManager.needsRedraw()&&this.tooltip.setTooltip(null),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(),this.viewManager&&this.viewManager.updateViewStates()}_onViewStateChange(t){const e=this.props.onViewStateChange(t)||t.viewState;this.viewState&&(this.viewState={...this.viewState,[t.viewId]:e},this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}_onInteractionStateChange(t){this.cursorState.isDragging=t.isDragging||!1,this.props.onInteractionStateChange(t)}_getFrameStats(){const{stats:t}=this;t.get("frameRate").timeEnd(),t.get("frameRate").timeStart();const e=this.animationLoop.stats;t.get("GPU Time").addTime(e.get("GPU Time").lastTiming),t.get("CPU Time").addTime(e.get("CPU Time").lastTiming)}_getMetrics(){const{metrics:t,stats:e}=this;t.fps=e.get("frameRate").getHz(),t.setPropsTime=e.get("setProps Time").time,t.updateAttributesTime=e.get("Update Attributes").time,t.framesRedrawn=e.get("Redraw Count").count,t.pickTime=e.get("pickObject Time").time+e.get("pickMultipleObjects Time").time+e.get("pickObjects Time").time,t.pickCount=e.get("Pick Count").count,t.gpuTime=e.get("GPU Time").time,t.cpuTime=e.get("CPU Time").time,t.gpuTimePerFrame=e.get("GPU Time").getAverageTime(),t.cpuTimePerFrame=e.get("CPU Time").getAverageTime();const i=Sht.get("Memory Usage");t.bufferMemory=i.get("Buffer Memory").count,t.textureMemory=i.get("Texture Memory").count,t.renderbufferMemory=i.get("Renderbuffer Memory").count,t.gpuMemory=i.get("GPU Memory").count}}cat(Cxt,"defaultProps",Ixt),cat(Cxt,"VERSION",_ut);class Pxt{constructor(t,e){cat(this,"opts",void 0),cat(this,"source",void 0),this.opts=e,this.source=t}get value(){return this.source.value}getValue(){const t=this.source.getBuffer(),e=this.getAccessor();if(t)return[t,e];const{value:i}=this.source,{size:n}=e;let r=i;if(i&&i.length!==n){r=new Float32Array(n);const t=e.elementOffset||0;for(let e=0;e<n;++e)r[e]=i[t+e]}return r}getAccessor(){return{...this.source.getAccessor(),...this.opts}}}function Lxt(t){return t.stride||t.size*t.bytesPerElement}function Dxt(t,e){e.offset&&dut.removed("shaderAttribute.offset","vertexOffset, elementOffset")();const i=Lxt(t),n=(void 0!==e.vertexOffset?e.vertexOffset:t.vertexOffset||0)*i+(e.elementOffset||0)*t.bytesPerElement+(t.offset||0);return{...e,offset:n,stride:i}}class Rxt{constructor(t,e,i){cat(this,"gl",void 0),cat(this,"id",void 0),cat(this,"size",void 0),cat(this,"settings",void 0),cat(this,"value",void 0),cat(this,"doublePrecision",void 0),cat(this,"_buffer",void 0),cat(this,"state",void 0),this.gl=t,this.id=e.id||"",this.size=e.size||1;const n=e.logicalType||e.type,r=5130===n;let o,{defaultValue:s}=e;s=Number.isFinite(s)?[s]:s||new Array(this.size).fill(0),o=r?5126:!n&&e.isIndexed?t&&Mpt(t,ypt)?5125:5123:n||5126;let a=function(t){switch(t){case 5126:return Float32Array;case 5130:return Float64Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return Uint8ClampedArray;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Unknown GL type")}}(n||o||5126);this.doublePrecision=r,r&&!1===e.fp64&&(a=Float32Array),this.value=null,this.settings={...e,defaultType:a,defaultValue:s,logicalType:n,type:o,size:this.size,bytesPerElement:a.BYTES_PER_ELEMENT},this.state={...i,externalBuffer:null,bufferAccessor:this.settings,allocatedValue:null,numInstances:0,bounds:null,constant:!1},this._buffer=null}get isConstant(){return this.state.constant}get buffer(){if(!this._buffer){const{isIndexed:t,type:e}=this.settings;this._buffer=new Xht(this.gl,{id:this.id,target:t?34963:34962,accessor:{type:e}})}return this._buffer}get byteOffset(){const t=this.getAccessor();return t.vertexOffset?t.vertexOffset*Lxt(t):0}get numInstances(){return this.state.numInstances}set numInstances(t){this.state.numInstances=t}delete(){this._buffer&&(this._buffer.delete(),this._buffer=null),pvt.release(this.state.allocatedValue)}getShaderAttributes(t,e){if(this.doublePrecision){const i={},n=this.value instanceof Float64Array,r=function(t,e){const i=Dxt(t,e);return{high:i,low:{...i,offset:i.offset+4*t.size}}}(this.getAccessor(),e||{});return i[t]=new Pxt(this,r.high),i["".concat(t,"64Low")]=n?new Pxt(this,r.low):new Float32Array(this.size),i}if(e){const i=Dxt(this.getAccessor(),e);return{[t]:new Pxt(this,i)}}return{[t]:this}}getBuffer(){return this.state.constant?null:this.state.externalBuffer||this._buffer}getValue(){return this.state.constant?this.value:[this.getBuffer(),this.getAccessor()]}getAccessor(){return this.state.bufferAccessor}getBounds(){if(this.state.bounds)return this.state.bounds;let t=null;if(this.state.constant&&this.value){const e=Array.from(this.value);t=[e,e]}else{const{value:e,numInstances:i,size:n}=this,r=i*n;if(e&&r&&e.length>=r){const i=new Array(n).fill(1/0),o=new Array(n).fill(-1/0);for(let t=0;t<r;)for(let r=0;r<n;r++){const n=e[t++];n<i[r]&&(i[r]=n),n>o[r]&&(o[r]=n)}t=[i,o]}}return this.state.bounds=t,t}setData(t){const{state:e}=this;let i;i=ArrayBuffer.isView(t)?{value:t}:t instanceof Xht?{buffer:t}:t;const n={...this.settings,...i};if(e.bufferAccessor=n,e.bounds=null,i.constant){let t=i.value;t=this._normalizeValue(t,[],0),this.settings.normalized&&(t=this.normalizeConstant(t));if(!(!e.constant||!this._areValuesEqual(t,this.value)))return!1;e.externalBuffer=null,e.constant=!0,this.value=t}else if(i.buffer){const t=i.buffer;e.externalBuffer=t,e.constant=!1,this.value=i.value||null;const r=i.value instanceof Float64Array;n.type=i.type||t.accessor.type,n.bytesPerElement=t.accessor.BYTES_PER_ELEMENT*(r?2:1),n.stride=Lxt(n)}else if(i.value){this._checkExternalBuffer(i);let t=i.value;e.externalBuffer=null,e.constant=!1,this.value=t,n.bytesPerElement=t.BYTES_PER_ELEMENT,n.stride=Lxt(n);const{buffer:r,byteOffset:o}=this;this.doublePrecision&&t instanceof Float64Array&&(t=yvt(t,n));const s=t.byteLength+o+2*n.stride;r.byteLength<s&&r.reallocate(s),r.setAccessor(null),r.subData({data:t,offset:o}),n.type=i.type||r.accessor.type}return!0}updateSubBuffer(t={}){this.state.bounds=null;const e=this.value,{startOffset:i=0,endOffset:n}=t;this.buffer.subData({data:this.doublePrecision&&e instanceof Float64Array?yvt(e,{size:this.size,startIndex:i,endIndex:n}):e.subarray(i,n),offset:i*e.BYTES_PER_ELEMENT+this.byteOffset})}allocate(t,e=!1){const{state:i}=this,n=i.allocatedValue,r=pvt.allocate(n,t+1,{size:this.size,type:this.settings.defaultType,copy:e});this.value=r;const{buffer:o,byteOffset:s}=this;return o.byteLength<r.byteLength+s&&(o.reallocate(r.byteLength+s),e&&n&&o.subData({data:n instanceof Float64Array?yvt(n,this):n,offset:s})),i.allocatedValue=r,i.constant=!1,i.externalBuffer=null,i.bufferAccessor=this.settings,!0}_checkExternalBuffer(t){const{value:e}=t;if(!ArrayBuffer.isView(e))throw new Error("Attribute ".concat(this.id," value is not TypedArray"));const i=this.settings.defaultType;let n=!1;if(this.doublePrecision&&(n=e.BYTES_PER_ELEMENT<4),n)throw new Error("Attribute ".concat(this.id," does not support ").concat(e.constructor.name));e instanceof i||!this.settings.normalized||"normalized"in t||dut.warn("Attribute ".concat(this.id," is normalized"))()}normalizeConstant(t){switch(this.settings.type){case 5120:return new Float32Array(t).map((t=>(t+128)/255*2-1));case 5122:return new Float32Array(t).map((t=>(t+32768)/65535*2-1));case 5121:return new Float32Array(t).map((t=>t/255));case 5123:return new Float32Array(t).map((t=>t/65535));default:return t}}_normalizeValue(t,e,i){const{defaultValue:n,size:r}=this.settings;if(Number.isFinite(t))return e[i]=t,e;if(!t){let t=r;for(;--t>=0;)e[i+t]=n[t];return e}switch(r){case 4:e[i+3]=Number.isFinite(t[3])?t[3]:n[3];case 3:e[i+2]=Number.isFinite(t[2])?t[2]:n[2];case 2:e[i+1]=Number.isFinite(t[1])?t[1]:n[1];case 1:e[i+0]=Number.isFinite(t[0])?t[0]:n[0];break;default:let o=r;for(;--o>=0;)e[i+o]=Number.isFinite(t[o])?t[o]:n[o]}return e}_areValuesEqual(t,e){if(!t||!e)return!1;const{size:i}=this;for(let n=0;n<i;n++)if(t[n]!==e[n])return!1;return!0}}const Oxt=[],kxt=[];function Nxt(t,e=0,i=1/0){let n=Oxt;const r={index:-1,data:t,target:[]};return t?"function"==typeof t[Symbol.iterator]?n=t:t.length>0&&(kxt.length=t.length,n=kxt):n=Oxt,(e>0||Number.isFinite(i))&&(n=(Array.isArray(n)?n:Array.from(n)).slice(e,i),r.index=e-1),{iterable:n,objectInfo:r}}function Bxt(t){return t&&t[Symbol.asyncIterator]}const zxt=[],Fxt=[[0,1/0]];function Vxt(t){const{source:e,target:i,start:n=0,size:r,getData:o}=t,s=t.end||i.length,a=e.length,l=s-n;if(a>l)return void i.set(e.subarray(0,l),n);if(i.set(e,n),!o)return;let c=a;for(;c<l;){const t=o(c,e);for(let e=0;e<r;e++)i[n+c]=t[e]||0,c++}}const Uxt={interpolation:{duration:0,easing:t=>t},spring:{stiffness:.05,damping:.5}};function Gxt(t,e){if(!t)return null;Number.isFinite(t)&&(t={type:"interpolation",duration:t});const i=t.type||"interpolation";return{...Uxt[i],...e,...t,type:i}}function jxt(t,e){const i=e.getBuffer();return i?[i,{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function Hxt(t){switch(t){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error('No defined attribute type for size "'.concat(t,'"'))}}function Wxt(t){t.push(t.shift())}function qxt(t,e){const{doublePrecision:i,settings:n,value:r,size:o}=t,s=i&&r instanceof Float64Array?2:1;return(n.noAlloc?r.length:e*o)*s}function Xxt({buffer:t,numInstances:e,attribute:i,fromLength:n,fromStartIndices:r,getData:o=(t=>t)}){const s=i.doublePrecision&&i.value instanceof Float64Array?2:1,a=i.size*s,l=i.byteOffset,c=i.startIndices,u=r&&c,h=qxt(i,e),p=i.isConstant;if(!u&&n>=h)return;const d=p?i.value:i.getBuffer().getData({srcByteOffset:l});if(i.settings.normalized&&!p){const t=o;o=(e,n)=>i.normalizeConstant(t(e,n))}const f=p?(t,e)=>o(d,e):(t,e)=>o(d.subarray(t,t+a),e),m=t.getData({length:n}),g=new Float32Array(h);!function({source:t,target:e,size:i,getData:n,sourceStartIndices:r,targetStartIndices:o}){if(!Array.isArray(o))return Vxt({source:t,target:e,size:i,getData:n}),e;let s=0,a=0;const l=n&&((t,e)=>n(t+a,e)),c=Math.min(r.length,o.length);for(let n=1;n<c;n++){const c=r[n]*i,u=o[n]*i;Vxt({source:t.subarray(s,c),target:e,start:a,end:u,size:i,getData:l}),s=c,a=u}a<e.length&&Vxt({source:[],target:e,start:a,size:i,getData:l})}({source:m,target:g,sourceStartIndices:r,targetStartIndices:c,size:a,getData:f}),t.byteLength<g.byteLength+l&&t.reallocate(g.byteLength+l),t.subData({data:g,offset:l})}class Zxt extends Rxt{constructor(t,e){super(t,e,{startIndices:null,lastExternalBuffer:null,binaryValue:null,binaryAccessor:null,needsUpdate:!0,needsRedraw:!1,updateRanges:Fxt}),cat(this,"constant",!1),this.settings.update=e.update||(e.accessor?this._autoUpdater:void 0),Object.seal(this.settings),Object.seal(this.state),this._validateAttributeUpdaters()}get startIndices(){return this.state.startIndices}set startIndices(t){this.state.startIndices=t}needsUpdate(){return this.state.needsUpdate}needsRedraw({clearChangedFlags:t=!1}={}){const e=this.state.needsRedraw;return this.state.needsRedraw=e&&!t,e}getUpdateTriggers(){const{accessor:t}=this.settings;return[this.id].concat("function"!=typeof t&&t||[])}supportsTransition(){return Boolean(this.settings.transition)}getTransitionSetting(t){if(!t||!this.supportsTransition())return null;const{accessor:e}=this.settings,i=this.settings.transition,n=Array.isArray(e)?t[e.find((e=>t[e]))]:t[e];return Gxt(n,i)}setNeedsUpdate(t=this.id,e){if(this.state.needsUpdate=this.state.needsUpdate||t,this.setNeedsRedraw(t),e){const{startRow:t=0,endRow:i=1/0}=e;this.state.updateRanges=function(t,e){if(t===Fxt)return t;if(e[0]<0&&(e[0]=0),e[0]>=e[1])return t;const i=[],n=t.length;let r=0;for(let o=0;o<n;o++){const n=t[o];n[1]<e[0]?(i.push(n),r=o+1):n[0]>e[1]?i.push(n):e=[Math.min(n[0],e[0]),Math.max(n[1],e[1])]}return i.splice(r,0,e),i}(this.state.updateRanges,[t,i])}else this.state.updateRanges=Fxt}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=zxt}setNeedsRedraw(t=this.id){this.state.needsRedraw=this.state.needsRedraw||t}allocate(t){const{state:e,settings:i}=this;return!i.noAlloc&&(!!i.update&&(super.allocate(t,e.updateRanges!==Fxt),!0))}updateBuffer({numInstances:t,data:e,props:i,context:n}){if(!this.needsUpdate())return!1;const{state:{updateRanges:r},settings:{update:o,noAlloc:s}}=this;let a=!0;if(o){for(const[s,a]of r)o.call(n,this,{data:e,startRow:s,endRow:a,props:i,numInstances:t});if(this.value)if(this.constant||this.buffer.byteLength<this.value.byteLength+this.byteOffset)this.setData({value:this.value,constant:this.constant}),this.constant=!1;else for(const[e,i]of r){const n=Number.isFinite(e)?this.getVertexOffset(e):0,r=Number.isFinite(i)?this.getVertexOffset(i):s||!Number.isFinite(t)?this.value.length:t*this.size;super.updateSubBuffer({startOffset:n,endOffset:r})}else;this._checkAttributeArray()}else a=!1;return this.clearNeedsUpdate(),this.setNeedsRedraw(),a}setConstantValue(t){if(void 0===t||"function"==typeof t)return!1;return this.setData({constant:!0,value:t})&&this.setNeedsRedraw(),this.clearNeedsUpdate(),!0}setExternalBuffer(t){const{state:e}=this;return t?(this.clearNeedsUpdate(),e.lastExternalBuffer===t||(e.lastExternalBuffer=t,this.setNeedsRedraw(),this.setData(t)),!0):(e.lastExternalBuffer=null,!1)}setBinaryValue(t,e=null){const{state:i,settings:n}=this;if(!t)return i.binaryValue=null,i.binaryAccessor=null,!1;if(n.noAlloc)return!1;if(i.binaryValue===t)return this.clearNeedsUpdate(),!0;i.binaryValue=t,this.setNeedsRedraw();if(n.transform||e!==this.startIndices){ArrayBuffer.isView(t)&&(t={value:t});const r=t;s_t(ArrayBuffer.isView(r.value),"invalid ".concat(n.accessor));const o=Boolean(r.size)&&r.size!==this.size;return i.binaryAccessor=function(t,e){const{size:i,stride:n,offset:r,startIndices:o,nested:s}=e,a=t.BYTES_PER_ELEMENT,l=n?n/a:i,c=r?r/a:0,u=Math.floor((t.length-c)/l);return(e,{index:n,target:r})=>{if(!o){const e=n*l+c;for(let n=0;n<i;n++)r[n]=t[e+n];return r}const a=o[n],h=o[n+1]||u;let p;if(s){p=new Array(h-a);for(let e=a;e<h;e++){const n=e*l+c;r=new Array(i);for(let e=0;e<i;e++)r[e]=t[n+e];p[e-a]=r}}else if(l===i)p=t.subarray(a*i+c,h*i+c);else{p=new t.constructor((h-a)*i);let e=0;for(let n=a;n<h;n++){const r=n*l+c;for(let n=0;n<i;n++)p[e++]=t[r+n]}}return p}}(r.value,{size:r.size||this.size,stride:r.stride,offset:r.offset,startIndices:e,nested:o}),!1}return this.clearNeedsUpdate(),this.setData(t),!0}getVertexOffset(t){const{startIndices:e}=this;return(e?t<e.length?e[t]:this.numInstances:t)*this.size}getShaderAttributes(){const t=this.settings.shaderAttributes||{[this.id]:null},e={};for(const i in t)Object.assign(e,super.getShaderAttributes(i,t[i]));return e}_autoUpdater(t,{data:e,startRow:i,endRow:n,props:r,numInstances:o}){if(t.constant)return;const{settings:s,state:a,value:l,size:c,startIndices:u}=t,{accessor:h,transform:p}=s,d=a.binaryAccessor||("function"==typeof h?h:r[h]);s_t("function"==typeof d,'accessor "'.concat(h,'" is not a function'));let f=t.getVertexOffset(i);const{iterable:m,objectInfo:g}=Nxt(e,i,n);for(const e of m){g.index++;let i=d(e,g);if(p&&(i=p.call(this,i)),u){const e=(g.index<u.length-1?u[g.index+1]:o)-u[g.index];if(i&&Array.isArray(i[0])){let e=f;for(const n of i)t._normalizeValue(n,l,e),e+=c}else i&&i.length>c?l.set(i,f):(t._normalizeValue(i,g.target,0),qvt({target:l,source:g.target,start:f,count:e}));f+=e*c}else t._normalizeValue(i,l,f),f+=c}}_validateAttributeUpdaters(){const{settings:t}=this;if(!(t.noAlloc||"function"==typeof t.update))throw new Error("Attribute ".concat(this.id," missing update or accessor"))}_checkAttributeArray(){const{value:t}=this,e=Math.min(4,this.size);if(t&&t.length>=e){let i=!0;switch(e){case 4:i=i&&Number.isFinite(t[3]);case 3:i=i&&Number.isFinite(t[2]);case 2:i=i&&Number.isFinite(t[1]);case 1:i=i&&Number.isFinite(t[0]);break;default:i=!1}if(!i)throw new Error("Illegal attribute generated for ".concat(this.id))}}}const Yxt="\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nuniform float time;\nattribute ATTRIBUTE_TYPE aFrom;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n vCurrent = mix(aFrom, aTo, time);\n gl_Position = vec4(0.0);\n}\n";const Qxt={interpolation:class{constructor({gl:t,attribute:e,timeline:i}){cat(this,"gl",void 0),cat(this,"type","interpolation"),cat(this,"attributeInTransition",void 0),cat(this,"settings",void 0),cat(this,"attribute",void 0),cat(this,"transition",void 0),cat(this,"currentStartIndices",void 0),cat(this,"currentLength",void 0),cat(this,"transform",void 0),cat(this,"buffers",void 0),this.gl=t,this.transition=new l_t(i),this.attribute=e,this.attributeInTransition=new Zxt(t,e.settings),this.currentStartIndices=e.startIndices,this.currentLength=0,this.transform=function(t,e){const i=Hxt(e.size);return new jgt(t,{vs:Yxt,defines:{ATTRIBUTE_TYPE:i},varyings:["vCurrent"]})}(t,e);const n={byteLength:0,usage:35050};this.buffers=[new Xht(t,n),new Xht(t,n)]}get inProgress(){return this.transition.inProgress}start(t,e){if(t.duration<=0)return void this.transition.cancel();this.settings=t;const{gl:i,buffers:n,attribute:r}=this;Wxt(n);const o={numInstances:e,attribute:r,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:t.enter};for(const t of n)Xxt({buffer:t,...o});this.currentStartIndices=r.startIndices,this.currentLength=qxt(r,e),this.attributeInTransition.setData({buffer:n[1],value:r.value}),this.transition.start(t),this.transform.update({elementCount:Math.floor(this.currentLength/r.size),sourceBuffers:{aFrom:n[0],aTo:jxt(0,r)},feedbackBuffers:{vCurrent:n[1]}})}update(){const t=this.transition.update();if(t){const{duration:t,easing:e}=this.settings,{time:i}=this.transition;let n=i/t;e&&(n=e(n)),this.transform.run({uniforms:{time:n}})}return t}cancel(){this.transition.cancel(),this.transform.delete();for(const t of this.buffers)t.delete();this.buffers.length=0}},spring:class{constructor({gl:t,attribute:e,timeline:i}){cat(this,"gl",void 0),cat(this,"type","spring"),cat(this,"attributeInTransition",void 0),cat(this,"settings",void 0),cat(this,"attribute",void 0),cat(this,"transition",void 0),cat(this,"currentStartIndices",void 0),cat(this,"currentLength",void 0),cat(this,"texture",void 0),cat(this,"framebuffer",void 0),cat(this,"transform",void 0),cat(this,"buffers",void 0),this.gl=t,this.type="spring",this.transition=new l_t(i),this.attribute=e,this.attributeInTransition=new Zxt(t,{...e.settings,normalized:!1}),this.currentStartIndices=e.startIndices,this.currentLength=0,this.texture=function(t){return new tpt(t,{data:new Uint8Array(4),format:6408,type:5121,border:0,mipmaps:!1,dataFormat:6408,width:1,height:1})}(t),this.framebuffer=function(t,e){return new Ppt(t,{id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,attachments:{36064:e}})}(t,this.texture),this.transform=function(t,e,i){const n=Hxt(e.size);return new jgt(t,{framebuffer:i,vs:"\n#define SHADER_NAME spring-transition-vertex-shader\n\n#define EPSILON 0.00001\n\nuniform float stiffness;\nuniform float damping;\nattribute ATTRIBUTE_TYPE aPrev;\nattribute ATTRIBUTE_TYPE aCur;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vNext;\nvarying float vIsTransitioningFlag;\n\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\n ATTRIBUTE_TYPE velocity = cur - prev;\n ATTRIBUTE_TYPE delta = dest - cur;\n ATTRIBUTE_TYPE spring = delta * stiffness;\n ATTRIBUTE_TYPE damper = velocity * -1.0 * damping;\n return spring + damper + velocity + cur;\n}\n\nvoid main(void) {\n bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\n vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\n\n vNext = getNextValue(aCur, aPrev, aTo);\n gl_Position = vec4(0, 0, 0, 1);\n gl_PointSize = 100.0;\n}\n",fs:"\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\n\nvarying float vIsTransitioningFlag;\n\nvoid main(void) {\n if (vIsTransitioningFlag == 0.0) {\n discard;\n }\n gl_FragColor = vec4(1.0);\n}",defines:{ATTRIBUTE_TYPE:n},varyings:["vNext"]})}(t,e,this.framebuffer);const n={byteLength:0,usage:35050};this.buffers=[new Xht(t,n),new Xht(t,n),new Xht(t,n)]}get inProgress(){return this.transition.inProgress}start(t,e){const{gl:i,buffers:n,attribute:r}=this,o={numInstances:e,attribute:r,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:t.enter};for(const t of n)Xxt({buffer:t,...o});this.settings=t,this.currentStartIndices=r.startIndices,this.currentLength=qxt(r,e),this.attributeInTransition.setData({buffer:n[1],value:r.value}),this.transition.start({...t,duration:1/0}),this.transform.update({elementCount:Math.floor(this.currentLength/r.size),sourceBuffers:{aTo:jxt(0,r)}})}update(){const{buffers:t,transform:e,framebuffer:i,transition:n}=this;if(!n.update())return!1;const r=this.settings;e.update({sourceBuffers:{aPrev:t[0],aCur:t[1]},feedbackBuffers:{vNext:t[2]}}),e.run({framebuffer:i,discard:!1,clearRenderTarget:!0,uniforms:{stiffness:r.stiffness,damping:r.damping},parameters:{depthTest:!1,blend:!0,viewport:[0,0,1,1],blendFunc:[1,1],blendEquation:[32776,32776]}}),Wxt(t),this.attributeInTransition.setData({buffer:t[1],value:this.attribute.value});return hpt(i)[0]>0||n.end(),!0}cancel(){this.transition.cancel(),this.transform.delete();for(const t of this.buffers)t.delete();this.buffers.length=0,this.texture.delete(),this.framebuffer.delete()}}};class Jxt{constructor(t,{id:e,timeline:i}){cat(this,"id",void 0),cat(this,"isSupported",void 0),cat(this,"gl",void 0),cat(this,"timeline",void 0),cat(this,"transitions",void 0),cat(this,"needsRedraw",void 0),cat(this,"numInstances",void 0),this.id=e,this.gl=t,this.timeline=i,this.transitions={},this.needsRedraw=!1,this.numInstances=1,this.isSupported=jgt.isSupported(t)}finalize(){for(const t in this.transitions)this._removeTransition(t)}update({attributes:t,transitions:e,numInstances:i}){this.numInstances=i||1;for(const i in t){const n=t[i],r=n.getTransitionSetting(e);r&&this._updateAttribute(i,n,r)}for(const i in this.transitions){const n=t[i];n&&n.getTransitionSetting(e)||this._removeTransition(i)}}hasAttribute(t){const e=this.transitions[t];return e&&e.inProgress}getAttributes(){const t={};for(const e in this.transitions){const i=this.transitions[e];i.inProgress&&(t[e]=i.attributeInTransition)}return t}run(){if(!this.isSupported||0===this.numInstances)return!1;for(const t in this.transitions){this.transitions[t].update()&&(this.needsRedraw=!0)}const t=this.needsRedraw;return this.needsRedraw=!1,t}_removeTransition(t){this.transitions[t].cancel(),delete this.transitions[t]}_updateAttribute(t,e,i){const n=this.transitions[t];let r=!n||n.type!==i.type;if(r){if(!this.isSupported)return void dut.warn("WebGL2 not supported by this browser. Transition for ".concat(t," is disabled."))();n&&this._removeTransition(t);const o=Qxt[i.type];o?this.transitions[t]=new o({attribute:e,timeline:this.timeline,gl:this.gl}):(dut.error("unsupported transition type '".concat(i.type,"'"))(),r=!1)}(r||e.needsRedraw())&&(this.needsRedraw=!0,this.transitions[t].start(i,this.numInstances))}}const Kxt="attributeManager.invalidate";class $xt{constructor(t,{id:e="attribute-manager",stats:i,timeline:n}={}){cat(this,"id",void 0),cat(this,"gl",void 0),cat(this,"attributes",void 0),cat(this,"updateTriggers",void 0),cat(this,"needsRedraw",void 0),cat(this,"userData",void 0),cat(this,"stats",void 0),cat(this,"attributeTransitionManager",void 0),cat(this,"mergeBoundsMemoized",byt(vvt)),this.id=e,this.gl=t,this.attributes={},this.updateTriggers={},this.needsRedraw=!0,this.userData={},this.stats=i,this.attributeTransitionManager=new Jxt(t,{id:"".concat(e,"-transitions"),timeline:n}),Object.seal(this)}finalize(){for(const t in this.attributes)this.attributes[t].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(t={clearRedrawFlags:!1}){const e=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!t.clearRedrawFlags,e&&this.id}setNeedsRedraw(){this.needsRedraw=!0}add(t){this._add(t)}addInstanced(t){this._add(t,{instanced:1})}remove(t){for(const e of t)void 0!==this.attributes[e]&&(this.attributes[e].delete(),delete this.attributes[e])}invalidate(t,e){const i=this._invalidateTrigger(t,e);yut(Kxt,this,t,i)}invalidateAll(t){for(const e in this.attributes)this.attributes[e].setNeedsUpdate(e,t);yut(Kxt,this,"all")}update({data:t,numInstances:e,startIndices:i=null,transitions:n,props:r={},buffers:o={},context:s={}}){let a=!1;yut("attributeManager.updateStart",this),this.stats&&this.stats.get("Update Attributes").timeStart();for(const n in this.attributes){const l=this.attributes[n],c=l.settings.accessor;l.startIndices=i,l.numInstances=e,r[n]&&dut.removed("props.".concat(n),"data.attributes.".concat(n))(),l.setExternalBuffer(o[n])||l.setBinaryValue("string"==typeof c?o[c]:void 0,t.startIndices)||"string"==typeof c&&!o[c]&&l.setConstantValue(r[c])||l.needsUpdate()&&(a=!0,this._updateAttribute({attribute:l,numInstances:e,data:t,props:r,context:s})),this.needsRedraw=this.needsRedraw||l.needsRedraw()}a&&yut("attributeManager.updateEnd",this,e),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:e,transitions:n})}updateTransition(){const{attributeTransitionManager:t}=this,e=t.run();return this.needsRedraw=this.needsRedraw||e,e}getAttributes(){return this.attributes}getBounds(t){const e=t.map((t=>{var e;return null===(e=this.attributes[t])||void 0===e?void 0:e.getBounds()}));return this.mergeBoundsMemoized(e)}getChangedAttributes(t={clearChangedFlags:!1}){const{attributes:e,attributeTransitionManager:i}=this,n={...i.getAttributes()};for(const r in e){const o=e[r];o.needsRedraw(t)&&!i.hasAttribute(r)&&(n[r]=o)}return n}getShaderAttributes(t,e={}){t||(t=this.getAttributes());const i={};for(const n in t)e[n]||Object.assign(i,t[n].getShaderAttributes());return i}_add(t,e={}){for(const i in t){const n=t[i];this.attributes[i]=this._createAttribute(i,n,e)}this._mapUpdateTriggersToAttributes()}_createAttribute(t,e,i){const n={...e,id:t,size:(e.isIndexed?1:e.size)||1,divisor:i.instanced?1:e.divisor||0};return new Zxt(this.gl,n)}_mapUpdateTriggersToAttributes(){const t={};for(const e in this.attributes){this.attributes[e].getUpdateTriggers().forEach((i=>{t[i]||(t[i]=[]),t[i].push(e)}))}this.updateTriggers=t}_invalidateTrigger(t,e){const{attributes:i,updateTriggers:n}=this,r=n[t];return r&&r.forEach((t=>{const n=i[t];n&&n.setNeedsUpdate(n.id,e)})),r}_updateAttribute(t){const{attribute:e,numInstances:i}=t;if(yut("attribute.updateStart",e),e.constant)return void e.setConstantValue(e.value);e.allocate(i)&&yut("attribute.allocate",e,i);e.updateBuffer(t)&&(this.needsRedraw=!0,yut("attribute.updateEnd",e,i))}}const tbt=1e-5;function ebt(t,e,i,n,r){const o=e-t;return(i-e)*r+-o*n+o+e}function ibt(t,e){if(Array.isArray(t)){let i=0;for(let n=0;n<t.length;n++){const r=t[n]-e[n];i+=r*r}return Math.sqrt(i)}return Math.abs(t-e)}const nbt={interpolation:class extends l_t{get value(){return this._value}_onUpdate(){const{time:t,settings:{fromValue:e,toValue:i,duration:n,easing:r}}=this,o=r(t/n);this._value=Wft(e,i,o)}},spring:class extends l_t{get value(){return this._currValue}_onUpdate(){const{fromValue:t,toValue:e,damping:i,stiffness:n}=this.settings,{_prevValue:r=t,_currValue:o=t}=this;let s=function(t,e,i,n,r){if(Array.isArray(i)){const o=[];for(let s=0;s<i.length;s++)o[s]=ebt(t[s],e[s],i[s],n,r);return o}return ebt(t,e,i,n,r)}(r,o,e,i,n);const a=ibt(s,e),l=ibt(s,o);a<tbt&&l<tbt&&(s=e,this.end()),this._prevValue=o,this._currValue=s}}};class rbt{constructor(t){this.transitions=new Map,this.timeline=t}get active(){return this.transitions.size>0}add(t,e,i,n){const{transitions:r}=this;if(r.has(t)){const i=r.get(t),{value:n=i.settings.fromValue}=i;e=n,this.remove(t)}if(!(n=Gxt(n)))return;const o=nbt[n.type];if(!o)return void dut.error("unsupported transition type '".concat(n.type,"'"))();const s=new o(this.timeline);s.start({...n,fromValue:e,toValue:i}),r.set(t,s)}remove(t){const{transitions:e}=this;e.has(t)&&(e.get(t).cancel(),e.delete(t))}update(){const t={};for(const[e,i]of this.transitions)i.update(),t[e]=i.value,i.inProgress||this.remove(e);return t}clear(){for(const t of this.transitions.keys())this.remove(t)}}function obt(t,e){const i=abt({newProps:t,oldProps:e,propTypes:t[Fvt],ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),n=function(t,e){if(null===e)return"oldProps is null, initial diff";let i=!1;const{dataComparator:n,_dataDiff:r}=t;n?n(t.data,e.data)||(i="Data comparator detected a change"):t.data!==e.data&&(i="A new data container was supplied");i&&r&&(i=r(t.data,e.data)||i);return i}(t,e);let r=!1;return n||(r=function(t,e){if(null===e)return{all:!0};if("all"in t.updateTriggers){if(ubt(t,e,"all"))return{all:!0}}const i={};let n=!1;for(const r in t.updateTriggers)if("all"!==r){ubt(t,e,r)&&(i[r]=!0,n=!0)}return!!n&&i}(t,e)),{dataChanged:n,propsChanged:i,updateTriggersChanged:r,extensionsChanged:cbt(t,e),transitionsChanged:sbt(t,e)}}function sbt(t,e){if(!t.transitions)return!1;const i={},n=t[Fvt];let r=!1;for(const o in t.transitions){const s=n[o],a=s&&s.type;("number"===a||"color"===a||"array"===a)&&lbt(t[o],e[o],s)&&(i[o]=!0,r=!0)}return!!r&&i}function abt({newProps:t,oldProps:e,ignoreProps:i={},propTypes:n={},triggerName:r="props"}){if(e===t)return!1;if("object"!=typeof t||null===t)return"".concat(r," changed shallowly");if("object"!=typeof e||null===e)return"".concat(r," changed shallowly");for(const o of Object.keys(t))if(!(o in i)){if(!(o in e))return"".concat(r,".").concat(o," added");const i=lbt(t[o],e[o],n[o]);if(i)return"".concat(r,".").concat(o," ").concat(i)}for(const o of Object.keys(e))if(!(o in i)){if(!(o in t))return"".concat(r,".").concat(o," dropped");if(!Object.hasOwnProperty.call(t,o)){const i=lbt(t[o],e[o],n[o]);if(i)return"".concat(r,".").concat(o," ").concat(i)}}return!1}function lbt(t,e,i){let n=i&&i.equal;return n&&!n(t,e,i)?"changed deeply":n||(n=t&&e&&t.equals,!n||n.call(t,e))?n||e===t?null:"changed shallowly":"changed deeply"}function cbt(t,e){if(null===e)return!0;const i=e.extensions,{extensions:n}=t;if(n===i)return!1;if(!i||!n)return!0;if(n.length!==i.length)return!0;for(let t=0;t<n.length;t++)if(!n[t].equals(i[t]))return!0;return!1}function ubt(t,e,i){let n=t.updateTriggers[i];n=null==n?{}:n;let r=e.updateTriggers[i];r=null==r?{}:r;return abt({oldProps:r,newProps:n,triggerName:i})}function hbt(t){if(null===(e=t)||"object"!=typeof e)throw new Error("count(): argument not an object");var e;if("function"==typeof t.count)return t.count();if(Number.isFinite(t.size))return t.size;if(Number.isFinite(t.length))return t.length;if(function(t){return null!==t&&"object"==typeof t&&t.constructor===Object}(t))return Object.keys(t).length;throw new Error("count(): argument not a container")}function pbt(t,e){if(!e)return t;const i={...t,...e};if("defines"in e&&(i.defines={...t.defines,...e.defines}),"modules"in e&&(i.modules=(t.modules||[]).concat(e.modules),e.modules.some((t=>"project64"===t.name)))){const t=i.modules.findIndex((t=>"project32"===t.name));t>=0&&i.modules.splice(t,1)}if("inject"in e)if(t.inject){const n={...t.inject};for(const t in e.inject)n[t]=(n[t]||"")+e.inject[t];i.inject=n}else i.inject=e.inject;return i}const dbt={10241:9987,10240:9729,10242:33071,10243:33071},fbt={};const mbt={boolean:{validate:(t,e)=>!0,equal:(t,e,i)=>Boolean(t)===Boolean(e)},number:{validate:(t,e)=>Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)},color:{validate:(t,e)=>e.optional&&!t||vbt(t)&&(3===t.length||4===t.length),equal:(t,e,i)=>e_t(t,e,1)},accessor:{validate(t,e){const i=_bt(t);return"function"===i||i===_bt(e.value)},equal:(t,e,i)=>"function"==typeof e||e_t(t,e,1)},array:{validate:(t,e)=>e.optional&&!t||vbt(t),equal(t,e,i){const{compare:n}=i,r=Number.isInteger(n)?n:n?1:0;return n?e_t(t,e,r):t===e}},object:{equal(t,e,i){if(i.ignore)return!0;const{compare:n}=i,r=Number.isInteger(n)?n:n?1:0;return n?e_t(t,e,r):t===e}},function:{validate:(t,e)=>e.optional&&!t||"function"==typeof t,equal:(t,e,i)=>!i.compare&&!1!==i.ignore||t===e},data:{transform:(t,e,i)=>{const{dataTransform:n}=i.props;return n&&t?n(t):t}},image:{transform:(t,e,i)=>{const n=i.context;return n&&n.gl?function(t,e,i,n){if(i instanceof tpt)return i;i.constructor&&"Object"!==i.constructor.name&&(i={data:i});let r=null;i.compressed&&(r={10241:i.data.length>1?9985:9729});const o=new tpt(e,{...i,parameters:{...dbt,...r,...n}});return fbt[o.id]=t,o}(i.id,n.gl,t,{...e.parameters,...i.props.textureParameters}):null},release:(t,e,i)=>{var n,r;n=i.id,(r=t)&&r instanceof tpt&&fbt[r.id]===n&&(r.delete(),delete fbt[r.id])}}};function gbt(t,e){switch(_bt(e)){case"object":return ybt(t,e);case"array":return ybt(t,{type:"array",value:e,compare:!1});case"boolean":return ybt(t,{type:"boolean",value:e});case"number":return ybt(t,{type:"number",value:e});case"function":return ybt(t,{type:"function",value:e,compare:!0});default:return{name:t,type:"unknown",value:e}}}function ybt(t,e){return"type"in e?{name:t,...mbt[e.type],...e}:"value"in e?{name:t,type:_bt(e.value),...e}:{name:t,type:"object",value:e}}function vbt(t){return Array.isArray(t)||ArrayBuffer.isView(t)}function _bt(t){return vbt(t)?"array":null===t?"null":typeof t}const xbt="_mergedDefaultProps";function bbt(t,e){let i=xbt;if(e)for(const t of e){const e=t.constructor;e&&(i+=":".concat(e.extensionName||e.name))}const n=Ebt(t,i);return n||(t[i]=function(t,e){const i=t.prototype;if(!i)return null;const n=Object.getPrototypeOf(t),r=bbt(n),o=Ebt(t,"defaultProps")||{},s=function(t){const e={},i={},n={};for(const[r,o]of Object.entries(t)){const t=null==o?void 0:o.deprecatedFor;if(t)n[r]=Array.isArray(t)?t:[t];else{const t=gbt(r,o);e[r]=t,i[r]=t.value}}return{propTypes:e,defaultProps:i,deprecatedProps:n}}(o),a=Object.assign(Object.create(null),r,s.defaultProps),l=Object.assign(Object.create(null),null==r?void 0:r[Fvt],s.propTypes),c=Object.assign(Object.create(null),null==r?void 0:r[Vvt],s.deprecatedProps);for(const t of e){const e=bbt(t.constructor);e&&(Object.assign(a,e),Object.assign(l,e[Fvt]),Object.assign(c,e[Vvt]))}(function(t,e){const i=function(t){const e=t.componentName;e||dut.warn("".concat(t.name,".componentName not specified"))();return e||t.name}(e);Object.defineProperties(t,{id:{writable:!0,value:i}})})(a,t),function(t,e){const i={},n={};for(const t in e){const r=e[t],{name:o,value:s}=r;r.async&&(i[o]=s,n[o]=wbt(o))}t[Uvt]=i,t[Gvt]={},Object.defineProperties(t,n)}(a,l),function(t,e){for(const i in e)Object.defineProperty(t,i,{enumerable:!1,set(t){const n="".concat(this.id,": ").concat(i);for(const n of e[i])Abt(this,n)||(this[n]=t);dut.deprecated(n,e[i].join("/"))()}})}(a,c),a[Fvt]=l,a[Vvt]=c,0!==e.length||Abt(t,"_propTypes")||(t._propTypes=l);return a}(t,e||[]))}function wbt(t){return{enumerable:!0,set(e){"string"==typeof e||e instanceof Promise||Bxt(e)?this[Gvt][t]=e:this[jvt][t]=e},get(){if(this[jvt]){if(t in this[jvt]){return this[jvt][t]||this[Uvt][t]}if(t in this[Gvt]){const e=this[zvt]&&this[zvt].internalState;if(e&&e.hasAsyncProp(t))return e.getAsyncProp(t)||this[Uvt][t]}}return this[Uvt][t]}}}function Abt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Ebt(t,e){return Abt(t,e)&&t[e]}let Sbt=0;class Mbt{constructor(...t){cat(this,"id",void 0),cat(this,"props",void 0),cat(this,"count",void 0),this.props=function(t,e){let i;for(let t=e.length-1;t>=0;t--){const n=e[t];"extensions"in n&&(i=n.extensions)}const n=bbt(t.constructor,i),r=Object.create(n);r[zvt]=t,r[Gvt]={},r[jvt]={};for(let t=0;t<e.length;++t){const i=e[t];for(const t in i)r[t]=i[t]}return Object.freeze(r),r}(this,t),this.id=this.props.id,this.count=Sbt++}clone(t){const{props:e}=this,i={};for(const t in e[Uvt])t in e[jvt]?i[t]=e[jvt][t]:t in e[Gvt]&&(i[t]=e[Gvt][t]);return new this.constructor({...e,...i,...t})}}cat(Mbt,"componentName","Component"),cat(Mbt,"defaultProps",{});const Tbt=Object.freeze({});class Ibt{constructor(t){cat(this,"component",void 0),cat(this,"onAsyncPropUpdated",void 0),cat(this,"asyncProps",void 0),cat(this,"oldProps",void 0),cat(this,"oldAsyncProps",void 0),this.component=t,this.asyncProps={},this.onAsyncPropUpdated=()=>{},this.oldProps=null,this.oldAsyncProps=null}finalize(){for(const t in this.asyncProps){const e=this.asyncProps[t];e&&e.type&&e.type.release&&e.type.release(e.resolvedValue,e.type,this.component)}this.asyncProps={},this.component=null,this.resetOldProps()}getOldProps(){return this.oldAsyncProps||this.oldProps||Tbt}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component?this.component.props:null}hasAsyncProp(t){return t in this.asyncProps}getAsyncProp(t){const e=this.asyncProps[t];return e&&e.resolvedValue}isAsyncPropLoading(t){if(t){const e=this.asyncProps[t];return Boolean(e&&e.pendingLoadCount>0&&e.pendingLoadCount!==e.resolvedLoadCount)}for(const t in this.asyncProps)if(this.isAsyncPropLoading(t))return!0;return!1}reloadAsyncProp(t,e){this._watchPromise(t,Promise.resolve(e))}setAsyncProps(t){this.component=t[zvt]||this.component;const e=t[jvt]||{},i=t[Gvt]||t,n=t[Uvt]||{};for(const t in e){const i=e[t];this._createAsyncPropData(t,n[t]),this._updateAsyncProp(t,i),e[t]=this.getAsyncProp(t)}for(const t in i){const e=i[t];this._createAsyncPropData(t,n[t]),this._updateAsyncProp(t,e)}}_fetch(t,e){return null}_onResolve(t,e){}_onError(t,e){}_updateAsyncProp(t,e){this._didAsyncInputValueChange(t,e)&&("string"==typeof e&&(e=this._fetch(t,e)),e instanceof Promise?this._watchPromise(t,e):Bxt(e)?this._resolveAsyncIterable(t,e):this._setPropValue(t,e))}_freezeAsyncOldProps(){if(!this.oldAsyncProps&&this.oldProps){this.oldAsyncProps=Object.create(this.oldProps);for(const t in this.asyncProps)Object.defineProperty(this.oldAsyncProps,t,{enumerable:!0,value:this.oldProps[t]})}}_didAsyncInputValueChange(t,e){const i=this.asyncProps[t];return e!==i.resolvedValue&&e!==i.lastValue&&(i.lastValue=e,!0)}_setPropValue(t,e){this._freezeAsyncOldProps();const i=this.asyncProps[t];i&&(e=this._postProcessValue(i,e),i.resolvedValue=e,i.pendingLoadCount++,i.resolvedLoadCount=i.pendingLoadCount)}_setAsyncPropValue(t,e,i){const n=this.asyncProps[t];n&&i>=n.resolvedLoadCount&&void 0!==e&&(this._freezeAsyncOldProps(),n.resolvedValue=e,n.resolvedLoadCount=i,this.onAsyncPropUpdated(t,e))}_watchPromise(t,e){const i=this.asyncProps[t];if(i){i.pendingLoadCount++;const n=i.pendingLoadCount;e.then((e=>{this.component&&(e=this._postProcessValue(i,e),this._setAsyncPropValue(t,e,n),this._onResolve(t,e))})).catch((e=>{this._onError(t,e)}))}}async _resolveAsyncIterable(t,e){if("data"!==t)return void this._setPropValue(t,e);const i=this.asyncProps[t];if(!i)return;i.pendingLoadCount++;const n=i.pendingLoadCount;let r=[],o=0;for await(const i of e){if(!this.component)return;const{dataTransform:e}=this.component.props;r=e?e(i,r):r.concat(i),Object.defineProperty(r,"__diff",{enumerable:!1,value:[{startRow:o,endRow:r.length}]}),o=r.length,this._setAsyncPropValue(t,r,n)}this._onResolve(t,r)}_postProcessValue(t,e){const i=t.type;return i&&this.component&&(i.release&&i.release(t.resolvedValue,i,this.component),i.transform)?i.transform(e,i,this.component):e}_createAsyncPropData(t,e){if(!this.asyncProps[t]){const i=this.component&&this.component.props[Fvt];this.asyncProps[t]={type:i&&i[t],lastValue:null,resolvedValue:e,pendingLoadCount:0,resolvedLoadCount:0}}}}class Cbt extends Ibt{constructor({attributeManager:t,layer:e}){super(e),cat(this,"attributeManager",void 0),cat(this,"needsRedraw",void 0),cat(this,"needsUpdate",void 0),cat(this,"subLayers",void 0),cat(this,"usesPickingColorCache",void 0),cat(this,"hasPickingBuffer",void 0),cat(this,"changeFlags",void 0),cat(this,"viewport",void 0),cat(this,"uniformTransitions",void 0),cat(this,"propsInTransition",void 0),this.attributeManager=t,this.needsRedraw=!0,this.needsUpdate=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}_fetch(t,e){const i=this.layer,n=null==i?void 0:i.props.fetch;return n?n(e,{propName:t,layer:i}):super._fetch(t,e)}_onResolve(t,e){const i=this.layer;if(i){const n=i.props.onDataLoad;"data"===t&&n&&n(e,{propName:t,layer:i})}}_onError(t,e){const i=this.layer;i&&i.raiseError(e,"loading ".concat(t," of ").concat(this.layer))}}const Pbt=2**24-1,Lbt=Object.freeze([]),Dbt=byt((({oldViewport:t,viewport:e})=>t.equals(e)));let Rbt=new Uint8ClampedArray(0);const Obt={data:{type:"data",value:Lbt,async:!0},dataComparator:{type:"function",value:null,optional:!0},_dataDiff:{type:"function",value:t=>t&&t.__diff,optional:!0},dataTransform:{type:"function",value:null,optional:!0},onDataLoad:{type:"function",value:null,optional:!0},onError:{type:"function",value:null,optional:!0},fetch:{type:"function",value:(t,{propName:e,layer:i,loaders:n,loadOptions:r,signal:o})=>{const{resourceManager:s}=i.context;var a;(r=r||i.getLoadOptions(),n=n||i.props.loaders,o)&&(r={...r,fetch:{...null===(a=r)||void 0===a?void 0:a.fetch,signal:o}});let l=s.contains(t);return l||r||(s.add({resourceId:t,data:bct(t,n),persistent:!1}),l=!0),l?s.subscribe({resourceId:t,onChange:t=>{var n;return null===(n=i.internalState)||void 0===n?void 0:n.reloadAsyncProp(e,t)},consumerId:i.id,requestId:e}):bct(t,n,r)}},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},operation:"draw",onHover:{type:"function",value:null,optional:!0},onClick:{type:"function",value:null,optional:!0},onDragStart:{type:"function",value:null,optional:!0},onDrag:{type:"function",value:null,optional:!0},onDragEnd:{type:"function",value:null,optional:!0},coordinateSystem:xut.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{type:"object",value:{},optional:!0,compare:2},loadOptions:{type:"object",value:null,optional:!0,ignore:!0},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,ignore:!0},getPolygonOffset:{type:"function",value:({layerIndex:t})=>[0,100*-t]},highlightedObjectIndex:null,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}};class kbt extends Mbt{constructor(...t){super(...t),cat(this,"internalState",null),cat(this,"lifecycle",Dvt),cat(this,"context",void 0),cat(this,"state",void 0),cat(this,"parent",null)}static get componentName(){return Object.prototype.hasOwnProperty.call(this,"layerName")?this.layerName:""}get root(){let t=this;for(;t.parent;)t=t.parent;return t}toString(){const t=this.constructor.layerName||this.constructor.name;return"".concat(t,"({id: '").concat(this.props.id,"'})")}project(t){s_t(this.internalState);const e=this.internalState.viewport||this.context.viewport,i=Tvt(t,{viewport:e,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[n,r,o]=Kyt(i,e.pixelProjectionMatrix);return 2===t.length?[n,r]:[n,r,o]}unproject(t){s_t(this.internalState);return(this.internalState.viewport||this.context.viewport).unproject(t)}projectPosition(t,e){s_t(this.internalState);return Ivt(t,{viewport:this.internalState.viewport||this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem,...e})}get isComposite(){return!1}setState(t){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,t),this.setNeedsRedraw()}setNeedsRedraw(){this.internalState&&(this.internalState.needsRedraw=!0)}setNeedsUpdate(){this.internalState&&(this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0)}get isLoaded(){return!!this.internalState&&!this.internalState.isAsyncPropLoading()}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){return this.state&&(this.state.models||this.state.model&&[this.state.model])||[]}setModuleParameters(t){for(const e of this.getModels())e.updateModuleSettings(t)}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}use64bitPositions(){const{coordinateSystem:t}=this.props;return t===xut.DEFAULT||t===xut.LNGLAT||t===xut.CARTESIAN}onHover(t,e){return this.props.onHover&&this.props.onHover(t,e)||!1}onClick(t,e){return this.props.onClick&&this.props.onClick(t,e)||!1}nullPickingColor(){return[0,0,0]}encodePickingColor(t,e=[]){return e[0]=t+1&255,e[1]=t+1>>8&255,e[2]=t+1>>8>>8&255,e}decodePickingColor(t){s_t(t instanceof Uint8Array);const[e,i,n]=t;return e+256*i+65536*n-1}getNumInstances(){return Number.isFinite(this.props.numInstances)?this.props.numInstances:this.state&&void 0!==this.state.numInstances?this.state.numInstances:hbt(this.props.data)}getStartIndices(){return this.props.startIndices?this.props.startIndices:this.state&&this.state.startIndices?this.state.startIndices:null}getBounds(){var t;return null===(t=this.getAttributeManager())||void 0===t?void 0:t.getBounds(["positions","instancePositions"])}getShaders(t){for(const e of this.props.extensions)t=pbt(t,e.getShaders.call(this,e));return t}shouldUpdateState(t){return t.changeFlags.propsOrDataChanged}updateState(t){const e=this.getAttributeManager(),{dataChanged:i}=t.changeFlags;if(i&&e)if(Array.isArray(i))for(const t of i)e.invalidateAll(t);else e.invalidateAll();if(e){const{props:i}=t,n=this.internalState.hasPickingBuffer,r=Number.isInteger(i.highlightedObjectIndex)||i.pickable||i.extensions.some((t=>t.getNeedsPickingBuffer.call(this,t)));if(n!==r){this.internalState.hasPickingBuffer=r;const{pickingColors:t,instancePickingColors:i}=e.attributes,n=t||i;n&&(r&&n.constant&&(n.constant=!1,e.invalidate(n.id)),n.value||r||(n.constant=!0,n.value=[0,0,0]))}}}finalizeState(t){for(const t of this.getModels())t.delete();const e=this.getAttributeManager();e&&e.finalize(),this.context&&this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState&&(this.internalState.uniformTransitions.clear(),this.internalState.finalize())}draw(t){for(const e of this.getModels())e.draw(t)}getPickingInfo({info:t,mode:e,sourceLayer:i}){const{index:n}=t;return n>=0&&Array.isArray(this.props.data)&&(t.object=this.props.data[n]),t}raiseError(t,e){var i,n,r,o;(e&&(t=new Error("".concat(e,": ").concat(t.message),{cause:t})),null!==(i=(n=this.props).onError)&&void 0!==i&&i.call(n,t))||(null===(r=this.context)||void 0===r||null===(o=r.onError)||void 0===o||o.call(r,t,this))}getNeedsRedraw(t={clearRedrawFlags:!1}){return this._getNeedsRedraw(t)}needsUpdate(){return!!this.internalState&&(this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams()))}hasUniformTransition(){var t;return(null===(t=this.internalState)||void 0===t?void 0:t.uniformTransitions.active)||!1}activateViewport(t){if(!this.internalState)return;const e=this.internalState.viewport;this.internalState.viewport=t,e&&Dbt({oldViewport:e,viewport:t})||(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(t="all"){const e=this.getAttributeManager();e&&("all"===t?e.invalidateAll():e.invalidate(t))}updateAttributes(t){for(const e of this.getModels())this._setModelAttributes(e,t)}_updateAttributes(){const t=this.getAttributeManager();if(!t)return;const e=this.props,i=this.getNumInstances(),n=this.getStartIndices();t.update({data:e.data,numInstances:i,startIndices:n,props:e,transitions:e.transitions,buffers:e.data.attributes,context:this});const r=t.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(r)}_updateAttributeTransition(){const t=this.getAttributeManager();t&&t.updateTransition()}_updateUniformTransition(){const{uniformTransitions:t}=this.internalState;if(t.active){const e=t.update(),i=Object.create(this.props);for(const t in e)Object.defineProperty(i,t,{value:e[t]});return i}return this.props}calculateInstancePickingColors(t,{numInstances:e}){if(t.constant)return;const i=Math.floor(Rbt.length/3);if(this.internalState.usesPickingColorCache=!0,i<e){e>Pbt&&dut.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),Rbt=pvt.allocate(Rbt,e,{size:3,copy:!0,maxCount:Math.max(e,Pbt)});const t=Math.floor(Rbt.length/3),n=[];for(let e=i;e<t;e++)this.encodePickingColor(e,n),Rbt[3*e+0]=n[0],Rbt[3*e+1]=n[1],Rbt[3*e+2]=n[2]}t.value=Rbt.subarray(0,3*e)}_setModelAttributes(t,e){const i=this.getAttributeManager(),n=t.userData.excludeAttributes||{},r=i.getShaderAttributes(e,n);t.setAttributes(r)}disablePickingIndex(t){const e=this.props.data;if(!("attributes"in e))return void this._disablePickingIndex(t);const{pickingColors:i,instancePickingColors:n}=this.getAttributeManager().attributes,r=i||n,o=r&&e.attributes&&e.attributes[r.id];if(o&&o.value){const i=o.value,n=this.encodePickingColor(t);for(let t=0;t<e.length;t++){const e=r.getVertexOffset(t);i[e]===n[0]&&i[e+1]===n[1]&&i[e+2]===n[2]&&this._disablePickingIndex(t)}}else this._disablePickingIndex(t)}_disablePickingIndex(t){const{pickingColors:e,instancePickingColors:i}=this.getAttributeManager().attributes,n=e||i;if(!n)return;const r=n.getVertexOffset(t),o=n.getVertexOffset(t+1);n.buffer.subData({data:new Uint8Array(o-r),offset:r})}restorePickingColors(){const{pickingColors:t,instancePickingColors:e}=this.getAttributeManager().attributes,i=t||e;i&&(this.internalState.usesPickingColorCache&&i.value.buffer!==Rbt.buffer&&(i.value=Rbt.subarray(0,i.value.length)),i.updateSubBuffer({startOffset:0}))}_initialize(){s_t(!this.internalState),s_t(Number.isFinite(this.props.coordinateSystem)),yut("layer.initialize",this);const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new Cbt({attributeManager:t,layer:this}),this._clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(dut.deprecated("layer.state.attributeManager","layer.getAttributeManager()")(),t)}),this.internalState.uniformTransitions=new rbt(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props),this.initializeState(this.context);for(const t of this.props.extensions)t.initializeState.call(this,this.context,t);this.setChangeFlags({dataChanged:"init",propsChanged:"init",viewportChanged:!0,extensionsChanged:!0}),this._update()}_transferState(t){yut("layer.matched",this,this===t);const{state:e,internalState:i}=t;this!==t&&(this.internalState=i,this.state=e,this.internalState.setAsyncProps(this.props),this._diffProps(this.props,this.internalState.getOldProps()))}_update(){const t=this.needsUpdate();if(yut("layer.update",this,t),!t)return;const e=this.props,i=this.context,n=this.internalState,r=i.viewport,o=this._updateUniformTransition();n.propsInTransition=o,i.viewport=n.viewport||r,this.props=o;try{const t=this._getUpdateParams(),e=this.getModels();if(i.gl)this.updateState(t);else try{this.updateState(t)}catch(t){}for(const e of this.props.extensions)e.updateState.call(this,t,e);const n=this.getModels()[0]!==e[0];this._postUpdate(t,n)}finally{i.viewport=r,this.props=e,this._clearChangeFlags(),n.needsUpdate=!1,n.resetOldProps()}}_finalize(){yut("layer.finalize",this),this.finalizeState(this.context);for(const t of this.props.extensions)t.finalizeState.call(this,this.context,t)}_drawLayer({moduleParameters:t=null,uniforms:e={},parameters:i={}}){this._updateAttributeTransition();const n=this.props,r=this.context;this.props=this.internalState.propsInTransition||n;const o=this.props.opacity;e.opacity=Math.pow(o,1/2.2);try{t&&this.setModuleParameters(t);const{getPolygonOffset:n}=this.props,o=n&&n(e)||[0,0];lht(r.gl,{polygonOffset:o}),uht(r.gl,i,(()=>{const n={moduleParameters:t,uniforms:e,parameters:i,context:r};for(const t of this.props.extensions)t.draw.call(this,n,t);this.draw(n)}))}finally{this.props=n}}getChangeFlags(){var t;return null===(t=this.internalState)||void 0===t?void 0:t.changeFlags}setChangeFlags(t){if(!this.internalState)return;const{changeFlags:e}=this.internalState;for(const i in t)if(t[i]){let n=!1;if("dataChanged"===i){const r=t[i],o=e[i];r&&Array.isArray(o)&&(e.dataChanged=Array.isArray(r)?o.concat(r):r,n=!0)}e[i]||(e[i]=t[i],n=!0),n&&yut("layer.changeFlag",this,i,t)}const i=Boolean(e.dataChanged||e.updateTriggersChanged||e.propsChanged||e.extensionsChanged);e.propsOrDataChanged=i,e.somethingChanged=i||e.viewportChanged||e.stateChanged}_clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}_diffProps(t,e){const i=obt(t,e);if(i.updateTriggersChanged)for(const t in i.updateTriggersChanged)i.updateTriggersChanged[t]&&this.invalidateAttribute(t);if(i.transitionsChanged)for(const r in i.transitionsChanged){var n;this.internalState.uniformTransitions.add(r,e[r],t[r],null===(n=t.transitions)||void 0===n?void 0:n[r])}return this.setChangeFlags(i)}validateProps(){!function(t){const e=t[Fvt];for(const i in e){const n=e[i],{validate:r}=n;if(r&&!r(t[i],n))throw new Error("Invalid prop ".concat(i,": ").concat(t[i]))}}(this.props)}updateAutoHighlight(t){this.props.autoHighlight&&!Number.isInteger(this.props.highlightedObjectIndex)&&this._updateAutoHighlight(t)}_updateAutoHighlight(t){const e={pickingSelectedColor:t.picked?t.color:null},{highlightColor:i}=this.props;t.picked&&"function"==typeof i&&(e.pickingHighlightColor=i(t)),this.setModuleParameters(e),this.setNeedsRedraw()}_getAttributeManager(){const t=this.context;return new $xt(t.gl,{id:this.props.id,stats:t.stats,timeline:t.timeline})}_postUpdate(t,e){const{props:i,oldProps:n}=t;this.setNeedsRedraw(),this._updateAttributes();const{model:r}=this.state;null==r||r.setInstanceCount(this.getNumInstances());const{autoHighlight:o,highlightedObjectIndex:s,highlightColor:a}=i;if(e||n.autoHighlight!==o||n.highlightedObjectIndex!==s||n.highlightColor!==a){const t={};o||(t.pickingSelectedColor=null),Array.isArray(a)&&(t.pickingHighlightColor=a),(e||s!==n.highlightedObjectIndex)&&(t.pickingSelectedColor=Number.isFinite(s)&&s>=0?this.encodePickingColor(s):null),this.setModuleParameters(t)}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(t){if(!this.internalState)return!1;let e=!1;e=e||this.internalState.needsRedraw&&this.id;const i=this.getAttributeManager(),n=!!i&&i.getNeedsRedraw(t);if(e=e||n,e)for(const t of this.props.extensions)t.onNeedsRedraw.call(this,t);return this.internalState.needsRedraw=this.internalState.needsRedraw&&!t.clearRedrawFlags,e}_onAsyncPropUpdated(){this._diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}cat(kbt,"defaultProps",Obt),cat(kbt,"layerName","Layer");class Nbt extends kbt{get isComposite(){return!0}get isLoaded(){return super.isLoaded&&this.getSubLayers().every((t=>t.isLoaded))}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(t){}setState(t){super.setState(t),this.setNeedsUpdate()}getPickingInfo({info:t}){const{object:e}=t;return e&&e.__source&&e.__source.parent&&e.__source.parent.id===this.id?(t.object=e.__source.object,t.index=e.__source.index,t):t}filterSubLayer(t){return!0}shouldRenderSubLayer(t,e){return e&&e.length}getSubLayerClass(t,e){const{_subLayerProps:i}=this.props;return i&&i[t]&&i[t].type||e}getSubLayerRow(t,e,i){return t.__source={parent:this,object:e,index:i},t}getSubLayerAccessor(t){if("function"==typeof t){const e={index:-1,data:this.props.data,target:[]};return(i,n)=>i&&i.__source?(e.index=i.__source.index,t(i.__source.object,e)):t(i,n)}return t}getSubLayerProps(t={}){var e;const{opacity:i,pickable:n,visible:r,parameters:o,getPolygonOffset:s,highlightedObjectIndex:a,autoHighlight:l,highlightColor:c,coordinateSystem:u,coordinateOrigin:h,wrapLongitude:p,positionFormat:d,modelMatrix:f,extensions:m,fetch:g,operation:y,_subLayerProps:v}=this.props,_={id:"",updateTriggers:{},opacity:i,pickable:n,visible:r,parameters:o,getPolygonOffset:s,highlightedObjectIndex:a,autoHighlight:l,highlightColor:c,coordinateSystem:u,coordinateOrigin:h,wrapLongitude:p,positionFormat:d,modelMatrix:f,extensions:m,fetch:g,operation:y},x=v&&t.id&&v[t.id],b=x&&x.updateTriggers,w=t.id||"sublayer";if(x){const e=this.props[Fvt],i=t.type?t.type._propTypes:{};for(const t in x){const n=i[t]||e[t];n&&"accessor"===n.type&&(x[t]=this.getSubLayerAccessor(x[t]))}}Object.assign(_,t,x),_.id="".concat(this.props.id,"-").concat(w),_.updateTriggers={all:null===(e=this.props.updateTriggers)||void 0===e?void 0:e.all,...t.updateTriggers,...b};for(const t of m){const e=t.getSubLayerProps.call(this,t);e&&Object.assign(_,e,{updateTriggers:Object.assign(_.updateTriggers,e.updateTriggers)})}return _}_updateAutoHighlight(t){for(const e of this.getSubLayers())e.updateAutoHighlight(t)}_getAttributeManager(){return null}_postUpdate(t,e){let i=this.internalState.subLayers;const n=!i||this.needsUpdate();if(n){i=Hvt(this.renderLayers(),Boolean),this.internalState.subLayers=i}yut("compositeLayer.renderLayers",this,n,i);for(const t of i)t.parent=this}}cat(Nbt,"layerName","CompositeLayer");const Bbt=512,zbt=Math.PI/180;function Fbt({map:t,gl:e,deck:i}){if(t.__deck)return t.__deck;const n=null==i?void 0:i.props._customRender,r=null==i?void 0:i.props.onLoad,o=(s={...null==i?void 0:i.props,_customRender:()=>{t.triggerRepaint(),null==n||n("")}},{...s,parameters:{depthMask:!0,depthTest:!0,blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthFunc:515,blendEquation:32774,...s.parameters},views:s.views||[new D_t({id:"mapbox"})]});var s;let a;return i&&i.props.gl!==e||(Object.assign(o,{gl:e,width:null,height:null,touchAction:"unset",viewState:Ubt(t)}),null!=i&&i.isInitialized?Vbt(i,t):o.onLoad=()=>{null==r||r(),Vbt(a,t)}),i?(a=i,i.setProps(o),i.userData.isExternal=!0):(a=new Cxt(o),t.on("remove",(()=>{!function(t){var e;null===(e=t.__deck)||void 0===e||e.finalize(),t.__deck=null}(t)}))),a.userData.mapboxLayers=new Set,t.__deck=a,t.on("render",(()=>{a.isInitialized&&function(t,e){const{mapboxLayers:i,isExternal:n}=t.userData;if(n){const n=Array.from(i,(t=>t.id)),r=Hvt(t.props.layers,Boolean).some((t=>t&&!n.includes(t.id)));let o=t.getViewports();const s=o.findIndex((t=>"mapbox"===t.id)),a=o.length>1||s<0;(r||a)&&(s>=0&&(o=o.slice(),o[s]=Gbt(t,e,!1)),t._drawLayers("mapbox-repaint",{viewports:o,layerFilter:e=>(!t.props.layerFilter||t.props.layerFilter(e))&&("mapbox"!==e.viewport.id||!n.includes(e.layer.id)),clearCanvas:!1}))}t.userData.currentViewport=null}(a,t)})),a}function Vbt(t,e){const i=()=>{t.isInitialized?function(t,e){t.setProps({viewState:Ubt(e)}),t.needsRedraw({clearRedrawFlags:!0})}(t,e):e.off("move",i)};e.on("move",i)}function Ubt(t){var e;const{lng:i,lat:n}=t.getCenter(),r={longitude:(i+540)%360-180,latitude:n,zoom:t.getZoom(),bearing:t.getBearing(),pitch:t.getPitch(),padding:t.getPadding(),repeat:t.getRenderWorldCopies()};return null!==(e=t.getTerrain)&&void 0!==e&&e.call(t)&&function(t,e){if(t.getFreeCameraOptions){const{position:i}=t.getFreeCameraOptions();if(!i||void 0===i.z)return;const n=t.transform.height,{longitude:r,latitude:o,pitch:s}=e,a=i.x*Bbt,l=(1-i.y)*Bbt,c=i.z*Bbt,u=Hyt([r,o]),h=a-u[0],p=l-u[1],d=Math.sqrt(h*h+p*p),f=s*zbt,m=1.5*n,g=f<.001?m*Math.cos(f)/c:m*Math.sin(f)/d;e.zoom=Math.log2(g);const y=c-m*Math.cos(f)/g;e.position=[0,0,y/Xyt(o)]}else"number"==typeof t.transform.elevation&&(e.position=[0,0,t.transform.elevation])}(t,r),r}function Gbt(t,e,i=!0){return new Evt({id:"mapbox",x:0,y:0,width:t.width,height:t.height,...Ubt(e),nearZMultiplier:i?.02:.1,nearZ:e.transform._nearZ/e.transform.height,farZ:e.transform._farZ/e.transform.height})}function jbt(t){if(t.userData.isExternal)return;const e=[];t.userData.mapboxLayers.forEach((t=>{const i=new(0,t.props.type)(t.props);e.push(i)})),t.setProps({layers:e})}class Hbt{constructor(t){if(cat(this,"id",void 0),cat(this,"type",void 0),cat(this,"renderingMode",void 0),cat(this,"map",void 0),cat(this,"deck",void 0),cat(this,"props",void 0),!t.id)throw new Error("Layer must have an unique id");this.id=t.id,this.type="custom",this.renderingMode=t.renderingMode||"3d",this.map=null,this.deck=null,this.props=t}onAdd(t,e){var i,n;this.map=t,this.deck=Fbt({map:t,gl:e,deck:this.props.deck}),i=this.deck,n=this,i.userData.mapboxLayers.add(n),jbt(i)}onRemove(){var t,e;this.deck&&(t=this.deck,e=this,t.userData.mapboxLayers.delete(e),jbt(t))}setProps(t){Object.assign(this.props,t,{id:this.id}),this.deck&&jbt(this.deck)}render(){!function(t,e,i){let{currentViewport:n}=t.userData,r=!1;n||(n=Gbt(t,e,!0),t.userData.currentViewport=n,r=!0),t.isInitialized&&t._drawLayers("mapbox-repaint",{viewports:[n],layerFilter:({layer:t})=>i.id===t.id||t.props.operation.includes("terrain"),clearStack:r,clearCanvas:!1})}(this.deck,this.map,this)}}const Wbt=[0,0,0,255],qbt=[0,0,1],Xbt={sizeUnits:"pixels",pointSize:{type:"number",min:0,value:10},getPosition:{type:"accessor",value:t=>t.position},getNormal:{type:"accessor",value:qbt},getColor:{type:"accessor",value:Wbt},material:!0,radiusPixels:{deprecatedFor:"pointSize"}};class Zbt extends kbt{getShaders(){return super.getShaders({vs:"#define SHADER_NAME point-cloud-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceNormals;\nattribute vec4 instanceColors;\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform float radiusPixels;\nuniform int sizeUnits;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.normal = project_normal(instanceNormals);\n unitPosition = positions.xy;\n geometry.uv = unitPosition;\n geometry.pickingColor = instancePickingColors;\n vec3 offset = vec3(positions.xy * project_size_to_pixel(radiusPixels, sizeUnits), 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.), geometry.position);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n vec3 lightColor = lighting_getLightColor(instanceColors.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n vColor = vec4(lightColor, instanceColors.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME point-cloud-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n geometry.uv = unitPosition;\n\n float distToCenter = length(unitPosition);\n\n if (distToCenter > 1.0) {\n discard;\n }\n\n gl_FragColor = vColor;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[Yvt,Sgt,Qvt]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceNormals:{size:3,transition:!0,accessor:"getNormal",defaultValue:qbt},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:Wbt}})}updateState(t){const{changeFlags:e,props:i}=t;if(super.updateState(t),e.extensionsChanged){var n;const{gl:t}=this.context;null===(n=this.state.model)||void 0===n||n.delete(),this.state.model=this._getModel(t),this.getAttributeManager().invalidateAll()}e.dataChanged&&function(t){const{header:e,attributes:i}=t;e&&i&&(t.length=e.vertexCount,i.POSITION&&(i.instancePositions=i.POSITION),i.NORMAL&&(i.instanceNormals=i.NORMAL),i.COLOR_0&&(i.instanceColors=i.COLOR_0))}(i.data)}draw({uniforms:t}){const{pointSize:e,sizeUnits:i}=this.props;this.state.model.setUniforms(t).setUniforms({sizeUnits:wut[i],radiusPixels:e}).draw()}_getModel(t){const e=[];for(let t=0;t<3;t++){const i=t/3*Math.PI*2;e.push(2*Math.cos(i),2*Math.sin(i),0)}return new kgt(t,{...this.getShaders(),id:this.props.id,geometry:new Wgt({drawMode:4,attributes:{positions:new Float32Array(e)}}),isInstanced:!0})}}cat(Zbt,"layerName","PointCloudLayer"),cat(Zbt,"defaultProps",Xbt);const Ybt=-1;function Qbt(t,e,i={}){const n=function(t,e={}){return Math.sign(function(t,e={}){const{start:i=0,end:n=t.length}=e,r=e.size||2;let o=0;for(let e=i,s=n-r;e<n;e+=r)o+=(t[e]-t[s])*(t[e+1]+t[s+1]),s=e;return o/2}(t,e))}(t,i);return n!==e&&(function(t,e){const{start:i=0,end:n=t.length,size:r=2}=e,o=(n-i)/r,s=Math.floor(o/2);for(let e=0;e<s;++e){const n=i+e*r,s=i+(o-1-e)*r;for(let e=0;e<r;++e){const i=t[n+e];t[n+e]=t[s+e],t[s+e]=i}}}(t,i),!0)}class Jbt extends Wgt{constructor(t){const{id:e=Pht("column-geometry")}=t,{indices:i,attributes:n}=function(t){const{radius:e,height:i=1,nradial:n=10}=t;let{vertices:r}=t;r&&(dut.assert(r.length>=n),r=r.flatMap((t=>[t[0],t[1]])),Qbt(r,Ybt));const o=i>0,s=n+1,a=o?3*s+1:n,l=2*Math.PI/n,c=new Uint16Array(o?3*n*2:0),u=new Float32Array(3*a),h=new Float32Array(3*a);let p=0;if(o){for(let t=0;t<s;t++){const o=t*l,s=t%n,a=Math.sin(o),c=Math.cos(o);for(let t=0;t<2;t++)u[p+0]=r?r[2*s]:c*e,u[p+1]=r?r[2*s+1]:a*e,u[p+2]=(.5-t)*i,h[p+0]=r?r[2*s]:c,h[p+1]=r?r[2*s+1]:a,p+=3}u[p+0]=u[p-3],u[p+1]=u[p-2],u[p+2]=u[p-1],p+=3}for(let t=o?0:1;t<s;t++){const o=Math.floor(t/2)*Math.sign(.5-t%2),s=o*l,a=(o+n)%n,c=Math.sin(s),d=Math.cos(s);u[p+0]=r?r[2*a]:d*e,u[p+1]=r?r[2*a+1]:c*e,u[p+2]=i/2,h[p+2]=1,p+=3}if(o){let t=0;for(let e=0;e<n;e++)c[t++]=2*e+0,c[t++]=2*e+2,c[t++]=2*e+0,c[t++]=2*e+1,c[t++]=2*e+1,c[t++]=2*e+3}return{indices:c,attributes:{POSITION:{size:3,value:u},NORMAL:{size:3,value:h}}}}(t);super({...t,id:e,indices:i,attributes:n})}}const Kbt=[0,0,0,255],$bt={diskResolution:{type:"number",min:4,value:20},vertices:null,radius:{type:"number",min:0,value:1e3},angle:{type:"number",value:0},offset:{type:"array",value:[0,0]},coverage:{type:"number",min:0,max:1,value:1},elevationScale:{type:"number",min:0,value:1},radiusUnits:"meters",lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,extruded:!0,wireframe:!1,filled:!0,stroked:!1,getPosition:{type:"accessor",value:t=>t.position},getFillColor:{type:"accessor",value:Kbt},getLineColor:{type:"accessor",value:Kbt},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0,getColor:{deprecatedFor:["getFillColor","getLineColor"]}};class twt extends kbt{getShaders(){const{gl:t}=this.context,e=!Iut(t),i={},n=this.props.flatShading&&Mpt(t,wpt);return n&&(i.FLAT_SHADING=1),super.getShaders({vs:"#version 300 es\n\n#define SHADER_NAME column-layer-vertex-shader\n\nin vec3 positions;\nin vec3 normals;\n\nin vec3 instancePositions;\nin float instanceElevations;\nin vec3 instancePositions64Low;\nin vec4 instanceFillColors;\nin vec4 instanceLineColors;\nin float instanceStrokeWidths;\n\nin vec3 instancePickingColors;\nuniform float opacity;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\nuniform bool extruded;\nuniform bool stroked;\nuniform bool isStroke;\nuniform float coverage;\nuniform float elevationScale;\nuniform float edgeDistance;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform int radiusUnits;\nuniform int widthUnits;\nout vec4 vColor;\n#ifdef FLAT_SHADING\nout vec4 position_commonspace;\n#endif\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n\n vec4 color = isStroke ? instanceLineColors : instanceFillColors;\n mat2 rotationMatrix = mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\n float elevation = 0.0;\n float strokeOffsetRatio = 1.0;\n\n if (extruded) {\n elevation = instanceElevations * (positions.z + 1.0) / 2.0 * elevationScale;\n } else if (stroked) {\n float widthPixels = clamp(\n project_size_to_pixel(instanceStrokeWidths * widthScale, widthUnits),\n widthMinPixels, widthMaxPixels) / 2.0;\n float halfOffset = project_pixel_size(widthPixels) / project_size(edgeDistance * coverage * radius);\n if (isStroke) {\n strokeOffsetRatio -= sign(positions.z) * halfOffset;\n } else {\n strokeOffsetRatio -= halfOffset;\n }\n }\n float shouldRender = float(color.a > 0.0 && instanceElevations >= 0.0);\n float dotRadius = radius * coverage * shouldRender;\n\n geometry.pickingColor = instancePickingColors;\n vec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation);\n vec3 centroidPosition64Low = instancePositions64Low;\n vec2 offset = (rotationMatrix * positions.xy * strokeOffsetRatio + offset) * dotRadius;\n if (radiusUnits == UNIT_METERS) {\n offset = project_size(offset);\n }\n vec3 pos = vec3(offset, 0.);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);\n geometry.normal = project_normal(vec3(rotationMatrix * normals.xy, normals.z));\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n if (extruded && !isStroke) {\n#ifdef FLAT_SHADING\n position_commonspace = geometry.position;\n vColor = vec4(color.rgb, color.a * opacity);\n#else\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n vColor = vec4(lightColor, color.a * opacity);\n#endif\n } else {\n vColor = vec4(color.rgb, color.a * opacity);\n }\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME column-layer-fragment-shader\n\nprecision highp float;\n\nuniform vec3 project_uCameraPosition;\nuniform bool extruded;\nuniform bool isStroke;\n\nout vec4 fragColor;\n\nin vec4 vColor;\n#ifdef FLAT_SHADING\nin vec4 position_commonspace;\n#endif\n\nvoid main(void) {\n fragColor = vColor;\n#ifdef FLAT_SHADING\n if (extruded && !isStroke && !picking_uActive) {\n vec3 normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n fragColor.rgb = lighting_getLightColor(vColor.rgb, project_uCameraPosition, position_commonspace.xyz, normal);\n }\n#endif\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",defines:i,transpileToGLSL100:e,modules:[Yvt,n?Mgt:Sgt,Qvt]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instanceFillColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getFillColor",defaultValue:Kbt},instanceLineColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getLineColor",defaultValue:Kbt},instanceStrokeWidths:{size:1,accessor:"getLineWidth",transition:!0}})}updateState(t){super.updateState(t);const{props:e,oldProps:i,changeFlags:n}=t,r=n.extensionsChanged||e.flatShading!==i.flatShading;if(r){var o;const{gl:t}=this.context;null===(o=this.state.model)||void 0===o||o.delete(),this.state.model=this._getModel(t),this.getAttributeManager().invalidateAll()}(r||e.diskResolution!==i.diskResolution||e.vertices!==i.vertices||(e.extruded||e.stroked)!==(i.extruded||i.stroked))&&this._updateGeometry(e)}getGeometry(t,e,i){const n=new Jbt({radius:1,height:i?2:0,vertices:e,nradial:t});let r=0;if(e)for(let i=0;i<t;i++){const n=e[i];r+=Math.sqrt(n[0]*n[0]+n[1]*n[1])/t}else r=1;return this.setState({edgeDistance:Math.cos(Math.PI/t)*r}),n}_getModel(t){return new kgt(t,{...this.getShaders(),id:this.props.id,isInstanced:!0})}_updateGeometry({diskResolution:t,vertices:e,extruded:i,stroked:n}){const r=this.getGeometry(t,e,i||n);this.setState({fillVertexCount:r.attributes.POSITION.value.length/3,wireframeVertexCount:r.indices.value.length}),this.state.model.setProps({geometry:r})}draw({uniforms:t}){const{lineWidthUnits:e,lineWidthScale:i,lineWidthMinPixels:n,lineWidthMaxPixels:r,radiusUnits:o,elevationScale:s,extruded:a,filled:l,stroked:c,wireframe:u,offset:h,coverage:p,radius:d,angle:f}=this.props,{model:m,fillVertexCount:g,wireframeVertexCount:y,edgeDistance:v}=this.state;m.setUniforms(t).setUniforms({radius:d,angle:f/180*Math.PI,offset:h,extruded:a,stroked:c,coverage:p,elevationScale:s,edgeDistance:v,radiusUnits:wut[o],widthUnits:wut[e],widthScale:i,widthMinPixels:n,widthMaxPixels:r}),a&&u&&(m.setProps({isIndexed:!0}),m.setVertexCount(y).setDrawMode(1).setUniforms({isStroke:!0}).draw()),l&&(m.setProps({isIndexed:!1}),m.setVertexCount(g).setDrawMode(5).setUniforms({isStroke:!1}).draw()),!a&&c&&(m.setProps({isIndexed:!1}),m.setVertexCount(2*g/3).setDrawMode(5).setUniforms({isStroke:!0}).draw())}}cat(twt,"layerName","ColumnLayer"),cat(twt,"defaultProps",$bt);class ewt extends twt{getGeometry(t){return new Jgt}draw({uniforms:t}){const{elevationScale:e,extruded:i,offset:n,coverage:r,cellSize:o,angle:s,radiusUnits:a}=this.props;this.state.model.setUniforms(t).setUniforms({radius:o/2,radiusUnits:wut[a],angle:s,offset:n,extruded:i,coverage:r,elevationScale:e,edgeDistance:1,isWireframe:!1}).draw()}}cat(ewt,"layerName","GridCellLayer"),cat(ewt,"defaultProps",{cellSize:{type:"number",min:0,value:1e3},offset:{type:"array",value:[1,1]}});const iwt=-1,nwt=0,rwt=1;new bmt,new bmt;const owt=new bmt,swt=new bmt;class awt{constructor(t=[0,0,0],e=0){cat(this,"center",void 0),cat(this,"radius",void 0),this.radius=-0,this.center=new bmt,this.fromCenterRadius(t,e)}fromCenterRadius(t,e){return this.center.from(t),this.radius=e,this}fromCornerPoints(t,e){return e=owt.from(e),this.center=(new bmt).from(t).add(e).scale(.5),this.radius=this.center.distance(e),this}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}clone(){return new awt(this.center,this.radius)}union(t){const e=this.center,i=this.radius,n=t.center,r=t.radius,o=owt.copy(n).subtract(e),s=o.magnitude();if(i>=s+r)return this.clone();if(r>=s+i)return t.clone();const a=.5*(i+s+r);return swt.copy(o).scale((-i+a)/s).add(e),this.center.copy(swt),this.radius=a,this}expand(t){const e=owt.from(t).subtract(this.center).magnitude();return e>this.radius&&(this.radius=e),this}transform(t){this.center.transform(t);const e=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[4],s=e[5],a=e[6],l=e[8],c=e[9],u=e[10];return t[0]=Math.hypot(i,n,r),t[1]=Math.hypot(o,s,a),t[2]=Math.hypot(l,c,u),t}(owt,t);return this.radius=Math.max(e[0],Math.max(e[1],e[2]))*this.radius,this}distanceSquaredTo(t){const e=this.distanceTo(t);return e*e}distanceTo(t){const e=owt.from(t).subtract(this.center);return Math.max(0,e.len()-this.radius)}intersectPlane(t){const e=this.center,i=this.radius,n=t.normal.dot(e)+t.distance;return n<-i?iwt:n<i?nwt:rwt}}const lwt=new bmt,cwt=new bmt,uwt=new bmt,hwt=new bmt,pwt=new bmt,dwt=new bmt,fwt=new bmt,mwt=0,gwt=1,ywt=2,vwt=3,_wt=4,xwt=5,bwt=6,wwt=7,Awt=8;class Ewt{constructor(t=[0,0,0],e=[0,0,0,0,0,0,0,0,0]){cat(this,"center",void 0),cat(this,"halfAxes",void 0),this.center=(new bmt).from(t),this.halfAxes=new Imt(e)}get halfSize(){const t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2);return[new bmt(t).len(),new bmt(e).len(),new bmt(i).len()]}get quaternion(){const t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2),n=new bmt(t).normalize(),r=new bmt(e).normalize(),o=new bmt(i).normalize();return(new fgt).fromMatrix3(new Imt([...n,...r,...o]))}fromCenterHalfSizeQuaternion(t,e,i){const n=new fgt(i),r=(new Imt).fromQuaternion(n);return r[0]=r[0]*e[0],r[1]=r[1]*e[0],r[2]=r[2]*e[0],r[3]=r[3]*e[1],r[4]=r[4]*e[1],r[5]=r[5]*e[1],r[6]=r[6]*e[2],r[7]=r[7]*e[2],r[8]=r[8]*e[2],this.center=(new bmt).from(t),this.halfAxes=r,this}clone(){return new Ewt(this.center,this.halfAxes)}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(t=new awt){const e=this.halfAxes,i=e.getColumn(0,uwt),n=e.getColumn(1,hwt),r=e.getColumn(2,pwt),o=lwt.copy(i).add(n).add(r);return t.center.copy(this.center),t.radius=o.magnitude(),t}intersectPlane(t){const e=this.center,i=t.normal,n=this.halfAxes,r=i.x,o=i.y,s=i.z,a=Math.abs(r*n[mwt]+o*n[gwt]+s*n[ywt])+Math.abs(r*n[vwt]+o*n[_wt]+s*n[xwt])+Math.abs(r*n[bwt]+o*n[wwt]+s*n[Awt]),l=i.dot(e)+t.distance;return l<=-a?iwt:l>=a?rwt:nwt}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){const e=cwt.from(t).subtract(this.center),i=this.halfAxes,n=i.getColumn(0,uwt),r=i.getColumn(1,hwt),o=i.getColumn(2,pwt),s=n.magnitude(),a=r.magnitude(),l=o.magnitude();n.normalize(),r.normalize(),o.normalize();let c,u=0;return c=Math.abs(e.dot(n))-s,c>0&&(u+=c*c),c=Math.abs(e.dot(r))-a,c>0&&(u+=c*c),c=Math.abs(e.dot(o))-l,c>0&&(u+=c*c),u}computePlaneDistances(t,e,i=[-0,-0]){let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;const o=this.center,s=this.halfAxes,a=s.getColumn(0,uwt),l=s.getColumn(1,hwt),c=s.getColumn(2,pwt),u=dwt.copy(a).add(l).add(c).add(o),h=fwt.copy(u).subtract(t);let p=e.dot(h);return n=Math.min(p,n),r=Math.max(p,r),u.copy(o).add(a).add(l).subtract(c),h.copy(u).subtract(t),p=e.dot(h),n=Math.min(p,n),r=Math.max(p,r),u.copy(o).add(a).subtract(l).add(c),h.copy(u).subtract(t),p=e.dot(h),n=Math.min(p,n),r=Math.max(p,r),u.copy(o).add(a).subtract(l).subtract(c),h.copy(u).subtract(t),p=e.dot(h),n=Math.min(p,n),r=Math.max(p,r),o.copy(u).subtract(a).add(l).add(c),h.copy(u).subtract(t),p=e.dot(h),n=Math.min(p,n),r=Math.max(p,r),o.copy(u).subtract(a).add(l).subtract(c),h.copy(u).subtract(t),p=e.dot(h),n=Math.min(p,n),r=Math.max(p,r),o.copy(u).subtract(a).subtract(l).add(c),h.copy(u).subtract(t),p=e.dot(h),n=Math.min(p,n),r=Math.max(p,r),o.copy(u).subtract(a).subtract(l).subtract(c),h.copy(u).subtract(t),p=e.dot(h),n=Math.min(p,n),r=Math.max(p,r),i[0]=n,i[1]=r,i}transform(t){this.center.transformAsPoint(t);const e=this.halfAxes.getColumn(0,uwt);e.transformAsPoint(t);const i=this.halfAxes.getColumn(1,hwt);i.transformAsPoint(t);const n=this.halfAxes.getColumn(2,pwt);return n.transformAsPoint(t),this.halfAxes=new Imt([...e,...i,...n]),this}getTransform(){throw new Error("not implemented")}}const Swt=new bmt,Mwt=new bmt;class Twt{constructor(t=[0,0,1],e=0){cat(this,"normal",void 0),cat(this,"distance",void 0),this.normal=new bmt,this.distance=-0,this.fromNormalDistance(t,e)}fromNormalDistance(t,e){return kft(Number.isFinite(e)),this.normal.from(t).normalize(),this.distance=e,this}fromPointNormal(t,e){t=Swt.from(t),this.normal.from(e).normalize();const i=-this.normal.dot(t);return this.distance=i,this}fromCoefficients(t,e,i,n){return this.normal.set(t,e,i),kft(qft(this.normal.len(),1)),this.distance=n,this}clone(){return new Twt(this.normal,this.distance)}equals(t){return qft(this.distance,t.distance)&&qft(this.normal,t.normal)}getPointDistance(t){return this.normal.dot(t)+this.distance}transform(t){const e=Mwt.copy(this.normal).transformAsVector(t).normalize(),i=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(i,e)}projectPointOntoPlane(t,e=[0,0,0]){t=Swt.from(t);const i=this.getPointDistance(t),n=Mwt.copy(this.normal).scale(i);return t.subtract(n).to(e)}}const Iwt=[new bmt([1,0,0]),new bmt([0,1,0]),new bmt([0,0,1])],Cwt=new bmt,Pwt=new bmt;new Twt(new bmt(1,0,0),0);class Lwt{constructor(t=[]){cat(this,"planes",void 0),this.planes=t}fromBoundingSphere(t){this.planes.length=2*Iwt.length;const e=t.center,i=t.radius;let n=0;for(const t of Iwt){let r=this.planes[n],o=this.planes[n+1];r||(r=this.planes[n]=new Twt),o||(o=this.planes[n+1]=new Twt);const s=Cwt.copy(t).scale(-i).add(e);t.dot(s),r.fromPointNormal(s,t);const a=Cwt.copy(t).scale(i).add(e),l=Pwt.copy(t).negate();l.dot(a),o.fromPointNormal(a,l),n+=2}return this}computeVisibility(t){let e=rwt;for(const i of this.planes){switch(t.intersectPlane(i)){case iwt:return iwt;case nwt:e=nwt}}return e}computeVisibilityWithPlaneMask(t,e){if(kft(Number.isFinite(e),"parentPlaneMask is required."),e===Lwt.MASK_OUTSIDE||e===Lwt.MASK_INSIDE)return e;let i=Lwt.MASK_INSIDE;const n=this.planes;for(let r=0;r<this.planes.length;++r){const o=r<31?1<<r:0;if(r<31&&0==(e&o))continue;const s=n[r],a=t.intersectPlane(s);if(a===iwt)return Lwt.MASK_OUTSIDE;a===nwt&&(i|=o)}return i}}cat(Lwt,"MASK_OUTSIDE",4294967295),cat(Lwt,"MASK_INSIDE",0),cat(Lwt,"MASK_INDETERMINATE",2147483647),new bmt,new bmt,new bmt,new bmt,new bmt,new bmt,new bmt,new bmt,new bmt,new bmt,new bmt,new bmt,new bmt,new bmt,new bmt,new bmt,new bmt;const Dwt=new Imt,Rwt=new Imt,Owt=new Imt,kwt=new Imt,Nwt=new Imt;function Bwt(t,e={}){const i=mgt.EPSILON20;let n=0,r=0;const o=Rwt,s=Owt;o.identity(),s.copy(t);const a=i*function(t){let e=0;for(let i=0;i<9;++i){const n=t[i];e+=n*n}return Math.sqrt(e)}(s);for(;r<10&&Vwt(s)>a;)Uwt(s,kwt),Nwt.copy(kwt).transpose(),s.multiplyRight(kwt),s.multiplyLeft(Nwt),o.multiplyRight(kwt),++n>2&&(++r,n=0);return e.unitary=o.toTarget(e.unitary),e.diagonal=s.toTarget(e.diagonal),e}const zwt=[1,0,0],Fwt=[2,2,1];function Vwt(t){let e=0;for(let i=0;i<3;++i){const n=t[Dwt.getElementIndex(Fwt[i],zwt[i])];e+=2*n*n}return Math.sqrt(e)}function Uwt(t,e){const i=mgt.EPSILON15;let n=0,r=1;for(let e=0;e<3;++e){const i=Math.abs(t[Dwt.getElementIndex(Fwt[e],zwt[e])]);i>n&&(r=e,n=i)}const o=zwt[r],s=Fwt[r];let a=1,l=0;if(Math.abs(t[Dwt.getElementIndex(s,o)])>i){const e=(t[Dwt.getElementIndex(s,s)]-t[Dwt.getElementIndex(o,o)])/2/t[Dwt.getElementIndex(s,o)];let i;i=e<0?-1/(-e+Math.sqrt(1+e*e)):1/(e+Math.sqrt(1+e*e)),a=1/Math.sqrt(1+i*i),l=i*a}return Imt.IDENTITY.to(e),e[Dwt.getElementIndex(o,o)]=e[Dwt.getElementIndex(s,s)]=a,e[Dwt.getElementIndex(s,o)]=l,e[Dwt.getElementIndex(o,s)]=-l,e}const Gwt=new bmt,jwt=new bmt,Hwt=new bmt,Wwt=new bmt,qwt=new bmt,Xwt=new Imt,Zwt={diagonal:new Imt,unitary:new Imt};const Ywt=Math.PI/180,Qwt=new Float32Array(16),Jwt=new Float32Array(12);function Kwt(t,e,i){const n=e[0]*Ywt,r=e[1]*Ywt,o=e[2]*Ywt,s=Math.sin(o),a=Math.sin(n),l=Math.sin(r),c=Math.cos(o),u=Math.cos(n),h=Math.cos(r),p=i[0],d=i[1],f=i[2];t[0]=p*h*u,t[1]=p*l*u,t[2]=p*-a,t[3]=d*(-l*c+h*a*s),t[4]=d*(h*c+l*a*s),t[5]=d*u*s,t[6]=f*(l*s+h*a*c),t[7]=f*(-h*s+l*a*c),t[8]=f*u*c}function $wt(t){return t[0]=t[0],t[1]=t[1],t[2]=t[2],t[3]=t[4],t[4]=t[5],t[5]=t[6],t[6]=t[8],t[7]=t[9],t[8]=t[10],t[9]=t[12],t[10]=t[13],t[11]=t[14],t.subarray(0,12)}const tAt={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,elementOffset:0},instanceModelMatrix__LOCATION_1:{size:3,elementOffset:3},instanceModelMatrix__LOCATION_2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update(t,{startRow:e,endRow:i}){const{data:n,getOrientation:r,getScale:o,getTranslation:s,getTransformMatrix:a}=this.props,l=Array.isArray(a),c=l&&16===a.length,u=Array.isArray(o),h=Array.isArray(r),p=Array.isArray(s),d=c||!l&&Boolean(a(n[0]));t.constant=d?c:h&&u&&p;const f=t.value;if(t.constant){let e;if(d)Qwt.set(a),e=$wt(Qwt);else{e=Jwt;Kwt(e,r,o),e.set(s,9)}t.value=new Float32Array(e)}else{let l=e*t.size;const{iterable:m,objectInfo:g}=Nxt(n,e,i);for(const t of m){let e;if(g.index++,d)Qwt.set(c?a:a(t,g)),e=$wt(Qwt);else{e=Jwt;Kwt(e,h?r:r(t,g),u?o:o(t,g)),e.set(p?s:s(t,g),9)}f[l++]=e[0],f[l++]=e[1],f[l++]=e[2],f[l++]=e[3],f[l++]=e[4],f[l++]=e[5],f[l++]=e[6],f[l++]=e[7],f[l++]=e[8],f[l++]=e[9],f[l++]=e[10],f[l++]=e[11]}}}};function eAt(t,e){return e===xut.CARTESIAN||e===xut.METER_OFFSETS||e===xut.DEFAULT&&!t.isGeospatial}function iAt(t){let e=1/0,i=1/0,n=1/0,r=-1/0,o=-1/0,s=-1/0;const a=t.POSITION?t.POSITION.value:[],l=a&&a.length;for(let t=0;t<l;t+=3){const l=a[t],c=a[t+1],u=a[t+2];e=l<e?l:e,i=c<i?c:i,n=u<n?u:n,r=l>r?l:r,o=c>o?c:o,s=u>s?u:s}return[[e,i,n],[r,o,s]]}class nAt{constructor(t,e){cat(this,"fields",void 0),cat(this,"metadata",void 0),function(t,e){if(!t)throw new Error(e||"loader assertion failed.")}(Array.isArray(t)),function(t){const e={};for(const i of t)e[i.name]&&console.warn("Schema: duplicated field name",i.name,i),e[i.name]=!0}(t),this.fields=t,this.metadata=e||new Map}compareTo(t){if(this.metadata!==t.metadata)return!1;if(this.fields.length!==t.fields.length)return!1;for(let e=0;e<this.fields.length;++e)if(!this.fields[e].compareTo(t.fields[e]))return!1;return!0}select(){const t=Object.create(null);for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];for(const e of i)t[e]=!0;const r=this.fields.filter((e=>t[e.name]));return new nAt(r,this.metadata)}selectAt(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];const n=e.map((t=>this.fields[t])).filter(Boolean);return new nAt(n,this.metadata)}assign(t){let e,i=this.metadata;if(t instanceof nAt){const n=t;e=n.fields,i=rAt(rAt(new Map,this.metadata),n.metadata)}else e=t;const n=Object.create(null);for(const t of this.fields)n[t.name]=t;for(const t of e)n[t.name]=t;const r=Object.values(n);return new nAt(r,i)}}function rAt(t,e){return new Map([...t||new Map,...e||new Map])}class oAt{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Map;cat(this,"name",void 0),cat(this,"type",void 0),cat(this,"nullable",void 0),cat(this,"metadata",void 0),this.name=t,this.type=e,this.nullable=i,this.metadata=n}get typeId(){return this.type&&this.type.typeId}clone(){return new oAt(this.name,this.type,this.nullable,this.metadata)}compareTo(t){return this.name===t.name&&this.type===t.type&&this.nullable===t.nullable&&this.metadata===t.metadata}toString(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}let sAt,aAt,lAt,cAt=function(t){return t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.Float=3]="Float",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct=13]="Struct",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Dictionary=-1]="Dictionary",t[t.Int8=-2]="Int8",t[t.Int16=-3]="Int16",t[t.Int32=-4]="Int32",t[t.Int64=-5]="Int64",t[t.Uint8=-6]="Uint8",t[t.Uint16=-7]="Uint16",t[t.Uint32=-8]="Uint32",t[t.Uint64=-9]="Uint64",t[t.Float16=-10]="Float16",t[t.Float32=-11]="Float32",t[t.Float64=-12]="Float64",t[t.DateDay=-13]="DateDay",t[t.DateMillisecond=-14]="DateMillisecond",t[t.TimestampSecond=-15]="TimestampSecond",t[t.TimestampMillisecond=-16]="TimestampMillisecond",t[t.TimestampMicrosecond=-17]="TimestampMicrosecond",t[t.TimestampNanosecond=-18]="TimestampNanosecond",t[t.TimeSecond=-19]="TimeSecond",t[t.TimeMillisecond=-20]="TimeMillisecond",t[t.TimeMicrosecond=-21]="TimeMicrosecond",t[t.TimeNanosecond=-22]="TimeNanosecond",t[t.DenseUnion=-23]="DenseUnion",t[t.SparseUnion=-24]="SparseUnion",t[t.IntervalDayTime=-25]="IntervalDayTime",t[t.IntervalYearMonth=-26]="IntervalYearMonth",t}({});class uAt{static isNull(t){return t&&t.typeId===cAt.Null}static isInt(t){return t&&t.typeId===cAt.Int}static isFloat(t){return t&&t.typeId===cAt.Float}static isBinary(t){return t&&t.typeId===cAt.Binary}static isUtf8(t){return t&&t.typeId===cAt.Utf8}static isBool(t){return t&&t.typeId===cAt.Bool}static isDecimal(t){return t&&t.typeId===cAt.Decimal}static isDate(t){return t&&t.typeId===cAt.Date}static isTime(t){return t&&t.typeId===cAt.Time}static isTimestamp(t){return t&&t.typeId===cAt.Timestamp}static isInterval(t){return t&&t.typeId===cAt.Interval}static isList(t){return t&&t.typeId===cAt.List}static isStruct(t){return t&&t.typeId===cAt.Struct}static isUnion(t){return t&&t.typeId===cAt.Union}static isFixedSizeBinary(t){return t&&t.typeId===cAt.FixedSizeBinary}static isFixedSizeList(t){return t&&t.typeId===cAt.FixedSizeList}static isMap(t){return t&&t.typeId===cAt.Map}static isDictionary(t){return t&&t.typeId===cAt.Dictionary}get typeId(){return cAt.NONE}compareTo(t){return this===t}}sAt=Symbol.toStringTag;class hAt extends uAt{constructor(t,e){super(),cat(this,"isSigned",void 0),cat(this,"bitWidth",void 0),this.isSigned=t,this.bitWidth=e}get typeId(){return cAt.Int}get[sAt](){return"Int"}toString(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}class pAt extends hAt{constructor(){super(!0,8)}}class dAt extends hAt{constructor(){super(!0,16)}}class fAt extends hAt{constructor(){super(!0,32)}}class mAt extends hAt{constructor(){super(!1,8)}}class gAt extends hAt{constructor(){super(!1,16)}}class yAt extends hAt{constructor(){super(!1,32)}}const vAt=32,_At=64;aAt=Symbol.toStringTag;class xAt extends uAt{constructor(t){super(),cat(this,"precision",void 0),this.precision=t}get typeId(){return cAt.Float}get[aAt](){return"Float"}toString(){return"Float".concat(this.precision)}}class bAt extends xAt{constructor(){super(vAt)}}class wAt extends xAt{constructor(){super(_At)}}lAt=Symbol.toStringTag;class AAt extends uAt{constructor(t,e){super(),cat(this,"listSize",void 0),cat(this,"children",void 0),this.listSize=t,this.children=[e]}get typeId(){return cAt.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[lAt](){return"FixedSizeList"}toString(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}function EAt(t,e,i){const n=function(t){switch(t.constructor){case Int8Array:return new pAt;case Uint8Array:return new mAt;case Int16Array:return new dAt;case Uint16Array:return new gAt;case Int32Array:return new fAt;case Uint32Array:return new yAt;case Float32Array:return new bAt;case Float64Array:return new wAt;default:throw new Error("array type not supported")}}(e.value),r=i||function(t){const e=new Map;"byteOffset"in t&&e.set("byteOffset",t.byteOffset.toString(10));"byteStride"in t&&e.set("byteStride",t.byteStride.toString(10));"normalized"in t&&e.set("normalized",t.normalized.toString());return e}(e);return new oAt(t,new AAt(e.size,new oAt("value",n)),!1,r)}function SAt(t,e){(t.COLOR_0||t.colors)&&e||(t.colors={constant:!0,value:new Float32Array([1,1,1])}),dut.assert(t.positions||t.POSITION,'no "postions" or "POSITION" attribute in mesh')}function MAt(t,e){if(t.attributes)return SAt(t.attributes,e),t instanceof Wgt?t:new Wgt(t);if(t.positions||t.POSITION)return SAt(t,e),new Wgt({attributes:t});throw Error("Invalid mesh")}const TAt={mesh:{type:"object",value:null,async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_useMeshColors:{type:"boolean",value:!1},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:t=>t.position},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},textureParameters:{type:"object",ignore:!0}};class IAt extends kbt{constructor(...t){super(...t),cat(this,"state",void 0)}getShaders(){const t=!Iut(this.context.gl),e={};return Mpt(this.context.gl,wpt)&&(e.DERIVATIVES_AVAILABLE=1),super.getShaders({vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n geometry.pickingColor = instancePickingColors;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n\n if (composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n geometry.worldPosition += pos;\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\n geometry.position = position_commonspace;\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\n geometry.position = position_commonspace;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n }\n\n geometry.normal = normals_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n DECKGL_FILTER_COLOR(color, geometry);\n\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n}\n",modules:[Yvt,Mgt,Qvt],transpileToGLSL100:t,defines:e})}getBounds(){var t;if(this.props._instanced)return super.getBounds();let e=this.state.positionBounds;if(e)return e;const{mesh:i}=this.props;if(!i)return null;if(e=null===(t=i.header)||void 0===t?void 0:t.boundingBox,!e){const{attributes:t}=MAt(i,this.props._useMeshColors);t.POSITION=t.POSITION||t.positions,e=iAt(t)}return this.state.positionBounds=e,e}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:5130,fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:tAt}),this.setState({emptyTexture:new tpt(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}updateState(t){super.updateState(t);const{props:e,oldProps:i,changeFlags:n}=t;if(e.mesh!==i.mesh||n.extensionsChanged){var r;if(this.state.positionBounds=null,null===(r=this.state.model)||void 0===r||r.delete(),e.mesh){this.state.model=this.getModel(e.mesh);const t=e.mesh.attributes||e.mesh;this.setState({hasNormals:Boolean(t.NORMAL||t.normals)})}this.getAttributeManager().invalidateAll()}e.texture!==i.texture&&this.setTexture(e.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}finalizeState(t){super.finalizeState(t),this.state.emptyTexture.delete()}draw({uniforms:t}){if(!this.state.model)return;const{viewport:e}=this.context,{sizeScale:i,coordinateSystem:n,_instanced:r}=this.props;this.state.model.setUniforms(t).setUniforms({sizeScale:i,composeModelMatrix:!r||eAt(e,n),flatShading:!this.state.hasNormals}).draw()}get isLoaded(){var t;return(null===(t=this.state)||void 0===t?void 0:t.model)&&super.isLoaded}getModel(t){const e=new kgt(this.context.gl,{...this.getShaders(),id:this.props.id,geometry:MAt(t,this.props._useMeshColors),isInstanced:!0}),{texture:i}=this.props,{emptyTexture:n}=this.state;return e.setUniforms({sampler:i||n,hasTexture:Boolean(i)}),e}setTexture(t){const{emptyTexture:e,model:i}=this.state;i&&i.setUniforms({sampler:t||e,hasTexture:Boolean(t)})}}cat(IAt,"defaultProps",TAt),cat(IAt,"layerName","SimpleMeshLayer");class CAt{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{id:e}=t;this.id=e||Pht(this.constructor.name),this.display=!0,this.position=new bmt,this.rotation=new bmt,this.scale=new bmt(1,1,1),this.matrix=new Xmt,this.userData={},this.props={},this._setScenegraphNodeProps(t)}delete(){}setProps(t){return this._setScenegraphNodeProps(t),this}toString(){return"{type: ScenegraphNode, id: ".concat(this.id,")}")}getBounds(){return null}setPosition(t){return Mht(3===t.length,"setPosition requires vector argument"),this.position=t,this}setRotation(t){return Mht(3===t.length,"setRotation requires vector argument"),this.rotation=t,this}setScale(t){return Mht(3===t.length,"setScale requires vector argument"),this.scale=t,this}setMatrix(t){!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.matrix.copy(t):this.matrix=t}setMatrixComponents(t){let{position:e,rotation:i,scale:n,update:r=!0}=t;return e&&this.setPosition(e),i&&this.setRotation(i),n&&this.setScale(n),r&&this.updateMatrix(),this}updateMatrix(){const t=this.position,e=this.rotation,i=this.scale;return this.matrix.identity(),this.matrix.translate(t),this.matrix.rotateXYZ(e),this.matrix.scale(i),this}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{position:e,rotation:i,scale:n}=t;return e&&this.setPosition(e),i&&this.setRotation(i),n&&this.setScale(n),this.updateMatrix(),this}getCoordinateUniforms(t,e){Mht(t),e=e||this.matrix;const i=new Xmt(t).multiplyRight(e),n=i.invert(),r=n.transpose();return{viewMatrix:t,modelMatrix:e,objectMatrix:e,worldMatrix:i,worldInverseMatrix:n,worldInverseTransposeMatrix:r}}_setScenegraphNodeProps(t){"display"in t&&(this.display=t.display),"position"in t&&this.setPosition(t.position),"rotation"in t&&this.setRotation(t.rotation),"scale"in t&&this.setScale(t.scale),"matrix"in t&&this.setMatrix(t.matrix),Object.assign(this.props,t)}}class PAt extends CAt{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=Array.isArray(t)?{children:t}:t;const{children:e=[]}=t;Eut.assert(e.every((t=>t instanceof CAt)),"every child must an instance of ScenegraphNode"),super(t),this.children=e}add(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];for(const t of e)Array.isArray(t)?this.add(...t):this.children.push(t);return this}remove(t){const e=this.children,i=e.indexOf(t);return i>-1&&e.splice(i,1),this}removeAll(){return this.children=[],this}delete(){this.children.forEach((t=>t.delete())),this.removeAll(),super.delete()}getBounds(){const t=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];return this.traverse(((e,i)=>{let{worldMatrix:n}=i;const r=e.getBounds();if(!r)return;const[o,s]=r,a=new bmt(o).add(s).divide([2,2,2]);n.transformAsPoint(a,a);const l=new bmt(s).subtract(o).divide([2,2,2]);n.transformAsVector(l,l);for(let e=0;e<8;e++){const i=new bmt(1&e?-1:1,2&e?-1:1,4&e?-1:1).multiply(l).add(a);for(let e=0;e<3;e++)t[0][e]=Math.min(t[0][e],i[e]),t[1][e]=Math.max(t[1][e],i[e])}})),Number.isFinite(t[0][0])?t:null}traverse(t){let{worldMatrix:e=new Xmt}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=new Xmt(e).multiplyRight(this.matrix);for(const e of this.children)e instanceof PAt?e.traverse(t,{worldMatrix:i}):t(e,{worldMatrix:i})}}const LAt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},DAt={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function RAt(t){if(!t._animation){const e=DAt[t.componentType],i=LAt[t.type],n=i*t.count,{buffer:r,byteOffset:o}=t.bufferView.data,s=new e(r,o+(t.byteOffset||0),n);if(1===i)t._animation=Array.from(s);else{const e=[];for(let t=0;t<s.length;t+=i)e.push(Array.from(s.slice(t,t+i)));t._animation=e}}return t._animation}const OAt=new Xmt;const kAt=new fgt;function NAt(t,e,i,n){let{input:r,interpolation:o,output:s}=e;const a=t%r[r.length-1],l=r.findIndex((t=>t>=a)),c=Math.max(0,l-1);if(!Array.isArray(i[n]))switch(n){case"translation":i[n]=[0,0,0];break;case"rotation":i[n]=[0,0,0,1];break;case"scale":i[n]=[1,1,1];break;default:Eut.warn("Bad animation path ".concat(n))()}Mht(i[n].length===s[c].length);const u=r[c],h=r[l];switch(o){case"STEP":!function(t,e,i){for(let n=0;n<i.length;n++)t[e][n]=i[n]}(i,n,s[c]);break;case"LINEAR":if(h>u){const t=(a-u)/(h-u);!function(t,e,i,n,r){if("rotation"===e){kAt.slerp({start:i,target:n,ratio:r});for(let i=0;i<kAt.length;i++)t[e][i]=kAt[i]}else for(let o=0;o<i.length;o++)t[e][o]=r*n[o]+(1-r)*i[o]}(i,n,s[c],s[l],t)}break;case"CUBICSPLINE":if(h>u){const t=(a-u)/(h-u),e=h-u;!function(t,e,i){let{p0:n,outTangent0:r,inTangent1:o,p1:s,tDiff:a,ratio:l}=i;for(let i=0;i<t[e].length;i++){const c=r[i]*a,u=o[i]*a;t[e][i]=(2*Math.pow(l,3)-3*Math.pow(l,2)+1)*n[i]+(Math.pow(l,3)-2*Math.pow(l,2)+l)*c+(-2*Math.pow(l,3)+3*Math.pow(l,2))*s[i]+(Math.pow(l,3)-Math.pow(l,2))*u}}(i,n,{p0:s[3*c+1],outTangent0:s[3*c+2],inTangent1:s[3*l+0],p1:s[3*l+1],tDiff:e,ratio:t})}break;default:Eut.warn("Interpolation ".concat(o," not supported"))()}}class BAt{constructor(t){this.startTime=0,this.playing=!0,this.speed=1,this.channels=[],Object.assign(this,t)}animate(t){if(!this.playing)return;const e=(t/1e3-this.startTime)*this.speed;this.channels.forEach((t=>{let{sampler:i,target:n,path:r}=t;NAt(e,i,n,r),function(t,e){if(e.matrix.identity(),t.translation&&e.matrix.translate(t.translation),t.rotation){const i=OAt.fromQuaternion(t.rotation);e.matrix.multiplyRight(i)}t.scale&&e.matrix.scale(t.scale)}(n,n._node)}))}}class zAt{constructor(t){this.animations=t.animations.map(((e,i)=>{const n=e.name||"Animation-".concat(i),r=e.samplers.map((e=>{let{input:i,interpolation:n="LINEAR",output:r}=e;return{input:RAt(t.accessors[i]),interpolation:n,output:RAt(t.accessors[r])}})),o=e.channels.map((e=>{let{sampler:i,target:n}=e;return{sampler:r[i],target:t.nodes[n.node],path:n.path}}));return new BAt({name:n,channels:o})}))}animate(t){this.setTime(t)}setTime(t){this.animations.forEach((e=>e.animate(t)))}getAnimations(){return this.animations}}class FAt extends CAt{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(e),this.onBeforeRender=null,this.AfterRender=null,t instanceof kgt?(this.model=t,this._setModelNodeProps(e)):this.model=new kgt(t,e),this.bounds=null,this.managedResources=e.managedResources||[]}setProps(t){return super.setProps(t),this._setModelNodeProps(t),this}getBounds(){return this.bounds}delete(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach((t=>t.delete())),this.managedResources=[]}draw(){return this.model.draw(...arguments)}setUniforms(){return this.model.setUniforms(...arguments),this}setAttributes(){return this.model.setAttributes(...arguments),this}updateModuleSettings(){return this.model.updateModuleSettings(...arguments),this}_setModelNodeProps(t){this.model.setProps(t)}}class VAt{constructor(t,e){let{attributes:i,material:n,pbrDebug:r,imageBasedLightingEnvironment:o,lights:s,useTangents:a}=e;this.gl=t,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},Mpt(t,Apt)&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],o&&(this.uniforms.u_DiffuseEnvSampler=o.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=o.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=o.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),r&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(i.NORMAL,"HAS_NORMALS"),this.defineIfPresent(i.TANGENT&&a,"HAS_TANGENTS"),this.defineIfPresent(i.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(o,"USE_IBL"),this.defineIfPresent(s,"USE_LIGHTS"),this.defineIfPresent(r,"PBR_DEBUG"),n&&this.parseMaterial(n)}defineIfPresent(t,e){t&&(this.defines[e]=1)}parseTexture(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=t.texture&&t.texture.sampler&&t.texture.sampler.parameters||{},r=t.texture.source.image;let o,s={};r.compressed?(o=r,s={[this.gl.TEXTURE_MIN_FILTER]:r.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR}):o={data:r};const a=new tpt(this.gl,{id:t.name||t.id,parameters:{...n,...s},pixelStore:{[this.gl.UNPACK_FLIP_Y_WEBGL]:!1},...o});this.uniforms[e]=a,this.defineIfPresent(i,i),this.generatedTextures.push(a)}parsePbrMetallicRoughness(t){t.baseColorTexture&&this.parseTexture(t.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=t.baseColorFactor||[1,1,1,1],t.metallicRoughnessTexture&&this.parseTexture(t.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");const{metallicFactor:e=1,roughnessFactor:i=1}=t;this.uniforms.u_MetallicRoughnessValues=[e,i]}parseMaterial(t){if(this.uniforms.pbr_uUnlit=Boolean(t.unlit),t.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(t.pbrMetallicRoughness),t.normalTexture){this.parseTexture(t.normalTexture,"u_NormalSampler","HAS_NORMALMAP");const{scale:e=1}=t.normalTexture;this.uniforms.u_NormalScale=e}if(t.occlusionTexture){this.parseTexture(t.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");const{strength:e=1}=t.occlusionTexture;this.uniforms.u_OcclusionStrength=e}if(t.emissiveTexture&&(this.parseTexture(t.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=t.emissiveFactor||[0,0,0]),"MASK"===t.alphaMode){const{alphaCutoff:e=.5}=t;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=e}else"BLEND"===t.alphaMode&&(Eut.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}delete(){this.generatedTextures.forEach((t=>t.delete()))}}function UAt(t,e){return Iut(t)?"#version 300 es\n".concat(e):e}const GAt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},jAt={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class HAt{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.gl=t,this.options=Object.assign({},jAt,e)}instantiate(t){this.gltf=t;return(t.scenes||[]).map((t=>this.createScene(t)))}createAnimator(){return Array.isArray(this.gltf.animations)?new zAt(this.gltf):null}createScene(t){const e=(t.nodes||[]).map((t=>this.createNode(t)));return new PAt({id:t.name||t.id,children:e})}createNode(t){if(!t._node){const e=(t.children||[]).map((t=>this.createNode(t)));t.mesh&&e.push(this.createMesh(t.mesh));const i=new PAt({id:t.name||t.id,children:e});if(t.matrix)i.setMatrix(t.matrix);else{if(i.matrix.identity(),t.translation&&i.matrix.translate(t.translation),t.rotation){const e=(new Xmt).fromQuaternion(t.rotation);i.matrix.multiplyRight(e)}t.scale&&i.matrix.scale(t.scale)}t._node=i}return t._node}createMesh(t){if(!t._mesh){const e=(t.primitives||[]).map(((e,i)=>this.createPrimitive(e,i,t))),i=new PAt({id:t.name||t.id,children:e});t._mesh=i}return t._mesh}getVertexCount(t){Eut.warn("getVertexCount() not found")()}createPrimitive(t,e,i){const n=function(t,e){const{id:i,drawMode:n,vertexCount:r,attributes:o,modelOptions:s}=e,a=new VAt(t,e);Eut.info(4,"createGLTFModel defines: ",a.defines)();const l=[];l.push(...a.generatedTextures),l.push(...Object.values(o).map((t=>t.buffer)));const c=new FAt(t,{id:i,drawMode:n,vertexCount:r,modules:[Tgt],parameters:a.parameters,vs:UAt(t,"\n#if (__VERSION__ < 300)\n #define _attr attribute\n#else\n #define _attr in\n#endif\n\n _attr vec4 POSITION;\n\n #ifdef HAS_NORMALS\n _attr vec4 NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _attr vec4 TANGENT;\n #endif\n\n #ifdef HAS_UV\n _attr vec2 TEXCOORD_0;\n #endif\n\n void main(void) {\n vec4 _NORMAL = vec4(0.);\n vec4 _TANGENT = vec4(0.);\n vec2 _TEXCOORD_0 = vec2(0.);\n\n #ifdef HAS_NORMALS\n _NORMAL = NORMAL;\n #endif\n\n #ifdef HAS_TANGENTS\n _TANGENT = TANGENT;\n #endif\n\n #ifdef HAS_UV\n _TEXCOORD_0 = TEXCOORD_0;\n #endif\n\n pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n gl_Position = u_MVPMatrix * POSITION;\n }\n"),fs:UAt(t,"\n#if (__VERSION__ < 300)\n #define fragmentColor gl_FragColor\n#else\n out vec4 fragmentColor;\n#endif\n\n void main(void) {\n fragmentColor = pbr_filterColor(vec4(0));\n }\n"),managedResources:l,...s,defines:{...a.defines,...s.defines}});return c.setProps({attributes:o}),c.setUniforms(a.uniforms),c}(this.gl,Object.assign({id:t.name||"".concat(i.name||i.id,"-primitive-").concat(e),drawMode:t.mode||4,vertexCount:t.indices?t.indices.count:this.getVertexCount(t.attributes),attributes:this.createAttributes(t.attributes,t.indices),material:t.material},this.options));return n.bounds=[t.attributes.POSITION.min,t.attributes.POSITION.max],n}createAttributes(t,e){const i={};return Object.keys(t).forEach((e=>{i[e]=this.createAccessor(t[e],this.createBuffer(t[e],this.gl.ARRAY_BUFFER))})),e&&(i.indices=this.createAccessor(e,this.createBuffer(e,this.gl.ELEMENT_ARRAY_BUFFER))),Eut.info(4,"glTF Attributes",{attributes:t,indices:e,generated:i})(),i}createBuffer(t,e){t.bufferView||(t.bufferView={});const{bufferView:i}=t;return i.lumaBuffers||(i.lumaBuffers={}),i.lumaBuffers[e]||(i.lumaBuffers[e]=new Xht(this.gl,{id:"from-".concat(i.id),data:i.data||t.value,target:e})),i.lumaBuffers[e]}createAccessor(t,e){return new jht({buffer:e,offset:t.byteOffset||0,stride:t.bufferView.byteStride||0,type:t.componentType,size:GAt[t.type]})}createSampler(t){return t}needsPOT(){return!1}}const WAt="3.4.14",qAt="https://unpkg.com/@loaders.gl/textures@".concat(WAt,"/dist/libs/basis_encoder.wasm"),XAt="https://unpkg.com/@loaders.gl/textures@".concat(WAt,"/dist/libs/basis_encoder.js");let ZAt,YAt;async function QAt(t){const e=t.modules||{};return e.basis?e.basis:(ZAt=ZAt||async function(t){let e=null,i=null;return[e,i]=await Promise.all([await Fat("basis_transcoder.js","textures",t),await Fat("basis_transcoder.wasm","textures",t)]),e=e||globalThis.BASIS,await function(t,e){const i={};e&&(i.wasmBinary=e);return new Promise((e=>{t(i).then((t=>{const{BasisFile:i,initializeBasis:n}=t;n(),e({BasisFile:i})}))}))}(e,i)}(t),await ZAt)}async function JAt(t){const e=t.modules||{};return e.basisEncoder?e.basisEncoder:(YAt=YAt||async function(t){let e=null,i=null;return[e,i]=await Promise.all([await Fat(XAt,"textures",t),await Fat(qAt,"textures",t)]),e=e||globalThis.BASIS,await function(t,e){const i={};e&&(i.wasmBinary=e);return new Promise((e=>{t(i).then((t=>{const{BasisFile:i,KTX2File:n,initializeBasis:r,BasisEncoder:o}=t;r(),e({BasisFile:i,KTX2File:n,BasisEncoder:o})}))}))}(e,i)}(t),await YAt)}const KAt=33776,$At=33779,tEt=35840,eEt=35842,iEt=36196,nEt=37808,rEt=["","WEBKIT_","MOZ_"],oEt={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"};let sEt=null;function aEt(t){if(!sEt){t=t||function(){try{return document.createElement("canvas").getContext("webgl")}catch(t){return null}}()||void 0,sEt=new Set;for(const e of rEt)for(const i in oEt)if(t&&t.getExtension("".concat(e).concat(i))){const t=oEt[i];sEt.add(t)}}return sEt}var lEt,cEt,uEt,hEt,pEt,dEt,fEt,mEt,gEt;(gEt=lEt||(lEt={}))[gEt.NONE=0]="NONE",gEt[gEt.BASISLZ=1]="BASISLZ",gEt[gEt.ZSTD=2]="ZSTD",gEt[gEt.ZLIB=3]="ZLIB",function(t){t[t.BASICFORMAT=0]="BASICFORMAT"}(cEt||(cEt={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.ETC1S=163]="ETC1S",t[t.UASTC=166]="UASTC"}(uEt||(uEt={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.SRGB=1]="SRGB"}(hEt||(hEt={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.LINEAR=1]="LINEAR",t[t.SRGB=2]="SRGB",t[t.ITU=3]="ITU",t[t.NTSC=4]="NTSC",t[t.SLOG=5]="SLOG",t[t.SLOG2=6]="SLOG2"}(pEt||(pEt={})),function(t){t[t.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",t[t.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(dEt||(dEt={})),function(t){t[t.RGB=0]="RGB",t[t.RRR=3]="RRR",t[t.GGG=4]="GGG",t[t.AAA=15]="AAA"}(fEt||(fEt={})),function(t){t[t.RGB=0]="RGB",t[t.RGBA=3]="RGBA",t[t.RRR=4]="RRR",t[t.RRRG=5]="RRRG"}(mEt||(mEt={}));const yEt=[171,75,84,88,32,50,48,187,13,10,26,10];const vEt={etc1:{basisFormat:0,compressed:!0,format:iEt},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:KAt},bc3:{basisFormat:3,compressed:!0,format:$At},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:tEt},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:eEt},"astc-4x4":{basisFormat:10,compressed:!0,format:nEt},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};function _Et(t,e,i){const n=new t(new Uint8Array(e));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");const t=n.getNumImages(),e=[];for(let r=0;r<t;r++){const t=n.getNumLevels(r),o=[];for(let e=0;e<t;e++)o.push(xEt(n,r,e,i));e.push(o)}return e}finally{n.close(),n.delete()}}function xEt(t,e,i,n){const r=t.getImageWidth(e,i),o=t.getImageHeight(e,i),s=t.getHasAlpha(),{compressed:a,format:l,basisFormat:c}=AEt(n,s),u=t.getImageTranscodedSizeInBytes(e,i,c),h=new Uint8Array(u);if(!t.transcodeImage(h,e,i,c,0,0))throw new Error("failed to start Basis transcoding");return{width:r,height:o,data:h,compressed:a,format:l,hasAlpha:s}}function bEt(t,e,i){const n=new t(new Uint8Array(e));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");const t=n.getLevels(),e=[];for(let r=0;r<t;r++){e.push(wEt(n,r,i));break}return[e]}finally{n.close(),n.delete()}}function wEt(t,e,i){const{alphaFlag:n,height:r,width:o}=t.getImageLevelInfo(e,0,0),{compressed:s,format:a,basisFormat:l}=AEt(i,n),c=t.getImageTranscodedSizeInBytes(e,0,0,l),u=new Uint8Array(c);if(!t.transcodeImage(u,e,0,0,l,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:o,height:r,data:u,compressed:s,levelSize:c,hasAlpha:n,format:a}}function AEt(t,e){let i=t&&t.basis&&t.basis.format;return"auto"===i&&(i=EEt()),"object"==typeof i&&(i=e?i.alpha:i.noAlpha),i=i.toLowerCase(),vEt[i]}function EEt(){const t=aEt();return t.has("astc")?"astc-4x4":t.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:t.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:t.has("etc1")?"etc1":t.has("etc2")?"etc2":"rgb565"}const SEt={...{name:"Basis",id:yat?"basis":"basis-nodejs",module:"textures",version:"3.4.14",worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},parse:async function(t,e){if("auto"===e.basis.containerFormat){if(function(t){const e=new Uint8Array(t);return!(e.byteLength<yEt.length||e[0]!==yEt[0]||e[1]!==yEt[1]||e[2]!==yEt[2]||e[3]!==yEt[3]||e[4]!==yEt[4]||e[5]!==yEt[5]||e[6]!==yEt[6]||e[7]!==yEt[7]||e[8]!==yEt[8]||e[9]!==yEt[9]||e[10]!==yEt[10]||e[11]!==yEt[11])}(t)){return bEt((await JAt(e)).KTX2File,t,e)}const{BasisFile:i}=await QAt(e);return _Et(i,t,e)}if("encoder"===e.basis.module){const i=await JAt(e);return"ktx2"===e.basis.containerFormat?bEt(i.KTX2File,t,e):_Et(i.BasisFile,t,e)}{const{BasisFile:i}=await QAt(e);return _Et(i,t,e)}}};function MEt(t,e){if(!t)throw new Error(e||"assert failed: gltf")}function TEt(t,e){if(t.startsWith("data:")||t.startsWith("http:")||t.startsWith("https:"))return t;const i=e.baseUri||e.uri;if(!i)throw new Error("'baseUri' must be provided to resolve relative url ".concat(t));return i.substr(0,i.lastIndexOf("/")+1)+t}const IEt=["SCALAR","VEC2","VEC3","VEC4"],CEt=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],PEt=new Map(CEt),LEt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},DEt={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},REt={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function OEt(t){return IEt[t-1]||IEt[0]}function kEt(t){const e=PEt.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function NEt(t,e){const i=REt[t.componentType],n=LEt[t.type],r=DEt[t.componentType],o=t.count*n,s=t.count*n*r;return MEt(s>=0&&s<=e.byteLength),{ArrayType:i,length:o,byteLength:s}}function BEt(t){let{images:e,bufferViews:i}=t;e=e||[],i=i||[];const n=e.map((t=>t.bufferView));i=i.filter((t=>!n.includes(t)));const r=i.reduce(((t,e)=>t+e.byteLength),0),o=e.reduce(((t,e)=>{const{width:i,height:n}=e.image;return t+i*n}),0);return r+Math.ceil(4*o*1.33)}const zEt={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class FEt{constructor(t){cat(this,"gltf",void 0),cat(this,"sourceBuffers",void 0),cat(this,"byteLength",void 0),this.gltf=t||{json:{...zEt},buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(t){return this.json[t]}getExtraData(t){return(this.json.extras||{})[t]}getExtension(t){const e=this.getUsedExtensions().find((e=>e===t)),i=this.json.extensions||{};return e?i[t]||!0:null}getRequiredExtension(t){const e=this.getRequiredExtensions().find((e=>e===t));return e?this.getExtension(t):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(t,e){return(t.extensions||{})[e]}getScene(t){return this.getObject("scenes",t)}getNode(t){return this.getObject("nodes",t)}getSkin(t){return this.getObject("skins",t)}getMesh(t){return this.getObject("meshes",t)}getMaterial(t){return this.getObject("materials",t)}getAccessor(t){return this.getObject("accessors",t)}getTexture(t){return this.getObject("textures",t)}getSampler(t){return this.getObject("samplers",t)}getImage(t){return this.getObject("images",t)}getBufferView(t){return this.getObject("bufferViews",t)}getBuffer(t){return this.getObject("buffers",t)}getObject(t,e){if("object"==typeof e)return e;const i=this.json[t]&&this.json[t][e];if(!i)throw new Error("glTF file error: Could not find ".concat(t,"[").concat(e,"]"));return i}getTypedArrayForBufferView(t){const e=(t=this.getBufferView(t)).buffer,i=this.gltf.buffers[e];MEt(i);const n=(t.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,n,t.byteLength)}getTypedArrayForAccessor(t){t=this.getAccessor(t);const e=this.getBufferView(t.bufferView),i=this.getBuffer(e.buffer).data,{ArrayType:n,length:r}=NEt(t,e);return new n(i,e.byteOffset+t.byteOffset,r)}getTypedArrayForImageData(t){t=this.getAccessor(t);const e=this.getBufferView(t.bufferView),i=this.getBuffer(e.buffer).data,n=e.byteOffset||0;return new Uint8Array(i,n,e.byteLength)}addApplicationData(t,e){return this.json[t]=e,this}addExtraData(t,e){return this.json.extras=this.json.extras||{},this.json.extras[t]=e,this}addObjectExtension(t,e,i){return t.extensions=t.extensions||{},t.extensions[e]=i,this.registerUsedExtension(e),this}setObjectExtension(t,e,i){(t.extensions||{})[e]=i}removeObjectExtension(t,e){const i=t.extensions||{},n=i[e];return delete i[e],n}addExtension(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return MEt(e),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=e,this.registerUsedExtension(t),e}addRequiredExtension(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return MEt(e),this.addExtension(t,e),this.registerRequiredExtension(t),e}registerUsedExtension(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find((e=>e===t))||this.json.extensionsUsed.push(t)}registerRequiredExtension(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find((e=>e===t))||this.json.extensionsRequired.push(t)}removeExtension(t){if(!this.getExtension(t))return;this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t),this.json.extensions&&delete this.json.extensions[t],Array.isArray(this.json.extensionsRemoved)||(this.json.extensionsRemoved=[]);const e=this.json.extensionsRemoved;e.includes(t)||e.push(t)}setDefaultScene(t){this.json.scene=t}addScene(t){const{nodeIndices:e}=t;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:e}),this.json.scenes.length-1}addNode(t){const{meshIndex:e,matrix:i}=t;this.json.nodes=this.json.nodes||[];const n={mesh:e};return i&&(n.matrix=i),this.json.nodes.push(n),this.json.nodes.length-1}addMesh(t){const{attributes:e,indices:i,material:n,mode:r=4}=t,o={primitives:[{attributes:this._addAttributes(e),mode:r}]};if(i){const t=this._addIndices(i);o.primitives[0].indices=t}return Number.isFinite(n)&&(o.primitives[0].material=n),this.json.meshes=this.json.meshes||[],this.json.meshes.push(o),this.json.meshes.length-1}addPointCloud(t){const e={primitives:[{attributes:this._addAttributes(t),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(e),this.json.meshes.length-1}addImage(t,e){const i=Fct(t),n=e||(null==i?void 0:i.mimeType),r={bufferView:this.addBufferView(t),mimeType:n};return this.json.images=this.json.images||[],this.json.images.push(r),this.json.images.length-1}addBufferView(t){const e=t.byteLength;MEt(Number.isFinite(e)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);const i={buffer:0,byteOffset:this.byteLength,byteLength:e};return this.byteLength+=Wat(e,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(t,e){const i={bufferView:t,type:OEt(e.size),componentType:e.componentType,count:e.count,max:e.max,min:e.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(i),this.json.accessors.length-1}addBinaryBuffer(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{size:3};const i=this.addBufferView(t);let n={min:e.min,max:e.max};n.min&&n.max||(n=this._getAccessorMinMax(t,e.size));const r={size:e.size,componentType:kEt(t),count:Math.round(t.length/e.size),min:n.min,max:n.max};return this.addAccessor(i,Object.assign(r,e))}addTexture(t){const{imageIndex:e}=t,i={source:e};return this.json.textures=this.json.textures||[],this.json.textures.push(i),this.json.textures.length-1}addMaterial(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}createBinaryChunk(){var t,e;this.gltf.buffers=[];const i=this.byteLength,n=new ArrayBuffer(i),r=new Uint8Array(n);let o=0;for(const t of this.sourceBuffers||[])o=qat(t,r,o);null!==(t=this.json)&&void 0!==t&&null!==(e=t.buffers)&&void 0!==e&&e[0]?this.json.buffers[0].byteLength=i:this.json.buffers=[{byteLength:i}],this.gltf.binary=n,this.sourceBuffers=[n]}_removeStringFromArray(t,e){let i=!0;for(;i;){const n=t.indexOf(e);n>-1?t.splice(n,1):i=!1}}_addAttributes(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e={};for(const i in t){const n=t[i],r=this._getGltfAttributeName(i),o=this.addBinaryBuffer(n.value,n);e[r]=o}return e}_addIndices(t){return this.addBinaryBuffer(t,{size:1})}_getGltfAttributeName(t){switch(t.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return t}}_getAccessorMinMax(t,e){const i={min:null,max:null};if(t.length<e)return i;i.min=[],i.max=[];const n=t.subarray(0,e);for(const t of n)i.min.push(t),i.max.push(t);for(let n=e;n<t.length;n+=e)for(let r=0;r<e;r++)i.min[0+r]=Math.min(i.min[0+r],t[n+r]),i.max[0+r]=Math.max(i.max[0+r],t[n+r]);return i}}const VEt="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",UEt="B9h9z9tFBBBF8dL9gBB9gLaaaaaFa9gEaaaB9gGaaB9gFaFaEQSBBFBFFGEGEGIILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBNn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBcI9z9iqlBMc/j9JSIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMkRIbaG97FaK978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAnDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAnDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBRnCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBHiCFD9tAiAPD9OD9hD9RHiDQBTFtGmEYIPLdKeOnH8ZAIAQJDBIBHpCFD9tApAPD9OD9hD9RHpAIASJDBIBHyCFD9tAyAPD9OD9hD9RHyDQBTFtGmEYIPLdKeOnH8cDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAnD9uHnDyBjGBAEAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnA8ZA8cDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNiV8ZcpMyS8cQ8df8eb8fHdApAyDQNiV8ZcpMyS8cQ8df8eb8fHiDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/xLGEaK978jUUUUBCAlHE8kUUUUBGXGXAGCI9HQBGXAFC98ZHI9FQBABRGCBRLEXAGAGDBBBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMBBAGCTJRGALCIJHLAI9JQBMMAIAF9PQFAEAFCEZHLCGWHGqCBCTAGl/8MBAEABAICGWJHIAG/8cBBGXAL9FQBAEAEDBIBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMIBMAIAEAG/8cBBSFMABAFC98ZHGT+HUUUBAGAF9PQBAEAFCEZHICEWHLJCBCAALl/8MBAEABAGCEWJHGAL/8cBBAEAIT+HUUUBAGAEAL/8cBBMAECAJ8kUUUUBM+yEGGaO97GXAF9FQBCBRGEXABCTJHEAEDBBBHICBDtHLCUU98D8cFCUU98D8cEHKD9OABDBBBHOAIDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAOAIDQBFGENVcMTtmYi8ZpyHICTD+sFD/6FHND/gFAICTD+rFCTD+sFD/6FHVD/gFD/kFD/lFHI9DB/+g6DYAVAIALD+2FHLAVCUUUU94DtHcD9OD9RD/kFHVAVD/mFAIAID/mFANALANAcD9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHLD/kFCTD+rFAVAND/mFALD/kFCggEDtD9OD9QHVAIAND/mFALD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHIDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAOAKD9OAVAIDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM94FEa8jUUUUBCAlHE8kUUUUBABAFC98ZHIT+JUUUBGXAIAF9PQBAEAFCEZHLCEWHFJCBCAAFl/8MBAEABAICEWJHBAF/8cBBAEALT+JUUUBABAEAF/8cBBMAECAJ8kUUUUBM/hEIGaF97FaL978jUUUUBCTlRGGXAF9FQBCBREEXAGABDBBBHIABCTJHLDBBBHKDQILKOSQfbPden8c8d8e8fHOCTD+sFHNCID+rFDMIBAB9DBBU8/DY9D/zI818/DYANCEDtD9QD/6FD/nFHNAIAKDQBFGENVcMTtmYi8ZpyHICTD+rFCTD+sFD/6FD/mFHKAKD/mFANAICTD+sFD/6FD/mFHVAVD/mFANAOCTD+rFCTD+sFD/6FD/mFHOAOD/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",GEt=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),jEt=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),HEt={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},WEt={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function qEt(t,e,i,n,r){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"NONE";const s=await async function(){XEt||(XEt=async function(){let t=VEt;WebAssembly.validate(GEt)&&(t=UEt,console.log("Warning: meshopt_decoder is using experimental SIMD support"));const e=await WebAssembly.instantiate(function(t){const e=new Uint8Array(t.length);for(let i=0;i<t.length;++i){const n=t.charCodeAt(i);e[i]=n>96?n-71:n>64?n-65:n>47?n+4:n>46?63:62}let i=0;for(let n=0;n<t.length;++n)e[i++]=e[n]<60?jEt[e[n]]:64*(e[n]-60)+e[++n];return e.buffer.slice(0,i)}(t),{});return await e.instance.exports.__wasm_call_ctors(),e.instance}());return XEt}();!function(t,e,i,n,r,o,s){const a=t.exports.sbrk,l=n+3&-4,c=a(l*r),u=a(o.length),h=new Uint8Array(t.exports.memory.buffer);h.set(o,u);const p=e(c,n,r,u,o.length);0===p&&s&&s(c,l,r);if(i.set(h.subarray(c,c+n*r)),a(c-a(0)),0!==p)throw new Error("Malformed buffer data: ".concat(p))}(s,s.exports[WEt[r]],t,e,i,n,s.exports[HEt[o||"NONE"]])}let XEt;const ZEt="EXT_meshopt_compression",YEt=ZEt;async function QEt(t,e){const i=t.getObjectExtension(e,ZEt);if(i){const{byteOffset:n=0,byteLength:r=0,byteStride:o,count:s,mode:a,filter:l="NONE",buffer:c}=i,u=t.gltf.buffers[c],h=new Uint8Array(u.arrayBuffer,u.byteOffset+n,r),p=new Uint8Array(t.gltf.buffers[e.buffer].arrayBuffer,e.byteOffset,e.byteLength);return await qEt(p,s,o,h,a,l),p}return null}var JEt=Object.freeze({__proto__:null,name:YEt,decode:async function(t,e){var i;const n=new FEt(t);if(null==e||null===(i=e.gltf)||void 0===i||!i.decompressMeshes)return;const r=[];for(const e of t.json.bufferViews||[])r.push(QEt(n,e));await Promise.all(r),n.removeExtension(ZEt)}});const KEt="EXT_texture_webp",$Et=KEt;var tSt=Object.freeze({__proto__:null,name:$Et,preprocess:function(t,e){const i=new FEt(t);if(!jct("image/webp")){if(i.getRequiredExtensions().includes(KEt))throw new Error("gltf: Required extension ".concat(KEt," not supported by browser"));return}const{json:n}=i;for(const t of n.textures||[]){const e=i.getObjectExtension(t,KEt);e&&(t.source=e.source),i.removeObjectExtension(t,KEt)}i.removeExtension(KEt)}});const eSt="KHR_texture_basisu",iSt=eSt;var nSt=Object.freeze({__proto__:null,name:iSt,preprocess:function(t,e){const i=new FEt(t),{json:n}=i;for(const t of n.textures||[]){const e=i.getObjectExtension(t,eSt);e&&(t.source=e.source),i.removeObjectExtension(t,eSt)}i.removeExtension(eSt)}});const rSt="3.4.14",oSt={draco:{decoderType:"object"==typeof WebAssembly?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}},sSt={name:"Draco",id:yat?"draco":"draco-nodejs",module:"draco",shapes:["mesh"],version:rSt,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:oSt};function aSt(t,e,i){return EAt(t,e,i?lSt(i.metadata):void 0)}function lSt(t){const e=new Map;for(const i in t)e.set("".concat(i,".string"),JSON.stringify(t[i]));return e}const cSt={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},uSt={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class hSt{constructor(t){cat(this,"draco",void 0),cat(this,"decoder",void 0),cat(this,"metadataQuerier",void 0),this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=new this.draco.DecoderBuffer;i.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(e);const n=this.decoder.GetEncodedGeometryType(i),r=n===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let t;switch(n){case this.draco.TRIANGULAR_MESH:t=this.decoder.DecodeBufferToMesh(i,r);break;case this.draco.POINT_CLOUD:t=this.decoder.DecodeBufferToPointCloud(i,r);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!t.ok()||!r.ptr){const e="DRACO decompression failed: ".concat(t.error_msg());throw new Error(e)}const o=this._getDracoLoaderData(r,n,e),s=this._getMeshData(r,o,e),a=iAt(s.attributes),l=function(t,e,i){const n=lSt(e.metadata),r=[],o=function(t){const e={};for(const i in t){const n=t[i];e[n.name||"undefined"]=n}return e}(e.attributes);for(const e in t){const i=aSt(e,t[e],o[e]);r.push(i)}if(i){const t=aSt("indices",i);r.push(t)}return new nAt(r,n)}(s.attributes,o,s.indices);return{loader:"draco",loaderData:o,header:{vertexCount:r.num_points(),boundingBox:a},...s,schema:l}}finally{this.draco.destroy(i),r&&this.draco.destroy(r)}}_getDracoLoaderData(t,e,i){const n=this._getTopLevelMetadata(t),r=this._getDracoAttributes(t,i);return{geometry_type:e,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:n,attributes:r}}_getDracoAttributes(t,e){const i={};for(let n=0;n<t.num_attributes();n++){const r=this.decoder.GetAttribute(t,n),o=this._getAttributeMetadata(t,n);i[r.unique_id()]={unique_id:r.unique_id(),attribute_type:r.attribute_type(),data_type:r.data_type(),num_components:r.num_components(),byte_offset:r.byte_offset(),byte_stride:r.byte_stride(),normalized:r.normalized(),attribute_index:n,metadata:o};const s=this._getQuantizationTransform(r,e);s&&(i[r.unique_id()].quantization_transform=s);const a=this._getOctahedronTransform(r,e);a&&(i[r.unique_id()].octahedron_transform=a)}return i}_getMeshData(t,e,i){const n=this._getMeshAttributes(e,t,i);if(!n.POSITION)throw new Error("DRACO: No position attribute found.");return t instanceof this.draco.Mesh?"triangle-strip"===i.topology?{topology:"triangle-strip",mode:4,attributes:n,indices:{value:this._getTriangleStripIndices(t),size:1}}:{topology:"triangle-list",mode:5,attributes:n,indices:{value:this._getTriangleListIndices(t),size:1}}:{topology:"point-list",mode:0,attributes:n}}_getMeshAttributes(t,e,i){const n={};for(const r of Object.values(t.attributes)){const t=this._deduceAttributeName(r,i);r.name=t;const{value:o,size:s}=this._getAttributeValues(e,r);n[t]={value:o,size:s,byteOffset:r.byte_offset,byteStride:r.byte_stride,normalized:r.normalized}}return n}_getTriangleListIndices(t){const e=3*t.num_faces(),i=4*e,n=this.draco._malloc(i);try{return this.decoder.GetTrianglesUInt32Array(t,i,n),new Uint32Array(this.draco.HEAPF32.buffer,n,e).slice()}finally{this.draco._free(n)}}_getTriangleStripIndices(t){const e=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,e),function(t){const e=t.size(),i=new Int32Array(e);for(let n=0;n<e;n++)i[n]=t.GetValue(n);return i}(e)}finally{this.draco.destroy(e)}}_getAttributeValues(t,e){const i=uSt[e.data_type],n=e.num_components,r=t.num_points()*n,o=r*i.BYTES_PER_ELEMENT,s=function(t,e){switch(e){case Float32Array:return t.DT_FLOAT32;case Int8Array:return t.DT_INT8;case Int16Array:return t.DT_INT16;case Int32Array:return t.DT_INT32;case Uint8Array:return t.DT_UINT8;case Uint16Array:return t.DT_UINT16;case Uint32Array:return t.DT_UINT32;default:return t.DT_INVALID}}(this.draco,i);let a;const l=this.draco._malloc(o);try{const n=this.decoder.GetAttribute(t,e.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,n,s,o,l),a=new i(this.draco.HEAPF32.buffer,l,r).slice()}finally{this.draco._free(l)}return{value:a,size:n}}_deduceAttributeName(t,e){const i=t.unique_id;for(const[t,n]of Object.entries(e.extraAttributes||{}))if(n===i)return t;const n=t.attribute_type;for(const t in cSt){if(this.draco[t]===n)return cSt[t]}const r=e.attributeNameEntry||"name";return t.metadata[r]?t.metadata[r].string:"CUSTOM_ATTRIBUTE_".concat(i)}_getTopLevelMetadata(t){const e=this.decoder.GetMetadata(t);return this._getDracoMetadata(e)}_getAttributeMetadata(t,e){const i=this.decoder.GetAttributeMetadata(t,e);return this._getDracoMetadata(i)}_getDracoMetadata(t){if(!t||!t.ptr)return{};const e={},i=this.metadataQuerier.NumEntries(t);for(let n=0;n<i;n++){const i=this.metadataQuerier.GetEntryName(t,n);e[i]=this._getDracoMetadataField(t,i)}return e}_getDracoMetadataField(t,e){const i=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,e,i);const n=function(t){const e=t.size(),i=new Int32Array(e);for(let n=0;n<e;n++)i[n]=t.GetValue(n);return i}(i);return{int:this.metadataQuerier.GetIntEntry(t,e),string:this.metadataQuerier.GetStringEntry(t,e),double:this.metadataQuerier.GetDoubleEntry(t,e),intArray:n}}finally{this.draco.destroy(i)}}_disableAttributeTransforms(t){const{quantizedAttributes:e=[],octahedronAttributes:i=[]}=t,n=[...e,...i];for(const t of n)this.decoder.SkipAttributeTransform(this.draco[t])}_getQuantizationTransform(t,e){const{quantizedAttributes:i=[]}=e,n=t.attribute_type();if(i.map((t=>this.decoder[t])).includes(n)){const e=new this.draco.AttributeQuantizationTransform;try{if(e.InitFromAttribute(t))return{quantization_bits:e.quantization_bits(),range:e.range(),min_values:new Float32Array([1,2,3]).map((t=>e.min_value(t)))}}finally{this.draco.destroy(e)}}return null}_getOctahedronTransform(t,e){const{octahedronAttributes:i=[]}=e,n=t.attribute_type();if(i.map((t=>this.decoder[t])).includes(n)){const e=new this.draco.AttributeQuantizationTransform;try{if(e.InitFromAttribute(t))return{quantization_bits:e.quantization_bits()}}finally{this.draco.destroy(e)}}return null}}const pSt="https://www.gstatic.com/draco/versioned/decoders/".concat("1.5.5"),dSt="".concat(pSt,"/draco_decoder.js"),fSt="".concat(pSt,"/draco_wasm_wrapper.js"),mSt="".concat(pSt,"/draco_decoder.wasm");let gSt;async function ySt(t){const e=t.modules||{};return gSt=e.draco3d?gSt||e.draco3d.createDecoderModule({}).then((t=>({draco:t}))):gSt||async function(t){let e,i;if("js"===(t.draco&&t.draco.decoderType))e=await Fat(dSt,"draco",t);else[e,i]=await Promise.all([await Fat(fSt,"draco",t),await Fat(mSt,"draco",t)]);return e=e||globalThis.DracoDecoderModule,await function(t,e){const i={};e&&(i.wasmBinary=e);return new Promise((e=>{t({...i,onModuleLoaded:t=>e({draco:t})})}))}(e,i)}(t),await gSt}const vSt={...sSt,parse:async function(t,e){const{draco:i}=await ySt(e),n=new hSt(i);try{return n.parseSync(t,null==e?void 0:e.draco)}finally{n.destroy()}}};function _St(t){const{buffer:e,size:i,count:n}=function(t){let e=t,i=1,n=0;t&&t.value&&(e=t.value,i=t.size||1);e&&(ArrayBuffer.isView(e)||(e=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!t)return null;if(Array.isArray(t))return new e(t);if(i&&!(t instanceof e))return new e(t);return t}(e,Float32Array)),n=e.length/i);return{buffer:e,size:i,count:n}}(t);return{value:e,size:i,byteOffset:0,count:n,type:OEt(i),componentType:kEt(e)}}const xSt="KHR_draco_mesh_compression",bSt=xSt;async function wSt(t,e,i,n){const r=t.getObjectExtension(e,xSt);if(!r)return;const o=t.getTypedArrayForBufferView(r.bufferView),s=Hat(o.buffer,o.byteOffset),{parse:a}=n,l={...i};delete l["3d-tiles"];const c=await a(s,vSt,l,n),u=function(t){const e={};for(const i in t){const n=t[i];if("indices"!==i){const t=_St(n);e[i]=t}}return e}(c.attributes);for(const[i,n]of Object.entries(u))if(i in e.attributes){const r=e.attributes[i],o=t.getAccessor(r);null!=o&&o.min&&null!=o&&o.max&&(n.min=o.min,n.max=o.max)}e.attributes=u,c.indices&&(e.indices=_St(c.indices)),function(t){if(!t.attributes&&Object.keys(t.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}(e)}function ASt(t,e){var i;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;if(!r.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");const s=r.DracoWriter.encodeSync({attributes:t}),a=null==o||null===(i=o.parseSync)||void 0===i?void 0:i.call(o,{attributes:t}),l=r._addFauxAttributes(a.attributes),c=r.addBufferView(s);return{primitives:[{attributes:l,mode:n,extensions:{[xSt]:{bufferView:c,attributes:l}}}]}}function*ESt(t){for(const e of t.json.meshes||[])for(const t of e.primitives)yield t}var SSt=Object.freeze({__proto__:null,name:bSt,preprocess:function(t,e,i){const n=new FEt(t);for(const t of ESt(n))n.getObjectExtension(t,xSt)},decode:async function(t,e,i){var n;if(null==e||null===(n=e.gltf)||void 0===n||!n.decompressMeshes)return;const r=new FEt(t),o=[];for(const t of ESt(r))r.getObjectExtension(t,xSt)&&o.push(wSt(r,t,e,i));await Promise.all(o),r.removeExtension(xSt)},encode:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=new FEt(t);for(const t of i.json.meshes||[])ASt(t,e),i.addRequiredExtension(xSt)}});const MSt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},TSt={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},ISt="KHR_texture_transform",CSt=ISt,PSt=new bmt,LSt=new Imt,DSt=new Imt;function RSt(t,e){var i,n,r;const o=[],s=null===(i=e.json.materials)||void 0===i?void 0:i[t],a=null==s||null===(n=s.pbrMetallicRoughness)||void 0===n?void 0:n.baseColorTexture;a&&OSt(e,t,a,o);const l=null==s?void 0:s.emissiveTexture;l&&OSt(e,t,l,o);const c=null==s?void 0:s.normalTexture;c&&OSt(e,t,c,o);const u=null==s?void 0:s.occlusionTexture;u&&OSt(e,t,u,o);const h=null==s||null===(r=s.pbrMetallicRoughness)||void 0===r?void 0:r.metallicRoughnessTexture;h&&OSt(e,t,h,o)}function OSt(t,e,i,n){const r=function(t,e){var i;const n=null===(i=t.extensions)||void 0===i?void 0:i[ISt],{texCoord:r=0}=t,{texCoord:o=r}=n,s=-1!==e.findIndex((t=>{let[e,i]=t;return e===r&&i===o}));if(!s){const i=function(t){const{offset:e=[0,0],rotation:i=0,scale:n=[1,1]}=t,r=(new Imt).set(1,0,0,0,1,0,e[0],e[1],1),o=LSt.set(Math.cos(i),Math.sin(i),0,-Math.sin(i),Math.cos(i),0,0,0,1),s=DSt.set(n[0],0,0,0,n[1],0,0,0,1);return r.multiplyRight(o).multiplyRight(s)}(n);return r!==o&&(t.texCoord=o),e.push([r,o]),{originalTexCoord:r,texCoord:o,matrix:i}}return null}(i,n);if(!r)return;const o=t.json.meshes||[];for(const i of o)for(const n of i.primitives){const i=n.material;Number.isFinite(i)&&e===i&&kSt(t,n,r)}}function kSt(t,e,i){const{originalTexCoord:n,texCoord:r,matrix:o}=i,s=e.attributes["TEXCOORD_".concat(n)];if(Number.isFinite(s)){var a;const i=null===(a=t.json.accessors)||void 0===a?void 0:a[s];if(i&&i.bufferView){var l;const s=null===(l=t.json.bufferViews)||void 0===l?void 0:l[i.bufferView];if(s){const{arrayBuffer:a,byteOffset:l}=t.buffers[s.buffer],c=(l||0)+(i.byteOffset||0)+(s.byteOffset||0),{ArrayType:u,length:h}=NEt(i,s),p=TSt[i.componentType],d=MSt[i.type],f=s.byteStride||p*d,m=new Float32Array(h);for(let t=0;t<i.count;t++){const e=new u(a,c+t*f,2);PSt.set(e[0],e[1],1),PSt.transformByMatrix3(o),m.set([PSt[0],PSt[1]],t*d)}n===r?function(t,e,i,n){t.componentType=5126,i.push({arrayBuffer:n.buffer,byteOffset:0,byteLength:n.buffer.byteLength}),e.buffer=i.length-1,e.byteLength=n.buffer.byteLength,e.byteOffset=0,delete e.byteStride}(i,s,t.buffers,m):function(t,e,i,n,r){n.buffers.push({arrayBuffer:r.buffer,byteOffset:0,byteLength:r.buffer.byteLength});const o=n.json.bufferViews;if(!o)return;o.push({buffer:n.buffers.length-1,byteLength:r.buffer.byteLength,byteOffset:0});const s=n.json.accessors;if(!s)return;s.push({bufferView:(null==o?void 0:o.length)-1,byteOffset:0,componentType:5126,count:e.count,type:"VEC2"}),i.attributes["TEXCOORD_".concat(t)]=s.length-1}(r,i,e,t,m)}}}}var NSt=Object.freeze({__proto__:null,name:CSt,decode:async function(t,e){if(!new FEt(t).getExtension(ISt))return;const i=t.json.materials||[];for(let e=0;e<i.length;e++)RSt(e,t)}});const BSt="KHR_lights_punctual",zSt=BSt;var FSt=Object.freeze({__proto__:null,name:zSt,decode:async function(t){const e=new FEt(t),{json:i}=e,n=e.getExtension(BSt);n&&(e.json.lights=n.lights,e.removeExtension(BSt));for(const t of i.nodes||[]){const i=e.getObjectExtension(t,BSt);i&&(t.light=i.light),e.removeObjectExtension(t,BSt)}},encode:async function(t){const e=new FEt(t),{json:i}=e;if(i.lights){const t=e.addExtension(BSt);MEt(!t.lights),t.lights=i.lights,delete i.lights}if(e.json.lights){for(const t of e.json.lights){const i=t.node;e.addObjectExtension(i,BSt,t)}delete e.json.lights}}});const VSt="KHR_materials_unlit",USt=VSt;var GSt=Object.freeze({__proto__:null,name:USt,decode:async function(t){const e=new FEt(t),{json:i}=e;for(const t of i.materials||[]){t.extensions&&t.extensions.KHR_materials_unlit&&(t.unlit=!0),e.removeObjectExtension(t,VSt)}e.removeExtension(VSt)},encode:function(t){const e=new FEt(t),{json:i}=e;if(e.materials)for(const t of i.materials||[])t.unlit&&(delete t.unlit,e.addObjectExtension(t,VSt,{}),e.addExtension(VSt))}});const jSt="KHR_techniques_webgl",HSt=jSt;function WSt(t,e){const i=Object.assign({},t.values);return Object.keys(t.uniforms||{}).forEach((e=>{t.uniforms[e].value&&!(e in i)&&(i[e]=t.uniforms[e].value)})),Object.keys(i).forEach((t=>{"object"==typeof i[t]&&void 0!==i[t].index&&(i[t].texture=e.getTexture(i[t].index))})),i}var qSt=Object.freeze({__proto__:null,name:HSt,decode:async function(t){const e=new FEt(t),{json:i}=e,n=e.getExtension(jSt);if(n){const t=function(t,e){const{programs:i=[],shaders:n=[],techniques:r=[]}=t,o=new TextDecoder;return n.forEach((t=>{if(!Number.isFinite(t.bufferView))throw new Error("KHR_techniques_webgl: no shader code");t.code=o.decode(e.getTypedArrayForBufferView(t.bufferView))})),i.forEach((t=>{t.fragmentShader=n[t.fragmentShader],t.vertexShader=n[t.vertexShader]})),r.forEach((t=>{t.program=i[t.program]})),r}(n,e);for(const n of i.materials||[]){const i=e.getObjectExtension(n,jSt);i&&(n.technique=Object.assign({},i,t[i.technique]),n.technique.values=WSt(n.technique,e)),e.removeObjectExtension(n,jSt)}e.removeExtension(jSt)}},encode:async function(t,e){}});const XSt="EXT_feature_metadata",ZSt=XSt;function YSt(t,e,i){for(const r in i.properties){var n;const o=i.properties[r],s=null==e||null===(n=e.properties)||void 0===n?void 0:n[r],a=e.count;if(s){const e=QSt(t,o,a,s);s.data=e}}}function QSt(t,e,i,n){const r=n.bufferView;let o=t.getTypedArrayForBufferView(r);switch(e.type){case"STRING":{const e=n.stringOffsetBufferView;o=function(t,e,i){const n=[],r=new TextDecoder("utf8");let o=0;const s=4;for(let a=0;a<i;a++){const i=e[(a+1)*s]-e[a*s],l=t.subarray(o,i+o),c=r.decode(l);n.push(c),o+=i}return n}(o,t.getTypedArrayForBufferView(e),i);break}}return o}function JSt(t,e){for(const i in t){const n=t[i];if(n.class===e)return n}return null}const KSt=[JEt,tSt,nSt,SSt,FSt,GSt,qSt,NSt,Object.freeze({__proto__:null,name:ZSt,decode:async function(t){!function(t){var e;const i=t.getExtension(XSt),n=null==i||null===(e=i.schema)||void 0===e?void 0:e.classes,r=null==i?void 0:i.featureTables;(null==i?void 0:i.featureTextures)&&console.warn('featureTextures is not yet supported in the "EXT_feature_metadata" extension.');if(n&&r)for(const e in n){const i=n[e],o=JSt(r,e);o&&YSt(t,o,i)}}(new FEt(t))}})];function $St(t,e){var i;const n=(null==e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};return!(t in n&&!n[t])}const tMt="KHR_binary_glTF";const eMt={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},iMt={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class nMt{constructor(){cat(this,"idToIndexMap",{animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}),cat(this,"json",void 0)}normalize(t,e){this.json=t.json;const i=t.json;switch(i.asset&&i.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn("glTF: Unknown version ".concat(i.asset.version))}if(!e.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(i),this._convertTopLevelObjectsToArrays(i),function(t){const e=new FEt(t),{json:i}=e;for(const t of i.images||[]){const i=e.getObjectExtension(t,tMt);i&&Object.assign(t,i),e.removeObjectExtension(t,tMt)}i.buffers&&i.buffers[0]&&delete i.buffers[0].uri,e.removeExtension(tMt)}(t),this._convertObjectIdsToArrayIndices(i),this._updateObjects(i),this._updateMaterial(i)}_addAsset(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(t){for(const e in eMt)this._convertTopLevelObjectToArray(t,e)}_convertTopLevelObjectToArray(t,e){const i=t[e];if(i&&!Array.isArray(i)){t[e]=[];for(const n in i){const r=i[n];r.id=r.id||n;const o=t[e].length;t[e].push(r),this.idToIndexMap[e][n]=o}}}_convertObjectIdsToArrayIndices(t){for(const e in eMt)this._convertIdsToIndices(t,e);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));for(const e of t.textures)this._convertTextureIds(e);for(const e of t.meshes)this._convertMeshIds(e);for(const e of t.nodes)this._convertNodeIds(e);for(const e of t.scenes)this._convertSceneIds(e)}_convertTextureIds(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}_convertMeshIds(t){for(const e of t.primitives){const{attributes:t,indices:i,material:n}=e;for(const e in t)t[e]=this._convertIdToIndex(t[e],"accessor");i&&(e.indices=this._convertIdToIndex(i,"accessor")),n&&(e.material=this._convertIdToIndex(n,"material"))}}_convertNodeIds(t){t.children&&(t.children=t.children.map((t=>this._convertIdToIndex(t,"node")))),t.meshes&&(t.meshes=t.meshes.map((t=>this._convertIdToIndex(t,"mesh"))))}_convertSceneIds(t){t.nodes&&(t.nodes=t.nodes.map((t=>this._convertIdToIndex(t,"node"))))}_convertIdsToIndices(t,e){t[e]||(console.warn("gltf v1: json doesn't contain attribute ".concat(e)),t[e]=[]);for(const i of t[e])for(const t in i){const e=i[t],n=this._convertIdToIndex(e,t);i[t]=n}}_convertIdToIndex(t,e){const i=iMt[e];if(i in this.idToIndexMap){const n=this.idToIndexMap[i][t];if(!Number.isFinite(n))throw new Error("gltf v1: failed to resolve ".concat(e," with id ").concat(t));return n}return t}_updateObjects(t){for(const t of this.json.buffers)delete t.type}_updateMaterial(t){for(const r of t.materials){var e,i,n;r.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const o=(null===(e=r.values)||void 0===e?void 0:e.tex)||(null===(i=r.values)||void 0===i?void 0:i.texture2d_0)||(null===(n=r.values)||void 0===n?void 0:n.diffuseTex),s=t.textures.findIndex((t=>t.id===o));-1!==s&&(r.pbrMetallicRoughness.baseColorTexture={index:s})}}}const rMt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},oMt={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},sMt=10240,aMt=10241,lMt=10242,cMt=10243,uMt=10497,hMt={magFilter:sMt,minFilter:aMt,wrapS:lMt,wrapT:cMt},pMt={[sMt]:9729,[aMt]:9986,[lMt]:uMt,[cMt]:uMt};class dMt{constructor(){cat(this,"baseUri",""),cat(this,"json",{}),cat(this,"buffers",[]),cat(this,"images",[])}postProcess(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{json:i,buffers:n=[],images:r=[],baseUri:o=""}=t;return MEt(i),this.baseUri=o,this.json=i,this.buffers=n,this.images=r,this._resolveTree(this.json,e),this.json}_resolveTree(t){t.bufferViews&&(t.bufferViews=t.bufferViews.map(((t,e)=>this._resolveBufferView(t,e)))),t.images&&(t.images=t.images.map(((t,e)=>this._resolveImage(t,e)))),t.samplers&&(t.samplers=t.samplers.map(((t,e)=>this._resolveSampler(t,e)))),t.textures&&(t.textures=t.textures.map(((t,e)=>this._resolveTexture(t,e)))),t.accessors&&(t.accessors=t.accessors.map(((t,e)=>this._resolveAccessor(t,e)))),t.materials&&(t.materials=t.materials.map(((t,e)=>this._resolveMaterial(t,e)))),t.meshes&&(t.meshes=t.meshes.map(((t,e)=>this._resolveMesh(t,e)))),t.nodes&&(t.nodes=t.nodes.map(((t,e)=>this._resolveNode(t,e)))),t.skins&&(t.skins=t.skins.map(((t,e)=>this._resolveSkin(t,e)))),t.scenes&&(t.scenes=t.scenes.map(((t,e)=>this._resolveScene(t,e)))),void 0!==t.scene&&(t.scene=t.scenes[this.json.scene])}getScene(t){return this._get("scenes",t)}getNode(t){return this._get("nodes",t)}getSkin(t){return this._get("skins",t)}getMesh(t){return this._get("meshes",t)}getMaterial(t){return this._get("materials",t)}getAccessor(t){return this._get("accessors",t)}getCamera(t){return null}getTexture(t){return this._get("textures",t)}getSampler(t){return this._get("samplers",t)}getImage(t){return this._get("images",t)}getBufferView(t){return this._get("bufferViews",t)}getBuffer(t){return this._get("buffers",t)}_get(t,e){if("object"==typeof e)return e;const i=this.json[t]&&this.json[t][e];return i||console.warn("glTF file error: Could not find ".concat(t,"[").concat(e,"]")),i}_resolveScene(t,e){return t.id=t.id||"scene-".concat(e),t.nodes=(t.nodes||[]).map((t=>this.getNode(t))),t}_resolveNode(t,e){return t.id=t.id||"node-".concat(e),t.children&&(t.children=t.children.map((t=>this.getNode(t)))),void 0!==t.mesh?t.mesh=this.getMesh(t.mesh):void 0!==t.meshes&&t.meshes.length&&(t.mesh=t.meshes.reduce(((t,e)=>{const i=this.getMesh(e);return t.id=i.id,t.primitives=t.primitives.concat(i.primitives),t}),{primitives:[]})),void 0!==t.camera&&(t.camera=this.getCamera(t.camera)),void 0!==t.skin&&(t.skin=this.getSkin(t.skin)),t}_resolveSkin(t,e){return t.id=t.id||"skin-".concat(e),t.inverseBindMatrices=this.getAccessor(t.inverseBindMatrices),t}_resolveMesh(t,e){return t.id=t.id||"mesh-".concat(e),t.primitives&&(t.primitives=t.primitives.map((t=>{const e=(t={...t}).attributes;t.attributes={};for(const i in e)t.attributes[i]=this.getAccessor(e[i]);return void 0!==t.indices&&(t.indices=this.getAccessor(t.indices)),void 0!==t.material&&(t.material=this.getMaterial(t.material)),t}))),t}_resolveMaterial(t,e){if(t.id=t.id||"material-".concat(e),t.normalTexture&&(t.normalTexture={...t.normalTexture},t.normalTexture.texture=this.getTexture(t.normalTexture.index)),t.occlusionTexture&&(t.occlustionTexture={...t.occlustionTexture},t.occlusionTexture.texture=this.getTexture(t.occlusionTexture.index)),t.emissiveTexture&&(t.emmisiveTexture={...t.emmisiveTexture},t.emissiveTexture.texture=this.getTexture(t.emissiveTexture.index)),t.emissiveFactor||(t.emissiveFactor=t.emmisiveTexture?[1,1,1]:[0,0,0]),t.pbrMetallicRoughness){t.pbrMetallicRoughness={...t.pbrMetallicRoughness};const e=t.pbrMetallicRoughness;e.baseColorTexture&&(e.baseColorTexture={...e.baseColorTexture},e.baseColorTexture.texture=this.getTexture(e.baseColorTexture.index)),e.metallicRoughnessTexture&&(e.metallicRoughnessTexture={...e.metallicRoughnessTexture},e.metallicRoughnessTexture.texture=this.getTexture(e.metallicRoughnessTexture.index))}return t}_resolveAccessor(t,e){var i,n;if(t.id=t.id||"accessor-".concat(e),void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView)),t.bytesPerComponent=(i=t.componentType,oMt[i]),t.components=(n=t.type,rMt[n]),t.bytesPerElement=t.bytesPerComponent*t.components,t.bufferView){const e=t.bufferView.buffer,{ArrayType:i,byteLength:n}=NEt(t,t.bufferView),r=(t.bufferView.byteOffset||0)+(t.byteOffset||0)+e.byteOffset;let o=e.arrayBuffer.slice(r,r+n);t.bufferView.byteStride&&(o=this._getValueFromInterleavedBuffer(e,r,t.bufferView.byteStride,t.bytesPerElement,t.count)),t.value=new i(o)}return t}_getValueFromInterleavedBuffer(t,e,i,n,r){const o=new Uint8Array(r*n);for(let s=0;s<r;s++){const r=e+s*i;o.set(new Uint8Array(t.arrayBuffer.slice(r,r+n)),s*n)}return o.buffer}_resolveTexture(t,e){return t.id=t.id||"texture-".concat(e),t.sampler="sampler"in t?this.getSampler(t.sampler):pMt,t.source=this.getImage(t.source),t}_resolveSampler(t,e){t.id=t.id||"sampler-".concat(e),t.parameters={};for(const e in t){const i=this._enumSamplerParameter(e);void 0!==i&&(t.parameters[i]=t[e])}return t}_enumSamplerParameter(t){return hMt[t]}_resolveImage(t,e){t.id=t.id||"image-".concat(e),void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView));const i=this.images[e];return i&&(t.image=i),t}_resolveBufferView(t,e){const i=t.buffer,n={id:"bufferView-".concat(e),...t,buffer:this.buffers[i]},r=this.buffers[i].arrayBuffer;let o=this.buffers[i].byteOffset||0;return"byteOffset"in t&&(o+=t.byteOffset),n.data=new Uint8Array(r,o,t.byteLength),n}_resolveCamera(t,e){return t.id=t.id||"camera-".concat(e),t.perspective,t.orthographic,t}}const fMt=1735152710,mMt=12,gMt=8,yMt=1313821514,vMt=5130562,_Mt=0,xMt=1,bMt=0,wMt=!0;function AMt(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=new DataView(e),r=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"".concat(String.fromCharCode(t.getUint8(e+0))).concat(String.fromCharCode(t.getUint8(e+1))).concat(String.fromCharCode(t.getUint8(e+2))).concat(String.fromCharCode(t.getUint8(e+3)))}(n,i+0),o=n.getUint32(i+4,wMt),s=n.getUint32(i+8,wMt);switch(Object.assign(t,{header:{byteOffset:i,byteLength:s,hasBinChunk:!1},type:r,version:o,json:{},binChunks:[]}),i+=mMt,t.version){case 1:return function(t,e,i){uat(t.header.byteLength>mMt+gMt);const n=e.getUint32(i+0,wMt),r=e.getUint32(i+4,wMt);return i+=gMt,uat(r===bMt),EMt(t,e,i,n),i+=n,i+=SMt(t,e,i,t.header.byteLength),i}(t,n,i);case 2:return function(t,e,i,n){return uat(t.header.byteLength>mMt+gMt),function(t,e,i,n){for(;i+8<=t.header.byteLength;){const r=e.getUint32(i+0,wMt),o=e.getUint32(i+4,wMt);switch(i+=gMt,o){case yMt:EMt(t,e,i,r);break;case vMt:SMt(t,e,i,r);break;case _Mt:n.strict||EMt(t,e,i,r);break;case xMt:n.strict||SMt(t,e,i,r)}i+=Wat(r,4)}}(t,e,i,n),i+t.header.byteLength}(t,n,i,{});default:throw new Error("Invalid GLB version ".concat(t.version,". Only supports v1 and v2."))}}function EMt(t,e,i,n){const r=new Uint8Array(e.buffer,i,n),o=new TextDecoder("utf8").decode(r);return t.json=JSON.parse(o),Wat(n,4)}function SMt(t,e,i,n){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:i,byteLength:n,arrayBuffer:e.buffer}),Wat(n,4)}async function MMt(t,e){var i,n,r,o;let s=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;!function(t,e,i,n){n.uri&&(t.baseUri=n.uri);if(e instanceof ArrayBuffer&&!function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=new DataView(t),{magic:r=fMt}=i,o=n.getUint32(e,!1);return o===r||o===fMt}(e,i,n)){e=(new TextDecoder).decode(e)}if("string"==typeof e)t.json=jat(e);else if(e instanceof ArrayBuffer){const r={};i=AMt(r,e,i,n.glb),MEt("glTF"===r.type,"Invalid GLB magic string ".concat(r.type)),t._glb=r,t.json=r.json}else MEt(!1,"GLTF: must be ArrayBuffer or string");const r=t.json.buffers||[];if(t.buffers=new Array(r.length).fill(null),t._glb&&t._glb.header.hasBinChunk){const{binChunks:e}=t._glb;t.buffers[0]={arrayBuffer:e[0].arrayBuffer,byteOffset:e[0].byteOffset,byteLength:e[0].byteLength}}const o=t.json.images||[];t.images=new Array(o.length).fill({})}(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s),function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(new nMt).normalize(t,e)}(t,{normalize:null==s||null===(i=s.gltf)||void 0===i?void 0:i.normalize}),function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;const n=KSt.filter((t=>$St(t.name,e)));for(const o of n){var r;null===(r=o.preprocess)||void 0===r||r.call(o,t,e,i)}}(t,s,a);const l=[];if(null!=s&&null!==(n=s.gltf)&&void 0!==n&&n.loadBuffers&&t.json.buffers&&await async function(t,e,i){const n=t.json.buffers||[];for(let s=0;s<n.length;++s){const a=n[s];if(a.uri){var r,o;const{fetch:n}=i;MEt(n);const l=TEt(a.uri,e),c=await(null==i||null===(r=i.fetch)||void 0===r?void 0:r.call(i,l)),u=await(null==c||null===(o=c.arrayBuffer)||void 0===o?void 0:o.call(c));t.buffers[s]={arrayBuffer:u,byteOffset:0,byteLength:u.byteLength},delete a.uri}else null===t.buffers[s]&&(t.buffers[s]={arrayBuffer:new ArrayBuffer(a.byteLength),byteOffset:0,byteLength:a.byteLength})}}(t,s,a),null!=s&&null!==(r=s.gltf)&&void 0!==r&&r.loadImages){const e=async function(t,e,i){const n=function(t){const e=new Set,i=t.json.textures||[];for(const t of i)void 0!==t.source&&e.add(t.source);return Array.from(e).sort()}(t),r=t.json.images||[],o=[];for(const s of n)o.push(TMt(t,r[s],s,e,i));return await Promise.all(o)}(t,s,a);l.push(e)}const c=async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;const n=KSt.filter((t=>$St(t.name,e)));for(const o of n){var r;await(null===(r=o.decode)||void 0===r?void 0:r.call(o,t,e,i))}}(t,s,a);return l.push(c),await Promise.all(l),null!=s&&null!==(o=s.gltf)&&void 0!==o&&o.postProcess?function(t,e){return(new dMt).postProcess(t,e)}(t,s):t}async function TMt(t,e,i,n,r){const{fetch:o,parse:s}=r;let a;if(e.uri&&!e.hasOwnProperty("bufferView")){const t=TEt(e.uri,n),i=await o(t);a=await i.arrayBuffer(),e.bufferView={data:a}}if(Number.isFinite(e.bufferView)){const i=function(t,e,i){const n=t.bufferViews[i];MEt(n);const r=e[n.buffer];MEt(r);const o=(n.byteOffset||0)+r.byteOffset;return new Uint8Array(r.arrayBuffer,o,n.byteLength)}(t.json,t.buffers,e.bufferView);a=Hat(i.buffer,i.byteOffset,i.byteLength)}MEt(a,"glTF image has no data");let l=await s(a,[Uct,SEt],{mimeType:e.mimeType,basis:n.basis||{format:EEt()}},r);l&&l[0]&&(l={compressed:!0,mipmaps:!1,width:l[0].width,height:l[0].height,data:l[0]}),t.images=t.images||[],t.images[i]=l}const IMt={name:"glTF",id:"gltf",module:"gltf",version:"3.4.14",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;e={...IMt.options,...e},e.gltf={...IMt.options.gltf,...e.gltf};const{byteOffset:n=0}=e;return await MMt({},t,n,e,i)},options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0,postProcess:!0},log:console},deprecatedOptions:{fetchImages:"gltf.loadImages",createImages:"gltf.loadImages",decompress:"gltf.decompressMeshes",postProcess:"gltf.postProcess",gltf:{decompress:"gltf.decompressMeshes"}}};async function CMt(t){const e=[];return t.scenes.forEach((t=>{t.traverse((t=>{Object.values(t.model.getUniforms()).forEach((t=>{!1===t.loaded&&e.push(t)}))}))})),await async function(t){for(;t();)await new Promise((t=>requestAnimationFrame(t)))}((()=>e.some((t=>!t.loaded))))}const PMt=[255,255,255,255],LMt={scenegraph:{type:"object",value:null,async:!0},getScene:t=>t&&t.scenes?"object"==typeof t.scene?t.scene:t.scenes[t.scene||0]:t,getAnimator:t=>t&&t.animator,_animations:null,sizeScale:{type:"number",value:1,min:0},sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:t=>t.position},getColor:{type:"accessor",value:PMt},_lighting:"flat",_imageBasedLightingEnvironment:null,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},loaders:[IMt]};class DMt extends kbt{constructor(...t){super(...t),cat(this,"state",void 0)}getShaders(){const t=[Yvt,Qvt];return"pbr"===this.props._lighting&&t.push(Tgt),super.getShaders({vs:"#version 300 es\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\nin vec4 POSITION;\n\n#ifdef HAS_UV\n in vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n in vec4 NORMAL;\n #endif\n#endif\nout vec4 vColor;\n#ifndef MODULE_PBR\n #ifdef HAS_UV\n out vec2 vTEXCOORD_0;\n #endif\n#endif\nvoid main(void) {\n #if defined(HAS_UV) && !defined(MODULE_PBR)\n vTEXCOORD_0 = TEXCOORD_0;\n geometry.uv = vTEXCOORD_0;\n #endif\n\n geometry.worldPosition = instancePositions;\n geometry.pickingColor = instancePickingColors;\n\n vec3 normal = vec3(0.0, 0.0, 1.0);\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n normal = instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz;\n #endif\n #endif\n\n float originalSize = project_size_to_pixel(sizeScale);\n float clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;\n if(composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n geometry.normal = project_normal(normal);\n geometry.worldPosition += pos;\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);\n geometry.normal = project_normal(normal);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #ifdef HAS_NORMALS\n pbr_vNormal = geometry.normal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = TEXCOORD_0;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\nuniform float opacity;\nin vec4 vColor;\n\nout vec4 fragmentColor;\n#ifndef MODULE_PBR\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n in vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n #endif\n#endif\n\nvoid main(void) {\n #ifdef MODULE_PBR\n fragmentColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n #else\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n fragmentColor = vColor * texture2D(u_BaseColorSampler, vTEXCOORD_0);\n geometry.uv = vTEXCOORD_0;\n #else\n fragmentColor = vColor;\n #endif\n #endif\n\n fragmentColor.a *= opacity;\n DECKGL_FILTER_COLOR(fragmentColor, geometry);\n}\n",modules:t})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),accessor:"getPosition",transition:!0},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:PMt,transition:!0},instanceModelMatrix:tAt})}updateState(t){super.updateState(t);const{props:e,oldProps:i}=t;e.scenegraph!==i.scenegraph?this._updateScenegraph():e._animations!==i._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,e._animations)}finalizeState(t){super.finalizeState(t),this._deleteScenegraph()}get isLoaded(){var t;return(null===(t=this.state)||void 0===t?void 0:t.scenegraph)&&super.isLoaded}_updateScenegraph(){const t=this.props,{gl:e}=this.context;let i=null;if(t.scenegraph instanceof CAt)i={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const n=t.scenegraph,r=function(t,e,i){const n=new HAt(t,i);return{scenes:n.instantiate(e),animator:n.createAnimator()}}(e,n,this._getModelOptions());i={gltf:n,...r},CMt(r).then((()=>this.setNeedsRedraw()))}else t.scenegraph&&(dut.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader")(),i=t.scenegraph);const n={layer:this,gl:e},r=t.getScene(i,n),o=t.getAnimator(i,n);r instanceof CAt?(this._deleteScenegraph(),this._applyAllAttributes(r),this._applyAnimationsProp(r,o,t._animations),this.setState({scenegraph:r,animator:o})):null!==r&&dut.warn("invalid scenegraph:",r)()}_applyAllAttributes(t){if(this.state.attributesAvailable){const e=this.getAttributeManager().getAttributes();t.traverse((t=>{this._setModelAttributes(t.model,e)}))}}_applyAnimationsProp(t,e,i){if(!t||!e||!i)return;const n=e.getAnimations();Object.keys(i).sort().forEach((t=>{const e=i[t];if("*"===t)n.forEach((t=>{Object.assign(t,e)}));else if(Number.isFinite(Number(t))){const i=Number(t);i>=0&&i<n.length?Object.assign(n[i],e):dut.warn("animation ".concat(t," not found"))()}else{const i=n.find((({name:e})=>e===t));i?Object.assign(i,e):dut.warn("animation ".concat(t," not found"))()}}))}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof CAt&&t.delete()}_getModelOptions(){const{_imageBasedLightingEnvironment:t}=this.props;let e=null;return t&&(e="function"==typeof t?t({gl:this.context.gl,layer:this}):t),{gl:this.context.gl,waitForFullLoad:!0,imageBasedLightingEnvironment:e,modelOptions:{isInstanced:!0,transpileToGLSL100:!Iut(this.context.gl),...this.getShaders()},useTangents:!1}}updateAttributes(t){this.setState({attributesAvailable:!0}),this.state.scenegraph&&this.state.scenegraph.traverse((e=>{this._setModelAttributes(e.model,t)}))}draw({moduleParameters:t=null,parameters:e={},context:i}){if(!this.state.scenegraph)return;this.props._animations&&this.state.animator&&(this.state.animator.animate(i.timeline.getTime()),this.setNeedsRedraw());const{viewport:n}=this.context,{sizeScale:r,sizeMinPixels:o,sizeMaxPixels:s,opacity:a,coordinateSystem:l}=this.props,c=this.getNumInstances();this.state.scenegraph.traverse(((i,{worldMatrix:u})=>{i.model.setInstanceCount(c),i.updateModuleSettings(t),i.draw({parameters:e,uniforms:{sizeScale:r,opacity:a,sizeMinPixels:o,sizeMaxPixels:s,composeModelMatrix:eAt(n,l),sceneModelMatrix:u,u_Camera:i.model.getUniforms().project_uCameraPosition}})}))}}cat(DMt,"defaultProps",LMt),cat(DMt,"layerName","ScenegraphLayer");class RMt extends IAt{getShaders(){const t=super.getShaders();return t.modules.push(Tgt),{...t,vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nuniform bool pickFeatureIds;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec4 uvRegions;\nin vec3 featureIdsPickingColors;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvec2 applyUVRegion(vec2 uv) {\n #ifdef HAS_UV_REGIONS\n return fract(uv) * (uvRegions.zw - uvRegions.xy) + uvRegions.xy;\n #else\n return uv;\n #endif\n}\n\nvoid main(void) {\n vec2 uv = applyUVRegion(texCoords);\n geometry.uv = uv;\n\n if (pickFeatureIds) {\n geometry.pickingColor = featureIdsPickingColors;\n } else {\n geometry.pickingColor = instancePickingColors;\n }\n\n vTexCoord = uv;\n cameraPosition = project_uCameraPosition;\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale;\n vec3 projectedPosition = project_position(positions);\n position_commonspace = vec4(projectedPosition, 1.0);\n gl_Position = project_common_position_to_clipspace(position_commonspace);\n\n geometry.position = position_commonspace;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n geometry.normal = normals_commonspace;\n\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #ifdef HAS_NORMALS\n pbr_vNormal = geometry.normal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = uv;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n \n#ifdef MODULE_PBR\n\n fragColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n fragColor.a *= opacity;\n\n#else\n\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n#endif\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n"}}initializeState(){const{featureIds:t}=this.props;super.initializeState();const e=this.getAttributeManager();t&&e.add({featureIdsPickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateFeatureIdsPickingColors}})}updateState(t){super.updateState(t);const{props:e,oldProps:i}=t;e.pbrMaterial!==i.pbrMaterial&&this.updatePbrMaterialUniforms(e.pbrMaterial)}draw(t){const{featureIds:e}=this.props;this.state.model&&(this.state.model.setUniforms({u_Camera:this.state.model.getUniforms().project_uCameraPosition,pickFeatureIds:Boolean(e)}),super.draw(t))}getModel(t){const{id:e,pbrMaterial:i}=this.props,n=this.parseMaterial(i,t);this.setState({materialParser:n});const r=this.getShaders();var o;(o=t.attributes).COLOR_0||o.colors||(o.colors={constant:!0,value:new Float32Array([1,1,1])});return new kgt(this.context.gl,{...this.getShaders(),id:e,geometry:t,defines:{...r.defines,...null==n?void 0:n.defines,HAS_UV_REGIONS:t.attributes.uvRegions},parameters:null==n?void 0:n.parameters,isInstanced:!0})}updatePbrMaterialUniforms(t){const{model:e}=this.state;if(e){const{mesh:i}=this.props,n=this.parseMaterial(t,i);this.setState({materialParser:n}),e.setUniforms(n.uniforms)}}parseMaterial(t,e){var i;const n=Boolean(t.pbrMetallicRoughness&&t.pbrMetallicRoughness.baseColorTexture);return null===(i=this.state.materialParser)||void 0===i||i.delete(),new VAt(this.context.gl,{attributes:{NORMAL:e.attributes.normals,TEXCOORD_0:e.attributes.texCoords},material:{unlit:n,...t},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1})}calculateFeatureIdsPickingColors(t){const e=this.props.featureIds,i=new Uint8ClampedArray(e.length*t.size),n=[];for(let t=0;t<e.length;t++)this.encodePickingColor(e[t],n),i[3*t]=n[0],i[3*t+1]=n[1],i[3*t+2]=n[2];t.value=i}finalizeState(t){var e;super.finalizeState(t),null===(e=this.state.materialParser)||void 0===e||e.delete(),this.setState({materialParser:null})}}cat(RMt,"layerName","MeshLayer"),cat(RMt,"defaultProps",{pbrMaterial:{type:"object",value:null},featureIds:{type:"array",value:null,optional:!0}});function OMt(t){return t}function kMt(t,e=[]){return function(t,e=[],i=OMt){return"longitude"in t?(e[0]=i(t.longitude),e[1]=i(t.latitude),e[2]=t.height):"x"in t?(e[0]=i(t.x),e[1]=i(t.y),e[2]=t.z):(e[0]=i(t[0]),e[1]=i(t[1]),e[2]=t[2]),e}(t,e,zft._cartographicRadians?OMt:Uft)}function NMt(t,e){return function(t,e,i=OMt){return"longitude"in e?(e.longitude=i(t[0]),e.latitude=i(t[1]),e.height=t[2]):"x"in e?(e.x=i(t[0]),e.y=i(t[1]),e.z=t[2]):(e[0]=i(t[0]),e[1]=i(t[1]),e[2]=t[2]),e}(t,e,zft._cartographicRadians?OMt:Gft)}new bmt;const BMt=new bmt,zMt=new bmt,FMt=new bmt;const VMt=new bmt,UMt={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},GMt={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},jMt={east:new bmt,north:new bmt,up:new bmt,west:new bmt,south:new bmt,down:new bmt},HMt=new bmt,WMt=new bmt,qMt=new bmt;function XMt(t,e,i,n,r,o){const s=UMt[e]&&UMt[e][i];let a,l,c;kft(s&&(!n||n===s));const u=VMt.copy(r);if(qft(u.x,0,1e-14)&&qft(u.y,0,1e-14)){const t=Math.sign(u.z);a=HMt.fromArray(GMt[e]),"east"!==e&&"west"!==e&&a.scale(t),l=WMt.fromArray(GMt[i]),"east"!==i&&"west"!==i&&l.scale(t),c=qMt.fromArray(GMt[n]),"east"!==n&&"west"!==n&&c.scale(t)}else{const{up:r,east:o,north:s}=jMt;o.set(-u.y,u.x,0).normalize(),t.geodeticSurfaceNormal(u,r),s.copy(r).cross(o);const{down:h,west:p,south:d}=jMt;h.copy(r).scale(-1),p.copy(o).scale(-1),d.copy(s).scale(-1),a=jMt[e],l=jMt[i],c=jMt[n]}return o[0]=a.x,o[1]=a.y,o[2]=a.z,o[3]=0,o[4]=l.x,o[5]=l.y,o[6]=l.z,o[7]=0,o[8]=c.x,o[9]=c.y,o[10]=c.z,o[11]=0,o[12]=u.x,o[13]=u.y,o[14]=u.z,o[15]=1,o}const ZMt=new bmt,YMt=new bmt,QMt=new bmt,JMt=new bmt,KMt=new bmt,$Mt=new bmt;class tTt{constructor(t=0,e=0,i=0){cat(this,"radii",void 0),cat(this,"radiiSquared",void 0),cat(this,"radiiToTheFourth",void 0),cat(this,"oneOverRadii",void 0),cat(this,"oneOverRadiiSquared",void 0),cat(this,"minimumRadius",void 0),cat(this,"maximumRadius",void 0),cat(this,"centerToleranceSquared",mgt.EPSILON1),cat(this,"squaredXOverSquaredZ",void 0),kft(t>=0),kft(e>=0),kft(i>=0),this.radii=new bmt(t,e,i),this.radiiSquared=new bmt(t*t,e*e,i*i),this.radiiToTheFourth=new bmt(t*t*t*t,e*e*e*e,i*i*i*i),this.oneOverRadii=new bmt(0===t?0:1/t,0===e?0:1/e,0===i?0:1/i),this.oneOverRadiiSquared=new bmt(0===t?0:1/(t*t),0===e?0:1/(e*e),0===i?0:1/(i*i)),this.minimumRadius=Math.min(t,e,i),this.maximumRadius=Math.max(t,e,i),0!==this.radiiSquared.z&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(t){return this===t||Boolean(t&&this.radii.equals(t.radii))}toString(){return this.radii.toString()}cartographicToCartesian(t,e=[0,0,0]){const i=YMt,n=QMt,[,,r]=t;this.geodeticSurfaceNormalCartographic(t,i),n.copy(this.radiiSquared).scale(i);const o=Math.sqrt(i.dot(n));return n.scale(1/o),i.scale(r),n.add(i),n.to(e)}cartesianToCartographic(t,e=[0,0,0]){$Mt.from(t);const i=this.scaleToGeodeticSurface($Mt,JMt);if(!i)return;const n=this.geodeticSurfaceNormal(i,YMt),r=KMt;r.copy($Mt).subtract(i);return NMt([Math.atan2(n.y,n.x),Math.asin(n.z),Math.sign(hmt(r,$Mt))*cmt(r)],e)}eastNorthUpToFixedFrame(t,e=new Xmt){return XMt(this,"east","north","up",t,e)}localFrameToFixedFrame(t,e,i,n,r=new Xmt){return XMt(this,t,e,i,n,r)}geocentricSurfaceNormal(t,e=[0,0,0]){return ZMt.from(t).normalize().to(e)}geodeticSurfaceNormalCartographic(t,e=[0,0,0]){const i=kMt(t),n=i[0],r=i[1],o=Math.cos(r);return ZMt.set(o*Math.cos(n),o*Math.sin(n),Math.sin(r)).normalize(),ZMt.to(e)}geodeticSurfaceNormal(t,e=[0,0,0]){return ZMt.from(t).scale(this.oneOverRadiiSquared).normalize().to(e)}scaleToGeodeticSurface(t,e){return function(t,e,i=[]){const{oneOverRadii:n,oneOverRadiiSquared:r,centerToleranceSquared:o}=e;BMt.from(t);const s=BMt.x,a=BMt.y,l=BMt.z,c=n.x,u=n.y,h=n.z,p=s*s*c*c,d=a*a*u*u,f=l*l*h*h,m=p+d+f,g=Math.sqrt(1/m);if(!Number.isFinite(g))return;const y=zMt;if(y.copy(t).scale(g),m<o)return y.to(i);const v=r.x,_=r.y,x=r.z,b=FMt;b.set(y.x*v*2,y.y*_*2,y.z*x*2);let w,A,E,S,M=(1-g)*BMt.len()/(.5*b.len()),T=0;do{M-=T,w=1/(1+M*v),A=1/(1+M*_),E=1/(1+M*x);const t=w*w,e=A*A,i=E*E;S=p*t+d*e+f*i-1,T=S/(-2*(p*(t*w)*v+d*(e*A)*_+f*(i*E)*x))}while(Math.abs(S)>mgt.EPSILON12);return BMt.scale([w,A,E]).to(i)}(t,this,e)}scaleToGeocentricSurface(t,e=[0,0,0]){JMt.from(t);const i=JMt.x,n=JMt.y,r=JMt.z,o=this.oneOverRadiiSquared,s=1/Math.sqrt(i*i*o.x+n*n*o.y+r*r*o.z);return JMt.multiplyScalar(s).to(e)}transformPositionToScaledSpace(t,e=[0,0,0]){return JMt.from(t).scale(this.oneOverRadii).to(e)}transformPositionFromScaledSpace(t,e=[0,0,0]){return JMt.from(t).scale(this.radii).to(e)}getSurfaceNormalIntersectionWithZAxis(t,e=0,i=[0,0,0]){kft(qft(this.radii.x,this.radii.y,mgt.EPSILON15)),kft(this.radii.z>0),JMt.from(t);const n=JMt.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(n)>=this.radii.z-e))return JMt.set(0,0,n).to(i)}}function eTt(){let t;if("undefined"!=typeof window&&window.performance)t=window.performance.now();else if(void 0!==process&&process.hrtime){const e=process.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}cat(tTt,"WGS84",new tTt(6378137,6378137,6356752.314245179));class iTt{constructor(t,e){this.name=void 0,this.type=void 0,this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=t,this.type=e,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=eTt(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(eTt()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class nTt{constructor(t){this.id=void 0,this.stats={},this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"count";return this._getOrCreate({name:t,type:e})}get size(){return Object.keys(this.stats).length}reset(){for(const t of Object.values(this.stats))t.reset();return this}forEach(t){for(const e of Object.values(this.stats))t(e)}getTable(){const t={};return this.forEach((e=>{t[e.name]={time:e.time||0,count:e.count||0,average:e.getAverageTime()||0,hz:e.getHz()||0}})),t}_initializeStats(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((t=>this._getOrCreate(t)))}_getOrCreate(t){const{name:e,type:i}=t;let n=this.stats[e];return n||(n=t instanceof iTt?t:new iTt(e,i),this.stats[e]=n),n}}class rTt{constructor(t,e,i){cat(this,"item",void 0),cat(this,"previous",void 0),cat(this,"next",void 0),this.item=t,this.previous=e,this.next=i}}class oTt{constructor(){cat(this,"head",null),cat(this,"tail",null),cat(this,"_length",0)}get length(){return this._length}add(t){const e=new rTt(t,this.tail,null);return this.tail?(this.tail.next=e,this.tail=e):(this.head=e,this.tail=e),++this._length,e}remove(t){t&&(t.previous&&t.next?(t.previous.next=t.next,t.next.previous=t.previous):t.previous?(t.previous.next=null,this.tail=t.previous):t.next?(t.next.previous=null,this.head=t.next):(this.head=null,this.tail=null),t.next=null,t.previous=null,--this._length)}splice(t,e){t!==e&&(this.remove(e),this._insert(t,e))}_insert(t,e){const i=t.next;t.next=e,this.tail===t?this.tail=e:i.previous=e,e.next=i,e.previous=t,++this._length}}class sTt{constructor(){cat(this,"_list",void 0),cat(this,"_sentinel",void 0),cat(this,"_trimTiles",void 0),this._list=new oTt,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}reset(){this._list.splice(this._list.tail,this._sentinel)}touch(t){const e=t._cacheNode;e&&this._list.splice(this._sentinel,e)}add(t,e,i){e._cacheNode||(e._cacheNode=this._list.add(e),i&&i(t,e))}unloadTile(t,e,i){const n=e._cacheNode;n&&(this._list.remove(n),e._cacheNode=null,i&&i(t,e))}unloadTiles(t,e){const i=this._trimTiles;this._trimTiles=!1;const n=this._list,r=1024*t.maximumMemoryUsage*1024,o=this._sentinel;let s=n.head;for(;s!==o&&(t.gpuMemoryUsageInBytes>r||i);){const i=s.item;s=s.next,this.unloadTile(t,i,e)}}trim(){this._trimTiles=!0}}const aTt=new bmt,lTt=new bmt,cTt=new Lwt([new Twt,new Twt,new Twt,new Twt,new Twt,new Twt]);function uTt(t,e){const{cameraDirection:i,cameraUp:n,height:r}=t,{metersPerUnit:o}=t.distanceScales,s=pTt(t,t.center),a=tTt.WGS84.eastNorthUpToFixedFrame(s),l=t.unprojectPosition(t.cameraPosition),c=tTt.WGS84.cartographicToCartesian(l,new bmt),u=new bmt(a.transformAsVector(new bmt(i).scale(o))).normalize(),h=new bmt(a.transformAsVector(new bmt(n).scale(o))).normalize();!function(t){const e=t.getFrustumPlanes(),i=hTt(e.near,t.cameraPosition),n=pTt(t,i),r=pTt(t,t.cameraPosition,lTt);let o=0;cTt.planes[o++].fromPointNormal(n,aTt.copy(n).subtract(r));for(const r in e){if("near"===r)continue;const s=pTt(t,hTt(e[r],i,lTt),lTt);cTt.planes[o++].fromPointNormal(s,aTt.copy(n).subtract(s))}}(t);const p=t.constructor,{longitude:d,latitude:f,width:m,bearing:g,zoom:y}=t;return{camera:{position:c,direction:u,up:h},viewport:t,topDownViewport:new p({longitude:d,latitude:f,height:r,width:m,bearing:g,zoom:y,pitch:0}),height:r,cullingVolume:cTt,frameNumber:e,sseDenominator:1.15}}function hTt(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new bmt;const n=t.normal.dot(e);return i.copy(t.normal).scale(t.distance-n).add(e),i}function pTt(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new bmt;const n=t.unprojectPosition(e);return tTt.WGS84.cartographicToCartesian(n,i)}const dTt=6356752.314245179,fTt=new bmt;function mTt(t,e){if(t instanceof Ewt){const{halfAxes:i}=t,n=function(t){t.getColumn(0,fTt);const e=t.getColumn(1),i=t.getColumn(2),n=fTt.add(e).add(i).len();return n}(i);return Math.log2(dTt/(n+e[2]))}if(t instanceof awt){const{radius:i}=t;return Math.log2(dTt/(i+e[2]))}if(t.width&&t.height){const{width:e,height:i}=t;return(Math.log2(6378137/e)+Math.log2(6378137/i))/2}return 1}function gTt(t,e,i){const n=tTt.WGS84.cartographicToCartesian([t.xmax,t.ymax,t.zmax],new bmt),r=Math.sqrt(Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2)+Math.pow(n[2]-i[2],2));return Math.log2(dTt/(r+e[2]))}const yTt=0,vTt=1,_Tt=3,xTt=4,bTt=5,wTt={ADD:1,REPLACE:2},ATt={EMPTY:"empty",SCENEGRAPH:"scenegraph",POINTCLOUD:"pointcloud",MESH:"mesh"},ETt={I3S:"I3S",TILES3D:"TILES3D"},STt={GEOMETRIC_ERROR:"geometricError",MAX_SCREEN_THRESHOLD:"maxScreenThreshold"},MTt=1;function TTt(t){return null!=t}const ITt=new bmt,CTt=new bmt,PTt=new bmt,LTt=new bmt;function DTt(t,e,i){if(uat(t,"3D Tile: boundingVolume must be defined"),t.box)return function(t,e,i){const n=new bmt(t[0],t[1],t[2]);e.transform(n,n);let r=[];if(10===t.length){const e=t.slice(3,6),i=new fgt;i.fromArray(t,6);const n=new bmt([1,0,0]),o=new bmt([0,1,0]),s=new bmt([0,0,1]);n.transformByQuaternion(i),n.scale(e[0]),o.transformByQuaternion(i),o.scale(e[1]),s.transformByQuaternion(i),s.scale(e[2]),r=[...n.toArray(),...o.toArray(),...s.toArray()]}else r=[...t.slice(3,6),...t.slice(6,9),...t.slice(9,12)];const o=e.transformAsVector(r.slice(0,3)),s=e.transformAsVector(r.slice(3,6)),a=e.transformAsVector(r.slice(6,9)),l=new Imt([o[0],o[1],o[2],s[0],s[1],s[2],a[0],a[1],a[2]]);if(TTt(i))return i.center=n,i.halfAxes=l,i;return new Ewt(n,l)}(t.box,e,i);if(t.region){const[e,i,n,r,o,s]=t.region,a=tTt.WGS84.cartographicToCartesian([jft(e),jft(r),o],PTt),l=tTt.WGS84.cartographicToCartesian([jft(n),jft(i),s],LTt),c=(new bmt).addVectors(a,l).multiplyScalar(.5),u=(new bmt).subVectors(a,l).len()/2;return OTt([c[0],c[1],c[2],u],new Xmt)}if(t.sphere)return OTt(t.sphere,e,i);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function RTt(t,e){if(t.box)return function(t){const e=kTt(),{halfAxes:i}=t,n=new bmt(i.getColumn(0)),r=new bmt(i.getColumn(1)),o=new bmt(i.getColumn(2));for(let i=0;i<2;i++){for(let i=0;i<2;i++){for(let i=0;i<2;i++)ITt.copy(t.center),ITt.add(n),ITt.add(r),ITt.add(o),NTt(e,ITt),o.negate();r.negate()}n.negate()}return e}(e);if(t.region){const[e,i,n,r,o,s]=t.region;return[[jft(e),jft(i),o],[jft(n),jft(r),s]]}if(t.sphere)return function(t){const e=kTt(),{center:i,radius:n}=t,r=tTt.WGS84.scaleToGeodeticSurface(i,ITt);let o;o=r?tTt.WGS84.geodeticSurfaceNormal(r):new bmt(0,0,1);let s=new bmt(o[2],-o[1],0);s.len()>0?s.normalize():s=new bmt(0,1,0);const a=s.clone().cross(o);for(const t of[s,a,o]){CTt.copy(t).scale(n);for(let t=0;t<2;t++)ITt.copy(i),ITt.add(CTt),NTt(e,ITt),CTt.negate()}return e}(e);throw new Error("Unkown boundingVolume type")}function OTt(t,e,i){const n=new bmt(t[0],t[1],t[2]);e.transform(n,n);const r=e.getScale(CTt),o=Math.max(Math.max(r[0],r[1]),r[2]),s=t[3]*o;return TTt(i)?(i.center=n,i.radius=s,i):new awt(n,s)}function kTt(){return[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]]}function NTt(t,e){tTt.WGS84.cartesianToCartographic(e,ITt),t[0][0]=Math.min(t[0][0],ITt[0]),t[0][1]=Math.min(t[0][1],ITt[1]),t[0][2]=Math.min(t[0][2],ITt[2]),t[1][0]=Math.max(t[1][0],ITt[0]),t[1][1]=Math.max(t[1][1],ITt[1]),t[1][2]=Math.max(t[1][2],ITt[2])}function BTt(t,e){if(t.dynamicScreenSpaceError&&t.dynamicScreenSpaceErrorComputedDensity){const i=t.dynamicScreenSpaceErrorComputedDensity,n=t.dynamicScreenSpaceErrorFactor,r=function(t,e){const i=t*e;return 1-Math.exp(-i*i)}(e,i)*n;return r}return 0}new bmt,new bmt,new Xmt,new bmt,new bmt,new bmt;const zTt=new bmt,FTt=new bmt,VTt=new bmt,UTt=new bmt,GTt=new bmt,jTt=new Xmt,HTt=new Xmt;function WTt(t,e){const{topDownViewport:i}=e,n=t.header.mbs[1],r=t.header.mbs[0],o=t.header.mbs[2],s=t.header.mbs[3],a=[...t.boundingVolume.center],l=i.unprojectPosition(i.cameraPosition);tTt.WGS84.cartographicToCartesian(l,zTt),FTt.copy(zTt).subtract(a).normalize(),tTt.WGS84.eastNorthUpToFixedFrame(a,jTt),HTt.copy(jTt).invert(),VTt.copy(zTt).transform(HTt);const c=Math.sqrt(VTt[0]*VTt[0]+VTt[1]*VTt[1]),u=c*c/VTt[2];UTt.copy([VTt[0],VTt[1],u]);const h=UTt.transform(jTt).subtract(a).normalize(),p=FTt.cross(h).normalize().scale(s).add(a),d=tTt.WGS84.cartesianToCartographic(p),f=i.project([r,n,o]),m=i.project(d);return GTt.copy(f).subtract(m).magnitude()}class qTt{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;cat(this,"_map",new Map),cat(this,"_array",void 0),cat(this,"_length",void 0),this._array=new Array(t),this._length=t}get length(){return this._length}set length(t){this._length=t,t>this._array.length&&(this._array.length=t)}get values(){return this._array}get(t){return uat(t<this._array.length),this._array[t]}set(t,e){uat(t>=0),t>=this.length&&(this.length=t+1),this._map.has(this._array[t])&&this._map.delete(this._array[t]),this._array[t]=e,this._map.set(e,t)}delete(t){const e=this._map.get(t);e>=0&&(this._array.splice(e,1),this._map.delete(t),this.length--)}peek(){return this._array[this._length-1]}push(t){if(!this._map.has(t)){const e=this.length++;this._array[e]=t,this._map.set(t,e)}}pop(){const t=this._array[--this.length];return this._map.delete(t),t}reserve(t){uat(t>=0),t>this._array.length&&(this._array.length=t)}resize(t){uat(t>=0),this.length=t}trim(t){null==t&&(t=this.length),this._array.length=t}reset(){this._array=[],this._map=new Map,this._length=0}find(t){return this._map.has(t)}}const XTt={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:()=>{},viewportTraversersMap:{},basePath:""};class ZTt{traversalFinished(t){return!0}constructor(t){cat(this,"options",void 0),cat(this,"root",null),cat(this,"selectedTiles",{}),cat(this,"requestedTiles",{}),cat(this,"emptyTiles",{}),cat(this,"lastUpdate",(new Date).getTime()),cat(this,"updateDebounceTime",1e3),cat(this,"_traversalStack",new qTt),cat(this,"_emptyTraversalStack",new qTt),cat(this,"_frameNumber",null),this.options={...XTt,...t}}traverse(t,e,i){this.root=t,this.options={...this.options,...i},this.reset(),this.updateTile(t,e),this._frameNumber=e.frameNumber,this.executeTraversal(t,e)}reset(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}executeTraversal(t,e){const i=this._traversalStack;for(t._selectionDepth=1,i.push(t);i.length>0;){const t=i.pop();let n=!1;this.canTraverse(t,e)&&(this.updateChildTiles(t,e),n=this.updateAndPushChildren(t,e,i,t.hasRenderContent?t._selectionDepth+1:t._selectionDepth));const r=t.parent,o=Boolean(!r||r._shouldRefine),s=!n;t.hasRenderContent?t.refine===wTt.ADD?(this.loadTile(t,e),this.selectTile(t,e)):t.refine===wTt.REPLACE&&(this.loadTile(t,e),s&&this.selectTile(t,e)):(this.emptyTiles[t.id]=t,this.loadTile(t,e),s&&this.selectTile(t,e)),this.touchTile(t,e),t._shouldRefine=n&&o}const n=(new Date).getTime();(this.traversalFinished(e)||n-this.lastUpdate>this.updateDebounceTime)&&(this.lastUpdate=n,this.options.onTraversalEnd(e))}updateChildTiles(t,e){const i=t.children;for(const t of i)this.updateTile(t,e)}updateAndPushChildren(t,e,i,n){const{loadSiblings:r,skipLevelOfDetail:o}=this.options,s=t.children;s.sort(this.compareDistanceToCamera.bind(this));const a=t.refine===wTt.REPLACE&&t.hasRenderContent&&!o;let l=!1,c=!0;for(const t of s)if(t._selectionDepth=n,t.isVisibleAndInRequestVolume?(i.find(t)&&i.delete(t),i.push(t),l=!0):(a||r)&&(this.loadTile(t,e),this.touchTile(t,e)),a){let i;if(i=!!t._inRequestVolume&&(t.hasRenderContent?t.contentAvailable:this.executeEmptyTraversal(t,e)),c=c&&i,!c)return!1}return l||(c=!1),c}updateTile(t,e){this.updateTileVisibility(t,e)}selectTile(t,e){this.shouldSelectTile(t)&&(t._selectedFrame=e.frameNumber,this.selectedTiles[t.id]=t)}loadTile(t,e){this.shouldLoadTile(t)&&(t._requestedFrame=e.frameNumber,t._priority=t._getPriority(),this.requestedTiles[t.id]=t)}touchTile(t,e){t.tileset._cache.touch(t),t._touchedFrame=e.frameNumber}canTraverse(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return!!t.hasChildren&&(t.hasTilesetContent?!t.contentExpired:!(!n&&!t.isVisibleAndInRequestVolume)&&this.shouldRefine(t,e,i))}shouldLoadTile(t){return t.hasUnloadedContent||t.contentExpired}shouldSelectTile(t){return t.contentAvailable&&!this.options.skipLevelOfDetail}shouldRefine(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=t._screenSpaceError;return i&&(n=t.getScreenSpaceError(e,!0)),n>this.options.maximumScreenSpaceError}updateTileVisibility(t,e){const i=[];if(this.options.viewportTraversersMap)for(const t in this.options.viewportTraversersMap){this.options.viewportTraversersMap[t]===e.viewport.id&&i.push(t)}else i.push(e.viewport.id);t.updateVisibility(e,i)}compareDistanceToCamera(t,e){return t._distanceToCamera-e._distanceToCamera}anyChildrenVisible(t,e){let i=!1;for(const n of t.children)n.updateVisibility(e),i=i||n.isVisibleAndInRequestVolume;return i}executeEmptyTraversal(t,e){let i=!0;const n=this._emptyTraversalStack;for(n.push(t);n.length>0&&i;){const t=n.pop();this.updateTile(t,e),t.isVisibleAndInRequestVolume||this.loadTile(t,e),this.touchTile(t,e);if(!t.hasRenderContent&&this.canTraverse(t,e,!1,!0)){const e=t.children;for(const t of e)n.find(t)&&n.delete(t),n.push(t)}else t.contentAvailable||t.hasEmptyContent||(i=!1)}return i}}const YTt=new bmt;class QTt{constructor(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";cat(this,"tileset",void 0),cat(this,"header",void 0),cat(this,"id",void 0),cat(this,"url",void 0),cat(this,"parent",void 0),cat(this,"refine",void 0),cat(this,"type",void 0),cat(this,"contentUrl",void 0),cat(this,"lodMetricType","geometricError"),cat(this,"lodMetricValue",0),cat(this,"boundingVolume",null),cat(this,"content",null),cat(this,"contentState",yTt),cat(this,"gpuMemoryUsageInBytes",0),cat(this,"children",[]),cat(this,"depth",0),cat(this,"viewportIds",[]),cat(this,"transform",new Xmt),cat(this,"extensions",null),cat(this,"implicitTiling",null),cat(this,"userData",{}),cat(this,"computedTransform",void 0),cat(this,"hasEmptyContent",!1),cat(this,"hasTilesetContent",!1),cat(this,"traverser",new ZTt({})),cat(this,"_cacheNode",null),cat(this,"_frameNumber",null),cat(this,"_expireDate",null),cat(this,"_expiredContent",null),cat(this,"_boundingBox",void 0),cat(this,"_distanceToCamera",0),cat(this,"_screenSpaceError",0),cat(this,"_visibilityPlaneMask",void 0),cat(this,"_visible",void 0),cat(this,"_contentBoundingVolume",void 0),cat(this,"_viewerRequestVolume",void 0),cat(this,"_initialTransform",new Xmt),cat(this,"_priority",0),cat(this,"_selectedFrame",0),cat(this,"_requestedFrame",0),cat(this,"_selectionDepth",0),cat(this,"_touchedFrame",0),cat(this,"_centerZDepth",0),cat(this,"_shouldRefine",!1),cat(this,"_stackLength",0),cat(this,"_visitedFrame",0),cat(this,"_inRequestVolume",!1),cat(this,"_lodJudge",null),this.header=e,this.tileset=t,this.id=n||e.id,this.url=e.url,this.parent=i,this.refine=this._getRefine(e.refine),this.type=e.type,this.contentUrl=e.contentUrl,this._initializeLodMetric(e),this._initializeTransforms(e),this._initializeBoundingVolumes(e),this._initializeContent(e),this._initializeRenderingState(e),Object.seal(this)}destroy(){this.header=null}isDestroyed(){return null===this.header}get selected(){return this._selectedFrame===this.tileset._frameNumber}get isVisible(){return this._visible}get isVisibleAndInRequestVolume(){return this._visible&&this._inRequestVolume}get hasRenderContent(){return!this.hasEmptyContent&&!this.hasTilesetContent}get hasChildren(){return this.children.length>0||this.header.children&&this.header.children.length>0}get contentReady(){return this.contentState===_Tt||this.hasEmptyContent}get contentAvailable(){return Boolean(this.contentReady&&this.hasRenderContent||this._expiredContent&&!this.contentFailed)}get hasUnloadedContent(){return this.hasRenderContent&&this.contentUnloaded}get contentUnloaded(){return this.contentState===yTt}get contentExpired(){return this.contentState===xTt}get contentFailed(){return this.contentState===bTt}get distanceToCamera(){return this._distanceToCamera}get screenSpaceError(){return this._screenSpaceError}get boundingBox(){return this._boundingBox||(this._boundingBox=RTt(this.header.boundingVolume,this.boundingVolume)),this._boundingBox}getScreenSpaceError(t,e){switch(this.tileset.type){case ETt.I3S:return WTt(this,t);case ETt.TILES3D:return function(t,e,i){const n=t.tileset,r=t.parent&&t.parent.lodMetricValue||t.lodMetricValue,o=i?r:t.lodMetricValue;if(0===o)return 0;const s=Math.max(t._distanceToCamera,1e-7),{height:a,sseDenominator:l}=e,{viewDistanceScale:c}=n.options;let u=o*a*(c||1)/(s*l);return u-=BTt(n,s),u}(this,t,e);default:throw new Error("Unsupported tileset type")}}unselect(){this._selectedFrame=0}_getGpuMemoryUsageInBytes(){return this.content.gpuMemoryUsageInBytes||this.content.byteLength||0}_getPriority(){const t=this.tileset._traverser,{skipLevelOfDetail:e}=t.options,i=this.refine===wTt.ADD||e;if(i&&!this.isVisible&&void 0!==this._visible)return-1;if(this.tileset._frameNumber-this._touchedFrame>=1)return-1;if(this.contentState===yTt)return-1;const n=this.parent,r=n&&(!i||0===this._screenSpaceError||n.hasTilesetContent)?n._screenSpaceError:this._screenSpaceError,o=t.root?t.root._screenSpaceError:0;return Math.max(o-r,0)}async loadContent(){if(this.hasEmptyContent)return!1;if(this.content)return!0;this.contentExpired&&(this._expireDate=null),this.contentState=vTt;const t=await this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));if(!t)return this.contentState=yTt,!1;try{const t=this.tileset.getTileUrl(this.contentUrl),e=this.tileset.loader,i={...this.tileset.loadOptions,[e.id]:{...this.tileset.loadOptions[e.id],isTileset:"json"===this.type,...this._getLoaderSpecificOptions(e.id)}};return this.content=await bct(t,e,i),this.tileset.options.contentLoader&&await this.tileset.options.contentLoader(this),this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=_Tt,this._onContentLoaded(),!0}catch(t){throw this.contentState=bTt,t}finally{t.done()}}unloadContent(){return this.content&&this.content.destroy&&this.content.destroy(),this.content=null,this.header.content&&this.header.content.destroy&&this.header.content.destroy(),this.header.content=null,this.contentState=yTt,!0}updateVisibility(t,e){if(this._frameNumber===t.frameNumber)return;const i=this.parent,n=i?i._visibilityPlaneMask:Lwt.MASK_INDETERMINATE;if(this.tileset._traverser.options.updateTransforms){const t=i?i.computedTransform:this.tileset.modelMatrix;this._updateTransform(t)}this._distanceToCamera=this.distanceToTile(t),this._screenSpaceError=this.getScreenSpaceError(t,!1),this._visibilityPlaneMask=this.visibility(t,n),this._visible=this._visibilityPlaneMask!==Lwt.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(t),this._frameNumber=t.frameNumber,this.viewportIds=e}visibility(t,e){const{cullingVolume:i}=t,{boundingVolume:n}=this;return i.computeVisibilityWithPlaneMask(n,e)}contentVisibility(){return!0}distanceToTile(t){const e=this.boundingVolume;return Math.sqrt(Math.max(e.distanceSquaredTo(t.camera.position),0))}cameraSpaceZDepth(t){let{camera:e}=t;const i=this.boundingVolume;return YTt.subVectors(i.center,e.position),e.direction.dot(YTt)}insideViewerRequestVolume(t){const e=this._viewerRequestVolume;return!e||e.distanceSquaredTo(t.camera.position)<=0}updateExpiration(){if(null!=this._expireDate&&this.contentReady&&!this.hasEmptyContent){const t=Date.now();Date.lessThan(this._expireDate,t)&&(this.contentState=xTt,this._expiredContent=this.content)}}get extras(){return this.header.extras}_initializeLodMetric(t){"lodMetricType"in t?this.lodMetricType=t.lodMetricType:(this.lodMetricType=this.parent&&this.parent.lodMetricType||this.tileset.lodMetricType,console.warn("3D Tile: Required prop lodMetricType is undefined. Using parent lodMetricType")),"lodMetricValue"in t?this.lodMetricValue=t.lodMetricValue:(this.lodMetricValue=this.parent&&this.parent.lodMetricValue||this.tileset.lodMetricValue,console.warn("3D Tile: Required prop lodMetricValue is undefined. Using parent lodMetricValue"))}_initializeTransforms(t){this.transform=t.transform?new Xmt(t.transform):new Xmt;const e=this.parent,i=this.tileset,n=e&&e.computedTransform?e.computedTransform.clone():i.modelMatrix.clone();this.computedTransform=new Xmt(n).multiplyRight(this.transform);const r=e&&e._initialTransform?e._initialTransform.clone():new Xmt;this._initialTransform=new Xmt(r).multiplyRight(this.transform)}_initializeBoundingVolumes(t){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(t)}_initializeContent(t){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=yTt,this.hasTilesetContent=!1,t.contentUrl&&(this.content=null,this.hasEmptyContent=!1)}_initializeRenderingState(t){this.depth=t.level||(this.parent?this.parent.depth+1:0),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._visibilityPlaneMask=Lwt.MASK_INDETERMINATE,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._frameNumber=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._priority=0}_getRefine(t){return t||this.parent&&this.parent.refine||wTt.REPLACE}_isTileset(){return-1!==this.contentUrl.indexOf(".json")}_onContentLoaded(){switch(this.content&&this.content.type){case"vctr":case"geom":this.tileset._traverser.disableSkipLevelOfDetail=!0}this._isTileset()?this.hasTilesetContent=!0:this.gpuMemoryUsageInBytes=this._getGpuMemoryUsageInBytes()}_updateBoundingVolume(t){this.boundingVolume=DTt(t.boundingVolume,this.computedTransform,this.boundingVolume);const e=t.content;e&&(e.boundingVolume&&(this._contentBoundingVolume=DTt(e.boundingVolume,this.computedTransform,this._contentBoundingVolume)),t.viewerRequestVolume&&(this._viewerRequestVolume=DTt(t.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}_updateTransform(){const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Xmt).clone().multiplyRight(this.transform);!t.equals(this.computedTransform)&&(this.computedTransform=t,this._updateBoundingVolume(this.header))}_getLoaderSpecificOptions(t){return"i3s"===t?{...this.tileset.options.i3s,_tileOptions:{attributeUrls:this.header.attributeUrls,textureUrl:this.header.textureUrl,textureFormat:this.header.textureFormat,textureLoaderOptions:this.header.textureLoaderOptions,materialDefinition:this.header.materialDefinition,isDracoGeometry:this.header.isDracoGeometry,mbs:this.header.mbs},_tilesetOptions:{store:this.tileset.tileset.store,attributeStorageInfo:this.tileset.tileset.attributeStorageInfo,fields:this.tileset.tileset.fields},isTileHeader:!1}:{assetGltfUpAxis:(e=this.tileset.tileset).asset&&e.asset.gltfUpAxis||"Y"};var e}}class JTt extends ZTt{compareDistanceToCamera(t,e){return 0===e._distanceToCamera&&0===t._distanceToCamera?e._centerZDepth-t._centerZDepth:e._distanceToCamera-t._distanceToCamera}updateTileVisibility(t,e){if(super.updateTileVisibility(t,e),!t.isVisibleAndInRequestVolume)return;const i=t.children.length>0;if(t.hasTilesetContent&&i){const i=t.children[0];return this.updateTileVisibility(i,e),void(t._visible=i._visible)}if(this.meetsScreenSpaceErrorEarly(t,e))return void(t._visible=!1);const n=t.refine===wTt.REPLACE,r=t._optimChildrenWithinParent===MTt;n&&r&&i&&!this.anyChildrenVisible(t,e)&&(t._visible=!1)}meetsScreenSpaceErrorEarly(t,e){const{parent:i}=t;return!(!i||i.hasTilesetContent||i.refine!==wTt.ADD)&&!this.shouldRefine(t,e,!0)}}class KTt{constructor(){cat(this,"frameNumberMap",new Map)}register(t,e){const i=this.frameNumberMap.get(t)||new Map,n=i.get(e)||0;i.set(e,n+1),this.frameNumberMap.set(t,i)}deregister(t,e){const i=this.frameNumberMap.get(t);if(!i)return;const n=i.get(e)||1;i.set(e,n-1)}isZero(t,e){var i;return 0===((null===(i=this.frameNumberMap.get(t))||void 0===i?void 0:i.get(e))||0)}}const $Tt="REQUESTED",tIt="COMPLETED",eIt="ERROR";class iIt{constructor(){cat(this,"_statusMap",void 0),cat(this,"pendingTilesRegister",new KTt),this._statusMap={}}add(t,e,i,n){if(!this._statusMap[e]){const{frameNumber:r,viewport:{id:o}}=n;this._statusMap[e]={request:t,callback:i,key:e,frameState:n,status:$Tt},this.pendingTilesRegister.register(o,r),t().then((t=>{this._statusMap[e].status=tIt;const{frameNumber:i,viewport:{id:r}}=this._statusMap[e].frameState;this.pendingTilesRegister.deregister(r,i),this._statusMap[e].callback(t,n)})).catch((t=>{this._statusMap[e].status=eIt;const{frameNumber:n,viewport:{id:r}}=this._statusMap[e].frameState;this.pendingTilesRegister.deregister(r,n),i(t)}))}}update(t,e){if(this._statusMap[t]){const{frameNumber:i,viewport:{id:n}}=this._statusMap[t].frameState;this.pendingTilesRegister.deregister(n,i);const{frameNumber:r,viewport:{id:o}}=e;this.pendingTilesRegister.register(o,r),this._statusMap[t].frameState=e}}find(t){return this._statusMap[t]}hasPendingTiles(t,e){return!this.pendingTilesRegister.isZero(t,e)}}class nIt extends ZTt{constructor(t){super(t),cat(this,"_tileManager",void 0),this._tileManager=new iIt}traversalFinished(t){return!this._tileManager.hasPendingTiles(t.viewport.id,this._frameNumber||0)}shouldRefine(t,e){return t._lodJudge=function(t,e){if(0===t.lodMetricValue||isNaN(t.lodMetricValue))return"DIG";const i=2*WTt(t,e);return i<2?"OUT":!t.header.children||i<=t.lodMetricValue?"DRAW":t.header.children?"DIG":"OUT"}(t,e),"DIG"===t._lodJudge}updateChildTiles(t,e){const i=t.header.children||[],n=t.children,r=t.tileset;for(const o of i){const i="".concat(o.id,"-").concat(e.viewport.id),s=n&&n.find((t=>t.id===i));if(s)s&&this.updateTile(s,e);else{let n=()=>this._loadTile(o.id,r);this._tileManager.find(i)?this._tileManager.update(i,e):(r.tileset.nodePages&&(n=()=>r.tileset.nodePagesTile.formTileFromNodePages(o.id)),this._tileManager.add(n,i,(e=>this._onTileLoad(e,t,i)),e))}}return!1}async _loadTile(t,e){const{loader:i}=e,n=e.getTileUrl("".concat(e.url,"/nodes/").concat(t)),r={...e.loadOptions,i3s:{...e.loadOptions.i3s,isTileHeader:!0}};return await bct(n,i,r)}_onTileLoad(t,e,i){const n=new QTt(e.tileset,t,e,i);e.children.push(n);const r=this._tileManager.find(n.id).frameState;this.updateTile(n,r),this._frameNumber===r.frameNumber&&(this.traversalFinished(r)||(new Date).getTime()-this.lastUpdate>this.updateDebounceTime)&&this.executeTraversal(n,r)}}const rIt={description:"",ellipsoid:tTt.WGS84,modelMatrix:new Xmt,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,maximumTilesSelected:0,debounceTime:0,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{},onTraversalComplete:t=>t,contentLoader:void 0,viewDistanceScale:1,maximumScreenSpaceError:8,loadTiles:!0,updateTransforms:!0,viewportTraversersMap:null,loadOptions:{fetch:{}},attributions:[],basePath:"",i3s:{}},oIt="Tiles In Tileset(s)",sIt="Tiles In Memory",aIt="Tiles In View",lIt="Tiles To Render",cIt="Tiles Loaded",uIt="Tiles Loading",hIt="Tiles Unloaded",pIt="Failed Tile Loads",dIt="Points/Vertices",fIt="Tile Memory Use";class mIt{constructor(t,e){cat(this,"options",void 0),cat(this,"loadOptions",void 0),cat(this,"type",void 0),cat(this,"tileset",void 0),cat(this,"loader",void 0),cat(this,"url",void 0),cat(this,"basePath",void 0),cat(this,"modelMatrix",void 0),cat(this,"ellipsoid",void 0),cat(this,"lodMetricType",void 0),cat(this,"lodMetricValue",void 0),cat(this,"refine",void 0),cat(this,"root",null),cat(this,"roots",{}),cat(this,"asset",{}),cat(this,"description",""),cat(this,"properties",void 0),cat(this,"extras",null),cat(this,"attributions",{}),cat(this,"credits",{}),cat(this,"stats",void 0),cat(this,"contentFormats",{draco:!1,meshopt:!1,dds:!1,ktx2:!1}),cat(this,"cartographicCenter",null),cat(this,"cartesianCenter",null),cat(this,"zoom",1),cat(this,"boundingVolume",null),cat(this,"dynamicScreenSpaceErrorComputedDensity",0),cat(this,"maximumMemoryUsage",32),cat(this,"gpuMemoryUsageInBytes",0),cat(this,"_frameNumber",0),cat(this,"_queryParams",{}),cat(this,"_extensionsUsed",[]),cat(this,"_tiles",{}),cat(this,"_pendingCount",0),cat(this,"selectedTiles",[]),cat(this,"traverseCounter",0),cat(this,"geometricError",0),cat(this,"lastUpdatedVieports",null),cat(this,"_requestedTiles",[]),cat(this,"_emptyTiles",[]),cat(this,"frameStateData",{}),cat(this,"_traverser",void 0),cat(this,"_cache",new sTt),cat(this,"_requestScheduler",void 0),cat(this,"updatePromise",null),cat(this,"tilesetInitializationPromise",void 0),this.options={...rIt,...e},this.tileset=t,this.loader=t.loader,this.type=t.type,this.url=t.url,this.basePath=t.basePath||nlt(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=t.lodMetricType,this.lodMetricValue=t.lodMetricValue,this.refine=t.root.refine,this.loadOptions=this.options.loadOptions||{},this._traverser=this._initializeTraverser(),this._requestScheduler=new Kat({throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests}),this.stats=new nTt({id:this.url}),this._initializeStats(),this.tilesetInitializationPromise=this._initializeTileSet(t)}destroy(){this._destroy()}isLoaded(){return 0===this._pendingCount&&0!==this._frameNumber&&0===this._requestedTiles.length}get tiles(){return Object.values(this._tiles)}get frameNumber(){return this._frameNumber}get queryParams(){return new URLSearchParams(this._queryParams).toString()}setProps(t){this.options={...this.options,...t}}setOptions(t){this.options={...this.options,...t}}getTileUrl(t){return t.startsWith("data:")?t:"".concat(t).concat(t.includes("?")?"&":"?").concat(this.queryParams)}hasExtension(t){return Boolean(this._extensionsUsed.indexOf(t)>-1)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.tilesetInitializationPromise.then((()=>{!t&&this.lastUpdatedVieports?t=this.lastUpdatedVieports:this.lastUpdatedVieports=t,t&&this.doUpdate(t)}))}async selectTiles(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return await this.tilesetInitializationPromise,t&&(this.lastUpdatedVieports=t),this.updatePromise||(this.updatePromise=new Promise((t=>{setTimeout((()=>{this.lastUpdatedVieports&&this.doUpdate(this.lastUpdatedVieports),t(this._frameNumber),this.updatePromise=null}),this.options.debounceTime)}))),this.updatePromise}doUpdate(t){if("loadTiles"in this.options&&!this.options.loadTiles)return;if(this.traverseCounter>0)return;const e=t instanceof Array?t:[t];this._cache.reset(),this._frameNumber++,this.traverseCounter=e.length;const i=[];for(const t of e){const e=t.id;this._needTraverse(e)?i.push(e):this.traverseCounter--}for(const t of e){const e=t.id;if(this.roots[e]||(this.roots[e]=this._initializeTileHeaders(this.tileset,null)),!i.includes(e))continue;const n=uTt(t,this._frameNumber);this._traverser.traverse(this.roots[e],n,this.options)}}_needTraverse(t){let e=t;return this.options.viewportTraversersMap&&(e=this.options.viewportTraversersMap[t]),e===t}_onTraversalEnd(t){const e=t.viewport.id;this.frameStateData[e]||(this.frameStateData[e]={selectedTiles:[],_requestedTiles:[],_emptyTiles:[]});const i=this.frameStateData[e],n=Object.values(this._traverser.selectedTiles),[r,o]=function(t,e,i){if(0===i||t.length<=i)return[t,[]];const n=[],{longitude:r,latitude:o}=e.viewport;for(const[e,i]of t.entries()){const[t,s]=i.header.mbs,a=Math.abs(r-t),l=Math.abs(o-s),c=Math.sqrt(l*l+a*a);n.push([e,c])}const s=n.sort(((t,e)=>t[1]-e[1])),a=[];for(let e=0;e<i;e++)a.push(t[s[e][0]]);const l=[];for(let e=i;e<s.length;e++)l.push(t[s[e][0]]);return[a,l]}(n,t,this.options.maximumTilesSelected);i.selectedTiles=r;for(const t of o)t.unselect();i._requestedTiles=Object.values(this._traverser.requestedTiles),i._emptyTiles=Object.values(this._traverser.emptyTiles),this.traverseCounter--,this.traverseCounter>0||this._updateTiles()}_updateTiles(){this.selectedTiles=[],this._requestedTiles=[],this._emptyTiles=[];for(const t in this.frameStateData){const e=this.frameStateData[t];this.selectedTiles=this.selectedTiles.concat(e.selectedTiles),this._requestedTiles=this._requestedTiles.concat(e._requestedTiles),this._emptyTiles=this._emptyTiles.concat(e._emptyTiles)}this.selectedTiles=this.options.onTraversalComplete(this.selectedTiles);for(const t of this.selectedTiles)this._tiles[t.id]=t;this._loadTiles(),this._unloadTiles(),this._updateStats()}_tilesChanged(t,e){if(t.length!==e.length)return!0;const i=new Set(t.map((t=>t.id))),n=new Set(e.map((t=>t.id)));let r=t.filter((t=>!n.has(t.id))).length>0;return r=r||e.filter((t=>!i.has(t.id))).length>0,r}_loadTiles(){for(const t of this._requestedTiles)t.contentUnloaded&&this._loadTile(t)}_unloadTiles(){this._cache.unloadTiles(this,((t,e)=>t._unloadTile(e)))}_updateStats(){let t=0,e=0;for(const i of this.selectedTiles)i.contentAvailable&&i.content&&(t++,i.content.pointCount?e+=i.content.pointCount:e+=i.content.vertexCount);this.stats.get(aIt).count=this.selectedTiles.length,this.stats.get(lIt).count=t,this.stats.get(dIt).count=e}async _initializeTileSet(t){this.type===ETt.I3S&&(this.calculateViewPropsI3S(),t.root=await t.root),this.root=this._initializeTileHeaders(t,null),this.type===ETt.TILES3D&&(this._initializeTiles3DTileset(t),this.calculateViewPropsTiles3D()),this.type===ETt.I3S&&this._initializeI3STileset()}calculateViewPropsI3S(){var t;const e=this.tileset.fullExtent;if(e){const{xmin:t,xmax:i,ymin:n,ymax:r,zmin:o,zmax:s}=e;return this.cartographicCenter=new bmt(t+(i-t)/2,n+(r-n)/2,o+(s-o)/2),this.cartesianCenter=tTt.WGS84.cartographicToCartesian(this.cartographicCenter,new bmt),void(this.zoom=gTt(e,this.cartographicCenter,this.cartesianCenter))}const i=null===(t=this.tileset.store)||void 0===t?void 0:t.extent;if(i){const[t,e,n,r]=i;return this.cartographicCenter=new bmt(t+(n-t)/2,e+(r-e)/2,0),this.cartesianCenter=tTt.WGS84.cartographicToCartesian(this.cartographicCenter,new bmt),void(this.zoom=function(t,e,i){const[n,r,o,s]=t;return gTt({xmin:n,xmax:o,ymin:r,ymax:s,zmin:0,zmax:0},e,i)}(i,this.cartographicCenter,this.cartesianCenter))}console.warn("Extent is not defined in the tileset header"),this.cartographicCenter=new bmt,this.zoom=1}calculateViewPropsTiles3D(){const t=this.root,{center:e}=t.boundingVolume;if(!e)return console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new bmt,void(this.zoom=1);0!==e[0]||0!==e[1]||0!==e[2]?this.cartographicCenter=tTt.WGS84.cartesianToCartographic(e,new bmt):this.cartographicCenter=new bmt(0,0,-tTt.WGS84.radii[0]),this.cartesianCenter=e,this.zoom=mTt(t.boundingVolume,this.cartographicCenter)}_initializeStats(){this.stats.get(oIt),this.stats.get(uIt),this.stats.get(sIt),this.stats.get(aIt),this.stats.get(lIt),this.stats.get(cIt),this.stats.get(hIt),this.stats.get(pIt),this.stats.get(dIt),this.stats.get(fIt,"memory")}_initializeTileHeaders(t,e){const i=new QTt(this,t.root,e);if(e&&(e.children.push(i),i.depth=e.depth+1),this.type===ETt.TILES3D){const t=[];for(t.push(i);t.length>0;){const e=t.pop();this.stats.get(oIt).incrementCount();const i=e.header.children||[];for(const r of i){var n;const i=new QTt(this,r,e);if(null!==(n=i.contentUrl)&&void 0!==n&&n.includes("?session=")){const t=new URL(i.contentUrl).searchParams.get("session");t&&(this._queryParams.session=t)}e.children.push(i),i.depth=e.depth+1,t.push(i)}}}return i}_initializeTraverser(){let t;switch(this.type){case ETt.TILES3D:t=JTt;break;case ETt.I3S:t=nIt;break;default:t=ZTt}return new t({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}_destroyTileHeaders(t){this._destroySubtree(t)}async _loadTile(t){let e;try{this._onStartTileLoading(),e=await t.loadContent()}catch(e){this._onTileLoadError(t,e instanceof Error?e:new Error("load failed"))}finally{this._onEndTileLoading(),this._onTileLoad(t,e)}}_onTileLoadError(t,e){this.stats.get(pIt).incrementCount();const i=e.message||e.toString(),n=t.url;console.error("A 3D tile failed to load: ".concat(t.url," ").concat(i)),this.options.onTileError(t,i,n)}_onTileLoad(t,e){if(e){if(this.type===ETt.I3S){var i,n;const t=(null===(i=this.tileset)||void 0===i||null===(n=i.nodePagesTile)||void 0===n?void 0:n.nodesInNodePages)||0;this.stats.get(oIt).reset(),this.stats.get(oIt).addCount(t)}t&&t.content&&function(t,e){uat(t),uat(e);const{rtcCenter:i,gltfUpAxis:n}=e,{computedTransform:r,boundingVolume:{center:o}}=t;let s=new Xmt(r);switch(i&&s.translate(i),n){case"Z":break;case"Y":const t=(new Xmt).rotateX(Math.PI/2);s=s.multiplyRight(t);break;case"X":const e=(new Xmt).rotateY(-Math.PI/2);s=s.multiplyRight(e)}e.isQuantized&&s.translate(e.quantizedVolumeOffset).scale(e.quantizedVolumeScale);const a=new bmt(o);e.cartesianModelMatrix=s,e.cartesianOrigin=a;const l=tTt.WGS84.cartesianToCartographic(a,new bmt),c=tTt.WGS84.eastNorthUpToFixedFrame(a).invert();e.cartographicModelMatrix=c.multiplyRight(s),e.cartographicOrigin=l,e.coordinateSystem||(e.modelMatrix=e.cartographicModelMatrix)}(t,t.content),this.updateContentTypes(t),this._addTileToCache(t),this.options.onTileLoad(t)}}updateContentTypes(t){if(this.type===ETt.I3S)switch(t.header.isDracoGeometry&&(this.contentFormats.draco=!0),t.header.textureFormat){case"dds":this.contentFormats.dds=!0;break;case"ktx2":this.contentFormats.ktx2=!0}else if(this.type===ETt.TILES3D){var e;const{extensionsRemoved:i=[]}=(null===(e=t.content)||void 0===e?void 0:e.gltf)||{};i.includes("KHR_draco_mesh_compression")&&(this.contentFormats.draco=!0),i.includes("EXT_meshopt_compression")&&(this.contentFormats.meshopt=!0),i.includes("KHR_texture_basisu")&&(this.contentFormats.ktx2=!0)}}_onStartTileLoading(){this._pendingCount++,this.stats.get(uIt).incrementCount()}_onEndTileLoading(){this._pendingCount--,this.stats.get(uIt).decrementCount()}_addTileToCache(t){this._cache.add(this,t,(e=>e._updateCacheStats(t)))}_updateCacheStats(t){this.stats.get(cIt).incrementCount(),this.stats.get(sIt).incrementCount(),this.gpuMemoryUsageInBytes+=t.gpuMemoryUsageInBytes||0,this.stats.get(fIt).count=this.gpuMemoryUsageInBytes}_unloadTile(t){this.gpuMemoryUsageInBytes-=t.gpuMemoryUsageInBytes||0,this.stats.get(sIt).decrementCount(),this.stats.get(hIt).incrementCount(),this.stats.get(fIt).count=this.gpuMemoryUsageInBytes,this.options.onTileUnload(t),t.unloadContent()}_destroy(){const t=[];for(this.root&&t.push(this.root);t.length>0;){const e=t.pop();for(const i of e.children)t.push(i);this._destroyTile(e)}this.root=null}_destroySubtree(t){const e=t,i=[];for(i.push(e);i.length>0;){t=i.pop();for(const e of t.children)i.push(e);t!==e&&this._destroyTile(t)}e.children=[]}_destroyTile(t){this._cache.unloadTile(this,t),this._unloadTile(t),t.destroy()}_initializeTiles3DTileset(t){if(t.queryString){const e=new URLSearchParams(t.queryString),i=Object.fromEntries(e.entries());this._queryParams={...this._queryParams,...i}}if(this.asset=t.asset,!this.asset)throw new Error("Tileset must have an asset property.");if("0.0"!==this.asset.version&&"1.0"!==this.asset.version)throw new Error("The tileset must be 3D Tiles version 0.0 or 1.0.");"tilesetVersion"in this.asset&&(this._queryParams.v=this.asset.tilesetVersion),this.credits={attributions:this.options.attributions||[]},this.description=this.options.description||"",this.properties=t.properties,this.geometricError=t.geometricError,this._extensionsUsed=t.extensionsUsed||[],this.extras=t.extras}_initializeI3STileset(){this.loadOptions.i3s&&"token"in this.loadOptions.i3s&&(this._queryParams.token=this.loadOptions.i3s.token)}}const gIt="3.4.14",yIt={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"};function vIt(t,e,i){uat(t instanceof ArrayBuffer);const n=new TextDecoder("utf8"),r=new Uint8Array(t,e,i);return n.decode(r)}const _It={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},xIt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,..._It},bIt={[_It.DOUBLE]:Float64Array,[_It.FLOAT]:Float32Array,[_It.UNSIGNED_SHORT]:Uint16Array,[_It.UNSIGNED_INT]:Uint32Array,[_It.UNSIGNED_BYTE]:Uint8Array,[_It.BYTE]:Int8Array,[_It.SHORT]:Int16Array,[_It.INT]:Int32Array},wIt={DOUBLE:_It.DOUBLE,FLOAT:_It.FLOAT,UNSIGNED_SHORT:_It.UNSIGNED_SHORT,UNSIGNED_INT:_It.UNSIGNED_INT,UNSIGNED_BYTE:_It.UNSIGNED_BYTE,BYTE:_It.BYTE,SHORT:_It.SHORT,INT:_It.INT},AIt="Failed to convert GL type";class EIt{static fromTypedArray(t){t=ArrayBuffer.isView(t)?t.constructor:t;for(const e in bIt){if(bIt[e]===t)return e}throw new Error(AIt)}static fromName(t){const e=wIt[t];if(!e)throw new Error(AIt);return e}static getArrayType(t){switch(t){case _It.UNSIGNED_SHORT_5_6_5:case _It.UNSIGNED_SHORT_4_4_4_4:case _It.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:const e=bIt[t];if(!e)throw new Error(AIt);return e}}static getByteSize(t){return EIt.getArrayType(t).BYTES_PER_ELEMENT}static validate(t){return Boolean(EIt.getArrayType(t))}static createTypedArray(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;void 0===n&&(n=(e.byteLength-i)/EIt.getByteSize(t));return new(EIt.getArrayType(t))(e,i,n)}}function SIt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];const i=t>>11&31,n=t>>5&63,r=31&t;return e[0]=i<<3,e[1]=n<<2,e[2]=r<<3,e}function MIt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:255;return Hft(t,0,e)/e*2-1}function TIt(t){return t<0?-1:1}function IIt(t,e,i,n){if(function(t,e){if(!t)throw new Error("math.gl assertion failed. ".concat(e))}(n),t<0||t>i||e<0||e>i)throw new Error("x and y must be unsigned normalized integers between 0 and ".concat(i));if(n.x=MIt(t,i),n.y=MIt(e,i),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){const t=n.x;n.x=(1-Math.abs(n.y))*TIt(t),n.y=(1-Math.abs(t))*TIt(n.y)}return n.normalize()}new amt,new bmt,new amt,new amt;class CIt{constructor(t,e){cat(this,"json",void 0),cat(this,"buffer",void 0),cat(this,"featuresLength",0),cat(this,"_cachedTypedArrays",{}),this.json=t,this.buffer=e}getExtension(t){return this.json.extensions&&this.json.extensions[t]}hasProperty(t){return Boolean(this.json[t])}getGlobalProperty(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xIt.UNSIGNED_INT,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const n=this.json[t];return n&&Number.isFinite(n.byteOffset)?this._getTypedArrayFromBinary(t,e,i,1,n.byteOffset):n}getPropertyArray(t,e,i){const n=this.json[t];return n&&Number.isFinite(n.byteOffset)?("componentType"in n&&(e=EIt.fromName(n.componentType)),this._getTypedArrayFromBinary(t,e,i,this.featuresLength,n.byteOffset)):this._getTypedArrayFromArray(t,e,n)}getProperty(t,e,i,n,r){const o=this.json[t];if(!o)return o;const s=this.getPropertyArray(t,e,i);if(1===i)return s[n];for(let t=0;t<i;++t)r[t]=s[i*n+t];return r}_getTypedArrayFromBinary(t,e,i,n,r){const o=this._cachedTypedArrays;let s=o[t];return s||(s=EIt.createTypedArray(e,this.buffer.buffer,this.buffer.byteOffset+r,n*i),o[t]=s),s}_getTypedArrayFromArray(t,e,i){const n=this._cachedTypedArrays;let r=n[t];return r||(r=EIt.createTypedArray(e,i),n[t]=r),r}}const PIt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},LIt={SCALAR:(t,e)=>t[e],VEC2:(t,e)=>[t[2*e+0],t[2*e+1]],VEC3:(t,e)=>[t[3*e+0],t[3*e+1],t[3*e+2]],VEC4:(t,e)=>[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]],MAT2:(t,e)=>[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]],MAT3:(t,e)=>[t[9*e+0],t[9*e+1],t[9*e+2],t[9*e+3],t[9*e+4],t[9*e+5],t[9*e+6],t[9*e+7],t[9*e+8]],MAT4:(t,e)=>[t[16*e+0],t[16*e+1],t[16*e+2],t[16*e+3],t[16*e+4],t[16*e+5],t[16*e+6],t[16*e+7],t[16*e+8],t[16*e+9],t[16*e+10],t[16*e+11],t[16*e+12],t[16*e+13],t[16*e+14],t[16*e+15]]},DIt={SCALAR:(t,e,i)=>{e[i]=t},VEC2:(t,e,i)=>{e[2*i+0]=t[0],e[2*i+1]=t[1]},VEC3:(t,e,i)=>{e[3*i+0]=t[0],e[3*i+1]=t[1],e[3*i+2]=t[2]},VEC4:(t,e,i)=>{e[4*i+0]=t[0],e[4*i+1]=t[1],e[4*i+2]=t[2],e[4*i+3]=t[3]},MAT2:(t,e,i)=>{e[4*i+0]=t[0],e[4*i+1]=t[1],e[4*i+2]=t[2],e[4*i+3]=t[3]},MAT3:(t,e,i)=>{e[9*i+0]=t[0],e[9*i+1]=t[1],e[9*i+2]=t[2],e[9*i+3]=t[3],e[9*i+4]=t[4],e[9*i+5]=t[5],e[9*i+6]=t[6],e[9*i+7]=t[7],e[9*i+8]=t[8],e[9*i+9]=t[9]},MAT4:(t,e,i)=>{e[16*i+0]=t[0],e[16*i+1]=t[1],e[16*i+2]=t[2],e[16*i+3]=t[3],e[16*i+4]=t[4],e[16*i+5]=t[5],e[16*i+6]=t[6],e[16*i+7]=t[7],e[16*i+8]=t[8],e[16*i+9]=t[9],e[16*i+10]=t[10],e[16*i+11]=t[11],e[16*i+12]=t[12],e[16*i+13]=t[13],e[16*i+14]=t[14],e[16*i+15]=t[15]}};const RIt=t=>void 0!==t;function OIt(t,e,i){if(!e)return null;let n=t.getExtension("3DTILES_batch_table_hierarchy");const r=e.HIERARCHY;return r&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),e.extensions=e.extensions||{},e.extensions["3DTILES_batch_table_hierarchy"]=r,n=r),n?function(t,e){let i,n,r;const o=t.instancesLength,s=t.classes;let a,l=t.classIds,c=t.parentCounts,u=t.parentIds,h=o;RIt(l.byteOffset)&&(l.componentType=defaultValue(l.componentType,GL.UNSIGNED_SHORT),l.type=AttributeType.SCALAR,r=getBinaryAccessor(l),l=r.createArrayBufferView(e.buffer,e.byteOffset+l.byteOffset,o));if(RIt(c))for(RIt(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,r=getBinaryAccessor(c),c=r.createArrayBufferView(e.buffer,e.byteOffset+c.byteOffset,o)),a=new Uint16Array(o),h=0,i=0;i<o;++i)a[i]=h,h+=c[i];RIt(u)&&RIt(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,GL.UNSIGNED_SHORT),u.type=AttributeType.SCALAR,r=getBinaryAccessor(u),u=r.createArrayBufferView(e.buffer,e.byteOffset+u.byteOffset,h));const p=s.length;for(i=0;i<p;++i){const t=s[i].length,n=s[i].instances,r=getBinaryProperties(t,n,e);s[i].instances=combine(r,n)}const d=new Array(p).fill(0),f=new Uint16Array(o);for(i=0;i<o;++i)n=l[i],f[i]=d[n],++d[n];const m={classes:s,classIds:l,classIndexes:f,parentCounts:c,parentIndexes:a,parentIds:u};return function(t){const e=t.classIds,i=e.length;for(let e=0;e<i;++e)NIt(t,e,stack)}(m),m}(n,i):null}function kIt(t,e,i){if(!t)return;const n=t.parentCounts;return t.parentIds?i(t,e):n>0?function(t,e,i){const n=t.classIds,r=t.parentCounts,o=t.parentIds,s=t.parentIndexes,a=n.length,l=scratchVisited;l.length=Math.max(l.length,a);const c=++marker,u=scratchStack;u.length=0,u.push(e);for(;u.length>0;){if(l[e=u.pop()]===c)continue;l[e]=c;const n=i(t,e);if(RIt(n))return n;const a=r[e],h=s[e];for(let t=0;t<a;++t){const i=o[h+t];i!==e&&u.push(i)}}return null}(t,e,i):function(t,e,i){let n=!0;for(;n;){const r=i(t,e);if(RIt(r))return r;const o=t.parentIds[e];n=o!==e,e=o}throw new Error("traverseHierarchySingleParent")}(t,e,i)}function NIt(t,e,i){const n=t.parentCounts,r=t.parentIds,o=t.parentIndexes,s=t.classIds.length;if(!RIt(r))return;assert(e<s,"Parent index ".concat(e," exceeds the total number of instances: ").concat(s)),assert(-1===i.indexOf(e),"Circular dependency detected in the batch table hierarchy."),i.push(e);const a=RIt(n)?n[e]:1,l=RIt(n)?o[e]:e;for(let n=0;n<a;++n){const o=r[l+n];o!==e&&NIt(t,o,i)}i.pop(e)}function BIt(t){return null!=t}const zIt=(t,e)=>t,FIt={HIERARCHY:!0,extensions:!0,extras:!0};class VIt{constructor(t,e,i){var n;let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};cat(this,"json",void 0),cat(this,"binary",void 0),cat(this,"featureCount",void 0),cat(this,"_extensions",void 0),cat(this,"_properties",void 0),cat(this,"_binaryProperties",void 0),cat(this,"_hierarchy",void 0),uat(i>=0),this.json=t||{},this.binary=e,this.featureCount=i,this._extensions=(null===(n=this.json)||void 0===n?void 0:n.extensions)||{},this._properties={};for(const t in this.json)FIt[t]||(this._properties[t]=this.json[t]);this._binaryProperties=this._initializeBinaryProperties(),r["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=OIt(this,this.json,this.binary))}getExtension(t){return this.json&&this.json.extensions&&this.json.extensions[t]}memorySizeInBytes(){return 0}isClass(t,e){if(this._checkBatchId(t),uat("string"==typeof e,e),this._hierarchy){return BIt(kIt(this._hierarchy,t,((t,i)=>{const n=t.classIds[i];return t.classes[n].name===e})))}return!1}isExactClass(t,e){return uat("string"==typeof e,e),this.getExactClassName(t)===e}getExactClassName(t){if(this._checkBatchId(t),this._hierarchy){const e=this._hierarchy.classIds[t];return this._hierarchy.classes[e].name}}hasProperty(t,e){return this._checkBatchId(t),uat("string"==typeof e,e),BIt(this._properties[e])||this._hasPropertyInHierarchy(t,e)}getPropertyNames(t,e){this._checkBatchId(t),(e=BIt(e)?e:[]).length=0;const i=Object.keys(this._properties);return e.push(...i),this._hierarchy&&this._getPropertyNamesInHierarchy(t,e),e}getProperty(t,e){if(this._checkBatchId(t),uat("string"==typeof e,e),this._binaryProperties){const i=this._binaryProperties[e];if(BIt(i))return this._getBinaryProperty(i,t)}const i=this._properties[e];if(BIt(i))return zIt(i[t]);if(this._hierarchy){const i=this._getHierarchyProperty(t,e);if(BIt(i))return i}}setProperty(t,e,i){const n=this.featureCount;if(this._checkBatchId(t),uat("string"==typeof e,e),this._binaryProperties){const n=this._binaryProperties[e];if(n)return void this._setBinaryProperty(n,t,i)}if(this._hierarchy&&this._setHierarchyProperty(this,t,e,i))return;let r=this._properties[e];BIt(r)||(this._properties[e]=new Array(n),r=this._properties[e]),r[t]=zIt(i)}_checkBatchId(t){if(!(t>=0&&t<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(t,e){return t.unpack(t.typedArray,e)}_setBinaryProperty(t,e,i){t.pack(i,t.typedArray,e)}_initializeBinaryProperties(){let t=null;for(const e in this._properties){const i=this._properties[e],n=this._initializeBinaryProperty(e,i);n&&(t=t||{},t[e]=n)}return t}_initializeBinaryProperty(t,e){if("byteOffset"in e){const i=e;uat(this.binary,"Property ".concat(t," requires a batch table binary.")),uat(i.type,"Property ".concat(t," requires a type."));const n=function(t,e,i,n){const{componentType:r}=t;uat(t.componentType);const o="string"==typeof r?EIt.fromName(r):r,s=PIt[t.type],a=LIt[t.type],l=DIt[t.type];return i+=t.byteOffset,{values:EIt.createTypedArray(o,e,i,s*n),type:o,size:s,unpacker:a,packer:l}}(i,this.binary.buffer,0|this.binary.byteOffset,this.featureCount);return{typedArray:n.values,componentCount:n.size,unpack:n.unpacker,pack:n.packer}}return null}_hasPropertyInHierarchy(t,e){if(!this._hierarchy)return!1;const i=kIt(this._hierarchy,t,((t,i)=>{const n=t.classIds[i];return BIt(t.classes[n].instances[e])}));return BIt(i)}_getPropertyNamesInHierarchy(t,e){kIt(this._hierarchy,t,((t,i)=>{const n=t.classIds[i],r=t.classes[n].instances;for(const t in r)r.hasOwnProperty(t)&&-1===e.indexOf(t)&&e.push(t)}))}_getHierarchyProperty(t,e){return kIt(this._hierarchy,t,((t,i)=>{const n=t.classIds[i],r=t.classes[n],o=t.classIndexes[i],s=r.instances[e];return BIt(s)?BIt(s.typedArray)?this._getBinaryProperty(s,o):zIt(s[o]):null}))}_setHierarchyProperty(t,e,i,n){const r=kIt(this._hierarchy,e,((t,r)=>{const o=t.classIds[r],s=t.classes[o],a=t.classIndexes[r],l=s.instances[i];return!!BIt(l)&&(uat(r===e,'Inherited property "'.concat(i,'" is read-only.')),BIt(l.typedArray)?this._setBinaryProperty(l,a,n):l[a]=zIt(n),!0)}));return BIt(r)}}const UIt=4;function GIt(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=new DataView(e);if(t.magic=n.getUint32(i,!0),i+=UIt,t.version=n.getUint32(i,!0),i+=UIt,t.byteLength=n.getUint32(i,!0),i+=UIt,1!==t.version)throw new Error("3D Tile Version ".concat(t.version," not supported"));return i}const jIt=4,HIt="b3dm tile in legacy format.";function WIt(t,e,i){const n=new DataView(e);let r;t.header=t.header||{};let o=n.getUint32(i,!0);i+=jIt;let s=n.getUint32(i,!0);i+=jIt;let a=n.getUint32(i,!0);i+=jIt;let l=n.getUint32(i,!0);return i+=jIt,a>=570425344?(i-=2*jIt,r=o,a=s,l=0,o=0,s=0,console.warn(HIt)):l>=570425344&&(i-=jIt,r=a,a=o,l=s,o=0,s=0,console.warn(HIt)),t.header.featureTableJsonByteLength=o,t.header.featureTableBinaryByteLength=s,t.header.batchTableJsonByteLength=a,t.header.batchTableBinaryByteLength=l,t.header.batchLength=r,i}function qIt(t,e,i,n){return i=function(t,e,i,n){const{featureTableJsonByteLength:r,featureTableBinaryByteLength:o,batchLength:s}=t.header;if(t.featureTableJson={BATCH_LENGTH:s||0},r>0){const n=vIt(e,i,r);t.featureTableJson=JSON.parse(n)}return i+=r,t.featureTableBinary=new Uint8Array(e,i,o),i+=o,i}(t,e,i),i=function(t,e,i,n){const{batchTableJsonByteLength:r,batchTableBinaryByteLength:o}=t.header;if(r>0){const n=vIt(e,i,r);t.batchTableJson=JSON.parse(n),i+=r,o>0&&(t.batchTableBinary=new Uint8Array(e,i,o),t.batchTableBinary=new Uint8Array(t.batchTableBinary),i+=o)}return i}(t,e,i),i}function XIt(t,e,i){if(!(e||t&&t.batchIds&&i))return null;const{batchIds:n,isRGB565:r,pointCount:o}=t;if(n&&i){const t=new Uint8ClampedArray(3*o);for(let e=0;e<o;e++){const r=n[e],o=i.getProperty(r,"dimensions").map((t=>255*t));t[3*e]=o[0],t[3*e+1]=o[1],t[3*e+2]=o[2]}return{type:xIt.UNSIGNED_BYTE,value:t,size:3,normalized:!0}}if(r){const t=new Uint8ClampedArray(3*o);for(let i=0;i<o;i++){const n=SIt(e[i]);t[3*i]=n[0],t[3*i+1]=n[1],t[3*i+2]=n[2]}return{type:xIt.UNSIGNED_BYTE,value:t,size:3,normalized:!0}}return e&&e.length===3*o?{type:xIt.UNSIGNED_BYTE,value:e,size:3,normalized:!0}:{type:xIt.UNSIGNED_BYTE,value:e,size:4,normalized:!0}}const ZIt=new bmt;function YIt(t,e,i){return t.isQuantized?i["3d-tiles"]&&i["3d-tiles"].decodeQuantizedPositions?(t.isQuantized=!1,function(t,e){const i=new bmt,n=new Float32Array(3*t.pointCount);for(let r=0;r<t.pointCount;r++)i.set(e[3*r],e[3*r+1],e[3*r+2]).scale(1/t.quantizedRange).multiply(t.quantizedVolumeScale).add(t.quantizedVolumeOffset).toArray(n,3*r);return n}(t,e)):{type:xIt.UNSIGNED_SHORT,value:e,size:3,normalized:!0}:e}async function QIt(t,e,i,n,r){i=qIt(t,e,i=WIt(t,e,i=GIt(t,e,i))),function(t){t.attributes={positions:null,colors:null,normals:null,batchIds:null},t.isQuantized=!1,t.isTranslucent=!1,t.isRGB565=!1,t.isOctEncoded16P=!1}(t);const{featureTable:o,batchTable:s}=function(t){const e=new CIt(t.featureTableJson,t.featureTableBinary),i=e.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(i))throw new Error("POINTS_LENGTH must be defined");e.featuresLength=i,t.featuresLength=i,t.pointsLength=i,t.pointCount=i,t.rtcCenter=e.getGlobalProperty("RTC_CENTER",xIt.FLOAT,3);const n=function(t,e){let i=null;if(!t.batchIds&&e.hasProperty("BATCH_ID")&&(t.batchIds=e.getPropertyArray("BATCH_ID",xIt.UNSIGNED_SHORT,1),t.batchIds)){const n=e.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");const{batchTableJson:r,batchTableBinary:o}=t;i=new VIt(r,o,n)}return i}(t,e);return{featureTable:e,batchTable:n}}(t);return await async function(t,e,i,n,r){let o,s,a;const l=t.batchTableJson&&t.batchTableJson.extensions&&t.batchTableJson.extensions["3DTILES_draco_point_compression"];l&&(a=l.properties);const c=e.getExtension("3DTILES_draco_point_compression");if(c){s=c.properties;const e=c.byteOffset,i=c.byteLength;if(!s||!Number.isFinite(e)||!i)throw new Error("Draco properties, byteOffset, and byteLength must be defined");o=t.featureTableBinary.slice(e,e+i),t.hasPositions=Number.isFinite(s.POSITION),t.hasColors=Number.isFinite(s.RGB)||Number.isFinite(s.RGBA),t.hasNormals=Number.isFinite(s.NORMAL),t.hasBatchIds=Number.isFinite(s.BATCH_ID),t.isTranslucent=Number.isFinite(s.RGBA)}if(!o)return!0;const u={buffer:o,properties:{...s,...a},featureTableProperties:s,batchTableProperties:a,dequantizeInShader:!1};return await async function(t,e,i,n){const{parse:r}=n,o={...i,draco:{...i.draco,extraAttributes:e.batchTableProperties||{}}};delete o["3d-tiles"];const s=await r(e.buffer,vSt,o),a=s.attributes.POSITION&&s.attributes.POSITION.value,l=s.attributes.COLOR_0&&s.attributes.COLOR_0.value,c=s.attributes.NORMAL&&s.attributes.NORMAL.value,u=s.attributes.BATCH_ID&&s.attributes.BATCH_ID.value,h=a&&s.attributes.POSITION.value.quantization,p=c&&s.attributes.NORMAL.value.quantization;if(h){const e=s.POSITION.data.quantization,i=e.range;t.quantizedVolumeScale=new bmt(i,i,i),t.quantizedVolumeOffset=new bmt(e.minValues),t.quantizedRange=(1<<e.quantizationBits)-1,t.isQuantizedDraco=!0}p&&(t.octEncodedRange=(1<<s.NORMAL.data.quantization.quantizationBits)-1,t.isOctEncodedDraco=!0);const d={};if(e.batchTableProperties)for(const t of Object.keys(e.batchTableProperties))s.attributes[t]&&s.attributes[t].value&&(d[t.toLowerCase()]=s.attributes[t].value);t.attributes={positions:a,colors:XIt(t,l,void 0),normals:c,batchIds:u,...d}}(t,u,n,r)}(t,o,0,n,r),function(t,e,i){if(!t.attributes.positions)if(e.hasProperty("POSITION"))t.attributes.positions=e.getPropertyArray("POSITION",xIt.FLOAT,3);else if(e.hasProperty("POSITION_QUANTIZED")){const n=e.getPropertyArray("POSITION_QUANTIZED",xIt.UNSIGNED_SHORT,3);if(t.isQuantized=!0,t.quantizedRange=65535,t.quantizedVolumeScale=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",xIt.FLOAT,3),!t.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(t.quantizedVolumeOffset=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",xIt.FLOAT,3),!t.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");t.attributes.positions=YIt(t,n,i)}if(!t.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}(t,o,n),function(t,e,i){if(!t.attributes.colors){let n=null;e.hasProperty("RGBA")?(n=e.getPropertyArray("RGBA",xIt.UNSIGNED_BYTE,4),t.isTranslucent=!0):e.hasProperty("RGB")?n=e.getPropertyArray("RGB",xIt.UNSIGNED_BYTE,3):e.hasProperty("RGB565")&&(n=e.getPropertyArray("RGB565",xIt.UNSIGNED_SHORT,1),t.isRGB565=!0),t.attributes.colors=XIt(t,n,i)}e.hasProperty("CONSTANT_RGBA")&&(t.constantRGBA=e.getGlobalProperty("CONSTANT_RGBA",xIt.UNSIGNED_BYTE,4))}(t,o,s),function(t,e){if(!t.attributes.normals){let i=null;e.hasProperty("NORMAL")?i=e.getPropertyArray("NORMAL",xIt.FLOAT,3):e.hasProperty("NORMAL_OCT16P")&&(i=e.getPropertyArray("NORMAL_OCT16P",xIt.UNSIGNED_BYTE,2),t.isOctEncoded16P=!0),t.attributes.normals=function(t,e){if(!e)return null;if(t.isOctEncoded16P){const i=new Float32Array(3*t.pointsLength);for(let n=0;n<t.pointsLength;n++)IIt(e[2*n],e[2*n+1],255,ZIt),ZIt.toArray(i,3*n);return{type:xIt.FLOAT,size:2,value:i}}return{type:xIt.FLOAT,size:2,value:e}}(t,i)}}(t,o),i}const JIt={URI:0,EMBEDDED:1};function KIt(t,e,i,n){t.rotateYtoZ=!0;const r=t.byteOffset+t.byteLength-i;if(0===r)throw new Error("glTF byte length must be greater than 0.");return t.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",t.gltfArrayBuffer=Hat(e,i,r),t.gltfByteOffset=0,t.gltfByteLength=r,i%4==0||console.warn("".concat(t.type,": embedded glb is not aligned to a 4-byte boundary.")),t.byteOffset+t.byteLength}async function $It(t,e,i,n){const r=i["3d-tiles"]||{};if(function(t,e,i){switch(e){case JIt.URI:const e=new Uint8Array(t.gltfArrayBuffer,t.gltfByteOffset),i=(new TextDecoder).decode(e);t.gltfUrl=i.replace(/[\s\0]+$/,""),delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength;break;case JIt.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}(t,e),r.loadGLTF){const{parse:e,fetch:r}=n;t.gltfUrl&&(t.gltfArrayBuffer=await r(t.gltfUrl,i),t.gltfByteOffset=0),t.gltfArrayBuffer&&(t.gltf=await e(t.gltfArrayBuffer,IMt,i,n),t.gpuMemoryUsageInBytes=BEt(t.gltf),delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength)}}async function tCt(t,e,i,n,r){var o;i=function(t,e,i,n,r){i=GIt(t,e,i),i=WIt(t,e,i),i=qIt(t,e,i),i=KIt(t,e,i,n);const o=new CIt(t.featureTableJson,t.featureTableBinary);return t.rtcCenter=o.getGlobalProperty("RTC_CENTER",xIt.FLOAT,3),i}(t,e,i,n),await $It(t,JIt.EMBEDDED,n,r);const s=null==t||null===(o=t.gltf)||void 0===o?void 0:o.extensions;return s&&s.CESIUM_RTC&&(t.rtcCenter=s.CESIUM_RTC.center),i}async function eCt(t,e,i,n,r){return i=function(t,e,i,n,r){if(i=GIt(t,e,i),1!==t.version)throw new Error("Instanced 3D Model version ".concat(t.version," is not supported"));i=WIt(t,e,i);const o=new DataView(e);if(t.gltfFormat=o.getUint32(i,!0),i+=4,i=qIt(t,e,i),i=KIt(t,e,i,n),0===t.featureTableJsonByteLength)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");const s=new CIt(t.featureTableJson,t.featureTableBinary),a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!Number.isFinite(a))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");t.eastNorthUp=s.getGlobalProperty("EAST_NORTH_UP"),t.rtcCenter=s.getGlobalProperty("RTC_CENTER",xIt.FLOAT,3);new VIt(t.batchTableJson,t.batchTableBinary,a);return function(t,e,i,n){const r={instances:new Array(n),batchTable:t._batchTable,cull:!1,url:void 0,gltf:void 0,basePath:void 0,incrementallyLoadTextures:!1,forwardAxis:[1,0,0]},o=r.instances,s=new bmt;new bmt,new bmt,new bmt;const a=new Imt,l=new fgt,c=new bmt,u={},h=new Xmt,p=[],d=[],f=new bmt,m=new bmt;for(let i=0;i<n;i++){let n;if(e.hasProperty("POSITION"))n=e.getProperty("POSITION",xIt.FLOAT,3,i,s);else if(e.hasProperty("POSITION_QUANTIZED")){n=e.getProperty("POSITION_QUANTIZED",xIt.UNSIGNED_SHORT,3,i,s);const t=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",xIt.FLOAT,3,f);if(!t)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");const r=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",xIt.FLOAT,3,m);if(!r)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");const o=65535;for(let e=0;e<3;e++)n[e]=n[e]/o*r[e]+t[e]}if(!n)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");if(s.copy(n),u.translation=s,t.normalUp=e.getProperty("NORMAL_UP",xIt.FLOAT,3,i,p),t.normalRight=e.getProperty("NORMAL_RIGHT",xIt.FLOAT,3,i,d),t.normalUp){if(!t.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");t.hasCustomOrientation=!0}else{if(t.octNormalUp=e.getProperty("NORMAL_UP_OCT32P",xIt.UNSIGNED_SHORT,2,p),t.octNormalRight=e.getProperty("NORMAL_RIGHT_OCT32P",xIt.UNSIGNED_SHORT,2,d),t.octNormalUp){if(!t.octNormalRight)throw new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");throw new Error("i3dm: oct-encoded orientation not implemented")}t.eastNorthUp?(tTt.WGS84.eastNorthUpToFixedFrame(s,h),h.getRotationMatrix3(a)):a.identity()}l.fromMatrix3(a),u.rotation=l,c.set(1,1,1);const r=e.getProperty("SCALE",xIt.FLOAT,1,i);Number.isFinite(r)&&c.multiplyByScalar(r);const g=e.getProperty("SCALE_NON_UNIFORM",xIt.FLOAT,3,i,p);g&&c.scale(g),u.scale=c;let y=e.getProperty("BATCH_ID",xIt.UNSIGNED_SHORT,1,i);void 0===y&&(y=i);const v=(new Xmt).fromQuaternion(u.rotation);h.identity(),h.translate(u.translation),h.multiplyRight(v),h.scale(u.scale);const _=h.clone();o[i]={modelMatrix:_,batchId:y}}t.instances=o}(t,s,0,a),i}(t,e,i,n),await $It(t,t.gltfFormat,n,r),i}async function iCt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};switch(r.byteOffset=e,r.type=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const i=new DataView(t);return"".concat(String.fromCharCode(i.getUint8(e+0))).concat(String.fromCharCode(i.getUint8(e+1))).concat(String.fromCharCode(i.getUint8(e+2))).concat(String.fromCharCode(i.getUint8(e+3)))}(t,e),r.type){case yIt.COMPOSITE:return await async function(t,e,i,n,r,o){i=GIt(t,e,i);const s=new DataView(e);for(t.tilesLength=s.getUint32(i,!0),i+=4,t.tiles=[];t.tiles.length<t.tilesLength&&t.byteLength-i>12;){const s={};t.tiles.push(s),i=await o(e,i,n,r,s)}return i}(r,t,e,i,n,iCt);case yIt.BATCHED_3D_MODEL:return await tCt(r,t,e,i,n);case yIt.GLTF:return await async function(t,e,i,n){t.rotateYtoZ=!0,t.gltfUpAxis=i["3d-tiles"]&&i["3d-tiles"].assetGltfUpAxis?i["3d-tiles"].assetGltfUpAxis:"Y";const{parse:r}=n;t.gltf=await r(e,IMt,i,n),t.gpuMemoryUsageInBytes=BEt(t.gltf)}(r,t,i,n);case yIt.INSTANCED_3D_MODEL:return await eCt(r,t,e,i,n);case yIt.POINT_CLOUD:return await QIt(r,t,e,i,n);default:throw new Error("3DTileLoader: unknown type ".concat(r.type))}}async function nCt(t,e,i,n){const r=t[e].bufferView,o=t.bufferViews[r],s=t.buffers[o.buffer];if(null==n||!n.url||!n.fetch)throw new Error("Url is not provided");if(!n.fetch)throw new Error("fetch is not provided");if(s.uri){const t=function(t,e){if(e.startsWith("http")){const i=new URL(t,e);return decodeURI(i.toString())}const i="http://".concat(e),n=new URL(t,i);return"/".concat(n.host).concat(n.pathname)}(s.uri,null==n?void 0:n.url),e=await n.fetch(t),i=await e.arrayBuffer();return new Uint8Array(i,o.byteOffset,o.byteLength)}return new Uint8Array(i,o.byteOffset,o.byteLength)}function rCt(t){const e=new DataView(t);return e.getUint32(0,!0)+2**32*e.getUint32(4,!0)}const oCt={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:gIt,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:async function(t,e,i){if(1952609651!==new Uint32Array(t.slice(0,4))[0])throw new Error("Wrong subtree file magic number");if(1!==new Uint32Array(t.slice(4,8))[0])throw new Error("Wrong subtree file verson, must be 1");const n=rCt(t.slice(8,16)),r=new Uint8Array(t,24,n),o=new TextDecoder("utf8").decode(r),s=JSON.parse(o),a=rCt(t.slice(16,24));let l=new ArrayBuffer(0);return a&&(l=t.slice(24+n)),"bufferView"in s.tileAvailability&&(s.tileAvailability.explicitBitstream=await nCt(s,"tileAvailability",l,i)),"bufferView"in s.contentAvailability&&(s.contentAvailability.explicitBitstream=await nCt(s,"contentAvailability",l,i)),"bufferView"in s.childSubtreeAvailability&&(s.childSubtreeAvailability.explicitBitstream=await nCt(s,"childSubtreeAvailability",l,i)),s},options:{}};
|
||
/**
|
||
* @license
|
||
* Copyright 2009 The Closure Library Authors
|
||
* Copyright 2020 Daniel Wirtz / The long.js Authors.
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*
|
||
* SPDX-License-Identifier: Apache-2.0
|
||
*/var sCt=null;try{sCt=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(zO){}function aCt(t,e,i){this.low=0|t,this.high=0|e,this.unsigned=!!i}function lCt(t){return!0===(t&&t.__isLong__)}function cCt(t){var e=Math.clz32(t&-t);return t?31-e:e}aCt.prototype.__isLong__,Object.defineProperty(aCt.prototype,"__isLong__",{value:!0}),aCt.isLong=lCt;var uCt={},hCt={};function pCt(t,e){var i,n,r;return e?(r=0<=(t>>>=0)&&t<256)&&(n=hCt[t])?n:(i=fCt(t,0,!0),r&&(hCt[t]=i),i):(r=-128<=(t|=0)&&t<128)&&(n=uCt[t])?n:(i=fCt(t,t<0?-1:0,!1),r&&(uCt[t]=i),i)}function dCt(t,e){if(isNaN(t))return e?ACt:wCt;if(e){if(t<0)return ACt;if(t>=_Ct)return ICt}else{if(t<=-xCt)return CCt;if(t+1>=xCt)return TCt}return t<0?dCt(-t,e).neg():fCt(t%vCt|0,t/vCt|0,e)}function fCt(t,e,i){return new aCt(t,e,i)}aCt.fromInt=pCt,aCt.fromNumber=dCt,aCt.fromBits=fCt;var mCt=Math.pow;function gCt(t,e,i){if(0===t.length)throw Error("empty string");if("number"==typeof e?(i=e,e=!1):e=!!e,"NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return e?ACt:wCt;if((i=i||10)<2||36<i)throw RangeError("radix");var n;if((n=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return gCt(t.substring(1),e,i).neg();for(var r=dCt(mCt(i,8)),o=wCt,s=0;s<t.length;s+=8){var a=Math.min(8,t.length-s),l=parseInt(t.substring(s,s+a),i);if(a<8){var c=dCt(mCt(i,a));o=o.mul(c).add(dCt(l))}else o=(o=o.mul(r)).add(dCt(l))}return o.unsigned=e,o}function yCt(t,e){return"number"==typeof t?dCt(t,e):"string"==typeof t?gCt(t,e):fCt(t.low,t.high,"boolean"==typeof e?e:t.unsigned)}aCt.fromString=gCt,aCt.fromValue=yCt;var vCt=4294967296,_Ct=vCt*vCt,xCt=_Ct/2,bCt=pCt(1<<24),wCt=pCt(0);aCt.ZERO=wCt;var ACt=pCt(0,!0);aCt.UZERO=ACt;var ECt=pCt(1);aCt.ONE=ECt;var SCt=pCt(1,!0);aCt.UONE=SCt;var MCt=pCt(-1);aCt.NEG_ONE=MCt;var TCt=fCt(-1,2147483647,!1);aCt.MAX_VALUE=TCt;var ICt=fCt(-1,-1,!0);aCt.MAX_UNSIGNED_VALUE=ICt;var CCt=fCt(0,-2147483648,!1);aCt.MIN_VALUE=CCt;var PCt=aCt.prototype;PCt.toInt=function(){return this.unsigned?this.low>>>0:this.low},PCt.toNumber=function(){return this.unsigned?(this.high>>>0)*vCt+(this.low>>>0):this.high*vCt+(this.low>>>0)},PCt.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(CCt)){var e=dCt(t),i=this.div(e),n=i.mul(e).sub(this);return i.toString(t)+n.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var r=dCt(mCt(t,6),this.unsigned),o=this,s="";;){var a=o.div(r),l=(o.sub(a.mul(r)).toInt()>>>0).toString(t);if((o=a).isZero())return l+s;for(;l.length<6;)l="0"+l;s=""+l+s}},PCt.getHighBits=function(){return this.high},PCt.getHighBitsUnsigned=function(){return this.high>>>0},PCt.getLowBits=function(){return this.low},PCt.getLowBitsUnsigned=function(){return this.low>>>0},PCt.getNumBitsAbs=function(){if(this.isNegative())return this.eq(CCt)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&0==(t&1<<e);e--);return 0!=this.high?e+33:e+1},PCt.isZero=function(){return 0===this.high&&0===this.low},PCt.eqz=PCt.isZero,PCt.isNegative=function(){return!this.unsigned&&this.high<0},PCt.isPositive=function(){return this.unsigned||this.high>=0},PCt.isOdd=function(){return 1==(1&this.low)},PCt.isEven=function(){return 0==(1&this.low)},PCt.equals=function(t){return lCt(t)||(t=yCt(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&(this.high===t.high&&this.low===t.low)},PCt.eq=PCt.equals,PCt.notEquals=function(t){return!this.eq(t)},PCt.neq=PCt.notEquals,PCt.ne=PCt.notEquals,PCt.lessThan=function(t){return this.comp(t)<0},PCt.lt=PCt.lessThan,PCt.lessThanOrEqual=function(t){return this.comp(t)<=0},PCt.lte=PCt.lessThanOrEqual,PCt.le=PCt.lessThanOrEqual,PCt.greaterThan=function(t){return this.comp(t)>0},PCt.gt=PCt.greaterThan,PCt.greaterThanOrEqual=function(t){return this.comp(t)>=0},PCt.gte=PCt.greaterThanOrEqual,PCt.ge=PCt.greaterThanOrEqual,PCt.compare=function(t){if(lCt(t)||(t=yCt(t)),this.eq(t))return 0;var e=this.isNegative(),i=t.isNegative();return e&&!i?-1:!e&&i?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},PCt.comp=PCt.compare,PCt.negate=function(){return!this.unsigned&&this.eq(CCt)?CCt:this.not().add(ECt)},PCt.neg=PCt.negate,PCt.add=function(t){lCt(t)||(t=yCt(t));var e=this.high>>>16,i=65535&this.high,n=this.low>>>16,r=65535&this.low,o=t.high>>>16,s=65535&t.high,a=t.low>>>16,l=0,c=0,u=0,h=0;return u+=(h+=r+(65535&t.low))>>>16,c+=(u+=n+a)>>>16,l+=(c+=i+s)>>>16,l+=e+o,fCt((u&=65535)<<16|(h&=65535),(l&=65535)<<16|(c&=65535),this.unsigned)},PCt.subtract=function(t){return lCt(t)||(t=yCt(t)),this.add(t.neg())},PCt.sub=PCt.subtract,PCt.multiply=function(t){if(this.isZero())return this;if(lCt(t)||(t=yCt(t)),sCt)return fCt(sCt.mul(this.low,this.high,t.low,t.high),sCt.get_high(),this.unsigned);if(t.isZero())return this.unsigned?ACt:wCt;if(this.eq(CCt))return t.isOdd()?CCt:wCt;if(t.eq(CCt))return this.isOdd()?CCt:wCt;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(bCt)&&t.lt(bCt))return dCt(this.toNumber()*t.toNumber(),this.unsigned);var e=this.high>>>16,i=65535&this.high,n=this.low>>>16,r=65535&this.low,o=t.high>>>16,s=65535&t.high,a=t.low>>>16,l=65535&t.low,c=0,u=0,h=0,p=0;return h+=(p+=r*l)>>>16,u+=(h+=n*l)>>>16,h&=65535,u+=(h+=r*a)>>>16,c+=(u+=i*l)>>>16,u&=65535,c+=(u+=n*a)>>>16,u&=65535,c+=(u+=r*s)>>>16,c+=e*l+i*a+n*s+r*o,fCt((h&=65535)<<16|(p&=65535),(c&=65535)<<16|(u&=65535),this.unsigned)},PCt.mul=PCt.multiply,PCt.divide=function(t){if(lCt(t)||(t=yCt(t)),t.isZero())throw Error("division by zero");var e,i,n;if(sCt)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?fCt((this.unsigned?sCt.div_u:sCt.div_s)(this.low,this.high,t.low,t.high),sCt.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?ACt:wCt;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return ACt;if(t.gt(this.shru(1)))return SCt;n=ACt}else{if(this.eq(CCt))return t.eq(ECt)||t.eq(MCt)?CCt:t.eq(CCt)?ECt:(e=this.shr(1).div(t).shl(1)).eq(wCt)?t.isNegative()?ECt:MCt:(i=this.sub(t.mul(e)),n=e.add(i.div(t)));if(t.eq(CCt))return this.unsigned?ACt:wCt;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();n=wCt}for(i=this;i.gte(t);){e=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var r=Math.ceil(Math.log(e)/Math.LN2),o=r<=48?1:mCt(2,r-48),s=dCt(e),a=s.mul(t);a.isNegative()||a.gt(i);)a=(s=dCt(e-=o,this.unsigned)).mul(t);s.isZero()&&(s=ECt),n=n.add(s),i=i.sub(a)}return n},PCt.div=PCt.divide,PCt.modulo=function(t){return lCt(t)||(t=yCt(t)),sCt?fCt((this.unsigned?sCt.rem_u:sCt.rem_s)(this.low,this.high,t.low,t.high),sCt.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},PCt.mod=PCt.modulo,PCt.rem=PCt.modulo,PCt.not=function(){return fCt(~this.low,~this.high,this.unsigned)},PCt.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},PCt.clz=PCt.countLeadingZeros,PCt.countTrailingZeros=function(){return this.low?cCt(this.low):cCt(this.high)+32},PCt.ctz=PCt.countTrailingZeros,PCt.and=function(t){return lCt(t)||(t=yCt(t)),fCt(this.low&t.low,this.high&t.high,this.unsigned)},PCt.or=function(t){return lCt(t)||(t=yCt(t)),fCt(this.low|t.low,this.high|t.high,this.unsigned)},PCt.xor=function(t){return lCt(t)||(t=yCt(t)),fCt(this.low^t.low,this.high^t.high,this.unsigned)},PCt.shiftLeft=function(t){return lCt(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?fCt(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):fCt(0,this.low<<t-32,this.unsigned)},PCt.shl=PCt.shiftLeft,PCt.shiftRight=function(t){return lCt(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?fCt(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):fCt(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},PCt.shr=PCt.shiftRight,PCt.shiftRightUnsigned=function(t){return lCt(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?fCt(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):fCt(32===t?this.high:this.high>>>t-32,0,this.unsigned)},PCt.shru=PCt.shiftRightUnsigned,PCt.shr_u=PCt.shiftRightUnsigned,PCt.rotateLeft=function(t){var e;return lCt(t)&&(t=t.toInt()),0==(t&=63)?this:32===t?fCt(this.high,this.low,this.unsigned):t<32?(e=32-t,fCt(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned)):(e=32-(t-=32),fCt(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned))},PCt.rotl=PCt.rotateLeft,PCt.rotateRight=function(t){var e;return lCt(t)&&(t=t.toInt()),0==(t&=63)?this:32===t?fCt(this.high,this.low,this.unsigned):t<32?(e=32-t,fCt(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned)):(e=32-(t-=32),fCt(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned))},PCt.rotr=PCt.rotateRight,PCt.toSigned=function(){return this.unsigned?fCt(this.low,this.high,!1):this},PCt.toUnsigned=function(){return this.unsigned?this:fCt(this.low,this.high,!0)},PCt.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},PCt.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},PCt.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},aCt.fromBytes=function(t,e,i){return i?aCt.fromBytesLE(t,e):aCt.fromBytesBE(t,e)},aCt.fromBytesLE=function(t,e){return new aCt(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},aCt.fromBytesBE=function(t,e){return new aCt(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)};const LCt=16;function DCt(t){"X"===t&&(t="");const e=t.padEnd(LCt,"0");return aCt.fromString(e,!0,16)}const RCt=3,OCt=61,kCt=180/Math.PI;function NCt(t,e,i){const n=1<<e;return[(t[0]+i[0])/n,(t[1]+i[1])/n]}function BCt(t){return t>=.5?1/3*(4*t*t-1):1/3*(1-4*(1-t)*(1-t))}function zCt(t){return[BCt(t[0]),BCt(t[1])]}function FCt(t,e){let[i,n]=e;switch(t){case 0:return[1,i,n];case 1:return[-i,1,n];case 2:return[-i,-n,1];case 3:return[-1,-n,-i];case 4:return[n,-1,-i];case 5:return[n,i,-1];default:throw new Error("Invalid face")}}function VCt(t){let[e,i,n]=t;const r=Math.atan2(n,Math.sqrt(e*e+i*i));return[Math.atan2(i,e)*kCt,r*kCt]}function UCt(t,e,i,n){if(0===n){1===i&&(e[0]=t-1-e[0],e[1]=t-1-e[1]);const n=e[0];e[0]=e[1],e[1]=n}}const GCt=100;function jCt(t){const{face:e,ij:i,level:n}=t,r=[[0,0],[0,1],[1,1],[1,0],[0,0]],o=Math.max(1,Math.ceil(GCt*Math.pow(2,-n))),s=new Float64Array(4*o*2+2);let a=0,l=0;for(let t=0;t<4;t++){const c=r[t].slice(0),u=r[t+1],h=(u[0]-c[0])/o,p=(u[1]-c[1])/o;for(let t=0;t<o;t++){c[0]+=h,c[1]+=p;const t=VCt(FCt(e,zCt(NCt(i,n,c))));Math.abs(t[1])>89.999&&(t[0]=l);const r=t[0]-l;t[0]+=r>180?-360:r<-180?360:0,s[a++]=t[0],s[a++]=t[1],l=t[0]}}return s[a++]=s[0],s[a++]=s[1],s}function HCt(t){const e=function(t){if(t.indexOf("/")>0)return t;const e=DCt(t);return function(t){if(t.isZero())return"";let e=t.toString(2);for(;e.length<RCt+OCt;)e="0"+e;const i=e.lastIndexOf("1"),n=e.substring(0,3),r=e.substring(3,i),o=r.length/2,s=aCt.fromString(n,!0,2).toString(10);let a="";if(0!==o)for(a=aCt.fromString(r,!0,2).toString(4);a.length<o;)a="0"+a;return"".concat(s,"/").concat(a)}(e)}(t),i=function(t){if(0===t.length)throw new Error("Invalid Hilbert quad key ".concat(t));const e=t.split("/"),i=parseInt(e[0],10),n=e[1],r=n.length;let o=0;const s=[0,0];for(let t=r-1;t>=0;t--){o=r-t;const e=n[t];let i=0,a=0;"1"===e?a=1:"2"===e?(i=1,a=1):"3"===e&&(i=1);const l=Math.pow(2,o-1);UCt(l,s,i,a),s[0]+=l*i,s[1]+=l*a}if(i%2==1){const t=s[0];s[0]=s[1],s[1]=t}return{face:i,ij:s,level:o}}(e);return i}function WCt(t){return function(t){const e=zCt(NCt(t.ij,t.level,[.5,.5]));return VCt(FCt(t.face,e))}(HCt(t))}function qCt(t){if(t.length%2!=0)throw new Error("Invalid corners");const e=[],i=[];for(let n=0;n<t.length;n+=2)e.push(t[n]),i.push(t[n+1]);return e.sort(((t,e)=>t-e)),i.sort(((t,e)=>t-e)),{west:e[0],east:e[e.length-1],north:i[i.length-1],south:i[0]}}function XCt(t,e){const i=(null==e?void 0:e.minimumHeight)||0,n=(null==e?void 0:e.maximumHeight)||0,r=function(t){let e;if(2===t.face||5===t.face){let i=null,n=0;for(let e=0;e<4;e++){const r=jCt(HCt("".concat(t.face,"/").concat(e)));null==i&&(i=new Float64Array(4*r.length)),i.set(r,n),n+=r.length}e=qCt(i)}else e=qCt(jCt(t));return e}(HCt(t)),o=r.west,s=r.south,a=r.east,l=r.north,c=[];return c.push(new bmt(o,l,i)),c.push(new bmt(a,l,i)),c.push(new bmt(a,s,i)),c.push(new bmt(o,s,i)),c.push(new bmt(o,l,n)),c.push(new bmt(a,l,n)),c.push(new bmt(a,s,n)),c.push(new bmt(o,s,n)),c}function ZCt(t){const e=t.token,i={minimumHeight:t.minimumHeight,maximumHeight:t.maximumHeight},n=XCt(e,i),r=WCt(e),o=r[0],s=r[1],a=tTt.WGS84.cartographicToCartesian([o,s,i.maximumHeight]),l=new bmt(a[0],a[1],a[2]);n.push(l);const c=function(t,e=new Ewt){if(!t||0===t.length)return e.halfAxes=new Imt([0,0,0,0,0,0,0,0,0]),e.center=new bmt,e;const i=t.length,n=new bmt(0,0,0);for(const e of t)n.add(e);const r=1/i;n.multiplyByScalar(r);let o=0,s=0,a=0,l=0,c=0,u=0;for(const e of t){const t=Gwt.copy(e).subtract(n);o+=t.x*t.x,s+=t.x*t.y,a+=t.x*t.z,l+=t.y*t.y,c+=t.y*t.z,u+=t.z*t.z}o*=r,s*=r,a*=r,l*=r,c*=r,u*=r;const h=Xwt;h[0]=o,h[1]=s,h[2]=a,h[3]=s,h[4]=l,h[5]=c,h[6]=a,h[7]=c,h[8]=u;const{unitary:p}=Bwt(h,Zwt),d=e.halfAxes.copy(p);let f=d.getColumn(0,Hwt),m=d.getColumn(1,Wwt),g=d.getColumn(2,qwt),y=-Number.MAX_VALUE,v=-Number.MAX_VALUE,_=-Number.MAX_VALUE,x=Number.MAX_VALUE,b=Number.MAX_VALUE,w=Number.MAX_VALUE;for(const e of t)Gwt.copy(e),y=Math.max(Gwt.dot(f),y),v=Math.max(Gwt.dot(m),v),_=Math.max(Gwt.dot(g),_),x=Math.min(Gwt.dot(f),x),b=Math.min(Gwt.dot(m),b),w=Math.min(Gwt.dot(g),w);f=f.multiplyByScalar(.5*(x+y)),m=m.multiplyByScalar(.5*(b+v)),g=g.multiplyByScalar(.5*(w+_)),e.center.copy(f).add(m).add(g);const A=jwt.set(y-x,v-b,_-w).multiplyByScalar(.5),E=new Imt([A[0],0,0,0,A[1],0,0,0,A[2]]);return e.halfAxes.multiplyRight(E),e}(n);return[...c.center,...c.halfAxes]}const YCt={QUADTREE:4,OCTREE:8};function QCt(t,e,i){if(null!=t&&t.box){const n=function(t,e){const i=function(t){return t.and(t.not().add(1))}(t).shiftRightUnsigned(2);return t.add(aCt.fromNumber(2*e+1-4).multiply(i))}(DCt(t.s2VolumeInfo.token),e),r=function(t){if(t.isZero())return"X";let e=t.countTrailingZeros();e=(e-e%4)/4;const i=e;e*=4;const n=t.shiftRightUnsigned(e).toString(16).replace(/0+$/,"");return Array(17-i-n.length).join("0")+n}(n),o={...t.s2VolumeInfo};if(o.token=r,"OCTREE"===i){const e=t.s2VolumeInfo,i=e.maximumHeight-e.minimumHeight,n=i/2,r=e.minimumHeight+i/2;e.minimumHeight=r-n,e.maximumHeight=r+n}return{box:ZCt(o),s2VolumeInfo:o}}}async function JCt(t){const{options:e,parentData:i={mortonIndex:0,x:0,y:0,z:0},childIndex:n=0,globalData:r={level:0,mortonIndex:0,x:0,y:0,z:0},s2VolumeBox:o}=t;let{subtree:s,level:a=0}=t;const{subdivisionScheme:l,subtreeLevels:c,maximumLevel:u,contentUrlTemplate:h,subtreesUriTemplate:p,basePath:d}=e,f={children:[],lodMetricValue:0,contentUrl:""},m=YCt[l],g=1&n,y=n>>1&1,v=n>>2&1,_=(m**a-1)/(m-1);let x=tPt(i.mortonIndex,n),b=_+x,w=tPt(i.x,g),A=tPt(i.y,y),E=tPt(i.z,v),S=!1;a+1>c&&(S=KCt(s.childSubtreeAvailability,x));const M=tPt(r.x,w),T=tPt(r.y,A),I=tPt(r.z,E),C=a+r.level;if(S){const t=ePt("".concat(d,"/").concat(p),C,M,T,I);s=await bct(t,oCt),r.mortonIndex=x,r.x=w,r.y=A,r.z=E,r.level=a,x=0,b=0,w=0,A=0,E=0,a=0}if(!KCt(s.tileAvailability,b)||a>u)return f;KCt(s.contentAvailability,b)&&(f.contentUrl=ePt(h,C,M,T,I));const P=a+1,L={mortonIndex:x,x:w,y:A,z:E};for(let t=0;t<m;t++){const i=QCt(o,t,l),n=await JCt({subtree:s,options:e,parentData:L,childIndex:t,level:P,globalData:r,s2VolumeBox:i});if(n.contentUrl||n.children.length){const t=$Ct(n,C+1,{childTileX:w,childTileY:A,childTileZ:E},e,o);f.children.push(t)}}return f}function KCt(t,e){return"constant"in t?Boolean(t.constant):!!t.explicitBitstream&&function(t,e){const i=Math.floor(t/8),n=t%8;return 1==(e[i]>>n&1)}(e,t.explicitBitstream)}function $Ct(t,e,i,n,r){const{basePath:o,refine:s,getRefine:a,lodMetricType:l,getTileType:c,rootLodMetricValue:u,rootBoundingVolume:h}=n,p=t.contentUrl&&t.contentUrl.replace("".concat(o,"/"),""),d=u/2**e,f=function(t,e,i){if(e.region){const{childTileX:n,childTileY:r,childTileZ:o}=i,[s,a,l,c,u,h]=e.region,p=2**t,d=(l-s)/p,f=(c-a)/p,m=(h-u)/p,[g,y]=[s+d*n,s+d*(n+1)],[v,_]=[a+f*r,a+f*(r+1)],[x,b]=[u+m*o,u+m*(o+1)];return{region:[g,v,y,_,x,b]}}if(e.box)return e;throw new Error("Unsupported bounding volume type ".concat(e))}(e,null!=r&&r.box?{box:r.box}:h,i);return{children:t.children,contentUrl:t.contentUrl,content:{uri:p},id:t.contentUrl,refine:a(s),type:c(t),lodMetricType:l,lodMetricValue:d,geometricError:d,transform:t.transform,boundingVolume:f}}function tPt(t,e){return parseInt(t.toString(2)+e.toString(2),2)}function ePt(t,e,i,n,r){const o=function(t){const e={};for(const i in t)e["{".concat(i,"}")]=t[i];return e}({level:e,x:i,y:n,z:r});return t.replace(/{level}|{x}|{y}|{z}/gi,(t=>o[t]))}function iPt(t){if(!t.contentUrl)return ATt.EMPTY;const e=t.contentUrl.split("?")[0].split(".").pop();switch(e){case"pnts":return ATt.POINTCLOUD;case"i3dm":case"b3dm":case"glb":case"gltf":return ATt.SCENEGRAPH;default:return e}}function nPt(t){switch(t){case"REPLACE":case"replace":return wTt.REPLACE;case"ADD":case"add":return wTt.ADD;default:return t}}function rPt(t,e){if(/^[a-z][0-9a-z+.-]*:/i.test(e)){const i=new URL(t,"".concat(e,"/"));return decodeURI(i.toString())}return t.startsWith("/")?t:"".concat(e,"/").concat(t)}function oPt(t,e){if(!t)return null;if(t.content){const i=t.content.uri||t.content.url;t.contentUrl=rPt(i,e.basePath)}return t.id=t.contentUrl,t.lodMetricType=STt.GEOMETRIC_ERROR,t.lodMetricValue=t.geometricError,t.transformMatrix=t.transform,t.type=iPt(t),t.refine=nPt(t.refine),t}async function sPt(t,e,i,n){var r,o;const s=e.basePath,{subdivisionScheme:a,maximumLevel:l,subtreeLevels:c,subtrees:{uri:u}}=i,h=rPt(ePt(u,0,0,0,0),s),p=await bct(h,oCt,n),d=rPt(t.content.uri,s),f=null==e||null===(r=e.root)||void 0===r?void 0:r.refine,m=t.geometricError,g=null===(o=t.boundingVolume.extensions)||void 0===o?void 0:o["3DTILES_bounding_volume_S2"];if(g){const e={box:ZCt(g),s2VolumeInfo:g};t.boundingVolume=e}const y=t.boundingVolume,v={contentUrlTemplate:d,subtreesUriTemplate:u,subdivisionScheme:a,subtreeLevels:c,maximumLevel:l,refine:f,basePath:s,lodMetricType:STt.GEOMETRIC_ERROR,rootLodMetricValue:m,rootBoundingVolume:y,getTileType:iPt,getRefine:nPt};return await async function(t,e,i){if(!t)return null;t.lodMetricType=STt.GEOMETRIC_ERROR,t.lodMetricValue=t.geometricError,t.transformMatrix=t.transform;const{children:n,contentUrl:r}=await JCt({subtree:e,options:i,s2VolumeBox:t});r&&(t.contentUrl=r,t.content={uri:r.replace("".concat(i.basePath,"/"),"")});return t.refine=nPt(t.refine),t.type=iPt(t),t.children=n,t.id=t.contentUrl,t}(t,p,v)}function aPt(t){var e;return(null==t||null===(e=t.extensions)||void 0===e?void 0:e["3DTILES_implicit_tiling"])||(null==t?void 0:t.implicitTiling)}const lPt={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:gIt,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:async function(t,e,i){const n=e["3d-tiles"]||{};let r;r="auto"===n.isTileset?i.url&&-1!==i.url.indexOf(".json"):n.isTileset;t=r?await async function(t,e,i){var n;const r=JSON.parse((new TextDecoder).decode(t));return r.loader=e.loader||lPt,r.url=i.url,r.queryString=i.queryString,r.basePath=function(t){return nlt(t.url)}(r),r.root=await async function(t,e){const i=t.basePath;let n;const r=aPt(null==t?void 0:t.root);n=r&&t.root?await sPt(t.root,t,r,e):oPt(t.root,t);const o=[];for(o.push(n);o.length>0;){const n=(o.pop()||{}).children||[];for(let r of n){const n=aPt(r);n?r=await sPt(r,t,n,e):oPt(r,{basePath:i}),o.push(r)}}return n}(r,e),r.type=ETt.TILES3D,r.lodMetricType=STt.GEOMETRIC_ERROR,r.lodMetricValue=(null===(n=r.root)||void 0===n?void 0:n.lodMetricValue)||0,r}(t,e,i):await async function(t,e,i){const n={content:{featureIds:null}},r=0;return await iCt(t,r,e,i,n.content),n.content}(t,e,i);return t},options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};const cPt=[0],uPt={getPointColor:{type:"accessor",value:[0,0,0,255]},pointSize:1,data:"",loader:lPt,onTilesetLoad:{type:"function",value:t=>{}},onTileLoad:{type:"function",value:t=>{}},onTileUnload:{type:"function",value:t=>{}},onTileError:{type:"function",value:(t,e,i)=>{}},_getMeshColor:{type:"function",value:t=>[255,255,255]}};class hPt extends Nbt{constructor(...t){super(...t),cat(this,"state",void 0)}initializeState(){"onTileLoadFail"in this.props&&dut.removed("onTileLoadFail","onTileError")(),this.state={layerMap:{},tileset3d:null,activeViewports:{},lastUpdatedViewports:null}}get isLoaded(){const{tileset3d:t}=this.state;return null!==t&&t.isLoaded()}shouldUpdateState({changeFlags:t}){return t.somethingChanged}updateState({props:t,oldProps:e,changeFlags:i}){if(t.data&&t.data!==e.data&&this._loadTileset(t.data),i.viewportChanged){const{activeViewports:t}=this.state;Object.keys(t).length&&(this._updateTileset(t),this.state.lastUpdatedViewports=t,this.state.activeViewports={})}if(i.propsChanged){const{layerMap:t}=this.state;for(const e in t)t[e].needsUpdate=!0}}activateViewport(t){const{activeViewports:e,lastUpdatedViewports:i}=this.state;this.internalState.viewport=t,e[t.id]=t;const n=null==i?void 0:i[t.id];n&&t.equals(n)||(this.setChangeFlags({viewportChanged:!0}),this.setNeedsUpdate())}getPickingInfo({info:t,sourceLayer:e}){const i=e&&e.props.tile;return t.picked&&(t.object=i),t.sourceTile=i,t}filterSubLayer({layer:t,viewport:e}){const{tile:i}=t.props,{id:n}=e;return i.selected&&i.viewportIds.includes(n)}_updateAutoHighlight(t){const e=t.sourceTile,i=this.state.layerMap[null==e?void 0:e.id];i&&i.layer&&i.layer.updateAutoHighlight(t)}async _loadTileset(t){const{loadOptions:e={}}=this.props;let i=this.props.loader||this.props.loaders;Array.isArray(i)&&(i=i[0]);const n={loadOptions:{...e}};let r=t;if(i.preload){const o=await i.preload(t,e);o.url&&(r=o.url),o.headers&&(n.loadOptions.fetch={...n.loadOptions.fetch,headers:o.headers}),Object.assign(n,o)}const o=await bct(r,i,n.loadOptions),s=new mIt(o,{onTileLoad:this._onTileLoad.bind(this),onTileUnload:this._onTileUnload.bind(this),onTileError:this.props.onTileError,...n});this.setState({tileset3d:s,layerMap:{}}),this._updateTileset(this.state.activeViewports),this.props.onTilesetLoad(s)}_onTileLoad(t){const{lastUpdatedViewports:e}=this.state;this.props.onTileLoad(t),this._updateTileset(e),this.setNeedsUpdate()}_onTileUnload(t){delete this.state.layerMap[t.id],this.props.onTileUnload(t)}_updateTileset(t){if(!t)return;const{tileset3d:e}=this.state,{timeline:i}=this.context,n=Object.keys(t).length;i&&n&&e&&e.selectTiles(Object.values(t)).then((t=>{this.state.frameNumber!==t&&this.setState({frameNumber:t})}))}_getSubLayer(t,e){if(!t.content)return null;switch(t.type){case ATt.POINTCLOUD:return this._makePointCloudLayer(t,e);case ATt.SCENEGRAPH:return this._make3DModelLayer(t);case ATt.MESH:return this._makeSimpleMeshLayer(t,e);default:throw new Error("Tile3DLayer: Failed to render layer of type ".concat(t.content.type))}}_makePointCloudLayer(t,e){const{attributes:i,pointCount:n,constantRGBA:r,cartographicOrigin:o,modelMatrix:s}=t.content,{positions:a,normals:l,colors:c}=i;if(!a)return null;const u=e&&e.props.data||{header:{vertexCount:n},attributes:{POSITION:a,NORMAL:l,COLOR_0:c}},{pointSize:h,getPointColor:p}=this.props;return new(this.getSubLayerClass("pointcloud",Zbt))({pointSize:h},this.getSubLayerProps({id:"pointcloud"}),{id:"".concat(this.id,"-pointcloud-").concat(t.id),tile:t,data:u,coordinateSystem:xut.METER_OFFSETS,coordinateOrigin:o,modelMatrix:s,getColor:r||p,_offset:0})}_make3DModelLayer(t){const{gltf:e,instances:i,cartographicOrigin:n,modelMatrix:r}=t.content;return new(this.getSubLayerClass("scenegraph",DMt))({_lighting:"pbr"},this.getSubLayerProps({id:"scenegraph"}),{id:"".concat(this.id,"-scenegraph-").concat(t.id),tile:t,data:i||cPt,scenegraph:e,coordinateSystem:xut.METER_OFFSETS,coordinateOrigin:n,modelMatrix:r,getTransformMatrix:t=>t.modelMatrix,getPosition:[0,0,0],_offset:0})}_makeSimpleMeshLayer(t,e){const i=t.content,{attributes:n,indices:r,modelMatrix:o,cartographicOrigin:s,coordinateSystem:a=xut.METER_OFFSETS,material:l,featureIds:c}=i,{_getMeshColor:u}=this.props,h=e&&e.props.mesh||new Wgt({drawMode:4,attributes:pPt(n),indices:r});return new(this.getSubLayerClass("mesh",RMt))(this.getSubLayerProps({id:"mesh"}),{id:"".concat(this.id,"-mesh-").concat(t.id),tile:t,mesh:h,data:cPt,getColor:u(t),pbrMaterial:l,modelMatrix:o,coordinateOrigin:s,coordinateSystem:a,featureIds:c,_offset:0})}renderLayers(){const{tileset3d:t,layerMap:e}=this.state;return t?t.tiles.map((t=>{const i=e[t.id]=e[t.id]||{tile:t};let{layer:n}=i;return t.selected&&(n?i.needsUpdate&&(n=this._getSubLayer(t,n),i.needsUpdate=!1):n=this._getSubLayer(t)),i.layer=n,n})).filter(Boolean):null}}function pPt(t){const e={};return e.positions={...t.positions,value:new Float32Array(t.positions.value)},t.normals&&(e.normals=t.normals),t.texCoords&&(e.texCoords=t.texCoords),t.colors&&(e.colors=t.colors),t.uvRegions&&(e.uvRegions=t.uvRegions),e}cat(hPt,"defaultProps",uPt),cat(hPt,"layerName","Tile3DLayer");class dPt{id;_url;_options;layer;constructor(t,e,i){this.id=i||d(0,5),this._url=t,this._options=e||{},this.render()}render(){this.layer=new Hbt({id:this.id,type:hPt,data:this._url,loader:lPt,pickable:!0,onTileError:t=>{this._options.onTileError&&this._options.onTileError(t)},onTilesetLoad:t=>{const e=this._geturlparam(this._url);t._queryParams=e,t.setProps({maximumScreenSpaceError:this._options.maximumScreenSpaceError?this._options.maximumScreenSpaceError:16});const{cartographicCenter:i,zoom:n}=t;this.layer.viewState={center:hNt.value?Math.floor(i):i,zoom:n+3},this._setOffset(t),cNt.value.flyTo(this.layer.viewState)}}),cNt.value.addLayer(this.layer)}_setOffset(t){const e=this._options.offset?this._options.offset[0]:0,i=this._options.offset?this._options.offset[1]:0,n=this._options.offset?this._options.offset[2]:0,r=(new Xmt).makeTranslation(e,i,n);t.modelMatrix=r}_geturlparam(t){const e=t.split("?")[1],i=new URLSearchParams(e),n={};return i.forEach(((t,e)=>{n[e]=t})),n}addEventListener(t,e){switch(t){case"click":this.layer.setProps({pickable:!0,onClick:(t,i)=>e(t,i)});break;case"mouseIn":case"mouseOut":this.layer.setProps({pickable:!0,onHover:(t,i)=>e(t,i)})}}removeEventListener(t){switch(t){case"click":this.layer.setProps({pickable:!0,onClick:!1});break;case"mouseIn":case"mouseOut":this.layer.setProps({pickable:!0,onHover:!1})}}highlight(){this.layer.setProps({highlightColor:"yellow"})}destroy(){cNt.value.removeLayer(this.id)}show(t){if(!cNt.value.getLayer(this.id))throw new Error(`Layer name "${this.id}" does not exist.`);{const e=t?"visible":"none";cNt.value.setLayoutProperty(this.id,"visibility",e)}}}const fPt={offset:[0,0],anchor:"center"};class mPt{marker;_option;constructor(t,e,i){this._option=Object.assign(fPt,i||{}),this.addMarker(t,e)}addMarker(t,e){this.marker=new Lm.Marker({element:t,offset:this._option.offset,anchor:this._option.anchor}).setLngLat(e).addTo(cNt.value)}destroy(){this.marker&&this.marker.remove(),this.marker=null}}
|
||
/**
|
||
* @license
|
||
* Copyright 2010-2023 Three.js Authors
|
||
* SPDX-License-Identifier: MIT
|
||
*/
|
||
const gPt=1001,yPt=3001,vPt="srgb",_Pt="srgb-linear",xPt="display-p3-linear",bPt="linear",wPt="srgb",APt="rec709",EPt=7680,SPt=2e3,MPt=2001;class TPt{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});const i=this._listeners;void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&i[t].push(e)}hasEventListener(t,e){if(void 0===this._listeners)return!1;const i=this._listeners;return void 0!==i[t]&&-1!==i[t].indexOf(e)}removeEventListener(t,e){if(void 0===this._listeners)return;const i=this._listeners[t];if(void 0!==i){const t=i.indexOf(e);-1!==t&&i.splice(t,1)}}dispatchEvent(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const i=e.slice(0);for(let e=0,n=i.length;e<n;e++)i[e].call(this,t);t.target=null}}}const IPt=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];function CPt(){const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(IPt[255&t]+IPt[t>>8&255]+IPt[t>>16&255]+IPt[t>>24&255]+"-"+IPt[255&e]+IPt[e>>8&255]+"-"+IPt[e>>16&15|64]+IPt[e>>24&255]+"-"+IPt[63&i|128]+IPt[i>>8&255]+"-"+IPt[i>>16&255]+IPt[i>>24&255]+IPt[255&n]+IPt[n>>8&255]+IPt[n>>16&255]+IPt[n>>24&255]).toLowerCase()}function PPt(t,e,i){return Math.max(e,Math.min(i,t))}function LPt(t,e,i){return(1-i)*t+i*e}function DPt(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function RPt(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(4294967295*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(2147483647*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}class OPt{constructor(t=0,e=0){OPt.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,i=this.y,n=t.elements;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(PPt(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const i=Math.cos(e),n=Math.sin(e),r=this.x-t.x,o=this.y-t.y;return this.x=r*i-o*n+t.x,this.y=r*n+o*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class kPt{constructor(t,e,i,n,r,o,s,a,l){kPt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,i,n,r,o,s,a,l)}set(t,e,i,n,r,o,s,a,l){const c=this.elements;return c[0]=t,c[1]=n,c[2]=s,c[3]=e,c[4]=r,c[5]=a,c[6]=i,c[7]=o,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}extractBasis(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,n=e.elements,r=this.elements,o=i[0],s=i[3],a=i[6],l=i[1],c=i[4],u=i[7],h=i[2],p=i[5],d=i[8],f=n[0],m=n[3],g=n[6],y=n[1],v=n[4],_=n[7],x=n[2],b=n[5],w=n[8];return r[0]=o*f+s*y+a*x,r[3]=o*m+s*v+a*b,r[6]=o*g+s*_+a*w,r[1]=l*f+c*y+u*x,r[4]=l*m+c*v+u*b,r[7]=l*g+c*_+u*w,r[2]=h*f+p*y+d*x,r[5]=h*m+p*v+d*b,r[8]=h*g+p*_+d*w,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],o=t[4],s=t[5],a=t[6],l=t[7],c=t[8];return e*o*c-e*s*l-i*r*c+i*s*a+n*r*l-n*o*a}invert(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],o=t[4],s=t[5],a=t[6],l=t[7],c=t[8],u=c*o-s*l,h=s*a-c*r,p=l*r-o*a,d=e*u+i*h+n*p;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);const f=1/d;return t[0]=u*f,t[1]=(n*l-c*i)*f,t[2]=(s*i-n*o)*f,t[3]=h*f,t[4]=(c*e-n*a)*f,t[5]=(n*r-s*e)*f,t[6]=p*f,t[7]=(i*a-l*e)*f,t[8]=(o*e-i*r)*f,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,i,n,r,o,s){const a=Math.cos(r),l=Math.sin(r);return this.set(i*a,i*l,-i*(a*o+l*s)+o+t,-n*l,n*a,-n*(-l*o+a*s)+s+e,0,0,1),this}scale(t,e){return this.premultiply(NPt.makeScale(t,e)),this}rotate(t){return this.premultiply(NPt.makeRotation(-t)),this}translate(t,e){return this.premultiply(NPt.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,i,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,i=t.elements;for(let t=0;t<9;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}clone(){return(new this.constructor).fromArray(this.elements)}}const NPt=new kPt;function BPt(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}const zPt={};function FPt(t){t in zPt||(zPt[t]=!0,console.warn(t))}const VPt=(new kPt).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),UPt=(new kPt).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),GPt={[_Pt]:{transfer:bPt,primaries:APt,toReference:t=>t,fromReference:t=>t},[vPt]:{transfer:wPt,primaries:APt,toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[xPt]:{transfer:bPt,primaries:"p3",toReference:t=>t.applyMatrix3(UPt),fromReference:t=>t.applyMatrix3(VPt)},"display-p3":{transfer:wPt,primaries:"p3",toReference:t=>t.convertSRGBToLinear().applyMatrix3(UPt),fromReference:t=>t.applyMatrix3(VPt).convertLinearToSRGB()}},jPt=new Set([_Pt,xPt]),HPt={enabled:!0,_workingColorSpace:_Pt,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(t){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!t},get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!jPt.has(t))throw new Error(`Unsupported working color space, "${t}".`);this._workingColorSpace=t},convert:function(t,e,i){if(!1===this.enabled||e===i||!e||!i)return t;const n=GPt[e].toReference;return(0,GPt[i].fromReference)(n(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return GPt[t].primaries},getTransfer:function(t){return""===t?bPt:GPt[t].transfer}};function WPt(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function qPt(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}let XPt;class ZPt{static getDataURL(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===XPt&&(XPt=BPt("canvas")),XPt.width=t.width,XPt.height=t.height;const i=XPt.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=XPt}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const e=BPt("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);const n=i.getImageData(0,0,t.width,t.height),r=n.data;for(let t=0;t<r.length;t++)r[t]=255*WPt(r[t]/255);return i.putImageData(n,0,0),e}if(t.data){const e=t.data.slice(0);for(let t=0;t<e.length;t++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[t]=Math.floor(255*WPt(e[t]/255)):e[t]=WPt(e[t]);return{data:e,width:t.width,height:t.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}}let YPt=0;class QPt{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:YPt++}),this.uuid=CPt(),this.data=t,this.version=0}set needsUpdate(t){!0===t&&this.version++}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];const i={uuid:this.uuid,url:""},n=this.data;if(null!==n){let t;if(Array.isArray(n)){t=[];for(let e=0,i=n.length;e<i;e++)n[e].isDataTexture?t.push(JPt(n[e].image)):t.push(JPt(n[e]))}else t=JPt(n);i.url=t}return e||(t.images[this.uuid]=i),i}}function JPt(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?ZPt.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let KPt=0;class $Pt extends TPt{constructor(t=$Pt.DEFAULT_IMAGE,e=$Pt.DEFAULT_MAPPING,i=1001,n=1001,r=1006,o=1008,s=1023,a=1009,l=$Pt.DEFAULT_ANISOTROPY,c=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:KPt++}),this.uuid=CPt(),this.name="",this.source=new QPt(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=i,this.wrapT=n,this.magFilter=r,this.minFilter=o,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=a,this.offset=new OPt(0,0),this.repeat=new OPt(1,1),this.center=new OPt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new kPt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,"string"==typeof c?this.colorSpace=c:(FPt("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=c===yPt?vPt:""),this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const i={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),e||(t.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case 1e3:t.x=t.x-Math.floor(t.x);break;case gPt:t.x=t.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case 1e3:t.y=t.y-Math.floor(t.y);break;case gPt:t.y=t.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return FPt("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===vPt?yPt:3e3}set encoding(t){FPt("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=t===yPt?vPt:""}}$Pt.DEFAULT_IMAGE=null,$Pt.DEFAULT_MAPPING=300,$Pt.DEFAULT_ANISOTROPY=1;class tLt{constructor(t=0,e=0,i=0,n=1){tLt.prototype.isVector4=!0,this.x=t,this.y=e,this.z=i,this.w=n}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,i=this.y,n=this.z,r=this.w,o=t.elements;return this.x=o[0]*e+o[4]*i+o[8]*n+o[12]*r,this.y=o[1]*e+o[5]*i+o[9]*n+o[13]*r,this.z=o[2]*e+o[6]*i+o[10]*n+o[14]*r,this.w=o[3]*e+o[7]*i+o[11]*n+o[15]*r,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,i,n,r;const o=.01,s=.1,a=t.elements,l=a[0],c=a[4],u=a[8],h=a[1],p=a[5],d=a[9],f=a[2],m=a[6],g=a[10];if(Math.abs(c-h)<o&&Math.abs(u-f)<o&&Math.abs(d-m)<o){if(Math.abs(c+h)<s&&Math.abs(u+f)<s&&Math.abs(d+m)<s&&Math.abs(l+p+g-3)<s)return this.set(1,0,0,0),this;e=Math.PI;const t=(l+1)/2,a=(p+1)/2,y=(g+1)/2,v=(c+h)/4,_=(u+f)/4,x=(d+m)/4;return t>a&&t>y?t<o?(i=0,n=.707106781,r=.707106781):(i=Math.sqrt(t),n=v/i,r=_/i):a>y?a<o?(i=.707106781,n=0,r=.707106781):(n=Math.sqrt(a),i=v/n,r=x/n):y<o?(i=.707106781,n=.707106781,r=0):(r=Math.sqrt(y),i=_/r,n=x/r),this.set(i,n,r,e),this}let y=Math.sqrt((m-d)*(m-d)+(u-f)*(u-f)+(h-c)*(h-c));return Math.abs(y)<.001&&(y=1),this.x=(m-d)/y,this.y=(u-f)/y,this.z=(h-c)/y,this.w=Math.acos((l+p+g-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class eLt{constructor(t=0,e=0,i=0,n=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=i,this._w=n}static slerpFlat(t,e,i,n,r,o,s){let a=i[n+0],l=i[n+1],c=i[n+2],u=i[n+3];const h=r[o+0],p=r[o+1],d=r[o+2],f=r[o+3];if(0===s)return t[e+0]=a,t[e+1]=l,t[e+2]=c,void(t[e+3]=u);if(1===s)return t[e+0]=h,t[e+1]=p,t[e+2]=d,void(t[e+3]=f);if(u!==f||a!==h||l!==p||c!==d){let t=1-s;const e=a*h+l*p+c*d+u*f,i=e>=0?1:-1,n=1-e*e;if(n>Number.EPSILON){const r=Math.sqrt(n),o=Math.atan2(r,e*i);t=Math.sin(t*o)/r,s=Math.sin(s*o)/r}const r=s*i;if(a=a*t+h*r,l=l*t+p*r,c=c*t+d*r,u=u*t+f*r,t===1-s){const t=1/Math.sqrt(a*a+l*l+c*c+u*u);a*=t,l*=t,c*=t,u*=t}}t[e]=a,t[e+1]=l,t[e+2]=c,t[e+3]=u}static multiplyQuaternionsFlat(t,e,i,n,r,o){const s=i[n],a=i[n+1],l=i[n+2],c=i[n+3],u=r[o],h=r[o+1],p=r[o+2],d=r[o+3];return t[e]=s*d+c*u+a*p-l*h,t[e+1]=a*d+c*h+l*u-s*p,t[e+2]=l*d+c*p+s*h-a*u,t[e+3]=c*d-s*u-a*h-l*p,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,i,n){return this._x=t,this._y=e,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){const i=t._x,n=t._y,r=t._z,o=t._order,s=Math.cos,a=Math.sin,l=s(i/2),c=s(n/2),u=s(r/2),h=a(i/2),p=a(n/2),d=a(r/2);switch(o){case"XYZ":this._x=h*c*u+l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u-h*p*d;break;case"YXZ":this._x=h*c*u+l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u+h*p*d;break;case"ZXY":this._x=h*c*u-l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u-h*p*d;break;case"ZYX":this._x=h*c*u-l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u+h*p*d;break;case"YZX":this._x=h*c*u+l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u-h*p*d;break;case"XZY":this._x=h*c*u-l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u+h*p*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!1!==e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const i=e/2,n=Math.sin(i);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],n=e[4],r=e[8],o=e[1],s=e[5],a=e[9],l=e[2],c=e[6],u=e[10],h=i+s+u;if(h>0){const t=.5/Math.sqrt(h+1);this._w=.25/t,this._x=(c-a)*t,this._y=(r-l)*t,this._z=(o-n)*t}else if(i>s&&i>u){const t=2*Math.sqrt(1+i-s-u);this._w=(c-a)/t,this._x=.25*t,this._y=(n+o)/t,this._z=(r+l)/t}else if(s>u){const t=2*Math.sqrt(1+s-i-u);this._w=(r-l)/t,this._x=(n+o)/t,this._y=.25*t,this._z=(a+c)/t}else{const t=2*Math.sqrt(1+u-i-s);this._w=(o-n)/t,this._x=(r+l)/t,this._y=(a+c)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return i<Number.EPSILON?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=i),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(PPt(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(0===i)return this;const n=Math.min(1,e/i);return this.slerp(t,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const i=t._x,n=t._y,r=t._z,o=t._w,s=e._x,a=e._y,l=e._z,c=e._w;return this._x=i*c+o*s+n*l-r*a,this._y=n*c+o*a+r*s-i*l,this._z=r*c+o*l+i*a-n*s,this._w=o*c-i*s-n*a-r*l,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const i=this._x,n=this._y,r=this._z,o=this._w;let s=o*t._w+i*t._x+n*t._y+r*t._z;if(s<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,s=-s):this.copy(t),s>=1)return this._w=o,this._x=i,this._y=n,this._z=r,this;const a=1-s*s;if(a<=Number.EPSILON){const t=1-e;return this._w=t*o+e*this._w,this._x=t*i+e*this._x,this._y=t*n+e*this._y,this._z=t*r+e*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(a),c=Math.atan2(l,s),u=Math.sin((1-e)*c)/l,h=Math.sin(e*c)/l;return this._w=o*u+this._w*h,this._x=i*u+this._x*h,this._y=n*u+this._y*h,this._z=r*u+this._z*h,this._onChangeCallback(),this}slerpQuaternions(t,e,i){return this.copy(t).slerp(e,i)}random(){const t=Math.random(),e=Math.sqrt(1-t),i=Math.sqrt(t),n=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(e*Math.cos(n),i*Math.sin(r),i*Math.cos(r),e*Math.sin(n))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class iLt{constructor(t=0,e=0,i=0){iLt.prototype.isVector3=!0,this.x=t,this.y=e,this.z=i}set(t,e,i){return void 0===i&&(i=this.z),this.x=t,this.y=e,this.z=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(rLt.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(rLt.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*n,this.y=r[1]*e+r[4]*i+r[7]*n,this.z=r[2]*e+r[5]*i+r[8]*n,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,n=this.z,r=t.elements,o=1/(r[3]*e+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*n+r[12])*o,this.y=(r[1]*e+r[5]*i+r[9]*n+r[13])*o,this.z=(r[2]*e+r[6]*i+r[10]*n+r[14])*o,this}applyQuaternion(t){const e=this.x,i=this.y,n=this.z,r=t.x,o=t.y,s=t.z,a=t.w,l=2*(o*n-s*i),c=2*(s*e-r*n),u=2*(r*i-o*e);return this.x=e+a*l+o*u-s*c,this.y=i+a*c+s*l-r*u,this.z=n+a*u+r*c-o*l,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*n,this.y=r[1]*e+r[5]*i+r[9]*n,this.z=r[2]*e+r[6]*i+r[10]*n,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const i=t.x,n=t.y,r=t.z,o=e.x,s=e.y,a=e.z;return this.x=n*a-r*s,this.y=r*o-i*a,this.z=i*s-n*o,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return nLt.copy(this).projectOnVector(t),this.sub(nLt)}reflect(t){return this.sub(nLt.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(PPt(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,n=this.z-t.z;return e*e+i*i+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,i){const n=Math.sin(e)*t;return this.x=n*Math.sin(i),this.y=Math.cos(e)*t,this.z=n*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=n,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=2*(Math.random()-.5),e=Math.random()*Math.PI*2,i=Math.sqrt(1-t**2);return this.x=i*Math.cos(e),this.y=i*Math.sin(e),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const nLt=new iLt,rLt=new eLt;class oLt{constructor(t=new iLt(1/0,1/0,1/0),e=new iLt(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e+=3)this.expandByPoint(aLt.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,i=t.count;e<i;e++)this.expandByPoint(aLt.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const i=aLt.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);const i=t.geometry;if(void 0!==i){const n=i.getAttribute("position");if(!0===e&&void 0!==n&&!0!==t.isInstancedMesh)for(let e=0,i=n.count;e<i;e++)!0===t.isMesh?t.getVertexPosition(e,aLt):aLt.fromBufferAttribute(n,e),aLt.applyMatrix4(t.matrixWorld),this.expandByPoint(aLt);else void 0!==t.boundingBox?(null===t.boundingBox&&t.computeBoundingBox(),lLt.copy(t.boundingBox)):(null===i.boundingBox&&i.computeBoundingBox(),lLt.copy(i.boundingBox)),lLt.applyMatrix4(t.matrixWorld),this.union(lLt)}const n=t.children;for(let t=0,i=n.length;t<i;t++)this.expandByObject(n[t],e);return this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsSphere(t){return this.clampPoint(t.center,aLt),aLt.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(mLt),gLt.subVectors(this.max,mLt),cLt.subVectors(t.a,mLt),uLt.subVectors(t.b,mLt),hLt.subVectors(t.c,mLt),pLt.subVectors(uLt,cLt),dLt.subVectors(hLt,uLt),fLt.subVectors(cLt,hLt);let e=[0,-pLt.z,pLt.y,0,-dLt.z,dLt.y,0,-fLt.z,fLt.y,pLt.z,0,-pLt.x,dLt.z,0,-dLt.x,fLt.z,0,-fLt.x,-pLt.y,pLt.x,0,-dLt.y,dLt.x,0,-fLt.y,fLt.x,0];return!!_Lt(e,cLt,uLt,hLt,gLt)&&(e=[1,0,0,0,1,0,0,0,1],!!_Lt(e,cLt,uLt,hLt,gLt)&&(yLt.crossVectors(pLt,dLt),e=[yLt.x,yLt.y,yLt.z],_Lt(e,cLt,uLt,hLt,gLt)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,aLt).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(aLt).length()),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(sLt[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),sLt[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),sLt[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),sLt[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),sLt[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),sLt[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),sLt[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),sLt[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(sLt)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const sLt=[new iLt,new iLt,new iLt,new iLt,new iLt,new iLt,new iLt,new iLt],aLt=new iLt,lLt=new oLt,cLt=new iLt,uLt=new iLt,hLt=new iLt,pLt=new iLt,dLt=new iLt,fLt=new iLt,mLt=new iLt,gLt=new iLt,yLt=new iLt,vLt=new iLt;function _Lt(t,e,i,n,r){for(let o=0,s=t.length-3;o<=s;o+=3){vLt.fromArray(t,o);const s=r.x*Math.abs(vLt.x)+r.y*Math.abs(vLt.y)+r.z*Math.abs(vLt.z),a=e.dot(vLt),l=i.dot(vLt),c=n.dot(vLt);if(Math.max(-Math.max(a,l,c),Math.min(a,l,c))>s)return!1}return!0}const xLt=new oLt,bLt=new iLt,wLt=new iLt;class ALt{constructor(t=new iLt,e=-1){this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const i=this.center;void 0!==e?i.copy(e):xLt.setFromPoints(t).getCenter(i);let n=0;for(let e=0,r=t.length;e<r;e++)n=Math.max(n,i.distanceToSquared(t[e]));return this.radius=Math.sqrt(n),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const i=this.center.distanceToSquared(t);return e.copy(t),i>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;bLt.subVectors(t,this.center);const e=bLt.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),i=.5*(t-this.radius);this.center.addScaledVector(bLt,i/t),this.radius+=i}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(wLt.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(bLt.copy(t.center).add(wLt)),this.expandByPoint(bLt.copy(t.center).sub(wLt))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const ELt=new iLt,SLt=new iLt,MLt=new iLt,TLt=new iLt,ILt=new iLt,CLt=new iLt,PLt=new iLt;class LLt{constructor(t=new iLt,e=new iLt(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,ELt)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=ELt.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(ELt.copy(this.origin).addScaledVector(this.direction,e),ELt.distanceToSquared(t))}distanceSqToSegment(t,e,i,n){SLt.copy(t).add(e).multiplyScalar(.5),MLt.copy(e).sub(t).normalize(),TLt.copy(this.origin).sub(SLt);const r=.5*t.distanceTo(e),o=-this.direction.dot(MLt),s=TLt.dot(this.direction),a=-TLt.dot(MLt),l=TLt.lengthSq(),c=Math.abs(1-o*o);let u,h,p,d;if(c>0)if(u=o*a-s,h=o*s-a,d=r*c,u>=0)if(h>=-d)if(h<=d){const t=1/c;u*=t,h*=t,p=u*(u+o*h+2*s)+h*(o*u+h+2*a)+l}else h=r,u=Math.max(0,-(o*h+s)),p=-u*u+h*(h+2*a)+l;else h=-r,u=Math.max(0,-(o*h+s)),p=-u*u+h*(h+2*a)+l;else h<=-d?(u=Math.max(0,-(-o*r+s)),h=u>0?-r:Math.min(Math.max(-r,-a),r),p=-u*u+h*(h+2*a)+l):h<=d?(u=0,h=Math.min(Math.max(-r,-a),r),p=h*(h+2*a)+l):(u=Math.max(0,-(o*r+s)),h=u>0?r:Math.min(Math.max(-r,-a),r),p=-u*u+h*(h+2*a)+l);else h=o>0?-r:r,u=Math.max(0,-(o*h+s)),p=-u*u+h*(h+2*a)+l;return i&&i.copy(this.origin).addScaledVector(this.direction,u),n&&n.copy(SLt).addScaledVector(MLt,h),p}intersectSphere(t,e){ELt.subVectors(t.center,this.origin);const i=ELt.dot(this.direction),n=ELt.dot(ELt)-i*i,r=t.radius*t.radius;if(n>r)return null;const o=Math.sqrt(r-n),s=i-o,a=i+o;return a<0?null:s<0?this.at(a,e):this.at(s,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){const i=this.distanceToPlane(t);return null===i?null:this.at(i,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;return t.normal.dot(this.direction)*e<0}intersectBox(t,e){let i,n,r,o,s,a;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return l>=0?(i=(t.min.x-h.x)*l,n=(t.max.x-h.x)*l):(i=(t.max.x-h.x)*l,n=(t.min.x-h.x)*l),c>=0?(r=(t.min.y-h.y)*c,o=(t.max.y-h.y)*c):(r=(t.max.y-h.y)*c,o=(t.min.y-h.y)*c),i>o||r>n?null:((r>i||isNaN(i))&&(i=r),(o<n||isNaN(n))&&(n=o),u>=0?(s=(t.min.z-h.z)*u,a=(t.max.z-h.z)*u):(s=(t.max.z-h.z)*u,a=(t.min.z-h.z)*u),i>a||s>n?null:((s>i||i!=i)&&(i=s),(a<n||n!=n)&&(n=a),n<0?null:this.at(i>=0?i:n,e)))}intersectsBox(t){return null!==this.intersectBox(t,ELt)}intersectTriangle(t,e,i,n,r){ILt.subVectors(e,t),CLt.subVectors(i,t),PLt.crossVectors(ILt,CLt);let o,s=this.direction.dot(PLt);if(s>0){if(n)return null;o=1}else{if(!(s<0))return null;o=-1,s=-s}TLt.subVectors(this.origin,t);const a=o*this.direction.dot(CLt.crossVectors(TLt,CLt));if(a<0)return null;const l=o*this.direction.dot(ILt.cross(TLt));if(l<0)return null;if(a+l>s)return null;const c=-o*TLt.dot(PLt);return c<0?null:this.at(c/s,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class DLt{constructor(t,e,i,n,r,o,s,a,l,c,u,h,p,d,f,m){DLt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,e,i,n,r,o,s,a,l,c,u,h,p,d,f,m)}set(t,e,i,n,r,o,s,a,l,c,u,h,p,d,f,m){const g=this.elements;return g[0]=t,g[4]=e,g[8]=i,g[12]=n,g[1]=r,g[5]=o,g[9]=s,g[13]=a,g[2]=l,g[6]=c,g[10]=u,g[14]=h,g[3]=p,g[7]=d,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new DLt).fromArray(this.elements)}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}copyPosition(t){const e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,i=t.elements,n=1/RLt.setFromMatrixColumn(t,0).length(),r=1/RLt.setFromMatrixColumn(t,1).length(),o=1/RLt.setFromMatrixColumn(t,2).length();return e[0]=i[0]*n,e[1]=i[1]*n,e[2]=i[2]*n,e[3]=0,e[4]=i[4]*r,e[5]=i[5]*r,e[6]=i[6]*r,e[7]=0,e[8]=i[8]*o,e[9]=i[9]*o,e[10]=i[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,i=t.x,n=t.y,r=t.z,o=Math.cos(i),s=Math.sin(i),a=Math.cos(n),l=Math.sin(n),c=Math.cos(r),u=Math.sin(r);if("XYZ"===t.order){const t=o*c,i=o*u,n=s*c,r=s*u;e[0]=a*c,e[4]=-a*u,e[8]=l,e[1]=i+n*l,e[5]=t-r*l,e[9]=-s*a,e[2]=r-t*l,e[6]=n+i*l,e[10]=o*a}else if("YXZ"===t.order){const t=a*c,i=a*u,n=l*c,r=l*u;e[0]=t+r*s,e[4]=n*s-i,e[8]=o*l,e[1]=o*u,e[5]=o*c,e[9]=-s,e[2]=i*s-n,e[6]=r+t*s,e[10]=o*a}else if("ZXY"===t.order){const t=a*c,i=a*u,n=l*c,r=l*u;e[0]=t-r*s,e[4]=-o*u,e[8]=n+i*s,e[1]=i+n*s,e[5]=o*c,e[9]=r-t*s,e[2]=-o*l,e[6]=s,e[10]=o*a}else if("ZYX"===t.order){const t=o*c,i=o*u,n=s*c,r=s*u;e[0]=a*c,e[4]=n*l-i,e[8]=t*l+r,e[1]=a*u,e[5]=r*l+t,e[9]=i*l-n,e[2]=-l,e[6]=s*a,e[10]=o*a}else if("YZX"===t.order){const t=o*a,i=o*l,n=s*a,r=s*l;e[0]=a*c,e[4]=r-t*u,e[8]=n*u+i,e[1]=u,e[5]=o*c,e[9]=-s*c,e[2]=-l*c,e[6]=i*u+n,e[10]=t-r*u}else if("XZY"===t.order){const t=o*a,i=o*l,n=s*a,r=s*l;e[0]=a*c,e[4]=-u,e[8]=l*c,e[1]=t*u+r,e[5]=o*c,e[9]=i*u-n,e[2]=n*u-i,e[6]=s*c,e[10]=r*u+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(kLt,t,NLt)}lookAt(t,e,i){const n=this.elements;return FLt.subVectors(t,e),0===FLt.lengthSq()&&(FLt.z=1),FLt.normalize(),BLt.crossVectors(i,FLt),0===BLt.lengthSq()&&(1===Math.abs(i.z)?FLt.x+=1e-4:FLt.z+=1e-4,FLt.normalize(),BLt.crossVectors(i,FLt)),BLt.normalize(),zLt.crossVectors(FLt,BLt),n[0]=BLt.x,n[4]=zLt.x,n[8]=FLt.x,n[1]=BLt.y,n[5]=zLt.y,n[9]=FLt.y,n[2]=BLt.z,n[6]=zLt.z,n[10]=FLt.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,n=e.elements,r=this.elements,o=i[0],s=i[4],a=i[8],l=i[12],c=i[1],u=i[5],h=i[9],p=i[13],d=i[2],f=i[6],m=i[10],g=i[14],y=i[3],v=i[7],_=i[11],x=i[15],b=n[0],w=n[4],A=n[8],E=n[12],S=n[1],M=n[5],T=n[9],I=n[13],C=n[2],P=n[6],L=n[10],D=n[14],R=n[3],O=n[7],k=n[11],N=n[15];return r[0]=o*b+s*S+a*C+l*R,r[4]=o*w+s*M+a*P+l*O,r[8]=o*A+s*T+a*L+l*k,r[12]=o*E+s*I+a*D+l*N,r[1]=c*b+u*S+h*C+p*R,r[5]=c*w+u*M+h*P+p*O,r[9]=c*A+u*T+h*L+p*k,r[13]=c*E+u*I+h*D+p*N,r[2]=d*b+f*S+m*C+g*R,r[6]=d*w+f*M+m*P+g*O,r[10]=d*A+f*T+m*L+g*k,r[14]=d*E+f*I+m*D+g*N,r[3]=y*b+v*S+_*C+x*R,r[7]=y*w+v*M+_*P+x*O,r[11]=y*A+v*T+_*L+x*k,r[15]=y*E+v*I+_*D+x*N,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[4],n=t[8],r=t[12],o=t[1],s=t[5],a=t[9],l=t[13],c=t[2],u=t[6],h=t[10],p=t[14];return t[3]*(+r*a*u-n*l*u-r*s*h+i*l*h+n*s*p-i*a*p)+t[7]*(+e*a*p-e*l*h+r*o*h-n*o*p+n*l*c-r*a*c)+t[11]*(+e*l*u-e*s*p-r*o*u+i*o*p+r*s*c-i*l*c)+t[15]*(-n*s*c-e*a*u+e*s*h+n*o*u-i*o*h+i*a*c)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,i){const n=this.elements;return t.isVector3?(n[12]=t.x,n[13]=t.y,n[14]=t.z):(n[12]=t,n[13]=e,n[14]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],o=t[4],s=t[5],a=t[6],l=t[7],c=t[8],u=t[9],h=t[10],p=t[11],d=t[12],f=t[13],m=t[14],g=t[15],y=u*m*l-f*h*l+f*a*p-s*m*p-u*a*g+s*h*g,v=d*h*l-c*m*l-d*a*p+o*m*p+c*a*g-o*h*g,_=c*f*l-d*u*l+d*s*p-o*f*p-c*s*g+o*u*g,x=d*u*a-c*f*a-d*s*h+o*f*h+c*s*m-o*u*m,b=e*y+i*v+n*_+r*x;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/b;return t[0]=y*w,t[1]=(f*h*r-u*m*r-f*n*p+i*m*p+u*n*g-i*h*g)*w,t[2]=(s*m*r-f*a*r+f*n*l-i*m*l-s*n*g+i*a*g)*w,t[3]=(u*a*r-s*h*r-u*n*l+i*h*l+s*n*p-i*a*p)*w,t[4]=v*w,t[5]=(c*m*r-d*h*r+d*n*p-e*m*p-c*n*g+e*h*g)*w,t[6]=(d*a*r-o*m*r-d*n*l+e*m*l+o*n*g-e*a*g)*w,t[7]=(o*h*r-c*a*r+c*n*l-e*h*l-o*n*p+e*a*p)*w,t[8]=_*w,t[9]=(d*u*r-c*f*r-d*i*p+e*f*p+c*i*g-e*u*g)*w,t[10]=(o*f*r-d*s*r+d*i*l-e*f*l-o*i*g+e*s*g)*w,t[11]=(c*s*r-o*u*r-c*i*l+e*u*l+o*i*p-e*s*p)*w,t[12]=x*w,t[13]=(c*f*n-d*u*n+d*i*h-e*f*h-c*i*m+e*u*m)*w,t[14]=(d*s*n-o*f*n-d*i*a+e*f*a+o*i*m-e*s*m)*w,t[15]=(o*u*n-c*s*n+c*i*a-e*u*a-o*i*h+e*s*h)*w,this}scale(t){const e=this.elements,i=t.x,n=t.y,r=t.z;return e[0]*=i,e[4]*=n,e[8]*=r,e[1]*=i,e[5]*=n,e[9]*=r,e[2]*=i,e[6]*=n,e[10]*=r,e[3]*=i,e[7]*=n,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,n))}makeTranslation(t,e,i){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const i=Math.cos(e),n=Math.sin(e),r=1-i,o=t.x,s=t.y,a=t.z,l=r*o,c=r*s;return this.set(l*o+i,l*s-n*a,l*a+n*s,0,l*s+n*a,c*s+i,c*a-n*o,0,l*a-n*s,c*a+n*o,r*a*a+i,0,0,0,0,1),this}makeScale(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,e,i,n,r,o){return this.set(1,i,r,0,t,1,o,0,e,n,1,0,0,0,0,1),this}compose(t,e,i){const n=this.elements,r=e._x,o=e._y,s=e._z,a=e._w,l=r+r,c=o+o,u=s+s,h=r*l,p=r*c,d=r*u,f=o*c,m=o*u,g=s*u,y=a*l,v=a*c,_=a*u,x=i.x,b=i.y,w=i.z;return n[0]=(1-(f+g))*x,n[1]=(p+_)*x,n[2]=(d-v)*x,n[3]=0,n[4]=(p-_)*b,n[5]=(1-(h+g))*b,n[6]=(m+y)*b,n[7]=0,n[8]=(d+v)*w,n[9]=(m-y)*w,n[10]=(1-(h+f))*w,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this}decompose(t,e,i){const n=this.elements;let r=RLt.set(n[0],n[1],n[2]).length();const o=RLt.set(n[4],n[5],n[6]).length(),s=RLt.set(n[8],n[9],n[10]).length();this.determinant()<0&&(r=-r),t.x=n[12],t.y=n[13],t.z=n[14],OLt.copy(this);const a=1/r,l=1/o,c=1/s;return OLt.elements[0]*=a,OLt.elements[1]*=a,OLt.elements[2]*=a,OLt.elements[4]*=l,OLt.elements[5]*=l,OLt.elements[6]*=l,OLt.elements[8]*=c,OLt.elements[9]*=c,OLt.elements[10]*=c,e.setFromRotationMatrix(OLt),i.x=r,i.y=o,i.z=s,this}makePerspective(t,e,i,n,r,o,s=2e3){const a=this.elements,l=2*r/(e-t),c=2*r/(i-n),u=(e+t)/(e-t),h=(i+n)/(i-n);let p,d;if(s===SPt)p=-(o+r)/(o-r),d=-2*o*r/(o-r);else{if(s!==MPt)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);p=-o/(o-r),d=-o*r/(o-r)}return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=p,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(t,e,i,n,r,o,s=2e3){const a=this.elements,l=1/(e-t),c=1/(i-n),u=1/(o-r),h=(e+t)*l,p=(i+n)*c;let d,f;if(s===SPt)d=(o+r)*u,f=-2*u;else{if(s!==MPt)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);d=r*u,f=-1*u}return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-p,a[2]=0,a[6]=0,a[10]=f,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(t){const e=this.elements,i=t.elements;for(let t=0;t<16;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}}const RLt=new iLt,OLt=new DLt,kLt=new iLt(0,0,0),NLt=new iLt(1,1,1),BLt=new iLt,zLt=new iLt,FLt=new iLt,VLt=new DLt,ULt=new eLt;class GLt{constructor(t=0,e=0,i=0,n=GLt.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=i,this._order=n}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,i,n=this._order){return this._x=t,this._y=e,this._z=i,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,i=!0){const n=t.elements,r=n[0],o=n[4],s=n[8],a=n[1],l=n[5],c=n[9],u=n[2],h=n[6],p=n[10];switch(e){case"XYZ":this._y=Math.asin(PPt(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-c,p),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-PPt(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(s,p),this._z=Math.atan2(a,l)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(PPt(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(a,r));break;case"ZYX":this._y=Math.asin(-PPt(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(h,p),this._z=Math.atan2(a,r)):(this._x=0,this._z=Math.atan2(-o,l));break;case"YZX":this._z=Math.asin(PPt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(s,p));break;case"XZY":this._z=Math.asin(-PPt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(h,l),this._y=Math.atan2(s,r)):(this._x=Math.atan2(-c,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===i&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return VLt.makeRotationFromQuaternion(t),this.setFromRotationMatrix(VLt,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return ULt.setFromEuler(this),this.setFromQuaternion(ULt,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}GLt.DEFAULT_ORDER="XYZ";class jLt{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return 0!=(this.mask&t.mask)}isEnabled(t){return 0!=(this.mask&(1<<t|0))}}let HLt=0;const WLt=new iLt,qLt=new eLt,XLt=new DLt,ZLt=new iLt,YLt=new iLt,QLt=new iLt,JLt=new eLt,KLt=new iLt(1,0,0),$Lt=new iLt(0,1,0),tDt=new iLt(0,0,1),eDt={type:"added"},iDt={type:"removed"};class nDt extends TPt{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:HLt++}),this.uuid=CPt(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=nDt.DEFAULT_UP.clone();const t=new iLt,e=new GLt,i=new eLt,n=new iLt(1,1,1);e._onChange((function(){i.setFromEuler(e,!1)})),i._onChange((function(){e.setFromQuaternion(i,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:n},modelViewMatrix:{value:new DLt},normalMatrix:{value:new kPt}}),this.matrix=new DLt,this.matrixWorld=new DLt,this.matrixAutoUpdate=nDt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.matrixWorldAutoUpdate=nDt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.layers=new jLt,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return qLt.setFromAxisAngle(t,e),this.quaternion.multiply(qLt),this}rotateOnWorldAxis(t,e){return qLt.setFromAxisAngle(t,e),this.quaternion.premultiply(qLt),this}rotateX(t){return this.rotateOnAxis(KLt,t)}rotateY(t){return this.rotateOnAxis($Lt,t)}rotateZ(t){return this.rotateOnAxis(tDt,t)}translateOnAxis(t,e){return WLt.copy(t).applyQuaternion(this.quaternion),this.position.add(WLt.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(KLt,t)}translateY(t){return this.translateOnAxis($Lt,t)}translateZ(t){return this.translateOnAxis(tDt,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(XLt.copy(this.matrixWorld).invert())}lookAt(t,e,i){t.isVector3?ZLt.copy(t):ZLt.set(t,e,i);const n=this.parent;this.updateWorldMatrix(!0,!1),YLt.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?XLt.lookAt(YLt,ZLt,this.up):XLt.lookAt(ZLt,YLt,this.up),this.quaternion.setFromRotationMatrix(XLt),n&&(XLt.extractRotation(n.matrixWorld),qLt.setFromRotationMatrix(XLt),this.quaternion.premultiply(qLt.invert()))}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(eDt)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}const e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(iDt)),this}removeFromParent(){const t=this.parent;return null!==t&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),XLt.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),XLt.multiply(t.parent.matrixWorld)),t.applyMatrix4(XLt),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let i=0,n=this.children.length;i<n;i++){const n=this.children[i].getObjectByProperty(t,e);if(void 0!==n)return n}}getObjectsByProperty(t,e){let i=[];this[t]===e&&i.push(this);for(let n=0,r=this.children.length;n<r;n++){const r=this.children[n].getObjectsByProperty(t,e);r.length>0&&(i=i.concat(r))}return i}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(YLt,t,QLt),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(YLt,JLt,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);const e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].traverseVisible(t)}traverseAncestors(t){const e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let i=0,n=e.length;i<n;i++){const n=e[i];!0!==n.matrixWorldAutoUpdate&&!0!==t||n.updateMatrixWorld(t)}}updateWorldMatrix(t,e){const i=this.parent;if(!0===t&&null!==i&&!0===i.matrixWorldAutoUpdate&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e){const t=this.children;for(let e=0,i=t.length;e<i;e++){const i=t[e];!0===i.matrixWorldAutoUpdate&&i.updateWorldMatrix(!1,!0)}}}toJSON(t){const e=void 0===t||"string"==typeof t,i={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const n={};function r(e,i){return void 0===e[i.uuid]&&(e[i.uuid]=i.toJSON(t)),i.uuid}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),n.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(n.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(n.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=r(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const i=e.shapes;if(Array.isArray(i))for(let e=0,n=i.length;e<n;e++){const n=i[e];r(t.shapes,n)}else r(t.shapes,i)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(r(t.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const e=[];for(let i=0,n=this.material.length;i<n;i++)e.push(r(t.materials,this.material[i]));n.material=e}else n.material=r(t.materials,this.material);if(this.children.length>0){n.children=[];for(let e=0;e<this.children.length;e++)n.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){n.animations=[];for(let e=0;e<this.animations.length;e++){const i=this.animations[e];n.animations.push(r(t.animations,i))}}if(e){const e=o(t.geometries),n=o(t.materials),r=o(t.textures),s=o(t.images),a=o(t.shapes),l=o(t.skeletons),c=o(t.animations),u=o(t.nodes);e.length>0&&(i.geometries=e),n.length>0&&(i.materials=n),r.length>0&&(i.textures=r),s.length>0&&(i.images=s),a.length>0&&(i.shapes=a),l.length>0&&(i.skeletons=l),c.length>0&&(i.animations=c),u.length>0&&(i.nodes=u)}return i.object=n,i;function o(t){const e=[];for(const i in t){const n=t[i];delete n.metadata,e.push(n)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e<t.children.length;e++){const i=t.children[e];this.add(i.clone())}return this}}nDt.DEFAULT_UP=new iLt(0,1,0),nDt.DEFAULT_MATRIX_AUTO_UPDATE=!0,nDt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const rDt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},oDt={h:0,s:0,l:0},sDt={h:0,s:0,l:0};function aDt(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t}class lDt{constructor(t,e,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,i)}set(t,e,i){if(void 0===e&&void 0===i){const e=t;e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e)}else this.setRGB(t,e,i);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=vPt){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,HPt.toWorkingColorSpace(this,e),this}setRGB(t,e,i,n=HPt.workingColorSpace){return this.r=t,this.g=e,this.b=i,HPt.toWorkingColorSpace(this,n),this}setHSL(t,e,i,n=HPt.workingColorSpace){if(t=function(t,e){return(t%e+e)%e}(t,1),e=PPt(e,0,1),i=PPt(i,0,1),0===e)this.r=this.g=this.b=i;else{const n=i<=.5?i*(1+e):i+e-i*e,r=2*i-n;this.r=aDt(r,n,t+1/3),this.g=aDt(r,n,t),this.b=aDt(r,n,t-1/3)}return HPt.toWorkingColorSpace(this,n),this}setStyle(t,e=vPt){function i(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let n;if(n=/^(\w+)\(([^\)]*)\)/.exec(t)){let r;const o=n[1],s=n[2];switch(o){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(t)){const i=n[1],r=i.length;if(3===r)return this.setRGB(parseInt(i.charAt(0),16)/15,parseInt(i.charAt(1),16)/15,parseInt(i.charAt(2),16)/15,e);if(6===r)return this.setHex(parseInt(i,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=vPt){const i=rDt[t.toLowerCase()];return void 0!==i?this.setHex(i,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=WPt(t.r),this.g=WPt(t.g),this.b=WPt(t.b),this}copyLinearToSRGB(t){return this.r=qPt(t.r),this.g=qPt(t.g),this.b=qPt(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=vPt){return HPt.fromWorkingColorSpace(cDt.copy(this),t),65536*Math.round(PPt(255*cDt.r,0,255))+256*Math.round(PPt(255*cDt.g,0,255))+Math.round(PPt(255*cDt.b,0,255))}getHexString(t=vPt){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=HPt.workingColorSpace){HPt.fromWorkingColorSpace(cDt.copy(this),e);const i=cDt.r,n=cDt.g,r=cDt.b,o=Math.max(i,n,r),s=Math.min(i,n,r);let a,l;const c=(s+o)/2;if(s===o)a=0,l=0;else{const t=o-s;switch(l=c<=.5?t/(o+s):t/(2-o-s),o){case i:a=(n-r)/t+(n<r?6:0);break;case n:a=(r-i)/t+2;break;case r:a=(i-n)/t+4}a/=6}return t.h=a,t.s=l,t.l=c,t}getRGB(t,e=HPt.workingColorSpace){return HPt.fromWorkingColorSpace(cDt.copy(this),e),t.r=cDt.r,t.g=cDt.g,t.b=cDt.b,t}getStyle(t=vPt){HPt.fromWorkingColorSpace(cDt.copy(this),t);const e=cDt.r,i=cDt.g,n=cDt.b;return t!==vPt?`color(${t} ${e.toFixed(3)} ${i.toFixed(3)} ${n.toFixed(3)})`:`rgb(${Math.round(255*e)},${Math.round(255*i)},${Math.round(255*n)})`}offsetHSL(t,e,i){return this.getHSL(oDt),this.setHSL(oDt.h+t,oDt.s+e,oDt.l+i)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,i){return this.r=t.r+(e.r-t.r)*i,this.g=t.g+(e.g-t.g)*i,this.b=t.b+(e.b-t.b)*i,this}lerpHSL(t,e){this.getHSL(oDt),t.getHSL(sDt);const i=LPt(oDt.h,sDt.h,e),n=LPt(oDt.s,sDt.s,e),r=LPt(oDt.l,sDt.l,e);return this.setHSL(i,n,r),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,i=this.g,n=this.b,r=t.elements;return this.r=r[0]*e+r[3]*i+r[6]*n,this.g=r[1]*e+r[4]*i+r[7]*n,this.b=r[2]*e+r[5]*i+r[8]*n,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const cDt=new lDt;lDt.NAMES=rDt;let uDt=0;class hDt extends TPt{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:uDt++}),this.uuid=CPt(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new lDt(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=EPt,this.stencilZFail=EPt,this.stencilZPass=EPt,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(const e in t){const i=t[e];if(void 0===i){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const n=this[e];void 0!==n?n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[e]=i:console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`)}}toJSON(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function n(t){const e=[];for(const i in t){const n=t[i];delete n.metadata,e.push(n)}return e}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(i.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(i.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),void 0!==this.anisotropy&&(i.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(i.blending=this.blending),0!==this.side&&(i.side=this.side),!0===this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=!0),204!==this.blendSrc&&(i.blendSrc=this.blendSrc),205!==this.blendDst&&(i.blendDst=this.blendDst),100!==this.blendEquation&&(i.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(i.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(i.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(i.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(i.depthFunc=this.depthFunc),!1===this.depthTest&&(i.depthTest=this.depthTest),!1===this.depthWrite&&(i.depthWrite=this.depthWrite),!1===this.colorWrite&&(i.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(i.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(i.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(i.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==EPt&&(i.stencilFail=this.stencilFail),this.stencilZFail!==EPt&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==EPt&&(i.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(i.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaHash&&(i.alphaHash=!0),!0===this.alphaToCoverage&&(i.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=!0),!0===this.forceSinglePass&&(i.forceSinglePass=!0),!0===this.wireframe&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=!0),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),!1===this.fog&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData),e){const e=n(t.textures),r=n(t.images);e.length>0&&(i.textures=e),r.length>0&&(i.images=r)}return i}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let i=null;if(null!==e){const t=e.length;i=new Array(t);for(let n=0;n!==t;++n)i[n]=e[n].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}}class pDt extends hDt{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new lDt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const dDt=new iLt,fDt=new OPt;class mDt{constructor(t,e,i=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=i,this.usage=35044,this.updateRange={offset:0,count:-1},this.gpuType=1015,this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,i){t*=this.itemSize,i*=e.itemSize;for(let n=0,r=this.itemSize;n<r;n++)this.array[t+n]=e.array[i+n];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(2===this.itemSize)for(let e=0,i=this.count;e<i;e++)fDt.fromBufferAttribute(this,e),fDt.applyMatrix3(t),this.setXY(e,fDt.x,fDt.y);else if(3===this.itemSize)for(let e=0,i=this.count;e<i;e++)dDt.fromBufferAttribute(this,e),dDt.applyMatrix3(t),this.setXYZ(e,dDt.x,dDt.y,dDt.z);return this}applyMatrix4(t){for(let e=0,i=this.count;e<i;e++)dDt.fromBufferAttribute(this,e),dDt.applyMatrix4(t),this.setXYZ(e,dDt.x,dDt.y,dDt.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)dDt.fromBufferAttribute(this,e),dDt.applyNormalMatrix(t),this.setXYZ(e,dDt.x,dDt.y,dDt.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)dDt.fromBufferAttribute(this,e),dDt.transformDirection(t),this.setXYZ(e,dDt.x,dDt.y,dDt.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let i=this.array[t*this.itemSize+e];return this.normalized&&(i=DPt(i,this.array)),i}setComponent(t,e,i){return this.normalized&&(i=RPt(i,this.array)),this.array[t*this.itemSize+e]=i,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=DPt(e,this.array)),e}setX(t,e){return this.normalized&&(e=RPt(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=DPt(e,this.array)),e}setY(t,e){return this.normalized&&(e=RPt(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=DPt(e,this.array)),e}setZ(t,e){return this.normalized&&(e=RPt(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=DPt(e,this.array)),e}setW(t,e){return this.normalized&&(e=RPt(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,i){return t*=this.itemSize,this.normalized&&(e=RPt(e,this.array),i=RPt(i,this.array)),this.array[t+0]=e,this.array[t+1]=i,this}setXYZ(t,e,i,n){return t*=this.itemSize,this.normalized&&(e=RPt(e,this.array),i=RPt(i,this.array),n=RPt(n,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,this}setXYZW(t,e,i,n,r){return t*=this.itemSize,this.normalized&&(e=RPt(e,this.array),i=RPt(i,this.array),n=RPt(n,this.array),r=RPt(r,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,this.array[t+3]=r,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(t.name=this.name),35044!==this.usage&&(t.usage=this.usage),0===this.updateRange.offset&&-1===this.updateRange.count||(t.updateRange=this.updateRange),t}}class gDt extends mDt{constructor(t,e,i){super(new Uint16Array(t),e,i)}}class yDt extends mDt{constructor(t,e,i){super(new Uint32Array(t),e,i)}}class vDt extends mDt{constructor(t,e,i){super(new Float32Array(t),e,i)}}let _Dt=0;const xDt=new DLt,bDt=new nDt,wDt=new iLt,ADt=new oLt,EDt=new oLt,SDt=new iLt;class MDt extends TPt{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:_Dt++}),this.uuid=CPt(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(function(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}(t)?yDt:gDt)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return void 0!==this.attributes[t]}addGroup(t,e,i=0){this.groups.push({start:t,count:e,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const i=this.attributes.normal;if(void 0!==i){const e=(new kPt).getNormalMatrix(t);i.applyNormalMatrix(e),i.needsUpdate=!0}const n=this.attributes.tangent;return void 0!==n&&(n.transformDirection(t),n.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(t){return xDt.makeRotationFromQuaternion(t),this.applyMatrix4(xDt),this}rotateX(t){return xDt.makeRotationX(t),this.applyMatrix4(xDt),this}rotateY(t){return xDt.makeRotationY(t),this.applyMatrix4(xDt),this}rotateZ(t){return xDt.makeRotationZ(t),this.applyMatrix4(xDt),this}translate(t,e,i){return xDt.makeTranslation(t,e,i),this.applyMatrix4(xDt),this}scale(t,e,i){return xDt.makeScale(t,e,i),this.applyMatrix4(xDt),this}lookAt(t){return bDt.lookAt(t),bDt.updateMatrix(),this.applyMatrix4(bDt.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(wDt).negate(),this.translate(wDt.x,wDt.y,wDt.z),this}setFromPoints(t){const e=[];for(let i=0,n=t.length;i<n;i++){const n=t[i];e.push(n.x,n.y,n.z||0)}return this.setAttribute("position",new vDt(e,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new oLt);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new iLt(-1/0,-1/0,-1/0),new iLt(1/0,1/0,1/0));if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,i=e.length;t<i;t++){const i=e[t];ADt.setFromBufferAttribute(i),this.morphTargetsRelative?(SDt.addVectors(this.boundingBox.min,ADt.min),this.boundingBox.expandByPoint(SDt),SDt.addVectors(this.boundingBox.max,ADt.max),this.boundingBox.expandByPoint(SDt)):(this.boundingBox.expandByPoint(ADt.min),this.boundingBox.expandByPoint(ADt.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new ALt);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingSphere.set(new iLt,1/0);if(t){const i=this.boundingSphere.center;if(ADt.setFromBufferAttribute(t),e)for(let t=0,i=e.length;t<i;t++){const i=e[t];EDt.setFromBufferAttribute(i),this.morphTargetsRelative?(SDt.addVectors(ADt.min,EDt.min),ADt.expandByPoint(SDt),SDt.addVectors(ADt.max,EDt.max),ADt.expandByPoint(SDt)):(ADt.expandByPoint(EDt.min),ADt.expandByPoint(EDt.max))}ADt.getCenter(i);let n=0;for(let e=0,r=t.count;e<r;e++)SDt.fromBufferAttribute(t,e),n=Math.max(n,i.distanceToSquared(SDt));if(e)for(let r=0,o=e.length;r<o;r++){const o=e[r],s=this.morphTargetsRelative;for(let e=0,r=o.count;e<r;e++)SDt.fromBufferAttribute(o,e),s&&(wDt.fromBufferAttribute(t,e),SDt.add(wDt)),n=Math.max(n,i.distanceToSquared(SDt))}this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const i=t.array,n=e.position.array,r=e.normal.array,o=e.uv.array,s=n.length/3;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new mDt(new Float32Array(4*s),4));const a=this.getAttribute("tangent").array,l=[],c=[];for(let t=0;t<s;t++)l[t]=new iLt,c[t]=new iLt;const u=new iLt,h=new iLt,p=new iLt,d=new OPt,f=new OPt,m=new OPt,g=new iLt,y=new iLt;function v(t,e,i){u.fromArray(n,3*t),h.fromArray(n,3*e),p.fromArray(n,3*i),d.fromArray(o,2*t),f.fromArray(o,2*e),m.fromArray(o,2*i),h.sub(u),p.sub(u),f.sub(d),m.sub(d);const r=1/(f.x*m.y-m.x*f.y);isFinite(r)&&(g.copy(h).multiplyScalar(m.y).addScaledVector(p,-f.y).multiplyScalar(r),y.copy(p).multiplyScalar(f.x).addScaledVector(h,-m.x).multiplyScalar(r),l[t].add(g),l[e].add(g),l[i].add(g),c[t].add(y),c[e].add(y),c[i].add(y))}let _=this.groups;0===_.length&&(_=[{start:0,count:i.length}]);for(let t=0,e=_.length;t<e;++t){const e=_[t],n=e.start;for(let t=n,r=n+e.count;t<r;t+=3)v(i[t+0],i[t+1],i[t+2])}const x=new iLt,b=new iLt,w=new iLt,A=new iLt;function E(t){w.fromArray(r,3*t),A.copy(w);const e=l[t];x.copy(e),x.sub(w.multiplyScalar(w.dot(e))).normalize(),b.crossVectors(A,e);const i=b.dot(c[t])<0?-1:1;a[4*t]=x.x,a[4*t+1]=x.y,a[4*t+2]=x.z,a[4*t+3]=i}for(let t=0,e=_.length;t<e;++t){const e=_[t],n=e.start;for(let t=n,r=n+e.count;t<r;t+=3)E(i[t+0]),E(i[t+1]),E(i[t+2])}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(void 0!==e){let i=this.getAttribute("normal");if(void 0===i)i=new mDt(new Float32Array(3*e.count),3),this.setAttribute("normal",i);else for(let t=0,e=i.count;t<e;t++)i.setXYZ(t,0,0,0);const n=new iLt,r=new iLt,o=new iLt,s=new iLt,a=new iLt,l=new iLt,c=new iLt,u=new iLt;if(t)for(let h=0,p=t.count;h<p;h+=3){const p=t.getX(h+0),d=t.getX(h+1),f=t.getX(h+2);n.fromBufferAttribute(e,p),r.fromBufferAttribute(e,d),o.fromBufferAttribute(e,f),c.subVectors(o,r),u.subVectors(n,r),c.cross(u),s.fromBufferAttribute(i,p),a.fromBufferAttribute(i,d),l.fromBufferAttribute(i,f),s.add(c),a.add(c),l.add(c),i.setXYZ(p,s.x,s.y,s.z),i.setXYZ(d,a.x,a.y,a.z),i.setXYZ(f,l.x,l.y,l.z)}else for(let t=0,s=e.count;t<s;t+=3)n.fromBufferAttribute(e,t+0),r.fromBufferAttribute(e,t+1),o.fromBufferAttribute(e,t+2),c.subVectors(o,r),u.subVectors(n,r),c.cross(u),i.setXYZ(t+0,c.x,c.y,c.z),i.setXYZ(t+1,c.x,c.y,c.z),i.setXYZ(t+2,c.x,c.y,c.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const t=this.attributes.normal;for(let e=0,i=t.count;e<i;e++)SDt.fromBufferAttribute(t,e),SDt.normalize(),t.setXYZ(e,SDt.x,SDt.y,SDt.z)}toNonIndexed(){function t(t,e){const i=t.array,n=t.itemSize,r=t.normalized,o=new i.constructor(e.length*n);let s=0,a=0;for(let r=0,l=e.length;r<l;r++){s=t.isInterleavedBufferAttribute?e[r]*t.data.stride+t.offset:e[r]*n;for(let t=0;t<n;t++)o[a++]=i[s++]}return new mDt(o,n,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new MDt,i=this.index.array,n=this.attributes;for(const r in n){const o=t(n[r],i);e.setAttribute(r,o)}const r=this.morphAttributes;for(const n in r){const o=[],s=r[n];for(let e=0,n=s.length;e<n;e++){const n=t(s[e],i);o.push(n)}e.morphAttributes[n]=o}e.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let t=0,i=o.length;t<i;t++){const i=o[t];e.addGroup(i.start,i.count,i.materialIndex)}return e}toJSON(){const t={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const i in e)void 0!==e[i]&&(t[i]=e[i]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const i=this.attributes;for(const e in i){const n=i[e];t.data.attributes[e]=n.toJSON(t.data)}const n={};let r=!1;for(const e in this.morphAttributes){const i=this.morphAttributes[e],o=[];for(let e=0,n=i.length;e<n;e++){const n=i[e];o.push(n.toJSON(t.data))}o.length>0&&(n[e]=o,r=!0)}r&&(t.data.morphAttributes=n,t.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(t.data.groups=JSON.parse(JSON.stringify(o)));const s=this.boundingSphere;return null!==s&&(t.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),t}clone(){return(new this.constructor).copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const i=t.index;null!==i&&this.setIndex(i.clone(e));const n=t.attributes;for(const t in n){const i=n[t];this.setAttribute(t,i.clone(e))}const r=t.morphAttributes;for(const t in r){const i=[],n=r[t];for(let t=0,r=n.length;t<r;t++)i.push(n[t].clone(e));this.morphAttributes[t]=i}this.morphTargetsRelative=t.morphTargetsRelative;const o=t.groups;for(let t=0,e=o.length;t<e;t++){const e=o[t];this.addGroup(e.start,e.count,e.materialIndex)}const s=t.boundingBox;null!==s&&(this.boundingBox=s.clone());const a=t.boundingSphere;return null!==a&&(this.boundingSphere=a.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}class TDt extends nDt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new DLt,this.projectionMatrix=new DLt,this.projectionMatrixInverse=new DLt,this.coordinateSystem=SPt}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}const IDt=new iLt,CDt=new iLt,PDt=new kPt;class LDt{constructor(t=new iLt(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,i,n){return this.normal.set(t,e,i),this.constant=n,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,i){const n=IDt.subVectors(i,e).cross(CDt.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(n,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){const i=t.delta(IDt),n=this.normal.dot(i);if(0===n)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const r=-(t.start.dot(this.normal)+this.constant)/n;return r<0||r>1?null:e.copy(t.start).addScaledVector(i,r)}intersectsLine(t){const e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const i=e||PDt.getNormalMatrix(t),n=this.coplanarPoint(IDt).applyMatrix4(t),r=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const DDt=new ALt,RDt=new iLt;class ODt{constructor(t=new LDt,e=new LDt,i=new LDt,n=new LDt,r=new LDt,o=new LDt){this.planes=[t,e,i,n,r,o]}set(t,e,i,n,r,o){const s=this.planes;return s[0].copy(t),s[1].copy(e),s[2].copy(i),s[3].copy(n),s[4].copy(r),s[5].copy(o),this}copy(t){const e=this.planes;for(let i=0;i<6;i++)e[i].copy(t.planes[i]);return this}setFromProjectionMatrix(t,e=2e3){const i=this.planes,n=t.elements,r=n[0],o=n[1],s=n[2],a=n[3],l=n[4],c=n[5],u=n[6],h=n[7],p=n[8],d=n[9],f=n[10],m=n[11],g=n[12],y=n[13],v=n[14],_=n[15];if(i[0].setComponents(a-r,h-l,m-p,_-g).normalize(),i[1].setComponents(a+r,h+l,m+p,_+g).normalize(),i[2].setComponents(a+o,h+c,m+d,_+y).normalize(),i[3].setComponents(a-o,h-c,m-d,_-y).normalize(),i[4].setComponents(a-s,h-u,m-f,_-v).normalize(),e===SPt)i[5].setComponents(a+s,h+u,m+f,_+v).normalize();else{if(e!==MPt)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);i[5].setComponents(s,u,f,v).normalize()}return this}intersectsObject(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),DDt.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),DDt.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(DDt)}intersectsSprite(t){return DDt.center.set(0,0,0),DDt.radius=.7071067811865476,DDt.applyMatrix4(t.matrixWorld),this.intersectsSphere(DDt)}intersectsSphere(t){const e=this.planes,i=t.center,n=-t.radius;for(let t=0;t<6;t++){if(e[t].distanceToPoint(i)<n)return!1}return!0}intersectsBox(t){const e=this.planes;for(let i=0;i<6;i++){const n=e[i];if(RDt.x=n.normal.x>0?t.max.x:t.min.x,RDt.y=n.normal.y>0?t.max.y:t.min.y,RDt.z=n.normal.z>0?t.max.z:t.min.z,n.distanceToPoint(RDt)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}class kDt extends TDt{constructor(t=-1,e=1,i=1,n=-1,r=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=i,this.bottom=n,this.near=r,this.far=o,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,i,n,r,o){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2;let r=i-t,o=i+t,s=n+e,a=n-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=t*this.view.offsetX,o=r+t*this.view.width,s-=e*this.view.offsetY,a=s-e*this.view.height}this.projectionMatrix.makeOrthographic(r,o,s,a,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}class NDt extends nDt{constructor(){super(),this.isGroup=!0,this.type="Group"}}class BDt extends hDt{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new lDt(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}const zDt=new iLt,FDt=new iLt,VDt=new DLt,UDt=new LLt,GDt=new ALt;class jDt extends nDt{constructor(t=new MDt,e=new BDt){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(null===t.index){const e=t.attributes.position,i=[0];for(let t=1,n=e.count;t<n;t++)zDt.fromBufferAttribute(e,t-1),FDt.fromBufferAttribute(e,t),i[t]=i[t-1],i[t]+=zDt.distanceTo(FDt);t.setAttribute("lineDistance",new vDt(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(t,e){const i=this.geometry,n=this.matrixWorld,r=t.params.Line.threshold,o=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),GDt.copy(i.boundingSphere),GDt.applyMatrix4(n),GDt.radius+=r,!1===t.ray.intersectsSphere(GDt))return;VDt.copy(n).invert(),UDt.copy(t.ray).applyMatrix4(VDt);const s=r/((this.scale.x+this.scale.y+this.scale.z)/3),a=s*s,l=new iLt,c=new iLt,u=new iLt,h=new iLt,p=this.isLineSegments?2:1,d=i.index,f=i.attributes.position;if(null!==d){for(let i=Math.max(0,o.start),n=Math.min(d.count,o.start+o.count)-1;i<n;i+=p){const n=d.getX(i),r=d.getX(i+1);l.fromBufferAttribute(f,n),c.fromBufferAttribute(f,r);if(UDt.distanceSqToSegment(l,c,h,u)>a)continue;h.applyMatrix4(this.matrixWorld);const o=t.ray.origin.distanceTo(h);o<t.near||o>t.far||e.push({distance:o,point:u.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}else{for(let i=Math.max(0,o.start),n=Math.min(f.count,o.start+o.count)-1;i<n;i+=p){l.fromBufferAttribute(f,i),c.fromBufferAttribute(f,i+1);if(UDt.distanceSqToSegment(l,c,h,u)>a)continue;h.applyMatrix4(this.matrixWorld);const n=t.ray.origin.distanceTo(h);n<t.near||n>t.far||e.push({distance:n,point:u.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=i.length;t<e;t++){const e=i[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}}class HDt extends nDt{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new lDt(t),this.intensity=e}dispose(){}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}const WDt=new DLt,qDt=new iLt,XDt=new iLt;class ZDt{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new OPt(512,512),this.map=null,this.mapPass=null,this.matrix=new DLt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new ODt,this._frameExtents=new OPt(1,1),this._viewportCount=1,this._viewports=[new tLt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,i=this.matrix;qDt.setFromMatrixPosition(t.matrixWorld),e.position.copy(qDt),XDt.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(XDt),e.updateMatrixWorld(),WDt.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(WDt),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(WDt)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const t={};return 0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}class YDt extends ZDt{constructor(){super(new kDt(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class QDt extends HDt{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(nDt.DEFAULT_UP),this.updateMatrix(),this.target=new nDt,this.shadow=new YDt}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}class JDt{constructor(t,e,i=0,n=1/0){this.ray=new LLt(t,e),this.near=i,this.far=n,this.camera=null,this.layers=new jLt,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type: "+e.type)}intersectObject(t,e=!0,i=[]){return $Dt(t,this,i,e),i.sort(KDt),i}intersectObjects(t,e=!0,i=[]){for(let n=0,r=t.length;n<r;n++)$Dt(t[n],this,i,e);return i.sort(KDt),i}}function KDt(t,e){return t.distance-e.distance}function $Dt(t,e,i,n){if(t.layers.test(e.layers)&&t.raycast(e,i),!0===n){const n=t.children;for(let t=0,r=n.length;t<r;t++)$Dt(n[t],e,i,!0)}}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"158"}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="158");class tRt{modelData;modelOpition;id;_tb;_model;constructor(t,e,i){this.modelData=t,this.modelOpition=Object.assign({heading:90,pitch:0,roll:0,scale:1},e),this.id=i||d(0,5),this._tb="",this.render()}render(){const t=window.tb=new af.Threebox(cNt.value,cNt.value.getCanvas().getContext("webgl"),{defaultLights:!0});this._tb=t;const{heading:e,pitch:i,roll:n,scale:r,color:o,lightColor:s}=this.modelOpition;cNt.value.addLayer({id:this.id,type:"custom",renderingMode:"3d",onAdd:()=>{const a={obj:this.modelData.url,type:this.modelData.type||"glb",units:"meters",rotation:{x:e,y:i,z:n},scale:r};t.loadObj(a,(e=>{if(this._model=e,s){const e=new QDt(this._getHex(s),1);e.intensity=5,e.position.set(0,-1,0),t.scene.add(e)}if(o){const t=this._getRgb(o),i=new pDt({color:new lDt(t[0],t[1],t[2])});e.traverse((t=>{t.isMesh&&(t.material=i)}))}e.setCoords(this.modelData.position),this.modelOpition.callBack&&this.modelOpition.callBack(e),t.add(e)}))},render(){t.update()}})}_onMouseClick(t,e){const i=new JDt,n=new OPt;n.x=t.clientX/window.innerWidth*2-1,n.y=-t.clientY/window.innerHeight*2+1,i.setFromCamera(n,this._tb.camera);const r=i.intersectObjects(this._model.children,!0);if(r.length>0){e(r[0].object)}}addEventListener(t,e){if("click"===t)I.value[t][this.id]=t=>{this._onMouseClick(t,e)},window.addEventListener("click",I.value[t][this.id],!1)}removeEventListener(t){if("click"===t)window.removeEventListener("click",I.value[t][this.id])}destroy(){cNt.value.removeLayer(this.id)}show(t){if(!cNt.value.getLayer(this.id))throw new Error(`Layer name "${this.id}" does not exist.`);{const e=t?"visible":"none";cNt.value.setLayoutProperty(this.id,"visibility",e)}}_getRgb(t){let e;const i=t.match(/rgb\((\d+), (\d+), (\d+)\)/);if(!i)throw new Error("Invalid RGB value");e=[parseInt(i[1]),parseInt(i[2]),parseInt(i[3])];return e}_getHex(t){const e=this._getRgb(t),i=e[0]<<16|e[1]<<8|e[2];return parseInt("0x"+i.toString(16))}highlight(t,e){const i=this._getRgb(e),n=new pDt({color:new lDt(i[0],i[1],i[2])});t.material=n}}var eRt;!function(t){t[t.color=0]="color",t[t.image=1]="image"}(eRt||(eRt={}));const iRt={MultiPolygon:{data:function(t,e,i){const n=[];return X(t,(t=>{const{geometry:{coordinates:r},properties:o}=t;h(r,(t=>{t[0].pop(),n.push({position:t,userData:o||{},text:e?o[e]:void 0,id:i?o[i]:void 0})}))})),n},option:function(t){const e={};return f(t,((t,i)=>{const n=i.split("-");-1===i.indexOf("polygon")&&-1===i.indexOf("Polygon")||2!==n.length||(e[n[n.length-1]]=t)})),t.labelOption&&(e.labelOption=t.labelOption),e},methods:Df}};class nRt{id;_options;constructor(t,e,i){this.id=i||d(0,5),this._options=Object.assign({url:t,minzoom:0,maxzoom:24,tileSize:256,exaggeration:1},e),this.render()}render(){"string"==typeof this._options.url.indexOf?cNt.value.addSource(this.id,{type:"raster-dem",url:this._options.url,tileSize:this._options.tileSize,maxzoom:this._options.maxzoom,minzoom:this._options.minzoom}):cNt.value.addSource(this.id,{type:"raster-dem",tiles:[this._options.url],tileSize:this._options.tileSize,maxzoom:this._options.maxzoom,minzoom:this._options.minzoom}),cNt.value.setTerrain({source:this.id,exaggeration:this._options.exaggeration})}exaggeration(t){cNt.value.setTerrain({source:this.id,exaggeration:t})}destroy(){cNt.value.setTerrain("")}}function rRt({map:t,gl:e,deck:i}){if(t.__deck)return t.__deck;const n=i&&i.props._customRender,r={useDevicePixels:!0,_customRender:()=>{t.triggerRepaint(),n&&n()},parameters:{depthMask:!0,depthTest:!0,blend:!0,blendFunc:[e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA],polygonOffsetFill:!0,depthFunc:e.LEQUAL,blendEquation:e.FUNC_ADD},userData:{isExternal:!1,mapboxLayers:new Set},views:i&&i.props.views||[new D_t({id:"mapbox"})]};return i&&i.props.gl!==e||(Object.assign(r,{gl:e,width:!1,height:!1,touchAction:"unset",viewState:oRt(t)}),t.on("move",(()=>function(t,e){t.setProps({viewState:oRt(e)}),t.needsRedraw({clearRedrawFlags:!0})}(i,t)))),i?(i.setProps(r),i.props.userData.isExternal=!0):(i=new Cxt(r),t.on("remove",(()=>{i.finalize(),t.__deck=null}))),i.props.userData.mapboxVersion=function(t){let e=0,i=0;t.version&&([e,i]=t.version.split(".").slice(0,2).map(Number));return{major:e,minor:i}}(t),t.__deck=i,t.on("render",(()=>{i.layerManager&&function(t,e){const{mapboxLayers:i,isExternal:n}=t.props.userData;if(n){const n=Array.from(i,(t=>t.id)),r=t.props.layers.some((t=>!n.includes(t.id)));let o=t.getViewports();const s=o.findIndex((t=>"mapbox"===t.id)),a=o.length>1||s<0;(r||a)&&(s>=0&&(o=o.slice(),o[s]=sRt(t,e,!1)),t._drawLayers("mapbox-repaint",{viewports:o,layerFilter:e=>(!t.props.layerFilter||t.props.layerFilter(e))&&("mapbox"!==e.viewport.id||!n.includes(e.layer.id)),clearCanvas:!1}))}t.props.userData.currentViewport=null}(i,t)})),i}function oRt(t){const{lng:e,lat:i}=t.getCenter();return{longitude:e,latitude:i,zoom:t.getZoom(),bearing:t.getBearing(),pitch:t.getPitch()}}function sRt(t,e,i=!0){const{mapboxVersion:n}=t.props.userData,r={nearZMultiplier:1===n.major&&n.minor>=3||n.major>=2?.02:1/(t.height||1)};return new Evt(Object.assign({id:"mapbox",x:0,y:0,width:t.width,height:t.height,repeat:e.getRenderWorldCopies()},oRt(e),i?r:{nearZMultiplier:.1}))}function aRt(t){if(t.props.userData.isExternal)return;const e=[];let i=0;t.props.userData.mapboxLayers.forEach((t=>{const n=new(0,t.props.type)(t.props,{_offset:i++});e.push(n)})),t.setProps({layers:e})}function lRt(t){if(!Array.isArray(t))return!1;for(const e of t)if("object"!=typeof e||"number"!=typeof e.x||"number"!=typeof e.y||"number"!=typeof e.value)return!1;return!0}function cRt(t){const e=[];return t.forEach((t=>{e.push(R([t.x,t.y],{mag:t.value}))})),N(e)}class uRt{id;type;renderingMode;map;deck;props;constructor(t){if(!t.id)throw new Error("Layer must have an unique id");this.id=t.id,this.type="custom",this.renderingMode=t.renderingMode||"3d",this.map=null,this.deck=null,this.props=t}onAdd(t,e){var i,n;this.map=t,this.deck=rRt({map:t,gl:e,deck:this.props.deck}),i=this.deck,n=this,i.props.userData.mapboxLayers.add(n),aRt(i)}onRemove(){var t,e;t=this.deck,e=this,t.props.userData.mapboxLayers.delete(e),aRt(t)}setProps(t){Object.assign(this.props,t,{id:this.id}),this.deck&&aRt(this.deck)}render(){!function(t,e,i){let{currentViewport:n}=t.props.userData;n||(n=sRt(t,e,!0),t.props.userData.currentViewport=n),t.layerManager&&t._drawLayers("mapbox-repaint",{viewports:[n],layerFilter:({layer:t})=>i.id===t.id,clearCanvas:!1})}(this.deck,this.map,this)}}class hRt extends(m(C)){data;id;_options;constructor(t,e,i){super(),this.data=t,this.id=i||d(0,5),this._options=Object.assign({magName:"mag",colors:{0:"rgba(33,102,172,0)",.2:"rgb(103,169,207)",.4:"rgb(209,229,240)",.6:"rgb(253,219,199)",.8:"rgb(239,138,98)","1.0":"rgb(178,24,43)"},elevationScale:1},e),cNt.value.addLayer(this.defineHeatmap())}defineHeatmap(){const{id:t,data:e,_options:{magName:i,colors:n}}=this,r=["interpolate",["linear"],["get",i],this._options.minValue?this._options.minValue:0,0,this._options.maxValue?this._options.maxValue:1e3,1],o=["interpolate",["linear"],["heatmap-density"]];if(n){const t=Object.keys(n).sort(((t,e)=>parseFloat(t)-parseFloat(e)));t.forEach((t=>{o.push(Number(t),n[t])}))}return{id:t,type:"heatmap",source:{type:"geojson",data:e},paint:{"heatmap-weight":r,"heatmap-intensity":this._options.heatmapIntensity?this._options.heatmapIntensity:10,"heatmap-color":o,"heatmap-radius":this._options.heatmapRadius?this._options.heatmapRadius:30,"heatmap-opacity":this._options.heatmapOpacity?this._options.heatmapOpacity:1}}}}const pRt={SUM:1,MEAN:2,MIN:3,MAX:4};function dRt(t,e){return t+e}function fRt(t,e){return e>t?e:t}function mRt(t,e){return e<t?e:t}function gRt(t,e,i){const n=pRt[t]||pRt.SUM;switch(e=function(t,e={}){if(Number.isFinite(t))return t;return i=>(e.index=i.index,t(i.source,e))}(e,i),n){case pRt.MIN:return t=>function(t,e){if(Number.isFinite(e))return t.length?e:null;const i=t.map(e).filter(Number.isFinite);return i.length?i.reduce(mRt,1/0):null}(t,e);case pRt.SUM:return t=>function(t,e){if(Number.isFinite(e))return t.length?t.length*e:null;const i=t.map(e).filter(Number.isFinite);return i.length?i.reduce(dRt,0):null}(t,e);case pRt.MEAN:return t=>function(t,e){if(Number.isFinite(e))return t.length?e:null;const i=t.map(e).filter(Number.isFinite);return i.length?i.reduce(dRt,0)/i.length:null}(t,e);case pRt.MAX:return t=>function(t,e){if(Number.isFinite(e))return t.length?e:null;const i=t.map(e).filter(Number.isFinite);return i.length?i.reduce(fRt,-1/0):null}(t,e);default:return null}}function yRt(t,e={}){return i=>(e.indices=i.map((t=>t.index)),t(i.map((t=>t.source)),e))}const vRt={projectPoints:!1,viewport:null,createBufferObjects:!0,moduleSettings:{}},_Rt=3402823466e29,xRt=[32775,32774],bRt=[32776,32774],wRt=[32776,32775],ARt={[pRt.SUM]:32774,[pRt.MEAN]:32774,[pRt.MIN]:xRt,[pRt.MAX]:bRt},ERt={size:1,operation:pRt.SUM,needMin:!1,needMax:!1,combineMaxMin:!1};var SRt="#define SHADER_NAME gpu-aggregation-to-grid-vs\n\nattribute vec3 positions;\nattribute vec3 positions64Low;\nattribute vec3 weights;\nuniform vec2 cellSize;\nuniform vec2 gridSize;\nuniform bool projectPoints;\nuniform vec2 translation;\nuniform vec3 scaling;\n\nvarying vec3 vWeights;\n\nvec2 project_to_pixel(vec4 pos) {\n vec4 result;\n pos.xy = pos.xy/pos.w;\n result = pos + vec4(translation, 0., 0.);\n result.xy = scaling.z > 0. ? result.xy * scaling.xy : result.xy;\n return result.xy;\n}\n\nvoid main(void) {\n\n vWeights = weights;\n\n vec4 windowPos = vec4(positions, 1.);\n if (projectPoints) {\n windowPos = project_position_to_clipspace(positions, positions64Low, vec3(0));\n }\n\n vec2 pos = project_to_pixel(windowPos);\n\n vec2 pixelXY64[2];\n pixelXY64[0] = vec2(pos.x, 0.);\n pixelXY64[1] = vec2(pos.y, 0.);\n vec2 gridXY64[2];\n gridXY64[0] = div_fp64(pixelXY64[0], vec2(cellSize.x, 0));\n gridXY64[1] = div_fp64(pixelXY64[1], vec2(cellSize.y, 0));\n float x = floor(gridXY64[0].x);\n float y = floor(gridXY64[1].x);\n pos = vec2(x, y);\n pos = (pos * (2., 2.) / (gridSize)) - (1., 1.);\n vec2 offset = 1.0 / gridSize;\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n gl_PointSize = 1.0;\n}\n",MRt="#define SHADER_NAME gpu-aggregation-to-grid-fs\n\nprecision highp float;\n\nvarying vec3 vWeights;\n\nvoid main(void) {\n gl_FragColor = vec4(vWeights, 1.0);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",TRt="#version 300 es\n#define SHADER_NAME gpu-aggregation-all-vs-64\n\nin vec2 position;\nuniform ivec2 gridSize;\nout vec2 vTextureCoord;\n\nvoid main(void) {\n vec2 pos = vec2(-1.0, -1.0);\n vec2 offset = 1.0 / vec2(gridSize);\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n\n int yIndex = gl_InstanceID / gridSize[0];\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 yIndexFP64 = vec2(float(yIndex), 0.);\n vec2 xIndexFP64 = vec2(float(xIndex), 0.);\n vec2 gridSizeYFP64 = vec2(gridSize[1], 0.);\n vec2 gridSizeXFP64 = vec2(gridSize[0], 0.);\n\n vec2 texCoordXFP64 = div_fp64(yIndexFP64, gridSizeYFP64);\n vec2 texCoordYFP64 = div_fp64(xIndexFP64, gridSizeXFP64);\n\n vTextureCoord = vec2(texCoordYFP64.x, texCoordXFP64.x);\n gl_PointSize = 1.0;\n}\n",IRt="#version 300 es\n#define SHADER_NAME gpu-aggregation-all-fs\n\nprecision highp float;\n\nin vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform bool combineMaxMin;\nout vec4 fragColor;\nvoid main(void) {\n vec4 textureColor = texture(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\n if (textureColor.a == 0.) {\n discard;\n }\n fragColor.rgb = textureColor.rgb;\n fragColor.a = combineMaxMin ? textureColor.r : textureColor.a;\n}\n",CRt="#define SHADER_NAME gpu-aggregation-transform-mean-vs\nattribute vec4 aggregationValues;\nvarying vec4 meanValues;\n\nvoid main()\n{\n bool isCellValid = bool(aggregationValues.w > 0.);\n meanValues.xyz = isCellValid ? aggregationValues.xyz/aggregationValues.w : vec3(0, 0, 0);\n meanValues.w = aggregationValues.w;\n gl_PointSize = 1.0;\n}\n";const PRt={10240:9728,10241:9728};function LRt(t,e={}){const{width:i=1,height:n=1,data:r=null,unpackFlipY:o=!0,parameters:s=PRt}=e;return new tpt(t,{data:r,format:Iut(t)?34836:6408,type:5126,border:0,mipmaps:!1,parameters:s,dataFormat:6408,width:i,height:n,unpackFlipY:o})}function DRt(t,e){const{id:i,width:n=1,height:r=1,texture:o}=e;return new Ppt(t,{id:i,width:n,height:r,attachments:{36064:o}})}const RRt=["aggregationBuffer","maxMinBuffer","minBuffer","maxBuffer"],ORt={maxData:"maxBuffer",minData:"minBuffer",maxMinData:"maxMinBuffer"},kRt=[mpt,bpt,vpt,_pt,xpt];class NRt{static getAggregationData({aggregationData:t,maxData:e,minData:i,maxMinData:n,pixelIndex:r}){const o=4*r,s={};return t&&(s.cellCount=t[o+3],s.cellWeight=t[o]),n?(s.maxCellWieght=n[0],s.minCellWeight=n[3]):(e&&(s.maxCellWieght=e[0],s.totalCount=e[3]),i&&(s.minCellWeight=i[0],s.totalCount=e[3])),s}static getCellData({countsData:t,size:e=1}){const i=t.length/4,n=new Float32Array(i*e),r=new Uint32Array(i);for(let o=0;o<i;o++){for(let i=0;i<e;i++)n[o*e+i]=t[4*o+i];r[o]=t[4*o+3]}return{cellCounts:r,cellWeights:n}}static isSupported(t){return Tpt(t,kRt)}constructor(t,e={}){this.id=e.id||"gpu-grid-aggregator",this.gl=t,this.state={weightAttributes:{},textures:{},meanTextures:{},buffers:{},framebuffers:{},maxMinFramebuffers:{},minFramebuffers:{},maxFramebuffers:{},equations:{},resources:{},results:{}},this._hasGPUSupport=Iut(t)&&Tpt(this.gl,vpt),this._hasGPUSupport&&this._setupModels()}delete(){const{gridAggregationModel:t,allAggregationModel:e,meanTransform:i}=this,{textures:n,framebuffers:r,maxMinFramebuffers:o,minFramebuffers:s,maxFramebuffers:a,meanTextures:l,resources:c}=this.state;null==t||t.delete(),null==e||e.delete(),null==i||i.delete(),function(t){t=Array.isArray(t)?t:[t],t.forEach((t=>{for(const e in t)t[e].delete()}))}([r,n,o,s,a,l,c])}run(t={}){this.setState({results:{}});const e=this._normalizeAggregationParams(t);return this._hasGPUSupport||dut.log(1,"GPUGridAggregator: not supported")(),this._runAggregation(e)}getData(t){const e={},i=this.state.results;i[t].aggregationData||(i[t].aggregationData=i[t].aggregationBuffer.getData()),e.aggregationData=i[t].aggregationData;for(const n in ORt){const r=ORt[n];(i[t][n]||i[t][r])&&(i[t][n]=i[t][n]||i[t][r].getData(),e[n]=i[t][n])}return e}updateShaders(t={}){this.setState({shaderOptions:t,modelDirty:!0})}_normalizeAggregationParams(t){const e={...vRt,...t},{weights:i}=e;return i&&(e.weights=function(t){const e={};for(const i in t)e[i]={...ERt,...t[i]};return e}(i)),e}setState(t){Object.assign(this.state,t)}_getAggregateData(t){const e={},{textures:i,framebuffers:n,maxMinFramebuffers:r,minFramebuffers:o,maxFramebuffers:s,resources:a}=this.state,{weights:l}=t;for(const t in l){e[t]={};const{needMin:c,needMax:u,combineMaxMin:h}=l[t];e[t].aggregationTexture=i[t],e[t].aggregationBuffer=ppt(n[t],{target:l[t].aggregationBuffer,sourceType:5126}),c&&u&&h?(e[t].maxMinBuffer=ppt(r[t],{target:l[t].maxMinBuffer,sourceType:5126}),e[t].maxMinTexture=a["".concat(t,"-maxMinTexture")]):(c&&(e[t].minBuffer=ppt(o[t],{target:l[t].minBuffer,sourceType:5126}),e[t].minTexture=a["".concat(t,"-minTexture")]),u&&(e[t].maxBuffer=ppt(s[t],{target:l[t].maxBuffer,sourceType:5126}),e[t].maxTexture=a["".concat(t,"-maxTexture")]))}return this._trackGPUResultBuffers(e,l),e}_renderAggregateData(t){const{cellSize:e,projectPoints:i,attributes:n,moduleSettings:r,numCol:o,numRow:s,weights:a,translation:l,scaling:c}=t,{maxMinFramebuffers:u,minFramebuffers:h,maxFramebuffers:p}=this.state,d=[o,s],f={blend:!0,depthTest:!1,blendFunc:[1,1]},m={cellSize:e,gridSize:d,projectPoints:i,translation:l,scaling:c};for(const t in a){const{needMin:e,needMax:i}=a[t],o=e&&i&&a[t].combineMaxMin;this._renderToWeightsTexture({id:t,parameters:f,moduleSettings:r,uniforms:m,gridSize:d,attributes:n,weights:a}),o?this._renderToMaxMinTexture({id:t,parameters:{...f,blendEquation:wRt},gridSize:d,minOrMaxFb:u[t],clearParams:{clearColor:[0,0,0,_Rt]},combineMaxMin:o}):(e&&this._renderToMaxMinTexture({id:t,parameters:{...f,blendEquation:xRt},gridSize:d,minOrMaxFb:h[t],clearParams:{clearColor:[_Rt,_Rt,_Rt,0]},combineMaxMin:o}),i&&this._renderToMaxMinTexture({id:t,parameters:{...f,blendEquation:bRt},gridSize:d,minOrMaxFb:p[t],clearParams:{clearColor:[0,0,0,0]},combineMaxMin:o}))}}_renderToMaxMinTexture(t){const{id:e,parameters:i,gridSize:n,minOrMaxFb:r,combineMaxMin:o,clearParams:s={}}=t,{framebuffers:a}=this.state,{gl:l,allAggregationModel:c}=this;uht(l,{...s,framebuffer:r,viewport:[0,0,n[0],n[1]]},(()=>{l.clear(16384),c.draw({parameters:i,uniforms:{uSampler:a[e].texture,gridSize:n,combineMaxMin:o}})}))}_renderToWeightsTexture(t){const{id:e,parameters:i,moduleSettings:n,uniforms:r,gridSize:o,weights:s}=t,{framebuffers:a,equations:l,weightAttributes:c}=this.state,{gl:u,gridAggregationModel:h}=this,{operation:p}=s[e],d=p===pRt.MIN?[_Rt,_Rt,_Rt,0]:[0,0,0,0];if(uht(u,{framebuffer:a[e],viewport:[0,0,o[0],o[1]],clearColor:d},(()=>{u.clear(16384);const t={weights:c[e]};h.draw({parameters:{...i,blendEquation:l[e]},moduleSettings:n,uniforms:r,attributes:t})})),p===pRt.MEAN){const{meanTextures:t,textures:i}=this.state,n={_sourceTextures:{aggregationValues:t[e]},_targetTexture:i[e],elementCount:i[e].width*i[e].height};this.meanTransform?this.meanTransform.update(n):this.meanTransform=function(t,e){return new jgt(t,{vs:CRt,_targetTextureVarying:"meanValues",...e})}(u,n),this.meanTransform.run({parameters:{blend:!1,depthTest:!1}}),a[e].attach({36064:i[e]})}}_runAggregation(t){this._updateModels(t),this._setupFramebuffers(t),this._renderAggregateData(t);const e=this._getAggregateData(t);return this.setState({results:e}),e}_setupFramebuffers(t){const{textures:e,framebuffers:i,maxMinFramebuffers:n,minFramebuffers:r,maxFramebuffers:o,meanTextures:s,equations:a}=this.state,{weights:l}=t,{numCol:c,numRow:u}=t,h={width:c,height:u};for(const t in l){const{needMin:p,needMax:d,combineMaxMin:f,operation:m}=l[t];e[t]=l[t].aggregationTexture||e[t]||LRt(this.gl,{id:"".concat(t,"-texture"),width:c,height:u}),e[t].resize(h);let g=e[t];m===pRt.MEAN&&(s[t]=s[t]||LRt(this.gl,{id:"".concat(t,"-mean-texture"),width:c,height:u}),s[t].resize(h),g=s[t]),i[t]?i[t].attach({36064:g}):i[t]=DRt(this.gl,{id:"".concat(t,"-fb"),width:c,height:u,texture:g}),i[t].resize(h),a[t]=ARt[m]||ARt.SUM,(p||d)&&(p&&d&&f?n[t]||(g=l[t].maxMinTexture||this._getMinMaxTexture("".concat(t,"-maxMinTexture")),n[t]=DRt(this.gl,{id:"".concat(t,"-maxMinFb"),texture:g})):(p&&(r[t]||(g=l[t].minTexture||this._getMinMaxTexture("".concat(t,"-minTexture")),r[t]=DRt(this.gl,{id:"".concat(t,"-minFb"),texture:g}))),d&&(o[t]||(g=l[t].maxTexture||this._getMinMaxTexture("".concat(t,"-maxTexture")),o[t]=DRt(this.gl,{id:"".concat(t,"-maxFb"),texture:g})))))}}_getMinMaxTexture(t){const{resources:e}=this.state;return e[t]||(e[t]=LRt(this.gl,{id:"resourceName"})),e[t]}_setupModels({numCol:t=0,numRow:e=0}={}){var i;const{gl:n}=this,{shaderOptions:r}=this.state;if(null===(i=this.gridAggregationModel)||void 0===i||i.delete(),this.gridAggregationModel=function(t,e){const i=pbt({vs:SRt,fs:MRt,modules:[Oft,Yvt]},e);return new kgt(t,{id:"Gird-Aggregation-Model",vertexCount:1,drawMode:0,...i})}(n,r),!this.allAggregationModel){const i=t*e;this.allAggregationModel=function(t,e){return new kgt(t,{id:"All-Aggregation-Model",vs:TRt,fs:IRt,modules:[Oft],vertexCount:1,drawMode:0,isInstanced:!0,instanceCount:e,attributes:{position:[0,0]}})}(n,i)}}_setupWeightAttributes(t){const{weightAttributes:e}=this.state,{weights:i}=t;for(const n in i)e[n]=t.attributes[n]}_trackGPUResultBuffers(t,e){const{resources:i}=this.state;for(const n in t)if(t[n])for(const r of RRt)if(t[n][r]&&e[n][r]!==t[n][r]){const e="gpu-result-".concat(n,"-").concat(r);i[e]&&i[e].delete(),i[e]=t[n][r]}}_updateModels(t){const{vertexCount:e,attributes:i,numCol:n,numRow:r}=t,{modelDirty:o}=this.state;o&&(this._setupModels(t),this.setState({modelDirty:!1})),this._setupWeightAttributes(t),this.gridAggregationModel.setVertexCount(e),this.gridAggregationModel.setAttributes(i),this.allAggregationModel.setInstanceCount(n*r)}}const BRt=[[255,255,178],[254,217,118],[254,178,76],[253,141,60],[240,59,32],[189,0,38]];function zRt(t,e=!1,i=Float32Array){let n;if(Number.isFinite(t[0]))n=new i(t);else{n=new i(4*t.length);let e=0;for(let i=0;i<t.length;i++){const r=t[i];n[e++]=r[0],n[e++]=r[1],n[e++]=r[2],n[e++]=Number.isFinite(r[3])?r[3]:255}}if(e)for(let t=0;t<n.length;t++)n[t]/=255;return n}const FRt=[0,0,0,0],VRt=[0,255,0,255],URt=["minColor","maxColor","colorRange","colorDomain"],GRt={cellSizePixels:{value:100,min:1},cellMarginPixels:{value:2,min:0,max:5},colorDomain:null,colorRange:BRt};class jRt extends kbt{constructor(...t){super(...t),cat(this,"state",void 0)}static isSupported(t){return Tpt(t,[xpt])}getShaders(){return{vs:"#define SHADER_NAME screen-grid-layer-vertex-shader\n#define RANGE_COUNT 6\n\nattribute vec3 positions;\nattribute vec3 instancePositions;\nattribute vec4 instanceCounts;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform vec3 cellScale;\nuniform vec4 minColor;\nuniform vec4 maxColor;\nuniform vec4 colorRange[RANGE_COUNT];\nuniform vec2 colorDomain;\nuniform bool shouldUseMinMax;\nuniform sampler2D maxTexture;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {\n vec4 outColor = vec4(0., 0., 0., 0.);\n if (value >= domain.x && value <= domain.y) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n outColor = outColor / 255.;\n return outColor;\n}\n\nvoid main(void) {\n vSampleCount = instanceCounts.a;\n\n float weight = instanceCounts.r;\n float maxWeight = texture2D(maxTexture, vec2(0.5)).r;\n\n float step = weight / maxWeight;\n vec4 minMaxColor = mix(minColor, maxColor, step) / 255.;\n\n vec2 domain = colorDomain;\n float domainMaxValid = float(colorDomain.y != 0.);\n domain.y = mix(maxWeight, colorDomain.y, domainMaxValid);\n vec4 rangeColor = quantizeScale(domain, colorRange, weight);\n\n float rangeMinMax = float(shouldUseMinMax);\n vec4 color = mix(rangeColor, minMaxColor, rangeMinMax);\n vColor = vec4(color.rgb, color.a * opacity);\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = vec4(instancePositions + positions * cellScale, 1.);\n}\n",fs:"#define SHADER_NAME screen-grid-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvoid main(void) {\n if (vSampleCount <= 0.0) {\n discard;\n }\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[Qvt]}}initializeState(){const{gl:t}=this.context;this.getAttributeManager().addInstanced({instancePositions:{size:3,update:this.calculateInstancePositions},instanceCounts:{size:4,noAlloc:!0}}),this.setState({model:this._getModel(t)})}shouldUpdateState({changeFlags:t}){return t.somethingChanged}updateState(t){super.updateState(t);const{oldProps:e,props:i,changeFlags:n}=t,r=this.getAttributeManager();i.numInstances!==e.numInstances?r.invalidateAll():e.cellSizePixels!==i.cellSizePixels&&r.invalidate("instancePositions"),this._updateUniforms(e,i,n)}draw({uniforms:t}){const{parameters:e,maxTexture:i}=this.props,n=this.props.minColor||FRt,r=this.props.maxColor||VRt,o=this.props.colorDomain||[1,0],{model:s}=this.state;s.setUniforms(t).setUniforms({minColor:n,maxColor:r,maxTexture:i,colorDomain:o}).draw({parameters:{depthTest:!1,depthMask:!1,...e}})}calculateInstancePositions(t,{numInstances:e}){const{width:i,height:n}=this.context.viewport,{cellSizePixels:r}=this.props,o=Math.ceil(i/r),{value:s,size:a}=t;for(let t=0;t<e;t++){const e=t%o,l=Math.floor(t/o);s[t*a+0]=e*r/i*2-1,s[t*a+1]=1-l*r/n*2,s[t*a+2]=0}}_getModel(t){return new kgt(t,{...this.getShaders(),id:this.props.id,geometry:new Wgt({drawMode:6,attributes:{positions:new Float32Array([0,0,0,1,0,0,1,1,0,0,1,0])}}),isInstanced:!0})}_shouldUseMinMax(){const{minColor:t,maxColor:e,colorDomain:i,colorRange:n}=this.props;return t||e?(dut.deprecated("ScreenGridLayer props: minColor and maxColor","colorRange, colorDomain")(),!0):!i&&!n}_updateUniforms(t,e,i){const{model:n}=this.state;if(URt.some((i=>t[i]!==e[i]))&&n.setUniforms({shouldUseMinMax:this._shouldUseMinMax()}),t.colorRange!==e.colorRange&&n.setUniforms({colorRange:zRt(e.colorRange)}),t.cellMarginPixels!==e.cellMarginPixels||t.cellSizePixels!==e.cellSizePixels||i.viewportChanged){const{width:t,height:e}=this.context.viewport,{cellSizePixels:i,cellMarginPixels:r}=this.props,o=i>r?r:0,s=new Float32Array([(i-o)/t*2,-(i-o)/e*2,1]);n.setUniforms({cellScale:s})}}}function HRt(t,e){const i={};for(const n in t)e.includes(n)||(i[n]=t[n]);return i}cat(jRt,"layerName","ScreenGridCellLayer"),cat(jRt,"defaultProps",GRt);class WRt extends Nbt{constructor(...t){super(...t),cat(this,"state",void 0)}initializeAggregationLayer(t){super.initializeState(this.context),this.setState({ignoreProps:HRt(this.constructor._propTypes,t.data.props),dimensions:t})}updateState(t){super.updateState(t);const{changeFlags:e}=t;if(e.extensionsChanged){const t=this.getShaders({});t&&t.defines&&(t.defines.NON_INSTANCED_MODEL=1),this.updateShaders(t)}this._updateAttributes()}updateAttributes(t){this.setState({changedAttributes:t})}getAttributes(){return this.getAttributeManager().getShaderAttributes()}getModuleSettings(){const{viewport:t,mousePosition:e,gl:i}=this.context;return Object.assign(Object.create(this.props),{viewport:t,mousePosition:e,pickingActive:0,devicePixelRatio:hht(i)})}updateShaders(t){}isAggregationDirty(t,e={}){const{props:i,oldProps:n,changeFlags:r}=t,{compareAll:o=!1,dimension:s}=e,{ignoreProps:a}=this.state,{props:l,accessors:c=[]}=s,{updateTriggersChanged:u}=r;if(r.dataChanged)return!0;if(u){if(u.all)return!0;for(const t of c)if(u[t])return!0}if(o)return!!r.extensionsChanged||abt({oldProps:n,newProps:i,ignoreProps:a,propTypes:this.constructor._propTypes});for(const t of l)if(i[t]!==n[t])return!0;return!1}isAttributeChanged(t){const{changedAttributes:e}=this.state;return t?e&&void 0!==e[t]:!function(t){let e=!0;for(const i in t){e=!1;break}return e}(e)}_getAttributeManager(){return new $xt(this.context.gl,{id:this.props.id,stats:this.context.stats})}}function qRt(t,e,i){const n=i;return n.domain=()=>t,n.range=()=>e,n}function XRt(t,e){return qRt(t,e,(i=>function(t,e,i){const n=t[1]-t[0];if(n<=0)return dut.warn("quantizeScale: invalid domain, returning range[0]")(),e[0];const r=n/e.length,o=Math.floor((i-t[0])/r),s=Math.max(Math.min(o,e.length-1),0);return e[s]}(t,e,i)))}function ZRt(t,e){return qRt(t,e,(i=>function(t,e,i){return(i-t[0])/(t[1]-t[0])*(e[1]-e[0])+e[0]}(t,e,i)))}function YRt(t,e){const i=t.sort(QRt);let n=0;const r=Math.max(1,e.length),o=new Array(r-1);for(;++n<r;)o[n-1]=JRt(i,n/r);const s=t=>function(t,e,i){return e[function(t,e){let i=0,n=t.length;for(;i<n;){const r=i+n>>>1;QRt(t[r],e)>0?n=r:i=r+1}return i}(t,i)]}(o,e,t);return s.thresholds=()=>o,qRt(t,e,s)}function QRt(t,e){return t-e}function JRt(t,e){const i=t.length;if(e<=0||i<2)return t[0];if(e>=1)return t[i-1];const n=(i-1)*e,r=Math.floor(n),o=t[r];return o+(t[r+1]-o)*(n-r)}function KRt(t,e){const i=new Map,n=[];for(const e of t){const t="".concat(e);i.has(t)||i.set(t,n.push(e))}return qRt(t,e,(t=>function(t,e,i,n){const r="".concat(n);let o=e.get(r);return void 0===o&&(o=t.push(n),e.set(r,o)),i[(o-1)%i.length]}(n,i,e,t)))}function $Rt(t){return null!=t}function tOt(t,e){return("function"==typeof e?t.map(e):t).filter($Rt)}function eOt(t,e){return function(t){const e=[];return t.forEach((t=>{!e.includes(t)&&$Rt(t)&&e.push(t)})),e}(tOt(t,e))}cat(WRt,"layerName","AggregationLayer");const iOt=t=>t.length,nOt=t=>t.points,rOt=t=>t.index,oOt=(t,e)=>t<e?-1:t>e?1:t>=e?0:NaN,sOt={getValue:iOt,getPoints:nOt,getIndex:rOt,filterData:null};class aOt{constructor(t=[],e=sOt){cat(this,"maxCount",void 0),cat(this,"maxValue",void 0),cat(this,"minValue",void 0),cat(this,"totalCount",void 0),cat(this,"aggregatedBins",void 0),cat(this,"sortedBins",void 0),cat(this,"binMap",void 0),this.aggregatedBins=this.getAggregatedBins(t,e),this._updateMinMaxValues(),this.binMap=this.getBinMap()}getAggregatedBins(t,e){const{getValue:i=iOt,getPoints:n=nOt,getIndex:r=rOt,filterData:o}=e,s="function"==typeof o,a=t.length,l=[];let c=0;for(let e=0;e<a;e++){const a=t[e],u=n(a),h=r(a),p=s?u.filter(o):u;a.filteredPoints=s?p:null;const d=p.length?i(p):null;null!=d&&(l[c]={i:Number.isFinite(h)?h:e,value:d,counts:p.length},c++)}return l}_percentileToIndex(t){const e=this.sortedBins.length;if(e<2)return[0,0];const[i,n]=t.map((t=>function(t,e,i){return Math.max(e,Math.min(i,t))}(t,0,100)));return[Math.ceil(i/100*(e-1)),Math.floor(n/100*(e-1))]}getBinMap(){const t={};for(const e of this.aggregatedBins)t[e.i]=e;return t}_updateMinMaxValues(){let t=0,e=0,i=3402823466e29,n=0;for(const r of this.aggregatedBins)t=t>r.counts?t:r.counts,e=e>r.value?e:r.value,i=i<r.value?i:r.value,n+=r.counts;this.maxCount=t,this.maxValue=e,this.minValue=i,this.totalCount=n}getValueRange(t){if(this.sortedBins||(this.sortedBins=this.aggregatedBins.sort(((t,e)=>oOt(t.value,e.value)))),!this.sortedBins.length)return[];let e=0,i=this.sortedBins.length-1;if(Array.isArray(t)){const n=this._percentileToIndex(t);e=n[0],i=n[1]}return[this.sortedBins[e].value,this.sortedBins[i].value]}getValueDomainByScale(t,[e=0,i=100]=[]){if(this.sortedBins||(this.sortedBins=this.aggregatedBins.sort(((t,e)=>oOt(t.value,e.value)))),!this.sortedBins.length)return[];const n=this._percentileToIndex([e,i]);return this._getScaleDomain(t,n)}_getScaleDomain(t,[e,i]){const n=this.sortedBins;switch(t){case"quantize":case"linear":default:return[n[e].value,n[i].value];case"quantile":return tOt(n.slice(e,i+1),(t=>t.value));case"ordinal":return eOt(n,(t=>t.value))}}}const lOt=6378e3;function cOt(t){return Number.isFinite(t)?t:0}function uOt(t,e){const i=t<0?-1:1;let n=i<0?Math.abs(t)+e:Math.abs(t);return n=Math.floor(n/e)*e,n*i}function hOt(t,e,i=!0){if(!i)return{xOffset:e,yOffset:e};const{yMin:n,yMax:r}=t;return function(t,e){const i=(s=t,s/lOt*(180/Math.PI)),n=(r=e,o=t,o/lOt*(180/Math.PI)/Math.cos(r*Math.PI/180));var r,o;var s;return{yOffset:i,xOffset:n}}(e,(n+r)/2)}function pOt(t,e,i,n){const r=hOt(t,e,n!==xut.CARTESIAN),o=function(t,e,i,n){const{width:r,height:o}=n,s=i===xut.CARTESIAN?[-r/2,-o/2]:[-180,-90];dut.assert(i===xut.CARTESIAN||i===xut.LNGLAT||i===xut.DEFAULT);const{xMin:a,yMin:l}=t;return[-1*(uOt(a-s[0],e.xOffset)+s[0]),-1*(uOt(l-s[1],e.yOffset)+s[1])]}(t,r,n,i),{xMin:s,yMin:a,xMax:l,yMax:c}=t,u=l-s+r.xOffset,h=c-a+r.yOffset;return{gridOffset:r,translation:o,width:u,height:h,numCol:Math.ceil(u/r.xOffset),numRow:Math.ceil(h/r.yOffset)}}function dOt(t,e){const i=function(t,e){const{data:i=[],cellSize:n}=t,{attributes:r,viewport:o,projectPoints:s,numInstances:a}=e,l=r.positions.value,{size:c}=r.positions.getAccessor(),u=e.boundingBox||function(t,e){const i=t.value,{size:n}=t.getAccessor();let r,o,s=1/0,a=-1/0,l=1/0,c=-1/0;for(let t=0;t<e;t++)o=i[t*n],r=i[t*n+1],Number.isFinite(o)&&Number.isFinite(r)&&(s=r<s?r:s,a=r>a?r:a,l=o<l?o:l,c=o>c?o:c);return{xMin:l,xMax:c,yMin:s,yMax:a}}(r.positions,a),h=e.posOffset||[180,90],p=e.gridOffset||hOt(u,n);if(p.xOffset<=0||p.yOffset<=0)return{gridHash:{},gridOffset:p};const{width:d,height:f}=o,m=Math.ceil(d/p.xOffset),g=Math.ceil(f/p.yOffset),y={},{iterable:v,objectInfo:_}=Nxt(i),x=new Array(3);for(const t of v){_.index++,x[0]=l[_.index*c],x[1]=l[_.index*c+1],x[2]=c>=3?l[_.index*c+2]:0;const[e,i]=s?o.project(x):x;if(Number.isFinite(e)&&Number.isFinite(i)){const n=Math.floor((i+h[1])/p.yOffset),r=Math.floor((e+h[0])/p.xOffset);if(!s||r>=0&&r<m&&n>=0&&n<g){const e="".concat(n,"-").concat(r);y[e]=y[e]||{count:0,points:[],lonIdx:r,latIdx:n},y[e].count+=1,y[e].points.push({source:t,index:_.index})}}}return{gridHash:y,gridOffset:p,offsets:[-1*h[0],-1*h[1]]}}(t,e),n=function({gridHash:t,gridOffset:e,offsets:i}){const n=new Array(Object.keys(t).length);let r=0;for(const o in t){const s=o.split("-"),a=parseInt(s[0],10),l=parseInt(s[1],10),c=r++;n[c]={index:c,position:[i[0]+e.xOffset*l,i[1]+e.yOffset*a],...t[o]}}return n}(i);return{gridHash:i.gridHash,gridOffset:i.gridOffset,data:n}}class fOt extends WRt{constructor(...t){super(...t),cat(this,"state",void 0)}initializeAggregationLayer({dimensions:t}){const{gl:e}=this.context;super.initializeAggregationLayer(t),this.setState({layerData:{},gpuGridAggregator:new NRt(e,{id:"".concat(this.id,"-gpu-aggregator")}),cpuGridAggregator:dOt})}updateState(t){super.updateState(t),this.updateAggregationState(t);const{aggregationDataDirty:e,aggregationWeightsDirty:i,gpuAggregation:n}=this.state;if(this.getNumInstances()<=0)return;let r=!1;(e||n&&i)&&(this._updateAggregation(t),r=!0),n||!e&&!i||(this._updateWeightBins(),this._uploadAggregationResults(),r=!0),this.setState({aggregationDirty:r})}finalizeState(t){var e;const{count:i}=this.state.weights;i&&i.aggregationBuffer&&i.aggregationBuffer.delete(),null===(e=this.state.gpuGridAggregator)||void 0===e||e.delete(),super.finalizeState(t)}updateShaders(t){this.state.gpuAggregation&&this.state.gpuGridAggregator.updateShaders(t)}updateAggregationState(t){dut.assert(!1)}allocateResources(t,e){if(this.state.numRow!==t||this.state.numCol!==e){const i=e*t*4*4,n=this.context.gl,{weights:r}=this.state;for(const t in r){const e=r[t];e.aggregationBuffer&&e.aggregationBuffer.delete(),e.aggregationBuffer=new Xht(n,{byteLength:i,accessor:{size:4,type:5126,divisor:1}})}}}updateResults({aggregationData:t,maxMinData:e,maxData:i,minData:n}){const{count:r}=this.state.weights;r&&(r.aggregationData=t,r.maxMinData=e,r.maxData=i,r.minData=n)}_updateAggregation(t){const{cpuGridAggregator:e,gpuGridAggregator:i,gridOffset:n,posOffset:r,translation:o=[0,0],scaling:s=[0,0,0],boundingBox:a,projectPoints:l,gpuAggregation:c,numCol:u,numRow:h}=this.state,{props:p}=t,{viewport:d}=this.context,f=this.getAttributes(),m=this.getNumInstances();if(c){const{weights:t}=this.state;i.run({weights:t,cellSize:[n.xOffset,n.yOffset],numCol:u,numRow:h,translation:o,scaling:s,vertexCount:m,projectPoints:l,attributes:f,moduleSettings:this.getModuleSettings()})}else{const t=e(p,{gridOffset:n,projectPoints:l,attributes:f,viewport:d,posOffset:r,boundingBox:a});this.setState({layerData:t})}}_updateWeightBins(){const{getValue:t}=this.state,e=new aOt(this.state.layerData.data||[],{getValue:t});this.setState({sortedBins:e})}_uploadAggregationResults(){const{numCol:t,numRow:e}=this.state,{data:i}=this.state.layerData,{aggregatedBins:n,minValue:r,maxValue:o,totalCount:s}=this.state.sortedBins,a=new Float32Array(t*e*4).fill(0);for(const e of n){const{lonIdx:n,latIdx:r}=i[e.i],{value:o,counts:s}=e,l=4*(n+r*t);a[l]=o,a[l+4-1]=s}const l=new Float32Array([o,0,0,r]),c=new Float32Array([o,0,0,s]),u=new Float32Array([r,0,0,s]);this.updateResults({aggregationData:a,maxMinData:l,maxData:c,minData:u})}}cat(fOt,"layerName","GridAggregationLayer");const mOt={...jRt.defaultProps,getPosition:{type:"accessor",value:t=>t.position},getWeight:{type:"accessor",value:1},gpuAggregation:!0,aggregation:"SUM"},gOt="positions",yOt={data:{props:["cellSizePixels"]},weights:{props:["aggregation"],accessors:["getWeight"]}};class vOt extends fOt{constructor(...t){super(...t),cat(this,"state",void 0)}initializeState(){const{gl:t}=this.context;if(!jRt.isSupported(t))return this.setState({supported:!1}),void dut.error("ScreenGridLayer: ".concat(this.id," is not supported on this browser"))();super.initializeAggregationLayer({dimensions:yOt,getCellSize:t=>t.cellSizePixels});const e={count:{size:1,operation:pRt.SUM,needMax:!0,maxTexture:LRt(t,{id:"".concat(this.id,"-max-texture")})}};this.setState({supported:!0,projectPoints:!0,weights:e,subLayerData:{attributes:{}},maxTexture:e.count.maxTexture,positionAttributeName:"positions",posOffset:[0,0],translation:[1,-1]});this.getAttributeManager().add({[gOt]:{size:3,accessor:"getPosition",type:5130,fp64:this.use64bitPositions()},count:{size:3,accessor:"getWeight"}})}shouldUpdateState({changeFlags:t}){return this.state.supported&&t.somethingChanged}updateState(t){super.updateState(t)}renderLayers(){if(!this.state.supported)return[];const{maxTexture:t,numRow:e,numCol:i,weights:n}=this.state,{updateTriggers:r}=this.props,{aggregationBuffer:o}=n.count;return new(this.getSubLayerClass("cells",jRt))(this.props,this.getSubLayerProps({id:"cell-layer",updateTriggers:r}),{data:{attributes:{instanceCounts:o}},maxTexture:t,numInstances:e*i})}finalizeState(t){super.finalizeState(t);const{aggregationBuffer:e,maxBuffer:i,maxTexture:n}=this.state;null==e||e.delete(),null==i||i.delete(),null==n||n.delete()}getPickingInfo({info:t}){const{index:e}=t;if(e>=0){const{gpuGridAggregator:i,gpuAggregation:n,weights:r}=this.state,o=n?i.getData("count"):r.count;t.object=NRt.getAggregationData({pixelIndex:e,...o})}return t}updateResults({aggregationData:t,maxData:e}){const{count:i}=this.state.weights;i.aggregationData=t,i.aggregationBuffer.setData({data:t}),i.maxData=e,i.maxTexture.setImageData({data:e})}updateAggregationState(t){const e=t.props.cellSizePixels,i=t.oldProps.cellSizePixels!==e,{viewportChanged:n}=t.changeFlags;let r=t.props.gpuAggregation;this.state.gpuAggregation!==t.props.gpuAggregation&&r&&!NRt.isSupported(this.context.gl)&&(dut.warn("GPU Grid Aggregation not supported, falling back to CPU")(),r=!1);const o=r!==this.state.gpuAggregation;this.setState({gpuAggregation:r});const s=this.isAttributeChanged(gOt),{dimensions:a}=this.state,{data:l,weights:c}=a,u=s||o||n||this.isAggregationDirty(t,{compareAll:r,dimension:l}),h=this.isAggregationDirty(t,{dimension:c});this.setState({aggregationDataDirty:u,aggregationWeightsDirty:h});const{viewport:p}=this.context;if(n||i){const{width:t,height:i}=p,n=Math.ceil(t/e),r=Math.ceil(i/e);this.allocateResources(r,n),this.setState({scaling:[t/2,-i/2,1],gridOffset:{xOffset:e,yOffset:e},width:t,height:i,numCol:n,numRow:r})}h&&this._updateAccessors(t),(u||h)&&this._resetResults()}_updateAccessors(t){const{getWeight:e,aggregation:i,data:n}=t.props,{count:r}=this.state.weights;r&&(r.getWeight=e,r.operation=pRt[i]),this.setState({getValue:gRt(i,e,{data:n})})}_resetResults(){const{count:t}=this.state.weights;t&&(t.aggregationData=null)}}function _Ot(){}cat(vOt,"layerName","ScreenGridLayer"),cat(vOt,"defaultProps",mOt);const xOt=["getBins","getDomain","getScaleFunc"],bOt=[{key:"fillColor",accessor:"getFillColor",pickingInfo:"colorValue",getBins:{triggers:{value:{prop:"getColorValue",updateTrigger:"getColorValue"},weight:{prop:"getColorWeight",updateTrigger:"getColorWeight"},aggregation:{prop:"colorAggregation"},filterData:{prop:"_filterData",updateTrigger:"_filterData"}}},getDomain:{triggers:{lowerPercentile:{prop:"lowerPercentile"},upperPercentile:{prop:"upperPercentile"},scaleType:{prop:"colorScaleType"}}},getScaleFunc:{triggers:{domain:{prop:"colorDomain"},range:{prop:"colorRange"}},onSet:{props:"onSetColorDomain"}},nullValue:[0,0,0,0]},{key:"elevation",accessor:"getElevation",pickingInfo:"elevationValue",getBins:{triggers:{value:{prop:"getElevationValue",updateTrigger:"getElevationValue"},weight:{prop:"getElevationWeight",updateTrigger:"getElevationWeight"},aggregation:{prop:"elevationAggregation"},filterData:{prop:"_filterData",updateTrigger:"_filterData"}}},getDomain:{triggers:{lowerPercentile:{prop:"elevationLowerPercentile"},upperPercentile:{prop:"elevationUpperPercentile"},scaleType:{prop:"elevationScaleType"}}},getScaleFunc:{triggers:{domain:{prop:"elevationDomain"},range:{prop:"elevationRange"}},onSet:{props:"onSetElevationDomain"}},nullValue:-1}],wOt=t=>t.cellSize;class AOt{constructor(t){this.state={layerData:{},dimensions:{}},this.changeFlags={},this.dimensionUpdaters={},this._getCellSize=t.getCellSize||wOt,this._getAggregator=t.getAggregator,this._addDimension(t.dimensions||bOt)}static defaultDimensions(){return bOt}updateState(t,e){const{oldProps:i,props:n,changeFlags:r}=t;this.updateGetValueFuncs(i,n,r);const o=this.needsReProjectPoints(i,n,r);let s=!1;if(r.dataChanged||o)this.getAggregatedData(n,e),s=!0;else{(this.getDimensionChanges(i,n,r)||[]).forEach((t=>"function"==typeof t&&t())),s=!0}return this.setState({aggregationDirty:s}),this.state}setState(t){this.state={...this.state,...t}}setDimensionState(t,e){this.setState({dimensions:{...this.state.dimensions,[t]:{...this.state.dimensions[t],...e}}})}normalizeResult(t={}){return t.hexagons?{data:t.hexagons,...t}:t.layerData?{data:t.layerData,...t}:t}getAggregatedData(t,e){const i=this._getAggregator(t)(t,e);this.setState({layerData:this.normalizeResult(i)}),this.changeFlags={layerData:!0},this.getSortedBins(t)}updateGetValueFuncs(t,e,i){for(const n in this.dimensionUpdaters){const{value:r,weight:o,aggregation:s}=this.dimensionUpdaters[n].getBins.triggers;let a=e[r.prop];this.needUpdateDimensionStep(this.dimensionUpdaters[n].getBins,t,e,i)&&(a=a?yRt(a,{data:e.data}):gRt(e[s.prop],e[o.prop],{data:e.data})),a&&this.setDimensionState(n,{getValue:a})}}needsReProjectPoints(t,e,i){return this._getCellSize(t)!==this._getCellSize(e)||this._getAggregator(t)!==this._getAggregator(e)||i.updateTriggersChanged&&(i.updateTriggersChanged.all||i.updateTriggersChanged.getPosition)}addDimension(t){this._addDimension(t)}_addDimension(t=[]){t.forEach((t=>{const{key:e}=t;this.dimensionUpdaters[e]=this.getDimensionUpdaters(t),this.state.dimensions[e]={getValue:null,domain:null,sortedBins:null,scaleFunc:_Ot}}))}getDimensionUpdaters({key:t,accessor:e,pickingInfo:i,getBins:n,getDomain:r,getScaleFunc:o,nullValue:s}){return{key:t,accessor:e,pickingInfo:i,getBins:{updater:this.getDimensionSortedBins,...n},getDomain:{updater:this.getDimensionValueDomain,...r},getScaleFunc:{updater:this.getDimensionScale,...o},attributeAccessor:this.getSubLayerDimensionAttribute(t,s)}}needUpdateDimensionStep(t,e,i,n){return Object.values(t.triggers).some((t=>t.updateTrigger?n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged[t.updateTrigger]):e[t.prop]!==i[t.prop]))}getDimensionChanges(t,e,i){const n=[];for(const r in this.dimensionUpdaters){const o=xOt.find((n=>this.needUpdateDimensionStep(this.dimensionUpdaters[r][n],t,e,i)));o&&n.push(this.dimensionUpdaters[r][o].updater.bind(this,e,this.dimensionUpdaters[r]))}return n.length?n:null}getUpdateTriggers(t){const e=t.updateTriggers||{},i={};for(const n in this.dimensionUpdaters){const{accessor:r}=this.dimensionUpdaters[n];i[r]={},xOt.forEach((o=>{Object.values(this.dimensionUpdaters[n][o].triggers).forEach((({prop:n,updateTrigger:o})=>{if(o){const t=e[o];"object"!=typeof t||Array.isArray(t)?void 0!==t&&(i[r][n]=t):Object.assign(i[r],t)}else i[r][n]=t[n]}))}))}return i}getSortedBins(t){for(const e in this.dimensionUpdaters)this.getDimensionSortedBins(t,this.dimensionUpdaters[e])}getDimensionSortedBins(t,e){const{key:i}=e,{getValue:n}=this.state.dimensions[i],r=new aOt(this.state.layerData.data||[],{getValue:n,filterData:t._filterData});this.setDimensionState(i,{sortedBins:r}),this.getDimensionValueDomain(t,e)}getDimensionValueDomain(t,e){const{getDomain:i,key:n}=e,{triggers:{lowerPercentile:r,upperPercentile:o,scaleType:s}}=i,a=this.state.dimensions[n].sortedBins.getValueDomainByScale(t[s.prop],[t[r.prop],t[o.prop]]);this.setDimensionState(n,{valueDomain:a}),this.getDimensionScale(t,e)}getDimensionScale(t,e){const{key:i,getScaleFunc:n,getDomain:r}=e,{domain:o,range:s}=n.triggers,{scaleType:a}=r.triggers,{onSet:l}=n,c=t[s.prop],u=t[o.prop]||this.state.dimensions[i].valueDomain,h=function(t){switch(t){case"quantize":default:return XRt;case"linear":return ZRt;case"quantile":return YRt;case"ordinal":return KRt}}(a&&t[a.prop]),p=h(u,c);"object"==typeof l&&"function"==typeof t[l.props]&&t[l.props](p.domain()),this.setDimensionState(i,{scaleFunc:p})}getSubLayerDimensionAttribute(t,e){return i=>{const{sortedBins:n,scaleFunc:r}=this.state.dimensions[t],o=n.binMap[i.index];if(o&&0===o.counts)return e;const s=o&&o.value,a=r.domain();return s>=a[0]&&s<=a[a.length-1]?r(s):e}}getSubLayerAccessors(t){const e={};for(const i in this.dimensionUpdaters){const{accessor:n}=this.dimensionUpdaters[i];e[n]=this.getSubLayerDimensionAttribute(t,i)}return e}getPickingInfo({info:t}){let e=null;if(t.picked&&t.index>-1){const i=this.state.layerData.data[t.index],n={};for(const t in this.dimensionUpdaters){const{pickingInfo:e}=this.dimensionUpdaters[t],{sortedBins:r}=this.state.dimensions[t],o=r.binMap[i.index]&&r.binMap[i.index].value;n[e]=o}e=Object.assign(n,i,{points:i.filteredPoints||i.points})}return t.picked=Boolean(e),t.object=e,t}getAccessor(t){return this.dimensionUpdaters.hasOwnProperty(t)?this.dimensionUpdaters[t].attributeAccessor:_Ot}}function EOt(){}const SOt={colorDomain:null,colorRange:BRt,getColorValue:{type:"accessor",value:null},getColorWeight:{type:"accessor",value:1},colorAggregation:"SUM",lowerPercentile:{type:"number",min:0,max:100,value:0},upperPercentile:{type:"number",min:0,max:100,value:100},colorScaleType:"quantize",onSetColorDomain:EOt,elevationDomain:null,elevationRange:[0,1e3],getElevationValue:{type:"accessor",value:null},getElevationWeight:{type:"accessor",value:1},elevationAggregation:"SUM",elevationLowerPercentile:{type:"number",min:0,max:100,value:0},elevationUpperPercentile:{type:"number",min:0,max:100,value:100},elevationScale:{type:"number",min:0,value:1},elevationScaleType:"linear",onSetElevationDomain:EOt,gridAggregator:dOt,cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:t=>t.position},extruded:!1,material:!0,_filterData:{type:"function",value:null,optional:!0}};class MOt extends WRt{initializeState(){const t=new AOt({getAggregator:t=>t.gridAggregator,getCellSize:t=>t.cellSize});this.state={cpuAggregator:t,aggregatorState:t.state};this.getAttributeManager().add({positions:{size:3,type:5130,accessor:"getPosition"}})}updateState(t){super.updateState(t),this.setState({aggregatorState:this.state.cpuAggregator.updateState(t,{viewport:this.context.viewport,attributes:this.getAttributes(),numInstances:this.getNumInstances()})})}getPickingInfo({info:t}){return this.state.cpuAggregator.getPickingInfo({info:t})}_onGetSublayerColor(t){return this.state.cpuAggregator.getAccessor("fillColor")(t)}_onGetSublayerElevation(t){return this.state.cpuAggregator.getAccessor("elevation")(t)}_getSublayerUpdateTriggers(){return this.state.cpuAggregator.getUpdateTriggers(this.props)}renderLayers(){const{elevationScale:t,extruded:e,cellSize:i,coverage:n,material:r,transitions:o}=this.props,{cpuAggregator:s}=this.state,a=this.getSubLayerClass("grid-cell",ewt),l=this._getSublayerUpdateTriggers();return new a({cellSize:i,coverage:n,material:r,elevationScale:t,extruded:e,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:o&&{getFillColor:o.getColorValue||o.getColorWeight,getElevation:o.getElevationValue||o.getElevationWeight}},this.getSubLayerProps({id:"grid-cell",updateTriggers:l}),{data:s.state.layerData.data})}}cat(MOt,"layerName","CPUGridLayer"),cat(MOt,"defaultProps",SOt);const TOt={colorDomain:null,colorRange:BRt,elevationDomain:null,elevationRange:[0,1e3],elevationScale:{type:"number",min:0,value:1},gridSize:{type:"array",value:[1,1]},gridOrigin:{type:"array",value:[0,0]},gridOffset:{type:"array",value:[0,0]},cellSize:{type:"number",min:0,max:1e3,value:1e3},offset:{type:"array",value:[1,1]},coverage:{type:"number",min:0,max:1,value:1},extruded:!0,material:!0};class IOt extends kbt{getShaders(){return super.getShaders({vs:"#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-vertex-shader\n#define RANGE_COUNT 6\n\nin vec3 positions;\nin vec3 normals;\n\nin vec4 colors;\nin vec4 elevations;\nin vec3 instancePickingColors;\nuniform vec2 offset;\nuniform bool extruded;\nuniform float cellSize;\nuniform float coverage;\nuniform float opacity;\nuniform float elevationScale;\n\nuniform ivec2 gridSize;\nuniform vec2 gridOrigin;\nuniform vec2 gridOriginLow;\nuniform vec2 gridOffset;\nuniform vec2 gridOffsetLow;\nuniform vec4 colorRange[RANGE_COUNT];\nuniform vec2 elevationRange;\nuniform vec2 colorDomain;\nuniform bool colorDomainValid;\nuniform vec2 elevationDomain;\nuniform bool elevationDomainValid;\n\nlayout(std140) uniform;\nuniform ColorData\n{\n vec4 maxMinCount;\n} colorData;\nuniform ElevationData\n{\n vec4 maxMinCount;\n} elevationData;\n\n#define EPSILON 0.00001\nout vec4 vColor;\n\nvec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {\n vec4 outColor = vec4(0., 0., 0., 0.);\n if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n return outColor;\n}\n\nfloat linearScale(vec2 domain, vec2 range, float value) {\n if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n return ((value - domain.x) / (domain.y - domain.x)) * (range.y - range.x) + range.x;\n }\n return -1.;\n}\n\nvoid main(void) {\n vec2 clrDomain = colorDomainValid ? colorDomain : vec2(colorData.maxMinCount.a, colorData.maxMinCount.r);\n vec4 color = quantizeScale(clrDomain, colorRange, colors.r);\n\n float elevation = 0.0;\n\n if (extruded) {\n vec2 elvDomain = elevationDomainValid ? elevationDomain : vec2(elevationData.maxMinCount.a, elevationData.maxMinCount.r);\n elevation = linearScale(elvDomain, elevationRange, elevations.r);\n elevation = elevation * (positions.z + 1.0) / 2.0 * elevationScale;\n }\n float shouldRender = float(color.r > 0.0 && elevations.r >= 0.0);\n float dotRadius = cellSize / 2. * coverage * shouldRender;\n\n int yIndex = (gl_InstanceID / gridSize[0]);\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 instancePositionXFP64 = mul_fp64(vec2(gridOffset[0], gridOffsetLow[0]), vec2(float(xIndex), 0.));\n instancePositionXFP64 = sum_fp64(instancePositionXFP64, vec2(gridOrigin[0], gridOriginLow[0]));\n vec2 instancePositionYFP64 = mul_fp64(vec2(gridOffset[1], gridOffsetLow[1]), vec2(float(yIndex), 0.));\n instancePositionYFP64 = sum_fp64(instancePositionYFP64, vec2(gridOrigin[1], gridOriginLow[1]));\n\n vec3 centroidPosition = vec3(instancePositionXFP64[0], instancePositionYFP64[0], elevation);\n vec3 centroidPosition64Low = vec3(instancePositionXFP64[1], instancePositionYFP64[1], 0.0);\n geometry.worldPosition = centroidPosition;\n vec3 pos = vec3(project_size(positions.xy + offset) * dotRadius, 0.);\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);\n\n vec3 normals_commonspace = project_normal(normals);\n\n if (extruded) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, normals_commonspace);\n vColor = vec4(lightColor, color.a * opacity) / 255.;\n } else {\n vColor = vec4(color.rgb, color.a * opacity) / 255.;\n }\n}\n",fs:"#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n fragColor = vColor;\n fragColor = picking_filterColor(fragColor);\n}\n",modules:[Yvt,Sgt,Qvt,Oft]})}initializeState({gl:t}){this.getAttributeManager().addInstanced({colors:{size:4,noAlloc:!0},elevations:{size:4,noAlloc:!0}});const e=this._getModel(t);this._setupUniformBuffer(e),this.setState({model:e})}_getModel(t){return new kgt(t,{...this.getShaders(),id:this.props.id,geometry:new Jgt,isInstanced:!0})}draw({uniforms:t}){const{cellSize:e,offset:i,extruded:n,elevationScale:r,coverage:o,gridSize:s,gridOrigin:a,gridOffset:l,elevationRange:c,colorMaxMinBuffer:u,elevationMaxMinBuffer:h}=this.props,p=[mvt(a[0]),mvt(a[1])],d=[mvt(l[0]),mvt(l[1])],f=this.getDomainUniforms(),m=zRt(this.props.colorRange);this.bindUniformBuffers(u,h),this.state.model.setUniforms(t).setUniforms(f).setUniforms({cellSize:e,offset:i,extruded:n,elevationScale:r,coverage:o,gridSize:s,gridOrigin:a,gridOriginLow:p,gridOffset:l,gridOffsetLow:d,colorRange:m,elevationRange:c}).draw(),this.unbindUniformBuffers(u,h)}bindUniformBuffers(t,e){t.bind({target:35345,index:0}),e.bind({target:35345,index:1})}unbindUniformBuffers(t,e){t.unbind({target:35345,index:0}),e.unbind({target:35345,index:1})}getDomainUniforms(){const{colorDomain:t,elevationDomain:e}=this.props,i={};return null!==t?(i.colorDomainValid=!0,i.colorDomain=t):i.colorDomainValid=!1,null!==e?(i.elevationDomainValid=!0,i.elevationDomain=e):i.elevationDomainValid=!1,i}_setupUniformBuffer(t){const e=this.context.gl,i=t.program.handle,n=e.getUniformBlockIndex(i,"ColorData"),r=e.getUniformBlockIndex(i,"ElevationData");e.uniformBlockBinding(i,n,0),e.uniformBlockBinding(i,r,1)}}cat(IOt,"layerName","GPUGridCellLayer"),cat(IOt,"defaultProps",TOt);const COt={colorDomain:null,colorRange:BRt,getColorWeight:{type:"accessor",value:1},colorAggregation:"SUM",elevationDomain:null,elevationRange:[0,1e3],getElevationWeight:{type:"accessor",value:1},elevationAggregation:"SUM",elevationScale:{type:"number",min:0,value:1},cellSize:{type:"number",min:1,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:t=>t.position},extruded:!1,material:!0},POt={data:{props:["cellSize","colorAggregation","elevationAggregation"]}},LOt="positions";class DOt extends fOt{initializeState({gl:t}){const e=NRt.isSupported(t);e||dut.error("GPUGridLayer is not supported on this browser, use GridLayer instead")(),super.initializeAggregationLayer({dimensions:POt}),this.setState({gpuAggregation:!0,projectPoints:!1,isSupported:e,weights:{color:{needMin:!0,needMax:!0,combineMaxMin:!0,maxMinBuffer:new Xht(t,{byteLength:16,accessor:{size:4,type:5126,divisor:1}})},elevation:{needMin:!0,needMax:!0,combineMaxMin:!0,maxMinBuffer:new Xht(t,{byteLength:16,accessor:{size:4,type:5126,divisor:1}})}},positionAttributeName:"positions"});this.getAttributeManager().add({[LOt]:{size:3,accessor:"getPosition",type:5130,fp64:this.use64bitPositions()},color:{size:3,accessor:"getColorWeight"},elevation:{size:3,accessor:"getElevationWeight"}})}updateState(t){if(!1===this.state.isSupported)return;super.updateState(t);const{aggregationDirty:e}=this.state;e&&this.setState({gridHash:null})}getHashKeyForIndex(t){const{numRow:e,numCol:i,boundingBox:n,gridOffset:r}=this.state,o=[i,e],s=[n.xMin,n.yMin],a=[r.xOffset,r.yOffset],l=Math.floor(t/o[0]),c=t-l*o[0],u=Math.floor((l*a[1]+s[1]+90+a[1]/2)/a[1]),h=Math.floor((c*a[0]+s[0]+180+a[0]/2)/a[0]);return"".concat(u,"-").concat(h)}getPositionForIndex(t){const{numRow:e,numCol:i,boundingBox:n,gridOffset:r}=this.state,o=[i,e],s=[n.xMin,n.yMin],a=[r.xOffset,r.yOffset],l=Math.floor(t/o[0]);return[(t-l*o[0])*a[0]+s[0],l*a[1]+s[1]]}getPickingInfo({info:t,mode:e}){const{index:i}=t;let n=null;if(i>=0){const{gpuGridAggregator:t}=this.state,r=this.getPositionForIndex(i),o=NRt.getAggregationData({pixelIndex:i,...t.getData("color")}),s=NRt.getAggregationData({pixelIndex:i,...t.getData("elevation")});if(n={colorValue:o.cellWeight,elevationValue:s.cellWeight,count:o.cellCount||s.cellCount,position:r,totalCount:o.totalCount||s.totalCount},"hover"!==e){const{props:t}=this;let{gridHash:e}=this.state;if(!e){const{gridOffset:i,translation:n,boundingBox:r}=this.state,{viewport:o}=this.context;e=dOt(t,{gridOffset:i,attributes:this.getAttributes(),viewport:o,translation:n,boundingBox:r}).gridHash,this.setState({gridHash:e})}const r=e[this.getHashKeyForIndex(i)];Object.assign(n,r)}}return t.picked=Boolean(n),t.object=n,t}renderLayers(){if(!this.state.isSupported)return null;const{elevationScale:t,extruded:e,cellSize:i,coverage:n,material:r,elevationRange:o,colorDomain:s,elevationDomain:a}=this.props,{weights:l,numRow:c,numCol:u,gridOrigin:h,gridOffset:p}=this.state,{color:d,elevation:f}=l,m=zRt(this.props.colorRange);return new(this.getSubLayerClass("gpu-grid-cell",IOt))({gridSize:[u,c],gridOrigin:h,gridOffset:[p.xOffset,p.yOffset],colorRange:m,elevationRange:o,colorDomain:s,elevationDomain:a,cellSize:i,coverage:n,material:r,elevationScale:t,extruded:e},this.getSubLayerProps({id:"gpu-grid-cell"}),{data:{attributes:{colors:d.aggregationBuffer,elevations:f.aggregationBuffer}},colorMaxMinBuffer:d.maxMinBuffer,elevationMaxMinBuffer:f.maxMinBuffer,numInstances:u*c})}finalizeState(t){const{color:e,elevation:i}=this.state.weights;[e,i].forEach((t=>{const{aggregationBuffer:e,maxMinBuffer:i}=t;i.delete(),null==e||e.delete()})),super.finalizeState(t)}updateAggregationState(t){const{props:e,oldProps:i}=t,{cellSize:n,coordinateSystem:r}=e,{viewport:o}=this.context,s=i.cellSize!==n,{dimensions:a}=this.state,l=this.isAttributeChanged(LOt),c=l||this.isAttributeChanged();let{boundingBox:u}=this.state;if(l&&(u=function(t,e){const i=t.positions.value;let n,r,o=1/0,s=-1/0,a=1/0,l=-1/0;for(let t=0;t<e;t++)r=i[3*t],n=i[3*t+1],o=n<o?n:o,s=n>s?n:s,a=r<a?r:a,l=r>l?r:l;return{xMin:cOt(a),xMax:cOt(l),yMin:cOt(o),yMax:cOt(s)}}(this.getAttributes(),this.getNumInstances()),this.setState({boundingBox:u})),l||s){const{gridOffset:t,translation:e,width:i,height:s,numCol:a,numRow:l}=pOt(u,n,o,r);this.allocateResources(l,a),this.setState({gridOffset:t,translation:e,gridOrigin:[-1*e[0],-1*e[1]],width:i,height:s,numCol:a,numRow:l})}const h=c||this.isAggregationDirty(t,{dimension:a.data,compareAll:!0});h&&this._updateAccessors(t),this.setState({aggregationDataDirty:h})}_updateAccessors(t){const{colorAggregation:e,elevationAggregation:i}=t.props,{color:n,elevation:r}=this.state.weights;n.operation=pRt[e],r.operation=pRt[i]}}cat(DOt,"layerName","GPUGridLayer"),cat(DOt,"defaultProps",COt);const ROt={...DOt.defaultProps,...MOt.defaultProps,gpuAggregation:!1};class OOt extends Nbt{constructor(...t){super(...t),cat(this,"state",void 0)}initializeState(){this.state={useGPUAggregation:!0}}updateState({props:t}){this.setState({useGPUAggregation:this.canUseGPUAggregation(t)})}renderLayers(){const{data:t,updateTriggers:e}=this.props,i=this.state.useGPUAggregation?"GPU":"CPU";return new(this.state.useGPUAggregation?this.getSubLayerClass("GPU",DOt):this.getSubLayerClass("CPU",MOt))(this.props,this.getSubLayerProps({id:i,updateTriggers:e}),{data:t})}canUseGPUAggregation(t){const{gpuAggregation:e,lowerPercentile:i,upperPercentile:n,getColorValue:r,getElevationValue:o,colorScaleType:s}=t;return!!e&&(!!NRt.isSupported(this.context.gl)&&(0===i&&100===n&&(null===r&&null===o&&("quantile"!==s&&"ordinal"!==s))))}}cat(OOt,"layerName","GridLayer"),cat(OOt,"defaultProps",ROt);const kOt=new Float32Array(12);function NOt(t,e=2){let i=0;for(const n of t)for(let t=0;t<e;t++)kOt[i++]=n[t]||0;return kOt}class BOt extends kbt{getShaders(){return{vs:"#define SHADER_NAME heatp-map-layer-vertex-shader\n\nuniform sampler2D maxTexture;\nuniform float intensity;\nuniform vec2 colorDomain;\nuniform float threshold;\nuniform float aggregationMode;\n\nattribute vec3 positions;\nattribute vec2 texCoords;\n\nvarying vec2 vTexCoords;\nvarying float vIntensityMin;\nvarying float vIntensityMax;\n\nvoid main(void) {\n gl_Position = project_position_to_clipspace(positions, vec3(0.0), vec3(0.0));\n vTexCoords = texCoords;\n vec4 maxTexture = texture2D(maxTexture, vec2(0.5));\n float maxValue = aggregationMode < 0.5 ? maxTexture.r : maxTexture.g;\n float minValue = maxValue * threshold;\n if (colorDomain[1] > 0.) {\n maxValue = colorDomain[1];\n minValue = colorDomain[0];\n }\n vIntensityMax = intensity / maxValue;\n vIntensityMin = intensity / minValue;\n}\n",fs:"#define SHADER_NAME triangle-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D texture;\nuniform sampler2D colorTexture;\nuniform float aggregationMode;\n\nvarying vec2 vTexCoords;\nvarying float vIntensityMin;\nvarying float vIntensityMax;\n\nvec4 getLinearColor(float value) {\n float factor = clamp(value * vIntensityMax, 0., 1.);\n vec4 color = texture2D(colorTexture, vec2(factor, 0.5));\n color.a *= min(value * vIntensityMin, 1.0);\n return color;\n}\n\nvoid main(void) {\n vec4 weights = texture2D(texture, vTexCoords);\n float weight = weights.r;\n\n if (aggregationMode > 0.5) {\n weight /= max(1.0, weights.a);\n }\n if (weight <= 0.) {\n discard;\n }\n\n vec4 linearColor = getLinearColor(weight);\n linearColor.a *= opacity;\n gl_FragColor =linearColor;\n}\n",modules:[Yvt]}}initializeState({gl:t}){this.getAttributeManager().add({positions:{size:3,noAlloc:!0},texCoords:{size:2,noAlloc:!0}}),this.setState({model:this._getModel(t)})}_getModel(t){const{vertexCount:e}=this.props;return new kgt(t,{...this.getShaders(),id:this.props.id,geometry:new Wgt({drawMode:6,vertexCount:e})})}draw({uniforms:t}){const{model:e}=this.state,{texture:i,maxTexture:n,colorTexture:r,intensity:o,threshold:s,aggregationMode:a,colorDomain:l}=this.props;e.setUniforms({...t,texture:i,maxTexture:n,colorTexture:r,intensity:o,threshold:s,aggregationMode:a,colorDomain:l}).draw()}}cat(BOt,"layerName","TriangleLayer");const zOt={mipmaps:!1,parameters:{10240:9729,10241:9729,10242:33071,10243:33071},dataFormat:6408},FOt=[0,0],VOt={SUM:0,MEAN:1},UOt={getPosition:{type:"accessor",value:t=>t.position},getWeight:{type:"accessor",value:1},intensity:{type:"number",min:0,value:1},radiusPixels:{type:"number",min:1,max:100,value:50},colorRange:BRt,threshold:{type:"number",min:0,max:1,value:.05},colorDomain:{type:"array",value:null,optional:!0},aggregation:"SUM",weightsTextureSize:{type:"number",min:128,max:2048,value:2048},debounceTimeout:{type:"number",min:0,max:1e3,value:500}},GOt=[vpt,xpt],jOt=[bpt,_pt],HOt={data:{props:["radiusPixels"]}};class WOt extends WRt{constructor(...t){super(...t),cat(this,"state",void 0)}initializeState(){const{gl:t}=this.context;if(!Tpt(t,GOt))return this.setState({supported:!1}),void dut.error("HeatmapLayer: ".concat(this.id," is not supported on this browser"))();super.initializeAggregationLayer(HOt),this.setState({supported:!0,colorDomain:FOt}),this._setupTextureParams(),this._setupAttributes(),this._setupResources()}shouldUpdateState({changeFlags:t}){return t.somethingChanged}updateState(t){this.state.supported&&(super.updateState(t),this._updateHeatmapState(t))}_updateHeatmapState(t){const{props:e,oldProps:i}=t,n=this._getChangeFlags(t);(n.dataChanged||n.viewportChanged)&&(n.boundsChanged=this._updateBounds(n.dataChanged),this._updateTextureRenderingBounds()),n.dataChanged||n.boundsChanged?(clearTimeout(this.state.updateTimer),this.setState({isWeightMapDirty:!0})):n.viewportZoomChanged&&this._debouncedUpdateWeightmap(),e.colorRange!==i.colorRange&&this._updateColorTexture(t),this.state.isWeightMapDirty&&this._updateWeightmap(),this.setState({zoom:t.context.viewport.zoom})}renderLayers(){if(!this.state.supported)return[];const{weightsTexture:t,triPositionBuffer:e,triTexCoordBuffer:i,maxWeightsTexture:n,colorTexture:r,colorDomain:o}=this.state,{updateTriggers:s,intensity:a,threshold:l,aggregation:c}=this.props;return new(this.getSubLayerClass("triangle",BOt))(this.getSubLayerProps({id:"triangle-layer",updateTriggers:s}),{coordinateSystem:xut.DEFAULT,data:{attributes:{positions:e,texCoords:i}},vertexCount:4,maxTexture:n,colorTexture:r,aggregationMode:VOt[c]||0,texture:t,intensity:a,threshold:l,colorDomain:o})}finalizeState(t){super.finalizeState(t);const{weightsTransform:e,weightsTexture:i,maxWeightTransform:n,maxWeightsTexture:r,triPositionBuffer:o,triTexCoordBuffer:s,colorTexture:a,updateTimer:l}=this.state;null==e||e.delete(),null==i||i.delete(),null==n||n.delete(),null==r||r.delete(),null==o||o.delete(),null==s||s.delete(),null==a||a.delete(),l&&clearTimeout(l)}_getAttributeManager(){return new $xt(this.context.gl,{id:this.props.id,stats:this.context.stats})}_getChangeFlags(t){const e={},{dimensions:i}=this.state;e.dataChanged=this.isAttributeChanged()||this.isAggregationDirty(t,{compareAll:!0,dimension:i.data}),e.viewportChanged=t.changeFlags.viewportChanged;const{zoom:n}=this.state;return t.context.viewport&&t.context.viewport.zoom===n||(e.viewportZoomChanged=!0),e}_createTextures(){const{gl:t}=this.context,{textureSize:e,format:i,type:n}=this.state;this.setState({weightsTexture:new tpt(t,{width:e,height:e,format:i,type:n,...zOt}),maxWeightsTexture:new tpt(t,{format:i,type:n,...zOt})})}_setupAttributes(){this.getAttributeManager().add({positions:{size:3,type:5130,accessor:"getPosition"},weights:{size:1,accessor:"getWeight"}}),this.setState({positionAttributeName:"positions"})}_setupTextureParams(){const{gl:t}=this.context,{weightsTextureSize:e}=this.props,i=Math.min(e,cht(t,3379)),n=Tpt(t,jOt),{format:r,type:o}=function({gl:t,floatTargetSupport:e}){return e?{format:Iut(t)?34836:6408,type:5126}:{format:6408,type:5121}}({gl:t,floatTargetSupport:n}),s=n?1:1/255;this.setState({textureSize:i,format:r,type:o,weightsScale:s}),n||dut.warn("HeatmapLayer: ".concat(this.id," rendering to float texture not supported, fallingback to low precession format"))()}getShaders(t){return super.getShaders("max-weights-transform"===t?{vs:"attribute vec4 inTexture;\nvarying vec4 outTexture;\n\nvoid main()\n{\noutTexture = inTexture;\ngl_Position = vec4(0, 0, 0, 1.);\ngl_PointSize = 1.0;\n}\n",_fs:"varying vec4 outTexture;\nvoid main() {\n gl_FragColor = outTexture;\n gl_FragColor.g = outTexture.r / max(1.0, outTexture.a);\n}\n"}:{vs:"attribute vec3 positions;\nattribute vec3 positions64Low;\nattribute float weights;\nvarying vec4 weightsTexture;\nuniform float radiusPixels;\nuniform float textureWidth;\nuniform vec4 commonBounds;\nuniform float weightsScale;\nvoid main()\n{\n weightsTexture = vec4(weights * weightsScale, 0., 0., 1.);\n\n float radiusTexels = project_pixel_size(radiusPixels) * textureWidth / (commonBounds.z - commonBounds.x);\n gl_PointSize = radiusTexels * 2.;\n\n vec3 commonPosition = project_position(positions, positions64Low);\n gl_Position.xy = (commonPosition.xy - commonBounds.xy) / (commonBounds.zw - commonBounds.xy) ;\n gl_Position.xy = (gl_Position.xy * 2.) - (1.);\n}\n",_fs:"varying vec4 weightsTexture;\nfloat gaussianKDE(float u){\n return pow(2.71828, -u*u/0.05555)/(1.77245385*0.166666);\n}\nvoid main()\n{\n float dist = length(gl_PointCoord - vec2(0.5, 0.5));\n if (dist > 0.5) {\n discard;\n }\n gl_FragColor = weightsTexture * gaussianKDE(2. * dist);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}_createWeightsTransform(t={}){var e;const{gl:i}=this.context;let{weightsTransform:n}=this.state;const{weightsTexture:r}=this.state;null===(e=n)||void 0===e||e.delete(),n=new jgt(i,{id:"".concat(this.id,"-weights-transform"),elementCount:1,_targetTexture:r,_targetTextureVarying:"weightsTexture",...t}),this.setState({weightsTransform:n})}_setupResources(){const{gl:t}=this.context;this._createTextures();const{textureSize:e,weightsTexture:i,maxWeightsTexture:n}=this.state,r=this.getShaders("weights-transform");this._createWeightsTransform(r);const o=this.getShaders("max-weights-transform"),s=new jgt(t,{id:"".concat(this.id,"-max-weights-transform"),_sourceTextures:{inTexture:i},_targetTexture:n,_targetTextureVarying:"outTexture",...o,elementCount:e*e});this.setState({weightsTexture:i,maxWeightsTexture:n,maxWeightTransform:s,zoom:null,triPositionBuffer:new Xht(t,{byteLength:48,accessor:{size:3}}),triTexCoordBuffer:new Xht(t,{byteLength:48,accessor:{size:2}})})}updateShaders(t){this._createWeightsTransform(t)}_updateMaxWeightValue(){const{maxWeightTransform:t}=this.state;t.run({parameters:{blend:!0,depthTest:!1,blendFunc:[1,1],blendEquation:32776}})}_updateBounds(t=!1){const{viewport:e}=this.context,i=[e.unproject([0,0]),e.unproject([e.width,0]),e.unproject([e.width,e.height]),e.unproject([0,e.height])].map((t=>t.map(Math.fround))),n=function(t){const e=t.map((t=>t[0])),i=t.map((t=>t[1])),n=Math.min.apply(null,e),r=Math.max.apply(null,e);return[n,Math.min.apply(null,i),r,Math.max.apply(null,i)]}(i),r={visibleWorldBounds:n,viewportCorners:i};let o=!1;if(t||!this.state.worldBounds||(s=this.state.worldBounds,!((a=n)[0]>=s[0]&&a[2]<=s[2]&&a[1]>=s[1]&&a[3]<=s[3]))){const t=this._worldToCommonBounds(n),e=this._commonToWorldBounds(t);this.props.coordinateSystem===xut.LNGLAT&&(e[1]=Math.max(e[1],-85.051129),e[3]=Math.min(e[3],85.051129),e[0]=Math.max(e[0],-360),e[2]=Math.min(e[2],360));const i=this._worldToCommonBounds(e);r.worldBounds=e,r.normalizedCommonBounds=i,o=!0}var s,a;return this.setState(r),o}_updateTextureRenderingBounds(){const{triPositionBuffer:t,triTexCoordBuffer:e,normalizedCommonBounds:i,viewportCorners:n}=this.state,{viewport:r}=this.context;t.subData(NOt(n,3));const o=n.map((t=>function(t,e){const[i,n,r,o]=e;return[(t[0]-i)/(r-i),(t[1]-n)/(o-n)]}(r.projectPosition(t),i)));e.subData(NOt(o,2))}_updateColorTexture(t){const{colorRange:e}=t.props;let{colorTexture:i}=this.state;const n=zRt(e,!1,Uint8Array);i?i.setImageData({data:n,width:e.length}):i=new tpt(this.context.gl,{data:n,width:e.length,height:1,...zOt}),this.setState({colorTexture:i})}_updateWeightmap(){const{radiusPixels:t,colorDomain:e,aggregation:i}=this.props,{weightsTransform:n,worldBounds:r,textureSize:o,weightsTexture:s,weightsScale:a}=this.state;this.state.isWeightMapDirty=!1;const l=this._worldToCommonBounds(r,{useLayerCoordinateSystem:!0});if(e&&"SUM"===i){const{viewport:t}=this.context,i=t.distanceScales.metersPerUnit[2]*(l[2]-l[0])/o;this.state.colorDomain=e.map((t=>t*i*a))}else this.state.colorDomain=e||FOt;const c={radiusPixels:t,commonBounds:l,textureWidth:o,weightsScale:a};n.update({elementCount:this.getNumInstances()}),uht(this.context.gl,{clearColor:[0,0,0,0]},(()=>{n.run({uniforms:c,parameters:{blend:!0,depthTest:!1,blendFunc:[1,1],blendEquation:32774},clearRenderTarget:!0,attributes:this.getAttributes(),moduleSettings:this.getModuleSettings()})})),this._updateMaxWeightValue(),s.setParameters({10240:9729,10241:9729})}_debouncedUpdateWeightmap(t=!1){let{updateTimer:e}=this.state;const{debounceTimeout:i}=this.props;t?(e=null,this._updateBounds(!0),this._updateTextureRenderingBounds(),this.setState({isWeightMapDirty:!0})):(this.setState({isWeightMapDirty:!1}),clearTimeout(e),e=setTimeout(this._debouncedUpdateWeightmap.bind(this,!0),i)),this.setState({updateTimer:e})}_worldToCommonBounds(t,e={}){const{useLayerCoordinateSystem:i=!1}=e,[n,r,o,s]=t,{viewport:a}=this.context,{textureSize:l}=this.state,{coordinateSystem:c}=this.props,u=i&&(c===xut.LNGLAT_OFFSETS||c===xut.METER_OFFSETS),h=u?a.projectPosition(this.props.coordinateOrigin):[0,0],p=2*l/a.scale;let d,f;return i&&!u?(d=this.projectPosition([n,r,0]),f=this.projectPosition([o,s,0])):(d=a.projectPosition([n,r,0]),f=a.projectPosition([o,s,0])),function(t,e,i){const[n,r,o,s]=t,a=o-n,l=s-r;let c=a,u=l;a/l<e/i?c=e/i*l:u=i/e*a,c<e&&(c=e,u=i);const h=(o+n)/2,p=(s+r)/2;return[h-c/2,p-u/2,h+c/2,p+u/2]}([d[0]-h[0],d[1]-h[1],f[0]-h[0],f[1]-h[1]],p,p)}_commonToWorldBounds(t){const[e,i,n,r]=t,{viewport:o}=this.context,s=o.unprojectPosition([e,i]),a=o.unprojectPosition([n,r]);return s.slice(0,2).concat(a.slice(0,2))}}cat(WOt,"layerName","HeatmapLayer"),cat(WOt,"defaultProps",UOt);const qOt=u({click:{},mouseOut:{},mouseMove:{}});class XOt extends(m(C)){data;id;_options;option;constructor(t,e,i){super(),this.data=t,this.id=i||d(0,5),this.option=e,this._options=Object.assign({magName:"mag",colors:{0:"rgb(1, 152, 189)",1:"rgb(209, 55, 78)"},opacity:1,cellSizePixels:30,elevationScale:1,type:"columnar",event:{},pickable:!0},e),this.createMapboxLayer(this._options.type)}createHeatmapgl(){const{opacity:t,cellSizePixels:e}=this._options,i={type:WOt,opacity:t,pickable:this._options.pickable,getPosition:t=>[t[0],t[1]],getWeight:t=>t[2],radiusPixels:e,intensity:1,threshold:.03,onHover:(t,e)=>{"pointermove"==e.type?qOt.value.mouseMove[this.id]&&qOt.value.mouseMove[this.id](t,e):"pointerleave"==e.type&&qOt.value.mouseOut[this.id]&&qOt.value.mouseOut[this.id](t,e)},onClick:(t,e)=>{qOt.value.click[this.id]&&qOt.value.click[this.id](t,e)}};return this.option.colors&&(i.colorRange=this.getColorArray()),i}createHexagonLayer(){const{opacity:t,cellSizePixels:e,elevationScale:i}=this._options;return{opacity:t,type:OOt,colorRange:this.getColorArray(),colorDomain:this._options.domain,getColorValue:t=>Math.max(...t.map((t=>t[t.length-1]))),onClick:(t,e)=>{qOt.value.click[this.id]&&qOt.value.click[this.id](t,e)},coverage:1,elevationRange:[0,i],elevationScale:i,getPosition:t=>t,pickable:!0,extruded:1!==i,radius:e,cellSize:e,upperPercentile:e,material:{ambient:.64,diffuse:.6,shininess:32,specularColor:[51,51,51]},transitions:{elevationScale:i},getElevationWeight:t=>t[t.length-1],elevationAggregation:"MAX"}}createScreenGridLayer(){const{opacity:t,cellSizePixels:e}=this._options;return{type:vOt,opacity:t,getPosition:t=>t,getWeight:t=>t[2],cellSizePixels:e,colorRange:this.getColorArray()}}async _updateData(t=(t=>t)){const{data:e,_options:{magName:i}}=this;if(!e)return;const n=e.features,r=[];let o=[];n[0]&&n[0].properties&&i&&(o=[n[0].properties[i],n[0].properties[i]]);for(let t=0,e=n.length-1;t<e;t++){const{properties:e,geometry:{coordinates:s}}=n[t];i&&e&&(r.push([...s,e[i]]),e[i]<o[0]&&(o[0]=e[i]),e[i]>o[1]&&(o[1]=e[i]))}this._options.domain=o,t(r)}createMapboxLayer(t){const{id:e}=this;this._updateData((i=>{const n=this[`create${"columnar"===t?"HexagonLayer":"point"===t?"ScreenGridLayer":"Heatmapgl"}`](),r=new uRt({id:e,data:i,...this._options.event,...n});return cNt.value.addLayer(r)}))}getColorArray=()=>{const{colors:t}=this._options;let e=[];if(t){const i=Object.keys(t).sort(((t,e)=>parseFloat(t)-parseFloat(e)));e=i.map((e=>{let i=[];const n=t[e].match(/\d+/g);if(n&&(i=n.map(Number)),i.length)return i}))}return e};addEventListener=(t,e)=>{switch(t){case"click":case"mouseOut":case"mouseMove":qOt.value[t][this.id]=e}};removeEventListener=t=>{switch(t){case"click":case"mouseOut":case"mouseMove":qOt.value[t]={}}}}function ZOt(t){const e=t.id,i=document.createElement("canvas");i.id=e;let n=[104,255,0];if(t.fillStyle)if(-1!=t.fillStyle.indexOf("rgb")){let e=t.fillStyle;e=e.replace("rgb(",""),e=e.replace("rgba(",""),e=e.replace(")",""),e&&(n=e.split(","))}else r=t.fillStyle,n=[parseInt("0x"+r.slice(1,3)),parseInt("0x"+r.slice(3,5)),parseInt("0x"+r.slice(5,7))];var r;function o(){this.renderArr=[],this.rotateAngle=0,this.speed=t.speed?t.speed*Math.PI:.01*Math.PI,this.point=null}o.prototype.init=function(e){if(!e)return;this.el=e,i.style.cssText="position:absolute;top:0;left:0;z-index:1000";const n=window.devicePixelRatio||1;i.width=(t.width||400)*n,i.height=(t.height||400)*n;const r=i.width,o=i.height;this.ctx=i.getContext("2d"),this.ctx.strokeStyle=t.fillStyle||"green",this.canvas=i,this.w=r,this.h=o,this.ctx.lineWidth=2,i.style.backgroundColor="rgba(255,255,255,0)",i.style.pointerEvents="none"};const s=new o;function a(t){this.x=0,this.y=0,this.r=0,this.startAngle=0,this.endAngle=0,this.anticlockwise=!1,this.stroke=!1,this.fill=!1,this.scaleX=1,this.scaleY=1,this.init(t)}function l(t){this.x=0,this.y=0,this.startX=0,this.startY=0,this.endX=0,this.endY=0,this.thin=!1,this.init(t)}function c(t,e,i){return(e-t)/i}function u(t,e,i,r,o,s){for(let r=0;r<e;r++)t.startAngle=i+o*r,t.endAngle=t.startAngle+o,t.fillStyle=`rgba(${n[0]},${n[1]},${n[2]},${(r+1)/e})`,t.render(s)}return s.init(document.body),a.prototype.init=function(t){for(const e in t)this[e]=t[e];this.render(s.ctx)},a.prototype.render=function(t){const e=t;return e.save(),e.beginPath(),e.translate(this.x,this.y),this.fill&&e.moveTo(0,0),e.scale(this.scaleX,this.scaleY),e.arc(0,0,this.r,this.startAngle,this.endAngle),this.lineWidth&&(e.lineWidth=this.lineWidth),this.stroke&&(this.strokeStyle&&(e.strokeStyle=this.strokeStyle),e.stroke()),this.fill&&(this.fillStyle&&(e.fillStyle=this.fillStyle),e.fill()),e.restore(),this},l.prototype.init=function(t){for(const e in t)this[e]=t[e];this.render(s.ctx)},l.prototype.render=function(t){return this.ctx=t,function(t){const e=t.ctx;e.save(),e.beginPath(),e.translate(t.x,t.y),t.thin&&e.translate(.5,.5);t.lineWidth&&(e.lineWidth=t.lineWidth);"Radar"==t.materialType&&(e.strokeStyle=t.strokeStyle);e.moveTo(t.startX,t.startY),e.lineTo(t.endX,t.endY),e.stroke(),e.restore()}(this),this},o.prototype.createMap=function(){const e=this.renderArr;let i;if("Radar"==t.materialType){i=new a({x:parseInt((this.w/2).toString()),y:parseInt((this.w/2).toString()),r:parseInt((this.w/2-1).toString()),startAngle:0,endAngle:2*Math.PI,stroke:!0}),e.push(i),i=new a({x:parseInt((this.w/2).toString()),y:parseInt((this.w/2).toString()),r:parseInt((this.w/2*.68).toString()),startAngle:0,endAngle:2*Math.PI,stroke:!0}),e.push(i),i=new a({x:parseInt((this.w/2).toString()),y:parseInt((this.w/2).toString()),r:parseInt((this.w/2*.33).toString()),startAngle:0,endAngle:2*Math.PI,stroke:!0}),e.push(i),i=new a({x:parseInt((this.w/2).toString()),y:parseInt((this.w/2).toString()),r:2,startAngle:0,endAngle:2*Math.PI,stroke:!0}),e.push(i);let t=new l({x:0,y:0,startX:0,startY:parseInt((this.w/2).toString()),endX:this.w-1,endY:parseInt((this.w/2).toString()),thin:!0});e.push(t),t=new l({x:0,y:0,startX:parseInt((this.w/2).toString()),startY:0,endX:parseInt((this.w/2).toString()),endY:this.w,thin:!0}),e.push(t)}let r=30;if(this.point){const t=JSON.parse(JSON.stringify(this.point.endAngle)),e=JSON.parse(JSON.stringify(this.point.startAngle));r=parseInt(((t-e)/.05).toString());const i=c(this.point.startAngle,this.point.endAngle,r);u(this.point,r,e,t,i,this.ctx),this.point.render(this.ctx)}else{const t=new a({x:parseInt((this.w/2).toString()),y:parseInt((this.w/2).toString()),r:parseInt((this.w/2).toString()),startAngle:0,endAngle:.3*Math.PI,fill:!0,fillStyle:`rgba(${n[0]},${n[1]},${n[2]},0.6)`}),i=JSON.parse(JSON.stringify(t.endAngle)),o=JSON.parse(JSON.stringify(t.startAngle));r=parseInt(((i-o)/.04).toString());u(t,r,o,i,c(t.startAngle,t.endAngle,r),this.ctx),e.push(t),this.point=t}},o.prototype.update=function(){this.clearCanvas();const t=this.point;t&&(t.startAngle=this.rotateAngle,this.rotateAngle+=this.speed,t.endAngle=this.rotateAngle+.4*Math.PI,this.rotateAngle>=2*Math.PI&&(this.rotateAngle=0,t.startAngle=0,t.endAngle=this.speed+.4*Math.PI)),this.createMap()},o.prototype.start=function(){s.update(),window.requestAnimationFrame(s.start)},o.prototype.clearCanvas=function(){this.ctx.clearRect(0,0,parseInt(this.w),parseInt(this.h)),this.renderArr=[]},s.start(),{canvas:i,id:e}}function YOt(t){const{color:e,duration:i,speed:n}=t;let r=[104,255,0];if(e)if(-1!=e.indexOf("rgb")){let t=e;t=t.replace("rgb(",""),t=t.replace("rgba(",""),t=t.replace(")",""),t&&(r=t.split(","))}else o=e,r=[parseInt("0x"+o.slice(1,3)),parseInt("0x"+o.slice(3,5)),parseInt("0x"+o.slice(5,7))];var o;const s=`rgba(${r[0]},${r[1]},${r[2]},0)`,a=`rgba(${r[0]},${r[1]},${r[2]},0.5)`,l=`rgba(${r[0]},${r[1]},${r[2]},1)`,c=document.createElement("canvas"),u=d(0,25);c.width=document.body.clientHeight,c.height=document.body.clientHeight,c.id=u;const h=c.getContext("2d"),p=c.width,f=c.height;c.style.width=p+"px",c.style.height=f+"px",c.style.background="rgba(255,255,255,0)",c.style.pointerEvents="none";const m=30,g=p/2,y=f/2;let v=50,_=0;const x=[];function b(t){const e=h.createRadialGradient(t.x,t.y,t.r-60>0?t.r-60:t.r,t.x,t.y,t.r);t.r>g/3*2?(e.addColorStop(0,s),e.addColorStop(1,a)):(e.addColorStop(0,s),e.addColorStop(1,l)),h.beginPath(),h.arc(t.x,t.y,t.r,0,2*Math.PI),h&&(h.fillStyle=e),h.fill()}return function t(){x.length>0&&function(){h.clearRect(0,0,p,f);let t,e=0,i=x.length-1;for(;t=x[e++];)b(t),t.r>g?(e--,x[e]=x[i],delete x[i],i--):t.r+=n||.3;x.length>=e&&x.splice(e-1,x.length-(i+1)),h.closePath()}(),0==v?(v=i||300,x.push({x:g,y:y,r:m,id:(_++,_>1e6&&(_=0),_),rgbgrad:null})):v-=1,window.requestAnimationFrame(t)}(),{id:u,canvas:c}}function QOt(t,e){this.canvasList=[],this.idList=[],t.length>0&&t.forEach((t=>{const i=t.id||d(0,25),{canvas:n}=ZOt({id:i,width:e.width||cNt.value._canvas.height,height:e.height||cNt.value._canvas.height,fillStyle:e.color||"rgb(81, 217, 254)",speed:e.speed||.01,materialType:e.materialType?e.materialType:"Radar"});this.canvasList.push(n),this.idList.push(i),KOt(t,e,i,n)}))}function JOt(t,e){this.canvasList=[],this.idList=[],t.length>0&&t.forEach((t=>{const i=t.id||d(0,25),{canvas:n}=YOt({id:i,color:e.color||"rgb(81, 217, 254)",duration:e.duration||300,speed:e.speed||.3});this.canvasList.push(n),this.idList.push(i),KOt(t,e,i,n)}))}function KOt(t,e,i,n){const r=K(Up(R(t.position||[100.3541,21.5006]),e.radius||30,{units:"kilometers"}));cNt.value.addSource(i+"source",{type:"canvas",canvas:n,coordinates:[[r[0],r[3]],[r[2],r[3]],[r[2],r[1]],[r[0],r[1]]],animate:!0}),cNt.value.addLayer({id:i,type:"raster",source:i+"source",layout:{visibility:"visible"}})}QOt.prototype.destroy=function(){this.idList.length>0&&this.idList.forEach(((t,e)=>{cNt.value.removeLayer(t),cNt.value.getSource(t+"source")&&cNt.value.removeSource(t+"source"),this.canvasList[e].remove()}))},QOt.prototype.show=function(t){this.idList.length>0&&this.idList.forEach((e=>{if(cNt.value.getLayer(e)){const i=t?"visible":"none";cNt.value.setLayoutProperty(e,"visibility",i)}}))},JOt.prototype.destroy=function(){this.idList.length>0&&this.idList.forEach(((t,e)=>{cNt.value.removeLayer(t),cNt.value.getSource(t+"source")&&cNt.value.removeSource(t+"source"),this.canvasList[e].remove()}))},JOt.prototype.show=function(t){this.idList.length>0&&this.idList.forEach((e=>{if(cNt.value.getLayer(e)){const i=t?"visible":"none";cNt.value.setLayoutProperty(e,"visibility",i)}}))};class $Ot{marker;position;map;_canvasel;constructor(t){this.map=cNt.value,this.marker={},this.position=t.position,this.init(t)}init(t){let e=400,i=1e3;try{const i=this.map.getContainer().clientWidth;e="number"==typeof t.radius&&t.radius>1?i:i*(t.radius?t.radius:1)}catch(t){throw new Error(t?t.messsges:"")}t.height&&(i=t.height),this._canvasel=document.createElement("canvas");const n=function(){const t=URL.createObjectURL(new Blob),e=t.toString();return URL.revokeObjectURL(t),e.substring(e.lastIndexOf("/")+1)}();this._canvasel.id=n,this._canvasel.width=e,this._canvasel.height=i,this.position||(this._canvasel.style.width="100%",this._canvasel.style.height="100%",this._canvasel.style.position="absolute",this._canvasel.style.left="0",this._canvasel.style.top="0",this._canvasel.style.zIndex="1000"),this._canvasel.style.background="rgba(255,255,255,0)",this._canvasel.style.pointerEvents="none";((this.map?this.map.getContainer():"")||document.body).appendChild(this._canvasel),ekt(this._canvasel,t);const r=new Lm.Marker({anchor:"bottom",element:this._canvasel,scale:1});this.position&&r.setLngLat(this.position?this.position:[100.3541,21.5006]).addTo(this.map),this.marker=r}destroy(){this.marker.remove(),this._canvasel&&this._canvasel.remove()}}const tkt=new Image,ekt=(t,e)=>{const i=t.getContext("2d");t.width=t.clientWidth,t.height=t.clientHeight;const n=[],r=[],o=[0,0],s=e.emissionRate?e.emissionRate:1,a=0;window.onresize=function(){t.width=t.clientWidth,t.height=t.clientHeight};const l=e.color?e.color:"rgb(255,255,255)";function c(t){const e={speed:1*(1*Math.random()+1),die:!1,posx:t,posy:-50,h:30,color:l};r.push(e)}e.image&&(tkt.src=new URL(e.image,"undefined"==typeof document&&"undefined"==typeof location?new(require("url").URL)("file:"+__filename).href:"undefined"==typeof document?location.href:document.currentScript&&document.currentScript.src||new URL("eliMapboxgl.min.js",document.baseURI).href).href),function e(){n.length>0&&n.forEach((function(e){e.vx=e.vx+a/2,e.posx=e.posx+e.vx,e.vy=e.vy+.5,e.posy=e.posy+e.vy,e.posy>t.clientHeight&&(e.die=!0)}));for(let t=n.length-1;t>=0;t--)n[t].die&&n.splice(t,1);for(let e=0;e<s;e++)c(10*Math.random()*t.width);const l=t.clientHeight;r.forEach((function(e){Math.sqrt((e.posx+a*e.h-o[0])*(e.posx+a*e.h-o[0])+(e.posy+e.h-o[1])*(e.posy+e.h-o[1]))<20&&(e.die=!0),e.posy+e.h>l&&(e.die=!0),e.posy>=t.clientHeight?e.die=!0:(e.posy=e.posy+e.speed,e.posx=e.posx+e.speed*a)}));for(let t=r.length-1;t>=0;t--)r[t].die&&r.splice(t,1);i&&(i.lineWidth=3,i.clearRect(0,0,t.width,t.clientHeight),r.forEach((function(t){i.strokeStyle=t.color,i.beginPath(),i.moveTo(t.posx,t.posy),i.drawImage(tkt,t.posx+t.h*a,t.posy+t.h,16,16),i.stroke()}))),window.requestAnimationFrame(e)}()};var ikt=function(t,e,i){var n=-1,r=t.length;e<0&&(e=-e>r?0:r+e),(i=i>r?r:i)<0&&(i+=r),r=e>i?0:i-e>>>0,e>>>=0;for(var o=Array(r);++n<r;)o[n]=t[n+e];return o};var nkt=function(t,e){return t===e||t!=t&&e!=e},rkt="object"==typeof nt&&nt&&nt.Object===Object&&nt,okt="object"==typeof self&&self&&self.Object===Object&&self,skt=(rkt||okt||Function("return this")()).Symbol,akt=skt,lkt=Object.prototype,ckt=lkt.hasOwnProperty,ukt=lkt.toString,hkt=akt?akt.toStringTag:void 0;var pkt=function(t){var e=ckt.call(t,hkt),i=t[hkt];try{t[hkt]=void 0;var n=!0}catch(t){}var r=ukt.call(t);return n&&(e?t[hkt]=i:delete t[hkt]),r},dkt=Object.prototype.toString;var fkt=pkt,mkt=function(t){return dkt.call(t)},gkt=skt?skt.toStringTag:void 0;var ykt=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":gkt&&gkt in Object(t)?fkt(t):mkt(t)};var vkt=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},_kt=ykt,xkt=vkt;var bkt=function(t){if(!xkt(t))return!1;var e=_kt(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},wkt=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991};var Akt=/^(?:0|[1-9]\d*)$/;var Ekt=function(t,e){var i=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==i||"symbol"!=i&&Akt.test(t))&&t>-1&&t%1==0&&t<e},Skt=nkt,Mkt=function(t){return null!=t&&wkt(t.length)&&!bkt(t)},Tkt=Ekt,Ikt=vkt;var Ckt=function(t,e,i){if(!Ikt(i))return!1;var n=typeof e;return!!("number"==n?Mkt(i)&&Tkt(e,i.length):"string"==n&&e in i)&&Skt(i[e],t)},Pkt=/\s/;var Lkt=function(t){for(var e=t.length;e--&&Pkt.test(t.charAt(e)););return e},Dkt=Lkt,Rkt=/^\s+/;var Okt=ykt,kkt=function(t){return null!=t&&"object"==typeof t};var Nkt=function(t){return t?t.slice(0,Dkt(t)+1).replace(Rkt,""):t},Bkt=vkt,zkt=function(t){return"symbol"==typeof t||kkt(t)&&"[object Symbol]"==Okt(t)},Fkt=/^[-+]0x[0-9a-f]+$/i,Vkt=/^0b[01]+$/i,Ukt=/^0o[0-7]+$/i,Gkt=parseInt;var jkt=function(t){if("number"==typeof t)return t;if(zkt(t))return NaN;if(Bkt(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Bkt(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Nkt(t);var i=Vkt.test(t);return i||Ukt.test(t)?Gkt(t.slice(2),i?2:8):Fkt.test(t)?NaN:+t},Hkt=1/0;var Wkt=function(t){return t?(t=jkt(t))===Hkt||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0};var qkt=ikt,Xkt=Ckt,Zkt=function(t){var e=Wkt(t),i=e%1;return e==e?i?e-i:e:0},Ykt=Math.ceil,Qkt=Math.max;var Jkt=function(t,e,i){e=(i?Xkt(t,e,i):void 0===e)?1:Qkt(Zkt(e),0);var n=null==t?0:t.length;if(!n||e<1)return[];for(var r=0,o=0,s=Array(Ykt(n/e));r<n;)s[o++]=qkt(t,r,r+=e);return s},Kkt=rt(Jkt);class $kt extends(m(C)){id;data;_options;tb;map;constructor(t,e,i){super(),this.id=i||d(0,5),this.data=t,this.tb="",this._options=Object.assign({row:0,column:0,colors:{},speed:2e3,opacity:.5},e),this.render()}render(){cNt.value.addLayer({id:this.id,type:"custom",onAdd:(t,e)=>{const i=this._options.speed;this.map=t,this.tb=new af.Threebox(t,e,{defaultLights:!0});const n=new NDt;this.tb.add(n);const r=this.arrSplit(this.tb,this.data),o=r[0][0]?r[0][0].length-2:r[0].length-2,s=new Array(o).fill({endPointIndex:0});let a=null;r.forEach(((t,e)=>{a=this.drawLine(t),a.userdata={index:e},n.add(a)})),n.traverse((t=>{const e=t.userdata;if(e){const n=e.index,o=[],a=s.length;for(let e=0;e<a-2;e++){const a=new ff(s[e]).to({endPointIndex:60},i).onUpdate((i=>{const o=[],s=[];for(let t=0;t<r[n].length;t++){const a=r[n][t],l=.2*a[e+2],c=l+(.2*a[e+3]-l)/60*i.endPointIndex;o.push(...new iLt(a[0],a[1],c)),s.push(...this.getColorByValue(c))}t.geometry.setAttribute("position",new vDt(o,3)),t.geometry.setAttribute("color",new vDt(s,3)),t.geometry.verticesNeedUpdate=!0,t.geometry.colorsNeedUpdate=!0})).onComplete((function(){s[e].endPointIndex=0}));o.push(a)}for(let t=0;t<o.length;t++){const e=o[t],i=o[(t+1)%o.length];e.chain(i)}o[0].start()}}))},render:()=>{this.map&&this.map.triggerRepaint(),this.tb&&this.tb.update(),bf()}})}arrSplit(t,e){const i=JSON.parse(JSON.stringify(e)),n=this.dataFormat(t,i),r=Kkt(n,this._options.row);let o=[];const s=[];for(let t=0;t<this._options.row;t++)for(let e=0;e<this._options.column;e++){const i=n[this._options.row*e+t];s.push(i)}return o=Kkt(s,this._options.column),[...r,...o]}drawLine(t){const e=[],i=[],n=new MDt;t.forEach((t=>{const[n,r,o]=[t[0],t[1],0];e.push(...new iLt(n,r,o));const s=this.getColorByValue(o);i.push(...s)}));const r=new BDt({opacity:this._options.opacity,vertexColors:!0,blending:2});n.setAttribute("position",new vDt(e,3)),n.setAttribute("color",new vDt(i,3));const o=new jDt(n,r);return o.geometry.verticesNeedUpdate=!0,o.geometry.colorsNeedUpdate=!0,o}dataFormat(t,e){const i=[];return e.map((e=>{const n=[e[0],e[1]],{x:r,y:o}=t.projectToWorld(n),s=[r,o,...e.splice(2)];i.push(s)})),i}getColorByValue(t){const e=Number(t);let i=[];const{colors:n}=this._options,r=Object.keys(n).sort(((t,e)=>parseFloat(t)-parseFloat(e))),o=r.find((t=>e<Number(t)));if(o){const t=n[o].match(/\d+/g);if(t){const i=t.map(Number)||[];if(i.length&&e<Number(o))return[i[0]/255,i[1]/255,i[2]/255]}}return i}}class tNt{constructor(t){cNt.value.setFog(t)}destroy(){cNt.value.setFog()}}class eNt{timer;state=!0;start(t){this.state=!0,cNt.value.setCenter(t.position),null!=t.pitch&&cNt.value.setPitch(t.pitch),null!=t.height&&cNt.value.setZoom(this._getZoomByElevation(t.height));const e=(t.speed||30)/360;let i=cNt.value.getBearing();this.timer=setInterval((()=>{this.state&&(i+=1,i>359&&(i=0),cNt.value.rotateTo(i))}),1e3*e)}_getZoomByElevation(t){return Math.log2(2*Math.PI*6378137/(2*t*Math.tan(cNt.value.transform._fov/2)))}stop(){this.state=!1,clearInterval(this.timer),this.timer=null}destroy(){this.stop()}}const iNt=window.mapboxPlot,nNt={type:"geojson",data:{type:"FeatureCollection",features:[]}},rNt={type:"geojson",data:{type:"FeatureCollection",features:[]}};let oNt,sNt;class aNt{_option;map;plotDraw;fu;constructor(t){if(this._option=Object.assign({lineColor:"rgba(223,168,32,1)",fillColor:"rgba(223,168,32,1)",lineWidth:4},t),this.map=cNt.value,!iNt)throw Error('"window.mapboxPlot" does not exist');this.init()}init(){this.map.addSource("viewLayerTempSource",nNt),this.map.addLayer({id:"view-temp-fill-layer",type:"fill",source:"viewLayerTempSource",paint:{"fill-color":this._option.fillColor},filter:["==","$type","Polygon"]}),this.map.addLayer({id:"view-temp-line-layer",type:"line",source:"viewLayerTempSource",paint:{"line-color":this._option.lineColor,"line-width":this._option.lineWidth},filter:["==","$type","LineString"]}),this.map.addSource("viewLayerSource",rNt),this.map.addLayer({id:"view-fill-layer",type:"fill",source:"viewLayerSource",paint:{"fill-color":this._option.fillColor},filter:["==","$type","Polygon"]}),this.map.addLayer({id:"view-point-layer",type:"circle",source:"viewLayerSource",paint:{"circle-radius":50,"circle-color":"#088"},filter:["==","$type","Point"]}),this.map.addLayer({id:"view-line-layer",type:"line",source:"viewLayerSource",paint:{"line-color":this._option.lineColor,"line-width":this._option.lineWidth},filter:["==","$type","LineString"]}),this.fu=t=>{const e=this.map.queryRenderedFeatures(t.point,{layers:["view-fill-layer","view-line-layer","view-point-layer"]});e.length?sNt.activate(e[0]):sNt.deactivate()},this.map.on("click",this.fu),this.plotDraw=new iNt.PlotDraw(this.map),this.plotDraw.on(iNt.Event.PlotDrawEvent.DRAW_END,this.onDrawEnd,!1,this),this.plotDraw.on(iNt.Event.PlotDrawEvent.DRAW_MOVING,this.onDrawMove,!1,this),sNt=new iNt.PlotEdit(this.map,Dm),sNt.on(iNt.Event.PlotEditEvent.DRAG_POINT_MOVING,this.onDragPointMove,!1,this),sNt.on(iNt.Event.PlotEditEvent.DRAG_POINT_END,this.onDragPointEnd,!1,this)}onDragPointEnd(t){nNt.data.features=[],this.map.getSource("viewLayerTempSource").setData(nNt.data),rNt.data.features.push(t.feature),this.map.getSource("viewLayerSource").setData(rNt.data);const e=lNt(t.feature.properties.id);oNt&&oNt(e)}onDragPointMove(t){nNt.data.features=[],nNt.data.features.push(t.feature),this.map.getSource("viewLayerTempSource").setData(nNt.data);JSON.parse(JSON.stringify(rNt.data.features)).map(((e,i)=>{e.properties.id==t.feature.properties.id?rNt.data.features.splice(i,1):rNt.data.features.push(t.feature)})),this.map.getSource("viewLayerSource").setData(rNt.data)}activate(t,e){"function"==typeof e&&(oNt=e),this.plotDraw.activate(t)}onDrawMove(t){nNt.data.features=[],nNt.data.features.push(t.feature),this.map.getSource("viewLayerTempSource").setData(nNt.data)}onDrawEnd(t){nNt.data.features=[],this.map.getSource("viewLayerTempSource").setData(nNt.data),rNt.data.features.push(t.feature),this.map.getSource("viewLayerSource").setData(rNt.data);const e=lNt(t.feature.properties.id);oNt&&oNt(e),setTimeout((()=>{const e=this.map.querySourceFeatures("viewLayerSource"),i=[];e.forEach((e=>{e&&e.properties.id==t.feature.properties.id&&i.push(e)})),i.length&&sNt.activate(i[i.length-1])}),100)}geojson(t,e){this.removePoint(),"function"==typeof e&&(oNt=e),this._createFeature(t)}_createFeature(t){t.features&&t.features.length>0&&(t.features.forEach((t=>{rNt.data.features.push(t)})),this.map.getSource("viewLayerSource").setData(rNt.data))}remove(t){if(t){JSON.parse(JSON.stringify(rNt.data.features)).forEach(((e,i)=>{e.properties.id==t&&rNt.data.features.splice(i,1)}))}else rNt.data.features=[];this.map.getSource("viewLayerSource").setData(rNt.data),nNt.data.features=[],this.map.getSource("viewLayerTempSource").setData(nNt.data),this.removePoint()}removePoint(){sNt.controlPoints&&sNt.controlPoints.length&&sNt.controlPoints.forEach((t=>{t.remove()}))}destroy(){this.removePoint(),this.map.off("click",this.fu),this.map.getLayer("view-temp-fill-layer")&&this.map.removeLayer("view-temp-fill-layer"),this.map.getLayer("view-temp-line-layer")&&this.map.removeLayer("view-temp-line-layer"),this.map.getLayer("view-fill-layer")&&this.map.removeLayer("view-fill-layer"),this.map.getLayer("view-point-layer")&&this.map.removeLayer("view-point-layer"),this.map.getLayer("view-line-layer")&&this.map.removeLayer("view-line-layer")}}function lNt(t){let e={};rNt.data.features=Array.from(new Set(rNt.data.features.map((t=>JSON.stringify(t))))).map((t=>JSON.parse(t)));return JSON.parse(JSON.stringify(rNt.data.features)).map((i=>{i.properties.id==t&&(e=i)})),e}const cNt=u(null),uNt=u("EPSG:3857"),hNt=u(!0);Rf(".mapboxgl-map{-webkit-tap-highlight-color:rgb(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;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:rgb(0 0 0/5%)}.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' fill='%23000' 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='%23000' 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' fill='%23000' 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='%23000' 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 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%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 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%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' fill='%23000' viewBox='0 0 29 29'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%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 id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%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 viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%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 id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%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 viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%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 id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%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 viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%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 id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%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 viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%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 id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%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 viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%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 id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%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 viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%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 id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%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 viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%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 id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%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 viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%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 id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%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 viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%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 id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%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 viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%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 id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%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 viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%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 id='dot' cx='10' cy='10' r='2' display='none'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%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 viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23000'%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 id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%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 viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%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 id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%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='logo' 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 013.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='text' 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 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.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 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.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 01-.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='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='0.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='0.9' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%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='logo' 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 013.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='text' 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 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.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 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.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 01-.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='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23fff'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%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='logo' 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 013.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='text' 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 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.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 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.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 01-.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='clip'%3E%3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/mask%3E%3Cg id='outline' opacity='1' stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E%3C/g%3E%3Cg id='fill' opacity='1' fill='%23000'%3E%3Cuse xlink:href='%23logo'/%3E%3Cuse xlink:href='%23text'/%3E%3C/g%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 viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%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:rgb(0 0 0/5%)}.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 viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%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 viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%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);text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;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:rgb(0 0 0/5%)}.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;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:#1da1f233;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}");Rf(".mapboxgl-popup-tip {\r\n display: none;\r\n}\r\n.mapboxgl-ctrl-logo{\r\n display: none !important;\r\n}\r\n.mapboxgl-popup-content {\r\n background: none !important;\r\n padding: 0 !important;\r\n margin: 0 !important;\r\n border-radius: 4px;\r\n}");Rf(".mapboxgl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mapboxgl-canvas{position:absolute;left:0;top:0}.mapboxgl-map:-webkit-full-screen{width:100%;height:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:grab;-webkit-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{position:absolute;pointer-events:none;z-index:2}.mapboxgl-ctrl-top-left{top:0;left:0}.mapboxgl-ctrl-top-right{top:0;right:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{right:0;bottom:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{margin:10px 0 0 10px;float:left}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{margin:10px 10px 0 0;float:right}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{margin:0 0 10px 10px;float:left}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{margin:0 10px 10px 0;float:right}.mapboxgl-ctrl-group{border-radius:4px;background:#fff}.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{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@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 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-group button:focus:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:focus:only-child{border-radius:inherit}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%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 width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%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 width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%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 width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%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 width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23000'%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 width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23000'%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 width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%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 width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%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 width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%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 width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%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 width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23000'%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 width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23000'%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 width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E %3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E %3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%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 width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E %3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E %3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%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 width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E %3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E %3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E %3C/svg%3E\")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%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 id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%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 width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%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 id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%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 width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%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 id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%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 width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%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 id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%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 width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%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 id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%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 width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%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 id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%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 width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%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 id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%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 width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%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 id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%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 width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%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 id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%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 width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%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 id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%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 width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%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 id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%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 width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%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 id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%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 width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23000'%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 id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%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 width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%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 id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E %3C/svg%3E\")}}@keyframes mapboxgl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{width:88px;height:23px;margin:0 0 -4px -4px;display:block;background-repeat:no-repeat;cursor:pointer;overflow:hidden;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E %3Cdefs%3E %3Cpath id='logo' 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 013.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='text' 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 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.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 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.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 01-.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='clip'%3E %3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E %3Cuse xlink:href='%23logo'/%3E %3Cuse xlink:href='%23text'/%3E %3C/mask%3E %3Cg id='outline' opacity='0.3' stroke='%23000' stroke-width='3'%3E %3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E %3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E %3C/g%3E %3Cg id='fill' opacity='0.9' fill='%23fff'%3E %3Cuse xlink:href='%23logo'/%3E %3Cuse xlink:href='%23text'/%3E %3C/g%3E %3C/svg%3E\")}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 width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E %3Cdefs%3E %3Cpath id='logo' 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 013.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='text' 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 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.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 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.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 01-.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='clip'%3E %3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E %3Cuse xlink:href='%23logo'/%3E %3Cuse xlink:href='%23text'/%3E %3C/mask%3E %3Cg id='outline' opacity='1' stroke='%23000' stroke-width='3'%3E %3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E %3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E %3C/g%3E %3Cg id='fill' opacity='1' fill='%23fff'%3E %3Cuse xlink:href='%23logo'/%3E %3Cuse xlink:href='%23text'/%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 width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E %3Cdefs%3E %3Cpath id='logo' 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 013.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='text' 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 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.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 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.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 01-.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='clip'%3E %3Crect x='0' y='0' width='100%25' height='100%25' fill='white'/%3E %3Cuse xlink:href='%23logo'/%3E %3Cuse xlink:href='%23text'/%3E %3C/mask%3E %3Cg id='outline' opacity='1' stroke='%23fff' stroke-width='3' fill='%23fff'%3E %3Ccircle mask='url(%23clip)' cx='11.5' cy='11.5' r='9.25'/%3E %3Cuse xlink:href='%23text' mask='url(%23clip)'/%3E %3C/g%3E %3Cg id='fill' opacity='1' fill='%23000'%3E %3Cuse xlink:href='%23logo'/%3E %3Cuse xlink:href='%23text'/%3E %3C/g%3E %3C/svg%3E\")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{padding:0 5px;background-color:hsla(0,0%,100%,.5);margin:0}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{min-height:20px;padding:2px 24px 2px 0;margin:10px;position:relative;background-color:#fff;border-radius:12px}.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{padding:2px 8px 2px 28px;border-radius:12px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{display:none;cursor:pointer;position:absolute;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%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\");background-color:hsla(0,0%,100%,.5);width:24px;height:24px;box-sizing:border-box;border-radius:12px;outline:none;top:0;right:0;border:0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner,.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button{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{top:0;right:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;left: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 width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%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 width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%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);text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;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);font-size:10px;border:2px solid #333;border-top:#333;padding:0 5px;color:#333;box-sizing:border-box}.mapboxgl-popup{position:absolute;top:0;left:0;display:flex;will-change:transform;pointer-events:none}.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{width:0;height:0;border:10px solid transparent;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{align-self:center;border-top:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.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-right:none;border-left-color:#fff}.mapboxgl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.mapboxgl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.mapboxgl-popup-content{position:relative;background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:10px 10px 15px;pointer-events:auto}.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;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{position:absolute;top:0;left:0;will-change:transform;opacity:1;transition:opacity .2s}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.mapboxgl-user-location-dot:before{content:\"\";position:absolute;animation:mapboxgl-user-location-dot-pulse 2s infinite}.mapboxgl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:\"\";height:19px;left:-2px;position:absolute;top:-2px;width:19px;box-sizing:border-box;box-shadow:0 0 3px rgba(0,0,0,.35)}@keyframes mapboxgl-user-location-dot-pulse{0%{transform:scale(1);opacity:1}70%{transform:scale(3);opacity:0}to{transform:scale(1);opacity:0}}.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);width:1px;height:1px;border-radius:100%}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{position:absolute;top:0;left:0;width:0;height:0;background:#fff;border:2px dotted #202020;opacity:.5}@media print{.mapbox-improve-map{display:none}}");class pNt extends xA.Map{constructor(t){super(t),this._popups=[]}_showingGlobe(){return!1}_addPopup(t){this._popups.push(t)}_removePopup(t){const e=this._popups.indexOf(t);-1!==e&&this._popups.splice(e,1)}}const dNt={version:8,name:"eliMapboxGLMap",glyphs:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf",sources:{},layers:[]};function fNt(t){let e;if(e=t.style?"string"==typeof t.style?t.style:Object.assign({},dNt,t.style):dNt,uNt.value=t.crs?t.crs:"EPSG:3857",null==t.isIntegerZoom?hNt.value=!0:hNt.value=t.isIntegerZoom,"EPSG:3857"==uNt.value||-1!=uNt.value.indexOf("3857")){if(t.token)Dm.accessToken=t.token;else{Dm.accessToken=null;class t extends Dm.Map{__proto__}t.prototype.__proto__._authenticate=function(){return!0}}const i=Object.assign({},t);delete i.id,delete i.crs,delete i.token,delete i.style,delete i.projection,delete i.transformRequest,delete i.dragRotate,cNt.value=new Dm.Map({container:t.id,dragRotate:!t.dragRotate&&0!=t.dragRotate||t.dragRotate,projection:t.projection,style:e,transformRequest:t.transformRequest,...i}),cNt.value.mapboxgl=Dm,cNt.value.on("load",(()=>{cNt.value.setFog({"horizon-blend":.3,color:"white","high-color":"#add8e6","space-color":"#d8f2ff","star-intensity":0})}))}else cNt.value=function(t,e){if(t.token)xA.accessToken=t.token;else{xA.accessToken=null;class t extends xA.Map{__proto__}t.prototype.__proto__._authenticate=function(){return!0}}const i=Object.assign({},t);delete i.id,delete i.crs,delete i.token,delete i.style,delete i.projection,delete i.transformRequest,delete i.dragRotate;const n=new pNt({container:t.id,dragRotate:!t.dragRotate&&0!=t.dragRotate||t.dragRotate,projection:t.projection,style:e,transformRequest:t.transformRequest,...i});return n.mapboxgl=xA,n}(t,e);return hNt.value&&(cNt.value.scrollZoom.setZoomRate(1),cNt.value.scrollZoom.setWheelZoomRate(1)),cNt.value}!function(t,e,i){"object"==typeof module&&"object"==typeof module.exports?module.exports=i(t,!0,e):i(t,!1,e)}(window||globalThis,class{mapboxGLMap;constructor(t){this.mapboxGLMap=fNt(t)}specialDraw(t){return function(t){const e=new aNt(t);return{straightArrow:t=>{e.activate(iNt.PlotTypes.STRAIGHT_ARROW,t)},arc:t=>{e.activate(iNt.PlotTypes.ARC,t)},curve:t=>{e.activate(iNt.PlotTypes.CURVE,t)},ellipse:t=>{e.activate(iNt.PlotTypes.ELLIPSE,t)},lune:t=>{e.activate(iNt.PlotTypes.LUNE,t)},sector:t=>{e.activate(iNt.PlotTypes.SECTOR,t)},closedCurve:t=>{e.activate(iNt.PlotTypes.CLOSED_CURVE,t)},gatheringPlace:t=>{e.activate(iNt.PlotTypes.GATHERING_PLACE,t)},doubleArrow:t=>{e.activate(iNt.PlotTypes.DOUBLE_ARROW,t)},fineArrow:t=>{e.activate(iNt.PlotTypes.FINE_ARROW,t)},assaultDirection:t=>{e.activate(iNt.PlotTypes.ASSAULT_DIRECTION,t)},attackArrow:t=>{e.activate(iNt.PlotTypes.ATTACK_ARROW,t)},squadCombat:t=>{e.activate(iNt.PlotTypes.SQUAD_COMBAT,t)},tailedSquadCombat:t=>{e.activate(iNt.PlotTypes.TAILED_SQUAD_COMBAT,t)},tailedAttackArrow:t=>{e.activate(iNt.PlotTypes.TAILED_ATTACK_ARROW,t)},remove:t=>{e.remove(t)},destroy:()=>{e.destroy()},geojson:(t,i)=>{e.geojson(t,i)}}}(t)}setMap(t){return function(t){cNt.value=t}(t)}addTDTlayer(t){return function(t){return new S(t)}(t)}addGaudLayer(t){return function(t){const e=Object.assign({tileSize:256},t);return new S(e)}(t)}addArcGisLayer(t){return function(t){return new S(t)}(t)}addEgisLayer(t){return function(t){return new S(t)}(t)}setStyle(t,e){return function(t,e){return cNt.value.setStyle(t,e)}(t,e)}addMvtLayer(t){return function(t){return new M(t)}(t)}addWMSLayer(t,e,i){return function(t,e,i){const n={url:e?`${t}?request=GetMap&${Object.keys(e).map((t=>`${t}=${e[t]}`)).join("&")}`:t,...i};return new S(n)}(t,e,i)}addWMTSLayer(t,e,i){return function(t,e,i){const n={url:`${t}?${Object.keys(e).map((t=>`${t}=${e[t]}`)).join("&")}`,...i};return new S(n)}(t,e,i)}addUrlTemplateImagery(t,e){return function(t,e){const i={url:t,...e};return new S(i)}(t,e)}createLine(t,e,i){return Ef(t,e,i)}geojson(t,e){return $p(t,e)}createCircle(t,e,i){return function(t,e,i){const n=Tf(t),r=$p(n,"multiPolygon"),o=new Mf(r,e,i),s=t.map((t=>({position:t.center,text:t.text,id:t.id,userData:t.userData})));o._addLabel(s);const a=n.map((t=>({position:t.position[0],id:t.id})));return o._addLine(a),o}(t,e,i)}getLayerBounds(t,e){return td(t,e)}createdPoint(t,e,i){return function(t,e,i){let n;return n=p(t)?$p(t,"point"):t,new id(n,e,i)}(t,e,i)}createRectangle(t,e,i){return function(t,e,i){const n=Cf(t),r=$p(n,"multiPolygon"),o=new If(r,e,i),s=n.map((t=>({position:t.center,text:t.text,id:t.id,userData:t.userData})));o._addLabel(s);const a=n.map((t=>({position:t.position[0],id:t.id})));return o._addLine(a),o}(t,e,i)}createLabel(t,e,i){return rd(t,e,i)}clusterLayer(t,e,i){return function(t,e,i){let n;n=p(t)?$p(t,"point"):t;const r={clusterRadius:40,...e,type:"assemblage",cluster:!0,iconOverlap:!0,textOverlap:!0,originData:t},o=i||d(0,5);return new Vf(n,o,r)}(t,e,i)}createPolygon(t,e,i){return Df(t,e,i)}measure(t){return function(t){return new Ff(t)}(t)}createVectorPoint(t,e,i){return function(t,e,i){let n;return n=p(t)?$p(t,"point"):t,new nd(n,e,i)}(t,e,i)}draw(t){return function(t){const e=new zg(t);return{point:(t,i)=>{e.addPoint(t,i)},line:(t,i)=>{e.addLine(t,i)},polygon:(t,i)=>{e.addPolygon(t,i)},remove:t=>{e.clear(t)},circle:(t,i)=>{e.addCircle(t,i)},rectangle:(t,i)=>{e.addRectangle(t,i)},geoJson:(t,i)=>{e.addGeoJson(t,i)},enableEdit:t=>{e.enableEdit(t)},destroy:()=>{e.destroy()},updateStyle:(t,i)=>{e.updateStyle(t,i)}}}(t)}createPopup(t,e,i){return function(t,e,i){const n={closeOnClick:!1,...e,isCloseButton:e.closeButton||!1,closeButton:"Custom"==e.style&&e.closeButton};return new cA(t,n,i)}(t,e,i)}ptlDistance(t,e,i){return uA(t,e,i)}ptpDistance(t,e,i){return function(t,e,i){const n=pt(R(t),R(e),{units:i&&i.units?i.units:"kilometers"}),r=i&&i.digit?i.digit:2;return n.toFixed(r)}(t,e,i)}lineDistance(t,e){return kf(t,e)}calculateArea(t,e){return Bf(t,e)}isPointOnLine(t,e,i){return hA(t,e,i)}isPointOnPolygon(t,e,i){return pA(t,e,i)}isPolygonOnPolygon(t,e,i){return function(t,e,i){const n=O(t),r=O(e),o=i||"booleanOverlap";let s;return"booleanContains"==o?s=Dr(n,r):"booleanOverlap"==o?s=Gr(n,r):"booleanDisjoint"==o&&(s=Ir(n,r)),s}(t,e,i)}pointBuffer(t,e){return function(t,e){return Up(R(t),e,{units:"kilometers"})}(t,e)}lineBuffer(t,e){return function(t,e){return Up(k(t),e,{units:"kilometers"})}(t,e)}interpolation(t,e,i){return dA(t,e,i)}ScaleControl(t){return function(t){return"EPSG:3857"==uNt.value?new bA(t):new wA(t)}(t)}pickCoordinate(t){return new vA(t)}NavigationControl(t){return function(t){return"EPSG:3857"==uNt.value?new AA(t):new EA(t)}(t)}flyto(t,e,i){return function(t,e,i){t instanceof Object&&!("type"in t)?cNt.value.flyTo(t,i):td(t,!0),e&&cNt.value.setPitch(e)}(t,e,i)}Rotate(){return new eNt}regionMask(t,e){return function(t,e){return new SA(t,e)}(t,e)}trajectoryPlayback(t,e,i){return NA(t,e,i)}Bar(t,e){return function(t,e){const i=Object.assign(e||{},sat),n=[];t.map((t=>{t.data.map((t=>{n.push(t.value)}))}));const r=Math.max(...n),o=[];return t.forEach((t=>{const e=[];t.data.map((t=>{e.push({type:"bar",barWidth:i.size[0],label:{show:i.showLabel,fontSize:i.fontSize,color:i.fontColor,position:"top"},itemStyle:{normal:{color:new mk(0,0,0,1,Array.isArray(i.color)?i.color&&i.color.map(((t,e)=>({offset:e,color:t}))):[{offset:1,color:i.color}],!1),barBorderRadius:[i.size[0]/2,i.size[0]/2,0,0]}},data:[t.value]}),n.push(t.value)}));const s={grid:{bottom:0,top:"10%"},xAxis:{data:["涉恐人员"],axisLine:{show:!1},splitLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1,fontSize:i.fontSize,color:i.fontColor}},yAxis:{max:r,axisLine:{show:!1},axisLabel:{show:!1},splitLine:{show:!1}},series:e};o.push({option:s,...t})})),new oat(o,d(0,25),i.size)}(t,e)}Scatter(t,e,i){return function(t,e,i){const n=i||d(0,25),r=t,o=Object.assign({showRipple:!0,symbolScale:1,rippleScale:2,fontSize:14,fontColor:"#333"},e||{}),s=[{name:"Apple",type:"scatter",data:r,symbolSize:t=>t[2]*o.symbolScale,encode:{value:2},label:{show:o.showLabel,formatter:"{b}",position:"top",fontSize:o.fontSize,color:o.fontColor},emphasis:{label:{show:!0}},itemStyle:{color:t=>t.data.color}}];o.showRipple&&s.push({name:"",type:"effectScatter",data:r,symbolSize:t=>t[2]*o.symbolScale,encode:{value:2},rippleEffect:{brushType:"stroke",scale:o.rippleScale},emphasis:{scale:!0,label:{show:!1}},itemStyle:{shadowBlur:10,shadowColor:"#333",color:t=>t.data.color}});const a=new eat(n,{tooltip:{trigger:"item"},series:s});return cNt.value.addLayer(a),a}(t,e,i)}trajectoryTrack(t,e){return function(t,e,i){const n=k(t);return new iat(n,e,i)}(t,e)}trajectoryRealtime(t,e,i){return function(t,e,i){let n;return n=p(t)?$p(t,"lineString"):t,new rat(n,e,i)}(t,e,i)}Migrate(t,e,i){return function(t,e,i){const n=i||d(0,25),r=Object.assign({rippleScale:1,showLabel:!1,fontSize:14,fontColor:"#333",lineColor:"rgb(71,206,239,.8)",lineWidth:2,lineCurveness:.2,period:10,symbolSize:20},e||{}),o="arrow",s=function(t){const e=[];for(let i=0;i<t.length;i++){const n=t[i],r=n[1].position,o=n[0].position;r&&o&&e.push([{coord:r},{coord:o}])}return e},a=[];[[t[0][0].name,t]].forEach((function(t){a.push({name:"",type:"lines",zlevel:1,effect:{show:!0,period:r.period,trailLength:.3,color:Array.isArray(r.lineColor)?r.lineColor[r.lineColor.length-1]:r.lineColor,symbol:o,symbolSize:r.symbolSize},lineStyle:{normal:{color:"red",width:0,curveness:r.lineCurveness}},label:{normal:{show:!1}},data:s(t[1])},{name:"",type:"lines",zlevel:2,effect:{show:!0,period:r.period,trailLength:0,symbol:o,symbolSize:r.symbolSize},lineStyle:{normal:{color:new mk(0,0,0,1,Array.isArray(r.lineColor)?r.lineColor&&r.lineColor.map(((t,e)=>({offset:e,color:t}))):[{offset:1,color:r.lineColor}],!1),width:r.lineWidth,opacity:1,curveness:r.lineCurveness}},label:{normal:{show:!1}},data:s(t[1])},{name:"",type:"effectScatter",coordinateSystem:"geo",zlevel:2,rippleEffect:{brushType:"stroke"},label:{normal:{show:r.showLabel,position:"right",formatter:"{b}",fontSize:r.fontSize,color:r.fontColor}},symbolSize:t=>t[2]*r.rippleScale,itemStyle:{color:t=>t.data.color},data:t[1].map((function(t){return{name:t[1].name,value:[...t[1].position,t[1].value],color:t[1].color||"#fff"}}))})}));const l=new eat(n,{tooltip:{trigger:"item",formatter(t){if("effectScatter"==t.componentSubType)return t.marker+`<span>${t.name}</span> <span style="">${t.value[2]}</span>`}},series:a});return cNt.value.addLayer(l),l}(t,e,i)}Flow(t,e,i){return function(t,e,i){const n=i||d(0,25),r=Object.assign({lineWidth:4,symbolSize:4,symbolColor:"rgb(71,206,239,.8)",trailLength:.5,period:5},e||{}),o=[];o.push({name:"",type:"lines",polyline:!0,silent:!0,zlevel:1,effect:{show:!0,width:r.symbolSize,period:r.period,trailLength:r.trailLength,color:r.symbolColor,symbolSize:r.symbolSize},lineStyle:{normal:{color:t=>t.data.lineColor,width:r.lineWidth,curveness:0}},label:{normal:{show:!1}},data:t});const s=new eat(n,{series:o});return cNt.value.addLayer(s),s}(t,e,i)}threeDBuildings(t,e,i){return function(t,e,i){const n=i||d(0,5),r=t,o=Object.assign({extrudedHeight:500,color:"rgba(255,255,255,1.00)",opacity:1},e),s=cNt.value.getLayer(r);let a;if(s){const{filter:t,maxzoom:e,minzoom:i,source:r,sourceLayer:l}=s;a=Df(void 0,{source:r,sourceLayer:l,maxzoom:e,minzoom:i,filter:t,color:o.color,extrudedHeight:o.extrudedHeight,opacity:o.opacity,highlightColor:o.highlightColor},n)}return a}(t,e,i)}Pie(t,e){return function(t,e){const i=Object.assign({showLabel:!0,fontSize:14,fontColor:"#fff",showTooltip:!0,size:[100,100],radius:["0%","80%"]},e||{}),n=[];if(t&&t.length)return t.forEach((t=>{const e={tooltip:{trigger:i.showTooltip?"item":"none",formatter:"{a}<br/>{b} : {c} ({d}%)"},series:{name:t.name||"",type:"pie",data:t.data,center:["50%","50%"],radius:i.radius,label:{show:i.showLabel,normal:{position:"inner",fontSize:i.fontSize,color:i.fontColor}},itemStyle:{color:t=>t.data.color||"#fff"}}};n.push({option:e,...t})})),new oat(n,d(0,25),i.size)}(t,e)}add3DtilesModel(t,e,i){return function(t,e,i){return new dPt(t,e,i)}(t,e,i)}Marker(t,e,i){return function(t,e,i){return new mPt(t,e,i)}(t,e,i)}addGlbModel(t,e,i){return function(t,e,i){return new tRt(t,e||{},i)}(t,e,i)}addGltfModel(t,e,i){return function(t,e,i){const n={...t,type:"gltf"};return new tRt(n,e||{},i)}(t,e,i)}createGeojsonLayer(t,e={}){return function(t,e={}){const i=t.features[0].geometry.type,n=e.textField,r=e.featureId,o=iRt[i].data(t,n,r),s=iRt[i].option(e);return iRt[i].methods(o,s)}(t,e)}addTerrain(t,e,i){return function(t,e,i){return new nRt(t,e,i)}(t,e,i)}HeatMap(t,e,i){return function(t,e,i){let n;return n=lRt(t)?cRt(t):t,new hRt(n,e,i)}(t,e,i)}GridHeatMap(t,e,i){return function(t,e,i){let n;return n=lRt(t)?cRt(t):t,new XOt(n,e,i)}(t,e,i)}LightHeatMap(t,e,i){return function(t,e,i){let n;return n=lRt(t)?cRt(t):t,new XOt(n,{...e,type:"light"},i)}(t,e,i)}ScreenGridHeatMap(t,e,i){return function(t,e,i){let n;return n=lRt(t)?cRt(t):t,new XOt(n,{...e,type:"point"},i)}(t,e,i)}Radar(t,e){return function(t,e){return new QOt(t,e)}(t,e)}DiffuseCircle(t,e){return function(t,e){return new JOt(t,e)}(t,e)}Weather(t){return function(t){return new $Ot(t)}(t)}Heatmap3D(t,e,i){return function(t,e,i){return new $kt(t,e,i)}(t,e,i)}FlowPoint(t,e,i){return function(t,e,i){const n=i||d(0,25),r=Object.assign({showLabel:!1,lineWidth:4,symbolSize:25,period:5,lineSymbolSize:20,lineColor:"#fff",lineCurveness:.2,fontSize:14,fontColor:"#fff"},e||{}),o=[];[[t[0][0].name,t]].forEach((function(t){o.push({name:"",type:"effectScatter",layout:"none",coordinateSystem:"GLMap",symbolSize:r.symbolSize,symbolOffset:[0,-10],zlevel:3,circular:{rotateLabel:!0},rippleEffect:{brushType:"stroke"},label:{normal:{show:r.showLabel,position:"bottom",formatter:"{b}",fontSize:r.fontSize,color:r.fontColor}},itemStyle:{color:t=>t.data.color},data:t[1].map((function(t){return{name:t[1].name,value:[...t[1].position,t[1].value],color:t[1].color||"#fff",symbol:t[1].symbol}}))}),t[1].length>0&&t[1].forEach((t=>{const e=[],i=t[1].position,n=t[0].position;e.push([{coord:i},{coord:n}]),o.push({name:"",type:"lines",silent:!0,zlevel:1,effect:{show:!0,period:r.period,trailLength:0,symbol:t[1].lineSymbol,symbolSize:r.lineSymbolSize||[10,30]},lineStyle:{normal:{color:t[1].lineColor||r.lineColor,width:r.lineWidth,curveness:r.lineCurveness}},label:{normal:{show:!1}},data:e})}))}));const s=new eat(n,{animation:!1,GLMap:{roam:!0},coordinateSystem:"GLMap",series:o});return cNt.value.addLayer(s),s}(t,e,i)}setSkyBox(t){return function(t){return new tNt(t)}(t)}echartsLayer(t,e){return new eat(t,e)}},((t,e,i)=>{if(e)return i;t.EliMap=i}))}));
|