1(self.webpackChunkglobe_oms_lite=self.webpackChunkglobe_oms_lite||[]).push([[8957],{42321:function(gr){gr.exports=function(){"use strict";var Xt=function(m,C){var L={drag:[],click:[],mousemove:[],mousedown:[],mouseup:[],mouseout:[],keydown:[],keyup:[],touchstart:[],touchmove:[],touchend:[],tap:[]},Z={on:function(re,de,qe){if(void 0===L[re])throw new Error("Invalid event type: "+re);L[re].push({selector:de,fn:qe})},render:function(re){C.store.featureChanged(re)}},ie=function(re,de){for(var qe=L[re],it=qe.length;it--;){var gt=qe[it];if(gt.selector(de)){gt.fn.call(Z,de)||C.store.render(),C.ui.updateMapClasses();break}}};return m.start.call(Z),{render:m.render,stop:function(){m.stop&&m.stop()},trash:function(){m.trash&&(m.trash(),C.store.render())},combineFeatures:function(){m.combineFeatures&&m.combineFeatures()},uncombineFeatures:function(){m.uncombineFeatures&&m.uncombineFeatures()},drag:function(re){ie("drag",re)},click:function(re){ie("click",re)},mousemove:function(re){ie("mousemove",re)},mousedown:function(re){ie("mousedown",re)},mouseup:function(re){ie("mouseup",re)},mouseout:function(re){ie("mouseout",re)},keydown:function(re){ie("keydown",re)},keyup:function(re){ie("keyup",re)},touchstart:function(re){ie("touchstart",re)},touchmove:function(re){ie("touchmove",re)},touchend:function(re){ie("touchend",re)},tap:function(re){ie("tap",re)}}};function X(m){return m&&m.__esModule&&Object.prototype.hasOwnProperty.call(m,"default")?m.default:m}var ke={},c={RADIUS:6378137,FLATTENING:1/298.257223563,POLAR_RADIUS:6356752.3142};function Q(m){var C=0;if(m&&m.length>0){C+=Math.abs(pe(m[0]));for(var L=1;L<m.length;L++)C-=Math.abs(pe(m[L]))}return C}function pe(m){var C,L,Z,ie,re,de,qe=0,it=m.length;if(it>2){for(de=0;de<it;de++)de===it-2?(Z=it-2,ie=it-1,re=0):de===it-1?(Z=it-1,ie=0,re=1):(Z=de,ie=de+1,re=de+2),C=m[Z],L=m[ie],qe+=(Ct(m[re][0])-Ct(C[0]))*Math.sin(Ct(L[1]));qe=qe*c.RADIUS*c.RADIUS/2}return qe}function Ct(m){return m*Math.PI/180}ke.geometry=function m(C){var L,Z=0;switch(C.type){case"Polygon":return Q(C.coordinates);case"MultiPolygon":for(L=0;L<C.coordinates.length;L++)Z+=Q(C.coordinates[L]);return Z;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(L=0;L<C.geometries.length;L++)Z+=m(C.geometries[L]);return Z}},ke.ring=pe;var Ue={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"},Ce={HOT:"mapbox-gl-draw-hot",COLD:"mapbox-gl-draw-cold"},me={ADD:"add",MOVE:"move",DRAG:"drag",POINTER:"pointer",NONE:"none"},ut={POLYGON:"polygon",LINE:"line_string",POINT:"point"},Be={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"},He={DRAW_LINE_STRING:"draw_line_string",DRAW_POLYGON:"draw_polygon",DRAW_POINT:"draw_point",SIMPLE_SELECT:"simple_select",DIRECT_SELECT:"direct_select",STATIC:"static"},Ze={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"},zt={MOVE:"move",CHANGE_COORDINATES:"change_coordinates"},Rt={FEATURE:"feature",MIDPOINT:"midpoint",VERTEX:"vertex"},xt={ACTIVE:"true",INACTIVE:"false"},si=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate"],be=-85,De=Object.freeze({__proto__:null,classes:Ue,sources:Ce,cursors:me,types:ut,geojsonTypes:Be,modes:He,events:Ze,updateActions:zt,meta:Rt,activeStates:xt,interactions:si,LAT_MIN:-90,LAT_RENDERED_MIN:be,LAT_MAX:90,LAT_RENDERED_MAX:85,LNG_MIN:-270,LNG_MAX:270}),Ae={Point:0,LineString:1,MultiLineString:1,Polygon:2};function Me(m,C){var L=Ae[m.geometry.type]-Ae[C.geometry.type];return 0===L&&m.geometry.type===Be.POLYGON?m.area-C.area:L}function Ve(m){return m.map(function(C){return C.geometry.type===Be.POLYGON&&(C.area=ke.geometry({type:Be.FEATURE,property:{},geometry:C.geometry})),C}).sort(Me).map(function(C){return delete C.area,C})}function Oe(m,C){return void 0===C&&(C=0),[[m.point.x-C,m.point.y-C],[m.point.x+C,m.point.y+C]]}function Ie(m){if(this._items={},this._nums={},this._length=m?m.length:0,m)for(var C=0,L=m.length;C<L;C++)this.add(m[C]),void 0!==m[C]&&("string"==typeof m[C]?this._items[m[C]]=C:this._nums[m[C]]=C)}Ie.prototype.add=function(m){return this.has(m)||(this._length++,"string"==typeof m?this._items[m]=this._length:this._nums[m]=this._length),this},Ie.prototype.delete=function(m){return!1===this.has(m)||(this._length--,delete this._items[m],delete this._nums[m]),this},Ie.prototype.has=function(m){return!("string"!=typeof m&&"number"!=typeof m||void 0===this._items[m]&&void 0===this._nums[m])},Ie.prototype.values=function(){var m=this,C=[];
1return Object.keys(this._items).forEach(function(L){C.push({k:L,v:m._items[L]})}),Object.keys(this._nums).forEach(function(L){C.push({k:JSON.parse(L),v:m._nums[L]})}),C.sort(function(L,Z){return L.v-Z.v}).map(function(L){return L.k})},Ie.prototype.clear=function(){return this._length=0,this._items={},this._nums={},this};var Qe=[Rt.FEATURE,Rt.MIDPOINT,Rt.VERTEX],ze={click:function(m,C,L){return Gt(m,C,L,L.options.clickBuffer)},touch:function(m,C,L){return Gt(m,C,L,L.options.touchBuffer)}};function Gt(m,C,L,Z){if(null===L.map)return[];var ie=m?Oe(m,Z):C,re={};L.options.styles&&(re.layers=L.options.styles.map(function(gt){return gt.id}).filter(function(gt){return null!=L.map.getLayer(gt)}));var de=L.map.queryRenderedFeatures(ie,re).filter(function(gt){return-1!==Qe.indexOf(gt.properties.meta)}),qe=new Ie,it=[];return de.forEach(function(gt){var _t=gt.properties.id;qe.has(_t)||(qe.add(_t),it.push(gt))}),Ve(it)}function St(m,C){var L=ze.click(m,null,C),Z={mouse:me.NONE};return L[0]&&(Z.mouse=L[0].properties.active===xt.ACTIVE?me.MOVE:me.POINTER,Z.feature=L[0].properties.meta),-1!==C.events.currentModeName().indexOf("draw")&&(Z.mouse=me.ADD),C.ui.queueMapClasses(Z),C.ui.updateMapClasses(),L[0]}function ht(m,C){var L=m.x-C.x,Z=m.y-C.y;return Math.sqrt(L*L+Z*Z)}function $e(m,C,L){void 0===L&&(L={});var Z=null!=L.fineTolerance?L.fineTolerance:4,ie=null!=L.grossTolerance?L.grossTolerance:12,re=null!=L.interval?L.interval:500;m.point=m.point||C.point,m.time=m.time||C.time;var de=ht(m.point,C.point);return de<Z||de<ie&&C.time-m.time<re}function We(m,C,L){void 0===L&&(L={});var Z=null!=L.tolerance?L.tolerance:25,ie=null!=L.interval?L.interval:250;return m.point=m.point||C.point,m.time=m.time||C.time,ht(m.point,C.point)<Z&&C.time-m.time<ie}var et={exports:{}},Ut=et.exports=function(m,C){if(C||(C=16),void 0===m&&(m=128),m<=0)return"0";for(var L=Math.log(Math.pow(2,m))/Math.log(C),Z=2;L===1/0;Z*=2)L=Math.log(Math.pow(2,m/Z))/Math.log(C)*Z;var ie=L-Math.floor(L),re="";for(Z=0;Z<Math.floor(L);Z++)re=Math.floor(Math.random()*C).toString(C)+re;if(ie){var de=Math.pow(C,ie);re=Math.floor(Math.random()*de).toString(C)+re}var qe=parseInt(re,C);return qe!==1/0&&qe>=Math.pow(2,m)?Ut(m,C):re};Ut.rack=function(m,C,L){var Z=function(re){var de=0;do{if(de++>10){if(!L)throw new Error("too many ID collisions, use more bits");m+=L}var qe=Ut(m,C)}while(Object.hasOwnProperty.call(ie,qe));return ie[qe]=re,qe},ie=Z.hats={};return Z.get=function(re){return Z.hats[re]},Z.set=function(re,de){return Z.hats[re]=de,Z},Z.bits=m||128,Z.base=C||16,Z};var Oi=X(et.exports),Ke=function(m,C){this.ctx=m,this.properties=C.properties||{},this.coordinates=C.geometry.coordinates,this.id=C.id||Oi(),this.type=C.geometry.type};Ke.prototype.changed=function(){this.ctx.store.featureChanged(this.id)},Ke.prototype.incomingCoords=function(m){this.setCoordinates(m)},Ke.prototype.setCoordinates=function(m){this.coordinates=m,this.changed()},Ke.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.coordinates))},Ke.prototype.setProperty=function(m,C){this.properties[m]=C},Ke.prototype.toGeoJSON=function(){return JSON.parse(JSON.stringify({id:this.id,type:Be.FEATURE,properties:this.properties,geometry:{coordinates:this.getCoordinates(),type:this.t
1ype}}))},Ke.prototype.internal=function(m){var C={id:this.id,meta:Rt.FEATURE,"meta:type":this.type,active:xt.INACTIVE,mode:m};if(this.ctx.options.userProperties)for(var L in this.properties)C["user_"+L]=this.properties[L];return{type:Be.FEATURE,properties:C,geometry:{coordinates:this.getCoordinates(),type:this.type}}};var ri=function(m,C){Ke.call(this,m,C)};(ri.prototype=Object.create(Ke.prototype)).isValid=function(){return"number"==typeof this.coordinates[0]&&"number"==typeof this.coordinates[1]},ri.prototype.updateCoordinate=function(m,C,L){this.coordinates=3===arguments.length?[C,L]:[m,C],this.changed()},ri.prototype.getCoordinate=function(){return this.getCoordinates()};var wt=function(m,C){Ke.call(this,m,C)};(wt.prototype=Object.create(Ke.prototype)).isValid=function(){return this.coordinates.length>1},wt.prototype.addCoordinate=function(m,C,L){this.changed();var Z=parseInt(m,10);this.coordinates.splice(Z,0,[C,L])},wt.prototype.getCoordinate=function(m){var C=parseInt(m,10);return JSON.parse(JSON.stringify(this.coordinates[C]))},wt.prototype.removeCoordinate=function(m){this.changed(),this.coordinates.splice(parseInt(m,10),1)},wt.prototype.updateCoordinate=function(m,C,L){var Z=parseInt(m,10);this.coordinates[Z]=[C,L],this.changed()};var $t=function(m,C){Ke.call(this,m,C),this.coordinates=this.coordinates.map(function(L){return L.slice(0,-1)})};($t.prototype=Object.create(Ke.prototype)).isValid=function(){return 0!==this.coordinates.length&&this.coordinates.every(function(m){return m.length>2})},$t.prototype.incomingCoords=function(m){this.coordinates=m.map(function(C){return C.slice(0,-1)}),this.changed()},$t.prototype.setCoordinates=function(m){this.coordinates=m,this.changed()},$t.prototype.addCoordinate=function(m,C,L){this.changed();var Z=m.split(".").map(function(ie){return parseInt(ie,10)});this.coordinates[Z[0]].splice(Z[1],0,[C,L])},$t.prototype.removeCoordinate=function(m){this.changed();var C=m.split(".").map(function(Z){return parseInt(Z,10)}),L=this.coordinates[C[0]];
1L&&(L.splice(C[1],1),L.length<3&&this.coordinates.splice(C[0],1))},$t.prototype.getCoordinate=function(m){var C=m.split(".").map(function(Z){return parseInt(Z,10)});return JSON.parse(JSON.stringify(this.coordinates[C[0]][C[1]]))},$t.prototype.getCoordinates=function(){return this.coordinates.map(function(m){return m.concat([m[0]])})},$t.prototype.updateCoordinate=function(m,C,L){this.changed();var Z=m.split("."),ie=parseInt(Z[0],10),re=parseInt(Z[1],10);void 0===this.coordinates[ie]&&(this.coordinates[ie]=[]),this.coordinates[ie][re]=[C,L]};var Qt={MultiPoint:ri,MultiLineString:wt,MultiPolygon:$t},Bi=function(m,C,L,Z,ie){var re=L.split("."),de=parseInt(re[0],10),qe=re[1]?re.slice(1).join("."):null;return m[de][C](qe,Z,ie)},xi=function(m,C){if(Ke.call(this,m,C),delete this.coordinates,this.model=Qt[C.geometry.type],void 0===this.model)throw new TypeError(C.geometry.type+" is not a valid type");this.features=this._coordinatesToFeatures(C.geometry.coordinates)};function Ft(m){this.map=m.map,this.drawConfig=JSON.parse(JSON.stringify(m.options||{})),this._ctx=m}(xi.prototype=Object.create(Ke.prototype))._coordinatesToFeatures=function(m){var C=this,L=this.model.bind(this);return m.map(function(Z){return new L(C.ctx,{id:Oi(),type:Be.FEATURE,properties:{},geometry:{coordinates:Z,type:C.type.replace("Multi","")}})})},xi.prototype.isValid=function(){return this.features.every(function(m){return m.isValid()})},xi.prototype.setCoordinates=function(m){this.features=this._coordinatesToFeatures(m),this.changed()},xi.prototype.getCoordinate=function(m){return Bi(this.features,"getCoordinate",m)},xi.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.features.map(function(m){return m.type===Be.POLYGON?m.getCoordinates():m.coordinates})))},xi.prototype.updateCoordinate=function(m,C,L){Bi(this.features,"updateCoordinate",m,C,L),this.changed()},xi.prototype.addCoordinate=function(m,C,L){Bi(this.features,"addCoordinate",m,C,L),this.changed()},xi.prototype.removeCoordinate=function(m){Bi(this.features,"removeCoordinate",m),this.changed()},xi.prototype.getFeatures=function(){return this.features},Ft.prototype.setSelected=function(m){return this._ctx.store.setSelected(m)},Ft.prototype.setSelectedCoordinates=function(m){var C=this;this._ctx.store.setSelectedCoordinates(m),m.reduce(function(L,Z){return void 0===L[Z.feature_id]&&(L[Z.feature_id]=!0,C._ctx.store.get(Z.feature_id).changed()),L},{})},Ft.prototype.getSelected=function(){return this._ctx.store.getSelected()},Ft.prototype.getSelectedIds=function(){return this._ctx.store.getSelectedIds()},Ft.prototype.isSelected=function(m){return this._ctx.store.isSelected(m)},Ft.prototype.getFeature=function(m){return this._ctx.store.get(m)},Ft.prototype.select=function(m){return this._ctx.store.select(m)},Ft.prototype.deselect=function(m){return this._ctx.store.deselect(m)},Ft.prototype.deleteFeature=function(m,C){return void 0===C&&(C={}),this._ctx.store.delete(m,C)},Ft.prototype.addFeature=function(m){return this._ctx.store.add(m)},Ft.prototype.clearSelectedFeatures=function(){return this._ctx.store.clearSelected()},Ft.prototype.clearSelectedCoordinates=function(){return this._ctx.store.clearSelectedCoordinates()},Ft.prototype.setActionableState=function(m){return void 0===m&&(m={}),this._ctx.events.actionable({trash:m.trash||!1,combineFeatures:m.combineFeatures||!1,uncombineFeatures:m.uncombineFeatures||!1})},Ft.prototype.changeMode=function(m,C,L){return void 0===C&&(C={}),void 0===L&&(L={}),this._ctx.events.changeMode(m,C,L)},Ft.prototype.updateUIClasses=function(m){return this._ctx.ui.queueMapClasses(m)},Ft.prototype.activateUIButton=function(m){return this._ctx.ui.setActiveButton(m)},Ft.prototype.featuresAt=function(m,C,L){if(void 0===L&&(L="click"),"click"!==L&&"touch"!==L)throw new Error("invalid buffer type");return ze[L](m,C,this._ctx)},Ft.prototype.newFeature=function(m){var C=m.geometry.type;return C===Be.POINT?new ri(this._ctx,m):C===Be.LINE_STRING?new wt(this._ctx,m):C===Be.POLYGON?new $t(this._ctx,m):new xi(this._ctx,m)},Ft.prototype.isInstanceOf=function(m,C){if(m===Be.POINT)return C instanceof ri;if(m===Be.LINE_STRING)return C instanceof wt;if(m===Be.POLYGON)return C instanceof $t;if("MultiFeature"===m)return C instanceof xi;throw new Error("Unknown feature class: "+m)},Ft.prototype.doRender=function(m){return this._ctx.store.featureChanged(m)},Ft.prototype.onSetup=function(){},Ft.prototype.onDrag=function(){},Ft.prototype.onClick=function(){},Ft.prototype.onMouseMove=function(){},Ft.prototype.onMouseDown=function(){},Ft.prototype.onMouseUp=function(){},Ft.prototype.onMouseOut=function(){},Ft.prototype.onKeyUp=function(){},Ft.prototype.onKeyDown=function(){},Ft.prototype.onTouchStart=function(){},Ft.prototype.onTouchMove=function(){},Ft.prototype.onTouchEnd=function(){},Ft.prototype.onTap=function(){},Ft.prototype.onStop=function(){},Ft.prototype.onTrash=function(){},Ft.prototype.onCombineFeature=function(){},Ft.prototype.onUncombineFeature=function(){},Ft.prototype.toDisplayFeatures=function(){throw new Error("You must over
1write toDisplayFeatures")};var Mn={drag:"onDrag",click:"onClick",mousemove:"onMouseMove",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseout:"onMouseOut",keyup:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",tap:"onTap"},_r=Object.keys(Mn);function tr(m){return[].concat(m).filter(function(C){return void 0!==C})}function Cr(){var m=this;if(!m.ctx.map||void 0===m.ctx.map.getSource(Ce.HOT))return it();var C=m.ctx.events.currentModeName();m.ctx.ui.queueMapClasses({mode:C});var L=[],Z=[];m.isDirty?Z=m.getAllIds():(L=m.getChangedIds().filter(function(gt){return void 0!==m.get(gt)}),Z=m.sources.hot.filter(function(gt){return gt.properties.id&&-1===L.indexOf(gt.properties.id)&&void 0!==m.get(gt.properties.id)}).map(function(gt){return gt.properties.id})),m.sources.hot=[];var ie=m.sources.cold.length;m.sources.cold=m.isDirty?[]:m.sources.cold.filter(function(gt){return-1===L.indexOf(gt.properties.id||gt.properties.parent)});var re=ie!==m.sources.cold.length||Z.length>0;function de(gt,_t){var lt=m.get(gt).internal(C);m.ctx.events.currentModeRender(lt,function(Yt){m.sources[_t].push(Yt)})}if(L.forEach(function(gt){return de(gt,"hot")}),Z.forEach(function(gt){return de(gt,"cold")}),re&&m.ctx.map.getSource(Ce.COLD).setData({type:Be.FEATURE_COLLECTION,features:m.sources.cold}),m.ctx.map.getSource(Ce.HOT).setData({type:Be.FEATURE_COLLECTION,features:m.sources.hot}),m._emitSelectionChange&&(m.ctx.map.fire(Ze.SELECTION_CHANGE,{features:m.getSelected().map(function(gt){return gt.toGeoJSON()}),points:m.getSelectedCoordinates().map(function(gt){return{type:Be.FEATURE,properties:{},geometry:{type:Be.POINT,coordinates:gt.coordinates}}})}),m._emitSelectionChange=!1),m._deletedFeaturesToEmit.length){var qe=m._deletedFeaturesToEmit.map(function(gt){return gt.toGeoJSON()});m._deletedFeaturesToEmit=[],m.ctx.map.fire(Ze.DELETE,{features:qe})}function it(){m.isDirty=!1,m.clearChangedIds()}it(),m.ctx.map.fire(Ze.RENDER,{})}function li(m){var C,L=this;this._features={},this._featureIds=new Ie,this._selectedFeatureIds=new Ie,this._selectedCoordinates=[],this._changedFeatureIds=new Ie,this._deletedFeaturesToEmit=[],this._emitSelectionChange=!1,this._mapInitialConfig={},this.ctx=m,this.sources={hot:[],cold:[]},this.render=function(){C||(C=requestAnimationFrame(function(){C=null,Cr.call(L)}))},this.isDirty=!1}function Xr(m,C){var L=m._selectedCoordinates.filter(function(Z){return m._selectedFeatureIds.has(Z.feature_id)});m._selectedCoordinates.length===L.length||C.silent||(m._emitSelectionChange=!0),m._selectedCoordinates=L}li.prototype.createRenderBatch=function(){var m=this,C=this.render,L=0;return this.render=function(){L++},function(){m.render=C,L>0&&m.render()}},li.prototype.setDirty=function(){return this.isDirty=!0,this},li.prototype.featureChanged=function(m){return this._changedFeatureIds.add(m),this},li.prototype.getChangedIds=function(){return this._changedFeatureIds.values()},li.prototype.clearChangedIds=function(){return this._changedFeatureIds.clear(),this},li.prototype.getAllIds=function(){return this._featureIds.values()},li.prototype.add=function(m){return this.featureChanged(m.id),this._features[m.id]=m,this._featureIds.add(m.id),this},li.prototype.delete=function(m,C){var L=this;return void 0===C&&(C={}),tr(m).forEach(function(Z){L._featureIds.has(Z)&&(L._featureIds.delete(Z),L._selectedFeatureIds.delete(Z),C.silent||-1===L._deletedFeaturesToEmit.indexOf(L._features[Z])&&L._deletedFeaturesToEmit.push(L._features[Z]),delete L._features[Z],L.isDirty=!0)}),Xr(this,C),this},li.prototype.get=function(m){return this._features[m]},li.prototype.getAll=function(){var m=this;return Object.keys(this._features).map(function(C){return m._features[C]})},li.prototype.select=function(m,C){var L=this;return void 0===C&&(C={}),tr(m).forEach(function(Z){L._selectedFeatureIds.has(Z)||(L._selectedFeatureIds.add(Z),L._changedFeatureIds.add(Z),C.silent||(L._emitSelectionChange=!0))}),this},li.prototype.deselect=function(m,C){var L=this;return void 0===C&&(C={}),tr(m).forEach(function(Z){L._selectedFeatureIds.has(Z)&&(L._selectedFeatureIds.delete(Z),L._changedFeatureIds.add(Z),C.silent||(L._emitSelectionChange=!0))}),Xr(this,C),this},li.prototype.clearSelected=function(m){return void 0===m&&(m={}),this.deselect(this._selectedFeatureIds.values(),{silent:m.silent}),this},li.prototype.setSelected=function(m,C){var L=this;return void 0===C&&(C={}),m=tr(m),this.deselect(this._selectedFeatureIds.values().filter(function(Z){return-1===m.indexOf(Z)}),{silent:C.silent}),this.select(m.filter(function(Z){return!L._selectedFeatureIds.has(Z)}),{silent:C.silent}),this},li.prototype.setSelectedCoordinates=function(m){return this._selectedCoordinates=m,this._emitSelectionChange=!0,this},li.prototype.clearSelectedCoordinates=function(){return this._selectedCoordinates=[],this._emitSelectionChange=!0,this},li.prototype.getSelectedIds=function(){return this._selectedFeatureIds.values()},li.prototype.getSelected=function(){var m=this;return this._selectedFeatureIds.values().map(function(C){return m.get(C)})},li.prototype.getSelectedCoordinates=function(){var m=this;return this._selectedCoordinates.map(function(C){return{coordinates:m.get(C.feature_id).getCoordinate(C.coord_path)}})},li.prototype.isSelected=function(m){return this._selectedFeatureIds.has(m)},li.prototype.setFeatureProperty=function(m,C,L){this.get(m).setProperty(C,L),this.featureChanged(m)},li.prototype.storeMapConfig=function(){var m=this;si.forEach(function(C){m.ctx.map[C]&&(m._mapInitialConfig[C]=m.ctx.map[C].isEnabled())})},li.prototype.restoreMapConfig=function(){var m=this;Object.keys(this._mapInitialConfig).forEach(function(C){m._mapInitialConfig[C]?m.ctx.map[C].enable():m.ctx.map[C].disable()})},li.prototype.getInitialConfigValue=function(m){return void 0===this._mapInitialConfig[m]||this._mapInitialConfig[m]};var sn=Object.prototype.hasOwnProperty,Y=X(function(){for(var m=arguments,C={},L=0;L<arguments.length;L++){var Z=m[L];for(var ie in Z)sn.call(Z,ie)&&(C[ie]=Z[ie])}return C}),ei=["mode","feature","mouse"];
1function w(m){var C=null,L=null,Z={onRemove:function(){return m.map.off("load",Z.connect),clearInterval(L),Z.removeLayers(),m.store.restoreMapConfig(),m.ui.removeButtons(),m.events.removeEventListeners(),m.ui.clearMapClasses(),m.boxZoomInitial&&m.map.boxZoom.enable(),m.map=null,m.container=null,m.store=null,C&&C.parentNode&&C.parentNode.removeChild(C),C=null,this},connect:function(){m.map.off("load",Z.connect),clearInterval(L),Z.addLayers(),m.store.storeMapConfig(),m.events.addEventListeners()},onAdd:function(ie){var re=ie.fire;return ie.fire=function(de,qe){var it=arguments;return 1===re.length&&1!==arguments.length&&(it=[Y({},{type:de},qe)]),re.apply(ie,it)},m.map=ie,m.events=function(de){var qe=Object.keys(de.options.modes).reduce(function(Ne,At){return Ne[At]=function Vr(m){var C=Object.keys(m);return function(L,Z){void 0===Z&&(Z={});var ie={},re=C.reduce(function(de,qe){return de[qe]=m[qe],de},new Ft(L));return{start:function(){var de=this;ie=re.onSetup(Z),_r.forEach(function(qe){var it,gt=Mn[qe],_t=function(){return!1};m[gt]&&(_t=function(){return!0}),de.on(qe,_t,(it=gt,function(lt){return re[it](ie,lt)}))})},stop:function(){re.onStop(ie)},trash:function(){re.onTrash(ie)},combineFeatures:function(){re.onCombineFeatures(ie)},uncombineFeatures:function(){re.onUncombineFeatures(ie)},render:function(de,qe){re.toDisplayFeatures(ie,de,qe)}}}}(de.options.modes[At]),Ne},{}),it={},gt={},_t={},lt=null,Yt=null;_t.drag=function(Ne,At){At({point:Ne.point,time:(new Date).getTime()})?(de.ui.queueMapClasses({mouse:me.DRAG}),Yt.drag(Ne)):Ne.originalEvent.stopPropagation()},_t.mousedrag=function(Ne){_t.drag(Ne,function(At){return!$e(it,At)})},_t.touchdrag=function(Ne){_t.drag(Ne,function(At){return!We(gt,At)})},_t.mousemove=function(Ne){if(1===(void 0!==Ne.originalEvent.buttons?Ne.originalEvent.buttons:Ne.originalEvent.which))return _t.mousedrag(Ne);var At=St(Ne,de);Ne.featureTarget=At,Yt.mousemove(Ne)},_t.mousedown=function(Ne){it={time:(new Date).getTime(),point:Ne.point};var At=St(Ne,de);Ne.featureTarget=At,Yt.mousedown(Ne)},_t.mouseup=function(Ne){var At=St(Ne,de);Ne.featureTarget=At,$e(it,{point:Ne.point,time:(new Date).getTime()})?Yt.click(Ne):Yt.mouseup(Ne)},_t.mouseout=function(Ne){Yt.mouseout(Ne)},_t.touchstart=function(Ne){if(de.options.touchEnabled){gt={time:(new Date).getTime(),point:Ne.point};var At=ze.touch(Ne,null,de)[0];Ne.featureTarget=At,Yt.touchstart(Ne)}},_t.touchmove=function(Ne){if(de.options.touchEnabled)return Yt.touchmove(Ne),_t.touchdrag(Ne)},_t.touchend=function(Ne){if(Ne.originalEvent.preventDefault(),de.options.touchEnabled){var At=ze.touch(Ne,null,de)[0];Ne.featureTarget=At,We(gt,{time:(new Date).getTime(),point:Ne.point})?Yt.tap(Ne):Yt.touchend(Ne)}};var $i=function(Ne){return!(8===Ne||46===Ne||Ne>=48&&Ne<=57)};function ii(Ne,At,Ii){void 0===Ii&&(Ii={}),Yt.stop();var Zi=qe[Ne];if(void 0===Zi)throw new Error(Ne+" is not valid");lt=Ne;var Hi=Zi(de,At);Yt=Xt(Hi,de),Ii.silent||de.map.fire(Ze.MODE_CHANGE,{mode:Ne}),de.store.setDirty(),de.store.render()}_t.keydown=function(Ne){(Ne.srcElement||Ne.target).classList.contains("mapboxgl-canvas")&&(8!==Ne.keyCode&&46!==Ne.keyCode||!de.options.controls.trash?$i(Ne.keyCode)?Yt.keydown(Ne):49===Ne.keyCode&&de.options.controls.point?ii(He.DRAW_POINT):50===Ne.keyCode&&de.options.controls.line_string?ii(He.DRAW_LINE_STRING):51===Ne.keyCode&&de.options.controls.polygon&&ii(He.DRAW_POLYGON):(Ne.preventDefault(),Yt.trash()))},_t.keyup=function(Ne){$i(Ne.keyCode)&&Yt.keyup(Ne)},_t.zoomend=function(){de.store.changeZoom()},_t.data=function(Ne){if("style"===Ne.dataType){var At=de.setup,Ii=de.map,Hi=de.store;de.options.styles.some(function(Jr){return Ii.getLayer(Jr.id)})||(At.addLayers(),Hi.setDirty(),Hi.render())}};var rr={trash:!1,combineFeatures:!1,uncombineFeatures:!1};return{start:function(){Yt=Xt(qe[lt=de.options.defaultMode](de),de)},changeMode:ii,actionable:function(Ne){var At=!1;Object.keys(Ne).forEach(function(Ii){if(void 0===rr[Ii])throw new Error("Invalid action type");rr[Ii]!==Ne[Ii]&&(At=!0),rr[Ii]=Ne[Ii]}),At&&de.map.fire(Ze.ACTIONABLE,{actions:rr})},currentModeName:function(){return lt},currentModeRender:function(Ne,At){return Yt.render(Ne,At)},fire:function(Ne,At){_t[Ne]&&_t[Ne](At)},addEventListeners:function(){de.map.on("mousemove",_t.mousemove),de.map.on("mousedown",_t.mousedown),de.map.on("mouseup",_t.mouseup),de.map.on("data",_t.data),de.map.on("touchmove",_t.touchmove),de.map.on("touchstart",_t.touchstart),de.map.on("touchend",_t.touchend),de.container.addEventListener("mouseout",_t.mouseout),de.options.keybindings&&(de.container.addEventListener("keydown",_t.keydown),de.container.addEventListener("keyup",_t.keyup))},removeEventListeners:function(){de.map.off("mousemove",_t.mousemove),de.map.off("mousedown",_t.mousedown),de.map.off("mouseup",_t.mouseup),de.map.off("data",_t.data),de.map.off("touchmove",_t.touchmove),de.map.off("touchstart",_t.touchstart),de.map.off("touchend",_t.touchend),de.container.removeEventListener("mouseout",_t.mouseout),de.options.keybindings&&(de.container.removeEventListener("keydown",_t.keydown),de.container.removeEventListener("keyup",_t.keyup))},trash:function(Ne){Yt.trash(Ne)},combineFeatures:function(){Yt.combineFeatures()},uncombineFeatures:function(){Yt.uncombineFeatures()},getMode:function(){return lt}}}(m),m.ui=function(de){var qe={},it=null,gt={mode:null,feature:null,mouse:null},_t={mode:null,feature:null,mouse:null};function lt(Ne){_t=Y(_t,Ne)}function Yt(){var Ne,At;if(de.container){var Ii=[],Zi=[];
1ei.forEach(function(Hi){_t[Hi]!==gt[Hi]&&(Ii.push(Hi+"-"+gt[Hi]),null!==_t[Hi]&&Zi.push(Hi+"-"+_t[Hi]))}),Ii.length>0&&(Ne=de.container.classList).remove.apply(Ne,Ii),Zi.length>0&&(At=de.container.classList).add.apply(At,Zi),gt=Y(gt,_t)}}function $i(Ne,At){void 0===At&&(At={});var Ii=document.createElement("button");return Ii.className=Ue.CONTROL_BUTTON+" "+At.className,Ii.setAttribute("title",At.title),At.container.appendChild(Ii),Ii.addEventListener("click",function(Zi){if(Zi.preventDefault(),Zi.stopPropagation(),Zi.target===it)return ii(),void At.onDeactivate();rr(Ne),At.onActivate()},!0),Ii}function ii(){it&&(it.classList.remove(Ue.ACTIVE_BUTTON),it=null)}function rr(Ne){ii();var At=qe[Ne];At&&At&&"trash"!==Ne&&(At.classList.add(Ue.ACTIVE_BUTTON),it=At)}return{setActiveButton:rr,queueMapClasses:lt,updateMapClasses:Yt,clearMapClasses:function(){lt({mode:null,feature:null,mouse:null}),Yt()},addButtons:function(){var Ne=de.options.controls,At=document.createElement("div");return At.className=Ue.CONTROL_GROUP+" "+Ue.CONTROL_BASE,Ne&&(Ne[ut.LINE]&&(qe[ut.LINE]=$i(ut.LINE,{container:At,className:Ue.CONTROL_BUTTON_LINE,title:"LineString tool "+(de.options.keybindings?"(l)":""),onActivate:function(){return de.events.changeMode(He.DRAW_LINE_STRING)},onDeactivate:function(){return de.events.trash()}})),Ne[ut.POLYGON]&&(qe[ut.POLYGON]=$i(ut.POLYGON,{container:At,className:Ue.CONTROL_BUTTON_POLYGON,title:"Polygon tool "+(de.options.keybindings?"(p)":""),onActivate:function(){return de.events.changeMode(He.DRAW_POLYGON)},onDeactivate:function(){return de.events.trash()}})),Ne[ut.POINT]&&(qe[ut.POINT]=$i(ut.POINT,{container:At,className:Ue.CONTROL_BUTTON_POINT,title:"Marker tool "+(de.options.keybindings?"(m)":""),onActivate:function(){return de.events.changeMode(He.DRAW_POINT)},onDeactivate:function(){return de.events.trash()}})),Ne.trash&&(qe.trash=$i("trash",{container:At,className:Ue.CONTROL_BUTTON_TRASH,title:"Delete",onActivate:function(){de.events.trash()}})),Ne.combine_features&&(qe.combine_features=$i("combineFeatures",{container:At,className:Ue.CONTROL_BUTTON_COMBINE_FEATURES,title:"Combine",onActivate:function(){de.events.combineFeatures()}})),Ne.uncombine_features&&(qe.uncombine_features=$i("uncombineFeatures",{container:At,className:Ue.CONTROL_BUTTON_UNCOMBINE_FEATURES,title:"Uncombine",onActivate:function(){de.events.uncombineFeatures()}}))),At},removeButtons:function(){Object.keys(qe).forEach(function(Ne){var At=qe[Ne];At.parentNode&&At.parentNode.removeChild(At),delete qe[Ne]})}}}(m),m.container=ie.getContainer(),m.store=new li(m),C=m.ui.addButtons(),m.options.boxSelect&&(m.boxZoomInitial=ie.boxZoom.isEnabled(),ie.boxZoom.disable(),ie.dragPan.disable(),ie.dragPan.enable()),ie.loaded()?Z.connect():(ie.on("load",Z.connect),L=setInterval(function(){ie.loaded()&&Z.connect()},16)),m.events.start(),C},addLayers:function(){m.map.addSource(Ce.COLD,{data:{type:Be.FEATURE_COLLECTION,features:[]},type:"geojson"}),m.map.addSource(Ce.HOT,{data:{type:Be.FEATURE_COLLECTION,features:[]},type:"geojson"}),m.options.styles.forEach(function(ie){m.map.addLayer(ie)}),m.store.setDirty(!0),m.store.render()},removeLayers:function(){m.options.styles.forEach(function(ie){m.map.getLayer(ie.id)&&m.map.removeLayer(ie.id)}),m.map.getSource(Ce.COLD)&&m.map.removeSource(Ce.COLD),m.map.getSource(Ce.HOT)&&m.map.removeSource(Ce.HOT)}};return m.setup=Z,Z}var z=[{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,"cir
1cle-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 Ee(m){return function(C){var L=C.featureTarget;return!!L&&!!L.properties&&L.properties.meta===m}}function ft(m){return!!m.originalEvent&&!!m.originalEvent.shiftKey&&0===m.originalEvent.button}function oi(m){return!!m.featureTarget&&!!m.featureTarget.properties&&m.featureTarget.properties.active===xt.ACTIVE&&m.featureTarget.properties.meta===Rt.FEATURE}function mi(m){return!!m.featureTarget&&!!m.featureTarget.properties&&m.featureTarget.properties.active===xt.INACTIVE&&m.featureTarget.properties.meta===Rt.FEATURE}function ki(m){return void 0===m.featureTarget}function Mr(m){return!!m.featureTarget&&!!m.featureTarget.properties&&m.featureTarget.properties.meta===Rt.FEATURE}function yr(m){var C=m.featureTarget;return!!C&&!!C.properties&&C.properties.meta===Rt.VERTEX}function Ir(m){return!!m.originalEvent&&!0===m.originalEvent.shiftKey}function tt(m){return 27===m.keyCode}function Er(m){return 13===m.keyCode}var zi=Object.freeze({__proto__:null,isOfMetaType:Ee,isShiftMousedown:ft,isActiveFeature:oi,isInactiveFeature:mi,noTarget:ki,isFeature:Mr,isVertex:yr,isShiftDown:Ir,isEscapeKey:tt,isEnterKey:Er,isTrue:function(){return!0}}),Rn=Tr;function Tr(m,C){this.x=m,this.y=C}Tr.prototype={clone:function(){return new Tr(this.x,this.y)},add:function(m){return this.clone()._add(m)},sub:function(m){return this.clone()._sub(m)},multByPoint:function(m){return this.clone()._multByPoint(m)},divByPoint:function(m){return this.clone()._divByPoint(m)},mult:function(m){return this.clone()._mult(m)},div:function(m){return this.clone()._div(m)},rotate:function(m){return this.clone()._rotate(m)},rotateAround:function(m,C){return this.clone()._rotateAround(m,C)},matMult:function(m){return this.clone()._matMult(m)},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(m){return this.x===m.x&&this.y===m.y},dist:function(m){return Math.sqrt(this.distSqr(m))},distSqr:function(m){var C=m.x-this.x,L=m.y-this.y;return C*C+L*L},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(m){return Math.atan2(this.y-m.y,this.x-m.x)},angleWith:function(m){return this.angleWithSep(m.x,m.y)},angleWithSep:function(m,C){return Math.atan2(this.x*C-this.y*m,this.x*m+this.y*C)},_matMult:function(m){var L=m[2]*this.x+m[3]*this.y;return this.x=m[0]*this.x+m[1]*this.y,this.y=L,this},_add:function(m){return this.x+=m.x,this.y+=m.y,this},_sub:function(m){return this.x-=m.x,this.y-=m.y,this},_mult:function(m){return this.x*=m,this.y*=m,this},_div:function(m){return this.x/=m,this.y/=m,this},_multByPoint:function(m){return this.x*=m.x,this.y*=m.y,this},_divByPoint:function(m){return this.x/=m.x,this.y/=m.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var m=this.y;return this.y=this.x,this.x=-m,this}
1,_rotate:function(m){var C=Math.cos(m),L=Math.sin(m),ie=L*this.x+C*this.y;return this.x=C*this.x-L*this.y,this.y=ie,this},_rotateAround:function(m,C){var L=Math.cos(m),Z=Math.sin(m),re=C.y+Z*(this.x-C.x)+L*(this.y-C.y);return this.x=C.x+L*(this.x-C.x)-Z*(this.y-C.y),this.y=re,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Tr.convert=function(m){return m instanceof Tr?m:Array.isArray(m)?new Tr(m[0],m[1]):m};var nt=X(Rn);function Ht(m,C){var L=C.getBoundingClientRect();return new nt(m.clientX-L.left-(C.clientLeft||0),m.clientY-L.top-(C.clientTop||0))}function jt(m,C,L,Z){return{type:Be.FEATURE,properties:{meta:Rt.VERTEX,parent:m,coord_path:L,active:Z?xt.ACTIVE:xt.INACTIVE},geometry:{type:Be.POINT,coordinates:C}}}function dr(m,C,L){var Z=C.geometry.coordinates,ie=L.geometry.coordinates;if(Z[1]>85||Z[1]<be||ie[1]>85||ie[1]<be)return null;var re={lng:(Z[0]+ie[0])/2,lat:(Z[1]+ie[1])/2};return{type:Be.FEATURE,properties:{meta:Rt.MIDPOINT,parent:m,lng:re.lng,lat:re.lat,coord_path:L.properties.coord_path},geometry:{type:Be.POINT,coordinates:[re.lng,re.lat]}}}function Br(m,C,L){void 0===C&&(C={}),void 0===L&&(L=null);var Z,ie=m.geometry,re=ie.type,de=ie.coordinates,qe=m.properties&&m.properties.id,it=[];function gt(lt,Yt){var $i="",ii=null;lt.forEach(function(rr,Ne){var At=null!=Yt?Yt+"."+Ne:String(Ne),Ii=jt(qe,rr,At,_t(At));if(C.midpoints&&ii){var Zi=dr(qe,ii,Ii);Zi&&it.push(Zi)}ii=Ii;var Hi=JSON.stringify(rr);$i!==Hi&&it.push(Ii),0===Ne&&($i=Hi)})}function _t(lt){return!!C.selectedPaths&&-1!==C.selectedPaths.indexOf(lt)}return re===Be.POINT?it.push(jt(qe,de,L,_t(L))):re===Be.POLYGON?de.forEach(function(lt,Yt){gt(lt,null!==L?L+"."+Yt:String(Yt))}):re===Be.LINE_STRING?gt(de,L):0===re.indexOf(Be.MULTI_PREFIX)&&(Z=re.replace(Be.MULTI_PREFIX,""),de.forEach(function(lt,Yt){it=it.concat(Br({type:Be.FEATURE,properties:m.properties,geometry:{type:Z,coordinates:lt}},C,Yt))})),it}var Bt={enable:function(m){setTimeout(function(){m.map&&m.map.doubleClickZoom&&m._ctx&&m._ctx.store&&m._ctx.store.getInitialConfigValue&&m._ctx.store.getInitialConfigValue("doubleClickZoom")&&m.map.doubleClickZoom.enable()},0)},disable:function(m){setTimeout(function(){m.map&&m.map.doubleClickZoom&&m.map.doubleClickZoom.disable()},0)}},Gr={exports:{}},G=function(m){if(!m||!m.type)return null;var C=P[m.type];return C?"geometry"===C?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:m}]}:"feature"===C?{type:"FeatureCollection",features:[m]}:"featurecollection"===C?m:void 0:null},P={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"},k=X(G),F=Object.freeze({__proto__:null,default:function m(C){switch(C&&C.type||null){case"FeatureCollection":return C.features=C.features.reduce(function(L,Z){return L.concat(m(Z))},[]),C;case"Feature":return C.geometry?m(C.geometry).map(function(L){var Z={type:"Feature",properties:JSON.parse(JSON.stringify(C.properties)),geometry:L};return void 0!==C.id&&(Z.id=C.id),Z}):[C];case"MultiPoint":return C.coordinates.map(function(L){return{type:"Point",coordinates:L}});case"MultiPolygon":return C.coordinates.map(function(L){return{type:"Polygon",coordinates:L}});case"MultiLineString":return C.coordinates.map(function(L){return{type:"LineString",coordinates:L}});case"GeometryCollection":return C.geometries.map(m).reduce(function(L,Z){return L.concat(Z)},[]);case"Point":case"Polygon":case"LineString":return[C]}}}),j=G,W=function Te(m){if(m.__esModule)return m;var C=m.default;if("function"==typeof C){var L=function Z(){if(this instanceof Z){var ie=[null];return ie.push.apply(ie,arguments),new(Function.bind.apply(C,ie))}return C.apply(this,arguments)};L.prototype=C.prototype}else L={};return Object.defineProperty(L,"__esModule",{value:!0}),Object.keys(m).forEach(function(Z){var ie=Object.getOwnPropertyDescriptor(m,Z);Object.defineProperty(L,Z,ie.get?ie:{enumerable:!0,get:function(){return m[Z]}})}),L}(F);W instanceof Function||(W=W.default);var ee={exports:{}},J=ee.exports=function(m){return new ne(m)};function ne(m){this.value=m}function Se(m,C,L){var Z=[],ie=[],re=!0;return function de(qe){var it=L?Pe(qe):qe,gt={}
1,_t=!0,lt={node:it,node_:qe,path:[].concat(Z),parent:ie[ie.length-1],parents:ie,key:Z.slice(-1)[0],isRoot:0===Z.length,level:Z.length,circular:null,update:function(ii,rr){lt.isRoot||(lt.parent.node[lt.key]=ii),lt.node=ii,rr&&(_t=!1)},delete:function(ii){delete lt.parent.node[lt.key],ii&&(_t=!1)},remove:function(ii){Zt(lt.parent.node)?lt.parent.node.splice(lt.key,1):delete lt.parent.node[lt.key],ii&&(_t=!1)},keys:null,before:function(ii){gt.before=ii},after:function(ii){gt.after=ii},pre:function(ii){gt.pre=ii},post:function(ii){gt.post=ii},stop:function(){re=!1},block:function(){_t=!1}};if(!re)return lt;function Yt(){if("object"==typeof lt.node&&null!==lt.node){lt.keys&<.node_===lt.node||(lt.keys=Le(lt.node)),lt.isLeaf=0==lt.keys.length;for(var ii=0;ii<ie.length;ii++)if(ie[ii].node_===qe){lt.circular=ie[ii];break}}else lt.isLeaf=!0,lt.keys=null;lt.notLeaf=!lt.isLeaf,lt.notRoot=!lt.isRoot}Yt();var $i=C.call(lt,lt.node);return void 0!==$i&<.update&<.update($i),gt.before&>.before.call(lt,lt.node),_t&&("object"!=typeof lt.node||null===lt.node||lt.circular||(ie.push(lt),Yt(),bt(lt.keys,function(ii,rr){Z.push(ii),gt.pre&>.pre.call(lt,lt.node[ii],ii);var Ne=de(lt.node[ii]);L&&Pt.call(lt.node,ii)&&(lt.node[ii]=Ne.node),Ne.isLast=rr==lt.keys.length-1,Ne.isFirst=0==rr,gt.post&>.post.call(lt,Ne),Z.pop()}),ie.pop()),gt.after&>.after.call(lt,lt.node)),lt}(m).node}function Pe(m){if("object"==typeof m&&null!==m){var C;if(Zt(m))C=[];else if("[object Date]"===It(m))C=new Date(m.getTime?m.getTime():m);else if("[object RegExp]"===It(m))C=new RegExp(m);else if("[object Error]"===It(m))C={message:m.message};else if(function(ie){return"[object Boolean]"===It(ie)}(m))C=new Boolean(m);else if(function(ie){return"[object Number]"===It(ie)}(m))C=new Number(m);else if(function(ie){return"[object String]"===It(ie)}(m))C=new String(m);else if(Object.create&&Object.getPrototypeOf)C=Object.create(Object.getPrototypeOf(m));else if(m.constructor===Object)C={};else{var Z=function(){};Z.prototype=m.constructor&&m.constructor.prototype||m.__proto__||{},C=new Z}return bt(Le(m),function(ie){C[ie]=m[ie]}),C}return m}ne.prototype.get=function(m){for(var C=this.value,L=0;L<m.length;L++){var Z=m[L];if(!C||!Pt.call(C,Z)){C=void 0;break}C=C[Z]}return C},ne.prototype.has=function(m){for(var C=this.value,L=0;L<m.length;L++){var Z=m[L];if(!C||!Pt.call(C,Z))return!1;C=C[Z]}return!0},ne.prototype.set=function(m,C){for(var L=this.value,Z=0;Z<m.length-1;Z++){var ie=m[Z];Pt.call(L,ie)||(L[ie]={}),L=L[ie]}return L[m[Z]]=C,C},ne.prototype.map=function(m){return Se(this.value,m,!0)},ne.prototype.forEach=function(m){return this.value=Se(this.value,m,!1),this.value},ne.prototype.reduce=function(m,C){var L=1===arguments.length,Z=L?this.value:C;return this.forEach(function(ie){this.isRoot&&L||(Z=m.call(this,Z,ie))}),Z},ne.prototype.paths=function(){var m=[];return this.forEach(function(C){m.push(this.path)}),m},ne.prototype.nodes=function(){var m=[];return this.forEach(function(C){m.push(this.node)}),m},ne.prototype.clone=function(){var m=[],C=[];return function L(Z){for(var ie=0;ie<m.length;ie++)if(m[ie]===Z)return C[ie];if("object"==typeof Z&&null!==Z){var re=Pe(Z);return m.push(Z),C.push(re),bt(Le(Z),function(de){re[de]=L(Z[de])}),m.pop(),C.pop(),re}return Z}(this.value)};var Le=Object.keys||function(m){var C=[];for(var L in m)C.push(L);return C};function It(m){return Object.prototype.toString.call(m)}var Zt=Array.isArray||function(m){return"[object Array]"===Object.prototype.toString.call(m)},bt=function(m,C){if(m.forEach)return m.forEach(C);for(var L=0;L<m.length;L++)C(m[L],L,m)};bt(Le(ne.prototype),function(m){J[m]=function(C){var L=[].slice.call(arguments,1),Z=new ne(C);return Z[m].apply(Z,L)}});var Pt=Object.hasOwnProperty||function(m,C){return C in m},Kt=ee.exports,bi=ni;function ni(m){if(!(this instanceof ni))return new ni(m);this._bbox=m||[1/0,1/0,-1/0,-1/0],this._valid=!!m}ni.prototype.include=function(m){return this._valid=!0,this._bbox[0]=Math.min(this._bbox[0],m[0]),this._bbox[1]=Math.min(this._bbox[1],m[1]),this._bbox[2]=Math.max(this._bbox[2],m[0]),this._bbox[3]=Math.max(this._bbox[3],m[1]),this}
1,ni.prototype.equals=function(m){var C;return C=m instanceof ni?m.bbox():m,this._bbox[0]==C[0]&&this._bbox[1]==C[1]&&this._bbox[2]==C[2]&&this._bbox[3]==C[3]},ni.prototype.center=function(m){return this._valid?[(this._bbox[0]+this._bbox[2])/2,(this._bbox[1]+this._bbox[3])/2]:null},ni.prototype.union=function(m){var C;return this._valid=!0,C=m instanceof ni?m.bbox():m,this._bbox[0]=Math.min(this._bbox[0],C[0]),this._bbox[1]=Math.min(this._bbox[1],C[1]),this._bbox[2]=Math.max(this._bbox[2],C[2]),this._bbox[3]=Math.max(this._bbox[3],C[3]),this},ni.prototype.bbox=function(){return this._valid?this._bbox:null},ni.prototype.contains=function(m){if(!m)return this._fastContains();if(!this._valid)return null;var C=m[0],L=m[1];return this._bbox[0]<=C&&this._bbox[1]<=L&&this._bbox[2]>=C&&this._bbox[3]>=L},ni.prototype.intersect=function(m){return this._valid?(C=m instanceof ni?m.bbox():m,!(this._bbox[0]>C[2]||this._bbox[2]<C[0]||this._bbox[3]<C[1]||this._bbox[1]>C[3])):null;var C},ni.prototype._fastContains=function(){return this._valid?new Function("ll","return "+this._bbox[0]+"<= ll[0] &&"+this._bbox[1]+"<= ll[1] &&"+this._bbox[2]+">= ll[0] &&"+this._bbox[3]+">= ll[1]"):new Function("return null;")},ni.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 hi=function(m){if(!m)return[];var C=W(j(m)),L=[];return C.features.forEach(function(Z){Z.geometry&&(L=L.concat(function(m){return function C(L){return Array.isArray(L)&&L.length&&"number"==typeof L[0]?[L]:L.reduce(function(Z,ie){return Array.isArray(ie)&&Array.isArray(ie[0])?Z.concat(C(ie)):(Z.push(ie),Z)},[])}(m)}(Z.geometry.coordinates)))}),L},ci=Kt,sr=bi,Ci={features:["FeatureCollection"],coordinates:["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],geometry:["Feature"],geometries:["GeometryCollection"]},_e=Object.keys(Ci);function ge(m){for(var C=sr(),L=hi(m),Z=0;Z<L.length;Z++)C.include(L[Z]);return C}Gr.exports=function(m){return ge(m).bbox()},Gr.exports.polygon=function(m){return ge(m).polygon()},Gr.exports.bboxify=function(m){return ci(m).map(function(C){C&&_e.some(function(L){return!!C[L]&&-1!==Ci[L].indexOf(C.type)})&&(C.bbox=ge(C).bbox(),this.update(C))})};var se=X(Gr.exports),je=-90;function Ye(m,C){var L=je,Z=90,ie=je,re=90,de=270,qe=-270;m.forEach(function(gt){var _t=se(gt),lt=_t[1],Yt=_t[3],$i=_t[0],ii=_t[2];lt>L&&(L=lt),Yt<Z&&(Z=Yt),Yt>ie&&(ie=Yt),lt<re&&(re=lt),$i<de&&(de=$i),ii>qe&&(qe=ii)});var it=C;return L+it.lat>85&&(it.lat=85-L),ie+it.lat>90&&(it.lat=90-ie),Z+it.lat<-85&&(it.lat=-85-Z),re+it.lat<je&&(it.lat=je-re),de+it.lng<=-270&&(it.lng+=360*Math.ceil(Math.abs(it.lng)/360)),qe+it.lng>=270&&(it.lng-=360*Math.ceil(Math.abs(it.lng)/360)),it}function Lt(m,C){var L=Ye(m.map(function(Z){return Z.toGeoJSON()}),C);m.forEach(function(Z){var ie,re=Z.getCoordinates(),de=function(it){var gt={lng:it[0]+L.lng,lat:it[1]+L.lat};return[gt.lng,gt.lat]},qe=function(it){return it.map(function(gt){return de(gt)})};Z.type===Be.POINT?ie=de(re):Z.type===Be.LINE_STRING||Z.type===Be.MULTI_POINT?ie=re.map(de):Z.type===Be.POLYGON||Z.type===Be.MULTI_LINE_STRING?ie=re.map(qe):Z.type===Be.MULTI_POLYGON&&(ie=re.map(function(it){return it.map(function(gt){return qe(gt)})})),Z.incomingCoords(ie)})}var ti={onSetup:function(m){var C=this,L={dragMoveLocation:null,boxSelectStartLocation:null,boxSelectElement:void 0,boxSelecting:!1,canBoxSelect:!1,dragMoving:!1,canDragMove:!1,initiallySelectedFeatureIds:m.featureIds||[]};return this.setSelected(L.initiallySelectedFeatureIds.filter(function(Z){return void 0!==C.getFeature(Z)})),this.fireActionable(),this.setActionableState({combineFeatures:!0,uncombineFeatures:!0,trash:!0}),L},fireUpdate:function(){this.map.fire(Ze.UPDATE,{action:zt.MOVE,features:this.getSelected().map(function(m){return m.toGeoJSON()})})},fireActionable:function(){var m=this,C=this.getSelected(),L=C.filter(function(qe){return m.isInstanceOf("MultiFeature",qe)}),Z=!1;if(C.length>1){Z=!0;var ie=C[0].type.replace("Multi","");
1C.forEach(function(qe){qe.type.replace("Multi","")!==ie&&(Z=!1)})}this.setActionableState({combineFeatures:Z,uncombineFeatures:L.length>0,trash:C.length>0})},getUniqueIds:function(m){return m.length?m.map(function(C){return C.properties.id}).filter(function(C){return void 0!==C}).reduce(function(C,L){return C.add(L),C},new Ie).values():[]},stopExtendedInteractions:function(m){m.boxSelectElement&&(m.boxSelectElement.parentNode&&m.boxSelectElement.parentNode.removeChild(m.boxSelectElement),m.boxSelectElement=null),this.map.dragPan.enable(),m.boxSelecting=!1,m.canBoxSelect=!1,m.dragMoving=!1,m.canDragMove=!1},onStop:function(){Bt.enable(this)},onMouseMove:function(m,C){return Mr(C)&&m.dragMoving&&this.fireUpdate(),this.stopExtendedInteractions(m),!0},onMouseOut:function(m){return!m.dragMoving||this.fireUpdate()}};ti.onTap=ti.onClick=function(m,C){return ki(C)?this.clickAnywhere(m,C):Ee(Rt.VERTEX)(C)?this.clickOnVertex(m,C):Mr(C)?this.clickOnFeature(m,C):void 0},ti.clickAnywhere=function(m){var C=this,L=this.getSelectedIds();
1L.length&&(this.clearSelectedFeatures(),L.forEach(function(Z){return C.doRender(Z)})),Bt.enable(this),this.stopExtendedInteractions(m)},ti.clickOnVertex=function(m,C){this.changeMode(He.DIRECT_SELECT,{featureId:C.featureTarget.properties.parent,coordPath:C.featureTarget.properties.coord_path,startPos:C.lngLat}),this.updateUIClasses({mouse:me.MOVE})},ti.startOnActiveFeature=function(m,C){this.stopExtendedInteractions(m),this.map.dragPan.disable(),this.doRender(C.featureTarget.properties.id),m.canDragMove=!0,m.dragMoveLocation=C.lngLat},ti.clickOnFeature=function(m,C){var L=this;Bt.disable(this),this.stopExtendedInteractions(m);var Z=Ir(C),ie=this.getSelectedIds(),re=C.featureTarget.properties.id,de=this.isSelected(re);if(!Z&&de&&this.getFeature(re).type!==Be.POINT)return this.changeMode(He.DIRECT_SELECT,{featureId:re});de&&Z?(this.deselect(re),this.updateUIClasses({mouse:me.POINTER}),1===ie.length&&Bt.enable(this)):!de&&Z?(this.select(re),this.updateUIClasses({mouse:me.MOVE})):de||Z||(ie.forEach(function(qe){return L.doRender(qe)}),this.setSelected(re),this.updateUIClasses({mouse:me.MOVE})),this.doRender(re)},ti.onMouseDown=function(m,C){return oi(C)?this.startOnActiveFeature
1(m,C):this.drawConfig.boxSelect&&ft(C)?this.startBoxSelect(m,C):void 0},ti.startBoxSelect=function(m,C){this.stopExtendedInteractions(m),this.map.dragPan.disable(),m.boxSelectStartLocation=Ht(C.originalEvent,this.map.getContainer()),m.canBoxSelect=!0},ti.onTouchStart=function(m,C){if(oi(C))return this.startOnActiveFeature(m,C)},ti.onDrag=function(m,C){return m.canDragMove?this.dragMove(m,C):this.drawConfig.boxSelect&&m.canBoxSelect?this.whileBoxSelect(m,C):void 0},ti.whileBoxSelect=function(m,C){m.boxSelecting=!0,this.updateUIClasses({mouse:me.ADD}),m.boxSelectElement||(m.boxSelectElement=document.createElement("div"),m.boxSelectElement.classList.add(Ue.BOX_SELECT),this.map.getContainer().appendChild(m.boxSelectElement));var L=Ht(C.originalEvent,this.map.getContainer()),Z=Math.min(m.boxSelectStartLocation.x,L.x),ie=Math.max(m.boxSelectStartLocation.x,L.x),re=Math.min(m.boxSelectStartLocation.y,L.y),de=Math.max(m.boxSelectStartLocation.y,L.y),qe="translate("+Z+"px, "+re+"px)";m.boxSelectElement.style.transform=qe,m.boxSelectElement.style.WebkitTransform=qe,m.boxSelectElement.style.width=ie-Z+"px",m.boxSelectElement.style.height=de-re+"px"},ti.dragMove=function(m,C){m.dragMoving=!0,C.originalEvent.stopPropagation();var L={lng:C.lngLat.lng-m.dragMoveLocation.lng,lat:C.lngLat.lat-m.dragMoveLocation.lat};Lt(this.getSelected(),L),m.dragMoveLocation=C.lngLat},ti.onTouchEnd=ti.onMouseUp=function(m,C){var L=this;if(m.dragMoving)this.fireUpdate();else if(m.boxSelecting){var Z=[m.boxSelectStartLocation,Ht(C.originalEvent,this.map.getContainer())],ie=this.featuresAt(null,Z,"click"),re=this.getUniqueIds(ie).filter(function(de){return!L.isSelected(de)});re.length&&(this.select(re),re.forEach(function(de){return L.doRender(de)}),this.updateUIClasses({mouse:me.MOVE}))}this.stopExtendedInteractions(m)},ti.toDisplayFeatures=function(m,C,L){C.properties.active=this.isSelected(C.properties.id)?xt.ACTIVE:xt.INACTIVE,L(C),this.fireActionable(),C.properties.active===xt.ACTIVE&&C.geometry.type!==Be.POINT&&Br(C).forEac
1h(L)},ti.onTrash=function(){this.deleteFeature(this.getSelectedIds()),this.fireActionable()},ti.onCombineFeatures=function(){var m=this.getSelected();if(!(0===m.length||m.length<2)){for(var C=[],L=[],Z=m[0].type.replace("Multi",""),ie=0;ie<m.length;ie++){var re=m[ie];if(re.type.replace("Multi","")!==Z)return;re.type.includes("Multi")?re.getCoordinates().forEach(function(qe){C.push(qe)}):C.push(re.getCoordinates()),L.push(re.toGeoJSON())}if(L.length>1){var de=this.newFeature({type:Be.FEATURE,properties:L[0].properties,geometry:{type:"Multi"+Z,coordinates:C}});this.addFeature(de),this.deleteFeature(this.getSelectedIds(),{silent:!0}),this.setSelected([de.id]),this.map.fire(Ze.COMBINE_FEATURES,{createdFeatures:[de.toGeoJSON()],deletedFeatures:L})}this.fireActionable()}},ti.onUncombineFeatures=function(){var m=this,C=this.getSelected();if(0!==C.length){for(var L=[],Z=[],ie=function(de){var qe=C[de];m.isInstanceOf("MultiFeature",qe)&&(qe.getFeatures().forEach(function(it){m.addFeature(it),it.properties=qe.properties,L.push(it.toGeoJSON()),m.select([it.id])}),m.deleteFeature(qe.id,{silent:!0}),Z.push(qe.toGeoJSON()))},re=0;re<C.length;re++)ie(re);L.length>1&&this.map.fire(Ze.UNCOMBINE_FEATURES,{createdFeatures:L,deletedFeatures:Z}),this.fireActionable()}};var Jt=Ee(Rt.VERTEX),fn=Ee(Rt.MIDPOINT),jr={fireUpdate:function(){this.map.fire(Ze.UPDATE,{action:zt.CHANGE_COORDINATES,features:this.getSelected().map(function(m){return m.toGeoJSON()})})},fireActionable:function(m){this.setActionableState({combineFeatures:!1,uncombineFeatures:!1,trash:m.selectedCoordPaths.length>0})},startDragging:function(m,C){this.map.dragPan.disable(),m.canDragMove=!0,m.dragMoveLocation=C.lngLat},stopDragging:function(m){this.map.dragPan.enable(),m.dragMoving=!1,m.canDragMove=!1,m.dragMoveLocation=null},onVertex:function(m,C){this.startDragging(m,C);var L=C.featureTarget.properties,Z=m.selectedCoordPaths.indexOf(L.coord_path);Ir(C)||-1!==Z?Ir(C)&&-1===Z&&m.selectedCoordPaths.push(L.coord_path):m.selectedCoordPaths=[L.coord_path];var ie=this.pathsToCoordinates(m.featureId,m.selectedCoordPaths);this.setSelectedCoordinates(ie)},onMidpoint:function(m,C){this.startDragging(m,C);var L=C.featureTarget.properties;m.feature.addCoordinate(L.coord_path,L.lng,L.lat),this.fireUpdate(),m.selectedCoordPaths=[L.coord_path]},pathsToCoordinates:function(m,C){return C.map(function(L){return{feature_id:m,coord_path:L}})},onFeature:function(m,C){0===m.selectedCoordPaths.length?this.startDragging(m,C):this.stopDragging(m)},dragFeature:function(m,C,L){Lt(this.getSelected(),L),m.dragMoveLocation=C.lngLat},dragVertex:function(m,C,L){for(var Z=m.selectedCoordPaths.map(function(qe){return m.feature.getCoordinate(qe)}),ie=Ye(Z.map(function(qe){return{type:Be.FEATURE,properties:{},geometry:{type:Be.POINT,coordinates:qe}}}),L),re=0;re<Z.length;re++){var de=Z[re];m.feature.updateCoordinate(m.selectedCoordPaths[re],de[0]+ie.lng,de[1]+ie.lat)}},clickNoTarget:function(){this.changeMode(He.SIMPLE_SELECT)},clickInactive:function(){this.changeMode(He.SIMPLE_SELECT)},clickActiveFeature:function(m){m.selectedCoordPaths=[],this.clearSelectedCoordinates(),m.feature.changed()},onSetup:function(m){var C=m.featureId,L=this.getFeature(C);if(!L)throw new Error("You must provide a featureId to enter direct_select mode");if(L.type===Be.POINT)throw new TypeError("direct_select mode doesn't handle point features");var Z={featureId:C,feature:L,dragMoveLocation:m.startPos||null,dragMoving:!1,canDragMove:!1,selectedCoordPaths:m.coordPath?[m.coordPath]:[]};return this.setSelectedCoordinates(this.pathsToCoordinates(C,Z.selectedCoordPaths)),this.setSelected(C),Bt.disable(this),this.setActionableState({trash:!0}),Z},onStop:function(){Bt.enable(this),this.clearSelectedCoordinates()},toDisplayFeatures:function(m,C,L){m.featureId===C.properties.id?(C.properties.active=xt.ACTIVE,L(C),Br(C,{map:this.map,midpoints:!0,selectedPaths:m.selectedCoordPaths}).forEach(L)):(C.properties.active=xt.INACTIVE,L(C)),this.fireActionable(m)},onTrash:function(m){m.selectedCoordPaths.sort(function(C,L){return L.localeCompare(C,"en",{numeric:!0})}
1).forEach(function(C){return m.feature.removeCoordinate(C)}),this.fireUpdate(),m.selectedCoordPaths=[],this.clearSelectedCoordinates(),this.fireActionable(m),!1===m.feature.isValid()&&(this.deleteFeature([m.featureId]),this.changeMode(He.SIMPLE_SELECT,{}))},onMouseMove:function(m,C){var L=oi(C),Z=Jt(C),ie=fn(C),re=0===m.selectedCoordPaths.length;return this.updateUIClasses(L&&re||Z&&!re?{mouse:me.MOVE}:{mouse:me.NONE}),(Z||L||ie)&&m.dragMoving&&this.fireUpdate(),this.stopDragging(m),!0},onMouseOut:function(m){return m.dragMoving&&this.fireUpdate(),!0}};jr.onTouchStart=jr.onMouseDown=function(m,C){return Jt(C)?this.onVertex(m,C):oi(C)?this.onFeature(m,C):fn(C)?this.onMidpoint(m,C):void 0},jr.onDrag=function(m,C){if(!0===m.canDragMove){m.dragMoving=!0,C.originalEvent.stopPropagation();var L={lng:C.lngLat.lng-m.dragMoveLocation.lng,lat:C.lngLat.lat-m.dragMoveLocation.lat};m.selectedCoordPaths.length>0?this.dragVertex(m,C,L):this.dragFeature(m,C,L),m.dragMoveLocation=C.lngLat}},jr.onClick=function(m,C){return ki(C)?this.clickNoTarget(m,C):oi(C)?this.clickActiveFeature
1(m,C):mi(C)?this.clickInactive(m,C):void this.stopDragging(m)},jr.onTap=function(m,C){return ki(C)?this.clickNoTarget(m,C):oi(C)?this.clickActiveFeature(m,C):mi(C)?this.clickInactive(m,C):void 0},jr.onTouchEnd=jr.onMouseUp=function(m){m.dragMoving&&this.fireUpdate(),this.stopDragging(m)};var Mi={};function Nr(m,C){return!!m.lngLat&&m.lngLat.lng===C[0]&&m.lngLat.lat===C[1]}Mi.onSetup=function(){var m=this.newFeature({type:Be.FEATURE,properties:{},geometry:{type:Be.POINT,coordinates:[]}});return this.addFeature(m),this.clearSelectedFeatures(),this.updateUIClasses({mouse:me.ADD}),this.activateUIButton(ut.POINT),this.setActionableState({trash:!0}),{point:m}},Mi.stopDrawingAndRemove=function(m){this.deleteFeature([m.point.id],{silent:!0}),this.changeMode(He.SIMPLE_SELECT)},Mi.onTap=Mi.onClick=function(m,C){this.updateUIClasses({mouse:me.MOVE}),m.point.updateCoordinate("",C.lngLat.lng,C.lngLat.lat),this.map.fire(Ze.CREATE,{features:[m.point.toGeoJSON()]}),this.changeMode(He.SIMPLE_SELECT,{featureIds:[m.point.id]})},Mi.onStop=function(m){this.activateUIButton(),m.point.getCoordinate().length||this.deleteFeature([m.point.id],{silent:!0})},Mi.toDisplayFeatures=function(m,C,L){var Z=C.properties.id===m.point.id;if(C.properties.active=Z?xt.ACTIVE:xt.INACTIVE,!Z)return L(C)},Mi.onTrash=Mi.stopDrawingAndRemove,Mi.onKeyUp=function(m,C){if(tt(C)||Er(C))return this.stopDrawingAndRemove(m,C)};var yo={onSetup:function(){var m=this.newFeature({type:Be.FEATURE,properties:{},geometry:{type:Be.POLYGON,coordinates:[[]]}});return this.addFeature(m),this.clearSelectedFeatures(),Bt.disable(this),this.updateUIClasses({mouse:me.ADD}),this.activateUIButton(ut.POLYGON),this.setActionableState({trash:!0}),{polygon:m,currentVertexPosition:0}},clickAnywhere:function(m,C){if(m.currentVertexPosition>0&&Nr(C,m.polygon.coordinates[0][m.currentVertexPosition-1]))return this.changeMode(He.SIMPLE_SELECT,{featureIds:[m.polygon.id]});this.updateUIClasses({mouse:me.ADD}),m.polygon.updateCoordinate("0."+m.currentVertexPosition,C.lngLat.lng,C.lngLat.lat),m.currentVertexPosition++,m.polygon.updateCoordinate("0."+m.currentVertexPosition,C.lngLat.lng,C.lngLat.lat)},clickOnVertex:function(m){return this.changeMode(He.SIMPLE_SELECT,{featureIds:[m.polygon.id]})},onMouseMove:function(m,C){m.polygon.updateCoordinate("0."+m.currentVertexPosition,C.lngLat.lng,C.lngLat.lat),yr(C)&&this.updateUIClasses({mouse:me.POINTER})}};yo.onTap=yo.onClick=function(m,C){return yr(C)?this.clickOnVertex(m,C):this.clickAnywhere(m,C)},yo.onKeyUp=function(m,C){tt(C)?(this.deleteFeature([m.polygon.id],{silent:!0}),this.changeMode(He.SIMPLE_SELECT)):Er(C)&&this.changeMode(He.SIMPLE_SELECT,{featureIds:[m.polygon.id]})},yo.onStop=function(m){this.updateUIClasses({mouse:me.NONE}),Bt.enable(this),this.activateUIButton(),void 0!==this.getFeature(m.polygon.id)&&(m.polygon.removeCoordinate("0."+m.currentVertexPosition),m.polygon.isValid()?this.map.fire(Ze.CREATE,{features:[m.polygon.toGeoJSON()]}):(this.deleteFeature([m.polygon.id],{silent:!0}),this.changeMode(He.SIMPLE_SELECT,{},{silent:!0})))},yo.toDisplayFeatures=function(m,C,L){var Z=C.properties.id===m.polygon.id;if(C.properties.active=Z?xt.ACTIVE:xt.INACTIVE,!Z)return L(C);if(0!==C.geometry.coordinates.length){var ie=C.geometry.coordinates[0].length;if(!(ie<3)){if(C.properties.meta=Rt.FEATURE,L(jt(m.polygon.id,C.geometry.coordinates[0][0],"0.0",!1)),ie>3){var re=C.geometry.coordinates[0].length-3;L(jt(m.polygon.id,C.geometry.coordinates[0][re],"0."+re,!1))}if(ie<=4&&(L({type:Be.FEATURE,properties:C.properties,geometry:{coordinates:[[C.geometry.coordinates[0][0][0],C.geometry.coordinates[0][0][1]],[C.geometry.coordinates[0][1][0],C.geometry.coordinates[0][1][1]]],type:Be.LINE_STRING}}),3===ie))return;return L(C)}}},yo.onTrash=function(m){this.deleteFeature([m.polygon.id],{silent:!0}),this.changeMode(He.SIMPLE_SELECT)};var vr={onSetup:function(m){var C,L,Z=(m=m||{}).featureId,ie="forward";if(Z){if(!(C=this.getFeature(Z)))throw new Error("Could not find a feature with the provided featureId");var re=m.from;if(re&&"Feature"===re.type&&re.geometry&&"Point"===re.geometry.type&&(re=re.geometry),re&&"Point"===re.type&&re.coordinates&&2===re.coordinates.length&&(re=re.coordinates),!re||!Array.isArray(re))throw new Error("Please use the `from` property to indicate which point to continue the line from");var de=C.coordinates.length-1;if(C.coordinates[de][0]===re[0]&&C.coordinates[de][1]===re[1])C.addCoordinate.apply(C,[L=de+1].concat(C.coordinates[de]));else{if(C.coordinates[0][0]!==re[0]||C.coordinates[0][1]!==re[1])throw new Error("`from` should match the point at either the start or the end of the provided LineString");ie="backwards",C.addCoordinate.apply(C,[L=0].concat(C.coordinates[0]))}}else C=this.newFeature({type:Be.FEATURE,properties:{},geometry:{type:Be.LINE_STRING,coordinates:[]}}),L=0,this.addFeature(C);return this.clearSelectedFeatures(),Bt.disable(this),this.updateUIClasses({mouse:me.ADD}),this.activateUIButton(ut.LINE),this.setActionableState({trash:!0}),{line:C,currentVertexPosition:L,direction:ie}},clickAnywhere:function(m,C){if(m.currentVertexPosition>0&&Nr(C,m.line.coordinates[m.currentVertexPosition-1])||"backwards"===m.direction&&Nr(C,m.line.coordinates[m.currentVertexPosition+1]))return this.changeMode(He.SIMPLE_SELECT,{featureIds:[m.line.id]});this.updateUIClasses({mouse:me.ADD}),m.line.updateCoordinate(m.currentVertexPosition,C.lngLat.lng,C.lngLat.lat),"forward"===m.direction?(m.currentVertexPosition++,m.line.updateCoordinate(m.currentVertexPosition,C.lngLat.lng,C.lngLat.lat)):m.line.addCoordinate(0,C.lngLat.lng,C.lngLat.lat)},clickOnVertex:function(m){return this.changeMode(He.SIMPLE_SELECT,{featureIds:[m.line.id]})},onMouseMove:function(m,C){m.line.updateCoordinate(m.currentVertexPosition,C.lngLat.lng,C.lngLat.lat),yr(C)&&this.updateUIClasses({mouse:me.POINTER})}};vr.onTap=vr.onClick=function(m,C){if(yr(C))return this.clickOnVertex(m,C);this.clickAnywhere(m,C)},vr.onKeyUp=function(m,C){Er(C)?this.changeMode(He.SIMPLE_SELECT,{featureIds:[m.line.id]}
1):tt(C)&&(this.deleteFeature([m.line.id],{silent:!0}),this.changeMode(He.SIMPLE_SELECT))},vr.onStop=function(m){Bt.enable(this),this.activateUIButton(),void 0!==this.getFeature(m.line.id)&&(m.line.removeCoordinate(""+m.currentVertexPosition),m.line.isValid()?this.map.fire(Ze.CREATE,{features:[m.line.toGeoJSON()]}):(this.deleteFeature([m.line.id],{silent:!0}),this.changeMode(He.SIMPLE_SELECT,{},{silent:!0})))},vr.onTrash=function(m){this.deleteFeature([m.line.id],{silent:!0}),this.changeMode(He.SIMPLE_SELECT)},vr.toDisplayFeatures=function(m,C,L){var Z=C.properties.id===m.line.id;if(C.properties.active=Z?xt.ACTIVE:xt.INACTIVE,!Z)return L(C);C.geometry.coordinates.length<2||(C.properties.meta=Rt.FEATURE,L(jt(m.line.id,C.geometry.coordinates["forward"===m.direction?C.geometry.coordinates.length-2:1],""+("forward"===m.direction?C.geometry.coordinates.length-2:1),!1)),L(C))};var xr={simple_select:ti,direct_select:jr,draw_point:Mi,draw_polygon:yo,draw_line_string:vr},ps={defaultMode:He.SIMPLE_SELECT,keybindings:!0,touchEnabled:!0,clickBuffer:2,touchBuffer:25,boxSelect:!0,displayControlsDefault:!0,styles:z,modes:xr,controls:{},userProperties:!1},Po={point:!0,line_string:!0,polygon:!0,trash:!0,combine_features:!0,uncombine_features:!0},Gi={point:!1,line_string:!1,polygon:!1,trash:!1,combine_features:!1,uncombine_features:!1};function wi(m,C){return m.map(function(L){return L.source?L:Y(L,{id:L.id+"."+C,source:"hot"===C?Ce.HOT:Ce.COLD})})}var Wn={exports:{}};!function(m,C){var L="__lodash_hash_undefined__",Z=9007199254740991,ie="[object Arguments]",re="[object Array]",de="[object Boolean]",qe="[object Date]",it="[object Error]",gt="[object Function]",_t="[object Map]",lt="[object Number]",Yt="[object Object]",$i="[object Promise]",ii="[object RegExp]",rr="[object Set]",Ne="[object String]",Ii="[object WeakMap]",Zi="[object ArrayBuffer]",Hi="[object DataView]",Jr=/^\[object .+?Constructor\]$/,ms=/^(?:0|[1-9]\d*)$/,Di={};Di["[object Float32Array]"]=Di["[object Float64Array]"]=Di["[object Int8Array]"]=Di["[object Int16Array]"]=Di["[object Int32Array]"]=Di["[object Uint8Array]"]=Di["[object Uint8ClampedArray]"]=Di["[object Uint16Array]"]=Di["[object Uint32Array]"]=!0,Di[ie]=Di[re]=Di[Zi]=Di[de]=Di[Hi]=Di[qe]=Di[it]=Di[gt]=Di[_t]=Di[lt]=Di[Yt]=Di[ii]=Di[rr]=Di[Ne]=Di[Ii]=!1;var Ao="object"==typeof global&&global&&global.Object===Object&&global,fs="object"==typeof self&&self&&self.Object===Object&&self,Hr=Ao||fs||Function("return this")(),qn=C&&!C.nodeType&&C,di=qn&&m&&!m.nodeType&&m,Zo=di&&di.exports===qn,$r=Zo&&Ao.process,Yr=function(){try{return $r&&$r.binding&&$r.binding("util")}catch{}}(),gs=Yr&&Yr.isTypedArray;function _s(ue,we){for(var ct=-1,Vt=null==ue?0:ue.length;++ct<Vt;)if(we(ue[ct],ct,ue))return!0;return!1}function ys(ue){var we=-1,ct=Array(ue.size);return ue.forEach(function(Vt,Ui){ct[++we]=[Ui,Vt]}),ct}function Ws(ue){var we=-1,ct=Array(ue.size);return ue.forEach(function(Vt){ct[++we]=Vt}),ct}var vs,Wo,xs,qs=Array.prototype,qo=Object.prototype,ws=Hr["__core-js_shared__"],vo=Function.prototype.toString,Fn=qo.hasOwnProperty,la=(vs=/[^.]+$/.exec(ws&&ws.keys&&ws.keys.IE_PROTO||""))?"Symbol(src)_1."+vs:"",ca=qo.toString,Ta=RegExp("^"+vo.call(Fn).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ua=Zo?Hr.Buffer:void 0,Cs=Hr.Symbol,Ss=Hr.Uint8Array,Ko=qo.propertyIsEnumerable,Ks=qs.splice,Kn=Cs?Cs.toStringTag:void 0,xo=Object.getOwnPropertySymbols,ha=ua?ua.isBuffer:void 0,da=(Wo=Object.keys,xs=Object,function(ue){return Wo(xs(ue))}),Xo=bo(Hr,"DataView"),In=bo(Hr,"Map"),Ms=bo(Hr,"Promise"),Bn=bo(Hr,"Set"),ro=bo(Hr,"WeakMap"),ko=bo(Object,"create"),Xs=ao(Xo),Si=ao(In),Wi=ao(Ms),Pa=ao(Bn),fi=ao(ro),no=Cs?Cs.prototype:void 0,Ni=no?no.valueOf:void 0;function Ei(ue){var we=-1,ct=null==ue?0:ue.length;for(this.clear();++we<ct;){var Vt=ue[we];this.set(Vt[0],Vt[1])}}function an(ue){var we=-1,ct=null==ue?0:ue.length;for(this.clear();++we<ct;){var Vt=ue[we];this.set(Vt[0],Vt[1])}}function oo(ue){var we=-1,ct=null==ue?0:ue.length;for(this.clear();++we<ct;){var Vt=ue[we];this.set(Vt[0],Vt[1])}}function Do(ue){var we=-1,ct=null==ue?0:ue.length;for(this.__data__=new oo;++we<ct;)this.add(ue[we])}function En(ue){var we=this.__data__=new an(ue);this.size=we.size}function Lo(ue,we){for(var ct=ue.length;ct--;)if(zo(ue[ct][0],we))return ct;return-1}
vendor: 1,380 bytes, line 1
1function so(ue){return null==ue?void 0===ue?"[object Undefined]":"[object Null]":Kn&&Kn in Object(ue)?function(we){var ct=Fn.call(we,Kn),Vt=we[Kn];try{we[Kn]=void 0;var Ui=!0}catch{}var yi=ca.call(we);return Ui&&(ct?we[Kn]=Vt:delete we[Kn]),yi}(ue):ca.call(ue)}function Es(ue){return Un(ue)&&so(ue)==ie}function Oo(ue,we,ct,Vt,Ui){return ue===we||(null==ue||null==we||!Un(ue)&&!Un(we)?ue!=ue&&we!=we:function(yi,Yi,nr,ar,Qi,Ti){var Qr=wo(yi),Vn=wo(Yi),Ur=Qr?re:Nn(yi),Gn=Vn?re:Nn(Yi),en=(Ur=Ur==ie?Yt:Ur)==Yt,Yo=(Gn=Gn==ie?Yt:Gn)==Yt,Pr=Ur==Gn;if(Pr&&Ds(yi)){if(!Ds(Yi))return!1;Qr=!0,en=!1}if(Pr&&!en)return Ti||(Ti=new En),Qr||Ro(yi)?pa(yi,Yi,nr,ar,Qi,Ti):function(Ri,Pi,es,Tn,co,lr,mt){switch(es){case Hi:if(Ri.byteLength!=Pi.byteLength||Ri.byteOffset!=Pi.byteOffset)return!1;Ri=Ri.buffer,Pi=Pi.buffer;case Zi:return!(Ri.byteLength!=Pi.byteLength||!lr(new Ss(Ri),new Ss(Pi)));case de:case qe:case lt:return zo(+Ri,+Pi);case it:return Ri.name==Pi.name&&Ri.message==Pi.message;case ii:case Ne:return Ri==Pi+"";case _t:var Pn=ys;case rr:if(Pn||(Pn=Ws),Ri.size!=Pi.size&&!(1&Tn))return!1;var Hn=mt.get(Ri);if(Hn)return Hn==Pi;Tn|=2,mt.set(Ri,Pi);var Co=pa(Pn(Ri),Pn(Pi),Tn,co,lr,mt);return mt.delete(Ri),Co;case"[object Symbol]":if(Ni)return Ni.call(Ri)==Ni.call(Pi)}return!1}(yi,Yi,Ur,nr,ar,Qi,Ti);if(!(1&nr)){var ln=en&&Fn.call(yi,"__wrapped__"),Qo=Yo&&Fn.call(Yi,"__wrapped__");
vendor: 6,260 bytes, line 1
1if(ln||Qo){var Xn=ln?yi.value():yi,Jn=Qo?Yi.value():Yi;return Ti||(Ti=new En),Qi(Xn,Jn,nr,ar,Ti)}}return!!Pr&&(Ti||(Ti=new En),function(Ri,Pi,es,Tn,co,lr){var mt=1&es,Pn=Ts(Ri),_n=Pn.length;if(_n!=Ts(Pi).length&&!mt)return!1;for(var Co=_n;Co--;){var st=Pn[Co];if(!(mt?st in Pi:Fn.call(Pi,st)))return!1}var Os=lr.get(Ri);if(Os&&lr.get(Pi))return Os==Pi;var Fo=!0;lr.set(Ri,Pi),lr.set(Pi,Ri);for(var Js=mt;++Co<_n;){var Bo=Ri[st=Pn[Co]],ts=Pi[st];if(Tn)var Hs=mt?Tn(ts,Bo,st,Pi,Ri,lr):Tn(Bo,ts,st,Ri,Pi,lr);if(!(void 0===Hs?Bo===ts||co(Bo,ts,es,Tn,lr):Hs)){Fo=!1;break}Js||(Js="constructor"==st)}if(Fo&&!Js){var is=Ri.constructor,zs=Pi.constructor;is==zs||!("constructor"in Ri)||!("constructor"in Pi)||"function"==typeof is&&is instanceof is&&"function"==typeof zs&&zs instanceof zs||(Fo=!1)}return lr.delete(Ri),lr.delete(Pi),Fo}(yi,Yi,nr,ar,Qi,Ti))}(ue,we,ct,Vt,Oo,Ui))}function pa(ue,we,ct,Vt,Ui,yi){var Yi=1&ct,nr=ue.length,ar=we.length;if(nr!=ar&&!(Yi&&ar>nr))return!1;var Qi=yi.get(ue);if(Qi&&yi.get(we))return Qi==we;var Ti=-1,Qr=!0,Vn=2&ct?new Do:void 0;for(yi.set(ue,we),yi.set(we,ue);++Ti<nr;){var Ur=ue[Ti],Gn=we[Ti];if(Vt)var en=Yi?Vt(Gn,Ur,Ti,we,ue,yi):Vt(Ur,Gn,Ti,ue,we,yi);if(void 0!==en){if(en)continue;Qr=!1;break}if(Vn){if(!_s(we,function(Yo,Pr){if(!Vn.has(Pr)&&(Ur===Yo||Ui(Ur,Yo,ct,Vt,yi)))return Vn.push(Pr)})){Qr=!1;break}}else if(Ur!==Gn&&!Ui(Ur,Gn,ct,Vt,yi)){Qr=!1;break}}return yi.delete(ue),yi.delete(we),Qr}function Ts(ue){return Vt=As,Ui=function Ls(ue){return null!=(we=ue)&&lo(we.length)&&!qi(we)?function Is(ue,we){var ct=wo(ue),Vt=!ct&&ks(ue),Ui=!ct&&!Vt&&Ds(ue),yi=!ct&&!Vt&&!Ui&&Ro(ue),Yi=ct||Vt||Ui||yi,nr=Yi?function(Ti,Qr){for(var Vn=-1,Ur=Array(Ti);++Vn<Ti;)Ur[Vn]=Qr(Vn);return Ur}(ue.length,String):[],ar=nr.length;for(var Qi in ue)!we&&!Fn.call(ue,Qi)||Yi&&("length"==Qi||Ui&&("offset"==Qi||"parent"==Qi)||yi&&("buffer"==Qi||"byteLength"==Qi||"byteOffset"==Qi)||ma(Qi,ar))||nr.push(Qi);return nr}(ue):function Ho(ue){if(ct=(we=ue)&&we.constructor,we!==("function"==typeof ct&&ct.prototype||qo))return da(ue);var we,ct,Ui=[];for(var yi in Object(ue))Fn.call(ue,yi)&&"constructor"!=yi&&Ui.push(yi);return Ui}(ue);var we}(we=ue),wo(we)?Ui:function(yi,Yi){for(var nr=-1,ar=Yi.length,Qi=yi.length;++nr<ar;)yi[Qi+nr]=Yi[nr];return yi}(Ui,Vt(we));var we,Vt,Ui}function Ps(ue,we){var ct,Vt,Ui=ue.__data__;return("string"==(Vt=typeof(ct=we))||"number"==Vt||"symbol"==Vt||"boolean"==Vt?"__proto__"!==ct:null===ct)?Ui["string"==typeof we?"string":"hash"]:Ui.map}function bo(ue,we){var Vt,Ui,ct=(Vt=ue,Ui=we,Vt?.[Ui]);return function Jo(ue){return!(!Zr(ue)||(we=ue,la&&la in we))&&(qi(ue)?Ta:Jr).test(ao(ue));var we}(ct)?ct:void 0}Ei.prototype.clear=function(){this.__data__=ko?ko(null):{},this.size=0},Ei.prototype.delete=function(ue){var we=this.has(ue)&&delete this.__data__[ue];return this.size-=we?1:0,we},Ei.prototype.get=function(ue){var we=this.__data__;if(ko){var ct=we[ue];return ct===L?void 0:ct}return Fn.call(we,ue)?we[ue]:void 0},Ei.prototype.has=function(ue){var we=this.__data__;return ko?void 0!==we[ue]:Fn.call(we,ue)},Ei.prototype.set=function(ue,we){var ct=this.__data__;return this.size+=this.has(ue)?0:1,ct[ue]=ko&&void 0===we?L:we,this},an.prototype.clear=function(){this.__data__=[],this.size=0},an.prototype.delete=function(ue){var we=this.__data__,ct=Lo(we,ue);return!(ct<0||(ct==we.length-1?we.pop():Ks.call(we,ct,1),--this.size,0))},an.prototype.get=function(ue){var we=this.__data__,ct=Lo(we,ue);return ct<0?void 0:we[ct][1]},an.prototype.has=function(ue){return Lo(this.__data__,ue)>-1},an.prototype.set=function(ue,we){var ct=this.__data__,Vt=Lo(ct,ue);return Vt<0?(++this.size,ct.push([ue,we])):ct[Vt][1]=we,this},oo.prototype.clear=function(){this.size=0,this.__data__={hash:new Ei,map:new(In||an),string:new Ei}},oo.prototype.delete=function(ue){var we=Ps(this,ue).delete(ue);return this.size-=we?1:0,we},oo.prototype.get=function(ue){return Ps(this,ue).get(ue)},oo.prototype.has=function(ue){return Ps(this,ue).has(ue)},oo.prototype.set=function(ue,we){var ct=Ps(this,ue),Vt=ct.size;return ct.set(ue,we),this.size+=ct.size==Vt?0:1,this},Do.prototype.add=Do.prototype.push=function(ue){return this.__data__.set(ue,L),this},Do.prototype.has=function(ue){return this.__data__.has(ue)},En.prototype.clear=function(){this.__data__=new an,this.size=0},En.prototype.delete=function(ue){var we=this.__data__,ct=we.delete(ue);return this.size=we.size,ct},En.prototype.get=function(ue){return this.__data__.get(ue)},En.prototype.has=function(ue){return this.__data__.has(ue)},En.prototype.set=function(ue,we){var ct=this.__data__;if(ct instanceof an){var Vt=ct.__data__;if(!In||Vt.length<199)return Vt.push([ue,we]),this.size=++ct.size,this;ct=this.__data__=new oo(Vt)}return ct.set(ue,we),this.size=ct.size,this};var As=xo?function(ue){return null==ue?[]:(ue=Object(ue),function(we,ct){for(var Vt=-1,Ui=null==we?0:we.length,yi=0,Yi=[];++Vt<Ui;){var nr=we[Vt];ct(nr)&&(Yi[yi++]=nr)}return Yi}(xo(ue),function(we){return Ko.call(ue,we)}))}:function(){return[]},Nn=so;function ma(ue,we){return!!(we=we??Z)&&("number"==typeof ue||ms.test(ue))&&ue>-1&&ue%1==0&&ue<we}function ao(ue){if(null!=ue){try{return vo.call(ue)}catch{}try{return ue+""}catch{}}return""}function zo(ue,we){return ue===we||ue!=ue&&we!=we}(Xo&&Nn(new Xo(new ArrayBuffer(1)))!=Hi||In&&Nn(new In)!=_t||Ms&&Nn(Ms.resolve())!=$i||Bn&&Nn(new Bn)!=rr||ro&&Nn(new ro)!=Ii)&&(Nn=function(ue){var we=so(ue),ct=we==Yt?ue.constructor:void 0,Vt=ct?ao(ct):"";if(Vt)switch(Vt){case Xs:return Hi;case Si:return _t;case Wi:return $i;case Pa:return rr;case fi:return Ii}return we});var ks=Es(function(){return arguments}())?Es:function(ue){return Un(ue)&&Fn.call(ue,"callee")&&!Ko.call(ue,"callee")},wo=Array.isArray,Ds=ha||function(){return!1};function qi(ue){if(!Zr(ue))return!1;var we=so(ue);return we==gt||"[object GeneratorFunction]"==we||"[object AsyncFunction]"==we||"[object Proxy]"==we}function lo(ue){return"number"==typeof ue&&ue>-1&&ue%1==0&&ue<=Z}function Zr(ue){var we=typeof ue;return null!=ue&&("object"==we||"function"==we)}function Un(ue){return null!=ue&&"object"==typeof ue}var Ro=gs?function(ue){return function(we){return ue(we)}}(gs):function(ue){return Un(ue)&&lo(ue.length)&&!!Di[so(ue)]};m.exports=function(ue,we){return Oo(ue,we)}}
1(Wn,Wn.exports);var ji=X(Wn.exports);function jo(m,C){return m.length===C.length&&JSON.stringify(m.map(function(L){return L}).sort())===JSON.stringify(C.map(function(L){return L}).sort())}var gn={Polygon:$t,LineString:wt,Point:ri,MultiPolygon:xi,MultiLineString:xi,MultiPoint:xi},Zs=Object.freeze({__proto__:null,CommonSelectors:zi,constrainFeatureMovement:Ye,createMidPoint:dr,createSupplementaryPoints:Br,createVertex:jt,doubleClickZoom:Bt,euclideanDistance:ht,featuresAt:ze,getFeatureAtAndSetCursors:St,isClick:$e,isEventAtCoordinates:Nr,isTap:We,mapEventToBoundingBox:Oe,ModeHandler:Xt,moveFeatures:Lt,sortFeatures:Ve,stringSetsAreEqual:jo,StringSet:Ie,theme:z,toDenseArray:tr});function $o(m){!function(m,C){var ie,re,L={options:m=function(ie){void 0===ie&&(ie={});var re=Y(ie);return ie.controls||(re.controls={}),re.controls=Y(!1===ie.displayControlsDefault?Gi:Po,ie.controls),(re=Y(ps,re)).styles=wi(re.styles,"cold").concat(wi(re.styles,"hot")),re}(m)};ie=L,(re=C).modes=He,re.getFeatureIdsAt=function(de){return ze.click({point:de},null,ie).map(function(qe){return qe.properties.id})},re.getSelectedIds=function(){return ie.store.getSelectedIds()},re.getSelected=function(){return{type:Be.FEATURE_COLLECTION,features:ie.store.getSelectedIds().map(function(de){return ie.store.get(de)}).map(function(de){return de.toGeoJSON()})}},re.getSelectedPoints=function(){return{type:Be.FEATURE_COLLECTION,features:ie.store.getSelectedCoordinates().map(function(de){return{type:Be.FEATURE,properties:{},geometry:{type:Be.POINT,coordinates:de.coordinates}}})}},re.set=function(de){if(void 0===de.type||de.type!==Be.FEATURE_COLLECTION||!Array.isArray(de.features))throw new Error("Invalid FeatureCollection");var qe=ie.store.createRenderBatch(),it=ie.store.getAllIds().slice(),gt=re.add(de),_t=new Ie(gt);return(it=it.filter(function(lt){return!_t.has(lt)})).length&&re.delete(it),qe(),gt},re.add=function(de){var qe=JSON.parse(JSON.stringify(k(de))).features.map(function(it){if(it.id=it.id||Oi(),null===it.geometry)throw new Error("Invalid geometry: null");if(void 0===ie.store.get(it.id)||ie.store.get(it.id).type!==it.geometry.type){var gt=gn[it.geometry.type];if(void 0===gt)throw new Error("Invalid geometry type: "+it.geometry.type+".");var _t=new gt(ie,it);ie.store.add(_t)}else{var lt=ie.store.get(it.id);lt.properties=it.properties,ji(lt.properties,it.properties)||ie.store.featureChanged(lt.id),ji(lt.getCoordinates(),it.geometry.coordinates)||lt.incomingCoords(it.geometry.coordinates)}return it.id});return ie.store.render(),qe},re.get=function(de){var qe=ie.store.get(de);if(qe)return qe.toGeoJSON()},re.getAll=function(){return{type:Be.FEATURE_COLLECTION,features:ie.store.getAll().map(function(de){return de.toGeoJSON()})}},re.delete=function(de){return ie.store.delete(de,{silent:!0}),re.getMode()!==He.DIRECT_SELECT||ie.store.getSelectedIds().length?ie.store.render():ie.events.changeMode(He.SIMPLE_SELECT,void 0,{silent:!0}),re},re.deleteAll=function(){return ie.store.delete(ie.store.getAllIds(),{silent:!0}),re.getMode()===He.DIRECT_SELECT?ie.events.changeMode(He.SIMPLE_SELECT,void 0,{silent:!0}):ie.store.render(),re},re.changeMode=function(de,qe){return void 0===qe&&(qe={}),de===He.SIMPLE_SELECT&&re.getMode()===He.SIMPLE_SELECT?(jo(qe.featureIds||[],ie.store.getSelectedIds())||
1(ie.store.setSelected(qe.featureIds,{silent:!0}),ie.store.render()),re):(de===He.DIRECT_SELECT&&re.getMode()===He.DIRECT_SELECT&&qe.featureId===ie.store.getSelectedIds()[0]||ie.events.changeMode(de,qe,{silent:!0}),re)},re.getMode=function(){return ie.events.getMode()},re.trash=function(){return ie.events.trash({silent:!0}),re},re.combineFeatures=function(){return ie.events.combineFeatures({silent:!0}),re},re.uncombineFeatures=function(){return ie.events.uncombineFeatures({silent:!0}),re},re.setFeatureProperty=function(de,qe,it){return ie.store.setFeatureProperty(de,qe,it),re},L.api=C=re;var Z=w(L);C.onAdd=Z.onAdd,C.onRemove=Z.onRemove,C.types=ut,C.options=m}(m,this)}return $o.modes=xr,$o.constants=De,$o.lib=Zs,$o}()},8957:(gr,Xt,X)=>{"use strict";X.d(Xt,{lw:()=>pe,RY:()=>$e.R,Tp:()=>Ut.T,cN:()=>ht,zK:()=>x.z,BV:()=>We.BV,aB:()=>et.a,Aj:()=>We.Aj});var Te=X(60177),ke=X(24624),x=X(9215),c=X(67376),Q=X(54438);const pe=new Q.nKC("globe.map.addressInfo");var Ct=X(99936),Ue=X(88498),Ce=X(51188),me=X(73955);const ut=Ke=>["/address",Ke];function Be(Ke,ri){if(1&Ke&&(Q.j41(0,"p",15),Q.EFF(1),Q.k0s()),2&Ke){const wt=Q.XpG(2);Q.R7$(),Q.SpI(" ",wt.addressProperties.additionalParam.unit," ")}}function He(Ke,ri){if(1&Ke&&(Q.j41(0,"div",10)(1,"div",11)(2,"p",12),Q.EFF(3),Q.k0s(),Q.DNE(4,Be,2,1,"p",13),Q.k0s(),Q.j41(5,"p",14),Q.EFF(6),Q.k0s()()),2&Ke){const wt=Q.XpG();Q.R7$(2),Q.xc7("color",wt.fontColorContrast(wt.addressProperties.style.color,.75)),Q.R7$(),Q.SpI(" ",wt.addressProperties.additionalParam.value," "),Q.R7$(),Q.Y8G("ngIf",wt.addressProperties.additionalParam.unit),Q.R7$(2),Q.SpI(" ",wt.addressProperties.additionalParam.timestamp," ")}}let Ze=(()=>{class Ke{set addressProperties(wt){let $t=!1;this._addressProperties?.id!==wt?.id&&!(0,c.isNil)(wt?.id)&&($t=!0),this._addressProperties=wt,$t&&this.onAddressIdChange()}get addressProperties(){return this._addressProperties}get cssMarkerColor(){return this.addressProperties?.style.color}constructor(wt,$t){this.globeMapAddressInfo=wt,this.cdk=$t,this.fontColorContrast=Ct.A,this._addressProperties=null,this.addressAdditionalInfo=null}onAddressIdChange(){this.addressAdditionalInfo=null,this.loadAddressAdditionalData()}loadAddressAdditionalData(){this.globeMapAddressInfo.getAdditionalData(this.addressProperties?.id).subscribe(wt=>{this.addressAdditionalInfo=wt,this.cdk.detectChanges()})}static{this.\u0275fac=function($t){return new($t||Ke)(Q.rXU(pe),Q.rXU(Q.gRc))}}static{this.\u0275cmp=Q.VBU({type:Ke,selectors:[["globe-globe-address-popup"]],hostVars:2,hostBindings:function($t,Qt){2&$t&&Q.xc7("--marker-color",Qt.cssMarkerColor)},inputs:{addressProperties:"addressProperties"},decls:21,vars:16,consts:[["fxLayout","column",1,"main-container"],["fxLayout","column","fxLayoutAlign","start center",1,"base-info",3,"routerLink"],[1,"marker-content"],[1,"marker-background"],["fxLayout","row","fxLayoutAlign","center center",1,"marker-icon"],[1,"marker-icon-mask"],["class","additional-param","fxLayout","column",4,"ngIf"],["fxLayout","row",1,"additional-info"],["fxFlex","50%","fxLayout","column","fxLayoutAlign","center start"],[3,"title","innerHTML"],["fxLayout","column",1,"additional-param"],["fxLayout","row","fxLayoutGap","5px",1,"additional-param-main"],[1,"additional-param-value"],["class","additional-param-unit",4,"ngIf"],[1,"additional-param-timestamp"],[1,"additional-param-unit"]],template:function($t,Qt){if(1&$t&&(Q.j41(0,"div",0)(1,"a",1)(2,"div",2),Q.nrm(3,"div",3),Q.j41(4,"div",4),Q.nrm(5,"div",5),Q.k0s()(),Q.j41(6,"h2"),Q.EFF(7),Q.k0s()(),Q.DNE(8,He,7,5,"div",6),Q.j41(9,"div",7)(10,"div",8)(11,"h3"),Q.EFF(12),Q.nI1(13,"translate"),Q.k0s(),Q.j41(14,"p",9),Q.EFF(15),Q.k0s()(),Q.j41(16,"div",8)(17,"h3"),Q.EFF(18),Q.nI1(19,"translate"),Q.k0s(),Q.nrm(20,"p",9),Q.k0s()()()),2&$t){let Bi,xi;Q.R7$(),Q.Y8G("routerLink",Q.eq3(14,ut,null==Qt.addressProperties?null:Qt.addressProperties.id)),Q.R7$(6),Q.JRh(null==Qt.addressProperties?null:Qt.addressProperties.labelExtended),Q.R7$(),Q.Y8G("ngIf",Qt.addressProperties&&Qt.addressProperties.additionalParam),Q.R7$(4),Q.SpI("",Q.bMT(13,10,"address.fields.route"),":"),Q.R7$(2),Q.Y8G("title",null==Qt.addressAdditionalInfo?null:Qt.addressAdditionalInfo.route)("innerHTML",null!==(Bi=null==Qt.addressAdditionalInfo?null:Qt.addressAdditionalInfo.route)&&void 0!==Bi?Bi:"\xa0",Q.npT),Q.R7$(),Q.SpI(" ",null==Qt.addressAdditionalInfo?null:Qt.addressAdditionalInfo.route," "),Q.R7$(3),Q.SpI("",Q.bMT(19,12,"address.fields.owner"),":"),Q.R7$(2),Q.Y8G("title",null==Qt.addressAdditionalInfo?null:Qt.addressAdditionalInfo.owner)("innerHTML",null!==(xi=null==Qt.addressAdditionalInfo?null:Qt.addressAdditionalInfo.owner)&&void 0!==xi?xi:"\xa0",Q.npT)}},dependencies:[Te.bT,Ue.DJ,Ue.BO,Ue.sA,Ue.UI,Ce.Wk,me.D9],styles:["@keyframes _ngcontent-%COMP%_slideInUp{0%{transform:translateY(20px);opacity:0}
1to{transform:translateY(0);opacity:1}}@keyframes _ngcontent-%COMP%_slideIn{0%{transform:translate(-10px);opacity:0}to{transform:translate(0);opacity:1}}[_nghost-%COMP%]{display:block;background-color:#fff;border-radius:11px;width:240px;overflow:hidden;font-family:Roboto,Helvetica Neue,Helvetica,Arial,sans-serif}.main-container[_ngcontent-%COMP%]{align-items:center}.additional-info[_ngcontent-%COMP%]{background-color:#ececec;height:80px;width:100%}.additional-info[_ngcontent-%COMP%] [_ngcontent-%COMP%]:not(:last-of-type){background-image:url(\"data:image/svg+xml,<svg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'><line x1='100%25' y1='0' x2='100%25' y2='100%25' stroke='%23b0b0b0' stroke-width='2' stroke-dasharray='6%2c 8' stroke-dashoffset='0' stroke-linecap='square'/></svg>\")}.additional-info[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{padding-left:16px;padding-right:5px}.additional-info[_ngcontent-%COMP%] > *[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;color:#afafaf;font-size:12px;font-weight:400}.additional-info[_ngcontent-%COMP%] > *[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;color:#040309;font-size:13px;font-weight:400;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}.base-info[_ngcontent-%COMP%]{all:unset;cursor:pointer;padding:14px}.base-info[_ngcontent-%COMP%] .marker-content[_ngcontent-%COMP%]{width:80px;height:80px;min-width:80px;min-height:80px;border-radius:50%;position:relative;overflow:hidden;margin-bottom:10px}.base-info[_ngcontent-%COMP%] .marker-content[_ngcontent-%COMP%] .marker-background[_ngcontent-%COMP%]{height:calc(100% - 4px);width:calc(100% - 4px);border:2px solid #dbdbdb;border-radius:50%;background-color:var(--marker-color);opacity:.2}.base-info[_ngcontent-%COMP%] .marker-content[_ngcontent-%COMP%] .marker-icon[_ngcontent-%COMP%]{position:absolute;top:8px;left:8px;width:64px;height:64px;min-width:64px;min-height:64px;border:2px solid var(--marker-color);border-radius:50%;background-color:#fff}.base-info[_ngcontent-%COMP%] .marker-content[_ngcontent-%COMP%] .marker-icon[_ngcontent-%COMP%] .marker-icon-mask[_ngcontent-%COMP%]{-webkit-mask-image:url(/assets/address-marker.png);mask-image:url(/assets/address-marker.png);background-color:var(--marker-color);width:36px;height:36px;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;-webkit-mask-position:center;mask-position:center}.base-info[_ngcontent-%COMP%] > h2[_ngcontent-%COMP%]{margin:0;color:#040309;font-size:14px;font-weight:700;text-align:center}.additional-param[_ngcontent-%COMP%]{background-color:#040309;color:#fff;font-size:13px;width:180px;margin-bottom:-15px;z-index:1;border-radius:8px;align-items:center;justify-content:space-around;padding:3px 3px 0}.additional-param[_ngcontent-%COMP%] .additional-param-main[_ngcontent-%COMP%]{justify-content:space-between;width:100%}.additional-param[_ngcontent-%COMP%] .additional-param-main[_ngcontent-%COMP%] .additional-param-value[_ngcontent-%COMP%]{width:inherit;background-color:var(--marker-color);height:21px;border-radius:5px;text-align:right;margin:0;line-height:21px;padding-right:5px;padding-left:5px;min-width:50px;overflow:hidden;text-overflow:ellipsis}.additional-param[_ngcontent-%COMP%] .additional-param-main[_ngcontent-%COMP%] .additional-param-unit[_ngcontent-%COMP%]{width:45%;margin:0 5px 0 0;justify-content:center;text-align:center;overflow:hidden;text-overflow:ellipsis}.additional-param[_ngcontent-%COMP%] .additional-param-timestamp[_ngcontent-%COMP%]{margin:1px 0;font-size:10px}"],changeDetection:0})}}return Ke})();var zt=X(3825),Rt=X(13600),xt=X(11054);const si=Ke=>["/address",Ke],be=Ke=>({"background-color":Ke});function De(Ke,ri){if(1&Ke&&(Q.j41(0,"a",3),Q.nrm(1,"div",4),Q.j41(2,"h5",5),Q.EFF(3),Q.k0s()()),2&Ke){const wt=ri.$implicit;Q.Y8G("routerLink",Q.eq3(4,si,wt.id)),Q.R7$(),Q.Y8G("ngStyle",Q.eq3(6,be,wt.style.color)),Q.R7$(),Q.Y8G("title",wt.label),Q.R7$(),Q.JRh(wt.label)}}function Ae(Ke,ri){if(1&Ke&&(Q.j41(0,"div",1),Q.DNE(1,De,4,8,"a",2),Q.k0s()),2&Ke){const wt=Q.XpG();Q.R7$(),Q.Y8G("ngForOf",wt.addresses)}}let Me=(()=>{class Ke{constructor(){this._addresses=null}set addresses(wt){this._addresses=wt?(0,c.orderBy)(wt,[$t=>{const Qt=$t.labelExtended.toLowerCase(),[Bi,xi]=Qt.split(", ");return[xi,Bi]}]):null}get addresses(){return this._addresses}static{this.\u0275fac=function($t){return new($t||Ke)}}static{this.\u0275cmp=Q.VBU({type:Ke,selectors:[["globe-globe-address-cluster-popup"]],inputs:{addresses:"addresses"},decls:1,vars:1,consts:[["class","addresses-container",3,"perfectScrollbar",4,"ngIf"],[1,"addresses-container",3,"perfectScrollbar"],["class","address-item","fxLayout","row","fxLayoutAlign","start center",3,"routerLink",4,"ngFor","ngForOf"],["fxLayout","row","fxLayoutAlign","start center",1,"address-item",3,"routerLink"],[1,"address-item-marker",3,"ngStyle"],[3,"title"]],template:function($t,Qt){1&$t&&Q.DNE(0,Ae,2,1,"div",0),2&$t&&Q.Y8G("ngIf",Qt.addresses)},dependencies:[Te.Sq,Te.bT,Te.B3,Ue.DJ,Ue.sA,Rt.eI,Ce.Wk,xt.Ld],styles:["@keyframes _ngcontent-%COMP%_slideInUp{0%{transform:translateY(20px);opacity:0}
1to{transform:translateY(0);opacity:1}}@keyframes _ngcontent-%COMP%_slideIn{0%{transform:translate(-10px);opacity:0}to{transform:translate(0);opacity:1}}[_nghost-%COMP%]{display:block;background-color:#040309;color:#fff;border-radius:11px;width:240px;font-family:Roboto,Helvetica Neue,Helvetica,Arial,sans-serif}[_nghost-%COMP%] .addresses-container[_ngcontent-%COMP%]{max-height:calc((100vh - 55px)*.3);overflow-x:auto}[_nghost-%COMP%] .addresses-container[_ngcontent-%COMP%] .address-item[_ngcontent-%COMP%]{all:unset;cursor:pointer;height:38px}[_nghost-%COMP%] .addresses-container[_ngcontent-%COMP%] .address-item[_ngcontent-%COMP%] .address-item-marker[_ngcontent-%COMP%]{-webkit-mask-image:url(/assets/address-marker.png);mask-image:url(/assets/address-marker.png);width:16px;height:16px;min-width:16px;min-height:16px;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;-webkit-mask-position:center;mask-position:center;margin:0 15px}[_nghost-%COMP%] .addresses-container[_ngcontent-%COMP%] .address-item[_ngcontent-%COMP%] h5[_ngcontent-%COMP%]{margin:0;font-size:14px;font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"],changeDetection:0})}}return Ke})();var Ve=X(7828);function Oe(Ke,ri){if(1&Ke&&(Q.j41(0,"div")(1,"div"),Q.EFF(2),Q.k0s()()),2&Ke){const wt=ri.$implicit;Q.R7$(2),Q.Lme("",wt.field.name,": ",wt.value,"")}}function Ie(Ke,ri){if(1&Ke&&(Q.j41(0,"div")(1,"div"),Q.EFF(2),Q.k0s(),Q.j41(3,"div"),Q.EFF(4),Q.k0s(),Q.DNE(5,Oe,3,2,"div",1),Q.k0s()),2&Ke){const wt=Q.XpG();Q.R7$(2),Q.SpI("Nazwa: ",wt.layer.name,""),Q.R7$(2),Q.SpI("Id: ",wt.layer.id,""),Q.R7$(),Q.Y8G("ngForOf",wt.layer.attributes)}}let Qe=(()=>{class Ke{constructor(){this._layer=null}set layer(wt){this._layer=wt}get layer(){return this._layer}static{this.\u0275fac=function($t){return new($t||Ke)}}static{this.\u0275cmp=Q.VBU({type:Ke,selectors:[["globe-layer-popup"]],inputs:{layer:"layer"},decls:1,vars:1,consts:[[4,"ngIf"],[4,"ngFor","ngForOf"]],template:function($t,Qt){1&$t&&Q.DNE(0,Ie,6,3,"div",0),2&$t&&Q.Y8G("ngIf",Qt.layer)},dependencies:[Te.Sq,Te.bT],styles:["@keyframes _ngcontent-%COMP%_slideInUp{0%{transform:translateY(20px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes _ngcontent-%COMP%_slideIn{0%{transform:translate(-10px);opacity:0}to{transform:translate(0);opacity:1}}[_nghost-%COMP%]{overflow:auto;max-height:400px;display:block;background-color:#fff;border-radius:11px;height:100%;font-family:Roboto,Helvetica Neue,Helvetica,Arial,sans-serif}[_nghost-%COMP%] {padding:20px}[_nghost-%COMP%] .ps__rail-y{left:unset!important;right:0}"],changeDetection:0})}}return Ke})();var ze=X(12497),Gt=X(58981),St=X(99213);let ht=(()=>{class Ke{static{this.\u0275fac=function($t){return new($t||Ke)}}static{this.\u0275mod=Q.$C({type:Ke})}static{this.\u0275inj=Q.G2t({imports:[Te.MD,ke.H5,zt.YF,Ce.iI,Ve.aS,xt.U$,Gt.dJ,St.m_]})}}return Ke})();Q.wjB(x.P,[Te.Sq,Te.bT,ke.iY,ke.VW,ke.hw,ke.UL,ke.C6,ke.JD,ke.yG,xt.Ld,Ze,Me,Qe,ze.Q],[]);var $e=X(44103),We=X(39546),et=X(22532),Ut=X(7735);X(58759)},9215:(gr,Xt,X)=>{"use strict";X.d(Xt,{P:()=>Ci,z:()=>ci});var Te=X(10467),ke=X(31635),x=X(54438),c=X(71318),Q=X(67376),Ct=X(10044),Ce=X(84412),me=X(21413),ut=X(23294),Be=X(70152),He=X(39546),Ze=X(79382),zt=X(49894),Rt=X(69508);const xt=["addressSource"],si=["statisticsSource"],be=_e=>[_e],De=()=>({sdf:!0,pixelRatio:1}),Ae=()=>["get","styleWithHighestPriority"],Me=_e=>["get","color",_e],Ve=_e=>({"circle-radius":35,"circle-color":_e,"circle-opacity":.22}),Oe=()=>["==","cluster",!0],Ie=_e=>({"circle-radius":18,"circle-color":_e,"circle-stroke-width":2,"circle-stroke-color":"#ffffff"}),Qe=()=>["Noto Sans Regular"],ze=_e=>({"text-field":"{point_count_abbreviated}","text-size":14,"text-font":_e,"text-overlap":"always"}),Gt=()=>({"text-color":"#FFFFFF"}),St=()=>({"icon-image":"address-marker-image","icon-anchor":"bottom","icon-overlap":"always"}),ht=()=>["get","style"],$e=_e=>({"icon-color":_e}),We=()=>["!=","cluster",!0],et=()=>({"circle-radius":35,"circle-color":"#ff7518","circle-opacity":.22}),Ut=()=>({"circle-radius":18,"circle-color":"#ff7518","circle-stroke-width":2,"circle-stroke-color":"#ffffff"}),Oi=()=>({"icon-color":"#ff7518"}),Ke=()=>["Noto Sans Bold"],ri=_e=>[0,_e],wt=(_e,ge)=>({"text-field":"{companyName}","text-size":16,"text-font":_e,"text-anchor":"bottom","text-offset":ge,"text-overlap":"always","icon-image":"label-icon","icon-text-fit":"both","icon-overlap":"always"}),$t=()=>({"text-color":"#000000"}),Qt=_e=>({bottom:_e}),Bi=()=>["geometry-type"],xi=_e=>["==",_e,"LineString"],Ft=_e=>["get","line-style",_e],Mn=_e=>["==",_e,0],_r=(_e,ge)=>
1["all",_e,ge],Vr=_e=>["get","line-color",_e],tr=_e=>["get","line-opacity",_e],Cr=(_e,ge)=>["*",_e,ge],li=_e=>["get","line-width",_e],Xr=()=>[1,4],Sr=(_e,ge,se,je)=>({"line-color":_e,"line-opacity":ge,"line-width":se,"line-dasharray":je}),sn=_e=>["==",_e,1],Y=()=>[4,4],ei=_e=>["==",_e,2],w=()=>[1,0],z=()=>["==","$type","Polygon"],Ee=_e=>["get","fill-color",_e],ft=_e=>["get","fill-opacity",_e],oi=(_e,ge)=>({"fill-color":_e,"fill-opacity":ge}),mi=_e=>["==",_e,"Polygon"],ki=()=>["get","contourStyle"],Mr=()=>["==","$type","Point"],yr=_e=>["get","circle-color",_e],Ir=_e=>["get","circle-opacity",_e],tt=()=>["exponential",2],Er=()=>["zoom"],zi=_e=>["get","circle-radius",_e],Rn=_e=>["*",_e,.1],Tr=_e=>["*",_e,22],nt=(_e,ge,se,je)=>["interpolate",_e,ge,0,se,20,je],Ht=_e=>["get","circle-stroke-width",_e],jt=_e=>["*",_e,2],dr=(_e,ge,se)=>["interpolate",_e,ge,0,0,20,se],Br=_e=>["get","circle-stroke-color",_e],Bt=_e=>["get","circle-stroke-opacity",_e],Gr=(_e,ge,se,je,Ye,Lt)=>({"circle-color":_e,"circle-opacity":ge,"circle-radius":se,"circle-stroke-width":je,"circle-stroke-color":Ye,"circle-stroke-opacity":Lt}),G=_e=>({"raster-opacity":_e}),P=(_e,ge)=>({"line-color":_e,"line-width":ge});function k(_e,ge){if(1&_e&&x.nrm(0,"mgl-geojson-source",20,1),2&_e){const se=x.XpG(2);x.Y8G("cluster",!0)("clusterMaxZoom",18)("clusterRadius",55)("data",se.statisticsFeatureCollectionUrl)}}function F(_e,ge){1&_e&&x.nrm(0,"mgl-layer",21),2&_e&&x.Y8G("source","statistics-source")("paint",x.lJ4(3,et))("filter",x.lJ4(4,Oe))}function j(_e,ge){if(1&_e){const se=x.RV6();x.j41(0,"mgl-layer",22),x.bIt("layerClick",function(Ye){x.eBV(se);const Lt=x.XpG(2);return x.Njj(Lt.onStatisticsClusterClick(Ye))}),x.k0s()}2&_e&&x.Y8G("source","statistics-source")("paint",x.lJ4(3,Ut))("filter",x.lJ4(4,Oe))}function W(_e,ge){1&_e&&x.nrm(0,"mgl-layer",23),2&_e&&x.Y8G("source","statistics-source")("filter",x.lJ4(4,Oe))("layout",x.eq3(6,ze,x.lJ4(5,Qe)))("paint",x.lJ4(8,Gt))}function ce(_e,ge){if(1&_e){const se=x.RV6();x.j41(0,"mgl-layer",24),x.bIt("layerClick",function(Ye){x.eBV(se);const Lt=x.XpG(2);return x.Njj(Lt.onStatisticClick(Ye))}),x.k0s()}2&_e&&x.Y8G("source","statistics-source")("layout",x.lJ4(4,St))("paint",x.lJ4(5,Oi))("filter",x.lJ4(6,We))}function ee(_e,ge){1&_e&&x.nrm(0,"mgl-layer",25),2&_e&&x.Y8G("source","statistics-source")("minzoom",10)("layout",x.l_i(8,wt,x.lJ4(5,Ke),x.eq3(6,ri,-3.75)))("paint",x.lJ4(11,$t))("filter",x.lJ4(12,We))}function J(_e,ge){if(1&_e){const se=x.RV6();x.j41(0,"mgl-popup",26),x.bIt("popupOpen",function(){x.eBV(se);const Ye=x.XpG(2);return x.Njj(Ye.addressPopupOpen=!0)})("popupClose",function(){x.eBV(se);const Ye=x.XpG(2);return x.Njj(Ye.addressPopupOpen=!1)}),x.nrm(1,"globe-client-stats-popup",27),x.k0s()}if(2&_e){const se=x.XpG(2);x.Y8G("lngLat",se.getStatisticLngLat(se.lastClickedStatistic))("offset",x.eq3(8,Qt,x.eq3(6,ri,-44)))("maxWidth","300px")("closeOnClick",!0)("closeButton",!1),x.R7$(),x.Y8G("statisticsProperties",se.lastClickedStatistic.properties)}}function ne(_e,ge){if(1&_e){const se=x.RV6();x.j41(0,"mgl-popup",28),x.bIt("popupOpen",function(){x.eBV(se);const Ye=x.XpG(2);return x.Njj(Ye.addressPopupOpen=!0)})("popupClose",function(){x.eBV(se);const Ye=x.XpG(2);return x.Njj(Ye.addressPopupOpen=!1)}),x.nrm(1,"globe-globe-address-popup",29),x.k0s()}if(2&_e){const se=x.XpG(2);x.Y8G("feature",se.lastClickedAddress)("offset",x.eq3(7,Qt,x.eq3(5,ri,-44)))("closeOnClick",!0)("closeButton",!1),x.R7$(),x.Y8G("addressProperties",se.lastClickedAddress.properties)}}function Se(_e,ge){if(1&_e&&x.nrm(0,"globe-globe-address-cluster-popup",31),2&_e){const se=x.XpG(3);x.Y8G("addresses",se.lastClickedAddressCluster.properties)}}function Pe(_e,ge){if(1&_e){const se=x.RV6();x.j41(0,"mgl-popup",28),x.bIt("popupOpen",function(){x.eBV(se);const Ye=x.XpG(2);return x.Njj(Ye.clusterPopupOpen=!0)})("popupClose",function(){x.eBV(se);const Ye=x.XpG(2);return x.Njj(Ye.clusterPopupOpen=!1)}),x.DNE(1,Se,1,1,"globe-globe-address-cluster-popup",30),x.k0s()}if(2&_e){const se=x.XpG(2);x.Y8G("feature",se.lastClickedAddressCluster)("offset",x.eq3(7,Qt,x.eq3(5,ri,-44)))("closeOnClick",!0)("closeButton",!1),x.R7$(),x.Y8G("ngIf",se.clusterPopupOpen)}}function Le(_e,ge){if(1&_e){const se=x.RV6();x.qex(0),x.nrm(1,"mgl-geojson-source",7,0)(3,"mgl-layer",8),x.j41(4,"mgl-layer",9),x.bIt("layerClick",function(Ye){x.eBV(se);const Lt=x.XpG();return x.Njj(Lt.onClusterClick(Ye))}),x.k0s(),x.nrm(5,"mgl-layer",10),x.j41(6,"mgl-layer",11),x.bIt("layerClick",function(Ye){x.eBV(se);const Lt=x.XpG();
1return x.Njj(Lt.onAddressClick(Ye))}),x.k0s(),x.DNE(7,k,2,4,"mgl-geojson-source",12)(8,F,1,5,"mgl-layer",13)(9,j,1,5,"mgl-layer",14)(10,W,1,9,"mgl-layer",15)(11,ce,1,7,"mgl-layer",16)(12,ee,1,13,"mgl-layer",17)(13,J,2,10,"mgl-popup",18)(14,ne,2,9,"mgl-popup",19)(15,Pe,2,9,"mgl-popup",19),x.bVm()}if(2&_e){const se=x.XpG();x.R7$(),x.Y8G("cluster",!0)("clusterMaxZoom",18)("clusterRadius",55)("clusterProperties",se.clusterProperties)("data",se.addressesFeatureCollection),x.R7$(2),x.Y8G("source","address-source")("paint",x.eq3(31,Ve,x.eq3(29,Me,x.lJ4(28,Ae))))("filter",x.lJ4(33,Oe)),x.R7$(),x.Y8G("source","address-source")("paint",x.eq3(37,Ie,x.eq3(35,Me,x.lJ4(34,Ae))))("filter",x.lJ4(39,Oe)),x.R7$(),x.Y8G("source","address-source")("filter",x.lJ4(40,Oe))("layout",x.eq3(42,ze,x.lJ4(41,Qe)))("paint",x.lJ4(44,Gt)),x.R7$(),x.Y8G("source","address-source")("layout",x.lJ4(45,St))("paint",x.eq3(49,$e,x.eq3(47,Me,x.lJ4(46,ht))))("filter",x.lJ4(51,We)),x.R7$(),x.Y8G("ngIf",se.statisticsFeatureCollectionUrl),x.R7$(),x.Y8G("ngIf",se.statisticsFeatureCollectionUrl),x.R7$(),x.Y8G("ngIf",se.statisticsFeatureCollectionUrl),x.R7$(),x.Y8G("ngIf",se.statisticsFeatureCollectionUrl),x.R7$(),x.Y8G("ngIf",se.statisticsFeatureCollectionUrl),x.R7$(),x.Y8G("ngIf",se.statisticsFeatureCollectionUrl),x.R7$(),x.Y8G("ngIf",se.lastClickedStatistic),x.R7$(),x.Y8G("ngIf",se.lastClickedAddress),x.R7$(),x.Y8G("ngIf",se.lastClickedAddressCluster)}}function It(_e,ge){if(1&_e&&(x.j41(0,"mgl-popup",32),x.nrm(1,"globe-layer-popup",33),x.k0s()),2&_e){const se=x.XpG();x.Y8G("feature",se.lastClickedLayer)("offset",x.eq3(7,Qt,x.eq3(5,ri,-44)))("closeOnClick",!0)("closeButton",!1),x.R7$(),x.Y8G("layer",se.lastClickedLayer.properties)}}function Zt(_e,ge){if(1&_e){const se=x.RV6();x.qex(0),x.nrm(1,"mgl-geojson-source",34),x.j41(2,"mgl-layer",35),x.bIt("layerMouseOver",function(){x.eBV(se);const Ye=x.XpG(2);return x.Njj(Ye.onMouseEnterLayer())})("layerMouseLeave",function(){x.eBV(se);const Ye=x.XpG(2);return x.Njj(Ye.onMouseLeaveLayer())})("layerClick",function(Ye){x.eBV(se);const Lt=x.XpG(2);return x.Njj(Lt.onLayerClick(Ye))}),x.k0s(),x.j41(3,"mgl-layer",35),x.bIt("layerMouseOver",function(){x.eBV(se);const Ye=x.XpG(2);return x.Njj(Ye.onMouseEnterLayer())})("layerMouseLeave",function(){x.eBV(se);const Ye=x.XpG(2);return x.Njj(Ye.onMouseLeaveLayer())})("layerClick",function(Ye){x.eBV(se);const Lt=x.XpG(2);return x.Njj(Lt.onLayerClick(Ye))}),x.k0s(),x.j41(4,"mgl-layer",35),x.bIt("layerMouseOver",function(){x.eBV(se);const Ye=x.XpG(2);return x.Njj(Ye.onMouseEnterLayer())})("layerMouseLeave",function(){x.eBV(se);const Ye=x.XpG(2);return x.Njj(Ye.onMouseLeaveLayer())})("layerClick",function(Ye){x.eBV(se);const Lt=x.XpG(2);return x.Njj(Lt.onLayerClick(Ye))}),x.k0s(),x.j41(5,"mgl-layer",36),x.bIt("layerMouseOver",function(){x.eBV(se);const Ye=x.XpG(2);return x.Njj(Ye.onMouseEnterLayer())})("layerMouseLeave",function(){x.eBV(se);const Ye=x.XpG(2);return x.Njj(Ye.onMouseLeaveLayer())})("layerClick",function(Ye){x.eBV(se);const Lt=x.XpG(2);return x.Njj(Lt.onLayerClick(Ye))}),x.k0s(),x.j41(6,"mgl-layer",37),x.bIt("layerClick",function(Ye){x.eBV(se);const Lt=x.XpG(2);return x.Njj(Lt.onLayerClick(Ye))}),x.k0s(),x.j41(7,"mgl-layer",37),x.bIt("layerClick",function(Ye){x.eBV(se);const Lt=x.XpG(2);return x.Njj(Lt.onLayerClick(Ye))}),x.k0s(),x.j41(8,"mgl-layer",37),x.bIt("layerClick",function(Ye){x.eBV(se);const Lt=x.XpG(2);return x.Njj(Lt.onLayerClick(Ye))}),x.k0s(),x.j41(9,"mgl-layer",38),x.bIt("layerMouseOver",function(){x.eBV(se);const Ye=x.XpG(2);return x.Njj(Ye.onMouseEnterLayer())})("layerMouseLeave",function(){x.eBV(se);const Ye=x.XpG(2);return x.Njj(Ye.onMouseLeaveLayer())})("layerClick",function(Ye){x.eBV(se);const Lt=x.XpG(2);return x.Njj(Lt.onLayerClick(Ye))}),x.k0s(),x.bVm()}if(2&_e){const se=x.XpG().$implicit,je=x.XpG();x.R7$(),x.Y8G("id",se.id)("data",se.sourceUrl),x.R7$(),x.Y8G("id",se.id+"-line-0")("source",se.id)("filter",x.l_i(50,_r,x.eq3(43,xi,x.lJ4(42,Bi)),x.eq3(48,Mn,x.eq3(46,Ft,x.lJ4(45,ht)))))("before",je.isMarkerLayerLoaded())("paint",x.ziG(66,Sr,x.eq3(54,Vr,x.lJ4(53,ht)),x.l_i(59,Cr,x.eq3(57,tr,x.lJ4(56,ht)),se.opacity),x.eq3(63,li,x.lJ4(62,ht)),x.lJ4(65,Xr))),x.R7$(),x.Y8G("id",se.id+"-line-1")("source",se.id)("filter",x.l_i(79,_r,x.eq3(72,xi,x.lJ4(71,Bi)),x.eq3(77,sn,x.eq3(75,Ft,x.lJ4(74,ht)))))("before",je.isMarkerLayerLoaded())("paint",x.ziG(95,Sr,x.eq3(83,Vr,x.lJ4(82,ht)),x.l_i(88,Cr,x.eq3(86,tr,x.lJ4(85,ht)),se.opacity),x.eq3(92,li,x.lJ4(91,ht)),x.lJ4(94,Y))),x.R7$(),x.Y8G("id",se.id+"-line-2")("source",se.id)("filter",x.l_i(108,_r,x.eq3(101,xi,x.lJ4(100,Bi)),x.eq3(106,ei,x.eq3(104,Ft,x.lJ4(103,ht)))))("before",je.isMarkerLayerLoaded())("paint",x.ziG(124,Sr,x.eq3(112,Vr,x.lJ4(111,ht)),x.l_i(117,Cr,x.eq3(115,tr,x.lJ4(114,ht)),se.opacity),x.eq3(121,li,x.lJ4(120,ht)),x.lJ4(123,w))),x.R7$(),x.Y8G("id",se.id+"-polygon")("source",se.id)("filter",x.lJ4(129,z))("before",je.isMarkerLayerLoaded())("paint",x.l_i(139,oi,x.eq3(131,Ee,x.lJ4(130,ht)),x.l_i(136,Cr,x.eq3(134,ft,x.lJ4(133,ht)),se.opacity))),x.R7$(),x.Y8G("id",se.id+"-polygon-contour-0")("source",se.id)("filter",x.l_i(150,_r,x.eq3(143,mi,x.lJ4(142,Bi)),x.eq3(148,Mn,x.eq3(146,Ft,x.lJ4(145,ki)))))("before",je.isMarkerLayerLoaded())("paint",x.ziG(166,Sr,x.eq3(154,Vr,x.lJ4(153,ki)),x.l_i(159,Cr,x.eq3(157,tr,x.lJ4(156,ht)),se.opacity),x.eq3(163,li,x.lJ4(162,ki)),x.lJ4(165,Xr))),x.R7$(),x.Y8G("id",se.id+"-polygon-contour-1")("source",se.id)("filter",x.l_i(179,_r,x.eq3(172,mi,x.lJ4(171,Bi)),x.eq3(177,sn,x.eq3(175,Ft,x.lJ4(174,ki)))))("before",je.isMarkerLayerLoaded())("paint",x.ziG(195,Sr,x.eq3(183,Vr,x.lJ4(182,ki)),x.l_i(188,Cr,x.eq3(186,tr,x.lJ4(185,ht)),se.opacity),x.eq3(192,li,x.lJ4(191,ki)),x.lJ4(194,Y))),x.R7$(),x.Y8G("id",se.id+"-polygon-contour-2")("source",se.id)("filter",x.l_i(208,_r,x.eq3(201,mi,x.lJ4(200,Bi)),x.eq3(206,ei,x.eq3(204,Ft,x.lJ4(203,ki)))))("before",je.isMarkerLayerLoaded())("paint",x.ziG(224,Sr,x.eq3(212,Vr,x.lJ4(211,ki)),x.l_i(217,Cr,x.eq3(215,tr,x.lJ4(214,ht)),se.opacity),x.eq3(221,li,x.lJ4(220,ki)),x.lJ4(223,w))),x.R7$(),x.Y8G("id",se.id+"-point")("source",se.id)("filter",x.lJ4(229,Mr))("before",je.isMarkerLayerLoaded())("paint",x.l4e(273,Gr,x.eq3(231,yr,x.lJ4(230,ht)),x.l_i(236,Cr,x.eq3(234,Ir,x.lJ4(233,ht)),se.opacity),x.ziG(251,nt,x.lJ4(239,tt),x.lJ4(240,Er),x.eq3(244,Rn,x.eq3(242,zi,x.lJ4(241,ht))),x.eq3(249,Tr,x.eq3(247,zi,x.lJ4(246,ht)))),x.sMw(263,dr,x.lJ4(256,tt),x.lJ4(257,Er),x.eq3(261,jt,x.eq3(259,Ht,x.lJ4(258,ht)))),x.eq3(268,Br,x.lJ4(267,ht)),x.eq3(271,Bt,x.lJ4(270,ht))))}}function bt(_e,ge){if(1&_e&&(x.qex(0),x.nrm(1,"mgl-raster-source",39)(2,"mgl-layer",40),x.bVm()),2&_e){const se=x.XpG().$implicit;x.R7$(),x.Y8G("tiles",x.eq3(6,be,se.sourceUrl))("tileSize",256)("id",se.id+"source"),x.R7$(),x.Y8G("id",se.id+"layer")("source",se.id+"source")("paint",x.eq3(8,G,se.opacity))}}function Pt(_e,ge){if(1&_e&&(x.qex(0),x.DNE(1,Zt,10,280,"ng-container",4)(2,bt,3,10,"ng-container",4),x.bVm()),2&_e){const se=ge.$implicit,je=x.XpG();x.R7$(),x.Y8G("ngIf",se.layerType===je.LayerPropertiesType.Geojson),x.R7$(),x.Y8G("ngIf",se.layerType===je.LayerPropertiesType.WMS)}}function Kt(_e,ge){if(1&_e&&(x.qex(0),x.nrm(1,"mgl-canvas-source",42)(2,"mgl-layer",43),x.bVm()),2&_e){const se=ge.$implicit,je=ge.index;x.R7$(),x.Y8G("id","kriging-canvas-source-"+je)("canvas",se.canvas)("coordinates",se.bBox),x.R7$(),x.Y8G("id","kriging-canvas-"+je)("source","kriging-canvas-source-"+je)("before","addresses-cluster-shadow")("paint",x.eq3(7,G,se.opacity))}}function bi(_e,ge){if(1&_e&&(x.qex(0),x.DNE(1,Kt,3,9,"ng-container",41),x.bVm()),2&_e){const se=x.XpG();x.R7$(),x.Y8G("ngForOf",se.canvas)}}function ni(_e,ge){if(1&_e&&(x.qex(0),x.nrm(1,"mgl-geojson-source",34)(2,"mgl-geojson-source",34)(3,"mgl-layer",44)(4,"mgl-layer",44),x.bVm()),2&_e){const se=ge.$implicit;x.R7$(),x.Y8G("id","balancing-group-source-"+se.id)("data",se.source),x.R7$(),x.Y8G("id","balancing-group-outline-source-"+se.id)("data",se.outlineSource),x.R7$(),x.Y8G("id","balancing-group-fill-"+se.id)("source","balancing-group-source-"+se.id)("before","addresses-cluster-shadow")("type","fill")("paint",x.l_i(14,oi,se.paint.fill.color,se.paint.fill.opacity)),x.R7$(),x.Y8G("id","balancing-group-outline-"+se.id)("source","balancing-group-outline-source-"+se.id)("before","addresses-cluster-shadow")("type","line")("paint",x.l_i(17,P,se.paint.outline.color,se.paint.outline.width))}}function hi(_e,ge){if(1&_e&&(x.qex(0),x.DNE(1,ni,5,20,"ng-container",41),x.bVm()),2&_e){const se=x.XpG();x.R7$(),x.Y8G("ngForOf",se.balancedGroups)}}var ci=function(_e){return _e[_e.Geojson=0]="Geojson",_e[_e.WMS=1]="WMS",_e}(ci||{});const sr={features:[],type:"FeatureCollection"};let Ci=class Tc{set disableAddressesCenter(ge){this._disableAddressesCenter=ge}get disableAddressesCenter(){return this._disableAddressesCenter}set mapPosition(ge){ge&&(this.mapZoom=ge.zoom,this.mapCenter=[ge.center[0],ge.center[1]],this.mapBearing=ge.bearing,this.mapPitch=ge.pitch)}set layerFeatureCollection(ge){ge&&(this._layerFeatureCollection=ge,this.lastClickedLayer=null,this.cdk.detectChanges())}get layerFeatureCollection(){return this._layerFeatureCollection}set areaFeatureCollection(ge){ge?(this._areaFeatureCollection=ge,this.showAreas()):this.draw?.deleteAll()}get areaFeatureCollection(){return this._areaFeatureCollection}set draw(ge){ge&&(this._draw=ge)}get draw(){return this._draw}set canvas(ge){this._canvas=ge||null}get canvas(){return this._canvas}set objectsArea(ge){ge?(this._objectsArea=ge,this.drawSingleArea(ge)):this._objectsArea=null}set balancedGroups(ge){ge&&(this._balancedGroups=ge)}get balancedGroups(){return this._balancedGroups}get addressesFeatureCollection(){return this._addressesFeatureCollection}set addressesFeatureCollection(ge){if(ge){this.basicFeatures=ge,this.basicFeaturesSubject.next(ge),this.closePopups(),URL.revokeObjectURL(this._addressesFeatureCollection);const se=new Blob([JSON.stringify(ge)],{type:"application/geo+json"}),je=URL.createObjectURL(se);this._addressesFeatureCollection=je}else this._addressesFeatureCollection=sr}get statisticsFeatureCollection(){return this._originalStatisticsData}set statisticsFeatureCollection(ge){if(ge&&0!==ge.length){this._originalStatisticsData=ge,this.closePopups(),URL.revokeObjectURL(this._statisticsFeatureCollection);const je={type:"FeatureCollection",features:ge.map((ti,Jt)=>({type:"Feature",geometry:{type:"Point",coordinates:[ti.longitude,ti.latitude]},properties:{statisticIndex:Jt,companyName:ti.companyName},id:Jt}))},Ye=new Blob([JSON.stringify(je)],{type:"application/geo+json"}),Lt=URL.createObjectURL(Ye);this._statisticsFeatureCollection=Lt}else this._originalStatisticsData=null,this._statisticsFeatureCollection=null}get statisticsFeatureCollectionUrl(){return this._statisticsFeatureCollection}get hasControl(){return this.map?.hasControl(this.draw)??!1}get isInSelectMode(){return!this.draw||!this.hasControl||!!this.draw?.getMode()&&"simple_select"===this.draw?.getMode()}get isDrawn(){if(!this.draw||!this.hasControl)return!1;const ge=this.draw?.getAll();return!!ge?.features.length&&ge?.features.length>0}
1constructor(ge,se,je){this.config=ge,this.cdk=se,this.layerService=je,this.mapStyle=this.config.mapStyle,this.mapCenter=this.config.defaultLngLat,this.mapZoom=12,this.mapPitch=0,this.mapBearing=0,this.basicFeatures=null,this.basicFeaturesSubject=new Ce.t(null),this.basicFeatures$=this.basicFeaturesSubject.asObservable(),this.convertToPaint=He.BV,this._disableAddressesCenter=!1,this.paramTabAdded=!1,this.paramAdded=!1,this.paramLongAdded=!1,this.paramLayersAdded=!1,this.addressLabelAdded=!1,this._layerFeatureCollection=[],this._areaFeatureCollection=[],this._draw=null,this._canvas=null,this._objectsArea=null,this._balancedGroups=null,this._addressesFeatureCollection=sr,this._originalStatisticsData=null,this._statisticsFeatureCollection=null,this.clusterProperties={styleWithHighestPriority:[["case",["any",[">",["get","priority",["accumulated"]],["get","priority",["get","styleWithHighestPriority"]]],["all",["==",["get","priority",["accumulated"]],["get","priority",["get","styleWithHighestPriority"]]],[">",["get","id",["accumulated"]],["get","id",["get","styleWithHighestPriority"]]]]],["accumulated"],["get","styleWithHighestPriority"]],["get","style"]]},this.mapInstance=new x.bkB,this.positionChange=new x.bkB,this.visibleAddressesIds=new x.bkB,this.requestZoomToAddresses=null,this.lastUsedRequestZoomToAddresses=void 0,this.lastClickedStatistic=null,this.lastClickedAddress=null,this.lastClickedLayer=null,this.lastClickedAddressCluster=null,this.map=null,this.popup=new Ct.Popup({closeButton:!1,closeOnClick:!1}),this.visibleAddressesIds$=new Ce.t([]),this.mapViewRendered$=new me.B,this.addressMarkerImageLoaded=!1,this.clusterPopupOpen=!1,this.addressPopupOpen=!1,this.LayerPropertiesType=ci,this.trackByLayerId=(Ye,Lt)=>Lt.id,this.visibleAddressesIds$.pipe((0,ut.F)(Q.isEqual)).subscribe(Ye=>{this.visibleAddressesIds.emit(Ye)}),this.mapViewRendered$.pipe((0,Be.B)(250),(0,zt.s)(this)).subscribe(()=>{this.onShowedAddressesOnMapChanged()})}onClusterClick(ge){var se=this;return(0,Te.A)(function*(){const je=ge.target,Ye=je.getMaxZoom(),Lt=ge.features[0],ti=Lt?.properties?.cluster_id,Jt=Lt?.geometry.coordinates,fn=yield se.addressSource.getClusterExpansionZoom(ti);if(je.easeTo({center:[Jt[0],Jt[1]],zoom:fn}),fn>=Ye){const jr=yield se.addressSource.getClusterChildren(ti);jr.find(Mi=>Mi?.properties?.cluster)||(se.lastClickedAddressCluster={properties:jr.map(Mi=>Mi.properties)??[],type:"Feature",geometry:{type:"Point",coordinates:Jt}},se.cdk.detectChanges())}})()}onAddressClick(ge){const se=ge.features[0],je=se.geometry.coordinates,Ye={...se.properties,style:JSON.parse(se.properties.style),additionalParam:se.properties.additionalParam?JSON.parse(se.properties.additionalParam):null};this.lastClickedAddress={geometry:{coordinates:je,type:"Point"},properties:Ye,type:"Feature"}}onStatisticsClusterClick(ge){var se=this;return(0,Te.A)(function*(){const je=ge.target,Ye=je.getMaxZoom(),Lt=ge.features[0],ti=Lt?.properties?.cluster_id,Jt=Lt?.geometry.coordinates,fn=yield se.statisticsSource.getClusterExpansionZoom(ti);je.easeTo({center:[Jt[0],Jt[1]],zoom:fn}),fn>=Ye&&((yield se.statisticsSource.getClusterChildren(ti)).find(Mi=>Mi?.properties?.cluster)||se.cdk.detectChanges())})()}onStatisticClick(ge){const se=ge.features[0],je=se.geometry.coordinates,Ye=se.properties.statisticIndex;this._originalStatisticsData&&Ye>=0&&Ye<this._originalStatisticsData.length&&(this.lastClickedStatistic={type:"Feature",geometry:{type:"Point",coordinates:[je[0],je[1]]},properties:this._originalStatisticsData[Ye]},this.cdk.detectChanges())}onLayerClick(ge){if(!this.isInSelectMode)return;const je=ge.lngLat;this.layerService.getShape({id:ge.features[0].id}).subscribe(Ye=>{this.lastClickedLayer={geometry:{type:"Point",coordinates:[je.lng,je.lat]},properties:Ye,type:"Feature"},this.cdk.detectChanges()})}onMapLoaded(ge){this.map=ge,this.mapInstance.emit(ge),this.map.addControl(new Ct.NavigationControl({})),this.addMarkerLabels(),this.addParamTabs(),!this.disableAddressesCenter&&this.basicFeatures$.subscribe(se=>{se?this.lastUsedRequestZoomToAddresses!==this.requestZoomToAddresses&&(this.centerMapToMarker(se),this.lastUsedRequestZoomToAddresses=this.requestZoomToAddresses):this.centerMapToMarker()})}onMouseEnterLayer(){!this.map||!this.isInSelectMode||(this.map.getCanvas().style.cursor="pointer")}onMouseLeaveLayer(){!this.map||!this.isInSelectMode||(this.map.getCanvas().style.cursor="")}onPositionChanged(){this.map&&this.positionChange.emit({center:[this.map.getCenter().lng,this.map.getCenter().lat],zoom:this.map.getZoom(),pitch:this.map.getPitch(),bearing:this.map.getBearing()})}onMapMoveStart(){this.closePopups()}getStatisticLngLat(ge){return{lng:ge.geometry.coordinates[0],lat:ge.geometry.coordinates[1]}}centerMapToMarker(ge){if(!ge&&!this.statisticsFeatureCollection)return;const Ye=[...ge?.features.map(Lt=>Lt.geometry.coordinates).filter(Lt=>{const[ti,Jt]=Lt;return ti>=-180&&ti<=180&&Jt>=-90&&Jt<=90})??[],...this.statisticsFeatureCollection?.map(Lt=>[Lt.longitude,Lt.latitude]).filter(Lt=>{const[ti,Jt]=Lt;return ti>=-180&&ti<=180&&Jt>=-90&&Jt<=90})??[]];if(1==Ye.length){const Lt=Ye[0],ti={lng:Lt[0],lat:Lt[1]};this.map?.setCenter(ti)}if(Ye.length>=2){const Lt=Ze.wiw(Ye),ti=Ze.Qk1(Lt),Jt=[[ti[0],ti[1]],[ti[2],ti[3]]];this.map?.fitBounds(Jt,{duration:0,padding:100})}}addMarkerLabels(){this.map?.loadImage("/assets/label-icon.png",(ge,se)=>{if(se&&!this.addressLabelAdded){if(ge)throw ge;this.map?.addImage("label-icon",se,{content:[6,6,26,26],stretchX:[[14,18]],stretchY:[[14,18]],pixelRatio:2}),this.map?.addLayer({id:"addresses-name",type:"symbol",source:"address-source",layout:{"text-field":"{label}","text-size":14,"text-font":["Noto Sans Regular"],"text-anchor":"bottom","text-offset":[0,-3.75],"text-overlap":"always","icon-image":"label-icon","icon-text-fit":"both","icon-overlap":"always"},paint:{"text-color":"#000000"},filter:["all",["!=",["get","cluster"],!0],["==",["to-string",["get","additionalParam"]],""]]}),this.addressLabelAdded=!0}}),this.map?.on("click","param-tab",ge=>
1{this.onAddressClick(ge)})}addParamTabs(){this.map?.loadImage("/assets/address-param-tab.png",(ge,se)=>{if(se&&!this.paramTabAdded){if(ge)throw ge;this.map?.addImage("param-tab-icon",se,{pixelRatio:1.5}),this.paramTabAdded=!0,this.addParamLayers()}}),this.map?.loadImage("/assets/address-param.png",(ge,se)=>{if(se&&!this.paramAdded){if(ge)throw ge;this.map?.addImage("param-icon",se,{pixelRatio:1.5,sdf:!0}),this.paramAdded=!0,this.addParamLayers()}}),this.map?.loadImage("/assets/address-param-long.png",(ge,se)=>{if(se&&!this.paramLongAdded){if(ge)throw ge;this.map?.addImage("param-icon-long",se,{pixelRatio:1.5,sdf:!0}),this.paramLongAdded=!0,this.addParamLayers()}})}addParamLayers(){!this.paramTabAdded||!this.paramAdded||!this.paramLongAdded||this.paramLayersAdded||(this.map?.addLayer({id:"param-tab",type:"symbol",source:"address-source",layout:{"text-field":["get","shortUnit",["get","additionalParam"]],"text-size":13,"text-font":["Noto Sans Bold"],"text-anchor":"center","text-offset":[2.35,-7.1],"icon-offset":[-10,-76.5],"text-overlap":"always","icon-image":"param-tab-icon","icon-allow-overlap":!0,"text-justify":"center"},paint:{"text-color":"#ffffff"},filter:["all",["!=",["get","cluster"],!0],["!=",["to-string",["get","additionalParam"]],""]]}),this.map?.addLayer({id:"param-timestamp",type:"symbol",source:"address-source",layout:{"text-field":["get","timestamp",["get","additionalParam"]],"text-size":10,"text-font":["Noto Sans Bold"],"text-anchor":"center","text-offset":[-1,-7.2],"text-overlap":"always","icon-allow-overlap":!0,"text-justify":"center"},paint:{"text-color":"#ffffff"},filter:["all",["!=",["get","cluster"],!0],["!=",["to-string",["get","additionalParam"]],""]]}),this.map?.addLayer({id:"param-value",type:"symbol",source:"address-source",layout:{"text-field":["get","shortValue",["get","additionalParam"]],"text-size":13,"text-font":["Noto Sans Bold"],"text-anchor":"right","text-offset":[.25,-7.1],"icon-offset":[-10,-76.5],"text-overlap":"always","icon-image":"param-icon","text-justify":"right","icon-allow-overlap":!0},paint:{"text-color":["get","textColor",["get","style"]],"icon-color":["get","color",["get","style"]]},filter:["all",["!=",["get","cluster"],!0],["!=",["to-string",["get","additionalParam"]],""],["!=",["to-string",["get","unit",["get","additionalParam"]]],""]]}),this.map?.addLayer({id:"param-value-long",type:"symbol",source:"address-source",layout:{"text-field":["get","longValue",["get","additionalParam"]],"text-size":13,"text-font":["Noto Sans Bold"],"text-anchor":"right","text-offset":[3.5,-7.1],"icon-offset":[-10,-76.5],"text-overlap":"always","icon-image":"param-icon-long","text-justify":"right","icon-allow-overlap":!0},paint:{"text-color":["get","textColor",["get","style"]],"icon-color":["get","color",["get","style"]]},filter:["all",["!=",["get","cluster"],!0],["!=",["to-string",["get","additionalParam"]],""],["!=",["to-string",["get","additionalParam"]],""],["==",["to-string",["get","unit",["get","additionalParam"]]],""]]}),this.map?.on("mouseenter","param-tab",ge=>{if(!(this.map&&ge.features&&ge.features[0].properties?.additionalParam&&ge.features[0].properties?.coordinates))return;const se=JSON.parse(ge.features[0].properties?.additionalParam),je=JSON.parse(ge.features[0].properties?.coordinates),Ye=`${se.value} ${se.unit??""}`;this.popup.setLngLat({lon:je[0],lat:je[1]}).setOffset([-10,-110]).setHTML(Ye).addTo(this.map),this.popup.addClassName("param-tooltip")}),this.map?.on("mouseleave","param-tab",()=>{this.popup.remove()}),this.paramLayersAdded=!0)}onShowedAddressesOnMapChanged(){var ge=this;return(0,Te.A)(function*(){if(!ge.map||!ge.map.getLayer("addresses-cluster-background")||!ge.map.getLayer("addresses-marker"))return;const je=ge.map.queryRenderedFeatures(null,{layers:["addresses-cluster-background","addresses-marker"]}).map(function(){var Lt=(0,Te.A)(function*(ti){return ti.properties.cluster?(yield ge.addressSource.getClusterLeaves(ti.properties.cluster_id,ti.properties.point_count,0)).map(fn=>fn.properties.id):[ti.properties.id]});return function(ti){return Lt.apply(this,arguments)}}()),Ye=(0,Q.chain)(yield Promise.all(je)).flatten().orderBy().value(
1);ge.visibleAddressesIds$.next(Ye)})()}onRender(){this.mapViewRendered$.next(!0)}closePopups(){this.lastClickedAddress=null,this.lastClickedAddressCluster=null,this.lastClickedLayer=null,this.lastClickedStatistic=null}showAreas(){!this.map&&!this.draw||(this.draw?.deleteAll(),this.areaFeatureCollection.forEach(ge=>{const je={type:"Feature",geometry:JSON.parse(ge.source),id:ge.id,properties:null};this.draw?.add(je)}))}drawSingleArea(ge){!this.map&&!this.draw||(this.draw?.deleteAll(),this.draw?.add(ge))}isMarkerLayerLoaded(){return this.map?.getLayer("addresses-cluster-shadow")?"addresses-cluster-shadow":""}static{this.\u0275fac=function(se){return new(se||Tc)(x.rXU(c.Yy),x.rXU(x.gRc),x.rXU(Rt.Q1))}}static{this.\u0275cmp=x.VBU({type:Tc,selectors:[["globe-addresses-map"]],viewQuery:function(se,je){if(1&se&&(x.GBs(xt,5),x.GBs(si,5)),2&se){let Ye;x.mGM(Ye=x.lsd())&&(je.addressSource=Ye.first),x.mGM(Ye=x.lsd())&&(je.statisticsSource=Ye.first)}},inputs:{disableAddressesCenter:"disableAddressesCenter",mapPosition:"mapPosition",layerFeatureCollection:"layerFeatureCollection",areaFeatureCollection:"areaFeatureCollection",draw:"draw",canvas:"canvas",objectsArea:"objectsArea",balancedGroups:"balancedGroups",addressesFeatureCollection:"addressesFeatureCollection",statisticsFeatureCollection:"statisticsFeatureCollection",requestZoomToAddresses:"requestZoomToAddresses"},outputs:{mapInstance:"mapInstance",positionChange:"positionChange",visibleAddressesIds:"visibleAddressesIds"},decls:7,vars:22,consts:[["addressSource",""],["statisticsSource",""],[3,"mapLoad","moveEnd","moveStart","render","center","zoom","pitch","bearing","fadeDuration","maxZoom"],["id","address-marker-image","url","/assets/address-marker.png",3,"imageLoaded","options"],[4,"ngIf"],[3,"feature","offset","closeOnClick","closeButton",4,"ngIf"],[4,"ngFor","ngForOf","ngForTrackBy"],["id","address-source",3,"cluster","clusterMaxZoom","clusterRadius","clusterProperties","data"],["id","addresses-cluster-shadow","type","circle",3,"source","paint","filter"],["id","addresses-cluster-background","type","circle",3,"layerClick","source","paint","filter"],["id","addresses-cluster-number","type","symbol",3,"source","filter","layout","paint"],["id","addresses-marker","type","symbol",3,"layerClick","source","layout","paint","filter"],["id","statistics-source",3,"cluster","clusterMaxZoom","clusterRadius","data",4,"ngIf"],["id","statistics-cluster-shadow","type","circle",3,"source","paint","filter",4,"ngIf"],["id","statistics-cluster-background","type","circle",3,"source","paint","filter","layerClick",4,"ngIf"],["id","statistics-cluster-number","type","symbol",3,"source","filter","layout","paint",4,"ngIf"],["id","statistics-marker","type","symbol",3,"source","layout","paint","filter","layerClick",4,"ngIf"],["id","statistics-name","type","symbol",3,"source","minzoom","layout","paint","filter",4,"ngIf"],[3,"lngLat","offset","maxWidth","closeOnClick","closeButton","popupOpen","popupClose",4,"ngIf"],[3,"feature","offset","closeOnClick","closeButton","popupOpen","popupClose",4,"ngIf"],["id","statistics-source",3,"cluster","clusterMaxZoom","clusterRadius","data"],["id","statistics-cluster-shadow","type","circle",3,"source","paint","filter"],["id","statistics-cluster-background","type","circle",3,"layerClick","source","paint","filter"],["id","statistics-cluster-number","type","symbol",3,"source","filter","layout","paint"],["id","statistics-marker","type","symbol",3,"layerClick","source","layout","paint","filter"],["id","statistics-name","type","symbol",3,"source","minzoom","layout","paint","filter"],[3,"popupOpen","popupClose","lngLat","offset","maxWidth","closeOnClick","closeButton"],[3,"statisticsProperties"],[3,"popupOpen","popupClose","feature","offset","closeOnClick","closeButton"],[3,"addressProperties"],[3,"addresses",4,"ngIf"],[3,"addresses"],[3,"feature","offset","closeOnClick","closeButton"],[3,"layer","perfectScrollbar"],[3,"id","data"],["type","line",3,"layerMouseOver","layerMouseLeave","layerClick","id","source","filter","before","paint"],["type","fill",3,"layerMouseOver","layerMouseLeave","layerClick","id","source","filter","before","paint"],["type","line",3,"layerClick","id","source","filter","before","paint"],["type","circle",3,"layerMouseOver","layerMouseLeave","layerClick","id","source","filter","before","paint"],[3,"tiles","tileSize","id"],["type","raster",3,"id","source","paint"],[4,"ngFor","ngForOf"],["type","canvas",3,"id","canvas","coordinates"],["type","raster",3,"id","source","before","paint"],[3,"id","source","before","type","paint"]],template:function(se,je){1&se&&(x.j41(0,"mgl-map",2),x.bIt("mapLoad",function(Lt){return je.onMapLoaded(Lt)})("moveEnd",function(){return je.onPositionChanged()})("moveStart",function(){return je.onMapMoveStart()})("render",function(){return je.onRender()}),x.j41(1,"mgl-image",3),x.bIt("imageLoaded",function(){return je.addressMarkerImageLoaded=!0}),x.k0s(),x.DNE(2,Le,16,52,"ng-container",4)(3,It,2,9,"mgl-popup",5)(4,Pt,3,2,"ng-container",6)(5,bi,2,1,"ng-container",4)(6,hi,2,1,"ng-container",4),x.k0s()),2&se&&(x.Aen(je.mapStyle),x.Y8G("center",je.mapCenter)("zoom",x.eq3(15,be,je.mapZoom))("pitch",x.eq3(17,be,je.mapPitch))("bearing",x.eq3(19,be,je.mapBearing))("fadeDuration",0)("maxZoom",19),x.R7$(),x.Y8G("options",x.lJ4(21,De)),x.R7$(),x.Y8G("ngIf",je.addressMarkerImageLoaded),x.R7$(),x.Y8G("ngIf",je.lastClickedLayer&&!je.addressPopupOpen&&!je.clusterPopupOpen&&je.isInSelectMode&&!je.isDrawn),x.R7$(),x.Y8G("ngForOf",je.layerFeatureCollection)("ngForTrackBy",je.trackByLayerId),x.R7$(),x.Y8G("ngIf",je.canvas),x.R7$(),x.Y8G("ngIf",je.balancedGroups))},styles:["[_nghost-%COMP%] mgl-map{display:block;height:100%;width:100%}[_nghost-%COMP%] mgl-map .param-tooltip{margin-bottom:20px;min-width:80px;text-align:center}[_nghost-%COMP%] mgl-map .param-tooltip .maplibregl-popup-content{background:#fff;padding:5px 10px}[_nghost-%COMP%] mgl-map .maplibregl-popup-tip.mapboxgl-popup-tip{display:none}[_nghost-%COMP%] mgl-map .mapboxgl-popup, [_nghost-%COMP%] mgl-map .maplibregl-popup{overflow:hidden}[_nghost-%COMP%] mgl-map .mapboxgl-popup-content, [_nghost-%COMP%] mgl-map .maplibregl-popup-content{overflow:hidden;padding:0;background-color:transparent}"],changeDetection:0})}};Ci=(0,ke.Cg)([(0,zt.d)(),(0,ke.Sn)("design:paramtypes",[Object,x.gRc,Rt.Q1])],Ci)},12497:(gr,Xt,X)=>{"use strict";X.d(Xt,{Q:()=>Ve});var Te=X(31635),ke=X(67376),c=X(99936),Q=X(69508),pe=X(36696),Ct=X(49894),Ue=X(58981),Ce=X(73955),me=X(54438),ut=X(60177),Be=X(88498),He=X(13600),Ze=X(88043),zt=X(99213);const Rt=Oe=>({"font-size.px":Oe});function xt(Oe,Ie){if(1&Oe&&(me.j41(0,"div",7),me.EFF(1),me.k0s()),2&Oe){const Qe=me.XpG
1();me.R7$(),me.E5c(" ",null!=Qe.statisticsProperties&&Qe.statisticsProperties.streetName?(null==Qe.statisticsProperties?null:Qe.statisticsProperties.streetName)+", ":""," ",null==Qe.statisticsProperties?null:Qe.statisticsProperties.postalCode," ",null==Qe.statisticsProperties?null:Qe.statisticsProperties.city," ")}}function si(Oe,Ie){1&Oe&&(me.j41(0,"div",8),me.EFF(1),me.nI1(2,"translate"),me.k0s()),2&Oe&&(me.R7$(),me.SpI(" ",me.bMT(2,1,"client.noDevices")," "))}function be(Oe,Ie){if(1&Oe&&(me.j41(0,"div",16),me.EFF(1),me.k0s()),2&Oe){const Qe=me.XpG().$implicit;me.Y8G("ngStyle",me.eq3(2,Rt,Qe.deviceCount.toString().length>6?10:Qe.deviceCount.toString().length>5?12:null)),me.R7$(),me.SpI(" ",Qe.deviceCount," ")}}function De(Oe,Ie){if(1&Oe&&(me.j41(0,"div",11)(1,"div",12),me.nrm(2,"globe-device-type-icon",13),me.k0s(),me.j41(3,"div",14),me.EFF(4),me.nI1(5,"translate"),me.k0s(),me.DNE(6,be,2,4,"div",15),me.k0s()),2&Oe){const Qe=Ie.$implicit,ze=Ie.index,Gt=me.XpG(2);me.muq("--device-index: ",ze,""),me.R7$(2),me.Y8G("type",Qe.deviceType),me.R7$(2),me.SpI(" ",Gt.isCentralDeviceType(Qe.deviceType)?Gt.isPolishLanguage?Qe.modelNamePl:Qe.modelNameEn:me.bMT(5,6,Gt.displayDeviceTypeWith(Qe.deviceType))," "),me.R7$(2),me.Y8G("ngIf",Qe.deviceCount)}}function Ae(Oe,Ie){if(1&Oe&&(me.j41(0,"div",9),me.DNE(1,De,7,8,"div",10),me.k0s()),2&Oe){const Qe=me.XpG();me.R7$(),me.Y8G("ngForOf",Qe.groupedItems)}}function Me(Oe,Ie){if(1&Oe){const Qe=me.RV6();me.j41(0,"div",17),me.bIt("click",function(Gt){me.eBV(Qe);const St=me.XpG();return me.Njj(St.toggleExpand(Gt))}),me.j41(1,"mat-icon"),me.EFF(2),me.k0s()()}if(2&Oe){const Qe=me.XpG();me.R7$(2),me.JRh(Qe.isExpanded?"keyboard_arrow_up":"keyboard_arrow_down")}}let Ve=class Pc{set statisticsProperties(Ie){if((0,ke.isNil)(Ie))return;this.configuration.culture$.pipe((0,Ct.s)(this)).subscribe(St=>{St&&(this.applicationLanguage=St)}),this._statisticsProperties=Ie;const Qe=Ie.items.filter(St=>this.centralDeviceTypes.includes(St.deviceType)),Gt=Ie.items.filter(St=>!this.centralDeviceTypes.includes(St.deviceType)).reduce((St,ht)=>{const $e=St.find(We=>We.deviceType===ht.deviceType);return $e?$e.deviceCount+=ht.deviceCount:St.push({...ht}),St},[]);this.groupedItems=[...Gt,...Qe].sort((St,ht)=>{const $e=this.isTransmissionDeviceType(St.deviceType);if($e!==this.isTransmissionDeviceType(ht.deviceType))return $e?1:-1;const et=this.isCentralDeviceType(St.deviceType)?this.isPolishLanguage?St.modelNamePl:St.modelNameEn:this.translateService.instant(this.displayDeviceTypeWith(St.deviceType)),Ut=this.isCentralDeviceType(ht.deviceType)?this.isPolishLanguage?ht.modelNamePl:ht.modelNameEn:this.translateService.instant(this.displayDeviceTypeWith(ht.deviceType));return et.localeCompare(Ut)})}get statisticsProperties(){return this._statisticsProperties}set accumulatedStatItems(Ie){if((0,ke.isNil)(Ie))return;this.accumulatedStatsMode=!0,this.configuration.culture$.pipe((0,Ct.s)(this)).subscribe(St=>{St&&(this.applicationLanguage=St)}),this._accumulatedStatItems=Ie;const Qe=Ie.filter(St=>this.centralDeviceTypes.includes(St.deviceType)),Gt=Ie.filter(St=>!this.centralDeviceTypes.includes(St.deviceType)).reduce((St,ht)=>{const $e=St.find(We=>We.deviceType===ht.deviceType);return $e?$e.deviceCount+=ht.deviceCount:St.push({...ht}),St},[]);this.groupedItems=[...Gt,...Qe].sort((St,ht)=>{const $e=this.isTransmissionDeviceType(St.deviceType);if($e!==this.isTransmissionDeviceType(ht.deviceType))return $e?1:-1;const et=this.isCentralDeviceType(St.deviceType)?this.isPolishLanguage?St.modelNamePl:St.modelNameEn:this.translateService.instant(this.displayDeviceTypeWith(St.deviceType)),Ut=this.isCentralDeviceType(ht.deviceType)?this.isPolishLanguage?ht.modelNamePl:ht.modelNameEn:this.translateService.instant(this.displayDeviceTypeWith(ht.deviceType));return et.localeCompare(Ut)})}get accumulatedStatItems(){return this._accumulatedStatItems}get isPolishLanguage(){return"pl-PL"===this.applicationLanguage}constructor(Ie,Qe){this.configuration=Ie,this.translateService=Qe,this.isExpanded=!1,this.fontColorContrast=c.A,this.accumulatedStatsMode=!1,this.centralDeviceTypes=[Q.bq.MiniBoard,Q.bq.PlusBoard],this.applicationLanguage="pl-PL",this.groupedItems=[],this._statisticsProperties=null,this._accumulatedStatItems=null,this.isExpandable=!1,this.displayDeviceTypeWith=ze=>(0,ke.isNil)(ze)?"":(0,Ue.dt)(ze)}toggleExpand(Ie){Ie.stopPropagation(),this.isExpanded=!this.isExpanded}isCentralDeviceType(Ie){return this.centralDeviceTypes.includes(Ie)}isTransmissionDeviceType(Ie){return Ie>=1e3&&Ie!==Q.bq.Formula}static{this.\u0275fac=function(Qe){return new(Qe||Pc)(me.rXU(pe.Zt),me.rXU(Ce.c$))}}static{this.\u0275cmp=me.VBU({type:Pc,selectors:[["globe-client-stats-popup"]],hostVars:2,hostBindings:function(Qe,ze){2&Qe&&me.AVh("expanded",ze.isExpanded)},inputs:{statisticsProperties:"statisticsProperties",accumulatedStatItems:"accumulatedStatItems",isExpandable:"isExpandable"},decls:10,vars:7,consts:[["fxLayout","column",1,"main-container"],["fxLayout","row","fxLayoutAlign","start center",1,"client-info"],["class","address-info",4,"ngIf"],[1,"device-info",3,"wheel"],["class","no-devices-message",4,"ngIf"],["class","device-list",4,"ngIf"],["class","expand-button",3,"click",4,"ngIf"],[1,"address-info"],[1,"n
1o-devices-message"],[1,"device-list"],["class","device-row",3,"style",4,"ngFor","ngForOf"],[1,"device-row"],[1,"device-icon"],[3,"type"],[1,"device-name"],["class","device-value",3,"ngStyle",4,"ngIf"],[1,"device-value",3,"ngStyle"],[1,"expand-button",3,"click"]],template:function(Qe,ze){1&Qe&&(me.j41(0,"div",0)(1,"a",1)(2,"h2"),me.EFF(3),me.nI1(4,"translate"),me.k0s()(),me.DNE(5,xt,2,3,"div",2),me.j41(6,"div",3),me.bIt("wheel",function(St){return St.stopPropagation()}),me.DNE(7,si,3,3,"div",4)(8,Ae,2,1,"div",5),me.k0s(),me.DNE(9,Me,3,1,"div",6),me.k0s()),2&Qe&&(me.R7$(3),me.SpI(" ",ze.accumulatedStatsMode?me.bMT(4,5,"systemParameters.mainDashboard.titles.accumulatedDeviceStats"):null==ze.statisticsProperties?null:ze.statisticsProperties.companyName," "),me.R7$(2),me.Y8G("ngIf",(null==ze.statisticsProperties?null:ze.statisticsProperties.streetName)||(null==ze.statisticsProperties?null:ze.statisticsProperties.postalCode)||(null==ze.statisticsProperties?null:ze.statisticsProperties.city)),me.R7$(2),me.Y8G("ngIf",!(null!=ze.groupedItems&&ze.groupedItems.length)),me.R7$(),me.Y8G("ngIf",null==ze.groupedItems?null:ze.groupedItems.length),me.R7$(),me.Y8G("ngIf",ze.isExpandable&&(null==ze.groupedItems?null:ze.groupedItems.length)&&ze.groupedItems.length>10))},dependencies:[ut.Sq,ut.bT,ut.B3,Be.DJ,Be.sA,He.eI,Ze.l,zt.An,Ce.D9],styles:["@keyframes _ngcontent-%COMP%_slideInUp{0%{transform:translateY(20px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes _ngcontent-%COMP%_slideIn{0%{transform:translate(-10px);opacity:0}to{transform:translate(0);opacity:1}}[_nghost-%COMP%]{cursor:default;display:block;background-color:#fff;border-radius:11px;width:300px;overflow:hidden;font-family:Roboto,Helvetica Neue,Helvetica,Arial,sans-serif;animation:_ngcontent-%COMP%_slideInUp .2s ease-out;box-shadow:0 0 15px #d1d1d1}.expanded[_nghost-%COMP%] .device-info[_ngcontent-%COMP%]{max-height:500px}[_nghost-%COMP%] .device-row[_ngcontent-%COMP%]{background-color:#f5f5f5;display:flex;align-items:center;padding:6px 16px;border-bottom:1px solid #e0e0e0;transition:all .2s ease;animation:_ngcontent-%COMP%_slideIn .4s ease-out;animation-fill-mode:both;transform:translate(-10px);opacity:0;animation-delay:min(var(--device-index, 0) * .05s + .1s,.2s)}[_nghost-%COMP%] .device-row[_ngcontent-%COMP%]:hover{background-color:#eee}[_nghost-%COMP%] .device-row[_ngcontent-%COMP%]:last-child{border-bottom:none}[_nghost-%COMP%] .device-row[_ngcontent-%COMP%] .device-name[_ngcontent-%COMP%]{flex:1;font-size:13px;font-weight:500;color:#333;text-align:left}[_nghost-%COMP%] .device-row[_ngcontent-%COMP%] .device-icon[_ngcontent-%COMP%]{flex:0 0 32px;display:flex;justify-content:center;align-items:center;margin-right:8px}[_nghost-%COMP%] .device-row[_ngcontent-%COMP%] .device-value[_ngcontent-%COMP%]{flex:0 0 40px;font-size:13px;font-weight:400;text-align:center;background-color:#dce0e6;border-radius:4px;padding:4px 8px;min-width:40px}[_nghost-%COMP%] .device-icon{flex:0 0 0!important}[_nghost-%COMP%] .device-icon globe-device-type-icon{width:24px;height:24px;min-width:24px;max-width:24px;min-height:24px;max-height:24px}[_nghost-%COMP%] .device-icon globe-device-type-icon globe-ui-icon{height:24px}[_nghost-%COMP%] .device-icon globe-device-type-icon globe-ui-icon .mat-icon{margin:0;font-size:20px;width:24px;height:24px}[_nghost-%COMP%] .main-container[_ngcontent-%COMP%]{align-items:center}[_nghost-%COMP%] .device-info[_ngcontent-%COMP%]{background-color:#f8f9fa;max-height:200px;width:100%;border-top:1px solid #e9ecef;overflow:auto;transition:max-height .3s ease-in-out}[_nghost-%COMP%] .device-info[_ngcontent-%COMP%] .no-devices-message[_ngcontent-%COMP%]{padding:16px;text-align:center;font-size:13px;font-weight:500;color:#6c757d;font-style:italic;background-color:#f5f5f5}[_nghost-%COMP%] .device-info[_ngcontent-%COMP%] .device-list[_ngcontent-%COMP%]{height:100%;overflow-y:auto;display:flex;flex-direction:column;padding:0;margin:0}[_nghost-%COMP%] .client-info[_ngcontent-%COMP%]{all:unset;padding:14px;transition:all .2s ease}[_nghost-%COMP%] .client-info[_ngcontent-%COMP%] > h2[_ngcontent-%COMP%]{margin:0;color:#040309;font-size:14px;font-weight:700;text-align:center;transition:all .2s ease}[_nghost-%COMP%] .address-info[_ngcontent-%COMP%]{width:100%;padding:8px 14px 12px;border-top:1px dashed #d0d0d0;font-size:12px;color:#6c757d;text-align:center;font-weight:400;line-height:1.4}[_nghost-%COMP%] .expand-button[_ngcontent-%COMP%]{width:100%;height:30px;display:flex;justify-content:center;align-items:center;border-top:1px solid #e0e0e0;cursor:pointer;transition:background-color .2s ease}[_nghost-%COMP%] .expand-button[_ngcontent-%COMP%]:hover{background-color:#e0e0e0}[_nghost-%COMP%] .expand-button[_ngcontent-%COMP%] globe-ui-icon[_ngcontent-%COMP%]{font-size:24px;color:#333}"]})}};Ve=(0,Te.Cg)([(0,Ct.d)(),(0,Te.Sn)("design:paramtypes",[pe.Zt,Ce.c$])],Ve)},44103:(gr,Xt,X)=>{"use strict";X.d(Xt,{R:()=>Rt});var Te=X(31635),ke=X(54438),x=X(49894),c=X(71318),Q=X(21626),pe=X(48163),Ct=X(14678),Ue=X(18810),Ce=X(96354),me=X(99437),ut=X(73955);let Be=(()=>{class xt{constructor(be,De,Ae){this.httpClient=be,this.toastService=De,this.translateService=Ae,this.geocode=Me=>{const Oe=`https://nominatim.openstreetmap.org/search?${(new Q.Nl).set("format","json").set("country",Me.country).set("city",Me.city).set("street",Me.streetName+" "+Me.houseNumber).toString()}`;return this.httpClient.get(Oe).pipe((0,Ce.T)(Ie=>this.convertAddressResponse(Ie)),(0,Ce.T)(Ie=>{if(null===Ie)throw new Error("No location found");return Ie}),(0,me.W)(Ie=>(this.toastService.showToast({type:Ct.lz.Warning,message:this.translateService.instant("common.getLocationErr")}),(0,Ue.$)(Ie))))},this.convertAddressResponse=Me=>0===Me.length?null:{lat:Me[0].lat,lng:Me[0].lon}}convertAddressToString(be){const De=[];return null!=be.houseNumber&&De.push(be.houseNumber),null!=be.streetName&&De.push(be.streetName),null!=be.city&&De.push(be.city),De.join(", ")}static{this.\u0275fac=function(De){return new(De||xt)(ke.KVO(Q.Qq),ke.KVO(pe.y),ke.KVO(ut.c$))}}static{this.\u0275prov=ke.jDH({token:xt,factory:xt.\u0275fac,providedIn:"root"})}}return xt})();var He=X(24624);const Ze=xt=>[xt],zt=xt=>[0,xt];let Rt=class Ac{set markerLngLat(si){si&&(this._markerLngLat=[...si],this.onChangeMarkerPosition(si[0],si[1]),this.cdr.detectChanges())}get markerLngLat(){return this._markerLngLat}constructor(si,be,De){this.globeFindLocationService=si,this.config=be,this.cdr=De,this.isDraggable=!0,this.mapCenter=this.config.defaultLngLat,this.mapStyle=this.config.mapStyle,this.mapZoom=this.config.mapZo
1om,this.isMapLoaded=!1,this.changePosition=new ke.bkB}ngOnInit(){this.markerLngLat||(this.markerLngLat=this.config.defaultLngLat)}onMapLoad(){this.isMapLoaded=!0,this.isPositionSet&&(this.mapCenter=this.markerLngLat,this.mapZoom=15,this.cdr.detectChanges())}onChangeMarkerPosition(si,be){this.changePosition.emit({lng:si,lat:be})}setMarkerPositionByCoordinates(si){this.isMapLoaded&&(this.markerLngLat=si,this.mapZoom=15,this.mapCenter=si,this.cdr.detectChanges())}setMarkerPositionByAddressInfo(si){this.isMapLoaded&&this.globeFindLocationService.geocode(si).pipe((0,x.s)(this)).subscribe(be=>{if(null!==be){const De=[Number(be.lng),Number(be.lat)];this.markerLngLat=De,this.mapZoom=15,this.mapCenter=[...De],this.cdr.detectChanges()}})}onMarkerDragEnd(si){this.onChangeMarkerPosition(si.getLngLat().lng,si.getLngLat().lat)}static{this.\u0275fac=function(be){return new(be||Ac)(ke.rXU(Be),ke.rXU(c.Yy),ke.rXU(ke.gRc))}}static{this.\u0275cmp=ke.VBU({type:Ac,selectors:[["globe-map-choose-location"]],inputs:{isDraggable:"isDraggable",isPositionSet:"isPositionSet",markerLngLat:"markerLngLat"},outputs:{changePosition:"changePosition"},decls:4,vars:11,consts:[[3,"mapLoad","zoom","center"],["mglNavigation",""],[3,"markerDragEnd","lngLat","draggable","offset"],["src","/assets/marker.png"]],template:function(be,De){1&be&&(ke.j41(0,"mgl-map",0),ke.bIt("mapLoad",function(){return De.onMapLoad()}),ke.nrm(1,"mgl-control",1),ke.j41(2,"mgl-marker",2),ke.bIt("markerDragEnd",function(Me){return De.onMarkerDragEnd(Me)}),ke.nrm(3,"img",3),ke.k0s()()),2&be&&(ke.Aen(De.mapStyle),ke.Y8G("zoom",ke.eq3(7,Ze,De.mapZoom))("center",De.mapCenter),ke.R7$(2),ke.Y8G("lngLat",De.markerLngLat)("draggable",De.isDraggable)("offset",ke.eq3(9,zt,-16)))},dependencies:[He.iY,He.cw,He.XH,He.xc],styles:["[_nghost-%COMP%] mgl-map[_ngcontent-%COMP%]{height:100%;width:100%}"],changeDetection:0})}};Rt=(0,Te.Cg)([(0,x.d)(),(0,Te.Sn)("design:paramtypes",[Be,Object,ke.gRc])],Rt)},7735:(gr,Xt,X)=>{"use strict";X.d(Xt,{T:()=>ut});var Te=X(54438),ke=X(13713),x=X(42321),Q=X(10044),Ct=X(22532),Ue=X(24624);const Ce=Be=>[Be],me="new-shape";let ut=(()=>{class Be{set geometryData(Ze){this._geometryData=Ze}set bbox(Ze){Ze&&(this.bboxFromLayer=Ze,this.fitLayerBounds(),this.cdk.detectChanges())}constructor(Ze,zt){this.config=Ze,this.cdk=zt,this.shapeType=null,this._geometryData=null,this.mapCenter=this.config.defaultLngLat,this.mapStyle=this.config.mapStyle,this.mapZoom=this.config.mapZoom,this.modes=x.modes,this.drawOptions=Ct.a,this.draw=new x(this.drawOptions),this.currentFeature=null,this.bboxFromLayer=null,this.newGeometry=new Te.bkB,this.toggleMap=new Te.bkB,this.handleDrawCreate=Rt=>{const xt={...Rt.features[0],id:me};this.draw.deleteAll(),this.draw.add(xt),this.mapInstance?.off("draw.create",this.handleDrawCreate)}}onMapLoaded(Ze){this.mapInstance=Ze,this.attachDrawControl(),this.mapInstance.addControl(new Q.NavigationControl({}))}loadShape(Ze){if(Ze){const zt=JSON.parse(Ze);this.currentFeature=Ze,this.draw.add(zt)}}attachDrawControl(){this.fitLayerBounds(),this.mapInstance?.addControl(this.draw),this.loadShape(this._geometryData),this.mapInstance?.on("click",Ze=>{this.handleClickOrTouch(Ze.point)}),this.mapInstance?.on("touchend",Ze=>{this.handleClickOrTouch(Ze.point)})}fitLayerBounds(){try{this.bboxFromLayer&&this.mapInstance?.fitBounds(this.bboxFromLayer,{padding:70,duration:0})}catch{return}}startDrawing(Ze){switch(Ze){case"Polygon":this.draw.changeMode("draw_polygon");break;case"LineString":this.draw.changeMode("draw_line_string");break;case"Point":this.draw.changeMode("draw_point")}this.mapInstance?.on("draw.create",this.handleDrawCreate)}getFeature(){const Ze=this.draw.getAll();return Ze.features.length>0?Ze.features[Ze.features.length-1]:null}editDrawing(){const Ze=this.getFeature(),zt=Ze?.id;"Point"!==Ze?.geometry.type?(this.draw.changeMode("direct_select",{featureId:zt}),this.mapInstance?.on("click",()=>{this.draw.changeMode("direct_select",{featureId:zt})}),this.mapInstance?.on("touchend",()=>{this.draw.changeMode("direct_select",{featureId:zt})})):this.draw.changeMode("simple_select")}onUpdateShape(){const Ze=this.getFeature();
1if(Ze){const zt=JSON.parse(JSON.stringify(Ze?.geometry));this.currentFeature=JSON.stringify(zt),this.newGeometry.emit({geometry:zt})}this.toggleMap.emit(!0),this.draw.changeMode("simple_select")}onCreateShape(){const Ze=this.draw.get(me);if(Ze){const zt=JSON.parse(JSON.stringify(Ze.geometry));this.currentFeature=JSON.stringify(zt),this.newGeometry.emit({geometry:zt})}this.toggleMap.emit(!0),this.draw.changeMode("simple_select")}resizeMap(){this.mapInstance&&this.mapInstance.resize()}deleteAll(){this.draw.deleteAll()}handleClickOrTouch(Ze){const zt=this.draw.getFeatureIdsAt(Ze),Rt=this.draw.getMode();if(zt.length>0){const xt=this.draw.getSelected();xt&&xt.features.length>0&&"Point"===xt.features[0].geometry.type&&"simple_select"===Rt||Rt.includes("draw")||this.draw.changeMode("simple_select")}}static{this.\u0275fac=function(zt){return new(zt||Be)(Te.rXU(ke.Y),Te.rXU(Te.gRc))}}static{this.\u0275cmp=Te.VBU({type:Be,selectors:[["globe-map-draw"]],inputs:{shapeType:"shapeType",geometryData:"geometryData",bbox:"bbox"},outputs:{newGeometry:"newGeometry",toggleMap:"toggleMap"},decls:1,vars:6,consts:[[3,"mapLoad","zoom","center"]],template:function(zt,Rt){1&zt&&(Te.j41(0,"mgl-map",0),Te.bIt("mapLoad",function(si){return Rt.onMapLoaded(si)}),Te.k0s()),2&zt&&(Te.Aen(Rt.mapStyle),Te.Y8G("zoom",Te.eq3(4,Ce,Rt.mapZoom))("center",Rt.mapCenter))},dependencies:[Ue.iY],styles:["[_nghost-%COMP%] mgl-map[_ngcontent-%COMP%]{height:100%;width:100%}"],changeDetection:0})}}return Be})()},58759:(gr,Xt,X)=>{"use strict";X.d(Xt,{v:()=>Rt});var Te=X(54438),ke=X(13713),x=X(10044),Q=X(79382),pe=X(48163),Ct=X(14678),Ue=X(73955),Ce=X(60177),me=X(24624);const ut=xt=>[xt];function Be(xt,si){if(1&xt&&Te.nrm(0,"mgl-layer",8),2&xt){const be=Te.XpG();Te.Y8G("source","line-source")("paint",be.linePaint)}}function He(xt,si){if(1&xt&&Te.nrm(0,"mgl-layer",9),2&xt){const be=Te.XpG();Te.Y8G("source","polygon-source")("paint",be.polygonPaint)}}function Ze(xt,si){if(1&xt&&Te.nrm(0,"mgl-layer",10),2&xt){const be=Te.XpG();Te.Y8G("source","polygon-source")("paint",be.polygonBorderPaint)}}function zt(xt,si){if(1&xt&&Te.nrm(0,"mgl-layer",11),2&xt){const be=Te.XpG();Te.Y8G("source","point-source")("paint",be.pointPaint)}}let Rt=(()=>{class xt{constructor(be,De,Ae){this.config=be,this.toastService=De,this.translateService=Ae,this.mapStyle=this.config.mapStyle,this.mapZoom=this.config.mapZoom,this.mapCenter=this.config.defaultLngLat,this.lineGeoJSONData=null,this.polygonGeoJSONData=null,this.pointGeoJSONData=null,this.linePaint=null,this.polygonPaint=null,this.polygonBorderPaint=null,this.pointPaint=null,this.bbox=new Te.bkB}onMapLoaded(be){this.mapInstance=be,this.zoomToGeometry(),this.mapInstance.addControl(new x.NavigationControl({}))}zoomToGeometry(){if(this.mapInstance)try{const be=this.calculateBoundingBox(this.lineGeoJSONData),De=this.calculateBoundingBox(this.polygonGeoJSONData),Ae=this.calculateBoundingBox(this.pointGeoJSONData),Me=this.getMaxBoundingBox([be,De,Ae]);Me&&this.mapInstance.fitBounds(Me,{padding:70,duration:0})}catch{this.toastService.showToast({type:Ct.lz.Error,message:this.translateService.instant("layer.shape.lngLatError")})}}calculateBoundingBox(be){if(!be)return[[0,0],[0,0]];const De=(0,Q.Qk1)(be);return[[De[0],De[1]],[De[2],De[3]]]}getMaxBoundingBox(be){if(0===be.length)return null;let De=1/0,Ae=1/0,Me=-1/0,Ve=-1/0;for(const Oe of be){const Ie=Oe;De=Math.min(De,Ie[0][0]),Ae=Math.min(Ae,Ie[0][1]),Me=Math.max(Me,Ie[1][0]),Ve=Math.max(Ve,Ie[1][1])}return[[De,Ae],[Me,Ve]]}static{this.\u0275fac=function(De){return new(De||xt)(Te.rXU(ke.Y),Te.rXU(pe.y),Te.rXU(Ue.c$))}}static{this.\u0275cmp=Te.VBU({type:xt,selectors:[["globe-map-layers"]],inputs:{mapStyle:"mapStyle",mapZoom:"mapZoom",mapCenter:"mapCenter",lineGeoJSONData:"lineGeoJSONData",polygonGeoJSONData:"polygonGeoJSONData",pointGeoJSONData:"pointGeoJSONData",linePaint:"linePaint",polygonPaint:"polygonPaint",polygonBorderPaint:"polygonBorderPaint",pointPaint:"pointPaint"},outputs:{bbox:"bbox"},decls:8,vars:13,consts:[[3,"mapLoad","zoom","center"],["id","line-source",3,"data"],["id","polygon-source",3,"data"],["id","point-source",3,"data"],["id","line-layer","type","line",3,"source","paint",4,"ngIf"],["id","polygon-layer","type","fill",3,"source","paint",4,"ngIf"],["id","polygon-border-layer","type","line",3,"source","paint",4,"ngIf"],["id","point-layer","type","circle",3,"source","paint",4,"ngIf"],["id","line-layer","type","line",3,"source","paint"],["id","polygon-layer","type","fill",3,"source","paint"],["id","polygon-border-layer","type","line",3,"source","paint"],["id","point-layer","type","circle",3,"source","paint"]],template:function(De,Ae){1&De&&(Te.j41(0,"mgl-map",0),Te.bIt("mapLoad",function(Ve){return Ae.onMapLoaded(Ve)}),Te.nrm(1,"mgl-geojson-source",1)(2,"mgl-geojson-source",2)(3,"mgl-geojson-source",3),Te.DNE(4,Be,1,2,"mgl-layer",4)(5,He,1,2,"mgl-layer",5)(6,Ze,1,2,"mgl-layer",6)(7,zt,1,2,"mgl-layer",7),Te.k0s()),2&De&&(Te.Aen(Ae.mapStyle),Te.Y8G("zoom",Te.eq3(11,ut,Ae.mapZoom))("center",Ae.mapCenter),Te.R7$(),Te.Y8G("data",Ae.lineGeoJSONData),Te.R7$(),Te.Y8G("data",Ae.polygonGeoJSONData),Te.R7$(),Te.Y8G("data",Ae.pointGeoJSONData),Te.R7$(),Te.Y8G("ngIf",Ae.linePaint),Te.R7$(),Te.Y8G("ngIf",Ae.polygonPaint),Te.R7$(),Te.Y8G("ngIf",Ae.polygonBorderPaint),Te.R7$(),Te.Y8G("ngIf",Ae.pointPaint))},dependencies:[Ce.bT,me.iY,me.VW,me.UL],styles:["[_nghost-%COMP%] mgl-map[_ngcontent-%COMP%]{height:100%;width:100%;min-height:600px}"],changeDetection:0})}}return xt})()},39546:(gr,Xt,X)=>{"use strict";function Te(Q,pe){if(!Q)return;const Ct={"line-color":c(Q.lineColor),"line-opacity":x(Q.lineTransparency),"line-width":Q.lineWeight};switch(pe){case"circle":return{"circle-color":c(Q.circleFillColor),"circle-opacity":x(Q.circleFillTransparency),"circle-radius":Q.circleRadius,"circle-stroke-width":Q.circleBorderWeight,"circle-stroke-color":c(Q.circleBorderColor),"circle-stroke-opacity":x(Q.circleBorderTransparency)};case"line":return Q.lineType&&2!==Q.lineType?{...Ct,...void 0!==Q.lineType&&2!==Q.lineType&&{"line-dasharray":ke(Q.lineType??2)}}:{...Ct};case"fill":return{"fill-color":c(Q.areaPatternColor),"fill-opacity":x(Q.areaPatternTransparency)};case"contour":return Q.areaBorderLineType&&2!==Q.areaBorderLineType?{"line-color":c(Q.areaBorderColor),"line-opacity":x(Q.areaBorderTransparency),"line-width":Q.areaBorderLineWeight,"line-dasharray":ke(Q.areaBorderLineType??2)}:{"line-color":c(Q.areaBorderColor),"line-opacity":x(Q.areaBorderTransparency),"line-width":Q.areaBorderLineWeight};case"all":return{"circle-color":c(Q.circleFillColor),"circle-opacity":x(Q.circleFillTransparency),"circle-radius":Q.circleRadius,"circle-stroke-width":Q.circleBorderWeight,"circle-stroke-color":c(Q.circleBorderColor),"circle-stroke-opacity":x(Q.circleBorderTransparency),"fill-color":c(Q.areaPatternColor),"fill-opacity":x(Q.areaPatternTransparency),"line-dasharray":ke(Q.lineType),"line-color":c(Q.lineColor),"line-opacity":x(Q.lineTransparency),"line-width":Q.lineWeight};default:return{}}}function ke(Q){return{0:[1,4],1:[4,4],2:[]}[Q]||[]}function x(Q){return null!=Q?Q/100:1}function c(Q){return null!=Q?`#${Math.min(Math.max(Q,0),16777215).toString(16).padStart(6,"0").toUpperCase()}`:""}X.d(Xt,{Aj:()=>ke,BV:()=>Te,uG:()=>c,un:()=>x})},22532:(gr,Xt,X)=>{"use strict";X.d(Xt,{a:()=>Te});const Te={displayControlsDefault:!1,styles:[{id:"gl-draw-polygon-fill-inactive",type:"fill",filter:["all",["==","active","false"],["==","$type","Polygon"],["!=","mode","static"]],paint:{"fill-color":"#4734f7","fill-outline-color":"#4734f7","fill-opacity":.1}},{id:"gl-draw-polygon-fill-active",type:"fill",filter:["all",["==","active","true"],["==","$type","Polygon"]],paint:{"fill-color":"#fb3b3b","fill-outline-color":"#fb3b3b","fill-opacity":.1}},{id:"gl-draw-polygon-midpoint",type:"circle",filter:["all",["==","$type","Point"],["==","meta","midpoint"]],paint:{"circle-radius":5,"circle-color":"#fb3b3b"}},{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":"#4734f7","line-width":4}},{id:"gl-draw-polygon-stroke-active",type:"line",filter:["all",["==","active","true"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fb3b3b","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":"#4734f7","line-width":4}},{id:"gl-draw-line-active",type:"line",filter:["all",["==","$type","LineString"],["==","active","true"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fb3b3b","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":8,"circle-color":"#4734f7"}},{id:"gl-draw-polygon-and-line-vertex-inactive",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":4,"circle-color":"#fff"}},{id:"gl-draw-point-point-stroke-inactive",type:"circle",filter:["all",["==","active","false"],["==","$type","Point"],["==","meta","feature"],["!=","mode","static"]],paint:{"circle-radius":7,"circle-opacity":1,"cir
1cle-color":"#4734f7"}},{id:"gl-draw-point-inactive",type:"circle",filter:["all",["==","active","false"],["==","$type","Point"],["==","meta","feature"],["!=","mode","static"]],paint:{"circle-radius":5,"circle-color":"#fff"}},{id:"gl-draw-point-stroke-active",type:"circle",filter:["all",["==","$type","Point"],["==","active","true"],["!=","meta","midpoint"]],paint:{"circle-radius":7,"circle-color":"#4734f7"}},{id:"gl-draw-point-active",type:"circle",filter:["all",["==","$type","Point"],["!=","meta","midpoint"],["==","active","true"]],paint:{"circle-radius":5,"circle-color":"#fff"}},{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"}}]}},70426:function(gr,Xt,X){"use strict";var x,c,Q,pe,Te=this&&this.__classPrivateFieldSet||function(me,ut,Be,He,Ze){if("m"===He)throw new TypeError("Private method is not writable");if("a"===He&&!Ze)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof ut?me!==ut||!Ze:!ut.has(me))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===He?Ze.call(me,Be):Ze?Ze.value=Be:ut.set(me,Be),Be},ke=this&&this.__classPrivateFieldGet||function(me,ut,Be,He){if("a"===Be&&!He)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof ut?me!==ut||!He:!ut.has(me))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===Be?He:"a"===Be?He.call(me):He?He.value:ut.get(me)};Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.FontColorContrast=Xt.NumberType=void 0;const Ct=X(73426);var Ue,me;(me=Ue=Xt.NumberType||(Xt.NumberType={}))[me.COLOR=255]="COLOR",me[me.RGB=16777215]="RGB",me[me.THRESHOLD=1]="THRESHOLD";class Ce{constructor(ut,Be,He,Ze){this.red=0,this.green=0,this.blue=0,x.set(this,void 0),c.set(this,void 0),Q.set(this,void 0),pe.set(this,void 0),this.threshold=.5,Te(this,x,ut,"f"),Te(this,c,Be,"f"),Te(this,Q,He,"f"),Te(this,pe,Ze,"f")}getColor(){if(this.isRgb())this.setColorsFromRgbNumbers();else if(this.isHexString())this.setColorsFromHexString();else if(this.isNumber())this.setColorsFromNumber();else{if(!this.isArray())return"#ffffff";this.setColorsFromArray()}return this.contrastFromHSP()}isRgb(){return Ce.isValidNumber(ke(this,x,"f"),Ue.COLOR)&&Ce.isValidNumber(ke(this,c,"f"),Ue.COLOR)&&Ce.isValidNumber(ke(this,Q,"f"),Ue.COLOR)&&Ce.isValidNumber(ke(this,pe,"f"),Ue.THRESHOLD)}isHexString(){const[ut,Be]=this.getCleanStringAndHexNum();return!!(Ce.isValidNumber(Be,Ue.RGB)&&Ce.isValidNumber(ke(this,c,"f"),Ue.THRESHOLD)&&Ce.isNotSet(ke(this,Q,"f"))&&Ce.isNotSet(ke(this,pe,"f")))&&(Te(this,x,ut,"f"),!0)}isNumber(){return Ce.isValidNumber(ke(this,x,"f"),Ue.RGB)&&Ce.isValidNumber(ke(this,c,"f"),Ue.THRESHOLD)&&Ce.isNotSet(ke(this,Q,"f"))&&Ce.isNotSet(ke(this,pe,"f"))}isArray(){return Array.isArray(ke(this,x,"f"))&&3===ke(this,x,"f").length&&Ce.isValidNumber(ke(this,x,"f")[0],Ue.COLOR)&&Ce.isValidNumber(ke(this,x,"f")[1],Ue.COLOR)&&Ce.isValidNumber(ke(this,x,"f")[2],Ue.COLOR)&&Ce.isValidNumber(ke(this,c,"f"),Ue.THRESHOLD)&&Ce.isNotSet(ke(this,Q,"f"))&&Ce.isNotSet(ke(this,pe,"f"))}setColorsFromRgbNumbers(){this.red=ke(this,x,"f"),this.green=ke(this,c,"f"),this.blue=ke(this,Q,"f"),this.setThreshold(ke(this,pe,"f"))}setColorsFromArray(){this.red=ke(this,x,"f")[0],this.green=ke(this,x,"f")[1],this.blue=ke(this,x,"f")[2],this.setThreshold(ke(this,c,"f"))}setColorsFromHexString(){3===ke(this,x,"f").length?(this.red=parseInt(ke(this,x,"f")[0].repeat(2),16),this.green=parseInt(ke(this,x,"f")[1].repeat(2),16),this.blue=parseInt(ke(this,x,"f")[2].repeat(2),16)):(this.red=parseInt(ke(this,x,"f").substring(0,2),16),this.green=parseInt(ke(this,x,"f").substring(2,4),16),this.blue=parseInt(ke(this,x,"f").substring(4,6),16)),this.setThreshold(ke(this,c,"f"))}setColorsFromNumber(){this.red=ke(this,x,"f")>>16,this.green=ke(this,x,"f")>>8&255,this.blue=255&ke(this,x,"f"),this.setThreshold(ke(this,c,"f"))}setThreshold(ut){this.threshold=ut||this.threshold}static isValidNumber(ut,Be){return Be===Ue.THRESHOLD&&null==ut||"number"==typeof ut&&(Be!==Ue.THRESHOLD&&Number.isInteger(ut)||Be===Ue.THRESHOLD)&&null!=ut&&ut>=0&&ut<=Be}getCleanStringAndHexNum(){if("string"!=typeof ke(this,x,"f"))return["",!1];const ut=/(#|\s)/gi,Be=Ct.cssNamedColors.find(zt=>zt.name===ke(this,x,"f"));Be&&Te(this,x,Be.hex.replace(ut,""),"f");const He=ke(this,x,"f").replace(ut,"");return 3!==He.length&&6!==He.length?["",!1]:[He,+("0x"+He)]}static isNotSet(ut){return null==ut}contrastFromHSP(){return Math.sqrt(.299*Math.pow(this.red/255,2)+.587*Math.pow(this.green/255,2)+.114*Math.pow(this.blue/255,2))>this.threshold?"#000000":"#ffffff"}}Xt.FontColorContrast=Ce,x=new WeakMap,c=new WeakMap,Q=new WeakMap,pe=new WeakMap},73426:(gr,Xt)=>{"use strict";
1Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.cssNamedColors=void 0,Xt.cssNamedColors=[{name:"aliceblue",hex:"#f0f8ff"},{name:"antiquewhite",hex:"#faebd7"},{name:"aqua",hex:"#00ffff"},{name:"aquamarine",hex:"#7fffd4"},{name:"azure",hex:"#f0ffff"},{name:"beige",hex:"#f5f5dc"},{name:"bisque",hex:"#ffe4c4"},{name:"black",hex:"#000000"},{name:"blanchedalmond",hex:"#ffebcd"},{name:"blue",hex:"#0000ff"},{name:"blueviolet",hex:"#8a2be2"},{name:"brown",hex:"#a52a2a"},{name:"burlywood",hex:"#deb887"},{name:"cadetblue",hex:"#5f9ea0"},{name:"chartreuse",hex:"#7fff00"},{name:"chocolate",hex:"#d2691e"},{name:"coral",hex:"#ff7f50"},{name:"cornflowerblue",hex:"#6495ed"},{name:"cornsilk",hex:"#fff8dc"},{name:"crimson",hex:"#dc143c"},{name:"cyan",hex:"#00ffff"},{name:"darkblue",hex:"#00008b"},{name:"darkcyan",hex:"#008b8b"},{name:"darkgoldenrod",hex:"#b8860b"},{name:"darkgray",hex:"#a9a9a9"},{name:"darkgreen",hex:"#006400"},{name:"darkgrey",hex:"#a9a9a9"},{name:"darkkhaki",hex:"#bdb76b"},{name:"darkmagenta",hex:"#8b008b"},{name:"darkolivegreen",hex:"#556b2f"},{name:"darkorange",hex:"#ff8c00"},{name:"darkorchid",hex:"#9932cc"},{name:"darkred",hex:"#8b0000"},{name:"darksalmon",hex:"#e9967a"},{name:"darkseagreen",hex:"#8fbc8f"},{name:"darkslateblue",hex:"#483d8b"},{name:"darkslategray",hex:"#2f4f4f"},{name:"darkslategrey",hex:"#2f4f4f"},{name:"darkturquoise",hex:"#00ced1"},{name:"darkviolet",hex:"#9400d3"},{name:"deeppink",hex:"#ff1493"},{name:"deepskyblue",hex:"#00bfff"},{name:"dimgray",hex:"#696969"},{name:"dimgrey",hex:"#696969"},{name:"dodgerblue",hex:"#1e90ff"},{name:"firebrick",hex:"#b22222"},{name:"floralwhite",hex:"#fffaf0"},{name:"forestgreen",hex:"#228b22"},{name:"fuchsia",hex:"#ff00ff"},{name:"gainsboro",hex:"#dcdcdc"},{name:"ghostwhite",hex:"#f8f8ff"},{name:"gold",hex:"#ffd700"},{name:"goldenrod",hex:"#daa520"},{name:"gray",hex:"#808080"},{name:"green",hex:"#008000"},{name:"greenyellow",hex:"#adff2f"},{name:"grey",hex:"#808080"},{name:"honeydew",hex:"#f0fff0"},{name:"hotpink",hex:"#ff69b4"},{name:"indianred",hex:"#cd5c5c"},{name:"indigo",hex:"#4b0082"},{name:"ivory",hex:"#fffff0"},{name:"khaki",hex:"#f0e68c"},{name:"lavender",hex:"#e6e6fa"},{name:"lavenderblush",hex:"#fff0f5"},{name:"lawngreen",hex:"#7cfc00"},{name:"lemonchiffon",hex:"#fffacd"},{name:"lightblue",hex:"#add8e6"},{name:"lightcoral",hex:"#f08080"},{name:"lightcyan",hex:"#e0ffff"},{name:"lightgoldenrodyellow",hex:"#fafad2"},{name:"lightgray",hex:"#d3d3d3"},{name:"lightgreen",hex:"#90ee90"},{name:"lightgrey",hex:"#d3d3d3"},{name:"lightpink",hex:"#ffb6c1"},{name:"lightsalmon",hex:"#ffa07a"},{name:"lightseagreen",hex:"#20b2aa"},{name:"lightskyblue",hex:"#87cefa"},{name:"lightslategray",hex:"#778899"},{name:"lightslategrey",hex:"#778899"},{name:"lightsteelblue",hex:"#b0c4de"},{name:"lightyellow",hex:"#ffffe0"},{name:"lime",hex:"#00ff00"},{name:"limegreen",hex:"#32cd32"},{name:"linen",hex:"#faf0e6"},{name:"magenta",hex:"#ff00ff"},{name:"maroon",hex:"#800000"},{name:"mediumaquamarine",hex:"#66cdaa"},{name:"mediumblue",hex:"#0000cd"},{name:"mediumorchid",hex:"#ba55d3"},{name:"mediumpurple",hex:"#9370db"},{name:"mediumseagreen",hex:"#3cb371"},{name:"mediumslateblue",hex:"#7b68ee"},{name:"mediumspringgreen",hex:"#00fa9a"},{name:"mediumturquoise",hex:"#48d1cc"},{name:"mediumvioletred",hex:"#c71585"},{name:"midnightblue",hex:"#191970"},{name:"mintcream",hex:"#f5fffa"},{name:"mistyrose",hex:"#ffe4e1"},{name:"moccasin",hex:"#ffe4b5"},{name:"navajowhite",hex:"#ffdead"},{name:"navy",hex:"#000080"},{name:"oldlace",hex:"#fdf5e6"},{name:"olive",hex:"#808000"},{name:"olivedrab",hex:"#6b8e23"},{name:"orange",hex:"#ffa500"},{name:"orangered",hex:"#ff4500"},{name:"orchid",hex:"#da70d6"},{name:"palegoldenrod",hex:"#eee8aa"},{name:"palegreen",hex:"#98fb98"},{name:"paleturquoise",hex:"#afeeee"},{name:"palevioletred",hex:"#db7093"},{name:"papayawhip",hex:"#ffefd5"},{name:"peachpuff",hex:"#ffdab9"},{name:"peru",hex:"#cd853f"},{name:"pink",hex:"#ffc0cb"},{name:"plum",hex:"#dda0dd"},{name:"powderblue",hex:"#b0e0e6"},{name:"purple",hex:"#800080"},{name:"red",hex:"#ff0000"},{name:"rosybrown",hex:"#bc8f8f"},{name:"royalblue",hex:"#4169e1"},{name:"saddlebrown",hex:"#8b4513"},{name:"salmon",hex:"#fa8072"},{name:"sandybrown",hex:"#f4a460"},{name:"seagreen",hex:"#2e8b57"},{name:"seashell",hex:"#fff5ee"},{name:"sienna",hex:"#a0522d"},{name:"silver",hex:"#c0c0c0"},{name:"skyblue",hex:"#87ceeb"},{name:"slateblue",hex:"#6a5acd"},{name:"slategray",hex:"#708090"},{name:"slategrey",hex:"#708090"},{name:"snow",hex:"#fffafa"},{name:"springgreen",hex:"#00ff7f"},{name:"steelblue",hex:"#4682b4"},{name:"tan",hex:"#d2b48c"},{name:"teal",hex:"#008080"},{name:"thistle",hex:"#d8bfd8"},{name:"tomato",hex:"#ff6347"},{name:"turquoise",hex:"#40e0d0"},{name:"violet",hex:"#ee82ee"},{name:"wheat",hex:"#f5deb3"},{name:"white",hex:"#ffffff"},{name:"whitesmoke",hex:"#f5f5f5"},{name:"yellow",hex:"#ffff00"},{name:"yellowgreen",hex:"#9acd32"},{name:"rebeccapurple",hex:"#663399"}]},99936:(gr,Xt,X)=>{"use strict";const ke=X(70426);Xt.A=function x(c,Q,pe,Ct){return new ke.FontColorContrast(c,Q,pe,Ct).getColor()}},10044:function(gr){gr.exports=function(){"use strict";var Xt,X,Te;function ke(c,Q){if(Xt)if(X){var pe="var sharedChunk = {}; ("+Xt+")(sharedChunk); ("+X+")(sharedChunk);",Ct={};Xt(Ct),Te=Q(Ct),typeof window<"u"&&(Te.workerUrl=window.URL.createObjectURL(new Blob([pe],{type:"text/javascript"})))}else X=Q;else Xt=Q}return ke(0,function(c){function Q(i,e,r,o){return new(r||(r=Promise))(function(a,h){function p(b){try{y(o.next(b))}catch(M){h(M)}}function f(b){try{y(o.throw(b))}catch(M){h(M)}}function y(b){var M;b.done?a(b.value):(M=b.value,M instanceof r?M:new r(function(T){T(M)})).then(p,f)}y((o=o.apply(i,e||[])).next())})}function pe(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}"function"==typeof SuppressedError&&SuppressedError;var Ct=Ue;function Ue(i,e){this.x=i,this.y=e}Ue.prototype={clone:function(){return new Ue(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)}
vendor: 1,515 bytes, line 1
1,rotateAround:function(i,e){return this.clone()._rotateAround(i,e)},matMult:function(i){return this.clone()._matMult(i)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var e=i.x-this.x,r=i.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,e){return Math.atan2(this.x*e-this.y*i,this.x*i+this.y*e)},_matMult:function(i){var e=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=e,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var e=Math.cos(i),r=Math.sin(i),o=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=o,this},_rotateAround:function(i,e){var r=Math.cos(i),o=Math.sin(i),a=e.y+o*(this.x-e.x)+r*(this.y-e.y);
1return this.x=e.x+r*(this.x-e.x)-o*(this.y-e.y),this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Ue.convert=function(i){return i instanceof Ue?i:Array.isArray(i)?new Ue(i[0],i[1]):i};var Ce=pe(Ct),me=ut;function ut(i,e,r,o){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(o-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=e,this.p2x=r,this.p2y=o}ut.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,e){if(void 0===e&&(e=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,o=0;o<8;o++){var a=this.sampleCurveX(r)-i;if(Math.abs(a)<e)return r;var h=this.sampleCurveDerivativeX(r);if(Math.abs(h)<1e-6)break;r-=a/h}var p=0,f=1;for(r=i,o=0;o<20&&(a=this.sampleCurveX(r),!(Math.abs(a-i)<e));o++)i>a?p=r:f=r,r=.5*(f-p)+p;return r},solve:function(i,e){return this.sampleCurveY(this.solveCurveX(i,e))}};var Be=pe(me);let He,Ze;function zt(){return null==He&&(He=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),He}function Rt(){if(null==Ze&&(Ze=!1,zt())){const e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let o=0;o<25;o++){const a=4*o;e.fillStyle=`rgb(${a},${a+1},${a+2})`,e.fillRect(o%5,Math.floor(o/5),1,1)}const r=e.getImageData(0,0,5,5).data;for(let o=0;o<100;o++)if(o%4!=3&&r[o]!==o){Ze=!0;break}}}return Ze||!1}function xt(i,e,r,o){const a=new Be(i,e,r,o);return function(h){return a.solve(h)}}const si=xt(.25,.1,.25,1);function be(i,e,r){return Math.min(r,Math.max(e,i))}function De(i,e,r){const o=r-e,a=((i-e)%o+o)%o+e;return a===e?r:a}function Ae(i,...e){for(const r of e)for(const o in r)i[o]=r[o];return i}let Me=1;function Ve(i,e,r){const o={};for(const a in i)o[a]=e.call(r||this,i[a],a,i);return o}function Oe(i,e,r){const o={};for(const a in i)e.call(r||this,i[a],a,i)&&(o[a]=i[a]);return o}function Ie(i){return Array.isArray(i)?i.map(Ie):"object"==typeof i&&i?Ve(i,Ie):i}const Qe={};function ze(i){Qe[i]||(typeof console<"u"&&console.warn(i),Qe[i]=!0)}function Gt(i,e,r){return(r.y-i.y)*(e.x-i.x)>(e.y-i.y)*(r.x-i.x)}function St(i){let e=0;for(let r,o,a=0,h=i.length,p=h-1;a<h;p=a++)r=i[a],o=i[p],e+=(o.x-r.x)*(r.y+o.y);return e}function ht(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}let $e=null;function We(i){return typeof ImageBitmap<"u"&&i instanceof ImageBitmap}const et="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Ut(i,e,r,o,a){return Q(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const h=new VideoFrame(i,{timestamp:0});try{const p=h?.format;if(!p||!p.startsWith("BGR")&&!p.startsWith("RGB"))throw new Error(`Unrecognized format ${p}`);const f=p.startsWith("BGR"),y=new Uint8ClampedArray(o*a*4);if(yield h.copyTo(y,function(b,M,T,A,O){const R=4*Math.max(-M,0),N=(Math.max(0,T)-T)*A*4+R,q=4*A,H=Math.max(0,M),le=Math.max(0,T);return{rect:{x:H,y:le,width:Math.min(b.width,M+A)-H,height:Math.min(b.height,T+O)-le},layout:[{offset:N,stride:q}]}}(i,e,r,o,a)),f)for(let b=0;b<y.length;b+=4){const M=y[b];y[b]=y[b+2],y[b+2]=M}return y}finally{h.close()}})}let Oi,Ke,ri,wt;const $t={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(i){const e=requestAnimationFrame(i);return{cancel:()=>cancelAnimationFrame(e)}},getImageData(i,e=0){return this.getImageCanvasContext(i).getImageData(-e,-e,i.width+2*e,i.height+2*e)},getImageCanvasContext(i){const e=window.document.createElement("canvas"),r=e.getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("failed to create canvas 2d context");return e.width=i.width,e.height=i.height,r.drawImage(i,0,0,i.width,i.height),r},resolveURL:i=>(ri||(ri=document.createElement("a")),ri.href=i,ri.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(null==wt&&(wt=matchMedia("(prefers-reduced-motion: reduce)")),wt.matches)}},Qt={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};
1class Bi extends Error{constructor(e,r,o,a){super(`AJAXError: ${r} (${e}): ${o}`),this.status=e,this.statusText=r,this.url=o,this.body=a}}const xi=ht()?()=>self.worker&&self.worker.referrer:()=>("blob:"===window.location.protocol?window.parent:window).location.href,Ft=i=>Qt.REGISTERED_PROTOCOLS[i.substring(0,i.indexOf("://"))];function Mn(i,e){const r=new AbortController,o=new Request(i.url,{method:i.method||"GET",body:i.body,credentials:i.credentials,headers:i.headers,cache:i.cache,referrer:xi(),signal:r.signal});let a=!1,h=!1;return"json"===i.type&&o.headers.set("Accept","application/json"),h||fetch(o).then(p=>{return p.ok?(f=p,void("arrayBuffer"===i.type||"image"===i.type?f.arrayBuffer():"json"===i.type?f.json():f.text()).then(y=>{h||(a=!0,e(null,y,f.headers.get("Cache-Control"),f.headers.get("Expires")))}).catch(y=>{h||e(new Error(y.message))})):p.blob().then(f=>e(new Bi(p.status,p.statusText,i.url,f)));var f}).catch(p=>{20!==p.code&&e(new Error(p.message))}),{cancel:()=>{h=!0,a||r.abort()}}}const _r=function(i,e){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){if(ht()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e);if(!ht())return(Ft(i.url)||Mn)(i,e)}if(!(/^file:/.test(r=i.url)||/^file:/.test(xi())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return Mn(i,e);if(ht()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e,void 0,!0)}var r;return function(o,a){const h=new XMLHttpRequest;h.open(o.method||"GET",o.url,!0),"arrayBuffer"!==o.type&&"image"!==o.type||(h.responseType="arraybuffer");for(const p in o.headers)h.setRequestHeader(p,o.headers[p]);return"json"===o.type&&(h.responseType="text",h.setRequestHeader("Accept","application/json")),h.withCredentials="include"===o.credentials,h.onerror=()=>{a(new Error(h.statusText))},h.onload=()=>{if((h.status>=200&&h.status<300||0===h.status)&&null!==h.response){let p=h.response;if("json"===o.type)try{p=JSON.parse(h.response)}catch(f){return a(f)}a(null,p,h.getResponseHeader("Cache-Control"),h.getResponseHeader("Expires"))}else{const p=new Blob([h.response],{type:h.getResponseHeader("Content-Type")});a(new Bi(h.status,h.statusText,o.url,p))}},h.send(o.body),{cancel:()=>h.abort()}}(i,e)},Vr=function(i,e){return _r(Ae(i,{type:"arrayBuffer"}),e)};function tr(i){if(!i||i.indexOf("://")<=0||0===i.indexOf("data:image/")||0===i.indexOf("blob:"))return!0;const e=new URL(i),r=window.location;return e.protocol===r.protocol&&e.host===r.host}function Cr(i,e,r){r[i]&&-1!==r[i].indexOf(e)||(r[i]=r[i]||[],r[i].push(e))}function li(i,e,r){if(r&&r[i]){const o=r[i].indexOf(e);-1!==o&&r[i].splice(o,1)}}class Xr{constructor(e,r={}){Ae(this,r),this.type=e}}class Sr extends Xr{constructor(e,r={}){super("error",Ae({error:e},r))}}class sn{on(e,r){return this._listeners=this._listeners||{},Cr(e,r,this._listeners),this}off(e,r){return li(e,r,this._listeners),li(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},Cr(e,r,this._oneTimeListeners),this):new Promise(o=>this.once(e,o))}fire(e,r){"string"==typeof e&&(e=new Xr(e,r||{}));const o=e.type;if(this.listens(o)){e.target=this;const a=this._listeners&&this._listeners[o]?this._listeners[o].slice():[];for(const f of a)f.call(this,e);const h=this._oneTimeListeners&&this._oneTimeListeners[o]?this._oneTimeListeners[o].slice():[];for(const f of h)li(o,f,this._oneTimeListeners),f.call(this,e);const p=this._eventedParent;p&&(Ae(e,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),p.fire(e))}else e instanceof Sr&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,r){return this._eventedParent=e,this._eventedParentData=r,this}}var Y={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"}
vendor: 3,526 bytes, line 1
1,bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade
vendor: 10,514 bytes, line 1
1","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},
vendor: 1,289 bytes, line 1
1filter:{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},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
vendor: 14,262 bytes, line 1
1,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};const
1ei=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function w(i,e){const r={};for(const o in i)"ref"!==o&&(r[o]=i[o]);return ei.forEach(o=>{o in e&&(r[o]=e[o])}),r}function z(i,e){if(Array.isArray(i)){if(!Array.isArray(e)||i.length!==e.length)return!1;for(let r=0;r<i.length;r++)if(!z(i[r],e[r]))return!1;return!0}if("object"==typeof i&&null!==i&&null!==e){if("object"!=typeof e||Object.keys(i).length!==Object.keys(e).length)return!1;for(const r in i)if(!z(i[r],e[r]))return!1;return!0}return i===e}const Ee={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"};
vendor: 11,731 bytes, line 1
1function ft(i,e,r){r.push({command:Ee.addSource,args:[i,e[i]]})}function oi(i,e,r){e.push({command:Ee.removeSource,args:[i]}),r[i]=!0}function mi(i,e,r,o){oi(i,r,o),ft(i,e,r)}function ki(i,e,r){let o;for(o in i[r])if(Object.prototype.hasOwnProperty.call(i[r],o)&&"data"!==o&&!z(i[r][o],e[r][o]))return!1;for(o in e[r])if(Object.prototype.hasOwnProperty.call(e[r],o)&&"data"!==o&&!z(i[r][o],e[r][o]))return!1;return!0}function Mr(i,e,r,o,a,h){let p;for(p in e=e||{},i=i||{})Object.prototype.hasOwnProperty.call(i,p)&&(z(i[p],e[p])||r.push({command:h,args:[o,p,e[p],a]}));for(p in e)Object.prototype.hasOwnProperty.call(e,p)&&!Object.prototype.hasOwnProperty.call(i,p)&&(z(i[p],e[p])||r.push({command:h,args:[o,p,e[p],a]}))}function yr(i){return i.id}function Ir(i,e){return i[e.id]=e,i}class tt{constructor(e,r,o,a){this.message=(e?`${e}: `:"")+o,a&&(this.identifier=a),null!=r&&r.__line__&&(this.line=r.__line__)}}function Er(i,...e){for(const r of e)for(const o in r)i[o]=r[o];return i}class zi extends Error{constructor(e,r){super(r),this.message=r,this.key=e}}class Rn{constructor(e,r=[]){this.parent=e,this.bindings={};for(const[o,a]of r)this.bindings[o]=a}concat(e){return new Rn(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const Tr={kind:"null"},nt={kind:"number"},Ht={kind:"string"},jt={kind:"boolean"},dr={kind:"color"},Br={kind:"object"},Bt={kind:"value"},Gr={kind:"collator"},G={kind:"formatted"},P={kind:"padding"},k={kind:"resolvedImage"},F={kind:"variableAnchorOffsetCollection"};function j(i,e){return{kind:"array",itemType:i,N:e}}function W(i){if("array"===i.kind){const e=W(i.itemType);return"number"==typeof i.N?`array<${e}, ${i.N}>`:"value"===i.itemType.kind?"array":`array<${e}>`}return i.kind}const ce=[Tr,nt,Ht,jt,dr,G,Br,j(Bt),P,k,F];function ee(i,e){if("error"===e.kind)return null;if("array"===i.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!ee(i.itemType,e.itemType))&&("number"!=typeof i.N||i.N===e.N))return null}else{if(i.kind===e.kind)return null;if("value"===i.kind)for(const r of ce)if(!ee(r,e))return null}return`Expected ${W(i)} but found ${W(e)} instead.`}function J(i,e){return e.some(r=>r.kind===i.kind)}function ne(i,e){return e.some(r=>"null"===r?null===i:"array"===r?Array.isArray(i):"object"===r?i&&!Array.isArray(i)&&"object"==typeof i:r===typeof i)}function Se(i,e){return"array"===i.kind&&"array"===e.kind?i.itemType.kind===e.itemType.kind&&"number"==typeof i.N:i.kind===e.kind}const It=4/29,Zt=6/29,bt=3*Zt*Zt,Pt=Zt*Zt*Zt,Kt=Math.PI/180,bi=180/Math.PI;function ni(i){return(i%=360)<0&&(i+=360),i}function hi([i,e,r,o]){let a,h;const p=sr((.2225045*(i=ci(i))+.7168786*(e=ci(e))+.0606169*(r=ci(r)))/1);i===e&&e===r?a=h=p:(a=sr((.4360747*i+.3850649*e+.1430804*r)/.96422),h=sr((.0139322*i+.0971045*e+.7141733*r)/.82521));const f=116*p-16;return[f<0?0:f,500*(a-p),200*(p-h),o]}function ci(i){return i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function sr(i){return i>Pt?Math.pow(i,1/3):i/bt+It}function Ci([i,e,r,o]){let a=(i+16)/116,h=isNaN(e)?a:a+e/500,p=isNaN(r)?a:a-r/200;return a=1*ge(a),h=.96422*ge(h),p=.82521*ge(p),[_e(3.1338561*h-1.6168667*a-.4906146*p),_e(-.9787684*h+1.9161415*a+.033454*p),_e(.0719453*h-.2289914*a+1.4052427*p),o]}function _e(i){return(i=i<=.00304?12.92*i:1.055*Math.pow(i,1/2.4)-.055)<0?0:i>1?1:i}function ge(i){return i>Zt?i*i*i:bt*(i-It)}function se(i){return parseInt(i.padEnd(2,i),16)/255}function je(i,e){return Ye(e?i/100:i,0,1)}function Ye(i,e,r){return Math.min(Math.max(e,i),r)}function Lt(i){return!i.some(Number.isNaN)}const ti={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class Jt{constructor(e,r,o,a=1,h=!0){this.r=e,this.g=r,this.b=o,this.a=a,h||(this.r*=a,this.g*=a,this.b*=a,a||this.overwriteGetter("rgb",[e,r,o,a]))}static parse(e){if(e instanceof Jt)return e;if("string"!=typeof e)return;const r=function(o){if("transparent"===(o=o.toLowerCase().trim()))return[0,0,0,0];const a=ti[o];if(a){const[p,f,y]=a;return[p/255,f/255,y/255,1]}if(o.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(o)){const p=o.length<6?1:2;let f=1;return[se(o.slice(f,f+=p)),se(o.slice(f,f+=p)),se(o.slice(f,f+=p)),se(o.slice(f,f+p)||"ff")]}if(o.startsWith("rgb")){const p=o.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(p){const[f,y,b,M,T,A,O,R,N,q,H,le]=p,te=[M||" ",O||" ",q].join("");if(" "===te||" /"===te||",,"===te||",,,"===te){const he=[b,A,N].join(""),ye="%%%"===he?100:""===he?255:0;if(ye){const Fe=[Ye(+y/ye,0,1),Ye(+T/ye,0,1),Ye(+R/ye,0,1),H?je(+H,le):1];if(Lt(Fe))return Fe}}return}}const h=o.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(h){const[p,f,y,b,M,T,A,O,R]=h,N=[y||" ",M||" ",A].join("");if(" "===N||" /"===N||",,"===N||",,,"===N){const q=[+f,Ye(+b,0,100),Ye(+T,0,100),O?je(+O,R):1];if(Lt(q))return function([H,le,te,he]){function ye(Fe){const vt=(Fe+H/30)%12,Tt=le*Math.min(te,1-te);return te-Tt*Math.max(-1,Math.min(vt-3,9-vt,1))}return H=ni(H),le/=100,te/=100,[ye(0),ye(8),ye(4),he]}(q)}}}(e);return r?new Jt(...r,!1):void 0}get rgb(){const{r:e,g:r,b:o,a}=this,h=a||1/0;return this.overwriteGetter("rgb",[e/h,r/h,o/h,a])}get hcl(){return this.overwriteGetter("hcl",function(e){const[r,o,a,h]=hi(e),p=Math.sqrt(o*o+a*a);return[Math.round(1e4*p)?ni(Math.atan2(a,o)*bi):NaN,p,r,h]}(this.rgb))}get lab(){return this.overwriteGetter("lab",hi(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){const[e,r,o,a]=this.rgb;return`rgba(${[e,r,o].map(h=>Math.round(255*h)).join(",")},${a})`}}Jt.black=new Jt(0,0,0,1),Jt.white=new Jt(1,1,1,1),Jt.transparent=new Jt(0,0,0,0),Jt.red=new Jt(1,0,0,1);class fn{constructor(e,r,o){this.sensitivity=e?r?"variant":"case":r?"accent":"base",this.locale=o,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,r){return this.collator.compare(e,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class jr{constructor(e,r,o,a,h){this.text=e,this.image=r,this.scale=o,this.fontStack=a,this.textColor=h}}class Mi{constructor(e){this.sections=e}static fromString(e){return new Mi([new jr(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(e=>0!==e.text.length||e.image&&0!==e.image.name.length)}static factory(e){return e instanceof Mi?e:Mi.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map(e=>e.text).join("")}}class Nr{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Nr)return e;if("number"==typeof e)return new Nr([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const r of e)if("number"!=typeof r)return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new Nr(e)}}toString(){return JSON.stringify(this.values)}}const yo=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class vr{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof vr)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let r=0;r<e.length;r+=2){const o=e[r],a=e[r+1];if("string"!=typeof o||!yo.has(o)||!Array.isArray(a)||2!==a.length||"number"!=typeof a[0]||"number"!=typeof a[1])return}return new vr(e)}}toString(){return JSON.stringify(this.values)}}class xr{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new xr({name:e,available:!1}):null}}function ps(i,e,r,o){return"number"==typeof i&&i>=0&&i<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===o||"number"==typeof o&&o>=0&&o<=1?null:`Invalid rgba value [${[i,e,r,o].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof o?[i,e,r,o]:[i,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Po(i){if(null===i||"string"==typeof i||"boolean"==typeof i||"number"==typeof i||i instanceof Jt||i instanceof fn||i instanceof Mi||i instanceof Nr||i instanceof vr||i instanceof xr)return!0;
vendor: 4,137 bytes, line 1
1if(Array.isArray(i)){for(const e of i)if(!Po(e))return!1;return!0}if("object"==typeof i){for(const e in i)if(!Po(i[e]))return!1;return!0}return!1}function Gi(i){if(null===i)return Tr;if("string"==typeof i)return Ht;if("boolean"==typeof i)return jt;if("number"==typeof i)return nt;if(i instanceof Jt)return dr;if(i instanceof fn)return Gr;if(i instanceof Mi)return G;if(i instanceof Nr)return P;if(i instanceof vr)return F;if(i instanceof xr)return k;if(Array.isArray(i)){const e=i.length;let r;for(const o of i){const a=Gi(o);if(r){if(r===a)continue;r=Bt;break}r=a}return j(r||Bt,e)}return Br}function wi(i){const e=typeof i;return null===i?"":"string"===e||"number"===e||"boolean"===e?String(i):i instanceof Jt||i instanceof Mi||i instanceof Nr||i instanceof vr||i instanceof xr?i.toString():JSON.stringify(i)}class Wn{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(2!==e.length)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Po(e[1]))return r.error("invalid value");const o=e[1];let a=Gi(o);const h=r.expectedType;return"array"!==a.kind||0!==a.N||!h||"array"!==h.kind||"number"==typeof h.N&&0!==h.N||(a=h),new Wn(a,o)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class ji{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const jo={string:Ht,number:nt,boolean:jt,object:Br};class gn{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let o,a=1;const h=e[0];if("array"===h){let f,y;if(e.length>2){const b=e[1];if("string"!=typeof b||!(b in jo)||"object"===b)return r.error('The item type argument of "array" must be one of string, number, boolean',1);f=jo[b],a++}else f=Bt;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);y=e[2],a++}o=j(f,y)}else{if(!jo[h])throw new Error(`Types doesn't contain name = ${h}`);o=jo[h]}const p=[];for(;a<e.length;a++){const f=r.parse(e[a],a,Bt);if(!f)return null;p.push(f)}return new gn(o,p)}evaluate(e){for(let r=0;r<this.args.length;r++){const o=this.args[r].evaluate(e);if(!ee(this.type,Gi(o)))return o;if(r===this.args.length-1)throw new ji(`Expected value to be of type ${W(this.type)}, but found ${W(Gi(o))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const Zs={"to-boolean":jt,"to-color":dr,"to-number":nt,"to-string":Ht};class io{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const o=e[0];if(!Zs[o])throw new Error(`Can't parse ${o} as it is not part of the known types`);if(("to-boolean"===o||"to-string"===o)&&2!==e.length)return r.error("Expected one argument.");const a=Zs[o],h=[];for(let p=1;p<e.length;p++){const f=r.parse(e[p],p,Bt);if(!f)return null;h.push(f)}return new io(a,h)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let r,o;for(const a of this.args){if(r=a.evaluate(e),o=null,r instanceof Jt)return r;if("string"==typeof r){const h=e.parseColor(r);if(h)return h}else if(Array.isArray(r)&&(o=r.length<3||r.length>4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:ps(r[0],r[1],r[2],r[3]),!o))return new Jt(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new ji(o||`Could not parse color from value '${"string"==typeof r?r:JSON.stringify(r)}'`)}case"padding":{let r;for(const o of this.args){r=o.evaluate(e);const a=Nr.parse(r);if(a)return a}throw new ji(`Could not parse padding from value '${"string"==typeof r?r:JSON.stringify(r)}'`)}case"variableAnchorOffsetCollection":{let r;for(const o of this.args){r=o.evaluate(e);const a=vr.parse(r);if(a)return a}throw new ji(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof r?r:JSON.stringify(r)}'`)}case"number":{let r=null;for(const o of this.args){if(r=o.evaluate(e),null===r)return 0;const a=Number(r);
1if(!isNaN(a))return a}throw new ji(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return Mi.fromString(wi(this.args[0].evaluate(e)));case"resolvedImage":return xr.fromString(wi(this.args[0].evaluate(e)));default:return wi(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const $o=["Unknown","Point","LineString","Polygon"];class m{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?$o[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(e){let r=this._parseColorCache[e];return r||(r=this._parseColorCache[e]=Jt.parse(e)),r}}class C{constructor(e,r,o=[],a,h=new Rn,p=[]){this.registry=e,this.path=o,this.key=o.map(f=>`[${f}]`).join(""),this.scope=h,this.errors=p,this.expectedType=a,this._isConstant=r}parse(e,r,o,a,h={}){return r?this.concat(r,o,a)._parse(e,h):this._parse(e,h)}_parse(e,r){function o(a,h,p){return"assert"===p?new gn(h,[a]):"coerce"===p?new io(h,[a]):a}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const a=e[0];if("string"!=typeof a)return this.error(`Expression name must be a string, but found ${typeof a} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const h=this.registry[a];if(h){let p=h.parse(e,this);if(!p)return null;if(this.expectedType){const f=this.expectedType,y=p.type;if("string"!==f.kind&&"number"!==f.kind&&"boolean"!==f.kind&&"object"!==f.kind&&"array"!==f.kind||"value"!==y.kind)if("color"!==f.kind&&"formatted"!==f.kind&&"resolvedImage"!==f.kind||"value"!==y.kind&&"string"!==y.kind)if("padding"!==f.kind||"value"!==y.kind&&"number"!==y.kind&&"array"!==y.kind)if("variableAnchorOffsetCollection"!==f.kind||"value"!==y.kind&&"array"!==y.kind){if(this.checkSubtype(f,y))return null}else p=o(p,f,r.typeAnnotation||"coerce");else p=o(p,f,r.typeAnnotation||"coerce");else p=o(p,f,r.typeAnnotation||"coerce");else p=o(p,f,r.typeAnnotation||"assert")}if(!(p instanceof Wn)&&"resolvedImage"!==p.type.kind&&this._isConstant(p)){const f=new m;try{p=new Wn(p.type,p.evaluate(f))}catch(y){return this.error(y.message),null}}return p}return this.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===e?"'undefined' value invalid. Use null instead.":"object"==typeof e?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,r,o){const a="number"==typeof e?this.path.concat(e):this.path,h=o?this.scope.concat(o):this.scope;return new C(this.registry,this._isConstant,a,r||null,h,this.errors)}error(e,...r){const o=`${this.key}${r.map(a=>`[${a}]`).join("")}`;this.errors.push(new zi(o,e))}checkSubtype(e,r){const o=ee(e,r);return o&&this.error(o),o}}class L{constructor(e,r,o){this.type=Gr,this.locale=o,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(2!==e.length)return r.error("Expected one argument.");const o=e[1];if("object"!=typeof o||Array.isArray(o))return r.error("Collator options argument must be an object.");const a=r.parse(void 0!==o["case-sensitive"]&&o["case-sensitive"],1,jt);if(!a)return null;const h=r.parse(void 0!==o["diacritic-sensitive"]&&o["diacritic-sensitive"],1,jt);if(!h)return null;let p=null;return o.locale&&(p=r.parse(o.locale,1,Ht),!p)?null:new L(a,h,p)}evaluate(e){return new fn(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}const Z=8192;function ie(i,e){i[0]=Math.min(i[0],e[0]),i[1]=Math.min(i[1],e[1]),i[2]=Math.max(i[2],e[0]),i[3]=Math.max(i[3],e[1])}function re(i,e){return!(i[0]<=e[0]||i[2]>=e[2]||i[1]<=e[1]||i[3]>=e[3])}function de(i,e){const r=(180+i[0])/360,o=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,a=Math.pow(2,e.z);return[Math.round(r*a*Z),Math.round(o*a*Z)]}function qe(i,e,r){const o=i[0]-e[0],a=i[1]-e[1],h=i[0]-r[0],p=i[1]-r[1];return o*p-h*a==0&&o*h<=0&&a*p<=0}function it(i,e){let r=!1;for(let p=0,f=e.length;p<f;p++){const y=e[p];for(let b=0,M=y.length;b<M-1;b++){if(qe(i,y[b],y[b+1]))return!1;(a=y[b])[1]>(o=i)[1]!=(h=y[b+1])[1]>o[1]&&o[0]<(h[0]-a[0])*(o[1]-a[1])/(h[1]-a[1])+a[0]&&(r=!r)}}var o,a,h;return r}function gt(i,e){for(let r=0;r<e.length;r++)if(it(i,e[r]))return!0;return!1}function _t(i,e,r,o){const a=o[0]-r[0],h=o[1]-r[1],p=(i[0]-r[0])*h-a*(i[1]-r[1]),f=(e[0]-r[0])*h-a*(e[1]-r[1]);return p>0&&f<0||p<0&&f>0}function lt(i,e,r){for(const b of r)for(let M=0;M<b.length-1;++M)if((f=[(p=b[M+1])[0]-(h=b[M])[0],p[1]-h[1]])[0]*(y=[(a=e)[0]-(o=i)[0],a[1]-o[1]])[1]-f[1]*y[0]!=0&&_t(o,a,h,p)&&_t(h,p,o,a))return!0;
vendor: 6,461 bytes, line 1
1var o,a,h,p,f,y;return!1}function Yt(i,e){for(let r=0;r<i.length;++r)if(!it(i[r],e))return!1;for(let r=0;r<i.length-1;++r)if(lt(i[r],i[r+1],e))return!1;return!0}function $i(i,e){for(let r=0;r<e.length;r++)if(Yt(i,e[r]))return!0;return!1}function ii(i,e,r){const o=[];for(let a=0;a<i.length;a++){const h=[];for(let p=0;p<i[a].length;p++){const f=de(i[a][p],r);ie(e,f),h.push(f)}o.push(h)}return o}function rr(i,e,r){const o=[];for(let a=0;a<i.length;a++){const h=ii(i[a],e,r);o.push(h)}return o}function Ne(i,e,r,o){if(i[0]<r[0]||i[0]>r[2]){const a=.5*o;let h=i[0]-r[0]>a?-o:r[0]-i[0]>a?o:0;0===h&&(h=i[0]-r[2]>a?-o:r[2]-i[0]>a?o:0),i[0]+=h}ie(e,i)}function At(i,e,r,o){const a=Math.pow(2,o.z)*Z,h=[o.x*Z,o.y*Z],p=[];for(const f of i)for(const y of f){const b=[y.x+h[0],y.y+h[1]];Ne(b,e,r,a),p.push(b)}return p}function Ii(i,e,r,o){const a=Math.pow(2,o.z)*Z,h=[o.x*Z,o.y*Z],p=[];for(const y of i){const b=[];for(const M of y){const T=[M.x+h[0],M.y+h[1]];ie(e,T),b.push(T)}p.push(b)}if(e[2]-e[0]<=a/2){(f=e)[0]=f[1]=1/0,f[2]=f[3]=-1/0;for(const y of p)for(const b of y)Ne(b,e,r,a)}var f;return p}class Zi{constructor(e,r){this.type=jt,this.geojson=e,this.geometries=r}static parse(e,r){if(2!==e.length)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Po(e[1])){const o=e[1];if("FeatureCollection"===o.type)for(let a=0;a<o.features.length;++a){const h=o.features[a].geometry.type;if("Polygon"===h||"MultiPolygon"===h)return new Zi(o,o.features[a].geometry)}else if("Feature"===o.type){const a=o.geometry.type;if("Polygon"===a||"MultiPolygon"===a)return new Zi(o,o.geometry)}else if("Polygon"===o.type||"MultiPolygon"===o.type)return new Zi(o,o)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(r,o){const a=[1/0,1/0,-1/0,-1/0],h=[1/0,1/0,-1/0,-1/0],p=r.canonicalID();if("Polygon"===o.type){const f=ii(o.coordinates,h,p),y=At(r.geometry(),a,h,p);if(!re(a,h))return!1;for(const b of y)if(!it(b,f))return!1}if("MultiPolygon"===o.type){const f=rr(o.coordinates,h,p),y=At(r.geometry(),a,h,p);if(!re(a,h))return!1;for(const b of y)if(!gt(b,f))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(r,o){const a=[1/0,1/0,-1/0,-1/0],h=[1/0,1/0,-1/0,-1/0],p=r.canonicalID();if("Polygon"===o.type){const f=ii(o.coordinates,h,p),y=Ii(r.geometry(),a,h,p);if(!re(a,h))return!1;for(const b of y)if(!Yt(b,f))return!1}if("MultiPolygon"===o.type){const f=rr(o.coordinates,h,p),y=Ii(r.geometry(),a,h,p);if(!re(a,h))return!1;for(const b of y)if(!$i(b,f))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class Hi{constructor(e,r){this.type=r.type,this.name=e,this.boundExpression=r}static parse(e,r){if(2!==e.length||"string"!=typeof e[1])return r.error("'var' expression requires exactly one string literal argument.");const o=e[1];return r.scope.has(o)?new Hi(o,r.scope.get(o)):r.error(`Unknown variable "${o}". Make sure "${o}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class Jr{constructor(e,r,o,a){this.name=e,this.type=r,this._evaluate=o,this.args=a}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,r){const o=e[0],a=Jr.definitions[o];if(!a)return r.error(`Unknown expression "${o}". If you wanted a literal array, use ["literal", [...]].`,0);const h=Array.isArray(a)?a[0]:a.type,p=Array.isArray(a)?[[a[1],a[2]]]:a.overloads,f=p.filter(([b])=>!Array.isArray(b)||b.length===e.length-1);let y=null;for(const[b,M]of f){y=new C(r.registry,ms,r.path,null,r.scope);const T=[];let A=!1;for(let O=1;O<e.length;O++){const R=e[O],N=Array.isArray(b)?b[O-1]:b.type,q=y.parse(R,1+T.length,N);if(!q){A=!0;break}T.push(q)}if(!A)if(Array.isArray(b)&&b.length!==T.length)y.error(`Expected ${b.length} arguments, but found ${T.length} instead.`);else{for(let O=0;O<T.length;O++){const R=Array.isArray(b)?b[O]:b.type,N=T[O];y.concat(O+1).checkSubtype(R,N.type)}if(0===y.errors.length)return new Jr(o,h,M,T)}}if(1===f.length)r.errors.push(...y.errors);else{const b=(f.length?f:p).map(([T])=>{return A=T,Array.isArray(A)?`(${A.map(W).join(", ")})`:`(${W(A.type)}...)`;var A}).join(" | "),M=[];for(let T=1;T<e.length;T++){const A=r.parse(e[T],1+M.length);if(!A)return null;M.push(W(A.type))}r.error(`Expected arguments of type ${b}, but found (${M.join(", ")}) instead.`)}return null}static register(e,r){Jr.definitions=r;for(const o in r)e[o]=Jr}}function ms(i){if(i instanceof Hi)return ms(i.boundExpression);if(i instanceof Jr&&"error"===i.name||i instanceof L||i instanceof Zi)return!1;const e=i instanceof io||i instanceof gn;let r=!0;return i.eachChild(o=>{r=e?r&&ms(o):r&&o instanceof Wn}),!!r&&Di(i)&&fs(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Di(i){if(i instanceof Jr&&("get"===i.name&&1===i.args.length||"feature-state"===i.name||"has"===i.name&&1===i.args.length||"properties"===i.name||"geometry-type"===i.name||"id"===i.name||/^filter-/.test(i.name))||i instanceof Zi)return!1;let e=!0;return i.eachChild(r=>{e&&!Di(r)&&(e=!1)}),e}function Ao(i){if(i instanceof Jr&&"feature-state"===i.name)return!1;let e=!0;return i.eachChild(r=>{e&&!Ao(r)&&(e=!1)}),e}function fs(i,e){if(i instanceof Jr&&e.indexOf(i.name)>=0)return!1;let r=!0;return i.eachChild(o=>{r&&!fs(o,e)&&(r=!1)}),r}function Hr(i,e){const r=i.length-1;let o,a,h=0,p=r,f=0;for(;h<=p;)if(f=Math.floor((h+p)/2),o=i[f],a=i[f+1],o<=e){if(f===r||e<a)return f;h=f+1}else{if(!(o>e))throw new ji("Input is not a number.");p=f-1}return 0}class qn{constructor(e,r,o){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(const[a,h]of o)this.labels.push(a),this.outputs.push(h)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");const o=r.parse(e[1],1,nt);if(!o)return null;const a=[];let h=null;r.expectedType&&"value"!==r.expectedType.kind&&(h=r.expectedType);for(let p=1;p<e.length;p+=2){const f=1===p?-1/0:e[p],y=e[p+1],b=p,M=p+1;if("number"!=typeof f)return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not c
1omputed expressions) for the input values.',b);if(a.length&&a[a.length-1][0]>=f)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',b);const T=r.parse(y,M,h);if(!T)return null;h=h||T.type,a.push([f,T])}return new qn(h,o,a)}evaluate(e){const r=this.labels,o=this.outputs;if(1===r.length)return o[0].evaluate(e);const a=this.input.evaluate(e);if(a<=r[0])return o[0].evaluate(e);const h=r.length;return a>=r[h-1]?o[h-1].evaluate(e):o[Hr(r,a)].evaluate(e)}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function di(i,e,r){return i+r*(e-i)}function Zo(i,e,r){return i.map((o,a)=>di(o,e[a],r))}const $r={number:di,color:function(i,e,r,o="rgb"){switch(o){case"rgb":{const[a,h,p,f]=Zo(i.rgb,e.rgb,r);return new Jt(a,h,p,f,!1)}case"hcl":{const[a,h,p,f]=i.hcl,[y,b,M,T]=e.hcl;let A,O;if(isNaN(a)||isNaN(y))isNaN(a)?isNaN(y)?A=NaN:(A=y,1!==p&&0!==p||(O=b)):(A=a,1!==M&&0!==M||(O=h));else{let le=y-a;y>a&&le>180?le-=360:y<a&&a-y>180&&(le+=360),A=a+r*le}const[R,N,q,H]=function([le,te,he,ye]){return le=isNaN(le)?0:le*Kt,Ci([he,Math.cos(le)*te,Math.sin(le)*te,ye])}([A,O??di(h,b,r),di(p,M,r),di(f,T,r)]);return new Jt(R,N,q,H,!1)}case"lab":{const[a,h,p,f]=Ci(Zo(i.lab,e.lab,r));return new Jt(a,h,p,f,!1)}}},array:Zo,padding:function(i,e,r){return new Nr(Zo(i.values,e.values,r))},variableAnchorOffsetCollection:function(i,e,r){const o=i.values,a=e.values;if(o.length!==a.length)throw new ji(`Cannot interpolate values of different length. from: ${i.toString()}, to: ${e.toString()}`);const h=[];for(let p=0;p<o.length;p+=2){if(o[p]!==a[p])throw new ji(`Cannot interpolate values containing mismatched anchors. from[${p}]: ${o[p]}, to[${p}]: ${a[p]}`);h.push(o[p]);const[f,y]=o[p+1],[b,M]=a[p+1];h.push([di(f,b,r),di(y,M,r)])}return new vr(h)}};class Yr{constructor(e,r,o,a,h){this.type=e,this.operator=r,this.interpolation=o,this.input=a,this.labels=[],this.outputs=[];for(const[p,f]of h)this.labels.push(p),this.outputs.push(f)}static interpolationFactor(e,r,o,a){let h=0;if("exponential"===e.name)h=gs(r,e.base,o,a);else if("linear"===e.name)h=gs(r,1,o,a);else if("cubic-bezier"===e.name){const p=e.controlPoints;h=new Be(p[0],p[1],p[2],p[3]).solve(gs(r,1,o,a))}return h}static parse(e,r){let[o,a,h,...p]=e;if(!Array.isArray(a)||0===a.length)return r.error("Expected an interpolation type expression.",1);if("linear"===a[0])a={name:"linear"};else if("exponential"===a[0]){const b=a[1];if("number"!=typeof b)return r.error("Exponential interpolation requires a numeric base.",1,1);a={name:"exponential",base:b}}else{if("cubic-bezier"!==a[0])return r.error(`Unknown interpolation type ${String(a[0])}`,1,0);{const b=a.slice(1);if(4!==b.length||b.some(M=>"number"!=typeof M||M<0||M>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);a={name:"cubic-bezier",controlPoints:b}}}if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(h=r.parse(h,2,nt),!h)return null;const f=[];let y=null;"interpolate-hcl"===o||"interpolate-lab"===o?y=dr:r.expectedType&&"value"!==r.expectedType.kind&&(y=r.expectedType);for(let b=0;b<p.length;b+=2){const M=p[b],T=p[b+1],A=b+3,O=b+4;if("number"!=typeof M)return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',A);if(f.length&&f[f.length-1][0]>=M)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',A);const R=r.parse(T,O,y);if(!R)return null;y=y||R.type,f.push([M,R])}return Se(y,nt)||Se(y,dr)||Se(y,P)||Se(y,F)||Se(y,j(nt))?new Yr(y,o,a,h,f):r.error(`Type ${W(y)} is not interpolatable.`)}evaluate(e){const r=this.labels,o=this.outputs;if(1===r.length)return o[0].evaluate(e);const a=this.input.evaluate(e);if(a<=r[0])return o[0].evaluate(e);const h=r.length;if(a>=r[h-1])return o[h-1].evaluate(e);const p=Hr(r,a),f=Yr.interpolationFactor(this.interpolation,a,r[p],r[p+1]),y=o[p].evaluate(e),b=o[p+1].evaluate(e);switch(this.operator){case"interpolate":return $r[this.type.kind](y,b,f);case"interpolate-hcl":return $r.color(y,b,f,"hcl");case"interpolate-lab":return $r.color(y,b,f,"lab")}}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function gs(i,e,r,o){const a=o-r,h=i-r;return 0===a?0:1===e?h/a:(Math.pow(e,h)-1)/(Math.pow(e,a)-1)}class _s{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expectected at least one argument.");let o=null;const a=r.expectedType;a&&"value"!==a.kind&&(o=a);const h=[];for(const f of e.slice(1)){const y=r.parse(f,1+h.length,o,void 0,{typeAnnotation:"omit"});if(!y)return null;o=o||y.type,h.push(y)}if(!o)throw new Error("No output type");const p=a&&h.some(f=>ee(a,f.type));return new _s(p?Bt:o,h)}evaluate(e){let r,o=null,a=0;for(const h of this.args)if(a++,o=h.evaluate(e),o&&o instanceof xr&&!o.available&&(r||(r=o.name),o=null,a===this.args.length&&(o=r)),null!==o)break;return o}
vendor: 4,488 bytes, line 1
1eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}class ys{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const o=[];for(let h=1;h<e.length-1;h+=2){const p=e[h];if("string"!=typeof p)return r.error(`Expected string, but found ${typeof p} instead.`,h);if(/[^a-zA-Z0-9_]/.test(p))return r.error("Variable names must contain only alphanumeric characters or '_'.",h);const f=r.parse(e[h+1],h+1);if(!f)return null;o.push([p,f])}const a=r.parse(e[e.length-1],e.length-1,r.expectedType,o);return a?new ys(o,a):null}outputDefined(){return this.result.outputDefined()}}class Ws{constructor(e,r,o){this.type=e,this.index=r,this.input=o}static parse(e,r){if(3!==e.length)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const o=r.parse(e[1],1,nt),a=r.parse(e[2],2,j(r.expectedType||Bt));return o&&a?new Ws(a.type.itemType,o,a):null}evaluate(e){const r=this.index.evaluate(e),o=this.input.evaluate(e);if(r<0)throw new ji(`Array index out of bounds: ${r} < 0.`);if(r>=o.length)throw new ji(`Array index out of bounds: ${r} > ${o.length-1}.`);if(r!==Math.floor(r))throw new ji(`Array index must be an integer, but found ${r} instead.`);return o[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class vs{constructor(e,r){this.type=jt,this.needle=e,this.haystack=r}static parse(e,r){if(3!==e.length)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const o=r.parse(e[1],1,Bt),a=r.parse(e[2],2,Bt);return o&&a?J(o.type,[jt,Ht,nt,Tr,Bt])?new vs(o,a):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${W(o.type)} instead`):null}evaluate(e){const r=this.needle.evaluate(e),o=this.haystack.evaluate(e);if(!o)return!1;if(!ne(r,["boolean","string","number","null"]))throw new ji(`Expected first argument to be of type boolean, string, number or null, but found ${W(Gi(r))} instead.`);if(!ne(o,["string","array"]))throw new ji(`Expected second argument to be of type array or string, but found ${W(Gi(o))} instead.`);return o.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class Wo{constructor(e,r,o){this.type=nt,this.needle=e,this.haystack=r,this.fromIndex=o}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const o=r.parse(e[1],1,Bt),a=r.parse(e[2],2,Bt);if(!o||!a)return null;if(!J(o.type,[jt,Ht,nt,Tr,Bt]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${W(o.type)} instead`);if(4===e.length){const h=r.parse(e[3],3,nt);return h?new Wo(o,a,h):null}return new Wo(o,a)}evaluate(e){const r=this.needle.evaluate(e),o=this.haystack.evaluate(e);if(!ne(r,["boolean","string","number","null"]))throw new ji(`Expected first argument to be of type boolean, string, number or null, but found ${W(Gi(r))} instead.`);if(!ne(o,["string","array"]))throw new ji(`Expected second argument to be of type array or string, but found ${W(Gi(o))} instead.`);if(this.fromIndex){const a=this.fromIndex.evaluate(e);return o.indexOf(r,a)}return o.indexOf(r)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class xs{constructor(e,r,o,a,h,p){this.inputType=e,this.type=r,this.input=o,this.cases=a,this.outputs=h,this.otherwise=p}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error("Expected an even number of arguments.");let o,a;r.expectedType&&"value"!==r.expectedType.kind&&(a=r.expectedType);const h={},p=[];for(let b=2;b<e.length-1;b+=2){let M=e[b];const T=e[b+1];Array.isArray(M)||(M=[M]);const A=r.concat(b);if(0===M.length)return A.error("Expected at least one branch label.");for(const R of M){if("number"!=typeof R&&"string"!=typeof R)return A.error("Branch labels must be numbers or strings.");if("number"==typeof R&&Math.abs(R)>Number.MAX_SAFE_INTEGER)return A.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof R&&Math.floor(R)!==R)return A.error("Numeric branch labels must be integer values.");if(o){if(A.checkSubtype(o,Gi(R)))return null}else o=Gi(R);
vendor: 15,006 bytes, line 1
1if(void 0!==h[String(R)])return A.error("Branch labels must be unique.");h[String(R)]=p.length}const O=r.parse(T,b,a);if(!O)return null;a=a||O.type,p.push(O)}const f=r.parse(e[1],1,Bt);if(!f)return null;const y=r.parse(e[e.length-1],e.length-1,a);return y?"value"!==f.type.kind&&r.concat(1).checkSubtype(o,f.type)?null:new xs(o,a,f,h,p,y):null}evaluate(e){const r=this.input.evaluate(e);return(Gi(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}}class qs{constructor(e,r,o){this.type=e,this.branches=r,this.otherwise=o}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error("Expected an odd number of arguments.");let o;r.expectedType&&"value"!==r.expectedType.kind&&(o=r.expectedType);const a=[];for(let p=1;p<e.length-1;p+=2){const f=r.parse(e[p],p,jt);if(!f)return null;const y=r.parse(e[p+1],p+1,o);if(!y)return null;a.push([f,y]),o=o||y.type}const h=r.parse(e[e.length-1],e.length-1,o);if(!h)return null;if(!o)throw new Error("Can't infer output type");return new qs(o,a,h)}evaluate(e){for(const[r,o]of this.branches)if(r.evaluate(e))return o.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[r,o]of this.branches)e(r),e(o);e(this.otherwise)}outputDefined(){return this.branches.every(([e,r])=>r.outputDefined())&&this.otherwise.outputDefined()}}class bs{constructor(e,r,o,a){this.type=e,this.input=r,this.beginIndex=o,this.endIndex=a}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const o=r.parse(e[1],1,Bt),a=r.parse(e[2],2,nt);if(!o||!a)return null;if(!J(o.type,[j(Bt),Ht,Bt]))return r.error(`Expected first argument to be of type array or string, but found ${W(o.type)} instead`);if(4===e.length){const h=r.parse(e[3],3,nt);return h?new bs(o.type,o,a,h):null}return new bs(o.type,o,a)}evaluate(e){const r=this.input.evaluate(e),o=this.beginIndex.evaluate(e);if(!ne(r,["string","array"]))throw new ji(`Expected first argument to be of type array or string, but found ${W(Gi(r))} instead.`);if(this.endIndex){const a=this.endIndex.evaluate(e);return r.slice(o,a)}return r.slice(o)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function qo(i,e){return"=="===i||"!="===i?"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 ws(i,e,r,o){return 0===o.compare(e,r)}function vo(i,e,r){const o="=="!==i&&"!="!==i;return class hh{constructor(h,p,f){this.type=jt,this.lhs=h,this.rhs=p,this.collator=f,this.hasUntypedArgument="value"===h.type.kind||"value"===p.type.kind}static parse(h,p){if(3!==h.length&&4!==h.length)return p.error("Expected two or three arguments.");const f=h[0];let y=p.parse(h[1],1,Bt);if(!y)return null;if(!qo(f,y.type))return p.concat(1).error(`"${f}" comparisons are not supported for type '${W(y.type)}'.`);let b=p.parse(h[2],2,Bt);if(!b)return null;if(!qo(f,b.type))return p.concat(2).error(`"${f}" comparisons are not supported for type '${W(b.type)}'.`);if(y.type.kind!==b.type.kind&&"value"!==y.type.kind&&"value"!==b.type.kind)return p.error(`Cannot compare types '${W(y.type)}' and '${W(b.type)}'.`);o&&("value"===y.type.kind&&"value"!==b.type.kind?y=new gn(b.type,[y]):"value"!==y.type.kind&&"value"===b.type.kind&&(b=new gn(y.type,[b])));let M=null;if(4===h.length){if("string"!==y.type.kind&&"string"!==b.type.kind&&"value"!==y.type.kind&&"value"!==b.type.kind)return p.error("Cannot use collator to compare non-string types.");if(M=p.parse(h[3],3,Gr),!M)return null}return new hh(y,b,M)}evaluate(h){const p=this.lhs.evaluate(h),f=this.rhs.evaluate(h);if(o&&this.hasUntypedArgument){const y=Gi(p),b=Gi(f);if(y.kind!==b.kind||"string"!==y.kind&&"number"!==y.kind)throw new ji(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${y.kind}, ${b.kind}) instead.`)}if(this.collator&&!o&&this.hasUntypedArgument){const y=Gi(p),b=Gi(f);if("string"!==y.kind||"string"!==b.kind)return e(h,p,f)}return this.collator?r(h,p,f,this.collator.evaluate(h)):e(h,p,f)}eachChild(h){h(this.lhs),h(this.rhs),this.collator&&h(this.collator)}outputDefined(){return!0}}}const Fn=vo("==",function(i,e,r){return e===r},ws),la=vo("!=",function(i,e,r){return e!==r},function(i,e,r,o){return!ws(0,e,r,o)}),ca=vo("<",function(i,e,r){return e<r},function(i,e,r,o){return o.compare(e,r)<0}),Ta=vo(">",function(i,e,r){return e>r},function(i,e,r,o){return o.compare(e,r)>0}),ua=vo("<=",function(i,e,r){return e<=r},function(i,e,r,o){return o.compare(e,r)<=0}),Cs=vo(">=",function(i,e,r){return e>=r},function(i,e,r,o){return o.compare(e,r)>=0});class Ss{constructor(e,r,o,a,h){this.type=Ht,this.number=e,this.locale=r,this.currency=o,this.minFractionDigits=a,this.maxFractionDigits=h}static parse(e,r){if(3!==e.length)return r.error("Expected two arguments.");const o=r.parse(e[1],1,nt);if(!o)return null;const a=e[2];if("object"!=typeof a||Array.isArray(a))return r.error("NumberFormat options argument must be an object.");let h=null;if(a.locale&&(h=r.parse(a.locale,1,Ht),!h))return null;let p=null;if(a.currency&&(p=r.parse(a.currency,1,Ht),!p))return null;let f=null;if(a["min-fraction-digits"]&&(f=r.parse(a["min-fraction-digits"],1,nt),!f))return null;let y=null;return a["max-fraction-digits"]&&(y=r.parse(a["max-fraction-digits"],1,nt),!y)?null:new Ss(o,h,p,f,y)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Ko{constructor(e){this.type=G,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const o=e[1];if(!Array.isArray(o)&&"object"==typeof o)return r.error("First argument must be an image or text section.");const a=[];let h=!1;for(let p=1;p<=e.length-1;++p){const f=e[p];if(h&&"object"==typeof f&&!Array.isArray(f)){h=!1;let y=null;if(f["font-scale"]&&(y=r.parse(f["font-scale"],1,nt),!y))return null;let b=null;if(f["text-font"]&&(b=r.parse(f["text-font"],1,j(Ht)),!b))return null;let M=null;if(f["text-color"]&&(M=r.parse(f["text-color"],1,dr),!M))return null;const T=a[a.length-1];T.scale=y,T.font=b,T.textColor=M}else{const y=r.parse(e[p],1,Bt);if(!y)return null;const b=y.type.kind;if("string"!==b&&"value"!==b&&"null"!==b&&"resolvedImage"!==b)return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");h=!0,a.push({content:y,scale:null,font:null,textColor:null})}}return new Ko(a)}evaluate(e){return new Mi(this.sections.map(r=>{const o=r.content.evaluate(e);return Gi(o)===k?new jr("",o,null,null,null):new jr(wi(o),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(","):null,r.textColor?r.textColor.evaluate(e):null)}))}eachChild(e){for(const r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor)}outputDefined(){return!1}}class Ks{constructor(e){this.type=k,this.input=e}static parse(e,r){if(2!==e.length)return r.error("Expected two arguments.");const o=r.parse(e[1],1,Ht);return o?new Ks(o):r.error("No image name provided.")}evaluate(e){const r=this.input.evaluate(e),o=xr.fromString(r);return o&&e.availableImages&&(o.available=e.availableImages.indexOf(r)>-1),o}eachChild(e){e(this.input)}outputDefined(){return!1}}class Kn{constructor(e){this.type=nt,this.input=e}static parse(e,r){if(2!==e.length)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);const o=r.parse(e[1],1);return o?"array"!==o.type.kind&&"string"!==o.type.kind&&"value"!==o.type.kind?r.error(`Expected argument of type string or array, but found ${W(o.type)} instead.`):new Kn(o):null}evaluate(e){const r=this.input.evaluate(e);if("string"==typeof r||Array.isArray(r))return r.length;throw new ji(`Expected value to be of type string or array, but found ${W(Gi(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const xo={"==":Fn,"!=":la,">":Ta,"<":ca,">=":Cs,"<=":ua,array:gn,at:Ws,boolean:gn,case:qs,coalesce:_s,collator:L,format:Ko,image:Ks,in:vs,"index-of":Wo,interpolate:Yr,"interpolate-hcl":Yr,"interpolate-lab":Yr,length:Kn,let:ys,literal:Wn,match:xs,number:gn,"number-format":Ss,object:gn,slice:bs,step:qn,string:gn,"to-boolean":io,"to-color":io,"to-number":io,"to-string":io,var:Hi,within:Zi};function ha(i,[e,r,o,a]){e=e.evaluate(i),r=r.evaluate(i),o=o.evaluate(i);const h=a?a.evaluate(i):1,p=ps(e,r,o,h);if(p)throw new ji(p);return new Jt(e/255,r/255,o/255,h,!1)}function da(i,e){return i in e}function Xo(i,e){const r=e[i];return void 0===r?null:r}function In(i){return{type:i}}function Ms(i){return{result:"success",value:i}}function Bn(i){return{result:"error",value:i}}function ro(i){return"data-driven"===i["property-type"]||"cross-faded-data-driven"===i["property-type"]}function ko(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function Xs(i){return!!i.expression&&i.expression.interpolated}function Si(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":null===i?"null":typeof i}function Wi(i){return"object"==typeof i&&null!==i&&!Array.isArray(i)}function Pa(i){return i}function fi(i,e){const r="color"===e.type,o=i.stops&&"object"==typeof i.stops[0][0],a=o||!(o||void 0!==i.property),h=i.type||(Xs(e)?"exponential":"interval");if(r||"padding"===e.type){const M=r?Jt.parse:Nr.parse;(i=Er({},i)).stops&&(i.stops=i.stops.map(T=>[T[0],M(T[1])])),i.default=M(i.default?i.default:e.default)}if(i.colorSpace&&"rgb"!==(p=i.colorSpace)&&"hcl"!==p&&"lab"!==p)throw new Error(`Unknown color space: "${i.colorSpace}"`);var p;let f,y,b;if("exponential"===h)f=an;else if("interval"===h)f=Ei;else if("categorical"===h){f=Ni,y=Object.create(null);for(const M of i.stops)y[M[0]]=M[1];b=typeof i.stops[0][0]}else{if("identity"!==h)throw new Error(`Unknown function type "${h}"`);f=oo}if(o){const M={},T=[];for(let R=0;R<i.stops.length;R++){const N=i.stops[R],q=N[0].zoom;void 0===M[q]&&(M[q]={zoom:q,type:i.type,property:i.property,default:i.default,stops:[]},T.push(q)),M[q].stops.push([N[0].value,N[1]])}const A=[];for(const R of T)A.push([M[R].zoom,fi(M[R],e)]);const O={name:"linear"};return{kind:"composite",interpolationType:O,interpolationFactor:Yr.interpolationFactor.bind(void 0,O),zoomStops:A.map(R=>R[0]),evaluate:({zoom:R},N)=>an({stops:A,base:i.base},e,R).evaluate(R,N)}}if(a){const M="exponential"===h?{name:"exponential",base:void 0!==i.base?i.base:1}:null;return{kind:"camera",interpolationType:M,interpolationFactor:Yr.interpolationFactor.bind(void 0,M),zoomStops:i.stops.map(T=>T[0]),evaluate:({zoom:T})=>f(i,e,T,y,b)}}return{kind:"source",evaluate(M,T){const A=T&&T.properties?T.properties[i.property]:void 0;return void 0===A?no(i.default,e.default):f(i,e,A,y,b)}}}function no(i,e,r){return void 0!==i?i:void 0!==e?e:void 0!==r?r:void 0}function Ni(i,e,r,o,a){return no(typeof r===a?o[r]:void 0,i.default,e.default)}function Ei(i,e,r){if("number"!==Si(r))return no(i.default,e.default);const o=i.stops.length;if(1===o||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[o-1][0])return i.stops[o-1][1];const a=Hr(i.stops.map(h=>h[0]),r);return i.stops[a][1]}function an(i,e,r){const o=void 0!==i.base?i.base:1;if("number"!==Si(r))return no(i.default,e.default);const a=i.stops.length;if(1===a||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[a-1][0])return i.stops[a-1][1];const h=Hr(i.stops.map(M=>M[0]),r),p=function(M,T,A,O){const R=O-A,N=M-A;return 0===R?0:1===T?N/R:(Math.pow(T,N)-1)/(Math.pow(T,R)-1)}(r,o,i.stops[h][0],i.stops[h+1][0]),f=i.stops[h][1],y=i.stops[h+1][1],b=$r[e.type]||Pa;return"function"==typeof f.evaluate?{evaluate(...M){const T=f.evaluate.apply(void 0,M),A=y.evaluate.apply(void 0,M);if(void 0!==T&&void 0!==A)return b(T,A,p,i.colorSpace)}}:b(f,y,p,i.colorSpace)}function oo(i,e,r){switch(e.type){case"color":r=Jt.parse(r);break;case"formatted":r=Mi.fromString(r.toString());break;case"resolvedImage":r=xr.fromString(r.toString());break;case"padding":r=Nr.parse(r);break;default:Si(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0)}return no(r,i.default,e.default)}Jr.register(xo,{error:[{kind:"error"},[Ht],(i,[e])=>{throw new ji(e.evaluate(i))}],typeof:[Ht,[Bt],(i,[e])=>W(Gi(e.evaluate(i)))],"to-rgba":[j(nt,4),[dr],(i,[e])=>{const[r,o,a,h]=e.evaluate(i).rgb;return[255*r,255*o,255*a,h]}],rgb:[dr,[nt,nt,nt],ha],rgba:[dr,[nt,nt,nt,nt],ha],has:{type:jt,overloads:[[[Ht],(i,[e])=>da(e.evaluate(i),i.properties())],[[Ht,Br],(i,[e,r])=>da(e.evaluate(i),r.evaluate(i))]]},get:{type:Bt,overloads:[[[Ht],(i,[e])=>Xo(e.evaluate(i),i.properties())],[[Ht,Br],(i,[e,r])=>Xo(e.evaluate(i),r.evaluate(i))]]},"feature-state":[Bt,[Ht],(i,[e])=>Xo(e.evaluate(i),i.featureState||{})],properties:[Br,[],i=>i.properties()],"geometry-type":[Ht,[],i=>i.geometryType()],id:[Bt,[],i=>i.id()],zoom:[nt,[],i=>i.globals.zoom],"heatmap-density":[nt,[],i=>i.globals.heatmapDensity||0],"line-progress":[nt,[],i=>i.globals.lineProgress||0],accumulated:[Bt,[],i=>void 0===i.globals.accumulated?null:i.globals.accumulated],"+":[nt,In(nt),(i,e)=>{let r=0;for(const o of e)r+=o.evaluate(i);return r}],"*":[nt,In(nt),(i,e)=>{let r=1;for(const o of e)r*=o.evaluate(i);return r}],"-":{type:nt,overloads:[[[nt,nt],(i,[e,r])=>e.evaluate(i)-r.evaluate(i)],[[nt],(i,[e])=>-e.evaluate(i)]]},"/":[nt,[nt,nt],(i,[e,r])=>e.evaluate(i)/r.evaluate(i)],"%":[nt,[nt,nt],(i,[e,r])=>e.evaluate(i)%r.evaluate(i)],ln2:[nt,[],()=>Math.LN2],pi:[nt,[],()=>Math.PI],e:[nt,[],()=>Math.E],"^":[nt,[nt,nt],(i,[e,r])=>Math.pow(e.evaluate(i),r.evaluate(i))],sqrt:[nt,[nt],(i,[e])=>Math.sqrt(e.evaluate(i))],log10:[nt,[nt],(i,[e])=>Math.log(e.evaluate(i))/Math.LN10],ln:[nt,[nt],(i,[e])=>Math.log(e.evaluate(i))],log2:[nt,[nt],(i,[e])=>Math.log(e.evaluate(i))/Math.LN2],sin:[nt,[nt],(i,[e])=>Math.sin(e.evaluate(i))],cos:[nt,[nt],(i,[e])=>Math.cos(e.evaluate(i))],tan:[nt,[nt],(i,[e])=>Math.tan(e.evaluate(i))],asin:[nt,[nt],(i,[e])=>Math.asin(e.evaluate(i))],acos:[nt,[nt],(i,[e])=>Math.acos(e.evaluate(i))],atan:[nt,[nt],(i,[e])=>Math.atan(e.evaluate(i))],min:[nt,In(nt),(i,e)=>Math.min(...e.map(r=>r.evaluate(i)))],max:[nt,In(nt),(i,e)=>Math.max(...e.map(r=>r.evaluate(i)))],abs:[nt,[nt],(i,[e])=>Math.abs(e.evaluate(i))],round:[nt,[nt],(i,[e])=>{const r=e.evaluate(i);return r<0?-Math.round(-r):Math.round(r)}
vendor: 1,927 bytes, line 1
1],floor:[nt,[nt],(i,[e])=>Math.floor(e.evaluate(i))],ceil:[nt,[nt],(i,[e])=>Math.ceil(e.evaluate(i))],"filter-==":[jt,[Ht,Bt],(i,[e,r])=>i.properties()[e.value]===r.value],"filter-id-==":[jt,[Bt],(i,[e])=>i.id()===e.value],"filter-type-==":[jt,[Ht],(i,[e])=>i.geometryType()===e.value],"filter-<":[jt,[Ht,Bt],(i,[e,r])=>{const o=i.properties()[e.value],a=r.value;return typeof o==typeof a&&o<a}],"filter-id-<":[jt,[Bt],(i,[e])=>{const r=i.id(),o=e.value;return typeof r==typeof o&&r<o}],"filter->":[jt,[Ht,Bt],(i,[e,r])=>{const o=i.properties()[e.value],a=r.value;return typeof o==typeof a&&o>a}],"filter-id->":[jt,[Bt],(i,[e])=>{const r=i.id(),o=e.value;return typeof r==typeof o&&r>o}],"filter-<=":[jt,[Ht,Bt],(i,[e,r])=>{const o=i.properties()[e.value],a=r.value;return typeof o==typeof a&&o<=a}],"filter-id-<=":[jt,[Bt],(i,[e])=>{const r=i.id(),o=e.value;return typeof r==typeof o&&r<=o}],"filter->=":[jt,[Ht,Bt],(i,[e,r])=>{const o=i.properties()[e.value],a=r.value;return typeof o==typeof a&&o>=a}],"filter-id->=":[jt,[Bt],(i,[e])=>{const r=i.id(),o=e.value;return typeof r==typeof o&&r>=o}],"filter-has":[jt,[Bt],(i,[e])=>e.value in i.properties()],"filter-has-id":[jt,[],i=>null!==i.id()&&void 0!==i.id()],"filter-type-in":[jt,[j(Ht)],(i,[e])=>e.value.indexOf(i.geometryType())>=0],"filter-id-in":[jt,[j(Bt)],(i,[e])=>e.value.indexOf(i.id())>=0],"filter-in-small":[jt,[Ht,j(Bt)],(i,[e,r])=>r.value.indexOf(i.properties()[e.value])>=0],"filter-in-large":[jt,[Ht,j(Bt)],(i,[e,r])=>function(o,a,h,p){for(;h<=p;){const f=h+p>>1;if(a[f]===o)return!0;a[f]>o?p=f-1:h=f+1}return!1}(i.properties()[e.value],r.value,0,r.value.length-1)],all:{type:jt,overloads:[[[jt,jt],(i,[e,r])=>e.evaluate(i)&&r.evaluate(i)],[In(jt),(i,e)=>{for(const r of e)if(!r.evaluate(i))return!1;return!0}]]},any:{type:jt,overloads:[[[jt,jt],(i,[e,r])=>e.evaluate(i)||r.evaluate(i)],[In(jt),(i,e)=>{for(const r of e)if(r.evaluate(i))return!0;return!1}]]}
vendor: 4,232 bytes, line 1
1,"!":[jt,[jt],(i,[e])=>!e.evaluate(i)],"is-supported-script":[jt,[Ht],(i,[e])=>{const r=i.globals&&i.globals.isSupportedScript;return!r||r(e.evaluate(i))}],upcase:[Ht,[Ht],(i,[e])=>e.evaluate(i).toUpperCase()],downcase:[Ht,[Ht],(i,[e])=>e.evaluate(i).toLowerCase()],concat:[Ht,In(Bt),(i,e)=>e.map(r=>wi(r.evaluate(i))).join("")],"resolved-locale":[Ht,[Gr],(i,[e])=>e.evaluate(i).resolvedLocale()]});class Do{constructor(e,r){var o;this.expression=e,this._warningHistory={},this._evaluator=new m,this._defaultValue=r?"color"===(o=r).type&&Wi(o.default)?new Jt(0,0,0,0):"color"===o.type?Jt.parse(o.default)||null:"padding"===o.type?Nr.parse(o.default)||null:"variableAnchorOffsetCollection"===o.type?vr.parse(o.default)||null:void 0===o.default?null:o.default:null,this._enumValues=r&&"enum"===r.type?r.values:null}evaluateWithoutErrorHandling(e,r,o,a,h,p){return this._evaluator.globals=e,this._evaluator.feature=r,this._evaluator.featureState=o,this._evaluator.canonical=a,this._evaluator.availableImages=h||null,this._evaluator.formattedSection=p,this.expression.evaluate(this._evaluator)}evaluate(e,r,o,a,h,p){this._evaluator.globals=e,this._evaluator.feature=r||null,this._evaluator.featureState=o||null,this._evaluator.canonical=a,this._evaluator.availableImages=h||null,this._evaluator.formattedSection=p||null;try{const f=this.expression.evaluate(this._evaluator);if(null==f||"number"==typeof f&&f!=f)return this._defaultValue;if(this._enumValues&&!(f in this._enumValues))throw new ji(`Expected value to be one of ${Object.keys(this._enumValues).map(y=>JSON.stringify(y)).join(", ")}, but found ${JSON.stringify(f)} instead.`);return f}catch(f){return this._warningHistory[f.message]||(this._warningHistory[f.message]=!0,typeof console<"u"&&console.warn(f.message)),this._defaultValue}}}function En(i){return Array.isArray(i)&&i.length>0&&"string"==typeof i[0]&&i[0]in xo}function Is(i,e){const r=new C(xo,ms,[],e?function(a){const h={color:dr,string:Ht,number:nt,enum:Ht,boolean:jt,formatted:G,padding:P,resolvedImage:k,variableAnchorOffsetCollection:F};return"array"===a.type?j(h[a.value]||Bt,a.length):h[a.type]}(e):void 0),o=r.parse(i,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return o?Ms(new Do(o,e)):Bn(r.errors)}class Lo{constructor(e,r){this.kind=e,this._styleExpression=r,this.isStateDependent="constant"!==e&&!Ao(r.expression)}evaluateWithoutErrorHandling(e,r,o,a,h,p){return this._styleExpression.evaluateWithoutErrorHandling(e,r,o,a,h,p)}evaluate(e,r,o,a,h,p){return this._styleExpression.evaluate(e,r,o,a,h,p)}}class so{constructor(e,r,o,a){this.kind=e,this.zoomStops=o,this._styleExpression=r,this.isStateDependent="camera"!==e&&!Ao(r.expression),this.interpolationType=a}evaluateWithoutErrorHandling(e,r,o,a,h,p){return this._styleExpression.evaluateWithoutErrorHandling(e,r,o,a,h,p)}evaluate(e,r,o,a,h,p){return this._styleExpression.evaluate(e,r,o,a,h,p)}interpolationFactor(e,r,o){return this.interpolationType?Yr.interpolationFactor(this.interpolationType,e,r,o):0}}function Es(i,e){const r=Is(i,e);if("error"===r.result)return r;const o=r.value.expression,a=Di(o);if(!a&&!ro(e))return Bn([new zi("","data expressions not supported")]);const h=fs(o,["zoom"]);if(!h&&!ko(e))return Bn([new zi("","zoom expressions not supported")]);const p=Jo(o);return p||h?p instanceof zi?Bn([p]):p instanceof Yr&&!Xs(e)?Bn([new zi("",'"interpolate" expressions cannot be used with this property')]):Ms(p?new so(a?"camera":"composite",r.value,p.labels,p instanceof Yr?p.interpolation:void 0):new Lo(a?"constant":"source",r.value)):Bn([new zi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Oo{constructor(e,r){this._parameters=e,this._specification=r,Er(this,fi(this._parameters,this._specification))}static deserialize(e){return new Oo(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Jo(i){let e=null;if(i instanceof ys)e=Jo(i.result);else if(i instanceof _s){for(const r of i.args)if(e=Jo(r),e)break}else(i instanceof qn||i instanceof Yr)&&i.input instanceof Jr&&"zoom"===i.input.name&&(e=i);return e instanceof zi||i.eachChild(r=>{const o=Jo(r);
vendor: 16,843 bytes, line 1
1o instanceof zi?e=o:!e&&o?e=new zi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&o&&e!==o&&(e=new zi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function Ho(i){if(!0===i||!1===i)return!0;if(!Array.isArray(i)||0===i.length)return!1;switch(i[0]){case"has":return i.length>=2&&"$id"!==i[1]&&"$type"!==i[1];case"in":return i.length>=3&&("string"!=typeof i[1]||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==i.length||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(const e of i.slice(1))if(!Ho(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}const pa={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Ts(i){if(null==i)return{filter:()=>!0,needGeometry:!1};Ho(i)||(i=As(i));const e=Is(i,pa);if("error"===e.result)throw new Error(e.value.map(r=>`${r.key}: ${r.message}`).join(", "));return{filter:(r,o,a)=>e.value.evaluate(r,o,{},a),needGeometry:bo(i)}}function Ps(i,e){return i<e?-1:i>e?1:0}function bo(i){if(!Array.isArray(i))return!1;if("within"===i[0])return!0;for(let e=1;e<i.length;e++)if(bo(i[e]))return!0;return!1}function As(i){if(!i)return!0;const e=i[0];return i.length<=1?"any"!==e:"=="===e?Nn(i[1],i[2],"=="):"!="===e?zo(Nn(i[1],i[2],"==")):"<"===e||">"===e||"<="===e||">="===e?Nn(i[1],i[2],e):"any"===e?(r=i.slice(1),["any"].concat(r.map(As))):"all"===e?["all"].concat(i.slice(1).map(As)):"none"===e?["all"].concat(i.slice(1).map(As).map(zo)):"in"===e?ma(i[1],i.slice(2)):"!in"===e?zo(ma(i[1],i.slice(2))):"has"===e?ao(i[1]):"!has"===e?zo(ao(i[1])):"within"!==e||i;var r}function Nn(i,e,r){switch(i){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,i,e]}}function ma(i,e){if(0===e.length)return!1;switch(i){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(r=>typeof r!=typeof e[0])?["filter-in-large",i,["literal",e.sort(Ps)]]:["filter-in-small",i,["literal",e]]}}function ao(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function zo(i){return["!",i]}function ks(i){const e=typeof i;if("number"===e||"boolean"===e||"string"===e||null==i)return JSON.stringify(i);if(Array.isArray(i)){let a="[";for(const h of i)a+=`${ks(h)},`;return`${a}]`}const r=Object.keys(i).sort();let o="{";for(let a=0;a<r.length;a++)o+=`${JSON.stringify(r[a])}:${ks(i[r[a]])},`;return`${o}}`}function wo(i){let e="";for(const r of ei)e+=`/${ks(i[r])}`;return e}function Ds(i){const e=i.value;return e?[new tt(i.key,e,"constants have been deprecated as of v8")]:[]}function qi(i){return i instanceof Number||i instanceof String||i instanceof Boolean?i.valueOf():i}function lo(i){if(Array.isArray(i))return i.map(lo);if(i instanceof Object&&!(i instanceof Number||i instanceof String||i instanceof Boolean)){const e={};for(const r in i)e[r]=lo(i[r]);return e}return qi(i)}function Zr(i){const e=i.key,r=i.value,o=i.valueSpec||{},a=i.objectElementValidators||{},h=i.style,p=i.styleSpec,f=i.validateSpec;let y=[];const b=Si(r);if("object"!==b)return[new tt(e,r,`object expected, ${b} found`)];for(const M in r){const T=M.split(".")[0],A=o[T]||o["*"];let O;if(a[T])O=a[T];else if(o[T])O=f;else if(a["*"])O=a["*"];else{if(!o["*"]){y.push(new tt(e,r[M],`unknown property "${M}"`));continue}O=f}y=y.concat(O({key:(e&&`${e}.`)+M,value:r[M],valueSpec:A,style:h,styleSpec:p,object:r,objectKey:M,validateSpec:f},r))}for(const M in o)a[M]||o[M].required&&void 0===o[M].default&&void 0===r[M]&&y.push(new tt(e,r,`missing required property "${M}"`));return y}function Un(i){const e=i.value,r=i.valueSpec,o=i.style,a=i.styleSpec,h=i.key,p=i.arrayElementValidator||i.validateSpec;if("array"!==Si(e))return[new tt(h,e,`array expected, ${Si(e)} found`)];if(r.length&&e.length!==r.length)return[new tt(h,e,`array length ${r.length} expected, length ${e.length} found`)];if(r["min-length"]&&e.length<r["min-length"])return[new tt(h,e,`array length at least ${r["min-length"]} expected, length ${e.length} found`)];let f={type:r.value,values:r.values};a.$version<7&&(f.function=r.function),"object"===Si(r.value)&&(f=r.value);let y=[];for(let b=0;b<e.length;b++)y=y.concat(p({array:e,arrayIndex:b,value:e[b],valueSpec:f,validateSpec:i.validateSpec,style:o,styleSpec:a,key:`${h}[${b}]`}));return y}function Ro(i){const e=i.key,r=i.value,o=i.valueSpec;let a=Si(r);return"number"===a&&r!=r&&(a="NaN"),"number"!==a?[new tt(e,r,`number expected, ${a} found`)]:"minimum"in o&&r<o.minimum?[new tt(e,r,`${r} is less than the minimum value ${o.minimum}`)]:"maximum"in o&&r>o.maximum?[new tt(e,r,`${r} is greater than the maximum value ${o.maximum}`)]:[]}function Ls(i){const e=i.valueSpec,r=qi(i.value.type);let o,a,h,p={};const f="categorical"!==r&&void 0===i.value.property,y=!f,b="array"===Si(i.value.stops)&&"array"===Si(i.value.stops[0])&&"object"===Si(i.value.stops[0][0]),M=Zr({key:i.key,value:i.value,valueSpec:i.styleSpec.function,validateSpec:i.validateSpec,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(O){if("identity"===r)return[new tt(O.key,O.value,'identity function may not have a "stops" property')];let R=[];const N=O.value;return R=R.concat(Un({key:O.key,value:N,valueSpec:O.valueSpec,validateSpec:O.validateSpec,style:O.style,styleSpec:O.styleSpec,arrayElementValidator:T})),"array"===Si(N)&&0===N.length&&R.push(new tt(O.key,N,"array must have at least one stop")),R},default:function(O){return O.validateSpec({key:O.key,value:O.value,valueSpec:e,validateSpec:O.validateSpec,style:O.style,styleSpec:O.styleSpec})}}});return"identity"===r&&f&&M.push(new tt(i.key,i.value,'missing required property "property"')),"identity"===r||i.value.stops||M.push(new tt(i.key,i.value,'missing required property "stops"')),"exponential"===r&&i.valueSpec.expression&&!Xs(i.valueSpec)&&M.push(new tt(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(y&&!ro(i.valueSpec)?M.push(new tt(i.key,i.value,"property functions not supported")):f&&!ko(i.valueSpec)&&M.push(new tt(i.key,i.value,"zoom functions not supported"))),"categorical"!==r&&!b||void 0!==i.value.property||M.push(new tt(i.key,i.value,'"property" property is required')),M;function T(O){let R=[];const N=O.value,q=O.key;if("array"!==Si(N))return[new tt(q,N,`array expected, ${Si(N)} found`)];if(2!==N.length)return[new tt(q,N,`array length 2 expected, length ${N.length} found`)];if(b){if("object"!==Si(N[0]))return[new tt(q,N,`object expected, ${Si(N[0])} found`)];if(void 0===N[0].zoom)return[new tt(q,N,"object stop key must have zoom")];if(void 0===N[0].value)return[new tt(q,N,"object stop key must have value")];if(h&&h>qi(N[0].zoom))return[new tt(q,N[0].zoom,"stop zoom values must appear in ascending order")];qi(N[0].zoom)!==h&&(h=qi(N[0].zoom),a=void 0,p={}),R=R.concat(Zr({key:`${q}[0]`,value:N[0],valueSpec:{zoom:{}},validateSpec:O.validateSpec,style:O.style,styleSpec:O.styleSpec,objectElementValidators:{zoom:Ro,value:A}}))}else R=R.concat(A({key:`${q}[0]`,value:N[0],valueSpec:{},validateSpec:O.validateSpec,style:O.style,styleSpec:O.styleSpec},N));return En(lo(N[1]))?R.concat([new tt(`${q}[1]`,N[1],"expressions are not allowed in function stops.")]):R.concat(O.validateSpec({key:`${q}[1]`,value:N[1],valueSpec:e,validateSpec:O.validateSpec,style:O.style,styleSpec:O.styleSpec}))}function A(O,R){const N=Si(O.value),q=qi(O.value),H=null!==O.value?O.value:R;if(o){if(N!==o)return[new tt(O.key,H,`${N} stop domain type must match previous stop domain type ${o}`)]}else o=N;if("number"!==N&&"string"!==N&&"boolean"!==N)return[new tt(O.key,H,"stop domain value must be a number, string, or boolean")];if("number"!==N&&"categorical"!==r){let le=`number expected, ${N} found`;return ro(e)&&void 0===r&&(le+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new tt(O.key,H,le)]}return"categorical"!==r||"number"!==N||isFinite(q)&&Math.floor(q)===q?"categorical"!==r&&"number"===N&&void 0!==a&&q<a?[new tt(O.key,H,"stop domain values must appear in ascending order")]:(a=q,"categorical"===r&&q in p?[new tt(O.key,H,"stop domain values must be unique")]:(p[q]=!0,[])):[new tt(O.key,H,`integer expected, found ${q}`)]}}function ue(i){const e=("property"===i.expressionContext?Es:Is)(lo(i.value),i.valueSpec);if("error"===e.result)return e.value.map(o=>new tt(`${i.key}${o.key}`,i.value,o.message));const r=e.value.expression||e.value._styleExpression.expression;if("property"===i.expressionContext&&"text-font"===i.propertyKey&&!r.outputDefined())return[new tt(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===i.expressionContext&&"layout"===i.propertyType&&!Ao(r))return[new tt(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===i.expressionContext&&!Ao(r))return[new tt(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&0===i.expressionContext.indexOf("cluster")){if(!fs(r,["zoom","feature-state"]))return[new tt(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===i.expressionContext&&!Di(r))return[new tt(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function we(i){const e=i.key,r=i.value,o=i.valueSpec,a=[];return Array.isArray(o.values)?-1===o.values.indexOf(qi(r))&&a.push(new tt(e,r,`expected one of [${o.values.join(", ")}], ${JSON.stringify(r)} found`)):-1===Object.keys(o.values).indexOf(qi(r))&&a.push(new tt(e,r,`expected one of [${Object.keys(o.values).join(", ")}], ${JSON.stringify(r)} found`)),a}function ct(i){return Ho(lo(i.value))?ue(Er({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Vt(i)}function Vt(i){const e=i.value,r=i.key;if("array"!==Si(e))return[new tt(r,e,`array expected, ${Si(e)} found`)];const o=i.styleSpec;let a,h=[];if(e.length<1)return[new tt(r,e,"filter array must have at least 1 element")];switch(h=h.concat(we({key:`${r}[0]`,value:e[0],valueSpec:o.filter_operator,style:i.style,styleSpec:i.styleSpec})),qi(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&"$type"===qi(e[1])&&h.push(new tt(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":3!==e.length&&h.push(new tt(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(a=Si(e[1]),"string"!==a&&h.push(new tt(`${r}[1]`,e[1],`string expected, ${a} found`)));for(let p=2;p<e.length;p++)a=Si(e[p]),"$type"===qi(e[1])?h=h.concat(we({key:`${r}[${p}]`,value:e[p],valueSpec:o.geometry_type,style:i.style,styleSpec:i.styleSpec})):"string"!==a&&"number"!==a&&"boolean"!==a&&h.push(new tt(`${r}[${p}]`,e[p],`string, number, or boolean expected, ${a} found`));break;case"any":case"all":case"none":for(let p=1;p<e.length;p++)h=h.concat(Vt({key:`${r}[${p}]`,value:e[p],style:i.style,styleSpec:i.styleSpec}));break;case"has":case"!has":a=Si(e[1]),2!==e.length?h.push(new tt(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):"string"!==a&&h.push(new tt(`${r}[1]`,e[1],`string expected, ${a} found`));break;case"within":a=Si(e[1]),2!==e.length?h.push(new tt(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):"object"!==a&&h.push(new tt(`${r}[1]`,e[1],`object expected, ${a} found`))}return h}function Ui(i,e){const r=i.key,o=i.validateSpec,a=i.style,h=i.styleSpec,p=i.value,f=i.objectKey,y=h[`${e}_${i.layerType}`];if(!y)return[];const b=f.match(/^(.*)-transition$/);if("paint"===e&&b&&y[b[1]]&&y[b[1]].transition)return o({key:r,value:p,valueSpec:h.transition,style:a,styleSpec:h});const M=i.valueSpec||y[f];if(!M)return[new tt(r,p,`unknown property "${f}"`)];let T;if("string"===Si(p)&&ro(M)&&!M.tokens&&(T=/^{([^}]+)}$/.exec(p)))return[new tt(r,p,`"${f}" does not support interpolation syntax\nUse an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(T[1])} }\`.`)];const A=[];return"symbol"===i.layerType&&("text-field"===f&&a&&!a.glyphs&&A.push(new tt(r,p,'use of "text-field" requires a style "glyphs" property')),"text-font"===f&&Wi(lo(p))&&"identity"===qi(p.type)&&A.push(new tt(r,p,'"text-font" does not support identity functions'))),A.concat(o({key:i.key,value:p,valueSpec:M,style:a,styleSpec:h,expressionContext:"property",propertyType:e,propertyKey:f}))}function yi(i){return Ui(i,"paint")}function Yi(i){return Ui(i,"layout")}function nr(i){let e=[];const r=i.value,o=i.key,a=i.style,h=i.styleSpec;r.type||r.ref||e.push(new tt(o,r,'either "type" or "ref" is required'));let p=qi(r.type);const f=qi(r.ref);if(r.id){const y=qi(r.id);for(let b=0;b<i.arrayIndex;b++){const M=a.layers[b];qi(M.id)===y&&e.push(new tt(o,r.id,`duplicate layer id "${r.id}", previously used at line ${M.id.__line__}`))}}if("ref"in r){let y;["type","source","source-layer","filter","layout"].forEach(b=>{b in r&&e.push(new tt(o,r[b],`"${b}" is prohibited for ref layers`))}),a.layers.forEach(b=>{qi(b.id)===f&&(y=b)}),y?y.ref?e.push(new tt(o,r.ref,"ref cannot reference another ref layer")):p=qi(y.type):e.push(new tt(o,r.ref,`ref layer "${f}" not found`))}else if("background"!==p)if(r.source){const y=a.sources&&a.sources[r.source],b=y&&qi(y.type);y?"vector"===b&&"raster"===p?e.push(new tt(o,r.source,`layer "${r.id}" requires a raster source`)):"raster-dem"!==b&&"hillshade"===p?e.push(new tt(o,r.source,`layer "${r.id}" requires a raster-dem source`)):"raster"===b&&"raster"!==p?e.push(new tt(o,r.source,`layer "${r.id}" requires a vector source`)):"vector"!==b||r["source-layer"]?"raster-dem"===b&&"hillshade"!==p?e.push(new tt(o,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==p||!r.paint||!r.paint["line-gradient"]||"geojson"===b&&y.lineMetrics||e.push(new tt(o,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new tt(o,r,`layer "${r.id}" must specify a "source-layer"`)):e.push(new tt(o,r.source,`source "${r.source}" not found`))}else e.push(new tt(o,r,'missing required property "source"'));return e=e.concat(Zr({key:o,value:r,valueSpec:h.layer,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,objectElementValidators:{"*":()=>[],type:()=>i.validateSpec({key:`${o}.type`,value:r.type,valueSpec:h.layer.type,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,object:r,objectKey:"type"}),filter:ct,layout:y=>Zr({layer:r,key:y.key,value:y.value,style:y.style,styleSpec:y.styleSpec,validateSpec:y.validateSpec,objectElementValidators:{"*":b=>Yi(Er({layerType:p},b))}}),paint:y=>Zr({layer:r,key:y.key,value:y.value,style:y.style,styleSpec:y.styleSpec,validateSpec:y.validateSpec,objectElementValidators:{"*":b=>yi(Er({layerType:p},b))}})}})),e}function ar(i){const e=i.value,r=i.key,o=Si(e);return"string"!==o?[new tt(r,e,`string expected, ${o} found`)]:[]}const Qi={promoteId:function({key:i,value:e}){if("string"===Si(e))return ar({key:i,value:e});{const r=[];for(const o in e)r.push(...ar({key:`${i}.${o}`,value:e[o]}));return r}}};function Ti(i){const e=i.value,r=i.key,o=i.styleSpec,a=i.style,h=i.validateSpec;if(!e.type)return[new tt(r,e,'"type" is required')];const p=qi(e.type);let f;switch(p){case"vector":case"raster":return f=Zr({key:r,value:e,valueSpec:o[`source_${p.replace("-","_")}`],style:i.style,styleSpec:o,objectElementValidators:Qi,validateSpec:h}),f;case"raster-dem":return f=function(y){var b;const M=null!==(b=y.sourceName)&&void 0!==b?b:"",T=y.value,A=y.styleSpec,O=A.source_raster_dem,R=y.style;let N=[];const q=Si(T);if(void 0===T)return N;if("object"!==q)return N.push(new tt("source_raster_dem",T,`object expected, ${q} found`)),N;const H="custom"===qi(T.encoding),le=["redFactor","greenFactor","blueFactor","baseShift"],te=y.value.encoding?`"${y.value.encoding}"`:"Default";for(const he in T)!H&&le.includes(he)?N.push(new tt(he,T[he],`In "${M}": "${he}" is only valid when "encoding" is set to "custom". ${te} encoding found`)):O[he]?N=N.concat(y.validateSpec({key:he,value:T[he],valueSpec:O[he],validateSpec:y.validateSpec,style:R,styleSpec:A})):N.push(new tt(he,T[he],`unknown property "${he}"`));return N}({sourceName:r,value:e,style:i.style,styleSpec:o,validateSpec:h}),f;case"geojson":if(f=Zr({key:r,value:e,valueSpec:o.source_geojson,style:a,styleSpec:o,validateSpec:h,objectElementValidators:Qi}),e.cluster)for(const y in e.clusterProperties){const[b,M]=e.clusterProperties[y],T="string"==typeof b?[b,["accumulated"],["get",y]]:b;f.push(...ue({key:`${r}.${y}
1.map`,value:M,validateSpec:h,expressionContext:"cluster-map"})),f.push(...ue({key:`${r}.${y}.reduce`,value:T,validateSpec:h,expressionContext:"cluster-reduce"}))}return f;case"video":return Zr({key:r,value:e,valueSpec:o.source_video,style:a,validateSpec:h,styleSpec:o});case"image":return Zr({key:r,value:e,valueSpec:o.source_image,style:a,validateSpec:h,styleSpec:o});case"canvas":return[new tt(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return we({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:a,validateSpec:h,styleSpec:o})}}function Qr(i){const e=i.value,r=i.styleSpec,o=r.light,a=i.style;let h=[];const p=Si(e);if(void 0===e)return h;if("object"!==p)return h=h.concat([new tt("light",e,`object expected, ${p} found`)]),h;for(const f in e){const y=f.match(/^(.*)-transition$/);h=h.concat(y&&o[y[1]]&&o[y[1]].transition?i.validateSpec({key:f,value:e[f],valueSpec:r.transition,validateSpec:i.validateSpec,style:a,styleSpec:r}):o[f]?i.validateSpec({key:f,value:e[f],valueSpec:o[f],validateSpec:i.validateSpec,style:a,styleSpec:r}):[new tt(f,e[f],`unknown property "${f}"`)])}return h}function Vn(i){const e=i.value,r=i.styleSpec,o=r.terrain,a=i.style;let h=[];const p=Si(e);if(void 0===e)return h;if("object"!==p)return h=h.concat([new tt("terrain",e,`object expected, ${p} found`)]),h;for(const f in e)h=h.concat(o[f]?i.validateSpec({key:f,value:e[f],valueSpec:o[f],validateSpec:i.validateSpec,style:a,styleSpec:r}):[new tt(f,e[f],`unknown property "${f}"`)]);return h}function Ur(i){let e=[];const r=i.value,o=i.key;if(Array.isArray(r)){const a=[],h=[];for(const p in r)r[p].id&&a.includes(r[p].id)&&e.push(new tt(o,r,`all the sprites' ids must be unique, but ${r[p].id} is duplicated`)),a.push(r[p].id),r[p].url&&h.includes(r[p].url)&&e.push(new tt(o,r,`all the sprites' URLs must be unique, but ${r[p].url} is duplicated`)),h.push(r[p].url),e=e.concat(Zr({key:`${o}[${p}]`,value:r[p],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:i.validateSpec}));return e}return ar({key:o,value:r})}const Gn={"*":()=>[],array:Un,boolean:function(i){const e=i.value,r=i.key,o=Si(e);return"boolean"!==o?[new tt(r,e,`boolean expected, ${o} found`)]:[]},number:Ro,color:function(i){const e=i.key,r=i.value,o=Si(r);return"string"!==o?[new tt(e,r,`color expected, ${o} found`)]:Jt.parse(String(r))?[]:[new tt(e,r,`color expected, "${r}" found`)]},constants:Ds,enum:we,filter:ct,function:Ls,layer:nr,object:Zr,source:Ti,light:Qr,terrain:Vn,string:ar,formatted:function(i){return 0===ar(i).length?[]:ue(i)},resolvedImage:function(i){return 0===ar(i).length?[]:ue(i)},padding:function(i){const e=i.key,r=i.value;if("array"===Si(r)){if(r.length<1||r.length>4)return[new tt(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];const o={type:"number"};let a=[];for(let h=0;h<r.length;h++)a=a.concat(i.validateSpec({key:`${e}[${h}]`,value:r[h],validateSpec:i.validateSpec,valueSpec:o}));return a}return Ro({key:e,value:r,valueSpec:{}})},variableAnchorOffsetCollection:function(i){const e=i.key,r=i.value,o=Si(r),a=i.styleSpec;if("array"!==o||r.length<1||r.length%2!=0)return[new tt(e,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let h=[];for(let p=0;p<r.length;p+=2)h=h.concat(we({key:`${e}[${p}]`,value:r[p],valueSpec:a.layout_symbol["text-anchor"]})),h=h.concat(Un({key:`${e}[${p+1}]`,value:r[p+1],valueSpec:{length:2,value:"number"},validateSpec:i.validateSpec,style:i.style,styleSpec:a}));return h},sprite:Ur};function en(i){const e=i.value,r=i.valueSpec,o=i.styleSpec;return i.validateSpec=en,r.expression&&Wi(qi(e))?Ls(i):r.expression&&En(lo(e))?ue(i):r.type&&Gn[r.type]?Gn[r.type](i):Zr(Er({},i,{valueSpec:r.type?o[r.type]:r}))}function Yo(i){const e=i.value,r=i.key,o=ar(i);return o.length||(-1===e.indexOf("{fontstack}")&&o.push(new tt(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&o.push(new tt(r,e,'"glyphs" url must include a "{range}" token'))),o}function Pr(i,e=Y){let r=[];return r=r.concat(en({key:"",value:i,valueSpec:e.$root,styleSpec:e,style:i,validateSpec:en,objectElementValidators:{glyphs:Yo,"*":()=>[]}})),i.constants&&(r=r.concat(Ds({key:"constants",value:i.constants,style:i,styleSpec:e,validateSpec:en}))),Qo(r)}function ln(i){return function(e){return i({...e,validateSpec:en})}}function Qo(i){return[].concat(i).sort((e,r)=>e.line-r.line)}function Xn(i){return function(...e){return Qo(i.apply(this,e))}}Pr.source=Xn(ln(Ti)),Pr.sprite=Xn(ln(Ur)),Pr.glyphs=Xn(ln(Yo)),Pr.light=Xn(ln(Qr)),Pr.terrain=Xn(ln(Vn)),Pr.layer=Xn(ln(nr)),Pr.filter=Xn(ln(ct)),Pr.paintProperty=Xn(ln(yi)),Pr.layoutProperty=Xn(ln(Yi));const Jn=Pr,Ri=Jn.light,Pi=Jn.paintProperty,es=Jn.layoutProperty;function Tn(i,e){let r=!1;if(e&&e.length)for(const o of e)i.fire(new Sr(new Error(o.message))),r=!0;return r}class co{constructor(e,r,o){const a=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;const p=new Int32Array(this.arrayBuffer);e=p[0],this.d=(r=p[1])+2*(o=p[2]);for(let y=0;y<this.d*this.d;y++){const b=p[3+y],M=p[3+y+1];a.push(b===M?null:p.subarray(b,M))}const f=p[3+a.length+1];this.keys=p.subarray(p[3+a.length],f),this.bboxes=p.subarray(f),this.insert=this._insertReadonly}else{this.d=r+2*o;for(let p=0;p<this.d*this.d;p++)a.push([]);this.keys=[],this.bboxes=[]}this.n=r,this.extent=e,this.padding=o,this.scale=r/e,this.uid=0;const h=o/r*e;this.min=-h,this.max=e+h}
1insert(e,r,o,a,h){this._forEachCell(r,o,a,h,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(r),this.bboxes.push(o),this.bboxes.push(a),this.bboxes.push(h)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,r,o,a,h,p){this.cells[h].push(p)}query(e,r,o,a,h){const p=this.min,f=this.max;if(e<=p&&r<=p&&f<=o&&f<=a&&!h)return Array.prototype.slice.call(this.keys);{const y=[];return this._forEachCell(e,r,o,a,this._queryCell,y,{},h),y}}_queryCell(e,r,o,a,h,p,f,y){const b=this.cells[h];if(null!==b){const M=this.keys,T=this.bboxes;for(let A=0;A<b.length;A++){const O=b[A];if(void 0===f[O]){const R=4*O;(y?y(T[R+0],T[R+1],T[R+2],T[R+3]):e<=T[R+2]&&r<=T[R+3]&&o>=T[R+0]&&a>=T[R+1])?(f[O]=!0,p.push(M[O])):f[O]=!1}}}}_forEachCell(e,r,o,a,h,p,f,y){const b=this._convertToCellCoord(e),M=this._convertToCellCoord(r),T=this._convertToCellCoord(o),A=this._convertToCellCoord(a);for(let O=b;O<=T;O++)for(let R=M;R<=A;R++){const N=this.d*R+O;if((!y||y(this._convertFromCellCoord(O),this._convertFromCellCoord(R),this._convertFromCellCoord(O+1),this._convertFromCellCoord(R+1)))&&h.call(this,e,r,o,a,N,p,f,y))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const e=this.cells,r=3+this.cells.length+1+1;let o=0;for(let p=0;p<this.cells.length;p++)o+=this.cells[p].length;const a=new Int32Array(r+o+this.keys.length+this.bboxes.length);a[0]=this.extent,a[1]=this.n,a[2]=this.padding;let h=r;for(let p=0;p<e.length;p++){const f=e[p];a[3+p]=h,a.set(f,h),h+=f.length}return a[3+e.length]=h,a.set(this.keys,h),h+=this.keys.length,a[3+e.length+1]=h,a.set(this.bboxes,h),h+=this.bboxes.length,a.buffer}static serialize(e,r){const o=e.toArrayBuffer();return r&&r.push(o),{buffer:o}}static deserialize(e){return new co(e.buffer)}}const lr={};function mt(i,e,r={}){if(lr[i])throw new Error(`${i} is already registered.`);Object.defineProperty(e,"_classRegistryKey",{value:i,writeable:!1}),lr[i]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}mt("Object",Object),mt("TransferableGridIndex",co),mt("Color",Jt),mt("Error",Error),mt("AJAXError",Bi),mt("ResolvedImage",xr),mt("StylePropertyFunction",Oo),mt("StyleExpression",Do,{omit:["_evaluator"]}),mt("ZoomDependentExpression",so),mt("ZoomConstantExpression",Lo),mt("CompoundExpression",Jr,{omit:["_evaluate"]});for(const i in xo)xo[i]._classRegistryKey||mt(`Expression_${i}`,xo[i]);function Pn(i){return i&&typeof ArrayBuffer<"u"&&(i instanceof ArrayBuffer||i.constructor&&"ArrayBuffer"===i.constructor.name)}function _n(i,e){if(null==i||"boolean"==typeof i||"number"==typeof i||"string"==typeof i||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||i instanceof Blob)return i;if(Pn(i)||We(i))return e&&e.push(i),i;if(ArrayBuffer.isView(i)){const r=i;return e&&e.push(r.buffer),r}if(i instanceof ImageData)return e&&e.push(i.data.buffer),i;if(Array.isArray(i)){const r=[];for(const o of i)r.push(_n(o,e));return r}if("object"==typeof i){const r=i.constructor,o=r._classRegistryKey;if(!o)throw new Error("can't serialize object of unregistered class");if(!lr[o])throw new Error(`${o} is not registered.`);const a=r.serialize?r.serialize(i,e):{};if(r.serialize){if(e&&a===e[e.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const h in i){if(!i.hasOwnProperty(h)||lr[o].omit.indexOf(h)>=0)continue;const p=i[h];a[h]=lr[o].shallow.indexOf(h)>=0?p:_n(p,e)}i instanceof Error&&(a.message=i.message)}if(a.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==o&&(a.$name=o),a}throw new Error("can't serialize object of type "+typeof i)}function Hn(i){if(null==i||"boolean"==typeof i||"number"==typeof i||"string"==typeof i||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||i instanceof Blob||Pn(i)||We(i)||ArrayBuffer.isView(i)||i instanceof ImageData)return i;if(Array.isArray(i))return i.map(Hn);if("object"==typeof i){const e=i.$name||"Object";if(!lr[e])throw new Error(`can't deserialize unregistered class ${e}`);const{klass:r}=lr[e];if(!r)throw new Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(i);const o=Object.create(r.prototype);for(const a of Object.keys(i)){if("$name"===a)continue;const h=i[a];o[a]=lr[e].shallow.indexOf(a)>=0?h:Hn(h)}return o}throw new Error("can't deserialize object of type "+typeof i)}class Co{constructor(){this.first=!0}update(e,r){const o=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=o,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=o,!0):(this.lastFloorZoom>o?(this.lastIntegerZoom=o+1,this.lastIntegerZoomTime=r):this.lastFloorZoom<o&&(this.lastIntegerZoom=o,this.lastIntegerZoomTime=r),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=o,!0))}}const st={"Latin-1 Supplement":i=>i>=128&&i<=255,Arabic:i=>i>=1536&&i<=1791,"Arabic Supplement":i=>i>=1872&&i<=1919,"Arabic Extended-A":i=>i>=2208&&i<=2303,"Hangul Jamo":i=>i>=4352&&i<=4607,"Unified Canadian Aboriginal Syllabics":i=>i>=5120&&i<=5759,Khmer:i=>i>=6016&&i<=6143,"Unified Canadian Aboriginal Syllabics Extended":i=>i>=6320&&i<=6399,"General Punctuation":i=>i>=8192&&i<=8303,"Letterlike Symbols":i=>i>=8448&&i<=8527,"Number Forms":i=>i>=8528&&i<=8591,"Miscellaneous Technical":i=>i>=8960&&i<=9215,"Control Pictures":i=>i>=9216&&i<=9279,"Optical Character Recognition":i=>i>=9280&&i<=9311,"Enclosed Alphanumerics":i=>i>=9312&&i<=9471,"Geometric Shapes":i=>i>=9632&&i<=9727,"Miscellaneous Symbols":i=>i>=9728&&i<=9983,"Miscellaneous Symbols and Arrows":i=>i>=11008&&i<=11263,"CJK Radicals Supplement":i=>i>=11904&&i<=12031,"Kangxi Radicals":i=>i>=12032&&i<=12255,"Ideographic Description Characters":i=>i>=12272&&i<=12287,"CJK Symbols and Punctuation":i=>i>=12288&&i<=12351,Hiragana:i=>i>=12352&&i<=12447,Katakana:i=>i>=12448&&i<=12543,Bopomofo:i=>i>=12544&&i<=12591,"Hangul Compatibility Jamo":i=>i>=12592&&i<=12687,Kanbun:i=>i>=12688&&i<=12703,"Bopomofo Extended":i=>i>=12704&&i<=12735,"CJK Strokes":i=>i>
1=12736&&i<=12783,"Katakana Phonetic Extensions":i=>i>=12784&&i<=12799,"Enclosed CJK Letters and Months":i=>i>=12800&&i<=13055,"CJK Compatibility":i=>i>=13056&&i<=13311,"CJK Unified Ideographs Extension A":i=>i>=13312&&i<=19903,"Yijing Hexagram Symbols":i=>i>=19904&&i<=19967,"CJK Unified Ideographs":i=>i>=19968&&i<=40959,"Yi Syllables":i=>i>=40960&&i<=42127,"Yi Radicals":i=>i>=42128&&i<=42191,"Hangul Jamo Extended-A":i=>i>=43360&&i<=43391,"Hangul Syllables":i=>i>=44032&&i<=55215,"Hangul Jamo Extended-B":i=>i>=55216&&i<=55295,"Private Use Area":i=>i>=57344&&i<=63743,"CJK Compatibility Ideographs":i=>i>=63744&&i<=64255,"Arabic Presentation Forms-A":i=>i>=64336&&i<=65023,"Vertical Forms":i=>i>=65040&&i<=65055,"CJK Compatibility Forms":i=>i>=65072&&i<=65103,"Small Form Variants":i=>i>=65104&&i<=65135,"Arabic Presentation Forms-B":i=>i>=65136&&i<=65279,"Halfwidth and Fullwidth Forms":i=>i>=65280&&i<=65519};function Os(i){for(const e of i)if(Bo(e.charCodeAt(0)))return!0;return!1}function Fo(i){for(const e of i)if(!Js(e.charCodeAt(0)))return!1;return!0}function Js(i){return!(st.Arabic(i)||st["Arabic Supplement"](i)||st["Arabic Extended-A"](i)||st["Arabic Presentation Forms-A"](i)||st["Arabic Presentation Forms-B"](i))}function Bo(i){return!(746!==i&&747!==i&&(i<4352||!(st["Bopomofo Extended"](i)||st.Bopomofo(i)||st["CJK Compatibility Forms"](i)&&!(i>=65097&&i<=65103)||st["CJK Compatibility Ideographs"](i)||st["CJK Compatibility"](i)||st["CJK Radicals Supplement"](i)||st["CJK Strokes"](i)||!(!st["CJK Symbols and Punctuation"](i)||i>=12296&&i<=12305||i>=12308&&i<=12319||12336===i)||st["CJK Unified Ideographs Extension A"](i)||st["CJK Unified Ideographs"](i)||st["Enclosed CJK Letters and Months"](i)||st["Hangul Compatibility Jamo"](i)||st["Hangul Jamo Extended-A"](i)||st["Hangul Jamo Extended-B"](i)||st["Hangul Jamo"](i)||st["Hangul Syllables"](i)||st.Hiragana(i)||st["Ideographic Description Characters"](i)||st.Kanbun(i)||st["Kangxi Radicals"](i)||st["Katakana Phonetic Extensions"](i)||st.Katakana(i)&&12540!==i||!(!st["Halfwidth and Fullwidth Forms"](i)||65288===i||65289===i||65293===i||i>=65306&&i<=65310||65339===i||65341===i||65343===i||i>=65371&&i<=65503||65507===i||i>=65512&&i<=65519)||!(!st["Small Form Variants"](i)||i>=65112&&i<=65118||i>=65123&&i<=65126)||st["Unified Canadian Aboriginal Syllabics"](i)||st["Unified Canadian Aboriginal Syllabics Extended"](i)||st["Vertical Forms"](i)||st["Yijing Hexagram Symbols"](i)||st["Yi Syllables"](i)||st["Yi Radicals"](i))))}function ts(i){return!(Bo(i)||(e=i,st["Latin-1 Supplement"](e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||st["General Punctuation"](e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||st["Letterlike Symbols"](e)||st["Number Forms"](e)||st["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||st["Control Pictures"](e)&&9251!==e||st["Optical Character Recognition"](e)||st["Enclosed Alphanumerics"](e)||st["Geometric Shapes"](e)||st["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||st["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||st["CJK Symbols and Punctuation"](e)||st.Katakana(e)||st["Private Use Area"](e)||st["CJK Compatibility Forms"](e)||st["Small Form Variants"](e)||st["Halfwidth and Fullwidth Forms"](e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e));var e}function Hs(i){return i>=1424&&i<=2303||st["Arabic Presentation Forms-A"](i)||st["Arabic Presentation Forms-B"](i)}function is(i,e){return!(!e&&Hs(i)||i>=2304&&i<=3583||i>=3840&&i<=4255||st.Khmer(i))}function zs(i){for(const e of i)if(Hs(e.charCodeAt(0)))return!0;return!1}const Aa="deferred",ka="loading",Da="loaded";let La=null,yn="unavailable",No=null;const Ys=function(i){i&&"string"==typeof i&&i.indexOf("NetworkError")>-1&&(yn="error"),La&&La(i)};function Oa(){Qs.fire(new Xr("pluginStateChange",{pluginStatus:yn,pluginURL:No}))}const Qs=new sn,za=function(){return yn},cl=function(){if(yn!==Aa||!No)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");yn=ka,Oa(),No&&Vr({url:No},i=>{i?Ys(i):(yn=Da,Oa())})},An={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>yn===Da||null!=An.applyArabicShaping,isLoading:()=>yn===ka,setState(i){if(!ht())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");yn=i.pluginStatus,No=i.pluginURL},isParsed(){if(!ht())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return null!=An.applyArabicShaping&&null!=An.processBidirectionalText&&null!=An.processStyledBidirectionalText},getPluginURL(){if(!ht())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return No}};class Ki{constructor(e,r){this.zoom=e,r?(this.now=r.now,this.fadeDuration=r.fadeDuration,this.zoomHistory=r.zoomHistory,this.transition=r.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Co,this.transition={})}isSupportedScript(e){return function(r,o){for(const a of r)if(!is(a.charCo
vendor: 55,697 bytes, line 1
1deAt(0),o))return!1;return!0}(e,An.isLoaded())}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const e=this.zoom,r=e-Math.floor(e),o=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*o}:{fromScale:.5,toScale:1,t:1-(1-o)*r}}}class fa{constructor(e,r){this.property=e,this.value=r,this.expression=function(o,a){if(Wi(o))return new Oo(o,a);if(En(o)){const h=Es(o,a);if("error"===h.result)throw new Error(h.value.map(p=>`${p.key}: ${p.message}`).join(", "));return h.value}{let h=o;return"color"===a.type&&"string"==typeof o?h=Jt.parse(o):"padding"!==a.type||"number"!=typeof o&&!Array.isArray(o)?"variableAnchorOffsetCollection"===a.type&&Array.isArray(o)&&(h=vr.parse(o)):h=Nr.parse(o),{kind:"constant",evaluate:()=>h}}}(void 0===r?e.specification.default:r,e.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(e,r,o){return this.property.possiblyEvaluate(this,e,r,o)}}class Ra{constructor(e){this.property=e,this.value=new fa(e,void 0)}transitioned(e,r){return new hl(this.property,this.value,r,Ae({},e.transition,this.transition),e.now)}untransitioned(){return new hl(this.property,this.value,null,{},0)}}class ul{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return Ie(this._values[e].value.value)}setValue(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Ra(this._values[e].property)),this._values[e].value=new fa(this._values[e].property,null===r?void 0:Ie(r))}getTransition(e){return Ie(this._values[e].transition)}setTransition(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Ra(this._values[e].property)),this._values[e].transition=Ie(r)||void 0}serialize(){const e={};for(const r of Object.keys(this._values)){const o=this.getValue(r);void 0!==o&&(e[r]=o);const a=this.getTransition(r);void 0!==a&&(e[`${r}-transition`]=a)}return e}transitioned(e,r){const o=new dl(this._properties);for(const a of Object.keys(this._values))o._values[a]=this._values[a].transitioned(e,r._values[a]);return o}untransitioned(){const e=new dl(this._properties);for(const r of Object.keys(this._values))e._values[r]=this._values[r].untransitioned();return e}}class hl{constructor(e,r,o,a,h){this.property=e,this.value=r,this.begin=h+a.delay||0,this.end=this.begin+a.duration||0,e.specification.transition&&(a.delay||a.duration)&&(this.prior=o)}possiblyEvaluate(e,r,o){const a=e.now||0,h=this.value.possiblyEvaluate(e,r,o),p=this.prior;if(p){if(a>this.end)return this.prior=null,h;if(this.value.isDataDriven())return this.prior=null,h;if(a<this.begin)return p.possiblyEvaluate(e,r,o);{const f=(a-this.begin)/(this.end-this.begin);return this.property.interpolate(p.possiblyEvaluate(e,r,o),h,function(y){if(y<=0)return 0;if(y>=1)return 1;const b=y*y,M=b*y;return 4*(y<.5?M:3*(y-b)+M-.75)}(f))}}return h}}class dl{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,r,o){const a=new ga(this._properties);for(const h of Object.keys(this._values))a._values[h]=this._values[h].possiblyEvaluate(e,r,o);return a}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class Fl{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}hasValue(e){return void 0!==this._values[e].value}getValue(e){return Ie(this._values[e].value)}setValue(e,r){this._values[e]=new fa(this._values[e].property,null===r?void 0:Ie(r))}serialize(){const e={};for(const r of Object.keys(this._values)){const o=this.getValue(r);void 0!==o&&(e[r]=o)}return e}possiblyEvaluate(e,r,o){const a=new ga(this._properties);for(const h of Object.keys(this._values))a._values[h]=this._values[h].possiblyEvaluate(e,r,o);return a}}class cn{constructor(e,r,o){this.property=e,this.value=r,this.parameters=o}isConstant(){return"constant"===this.value.kind}constantOr(e){return"constant"===this.value.kind?this.value.value:e}evaluate(e,r,o,a){return this.property.evaluate(this.value,this.parameters,e,r,o,a)}}class ga{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Ot{constructor(e){this.specification=e}possiblyEvaluate(e,r){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(r)}interpolate(e,r,o){const a=$r[this.specification.type];return a?a(e,r,o):e}}class Wt{constructor(e,r){this.specification=e,this.overrides=r}possiblyEvaluate(e,r,o,a){return new cn(this,"constant"===e.expression.kind||"camera"===e.expression.kind?{kind:"constant",value:e.expression.evaluate(r,null,{},o,a)}:e.expression,r)}interpolate(e,r,o){if("constant"!==e.value.kind||"constant"!==r.value.kind)return e;if(void 0===e.value.value||void 0===r.value.value)return new cn(this,{kind:"constant",value:void 0},e.parameters);const a=$r[this.specification.type];if(a){const h=a(e.value.value,r.value.value,o);return new cn(this,{kind:"constant",value:h},e.parameters)}return e}evaluate(e,r,o,a,h,p){return"constant"===e.kind?e.value:e.evaluate(r,o,a,h,p)}}class ea extends Wt{possiblyEvaluate(e,r,o,a){if(void 0===e.value)return new cn(this,{kind:"constant",value:void 0},r);if("constant"===e.expression.kind){const h=e.expression.evaluate(r,null,{},o,a),p="resolvedImage"===e.property.specification.type&&"string"!=typeof h?h.name:h,f=this._calculate(p,p,p,r);return new cn(this,{kind:"constant",value:f},r)}if("camera"===e.expression.kind){const h=this._calculate(e.expression.evaluate({zoom:r.zoom-1}),e.expression.evaluate({zoom:r.zoom}),e.expression.evaluate({zoom:r.zoom+1}),r);return new cn(this,{kind:"constant",value:h},r)}return new cn(this,e.expression,r)}evaluate(e,r,o,a,h,p){if("source"===e.kind){const f=e.evaluate(r,o,a,h,p);return this._calculate(f,f,f,r)}return"composite"===e.kind?this._calculate(e.evaluate({zoom:Math.floor(r.zoom)-1},o,a),e.evaluate({zoom:Math.floor(r.zoom)},o,a),e.evaluate({zoom:Math.floor(r.zoom)+1},o,a),r):e.value}_calculate(e,r,o,a){return a.zoom>a.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:o,to:r}}interpolate(e){return e}}class Fa{constructor(e){this.specification=e}possiblyEvaluate(e,r,o,a){if(void 0!==e.value){if("constant"===e.expression.kind){const h=e.expression.evaluate(r,null,{},o,a);return this._calculate(h,h,h,r)}return this._calculate(e.expression.evaluate(new Ki(Math.floor(r.zoom-1),r)),e.expression.evaluate(new Ki(Math.floor(r.zoom),r)),e.expression.evaluate(new Ki(Math.floor(r.zoom+1),r)),r)}}_calculate(e,r,o,a){return a.zoom>a.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:o,to:r}}interpolate(e){return e}}class Ba{constructor(e){this.specification=e}possiblyEvaluate(e,r,o,a){return!!e.expression.evaluate(r,null,{},o,a)}interpolate(){return!1}}class pr{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const r in e){const o=e[r];o.specification.overridable&&this.overridableProperties.push(r);const a=this.defaultPropertyValues[r]=new fa(o,void 0),h=this.defaultTransitionablePropertyValues[r]=new Ra(o);this.defaultTransitioningPropertyValues[r]=h.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=a.possiblyEvaluate({})}}}mt("DataDrivenProperty",Wt),mt("DataConstantProperty",Ot),mt("CrossFadedDataDrivenProperty",ea),mt("CrossFadedProperty",Fa),mt("ColorRampProperty",Ba);const Na="-transition";class jn extends sn{constructor(e,r){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1},"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new Fl(r.layout)),r.paint)){this._transitionablePaint=new ul(r.paint);for(const o in e.paint)this.setPaintProperty(o,e.paint[o],{validate:!1});for(const o in e.layout)this.setLayoutProperty(o,e.layout[o],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ga(r.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,r,o={}){null!=r&&this._validate(es,`layers.${this.id}.layout.${e}`,e,r,o)||("visibility"!==e?this._unevaluatedLayout.setValue(e,r):this.visibility=r)}getPaintProperty(e){return e.endsWith(Na)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,r,o={}){if(null!=r&&this._validate(Pi,`layers.${this.id}.paint.${e}`,e,r,o))return!1;if(e.endsWith(Na))return this._transitionablePaint.setTransition(e.slice(0,-11),r||void 0),!1;{const a=this._transitionablePaint._values[e],h="cross-faded-data-driven"===a.property.specification["property-type"],p=a.value.isDataDriven(),f=a.value;this._transitionablePaint.setValue(e,r),this._handleSpecialPaintPropertyUpdate(e);const y=this._transitionablePaint._values[e].value;return y.isDataDriven()||p||h||this._handleOverridablePaintPropertyUpdate(e,f,y)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,r,o){return!1}isHidden(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||"none"===this.visibility}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,r){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,r)}serialize(){const e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),Oe(e,(r,o)=>!(void 0===r||"layout"===o&&!Object.keys(r).length||"paint"===o&&!Object.keys(r).length))}_validate(e,r,o,a,h={}){return(!h||!1!==h.validate)&&Tn(this,e.call(Jn,{key:r,layerType:this.type,objectKey:o,value:a,styleSpec:Y,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const r=this.paint.get(e);if(r instanceof cn&&ro(r.property.specification)&&("source"===r.value.kind||"composite"===r.value.kind)&&r.value.isStateDependent)return!0}return!1}}const pl={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class rs{constructor(e,r){this._structArray=e,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class or{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,r){return e._trim(),r&&(e.isTransferred=!0,r.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const r=Object.create(this.prototype);return r.arrayBuffer=e.arrayBuffer,r.length=e.length,r.capacity=e.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function ir(i,e=1){let r=0,o=0;return{members:i.map(a=>{const h=pl[a.type].BYTES_PER_ELEMENT,p=r=Rs(r,Math.max(e,h)),f=a.components||1;return o=Math.max(o,h),r+=h*f,{name:a.name,type:a.type,components:f,offset:p}}),size:Rs(r,Math.max(o,e)),alignment:e}}function Rs(i,e){return Math.ceil(i/e)*e}class ta extends or{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r){const o=this.length;return this.resize(o+1),this.emplace(o,e,r)}emplace(e,r,o){const a=2*e;return this.int16[a+0]=r,this.int16[a+1]=o,e}}ta.prototype.bytesPerElement=4,mt("StructArrayLayout2i4",ta);class ia extends or{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,o){const a=this.length;return this.resize(a+1),this.emplace(a,e,r,o)}emplace(e,r,o,a){const h=3*e;return this.int16[h+0]=r,this.int16[h+1]=o,this.int16[h+2]=a,e}}ia.prototype.bytesPerElement=6,mt("StructArrayLayout3i6",ia);class ns extends or{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,o,a){const h=this.length;return this.resize(h+1),this.emplace(h,e,r,o,a)}emplace(e,r,o,a,h){const p=4*e;return this.int16[p+0]=r,this.int16[p+1]=o,this.int16[p+2]=a,this.int16[p+3]=h,e}}ns.prototype.bytesPerElement=8,mt("StructArrayLayout4i8",ns);class Ua extends or{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,o,a,h,p){const f=this.length;return this.resize(f+1),this.emplace(f,e,r,o,a,h,p)}emplace(e,r,o,a,h,p,f){const y=6*e;return this.int16[y+0]=r,this.int16[y+1]=o,this.int16[y+2]=a,this.int16[y+3]=h,this.int16[y+4]=p,this.int16[y+5]=f,e}}Ua.prototype.bytesPerElement=12,mt("StructArrayLayout2i4i12",Ua);class Va extends or{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,o,a,h,p){const f=this.length;return this.resize(f+1),this.emplace(f,e,r,o,a,h,p)}emplace(e,r,o,a,h,p,f){const y=4*e,b=8*e;return this.int16[y+0]=r,this.int16[y+1]=o,this.uint8[b+4]=a,this.uint8[b+5]=h,this.uint8[b+6]=p,this.uint8[b+7]=f,e}}Va.prototype.bytesPerElement=8,mt("StructArrayLayout2i4ub8",Va);class Fs extends or{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r){const o=this.length;return this.resize(o+1),this.emplace(o,e,r)}emplace(e,r,o){const a=2*e;return this.float32[a+0]=r,this.float32[a+1]=o,e}}Fs.prototype.bytesPerElement=8,mt("StructArrayLayout2f8",Fs);class Ga extends or{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,o,a,h,p,f,y,b,M){const T=this.length;return this.resize(T+1),this.emplace(T,e,r,o,a,h,p,f,y,b,M)}emplace(e,r,o,a,h,p,f,y,b,M,T){const A=10*e;return this.uint16[A+0]=r,this.uint16[A+1]=o,this.uint16[A+2]=a,this.uint16[A+3]=h,this.uint16[A+4]=p,this.uint16[A+5]=f,this.uint16[A+6]=y,this.uint16[A+7]=b,this.uint16[A+8]=M,this.uint16[A+9]=T,e}}Ga.prototype.bytesPerElement=20,mt("StructArrayLayout10ui20",Ga);class ja extends or{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,o,a,h,p,f,y,b,M,T,A){const O=this.length;return this.resize(O+1),this.emplace(O,e,r,o,a,h,p,f,y,b,M,T,A)}emplace(e,r,o,a,h,p,f,y,b,M,T,A,O){const R=12*e;return this.int16[R+0]=r,this.int16[R+1]=o,this.int16[R+2]=a,this.int16[R+3]=h,this.uint16[R+4]=p,this.uint16[R+5]=f,this.uint16[R+6]=y,this.uint16[R+7]=b,this.int16[R+8]=M,this.int16[R+9]=T,this.int16[R+10]=A,this.int16[R+11]=O,e}}ja.prototype.bytesPerElement=24,mt("StructArrayLayout4i4ui4i24",ja);class Ai extends or{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,o){const a=this.length;return this.resize(a+1),this.emplace(a,e,r,o)}emplace(e,r,o,a){const h=3*e;return this.float32[h+0]=r,this.float32[h+1]=o,this.float32[h+2]=a,e}}Ai.prototype.bytesPerElement=12,mt("StructArrayLayout3f12",Ai);class u extends or{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint32[1*e+0]=r,e}}u.prototype.bytesPerElement=4,mt("StructArrayLayout1ul4",u);class t extends or{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,o,a,h,p,f,y,b){const M=this.length;return this.resize(M+1),this.emplace(M,e,r,o,a,h,p,f,y,b)}emplace(e,r,o,a,h,p,f,y,b,M){const T=10*e,A=5*e;return this.int16[T+0]=r,this.int16[T+1]=o,this.int16[T+2]=a,this.int16[T+3]=h,this.int16[T+4]=p,this.int16[T+5]=f,this.uint32[A+3]=y,this.uint16[T+8]=b,this.uint16[T+9]=M,e}}t.prototype.bytesPerElement=20,mt("StructArrayLayout6i1ul2ui20",t);class n extends or{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,o,a,h,p){const f=this.length;return this.resize(f+1),this.emplace(f,e,r,o,a,h,p)}emplace(e,r,o,a,h,p,f){const y=6*e;return this.int16[y+0]=r,this.int16[y+1]=o,this.int16[y+2]=a,this.int16[y+3]=h,this.int16[y+4]=p,this.int16[y+5]=f,e}}n.prototype.bytesPerElement=12,mt("StructArrayLayout2i2i2i12",n);class s extends or{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,o,a,h){const p=this.length;return this.resize(p+1),this.emplace(p,e,r,o,a,h)}emplace(e,r,o,a,h,p){const f=4*e,y=8*e;return this.float32[f+0]=r,this.float32[f+1]=o,this.float32[f+2]=a,this.int16[y+6]=h,this.int16[y+7]=p,e}}s.prototype.bytesPerElement=16,mt("StructArrayLayout2f1f2i16",s);class l extends or{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,o,a){const h=this.length;return this.resize(h+1),this.emplace(h,e,r,o,a)}emplace(e,r,o,a,h){const p=12*e,f=3*e;return this.uint8[p+0]=r,this.uint8[p+1]=o,this.float32[f+1]=a,this.float32[f+2]=h,e}}l.prototype.bytesPerElement=12,mt("StructArrayLayout2ub2f12",l);class d extends or{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,o){const a=this.length;return this.resize(a+1),this.emplace(a,e,r,o)}emplace(e,r,o,a){const h=3*e;return this.uint16[h+0]=r,this.uint16[h+1]=o,this.uint16[h+2]=a,e}}d.prototype.bytesPerElement=6,mt("StructArrayLayout3ui6",d);class g extends or{_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(e,r,o,a,h,p,f,y,b,M,T,A,O,R,N,q,H){const le=this.length;return this.resize(le+1),this.emplace(le,e,r,o,a,h,p,f,y,b,M,T,A,O,R,N,q,H)}emplace(e,r,o,a,h,p,f,y,b,M,T,A,O,R,N,q,H,le){const te=24*e,he=12*e,ye=48*e;return this.int16[te+0]=r,this.int16[te+1]=o,this.uint16[te+2]=a,this.uint16[te+3]=h,this.uint32[he+2]=p,this.uint32[he+3]=f,this.uint32[he+4]=y,this.uint16[te+10]=b,this.uint16[te+11]=M,this.uint16[te+12]=T,this.float32[he+7]=A,this.float32[he+8]=O,this.uint8[ye+36]=R,this.uint8[ye+37]=N,this.uint8[ye+38]=q,this.uint32[he+10]=H,this.int16[te+22]=le,e}}g.prototype.bytesPerElement=48,mt("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",g);class _ extends or{_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(e,r,o,a,h,p,f,y,b,M,T,A,O,R,N,q,H,le,te,he,ye,Fe,vt,Tt,yt,pt,ot,Mt){const at=this.length;return this.resize(at+1),this.emplace(at,e,r,o,a,h,p,f,y,b,M,T,A,O,R,N,q,H,le,te,he,ye,Fe,vt,Tt,yt,pt,ot,Mt)}emplace(e,r,o,a,h,p,f,y,b,M,T,A,O,R,N,q,H,le,te,he,ye,Fe,vt,Tt,yt,pt,ot,Mt,at){const Je=32*e,Nt=16*e;return this.int16[Je+0]=r,this.int16[Je+1]=o,this.int16[Je+2]=a,this.int16[Je+3]=h,this.int16[Je+4]=p,this.int16[Je+5]=f,this.int16[Je+6]=y,this.int16[Je+7]=b,this.uint16[Je+8]=M,this.uint16[Je+9]=T,this.uint16[Je+10]=A,this.uint16[Je+11]=O,this.uint16[Je+12]=R,this.uint16[Je+13]=N,this.uint16[Je+14]=q,this.uint16[Je+15]=H,this.uint16[Je+16]=le,this.uint16[Je+17]=te,this.uint16[Je+18]=he,this.uint16[Je+19]=ye,this.uint16[Je+20]=Fe,this.uint16[Je+21]=vt,this.uint16[Je+22]=Tt,this.uint32[Nt+12]=yt,this.float32[Nt+13]=pt,this.float32[Nt+14]=ot,this.uint16[Je+30]=Mt,this.uint16[Je+31]=at,e}}_.prototype.bytesPerElement=64,mt("StructArrayLayout8i15ui1ul2f2ui64",_);class v extends or{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.float32[1*e+0]=r,e}}v.prototype.bytesPerElement=4,mt("StructArrayLayout1f4",v);class S extends or{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,o){const a=this.length;return this.resize(a+1),this.emplace(a,e,r,o)}emplace(e,r,o,a){const h=3*e;return this.uint16[6*e+0]=r,this.float32[h+1]=o,this.float32[h+2]=a,e}}S.prototype.bytesPerElement=12,mt("StructArrayLayout1ui2f12",S);class I extends or{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,o){const a=this.length;return this.resize(a+1),this.emplace(a,e,r,o)}emplace(e,r,o,a){const h=4*e;return this.uint32[2*e+0]=r,this.uint16[h+2]=o,this.uint16[h+3]=a,e}}I.prototype.bytesPerElement=8,mt("StructArrayLayout1ul2ui8",I);class E extends or{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r){const o=this.length;return this.resize(o+1),this.emplace(o,e,r)}emplace(e,r,o){const a=2*e;return this.uint16[a+0]=r,this.uint16[a+1]=o,e}}E.prototype.bytesPerElement=4,mt("StructArrayLayout2ui4",E);class D extends or{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint16[1*e+0]=r,e}}D.prototype.bytesPerElement=2,mt("StructArrayLayout1ui2",D);class V extends or{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,o,a){const h=this.length;return this.resize(h+1),this.emplace(h,e,r,o,a)}emplace(e,r,o,a,h){const p=4*e;return this.float32[p+0]=r,this.float32[p+1]=o,this.float32[p+2]=a,this.float32[p+3]=h,e}}V.prototype.bytesPerElement=16,mt("StructArrayLayout4f16",V);class U extends rs{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new Ce(this.anchorPointX,this.anchorPointY)}}U.prototype.size=20;class $ extends t{get(e){return new U(this,e)}}mt("CollisionBoxArray",$);class B extends rs{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(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}B.prototype.size=48;class oe extends g{get(e){return new B(this,e)}}mt("PlacedSymbolArray",oe);class fe extends rs{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(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}fe.prototype.size=64;class K extends _{get(e){return new fe(this,e)}}mt("SymbolInstanceArray",K);class ae extends v{getoffsetX(e){return this.float32[1*e+0]}}mt("GlyphOffsetArray",ae);class ve extends ia{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}mt("SymbolLineVertexArray",ve);class xe extends rs{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}xe.prototype.size=12;class Re extends S{get(e){return new xe(this,e)}}mt("TextAnchorOffsetArray",Re);class Xe extends rs{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]}}Xe.prototype.size=8;class Ge extends I{get(e){return new Xe(this,e)}}mt("FeatureIndexArray",Ge);class rt extends ta{}class Et extends ta{}class gi extends ta{}class dt extends Ua{}class qt extends Va{}class kt extends Fs{}class Li extends Ga{}class pi extends ja{}class ai extends Ai{}class _i extends u{}class cr extends n{}class Vi extends l{}class Wr extends d{}class Ar extends E{}const mr=ir([{name:"a_pos",components:2,type:"Int16"}],4),{members:kn}=mr;class Xi{constructor(e=[]){this.segments=e}prepareSegment(e,r,o,a){let h=this.segments[this.segments.length-1];return e>Xi.MAX_VERTEX_ARRAY_LENGTH&&ze(`Max vertices per segment is ${Xi.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!h||h.vertexLength+e>Xi.MAX_VERTEX_ARRAY_LENGTH||h.sortKey!==a)&&(h={vertexOffset:r.length,primitiveOffset:o.length,vertexLength:0,primitiveLength:0},void 0!==a&&(h.sortKey=a),this.segments.push(h)),h}get(){return this.segments}destroy(){for(const e of this.segments)for(const r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,o,a){return new Xi([{vertexOffset:e,primitiveOffset:r,vertexLength:o,primitiveLength:a,vaos:{},sortKey:0}])}}function uo(i,e){return 256*(i=be(Math.floor(i),0,255))+be(Math.floor(e),0,255)}Xi.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,mt("SegmentVector",Xi);const ho=ir([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var Uo={exports:{}},qr=function(i,e){var r,o,a,h,p,f,y,b;for(o=i.length-(r=3&i.length),a=e,p=3432918353,f=461845907,b=0;b<o;)y=255&i.charCodeAt(b)|(255&i.charCodeAt(++b))<<8|(255&i.charCodeAt(++b))<<16|(255&i.charCodeAt(++b))<<24,++b,a=27492+(65535&(h=5*(65535&(a=(a^=y=(65535&(y=(y=(65535&y)*p+(((y>>>16)*p&65535)<<16)&4294967295)<<15|y>>>17))*f+(((y>>>16)*f&65535)<<16)&4294967295)<<13|a>>>19))+((5*(a>>>16)&65535)<<16)&4294967295))+((58964+(h>>>16)&65535)<<16);switch(y=0,r){case 3:y^=(255&i.charCodeAt(b+2))<<16;case 2:y^=(255&i.charCodeAt(b+1))<<8;case 1:a^=y=(65535&(y=(y=(65535&(y^=255&i.charCodeAt(b)))*p+(((y>>>16)*p&65535)<<16)&4294967295)<<15|y>>>17))*f+(((y>>>16)*f&65535)<<16)&4294967295}return a^=i.length,a=2246822507*(65535&(a^=a>>>16))+((2246822507*(a>>>16)&65535)<<16)&4294967295,a=3266489909*(65535&(a^=a>>>13))+((3266489909*(a>>>16)&65535)<<16)&4294967295,(a^=a>>>16)>>>0},un=function(i,e){for(var r,o=i.length,a=e^o,h=0;o>=4;)r=1540483477*(65535&(r=255&i.charCodeAt(h)|(255&i.charCodeAt(++h))<<8|(255&i.charCodeAt(++h))<<16|(255&i.charCodeAt(++h))<<24))+((1540483477*(r>>>16)&65535)<<16),a=1540483477*(65535&a)+((1540483477*(a>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),o-=4,++h;switch(o){case 3:a^=(255&i.charCodeAt(h+2))<<16;case 2:a^=(255&i.charCodeAt(h+1))<<8;case 1:a=1540483477*(65535&(a^=255&i.charCodeAt(h)))+((1540483477*(a>>>16)&65535)<<16)}return a=1540483477*(65535&(a^=a>>>13))+((1540483477*(a>>>16)&65535)<<16),(a^=a>>>15)>>>0};Uo.exports=qr,Uo.exports.murmur3=qr,Uo.exports.murmur2=un;var ss=pe(Uo.exports);class ur{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,o,a){this.ids.push(kr(e)),this.positions.push(r,o,a)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const r=kr(e);let o=0,a=this.ids.length-1;for(;o<a;){const p=o+a>>1;this.ids[p]>=r?a=p:o=p+1}const h=[];for(;this.ids[o]===r;)h.push({index:this.positions[3*o],start:this.positions[3*o+1],end:this.positions[3*o+2]}),o++;return h}static serialize(e,r){const o=new Float64Array(e.ids),a=new Uint32Array(e.positions);return vn(o,a,0,o.length-1),r&&r.push(o.buffer,a.buffer),{ids:o,positions:a}}static deserialize(e){const r=new ur;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}}function kr(i){const e=+i;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:ss(String(i))}function vn(i,e,r,o){for(;r<o;){const a=i[r+o>>1];let h=r-1,p=o+1;for(;;){do{h++}while(i[h]<a);do{p--}while(i[p]>a);if(h>=p)break;hr(i,h,p),hr(e,3*h,3*p),hr(e,3*h+1,3*p+1),hr(e,3*h+2,3*p+2)}p-r<o-p?(vn(i,e,r,p),r=p+1):(vn(i,e,p+1,o),o=p)}}function hr(i,e,r){const o=i[e];i[e]=i[r],i[r]=o}mt("FeaturePositionMap",ur);class as{constructor(e,r){this.gl=e.gl,this.location=r}}class _a extends as{constructor(e,r){super(e,r),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}}class ml extends as{constructor(e,r){super(e,r),this.current=[0,0,0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]&&e[3]===this.current[3]||(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}}class fl extends as{constructor(e,r){super(e,r),this.current=Jt.transparent}set(e){e.r===this.current.r&&e.g===this.current.g&&e.b===this.current.b&&e.a===this.current.a||(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}}const Bl=new Float32Array(16);function $a(i){return[uo(255*i.r,255*i.g),uo(255*i.b,255*i.a)]}class po{constructor(e,r,o){this.value=e,this.uniformNames=r.map(a=>`u_${a}`),this.type=o}setUniform(e,r,o){e.set(o.constantOr(this.value))}getBinding(e,r,o){return"color"===this.type?new fl(e,r):new _a(e,r)}}class ls{constructor(e,r){this.uniformNames=r.map(o=>`u_${o}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=e.tlbr}setUniform(e,r,o,a){const h="u_pattern_to"===a?this.patternTo:"u_pattern_from"===a?this.patternFrom:"u_pixel_ratio_to"===a?this.pixelRatioTo:"u_pixel_ratio_from"===a?this.pixelRatioFrom:null;h&&e.set(h)}getBinding(e,r,o){return"u_pattern"===o.substr(0,9)?new ml(e,r):new _a(e,r)}}class mo{constructor(e,r,o,a){this.expression=e,this.type=o,this.maxValue=0,this.paintVertexAttributes=r.map(h=>({name:`a_${h}`,type:"Float32",components:"color"===o?2:1,offset:0})),this.paintVertexArray=new a}populatePaintArray(e,r,o,a,h){const p=this.paintVertexArray.length,f=this.expression.evaluate(new Ki(0),r,{},a,[],h);this.paintVertexArray.resize(e),this._setPaintValue(p,e,f)}updatePaintArray(e,r,o,a){const h=this.expression.evaluate({zoom:0},o,a);this._setPaintValue(e,r,h)}_setPaintValue(e,r,o){if("color"===this.type){const a=$a(o);for(let h=e;h<r;h++)this.paintVertexArray.emplace(h,a[0],a[1])}else{for(let a=e;a<r;a++)this.paintVertexArray.emplace(a,o);this.maxValue=Math.max(this.maxValue,Math.abs(o))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class $n{constructor(e,r,o,a,h,p){this.expression=e,this.uniformNames=r.map(f=>`u_${f}_t`),this.type=o,this.useIntegerZoom=a,this.zoom=h,this.maxValue=0,this.paintVertexAttributes=r.map(f=>({name:`a_${f}`,type:"Float32",components:"color"===o?4:2,offset:0})),this.paintVertexArray=new p}populatePaintArray(e,r,o,a,h){const p=this.expression.evaluate(new Ki(this.zoom),r,{},a,[],h),f=this.expression.evaluate(new Ki(this.zoom+1),r,{},a,[],h),y=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(y,e,p,f)}updatePaintArray(e,r,o,a){const h=this.expression.evaluate({zoom:this.zoom},o,a),p=this.expression.evaluate({zoom:this.zoom+1},o,a);this._setPaintValue(e,r,h,p)}_setPaintValue(e,r,o,a){if("color"===this.type){const h=$a(o),p=$a(a);for(let f=e;f<r;f++)this.paintVertexArray.emplace(f,h[0],h[1],p[0],p[1])}else{for(let h=e;h<r;h++)this.paintVertexArray.emplace(h,o,a);this.maxValue=Math.max(this.maxValue,Math.abs(o),Math.abs(a))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,r){const o=this.useIntegerZoom?Math.floor(r.zoom):r.zoom,a=be(this.expression.interpolationFactor(o,this.zoom,this.zoom+1),0,1);e.set(a)}getBinding(e,r,o){return new _a(e,r)}}class fo{constructor(e,r,o,a,h,p){this.expression=e,this.type=r,this.useIntegerZoom=o,this.zoom=a,this.layerId=p,this.zoomInPaintVertexArray=new h,this.zoomOutPaintVertexArray=new h}populatePaintArray(e,r,o){const a=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(a,e,r.patterns&&r.patterns[this.layerId],o)}updatePaintArray(e,r,o,a,h){this._setPaintValues(e,r,o.patterns&&o.patterns[this.layerId],h)}_setPaintValues(e,r,o,a){if(!a||!o)return;const{min:h,mid:p,max:f}=o,y=a[h],b=a[p],M=a[f];if(y&&b&&M)for(let T=e;T<r;T++)this.zoomInPaintVertexArray.emplace(T,b.tl[0],b.tl[1],b.br[0],b.br[1],y.tl[0],y.tl[1],y.br[0],y.br[1],b.pixelRatio,y.pixelRatio),this.zoomOutPaintVertexArray.emplace(T,b.tl[0],b.tl[1],b.br[0],b.br[1],M.tl[0],M.tl[1],M.br[0],M.br[1],b.pixelRatio,M.pixelRatio)}upload(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,ho.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,ho.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class Za{constructor(e,r,o){this.binders={},this._buffers=[];const a=[];for(const h in e.paint._values){if(!o(h))continue;const p=e.paint.get(h);if(!(p instanceof cn&&ro(p.property.specification)))continue;const f=dh(h,e.type),y=p.value,b=p.property.specification.type,M=p.property.useIntegerZoom,T=p.property.specification["property-type"],A="cross-faded"===T||"cross-faded-data-driven"===T;if("constant"===y.kind)this.binders[h]=A?new ls(y.value,f):new po(y.value,f,b),a.push(`/u_${h}`);else if("source"===y.kind||A){const O=kc(h,b,"source");this.binders[h]=A?new fo(y,b,M,r,O,e.id):new mo(y,f,b,O),a.push(`/a_${h}`)}else{const O=kc(h,b,"composite");this.binders[h]=new $n(y,f,b,M,r,O),a.push(`/z_${h}`)}}this.cacheKey=a.sort().join("")}getMaxValue(e){const r=this.binders[e];return r instanceof mo||r instanceof $n?r.maxValue:0}populatePaintArrays(e,r,o,a,h){for(const p in this.binders){const f=this.binders[p];(f instanceof mo||f instanceof $n||f instanceof fo)&&f.populatePaintArray(e,r,o,a,h)}}setConstantPatternPositions(e,r){for(const o in this.binders){const a=this.binders[o];a instanceof ls&&a.setConstantPatternPositions(e,r)}}updatePaintArrays(e,r,o,a,h){let p=!1;for(const f in e){const y=r.getPositions(f);for(const b of y){const M=o.feature(b.index);for(const T in this.binders){const A=this.binders[T];if((A instanceof mo||A instanceof $n||A instanceof fo)&&!0===A.expression.isStateDependent){const O=a.paint.get(T);A.expression=O.value,A.updatePaintArray(b.start,b.end,M,e[f],h),p=!0}}}}return p}defines(){const e=[];for(const r in this.binders){const o=this.binders[r];(o instanceof po||o instanceof ls)&&e.push(...o.uniformNames.map(a=>`#define HAS_UNIFORM_${a}`))}return e}getBinderAttributes(){const e=[];for(const r in this.binders){const o=this.binders[r];if(o instanceof mo||o instanceof $n)for(let a=0;a<o.paintVertexAttributes.length;a++)e.push(o.paintVertexAttributes[a].name);else if(o instanceof fo)for(let a=0;a<ho.members.length;a++)e.push(ho.members[a].name)}return e}getBinderUniforms(){const e=[];for(const r in this.binders){const o=this.binders[r];if(o instanceof po||o instanceof ls||o instanceof $n)for(const a of o.uniformNames)e.push(a)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,r){const o=[];for(const a in this.binders){const h=this.binders[a];if(h instanceof po||h instanceof ls||h instanceof $n)for(const p of h.uniformNames)if(r[p]){const f=h.getBinding(e,r[p],p);o.push({name:p,property:a,binding:f})}}return o}setUniforms(e,r,o,a){for(const{name:h,property:p,binding:f}of r)this.binders[p].setUniform(f,a,o.get(p),h)}updatePaintBuffers(e){this._buffers=[];for(const r in this.binders){const o=this.binders[r];if(e&&o instanceof fo){const a=2===e.fromScale?o.zoomInPaintVertexBuffer:o.zoomOutPaintVertexBuffer;a&&this._buffers.push(a)}else(o instanceof mo||o instanceof $n)&&o.paintVertexBuffer&&this._buffers.push(o.paintVertexBuffer)}}upload(e){for(const r in this.binders){const o=this.binders[r];(o instanceof mo||o instanceof $n||o instanceof fo)&&o.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const r=this.binders[e];(r instanceof mo||r instanceof $n||r instanceof fo)&&r.destroy()}}}class So{constructor(e,r,o=(()=>!0)){this.programConfigurations={};for(const a of e)this.programConfigurations[a.id]=new Za(a,r,o);this.needsUpload=!1,this._featureMap=new ur,this._bufferOffset=0}populatePaintArrays(e,r,o,a,h,p){for(const f in this.programConfigurations)this.programConfigurations[f].populatePaintArrays(e,r,a,h,p);void 0!==r.id&&this._featureMap.add(r.id,o,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,r,o,a){for(const h of o)this.needsUpload=this.programConfigurations[h.id].updatePaintArrays(e,this._featureMap,r,h,a)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const r in this.programConfigurations)this.programConfigurations[r].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}function dh(i,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[i]||[i.replace(`${e}-`,"").replace(/-/g,"_")]}function kc(i,e,r){const a={"line-pattern":{source:Li,composite:Li},"fill-pattern":{source:Li,composite:Li},"fill-extrusion-pattern":{source:Li,composite:Li}}[i];return a&&a[r]||{color:{source:Fs,composite:V},number:{source:v,composite:Fs}}[e][r]}mt("ConstantBinder",po),mt("CrossFadedConstantBinder",ls),mt("SourceExpressionBinder",mo),mt("CrossFadedCompositeBinder",fo),mt("CompositeExpressionBinder",$n),mt("ProgramConfiguration",Za,{omit:["_buffers"]}),mt("ProgramConfigurationSet",So);const br=8192,Nl=Math.pow(2,14)-1,Dc=-Nl-1;function ra(i){const e=br/i.extent,r=i.loadGeometry();for(let o=0;o<r.length;o++){const a=r[o];for(let h=0;h<a.length;h++){const p=a[h],f=Math.round(p.x*e),y=Math.round(p.y*e);p.x=be(f,Dc,Nl),p.y=be(y,Dc,Nl),(f<p.x||f>p.x+1||y<p.y||y>p.y+1)&&ze("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function na(i,e){return{type:i.type,id:i.id,properties:i.properties,geometry:e?ra(i):[]}}function gl(i,e,r,o,a){i.emplaceBack(2*e+(o+1)/2,2*r+(a+1)/2)}class Ul{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Et,this.indexArray=new Wr,this.segments=new Xi,this.programConfigurations=new So(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,o){const a=this.layers[0],h=[];let p=null,f=!1;"circle"===a.type&&(p=a.layout.get("circle-sort-key"),f=!p.isConstant());for(const{feature:y,id:b,index:M,sourceLayerIndex:T}of e){const A=this.layers[0]._featureFilter.needGeometry,O=na(y,A);if(!this.layers[0]._featureFilter.filter(new Ki(this.zoom),O,o))continue;const R=f?p.evaluate(O,{},o):void 0,N={id:b,properties:y.properties,type:y.type,sourceLayerIndex:T,index:M,geometry:A?O.geometry:ra(y),patterns:{},sortKey:R};h.push(N)}f&&h.sort((y,b)=>y.sortKey-b.sortKey);for(const y of h){const{geometry:b,index:M,sourceLayerIndex:T}=y,A=e[M].feature;this.addFeature(y,b,M,o),r.featureIndex.insert(A,b,M,T,this.index)}}update(e,r,o){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,o)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,kn),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,r,o,a){for(const h of r)for(const p of h){const f=p.x,y=p.y;if(f<0||f>=br||y<0||y>=br)continue;const b=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),M=b.vertexLength;gl(this.layoutVertexArray,f,y,-1,-1),gl(this.layoutVertexArray,f,y,1,-1),gl(this.layoutVertexArray,f,y,1,1),gl(this.layoutVertexArray,f,y,-1,1),this.indexArray.emplaceBack(M,M+1,M+2),this.indexArray.emplaceBack(M,M+3,M+2),b.vertexLength+=4,b.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,{},a)}}function Lc(i,e){for(let r=0;r<i.length;r++)if(ya(e,i[r]))return!0;for(let r=0;r<e.length;r++)if(ya(i,e[r]))return!0;return!!Vl(i,e)}function ph(i,e,r){return!!ya(i,e)||!!Gl(e,i,r)}function Oc(i,e){if(1===i.length)return Rc(e,i[0]);for(let r=0;r<e.length;r++){const o=e[r];for(let a=0;a<o.length;a++)if(ya(i,o[a]))return!0}for(let r=0;r<i.length;r++)if(Rc(e,i[r]))return!0;for(let r=0;r<e.length;r++)if(Vl(i,e[r]))return!0;return!1}function mh(i,e,r){if(i.length>1){if(Vl(i,e))return!0;for(let o=0;o<e.length;o++)if(Gl(e[o],i,r))return!0}for(let o=0;o<i.length;o++)if(Gl(i[o],e,r))return!0;return!1}function Vl(i,e){if(0===i.length||0===e.length)return!1;for(let r=0;r<i.length-1;r++){const o=i[r],a=i[r+1];for(let h=0;h<e.length-1;h++)if(fh(o,a,e[h],e[h+1]))return!0}return!1}function fh(i,e,r,o){return Gt(i,r,o)!==Gt(e,r,o)&&Gt(i,e,r)!==Gt(i,e,o)}function Gl(i,e,r){const o=r*r;if(1===e.length)return i.distSqr(e[0])<o;for(let a=1;a<e.length;a++)if(zc(i,e[a-1],e[a])<o)return!0;return!1}function zc(i,e,r){const o=e.distSqr(r);if(0===o)return i.distSqr(e);const a=((i.x-e.x)*(r.x-e.x)+(i.y-e.y)*(r.y-e.y))/o;return i.distSqr(a<0?e:a>1?r:r.sub(e)._mult(a)._add(e))}function Rc(i,e){let r,o,a,h=!1;for(let p=0;p<i.length;p++){r=i[p];for(let f=0,y=r.length-1;f<r.length;y=f++)o=r[f],a=r[y],o.y>e.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(h=!h)}return h}function ya(i,e){let r=!1;for(let o=0,a=i.length-1;o<i.length;a=o++){const h=i[o],p=i[a];h.y>e.y!=p.y>e.y&&e.x<(p.x-h.x)*(e.y-h.y)/(p.y-h.y)+h.x&&(r=!r)}return r}function gh(i,e,r){const o=r[0],a=r[2];if(i.x<o.x&&e.x<o.x||i.x>a.x&&e.x>a.x||i.y<o.y&&e.y<o.y||i.y>a.y&&e.y>a.y)return!1;const h=Gt(i,e,r[0]);return h!==Gt(i,e,r[1])||h!==Gt(i,e,r[2])||h!==Gt(i,e,r[3])}function Wa(i,e,r){const o=e.paint.get(i).value;return"constant"===o.kind?o.value:r.programConfigurations.get(e.id).getMaxValue(i)}function _l(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function yl(i,e,r,o,a){if(!e[0]&&!e[1])return i;const h=Ce.convert(e)._mult(a);"viewport"===r&&h._rotate(-o);const p=[];for(let f=0;f<i.length;f++)p.push(i[f].sub(h));return p}let Fc,Bc;mt("CircleBucket",Ul,{omit:["layers"]});var _h={get paint(){return Bc=Bc||new pr({"circle-radius":new Wt(Y.paint_circle["circle-radius"]),"circle-color":new Wt(Y.paint_circle["circle-color"]),"circle-blur":new Wt(Y.paint_circle["circle-blur"]),"circle-opacity":new Wt(Y.paint_circle["circle-opacity"]),"circle-translate":new Ot(Y.paint_circle["circle-translate"]),"circle-translate-anchor":new Ot(Y.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Ot(Y.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Ot(Y.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Wt(Y.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Wt(Y.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Wt(Y.paint_circle["circle-stroke-opacity"])})},get layout(){return Fc=Fc||new pr({"circle-sort-key":new Wt(Y.layout_circle["circle-sort-key"])})}},xn=1e-6,va=typeof Float32Array<"u"?Float32Array:Array;function jl(i){return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}function Nc(i,e,r){var o=e[0],a=e[1],h=e[2],p=e[3],f=e[4],y=e[5],b=e[6],M=e[7],T=e[8],A=e[9],O=e[10],R=e[11],N=e[12],q=e[13],H=e[14],le=e[15],te=r[0],he=r[1],ye=r[2],Fe=r[3];return i[0]=te*o+he*f+ye*T+Fe*N,i[1]=te*a+he*y+ye*A+Fe*q,i[2]=te*h+he*b+ye*O+Fe*H,i[3]=te*p+he*M+ye*R+Fe*le,i[4]=(te=r[4])*o+(he=r[5])*f+(ye=r[6])*T+(Fe=r[7])*N,i[5]=te*a+he*y+ye*A+Fe*q,i[6]=te*h+he*b+ye*O+Fe*H,i[7]=te*p+he*M+ye*R+Fe*le,i[8]=(te=r[8])*o+(he=r[9])*f+(ye=r[10])*T+(Fe=r[11])*N,i[9]=te*a+he*y+ye*A+Fe*q,i[10]=te*h+he*b+ye*O+Fe*H,i[11]=te*p+he*M+ye*R+Fe*le,i[12]=(te=r[12])*o+(he=r[13])*f+(ye=r[14])*T+(Fe=r[15])*N,i[13]=te*a+he*y+ye*A+Fe*q,i[14]=te*h+he*b+ye*O+Fe*H,i[15]=te*p+he*M+ye*R+Fe*le,i}Math.hypot||(Math.hypot=function(){for(var i=0,e=arguments.length;e--;)i+=arguments[e]*arguments[e];return Math.sqrt(i)});var qa,yh=Nc;function vl(i,e,r){var o=e[0],a=e[1],h=e[2],p=e[3];return i[0]=r[0]*o+r[4]*a+r[8]*h+r[12]*p,i[1]=r[1]*o+r[5]*a+r[9]*h+r[13]*p,i[2]=r[2]*o+r[6]*a+r[10]*h+r[14]*p,i[3]=r[3]*o+r[7]*a+r[11]*h+r[15]*p,i}qa=new va(4),va!=Float32Array&&(qa[0]=0,qa[1]=0,qa[2]=0,qa[3]=0);class vh extends jn{constructor(e){super(e,_h)}createBucket(e){return new Ul(e)}queryRadius(e){const r=e;return Wa("circle-radius",this,r)+Wa("circle-stroke-width",this,r)+_l(this.paint.get("circle-translate"))}queryIntersectsFeature(e,r,o,a,h,p,f,y){const b=yl(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),p.angle,f),M=this.paint.get("circle-radius").evaluate(r,o)+this.paint.get("circle-stroke-width").evaluate(r,o),T="map"===this.paint.get("circle-pitch-alignment"),A=T?b:(N=y,b.map(q=>Uc(q,N))),O=T?M*f:M;var N;for(const R of a)for(const N of R){const q=T?N:Uc(N,y);let H=O;const le=vl([],[N.x,N.y,0,1],y);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?H*=le[3]/p.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(H*=p.cameraToCenterDistance/le[3]),ph(A,q,H))return!0}return!1}}function Uc(i,e){const r=vl([],[i.x,i.y,0,1],e);return new Ce(r[0]/r[3],r[1]/r[3])}class Vc extends Ul{}let Gc;mt("HeatmapBucket",Vc,{omit:["layers"]});var xh={get paint(){return Gc=Gc||new pr({"heatmap-radius":new Wt(Y.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Wt(Y.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ot(Y.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Ba(Y.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ot(Y.paint_heatmap["heatmap-opacity"])})}};function $l(i,{width:e,height:r},o,a){if(a){if(a instanceof Uint8ClampedArray)a=new Uint8Array(a.buffer);else if(a.length!==e*r*o)throw new RangeError(`mismatched image size. expected: ${a.length} but got: ${e*r*o}`)}else a=new Uint8Array(e*r*o);return i.width=e,i.height=r,i.data=a,i}function jc(i,{width:e,height:r},o){if(e===i.width&&r===i.height)return;const a=$l({},{width:e,height:r},o);Zl(i,a,{x:0,y:0},{x:0,y:0},{width:Math.min(i.width,e),height:Math.min(i.height,r)},o),i.width=e,i.height=r,i.data=a.data}function Zl(i,e,r,o,a,h){if(0===a.width||0===a.height)return e;if(a.width>i.width||a.height>i.height||r.x>i.width-a.width||r.y>i.height-a.height)throw new RangeError("out of range source coordinates for image copy");if(a.width>e.width||a.height>e.height||o.x>e.width-a.width||o.y>e.height-a.height)throw new RangeError("out of range destination coordinates for image copy");const p=i.data,f=e.data;if(p===f)throw new Error("srcData equals dstData, so image is already copied");for(let y=0;y<a.height;y++){const b=((r.y+y)*i.width+r.x)*h,M=((o.y+y)*e.width+o.x)*h;for(let T=0;T<a.width*h;T++)f[M+T]=p[b+T]}return e}class Ka{constructor(e,r){$l(this,e,1,r)}resize(e){jc(this,e,1)}clone(){return new Ka({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,o,a,h){Zl(e,r,o,a,h,1)}}class Yn{constructor(e,r){$l(this,e,4,r)}resize(e){jc(this,e,4)}replace(e,r){r?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new Yn({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,o,a,h){Zl(e,r,o,a,h,4)}}function $c(i){const e={},r=i.resolution||256,o=i.clips?i.clips.length:1,a=i.image||new Yn({width:r,height:o});if(Math.log(r)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${r}`);const h=(p,f,y)=>{e[i.evaluationKey]=y;const b=i.expression.evaluate(e);a.data[p+f+0]=Math.floor(255*b.r/b.a),a.data[p+f+1]=Math.floor(255*b.g/b.a),a.data[p+f+2]=Math.floor(255*b.b/b.a),a.data[p+f+3]=Math.floor(255*b.a)};if(i.clips)for(let p=0,f=0;p<o;++p,f+=4*r)for(let y=0,b=0;y<r;y++,b+=4){const M=y/(r-1),{start:T,end:A}=i.clips[p];h(f,b,T*(1-M)+A*M)}else for(let p=0,f=0;p<r;p++,f+=4)h(0,f,p/(r-1));return a}mt("AlphaImage",Ka),mt("RGBAImage",Yn);class bh extends jn{createBucket(e){return new Vc(e)}constructor(e){super(e,xh),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){"heatmap-color"===e&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=$c({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}}let Zc;var wh={get paint(){return Zc=Zc||new pr({"hillshade-illumination-direction":new Ot(Y.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Ot(Y.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Ot(Y.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Ot(Y.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Ot(Y.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Ot(Y.paint_hillshade["hillshade-accent-color"])})}};class Ch extends jn{constructor(e){super(e,wh)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}}const Sh=ir([{name:"a_pos",components:2,type:"Int16"}],4),{members:Mh}=Sh;var Wl={exports:{}};function xl(i,e,r){r=r||2;
vendor: 4,246 bytes, line 1
1var o,a,h,p,f,y,b,M=e&&e.length,T=M?e[0]*r:i.length,A=Wc(i,0,T,r,!0),O=[];if(!A||A.next===A.prev)return O;if(M&&(A=function(N,q,H,le){var te,he,ye,Fe=[];for(te=0,he=q.length;te<he;te++)(ye=Wc(N,q[te]*le,te<he-1?q[te+1]*le:N.length,le,!1))===ye.next&&(ye.steiner=!0),Fe.push(Lh(ye));for(Fe.sort(Ah),te=0;te<Fe.length;te++)H=kh(Fe[te],H);return H}(i,e,A,r)),i.length>80*r){o=h=i[0],a=p=i[1];for(var R=r;R<T;R+=r)(f=i[R])<o&&(o=f),(y=i[R+1])<a&&(a=y),f>h&&(h=f),y>p&&(p=y);b=0!==(b=Math.max(h-o,p-a))?32767/b:0}return Xa(A,O,r,o,a,b,0),O}function Wc(i,e,r,o,a){var h,p;if(a===Xl(i,e,r,o)>0)for(h=e;h<r;h+=o)p=Xc(h,i[h],i[h+1],p);else for(h=r-o;h>=e;h-=o)p=Xc(h,i[h],i[h+1],p);return p&&bl(p,p.next)&&(Ha(p),p=p.next),p}function oa(i,e){if(!i)return i;e||(e=i);var r,o=i;do{if(r=!1,o.steiner||!bl(o,o.next)&&0!==fr(o.prev,o,o.next))o=o.next;else{if(Ha(o),(o=e=o.prev)===o.next)break;r=!0}}while(r||o!==e);return e}function Xa(i,e,r,o,a,h,p){if(i){!p&&h&&function(M,T,A,O){var R=M;do{0===R.z&&(R.z=ql(R.x,R.y,T,A,O)),R.prevZ=R.prev,R.nextZ=R.next,R=R.next}while(R!==M);R.prevZ.nextZ=null,R.prevZ=null,function(N){var q,H,le,te,he,ye,Fe,vt,Tt=1;do{for(H=N,N=null,he=null,ye=0;H;){for(ye++,le=H,Fe=0,q=0;q<Tt&&(Fe++,le=le.nextZ);q++);for(vt=Tt;Fe>0||vt>0&≤)0!==Fe&&(0===vt||!le||H.z<=le.z)?(te=H,H=H.nextZ,Fe--):(te=le,le=le.nextZ,vt--),he?he.nextZ=te:N=te,te.prevZ=he,he=te;H=le}he.nextZ=null,Tt*=2}while(ye>1)}(R)}(i,o,a,h);for(var f,y,b=i;i.prev!==i.next;)if(f=i.prev,y=i.next,h?Eh(i,o,a,h):Ih(i))e.push(f.i/r|0),e.push(i.i/r|0),e.push(y.i/r|0),Ha(i),i=y.next,b=y.next;else if((i=y)===b){p?1===p?Xa(i=Th(oa(i),e,r),e,r,o,a,h,2):2===p&&Ph(i,e,r,o,a,h):Xa(oa(i),e,r,o,a,h,1);break}}}function Ih(i){var e=i.prev,r=i,o=i.next;if(fr(e,r,o)>=0)return!1;for(var a=e.x,h=r.x,p=o.x,f=e.y,y=r.y,b=o.y,M=a<h?a<p?a:p:h<p?h:p,T=f<y?f<b?f:b:y<b?y:b,A=a>h?a>p?a:p:h>p?h:p,O=f>y?f>b?f:b:y>b?y:b,R=o.next;R!==e;){if(R.x>=M&&R.x<=A&&R.y>=T&&R.y<=O&&xa(a,f,h,y,p,b,R.x,R.y)&&fr(R.prev,R,R.next)>=0)return!1;R=R.next}return!0}function Eh(i,e,r,o){var a=i.prev,h=i,p=i.next;if(fr(a,h,p)>=0)return!1;for(var f=a.x,y=h.x,b=p.x,M=a.y,T=h.y,A=p.y,O=f<y?f<b?f:b:y<b?y:b,R=M<T?M<A?M:A:T<A?T:A,N=f>y?f>b?f:b:y>b?y:b,q=M>T?M>A?M:A:T>A?T:A,H=ql(O,R,e,r,o),le=ql(N,q,e,r,o),te=i.prevZ,he=i.nextZ;te&&te.z>=H&&he&&he.z<=le;){if(te.x>=O&&te.x<=N&&te.y>=R&&te.y<=q&&te!==a&&te!==p&&xa(f,M,y,T,b,A,te.x,te.y)&&fr(te.prev,te,te.next)>=0||(te=te.prevZ,he.x>=O&&he.x<=N&&he.y>=R&&he.y<=q&&he!==a&&he!==p&&xa(f,M,y,T,b,A,he.x,he.y)&&fr(he.prev,he,he.next)>=0))return!1;he=he.nextZ}for(;te&&te.z>=H;){if(te.x>=O&&te.x<=N&&te.y>=R&&te.y<=q&&te!==a&&te!==p&&xa(f,M,y,T,b,A,te.x,te.y)&&fr(te.prev,te,te.next)>=0)return!1;te=te.prevZ}for(;he&&he.z<=le;){if(he.x>=O&&he.x<=N&&he.y>=R&&he.y<=q&&he!==a&&he!==p&&xa(f,M,y,T,b,A,he.x,he.y)&&fr(he.prev,he,he.next)>=0)return!1;he=he.nextZ}return!0}function Th(i,e,r){var o=i;do{var a=o.prev,h=o.next.next;!bl(a,h)&&qc(a,o,o.next,h)&&Ja(a,h)&&Ja(h,a)&&(e.push(a.i/r|0),e.push(o.i/r|0),e.push(h.i/r|0),Ha(o),Ha(o.next),o=i=h),o=o.next}while(o!==i);return oa(o)}function Ph(i,e,r,o,a,h){var p=i;do{for(var f=p.next.next;f!==p.prev;){if(p.i!==f.i&&Oh(p,f)){var y=Kc(p,f);return p=oa(p,p.next),y=oa(y,y.next),Xa(p,e,r,o,a,h,0),void Xa(y,e,r,o,a,h,0)}f=f.next}p=p.next}while(p!==i)}function Ah(i,e){return i.x-e.x}function kh(i,e){var r=function(a,h){var p,f=h,y=a.x,b=a.y,M=-1/0;do{if(b<=f.y&&b>=f.next.y&&f.next.y!==f.y){var T=f.x+(b-f.y)*(f.next.x-f.x)/(f.next.y-f.y);if(T<=y&&T>M&&(M=T,p=f.x<f.next.x?f:f.next,T===y))return p}f=f.next}while(f!==h);if(!p)return null;var A,O=p,R=p.x,N=p.y,q=1/0;f=p;do{y>=f.x&&f.x>=R&&y!==f.x&&xa(b<N?y:M,b,R,N,b<N?M:y,b,f.x,f.y)&&(A=Math.abs(b-f.y)/(y-f.x),Ja(f,a)&&(A<q||A===q&&(f.x>p.x||f.x===p.x&&Dh(p,f)))&&(p=f,q=A)),f=f.next}while(f!==O);return p}(i,e);if(!r)return e;var o=Kc(r,i);return oa(o,o.next),oa(r,r.next)}function Dh(i,e){return fr(i.prev,i,e.prev)<0&&fr(e.next,i,i.next)<0}function ql(i,e,r,o,a){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=(i-r)*a|0)|i<<8))|i<<4))|i<<2))|i<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-o)*a|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Lh(i){var e=i,r=i;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==i);return r}
vendor: 8,137 bytes, line 1
1function xa(i,e,r,o,a,h,p,f){return(a-p)*(e-f)>=(i-p)*(h-f)&&(i-p)*(o-f)>=(r-p)*(e-f)&&(r-p)*(h-f)>=(a-p)*(o-f)}function Oh(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!function(r,o){var a=r;do{if(a.i!==r.i&&a.next.i!==r.i&&a.i!==o.i&&a.next.i!==o.i&&qc(a,a.next,r,o))return!0;a=a.next}while(a!==r);return!1}(i,e)&&(Ja(i,e)&&Ja(e,i)&&function(r,o){var a=r,h=!1,p=(r.x+o.x)/2,f=(r.y+o.y)/2;do{a.y>f!=a.next.y>f&&a.next.y!==a.y&&p<(a.next.x-a.x)*(f-a.y)/(a.next.y-a.y)+a.x&&(h=!h),a=a.next}while(a!==r);return h}(i,e)&&(fr(i.prev,i,e.prev)||fr(i,e.prev,e))||bl(i,e)&&fr(i.prev,i,i.next)>0&&fr(e.prev,e,e.next)>0)}function fr(i,e,r){return(e.y-i.y)*(r.x-e.x)-(e.x-i.x)*(r.y-e.y)}function bl(i,e){return i.x===e.x&&i.y===e.y}function qc(i,e,r,o){var a=Cl(fr(i,e,r)),h=Cl(fr(i,e,o)),p=Cl(fr(r,o,i)),f=Cl(fr(r,o,e));return a!==h&&p!==f||!(0!==a||!wl(i,r,e))||!(0!==h||!wl(i,o,e))||!(0!==p||!wl(r,i,o))||!(0!==f||!wl(r,e,o))}function wl(i,e,r){return e.x<=Math.max(i.x,r.x)&&e.x>=Math.min(i.x,r.x)&&e.y<=Math.max(i.y,r.y)&&e.y>=Math.min(i.y,r.y)}function Cl(i){return i>0?1:i<0?-1:0}function Ja(i,e){return fr(i.prev,i,i.next)<0?fr(i,e,i.next)>=0&&fr(i,i.prev,e)>=0:fr(i,e,i.prev)<0||fr(i,i.next,e)<0}function Kc(i,e){var r=new Kl(i.i,i.x,i.y),o=new Kl(e.i,e.x,e.y),a=i.next,h=e.prev;return i.next=e,e.prev=i,r.next=a,a.prev=r,o.next=r,r.prev=o,h.next=o,o.prev=h,o}function Xc(i,e,r,o){var a=new Kl(i,e,r);return o?(a.next=o.next,a.prev=o,o.next.prev=a,o.next=a):(a.prev=a,a.next=a),a}function Ha(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function Kl(i,e,r){this.i=i,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Xl(i,e,r,o){for(var a=0,h=e,p=r-o;h<r;h+=o)a+=(i[p]-i[h])*(i[h+1]+i[p+1]),p=h;return a}Wl.exports=xl,Wl.exports.default=xl,xl.deviation=function(i,e,r,o){var a=e&&e.length,h=Math.abs(Xl(i,0,a?e[0]*r:i.length,r));if(a)for(var p=0,f=e.length;p<f;p++)h-=Math.abs(Xl(i,e[p]*r,p<f-1?e[p+1]*r:i.length,r));var y=0;for(p=0;p<o.length;p+=3){var b=o[p]*r,M=o[p+1]*r,T=o[p+2]*r;y+=Math.abs((i[b]-i[T])*(i[M+1]-i[b+1])-(i[b]-i[M])*(i[T+1]-i[b+1]))}return 0===h&&0===y?0:Math.abs((y-h)/h)},xl.flatten=function(i){for(var e=i[0][0].length,r={vertices:[],holes:[],dimensions:e},o=0,a=0;a<i.length;a++){for(var h=0;h<i[a].length;h++)for(var p=0;p<e;p++)r.vertices.push(i[a][h][p]);a>0&&r.holes.push(o+=i[a-1].length)}return r};var Jc=pe(Wl.exports);function zh(i,e,r,o,a){Hc(i,e,r||0,o||i.length-1,a||Rh)}function Hc(i,e,r,o,a){for(;o>r;){if(o-r>600){var h=o-r+1,p=e-r+1,f=Math.log(h),y=.5*Math.exp(2*f/3),b=.5*Math.sqrt(f*y*(h-y)/h)*(p-h/2<0?-1:1);Hc(i,e,Math.max(r,Math.floor(e-p*y/h+b)),Math.min(o,Math.floor(e+(h-p)*y/h+b)),a)}var M=i[e],T=r,A=o;for(Ya(i,r,e),a(i[o],M)>0&&Ya(i,r,o);T<A;){for(Ya(i,T,A),T++,A--;a(i[T],M)<0;)T++;for(;a(i[A],M)>0;)A--}0===a(i[r],M)?Ya(i,r,A):Ya(i,++A,o),A<=e&&(r=A+1),e<=A&&(o=A-1)}}function Ya(i,e,r){var o=i[e];i[e]=i[r],i[r]=o}function Rh(i,e){return i<e?-1:i>e?1:0}function Jl(i,e){const r=i.length;if(r<=1)return[i];const o=[];let a,h;for(let p=0;p<r;p++){const f=St(i[p]);0!==f&&(i[p].area=Math.abs(f),void 0===h&&(h=f<0),h===f<0?(a&&o.push(a),a=[i[p]]):a.push(i[p]))}if(a&&o.push(a),e>1)for(let p=0;p<o.length;p++)o[p].length<=e||(zh(o[p],e,1,o[p].length-1,Fh),o[p]=o[p].slice(0,e));return o}function Fh(i,e){return e.area-i.area}function Hl(i,e,r){const o=r.patternDependencies;let a=!1;for(const h of e){const p=h.paint.get(`${i}-pattern`);p.isConstant()||(a=!0);const f=p.constantOr(null);f&&(a=!0,o[f.to]=!0,o[f.from]=!0)}return a}function Yl(i,e,r,o,a){const h=a.patternDependencies;for(const p of e){const f=p.paint.get(`${i}-pattern`).value;if("constant"!==f.kind){let y=f.evaluate({zoom:o-1},r,{},a.availableImages),b=f.evaluate({zoom:o},r,{},a.availableImages),M=f.evaluate({zoom:o+1},r,{},a.availableImages);y=y&&y.name?y.name:y,b=b&&b.name?b.name:b,M=M&&M.name?M.name:M,h[y]=!0,h[b]=!0,h[M]=!0,r.patterns[p.id]={min:y,mid:b,max:M}}}return r}class Ql{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new gi,this.indexArray=new Wr,this.indexArray2=new Ar,this.programConfigurations=new So(e.layers,e.zoom),this.segments=new Xi,this.segments2=new Xi,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,o){this.hasPattern=Hl("fill",this.layers,r);const a=this.layers[0].layout.get("fill-sort-key"),h=!a.isConstant(),p=[];for(const{feature:f,id:y,index:b,sourceLayerIndex:M}of e){const T=this.layers[0]._featureFilter.needGeometry,A=na(f,T);if(!this.layers[0]._featureFilter.filter(new Ki(this.zoom),A,o))continue;const O=h?a.evaluate(A,{},o,r.availableImages):void 0,R={id:y,properties:f.properties,type:f.type,sourceLayerIndex:M,index:b,geometry:T?A.geometry:ra(f),patterns:{},sortKey:O};p.push(R)}h&&p.sort((f,y)=>f.sortKey-y.sortKey);for(const f of p){const{geometry:y,index:b,sourceLayerIndex:M}=f;if(this.hasPattern){const T=Yl("fill",this.layers,f,this.zoom,r);this.patternFeatures.push(T)}else this.addFeature(f,y,b,o,{});r.featureIndex.insert(e[b].feature,y,b,M,this.index)}}update(e,r,o){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,o)}addFeatures(e,r,o){for(const a of this.patternFeatures)this.addFeature(a,a.geometry,a.index,r,o)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Mh),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,r,o,a,h){for(const p of Jl(r,500)){let f=0;for(const O of p)f+=O.length;const y=this.segments.prepareSegment(f,this.layoutVertexArray,this.indexArray),b=y.vertexLength,M=[],T=[];for(const O of p){if(0===O.length)continue;O!==p[0]&&T.push(M.length/2);const R=this.segments2.prepareSegment(O.length,this.layoutVertexArray,this.indexArray2),N=R.vertexLength;this.layoutVertexArray.emplaceBack(O[0].x,O[0].y),this.indexArray2.emplaceBack(N+O.length-1,N),M.push(O[0].x),M.push(O[0].y);for(let q=1;q<O.length;q++)this.layoutVertexArray.emplaceBack(O[q].x,O[q].y),this.indexArray2.emplaceBack(N+q-1,N+q),M.push(O[q].x),M.push(O[q].y);R.vertexLength+=O.length,R.primitiveLength+=O.length}const A=Jc(M,T);for(let O=0;O<A.length;O+=3)this.indexArray.emplaceBack(b+A[O],b+A[O+1],b+A[O+2]);y.vertexLength+=f,y.primitiveLength+=A.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,h,a)}}let Yc,Qc;mt("FillBucket",Ql,{omit:["layers","patternFeatures"]});var Bh={get paint(){return Qc=Qc||new pr({"fill-antialias":new Ot(Y.paint_fill["fill-antialias"]),"fill-opacity":new Wt(Y.paint_fill["fill-opacity"]),"fill-color":new Wt(Y.paint_fill["fill-color"]),"fill-outline-color":new Wt(Y.paint_fill["fill-outline-color"]),"fill-translate":new Ot(Y.paint_fill["fill-translate"]),"fill-translate-anchor":new Ot(Y.paint_fill["fill-translate-anchor"]),"fill-pattern":new ea(Y.paint_fill["fill-pattern"])})},get layout(){return Yc=Yc||new pr({"fill-sort-key":new Wt(Y.layout_fill["fill-sort-key"])})}};class Nh extends jn{constructor(e){super(e,Bh)}recalculate(e,r){super.recalculate(e,r);const o=this.paint._values["fill-outline-color"];"constant"===o.value.kind&&void 0===o.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new Ql(e)}queryRadius(){return _l(this.paint.get("fill-translate"))}queryIntersectsFeature(e,r,o,a,h,p,f){return Oc(yl(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),p.angle,f),a)}isTileClipped(){return!0}}
vendor: 29,271 bytes, line 1
1const Uh=ir([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Vh=ir([{name:"a_centroid",components:2,type:"Int16"}],4),{members:Gh}=Uh;var Ns={},jh=Ct,eu=ba;function ba(i,e,r,o,a){this.properties={},this.extent=r,this.type=0,this._pbf=i,this._geometry=-1,this._keys=o,this._values=a,i.readFields($h,this,e)}function $h(i,e,r){1==i?e.id=r.readVarint():2==i?function(o,a){for(var h=o.readVarint()+o.pos;o.pos<h;){var p=a._keys[o.readVarint()],f=a._values[o.readVarint()];a.properties[p]=f}}(r,e):3==i?e.type=r.readVarint():4==i&&(e._geometry=r.pos)}function Zh(i){for(var e,r,o=0,a=0,h=i.length,p=h-1;a<h;p=a++)o+=((r=i[p]).x-(e=i[a]).x)*(e.y+r.y);return o}ba.types=["Unknown","Point","LineString","Polygon"],ba.prototype.loadGeometry=function(){var i=this._pbf;i.pos=this._geometry;for(var e,r=i.readVarint()+i.pos,o=1,a=0,h=0,p=0,f=[];i.pos<r;){if(a<=0){var y=i.readVarint();o=7&y,a=y>>3}if(a--,1===o||2===o)h+=i.readSVarint(),p+=i.readSVarint(),1===o&&(e&&f.push(e),e=[]),e.push(new jh(h,p));else{if(7!==o)throw new Error("unknown command "+o);e&&e.push(e[0].clone())}}return e&&f.push(e),f},ba.prototype.bbox=function(){var i=this._pbf;i.pos=this._geometry;for(var e=i.readVarint()+i.pos,r=1,o=0,a=0,h=0,p=1/0,f=-1/0,y=1/0,b=-1/0;i.pos<e;){if(o<=0){var M=i.readVarint();r=7&M,o=M>>3}if(o--,1===r||2===r)(a+=i.readSVarint())<p&&(p=a),a>f&&(f=a),(h+=i.readSVarint())<y&&(y=h),h>b&&(b=h);else if(7!==r)throw new Error("unknown command "+r)}return[p,y,f,b]},ba.prototype.toGeoJSON=function(i,e,r){var o,a,h=this.extent*Math.pow(2,r),p=this.extent*i,f=this.extent*e,y=this.loadGeometry(),b=ba.types[this.type];function M(O){for(var R=0;R<O.length;R++){var N=O[R];O[R]=[360*(N.x+p)/h-180,360/Math.PI*Math.atan(Math.exp((180-360*(N.y+f)/h)*Math.PI/180))-90]}}switch(this.type){case 1:var T=[];for(o=0;o<y.length;o++)T[o]=y[o][0];M(y=T);break;case 2:for(o=0;o<y.length;o++)M(y[o]);break;case 3:for(y=function(O){var R=O.length;if(R<=1)return[O];for(var N,q,H=[],le=0;le<R;le++){var te=Zh(O[le]);0!==te&&(void 0===q&&(q=te<0),q===te<0?(N&&H.push(N),N=[O[le]]):N.push(O[le]))}return N&&H.push(N),H}(y),o=0;o<y.length;o++)for(a=0;a<y[o].length;a++)M(y[o][a])}1===y.length?y=y[0]:b="Multi"+b;var A={type:"Feature",geometry:{type:b,coordinates:y},properties:this.properties};return"id"in this&&(A.id=this.id),A};var Wh=eu,tu=iu;function iu(i,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=i,this._keys=[],this._values=[],this._features=[],i.readFields(qh,this,e),this.length=this._features.length}function qh(i,e,r){15===i?e.version=r.readVarint():1===i?e.name=r.readString():5===i?e.extent=r.readVarint():2===i?e._features.push(r.pos):3===i?e._keys.push(r.readString()):4===i&&e._values.push(function(o){for(var a=null,h=o.readVarint()+o.pos;o.pos<h;){var p=o.readVarint()>>3;a=1===p?o.readString():2===p?o.readFloat():3===p?o.readDouble():4===p?o.readVarint64():5===p?o.readVarint():6===p?o.readSVarint():7===p?o.readBoolean():null}return a}(r))}iu.prototype.feature=function(i){if(i<0||i>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[i];var e=this._pbf.readVarint()+this._pbf.pos;return new Wh(this._pbf,e,this.extent,this._keys,this._values)};var Kh=tu;function Xh(i,e,r){if(3===i){var o=new Kh(r,r.readVarint()+r.pos);o.length&&(e[o.name]=o)}}Ns.VectorTile=function(i,e){this.layers=i.readFields(Xh,{},e)},Ns.VectorTileFeature=eu,Ns.VectorTileLayer=tu;const Jh=Ns.VectorTileFeature.types,ec=Math.pow(2,13);function Qa(i,e,r,o,a,h,p,f){i.emplaceBack(e,r,2*Math.floor(o*ec)+p,a*ec*2,h*ec*2,Math.round(f))}class tc{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new dt,this.centroidVertexArray=new rt,this.indexArray=new Wr,this.programConfigurations=new So(e.layers,e.zoom),this.segments=new Xi,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,o){this.features=[],this.hasPattern=Hl("fill-extrusion",this.layers,r);for(const{feature:a,id:h,index:p,sourceLayerIndex:f}of e){const y=this.layers[0]._featureFilter.needGeometry,b=na(a,y);if(!this.layers[0]._featureFilter.filter(new Ki(this.zoom),b,o))continue;const M={id:h,sourceLayerIndex:f,index:p,geometry:y?b.geometry:ra(a),properties:a.properties,type:a.type,patterns:{}};this.hasPattern?this.features.push(Yl("fill-extrusion",this.layers,M,this.zoom,r)):this.addFeature(M,M.geometry,p,o,{}),r.featureIndex.insert(a,M.geometry,p,f,this.index,!0)}}addFeatures(e,r,o){for(const a of this.features){const{geometry:h}=a;this.addFeature(a,h,a.index,r,o)}}update(e,r,o){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,o)}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Gh),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Vh.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,r,o,a,h){const p={x:0,y:0,vertexCount:0};for(const f of Jl(r,500)){let y=0;for(const R of f)y+=R.length;let b=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const R of f){if(0===R.length||((i=R).every(e=>e.x<0)||i.every(e=>e.x>br)||i.every(e=>e.y<0)||i.every(e=>e.y>br)))continue;let N=0;for(let q=0;q<R.length;q++){const H=R[q];if(q>=1){const le=R[q-1];if(!Hh(H,le)){b.vertexLength+4>Xi.MAX_VERTEX_ARRAY_LENGTH&&(b=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const te=H.sub(le)._perp()._unit(),he=le.dist(H);N+he>32768&&(N=0),Qa(this.layoutVertexArray,H.x,H.y,te.x,te.y,0,0,N),Qa(this.layoutVertexArray,H.x,H.y,te.x,te.y,0,1,N),p.x+=2*H.x,p.y+=2*H.y,p.vertexCount+=2,N+=he,Qa(this.layoutVertexArray,le.x,le.y,te.x,te.y,0,0,N),Qa(this.layoutVertexArray,le.x,le.y,te.x,te.y,0,1,N),p.x+=2*le.x,p.y+=2*le.y,p.vertexCount+=2;const ye=b.vertexLength;this.indexArray.emplaceBack(ye,ye+2,ye+1),this.indexArray.emplaceBack(ye+1,ye+2,ye+3),b.vertexLength+=4,b.primitiveLength+=2}}}}if(b.vertexLength+y>Xi.MAX_VERTEX_ARRAY_LENGTH&&(b=this.segments.prepareSegment(y,this.layoutVertexArray,this.indexArray)),"Polygon"!==Jh[e.type])continue;const M=[],T=[],A=b.vertexLength;for(const R of f)if(0!==R.length){R!==f[0]&&T.push(M.length/2);for(let N=0;N<R.length;N++){const q=R[N];Qa(this.layoutVertexArray,q.x,q.y,0,0,1,1,0),p.x+=q.x,p.y+=q.y,p.vertexCount+=1,M.push(q.x),M.push(q.y)}}const O=Jc(M,T);for(let R=0;R<O.length;R+=3)this.indexArray.emplaceBack(A+O[R],A+O[R+2],A+O[R+1]);b.primitiveLength+=O.length/3,b.vertexLength+=y}var i;for(let f=0;f<p.vertexCount;f++)this.centroidVertexArray.emplaceBack(Math.floor(p.x/p.vertexCount),Math.floor(p.y/p.vertexCount));this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,h,a)}}function Hh(i,e){return i.x===e.x&&(i.x<0||i.x>br)||i.y===e.y&&(i.y<0||i.y>br)}let ru;mt("FillExtrusionBucket",tc,{omit:["layers","features"]});var Qh={get paint(){return ru=ru||new pr({"fill-extrusion-opacity":new Ot(Y["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Wt(Y["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ot(Y["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ot(Y["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ea(Y["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Wt(Y["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Wt(Y["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ot(Y["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class ed extends jn{constructor(e){super(e,Qh)}createBucket(e){return new tc(e)}queryRadius(){return _l(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(e,r,o,a,h,p,f,y){const b=yl(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),p.angle,f),M=this.paint.get("fill-extrusion-height").evaluate(r,o),T=this.paint.get("fill-extrusion-base").evaluate(r,o),A=function(R,N,q,H){const le=[];for(const te of R){const he=[te.x,te.y,0,1];vl(he,he,N),le.push(new Ce(he[0]/he[3],he[1]/he[3]))}return le}(b,y),O=function(R,N,q,H){const le=[],te=[],he=H[8]*N,ye=H[9]*N,Fe=H[10]*N,vt=H[11]*N,Tt=H[8]*q,yt=H[9]*q,pt=H[10]*q,ot=H[11]*q;for(const Mt of R){const at=[],Je=[];for(const Nt of Mt){const Dt=Nt.x,ui=Nt.y,Ji=H[0]*Dt+H[4]*ui+H[12],er=H[1]*Dt+H[5]*ui+H[13],Lr=H[2]*Dt+H[6]*ui+H[14],Zn=H[3]*Dt+H[7]*ui+H[15],bn=Lr+Fe,wr=Zn+vt,Kr=Ji+Tt,nn=er+yt,wn=Lr+pt,Cn=Zn+ot,Or=new Ce((Ji+he)/wr,(er+ye)/wr);Or.z=bn/wr,at.push(Or);const zr=new Ce(Kr/Cn,nn/Cn);zr.z=wn/Cn,Je.push(zr)}le.push(at),te.push(Je)}return[le,te]}(a,T,M,y);return function(R,N,q){let H=1/0;Oc(q,N)&&(H=nu(q,N[0]));for(let le=0;le<N.length;le++){const te=N[le],he=R[le];for(let ye=0;ye<te.length-1;ye++){const Fe=te[ye],vt=[Fe,te[ye+1],he[ye+1],he[ye],Fe];Lc(q,vt)&&(H=Math.min(H,nu(q,vt)))}}return H!==1/0&&H}(O[0],O[1],A)}}function el(i,e){return i.x*e.x+i.y*e.y}function nu(i,e){if(1===i.length){let r=0;const o=e[r++];let a;for(;!a||o.equals(a);)if(a=e[r++],!a)return 1/0;for(;r<e.length;r++){const h=e[r],p=i[0],f=a.sub(o),y=h.sub(o),b=p.sub(o),M=el(f,f),T=el(f,y),A=el(y,y),O=el(b,f),R=el(b,y),N=M*A-T*T,q=(A*O-T*R)/N,H=(M*R-T*O)/N,le=o.z*(1-q-H)+a.z*q+h.z*H;if(isFinite(le))return le}return 1/0}{let r=1/0;for(const o of e)r=Math.min(r,o.z);return r}}const td=ir([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:id}=td,rd=ir([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:nd}=rd,od=Ns.VectorTileFeature.types,sd=Math.cos(Math.PI/180*37.5),ou=Math.pow(2,14)/.5;class ic{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(r=>{this.gradients[r.id]={}}),this.layoutVertexArray=new qt,this.layoutVertexArray2=new kt,this.indexArray=new Wr,this.programConfigurations=new So(e.layers,e.zoom),this.segments=new Xi,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,o){this.hasPattern=Hl("line",this.layers,r);const a=this.layers[0].layout.get("line-sort-key"),h=!a.isConstant(),p=[];for(const{feature:f,id:y,index:b,sourceLayerIndex:M}of e){const T=this.layers[0]._featureFilter.needGeometry,A=na(f,T);if(!this.layers[0]._featureFilter.filter(new Ki(this.zoom),A,o))continue;const O=h?a.evaluate(A,{},o):void 0,R={id:y,properties:f.properties,type:f.type,sourceLayerIndex:M,index:b,geometry:T?A.geometry:ra(f),patterns:{},sortKey:O};p.push(R)}h&&p.sort((f,y)=>f.sortKey-y.sortKey);for(const f of p){const{geometry:y,index:b,sourceLayerIndex:M}=f;if(this.hasPattern){const T=Yl("line",this.layers,f,this.zoom,r);this.patternFeatures.push(T)}else this.addFeature(f,y,b,o,{});r.featureIndex.insert(e[b].feature,y,b,M,this.index)}}update(e,r,o){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,o)}addFeatures(e,r,o){for(const a of this.patternFeatures)this.addFeature(a,a.geometry,a.index,r,o)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,nd)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,id),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,r,o,a,h){const p=this.layers[0].layout,f=p.get("line-join").evaluate(e,{}),y=p.get("line-cap"),b=p.get("line-miter-limit"),M=p.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const T of r)this.addLine(T,e,f,y,b,M);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,h,a)}addLine(e,r,o,a,h,p){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let H=0;H<e.length-1;H++)this.totalDistance+=e[H].dist(e[H+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const f="Polygon"===od[r.type];let y=e.length;for(;y>=2&&e[y-1].equals(e[y-2]);)y--;let b=0;for(;b<y-1&&e[b].equals(e[b+1]);)b++;if(y<(f?3:2))return;"bevel"===o&&(h=1.05);const M=this.overscaling<=16?15*br/(512*this.overscaling):0,T=this.segments.prepareSegment(10*y,this.layoutVertexArray,this.indexArray);let A,O,R,N,q;this.e1=this.e2=-1,f&&(A=e[y-2],q=e[b].sub(A)._unit()._perp());for(let H=b;H<y;H++){if(R=H===y-1?f?e[b+1]:void 0:e[H+1],R&&e[H].equals(R))continue;q&&(N=q),A&&(O=A),A=e[H],q=R?R.sub(A)._unit()._perp():N,N=N||q;let le=N.add(q);0===le.x&&0===le.y||le._unit();const te=N.x*q.x+N.y*q.y,he=le.x*q.x+le.y*q.y,ye=0!==he?1/he:1/0,Fe=2*Math.sqrt(2-2*he),vt=he<sd&&O&&R,Tt=N.x*q.y-N.y*q.x>0;if(vt&&H>b){const ot=A.dist(O);if(ot>2*M){const Mt=A.sub(A.sub(O)._mult(M/ot)._round());this.updateDistance(O,Mt),this.addCurrentVertex(Mt,N,0,0,T),O=Mt}}const yt=O&&R;let pt=yt?o:f?"butt":a;if(yt&&"round"===pt&&(ye<p?pt="miter":ye<=2&&(pt="fakeround")),"miter"===pt&&ye>h&&(pt="bevel"),"bevel"===pt&&(ye>2&&(pt="flipbevel"),ye<h&&(pt="miter")),O&&this.updateDistance(O,A),"miter"===pt)le._mult(ye),this.addCurrentVertex(A,le,0,0,T);else if("flipbevel"===pt){if(ye>100)le=q.mult(-1);else{const ot=ye*N.add(q).mag()/N.sub(q).mag();le._perp()._mult(ot*(Tt?-1:1))}this.addCurrentVertex(A,le,0,0,T),this.addCurrentVertex(A,le.mult(-1),0,0,T)}else if("bevel"===pt||"fakeround"===pt){const ot=-Math.sqrt(ye*ye-1),Mt=Tt?ot:0,at=Tt?0:ot;if(O&&this.addCurrentVertex(A,N,Mt,at,T),"fakeround"===pt){const Je=Math.round(180*Fe/Math.PI/20);for(let Nt=1;Nt<Je;Nt++){let Dt=Nt/Je;if(.5!==Dt){const Ji=Dt-.5;Dt+=Dt*Ji*(Dt-1)*((1.0904+te*(te*(3.55645-1.43519*te)-3.2452))*Ji*Ji+(.848013+te*(.215638*te-1.06021)))}const ui=q.sub(N)._mult(Dt)._add(N)._unit()._mult(Tt?-1:1);this.addHalfVertex(A,ui.x,ui.y,!1,Tt,0,T)}}R&&this.addCurrentVertex(A,q,-Mt,-at,T)}else if("butt"===pt)this.addCurrentVertex(A,le,0,0,T);else if("square"===pt){const ot=O?1:-1;this.addCurrentVertex(A,le,ot,ot,T)}else"round"===pt&&(O&&(this.addCurrentVertex(A,N,0,0,T),this.addCurrentVertex(A,N,1,1,T,!0)),R&&(this.addCurrentVertex(A,q,-1,-1,T,!0),this.addCurrentVertex(A,q,0,0,T)));if(vt&&H<y-1){const ot=A.dist(R);if(ot>2*M){const Mt=A.add(R.sub(A)._mult(M/ot)._round());this.updateDistance(A,Mt),this.addCurrentVertex(Mt,q,0,0,T),A=Mt}}}}addCurrentVertex(e,r,o,a,h,p=!1){const f=r.y*a-r.x,y=-r.y-r.x*a;this.addHalfVertex(e,r.x+r.y*o,r.y-r.x*o,p,!1,o,h),this.addHalfVertex(e,f,y,p,!0,-a,h),this.distance>ou/2&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,r,o,a,h,p))}addHalfVertex({x:e,y:r},o,a,h,p,f,y){const b=.5*(this.lineClips?this.scaledDistance*(ou-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(h?1:0),(r<<1)+(p?1:0),Math.round(63*o)+128,Math.round(63*a)+128,1+(0===f?0:f<0?-1:1)|(63&b)<<2,b>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const M=y.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,M),y.primitiveLength++),p?this.e2=M:this.e1=M}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,r){this.distance+=e.dist(r),this.updateScaledDistance()}}let su,au;mt("LineBucket",ic,{omit:["layers","patternFeatures"]});var lu={get paint(){return au=au||new pr({"line-opacity":new Wt(Y.paint_line["line-opacity"]),"line-color":new Wt(Y.paint_line["line-color"]),"line-translate":new Ot(Y.paint_line["line-translate"]),"line-translate-anchor":new Ot(Y.paint_line["line-translate-anchor"]),"line-width":new Wt(Y.paint_line["line-width"]),"line-gap-width":new Wt(Y.paint_line["line-gap-width"]),"line-offset":new Wt(Y.paint_line["line-offset"]),"line-blur":new Wt(Y.paint_line["line-blur"]),"line-dasharray":new Fa(Y.paint_line["line-dasharray"]),"line-pattern":new ea(Y.paint_line["line-pattern"]),"line-gradient":new Ba(Y.paint_line["line-gradient"])})},get layout(){return su=su||new pr({"line-cap":new Ot(Y.layout_line["line-cap"]),"line-join":new Wt(Y.layout_line["line-join"]),"line-miter-limit":new Ot(Y.layout_line["line-miter-limit"]),"line-round-limit":new Ot(Y.layout_line["line-round-limit"]),"line-sort-key":new Wt(Y.layout_line["line-sort-key"])})}};class ad extends Wt{possiblyEvaluate(e,r){return r=new Ki(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),super.possiblyEvaluate(e,r)}evaluate(e,r,o,a){return r=Ae({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(e,r,o,a)}}let Sl;class ld extends jn{constructor(e){super(e,lu),this.gradientVersion=0,Sl||(Sl=new ad(lu.paint.properties["line-width"].specification),Sl.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if("line-gradient"===e){const r=this.gradientExpression();this.stepInterpolant=!(void 0===r._styleExpression)&&r._styleExpression.expression instanceof qn,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,r){super.recalculate(e,r),this.paint._values["line-floorwidth"]=Sl.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new ic(e)}queryRadius(e){const r=e,o=cu(Wa("line-width",this,r),Wa("line-gap-width",this,r)),a=Wa("line-offset",this,r);return o/2+Math.abs(a)+_l(this.paint.get("line-translate"))}queryIntersectsFeature(e,r,o,a,h,p,f){const y=yl(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),p.angle,f),b=f/2*cu(this.paint.get("line-width").evaluate(r,o),this.paint.get("line-gap-width").evaluate(r,o)),M=this.paint.get("line-offset").evaluate(r,o);return M&&(a=function(T,A){const O=[];for(let R=0;R<T.length;R++){const N=T[R],q=[];for(let H=0;H<N.length;H++){const le=N[H-1],te=N[H],he=N[H+1],ye=0===H?new Ce(0,0):te.sub(le)._unit()._perp(),Fe=H===N.length-1?new Ce(0,0):he.sub(te)._unit()._perp(),vt=ye._add(Fe)._unit(),Tt=vt.x*Fe.x+vt.y*Fe.y;0!==Tt&&vt._mult(1/Tt),q.push(vt._mult(A)._add(te))}O.push(q)}return O}(a,M*f)),function(T,A,O){for(let R=0;R<A.length;R++){const N=A[R];if(T.length>=3)for(let q=0;q<N.length;q++)if(ya(T,N[q]))return!0;if(mh(T,N,O))return!0}return!1}(y,a,b)}isTileClipped(){return!0}}function cu(i,e){return e>0?e+2*i:i}const cd=ir([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),ud=ir([{name:"a_projected_pos",components:3,type:"Float32"}],4);ir([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const hd=ir([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);ir([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const uu=ir([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),dd=ir([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function pd(i,e,r){return i.sections.forEach(o=>{o.text=function(a,h,p){const f=h.layout.get("text-transform").evaluate(p,{});return"uppercase"===f?a=a.toLocaleUpperCase():"lowercase"===f&&(a=a.toLocaleLowerCase()),An.applyArabicShaping&&(a=An.applyArabicShaping(a)),a}(o.text,e,r)}),i}ir([{name:"triangle",components:3,type:"Uint16"}]),ir([{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"}]),ir([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),ir([{type:"Float32",name:"offsetX"}]),ir([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),ir([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const tl={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"};var Dr=24,hu=Fi,du=function(i,e,r,o,a){var h,p,f=8*a-o-1,y=(1<<f)-1,b=y>>1,M=-7,T=r?a-1:0,A=r?-1:1,O=i[e+T];for(T+=A,h=O&(1<<-M)-1,O>>=-M,M+=f;M>0;h=256*h+i[e+T],T+=A,M-=8);for(p=h&(1<<-M)-1,h>>=-M,M+=o;M>0;p=256*p+i[e+T],T+=A,M-=8);if(0===h)h=1-b;else{if(h===y)return p?NaN:1/0*(O?-1:1);p+=Math.pow(2,o),h-=b}return(O?-1:1)*p*Math.pow(2,h-o)},pu=function(i,e,r,o,a,h){var p,f,y,b=8*h-a-1,M=(1<<b)-1,T=M>>1,A=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,O=o?0:h-1,R=o?1:-1,N=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(f=isNaN(e)?1:0,p=M):(p=Math.floor(Math.log(e)/Math.LN2),e*(y=Math.pow(2,-p))<1&&(p--,y*=2),(e+=p+T>=1?A/y:A*Math.pow(2,1-T))*y>=2&&(p++,y/=2),p+T>=M?(f=0,p=M):p+T>=1?(f=(e*y-1)*Math.pow(2,a),p+=T):(f=e*Math.pow(2,T-1)*Math.pow(2,a),p=0));a>=8;i[r+O]=255&f,O+=R,f/=256,a-=8);for(p=p<<a|f,b+=a;b>0;i[r+O]=255&p,O+=R,p/=256,b-=8);i[r+O-R]|=128*N};function Fi(i){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(i)?i:new Uint8Array(i||0),this.pos=0,this.type=0,this.length=this.buf.length}Fi.Varint=0,Fi.Fixed64=1,Fi.Bytes=2,Fi.Fixed32=5;var rc=4294967296,mu=1/rc,fu=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function cs(i){return i.type===Fi.Bytes?i.readVarint()+i.pos:i.pos+1}function gu(i,e,r){var o=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(o);for(var a=r.pos-1;a>=i;a--)r.buf[a+o]=r.buf[a]}function md(i,e){for(var r=0;r<i.length;r++)e.writeVarint(i[r])}function fd(i,e){for(var r=0;r<i.length;r++)e.writeSVarint(i[r])}function gd(i,e){for(var r=0;r<i.length;r++)e.writeFloat(i[r])}function _d(i,e){for(var r=0;r<i.length;r++)e.writeDouble(i[r])}function yd(i,e){for(var r=0;r<i.length;r++)e.writeBoolean(i[r])}function vd(i,e){for(var r=0;r<i.length;r++)e.writeFixed32(i[r])}function xd(i,e){for(var r=0;r<i.length;r++)e.writeSFixed32(i[r])}function bd(i,e){for(var r=0;r<i.length;r++)e.writeFixed64(i[r])}function wd(i,e){for(var r=0;r<i.length;r++)e.writeSFixed64(i[r])}function Ml(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16)+16777216*i[e+3]}function Ca(i,e,r){i[r]=e,i[r+1]=e>>>8,i[r+2]=e>>>16,i[r+3]=e>>>24}function _u(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16)+(i[e+3]<<24)}Fi.prototype={destroy:function(){this.buf=null},readFields:function(i,e,r){for(r=r||this.length;this.pos<r;){var o=this.readVarint(),a=o>>3,h=this.pos;this.type=7&o,i(a,e,this),this.pos===h&&this.skip(o)}return e},readMessage:function(i,e){return this.readFields(i,e,this.readVarint()+this.pos)},readFixed32:function(){var i=Ml(this.buf,this.pos);return this.pos+=4,i},readSFixed32:function(){var i=_u(this.buf,this.pos);return this.pos+=4,i},readFixed64:function(){var i=Ml(this.buf,this.pos)+Ml(this.buf,this.pos+4)*rc;return this.pos+=8,i},readSFixed64:function(){var i=Ml(this.buf,this.pos)+_u(this.buf,this.pos+4)*rc;return this.pos+=8,i},readFloat:function(){var i=du(this.buf,this.pos,!0,23,4);return this.pos+=4,i},readDouble:function(){var i=du(this.buf,this.pos,!0,52,8);return this.pos+=8,i},readVarint:function(i){var e,r,o=this.buf;return e=127&(r=o[this.pos++]),r<128?e:(e|=(127&(r=o[this.pos++]))<<7,r<128?e:(e|=(127&(r=o[this.pos++]))<<14,r<128?e:(e|=(127&(r=o[this.pos++]))<<21,r<128?e:function(a,h,p){var f,y,b=p.buf;if(f=(112&(y=b[p.pos++]))>>4,y<128||(f|=(127&(y=b[p.pos++]))<<3,y<128)||(f|=(127&(y=b[p.pos++]))<<10,y<128)||(f|=(127&(y=b[p.pos++]))<<17,y<128)||(f|=(127&(y=b[p.pos++]))<<24,y<128)||(f|=(1&(y=b[p.pos++]))<<31,y<128))return function wa(i,e,r){return r?4294967296*e+(i>>>0):4294967296*(e>>>0)+(i>>>0)}(a,f,h);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=o[this.pos]))<<28,i,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var i=this.readVarint();return i%2==1?(i+1)/-2:i/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var i=this.readVarint()+this.pos,e=this.pos;return this.pos=i,i-e>=12&&fu?fu.decode(this.buf.subarray(e,i)):function(r,o,a){for(var h="",p=o;p<a;){var f,y,b,M=r[p],T=null,A=M>239?4:M>223?3:M>191?2:1;if(p+A>a)break;1===A?M<128&&(T=M):2===A?128==(192&(f=r[p+1]))&&(T=(31&M)<<6|63&f)<=127&&(T=null):3===A?(y=r[p+2],128==(192&(f=r[p+1]))&&128==(192&y)&&((T=(15&M)<<12|(63&f)<<6|63&y)<=2047||T>=55296&&T<=57343)&&(T=null)):4===A&&(y=r[p+2],b=r[p+3],128==(192&(f=r[p+1]))&&128==(192&y)&&128==(192&b)&&((T=(15&M)<<18|(63&f)<<12|(63&y)<<6|63&b)<=65535||T>=1114112)&&(T=null)),null===T?(T=65533,A=1):T>65535&&(T-=65536,h+=String.fromCharCode(T>>>10&1023|55296),T=56320|1023&T),h+=String.fromCharCode(T),p+=A}return h}(this.buf,e,i)},readBytes:function(){var i=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,i);return this.pos=i,e},readPackedVarint:function(i,e){if(this.type!==Fi.Bytes)return i.push(this.readVarint(e));var r=cs(this);for(i=i||[];this.pos<r;)i.push(this.readVarint(e));return i}
vendor: 5,450 bytes, line 1
1,readPackedSVarint:function(i){if(this.type!==Fi.Bytes)return i.push(this.readSVarint());var e=cs(this);for(i=i||[];this.pos<e;)i.push(this.readSVarint());return i},readPackedBoolean:function(i){if(this.type!==Fi.Bytes)return i.push(this.readBoolean());var e=cs(this);for(i=i||[];this.pos<e;)i.push(this.readBoolean());return i},readPackedFloat:function(i){if(this.type!==Fi.Bytes)return i.push(this.readFloat());var e=cs(this);for(i=i||[];this.pos<e;)i.push(this.readFloat());return i},readPackedDouble:function(i){if(this.type!==Fi.Bytes)return i.push(this.readDouble());var e=cs(this);for(i=i||[];this.pos<e;)i.push(this.readDouble());return i},readPackedFixed32:function(i){if(this.type!==Fi.Bytes)return i.push(this.readFixed32());var e=cs(this);for(i=i||[];this.pos<e;)i.push(this.readFixed32());return i},readPackedSFixed32:function(i){if(this.type!==Fi.Bytes)return i.push(this.readSFixed32());var e=cs(this);for(i=i||[];this.pos<e;)i.push(this.readSFixed32());return i},readPackedFixed64:function(i){if(this.type!==Fi.Bytes)return i.push(this.readFixed64());var e=cs(this);for(i=i||[];this.pos<e;)i.push(this.readFixed64());return i},readPackedSFixed64:function(i){if(this.type!==Fi.Bytes)return i.push(this.readSFixed64());var e=cs(this);for(i=i||[];this.pos<e;)i.push(this.readSFixed64());return i},skip:function(i){var e=7&i;if(e===Fi.Varint)for(;this.buf[this.pos++]>127;);else if(e===Fi.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Fi.Fixed32)this.pos+=4;else{if(e!==Fi.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(i,e){this.writeVarint(i<<3|e)},realloc:function(i){for(var e=this.length||16;e<this.pos+i;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(i){this.realloc(4),Ca(this.buf,i,this.pos),this.pos+=4},writeSFixed32:function(i){this.realloc(4),Ca(this.buf,i,this.pos),this.pos+=4},writeFixed64:function(i){this.realloc(8),Ca(this.buf,-1&i,this.pos),Ca(this.buf,Math.floor(i*mu),this.pos+4),this.pos+=8},writeSFixed64:function(i){this.realloc(8),Ca(this.buf,-1&i,this.pos),Ca(this.buf,Math.floor(i*mu),this.pos+4),this.pos+=8},writeVarint:function(i){(i=+i||0)>268435455||i<0?function(e,r){var o,a,h,f;if(e>=0?(o=e%4294967296|0,a=e/4294967296|0):(a=~(-e/4294967296),4294967295^(o=~(-e%4294967296))?o=o+1|0:(o=0,a=a+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),h=o,(f=r).buf[f.pos++]=127&h|128,h>>>=7,f.buf[f.pos++]=127&h|128,h>>>=7,f.buf[f.pos++]=127&h|128,h>>>=7,f.buf[f.pos++]=127&h|128,f.buf[f.pos]=127&(h>>>=7),function(h,p){var f=(7&h)<<4;p.buf[p.pos++]|=f|((h>>>=3)?128:0),h&&(p.buf[p.pos++]=127&h|((h>>>=7)?128:0),h&&(p.buf[p.pos++]=127&h|((h>>>=7)?128:0),h&&(p.buf[p.pos++]=127&h|((h>>>=7)?128:0),h&&(p.buf[p.pos++]=127&h|((h>>>=7)?128:0),h&&(p.buf[p.pos++]=127&h)))))}(a,r)}(i,this):(this.realloc(4),this.buf[this.pos++]=127&i|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=i>>>7&127))))},writeSVarint:function(i){this.writeVarint(i<0?2*-i-1:2*i)},writeBoolean:function(i){this.writeVarint(!!i)},writeString:function(i){i=String(i),this.realloc(4*i.length),this.pos++;var e=this.pos;this.pos=function(o,a,h){for(var p,f,y=0;y<a.length;y++){if((p=a.charCodeAt(y))>55295&&p<57344){if(!f){p>56319||y+1===a.length?(o[h++]=239,o[h++]=191,o[h++]=189):f=p;continue}if(p<56320){o[h++]=239,o[h++]=191,o[h++]=189,f=p;continue}p=f-55296<<10|p-56320|65536,f=null}else f&&(o[h++]=239,o[h++]=191,o[h++]=189,f=null);p<128?o[h++]=p:(p<2048?o[h++]=p>>6|192:(p<65536?o[h++]=p>>12|224:(o[h++]=p>>18|240,o[h++]=p>>12&63|128),o[h++]=p>>6&63|128),o[h++]=63&p|128)}return h}(this.buf,i,this.pos);var r=this.pos-e;r>=128&&gu(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(i){this.realloc(4),pu(this.buf,i,this.pos,!0,23,4),this.pos+=4},writeDouble:function(i){this.realloc(8),pu(this.buf,i,this.pos,!0,52,8),this.pos+=8},writeBytes:function(i){var e=i.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=i[r]},writeRawMessage:function(i,e){this.pos++;var r=this.pos;i(e,this);var o=this.pos-r;o>=128&&gu(r,o,this),this.pos=r-1,this.writeVarint(o),this.pos+=o},writeMessage:function(i,e,r){this.writeTag(i,Fi.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(i,e){e.length&&this.writeMessage(i,md,e)},writePackedSVarint:function(i,e){e.length&&this.writeMessage(i,fd,e)},writePackedBoolean:function(i,e){e.length&&this.writeMessage(i,yd,e)},writePackedFloat:function(i,e){e.length&&this.writeMessage(i,gd,e)},writePackedDouble:function(i,e){e.length&&this.writeMessage(i,_d,e)},writePackedFixed32:function(i,e){e.length&&this.writeMessage(i,vd,e)},writePackedSFixed32:function(i,e){e.length&&this.writeMessage(i,xd,e)},writePackedFixed64:function(i,e){e.length&&this.writeMessage(i,bd,e)},writePackedSFixed64:function(i,e){e.length&&this.writeMessage(i,wd,e)},writeBytesField:function(i,e){this.writeTag(i,Fi.Bytes),this.writeBytes(e)},writeFixed32Field:function(i,e){this.writeTag(i,Fi.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(i,e){this.writeTag(i,Fi.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(i,e){this.writeTag(i,Fi.Fixed64),this.writeFixed64
vendor: 49,459 bytes, line 1
1(e)},writeSFixed64Field:function(i,e){this.writeTag(i,Fi.Fixed64),this.writeSFixed64(e)},writeVarintField:function(i,e){this.writeTag(i,Fi.Varint),this.writeVarint(e)},writeSVarintField:function(i,e){this.writeTag(i,Fi.Varint),this.writeSVarint(e)},writeStringField:function(i,e){this.writeTag(i,Fi.Bytes),this.writeString(e)},writeFloatField:function(i,e){this.writeTag(i,Fi.Fixed32),this.writeFloat(e)},writeDoubleField:function(i,e){this.writeTag(i,Fi.Fixed64),this.writeDouble(e)},writeBooleanField:function(i,e){this.writeVarintField(i,!!e)}};var nc=pe(hu);const oc=3;function Cd(i,e,r){1===i&&r.readMessage(Sd,e)}function Sd(i,e,r){if(3===i){const{id:o,bitmap:a,width:h,height:p,left:f,top:y,advance:b}=r.readMessage(Md,{});e.push({id:o,bitmap:new Ka({width:h+2*oc,height:p+2*oc},a),metrics:{width:h,height:p,left:f,top:y,advance:b}})}}function Md(i,e,r){1===i?e.id=r.readVarint():2===i?e.bitmap=r.readBytes():3===i?e.width=r.readVarint():4===i?e.height=r.readVarint():5===i?e.left=r.readSVarint():6===i?e.top=r.readSVarint():7===i&&(e.advance=r.readVarint())}const yu=oc;function vu(i){let e=0,r=0;for(const p of i)e+=p.w*p.h,r=Math.max(r,p.w);i.sort((p,f)=>f.h-p.h);const o=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}];let a=0,h=0;for(const p of i)for(let f=o.length-1;f>=0;f--){const y=o[f];if(!(p.w>y.w||p.h>y.h)){if(p.x=y.x,p.y=y.y,h=Math.max(h,p.y+p.h),a=Math.max(a,p.x+p.w),p.w===y.w&&p.h===y.h){const b=o.pop();f<o.length&&(o[f]=b)}else p.h===y.h?(y.x+=p.w,y.w-=p.w):p.w===y.w?(y.y+=p.h,y.h-=p.h):(o.push({x:y.x+p.w,y:y.y,w:y.w-p.w,h:p.h}),y.y+=p.h,y.h-=p.h);break}}return{w:a,h,fill:e/(a*h)||0}}const Dn=1;class sc{constructor(e,{pixelRatio:r,version:o,stretchX:a,stretchY:h,content:p}){this.paddedRect=e,this.pixelRatio=r,this.stretchX=a,this.stretchY=h,this.content=p,this.version=o}get tl(){return[this.paddedRect.x+Dn,this.paddedRect.y+Dn]}get br(){return[this.paddedRect.x+this.paddedRect.w-Dn,this.paddedRect.y+this.paddedRect.h-Dn]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2*Dn)/this.pixelRatio,(this.paddedRect.h-2*Dn)/this.pixelRatio]}}class xu{constructor(e,r){const o={},a={};this.haveRenderCallbacks=[];const h=[];this.addImages(e,o,h),this.addImages(r,a,h);const{w:p,h:f}=vu(h),y=new Yn({width:p||1,height:f||1});for(const b in e){const M=e[b],T=o[b].paddedRect;Yn.copy(M.data,y,{x:0,y:0},{x:T.x+Dn,y:T.y+Dn},M.data)}for(const b in r){const M=r[b],T=a[b].paddedRect,A=T.x+Dn,O=T.y+Dn,R=M.data.width,N=M.data.height;Yn.copy(M.data,y,{x:0,y:0},{x:A,y:O},M.data),Yn.copy(M.data,y,{x:0,y:N-1},{x:A,y:O-1},{width:R,height:1}),Yn.copy(M.data,y,{x:0,y:0},{x:A,y:O+N},{width:R,height:1}),Yn.copy(M.data,y,{x:R-1,y:0},{x:A-1,y:O},{width:1,height:N}),Yn.copy(M.data,y,{x:0,y:0},{x:A+R,y:O},{width:1,height:N})}this.image=y,this.iconPositions=o,this.patternPositions=a}addImages(e,r,o){for(const a in e){const h=e[a],p={x:0,y:0,w:h.data.width+2*Dn,h:h.data.height+2*Dn};o.push(p),r[a]=new sc(p,h),h.hasRenderCallback&&this.haveRenderCallbacks.push(a)}}patchUpdatedImages(e,r){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const o in e.updatedImages)this.patchUpdatedImage(this.iconPositions[o],e.getImage(o),r),this.patchUpdatedImage(this.patternPositions[o],e.getImage(o),r)}patchUpdatedImage(e,r,o){if(!e||!r||e.version===r.version)return;e.version=r.version;const[a,h]=e.tl;o.update(r.data,void 0,{x:a,y:h})}}var Us;mt("ImagePosition",sc),mt("ImageAtlas",xu),c.ai=void 0,(Us=c.ai||(c.ai={}))[Us.none=0]="none",Us[Us.horizontal=1]="horizontal",Us[Us.vertical=2]="vertical",Us[Us.horizontalOnly=3]="horizontalOnly";const il=-17;class rl{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,r){const o=new rl;return o.scale=e||1,o.fontStack=r,o}static forImage(e){const r=new rl;return r.imageName=e,r}}class Sa{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,r){const o=new Sa;for(let a=0;a<e.sections.length;a++){const h=e.sections[a];h.image?o.addImageSection(h):o.addTextSection(h,r)}return o}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}getCharCode(e){return this.text.charCodeAt(e)}verticalizePunctuation(){this.text=function(e){let r="";for(let o=0;o<e.length;o++){const a=e.charCodeAt(o+1)||null,h=e.charCodeAt(o-1)||null;r+=a&&ts(a)&&!tl[e[o+1]]||h&&ts(h)&&!tl[e[o-1]]||!tl[e[o]]?e[o]:tl[e[o]]}return r}(this.text)}trim(){let e=0;for(let o=0;o<this.text.length&&El[this.text.charCodeAt(o)];o++)e++;let r=this.text.length;for(let o=this.text.length-1;o>=0&&o>=e&&El[this.text.charCodeAt(o)];o--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)}substring(e,r){const o=new Sa;return o.text=this.text.substring(e,r),o.sectionIndex=this.sectionIndex.slice(e,r),o.sections=this.sections,o}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>Math.max(e,this.sections[r].scale),0)}addTextSection(e,r){this.text+=e.text,this.sections.push(rl.forText(e.scale,e.fontStack||r));const o=this.sections.length-1;for(let a=0;a<e.text.length;++a)this.sectionIndex.push(o)}addImageSection(e){const r=e.image?e.image.name:"";if(0===r.length)return void ze("Can't add FormattedSection with an empty image.");const o=this.getNextImageSectionCharCode();o?(this.text+=String.fromCharCode(o),this.sections.push(rl.forImage(r)),this.sectionIndex.push(this.sections.length-1)):ze("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Il(i,e,r,o,a,h,p,f,y,b,M,T,A,O,R,N){const q=Sa.fromFeature(i,a);let H;T===c.ai.vertical&&q.verticalizePunctuation();const{processBidirectionalText:le,processStyledBidirectionalText:te}=An;if(le&&1===q.sections.length){H=[];const Fe=le(q.toString(),ac(q,b,h,e,o,O,R));for(const vt of Fe){const Tt=new Sa;Tt.text=vt,Tt.sections=q.sections;for(let yt=0;yt<vt.length;yt++)Tt.sectionIndex.push(0);H.push(Tt)}}else if(te){H=[];const Fe=te(q.text,q.sectionIndex,ac(q,b,h,e,o,O,R));for(const vt of Fe){const Tt=new Sa;Tt.text=vt[0],Tt.sectionIndex=vt[1],Tt.sections=q.sections,H.push(Tt)}}else H=function(Fe,vt){const Tt=[],yt=Fe.text;let pt=0;for(const ot of vt)Tt.push(Fe.substring(pt,ot)),pt=ot;return pt<yt.length&&Tt.push(Fe.substring(pt,yt.length)),Tt}(q,ac(q,b,h,e,o,O,R));const he=[],ye={positionedLines:he,text:q.toString(),top:M[1],bottom:M[1],left:M[0],right:M[0],writingMode:T,iconsInText:!1,verticalizable:!1};return function(Fe,vt,Tt,yt,pt,ot,Mt,at,Je,Nt,Dt,ui){let Ji=0,er=il,Lr=0,Zn=0;const bn="right"===at?1:"left"===at?0:.5;let wr=0;for(const Or of pt){Or.trim();const zr=Or.getMaxScale(),hn=(zr-1)*Dr,Sn={positionedGlyphs:[],lineOffset:0};Fe.positionedLines[wr]=Sn;const dn=Sn.positionedGlyphs;let Ln=0;if(!Or.length()){er+=ot,++wr;continue}for(let Rr=0;Rr<Or.length();Rr++){const vi=Or.getSection(Rr),pn=Or.getSectionIndex(Rr),on=Or.getCharCode(Rr);let Fr=0,go=null,Mo=null,Io=null,us=Dr;const _o=!(Je===c.ai.horizontal||!Dt&&!Bo(on)||Dt&&(El[on]||(Kr=on,st.Arabic(Kr)||st["Arabic Supplement"](Kr)||st["Arabic Extended-A"](Kr)||st["Arabic Presentation Forms-A"](Kr)||st["Arabic Presentation Forms-B"](Kr))));if(vi.imageName){const eo=yt[vi.imageName];if(!eo)continue;Io=vi.imageName,Fe.iconsInText=Fe.iconsInText||!0,Mo=eo.paddedRect;const zn=eo.displaySize;vi.scale=vi.scale*Dr/ui,go={width:zn[0],height:zn[1],left:Dn,top:-yu,advance:_o?zn[1]:zn[0]},Fr=hn+(Dr-zn[1]*vi.scale),us=go.advance;const hs=_o?zn[0]*vi.scale-Dr*zr:zn[1]*vi.scale-Dr*zr;hs>0&&hs>Ln&&(Ln=hs)}else{const eo=Tt[vi.fontStack],zn=eo&&eo[on];if(zn&&zn.rect)Mo=zn.rect,go=zn.metrics;else{const hs=vt[vi.fontStack],ll=hs&&hs[on];if(!ll)continue;go=ll.metrics}Fr=(zr-vi.scale)*Dr}_o?(Fe.verticalizable=!0,dn.push({glyph:on,imageName:Io,x:Ji,y:er+Fr,vertical:_o,scale:vi.scale,fontStack:vi.fontStack,sectionIndex:pn,metrics:go,rect:Mo}),Ji+=us*vi.scale+Nt):(dn.push({glyph:on,imageName:Io,x:Ji,y:er+Fr,vertical:_o,scale:vi.scale,fontStack:vi.fontStack,sectionIndex:pn,metrics:go,rect:Mo}),Ji+=go.advance*vi.scale+Nt)}0!==dn.length&&(Lr=Math.max(Ji-Nt,Lr),Td(dn,0,dn.length-1,bn,Ln)),Ji=0;const On=ot*zr+Ln;Sn.lineOffset=Math.max(Ln,hn),er+=On,Zn=Math.max(On,Zn),++wr}var Kr;const nn=er-il,{horizontalAlign:wn,verticalAlign:Cn}=lc(Mt);(function(Or,zr,hn,Sn,dn,Ln,On,Rr,vi){const pn=(zr-hn)*dn;let on=0;on=Ln!==On?-Rr*Sn-il:(-Sn*vi+.5)*On;for(const Fr of Or)for(const go of Fr.positionedGlyphs)go.x+=pn,go.y+=on})(Fe.positionedLines,bn,wn,Cn,Lr,Zn,ot,nn,pt.length),Fe.top+=-Cn*nn,Fe.bottom=Fe.top+nn,Fe.left+=-wn*Lr,Fe.right=Fe.left+Lr}(ye,e,r,o,H,p,f,y,T,b,A,N),!function(Fe){for(const vt of Fe)if(0!==vt.positionedGlyphs.length)return!1;return!0}(he)&&ye}const El={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Id={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 bu(i,e,r,o,a,h){if(e.imageName){const p=o[e.imageName];return p?p.displaySize[0]*e.scale*Dr/h+a:0}{const p=r[e.fontStack],f=p&&p[i];return f?f.metrics.advance*e.scale+a:0}}function wu(i,e,r,o){const a=Math.pow(i-e,2);return o?i<e?a/2:2*a:a+Math.abs(r)*r}function Ed(i,e,r){let o=0;return 10===i&&(o-=1e4),r&&(o+=150),40!==i&&65288!==i||(o+=50),41!==e&&65289!==e||(o+=50),o}function Cu(i,e,r,o,a,h){let p=null,f=wu(e,r,a,h);for(const y of o){const b=wu(e-y.x,r,a,h)+y.badness;b<=f&&(p=y,f=b)}return{index:i,x:e,priorBreak:p,badness:f}}function Su(i){return i?Su(i.priorBreak).concat(i.index):[]}function ac(i,e,r,o,a,h,p){if("point"!==h)return[];if(!i)return[];const f=[],y=function(A,O,R,N,q,H){let le=0;for(let te=0;te<A.length();te++){const he=A.getSection(te);le+=bu(A.getCharCode(te),he,N,q,O,H)}return le/Math.max(1,Math.ceil(le/R))}(i,e,r,o,a,p),b=i.text.indexOf("\u200b")>=0;let M=0;for(let A=0;A<i.length();A++){const O=i.getSection(A),R=i.getCharCode(A);if(El[R]||(M+=bu(R,O,o,a,e,p)),A<i.length()-1){const N=!((T=R)<11904||!(st["Bopomofo Extended"](T)||st.Bopomofo(T)||st["CJK Compatibility Forms"](T)||st["CJK Compatibility Ideographs"](T)||st["CJK Compatibility"](T)||st["CJK Radicals Supplement"](T)||st["CJK Strokes"](T)||st["CJK Symbols and Punctuation"](T)||st["CJK Unified Ideographs Extension A"](T)||st["CJK Unified Ideographs"](T)||st["Enclosed CJK Letters and Months"](T)||st["Halfwidth and Fullwidth Forms"](T)||st.Hiragana(T)||st["Ideographic Description Characters"](T)||st["Kangxi Radicals"](T)||st["Katakana Phonetic Extensions"](T)||st.Katakana(T)||st["Vertical Forms"](T)||st["Yi Radicals"](T)||st["Yi Syllables"](T)));(Id[R]||N||O.imageName)&&f.push(Cu(A+1,M,y,f,Ed(R,i.getCharCode(A+1),N&&b),!1))}}var T;return Su(Cu(i.length(),M,y,f,0,!0))}function lc(i){let e=.5,r=.5;switch(i){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(i){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}function Td(i,e,r,o,a){if(!o&&!a)return;const h=i[r],p=(i[r].x+h.metrics.advance*h.scale)*o;for(let f=e;f<=r;f++)i[f].x-=p,i[f].y+=a}function Pd(i,e,r){const{horizontalAlign:o,verticalAlign:a}=lc(r),h=e[0]-i.displaySize[0]*o,p=e[1]-i.displaySize[1]*a;return{image:i,top:p,bottom:p+i.displaySize[1],left:h,right:h+i.displaySize[0]}}function Mu(i,e,r,o,a,h){const p=i.image;let f;if(p.content){const q=p.content,H=p.pixelRatio||1;f=[q[0]/H,q[1]/H,p.displaySize[0]-q[2]/H,p.displaySize[1]-q[3]/H]}const y=e.left*h,b=e.right*h;let M,T,A,O;"width"===r||"both"===r?(O=a[0]+y-o[3],T=a[0]+b+o[1]):(O=a[0]+(y+b-p.displaySize[0])/2,T=O+p.displaySize[0]);const R=e.top*h,N=e.bottom*h;return"height"===r||"both"===r?(M=a[1]+R-o[0],A=a[1]+N+o[2]):(M=a[1]+(R+N-p.displaySize[1])/2,A=M+p.displaySize[1]),{image:p,top:M,right:T,bottom:A,left:O,collisionPadding:f}}const nl=255,Vo=128,Vs=nl*Vo;function Iu(i,e){const{expression:r}=e;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new Ki(i+1))};if("source"===r.kind)return{kind:"source"};{const{zoomStops:o,interpolationType:a}=r;let h=0;for(;h<o.length&&o[h]<=i;)h++;h=Math.max(0,h-1);let p=h;for(;p<o.length&&o[p]<i+1;)p++;p=Math.min(o.length-1,p);const f=o[h],y=o[p];return"composite"===r.kind?{kind:"composite",minZoom:f,maxZoom:y,interpolationType:a}:{kind:"camera",minZoom:f,maxZoom:y,minSize:r.evaluate(new Ki(f)),maxSize:r.evaluate(new Ki(y)),interpolationType:a}}}function cc(i,e,r){let o="never";const a=i.get(e);return a?o=a:i.get(r)&&(o="always"),o}const Ad=Ns.VectorTileFeature.types,kd=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Tl(i,e,r,o,a,h,p,f,y,b,M,T,A){const O=f?Math.min(Vs,Math.round(f[0])):0,R=f?Math.min(Vs,Math.round(f[1])):0;i.emplaceBack(e,r,Math.round(32*o),Math.round(32*a),h,p,(O<<1)+(y?1:0),R,16*b,16*M,256*T,256*A)}function uc(i,e,r){i.emplaceBack(e.x,e.y,r),i.emplaceBack(e.x,e.y,r),i.emplaceBack(e.x,e.y,r),i.emplaceBack(e.x,e.y,r)}function Dd(i){for(const e of i.sections)if(zs(e.text))return!0;return!1}class hc{constructor(e){this.layoutVertexArray=new pi,this.indexArray=new Wr,this.programConfigurations=e,this.segments=new Xi,this.dynamicLayoutVertexArray=new ai,this.opacityVertexArray=new _i,this.hasVisibleVertices=!1,this.placedSymbolArray=new oe}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(e,r,o,a){this.isEmpty()||(o&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,cd.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,r),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,ud.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,kd,!0),this.opacityVertexBuffer.itemSize=1),(o||a)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}mt("SymbolBuffers",hc);class dc{constructor(e,r,o){this.layoutVertexArray=new e,this.layoutAttributes=r,this.indexArray=new o,this.segments=new Xi,this.collisionVertexArray=new Vi}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,hd.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}mt("CollisionBuffers",dc);class Ma{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(p=>p.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=jl([]),this.placementViewportMatrix=jl([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Iu(this.zoom,r["text-size"]),this.iconSizeData=Iu(this.zoom,r["icon-size"]);const o=this.layers[0].layout,a=o.get("symbol-sort-key"),h=o.get("symbol-z-order");this.canOverlap="never"!==cc(o,"text-overlap","text-allow-overlap")||"never"!==cc(o,"icon-overlap","icon-allow-overlap")||o.get("text-ignore-placement")||o.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==h&&!a.isConstant(),this.sortFeaturesByY=("viewport-y"===h||"auto"===h&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===o.get("symbol-placement")&&(this.writingModes=o.get("text-writing-mode").map(p=>c.ai[p])),this.stateDependentLayerIds=this.layers.filter(p=>p.isStateDependent()).map(p=>p.id),this.sourceID=e.sourceID}createArrays(){this.text=new hc(new So(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new hc(new So(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new ae,this.lineVertexArray=new ve,this.symbolInstances=new K,this.textAnchorOffsets=new Re}calculateGlyphDependencies(e,r,o,a,h){for(let p=0;p<e.length;p++)if(r[e.charCodeAt(p)]=!0,(o||a)&&h){const f=tl[e.charAt(p)];f&&(r[f.charCodeAt(0)]=!0)}}populate(e,r,o){const a=this.layers[0],h=a.layout,p=h.get("text-font"),f=h.get("text-field"),y=h.get("icon-image"),b=("constant"!==f.value.kind||f.value.value instanceof Mi&&!f.value.value.isEmpty()||f.value.value.toString().length>0)&&("constant"!==p.value.kind||p.value.value.length>0),M="constant"!==y.value.kind||!!y.value.value||Object.keys(y.parameters).length>0,T=h.get("symbol-sort-key");if(this.features=[],!b&&!M)return;const A=r.iconDependencies,O=r.glyphDependencies,R=r.availableImages,N=new Ki(this.zoom);for(const{feature:q,id:H,index:le,sourceLayerIndex:te}of e){const he=a._featureFilter.needGeometry,ye=na(q,he);if(!a._featureFilter.filter(N,ye,o))continue;let Fe,vt;if(he||(ye.geometry=ra(q)),b){const yt=a.getValueAndResolveTokens("text-field",ye,o,R),pt=Mi.factory(yt);Dd(pt)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===za()||this.hasRTLText&&An.isParsed())&&(Fe=pd(pt,a,ye))}if(M){const yt=a.getValueAndResolveTokens("icon-image",ye,o,R);vt=yt instanceof xr?yt:xr.fromString(yt)}if(!Fe&&!vt)continue;const Tt=this.sortFeaturesByKey?T.evaluate(ye,{},o):void 0;if(this.features.push({id:H,text:Fe,icon:vt,index:le,sourceLayerIndex:te,geometry:ye.geometry,properties:q.properties,type:Ad[q.type],sortKey:Tt}),vt&&(A[vt.name]=!0),Fe){const yt=p.evaluate(ye,{},o).join(","),pt="viewport"!==h.get("text-rotation-alignment")&&"point"!==h.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(c.ai.vertical)>=0;for(const ot of Fe.sections)if(ot.image)A[ot.image.name]=!0;else{const Mt=Os(Fe.toString()),at=ot.fontStack||yt,Je=O[at]=O[at]||{};this.calculateGlyphDependencies(ot.text,Je,pt,this.allowVerticalPlacement,Mt)}}}"line"===h.get("symbol-placement")&&(this.features=function(q){const H={},le={},te=[];let he=0;function ye(yt){te.push(q[yt]),he++}function Fe(yt,pt,ot){const Mt=le[yt];return delete le[yt],le[pt]=Mt,te[Mt].geometry[0].pop(),te[Mt].geometry[0]=te[Mt].geometry[0].concat(ot[0]),Mt}function vt(yt,pt,ot){const Mt=H[pt];return delete H[pt],H[yt]=Mt,te[Mt].geometry[0].shift(),te[Mt].geometry[0]=ot[0].concat(te[Mt].geometry[0]),Mt}function Tt(yt,pt,ot){const Mt=ot?pt[0][pt[0].length-1]:pt[0][0];return`${yt}:${Mt.x}:${Mt.y}`}for(let yt=0;yt<q.length;yt++){const pt=q[yt],ot=pt.geometry,Mt=pt.text?pt.text.toString():null;if(!Mt){ye(yt);continue}const at=Tt(Mt,ot),Je=Tt(Mt,ot,!0);if(at in le&&Je in H&&le[at]!==H[Je]){const Nt=vt(at,Je,ot),Dt=Fe(at,Je,te[Nt].geometry);delete H[at],delete le[Je],le[Tt(Mt,te[Dt].geometry,!0)]=Dt,te[Nt].geometry=null}else at in le?Fe(at,Je,ot):Je in H?vt(at,Je,ot):(ye(yt),H[at]=he-1,le[Je]=he-1)}return te.filter(yt=>yt.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((q,H)=>q.sortKey-H.sortKey)}update(e,r,o){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,r,this.layers,o),this.icon.programConfigurations.updatePaintArrays(e,r,this.layers,o))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,r){const o=this.lineVertexArray.length;if(void 0!==e.segment){let a=e.dist(r[e.segment+1]),h=e.dist(r[e.segment]);const p={};for(let f=e.segment+1;f<r.length;f++)p[f]={x:r[f].x,y:r[f].y,tileUnitDistanceFromAnchor:a},f<r.length-1&&(a+=r[f+1].dist(r[f]));for(let f=e.segment||0;f>=0;f--)p[f]={x:r[f].x,y:r[f].y,tileUnitDistanceFromAnchor:h},f>0&&(h+=r[f-1].dist(r[f]));for(let f=0;f<r.length;f++){const y=p[f];this.lineVertexArray.emplaceBack(y.x,y.y,y.tileUnitDistanceFromAnchor)}}return{lineStartIndex:o,lineLength:this.lineVertexArray.length-o}}addSymbols(e,r,o,a,h,p,f,y,b,M,T,A){const O=e.indexArray,R=e.layoutVertexArray,N=e.segments.prepareSegment(4*r.length,R,O,this.canOverlap?p.sortKey:void 0),q=this.glyphOffsetArray.length,H=N.vertexLength,le=this.allowVerticalPlacement&&f===c.ai.vertical?Math.PI/2:0,te=p.text&&p.text.sections;for(let he=0;he<r.length;he++){const{tl:ye,tr:Fe,bl:vt,br:Tt,tex:yt,pixelOffsetTL:pt,pixelOffsetBR:ot,minFontScaleX:Mt,minFontScaleY:at,glyphOffset:Je,isSDF:Nt,sectionIndex:Dt}=r[he],ui=N.vertexLength,Ji=Je[1];Tl(R,y.x,y.y,ye.x,Ji+ye.y,yt.x,yt.y,o,Nt,pt.x,pt.y,Mt,at),Tl(R,y.x,y.y,Fe.x,Ji+Fe.y,yt.x+yt.w,yt.y,o,Nt,ot.x,pt.y,Mt,at),Tl(R,y.x,y.y,vt.x,Ji+vt.y,yt.x,yt.y+yt.h,o,Nt,pt.x,ot.y,Mt,at),Tl(R,y.x,y.y,Tt.x,Ji+Tt.y,yt.x+yt.w,yt.y+yt.h,o,Nt,ot.x,ot.y,Mt,at),uc(e.dynamicLayoutVertexArray,y,le),O.emplaceBack(ui,ui+1,ui+2),O.emplaceBack(ui+1,ui+2,ui+3),N.vertexLength+=4,N.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Je[0]),he!==r.length-1&&Dt===r[he+1].sectionIndex||e.programConfigurations.populatePaintArrays(R.length,p,p.index,{},A,te&&te[Dt])}e.placedSymbolArray.emplaceBack(y.x,y.y,q,this.glyphOffsetArray.length-q,H,b,M,y.segment,o?o[0]:0,o?o[1]:0,a[0],a[1],f,0,!1,0,T)}_addCollisionDebugVertex(e,r,o,a,h,p){return r.emplaceBack(0,0),e.emplaceBack(o.x,o.y,a,h,Math.round(p.x),Math.round(p.y))}addCollisionDebugVertices(e,r,o,a,h,p,f){const y=h.segments.prepareSegment(4,h.layoutVertexArray,h.indexArray),b=y.vertexLength,M=h.layoutVertexArray,T=h.collisionVertexArray,A=f.anchorX,O=f.anchorY;this._addCollisionDebugVertex(M,T,p,A,O,new Ce(e,r)),this._addCollisionDebugVertex(M,T,p,A,O,new Ce(o,r)),this._addCollisionDebugVertex(M,T,p,A,O,new Ce(o,a)),this._addCollisionDebugVertex(M,T,p,A,O,new Ce(e,a)),y.vertexLength+=4;const R=h.indexArray;R.emplaceBack(b,b+1),R.emplaceBack(b+1,b+2),R.emplaceBack(b+2,b+3),R.emplaceBack(b+3,b),y.primitiveLength+=4}addDebugCollisionBoxes(e,r,o,a){for(let h=e;h<r;h++){const p=this.collisionBoxArray.get(h);this.addCollisionDebugVertices(p.x1,p.y1,p.x2,p.y2,a?this.textCollisionBox:this.iconCollisionBox,p.anchorPoint,o)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new dc(cr,uu.members,Ar),this.iconCollisionBox=new dc(cr,uu.members,Ar);for(let e=0;e<this.symbolInstances.length;e++){const r=this.symbolInstances.get(e);this.addDebugCollisionBoxes(r.textBoxStartIndex,r.textBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.iconBoxStartIndex,r.iconBoxEndIndex,r,!1),this.addDebugCollisionBoxes(r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex,r,!1)}}_deserializeCollisionBoxesForSymbol(e,r,o,a,h,p,f,y,b){const M={};for(let T=r;T<o;T++){const A=e.get(T);M.textBox={x1:A.x1,y1:A.y1,x2:A.x2,y2:A.y2,anchorPointX:A.anchorPointX,anchorPointY:A.anchorPointY},M.textFeatureIndex=A.featureIndex;break}for(let T=a;T<h;T++){const A=e.get(T);M.verticalTextBox={x1:A.x1,y1:A.y1,x2:A.x2,y2:A.y2,anchorPointX:A.anchorPointX,anchorPointY:A.anchorPointY},M.verticalTextFeatureIndex=A.featureIndex;break}for(let T=p;T<f;T++){const A=e.get(T);M.iconBox={x1:A.x1,y1:A.y1,x2:A.x2,y2:A.y2,anchorPointX:A.anchorPointX,anchorPointY:A.anchorPointY},M.iconFeatureIndex=A.featureIndex;break}for(let T=y;T<b;T++){const A=e.get(T);M.verticalIconBox={x1:A.x1,y1:A.y1,x2:A.x2,y2:A.y2,anchorPointX:A.anchorPointX,anchorPointY:A.anchorPointY},M.verticalIconFeatureIndex=A.featureIndex;break}return M}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let r=0;r<this.symbolInstances.length;r++){const o=this.symbolInstances.get(r);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,o.textBoxStartIndex,o.textBoxEndIndex,o.verticalTextBoxStartIndex,o.verticalTextBoxEndIndex,o.iconBoxStartIndex,o.iconBoxEndIndex,o.verticalIconBoxStartIndex,o.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,r){const o=e.placedSymbolArray.get(r),a=o.vertexStartIndex+4*o.numGlyphs;for(let h=o.vertexStartIndex;h<a;h+=4)e.indexArray.emplaceBack(h,h+1,h+2),e.indexArray.emplaceBack(h+1,h+2,h+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const r=Math.sin(e),o=Math.cos(e),a=[],h=[],p=[];for(let f=0;f<this.symbolInstances.length;++f){p.push(f);const y=this.symbolInstances.get(f);a.push(0|Math.round(r*y.anchorX+o*y.anchorY)),h.push(y.featureIndex)}return p.sort((f,y)=>a[f]-a[y]||h[y]-h[f]),p}addToSortKeyRanges(e,r){const o=this.sortKeyRanges[this.sortKeyRanges.length-1];o&&o.sortKey===r?o.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:r,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const r of this.symbolInstanceIndexes){const o=this.symbolInstances.get(r);this.featureSortOrder.push(o.featureIndex),[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((a,h,p)=>{a>=0&&p.indexOf(a)===h&&this.addIndicesForPlacedSymbol(this.text,a)}),o.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,o.verticalPlacedTextSymbolIndex),o.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.placedIconSymbolIndex),o.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Eu,Tu;mt("SymbolBucket",Ma,{omit:["layers","collisionBoxArray","features","compareText"]}),Ma.MAX_GLYPHS=65535,Ma.addDynamicAttributes=uc;var pc={get paint(){return Tu=Tu||new pr({"icon-opacity":new Wt(Y.paint_symbol["icon-opacity"]),"icon-color":new Wt(Y.paint_symbol["icon-color"]),"icon-halo-color":new Wt(Y.paint_symbol["icon-halo-color"]),"icon-halo-width":new Wt(Y.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Wt(Y.paint_symbol["icon-halo-blur"]),"icon-translate":new Ot(Y.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ot(Y.paint_symbol["icon-translate-anchor"]),"text-opacity":new Wt(Y.paint_symbol["text-opacity"]),"text-color":new Wt(Y.paint_symbol["text-color"],{runtimeType:dr,getOverride:i=>i.textColor,hasOverride:i=>!!i.textColor}),"text-halo-color":new Wt(Y.paint_symbol["text-halo-color"]),"text-halo-width":new Wt(Y.paint_symbol["text-halo-width"]),"text-halo-blur":new Wt(Y.paint_symbol["text-halo-blur"]),"text-translate":new Ot(Y.paint_symbol["text-translate"]),"text-translate-anchor":new Ot(Y.paint_symbol["text-translate-anchor"])})},get layout(){return Eu=Eu||new pr({"symbol-placement":new Ot(Y.layout_symbol["symbol-placement"]),"symbol-spacing":new Ot(Y.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ot(Y.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Wt(Y.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ot(Y.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ot(Y.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Ot(Y.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Ot(Y.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ot(Y.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ot(Y.layout_symbol["icon-rotation-alignment"]),"icon-size":new Wt(Y.layout_symbol["icon-size"]),"icon-text-fit":new Ot(Y.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ot(Y.layout_symbol["icon-text-fit-padding"]),"icon-image":new Wt(Y.layout_symbol["icon-image"]),"icon-rotate":new Wt(Y.layout_symbol["icon-rotate"]),"icon-padding":new Wt(Y.layout_symbol["icon-padding"]),"icon-keep-upright":new Ot(Y.layout_symbol["icon-keep-upright"]),"icon-offset":new Wt(Y.layout_symbol["icon-offset"]),"icon-anchor":new Wt(Y.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ot(Y.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ot(Y.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ot(Y.layout_symbol["text-rotation-alignment"]),"text-field":new Wt(Y.layout_symbol["text-field"]),"text-font":new Wt(Y.layout_symbol["text-font"]),"text-size":new Wt(Y.layout_symbol["text-size"]),"text-max-width":new Wt(Y.layout_symbol["text-max-width"]),"text-line-height":new Ot(Y.layout_symbol["text-line-height"]),"text-letter-spacing":new Wt(Y.layout_symbol["text-letter-spacing"]),"text-justify":new Wt(Y.layout_symbol["text-justify"]),"text-radial-offset":new Wt(Y.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ot(Y.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Wt(Y.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Wt(Y.layout_symbol["text-anchor"]),"text-max-angle":new Ot(Y.layout_symbol["text-max-angle"]),"text-writing-mode":new Ot(Y.layout_symbol["text-writing-mode"]),"text-rotate":new Wt(Y.layout_symbol["text-rotate"]),"text-padding":new Ot(Y.layout_symbol["text-padding"]),"text-keep-upright":new Ot(Y.layout_symbol["text-keep-upright"]),"text-transform":new Wt(Y.layout_symbol["text-transform"]),"text-offset":new Wt(Y.layout_symbol["text-offset"]),"text-allow-overlap":new Ot(Y.layout_symbol["text-allow-overlap"]),"text-overlap":new Ot(Y.layout_symbol["text-overlap"]),"text-ignore-placement":new Ot(Y.layout_symbol["text-ignore-placement"]),"text-optional":new Ot(Y.layout_symbol["text-optional"])})}};class Pu{constructor(e){if(void 0===e.property.overrides)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:Tr,this.defaultValue=e}evaluate(e){if(e.formattedSection){const r=this.defaultValue.property.overrides;if(r&&r.hasOverride(e.formattedSection))return r.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}mt("FormatSectionOverride",Pu,{omit:["defaultValue"]});class Pl extends jn{constructor(e){super(e,pc)}recalculate(e,r){if(super.recalculate(e,r),"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"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"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 o=this.layout.get("text-writing-mode");if(o){const a=[];for(const h of o)a.indexOf(h)<0&&a.push(h);this.layout._values["text-writing-mode"]=a}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,r,o,a){const h=this.layout.get(e).evaluate(r,{},o,a),p=this._unevaluatedLayout._values[e];return p.isDataDriven()||En(p.value)||!h?h:(f=r.properties,h.replace(/{([^{}]+)}/g,(b,M)=>f&&M in f?String(f[M]):""));var f}createBucket(e){return new Ma(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const e of pc.paint.overridableProperties){if(!Pl.hasPaintOverride(this.layout,e))continue;const r=this.paint.get(e),o=new Pu(r),a=new Do(o,r.property.specification);let h=null;h="constant"===r.value.kind||"source"===r.value.kind?new Lo("source",a):new so("composite",a,r.value.zoomStops),this.paint._values[e]=new cn(r.property,h,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,o){return!(!this.layout||r.isDataDriven()||o.isDataDriven())&&Pl.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){const o=e.get("text-field"),a=pc.paint.properties[r];let h=!1;const p=f=>{for(const y of f)if(a.overrides&&a.overrides.hasOverride(y))return void(h=!0)};if("constant"===o.value.kind&&o.value.value instanceof Mi)p(o.value.value.sections);else if("source"===o.value.kind){const f=b=>{h||(b instanceof Wn&&Gi(b.value)===G?p(b.value.sections):b instanceof Ko?p(b.sections):b.eachChild(f))},y=o.value;y._styleExpression&&f(y._styleExpression.expression)}return h}}let Au;var Ld={get paint(){return Au=Au||new pr({"background-color":new Ot(Y.paint_background["background-color"]),"background-pattern":new Fa(Y.paint_background["background-pattern"]),"background-opacity":new Ot(Y.paint_background["background-opacity"])})}};class Od extends jn{constructor(e){super(e,Ld)}}let ku;var zd={get paint(){return ku=ku||new pr({"raster-opacity":new Ot(Y.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ot(Y.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ot(Y.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ot(Y.paint_raster["raster-brightness-max"]),"raster-saturation":new Ot(Y.paint_raster["raster-saturation"]),"raster-contrast":new Ot(Y.paint_raster["raster-contrast"]),"raster-resampling":new Ot(Y.paint_raster["raster-resampling"]),"raster-fade-duration":new Ot(Y.paint_raster["raster-fade-duration"])})}};class Rd extends jn{constructor(e){super(e,zd)}}class Fd extends jn{constructor(e){super(e,{}),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=e}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class Bd{constructor(e){this._callback=e,this._triggered=!1,typeof MessageChannel<"u"&&(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 mc=6371008.8;class Gs{constructor(e,r){if(isNaN(e)||isNaN(r))throw new Error(`Invalid LngLat object: (${e}, ${r})`);if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Gs(De(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const r=Math.PI/180,o=this.lat*r,a=e.lat*r,h=Math.sin(o)*Math.sin(a)+Math.cos(o)*Math.cos(a)*Math.cos((e.lng-this.lng)*r);return mc*Math.acos(Math.min(h,1))}static convert(e){if(e instanceof Gs)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new Gs(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return new Gs(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}const Du=2*Math.PI*mc;function Lu(i){return Du*Math.cos(i*Math.PI/180)}function Ou(i){return(180+i)/360}function zu(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function Ru(i,e){return i/Lu(e)}function Fu(i){return 360*i-180}function fc(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180))-90}class Al{constructor(e,r,o=0){this.x=+e,this.y=+r,this.z=+o}static fromLngLat(e,r=0){const o=Gs.convert(e);return new Al(Ou(o.lng),zu(o.lat),Ru(r,o.lat))}toLngLat(){return new Gs(Fu(this.x),fc(this.y))}toAltitude(){return this.z*Lu(fc(this.y))}meterInMercatorCoordinateUnits(){return 1/Du*(e=fc(this.y),1/Math.cos(e*Math.PI/180));var e}}function Bu(i,e,r){var o=2*Math.PI*6378137/256/Math.pow(2,r);return[i*o-2*Math.PI*6378137/2,e*o-2*Math.PI*6378137/2]}class gc{constructor(e,r,o){if(e<0||e>25||o<0||o>=Math.pow(2,e)||r<0||r>=Math.pow(2,e))throw new Error(`x=${r}, y=${o}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} 0<=z<=25 `);this.z=e,this.x=r,this.y=o,this.key=ol(0,e,e,r,o)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,r,o){const a=(p=this.y,f=this.z,y=Bu(256*(h=this.x),256*(p=Math.pow(2,f)-p-1),f),b=Bu(256*(h+1),256*(p+1),f),y[0]+","+y[1]+","+b[0]+","+b[1]);var h,p,f,y,b;const M=function(T,A,O){let R,N="";for(let q=T;q>0;q--)R=1<<q-1,N+=(A&R?1:0)+(O&R?2:0);return N}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(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"===o?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,r>1?"@2x":"").replace(/{quadkey}/g,M).replace(/{bbox-epsg-3857}/g,a)}isChildOf(e){const r=this.z-e.z;return r>0&&e.x===this.x>>r&&e.y===this.y>>r}getTilePoint(e){const r=Math.pow(2,this.z);return new Ce((e.x*r-this.x)*br,(e.y*r-this.y)*br)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Nu{constructor(e,r){this.wrap=e,this.canonical=r,this.key=ol(e,r.z,r.z,r.x,r.y)}}class Qn{constructor(e,r,o,a,h){if(e<o)throw new Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${o}`);this.overscaledZ=e,this.wrap=r,this.canonical=new gc(o,+a,+h),this.key=ol(r,e,o,a,h)}clone(){return new Qn(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const r=this.canonical.z-e;return e>this.canonical.z?new Qn(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Qn(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(e,r){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const o=this.canonical.z-e;return e>this.canonical.z?ol(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):ol(this.wrap*+r,e,e,this.canonical.x>>o,this.canonical.y>>o)}isChildOf(e){if(e.wrap!==this.wrap)return!1;const r=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new Qn(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const r=this.canonical.z+1,o=2*this.canonical.x,a=2*this.canonical.y;return[new Qn(r,this.wrap,r,o,a),new Qn(r,this.wrap,r,o+1,a),new Qn(r,this.wrap,r,o,a+1),new Qn(r,this.wrap,r,o+1,a+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new Qn(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new Qn(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Nu(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new Al(e.x-this.wrap,e.y))}}function ol(i,e,r,o,a){(i*=2)<0&&(i=-1*i-1);const h=1<<r;return(h*h*i+h*a+o).toString(36)+r.toString(36)+e.toString(36)}mt("CanonicalTileID",gc),mt("OverscaledTileID",Qn,{omit:["posMatrix"]});class Uu{constructor(e,r,o,a=1,h=1,p=1,f=0){if(this.uid=e,r.height!==r.width)throw new RangeError("DEM tiles must be square");if(o&&!["mapbox","terrarium","custom"].includes(o))return void ze(`"${o}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=r.height;const y=this.dim=r.height-2;switch(this.data=new Uint32Array(r.data.buffer),o){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=a,this.greenFactor=h,this.blueFactor=p,this.baseShift=f;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let b=0;b<y;b++)this.data[this._idx(-1,b)]=this.data[this._idx(0,b)],this.data[this._idx(y,b)]=this.data[this._idx(y-1,b)],this.data[this._idx(b,-1)]=this.data[this._idx(b,0)],this.data[this._idx(b,y)]=this.data[this._idx(b,y-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(y,-1)]=this.data[this._idx(y-1,0)],this.data[this._idx(-1,y)]=this.data[this._idx(0,y-1)],this.data[this._idx(y,y)]=this.data[this._idx(y-1,y-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let b=0;b<y;b++)for(let M=0;M<y;M++){const T=this.get(b,M);T>this.max&&(this.max=T),T<this.min&&(this.min=T)}}get(e,r){const o=new Uint8Array(this.data.buffer),a=4*this._idx(e,r);return this.unpack(o[a],o[a+1],o[a+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,r){if(e<-1||e>=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(e+1)}unpack(e,r,o){return e*this.redFactor+r*this.greenFactor+o*this.blueFactor-this.baseShift}getPixels(){return new Yn({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,r,o){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let a=r*this.dim,h=r*this.dim+this.dim,p=o*this.dim,f=o*this.dim+this.dim;switch(r){case-1:a=h-1;break;case 1:h=a+1}switch(o){case-1:p=f-1;break;case 1:f=p+1}const y=-r*this.dim,b=-o*this.dim;for(let M=p;M<f;M++)for(let T=a;T<h;T++)this.data[this._idx(T,M)]=e.data[this._idx(T+y,M+b)]}}mt("DEMData",Uu);class Vu{constructor(e){this._stringToNumber={},this._numberToString=[];for(let r=0;r<e.length;r++){const o=e[r];this._stringToNumber[o]=r,this._numberToString[r]=o}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}class Gu{constructor(e,r,o,a,h){this.type="Feature",this._vectorTileFeature=e,e._z=r,e._x=o,e._y=a,this.properties=e.properties,this.id=h}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(e){this._geometry=e}toJSON(){const e={geometry:this.geometry};for(const r in this)"_geometry"!==r&&"_vectorTileFeature"!==r&&(e[r]=this[r]);return e}}class ju{constructor(e,r){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new co(br,16,0),this.grid3D=new co(br,16,0),this.featureIndexArray=new Ge,this.promoteId=r}insert(e,r,o,a,h,p){const f=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(o,a,h);const y=p?this.grid3D:this.grid;for(let b=0;b<r.length;b++){const M=r[b],T=[1/0,1/0,-1/0,-1/0];for(let A=0;A<M.length;A++){const O=M[A];T[0]=Math.min(T[0],O.x),T[1]=Math.min(T[1],O.y),T[2]=Math.max(T[2],O.x),T[3]=Math.max(T[3],O.y)}T[0]<br&&T[1]<br&&T[2]>=0&&T[3]>=0&&y.insert(f,T[0],T[1],T[2],T[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Ns.VectorTile(new nc(this.rawTileData)).layers,this.sourceLayerCoder=new Vu(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,r,o,a){this.loadVTLayers();const h=e.params||{},p=br/e.tileSize/e.scale,f=Ts(h.filter),y=e.queryGeometry,b=e.queryPadding*p,M=Zu(y),T=this.grid.query(M.minX-b,M.minY-b,M.maxX+b,M.maxY+b),A=Zu(e.cameraQueryGeometry),O=this.grid3D.query(A.minX-b,A.minY-b,A.maxX+b,A.maxY+b,(q,H,le,te)=>function(he,ye,Fe,vt,Tt){for(const pt of he)if(ye<=pt.x&&Fe<=pt.y&&vt>=pt.x&&Tt>=pt.y)return!0;const yt=[new Ce(ye,Fe),new Ce(ye,Tt),new Ce(vt,Tt),new Ce(vt,Fe)];if(he.length>2)for(const pt of yt)if(ya(he,pt))return!0;for(let pt=0;pt<he.length-1;pt++)if(gh(he[pt],he[pt+1],yt))return!0;return!1}(e.cameraQueryGeometry,q-b,H-b,le+b,te+b));for(const q of O)T.push(q);T.sort(Nd);const R={};let N;for(let q=0;q<T.length;q++){const H=T[q];if(H===N)continue;N=H;const le=this.featureIndexArray.get(H);let te=null;this.loadMatchingFeature(R,le.bucketIndex,le.sourceLayerIndex,le.featureIndex,f,h.layers,h.availableImages,r,o,a,(he,ye,Fe)=>(te||(te=ra(he)),ye.queryIntersectsFeature(y,he,Fe,te,this.z,e.transform,p,e.pixelPosMatrix)))}return R}loadMatchingFeature(e,r,o,a,h,p,f,y,b,M,T){const A=this.bucketLayerIDs[r];if(p&&!function(q,H){for(let le=0;le<q.length;le++)if(H.indexOf(q[le])>=0)return!0;return!1}(p,A))return;const O=this.sourceLayerCoder.decode(o),R=this.vtLayers[O].feature(a);if(h.needGeometry){const q=na(R,!0);if(!h.filter(new Ki(this.tileID.overscaledZ),q,this.tileID.canonical))return}else if(!h.filter(new Ki(this.tileID.overscaledZ),R))return;const N=this.getId(R,O);for(let q=0;q<A.length;q++){const H=A[q];if(p&&p.indexOf(H)<0)continue;const le=y[H];if(!le)continue;let te={};N&&M&&(te=M.getState(le.sourceLayer||"_geojsonTileLayer",N));const he=Ae({},b[H]);he.paint=$u(he.paint,le.paint,R,te,f),he.layout=$u(he.layout,le.layout,R,te,f);const ye=!T||T(R,le,te);if(!ye)continue;const Fe=new Gu(R,this.z,this.x,this.y,N);Fe.layer=he;let vt=e[H];void 0===vt&&(vt=e[H]=[]),vt.push({featureIndex:a,feature:Fe,intersectionZ:ye})}}lookupSymbolFeatures(e,r,o,a,h,p,f,y){const b={};this.loadVTLayers();const M=Ts(h);for(const T of e)this.loadMatchingFeature(b,o,a,T,M,p,f,y,r);return b}hasLayer(e){for(const r of this.bucketLayerIDs)for(const o of r)if(e===o)return!0;return!1}getId(e,r){let o=e.id;return this.promoteId&&(o=e.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[r]],"boolean"==typeof o&&(o=Number(o))),o}}function $u(i,e,r,o,a){return Ve(i,(h,p)=>{const f=e instanceof ga?e.get(p):null;return f&&f.evaluate?f.evaluate(r,o,a):f})}function Zu(i){let e=1/0,r=1/0,o=-1/0,a=-1/0;for(const h of i)e=Math.min(e,h.x),r=Math.min(r,h.y),o=Math.max(o,h.x),a=Math.max(a,h.y);return{minX:e,minY:r,maxX:o,maxY:a}}function Nd(i,e){return e-i}function Wu(i,e,r,o,a){const h=[];for(let p=0;p<i.length;p++){const f=i[p];let y;for(let b=0;b<f.length-1;b++){let M=f[b],T=f[b+1];M.x<e&&T.x<e||(M.x<e?M=new Ce(e,M.y+(e-M.x)/(T.x-M.x)*(T.y-M.y))._round():T.x<e&&(T=new Ce(e,M.y+(e-M.x)/(T.x-M.x)*(T.y-M.y))._round()),M.y<r&&T.y<r||(M.y<r?M=new Ce(M.x+(r-M.y)/(T.y-M.y)*(T.x-M.x),r)._round():T.y<r&&(T=new Ce(M.x+(r-M.y)/(T.y-M.y)*(T.x-M.x),r)._round()),M.x>=o&&T.x>=o||(M.x>=o?M=new Ce(o,M.y+(o-M.x)/(T.x-M.x)*(T.y-M.y))._round():T.x>=o&&(T=new Ce(o,M.y+(o-M.x)/(T.x-M.x)*(T.y-M.y))._round()),M.y>=a&&T.y>=a||(M.y>=a?M=new Ce(M.x+(a-M.y)/(T.y-M.y)*(T.x-M.x),a)._round():T.y>=a&&(T=new Ce(M.x+(a-M.y)/(T.y-M.y)*(T.x-M.x),a)._round()),y&&M.equals(y[y.length-1])||(y=[M],h.push(y)),y.push(T)))))}}return h}mt("FeatureIndex",ju,{omit:["rawTileData","sourceLayerCoder"]});class js extends Ce{constructor(e,r,o,a){super(e,r),this.angle=o,void 0!==a&&(this.segment=a)}clone(){return new js(this.x,this.y,this.angle,this.segment)}}function qu(i,e,r,o,a){if(void 0===e.segment||0===r)return!0;let h=e,p=e.segment+1,f=0;for(;f>-r/2;){if(p--,p<0)return!1;f-=i[p].dist(h),h=i[p]}f+=i[p].dist(i[p+1]),p++;const y=[];let b=0;for(;f<r/2;){const M=i[p],T=i[p+1];if(!T)return!1;let A=i[p-1].angleTo(M)-M.angleTo(T);for(A=Math.abs((A+3*Math.PI)%(2*Math.PI)-Math.PI),y.push({distance:f,angleDelta:A}),b+=A;f-y[0].distance>o;)b-=y.shift().angleDelta;if(b>a)return!1;p++,f+=M.dist(T)}return!0}function Ku(i){let e=0;for(let r=0;r<i.length-1;r++)e+=i[r].dist(i[r+1]);return e}function Xu(i,e,r){return i?.6*e*r:0}function Ju(i,e){return Math.max(i?i.right-i.left:0,e?e.right-e.left:0)}function Ud(i,e,r,o,a,h){const p=Xu(r,a,h),f=Ju(r,o)*h;let y=0;const b=Ku(i)/2;for(let M=0;M<i.length-1;M++){const T=i[M],A=i[M+1],O=T.dist(A);if(y+O>b){const R=(b-y)/O,N=$r.number(T.x,A.x,R),q=$r.number(T.y,A.y,R),H=new js(N,q,A.angleTo(T),M);
1return H._round(),!p||qu(i,H,f,p,e)?H:void 0}y+=O}}function Vd(i,e,r,o,a,h,p,f,y){const b=Xu(o,h,p),M=Ju(o,a),T=M*p,A=0===i[0].x||i[0].x===y||0===i[0].y||i[0].y===y;return e-T<e/4&&(e=T+e/4),Hu(i,A?e/2*f%e:(M/2+2*h)*p*f%e,e,b,r,T,A,!1,y)}function Hu(i,e,r,o,a,h,p,f,y){const b=h/2,M=Ku(i);let T=0,A=e-r,O=[];for(let R=0;R<i.length-1;R++){const N=i[R],q=i[R+1],H=N.dist(q),le=q.angleTo(N);for(;A+r<T+H;){A+=r;const te=(A-T)/H,he=$r.number(N.x,q.x,te),ye=$r.number(N.y,q.y,te);if(he>=0&&he<y&&ye>=0&&ye<y&&A-b>=0&&A+b<=M){const Fe=new js(he,ye,le,R);Fe._round(),o&&!qu(i,Fe,h,o,a)||O.push(Fe)}}T+=H}return f||O.length||p||(O=Hu(i,T/2,r,o,a,h,p,!0,y)),O}mt("Anchor",js);const Ia=Dn;function Yu(i,e,r,o){const a=[],h=i.image,p=h.pixelRatio,f=h.paddedRect.w-2*Ia,y=h.paddedRect.h-2*Ia,b=i.right-i.left,M=i.bottom-i.top,T=h.stretchX||[[0,f]],A=h.stretchY||[[0,y]],O=(ot,Mt)=>ot+Mt[1]-Mt[0],R=T.reduce(O,0),N=A.reduce(O,0),q=f-R,H=y-N;let le=0,te=R,he=0,ye=N,Fe=0,vt=q,Tt=0,yt=H;if(h.content&&o){const ot=h.content;le=kl(T,0,ot[0]),he=kl(A,0,ot[1]),te=kl(T,ot[0],ot[2]),ye=kl(A,ot[1],ot[3]),Fe=ot[0]-le,Tt=ot[1]-he,vt=ot[2]-ot[0]-te,yt=ot[3]-ot[1]-ye}const pt=(ot,Mt,at,Je)=>{const Nt=Dl(ot.stretch-le,te,b,i.left),Dt=Ll(ot.fixed-Fe,vt,ot.stretch,R),ui=Dl(Mt.stretch-he,ye,M,i.top),Ji=Ll(Mt.fixed-Tt,yt,Mt.stretch,N),er=Dl(at.stretch-le,te,b,i.left),Lr=Ll(at.fixed-Fe,vt,at.stretch,R),Zn=Dl(Je.stretch-he,ye,M,i.top),bn=Ll(Je.fixed-Tt,yt,Je.stretch,N),wr=new Ce(Nt,ui),Kr=new Ce(er,ui),nn=new Ce(er,Zn),wn=new Ce(Nt,Zn),Cn=new Ce(Dt/p,Ji/p),Or=new Ce(Lr/p,bn/p),zr=e*Math.PI/180;if(zr){const dn=Math.sin(zr),Ln=Math.cos(zr),On=[Ln,-dn,dn,Ln];wr._matMult(On),Kr._matMult(On),wn._matMult(On),nn._matMult(On)}const hn=ot.stretch+ot.fixed,Sn=Mt.stretch+Mt.fixed;return{tl:wr,tr:Kr,bl:wn,br:nn,tex:{x:h.paddedRect.x+Ia+hn,y:h.paddedRect.y+Ia+Sn,w:at.stretch+at.fixed-hn,h:Je.stretch+Je.fixed-Sn},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Cn,pixelOffsetBR:Or,minFontScaleX:vt/p/b,minFontScaleY:yt/p/M,isSDF:r}};if(o&&(h.stretchX||h.stretchY)){const ot=Qu(T,q,R),Mt=Qu(A,H,N);for(let at=0;at<ot.length-1;at++){const Je=ot[at],Nt=ot[at+1];for(let Dt=0;Dt<Mt.length-1;Dt++)a.push(pt(Je,Mt[Dt],Nt,Mt[Dt+1]))}}else a.push(pt({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:f+1},{fixed:0,stretch:y+1}));return a}function kl(i,e,r){let o=0;for(const a of i)o+=Math.max(e,Math.min(r,a[1]))-Math.max(e,Math.min(r,a[0]));return o}function Qu(i,e,r){const o=[{fixed:-Ia,stretch:0}];for(const[a,h]of i){const p=o[o.length-1];o.push({fixed:a-p.stretch,stretch:p.stretch}),o.push({fixed:a-p.stretch,stretch:p.stretch+(h-a)})}return o.push({fixed:e+Ia,stretch:r}),o}function Dl(i,e,r,o){return i/e*r+o}function Ll(i,e,r,o){return i-e*r/o}class Ol{constructor(e,r,o,a,h,p,f,y,b,M){if(this.boxStartIndex=e.length,b){let T=p.top,A=p.bottom;const O=p.collisionPadding;O&&(T-=O[1],A+=O[3]);let R=A-T;R>0&&(R=Math.max(10,R),this.circleDiameter=R)}else{let T=p.top*f-y[0],A=p.bottom*f+y[2],O=p.left*f-y[3],R=p.right*f+y[1];const N=p.collisionPadding;if(N&&(O-=N[0]*f,T-=N[1]*f,R+=N[2]*f,A+=N[3]*f),M){const q=new Ce(O,T),H=new Ce(R,T),le=new Ce(O,A),te=new Ce(R,A),he=M*Math.PI/180;q._rotate(he),H._rotate(he),le._rotate(he),te._rotate(he),O=Math.min(q.x,H.x,le.x,te.x),R=Math.max(q.x,H.x,le.x,te.x),T=Math.min(q.y,H.y,le.y,te.y),A=Math.max(q.y,H.y,le.y,te.y)}e.emplaceBack(r.x,r.y,O,T,R,A,o,a,h)}this.boxEndIndex=e.length}}class Gd{constructor(e=[],r=jd){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let o=(this.length>>1)-1;o>=0;o--)this._down(o)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const e=this.data[0],r=this.data.pop();return this.length--,this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:r,compare:o}=this,a=r[e];for(;e>0;){const h=e-1>>1,p=r[h];if(o(a,p)>=0)break;r[e]=p,e=h}r[e]=a}_down(e){const{data:r,compare:o}=this,a=this.length>>1,h=r[e];for(;e<a;){let p=1+(e<<1),f=r[p];const y=p+1;if(y<this.length&&o(r[y],f)<0&&(p=y,f=r[y]),o(f,h)>=0)break;r[e]=f,e=p}r[e]=h}}
vendor: 11,504 bytes, line 1
1function jd(i,e){return i<e?-1:i>e?1:0}function $d(i,e=1,r=!1){let o=1/0,a=1/0,h=-1/0,p=-1/0;const f=i[0];for(let O=0;O<f.length;O++){const R=f[O];(!O||R.x<o)&&(o=R.x),(!O||R.y<a)&&(a=R.y),(!O||R.x>h)&&(h=R.x),(!O||R.y>p)&&(p=R.y)}const y=Math.min(h-o,p-a);let b=y/2;const M=new Gd([],Zd);if(0===y)return new Ce(o,a);for(let O=o;O<h;O+=y)for(let R=a;R<p;R+=y)M.push(new Ea(O+b,R+b,b,i));let T=function(O){let R=0,N=0,q=0;const H=O[0];for(let le=0,te=H.length,he=te-1;le<te;he=le++){const ye=H[le],Fe=H[he],vt=ye.x*Fe.y-Fe.x*ye.y;N+=(ye.x+Fe.x)*vt,q+=(ye.y+Fe.y)*vt,R+=3*vt}return new Ea(N/R,q/R,0,O)}(i),A=M.length;for(;M.length;){const O=M.pop();(O.d>T.d||!T.d)&&(T=O,r&&console.log("found best %d after %d probes",Math.round(1e4*O.d)/1e4,A)),O.max-T.d<=e||(b=O.h/2,M.push(new Ea(O.p.x-b,O.p.y-b,b,i)),M.push(new Ea(O.p.x+b,O.p.y-b,b,i)),M.push(new Ea(O.p.x-b,O.p.y+b,b,i)),M.push(new Ea(O.p.x+b,O.p.y+b,b,i)),A+=4)}return r&&(console.log(`num probes: ${A}`),console.log(`best distance: ${T.d}`)),T.p}function Zd(i,e){return e.max-i.max}function Ea(i,e,r,o){this.p=new Ce(i,e),this.h=r,this.d=function(a,h){let p=!1,f=1/0;for(let y=0;y<h.length;y++){const b=h[y];for(let M=0,T=b.length,A=T-1;M<T;A=M++){const O=b[M],R=b[A];O.y>a.y!=R.y>a.y&&a.x<(R.x-O.x)*(a.y-O.y)/(R.y-O.y)+O.x&&(p=!p),f=Math.min(f,zc(a,O,R))}}return(p?1:-1)*Math.sqrt(f)}(this.p,o),this.max=this.d+this.h*Math.SQRT2}var rn;c.aq=void 0,(rn=c.aq||(c.aq={}))[rn.center=1]="center",rn[rn.left=2]="left",rn[rn.right=3]="right",rn[rn.top=4]="top",rn[rn.bottom=5]="bottom",rn[rn["top-left"]=6]="top-left",rn[rn["top-right"]=7]="top-right",rn[rn["bottom-left"]=8]="bottom-left",rn[rn["bottom-right"]=9]="bottom-right";const $s=7,_c=Number.POSITIVE_INFINITY;function eh(i,e){return e[1]!==_c?function(r,o,a){let h=0,p=0;switch(o=Math.abs(o),a=Math.abs(a),r){case"top-right":case"top-left":case"top":p=a-$s;break;case"bottom-right":case"bottom-left":case"bottom":p=-a+$s}switch(r){case"top-right":case"bottom-right":case"right":h=-o;break;case"top-left":case"bottom-left":case"left":h=o}return[h,p]}(i,e[0],e[1]):function(r,o){let a=0,h=0;o<0&&(o=0);const p=o/Math.SQRT2;switch(r){case"top-right":case"top-left":h=p-$s;break;case"bottom-right":case"bottom-left":h=-p+$s;break;case"bottom":h=-o+$s;break;case"top":h=o-$s}switch(r){case"top-right":case"bottom-right":a=-p;break;case"top-left":case"bottom-left":a=p;break;case"left":a=o;break;case"right":a=-o}return[a,h]}(i,e[0])}function th(i,e,r){var o;const a=i.layout,h=null===(o=a.get("text-variable-anchor-offset"))||void 0===o?void 0:o.evaluate(e,{},r);if(h){const f=h.values,y=[];for(let b=0;b<f.length;b+=2){const M=y[b]=f[b],T=f[b+1].map(A=>A*Dr);M.startsWith("top")?T[1]-=$s:M.startsWith("bottom")&&(T[1]+=$s),y[b+1]=T}return new vr(y)}const p=a.get("text-variable-anchor");if(p){let f;f=void 0!==i._unevaluatedLayout.getValue("text-radial-offset")?[a.get("text-radial-offset").evaluate(e,{},r)*Dr,_c]:a.get("text-offset").evaluate(e,{},r).map(b=>b*Dr);const y=[];for(const b of p)y.push(b,eh(b,f));return new vr(y)}return null}function yc(i){switch(i){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Wd(i,e,r,o,a,h,p,f,y,b,M){let T=h.textMaxSize.evaluate(e,{});void 0===T&&(T=p);const A=i.layers[0].layout,O=A.get("icon-offset").evaluate(e,{},M),R=rh(r.horizontal),N=p/24,q=i.tilePixelRatio*N,H=i.tilePixelRatio*T/24,le=i.tilePixelRatio*f,te=i.tilePixelRatio*A.get("symbol-spacing"),he=A.get("text-padding")*i.tilePixelRatio,ye=function(Je,Nt,Dt,ui=1){const Ji=Je.get("icon-padding").evaluate(Nt,{},Dt),er=Ji&&Ji.values;return[er[0]*ui,er[1]*ui,er[2]*ui,er[3]*ui]}(A,e,M,i.tilePixelRatio),Fe=A.get("text-max-angle")/180*Math.PI,vt="viewport"!==A.get("text-rotation-alignment")&&"point"!==A.get("symbol-placement"),Tt="map"===A.get("icon-rotation-alignment")&&"point"!==A.get("symbol-placement"),yt=A.get("symbol-placement"),pt=te/2,ot=A.get("icon-text-fit");let Mt;o&&"none"!==ot&&(i.allowVerticalPlacement&&r.vertical&&(Mt=Mu(o,r.vertical,ot,A.get("icon-text-fit-padding"),O,N)),R&&(o=Mu(o,R,ot,A.get("icon-text-fit-padding"),O,N)));const at=(Je,Nt)=>{Nt.x<0||Nt.x>=br||Nt.y<0||Nt.y>=br||function(Dt,ui,Ji,er,Lr,Zn,bn,wr,Kr,nn,wn,Cn,Or,zr,hn,Sn,dn,Ln,On,Rr,vi,pn,on,Fr,go){const Mo=Dt.addToLineVertexArray(ui,Ji);let Io,us,_o,eo,zn=0,hs=0,ll=0,ah=0,Ic=-1,Ec=-1;const ds={};let lh=ss("");if(Dt.allowVerticalPlacement&&er.vertical){const mn=wr.layout.get("text-rotate").evaluate(vi,{},Fr)+90;_o=new Ol(Kr,ui,nn,wn,Cn,er.vertical,Or,zr,hn,mn),bn&&(eo=new Ol(Kr,ui,nn,wn,Cn,bn,dn,Ln,hn,mn))}if(Lr){const mn=wr.layout.get("icon-rotate").evaluate(vi,{}),to="none"!==wr.layout.get("icon-text-fit"),sa=Yu(Lr,mn,on,to),To=bn?Yu(bn,mn,on,to):void 0;us=new Ol(Kr,ui,nn,wn,Cn,Lr,dn,Ln,!1,mn),zn=4*sa.length;const aa=Dt.iconSizeData;let Go=null;"source"===aa.kind?(Go=[Vo*wr.layout.get("icon-size").evaluate(vi,{})],Go[0]>Vs&&ze(`${Dt.layerIds[0]}: Value for "icon-size" is >= ${nl}. Reduce your "icon-size".`)):"composite"===aa.kind&&(Go=[Vo*pn.compositeIconSizes[0].evaluate(vi,{},Fr),Vo*pn.compositeIconSizes[1].evaluate(vi,{},Fr)],(Go[0]>Vs||Go[1]>Vs)&&ze(`${Dt.layerIds[0]}: Value for "icon-size" is >= ${nl}. Reduce your "icon-size".`)),Dt.addSymbols(Dt.icon,sa,Go,Rr,On,vi,c.ai.none,ui,Mo.lineStartIndex,Mo.lineLength,-1,Fr),Ic=Dt.icon.placedSymbolArray.length-1,To&&(hs=4*To.length,Dt.addSymbols(Dt.icon,To,Go,Rr,On,vi,c.ai.vertical,ui,Mo.lineStartIndex,Mo.lineLength,-1,Fr),Ec=Dt.icon.placedSymbolArray.length-1)}const ch=Object.keys(er.horizontal);for(const mn of ch){const to=er.horizontal[mn];if(!Io){lh=ss(to.text);const To=wr.layout.get("text-rotate").evaluate(vi,{},Fr);Io=new Ol(Kr,ui,nn,wn,Cn,to,Or,zr,hn,To)}const sa=1===to.positionedLines.length;if(ll+=ih(Dt,ui,to,Zn,wr,hn,vi,Sn,Mo,er.vertical?c.ai.horizontal:c.ai.horizontalOnly,sa?ch:[mn],ds,Ic,pn,Fr),sa)break}er.vertical&&(ah+=ih(Dt,ui,er.vertical,Zn,wr,hn,vi,Sn,Mo,c.ai.vertical,["vertical"],ds,Ec,pn,Fr));const Xd=Io?Io.boxStartIndex:Dt.collisionBoxArray.length,Jd=Io?Io.boxEndIndex:Dt.collisionBoxArray.length,Hd=_o?_o.boxStartIndex:Dt.collisionBoxArray.length,Yd=_o?_o.boxEndIndex:Dt.collisionBoxArray.length,Qd=us?us.boxStartIndex:Dt.collisionBoxArray.length,ep=us?us.boxEndIndex:Dt.collisionBoxArray.length,tp=eo?eo.boxStartIndex:Dt.collisionBoxArray.length,ip=eo?eo.boxEndIndex:Dt.collisionBoxArray.length;let Eo=-1;const Rl=(mn,to)=>mn&&mn.circleDiameter?Math.max(mn.circleDiameter,to):to;Eo=Rl(Io,Eo),Eo=Rl(_o,Eo),Eo=Rl(us,Eo),Eo=Rl(eo,Eo);const uh=Eo>-1?1:0;uh&&(Eo*=go/Dr),Dt.glyphOffsetArray.length>=Ma.MAX_GLYPHS&&ze("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==vi.sortKey&&Dt.addToSortKeyRanges(Dt.symbolInstances.length,vi.sortKey);const rp=th(wr,vi,Fr),[np,op]=function(mn,to){const sa=mn.length,To=to?.values;if(To?.length>0)for(let aa=0;aa<To.length;aa+=2){const Go=To[aa+1];mn.emplaceBack(c.aq[To[aa]],Go[0],Go[1])}return[sa,mn.length]}(Dt.textAnchorOffsets,rp);Dt.symbolInstances.emplaceBack(ui.x,ui.y,ds.right>=0?ds.right:-1,ds.center>=0?ds.center:-1,ds.left>=0?ds.left:-1,ds.vertical||-1,Ic,Ec,lh,Xd,Jd,Hd,Yd,Qd,ep,tp,ip,nn,ll,ah,zn,hs,uh,0,Or,Eo,np,op)}(i,Nt,Je,r,o,a,Mt,i.layers[0],i.collisionBoxArray,e.index,e.sourceLayerIndex,i.index,q,[he,he,he,he],vt,y,le,ye,Tt,O,e,h,b,M,p)};if("line"===yt)for(const Je of Wu(e.geometry,0,0,br,br)){const Nt=Vd(Je,te,Fe,r.vertical||R,o,24,H,i.overscaling,br);for(const Dt of Nt)R&&qd(i,R.text,pt,Dt)||at(Je,Dt)}else if("line-center"===yt){for(const Je of e.geometry)if(Je.length>1){const Nt=Ud(Je,Fe,r.vertical||R,o,24,H);Nt&&at(Je,Nt)}}else if("Polygon"===e.type)for(const Je of Jl(e.geometry,0)){const Nt=$d(Je,16);at(Je[0],new js(Nt.x,Nt.y,0))}else if("LineString"===e.type)for(const Je of e.geometry)at(Je,new js(Je[0].x,Je[0].y,0));else if("Point"===e.type)for(const Je of e.geometry)for(const Nt of Je)at([Nt],new js(Nt.x,Nt.y,0))}function ih(i,e,r,o,a,h,p,f,y,b,M,T,A,O,R){const N=function(le,te,he,ye,Fe,vt,Tt,yt){const pt=ye.layout.get("text-rotate").evaluate(vt,{})*Math.PI/180,ot=[];for(const Mt of te.positionedLines)for(const at of Mt.positionedGlyphs){if(!at.rect)continue;const Je=at.rect||{};let Nt=yu+1,Dt=!0,ui=1,Ji=0;const er=(Fe||yt)&&at.vertical,Lr=at.metrics.advance*at.scale/2;if(yt&&te.verticalizable&&(Ji=Mt.lineOffset/2-(at.imageName?-(Dr-at.metrics.width*at.scale)/2:(at.scale-1)*Dr)),at.imageName){const Rr=Tt[at.imageName];Dt=Rr.sdf,ui=Rr.pixelRatio,Nt=Dn/ui}const Zn=Fe?[at.x+Lr,at.y]:[0,0];let bn=Fe?[0,0]:[at.x+Lr+he[0],at.y+he[1]-Ji],wr=[0,0];er&&(wr=bn,bn=[0,0]);const Kr=at.metrics.isDoubleResolution?2:1,nn=(at.metrics.left-Nt)*at.scale-Lr+bn[0],wn=(-at.metrics.top-Nt)*at.scale+bn[1],Cn=nn+Je.w/Kr*at.scale/ui,Or=wn+Je.h/Kr*at.scale/ui,zr=new Ce(nn,wn),hn=new Ce(Cn,wn),Sn=new Ce(nn,Or),dn=new Ce(Cn,Or);if(er){const Rr=new Ce(-Lr,Lr-il),vi=-Math.PI/2,pn=Dr/2-Lr,on=new Ce(5-il-pn,-(at.imageName?pn:0)),Fr=new Ce(...wr);zr._rotateAround(vi,Rr)._add(on)._add(Fr),hn._rotateAround(vi,Rr)._add(on)._add(Fr),Sn._rotateAround(vi,Rr)._add(on)._add(Fr),dn._rotateAround(vi,Rr)._add(on)._add(Fr)}if(pt){const Rr=Math.sin(pt),vi=Math.cos(pt),pn=[vi,-Rr,Rr,vi];zr._matMult(pn),hn._matMult(pn),Sn._matMult(pn),dn._matMult(pn)}const Ln=new Ce(0,0),On=new Ce(0,0);ot.push({tl:zr,tr:hn,bl:Sn,br:dn,tex:Je,writingMode:te.writingMode,glyphOffset:Zn,sectionIndex:at.sectionIndex,isSDF:Dt,pixelOffsetTL:Ln,pixelOffsetBR:On,minFontScaleX:0,minFontScaleY:0})}return ot}(0,r,f,a,h,p,o,i.allowVerticalPlacement),q=i.textSizeData;let H=null;"source"===q.kind?(H=[Vo*a.layout.get("text-size").evaluate(p,{})],H[0]>Vs&&ze(`${i.layerIds[0]}: Value for "text-size" is >= ${nl}. Reduce your "text-size".`)):"composite"===q.kind&&(H=[Vo*O.compositeTextSizes[0].evaluate(p,{},R),Vo*O.compositeTextSizes[1].evaluate(p,{},R)],(H[0]>Vs||H[1]>Vs)&&ze(`${i.layerIds[0]}: Value for "text-size" is >= ${nl}. Reduce your "text-size".`)),i.addSymbols(i.text,N,H,f,h,p,b,e,y.lineStartIndex,y.lineLength,A,R);for(const le of M)T[le]=i.text.placedSymbolArray.length-1;return 4*N.length}function rh(i){for(const e in i)return i[e];return null}function qd(i,e,r,o){const a=i.compareText;if(e in a){const h=a[e];for(let p=h.length-1;p>=0;p--)if(o.dist(h[p])<r)return!0}else a[e]=[];return a[e].push(o),!1}const nh=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class vc{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[r,o]=new Uint8Array(e,0,2);if(219!==r)throw new Error("Data does not appear to be in a KDBush format.");const a=o>>4;if(1!==a)throw new Error(`Got v${a} data when expected v1.`);const h=nh[15&o];if(!h)throw new Error("Unrecognized array type.");const[p]=new Uint16Array(e,2,1),[f]=new Uint32Array(e,4,1);return new vc(f,p,h,e)}constructor(e,r=64,o=Float64Array,a){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=o,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const h=nh.indexOf(this.ArrayType),p=2*e*this.ArrayType.BYTES_PER_ELEMENT,f=e*this.IndexArrayType.BYTES_PER_ELEMENT,y=(8-f%8)%8;if(h<0)throw new Error(`Unexpected typed array class: ${o}.`);a&&a instanceof ArrayBuffer?(this.data=a,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+f+y,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+p+f
1+y),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+f+y,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+h]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=e)}add(e,r){const o=this._pos>>1;return this.ids[o]=o,this.coords[this._pos++]=e,this.coords[this._pos++]=r,o}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return xc(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,o,a){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:h,coords:p,nodeSize:f}=this,y=[0,h.length-1,0],b=[];for(;y.length;){const M=y.pop()||0,T=y.pop()||0,A=y.pop()||0;if(T-A<=f){for(let q=A;q<=T;q++){const H=p[2*q],le=p[2*q+1];H>=e&&H<=o&&le>=r&&le<=a&&b.push(h[q])}continue}const O=A+T>>1,R=p[2*O],N=p[2*O+1];R>=e&&R<=o&&N>=r&&N<=a&&b.push(h[O]),(0===M?e<=R:r<=N)&&(y.push(A),y.push(O-1),y.push(1-M)),(0===M?o>=R:a>=N)&&(y.push(O+1),y.push(T),y.push(1-M))}return b}within(e,r,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:a,coords:h,nodeSize:p}=this,f=[0,a.length-1,0],y=[],b=o*o;for(;f.length;){const M=f.pop()||0,T=f.pop()||0,A=f.pop()||0;if(T-A<=p){for(let q=A;q<=T;q++)sh(h[2*q],h[2*q+1],e,r)<=b&&y.push(a[q]);continue}const O=A+T>>1,R=h[2*O],N=h[2*O+1];sh(R,N,e,r)<=b&&y.push(a[O]),(0===M?e-o<=R:r-o<=N)&&(f.push(A),f.push(O-1),f.push(1-M)),(0===M?e+o>=R:r+o>=N)&&(f.push(O+1),f.push(T),f.push(1-M))}return y}}function xc(i,e,r,o,a,h){if(a-o<=r)return;const p=o+a>>1;oh(i,e,p,o,a,h),xc(i,e,r,o,p-1,1-h),xc(i,e,r,p+1,a,1-h)}function oh(i,e,r,o,a,h){for(;a>o;){if(a-o>600){const b=a-o+1,M=r-o+1,T=Math.log(b),A=.5*Math.exp(2*T/3),O=.5*Math.sqrt(T*A*(b-A)/b)*(M-b/2<0?-1:1);oh(i,e,r,Math.max(o,Math.floor(r-M*A/b+O)),Math.min(a,Math.floor(r+(b-M)*A/b+O)),h)}const p=e[2*r+h];let f=o,y=a;for(sl(i,e,o,r),e[2*a+h]>p&&sl(i,e,o,a);f<y;){for(sl(i,e,f,y),f++,y--;e[2*f+h]<p;)f++;for(;e[2*y+h]>p;)y--}e[2*o+h]===p?sl(i,e,o,y):(y++,sl(i,e,y,a)),y<=r&&(o=y+1),r<=y&&(a=y-1)}}function sl(i,e,r,o){bc(i,r,o),bc(e,2*r,2*o),bc(e,2*r+1,2*o+1)}function bc(i,e,r){const o=i[e];i[e]=i[r],i[r]=o}function sh(i,e,r,o){const a=i-r,h=e-o;return a*a+h*h}var wc;c.bh=void 0,(wc=c.bh||(c.bh={})).create="create",wc.load="load",wc.fullLoad="fullLoad";let zl=null,al=[];const Cc=1e3/60,Sc="loadTime",Mc="fullLoadTime",Kd={mark(i){performance.mark(i)},frame(i){const e=i;null!=zl&&al.push(e-zl),zl=e},clearMetrics(){zl=null,al=[],performance.clearMeasures(Sc),performance.clearMeasures(Mc);for(const i in c.bh)performance.clearMarks(c.bh[i])},getPerformanceMetrics(){performance.measure(Sc,c.bh.create,c.bh.load),performance.measure(Mc,c.bh.create,c.bh.fullLoad);const i=performance.getEntriesByName(Sc)[0].duration,e=performance.getEntriesByName(Mc)[0].duration,r=al.length,o=1/(al.reduce((h,p)=>h+p,0)/r/1e3),a=al.filter(h=>h>Cc).reduce((h,p)=>h+(p-Cc)/Cc,0);return{loadTime:i,fullLoadTime:e,fps:o,percentDroppedFrames:a/(r+a)*100,totalFrames:r}}};c.$=function(i,e,r){var o,a,h,p,f,y,b,M,T,A,O,R,N=r[0],q=r[1],H=r[2];return e===i?(i[12]=e[0]*N+e[4]*q+e[8]*H+e[12],i[13]=e[1]*N+e[5]*q+e[9]*H+e[13],i[14]=e[2]*N+e[6]*q+e[10]*H+e[14],i[15]=e[3]*N+e[7]*q+e[11]*H+e[15]):(a=e[1],h=e[2],p=e[3],f=e[4],y=e[5],b=e[6],M=e[7],T=e[8],A=e[9],O=e[10],R=e[11],i[0]=o=e[0],i[1]=a,i[2]=h,i[3]=p,i[4]=f,i[5]=y,i[6]=b,i[7]=M,i[8]=T,i[9]=A,i[10]=O,i[11]=R,i[12]=o*N+f*q+T*H+e[12],i[13]=a*N+y*q+A*H+e[13],i[14]=h*N+b*q+O*H+e[14],i[15]=p*N+M*q+R*H+e[15]),i},c.A=va,c.B=$r,c.C=class{constructor(i,e,r){this.receive=o=>{const a=o.data,h=a.id;if(h&&(!a.targetMapId||this.mapId===a.targetMapId))if("<cancel>"===a.type){delete this.tasks[h];const p=this.cancelCallbacks[h];delete this.cancelCallbacks[h],p&&p()}else ht()||a.mustQueue?(this.tasks[h]=a,this.taskQueue.push(h),this.invoker.trigger()):this.processTask(h,a)},this.process=()=>{if(!this.taskQueue.length)return;const o=this.taskQueue.shift(),a=this.tasks[o];delete this.tasks[o],this.taskQueue.length&&this.invoker.trigger(),a&&this.processTask(o,a)},this.target=i,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},this.invoker=new Bd(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=ht()?i:window}send(i,e,r,o,a=!1){const h=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[h]=r);const p=[],f={id:h,type:i,hasCallback:!!r,targetMapId:o,mustQueue:a,sourceMapId:this.mapId,data:_n(e,p)};return this.target.postMessage(f,{transfer:p}),{cancel:()=>{r&&delete this.callbacks[h],this.target.postMessage({id:h,type:"<cancel>",targetMapId:o,sourceMapId:this.mapId})}}}processTask(i,e){if("<response>"===e.type){const r=this.callbacks[i];delete this.callbacks[i],r&&(e.error?r(Hn(e.error)):r(null,Hn(e.data)))}else{let r=!1;const o=[],a=e.hasCallback?(f,y)=>{r=!0,delete this.cancelCallbacks[i];const b={id:i,type:"<response>",sourceMapId:this.mapId,error:f?_n(f):null,data:_n(y,o)};this.target.postMessage(b,{transfer:o})}:f=>{r=!0};let h=null;const p=Hn(e.data);if(this.parent[e.type])h=this.parent[e.type](e.sourceMapId,p,a);else if("getWorkerSource"in this.parent){const f=e.type.split(".");h=this.parent.getWorkerSource(e.sourceMapId,f[0],p.source)[f[1]](p,a)}else a(new Error(`Could not find function ${e.type}`));!r&&h&&h.cancel&&(this.cancelCallbacks[i]=h.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},c.D=Ot,c.E=sn,c.F=function(i,e){const r={};for(let o=0;o<e.length;o++){const a=e[o];a in i&&(r[a]=i[a])}return r},c.G=Ou,c.H=zu,c.I=sc,c.J=zt,c.K=Rt,c.L=Gs,c.M=Ut,c.N=br,c.O=Qn,c.P=Ce,c.Q=ir,c.R=Yn,c.S=Xi,c.T=ul,c.U=Al,c.V=class extends ns{},c.W=gc,c.X=function(i,e){const r=window.document.createElement("video");r.muted=!0,r.onloadstart=function(){e(null,r)};for(let o=0;o<i.length;o++){const a=window.document.createElement("source");tr(i[o])||(r.crossOrigin="Anonymous"),a.src=i[o],r.appendChild(a)}return{cancel:()=>{}}},c.Y=tt,c.Z=function(){var i=new va(16);return va!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0),i[0]=1,i[5]=1,i[10]=1,i[15]=1,i},c._=Q,c.a=We,c.a$=class extends D{},c.a0=function(i,e,r){var o=r[0],a=r[1],h=r[2];return i[0]=e[0]*o,i[1]=e[1]*o,i[2]=e[2]*o,i[3]=e[3]*o,i[4]=e[4]*a,i[5]=e[5]*a,i[6]=e[6]*a,i[7]=e[7]*a,i[8]=e[8]*h,i[9]=e[9]*h,i[10]=e[10]*h,i[11]=e[11]*h,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},c.a1=Nc,c.a2=function(){return Me++},c.a3=$,c.a4=Ma,c.a5=function(){An.isLoading()||An.isLoaded()||"deferred"!==za()||cl()},c.a6=Ts,c.a7=na,c.a8=Ki,c.a9=Gu,c.aA=Ys,c.aB=function(i){i=i.slice();const e=Object.create(null);for(let r=0;r<i.length;r++)e[i[r].id]=i[r];for(let r=0;r<i.length;r++)"ref"in i[r]&&(i[r]=w(i[r],e[i[r].ref]));return i},c.aC=function(i){if("custom"===i.type)return new Fd(i);switch(i.type){case"background":return new Od(i);case"circle":return new vh(i);case"fill":return new Nh(i);case"fill-extrusion":return new ed(i);case"heatmap":return new bh(i);case"hillshade":return new Ch(i);case"line":return new ld(i);case"raster":return new Rd(i);case"symbol":return new Pl(i)}},c.aD=Ie,c.aE=function(i,e){if(!i)return[{command:Ee.setStyle,args:[e]}];let r=[];try{if(!z(i.version,e.version))return[{command:Ee.setStyle,args:[e]}];z(i.center,e.center)||r.push({command:Ee.setCenter,args:[e.center]}),z(i.zoom,e.zoom)||r.push({command:Ee.setZoom,args:[e.zoom]}),z(i.bearing,e.bearing)||r.push({command:Ee.setBearing,args:[e.bearing]}),z(i.pitch,e.pitch)||r.push({command:Ee.setPitch,args:[e.pitch]}),z(i.sprite,e.sprite)||r.push({command:Ee.setSprite,args:[e.sprite]}),z(i.glyphs,e.glyphs)||r.push({command:Ee.setGlyphs,args:[e.glyphs]}),z(i.transition,e.transition)||r.push({command:Ee.setTransition,args:[e.transition]}),z(i.light,e.light)||r.push({command:Ee.setLight,args:[e.light]});const o={},a=[];!function(p,f,y,b){let M;for(M in f=f||{},p=p||{})Object.prototype.hasOwnProperty.call(p,M)&&(Object.prototype.hasOwnProperty.call(f,M)||oi(M,y,b));for(M in f)Object.prototype.hasOwnProperty.call(f,M)&&(Object.prototype.hasOwnProperty.call(p,M)?z(p[M],f[M])||("geojson"===p[M].type&&"geojson"===f[M].type&&ki(p,f,M)?y.push({command:Ee.setGeoJSONSourceData,args:[M,f[M].data]}):mi(M,f,y,b)):ft(M,f,y))}(i.sources,e.sources,a,o);const h=[];
1i.layers&&i.layers.forEach(p=>{o[p.source]?r.push({command:Ee.removeLayer,args:[p.id]}):h.push(p)}),r=r.concat(a),function(p,f,y){f=f||[];const b=(p=p||[]).map(yr),M=f.map(yr),T=p.reduce(Ir,{}),A=f.reduce(Ir,{}),O=b.slice(),R=Object.create(null);let N,q,H,le,te,he,ye;for(N=0,q=0;N<b.length;N++)H=b[N],Object.prototype.hasOwnProperty.call(A,H)?q++:(y.push({command:Ee.removeLayer,args:[H]}),O.splice(O.indexOf(H,q),1));for(N=0,q=0;N<M.length;N++)H=M[M.length-1-N],O[O.length-1-N]!==H&&(Object.prototype.hasOwnProperty.call(T,H)?(y.push({command:Ee.removeLayer,args:[H]}),O.splice(O.lastIndexOf(H,O.length-q),1)):q++,he=O[O.length-N],y.push({command:Ee.addLayer,args:[A[H],he]}),O.splice(O.length-N,0,H),R[H]=!0);for(N=0;N<M.length;N++)if(H=M[N],le=T[H],te=A[H],!R[H]&&!z(le,te))if(z(le.source,te.source)&&z(le["source-layer"],te["source-layer"])&&z(le.type,te.type)){for(ye in Mr(le.layout,te.layout,y,H,null,Ee.setLayoutProperty),Mr(le.paint,te.paint,y,H,null,Ee.setPaintProperty),z(le.filter,te.filter)||y.push({command:Ee.setFilter,args:[H,te.filter]}),z(le.minzoom,te.minzoom)&&z(le.maxzoom,te.maxzoom)||y.push({command:Ee.setLayerZoomRange,args:[H,te.minzoom,te.maxzoom]}),le)Object.prototype.hasOwnProperty.call(le,ye)&&"layout"!==ye&&"paint"!==ye&&"filter"!==ye&&"metadata"!==ye&&"minzoom"!==ye&&"maxzoom"!==ye&&(0===ye.indexOf("paint.")?Mr(le[ye],te[ye],y,H,ye.slice(6),Ee.setPaintProperty):z(le[ye],te[ye])||y.push({command:Ee.setLayerProperty,args:[H,ye,te[ye]]}));for(ye in te)Object.prototype.hasOwnProperty.call(te,ye)&&!Object.prototype.hasOwnProperty.call(le,ye)&&"layout"!==ye&&"paint"!==ye&&"filter"!==ye&&"metadata"!==ye&&"minzoom"!==ye&&"maxzoom"!==ye&&(0===ye.indexOf("paint.")?Mr(le[ye],te[ye],y,H,ye.slice(6),Ee.setPaintProperty):z(le[ye],te[ye])||y.push({command:Ee.setLayerProperty,args:[H,ye,te[ye]]}))}else y.push({command:Ee.removeLayer,args:[H]}),he=O[O.lastIndexOf(H)+1],y.push({command:Ee.addLayer,args:[te,he]})}(h,e.layers,r)}catch(o){console.warn("Unable to compute style diff:",o),r=[{command:Ee.setStyle,args:[e]}]}return r},c.aF=function(i){const e=[],r=i.id;return void 0===r&&e.push({message:`layers.${r}: missing required property "id"`}),void 0===i.render&&e.push({message:`layers.${r}: missing required method "render"`}),i.renderingMode&&"2d"!==i.renderingMode&&"3d"!==i.renderingMode&&e.push({message:`layers.${r}: property "renderingMode" must be either "2d" or "3d"`}),e},c.aG=function i(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(let o=0;o<e.length;o++)if(!i(e[o],r[o]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==r){if("object"!=typeof r||Object.keys(e).length!==Object.keys(r).length)return!1;for(const o in e)if(!i(e[o],r[o]))return!1;return!0}return e===r},c.aH=Ve,c.aI=Oe,c.aJ=Qs,c.aK=function(i){return i({pluginStatus:yn,pluginURL:No}),Qs.on("pluginStateChange",i),i},c.aL=class extends as{constructor(i,e){super(i,e),this.current=0}set(i){this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},c.aM=_a,c.aN=class extends as{constructor(i,e){super(i,e),this.current=Bl}set(i){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 e=1;e<16;e++)if(i[e]!==this.current[e]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}},c.aO=ml,c.aP=class extends as{constructor(i,e){super(i,e),this.current=[0,0,0]}set(i){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]))}},c.aQ=class extends as{constructor(i,e){super(i,e),this.current=[0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1]))}},c.aR=fl,c.aS=function(i,e,r,o,a,h,p){var f=1/(e-r),y=1/(o-a),b=1/(h-p);return i[0]=-2*f,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=-2*y,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=2*b,i[11]=0,i[12]=(e+r)*f,i[13]=(a+o)*y,i[14]=(p+h)*b,i[15]=1,i},c.aT=Jt,c.aU=yh,c.aV=class extends s{},c.aW=dd,c.aX=class extends d{},c.aY=function(i){return i<=1?1:Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))},c.aZ=$c,c.a_=rt,c.aa=function(i){const e={};if(i.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(r,o,a,h)=>{const p=a||h;return e[o]=!p||p.toLowerCase(),""}),e["max-age"]){const r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e},c.ab=function(i,e){const r=[];for(const o in i)o in e||r.push(o);return r},c.ac=function(i){if(null==$e){const e=i.navigator?i.navigator.userAgent:null;$e=!!i.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return $e},c.ad=be,c.ae=function(i,e,r){var o=Math.sin(r),a=Math.cos(r),h=e[0],p=e[1],f=e[2],y=e[3],b=e[4],M=e[5],T=e[6],A=e[7];return e!==i&&(i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[0]=h*a+b*o,i[1]=p*a+M*o,i[2]=f*a+T*o,i[3]=y*a+A*o,i[4]=b*a-h*o,i[5]=M*a-p*o,i[6]=T*a-f*o,i[7]=A*a-y*o,i},c.af=function(i){var e=new va(16);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],e},c.ag=vl,c.ah=function(i,e){let r=0,o=0;if("constant"===i.kind)o=i.layoutSize;else if("source"!==i.kind){const{interpolationType:a,minZoom:h,maxZoom:p}=i,f=a?be(Yr.interpolationFactor(a,e,h,p),0,1):0;"camera"===i.kind?o=$r.number(i.minSize,i.maxSize,f):r=f}return{uSizeT:r,uSize:o}},c.aj=function(i,{uSize:e,uSizeT:r},{lowerSize:o,upperSize:a}){return"source"===i.kind?o/Vo:"composite"===i.kind?$r.number(o/Vo,a/Vo,r):e},c.ak=uc,c.al=function(i,e,r,o){const a=e.y-i.y,h=e.x-i.x,p=o.y-r.y,f=o.x-r.x,y=p*h-f*a;if(0===y)return null;const b=(f*(i.y-r.y)-p*(i.x-r.x))/y;return new Ce(i.x+b*h,i.y+b*a)},c.am=Wu,c.an=Lc,c.ao=jl,c.ap=Dr,c.ar=cc,c.as=function(i,e){var r=e[0],o=e[1],a=e[2],h=e[3],p=e[4],f=e[5],y=e[6],b=e[7],M=e[8],T=e[9],A=e[10],O=e[11],R=e[12],N=e[13],q=e[14],H=e[15],le=r*f-o*p,te=r*y-a*p,he=r*b-h*p,ye=o*y-a*f,Fe=o*b-h*f,vt=a*b-h*y,Tt=M*N-T*R,yt=M*q-A*R,pt=M*H-O*R,ot=T*q-A*N,Mt=T*H-O*N,at=A*H-O*q,Je=le*at-te*Mt+he*ot+ye*pt-Fe*yt+vt*Tt;return Je?(i[0]=(f*at-y*Mt+b*ot)*(Je=1/Je),i[1]=(a*Mt-o*at-h*ot)*Je,i[2]=(N*vt-q*Fe+H*ye)*Je,i[3]=(A*Fe-T*vt-O*ye)*Je,i[4]=(y*pt-p*at-b*yt)*Je,i[5]=(r*at-a*pt+h*yt)*Je,i[6]=(q*he-R*vt-H*te)*Je,i[7]=(M*vt-A*he+O*te)*Je,i[8]=(p*Mt-f*pt+b*Tt)*Je,i[9]=(o*pt-r*Mt-h*Tt)*Je,i[10]=(R*Fe-N*he+H*le)*Je,i[11]=(T*he-M*Fe-O*le)*Je,i[12]=(f*yt-p*ot-y*Tt)*Je,i[13]=(r*ot-o*yt+a*Tt)*Je,i[14]=(N*te-R*ye-q*le)*Je,i[15]=(M*ye-T*te+A*le)*Je,i):null}
vendor: 5,024 bytes, line 1
1,c.at=yc,c.au=lc,c.av=vc,c.aw=function(){const i={},e=Y.$version;for(const r in Y.$root){const o=Y.$root[r];if(o.required){let a=null;a="version"===r?e:"array"===o.type?[]:{},null!=a&&(i[r]=a)}}return i},c.ax=Ee,c.ay=Co,c.az=xi,c.b=function(i,e){const r=new Blob([new Uint8Array(i)],{type:"image/png"});createImageBitmap(r).then(o=>{e(null,o)}).catch(o=>{e(new Error(`Could not load image because of ${o.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})},c.b0=Wr,c.b1=function(i,e){var r=i[0],o=i[1],a=i[2],h=i[3],p=i[4],f=i[5],y=i[6],b=i[7],M=i[8],T=i[9],A=i[10],O=i[11],R=i[12],N=i[13],q=i[14],H=i[15],le=e[0],te=e[1],he=e[2],ye=e[3],Fe=e[4],vt=e[5],Tt=e[6],yt=e[7],pt=e[8],ot=e[9],Mt=e[10],at=e[11],Je=e[12],Nt=e[13],Dt=e[14],ui=e[15];return Math.abs(r-le)<=xn*Math.max(1,Math.abs(r),Math.abs(le))&&Math.abs(o-te)<=xn*Math.max(1,Math.abs(o),Math.abs(te))&&Math.abs(a-he)<=xn*Math.max(1,Math.abs(a),Math.abs(he))&&Math.abs(h-ye)<=xn*Math.max(1,Math.abs(h),Math.abs(ye))&&Math.abs(p-Fe)<=xn*Math.max(1,Math.abs(p),Math.abs(Fe))&&Math.abs(f-vt)<=xn*Math.max(1,Math.abs(f),Math.abs(vt))&&Math.abs(y-Tt)<=xn*Math.max(1,Math.abs(y),Math.abs(Tt))&&Math.abs(b-yt)<=xn*Math.max(1,Math.abs(b),Math.abs(yt))&&Math.abs(M-pt)<=xn*Math.max(1,Math.abs(M),Math.abs(pt))&&Math.abs(T-ot)<=xn*Math.max(1,Math.abs(T),Math.abs(ot))&&Math.abs(A-Mt)<=xn*Math.max(1,Math.abs(A),Math.abs(Mt))&&Math.abs(O-at)<=xn*Math.max(1,Math.abs(O),Math.abs(at))&&Math.abs(R-Je)<=xn*Math.max(1,Math.abs(R),Math.abs(Je))&&Math.abs(N-Nt)<=xn*Math.max(1,Math.abs(N),Math.abs(Nt))&&Math.abs(q-Dt)<=xn*Math.max(1,Math.abs(q),Math.abs(Dt))&&Math.abs(H-ui)<=xn*Math.max(1,Math.abs(H),Math.abs(ui))},c.b2=function(i,e){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},c.b3=function(i,e,r){return i[0]=e[0]*r[0],i[1]=e[1]*r[1],i[2]=e[2]*r[2],i[3]=e[3]*r[3],i},c.b4=function(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]+i[3]*e[3]},c.b5=De,c.b6=Nu,c.b7=Ru,c.b8=function(i,e,r,o,a){var h,p=1/Math.tan(e/2);return i[0]=p/r,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=p,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=-1,i[12]=0,i[13]=0,i[15]=0,null!=a&&a!==1/0?(i[10]=(a+o)*(h=1/(o-a)),i[14]=2*a*o*h):(i[10]=-1,i[14]=-2*o),i},c.b9=function(i,e,r){var o=Math.sin(r),a=Math.cos(r),h=e[4],p=e[5],f=e[6],y=e[7],b=e[8],M=e[9],T=e[10],A=e[11];return e!==i&&(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[4]=h*a+b*o,i[5]=p*a+M*o,i[6]=f*a+T*o,i[7]=y*a+A*o,i[8]=b*a-h*o,i[9]=M*a-p*o,i[10]=T*a-f*o,i[11]=A*a-y*o,i},c.bA=Ct,c.bB=hu,c.bC=Is,c.bD=An,c.ba=xt,c.bb=si,c.bc=function(i,e){return i[0]=e[0],i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=e[1],i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=e[2],i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i},c.bd=class extends ia{},c.be=mc,c.bf=Fu,c.bg=Kd,c.bi=Bi,c.bj=function(i,e,r=!1){if(yn===Aa||yn===ka||yn===Da)throw new Error("setRTLTextPlugin cannot be called multiple times.");No=$t.resolveURL(i),yn=Aa,La=e,Oa(),r||cl()},c.bk=za,c.bl=function(i,e){const r={};for(let a=0;a<i.length;a++){const h=e&&e[i[a].id]||wo(i[a]);e&&(e[i[a].id]=h);let p=r[h];p||(p=r[h]=[]),p.push(i[a])}const o=[];for(const a in r)o.push(r[a]);return o},c.bm=mt,c.bn=Vu,c.bo=ju,c.bp=xu,c.bq=function(i){i.bucket.createArrays(),i.bucket.tilePixelRatio=br/(512*i.bucket.overscaling),i.bucket.compareText={},i.bucket.iconsNeedLinear=!1;const e=i.bucket.layers[0],r=e.layout,o=e._unevaluatedLayout._values,a={layoutIconSize:o["icon-size"].possiblyEvaluate(new Ki(i.bucket.zoom+1),i.canonical),layoutTextSize:o["text-size"].possiblyEvaluate(new Ki(i.bucket.zoom+1),i.canonical),textMaxSize:o["text-size"].possiblyEvaluate(new Ki(18))};if("composite"===i.bucket.textSizeData.kind){const{minZoom:b,maxZoom:M}=i.bucket.textSizeData;a.compositeTextSizes=[o["text-size"].possiblyEvaluate(new Ki(b),i.canonical),o["text-size"].possiblyEvaluate(new Ki(M),i.canonical)]}if("composite"===i.bucket.iconSizeData.kind){const{minZoom:b,maxZoom:M}=i.bucket.iconSizeData;a.compositeIconSizes=[o["icon-size"].possiblyEvaluate(new Ki(b),i.canonical),o["icon-size"].possiblyEvaluate(new Ki(M),i.canonical)]}const h=r.get("text-line-height")*Dr,p="viewport"!==r.get("text-rotation-alignment")&&"point"!==r.get("symbol-placement"),f=r.get("text-keep-upright"),y=r.get("text-size");for(const b of i.bucket.features){const M=r.get("text-font").evaluate(b,{},i.canonical).join(","),T=y.evaluate(b,{},i.canonical),A=a.layoutTextSize.evaluate(b,{},i.canonical),O=a.layoutIconSize.evaluate(b,{},i.canonical),R={horizontal:{},vertical:void 0},N=b.text;let q,H=[0,0];if(N){const he=N.toString(),ye=r.get("text-letter-spacing").evaluate(b,{},i.canonical)*Dr,Fe=Fo(he)?ye:0,vt=r.get("text-anchor").evaluate(b,{},i.canonical),Tt=th(e,b,i.canonical);if(!Tt){const at=r.get("text-radial-offset").evaluate(b,{},i.canonical);H=at?eh(vt,[at*Dr,_c]):r.get("text-offset").evaluate(b,{},i.canonical).map(Je=>Je*Dr)}
1let yt=p?"center":r.get("text-justify").evaluate(b,{},i.canonical);const pt=r.get("symbol-placement"),ot="point"===pt?r.get("text-max-width").evaluate(b,{},i.canonical)*Dr:0,Mt=()=>{i.bucket.allowVerticalPlacement&&Os(he)&&(R.vertical=Il(N,i.glyphMap,i.glyphPositions,i.imagePositions,M,ot,h,vt,"left",Fe,H,c.ai.vertical,!0,pt,A,T))};if(!p&&Tt){const at=new Set;if("auto"===yt)for(let Nt=0;Nt<Tt.values.length;Nt+=2)at.add(yc(Tt.values[Nt]));else at.add(yt);let Je=!1;for(const Nt of at)if(!R.horizontal[Nt])if(Je)R.horizontal[Nt]=R.horizontal[0];else{const Dt=Il(N,i.glyphMap,i.glyphPositions,i.imagePositions,M,ot,h,"center",Nt,Fe,H,c.ai.horizontal,!1,pt,A,T);Dt&&(R.horizontal[Nt]=Dt,Je=1===Dt.positionedLines.length)}Mt()}else{"auto"===yt&&(yt=yc(vt));const at=Il(N,i.glyphMap,i.glyphPositions,i.imagePositions,M,ot,h,vt,yt,Fe,H,c.ai.horizontal,!1,pt,A,T);at&&(R.horizontal[yt]=at),Mt(),Os(he)&&p&&f&&(R.vertical=Il(N,i.glyphMap,i.glyphPositions,i.imagePositions,M,ot,h,vt,yt,Fe,H,c.ai.vertical,!1,pt,A,T))}}let le=!1;if(b.icon&&b.icon.name){const he=i.imageMap[b.icon.name];he&&(q=Pd(i.imagePositions[b.icon.name],r.get("icon-offset").evaluate(b,{},i.canonical),r.get("icon-anchor").evaluate(b,{},i.canonical)),le=!!he.sdf,void 0===i.bucket.sdfIcons?i.bucket.sdfIcons=le:i.bucket.sdfIcons!==le&&ze("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(he.pixelRatio!==i.bucket.pixelRatio||0!==r.get("icon-rotate").constantOr(1))&&(i.bucket.iconsNeedLinear=!0))}const te=rh(R.horizontal)||R.vertical;i.bucket.iconsInText=!!te&&te.iconsInText,(te||q)&&Wd(i.bucket,b,R,q,i.imageMap,a,A,O,H,le,i.canonical)}i.showCollisionBoxes&&i.bucket.generateCollisionDebugBuffers()},c.br=ic,c.bs=Ql,c.bt=tc,c.bu=class{constructor(i){this._marks={start:[i.url,"start"].join("#"),end:[i.url,"end"].join("#"),measure:i.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let i=performance.getEntriesByName(this._marks.measure);return 0===i.length&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),i=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),i}},c.bv=nc,c.bw=Ns,c.bx=function(i,e,r,o,a){return Q(this,void 0,void 0,function*(){if(Rt())try{return yield Ut(i,e,r,o,a)}catch{}return function(h,p,f,y,b){const M=h.width,T=h.height;Oi&&Ke||(Oi=new OffscreenCanvas(M,T),Ke=Oi.getContext("2d",{willReadFrequently:!0})),Oi.width=M,Oi.height=T,Ke.drawImage(h,0,0,M,T);const A=Ke.getImageData(p,f,y,b);return Ke.clearRect(0,0,M,T),A.data}(i,e,r,o,a)})},c.by=Uu,c.bz=pe,c.c=Qt,c.d=function(i,e){const r=new Image;r.onload=()=>{e(null,r),URL.revokeObjectURL(r.src),r.onload=null,window.requestAnimationFrame(()=>{r.src=et})},r.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 o=new Blob([new Uint8Array(i)],{type:"image/png"});r.src=i.byteLength?URL.createObjectURL(o):et},c.e=Ae,c.f=function(i,e){return _r(Ae(i,{type:"json"}),e)},c.g=Ft,c.h=$t,c.i=ht,c.j=Sr,c.k=Xr,c.l=Vr,c.m=_r,c.n=function(i){return new nc(i).readFields(Cd,[])},c.o=function(i,e,r){if(!i.length)return r(null,[]);let o=i.length;const a=new Array(i.length);let h=null;i.forEach((p,f)=>{e(p,(y,b)=>{y&&(h=y),a[f]=b,0==--o&&r(h,a)})})},c.p=vu,c.q=Ka,c.r=pr,c.s=tr,c.t=Ri,c.u=st,c.v=Y,c.w=ze,c.x=Tn,c.y=Jn,c.z=function([i,e,r]){return e+=90,e*=Math.PI/180,r*=Math.PI/180,{x:i*Math.cos(e)*Math.sin(r),y:i*Math.sin(e)*Math.sin(r),z:i*Math.cos(r)}}}),ke(0,function(c){class Q{constructor(P){this.keyCache={},P&&this.replace(P)}replace(P){this._layerConfigs={},this._layers={},this.update(P,[])}update(P,k){for(const j of P){this._layerConfigs[j.id]=j;const W=this._layers[j.id]=c.aC(j);W._featureFilter=c.a6(W.filter),this.keyCache[j.id]&&delete this.keyCache[j.id]}for(const j of k)delete this.keyCache[j],delete this._layerConfigs[j],delete this._layers[j];this.familiesBySource={};const F=c.bl(Object.values(this._layerConfigs),this.keyCache);for(const j of F){const W=j.map(Pe=>this._layers[Pe.id]),ce=W[0];if("none"===ce.visibility)continue;const ee=ce.source||"";let J=this.familiesBySource[ee];J||(J=this.familiesBySource[ee]={});const ne=ce.sourceLayer||"_geojsonTileLayer";let Se=J[ne];
1Se||(Se=J[ne]=[]),Se.push(W)}}}class pe{constructor(P){const k={},F=[];for(const ee in P){const J=P[ee],ne=k[ee]={};for(const Se in J){const Pe=J[+Se];if(!Pe||0===Pe.bitmap.width||0===Pe.bitmap.height)continue;const Le={x:0,y:0,w:Pe.bitmap.width+2,h:Pe.bitmap.height+2};F.push(Le),ne[Se]={rect:Le,metrics:Pe.metrics}}}const{w:j,h:W}=c.p(F),ce=new c.q({width:j||1,height:W||1});for(const ee in P){const J=P[ee];for(const ne in J){const Se=J[+ne];if(!Se||0===Se.bitmap.width||0===Se.bitmap.height)continue;const Pe=k[ee][ne].rect;c.q.copy(Se.bitmap,ce,{x:0,y:0},{x:Pe.x+1,y:Pe.y+1},Se.bitmap)}}this.image=ce,this.positions=k}}c.bm("GlyphAtlas",pe);class Ct{constructor(P){this.tileID=new c.O(P.tileID.overscaledZ,P.tileID.wrap,P.tileID.canonical.z,P.tileID.canonical.x,P.tileID.canonical.y),this.uid=P.uid,this.zoom=P.zoom,this.pixelRatio=P.pixelRatio,this.tileSize=P.tileSize,this.source=P.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=P.showCollisionBoxes,this.collectResourceTiming=!!P.collectResourceTiming,this.returnDependencies=!!P.returnDependencies,this.promoteId=P.promoteId,this.inFlightDependencies=[],this.dependencySentinel=-1}parse(P,k,F,j,W){this.status="parsing",this.data=P,this.collisionBoxArray=new c.a3;const ce=new c.bn(Object.keys(P.layers).sort()),ee=new c.bo(this.tileID,this.promoteId);ee.bucketLayerIDs=[];const J={},ne={featureIndex:ee,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:F},Se=k.familiesBySource[this.source];for(const hi in Se){const ci=P.layers[hi];if(!ci)continue;1===ci.version&&c.w(`Vector tile source "${this.source}" layer "${hi}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const sr=ce.encode(hi),Ci=[];for(let _e=0;_e<ci.length;_e++){const ge=ci.feature(_e),se=ee.getId(ge,hi);Ci.push({feature:ge,id:se,index:_e,sourceLayerIndex:sr})}for(const _e of Se[hi]){const ge=_e[0];ge.source!==this.source&&c.w(`layer.source = ${ge.source} does not equal this.source = ${this.source}`),ge.minzoom&&this.zoom<Math.floor(ge.minzoom)||ge.maxzoom&&this.zoom>=ge.maxzoom||"none"!==ge.visibility&&(Ue(_e,this.zoom,F),(J[ge.id]=ge.createBucket({index:ee.bucketLayerIDs.length,layers:_e,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:sr,sourceID:this.source})).populate(Ci,ne,this.tileID.canonical),ee.bucketLayerIDs.push(_e.map(se=>se.id)))}}let Pe,Le,It,Zt;const bt=c.aH(ne.glyphDependencies,hi=>Object.keys(hi).map(Number));this.inFlightDependencies.forEach(hi=>hi?.cancel()),this.inFlightDependencies=[];const Pt=++this.dependencySentinel;Object.keys(bt).length?this.inFlightDependencies.push(j.send("getGlyphs",{uid:this.uid,stacks:bt,source:this.source,tileID:this.tileID,type:"glyphs"},(hi,ci)=>{Pt===this.dependencySentinel&&(Pe||(Pe=hi,Le=ci,ni.call(this)))})):Le={};const Kt=Object.keys(ne.iconDependencies);Kt.length?this.inFlightDependencies.push(j.send("getImages",{icons:Kt,source:this.source,tileID:this.tileID,type:"icons"},(hi,ci)=>{Pt===this.dependencySentinel&&(Pe||(Pe=hi,It=ci,ni.call(this)))})):It={};const bi=Object.keys(ne.patternDependencies);function ni(){if(Pe)return W(Pe);if(Le&&It&&Zt){const hi=new pe(Le),ci=new c.bp(It,Zt);for(const sr in J){const Ci=J[sr];Ci instanceof c.a4?(Ue(Ci.layers,this.zoom,F),c.bq({bucket:Ci,glyphMap:Le,glyphPositions:hi.positions,imageMap:It,imagePositions:ci.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):Ci.hasPattern&&(Ci instanceof c.br||Ci instanceof c.bs||Ci instanceof c.bt)&&(Ue(Ci.layers,this.zoom,F),Ci.addFeatures(ne,this.tileID.canonical,ci.patternPositions))}this.status="done",W(null,{buckets:Object.values(J).filter(sr=>!sr.isEmpty()),featureIndex:ee,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:hi.image,imageAtlas:ci,glyphMap:this.returnDependencies?Le:null,iconMap:this.returnDependencies?It:null,glyphPositions:this.returnDependencies?hi.positions:null})}}bi.length?this.inFlightDependencies.push(j.send("getImages",{icons:bi,source:this.source,tileID:this.tileID,type:"patterns"},(hi,ci)=>{Pt===this.dependencySentinel&&(Pe||(Pe=hi,Zt=ci,ni.call(this)))})):Zt={},ni.call(this)}}function Ue(G,P,k){const F=new c.a8(P);for(const j of G)j.recalculate(F,k)}function Ce(G,P){const k=c.l(G.request,(F,j,W,ce)=>{if(F)P(F);else if(j)try{const ee=new c.bw.VectorTile(new c.bv(j));P(null,{vectorTile:ee,rawData:j,cacheControl:W,expires:ce})}catch(ee){const J=new Uint8Array(j);let ne=`Unable to parse the tile at ${G.request.url}, `;ne+=31===J[0]&&139===J[1]?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${ee.messge}`,P(new Error(ne))}});return()=>{k.cancel(),P()}}class me{constructor(P,k,F,j){this.actor=P,this.layerIndex=k,this.availableImages=F,this.loadVectorData=j||Ce,this.fetching={},this.loading={},this.loaded={}}loadTile(P,k){const F=P.uid;this.loading||(this.loading={});const j=!!(P&&P.request&&P.request.collectResourceTiming)&&new c.bu(P.request),W=this.loading[F]=new Ct(P);W.abort=this.loadVectorData(P,(ce,ee)=>{if(delete this.loading[F],ce||!ee)return W.status="done",this.loaded[F]=W,k(ce);const J=ee.rawData,ne={};ee.expires&&(ne.expires=ee.expires),ee.cacheControl&&(ne.cacheControl=ee.cacheControl);const Se={};if(j){const Pe=j.finish();Pe&&(Se.resourceTiming=JSON.parse(JSON.stringify(Pe)))}W.vectorTile=ee.vectorTile,W.parse(ee.vectorTile,this.layerIndex,this.availableImages,this.actor,(Pe,Le)=>{if(delete this.fetching[F],Pe||!Le)return k(Pe);k(null,c.e({rawTileData:J.slice(0)},Le,ne,Se))}),this.loaded=this.loaded||{},this.loaded[F]=W,this.fetching[F]={rawTileData:J,cacheControl:ne,resourceTiming:Se}})}reloadTile(P,k){const F=this.loaded,j=P.uid;if(F&&F[j]){const W=F[j];W.showCollisionBoxes=P.showCollisionBoxes,"parsing"===W.status?W.parse(W.vectorTile,this.layerIndex,this.availableImages,this.actor,(ce,ee)=>{if(ce||!ee)return k(ce,ee);let J;if(this.fetching[j]){const{rawTileData:ne,cacheControl:Se,resourceTiming:Pe}=this.fetching[j];delete this.fetching[j],J=c.e({rawTileData:ne.slice(0)},ee,Se,Pe)}else J=ee;k(null,J)}):"done"===W.status&&(W.vectorTile?W.parse(W.vectorTile,this.layerIndex,this.availableImages,this.actor,k):k())}}abortTile(P,k){const F=this.loading,j=P.uid;F&&F[j]&&F[j].abort&&(F[j].abort(),delete F[j]),k()}removeTile(P,k){const F=this.loaded,j=P.uid;F&&F[j]&&delete F[j],k()}}class ut{constructor(){this.loaded={}}loadTile(P,k){return c._(this,void 0,void 0,function*(){const{uid:F,encoding:j,rawImageData:W,redFactor:ce,greenFactor:ee,blueFactor:J,baseShift:ne}=P,Se=W.width+2,Pe=W.height+2,Le=c.a(W)?new c.R({width:Se,height:Pe},yield c.bx(W,-1,-1,Se,Pe)):W,It=new c.by(F,Le,j,ce,ee,J,ne);this.loaded=this.loaded||{},this.loaded[F]=It,k(null,It)})}removeTile(P){const k=this.loaded,F=P.uid;k&&k[F]&&delete k[F]}}function Be(G,P){if(0!==G.length){He(G[0],P);for(var k=1;k<G.length;k++)He(G[k],!P)}}function He(G,P){for(var k=0,F=0,j=0,W=G.length,ce=W-1;j<W;ce=j++){var ee=(G[j][0]-G[ce][0])*(G[ce][1]+G[j][1]),J=k+ee;F+=Math.abs(k)>=Math.abs(ee)?k-J+ee:ee-J+k,k=J}k+F>=0!=!!P&&G.reverse()}var Ze=c.bz(function G(P,k){var F,j=P&&P.type;if("FeatureCollection"===j)for(F=0;F<P.features.length;F++)G(P.features[F],k);else if("GeometryCollection"===j)for(F=0;F<P.geometries.length;F++)G(P.geometries[F],k);else if("Feature"===j)G(P.geometry,k);else if("Polygon"===j)Be(P.coordinates,k);else if("MultiPolygon"===j)for(F=0;F<P.coordinates.length;F++)Be(P.coordinates[F],k);return P});
vendor: 11,055 bytes, line 1
1const zt=c.bw.VectorTileFeature.prototype.toGeoJSON;var Rt={exports:{}},xt=c.bA,si=c.bw.VectorTileFeature,be=De;function De(G,P){this.options=P||{},this.features=G,this.length=G.length}function Ae(G,P){this.id="number"==typeof G.id?G.id:void 0,this.type=G.type,this.rawGeometry=1===G.type?[G.geometry]:G.geometry,this.properties=G.tags,this.extent=P||4096}De.prototype.feature=function(G){return new Ae(this.features[G],this.options.extent)},Ae.prototype.loadGeometry=function(){var G=this.rawGeometry;this.geometry=[];for(var P=0;P<G.length;P++){for(var k=G[P],F=[],j=0;j<k.length;j++)F.push(new xt(k[j][0],k[j][1]));this.geometry.push(F)}return this.geometry},Ae.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var G=this.geometry,P=1/0,k=-1/0,F=1/0,j=-1/0,W=0;W<G.length;W++)for(var ce=G[W],ee=0;ee<ce.length;ee++){var J=ce[ee];P=Math.min(P,J.x),k=Math.max(k,J.x),F=Math.min(F,J.y),j=Math.max(j,J.y)}return[P,F,k,j]},Ae.prototype.toGeoJSON=si.prototype.toGeoJSON;var Me=c.bB,Ve=be;function Oe(G){var P=new Me;return function(k,F){for(var j in k.layers)F.writeMessage(3,Ie,k.layers[j])}(G,P),P.finish()}function Ie(G,P){var k;P.writeVarintField(15,G.version||1),P.writeStringField(1,G.name||""),P.writeVarintField(5,G.extent||4096);var F={keys:[],values:[],keycache:{},valuecache:{}};for(k=0;k<G.length;k++)F.feature=G.feature(k),P.writeMessage(2,Qe,F);var j=F.keys;for(k=0;k<j.length;k++)P.writeStringField(3,j[k]);var W=F.values;for(k=0;k<W.length;k++)P.writeMessage(4,$e,W[k])}function Qe(G,P){var k=G.feature;void 0!==k.id&&P.writeVarintField(1,k.id),P.writeMessage(2,ze,G),P.writeVarintField(3,k.type),P.writeMessage(4,ht,k)}function ze(G,P){var k=G.feature,F=G.keys,j=G.values,W=G.keycache,ce=G.valuecache;for(var ee in k.properties){var J=k.properties[ee],ne=W[ee];if(null!==J){void 0===ne&&(F.push(ee),W[ee]=ne=F.length-1),P.writeVarint(ne);var Se=typeof J;"string"!==Se&&"boolean"!==Se&&"number"!==Se&&(J=JSON.stringify(J));var Pe=Se+":"+J,Le=ce[Pe];void 0===Le&&(j.push(J),ce[Pe]=Le=j.length-1),P.writeVarint(Le)}}}function Gt(G,P){return(P<<3)+(7&G)}function St(G){return G<<1^G>>31}function ht(G,P){for(var k=G.loadGeometry(),F=G.type,j=0,W=0,ce=k.length,ee=0;ee<ce;ee++){var J=k[ee],ne=1;1===F&&(ne=J.length),P.writeVarint(Gt(1,ne));for(var Se=3===F?J.length-1:J.length,Pe=0;Pe<Se;Pe++){1===Pe&&1!==F&&P.writeVarint(Gt(2,Se-1));var Le=J[Pe].x-j,It=J[Pe].y-W;P.writeVarint(St(Le)),P.writeVarint(St(It)),j+=Le,W+=It}3===F&&P.writeVarint(Gt(7,1))}}function $e(G,P){var k=typeof G;"string"===k?P.writeStringField(1,G):"boolean"===k?P.writeBooleanField(7,G):"number"===k&&(G%1!=0?P.writeDoubleField(3,G):G<0?P.writeSVarintField(6,G):P.writeVarintField(5,G))}Rt.exports=Oe,Rt.exports.fromVectorTileJs=Oe,Rt.exports.fromGeojsonVt=function(G,P){P=P||{};var k={};for(var F in G)k[F]=new Ve(G[F].features,P),k[F].name=F,k[F].version=P.version,k[F].extent=P.extent;return Oe({layers:k})},Rt.exports.GeoJSONWrapper=Ve;var We=c.bz(Rt.exports);const et={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:G=>G},Ut=Math.fround||(Oi=new Float32Array(1),G=>(Oi[0]=+G,Oi[0]));var Oi;const Ke=3,ri=5,wt=6;class $t{constructor(P){this.options=Object.assign(Object.create(et),P),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(P){const{log:k,minZoom:F,maxZoom:j}=this.options;k&&console.time("total time");const W=`prepare ${P.length} points`;k&&console.time(W),this.points=P;const ce=[];for(let J=0;J<P.length;J++){const ne=P[J];if(!ne.geometry)continue;const[Se,Pe]=ne.geometry.coordinates,Le=Ut(xi(Se)),It=Ut(Ft(Pe));ce.push(Le,It,1/0,J,-1,1),this.options.reduce&&ce.push(0)}let ee=this.trees[j+1]=this._createTree(ce);k&&console.timeEnd(W);for(let J=j;J>=F;J--){const ne=+Date.now();ee=this.trees[J]=this._createTree(this._cluster(ee,J)),k&&console.log("z%d: %d clusters in %dms",J,ee.numItems,+Date.now()-ne)}return k&&console.timeEnd("total time"),this}getClusters(P,k){let F=((P[0]+180)%360+360)%360-180;const j=Math.max(-90,Math.min(90,P[1]));let W=180===P[2]?180:((P[2]+180)%360+360)%360-180;const ce=Math.max(-90,Math.min(90,P[3]));if(P[2]-P[0]>=360)F=-180,W=180;else if(F>W){const Pe=this.getClusters([F,j,180,ce],k),Le=this.getClusters([-180,j,W,ce],k);return Pe.concat(Le)}const ee=this.trees[this._limitZoom(k)],J=ee.range(xi(F),Ft(ce),xi(W),Ft(j)),ne=ee.data,Se=[];for(const Pe of J){const Le=this.stride*Pe;Se.push(ne[Le+ri]>1?Qt(ne,Le,this.clusterProps):this.points[ne[Le+Ke]])}return Se}getChildren(P){const k=this._getOriginId(P),F=this._getOriginZoom(P),j="No cluster with the specified id.",W=this.trees[F];if(!W)throw new Error(j);const ce=W.data;if(k*this.stride>=ce.length)throw new Error(j);const ee=this.options.radius/(this.options.extent*Math.pow(2,F-1)),J=W.within(ce[k*this.stride],ce[k*this.stride+1],ee),ne=[];for(const Se of J){const Pe=Se*this.stride;ce[Pe+4]===P&&ne.push(ce[Pe+ri]>1?Qt(ce,Pe,this.clusterProps):this.points[ce[Pe+Ke]])}if(0===ne.length)throw new Error(j);return ne}getLeaves(P,k,F){const j=[];return this._appendLeaves(j,P,k=k||10,F=F||0,0),j}getTile(P,k,F){const j=this.trees[this._limitZoom(P)],W=Math.pow(2,P),{extent:ce,radius:ee}=this.options,J=ee/ce,ne=(F-J)/W,Se=(F+1+J)/W,Pe={features:[]};return this._addTileFeatures(j.range((k-J)/W,ne,(k+1+J)/W,Se),j.data,k,F,W,Pe),0===k&&this._addTileFeatures(j.range(1-J/W,ne,1,Se),j.data,W,F,W,Pe),k===W-1&&this._addTileFeatures(j.range(0,ne,J/W,Se),j.data,-1,F,W,Pe),Pe.features.length?Pe:null}getClusterExpansionZoom(P){let k=this._getOriginZoom(P)-1;for(;k<=this.options.maxZoom;){const F=this.getChildren(P);if(k++,1!==F.length)break;P=F[0].properties.cluster_id}return k}_appendLeaves(P,k,F,j,W){const ce=this.getChildren(k);for(const ee of ce){const J=ee.properties;if(J&&J.cluster?W+J.point_count<=j?W+=J.point_count:W=this._appendLeaves(P,J.cluster_id,F,j,W):W<j?W++:P.push(ee),P.length===F)break}return W}_createTree(P){const k=new c.av(P.length/this.stride|0,this.options.nodeSize,Float32Array);for(let F=0;F<P.length;F+=this.stride)k.add(P[F],P[F+1]);return k.finish(),k.data=P,k}_addTileFeatures(P,k,F,j,W,ce){for(const ee of P){const J=ee*this.stride,ne=k[J+ri]>1;let Se,Pe,Le;if(ne)Se=Bi(k,J,this.clusterProps),Pe=k[J],Le=k[J+1];else{const bt=this.points[k[J+Ke]];Se=bt.properties;const[Pt,Kt]=bt.geometry.coordinates;Pe=xi(Pt),Le=Ft(Kt)}const It={type:1,geometry:[[Math.round(this.options.extent*(Pe*W-F)),Math.round(this.options.extent*(Le*W-j))]],tags:Se};let Zt;Zt=ne||this.options.generateId?k[J+Ke]:this.points[k[J+Ke]].id,void 0!==Zt&&(It.id=Zt),ce.features.push(It)}}_limitZoom(P){return Math.max(this.options.minZoom,Math.min(Math.floor(+P),this.options.maxZoom+1))}_cluster(P,k){const{radius:F,extent:j,reduce:W,minPoints:ce}=this.options,ee=F/(j*Math.pow(2,k)),J=P.data,ne=[],Se=this.stride;for(let Pe=0;Pe<J.length;Pe+=Se){if(J[Pe+2]<=k)continue;J[Pe+2]=k;const Le=J[Pe],It=J[Pe+1],Zt=P.within(J[Pe],J[Pe+1],ee),bt=J[Pe+ri];let Pt=bt;for(const Kt of Zt){const bi=Kt*Se;J[bi+2]>k&&(Pt+=J[bi+ri])}if(Pt>bt&&Pt>=ce){let Kt,bi=Le*bt,ni=It*bt,hi=-1;const ci=(Pe/Se<<5)+(k+1)+this.points.length;for(const sr of Zt){const Ci=sr*Se;if(J[Ci+2]<=k)continue;J[Ci+2]=k;const _e=J[Ci+ri];bi+=J[Ci]*_e,ni+=J[Ci+1]*_e,J[Ci+4]=ci,W&&(Kt||(Kt=this._map(J,Pe,!0),hi=this.clusterProps.length,this.clusterProps.push(Kt)),W(Kt,this._map(J,Ci)))}J[Pe+4]=ci,ne.push(bi/Pt,ni/Pt,1/0,ci,-1,Pt),W&&ne.push(hi)}else{for(let Kt=0;Kt<Se;Kt++)ne.push(J[Pe+Kt]);if(Pt>1)for(const Kt of Zt){const bi=Kt*Se;if(!(J[bi+2]<=k)){J[bi+2]=k;for(let ni=0;ni<Se;ni++)ne.push(J[bi+ni])}}}}return ne}_getOriginId(P){return P-this.points.length>>5}_getOriginZoom(P){return(P-this.points.length)%32}_map(P,k,F){if(P[k+ri]>1){const ce=this.clusterProps[P[k+wt]];return F?Object.assign({},ce):ce}const j=this.points[P[k+Ke]].properties,W=this.options.map(j);return F&&W===j?Object.assign({},W):W}}function Qt(G,P,k){return{type:"Feature",id:G[P+Ke],properties:Bi(G,P,k),geometry:{type:"Point",coordinates:[(F=G[P],360*(F-.5)),Mn(G[P+1])]}};var F}function Bi(G,P,k){const F=G[P+ri],j=F>=1e4?`${Math.round(F/1e3)}k`:F>=1e3?Math.round(F/100)/10+"k":F,W=G[P+wt],ce=-1===W?{}:Object.assign({},k[W]);return Object.assign(ce,{cluster:!0,cluster_id:G[P+Ke],point_count:F,point_count_abbreviated:j})}function xi(G){return G/360+.5}function Ft(G){const P=Math.sin(G*Math.PI/180),k=.5-.25*Math.log((1+P)/(1-P))/Math.PI;return k<0?0:k>1?1:k}function Mn(G){const P=(180-360*G)*Math.PI/180;return 360*Math.atan(Math.exp(P))/Math.PI-90}function _r(G,P,k,F){for(var j,W=F,ce=k-P>>1,ee=k-P,J=G[P],ne=G[P+1],Se=G[k],Pe=G[k+1],Le=P+3;Le<k;Le+=3){var It=Vr(G[Le],G[Le+1],J,ne,Se,Pe);if(It>W)j=Le,W=It;else if(It===W){var Zt=Math.abs(Le-ce);Zt<ee&&(j=Le,ee=Zt)}}W>F&&(j-P>3&&_r(G,P,j,F),G[j+2]=W,k-j>3&&_r(G,j,k,F))}function Vr(G,P,k,F,j,W){var ce=j-k,ee=W-F;if(0!==ce||0!==ee){var J=((G-k)*ce+(P-F)*ee)/(ce*ce+ee*ee);J>1?(k=j,F=W):J>0&&(k+=ce*J,F+=ee*J)}return(ce=G-k)*ce+(ee=P-F)*ee}function tr(G,P,k,F){var j={id:void 0===G?null:G,type:P,geometry:k,tags:F,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(W){var ce=W.geometry,ee=W.type;if("Point"===ee||"MultiPoint"===ee||"LineString"===ee)Cr(W,ce);else if("Polygon"===ee||"MultiLineString"===ee)for(var J=0;J<ce.length;J++)Cr(W,ce[J]);else if("MultiPolygon"===ee)for(J=0;J<ce.length;J++)for(var ne=0;ne<ce[J].length;ne++)Cr(W,ce[J][ne])}(j),j}function Cr(G,P){for(var k=0;k<P.length;k+=3)G.minX=Math.min(G.minX,P[k]),G.minY=Math.min(G.minY,P[k+1]),G.maxX=Math.max(G.maxX,P[k]),G.maxY=Math.max(G.maxY,P[k+1])}function li(G,P,k,F){if(P.geometry){var j=P.geometry.coordinates,W=P.geometry.type,ce=Math.pow(k.tolerance/((1<<k.maxZoom)*k.extent),2),ee=[],J=P.id;if(k.promoteId?J=P.properties[k.promoteId]:k.generateId&&(J=F||0),"Point"===W)Xr(j,ee);else if("MultiPoint"===W)for(var ne=0;ne<j.length;ne++)Xr(j[ne],ee);else if("LineString"===W)Sr(j,ee,ce,!1);else if("MultiLineString"===W){if(k.lineMetrics){for(ne=0;ne<j.length;ne++)Sr(j[ne],ee=[],ce,!1),G.push(tr(J,"LineString",ee,P.properties));return}sn(j,ee,ce,!1)}else if("Polygon"===W)sn(j,ee,ce,!0);else{if("MultiPolygon"!==W){if("GeometryCollection"===W){for(ne=0;ne<P.geometry.geometries.length;ne++)li(G,{id:J,geometry:P.geometry.geometries[ne],properties:P.properties},k,F);return}throw new Error("Input data is not a valid GeoJSON object.")}for(ne=0;ne<j.length;ne++){var Se=[];sn(j[ne],Se,ce,!0),ee.push(Se)}}G.push(tr(J,W,ee,P.properties))}}function Xr(G,P){P.push(Y(G[0])),P.push(ei(G[1])),P.push(0)}function Sr(G,P,k,F){for(var j,W,ce=0,ee=0;ee<G.length;ee++){var J=Y(G[ee][0]),ne=ei(G[ee][1]);P.push(J),P.push(ne),P.push(0),ee>0&&(ce+=F?(j*ne-J*W)/2:Math.sqrt(Math.pow(J-j,2)+Math.pow(ne-W,2))),j=J,W=ne}var Se=P.length-3;P[2]=1,_r(P,0,Se,k),P[Se+2]=1,P.size=Math.abs(ce),P.start=0,P.end=P.size}function sn(G,P,k,F){for(var j=0;j<G.length;j++){var W=[];Sr(G[j],W,k,F),P.push(W)}}function Y(G){return G/360+.5}function ei(G){var P=Math.sin(G*Math.PI/180),k=.5-.25*Math.log((1+P)/(1-P))/Math.PI;return k<0?0:k>1?1:k}function w(G,P,k,F,j,W,ce,ee){if(F/=P,W>
vendor: 6,314 bytes, line 1
1=(k/=P)&&ce<F)return G;if(ce<k||W>=F)return null;for(var J=[],ne=0;ne<G.length;ne++){var Se=G[ne],Pe=Se.geometry,Le=Se.type,It=0===j?Se.minX:Se.minY,Zt=0===j?Se.maxX:Se.maxY;if(It>=k&&Zt<F)J.push(Se);else if(!(Zt<k||It>=F)){var bt=[];if("Point"===Le||"MultiPoint"===Le)z(Pe,bt,k,F,j);else if("LineString"===Le)Ee(Pe,bt,k,F,j,!1,ee.lineMetrics);else if("MultiLineString"===Le)oi(Pe,bt,k,F,j,!1);else if("Polygon"===Le)oi(Pe,bt,k,F,j,!0);else if("MultiPolygon"===Le)for(var Pt=0;Pt<Pe.length;Pt++){var Kt=[];oi(Pe[Pt],Kt,k,F,j,!0),Kt.length&&bt.push(Kt)}if(bt.length){if(ee.lineMetrics&&"LineString"===Le){for(Pt=0;Pt<bt.length;Pt++)J.push(tr(Se.id,Le,bt[Pt],Se.tags));continue}"LineString"!==Le&&"MultiLineString"!==Le||(1===bt.length?(Le="LineString",bt=bt[0]):Le="MultiLineString"),"Point"!==Le&&"MultiPoint"!==Le||(Le=3===bt.length?"Point":"MultiPoint"),J.push(tr(Se.id,Le,bt,Se.tags))}}}return J.length?J:null}function z(G,P,k,F,j){for(var W=0;W<G.length;W+=3){var ce=G[W+j];ce>=k&&ce<=F&&(P.push(G[W]),P.push(G[W+1]),P.push(G[W+2]))}}function Ee(G,P,k,F,j,W,ce){for(var ee,J,ne=ft(G),Se=0===j?ki:Mr,Pe=G.start,Le=0;Le<G.length-3;Le+=3){var It=G[Le],Zt=G[Le+1],bt=G[Le+2],Pt=G[Le+3],Kt=G[Le+4],bi=0===j?It:Zt,ni=0===j?Pt:Kt,hi=!1;ce&&(ee=Math.sqrt(Math.pow(It-Pt,2)+Math.pow(Zt-Kt,2))),bi<k?ni>k&&(J=Se(ne,It,Zt,Pt,Kt,k),ce&&(ne.start=Pe+ee*J)):bi>F?ni<F&&(J=Se(ne,It,Zt,Pt,Kt,F),ce&&(ne.start=Pe+ee*J)):mi(ne,It,Zt,bt),ni<k&&bi>=k&&(J=Se(ne,It,Zt,Pt,Kt,k),hi=!0),ni>F&&bi<=F&&(J=Se(ne,It,Zt,Pt,Kt,F),hi=!0),!W&&hi&&(ce&&(ne.end=Pe+ee*J),P.push(ne),ne=ft(G)),ce&&(Pe+=ee)}var ci=G.length-3;It=G[ci],Zt=G[ci+1],bt=G[ci+2],(bi=0===j?It:Zt)>=k&&bi<=F&&mi(ne,It,Zt,bt),ci=ne.length-3,W&&ci>=3&&(ne[ci]!==ne[0]||ne[ci+1]!==ne[1])&&mi(ne,ne[0],ne[1],ne[2]),ne.length&&P.push(ne)}function ft(G){var P=[];return P.size=G.size,P.start=G.start,P.end=G.end,P}function oi(G,P,k,F,j,W){for(var ce=0;ce<G.length;ce++)Ee(G[ce],P,k,F,j,W,!1)}function mi(G,P,k,F){G.push(P),G.push(k),G.push(F)}function ki(G,P,k,F,j,W){var ce=(W-P)/(F-P);return G.push(W),G.push(k+(j-k)*ce),G.push(1),ce}function Mr(G,P,k,F,j,W){var ce=(W-k)/(j-k);return G.push(P+(F-P)*ce),G.push(W),G.push(1),ce}function yr(G,P){for(var k=[],F=0;F<G.length;F++){var j,W=G[F],ce=W.type;if("Point"===ce||"MultiPoint"===ce||"LineString"===ce)j=Ir(W.geometry,P);else if("MultiLineString"===ce||"Polygon"===ce){j=[];for(var ee=0;ee<W.geometry.length;ee++)j.push(Ir(W.geometry[ee],P))}else if("MultiPolygon"===ce)for(j=[],ee=0;ee<W.geometry.length;ee++){for(var J=[],ne=0;ne<W.geometry[ee].length;ne++)J.push(Ir(W.geometry[ee][ne],P));j.push(J)}k.push(tr(W.id,ce,j,W.tags))}return k}function Ir(G,P){var k=[];k.size=G.size,void 0!==G.start&&(k.start=G.start,k.end=G.end);for(var F=0;F<G.length;F+=3)k.push(G[F]+P,G[F+1],G[F+2]);return k}function tt(G,P){if(G.transformed)return G;var k,F,j,W=1<<G.z,ce=G.x,ee=G.y;for(k=0;k<G.features.length;k++){var J=G.features[k],ne=J.geometry,Se=J.type;if(J.geometry=[],1===Se)for(F=0;F<ne.length;F+=2)J.geometry.push(Er(ne[F],ne[F+1],P,W,ce,ee));else for(F=0;F<ne.length;F++){var Pe=[];for(j=0;j<ne[F].length;j+=2)Pe.push(Er(ne[F][j],ne[F][j+1],P,W,ce,ee));J.geometry.push(Pe)}}return G.transformed=!0,G}function Er(G,P,k,F,j,W){return[Math.round(k*(G*F-j)),Math.round(k*(P*F-W))]}function zi(G,P,k,F,j){for(var W=P===j.maxZoom?0:j.tolerance/((1<<P)*j.extent),ce={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:k,y:F,z:P,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},ee=0;ee<G.length;ee++){ce.numFeatures++,Rn(ce,G[ee],W,j);var J=G[ee].minX,ne=G[ee].minY,Se=G[ee].maxX,Pe=G[ee].maxY;J<ce.minX&&(ce.minX=J),ne<ce.minY&&(ce.minY=ne),Se>ce.maxX&&(ce.maxX=Se),Pe>ce.maxY&&(ce.maxY=Pe)}return ce}function Rn(G,P,k,F){var j=P.geometry,W=P.type,ce=[];if("Point"===W||"MultiPoint"===W)for(var ee=0;ee<j.length;ee+=3)ce.push(j[ee]),ce.push(j[ee+1]),G.numPoints++,G.numSimplified++;else if("LineString"===W)Tr(ce,j,G,k,!1,!1);else if("MultiLineString"===W||"Polygon"===W)for(ee=0;ee<j.length;ee++)Tr(ce,j[ee],G,k,"Polygon"===W,0===ee);else if("MultiPolygon"===W)for(var J=0;J<j.length;J++){var ne=j[J];for(ee=0;ee<ne.length;ee++)Tr(ce,ne[ee],G,k,!0,0===ee)}if(ce.length){var Se=P.tags||null;if("LineString"===W&&F.lineMetrics){for(var Pe in Se={},P.tags)Se[Pe]=P.tags[Pe];Se.mapbox_clip_start=j.start/j.size,Se.mapbox_clip_end=j.end/j.size}var Le={geometry:ce,type:"Polygon"===W||"MultiPolygon"===W?3:"LineString"===W||"MultiLineString"===W?2:1,tags:Se};null!==P.id&&(Le.id=P.id),G.features.push(Le)}}function Tr(G,P,k,F,j,W){var ce=F*F;if(F>0&&P.size<(j?ce:F))k.numPoints+=P.length/3;else{for(var ee=[],J=0;J<P.length;J+=3)(0===F||P[J+2]>ce)&&(k.numSimplified++,ee.push(P[J]),ee.push(P[J+1])),k.numPoints++;j&&function(ne,Se){for(var Pe=0,Le=0,It=ne.length,Zt=It-2;Le<It;Zt=Le,Le+=2)Pe+=(ne[Le]-ne[Zt])*(ne[Le+1]+ne[Zt+1]);if(Pe>0===Se)for(Le=0,It=ne.length;Le<It/2;Le+=2){var bt=ne[Le],Pt=ne[Le+1];ne[Le]=ne[It-2-Le],ne[Le+1]=ne[It-1-Le],ne[It-2-Le]=bt,ne[It-1-Le]=Pt}}(ee,W),G.push(ee)}}function nt(G,P){var k=(P=this.options=function(j,W){for(var ce in W)j[ce]=W[ce];return j}(Object.create(this.options),P)).debug;if(k&&console.time("preprocess data"),P.maxZoom<0||P.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(P.promoteId&&P.generateId)throw new Error("promoteId and generateId cannot be used together.");var j,W,ce,ee,J,ne,F=function(j,W){var ce=[];if("FeatureCollection"===j.type)for(var ee=0;ee<j.features.length;ee++)li(ce,j.features[ee],W,ee);else li(ce,"Feature"===j.type?j:{geometry:j},W);return ce}(G,P);this.tiles={},this.tileCoords=[],k&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",P.indexMaxZoom,P.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),ee=j=F,J=w(j,1,-1-(ce=(W=P).buffer/W.extent),ce,0,-1,2,W),ne=w(j,1,1-ce,2+ce,0,-1,2,W),(J||ne)&&(ee=w(j,1,-ce,1+ce,0,-1,2,W)||[],J&&(ee=yr(J,1).concat(ee)),ne&&(ee=ee.concat(yr(ne,-1)))),(F=ee).length&&this.splitTile(F,0,0,0),k&&(F.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 Ht(G,P,k){return 32*((1<<G)*k+P)+G}function jt(G,P){return P?G.properties[P]:G.id}function dr(G,P){if(null==G)return!0;
1if("Feature"===G.type)return null!=jt(G,P);if("FeatureCollection"===G.type){const k=new Set;for(const F of G.features){const j=jt(F,P);if(null==j||k.has(j))return!1;k.add(j)}return!0}return!1}function Br(G,P){const k=new Map;if(null!=G)if("Feature"===G.type)k.set(jt(G,P),G);else for(const F of G.features)k.set(jt(F,P),F);return k}nt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},nt.prototype.splitTile=function(G,P,k,F,j,W,ce){for(var ee=[G,P,k,F],J=this.options,ne=J.debug;ee.length;){F=ee.pop(),k=ee.pop(),P=ee.pop(),G=ee.pop();var Se=1<<P,Pe=Ht(P,k,F),Le=this.tiles[Pe];if(!Le&&(ne>1&&console.time("creation"),Le=this.tiles[Pe]=zi(G,P,k,F,J),this.tileCoords.push({z:P,x:k,y:F}),ne)){ne>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",P,k,F,Le.numFeatures,Le.numPoints,Le.numSimplified),console.timeEnd("creation"));var It="z"+P;this.stats[It]=(this.stats[It]||0)+1,this.total++}if(Le.source=G,j){if(P===J.maxZoom||P===j)continue;var Zt=1<<j-P;if(k!==Math.floor(W/Zt)||F!==Math.floor(ce/Zt))continue}else if(P===J.indexMaxZoom||Le.numPoints<=J.indexMaxPoints)continue;if(Le.source=null,0!==G.length){ne>1&&console.time("clipping");var bt,Pt,Kt,bi,ni,hi,ci=.5*J.buffer/J.extent,sr=.5-ci,Ci=.5+ci,_e=1+ci;bt=Pt=Kt=bi=null,ni=w(G,Se,k-ci,k+Ci,0,Le.minX,Le.maxX,J),hi=w(G,Se,k+sr,k+_e,0,Le.minX,Le.maxX,J),G=null,ni&&(bt=w(ni,Se,F-ci,F+Ci,1,Le.minY,Le.maxY,J),Pt=w(ni,Se,F+sr,F+_e,1,Le.minY,Le.maxY,J),ni=null),hi&&(Kt=w(hi,Se,F-ci,F+Ci,1,Le.minY,Le.maxY,J),bi=w(hi,Se,F+sr,F+_e,1,Le.minY,Le.maxY,J),hi=null),ne>1&&console.timeEnd("clipping"),ee.push(bt||[],P+1,2*k,2*F),ee.push(Pt||[],P+1,2*k,2*F+1),ee.push(Kt||[],P+1,2*k+1,2*F),ee.push(bi||[],P+1,2*k+1,2*F+1)}}},nt.prototype.getTile=function(G,P,k){var F=this.options,j=F.extent,W=F.debug;if(G<0||G>24)return null;var ce=1<<G,ee=Ht(G,P=(P%ce+ce)%ce,k);if(this.tiles[ee])return tt(this.tiles[ee],j);W>1&&console.log("drilling down to z%d-%d-%d",G,P,k);for(var J,ne=G,Se=P,Pe=k;!J&&ne>0;)ne--,Se=Math.floor(Se/2),Pe=Math.floor(Pe/2),J=this.tiles[Ht(ne,Se,Pe)];return J&&J.source?(W>1&&console.log("found parent tile z%d-%d-%d",ne,Se,Pe),W>1&&console.time("drilling down"),this.splitTile(J.source,ne,Se,Pe,G,P,k),W>1&&console.timeEnd("drilling down"),this.tiles[ee]?tt(this.tiles[ee],j):null):null};class Bt extends me{constructor(P,k,F,j){super(P,k,F),this._dataUpdateable=new Map,this.loadGeoJSON=(W,ce)=>{const{promoteId:ee}=W;if(W.request)return c.f(W.request,(J,ne,Se,Pe)=>{this._dataUpdateable=dr(ne,ee)?Br(ne,ee):void 0,ce(J,ne,Se,Pe)});if("string"==typeof W.data)try{const J=JSON.parse(W.data);this._dataUpdateable=dr(J,ee)?Br(J,ee):void 0,ce(null,J)}catch{ce(new Error(`Input data given to '${W.source}' is not a valid GeoJSON object.`))}else W.dataDiff?this._dataUpdateable?(function(J,ne,Se){var Pe,Le,It,Zt;if(ne.removeAll&&J.clear(),ne.remove)for(const bt of ne.remove)J.delete(bt);if(ne.add)for(const bt of ne.add){const Pt=jt(bt,Se);null!=Pt&&J.set(Pt,bt)}if(ne.update)for(const bt of ne.update){let Pt=J.get(bt.id);if(null==Pt)continue;const Kt=!bt.removeAllProperties&&((null===(Pe=bt.removeProperties)||void 0===Pe?void 0:Pe.length)>0||(null===(Le=bt.addOrUpdateProperties)||void 0===Le?void 0:Le.length)>0);if((bt.newGeometry||bt.removeAllProperties||Kt)&&(Pt=Object.assign({},Pt),J.set(bt.id,Pt),Kt&&(Pt.properties=Object.assign({},Pt.properties))),bt.newGeometry&&(Pt.geometry=bt.newGeometry),bt.removeAllProperties)Pt.properties={};else if((null===(It=bt.removeProperties)||void 0===It?void 0:It.length)>0)for(const bi of bt.removeProperties)Object.prototype.hasOwnProperty.call(Pt.properties,bi)&&delete Pt.properties[bi];if((null===(Zt=bt.addOrUpdateProperties)||void 0===Zt?void 0:Zt.length)>0)for(const{key:bi,value:ni}of bt.addOrUpdateProperties)Pt.properties[bi]=ni}}(this._dataUpdateable,W.dataDiff,ee),ce(null,{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())})):ce(new Error(`Cannot update existing geojson data in ${W.source}`)):ce(new Error(`Input data given to '${W.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}},this.loadVectorData=this.loadGeoJSONTile,j&&(this.loadGeoJSON=j)}loadGeoJSONTile(P,k){const F=P.tileID.canonical;if(!this._geoJSONIndex)return k(null,null);const j=this._geoJSONIndex.getTile(F.z,F.x,F.y);if(!j)return k(null,null);const W=new class{constructor(ee){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=c.N,this.length=ee.length,this._features=ee}feature(ee){return new class{constructor(J){this._feature=J,this.extent=c.N,this.type=J.type,this.properties=J.tags,"id"in J&&!isNaN(J.id)&&(this.id=p
1arseInt(J.id,10))}loadGeometry(){if(1===this._feature.type){const J=[];for(const ne of this._feature.geometry)J.push([new c.P(ne[0],ne[1])]);return J}{const J=[];for(const ne of this._feature.geometry){const Se=[];for(const Pe of ne)Se.push(new c.P(Pe[0],Pe[1]));J.push(Se)}return J}}toGeoJSON(J,ne,Se){return zt.call(this,J,ne,Se)}}(this._features[ee])}}(j.features);let ce=We(W);0===ce.byteOffset&&ce.byteLength===ce.buffer.byteLength||(ce=new Uint8Array(ce)),k(null,{vectorTile:W,rawData:ce.buffer})}loadData(P,k){var F;null===(F=this._pendingRequest)||void 0===F||F.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const j=!!(P&&P.request&&P.request.collectResourceTiming)&&new c.bu(P.request);this._pendingCallback=k,this._pendingRequest=this.loadGeoJSON(P,(W,ce)=>{if(delete this._pendingCallback,delete this._pendingRequest,W||!ce)return k(W);if("object"!=typeof ce)return k(new Error(`Input data given to '${P.source}' is not a valid GeoJSON object.`));{Ze(ce,!0);try{if(P.filter){const J=c.bC(P.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===J.result)throw new Error(J.value.map(Se=>`${Se.key}: ${Se.message}`).join(", "));ce={type:"FeatureCollection",features:ce.features.filter(Se=>J.value.evaluate({zoom:0},Se))}}this._geoJSONIndex=P.cluster?new $t(function({superclusterOptions:J,clusterProperties:ne}){if(!ne||!J)return J;const Se={},Pe={},Le={accumulated:null,zoom:0},It={properties:null},Zt=Object.keys(ne);for(const bt of Zt){const[Pt,Kt]=ne[bt],bi=c.bC(Kt),ni=c.bC("string"==typeof Pt?[Pt,["accumulated"],["get",bt]]:Pt);Se[bt]=bi.value,Pe[bt]=ni.value}return J.map=bt=>{It.properties=bt;const Pt={};for(const Kt of Zt)Pt[Kt]=Se[Kt].evaluate(Le,It);return Pt},J.reduce=(bt,Pt)=>{It.properties=Pt;for(const Kt of Zt)Le.accumulated=bt[Kt],bt[Kt]=Pe[Kt].evaluate(Le,It)},J}(P)).load(ce.features):new nt(J=ce,P.geojsonVtOptions)}catch(J){return k(J)}this.loaded={};const ee={};if(j){const J=j.finish();J&&(ee.resourceTiming={},ee.resourceTiming[P.source]=JSON.parse(JSON.stringify(J)))}k(null,ee)}var J})}reloadTile(P,k){const F=this.loaded;return F&&F[P.uid]?super.reloadTile(P,k):this.loadTile(P,k)}removeSource(P,k){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),k()}getClusterExpansionZoom(P,k){try{k(null,this._geoJSONIndex.getClusterExpansionZoom(P.clusterId))}catch(F){k(F)}}getClusterChildren(P,k){try{k(null,this._geoJSONIndex.getChildren(P.clusterId))}catch(F){k(F)}}getClusterLeaves(P,k){try{k(null,this._geoJSONIndex.getLeaves(P.clusterId,P.limit,P.offset))}catch(F){k(F)}}}class Gr{constructor(P){this.self=P,this.actor=new c.C(P,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:me,geojson:Bt},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(k,F)=>{if(this.workerSourceTypes[k])throw new Error(`Worker source with name "${k}" already registered.`);this.workerSourceTypes[k]=F},this.self.registerRTLTextPlugin=k=>{if(c.bD.isParsed())throw new Error("RTL text plugin already registered.");c.bD.applyArabicShaping=k.applyArabicShaping,c.bD.processBidirectionalText=k.processBidirectionalText,c.bD.processStyledBidirectionalText=k.processStyledBidirectionalText}}setReferrer(P,k){this.referrer=k}setImages(P,k,F){this.availableImages[P]=k;for(const j in this.workerSources[P]){const W=this.workerSources[P][j];for(const ce in W)W[ce].availableImages=k}F()}setLayers(P,k,F){this.getLayerIndex(P).replace(k),F()}updateLayers(P,k,F){this.getLayerIndex(P).update(k.layers,k.removedIds),F()}loadTile(P,k,F){this.getWorkerSource(P,k.type,k.source).loadTile(k,F)}loadDEMTile(P,k,F){this.getDEMWorkerSource(P,k.source).loadTile(k,F)}reloadTile(P,k,F){this.getWorkerSource(P,k.type,k.source).reloadTile(k,F)}abortTile(P,k,F){this.getWorkerSource(P,k.type,k.source).abortTile(k,F)}removeTile(P,k,F){this.getWorkerSource(P,k.type,k.source).removeTile(k,F)}removeDEMTile(P,k){this.getDEMWorkerSource(P,k.source).removeTile(k)}removeSource(P,k,F){if(!this.workerSources[P]||!this.workerSources[P][k.type]||!this.workerSources[P][k.type][k.source])return;const j=this.workerSources[P][k.type][k.source];delete this.workerSources[P][k.type][k.source],void 0!==j.removeSource?j.removeSource(k,F):F()}loadWorkerSource(P,k,F){try{this.self.importScripts(k.url),F()}catch(j){F(j.toString())}}syncRTLPluginState(P,k,F){try{c.bD.setState(k);const j=c.bD.getPluginURL();if(c.bD.isLoaded()&&!c.bD.isParsed()&&null!=j){this.self.importScripts(j);const W=c.bD.isParsed();F(W?void 0:new Error(`RTL Text Plugin failed to import scripts from ${j}`),W)}}catch(j){F(j.toString())}}getAvailableImages(P){let k=this.availableImages[P];
1return k||(k=[]),k}getLayerIndex(P){let k=this.layerIndexes[P];return k||(k=this.layerIndexes[P]=new Q),k}getWorkerSource(P,k,F){return this.workerSources[P]||(this.workerSources[P]={}),this.workerSources[P][k]||(this.workerSources[P][k]={}),this.workerSources[P][k][F]||(this.workerSources[P][k][F]=new this.workerSourceTypes[k]({send:(j,W,ce)=>{this.actor.send(j,W,ce,P)}},this.getLayerIndex(P),this.getAvailableImages(P))),this.workerSources[P][k][F]}getDEMWorkerSource(P,k){return this.demWorkerSources[P]||(this.demWorkerSources[P]={}),this.demWorkerSources[P][k]||(this.demWorkerSources[P][k]=new ut),this.demWorkerSources[P][k]}}return c.i()&&(self.worker=new Gr(self)),Gr}),ke(0,function(c){var Q="3.6.2";class pe{static testProp(t){if(!pe.docStyle)return t[0];for(let n=0;n<t.length;n++)if(t[n]in pe.docStyle)return t[n];return t[0]}static create(t,n,s){const l=window.document.createElement(t);return void 0!==n&&(l.className=n),s&&s.appendChild(l),l}static createNS(t,n){return window.document.createElementNS(t,n)}static disableDrag(){pe.docStyle&&pe.selectProp&&(pe.userSelect=pe.docStyle[pe.selectProp],pe.docStyle[pe.selectProp]="none")}static enableDrag(){pe.docStyle&&pe.selectProp&&(pe.docStyle[pe.selectProp]=pe.userSelect)}static setTransform(t,n){t.style[pe.transformProp]=n}static addEventListener(t,n,s,l={}){t.addEventListener(n,s,"passive"in l?l:l.capture)}static removeEventListener(t,n,s,l={}){t.removeEventListener(n,s,"passive"in l?l:l.capture)}static suppressClickInternal(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",pe.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",pe.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",pe.suppressClickInternal,!0)},0)}static mousePos(t,n){const s=t.getBoundingClientRect();return new c.P(n.clientX-s.left-t.clientLeft,n.clientY-s.top-t.clientTop)}static touchPos(t,n){const s=t.getBoundingClientRect(),l=[];for(let d=0;d<n.length;d++)l.push(new c.P(n[d].clientX-s.left-t.clientLeft,n[d].clientY-s.top-t.clientTop));return l}static mouseButton(t){return t.button}static remove(t){t.parentNode&&t.parentNode.removeChild(t)}}pe.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,pe.selectProp=pe.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),pe.transformProp=pe.testProp(["transform","WebkitTransform"]);const Ct={supported:!1,testSupport:function(u){!me&&Ce&&(ut?Be(u):Ue=u)}};let Ue,Ce,me=!1,ut=!1;function Be(u){const t=u.createTexture();u.bindTexture(u.TEXTURE_2D,t);try{if(u.texImage2D(u.TEXTURE_2D,0,u.RGBA,u.RGBA,u.UNSIGNED_BYTE,Ce),u.isContextLost())return;Ct.supported=!0}
1catch{}u.deleteTexture(t),me=!0}var He,Ze,u;typeof document<"u"&&(Ce=document.createElement("img"),Ce.onload=function(){Ue&&Be(Ue),Ue=null,ut=!0},Ce.onerror=function(){me=!0,Ue=null},Ce.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(u){let t,n,s,l;u.resetRequestQueue=()=>{t=[],n=0,s=0,l={}},u.addThrottleControl=S=>{const I=s++;return l[I]=S,I},u.removeThrottleControl=S=>{delete l[S],_()},u.getImage=(S,I,E=!0)=>{Ct.supported&&(S.headers||(S.headers={}),S.headers.accept="image/webp,*/*");const D={requestParameters:S,supportImageRefresh:E,callback:I,cancelled:!1,completed:!1,cancel:()=>{D.completed||D.cancelled||(D.cancelled=!0,D.innerRequest&&(D.innerRequest.cancel(),n--),_())}};return t.push(D),_(),D};const d=S=>{const{requestParameters:I,supportImageRefresh:E,callback:D}=S;return c.e(I,{type:"image"}),(!1!==E||c.i()||c.g(I.url)||I.headers&&!Object.keys(I.headers).reduce((V,U)=>V&&"accept"===U,!0)?c.m:v)(I,(V,U,$,B)=>{g(S,D,V,U,$,B)})},g=(S,I,E,D,V,U)=>{var $,B;E?I(E):D instanceof HTMLImageElement||c.a(D)?I(null,D):D&&($=D,B=($,B)=>{null!=$?I($):null!=B&&I(null,B,{cacheControl:V,expires:U})},"function"==typeof createImageBitmap?c.b($,B):c.d($,B)),S.cancelled||(S.completed=!0,n--,_())},_=()=>{const S=(()=>{const I=Object.keys(l);let E=!1;if(I.length>0)for(const D of I)if(E=l[D](),E)break;return E})()?c.c.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:c.c.MAX_PARALLEL_IMAGE_REQUESTS;for(let I=n;I<S&&t.length>0;I++){const E=t.shift();if(E.cancelled){I--;continue}const D=d(E);n++,E.innerRequest=D}},v=(S,I)=>{const E=new Image,D=S.url;let V=!1;const U=S.credentials;return U&&"include"===U?E.crossOrigin="use-credentials":(U&&"same-origin"===U||!c.s(D))&&(E.crossOrigin="anonymous"),E.fetchPriority="high",E.onload=()=>{I(null,E),E.onerror=E.onload=null},E.onerror=()=>{V||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.")),E.onerror=E.onload=null},E.src=D,{cancel:()=>{V=!0,E.src=""}}}}(He||(He={})),He.resetRequestQueue(),(u=Ze||(Ze={})).Glyphs="Glyphs",u.Image="Image",u.Source="Source",u.SpriteImage="SpriteImage",u.SpriteJSON="SpriteJSON",u.Style="Style",u.Tile="Tile",u.Unknown="Unknown";class zt{constructor(t){this._transformRequestFn=t}transformRequest(t,n){return this._transformRequestFn&&this._transformRequestFn(t,n)||{url:t}}normalizeSpriteURL(t,n,s){const l=function(d){const g=d.match(Rt);if(!g)throw new Error(`Unable to parse URL "${d}"`);return{protocol:g[1],authority:g[2],path:g[3]||"/",params:g[4]?g[4].split("&"):[]}}(t);return l.path+=`${n}${s}`,function(d){const g=d.params.length?`?${d.params.join("&")}`:"";return`${d.protocol}://${d.authority}${d.path}${g}`}(l)}setTransformRequest(t){this._transformRequestFn=t}}const Rt=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function xt(u){var t=new c.A(3);return t[0]=u[0],t[1]=u[1],t[2]=u[2],t}var si,be=function(u,t,n){return u[0]=t[0]-n[0],u[1]=t[1]-n[1],u[2]=t[2]-n[2],u};si=new c.A(3),c.A!=Float32Array&&(si[0]=0,si[1]=0,si[2]=0);var De=function(u){var t=u[0],n=u[1];return t*t+n*n};function Ae(u){const t=[];if("string"==typeof u)t.push({id:"default",url:u});else if(u&&u.length>0){const n=[];for(const{id:s,url:l}of u){const d=`${s}${l}`;-1===n.indexOf(d)&&(n.push(d),t.push({id:s,url:l}))}}return t}function Me(u,t,n,s,l){if(s)return void u(s);if(l!==Object.values(t).length||l!==Object.values(n).length)return;const d={};for(const g in t){d[g]={};const _=c.h.getImageCanvasContext(n[g]),v=t[g];for(const S in v){const{width:I,height:E,x:D,y:V,sdf:U,pixelRatio:$,stretchX:B,stretchY:oe,content:fe}=v[S];d[g][S]={data:null,pixelRatio:$,sdf:U,stretchX:B,stretchY:oe,content:fe,spriteData:{width:I,height:E,x:D,y:V,context:_}}}}u(null,d)}!function(){var u=new c.A(2);c.A!=Float32Array&&(u[0]=0,u[1]=0)}();class Ve{constructor(t,n,s,l){this.context=t,this.format=s,this.texture=t.gl.createTexture(),this.update(n,l)}update(t,n,s){const{width:l,height:d}=t,g=!(this.size&&this.size[0]===l&&this.size[1]===d||s),{context:_}=this,{gl:v}=_;if(this.useMipmap=!(!n||!n.useMipmap),v.bindTexture(v.TEXTURE_2D,this.texture),_.pixelStoreUnpackFlipY.set(!1),_.pixelStoreUnpack.set(1),_.pixelStoreUnpackPremultiplyAlpha.set(this.format===v.RGBA&&(!n||!1!==n.premultiply)),g)this.size=[l,d],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||c.a(t)?v.texImage2D(v.TEXTURE_2D,0,this.format,this.format,v.UNSIGNED_BYTE,t):v.texImage2D(v.TEXTURE_2D,0,this.format,l,d,0,this.format,v.UNSIGNED_BYTE,t.data);else{const{x:S,y:I}=s||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||c.a(t)?v.texSubImage2D(v.TEXTURE_2D,0,S,I,v.RGBA,v.UNSIGNED_BYTE,t):v.texSubImage2D(v.TEXTURE_2D,0,S,I,l,d,v.RGBA,v.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&v.generateMipmap(v.TEXTURE_2D)}bind(t,n,s){const{context:l}=this,{gl:d}=l;d.bindTexture(d.TEXTURE_2D,this.texture),s!==d.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(s=d.LINEAR),t!==this.filter&&(d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,t),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,s||t),this.filter=t),n!==this.wrap&&(d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,n),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,n),this.wrap=n)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}function Oe(u){const{userImage:t}=u;return!!(t&&t.render&&t.render())&&(u.data.replace(new Uint8Array(t.data.buffer)),!0)}class Ie extends c.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new c.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(const{ids:n,callback:s}of this.requestors)this._notify(n,s);this.requestors=[]}}getImage(t){const n=this.images[t];if(n&&!n.data&&n.spriteData){const s=n.spriteData;n.data=new c.R({width:s.width,height:s.height},s.context.getImageData(s.x,s.y,s.width,s.height).data),n.spriteData=null}return n}addImage(t,n){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);
vendor: 1,690 bytes, line 1
1this._validate(t,n)&&(this.images[t]=n)}_validate(t,n){let s=!0;const l=n.data||n.spriteData;return this._validateStretch(n.stretchX,l&&l.width)||(this.fire(new c.j(new Error(`Image "${t}" has invalid "stretchX" value`))),s=!1),this._validateStretch(n.stretchY,l&&l.height)||(this.fire(new c.j(new Error(`Image "${t}" has invalid "stretchY" value`))),s=!1),this._validateContent(n.content,n)||(this.fire(new c.j(new Error(`Image "${t}" has invalid "content" value`))),s=!1),s}_validateStretch(t,n){if(!t)return!0;let s=0;for(const l of t){if(l[0]<s||l[1]<l[0]||n<l[1])return!1;s=l[1]}return!0}_validateContent(t,n){if(!t)return!0;if(4!==t.length)return!1;const s=n.spriteData,l=s&&s.width||n.data.width,d=s&&s.height||n.data.height;return!(t[0]<0||l<t[0]||t[1]<0||d<t[1]||t[2]<0||l<t[2]||t[3]<0||d<t[3]||t[2]<t[0]||t[3]<t[1])}updateImage(t,n,s=!0){const l=this.getImage(t);if(s&&(l.data.width!==n.data.width||l.data.height!==n.data.height))throw new Error(`size mismatch between old image (${l.data.width}x${l.data.height}) and new image (${n.data.width}x${n.data.height}).`);n.version=l.version+1,this.images[t]=n,this.updatedImages[t]=!0}removeImage(t){const n=this.images[t];delete this.images[t],delete this.patterns[t],n.userImage&&n.userImage.onRemove&&n.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(t,n){let s=!0;if(!this.isLoaded())for(const l of t)this.images[l]||(s=!1);this.isLoaded()||s?this._notify(t,n):this.requestors.push({ids:t,callback:n})}_notify(t,n){const s={};for(const l of t){let d=this.getImage(l);d||(this.fire(new c.k("styleimagemissing",{id:l})),d=this.getImage(l)),d?s[l]={data:d.data.clone(),pixelRatio:d.pixelRatio,sdf:d.sdf,ver
1sion:d.version,stretchX:d.stretchX,stretchY:d.stretchY,content:d.content,hasRenderCallback:!(!d.userImage||!d.userImage.render)}:c.w(`Image "${l}" 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.`)}n(null,s)}getPixelSize(){const{width:t,height:n}=this.atlasImage;return{width:t,height:n}}getPattern(t){const n=this.patterns[t],s=this.getImage(t);if(!s)return null;if(n&&n.position.version===s.version)return n.position;if(n)n.position.version=s.version;else{const l={w:s.data.width+2,h:s.data.height+2,x:0,y:0},d=new c.I(l,s);this.patterns[t]={bin:l,position:d}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){const n=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new Ve(t,this.atlasImage,n.RGBA),this.atlasTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}_updatePatternAtlas(){const t=[];for(const d in this.patterns)t.push(this.patterns[d].bin);const{w:n,h:s}=c.p(t),l=this.atlasImage;l.resize({width:n||1,height:s||1});for(const d in this.patterns){const{bin:g}=this.patterns[d],_=g.x+1,v=g.y+1,S=this.getImage(d).data,I=S.width,E=S.height;c.R.copy(S,l,{x:0,y:0},{x:_,y:v},{width:I,height:E}),c.R.copy(S,l,{x:0,y:E-1},{x:_,y:v-1},{width:I,height:1}),c.R.copy(S,l,{x:0,y:0},{x:_,y:v+E},{width:I,height:1}),c.R.copy(S,l,{x:I-1,y:0},{x:_-1,y:v},{width:1,height:E}),c.R.copy(S,l,{x:0,y:0},{x:_+I,y:v},{width:1,height:E})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(const n of t){if(this.callbackDispatchedThisFrame[n])continue;this.callbackDispatchedThisFrame[n]=!0;const s=this.getImage(n);s||c.w(`Image with ID: "${n}" was not found`),Oe(s)&&this.updateImage(n,s)}}}const Qe=1e20;function ze(u,t,n,s,l,d,g,_,v){for(let S=t;S<t+s;S++)Gt(u,n*d+S,d,l,g,_,v);for(let S=n;S<n+l;S++)Gt(u,S*d+t,1,s,g,_,v)}function Gt(u,t,n,s,l,d,g){d[0]=0,g[0]=-Qe,g[1]=Qe,l[0]=u[t];for(let _=1,v=0,S=0;_<s;_++){l[_]=u[t+_*n];const I=_*_;do{const E=d[v];S=(l[_]-l[E]+I-E*E)/(_-E)/2}while(S<=g[v]&&--v>-1);v++,d[v]=_,g[v]=S,g[v+1]=Qe}for(let _=0,v=0;_<s;_++){for(;g[v+1]<_;)v++;const S=d[v],I=_-S;u[t+_*n]=l[S]+I*I}}class St{constructor(t,n){this.requestManager=t,this.localIdeographFontFamily=n,this.entries={}}setURL(t){this.url=t}getGlyphs(t,n){const s=[];for(const l in t)for(const d of t[l])s.push({stack:l,id:d});c.o(s,({stack:l,id:d},g)=>{let _=this.entries[l];_||(_=this.entries[l]={glyphs:{},requests:{},ranges:{}});let v=_.glyphs[d];if(void 0!==v)return void g(null,{stack:l,id:d,glyph:v});if(v=this._tinySDF(_,l,d),v)return _.glyphs[d]=v,void g(null,{stack:l,id:d,glyph:v});const S=Math.floor(d/256);if(256*S>65535)return void g(new Error("glyphs > 65535 not supported"));if(_.ranges[S])return void g(null,{stack:l,id:d,glyph:v});if(!this.url)return void g(new Error("glyphsUrl is not set"));let I=_.requests[S];I||(I=_.requests[S]=[],St.loadGlyphRange(l,S,this.url,this.requestManager,(E,D)=>{if(D){for(const V in D)this._doesCharSupportLocalGlyph(+V)||(_.glyphs[+V]=D[+V]);_.ranges[S]=!0}for(const V of I)V(E,D);delete _.requests[S]})),I.push((E,D)=>{E?g(E):D&&g(null,{stack:l,id:d,glyph:D[d]||null})})},(l,d)=>{if(l)n(l);else if(d){const g={};for(const{stack:_,id:v,glyph:S}of d)(g[_]||(g[_]={}))[v]=S&&{id:S.id,bitmap:S.bitmap.clone(),metrics:S.metrics};n(null,g)}})}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&(c.u["CJK Unified Ideographs"](t)||c.u["Hangul Syllables"](t)||c.u.Hiragana(t)||c.u.Katakana(t))}_tinySDF(t,n,s){const l=this.localIdeographFontFamily;if(!l||!this._doesCharSupportLocalGlyph(s))return;let d=t.tinySDF;if(!d){let _="400";/bold/i.test(n)?_="900":/medium/i.test(n)?_="500":/light/i.test(n)&&(_="200"),d=t.tinySDF=new St.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:l,fontWeight:_})}const g=d.draw(String.fromCharCode(s));return{id:s,bitmap:new c.q({width:g.width||60,height:g.height||60},g.data),metrics:{width:g.glyphWidth/2||24,height:g.glyphHeight/2||24,left:g.glyphLeft/2+.5||0,top:g.glyphTop/2-27.5||-8,advance:g.glyphAdvance/2||24,isDoubleResolution:!0}}}}St.loadGlyphRange=function(u,t,n,s,l){const d=256*t,g=d+255,_=s.transformRequest(n.replace("{fontstack}",u).replace("{range}",`${d}-${g}`),Ze.Glyphs);c.l(_,(v,S)=>{if(v)l(v);else if(S){const I={};for(const E of c.n(S))I[E.id]=E;l(null,I)}})},St.TinySDF=class{constructor({fontSize:u=24,buffer:t=3,radius:n=8,cutoff:s=.25,fontFamily:l="sans-serif",fontWeight:d="normal",fontStyle:g="normal"}={}){this.buffer=t,this.cutoff=s,this.radius=n;const _=this.size=u+4*t,v=this._createCanvas(_),S=this.ctx=v.getContext("2d",{willReadFrequently:!0});S.font=`${g} ${d} ${u}px ${l}`,S.textBaseline="alphabetic",S.textAlign="left",S.fillStyle="black",this.gridOuter=new Float64Array(_*_),this.gridInner=new Float64Array(_*_),this.f=new Float64Array(_),this.z=new Float64Array(_+1),this.v=new Uint16Array(_)}_createCanvas(u){const t=document.createElement("canvas");return t.width=t.height=u,t}draw(u){const{width:t,actualBoundingBoxAscent:n,actualBoundingBoxDescent:s,actualBoundingBoxLeft:l,actualBoundingBoxRight:d}=this.ctx.measureText(u),g=Math.ceil(n),_=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(d-l))),v=Math.min(this.size-this.buffer,g+Math.ceil(s)),S=_+2*this.buffer,I=v+2*this.buffer,E=Math.max(S*I,0),D=new Uint8ClampedArray(E),V={data:D,width:S,height:I,glyphWidth:_,glyphHeight:v,glyphTop:g,glyphLeft:0,glyphAdvance:t};if(0===_||0===v)return V;const{ctx:U,buffer:$,gridInner:B,gridOuter:oe}=this;U.clearRect($,$,_,v),U.fillText(u,$,$+g);const fe=U.getImageData($,$,_,v);oe.fill(Qe,0,E),B.fill(0,0,E);for(let K=0;K<v;K++)for(let ae=0;ae<_;ae++){const ve=fe.data[4*(K*_+ae)+3]/255;if(0===ve)continue;const xe=(K+$)*S+ae+$;if(1===ve)oe[xe]=0,B[xe]=Qe;else{const Re=.5-ve;oe[xe]=Re>0?Re*Re:0,B[xe]=Re<0?Re*Re:0}}ze(oe,0,0,S,I,S,this.f,this.v,this.z),ze(B,$,$,_,v,S,this.f,this.v,this.z);for(let K=0;K<E;K++){const ae=Math.sqrt(oe[K])-Math.sqrt(B[K]);D[K]=Math.round(255-255*(ae/this.radius+this.cutoff))}return V}};class ht{constructor(){this.specification=c.v.light.position}possiblyEvaluate(t,n){return c.z(t.expression.evaluate(n))}interpolate(t,n,s){return{x:c.B.number(t.x,n.x,s),y:c.B.number(t.y,n.y,s),z:c.B.number(t.z,n.z,s)}}}let $e;class We extends c.E{constructor(t){super(),$e=$e||new c.r({anchor:new c.D(c.v.light.anchor),position:new ht,color:new c.D(c.v.light.color),intensity:new c.D(c.v.light.intensity)}),this._transitionable=new c.T($e),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t,n={}
vendor: 2,749 bytes, line 1
1){if(!this._validate(c.t,t,n))for(const s in t){const l=t[s];s.endsWith("-transition")?this._transitionable.setTransition(s.slice(0,-11),l):this._transitionable.setValue(s,l)}}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,n,s){return(!s||!1!==s.validate)&&c.x(this,t.call(c.y,c.e({value:n,style:{glyphs:!0,sprite:!0},styleSpec:c.v})))}}class et{constructor(t,n){this.width=t,this.height=n,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(t,n){const s=t.join(",")+String(n);return this.dashEntry[s]||(this.dashEntry[s]=this.addDash(t,n)),this.dashEntry[s]}getDashRanges(t,n,s){const l=[];let d=t.length%2==1?-t[t.length-1]*s:0,g=t[0]*s,_=!0;l.push({left:d,right:g,isDash:_,zeroLength:0===t[0]});let v=t[0];for(let S=1;S<t.length;S++){_=!_;const I=t[S];d=v*s,v+=I,g=v*s,l.push({left:d,right:g,isDash:_,zeroLength:0===I})}return l}addRoundDash(t,n,s){const l=n/2;for(let d=-s;d<=s;d++){const g=this.width*(this.nextRow+s+d);let _=0,v=t[_];for(let S=0;S<this.width;S++){S/v.right>1&&(v=t[++_]);const I=Math.abs(S-v.left),E=Math.abs(S-v.right),D=Math.min(I,E);let V;const U=d/s*(l+1);if(v.isDash){const $=l-Math.abs(U);V=Math.sqrt(D*D+$*$)}else V=l-Math.sqrt(D*D+U*U);this.data[g+S]=Math.max(0,Math.min(255,V+128))}}}addRegularDash(t){for(let _=t.length-1;_>=0;--_){const v=t[_],S=t[_+1];v.zeroLength?t.splice(_,1):S&&S.isDash===v.isDash&&(S.left=v.left,t.splice(_,1))}const n=t[0],s=t[t.length-1];n.isDash===s.isDash&&(n.left=s.left-this.width,s.right=n.right+this.width);const l=this.width*this.nextRow;let d=0,g=t[d];for(let _=0;_<this.width;_++){_/g.right>1&&(g=t[++d]);const v=Math.abs(_-g.left),S=Math.abs(_-g.right),I=Math.min(v,S);this.data[l+_]=Math.max(0,Math.min(255,(g.isDash?I:-I)+128))}}addDash(t,n){const s=n?7:0,l=2*s+1;if(this.nextRow+l>this.height)return c.w("LineAtlas out of space"),null;let d=0;for(let _=0;_<t.length;_++)d+=t[_];if(0!==d){const _=this.width/d,v=this.getDashRanges(t,this.width,_);n?this.addRoundDash(v,_,s):this.addRegularDash(v)}const g={y:(this.nextRow+s+.5)/this.height,height:2*s/this.height,width:d};return this.nextRow+=l,this.dirty=!0,g}bind(t){const n=t.gl;this.texture?(n.bindTexture(n.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,n.texSubImage2D(n.TEXTURE_2D,0,0,0,this.width,this.height,n.ALPHA,n.UNSIGNED_BYTE,this.data))):(this.texture=n.createTexture(),n.bindTexture(n.TEXTURE_2D,this.texture),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.REPEAT),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.REPEAT),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.L
1INEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texImage2D(n.TEXTURE_2D,0,n.ALPHA,this.width,this.height,0,n.ALPHA,n.UNSIGNED_BYTE,this.data))}}class Ut{constructor(t,n,s){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=s;const l=this.workerPool.acquire(s);for(let d=0;d<l.length;d++){const g=new c.C(l[d],n,s);g.name=`Worker ${d}`,this.actors.push(g)}if(!this.actors.length)throw new Error("No actors found")}broadcast(t,n,s){c.o(this.actors,(l,d)=>{l.send(t,n,d)},s=s||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(t=!0){this.actors.forEach(n=>{n.remove()}),this.actors=[],t&&this.workerPool.release(this.id)}}function Oi(u,t,n){const s=function(l,d){if(l)return n(l);if(d){const g=c.F(c.e(d,u),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);d.vector_layers&&(g.vectorLayers=d.vector_layers,g.vectorLayerIds=g.vectorLayers.map(_=>_.id)),n(null,g)}};return u.url?c.f(t.transformRequest(u.url,Ze.Source),s):c.h.frame(()=>s(null,u))}class Ke{constructor(t,n){t&&(n?this.setSouthWest(t).setNorthEast(n):Array.isArray(t)&&(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 c.L?new c.L(t.lng,t.lat):c.L.convert(t),this}setSouthWest(t){return this._sw=t instanceof c.L?new c.L(t.lng,t.lat):c.L.convert(t),this}extend(t){const n=this._sw,s=this._ne;let l,d;if(t instanceof c.L)l=t,d=t;else{if(!(t instanceof Ke))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(Ke.convert(t)):this.extend(c.L.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(c.L.convert(t)):this;if(l=t._sw,d=t._ne,!l||!d)return this}return n||s?(n.lng=Math.min(l.lng,n.lng),n.lat=Math.min(l.lat,n.lat),s.lng=Math.max(d.lng,s.lng),s.lat=Math.max(d.lat,s.lat)):(this._sw=new c.L(l.lng,l.lat),this._ne=new c.L(d.lng,d.lat)),this}getCenter(){return new c.L((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 c.L(this.getWest(),this.getNorth())}getSouthEast(){return new c.L(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:n,lat:s}=c.L.convert(t);let l=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(l=this._sw.lng>=n&&n>=this._ne.lng),this._sw.lat<=s&&s<=this._ne.lat&&l}static convert(t){return t instanceof Ke?t:t&&new Ke(t)}static fromLngLat(t,n=0){const s=360*n/40075017,l=s/Math.cos(Math.PI/180*t.lat);return new Ke(new c.L(t.lng-l,t.lat-s),new c.L(t.lng+l,t.lat+s))}}class ri{constructor(t,n,s){this.bounds=Ke.convert(this.validateBounds(t)),this.minzoom=n||0,this.maxzoom=s||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(t){const n=Math.pow(2,t.z),s=Math.floor(c.G(this.bounds.getWest())*n),l=Math.floor(c.H(this.bounds.getNorth())*n),d=Math.ceil(c.G(this.bounds.getEast())*n),g=Math.ceil(c.H(this.bounds.getSouth())*n);return t.x>=s&&t.x<d&&t.y>=l&&t.y<g}}class wt extends c.E{constructor(t,n,s,l){if(super(),this.load=()=>{this._loaded=!1,this.fire(new c.k("dataloading",{dataType:"source"})),this._tileJSONRequest=Oi(this._options,this.map._requestManager,(d,g)=>{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),d?this.fire(new c.j(d)):g&&(c.e(this,g),g.bounds&&(this.tileBounds=new ri(g.bounds,this.minzoom,this.maxzoom)),this.fire(new c.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new c.k("data",{dataType:"source",sourceDataType:"content"})))})},this.serialize=()=>c.e({},this._options),this.id=t,this.dispatcher=s,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,c.e(this,c.F(n,["url","scheme","tileSize","promoteId"])),this._options=c.e({type:"vector"},n),this._collectResourceTiming=n.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(l)}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(),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)}loadTile(t,n){const s=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),l={request:this.map._requestManager.transformRequest(s,Ze.Tile),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.t
1ype,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function d(g,_){return delete t.request,t.aborted?n(null):g&&404!==g.status?n(g):(_&&_.resourceTiming&&(t.resourceTiming=_.resourceTiming),this.map._refreshExpiredTiles&&_&&t.setExpiryData(_),t.loadVectorData(_,this.map.painter),n(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}l.request.collectResourceTiming=this._collectResourceTiming,t.actor&&"expired"!==t.state?"loading"===t.state?t.reloadCallback=n:t.request=t.actor.send("reloadTile",l,d.bind(this)):(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",l,d.bind(this)))}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},void 0)}unloadTile(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class $t extends c.E{constructor(t,n,s,l){super(),this.id=t,this.dispatcher=s,this.setEventedParent(l),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=c.e({type:"raster"},n),c.e(this,c.F(n,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new c.k("dataloading",{dataType:"source"})),this._tileJSONRequest=Oi(this._options,this.map._requestManager,(t,n)=>{this._tileJSONRequest=null,this._loaded=!0,t?this.fire(new c.j(t)):n&&(c.e(this,n),n.bounds&&(this.tileBounds=new ri(n.bounds,this.minzoom,this.maxzoom)),this.fire(new c.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new c.k("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)}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}serialize(){return c.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t,n){const s=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.request=He.getImage(this.map._requestManager.transformRequest(s,Ze.Tile),(l,d,g)=>{if(delete t.request,t.aborted)t.state="unloaded",n(null);else if(l)t.state="errored",n(l);else if(d){this.map._refreshExpiredTiles&&g&&t.setExpiryData(g);const _=this.map.painter.context,v=_.gl;t.texture=this.map.painter.getTileTexture(d.width),t.texture?t.texture.update(d,{useMipmap:!0}):(t.texture=new Ve(_,d,v.RGBA,{useMipmap:!0}),t.texture.bind(v.LINEAR,v.CLAMP_TO_EDGE,v.LINEAR_MIPMAP_NEAREST),_.extTextureFilterAnisotropic&&v.texParameterf(v.TEXTURE_2D,_.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,_.extTextureFilterAnisotropicMax)),t.state="loaded",n(null)}},this.map._refreshExpiredTiles)}abortTile(t,n){t.request&&(t.request.cancel(),delete t.request),n()}unloadTile(t,n){t.texture&&this.map.painter.saveTileTexture(t.texture),n()}hasTransition(){return!1}}class Qt extends $t{constructor(t,n,s,l){super(t,n,s,l),this.type="raster-dem",this.maxzoom=22,this._options=c.e({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox",this.redFactor=n.redFactor,this.greenFactor=n.greenFactor,this.blueFactor=n.blueFactor,this.baseShift=n.baseShift}loadTile(t,n){const s=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),l=this.map._requestManager.transformRequest(s,Ze.Tile);function d(g,_){g&&(t.state="errored",n(g)),_&&(t.dem=_,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded",n(null))}t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.request=He.getImage(l,(g,_,v)=>c._(this,void 0,void 0,function*(){if(delete t.request,t.aborted)t.state="unloaded",n(null);else if(g)t.state="errored",n(g);else if(_){this.map._refreshExpiredTiles&&t.setExpiryData(v);const S=c.a(_)&&c.J()?_:yield function(E){return c._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&c.K()){const D=E.width+2,V=E.height+2;try{return new c.R({width:D,height:V},yield c.M(E,-1,-1,D,V))}catch{}}return c.h.getImageData(E,1)})}
1(_),I={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:S,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};t.actor&&"expired"!==t.state||(t.actor=this.dispatcher.getActor(),t.actor.send("loadDEMTile",I,d))}}),this.map._refreshExpiredTiles)}_getNeighboringTiles(t){const n=t.canonical,s=Math.pow(2,n.z),l=(n.x-1+s)%s,d=0===n.x?t.wrap-1:t.wrap,g=(n.x+1+s)%s,_=n.x+1===s?t.wrap+1:t.wrap,v={};return v[new c.O(t.overscaledZ,d,n.z,l,n.y).key]={backfilled:!1},v[new c.O(t.overscaledZ,_,n.z,g,n.y).key]={backfilled:!1},n.y>0&&(v[new c.O(t.overscaledZ,d,n.z,l,n.y-1).key]={backfilled:!1},v[new c.O(t.overscaledZ,t.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},v[new c.O(t.overscaledZ,_,n.z,g,n.y-1).key]={backfilled:!1}),n.y+1<s&&(v[new c.O(t.overscaledZ,d,n.z,l,n.y+1).key]={backfilled:!1},v[new c.O(t.overscaledZ,t.wrap,n.z,n.x,n.y+1).key]={backfilled:!1},v[new c.O(t.overscaledZ,_,n.z,g,n.y+1).key]={backfilled:!1}),v}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",t.actor&&t.actor.send("removeDEMTile",{uid:t.uid,source:this.id})}}class Bi extends c.E{constructor(t,n,s,l){super(),this.load=()=>{this._updateWorkerData()},this.serialize=()=>c.e({}
1,this._options,{type:this.type,data:this._data}),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=s.getActor(),this.setEventedParent(l),this._data=n.data,this._options=c.e({},n),this._collectResourceTiming=n.collectResourceTiming,void 0!==n.maxzoom&&(this.maxzoom=n.maxzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution),this.promoteId=n.promoteId;const d=c.N/this.tileSize;this.workerOptions=c.e({source:this.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:(void 0!==n.buffer?n.buffer:128)*d,tolerance:(void 0!==n.tolerance?n.tolerance:.375)*d,extent:c.N,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:void 0!==n.clusterMaxZoom?n.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,n.clusterMinPoints||2),extent:c.N,radius:(n.clusterRadius||50)*d,log:!1,generateId:n.generateId||!1},clusterProperties:n.clusterProperties,filter:n.filter},n.workerOptions),"string"==typeof this.promoteId&&(this.workerOptions.promoteId=this.promoteId)}onAdd(t){this.map=t,this.load()}setData(t){return this._data=t,this._updateWorkerData(),this}updateData(t){return this._updateWorkerData(t),this}setClusterOptions(t){return this.workerOptions.cluster=t.cluster,t&&(void 0!==t.clusterRadius&&(this.workerOptions.superclusterOptions.radius=t.clusterRadius),void 0!==t.clusterMaxZoom&&(this.workerOptions.superclusterOptions.maxZoom=t.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(t,n){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},n),this}getClusterChildren(t,n){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},n),this}getClusterLeaves(t,n,s,l){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:n,offset:s},l),this}_updateWorkerData(t){const n=c.e({},this.workerOptions);t?n.dataDiff=t:"string"==typeof this._data?(n.request=this.map._requestManager.transformRequest(c.h.resolveURL(this._data),Ze.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new c.k("dataloading",{dataType:"source"})),this.actor.send(`${this.type}.loadData`,n,(s,l)=>{if(this._pendingLoads--,this._removed||l&&l.abandoned)return void this.fire(new c.k("dataabort",{dataType:"source"}));let d=null;if(l&&l.resourceTiming&&l.resourceTiming[this.id]&&(d=l.resourceTiming[this.id].slice(0)),s)return void this.fire(new c.j(s));const g={dataType:"source"};this._collectResourceTiming&&d&&d.length>0&&c.e(g,{resourceTiming:d}),this.fire(new c.k("data",Object.assign(Object.assign({},g),{sourceDataType:"metadata"}))),this.fire(new c.k("data",Object.assign(Object.assign({},g),{sourceDataType:"content"})))})}loaded(){return 0===this._pendingLoads}loadTile(t,n){const s=t.actor?"reloadTile":"loadTile";t.actor=this.actor;const l={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.request=this.actor.send(s,l,(d,g)=>(delete t.request,t.unloadVectorData(),t.aborted?n(null):d?n(d):(t.loadVectorData(g,this.map.painter,"reloadTile"===s),n(null))))}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.t
1ype,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}hasTransition(){return!1}}var xi=c.Q([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Ft extends c.E{constructor(t,n,s,l){super(),this.load=(d,g)=>{this._loaded=!1,this.fire(new c.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=He.getImage(this.map._requestManager.transformRequest(this.url,Ze.Image),(_,v)=>{this._request=null,this._loaded=!0,_?this.fire(new c.j(_)):v&&(this.image=v,d&&(this.coordinates=d),g&&g(),this._finishLoading())})},this.prepare=()=>{if(0===Object.keys(this.tiles).length||!this.image)return;const d=this.map.painter.context,g=d.gl;this.boundsBuffer||(this.boundsBuffer=d.createVertexBuffer(this._boundsArray,xi.members)),this.boundsSegments||(this.boundsSegments=c.S.simpleSegment(0,0,4,2)),this.texture||(this.texture=new Ve(d,this.image,g.RGBA),this.texture.bind(g.LINEAR,g.CLAMP_TO_EDGE));let _=!1;for(const v in this.tiles){const S=this.tiles[v];"loaded"!==S.state&&(S.state="loaded",S.texture=this.texture,_=!0)}_&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"image",url:this.options.url,coordinates:this.coordinates}),this.id=t,this.dispatcher=s,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(l),this.options=n}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.cancel(),this._request=null),this.options.url=t.url,this.load(t.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new c.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.cancel(),this._request=null)}setCoordinates(t){this.coordinates=t;const n=t.map(c.U.fromLngLat);this.tileID=function(l){let d=1/0,g=1/0,_=-1/0,v=-1/0;for(const D of l)d=Math.min(d,D.x),g=Math.min(g,D.y),_=Math.max(_,D.x),v=Math.max(v,D.y);const S=Math.max(_-d,v-g),I=Math.max(0,Math.floor(-Math.log(S)/Math.LN2)),E=Math.pow(2,I);return new c.W(I,Math.floor((d+_)/2*E),Math.floor((g+v)/2*E))}(n),this.minzoom=this.maxzoom=this.tileID.z;const s=n.map(l=>this.tileID.getTilePoint(l)._round());return this._boundsArray=new c.V,this._boundsArray.emplaceBack(s[0].x,s[0].y,0,0),this._boundsArray.emplaceBack(s[1].x,s[1].y,c.N,0),this._boundsArray.emplaceBack(s[3].x,s[3].y,0,c.N),this._boundsArray.emplaceBack(s[2].x,s[2].y,c.N,c.N),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new c.k("data",{dataType:"source",sourceDataType:"content"})),this}loadTile(t,n){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},n(null)):(t.state="errored",n(null))}hasTransition(){return!1}}class Mn extends Ft{constructor(t,n,s,l){super(t,n,s,l),this.load=()=>{this._loaded=!1;const d=this.options;this.urls=[];for(const g of d.urls)this.urls.push(this.map._requestManager.transformRequest(g,Ze.Source).url);c.X(this.urls,(g,_)=>{this._loaded=!0,g?this.fire(new c.j(g)):_&&(this.video=_,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})},this.prepare=()=>{if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const d=this.map.painter.context,g=d.gl;this.boundsBuffer||(this.boundsBuffer=d.createVertexBuffer(this._boundsArray,xi.members)),this.boundsSegments||(this.boundsSegments=c.S.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(g.LINEAR,g.CLAMP_TO_EDGE),g.texSubImage2D(g.TEXTURE_2D,0,0,0,g.RGBA,g.UNSIGNED_BYTE,this.video)):(this.texture=new Ve(d,this.video,g.RGBA),this.texture.bind(g.LINEAR,g.CLAMP_TO_EDGE));let _=!1;for(const v in this.tiles){const S=this.tiles[v];"loaded"!==S.state&&(S.state="loaded",S.texture=this.texture,_=!0)}_&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"video",urls:this.urls,coordinates:this.coordinates}),this.roundZoom=!0,this.type="video",this.options=n}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const n=this.video.seekable;t<n.start(0)||t>n.end(0)?this.fire(new c.j(new c.Y(`sources.${this.id}`,null,`Playback for this video can be set only between the ${n.start(0)} and ${n.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}
1onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}hasTransition(){return this.video&&!this.video.paused}}class _r extends Ft{constructor(t,n,s,l){super(t,n,s,l),this.load=()=>{this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new c.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},this.prepare=()=>{let d=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,d=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,d=!0),this._hasInvalidDimensions()||0===Object.keys(this.tiles).length)return;const g=this.map.painter.context,_=g.gl;this.boundsBuffer||(this.boundsBuffer=g.createVertexBuffer(this._boundsArray,xi.members)),this.boundsSegments||(this.boundsSegments=c.S.simpleSegment(0,0,4,2)),this.texture?(d||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new Ve(g,this.canvas,_.RGBA,{premultiply:!0});let v=!1;for(const S in this.tiles){const I=this.tiles[S];"loaded"!==I.state&&(I.state="loaded",I.texture=this.texture,v=!0)}v&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"canvas",coordinates:this.coordinates}),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some(d=>!Array.isArray(d)||2!==d.length||d.some(g=>"number"!=typeof g))||this.fire(new c.j(new c.Y(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new c.j(new c.Y(`sources.${t}`,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new c.j(new c.Y(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof HTMLCanvasElement||this.fire(new c.j(new c.Y(`sources.${t}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new c.j(new c.Y(`sources.${t}`,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}const Vr={},tr=u=>{switch(u){case"geojson":return Bi;case"image":return Ft;case"raster":return $t;case"raster-dem":return Qt;case"vector":return wt;case"video":return Mn;case"canvas":return _r}return Vr[u]};function Cr(u,t){const n=c.Z();return c.$(n,n,[1,1,0]),c.a0(n,n,[.5*u.width,.5*u.height,1]),c.a1(n,n,u.calculatePosMatrix(t.toUnwrapped()))}function li(u,t,n,s,l,d){const g=function(E,D,V){if(E)for(const U of E){const $=D[U];if($&&$.source===V&&"fill-extrusion"===$.type)return!0}else for(const U in D){const $=D[U];if($.source===V&&"fill-extrusion"===$.type)return!0}return!1}(l&&l.layers,t,u.id),_=d.maxPitchScaleFactor(),v=u.tilesIn(s,_,g);v.sort(Xr);const S=[];for(const E of v)S.push({wrappedTileID:E.tileID.wrapped().key,queryResults:E.tile.queryRenderedFeatures(t,n,u._state,E.queryGeometry,E.cameraQueryGeometry,E.scale,l,d,_,Cr(u.transform,E.tileID))});const I=function(E){const D={},V={};for(const U of E){const $=U.queryResults,B=U.wrappedTileID,oe=V[B]=V[B]||{};for(const fe in $){const K=$[fe],ae=oe[fe]=oe[fe]||{},ve=D[fe]=D[fe]||[];for(const xe of K)ae[xe.featureIndex]||(ae[xe.featureIndex]=!0,ve.push(xe))}}return D}(S);
vendor: 10,354 bytes, line 1
1for(const E in I)I[E].forEach(D=>{const V=D.feature,U=u.getFeatureState(V.layer["source-layer"],V.id);V.source=V.layer.source,V.layer["source-layer"]&&(V.sourceLayer=V.layer["source-layer"]),V.state=U});return I}function Xr(u,t){const n=u.tileID,s=t.tileID;return n.overscaledZ-s.overscaledZ||n.canonical.y-s.canonical.y||n.wrap-s.wrap||n.canonical.x-s.canonical.x}class Sr{constructor(t,n){this.timeAdded=0,this.fadeEndTime=0,this.tileID=t,this.uid=c.a2(),this.uses=0,this.tileSize=n,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(t){const n=t+this.timeAdded;n<this.fadeEndTime||(this.fadeEndTime=n)}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}clearTextures(t){this.demTexture&&t.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(t,n,s){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(l,d){const g={};if(!d)return g;for(const _ of l){const v=_.layerIds.map(S=>d.getLayer(S)).filter(Boolean);if(0!==v.length){_.layers=v,_.stateDependentLayerIds&&(_.stateDependentLayers=_.stateDependentLayerIds.map(S=>v.filter(I=>I.id===S)[0]));for(const S of v)g[S.id]=_}}return g}(t.buckets,n.style),this.hasSymbolBuckets=!1;for(const l in this.buckets){const d=this.buckets[l];if(d instanceof c.a4){if(this.hasSymbolBuckets=!0,!s)break;d.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const l in this.buckets){const d=this.buckets[l];if(d instanceof c.a4&&d.hasRTLText){this.hasRTLText=!0,c.a5();break}}this.queryPadding=0;for(const l in this.buckets){const d=this.buckets[l];this.queryPadding=Math.max(this.queryPadding,n.style.getLayer(l).queryRadius(d))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new c.a3}unloadVectorData(){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(const s in this.buckets){const l=this.buckets[s];l.uploadPending()&&l.upload(t)}const n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Ve(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Ve(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,n,s,l,d,g,_,v,S,I){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:l,cameraQueryGeometry:d,scale:g,tileSize:this.tileSize,pixelPosMatrix:I,transform:v,params:_,queryPadding:this.queryPadding*S},t,n,s):{}}querySourceFeatures(t,n){const s=this.latestFeatureIndex;if(!s||!s.rawTileData)return;const l=s.loadVTLayers(),d=n&&n.sourceLayer?n.sourceLayer:"",g=l._geojsonTileLayer||l[d];if(!g)return;const _=c.a6(n&&n.filter),{z:v,x:S,y:I}=this.tileID.canonical,E={z:v,x:S,y:I};for(let D=0;D<g.length;D++){const V=g.feature(D);if(_.needGeometry){const B=c.a7(V,!0);if(!_.filter(new c.a8(this.tileID.overscaledZ),B,this.tileID.canonical))continue}else if(!_.filter(new c.a8(this.tileID.overscaledZ),V))continue;const U=s.getId(V,d),$=new c.a9(V,v,S,I,U);$.tile=E,t.push($)}}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(t){const n=this.expirationTime;if(t.cacheControl){const s=c.aa(t.cacheControl);s["max-age"]&&(this.expirationTime=Date.now()+1e3*s["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){const s=Date.now();let l=!1;if(this.expirationTime>s)l=!1;else if(n)if(this.expirationTime<n)l=!0;else{const d=this.expirationTime-n;d?this.expirationTime=s+Math.max(d,3e4):l=!0}else l=!0;l?(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,n){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||0===Object.keys(t).length)return;const s=this.latestFeatureIndex.loadVTLayers();for(const l in this.buckets){if(!n.style.hasLayer(l))continue;const d=this.buckets[l],g=d.layers[0].sourceLayer||"_geojsonTileLayer",_=s[g],v=t[g];if(!_||!v||0===Object.keys(v).length)continue;d.update(v,_,this.imageAtlas&&this.imageAtlas.patternPositions||{});const S=n&&n.style&&n.style.getLayer(l);S&&(this.queryPadding=Math.max(this.queryPadding,S.queryRadius(d)))}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<c.h.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(t){this.symbolFadeHoldUntil=c.h.now()+t}setDependencies(t,n){const s={};for(const l of n)s[l]=!0;this.dependencies[t]=s}hasDependency(t,n){for(const s of t){const l=this.dependencies[s];if(l)for(const d of n)if(l[d])return!0}return!1}}class sn{constructor(t,n){this.max=t,this.onRemove=n,this.reset()}reset(){for(const t in this.data)for(const n of this.data[t])n.timeout&&clearTimeout(n.timeout),this.onRemove(n.value);return this.data={},this.order=[],this}add(t,n,s){const l=t.wrapped().key;void 0===this.data[l]&&(this.data[l]=[]);const d={value:n,timeout:void 0};if(void 0!==s&&(d.timeout=setTimeout(()=>{this.remove(t,d)},s)),this.data[l].push(d),this.order.push(l),this.order.length>this.max){const g=this._getAndRemoveByKey(this.order[0]);g&&this.onRemove(g)}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 n=this.data[t].shift();return n.timeout&&clearTimeout(n.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),n.value}getByKey(t){const n=this.data[t];return n?n[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,n){if(!this.has(t))return this;const s=t.wrapped().key,l=void 0===n?0:this.data[s].indexOf(n),d=this.data[s][l];return this.data[s].splice(l,1),d.timeout&&clearTimeout(d.timeout),0===this.data[s].length&&delete this.data[s],this.onRemove(d.value),this.order.splice(this.order.indexOf(s),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const n=this._getAndRemoveByKey(this.order[0]);n&&this.onRemove(n)}return this}filter(t){const n=[];for(const s in this.data)for(const l of this.data[s])t(l.value)||n.push(l);for(const s of n)this.remove(s.value.tileID,s)}}class Y{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,n,s){const l=String(n);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][l]=this.stateChanges[t][l]||{},c.e(this.stateChanges[t][l],s),null===this.deletedStates[t]){this.deletedStates[t]={};for(const d in this.state[t])d!==l&&(this.deletedStates[t][d]=null)}else if(this.deletedStates[t]&&null===this.deletedStates[t][l]){this.deletedStates[t][l]={};for(const d in this.state[t][l])s[d]||(this.deletedStates[t][l][d]=null)}else for(const d in s)this.deletedStates[t]&&this.deletedStates[t][l]&&null===this.deletedStates[t][l][d]&&delete this.deletedStates[t][l][d]}removeFeatureState(t,n,s){if(null===this.deletedStates[t])return;const l=String(n);if(this.deletedStates[t]=this.deletedStates[t]||{},s&&void 0!==n)null!==this.deletedStates[t][l]&&(this.deletedStates[t][l]=this.deletedStates[t][l]||{},this.deletedStates[t][l][s]=null);else if(void 0!==n)if(this.stateChanges[t]&&this.stateChanges[t][l])for(s in this.deletedStates[t][l]={},this.stateChanges[t][l])this.deletedStates[t][l][s]=null;else this.deletedStates[t][l]=null;else this.deletedStates[t]=null}getState(t,n){const s=String(n),l=c.e({},(this.state[t]||{})[s],(this.stateChanges[t]||{})[s]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){const d=this.deletedStates[t][n];if(null===d)return{};for(const g in d)delete l[g]}return l}initializeTileState(t,n){t.setFeatureState(this.state,n)}coalesceChanges(t,n){const s={};for(const l in this.stateChanges){this.state[l]=this.state[l]||{};const d={};for(const g in this.stateChanges[l])this.state[l][g]||(this.state[l][g]={}),c.e(this.state[l][g],this.stateChanges[l][g]),d[g]=this.state[l][g];s[l]=d}for(const l in this.deletedStates){this.state[l]=this.state[l]||{};const d={};if(null===this.deletedStates[l])for(const g in this.state[l])d[g]={},this.state[l][g]={};else for(const g in this.deletedStates[l]){if(null===this.deletedStates[l][g])this.state[l][g]={};else for(const _ of Object.keys(this.deletedStates[l][g]))delete this.state[l][g][_];d[g]=this.state[l][g]}s[l]=s[l]||{},c.e(s[l],d)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(s).length)for(const l in t)t[l].setFeatureState(s,n)}}class ei extends c.E{constructor(t,n,s){super(),this.id=t,this.dispatcher=s,this.on("data",l=>{"source"===l.dataType&&"metadata"===l.sourceDataType&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===l.dataType&&"content"===l.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((l,d,g,_)=>{const v=new(tr(d.type))(l,d,g,_);if(v.id!==l)throw new Error(`Expected Source id to be ${l} instead of ${v.id}`);return v})(t,n,s,this),this._tiles={},this._cache=new sn(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={}
1,this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Y,this._didEmitContent=!1,this._updated=!1}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(t)}onRemove(t){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(void 0===this.used&&void 0===this.usedForTerrain||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const t in this._tiles){const n=this._tiles[t];if("loaded"!==n.state&&"errored"!==n.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,this.terrain)}_loadTile(t,n){return this._source.loadTile(t,n)}_unloadTile(t){if(this._source.unloadTile)return this._source.unloadTile(t,()=>{})}_abortTile(t){this._source.abortTile&&this._source.abortTile(t,()=>{}),this._source.fire(new c.k("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}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 n in this._tiles){const s=this._tiles[n];s.upload(t),s.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(t=>t.tileID).sort(w).map(t=>t.key)}getRenderableIds(t){const n=[];for(const s in this._tiles)this._isIdRenderable(s,t)&&n.push(this._tiles[s]);return t?n.sort((s,l)=>{const d=s.tileID,g=l.tileID,_=new c.P(d.canonical.x,d.canonical.y)._rotate(this.transform.angle),v=new c.P(g.canonical.x,g.canonical.y)._rotate(this.transform.angle);return d.overscaledZ-g.overscaledZ||v.y-_.y||v.x-_.x}).map(s=>s.tileID.key):n.map(s=>s.tileID).sort(w).map(s=>s.key)}hasRenderableParent(t){const n=this.findLoadedParent(t,0);return!!n&&this._isIdRenderable(n.tileID.key)}_isIdRenderable(t,n){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(n||!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,n){const s=this._tiles[t];s&&("loading"!==s.state&&(s.state=n),this._loadTile(s,this._tileLoaded.bind(this,s,t,n)))}_tileLoaded(t,n,s,l){if(l)return t.state="errored",void(404!==l.status?this._source.fire(new c.j(l,{tile:t})):this.update(this.transform,this.terrain));t.timeAdded=c.h.now(),"expired"===s&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(n,t),"raster-dem"===this.getSource().type&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new c.k("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){const n=this.getRenderableIds();for(let l=0;l<n.length;l++){const d=n[l];if(t.neighboringTiles&&t.neighboringTiles[d]){const g=this.getTileByID(d);s(t,g),s(g,t)}}function s(l,d){l.needsHillshadePrepare=!0,l.needsTerrainPrepare=!0;let g=d.tileID.canonical.x-l.tileID.canonical.x;const _=d.tileID.canonical.y-l.tileID.canonical.y,v=Math.pow(2,l.tileID.canonical.z),S=d.tileID.key;0===g&&0===_||Math.abs(_)>1||(Math.abs(g)>1&&(1===Math.abs(g+v)?g+=v:1===Math.abs(g-v)&&(g-=v)),d.dem&&l.dem&&(l.dem.backfillBorder(d.dem,g,_),l.neighboringTiles&&l.neighboringTiles[S]&&(l.neighboringTiles[S].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,n,s,l){for(const d in this._tiles){let g=this._tiles[d];if(l[d]||!g.hasData()||g.tileID.overscaledZ<=n||g.tileID.overscaledZ>s)continue;let _=g.tileID;for(;g&&g.tileID.overscaledZ>n+1;){const S=g.tileID.scaledTo(g.tileID.overscaledZ-1);g=this._tiles[S.key],g&&g.hasData()&&(_=S)}let v=_;for(;v.overscaledZ>n;)if(v=v.scaledTo(v.overscaledZ-1),t[v.key]){l[_.key]=_;break}}}findLoadedParent(t,n){if(t.key in this._loadedParentTiles){const s=this._loadedParentTiles[t.key];return s&&s.tileID.overscaledZ>=n?s:null}for(let s=t.overscaledZ-1;s>=n;s--){const l=t.scaledTo(s),d=this._getLoadedTile(l);
vendor: 4,117 bytes, line 1
1if(d)return d}}_getLoadedTile(t){const n=this._tiles[t.key];return n&&n.hasData()?n:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){const n=Math.ceil(t.width/this._source.tileSize)+1,s=Math.ceil(t.height/this._source.tileSize)+1,l=Math.floor(n*s*(null===this._maxTileCacheZoomLevels?c.c.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),d="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,l):l;this._cache.setMaxSize(d)}handleWrapJump(t){const n=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,n){const s={};for(const l in this._tiles){const d=this._tiles[l];d.tileID=d.tileID.unwrapTo(d.tileID.wrap+n),s[d.tileID.key]=d}this._tiles=s;for(const l in this._timers)clearTimeout(this._timers[l]),delete this._timers[l];for(const l in this._tiles)this._setTileReloadTimer(l,this._tiles[l])}}update(t,n){if(this.transform=t,this.terrain=n,!this._sourceLoaded||this._paused)return;let s;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?s=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(I=>new c.O(I.canonical.z,I.wrap,I.canonical.z,I.canonical.x,I.canonical.y)):(s=t.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:n}),this._source.hasTile&&(s=s.filter(I=>this._source.hasTile(I)))):s=[];const l=t.coveringZoomLevel(this._source),d=Math.max(l-ei.maxOverzooming,this._source.minzoom),g=Math.max(l+ei.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const I={};for(const E of s)if(E.canonical.z>this._source.minzoom){const D=E.scaledTo(E.canonical.z-1);I[D.key]=D;const V=E.scaledTo(Math.max(this._source.minzoom,Math.min(E.canonical.z,5)));I[V.key]=V}s=s.concat(Object.values(I))}const _=0===s.length&&!this._updated&&this._didEmitContent;this._updated=!0,_&&this.fire(new c.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const v=this._updateRetainedTiles(s,l);if(z(this._source.type)){const I={},E={},D=Object.keys(v),V=c.h.now();for(const U of D){const $=v[U],B=this._tiles[U];if(!B||0!==B.fadeEndTime&&B.fadeEndTime<=V)continue;const oe=this.findLoadedParent($,d);oe&&(this._addTile(oe.tileID),I[oe.tileID.key]=oe.tileID),E[U]=$}this._retainLoadedChildren(E,l,g,v);for(const U in I)v[U]||(this._coveredTiles[U]=!0,v[U]=I[U]);if(n){const U={},$={};for(const B of s)this._tiles[B.key].hasData()?U[B.key]=B:$[B.key]=B;for(const B in $){const oe=$[B].children(this._source.maxzoom);this._tiles[oe[0].key]&&this._tiles[oe[1].key]&&this._tiles[oe[2].key]&&this._tiles[oe[3].key]&&(U[oe[0].key]=v[oe[0].key]=oe[0],U[oe[1].key]=v[oe[1].key]=oe[1],U[oe[2].key]=v[oe[2].key]=oe[2],U[oe[3].key]=v[oe[3].key]=oe[3],delete $[B])}for(const B in $){const oe=this.findLoadedParent($[B],this._source.minzoom);if(oe){U[oe.tileID.key]=v[oe.tileID.key]=oe.tileID;for(const fe in U)U[fe].isChildOf(oe.tileID)&&delete U[fe]}}for(const B in this._tiles)U[B]||(this._coveredTiles[B]=!0)}}for(const I in v)this._tiles[I].clearFadeHold();const S=c.ab(this._tiles,v);for(const I of S){const E=this._tiles[I];E.hasSymbolBuckets&&!E.holdingForFade()?E.setHoldDuration(this.map._fadeDuration):E.hasSymbolBuckets&&!E.symbolFadeFinished()||this._removeTile(I)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)}_updateRetainedTiles(t,n){const s={},l={},d=Math.max(n-ei.maxOverzooming,this._source.minzoom),g=Math.max(n+ei.maxUnderzooming,this._source.minzoom),_={};for(const v of t){const S=this._addTile(v);s[v.key]=v,S.hasData()||n<this._source.maxzoom&&(_[v.key]=v)}this._retainLoadedChildren(_,n,g,s);for(const v of t){let S=this._tiles[v.key];if(S.hasData())continue;if(n+1>this._source.maxzoom){const E=v.children(this._source.maxzoom)[0],D=this.getTile(E);if(D&&D.hasData()){s[E.key]=E;continue}}else{const E=v.children(this._source.maxzoom);
1if(s[E[0].key]&&s[E[1].key]&&s[E[2].key]&&s[E[3].key])continue}let I=S.wasRequested();for(let E=v.overscaledZ-1;E>=d;--E){const D=v.scaledTo(E);if(l[D.key])break;if(l[D.key]=!0,S=this.getTile(D),!S&&I&&(S=this._addTile(D)),S){const V=S.hasData();if((I||V)&&(s[D.key]=D),I=S.wasRequested(),V)break}}}return s}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const n=[];let s,l=this._tiles[t].tileID;for(;l.overscaledZ>0;){if(l.key in this._loadedParentTiles){s=this._loadedParentTiles[l.key];break}n.push(l.key);const d=l.scaledTo(l.overscaledZ-1);if(s=this._getLoadedTile(d),s)break;l=d}for(const d of n)this._loadedParentTiles[d]=s}}_addTile(t){let n=this._tiles[t.key];if(n)return n;n=this._cache.getAndRemove(t),n&&(this._setTileReloadTimer(t.key,n),n.tileID=t,this._state.initializeTileState(n,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,n)));const s=n;return n||(n=new Sr(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(n,this._tileLoaded.bind(this,n,t.key,n.state))),n.uses++,this._tiles[t.key]=n,s||this._source.fire(new c.k("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n}_setTileReloadTimer(t,n){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const s=n.getExpiryTimeout();s&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},s))}_removeTile(t){const n=this._tiles[t];n&&(n.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),n.uses>0||(n.hasData()&&"reloading"!==n.state?this._cache.add(n.tileID,n,n.getExpiryTimeout()):(n.aborted=!0,this._abortTile(n),this._unloadTile(n))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(t);this._cache.reset()}tilesIn(t,n,s){const l=[],d=this.transform;if(!d)return l;const g=s?d.getCameraQueryGeometry(t):t,_=t.map(U=>d.pointCoordinate(U,this.terrain)),v=g.map(U=>d.pointCoordinate(U,this.terrain)),S=this.getIds();let I=1/0,E=1/0,D=-1/0,V=-1/0;for(const U of v)I=Math.min(I,U.x),E=Math.min(E,U.y),D=Math.max(D,U.x),V=Math.max(V,U.y);for(let U=0;U<S.length;U++){const $=this._tiles[S[U]];if($.holdingForFade())continue;const B=$.tileID,oe=Math.pow(2,d.zoom-$.tileID.overscaledZ),fe=n*$.queryPadding*c.N/$.tileSize/oe,K=[B.getTilePoint(new c.U(I,E)),B.getTilePoint(new c.U(D,V))];if(K[0].x-fe<c.N&&K[0].y-fe<c.N&&K[1].x+fe>=0&&K[1].y+fe>=0){const ae=_.map(xe=>B.getTilePoint(xe)),ve=v.map(xe=>B.getTilePoint(xe));l.push({tile:$,tileID:B,queryGeometry:ae,cameraQueryGeometry:ve,scale:oe})}}return l}getVisibleCoordinates(t){const n=this.getRenderableIds(t).map(s=>this._tiles[s].tileID);for(const s of n)s.posMatrix=this.transform.calculatePosMatrix(s.toUnwrapped());return n}hasTransition(){if(this._source.hasTransition())return!0;if(z(this._source.type)){const t=c.h.now();for(const n in this._tiles)if(this._tiles[n].fadeEndTime>=t)return!0}return!1}setFeatureState(t,n,s){this._state.updateState(t=t||"_geojsonTileLayer",n,s)}removeFeatureState(t,n,s){this._state.removeFeatureState(t=t||"_geojsonTileLayer",n,s)}getFeatureState(t,n){return this._state.getState(t=t||"_geojsonTileLayer",n)}setDependencies(t,n,s){const l=this._tiles[t];l&&l.setDependencies(n,s)}reloadTilesForDependencies(t,n){for(const s in this._tiles)this._tiles[s].hasDependency(t,n)&&this._reloadTile(s,"reloading");this._cache.filter(s=>!s.hasDependency(t,n))}}function w(u,t){const n=Math.abs(2*u.wrap)-+(u.wrap<0),s=Math.abs(2*t.wrap)-+(t.wrap<0);return u.overscaledZ-t.overscaledZ||s-n||t.canonical.y-u.canonical.y||t.canonical.x-u.canonical.x}function z(u){return"raster"===u||"image"===u||"video"===u}ei.maxOverzooming=10,ei.maxUnderzooming=3;const Ee="mapboxgl_preloaded_worker_pool";class ft{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length<ft.workerCount;)this.workers.push(new Worker(c.c.WORKER_URL));return this.active[t]=!0,this.workers.slice()}release(t){delete this.active[t],0===this.numActive()&&(this.workers.forEac
vendor: 4,155 bytes, line 1
1h(n=>{n.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Ee]}numActive(){return Object.keys(this.active).length}}const oi=Math.floor(c.h.hardwareConcurrency/2);let mi;function ki(){return mi||(mi=new ft),mi}ft.workerCount=c.ac(globalThis)?Math.max(Math.min(oi,3),1):1;class Mr{constructor(t,n){this.reset(t,n)}reset(t,n){this.points=t||[],this._distances=[0];for(let s=1;s<this.points.length;s++)this._distances[s]=this._distances[s-1]+this.points[s].dist(this.points[s-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(n||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(1===this.points.length)return this.points[0];t=c.ad(t,0,1);let n=1,s=this._distances[n];const l=t*this.paddedLength+this.padding;for(;s<l&&n<this._distances.length;)s=this._distances[++n];const d=n-1,g=this._distances[d],_=s-g,v=_>0?(l-g)/_:0;return this.points[d].mult(1-v).add(this.points[n].mult(v))}}function yr(u,t){let n=!0;return"always"===u||"never"!==u&&"never"!==t||(n=!1),n}class Ir{constructor(t,n,s){const l=this.boxCells=[],d=this.circleCells=[];this.xCellCount=Math.ceil(t/s),this.yCellCount=Math.ceil(n/s);for(let g=0;g<this.xCellCount*this.yCellCount;g++)l.push([]),d.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=n,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/n,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(t,n,s,l,d){this._forEachCell(n,s,l,d,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(n),this.bboxes.push(s),this.bboxes.push(l),this.bboxes.push(d)}insertCircle(t,n,s,l){this._forEachCell(n-l,s-l,n+l,s+l,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(n),this.circles.push(s),this.circles.push(l)}_insertBoxCell(t,n,s,l,d,g){this.boxCells[d].push(g)}_insertCircleCell(t,n,s,l,d,g){this.circleCells[d].push(g)}_query(t,n,s,l,d,g,_){if(s<0||t>this.width||l<0||n>this.height)return[];const v=[];if(t<=0&&n<=0&&this.width<=s&&this.height<=l){if(d)return[{key:null,x1:t,y1:n,x2:s,y2:l}];for(let S=0;S<this.boxKeys.length;S++)v.push({key:this.boxKeys[S],x1:this.bboxes[4*S],y1:this.bboxes[4*S+1],x2:this.bboxes[4*S+2],y2:this.bboxes[4*S+3]});for(let S=0;S<this.circleKeys.length;S++){const I=this.circles[3*S],E=this.circles[3*S+1],D=this.circles[3*S+2];v.push({key:this.circleKeys[S],x1:I-D,y1:E-D,x2:I+D,y2:E+D})}}else this._forEachCell(t,n,s,l,this._queryCell,v,{hitTest:d,overlapMode:g,seenUids:{box:{},circle:{}}},_);return v}query(t,n,s,l){return this._query(t,n,s,l,!1,null)}hitTest(t,n,s,l,d,g){return this._query(t,n,s,l,!0,d,g).length>0}hitTestCircle(t,n,s,l,d){const g=t-s,_=t+s,v=n-s,S=n+s;if(_<0||g>this.width||S<0||v>this.height)return!1;const I=[];return this._forEachCell(g,v,_,S,this._queryCellCircle,I,{hitTest:!0,overlapMode:l,circle:{x:t,y:n,radius:s},seenUids:{box:{},circle:{}}},d),I.length>0}_queryCell(t,n,s,l,d,g,_,v){const{seenUids:S,hitTest:I,overlapMode:E}=_,D=this.boxCells[d];if(null!==D){const U=this.bboxes;for(const $ of D)if(!S.box[$]){S.box[$]=!0;const B=4*$,oe=this.boxKeys[$];if(t<=U[B+2]&&n<=U[B+3]&&s>=U[B+0]&&l>=U[B+1]&&(!v||v(oe))&&(!I||!yr(E,oe.overlapMode))&&(g.push({key:oe,x1:U[B],y1:U[B+1],x2:U[B+2],y2:U[B+3]}),I))return!0}}const V=this.circleCells[d];if(null!==V){const U=this.circles;for(const $ of V)if(!S.circle[$]){S.circle[$]=!0;const B=3*$,oe=this.circleKeys[$];if(this._circleAndRectCollide(U[B],U[B+1],U[B+2],t,n,s,l)&&(!v||v(oe))&&(!I||!yr(E,oe.overlapMode))){const fe=U[B],K=U[B+1],ae=U[B+2];if(g.push({key:oe,x1:fe-ae,y1:K-ae,x2:fe+ae,y2:K+ae}),I)return!0}}}return!1}_queryCellCircle(t,n,s,l,d,g,_,v){const{circle:S,seenUids:I,overlapMode:E}=_,D=this.boxCells[d];if(null!==D){const U=this.bboxes;for(const $ of D)if(!I.box[$]){I.box[$]=!0;const B=4*$,oe=this.boxKeys[$];if(this._circleAndRectCollide(S.x,S.y,S.radius,U[B+0],U[B+1],U[B+2],U[B+3])&&(!v||v(oe))&&!yr(E,oe.overlapMode))return g.push(!0),!0}}const V=this.circleCells[d];if(null!==V){const U=this.circles;for(const $ of V)if(!I.circle[$]){I.circle[$]=!0;const B=3*$,oe=this.circleKeys[$];
1if(this._circlesCollide(U[B],U[B+1],U[B+2],S.x,S.y,S.radius)&&(!v||v(oe))&&!yr(E,oe.overlapMode))return g.push(!0),!0}}}_forEachCell(t,n,s,l,d,g,_,v){const S=this._convertToXCellCoord(t),I=this._convertToYCellCoord(n),E=this._convertToXCellCoord(s),D=this._convertToYCellCoord(l);for(let V=S;V<=E;V++)for(let U=I;U<=D;U++)if(d.call(this,t,n,s,l,this.xCellCount*U+V,g,_,v))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,n,s,l,d,g){const _=l-t,v=d-n,S=s+g;return S*S>_*_+v*v}_circleAndRectCollide(t,n,s,l,d,g,_){const v=(g-l)/2,S=Math.abs(t-(l+v));if(S>v+s)return!1;const I=(_-d)/2,E=Math.abs(n-(d+I));if(E>I+s)return!1;if(S<=v||E<=I)return!0;const D=S-v,V=E-I;return D*D+V*V<=s*s}}function tt(u,t,n,s,l){const d=c.Z();return t?(c.a0(d,d,[1/l,1/l,1]),n||c.ae(d,d,s.angle)):c.a1(d,s.labelPlaneMatrix,u),d}function Er(u,t,n,s,l){if(t){const d=c.af(u);return c.a0(d,d,[l,l,1]),n||c.ae(d,d,-s.angle),d}return s.glCoordMatrix}function zi(u,t,n){let s;n?(s=[u.x,u.y,n(u.x,u.y),1],c.ag(s,s,t)):(s=[u.x,u.y,0,1],j(s,s,t));const l=s[3];return{point:new c.P(s[0]/l,s[1]/l),signedDistanceFromCamera:l}}function Rn(u,t){return.5+u/t*.5}function Tr(u,t){const n=u[0]/u[3],s=u[1]/u[3];return n>=-t[0]&&n<=t[0]&&s>=-t[1]&&s<=t[1]}function nt(u,t,n,s,l,d,g,_,v,S){const I=s?u.textSizeData:u.iconSizeData,E=c.ah(I,n.transform.zoom),D=[256/n.width*2+1,256/n.height*2+1],V=s?u.text.dynamicLayoutVertexArray:u.icon.dynamicLayoutVertexArray;V.clear();const U=u.lineVertexArray,$=s?u.text.placedSymbolArray:u.icon.placedSymbolArray,B=n.transform.width/n.transform.height;let oe=!1;for(let fe=0;fe<$.length;fe++){const K=$.get(fe);if(K.hidden||K.writingMode===c.ai.vertical&&!oe){F(K.numGlyphs,V);continue}let ae;if(oe=!1,S?(ae=[K.anchorX,K.anchorY,S(K.anchorX,K.anchorY),1],c.ag(ae,ae,t)):(ae=[K.anchorX,K.anchorY,0,1],j(ae,ae,t)),!Tr(ae,D)){F(K.numGlyphs,V);continue}const ve=Rn(n.transform.cameraToCenterDistance,ae[3]),xe=c.aj(I,E,K),Re=g?xe/ve:xe*ve,Xe=new c.P(K.anchorX,K.anchorY),Ge=zi(Xe,l,S).point,rt={projections:{},offsets:{}},Et=dr(K,Re,!1,_,t,l,d,u.glyphOffsetArray,U,V,Ge,Xe,rt,B,v,S);oe=Et.useVertical,(Et.notEnoughRoom||oe||Et.needsFlipping&&dr(K,Re,!0,_,t,l,d,u.glyphOffsetArray,U,V,Ge,Xe,rt,B,v,S).notEnoughRoom)&&F(K.numGlyphs,V)}s?u.text.dynamicLayoutVertexBuffer.updateData(V):u.icon.dynamicLayoutVertexBuffer.updateData(V)}function Ht(u,t,n,s,l,d,g,_,v,S,I,E,D){const V=_.glyphStartIndex+_.numGlyphs,U=_.lineStartIndex,$=_.lineStartIndex+_.lineLength,B=t.getoffsetX(_.glyphStartIndex),oe=t.getoffsetX(V-1),fe=P(u*B,n,s,l,d,g,_.segment,U,$,v,S,I,E,D);if(!fe)return null;const K=P(u*oe,n,s,l,d,g,_.segment,U,$,v,S,I,E,D);return K?{first:fe,last:K}:null}function jt(u,t,n,s){return u===c.ai.horizontal&&Math.abs(n.y-t.y)>Math.abs(n.x-t.x)*s?{useVertical:!0}:(u===c.ai.vertical?t.y<n.y:t.x>n.x)?{needsFlipping:!0}:null}function dr(u,t,n,s,l,d,g,_,v,S,I,E,D,V,U,$){const B=t/24,oe=u.lineOffsetX*B,fe=u.lineOffsetY*B;let K;if(u.numGlyphs>1){const ae=u.glyphStartIndex+u.numGlyphs,ve=u.lineStartIndex,xe=u.lineStartIndex+u.lineLength,Re=Ht(B,_,oe,fe,n,I,E,u,v,d,D,U,$);if(!Re)return{notEnoughRoom:!0};const Xe=zi(Re.first.point,g,$).point,Ge=zi(Re.last.point,g,$).point;if(s&&!n){const rt=jt(u.writingMode,Xe,Ge,V);if(rt)return rt}K=[Re.first];for(let rt=u.glyphStartIndex+1;rt<ae-1;rt++)K.push(P(B*_.getoffsetX(rt),oe,fe,n,I,E,u.segment,ve,xe,v,d,D,U,$));K.push(Re.last)}else{if(s&&!n){const ve=zi(E,l,$).point,xe=u.lineStartIndex+u.segment+1,Re=new c.P(v.getx(xe),v.gety(xe)),Xe=zi(Re,l,$),Ge=Xe.signedDistanceFromCamera>0?Xe.point:Br(E,Re,ve,1,l,$),rt=jt(u.writingMode,ve,Ge,V);if(rt)return rt}const ae=P(B*_.getoffsetX(u.glyphStartIndex),oe,fe,n,I,E,u.segment,u.lineStartIndex,u.lineStartIndex+u.lineLength,v,d,D,U,$);if(!ae)return{notEnoughRoom:!0};K=[ae]}for(const ae of K)c.ak(S,ae.point,ae.angle);return{}}function Br(u,t,n,s,l,d){const g=zi(u.add(u.sub(t)._unit()),l,d).point,_=n.sub(g);return n.add(_._mult(s/_.mag()))}function Bt(u,t){const{projectionCache:n,lineVertexArray:s,labelPlaneMatr
1ix:l,tileAnchorPoint:d,distanceFromAnchor:g,getElevation:_,previousVertex:v,direction:S,absOffsetX:I}=t;if(n.projections[u])return n.projections[u];const E=new c.P(s.getx(u),s.gety(u)),D=zi(E,l,_);if(D.signedDistanceFromCamera>0)return n.projections[u]=D.point,D.point;const V=u-S;return Br(0===g?d:new c.P(s.getx(V),s.gety(V)),E,v,I-g+1,l,_)}function Gr(u,t,n){return u._unit()._perp()._mult(t*n)}function G(u,t,n,s,l,d,g,_){const{projectionCache:v,direction:S}=_;if(v.offsets[u])return v.offsets[u];const I=n.add(t);if(u+S<s||u+S>=l)return v.offsets[u]=I,I;const E=Bt(u+S,_),D=Gr(E.sub(n),g,S),V=n.add(D),U=E.add(D);return v.offsets[u]=c.al(d,I,V,U)||I,v.offsets[u]}function P(u,t,n,s,l,d,g,_,v,S,I,E,D,V){const U=s?u-t:u+t;let $=U>0?1:-1,B=0;s&&($*=-1,B=Math.PI),$<0&&(B+=Math.PI);let oe,fe,K=$>0?_+g:_+g+1,ae=l,ve=l,xe=0,Re=0;const Xe=Math.abs(U),Ge=[];let rt;for(;xe+Re<=Xe;){if(K+=$,K<_||K>=v)return null;xe+=Re,ve=ae,fe=oe;const dt={projectionCache:E,lineVertexArray:S,labelPlaneMatrix:I,tileAnchorPoint:d,distanceFromAnchor:xe,getElevation:V,previousVertex:ve,direction:$,absOffsetX:Xe};if(ae=Bt(K,dt),0===n)Ge.push(ve),rt=ae.sub(ve);else{let qt;const kt=ae.sub(ve);qt=0===kt.mag()?Gr(Bt(K+$,dt).sub(ae),n,$):Gr(kt,n,$),fe||(fe=ve.add(qt)),oe=G(K,qt,ae,_,v,fe,n,dt),Ge.push(fe),rt=oe.sub(fe)}Re=rt.mag()}const Et=rt._mult((Xe-xe)/Re)._add(fe||ve),gi=B+Math.atan2(ae.y-ve.y,ae.x-ve.x);return Ge.push(Et),{point:Et,angle:D?gi:0,path:Ge}}const k=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function F(u,t){for(let n=0;n<u;n++){const s=t.length;t.resize(s+4),t.float32.set(k,3*s)}}function j(u,t,n){const s=t[0],l=t[1];return u[0]=n[0]*s+n[4]*l+n[12],u[1]=n[1]*s+n[5]*l+n[13],u[3]=n[3]*s+n[7]*l+n[15],u}const W=100;class ce{constructor(t,n=new Ir(t.width+200,t.height+200,25),s=new Ir(t.width+200,t.height+200,25)){this.transform=t,this.grid=n,this.ignoredGrid=s,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+W,this.screenBottomBoundary=t.height+W,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(t,n,s,l,d,g){const _=this.projectAndGetPerspectiveRatio(l,t.anchorPointX,t.anchorPointY,g),v=s*_.perspectiveRatio,S=t.x1*v+_.point.x,I=t.y1*v+_.point.y,E=t.x2*v+_.point.x,D=t.y2*v+_.point.y;return!this.isInsideGrid(S,I,E,D)||"always"!==n&&this.grid.hitTest(S,I,E,D,n,d)||_.perspectiveRatio<this.perspectiveRatioCutoff?{box:[],offscreen:!1}:{box:[S,I,E,D],offscreen:this.isOffscreen(S,I,E,D)}}placeCollisionCircles(t,n,s,l,d,g,_,v,S,I,E,D,V,U){const $=[],B=new c.P(n.anchorX,n.anchorY),oe=zi(B,g,U),fe=Rn(this.transform.cameraToCenterDistance,oe.signedDistanceFromCamera),K=(I?d/fe:d*fe)/c.ap,ae=zi(B,_,U).point,ve=Ht(K,l,n.lineOffsetX*K,n.lineOffsetY*K,!1,ae,B,n,s,_,{projections:{},offsets:{}},!1,U);let xe=!1,Re=!1,Xe=!0;if(ve){const Ge=.5*D*fe+V,rt=new c.P(-100,-100),Et=new c.P(this.screenRightBoundary,this.screenBottomBoundary),gi=new Mr,dt=ve.first,qt=ve.last;let kt=[];for(let ai=dt.path.length-1;ai>=1;ai--)kt.push(dt.path[ai]);for(let ai=1;ai<qt.path.length;ai++)kt.push(qt.path[ai]);const Li=2.5*Ge;if(v){const ai=kt.map(_i=>zi(_i,v,U));kt=ai.some(_i=>_i.signedDistanceFromCamera<=0)?[]:ai.map(_i=>_i.point)}let pi=[];if(kt.length>0){const ai=kt[0].clone(),_i=kt[0].clone();for(let cr=1;cr<kt.length;cr++)ai.x=Math.min(ai.x,kt[cr].x),ai.y=Math.min(ai.y,kt[cr].y),_i.x=Math.max(_i.x,kt[cr].x),_i.y=Math.max(_i.y,kt[cr].y);pi=ai.x>=rt.x&&_i.x<=Et.x&&ai.y>=rt.y&&_i.y<=Et.y?[kt]:_i.x<rt.x||ai.x>Et.x||_i.y<rt.y||ai.y>Et.y?[]:c.am([kt],rt.x,rt.y,Et.x,Et.y)}for(const ai of pi){gi.reset(ai,.25*Ge);let _i=0;_i=gi.length<=.5*Ge?1:Math.ceil(gi.paddedLength/Li)+1;for(let cr=0;cr<_i;cr++){const Vi=cr/Math.max(_i-1,1),Wr=gi.lerp(Vi),Ar=Wr.x+W,mr=Wr.y+W;$.push(Ar,mr,Ge,0);const kn=Ar-Ge,Xi=mr-Ge,uo=Ar+Ge,ho=mr+Ge;if(Xe=Xe&&this.isOffscreen(kn,Xi,uo,ho),Re=Re||this.isInsideGrid(kn,Xi,uo,ho),"always"!==t&&this.grid.hitTestCircle(Ar,mr,Ge,t,E)&&(xe=!0,!S))return{circles:[],offscreen:!1,collisionDetected:xe}}}}return{circles:!S&&xe||!Re||fe<this.perspectiveRatioCutoff?[]:$,offscreen:Xe,collisionDetected:xe}}queryRenderedSymbols(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};const n=[];let s=1/0,l=1/0,d=-1/0,g=-1/0;for(const I of t){const E=new c.P(I.x+W,I.y+W);s=Math.min(s,E.x),l=Math.min(l,E.y),d=Math.max(d,E.x),g=Math.max(g,E.y),n.push(E)}const _=this.grid.query(s,l,d,g).concat(this.ignoredGrid.query(s,l,d,g)),v={},S={};for(const I of _){const E=I.key;if(void 0===v[E.bucketInstanceId]&&(v[E.bucketInstanceId]={}),v[E.bucketInstanceId][E.featureIndex])continue;const D=[new c.P(I.x1,I.y1),new c.P(I.x2,I.y1),new c.P(I.x2,I.y2),new c.P(I.x1,I.y2)];c.an(n,D)&&(v[E.bucketInstanceId][E.featureIndex]=!0,void 0===S[E.bucketInstanceId]&&(S[E.bucketInstanceId]=[]),S[E.bucketInstanceId].push(E.featureIndex))}return S}insertCollisionBox(t,n,s,l,d,g){(s?this.ignoredGrid:this.grid).insert({bucketInstanceId:l,featureIndex:d,collisionGroupID:g,overlapMode:n},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,n,s,l,d,g){const _=s?this.ignoredGrid:this.grid,v={bucketInstanceId:l,featureIndex:d,collisionGroupID:g,overlapMode:n};for(let S=0;S<t.length;
1S+=4)_.insertCircle(v,t[S],t[S+1],t[S+2])}projectAndGetPerspectiveRatio(t,n,s,l){let d;return l?(d=[n,s,l(n,s),1],c.ag(d,d,t)):(d=[n,s,0,1],j(d,d,t)),{point:new c.P((d[0]/d[3]+1)/2*this.transform.width+W,(-d[1]/d[3]+1)/2*this.transform.height+W),perspectiveRatio:.5+this.transform.cameraToCenterDistance/d[3]*.5}}isOffscreen(t,n,s,l){return s<W||t>=this.screenRightBoundary||l<W||n>this.screenBottomBoundary}isInsideGrid(t,n,s,l){return s>=0&&t<this.gridRightBoundary&&l>=0&&n<this.gridBottomBoundary}getViewportMatrix(){const t=c.ao([]);return c.$(t,t,[-100,-100,0]),t}}function ee(u,t,n){return t*(c.N/(u.tileSize*Math.pow(2,n-u.tileID.overscaledZ)))}class J{constructor(t,n,s,l){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?n:-n))):l&&s?1:0,this.placed=s}isHidden(){return 0===this.opacity&&!this.placed}}class ne{constructor(t,n,s,l,d){this.text=new J(t?t.text:null,n,s,d),this.icon=new J(t?t.icon:null,n,l,d)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Se{constructor(t,n,s){this.text=t,this.icon=n,this.skipFade=s}}class Pe{constructor(){this.invProjMatrix=c.Z(),this.viewportMatrix=c.Z(),this.circles=[]}}class Le{constructor(t,n,s,l,d){this.bucketInstanceId=t,this.featureIndex=n,this.sourceLayerIndex=s,this.bucketIndex=l,this.tileID=d}}class It{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 n=++this.maxGroupID;this.collisionGroups[t]={ID:n,predicate:s=>s.collisionGroupID===n}}return this.collisionGroups[t]}}function Zt(u,t,n,s,l){const{horizontalAlign:d,verticalAlign:g}=c.au(u);return new c.P(-(d-.5)*t+s[0]*l,-(g-.5)*n+s[1]*l)}function bt(u,t,n,s,l,d){const{x1:g,x2:_,y1:v,y2:S,anchorPointX:I,anchorPointY:E}=u,D=new c.P(t,n);return s&&D._rotate(l?d:-d),{x1:g+D.x,y1:v+D.y,x2:_+D.x,y2:S+D.y,anchorPointX:I,anchorPointY:E}}class Pt{constructor(t,n,s,l,d){this.transform=t.clone(),this.terrain=n,this.collisionIndex=new ce(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=s,this.retainedQueryData={},this.collisionGroups=new It(l),this.collisionCircleArrays={},this.prevPlacement=d,d&&(d.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,n,s,l){const d=s.getBucket(n),g=s.latestFeatureIndex;if(!d||!g||n.id!==d.layerIds[0])return;const _=s.collisionBoxArray,v=d.layers[0].layout,S=Math.pow(2,this.transform.zoom-s.tileID.overscaledZ),I=s.tileSize/c.N,E=this.transform.calculatePosMatrix(s.tileID.toUnwrapped()),D="map"===v.get("text-pitch-alignment"),V="map"===v.get("text-rotation-alignment"),U=ee(s,1,this.transform.zoom),$=tt(E,D,V,this.transform,U);let B=null;if(D){const fe=Er(E,D,V,this.transform,U);B=c.a1([],this.transform.labelPlaneMatrix,fe)}this.retainedQueryData[d.bucketInstanceId]=new Le(d.bucketInstanceId,g,d.sourceLayerIndex,d.index,s.tileID);const oe={bucket:d,layout:v,posMatrix:E,textLabelPlaneMatrix:$,labelToScreenMatrix:B,scale:S,textPixelRatio:I,holdingForFade:s.holdingForFade(),collisionBoxArray:_,partiallyEvaluatedTextSize:c.ah(d.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(d.sourceID)};if(l)for(const fe of d.sortKeyRanges){const{sortKey:K,symbolInstanceStart:ae,symbolInstanceEnd:ve}=fe;t.push({sortKey:K,symbolInstanceStart:ae,symbolInstanceEnd:ve,parameters:oe})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:d.symbolInstances.length,parameters:oe})}attemptAnchorPlacement(t,n,s,l,d,g,_,v,S,I,E,D,V,U,$,B){const oe=c.aq[t.textAnchor],fe=[t.textOffset0,t.textOffset1],K=Zt(oe,s,l,fe,d),ae=this.collisionIndex.placeCollisionBox(bt(n,K.x,K.y,g,_,this.transform.angle),E,v,S,I.predicate,B);if((!$||0!==this.collisionIndex.placeCollisionBox(bt($,K.x,K.y,g,_,this.transform.angle),E,v,S,I.predicate,B).box.length)&&ae.box.length>0){let ve;if(this.prevPlacement&&this.prevPlacement.variableOffsets[D.crossTileID]&&this.prevPlacement.placements[D.crossTileID]&&this.prevPlacement.placements[D.crossTileID].text&&(ve=this.prevPlacement.variableOffsets[D.crossTileID].anchor),0===D.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[D.crossTileID]={textOffset:fe,width:s,height:l,anchor:oe,textBoxScale:d,prevAnchor:ve},this.markUsedJustification(V,oe,D,U),V.allowVerticalPlacement&&(this.markUsedOrientation(V,U,D),this.placedOrientations[D.crossTileID]=U),{shift:K,placedGlyphBoxes:ae}}}placeLayerBucketPart(t,n,s){const{bucket:l,layout:d,posMatrix:g,textLabelPlaneMatr
1ix:_,labelToScreenMatrix:v,textPixelRatio:S,holdingForFade:I,collisionBoxArray:E,partiallyEvaluatedTextSize:D,collisionGroup:V}=t.parameters,U=d.get("text-optional"),$=d.get("icon-optional"),B=c.ar(d,"text-overlap","text-allow-overlap"),oe="always"===B,fe=c.ar(d,"icon-overlap","icon-allow-overlap"),K="always"===fe,ae="map"===d.get("text-rotation-alignment"),ve="map"===d.get("text-pitch-alignment"),xe="none"!==d.get("icon-text-fit"),Re="viewport-y"===d.get("symbol-z-order"),Xe=oe&&(K||!l.hasIconData()||$),Ge=K&&(oe||!l.hasTextData()||U);!l.collisionArrays&&E&&l.deserializeCollisionBoxes(E);const rt=this.retainedQueryData[l.bucketInstanceId].tileID,Et=this.terrain?(dt,qt)=>this.terrain.getElevation(rt,dt,qt):null,gi=(dt,qt)=>{var kt,Li;if(n[dt.crossTileID])return;if(I)return void(this.placements[dt.crossTileID]=new Se(!1,!1,!1));let pi=!1,ai=!1,_i=!0,cr=null,Vi={box:null,offscreen:null},Wr={box:null,offscreen:null},Ar=null,mr=null,kn=null,Xi=0,uo=0,ho=0;qt.textFeatureIndex?Xi=qt.textFeatureIndex:dt.useRuntimeCollisionCircles&&(Xi=dt.featureIndex),qt.verticalTextFeatureIndex&&(uo=qt.verticalTextFeatureIndex);const Uo=qt.textBox;if(Uo){const tn=ur=>{let kr=c.ai.horizontal;if(l.allowVerticalPlacement&&!ur&&this.prevPlacement){const vn=this.prevPlacement.placedOrientations[dt.crossTileID];vn&&(this.placedOrientations[dt.crossTileID]=vn,kr=vn,this.markUsedOrientation(l,kr,dt))}return kr},qr=(ur,kr)=>{if(l.allowVerticalPlacement&&dt.numVerticalGlyphVertices>0&&qt.verticalTextBox){for(const vn of l.writingModes)if(vn===c.ai.vertical?(Vi=kr(),Wr=Vi):Vi=ur(),Vi&&Vi.box&&Vi.box.length)break}else Vi=ur()},un=dt.textAnchorOffsetStartIndex,ss=dt.textAnchorOffsetEndIndex;if(ss===un){const ur=(kr,vn)=>{const hr=this.collisionIndex.placeCollisionBox(kr,B,S,g,V.predicate,Et);return hr&&hr.box&&hr.box.length&&(this.markUsedOrientation(l,vn,dt),this.placedOrientations[dt.crossTileID]=vn),hr};qr(()=>ur(Uo,c.ai.horizontal),()=>{const kr=qt.verticalTextBox;return l.allowVerticalPlacement&&dt.numVerticalGlyphVertices>0&&kr?ur(kr,c.ai.vertical):{box:null,offscreen:null}}),tn(Vi&&Vi.box&&Vi.box.length)}else{let ur=c.aq[null===(Li=null===(kt=this.prevPlacement)||void 0===kt?void 0:kt.variableOffsets[dt.crossTileID])||void 0===Li?void 0:Li.anchor];const kr=(hr,as,_a)=>{const ml=hr.x2-hr.x1,fl=hr.y2-hr.y1,Bl=dt.textBoxScale,$a=xe&&"never"===fe?as:null;let po={box:[],offscreen:!1},ls="never"===B?1:2,mo="never";ur&&ls++;for(let $n=0;$n<ls;$n++){for(let fo=un;fo<ss;fo++){const Za=l.textAnchorOffsets.get(fo);if(ur&&Za.textAnchor!==ur)continue;const So=this.attemptAnchorPlacement(Za,hr,ml,fl,Bl,ae,ve,S,g,V,mo,dt,l,_a,$a,Et);if(So&&(po=So.placedGlyphBoxes,po&&po.box&&po.box.length))return pi=!0,cr=So.shift,po}ur?ur=null:mo=B}return po};qr(()=>kr(Uo,qt.iconBox,c.ai.horizontal),()=>{const hr=qt.verticalTextBox;return l.allowVerticalPlacement&&!(Vi&&Vi.box&&Vi.box.length)&&dt.numVerticalGlyphVertices>0&&hr?kr(hr,qt.verticalIconBox,c.ai.vertical):{box:null,offscreen:null}}),Vi&&(pi=Vi.box,_i=Vi.offscreen);const vn=tn(Vi&&Vi.box);if(!pi&&this.prevPlacement){const hr=this.prevPlacement.variableOffsets[dt.crossTileID];hr&&(this.variableOffsets[dt.crossTileID]=hr,this.markUsedJustification(l,hr.anchor,dt,vn))}}}if(Ar=Vi,pi=Ar&&Ar.box&&Ar.box.length>0,_i=Ar&&Ar.offscreen,dt.useRuntimeCollisionCircles){const tn=l.text.placedSymbolArray.get(dt.centerJustifiedTextSymbolIndex),qr=c.aj(l.textSizeData,D,tn),un=d.get("text-padding");mr=this.collisionIndex.placeCollisionCircles(B,tn,l.lineVertexArray,l.glyphOffsetArray,qr,g,_,v,s,ve,V.predicate,dt.collisionCircleDiameter,un,Et),mr.circles.length&&mr.collisionDetected&&!s&&c.w("Collisions detected, but collision boxes are not shown"),pi=oe||mr.circles.length>0&&!mr.collisionDetected,_i=_i&&mr.offscreen}if(qt.iconFeatureIndex&&(ho=qt.iconFeatureIndex),qt.iconBox){const tn=qr=>{const un=xe&&cr?bt(qr,cr.x,cr.y,ae,ve,this.transform.angle):qr;return this.collisionIndex.placeCollisionBox(un,fe,S,g,V.predicate,Et)};Wr&&Wr.box&&Wr.box.length&&qt.verticalIconBox?(kn=tn(qt.verticalIconBox),ai=kn.box.length>0):(kn=tn(qt.iconBox),ai=kn.box.length>0),_i=_i&&kn.offscreen}const os=U||0===dt.numHorizontalGlyphVertices&&0===dt.numVerticalGlyphVertices,Bs=$||0===dt.numIconVertices;if(os||Bs?Bs?os||(ai=ai&&pi):pi=ai&&pi:ai=pi=ai&&pi,pi&&Ar&&Ar.box&&this.collisionIndex.insertCollisionBox(Ar.box,B,d.get("text-ignore-placement"),l.bucketInstanceId,Wr&&Wr.box&&uo?uo:Xi,V.ID),ai&&kn&&this.collisionIndex.insertCollisionBox(kn.box,fe,d.get("icon-ignore-placement"),l.bucketInstanceId,ho,V.ID),mr&&(pi&&this.collisionIndex.insertCollisionCircles(mr.circles,B,d.get("text-ignore-placement"),l.bucketInstanceId,Xi,V.ID),s)){const tn=l.bucketInstanceId;let qr=this.collisionCircleArrays[tn];void 0===qr&&(qr=this.collisionCircleArrays[tn]=new Pe);for(let un=0;un<mr.circles.length;un+=4)qr.circles.push(mr.circles[un+0]),qr.circles.push(mr.circles[un+1]),qr.circles.push(mr.circles[un+2]),qr.circles.push(mr.collisionDetected?1:0)}if(0===dt.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");if(0===l.bucketInstanceId)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[dt.crossTileID]=new Se(pi||Xe,ai||Ge,_i||l.justReloaded),n[dt.crossTileID]=!0};if(Re){if(0!==t.symbolInstanceStart)throw new Error("bucket.bucketInstanceId should be 0");
vendor: 4,351 bytes, line 1
1const dt=l.getSortedSymbolIndexes(this.transform.angle);for(let qt=dt.length-1;qt>=0;--qt){const kt=dt[qt];gi(l.symbolInstances.get(kt),l.collisionArrays[kt])}}else for(let dt=t.symbolInstanceStart;dt<t.symbolInstanceEnd;dt++)gi(l.symbolInstances.get(dt),l.collisionArrays[dt]);if(s&&l.bucketInstanceId in this.collisionCircleArrays){const dt=this.collisionCircleArrays[l.bucketInstanceId];c.as(dt.invProjMatrix,g),dt.viewportMatrix=this.collisionIndex.getViewportMatrix()}l.justReloaded=!1}markUsedJustification(t,n,s,l){let d;d=l===c.ai.vertical?s.verticalPlacedTextSymbolIndex:{left:s.leftJustifiedTextSymbolIndex,center:s.centerJustifiedTextSymbolIndex,right:s.rightJustifiedTextSymbolIndex}[c.at(n)];const g=[s.leftJustifiedTextSymbolIndex,s.centerJustifiedTextSymbolIndex,s.rightJustifiedTextSymbolIndex,s.verticalPlacedTextSymbolIndex];for(const _ of g)_>=0&&(t.text.placedSymbolArray.get(_).crossTileID=d>=0&&_!==d?0:s.crossTileID)}markUsedOrientation(t,n,s){const l=n===c.ai.horizontal||n===c.ai.horizontalOnly?n:0,d=n===c.ai.vertical?n:0,g=[s.leftJustifiedTextSymbolIndex,s.centerJustifiedTextSymbolIndex,s.rightJustifiedTextSymbolIndex];for(const _ of g)t.text.placedSymbolArray.get(_).placedOrientation=l;s.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(s.verticalPlacedTextSymbolIndex).placedOrientation=d)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const n=this.prevPlacement;let s=!1;this.prevZoomAdjustment=n?n.zoomAdjustment(this.transform.zoom):0;const l=n?n.symbolFadeChange(t):1,d=n?n.opacities:{},g=n?n.variableOffsets:{},_=n?n.placedOrientations:{};for(const v in this.placements){const S=this.placements[v],I=d[v];I?(this.opacities[v]=new ne(I,l,S.text,S.icon),s=s||S.text!==I.text.placed||S.icon!==I.icon.placed):(this.opacities[v]=new ne(null,l,S.text,S.icon,S.skipFade),s=s||S.text||S.icon)}for(const v in d){const S=d[v];if(!this.opacities[v]){const I=new ne(S,l,!1,!1);I.isHidden()||(this.opacities[v]=I,s=s||S.text.placed||S.icon.placed)}}for(const v in g)this.variableOffsets[v]||!this.opacities[v]||this.opacities[v].isHidden()||(this.variableOffsets[v]=g[v]);for(const v in _)this.placedOrientations[v]||!this.opacities[v]||this.opacities[v].isHidden()||(this.placedOrientations[v]=_[v]);if(n&&void 0===n.lastPlacementChangeTime)throw new Error("Last placement time for previous placement is not defined");s?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=n?n.lastPlacementChangeTime:t)}updateLayerOpacities(t,n){const s={};for(const l of n){const d=l.getBucket(t);d&&l.latestFeatureIndex&&t.id===d.layerIds[0]&&this.updateBucketOpacities(d,s,l.collisionBoxArray)}}updateBucketOpacities(t,n,s){t.hasTextData()&&(t.text.opacityVertexArray.clear(),t.text.hasVisibleVertices=!1),t.hasIconData()&&(t.icon.opacityVertexArray.clear(),t.icon.hasVisibleVertices=!1),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const l=t.layers[0],d=l.layout,g=new ne(null,0,!1,!1,!0),_=d.get("text-allow-overlap"),v=d.get("icon-allow-overlap"),S=l._unevaluatedLayout.hasValue("text-variable-anchor")||l._unevaluatedLayout.hasValue("text-variable-anchor-offset"),I="map"===d.get("text-rotation-alignment"),E="map"===d.get("text-pitch-alignment"),D="none"!==d.get("icon-text-fit"),V=new ne(null,0,_&&(v||!t.hasIconData()||d.get("icon-optional")),v&&(_||!t.hasTextData()||d.get("text-optional")),!0);!t.collisionArrays&&s&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(s);const U=($,B,oe)=>{for(let fe=0;fe<B/4;fe++)$.opacityVertexArray.emplaceBack(oe);$.hasVisibleVertices=$.hasVisibleVertices||oe!==se};for(let $=0;$<t.symbolInstances.length;$++){const B=t.symbolInstances.get($),{numHorizontalGlyphVertices:oe,numVerticalGlyphVertices:fe,crossTileID:K}=B;let ae=this.opacities[K];n[K]?ae=g:ae||(ae=V,this.opacities[K]=ae),n[K]=!0;const ve=B.numIconVertices>0,xe=this.placedOrientations[B.crossTileID],Re=xe===c.ai.vertical,Xe=xe===c.ai.horizontal||xe===c.ai.horizontalOnly;if(oe>0||fe>0){const Ge=ge(ae.text);U(t.text,oe,Re?se:Ge),U(t.text,fe,Xe?se:Ge);const rt=ae.text.isHidden();[B.rightJustifiedTextSymbolIndex,B.centerJustifiedTextSymbolIndex,B.leftJustifiedTextSymbolIndex].forEac
1h(dt=>{dt>=0&&(t.text.placedSymbolArray.get(dt).hidden=rt||Re?1:0)}),B.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(B.verticalPlacedTextSymbolIndex).hidden=rt||Xe?1:0);const Et=this.variableOffsets[B.crossTileID];Et&&this.markUsedJustification(t,Et.anchor,B,xe);const gi=this.placedOrientations[B.crossTileID];gi&&(this.markUsedJustification(t,"left",B,gi),this.markUsedOrientation(t,gi,B))}if(ve){const Ge=ge(ae.icon),rt=!(D&&B.verticalPlacedIconSymbolIndex&&Re);B.placedIconSymbolIndex>=0&&(U(t.icon,B.numIconVertices,rt?Ge:se),t.icon.placedSymbolArray.get(B.placedIconSymbolIndex).hidden=ae.icon.isHidden()),B.verticalPlacedIconSymbolIndex>=0&&(U(t.icon,B.numVerticalIconVertices,rt?se:Ge),t.icon.placedSymbolArray.get(B.verticalPlacedIconSymbolIndex).hidden=ae.icon.isHidden())}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const Ge=t.collisionArrays[$];if(Ge){let rt=new c.P(0,0);if(Ge.textBox||Ge.verticalTextBox){let gi=!0;if(S){const dt=this.variableOffsets[K];dt?(rt=Zt(dt.anchor,dt.width,dt.height,dt.textOffset,dt.textBoxScale),I&&rt._rotate(E?this.transform.angle:-this.transform.angle)):gi=!1}Ge.textBox&&Kt(t.textCollisionBox.collisionVertexArray,ae.text.placed,!gi||Re,rt.x,rt.y),Ge.verticalTextBox&&Kt(t.textCollisionBox.collisionVertexArray,ae.text.placed,!gi||Xe,rt.x,rt.y)}const Et=!(Xe||!Ge.verticalIconBox);Ge.iconBox&&Kt(t.iconCollisionBox.collisionVertexArray,ae.icon.placed,Et,D?rt.x:0,D?rt.y:0),Ge.verticalIconBox&&Kt(t.iconCollisionBox.collisionVertexArray,ae.icon.placed,!Et,D?rt.x:0,D?rt.y:0)}}}if(t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);if(t.bucketInstanceId in this.collisionCircleArrays){const $=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=$.invProjMatrix,t.placementViewportMatrix=$.viewportMatrix,t.collisionCircleArray=$.circles,delete this.collisionCircleArrays[t.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,n){const s=this.zoomAtLastRecencyCheck===n?1-this.zoomAdjustment(n):1;return this.zoomAtLastRecencyCheck=n,this.commitTime+this.fadeDuration*s>t}setStale(){this.stale=!0}}function Kt(u,t,n,s,l){u.emplaceBack(t?1:0,n?1:0,s||0,l||0),u.emplaceBack(t?1:0,n?1:0,s||0,l||0),u.emplaceBack(t?1:0,n?1:0,s||0,l||0),u.emplaceBack(t?1:0,n?1:0,s||0,l||0)}const bi=Math.pow(2,25),ni=Math.pow(2,24),hi=Math.pow(2,17),ci=Math.pow(2,16),sr=Math.pow(2,9),Ci=Math.pow(2,8),_e=Math.pow(2,1);function ge(u){if(0===u.opacity&&!u.placed)return 0;if(1===u.opacity&&u.placed)return 4294967295;const t=u.placed?1:0,n=Math.floor(127*u.opacity);return n*bi+t*ni+n*hi+t*ci+n*sr+t*Ci+n*_e+t}const se=0;class je{constructor(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,n,s,l,d){const g=this._bucketParts;for(;this._currentTileIndex<t.length;)if(n.getBucketParts(g,l,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,d())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,g.sort((_,v)=>
vendor: 4,739 bytes, line 1
1_.sortKey-v.sortKey));this._currentPartIndex<g.length;)if(n.placeLayerBucketPart(g[this._currentPartIndex],this._seenCrossTileIDs,s),this._currentPartIndex++,d())return!0;return!1}}class Ye{constructor(t,n,s,l,d,g,_,v){this.placement=new Pt(t,n,g,_,v),this._currentPlacementIndex=s.length-1,this._forceFullPlacement=l,this._showCollisionBoxes=d,this._done=!1}isDone(){return this._done}continuePlacement(t,n,s){const l=c.h.now(),d=()=>!this._forceFullPlacement&&c.h.now()-l>2;for(;this._currentPlacementIndex>=0;){const g=n[t[this._currentPlacementIndex]],_=this.placement.collisionIndex.transform.zoom;if("symbol"===g.type&&(!g.minzoom||g.minzoom<=_)&&(!g.maxzoom||g.maxzoom>_)){if(this._inProgressLayer||(this._inProgressLayer=new je(g)),this._inProgressLayer.continuePlacement(s[g.source],this.placement,this._showCollisionBoxes,g,d))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const Lt=512/c.N/2;class ti{constructor(t,n,s){this.tileID=t,this.bucketInstanceId=s,this._symbolsByKey={};const l=new Map;for(let d=0;d<n.length;d++){const g=n.get(d),_=g.key,v=l.get(_);v?v.push(g):l.set(_,[g])}for(const[d,g]of l){const _={positions:g.map(v=>({x:Math.floor(v.anchorX*Lt),y:Math.floor(v.anchorY*Lt)})),crossTileIDs:g.map(v=>v.crossTileID)};if(_.positions.length>128){const v=new c.av(_.positions.length,16,Uint16Array);for(const{x:S,y:I}of _.positions)v.add(S,I);v.finish(),delete _.positions,_.index=v}this._symbolsByKey[d]=_}}getScaledCoordinates(t,n){const{x:s,y:l,z:d}=this.tileID.canonical,{x:g,y:_,z:v}=n.canonical,S=Lt/Math.pow(2,v-d),I=(_*c.N+t.anchorY)*S,E=l*c.N*Lt;return{x:Math.floor((g*c.N+t.anchorX)*S-s*c.N*Lt),y:Math.floor(I-E)}}findMatches(t,n,s){const l=this.tileID.canonical.z<n.canonical.z?1:Math.pow(2,this.tileID.canonical.z-n.canonical.z);for(let d=0;d<t.length;d++){const g=t.get(d);if(g.crossTileID)continue;const _=this._symbolsByKey[g.key];if(!_)continue;const v=this.getScaledCoordinates(g,n);if(_.index){const S=_.index.range(v.x-l,v.y-l,v.x+l,v.y+l).sort();for(const I of S){const E=_.crossTileIDs[I];if(!s[E]){s[E]=!0,g.crossTileID=E;break}}}else if(_.positions)for(let S=0;S<_.positions.length;S++){const I=_.positions[S],E=_.crossTileIDs[S];if(Math.abs(I.x-v.x)<=l&&Math.abs(I.y-v.y)<=l&&!s[E]){s[E]=!0,g.crossTileID=E;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:t})=>t)}}class Jt{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class fn{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const n=Math.round((t-this.lng)/360);if(0!==n)for(const s in this.indexes){const l=this.indexes[s],d={};for(const g in l){const _=l[g];_.tileID=_.tileID.unwrapTo(_.tileID.wrap+n),d[_.tileID.key]=_}this.indexes[s]=d}this.lng=t}addBucket(t,n,s){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===n.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let d=0;d<n.symbolInstances.length;d++)n.symbolInstances.get(d).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});const l=this.usedCrossTileIDs[t.overscaledZ];for(const d in this.indexes){const g=this.indexes[d];if(Number(d)>t.overscaledZ)for(const _ in g){const v=g[_];v.tileID.isChildOf(t)&&v.findMatches(n.symbolInstances,t,l)}else{const _=g[t.scaledTo(Number(d)).key];_&&_.findMatches(n.symbolInstances,t,l)}}for(let d=0;d<n.symbolInstances.length;d++){const g=n.symbolInstances.get(d);g.crossTileID||(g.crossTileID=s.generate(),l[g.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new ti(t,n.symbolInstances,n.bucketInstanceId),!0}removeBucketCrossTileIDs(t,n){for(const s of n.getCrossTileIDsLists())for(const l of s)delete this.usedCrossTileIDs[t][l]}removeStaleBuckets(t){let n=!1;for(const s in this.indexes){const l=this.indexes[s];for(const d in l)t[l[d].bucketInstanceId]||(this.removeBucketCrossTileIDs(s,l[d]),delete l[d],n=!0)}return n}}class jr{constructor(){this.layerIndexes={},this.crossTileIDs=new Jt,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(t,n,s){let l=this.layerIndexes[t.id];void 0===l&&(l=this.layerIndexes[t.id]=new fn);let d=!1;const g={};l.handleWrapJump(s);for(const _ of n){const v=_.getBucket(t);v&&t.id===v.layerIds[0]&&(v.bucketInstanceId||(v.bucketInstanceId=++this.maxBucketInstanceId),l.addBucket(_.tileID,v,this.crossTileIDs)&&(d=!0),g[v.bucketInstanceId]=!0)}return l.removeStaleBuckets(g)&&(d=!0),d}pruneUnusedLayers(t){const n={};t.forEach(s=>
1{n[s]=!0});for(const s in this.layerIndexes)n[s]||delete this.layerIndexes[s]}}const Mi=(u,t)=>c.x(u,t&&t.filter(n=>"source.canvas"!==n.identifier)),Nr=c.F(c.ax,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setGlyphs","setSprite"]),yo=c.F(c.ax,["setCenter","setZoom","setBearing","setPitch"]),vr=c.aw();class xr extends c.E{constructor(t,n={}){super(),this.map=t,this.dispatcher=new Ut(ki(),this,t._getMapId()),this.imageManager=new Ie,this.imageManager.setEventedParent(this),this.glyphManager=new St(t._requestManager,n.localIdeographFontFamily),this.lineAtlas=new et(256,512),this.crossTileSymbolIndex=new jr,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new c.ay,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",c.az());const s=this;this._rtlTextPluginCallback=xr.registerForPluginStateChange(l=>{s.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:l.pluginStatus,pluginURL:l.pluginURL},(d,g)=>{if(c.aA(d),g&&g.every(_=>_))for(const _ in s.sourceCaches){const v=s.sourceCaches[_].getSource().type;"vector"!==v&&"geojson"!==v||s.sourceCaches[_].reload()}})}),this.on("data",l=>{if("source"!==l.dataType||"metadata"!==l.sourceDataType)return;const d=this.sourceCaches[l.sourceId];if(!d)return;const g=d.getSource();if(g&&g.vectorLayerIds)for(const _ in this._layers){const v=this._layers[_];v.source===g.id&&this._validateLayer(v)}})}loadURL(t,n={},s){this.fire(new c.k("dataloading",{dataType:"style"})),n.validate="boolean"!=typeof n.validate||n.validate;const l=this.map._requestManager.transformRequest(t,Ze.Style);this._request=c.f(l,(d,g)=>{this._request=null,d?this.fire(new c.j(d)):g&&this._load(g,n,s)})}loadJSON(t,n={},s){this.fire(new c.k("dataloading",{dataType:"style"})),this._request=c.h.frame(()=>{this._request=null,n.validate=!1!==n.validate,this._load(t,n,s)})}loadEmpty(){this.fire(new c.k("dataloading",{dataType:"style"})),this._load(vr,{validate:!1})}_load(t,n,s){var l;const d=n.transformStyle?n.transformStyle(s,t):t;if(!n.validate||!Mi(this,c.y(d))){this._loaded=!0,this.stylesheet=d;for(const g in d.sources)this.addSource(g,d.sources[g],{validate:!1});d.sprite?this._loadSprite(d.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(d.glyphs),this._createLayers(),this.light=new We(this.stylesheet.light),this.map.setTerrain(null!==(l=this.stylesheet.terrain)&&void 0!==l?l:null),this.fire(new c.k("data",{dataType:"style"})),this.fire(new c.k("style.load"))}}_createLayers(){const t=c.aB(this.stylesheet.layers);this.dispatcher.broadcast("setLayers",t),this._order=t.map(n=>n.id),this._layers={},this._serializedLayers=null;for(const n of t){const s=c.aC(n);s.setEventedParent(this,{layer:{id:n.id}}),this._layers[n.id]=s}}_loadSprite(t,n=!1,s=void 0){this.imageManager.setLoaded(!1),this._spriteRequest=function(l,d,g,_){const v=Ae(l),S=v.length,I=g>1?"@2x":"",E={},D={},V={};for(const{id:U,url:$}of v){const B=d.transformRequest(d.normalizeSpriteURL($,I,".json"),Ze.SpriteJSON),oe=`${U}_${B.url}`;E[oe]=c.f(B,(ae,ve)=>{delete E[oe],D[U]=ve,Me(_,D,V,ae,S)});const fe=d.transformRequest(d.normalizeSpriteURL($,I,".png"),Ze.SpriteImage),K=`${U}_${fe.url}`;E[K]=He.getImage(fe,(ae,ve)=>{delete E[K],V[U]=ve,Me(_,D,V,ae,S)})}return{cancel(){for(const U of Object.values(E))U.cancel()}}}(t,this.map._requestManager,this.map.getPixelRatio(),(l,d)=>{if(this._spriteRequest=null,l)this.fire(new c.j(l));else if(d)for(const g in d){this._spritesImagesIds[g]=[];const _=this._spritesImagesIds[g]?this._spritesImagesIds[g].filter(v=>!(v in d)):[];for(const v of _)this.imageManager.removeImage(v),this._changedImages[v]=!0;for(const v in d[g]){const S="default"===g?v:`${g}:${v}`;this._spritesImagesIds[g].push(S),S in this.imageManager.images?this.imageManager.updateImage(S,d[g][v],!1):this.imageManager.addImage(S,d[g][v]),n&&(this._changedImages[S]=!0)}}this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),n&&(this._changed=!0),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new c.k("data",{dataType:"style"})),s&&s(l)})}_unloadSprite(){for(const t of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(t),this._changedImages[t]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}_validateLayer(t){const n=this.sourceCaches[t.source];if(!n)return;const s=t.sourceLayer;if(!s)return;const l=n.getSource();("geojson"===l.type||l.vectorLayerIds&&-1===l.vectorLayerIds.indexOf(s))&&this.fire(new c.j(new Error(`Source layer "${s}" does not exist on source "${l.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(t){const n=this._serializedAllLayers();if(!t||0===t.length)return Object.values(n);const s=[];for(const l of t)n[l]&&s.push(n[l]);return s}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};const n=Object.keys(this._layers);for(const s of n){const l=this._layers[s];"custom"!==l.type&&(t[s]=l.serialize())}return t}hasTransitions(){if(this.light&&this.light.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}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;const n=this._changed;if(this._changed){const l=Object.keys(this._updatedLayers),d=Object.keys(this._removedLayers);(l.length||d.length)&&this._updateWorkerLayers(l,d);for(const g in this._updatedSources){const _=this._updatedSources[g];if("reload"===_)this._reloadSource(g);else{if("clear"!==_)throw new Error(`Invalid action ${_}`);this._clearSource(g)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const g in this._updatedPaintProps)this._layers[g].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}const s={};for(const l in this.sourceCaches){const d=this.sourceCaches[l];s[l]=d.used,d.used=!1}for(const l of this._order){const d=this._layers[l];d.recalculate(t,this._availableImages),!d.isHidden(t.zoom)&&d.source&&(this.sourceCaches[d.source].used=!0)}for(const l in s){const d=this.sourceCaches[l];s[l]!==d.used&&d.fire(new c.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:l}))}this.light.recalculate(t),this.z=t.zoom,n&&this.fire(new c.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const n in this.sourceCaches)this.sourceCaches[n].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,n){this.dispatcher.broadcast("updateLayers",{layers:this._serializeByIds(t),removedIds:n})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,n={}){this._checkLoaded();const s=this.serialize();if(t=n.transformStyle?n.transformStyle(s,t):t,Mi(this,c.y(t)))return!1;(t=c.aD(t)).layers=c.aB(t.layers);const l=c.aE(s,t).filter(g=>!(g.command in yo));if(0===l.length)return!1;const d=l.filter(g=>!(g.command in Nr));if(d.length>0)throw new Error(`Unimplemented: ${d.map(g=>g.command).join(", ")}.`);for(const g of l)"setTransition"!==g.command&&this[g.command].apply(this,g.args);return this.stylesheet=t,this._serializedLayers=null,!0}addImage(t,n){if(this.getImage(t))return this.fire(new c.j(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,n),this._afterImageUpdated(t)}updateImage(t,n){this.imageManager.updateImage(t,n)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new c.j(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,n,s={}){if(this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error(`Source "${t}" already exists.`);
vendor: 8,977 bytes, line 1
1if(!n.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(n).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(c.y.source,`sources.${t}`,n,null,s))return;this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);const l=this.sourceCaches[t]=new ei(t,n,this.dispatcher);l.style=this,l.setEventedParent(this,()=>({isSourceLoaded:l.loaded(),source:l.serialize(),sourceId:t})),l.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");for(const s in this._layers)if(this._layers[s].source===t)return this.fire(new c.j(new Error(`Source "${t}" cannot be removed while layer "${s}" is using it.`)));const n=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],n.fire(new c.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),n.setEventedParent(null),n.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,n){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error(`There is no source with this ID=${t}`);const s=this.sourceCaches[t].getSource();if("geojson"!==s.type)throw new Error(`geojsonSource.type is ${s.type}, which is !== 'geojson`);s.setData(n),this._changed=!0}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(t,n,s={}){this._checkLoaded();const l=t.id;if(this.getLayer(l))return void this.fire(new c.j(new Error(`Layer "${l}" already exists on this map.`)));let d;if("custom"===t.type){if(Mi(this,c.aF(t)))return;d=c.aC(t)}else{if("source"in t&&"object"==typeof t.source&&(this.addSource(l,t.source),t=c.aD(t),t=c.e(t,{source:l})),this._validate(c.y.layer,`layers.${l}`,t,{arrayIndex:-1},s))return;d=c.aC(t),this._validateLayer(d),d.setEventedParent(this,{layer:{id:l}})}const g=n?this._order.indexOf(n):this._order.length;if(n&&-1===g)this.fire(new c.j(new Error(`Cannot add layer "${l}" before non-existing layer "${n}".`)));else{if(this._order.splice(g,0,l),this._layerOrderChanged=!0,this._layers[l]=d,this._removedLayers[l]&&d.source&&"custom"!==d.type){const _=this._removedLayers[l];delete this._removedLayers[l],_.type!==d.type?this._updatedSources[d.source]="clear":(this._updatedSources[d.source]="reload",this.sourceCaches[d.source].pause())}this._updateLayer(d),d.onAdd&&d.onAdd(this.map)}}moveLayer(t,n){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new c.j(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===n)return;const s=this._order.indexOf(t);this._order.splice(s,1);const l=n?this._order.indexOf(n):this._order.length;n&&-1===l?this.fire(new c.j(new Error(`Cannot move layer "${t}" before non-existing layer "${n}".`))):(this._order.splice(l,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();const n=this._layers[t];if(!n)return void this.fire(new c.j(new Error(`Cannot remove non-existing layer "${t}".`)));n.setEventedParent(null);const s=this._order.indexOf(t);this._order.splice(s,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=n,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],n.onRemove&&n.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,n,s){this._checkLoaded();const l=this.getLayer(t);l?l.minzoom===n&&l.maxzoom===s||(null!=n&&(l.minzoom=n),null!=s&&(l.maxzoom=s),this._updateLayer(l)):this.fire(new c.j(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,n,s={}){this._checkLoaded();const l=this.getLayer(t);if(l){if(!c.aG(l.filter,n))return null==n?(l.filter=void 0,void this._updateLayer(l)):void(this._validate(c.y.filter,`layers.${l.id}.filter`,n,null,s)||(l.filter=c.aD(n),this._updateLayer(l)))}else this.fire(new c.j(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return c.aD(this.getLayer(t).filter)}setLayoutProperty(t,n,s,l={}){this._checkLoaded();const d=this.getLayer(t);d?c.aG(d.getLayoutProperty(n),s)||(d.setLayoutProperty(n,s,l),this._updateLayer(d)):this.fire(new c.j(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,n){const s=this.getLayer(t);if(s)return s.getLayoutProperty(n);this.fire(new c.j(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,n,s,l={}){this._checkLoaded();const d=this.getLayer(t);d?c.aG(d.getPaintProperty(n),s)||(d.setPaintProperty(n,s,l)&&this._updateLayer(d),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new c.j(new Error(`Cannot style non-existing layer "${t}".`)))}getPaintProperty(t,n){return this.getLayer(t).getPaintProperty(n)}setFeatureState(t,n){this._checkLoaded();const s=t.source,l=t.sourceLayer,d=this.sourceCaches[s];if(void 0===d)return void this.fire(new c.j(new Error(`The source '${s}' does not exist in the map's style.`)));const g=d.getSource().type;"geojson"===g&&l?this.fire(new c.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==g||l?(void 0===t.id&&this.fire(new c.j(new Error("The feature id parameter must be provided."))),d.setFeatureState(l,t.id,n)):this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,n){this._checkLoaded();const s=t.source,l=this.sourceCaches[s];if(void 0===l)return void this.fire(new c.j(new Error(`The source '${s}' does not exist in the map's style.`)));const d=l.getSource().type,g="vector"===d?t.sourceLayer:void 0;"vector"!==d||g?n&&"string"!=typeof t.id&&"number"!=typeof t.id?this.fire(new c.j(new Error("A feature id is required to remove its specific state property."))):l.removeFeatureState(g,t.id,n):this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();const n=t.source,s=t.sourceLayer,l=this.sourceCaches[n];if(void 0!==l)return"vector"!==l.getSource().type||s?(void 0===t.id&&this.fire(new c.j(new Error("The feature id parameter must be provided."))),l.getFeatureState(s,t.id)):void this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new c.j(new Error(`The source '${n}' does not exist in the map's style.`)))}getTransition(){return c.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const t=c.aH(this.sourceCaches,d=>d.serialize()),n=this._serializeByIds(this._order),s=this.map.getTerrain()||void 0,l=this.stylesheet;return c.aI({version:l.version,name:l.name,metadata:l.metadata,light:l.light,center:l.center,zoom:l.zoom,bearing:l.bearing,pitch:l.pitch,sprite:l.sprite,glyphs:l.glyphs,transition:l.transition,sources:t,layers:n,terrain:s},d=>void 0!==d)}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){const n=g=>"fill-extrusion"===this._layers[g].type,s={},l=[];for(let g=this._order.length-1;g>=0;g--){const _=this._order[g];if(n(_)){s[_]=g;for(const v of t){const S=v[_];if(S)for(const I of S)l.push(I)}}}l.sort((g,_)=>_.intersectionZ-g.intersectionZ);const d=[];for(let g=this._order.length-1;g>=0;g--){const _=this._order[g];if(n(_))for(let v=l.length-1;v>=0;v--){const S=l[v].feature;if(s[S.layer.id]<g)break;d.push(S),l.pop()}else for(const v of t){const S=v[_];if(S)for(const I of S)d.push(I.feature)}}return d}queryRenderedFeatures(t,n,s){n&&n.filter&&this._validate(c.y.filter,"queryRenderedFeatures.filter",n.filter,null,n);const l={};if(n&&n.layers){if(!Array.isArray(n.layers))return this.fire(new c.j(new Error("parameters.layers must be an Array."))),[];for(const _ of n.layers){const v=this._layers[_];if(!v)return this.fire(new c.j(new Error(`The layer '${_}' does not exist in the map's style and cannot be queried for features.`))),[];l[v.source]=!0}}const d=[];n.availableImages=this._availableImages;const g=this._serializedAllLayers();for(const _ in this.sourceCaches)n.layers&&!l[_]||d.push(li(this.sourceCaches[_],this._layers,g,t,n,s));return this.placement&&d.push(function(_,v,S,I,E,D,V){const U={},$=D.queryRenderedSymbols(I),B=[];for(const oe of Object.keys($).map(Number))B.push(V[oe]);B.sort(Xr);for(const oe of B){const fe=oe.featureIndex.lookupSymbolFeatures($[oe.bucketInstanceId],v,oe.bucketIndex,oe.sourceLayerIndex,E.filter,E.layers,E.availableImages,_);for(const K in fe){const ae=U[K]=U[K]||[],ve=fe[K];ve.sort((xe,Re)=>{const Xe=oe.featureSortOrder;if(Xe){const Ge=Xe.indexOf(xe.featureIndex);return Xe.indexOf(Re.featureIndex)-Ge}return Re.featureIndex-xe.featureIndex});
1for(const xe of ve)ae.push(xe)}}for(const oe in U)U[oe].forEach(fe=>{const K=fe.feature,ae=S[_[oe].source].getFeatureState(K.layer["source-layer"],K.id);K.source=K.layer.source,K.layer["source-layer"]&&(K.sourceLayer=K.layer["source-layer"]),K.state=ae});return U}(this._layers,g,this.sourceCaches,t,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(d)}querySourceFeatures(t,n){n&&n.filter&&this._validate(c.y.filter,"querySourceFeatures.filter",n.filter,null,n);const s=this.sourceCaches[t];return s?function(l,d){const g=l.getRenderableIds().map(S=>l.getTileByID(S)),_=[],v={};for(let S=0;S<g.length;S++){const I=g[S],E=I.tileID.canonical.key;v[E]||(v[E]=!0,I.querySourceFeatures(_,d))}return _}(s,n):[]}addSourceType(t,n,s){return tr(t)?s(new Error(`A source type called "${t}" already exists.`)):(Vr[t]=n,n.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:n.workerSourceURL},s):s(null,null))}getLight(){return this.light.getLight()}setLight(t,n={}){this._checkLoaded();const s=this.light.getLight();let l=!1;for(const g in t)if(!c.aG(t[g],s[g])){l=!0;break}if(!l)return;const d={now:c.h.now(),transition:c.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,n),this.light.updateTransitions(d)}_validate(t,n,s,l,d={}){return(!d||!1!==d.validate)&&Mi(this,t.call(c.y,c.e({key:n,style:this.serialize(),value:s,styleSpec:c.v},l)))}_remove(t=!0){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),c.aJ.off("pluginStateChange",this._rtlTextPluginCallback);for(const n in this._layers)this._layers[n].setEventedParent(null);for(const n in this.sourceCaches){const s=this.sourceCaches[n];s.setEventedParent(null),s.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove(t)}_clearSource(t){this.sourceCaches[t].clearTiles()}_reloadSource(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()}_updateSources(t){for(const n in this.sourceCaches)this.sourceCaches[n].update(t,this.map.terrain)}_generateCollisionBoxes(){for(const t in this.sourceCaches)this._reloadSource(t)}_updatePlacement(t,n,s,l,d=!1){let g=!1,_=!1;const v={};for(const S of this._order){const I=this._layers[S];if("symbol"!==I.type)continue;if(!v[I.source]){const D=this.sourceCaches[I.source];v[I.source]=D.getRenderableIds(!0).map(V=>D.getTileByID(V)).sort((V,U)=>U.tileID.overscaledZ-V.tileID.overscaledZ||(V.tileID.isLessThan(U.tileID)?-1:1))}const E=this.crossTileSymbolIndex.addLayer(I,v[I.source],t.center.lng);g=g||E}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((d=d||this._layerOrderChanged||0===s)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(c.h.now(),t.zoom))&&(this.pauseablePlacement=new Ye(t,this.map.terrain,this._order,d,n,s,l,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,v),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(c.h.now()),_=!0),g&&this.pauseablePlacement.placement.setStale()),_||g)for(const S of this._order){const I=this._layers[S];"symbol"===I.type&&this.placement.updateLayerOpacities(I,v[I.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(c.h.now())}_releaseSymbolFadeTiles(){for(const t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,n,s){this.imageManager.getImages(n.icons,s),this._updateTilesForChangedImages();const l=this.sourceCaches[n.source];l&&l.setDependencies(n.tileID.key,n.type,n.icons)}getGlyphs(t,n,s){this.glyphManager.getGlyphs(n.stacks,s);const l=this.sourceCaches[n.source];l&&l.setDependencies(n.tileID.key,n.type,[""])}getResource(t,n,s){return c.m(n,s)}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,n={}){this._checkLoaded(),t&&this._validate(c.y.glyphs,"glyphs",t,null,n)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}
1addSprite(t,n,s={},l){this._checkLoaded();const d=[{id:t,url:n}],g=[...Ae(this.stylesheet.sprite),...d];this._validate(c.y.sprite,"sprite",g,null,s)||(this.stylesheet.sprite=g,this._loadSprite(d,!0,l))}removeSprite(t){this._checkLoaded();const n=Ae(this.stylesheet.sprite);if(n.find(s=>s.id===t)){if(this._spritesImagesIds[t])for(const s of this._spritesImagesIds[t])this.imageManager.removeImage(s),this._changedImages[s]=!0;n.splice(n.findIndex(s=>s.id===t),1),this.stylesheet.sprite=n.length>0?n:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}else this.fire(new c.j(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return Ae(this.stylesheet.sprite)}setSprite(t,n={},s){this._checkLoaded(),t&&this._validate(c.y.sprite,"sprite",t,null,n)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,s):(this._unloadSprite(),s&&s(null)))}}xr.registerForPluginStateChange=c.aK;var ps=c.Q([{name:"a_pos",type:"Int16",components:2}]),Po="attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_depth;void main() {float extent=8192.0;float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/extent;gl_Position=u_matrix*vec4(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}";const Gi={prelude:wi("#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\n","#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(unpack_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;}\n#ifdef TERRAIN3D\nuniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;\n#endif\nconst highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\nvec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;\n#else\nreturn 0.0;\n#endif\n}"),background:wi("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_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);}"),backgroundPattern:wi("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;
1uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\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);}"),circle:wi("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(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility;\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(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 ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),clippingMask:wi("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:wi("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 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;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}"),heatmapTexture:wi("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:wi("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:wi("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:wi("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:wi("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),fillOutline:wi("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),fillOutlinePattern:wi("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform 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;}"),fillPattern:wi("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform 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);}"),fillExtrusion:wi("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+heig
1ht_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),fillExtrusionPattern:wi("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 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying 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 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),hillshadePrepare:wi("#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((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\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:wi("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;
1\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:wi("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\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#endif\nv_width2=vec2(outset,inset);}"),lineGradient:wi("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);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;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#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\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#endif\nv_width2=vec2(outset,inset);}"),linePattern:wi("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform 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);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;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;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\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#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),lineSDF:wi("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;
1uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\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#endif\nv_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),raster:wi("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:wi("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,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,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}"),symbolSDF:wi("#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 inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,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,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),symbolTextAndIcon:wi("#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;
1gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,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,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}"),terrain:wi("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",Po),terrainDepth:wi("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}",Po),terrainCoords:wi("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}",Po)};
vendor: 11,331 bytes, line 1
1function wi(u,t){const n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,s=t.match(/attribute ([\w]+) ([\w]+)/g),l=u.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),d=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),g=d?d.concat(l):l,_={};return{fragmentSource:u=u.replace(n,(v,S,I,E,D)=>(_[D]=!0,"define"===S?`\n#ifndef HAS_UNIFORM_u_${D}\nvarying ${I} ${E} ${D};\n#else\nuniform ${I} ${E} u_${D};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${D}\n ${I} ${E} ${D} = u_${D};\n#endif\n`)),vertexSource:t=t.replace(n,(v,S,I,E,D)=>{const V="float"===E?"vec2":"vec4",U=D.match(/color/)?"color":V;return _[D]?"define"===S?`\n#ifndef HAS_UNIFORM_u_${D}\nuniform lowp float u_${D}_t;\nattribute ${I} ${V} a_${D};\nvarying ${I} ${E} ${D};\n#else\nuniform ${I} ${E} u_${D};\n#endif\n`:"vec4"===U?`\n#ifndef HAS_UNIFORM_u_${D}\n ${D} = a_${D};\n#else\n ${I} ${E} ${D} = u_${D};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${D}\n ${D} = unpack_mix_${U}(a_${D}, u_${D}_t);\n#else\n ${I} ${E} ${D} = u_${D};\n#endif\n`:"define"===S?`\n#ifndef HAS_UNIFORM_u_${D}\nuniform lowp float u_${D}_t;\nattribute ${I} ${V} a_${D};\n#else\nuniform ${I} ${E} u_${D};\n#endif\n`:"vec4"===U?`\n#ifndef HAS_UNIFORM_u_${D}\n ${I} ${E} ${D} = a_${D};\n#else\n ${I} ${E} ${D} = u_${D};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${D}\n ${I} ${E} ${D} = unpack_mix_${U}(a_${D}, u_${D}_t);\n#else\n ${I} ${E} ${D} = u_${D};\n#endif\n`}),staticAttributes:s,staticUniforms:g}}class Wn{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,n,s,l,d,g,_,v,S){this.context=t;let I=this.boundPaintVertexBuffers.length!==l.length;for(let E=0;!I&&E<l.length;E++)this.boundPaintVertexBuffers[E]!==l[E]&&(I=!0);!this.vao||this.boundProgram!==n||this.boundLayoutVertexBuffer!==s||I||this.boundIndexBuffer!==d||this.boundVertexOffset!==g||this.boundDynamicVertexBuffer!==_||this.boundDynamicVertexBuffer2!==v||this.boundDynamicVertexBuffer3!==S?this.freshBind(n,s,l,d,g,_,v,S):(t.bindVertexArray.set(this.vao),_&&_.bind(),d&&d.dynamicDraw&&d.bind(),v&&v.bind(),S&&S.bind())}freshBind(t,n,s,l,d,g,_,v){const S=t.numAttributes,I=this.context,E=I.gl;this.vao&&this.destroy(),this.vao=I.createVertexArray(),I.bindVertexArray.set(this.vao),this.boundProgram=t,this.boundLayoutVertexBuffer=n,this.boundPaintVertexBuffers=s,this.boundIndexBuffer=l,this.boundVertexOffset=d,this.boundDynamicVertexBuffer=g,this.boundDynamicVertexBuffer2=_,this.boundDynamicVertexBuffer3=v,n.enableAttributes(E,t);for(const D of s)D.enableAttributes(E,t);g&&g.enableAttributes(E,t),_&&_.enableAttributes(E,t),v&&v.enableAttributes(E,t),n.bind(),n.setVertexAttribPointers(E,t,d);for(const D of s)D.bind(),D.setVertexAttribPointers(E,t,d);g&&(g.bind(),g.setVertexAttribPointers(E,t,d)),l&&l.bind(),_&&(_.bind(),_.setVertexAttribPointers(E,t,d)),v&&(v.bind(),v.setVertexAttribPointers(E,t,d)),I.currentNumAttributes=S}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}function ji(u){const t=[];for(let n=0;n<u.length;n++){if(null===u[n])continue;const s=u[n].split(" ");t.push(s.pop())}return t}class jo{constructor(t,n,s,l,d,g){const _=t.gl;this.program=_.createProgram();const v=ji(n.staticAttributes),S=s?s.getBinderAttributes():[],I=v.concat(S),E=Gi.prelude.staticUniforms?ji(Gi.prelude.staticUniforms):[],D=n.staticUniforms?ji(n.staticUniforms):[],V=s?s.getBinderUniforms():[],U=E.concat(D).concat(V),$=[];for(const xe of U)$.indexOf(xe)<0&&$.push(xe);const B=s?s.defines():[];d&&B.push("#define OVERDRAW_INSPECTOR;"),g&&B.push("#define TERRAIN3D;");const oe=B.concat(Gi.prelude.fragmentSource,n.fragmentSource).join("\n"),fe=B.concat(Gi.prelude.vertexSource,n.vertexSource).join("\n"),K=_.createShader(_.FRAGMENT_SHADER);if(_.isContextLost())return void(this.failedToCreate=!0);if(_.shaderSource(K,oe),_.compileShader(K),!_.getShaderParameter(K,_.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${_.getShaderInfoLog(K)}`);_.attachShader(this.program,K);const ae=_.createShader(_.VERTEX_SHADER);if(_.isContextLost())return void(this.failedToCreate=!0);if(_.shaderSource(ae,fe),_.compileShader(ae),!_.getShaderParameter(ae,_.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${_.getShaderInfoLog(ae)}`);_.attachShader(this.program,ae),this.attributes={};const ve={};this.numAttributes=I.length;for(let xe=0;xe<this.numAttributes;xe++)I[xe]&&(_.bindAttribLocation(this.program,xe,I[xe]),this.attributes[I[xe]]=xe);if(_.linkProgram(this.program),!_.getProgramParameter(this.program,_.LINK_STATUS))throw new Error(`Program failed to link: ${_.getProgramInfoLog(this.program)}`);_.deleteShader(ae),_.deleteShader(K);for(let xe=0;xe<$.length;xe++){const Re=$[xe];if(Re&&!ve[Re]){const Xe=_.getUniformLocation(this.program,Re);Xe&&(ve[Re]=Xe)}}var xe,Re;this.fixedUniforms=l(t,ve),this.terrainUniforms={u_depth:new c.aL(xe=t,(Re=ve).u_depth),u_terrain:new c.aL(xe,Re.u_terrain),u_terrain_dim:new c.aM(xe,Re.u_terrain_dim),u_terrain_matrix:new c.aN(xe,Re.u_terrain_matrix),u_terrain_unpack:new c.aO(xe,Re.u_terrain_unpack),u_terrain_exaggeration:new c.aM(xe,Re.u_terrain_exaggeration)},this.binderUniforms=s?s.getUniforms(t,ve):[]}draw(t,n,s,l,d,g,_,v,S,I,E,D,V,U,$,B,oe,fe){const K=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(s),t.setStencilMode(l),t.setColorMode(d),t.setCullFace(g),v){t.activeTexture.set(K.TEXTURE2),K.bindTexture(K.TEXTURE_2D,v.depthTexture),t.activeTexture.set(K.TEXTURE3),K.bindTexture(K.TEXTURE_2D,v.texture);for(const ve in this.terrainUniforms)this.terrainUniforms[ve].set(v[ve])}for(const ve in this.fixedUniforms)this.fixedUniforms[ve].set(_[ve]);$&&$.setUniforms(t,this.binderUniforms,V,{zoom:U});let ae=0;switch(n){case K.LINES:ae=2;break;case K.TRIANGLES:ae=3;break;case K.LINE_STRIP:ae=1}for(const ve of D.get()){const xe=ve.vaos||(ve.vaos={});(xe[S]||(xe[S]=new Wn)).bind(t,this,I,$?$.getPaintVertexBuffers():[],E,ve.vertexOffset,B,oe,fe),K.drawElements(n,ve.primitiveLength*ae,K.UNSIGNED_SHORT,ve.primitiveOffset*ae*2)}}}function gn(u,t,n){const s=1/ee(n,1,t.transform.tileZoom),l=Math.pow(2,n.tileID.overscaledZ),d=n.tileSize*Math.pow(2,t.transform.tileZoom)/l,g=d*(n.tileID.canonical.x+n.tileID.wrap*l),_=d*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[s,u.fromScale,u.toScale],u_fade:u.t,u_pixel_coord_upper:[g>>16,_>>16],u_pixel_coord_lower:[65535&g,65535&_]}}const Zs=(u,t,n,s)=>{const l=t.style.light,d=l.properties.get("position"),g=[d.x,d.y,d.z],_=(S=new c.A(9),c.A!=Float32Array&&(S[1]=0,S[2]=0,S[3]=0,S[5]=0,S[6]=0,S[7]=0),S[0]=1,S[4]=1,S[8]=1,S);var S;"viewport"===l.properties.get("anchor")&&function(S,I){var E=Math.sin(I),D=Math.cos(I);S[0]=D,S[1]=E,S[2]=0,S[3]=-E,S[4]=D,S[5]=0,S[6]=0,S[7]=0,S[8]=1}(_,-t.transform.angle),function(S,I,E){var D=I[0],V=I[1],U=I[2];S[0]=D*E[0]+V*E[3]+U*E[6],S[1]=D*E[1]+V*E[4]+U*E[7],S[2]=D*E[2]+V*E[5]+U*E[8]}(g,g,_);const v=l.properties.get("color");return{u_matrix:u,u_lightpos:g,u_lightintensity:l.properties.get("intensity"),u_lightcolor:[v.r,v.g,v.b],u_vertical_gradient:+n,u_opacity:s}},io=(u,t,n,s,l,d,g)=>c.e(Zs(u,t,n,s),gn(d,t,g),{u_height_factor:-Math.pow(2,l.overscaledZ)/g.tileSize/8}),$o=u=>({u_matrix:u}),m=(u,t,n,s)=>c.e($o(u),gn(n,t,s)),C=(u,t)=>({u_matrix:u,u_world:t}),L=(u,t,n,s,l)=>c.e(m(u,t,n,s),{u_world:l}),Z=(u,t,n,s)=>{const l=u.transform;let d,g;if("map"===s.paint.get("circle-pitch-alignment")){const _=ee(n,1,l.zoom);d=!0,g=[_,_]}else d=!1,g=l.pixelsToGLUnits;return{u_camera_to_center_distance:l.cameraToCenterDistance,u_scale_with_map:+("map"===s.paint.get("circle-pitch-scale")),u_matrix:u.translatePosMatrix(t.posMatrix,n,s.paint.get("circle-translate"),s.paint.get("circle-translate-anchor")),u_pitch_with_map:+d,u_device_pixel_ratio:u.pixelRatio,u_extrude_scale:g}},ie=(u,t,n)=>{const s=ee(n,1,t.zoom),l=Math.pow(2,t.zoom-n.tileID.overscaledZ),d=n.tileID.overscaleFactor();return{u_matrix:u,u_camera_to_center_distance:t.cameraToCenterDistance,u_pixels_to_tile_units:s,u_extrude_scale:[t.pixelsToGLUnits[0]/(s*l),t.pixelsToGLUnits[1]/(s*l)],u_overscale_factor:d}},re=(u,t,n=1)=>({u_matrix:u,u_color:t,u_overlay:0,u_overlay_scale:n}),de=u=>({u_matrix:u}),qe=(u,t,n,s)=>({u_matrix:u,u_extrude_scale:ee(t,1,n),u_intensity:s});function it(u,t){const n=Math.pow(2,t.canonical.z),s=t.canonical.y;return[new c.U(0,s/n).toLngLat().lat,new c.U(0,(s+1)/n).toLngLat().lat]}const gt=(u,t,n,s)=>{const l=u.transform;return{u_matrix:ii(u,t,n,s),u_ratio:1/ee(t,1,l.zoom),u_device_pixel_ratio:u.pixelRatio,u_units_to_pixels:[1/l.pixelsToGLUnits[0],1/l.pixelsToGLUnits[1]]}},_t=(u,t,n,s,l)=>c.e(gt(u,t,n,l),{u_image:0,u_image_height:s}),lt=(u,t,n,s,l)=>{const d=u.transform,g=$i(t,d);return{u_matrix:ii(u,t,n,l),u_texsize:t.imageAtlasTexture.size,u_ratio:1/ee(t,1,d.zoom),u_device_pixel_ratio:u.pixelRatio,u_image:0,u_scale:[g,s.fromScale,s.toScale],u_fade:s.t,u_units_to_pixels:[1/d.pixelsToGLUnits[0],1/d.pixelsToGLUnits[1]]}},Yt=(u,t,n,s,l,d)=>{const g=u.lineAtlas,_=$i(t,u.transform),v="round"===n.layout.get("line-cap"),S=g.getDash(s.from,v),I=g.getDash(s.to,v),E=S.width*l.fromScale,D=I.width*l.toScale;return c.e(gt(u,t,n,d),{u_patternscale_a:[_/E,-S.height/2],u_patternscale_b:[_/D,-I.height/2],u_sdfgamma:g.width/(256*Math.min(E,D)*u.pixelRatio)/2,u_image:0,u_tex_y_a:S.y,u_tex_y_b:I.y,u_mix:l.t})};function $i(u,t){return 1/ee(u,1,t.tileZoom)}function ii(u,t,n,s){return u.translatePosMatrix(s?s.posMatrix:t.tileID.posMatrix,t,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}const rr=(u,t,n,s,l)=>{return{u_matrix:u,u_tl_parent:t,u_scale_parent:n,u_buffer_scale:1,u_fade_t:s.mix,u_opacity:s.opacity*l.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:l.paint.get("raster-brightness-min"),u_brightness_high:l.paint.get("raster-brightness-max"),u_saturation_factor:(g=l.paint.get("raster-saturation"),g>0?1-1/(1.001-g):-g),u_contrast_factor:(d=l.paint.get("raster-contrast"),d>0?1/(1-d):1+d),u_spin_weights:Ne(l.paint.get("raster-hue-rotate"))};var d,g};function Ne(u){u*=Math.PI/180;const t=Math.sin(u),n=Math.cos(u);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}const At=(u,t,n,s,l,d,g,_,v,S)=>{const I=l.transform;return{u_is_size_zoom_constant:+("constant"===u||"source"===u),u_is_size_feature_constant:+("constant"===u||"camera"===u),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:I.cameraToCenterDistance,u_pitch:I.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:I.width/I.height,u_fade_change:l.options.fadeDuration?l.symbolFadeChange:1,u_matrix:d,u_label_plane_matrix:g,u_coord_matrix:_,u_is_text:+v,u_pitch_with_map:+s,u_texsize:S,u_texture:0}},Ii=(u,t,n,s,l,d,g,_,v,S,I)=>{const E=l.transform;return c.e(At(u,t,n,s,l,d,g,_,v,S),{u_gamma_scale:s?Math.cos(E._pitch)*E.cameraToCenterDistance:1,u_device_pixel_ratio:l.pixelRatio,u_is_halo:+I})},Zi=(u,t,n,s,l,d,g,_,v,S)=>c.e(Ii(u,t,n,s,l,d,g,_,!0,v,!0),{u_texsize_icon:S,u_texture_icon:1}),Hi=(u,t,n)=>({u_matrix:u,u_opacity:t,u_color:n}),Jr=(u,t,n,s,l,d)=>c.e(function(g,_,v,S){const I=v.imageManager.getPattern(g.from.toString()),E=v.imageManager.getPattern(g.to.toString()),{width:D,height:V}=v.imageManager.getPixelSize(),U=Math.pow(2,S.tileID.overscaledZ
vendor: 4,343 bytes, line 1
1),$=S.tileSize*Math.pow(2,v.transform.tileZoom)/U,B=$*(S.tileID.canonical.x+S.tileID.wrap*U),oe=$*S.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:I.tl,u_pattern_br_a:I.br,u_pattern_tl_b:E.tl,u_pattern_br_b:E.br,u_texsize:[D,V],u_mix:_.t,u_pattern_size_a:I.displaySize,u_pattern_size_b:E.displaySize,u_scale_a:_.fromScale,u_scale_b:_.toScale,u_tile_units_to_pixels:1/ee(S,1,v.transform.tileZoom),u_pixel_coord_upper:[B>>16,oe>>16],u_pixel_coord_lower:[65535&B,65535&oe]}}(s,d,n,l),{u_matrix:u,u_opacity:t}),ms={fillExtrusion:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_lightpos:new c.aP(u,t.u_lightpos),u_lightintensity:new c.aM(u,t.u_lightintensity),u_lightcolor:new c.aP(u,t.u_lightcolor),u_vertical_gradient:new c.aM(u,t.u_vertical_gradient),u_opacity:new c.aM(u,t.u_opacity)}),fillExtrusionPattern:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_lightpos:new c.aP(u,t.u_lightpos),u_lightintensity:new c.aM(u,t.u_lightintensity),u_lightcolor:new c.aP(u,t.u_lightcolor),u_vertical_gradient:new c.aM(u,t.u_vertical_gradient),u_height_factor:new c.aM(u,t.u_height_factor),u_image:new c.aL(u,t.u_image),u_texsize:new c.aQ(u,t.u_texsize),u_pixel_coord_upper:new c.aQ(u,t.u_pixel_coord_upper),u_pixel_coord_lower:new c.aQ(u,t.u_pixel_coord_lower),u_scale:new c.aP(u,t.u_scale),u_fade:new c.aM(u,t.u_fade),u_opacity:new c.aM(u,t.u_opacity)}),fill:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix)}),fillPattern:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_image:new c.aL(u,t.u_image),u_texsize:new c.aQ(u,t.u_texsize),u_pixel_coord_upper:new c.aQ(u,t.u_pixel_coord_upper),u_pixel_coord_lower:new c.aQ(u,t.u_pixel_coord_lower),u_scale:new c.aP(u,t.u_scale),u_fade:new c.aM(u,t.u_fade)}),fillOutline:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_world:new c.aQ(u,t.u_world)}),fillOutlinePattern:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_world:new c.aQ(u,t.u_world),u_image:new c.aL(u,t.u_image),u_texsize:new c.aQ(u,t.u_texsize),u_pixel_coord_upper:new c.aQ(u,t.u_pixel_coord_upper),u_pixel_coord_lower:new c.aQ(u,t.u_pixel_coord_lower),u_scale:new c.aP(u,t.u_scale),u_fade:new c.aM(u,t.u_fade)}),circle:(u,t)=>({u_camera_to_center_distance:new c.aM(u,t.u_camera_to_center_distance),u_scale_with_map:new c.aL(u,t.u_scale_with_map),u_pitch_with_map:new c.aL(u,t.u_pitch_with_map),u_extrude_scale:new c.aQ(u,t.u_extrude_scale),u_device_pixel_ratio:new c.aM(u,t.u_device_pixel_ratio),u_matrix:new c.aN(u,t.u_matrix)}),collisionBox:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_camera_to_center_distance:new c.aM(u,t.u_camera_to_center_distance),u_pixels_to_tile_units:new c.aM(u,t.u_pixels_to_tile_units),u_extrude_scale:new c.aQ(u,t.u_extrude_scale),u_overscale_factor:new c.aM(u,t.u_overscale_factor)}),collisionCircle:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_inv_matrix:new c.aN(u,t.u_inv_matrix),u_camera_to_center_distance:new c.aM(u,t.u_camera_to_center_distance),u_viewport_size:new c.aQ(u,t.u_viewport_size)}),debug:(u,t)=>({u_color:new c.aR(u,t.u_color),u_matrix:new c.aN(u,t.u_matrix),u_overlay:new c.aL(u,t.u_overlay),u_overlay_scale:new c.aM(u,t.u_overlay_scale)}),clippingMask:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix)}),heatmap:(u,t)=>({u_extrude_scale:new c.aM(u,t.u_extrude_scale),u_intensity:new c.aM(u,t.u_intensity),u_matrix:new c.aN(u,t.u_matrix)}),heatmapTexture:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_world:new c.aQ(u,t.u_world),u_image:new c.aL(u,t.u_image),u_color_ramp:new c.aL(u,t.u_color_ramp),u_opacity:new c.aM(u,t.u_opacity)}),hillshade:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_image:new c.aL(u,t.u_image),u_latrange:new c.aQ(u,t.u_latrange),u_light:new c.aQ(u,t.u_light),u_shadow:new c.aR(u,t.u_shadow),u_highlight:new c.aR(u,t.u_highlight),u_accent:new c.aR(u,t.u_accent)}),hillshadePrepare:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_image:new c.aL(u,t.u_image),u_dimension:new c.aQ(u,t.u_dimension),u_zoom:new c.aM(u,t.u_zoom),u_unpack:new c.aO(u,t.u_unpack)}),line:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_ratio:new c.aM(u,t.u_ratio),u_device_pixel_ratio:new c.aM(u,t.u_device_pixel_ratio),u_units_to_pixels:new c.aQ(u,t.u_units_to_pixels)}),lineGradient:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_ratio:new c.aM(u,t.u_ratio),u_device_pixel_ratio:new c.aM(u,t.u_device_pixel_ratio),u_units_to_pixels:new c.aQ(u,t.u_units_to_pixels),u_image:new c.aL(u,t.u_image),u_image_height:new c.aM(u,t.u_image_height)}),linePattern:(u,t)=>
vendor: 6,465 bytes, line 1
1({u_matrix:new c.aN(u,t.u_matrix),u_texsize:new c.aQ(u,t.u_texsize),u_ratio:new c.aM(u,t.u_ratio),u_device_pixel_ratio:new c.aM(u,t.u_device_pixel_ratio),u_image:new c.aL(u,t.u_image),u_units_to_pixels:new c.aQ(u,t.u_units_to_pixels),u_scale:new c.aP(u,t.u_scale),u_fade:new c.aM(u,t.u_fade)}),lineSDF:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_ratio:new c.aM(u,t.u_ratio),u_device_pixel_ratio:new c.aM(u,t.u_device_pixel_ratio),u_units_to_pixels:new c.aQ(u,t.u_units_to_pixels),u_patternscale_a:new c.aQ(u,t.u_patternscale_a),u_patternscale_b:new c.aQ(u,t.u_patternscale_b),u_sdfgamma:new c.aM(u,t.u_sdfgamma),u_image:new c.aL(u,t.u_image),u_tex_y_a:new c.aM(u,t.u_tex_y_a),u_tex_y_b:new c.aM(u,t.u_tex_y_b),u_mix:new c.aM(u,t.u_mix)}),raster:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_tl_parent:new c.aQ(u,t.u_tl_parent),u_scale_parent:new c.aM(u,t.u_scale_parent),u_buffer_scale:new c.aM(u,t.u_buffer_scale),u_fade_t:new c.aM(u,t.u_fade_t),u_opacity:new c.aM(u,t.u_opacity),u_image0:new c.aL(u,t.u_image0),u_image1:new c.aL(u,t.u_image1),u_brightness_low:new c.aM(u,t.u_brightness_low),u_brightness_high:new c.aM(u,t.u_brightness_high),u_saturation_factor:new c.aM(u,t.u_saturation_factor),u_contrast_factor:new c.aM(u,t.u_contrast_factor),u_spin_weights:new c.aP(u,t.u_spin_weights)}),symbolIcon:(u,t)=>({u_is_size_zoom_constant:new c.aL(u,t.u_is_size_zoom_constant),u_is_size_feature_constant:new c.aL(u,t.u_is_size_feature_constant),u_size_t:new c.aM(u,t.u_size_t),u_size:new c.aM(u,t.u_size),u_camera_to_center_distance:new c.aM(u,t.u_camera_to_center_distance),u_pitch:new c.aM(u,t.u_pitch),u_rotate_symbol:new c.aL(u,t.u_rotate_symbol),u_aspect_ratio:new c.aM(u,t.u_aspect_ratio),u_fade_change:new c.aM(u,t.u_fade_change),u_matrix:new c.aN(u,t.u_matrix),u_label_plane_matrix:new c.aN(u,t.u_label_plane_matrix),u_coord_matrix:new c.aN(u,t.u_coord_matrix),u_is_text:new c.aL(u,t.u_is_text),u_pitch_with_map:new c.aL(u,t.u_pitch_with_map),u_texsize:new c.aQ(u,t.u_texsize),u_texture:new c.aL(u,t.u_texture)}),symbolSDF:(u,t)=>({u_is_size_zoom_constant:new c.aL(u,t.u_is_size_zoom_constant),u_is_size_feature_constant:new c.aL(u,t.u_is_size_feature_constant),u_size_t:new c.aM(u,t.u_size_t),u_size:new c.aM(u,t.u_size),u_camera_to_center_distance:new c.aM(u,t.u_camera_to_center_distance),u_pitch:new c.aM(u,t.u_pitch),u_rotate_symbol:new c.aL(u,t.u_rotate_symbol),u_aspect_ratio:new c.aM(u,t.u_aspect_ratio),u_fade_change:new c.aM(u,t.u_fade_change),u_matrix:new c.aN(u,t.u_matrix),u_label_plane_matrix:new c.aN(u,t.u_label_plane_matrix),u_coord_matrix:new c.aN(u,t.u_coord_matrix),u_is_text:new c.aL(u,t.u_is_text),u_pitch_with_map:new c.aL(u,t.u_pitch_with_map),u_texsize:new c.aQ(u,t.u_texsize),u_texture:new c.aL(u,t.u_texture),u_gamma_scale:new c.aM(u,t.u_gamma_scale),u_device_pixel_ratio:new c.aM(u,t.u_device_pixel_ratio),u_is_halo:new c.aL(u,t.u_is_halo)}),symbolTextAndIcon:(u,t)=>({u_is_size_zoom_constant:new c.aL(u,t.u_is_size_zoom_constant),u_is_size_feature_constant:new c.aL(u,t.u_is_size_feature_constant),u_size_t:new c.aM(u,t.u_size_t),u_size:new c.aM(u,t.u_size),u_camera_to_center_distance:new c.aM(u,t.u_camera_to_center_distance),u_pitch:new c.aM(u,t.u_pitch),u_rotate_symbol:new c.aL(u,t.u_rotate_symbol),u_aspect_ratio:new c.aM(u,t.u_aspect_ratio),u_fade_change:new c.aM(u,t.u_fade_change),u_matrix:new c.aN(u,t.u_matrix),u_label_plane_matrix:new c.aN(u,t.u_label_plane_matrix),u_coord_matrix:new c.aN(u,t.u_coord_matrix),u_is_text:new c.aL(u,t.u_is_text),u_pitch_with_map:new c.aL(u,t.u_pitch_with_map),u_texsize:new c.aQ(u,t.u_texsize),u_texsize_icon:new c.aQ(u,t.u_texsize_icon),u_texture:new c.aL(u,t.u_texture),u_texture_icon:new c.aL(u,t.u_texture_icon),u_gamma_scale:new c.aM(u,t.u_gamma_scale),u_device_pixel_ratio:new c.aM(u,t.u_device_pixel_ratio),u_is_halo:new c.aL(u,t.u_is_halo)}),background:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_opacity:new c.aM(u,t.u_opacity),u_color:new c.aR(u,t.u_color)}),backgroundPattern:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_opacity:new c.aM(u,t.u_opacity),u_image:new c.aL(u,t.u_image),u_pattern_tl_a:new c.aQ(u,t.u_pattern_tl_a),u_pattern_br_a:new c.aQ(u,t.u_pattern_br_a),u_pattern_tl_b:new c.aQ(u,t.u_pattern_tl_b),u_pattern_br_b:new c.aQ(u,t.u_pattern_br_b),u_texsize:new c.aQ(u,t.u_texsize),u_mix:new c.aM(u,t.u_mix),u_pattern_size_a:new c.aQ(u,t.u_pattern_size_a),u_pattern_size_b:new c.aQ(u,t.u_pattern_size_b),u_scale_a:new c.aM(u,t.u_scale_a),u_scale_b:new c.aM(u,t.u_scale_b),u_pixel_coord_upper:new c.aQ(u,t.u_pixel_coord_upper),u_pixel_coord_lower:new c.aQ(u,t.u_pixel_coord_lower),u_tile_units_to_pixels:new c.aM(u,t.u_tile_units_to_pixels)}),terrain:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_texture:new c.aL(u,t.u_texture),u_ele_delta:new c.aM(u,t.u_ele_delta)}),terrainDepth:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_ele_delta:new c.aM(u,t.u_ele_delta)}),terrainCoords:(u,t)=>({u_matrix:new c.aN(u,t.u_matrix),u_texture:new c.aL(u,t.u_texture),u_terrain_coords_id:new c.aM(u,t.u_terrain_coords_id),u_ele_delta:new c.aM(u,t.u_ele_delta)})};class Di{constructor(t,n,s){this.context=t;const l=t.gl;this.buffer=l.createBuffer(),this.dynamicDraw=!!s,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),l.bufferData(l.ELEMENT_ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?l.DYNAMIC_DRAW:l.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){const n=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),n.bufferSubData(n.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Ao={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class fs{constructor(t,n,s,l){this.length=n.length,this.attributes=s,this.itemSize=n.bytesPerElement,this.dynamicDraw=l,this.context=t;const d=t.gl;this.buffer=d.createBuffer(),t.bindVertexBuffer.set(this.buffer),d.bufferData(d.ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?d.DYNAMIC_DRAW:d.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw new Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);const n=this.context.gl;this.bind(),n.bufferSubData(n.ARRAY_BUFFER,0,t.arrayBuffer)}
vendor: 14,185 bytes, line 1
1enableAttributes(t,n){for(let s=0;s<this.attributes.length;s++){const l=n.attributes[this.attributes[s].name];void 0!==l&&t.enableVertexAttribArray(l)}}setVertexAttribPointers(t,n,s){for(let l=0;l<this.attributes.length;l++){const d=this.attributes[l],g=n.attributes[d.name];void 0!==g&&t.vertexAttribPointer(g,d.components,t[Ao[d.type]],!1,this.itemSize,d.offset+this.itemSize*(s||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Hr=new WeakMap;function qn(u){var t;if(Hr.has(u))return Hr.get(u);{const n=null===(t=u.getParameter(u.VERSION))||void 0===t?void 0:t.startsWith("WebGL 2.0");return Hr.set(u,n),n}}class di{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 Zo extends di{getDefault(){return c.aT.transparent}set(t){const n=this.current;(t.r!==n.r||t.g!==n.g||t.b!==n.b||t.a!==n.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class $r extends di{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}}class Yr extends di{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}}class gs extends di{getDefault(){return[!0,!0,!0,!0]}set(t){const n=this.current;(t[0]!==n[0]||t[1]!==n[1]||t[2]!==n[2]||t[3]!==n[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class _s extends di{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}}class ys extends di{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}}class Ws extends di{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){const n=this.current;(t.func!==n.func||t.ref!==n.ref||t.mask!==n.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)}}class vs extends di{getDefault(){const t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){const n=this.current;(t[0]!==n[0]||t[1]!==n[1]||t[2]!==n[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)}}class Wo extends di{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const n=this.gl;t?n.enable(n.STENCIL_TEST):n.disable(n.STENCIL_TEST),this.current=t,this.dirty=!1}}class xs extends di{getDefault(){return[0,1]}set(t){const n=this.current;(t[0]!==n[0]||t[1]!==n[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)}}class qs extends di{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const n=this.gl;t?n.enable(n.DEPTH_TEST):n.disable(n.DEPTH_TEST),this.current=t,this.dirty=!1}}class bs extends di{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}}class qo extends di{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const n=this.gl;t?n.enable(n.BLEND):n.disable(n.BLEND),this.current=t,this.dirty=!1}}class ws extends di{getDefault(){const t=this.gl;return[t.ONE,t.ZERO]}set(t){const n=this.current;(t[0]!==n[0]||t[1]!==n[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)}}class vo extends di{getDefault(){return c.aT.transparent}set(t){const n=this.current;(t.r!==n.r||t.g!==n.g||t.b!==n.b||t.a!==n.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class Fn extends di{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)}}class la extends di{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const n=this.gl;t?n.enable(n.CULL_FACE):n.disable(n.CULL_FACE),this.current=t,this.dirty=!1}}class ca extends di{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}}class Ta extends di{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}}class ua extends di{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)}}class Cs extends di{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}}class Ss extends di{getDefault(){const t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){const n=this.current;(t[0]!==n[0]||t[1]!==n[1]||t[2]!==n[2]||t[3]!==n[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class Ko extends di{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const n=this.gl;n.bindFramebuffer(n.FRAMEBUFFER,t),this.current=t,this.dirty=!1}}class Ks extends di{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const n=this.gl;n.bindRenderbuffer(n.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Kn extends di{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const n=this.gl;n.bindTexture(n.TEXTURE_2D,t),this.current=t,this.dirty=!1}}class xo extends di{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const n=this.gl;n.bindBuffer(n.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class ha extends di{getDefault(){return null}set(t){const n=this.gl;n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class da extends di{getDefault(){return null}set(t){var n;if(t===this.current&&!this.dirty)return;const s=this.gl;qn(s)?s.bindVertexArray(t):null===(n=s.getExtension("OES_vertex_array_object"))||void 0===n||n.bindVertexArrayOES(t),this.current=t,this.dirty=!1}}class Xo extends di{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;const n=this.gl;n.pixelStorei(n.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}}class In extends di{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const n=this.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}}class Ms extends di{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const n=this.gl;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}}class Bn extends di{constructor(t,n){super(t),this.context=t,this.parent=n}getDefault(){return null}}class ro extends Bn{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const n=this.gl;n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class ko extends Bn{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const n=this.gl;n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Xs extends Bn{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const n=this.gl;n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Si{constructor(t,n,s,l,d){this.context=t,this.width=n,this.height=s;const g=t.gl,_=this.framebuffer=g.createFramebuffer();if(this.colorAttachment=new ro(t,_),l)this.depthAttachment=d?new Xs(t,_):new ko(t,_);else if(d)throw new Error("Stencil cannot be setted without depth");if(g.checkFramebufferStatus(g.FRAMEBUFFER)!==g.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer is not complete")}destroy(){const t=this.context.gl,n=this.colorAttachment.get();if(n&&t.deleteTexture(n),this.depthAttachment){const s=this.depthAttachment.get();s&&t.deleteRenderbuffer(s)}t.deleteFramebuffer(this.framebuffer)}}class Wi{constructor(t,n,s){this.blendFunction=t,this.blendColor=n,this.mask=s}}Wi.Replace=[1,0],Wi.disabled=new Wi(Wi.Replace,c.aT.transparent,[!1,!1,!1,!1]),Wi.unblended=new Wi(Wi.Replace,c.aT.transparent,[!0,!0,!0,!0]),Wi.alphaBlended=new Wi([1,771],c.aT.transparent,[!0,!0,!0,!0]);class Pa{constructor(t){var n,s;if(this.gl=t,this.clearColor=new Zo(this),this.clearDepth=new $r(this),this.clearStencil=new Yr(this),this.colorMask=new gs(this),this.depthMask=new _s(this),this.stencilMask=new ys(this),this.stencilFunc=new Ws(this),this.stencilOp=new vs(this),this.stencilTest=new Wo(this),this.depthRange=new xs(this),this.depthTest=new qs(this),this.depthFunc=new bs(this),this.blend=new qo(this),this.blendFunc=new ws(this),this.blendColor=new vo(this),this.blendEquation=new Fn(this),this.cullFace=new la(this),this.cullFaceSide=new ca(this),this.frontFace=new Ta(this),this.program=new ua(this),this.activeTexture=new Cs(this),this.viewport=new Ss(this),this.bindFramebuffer=new Ko(this),this.bindRenderbuffer=new Ks(this),this.bindTexture=new Kn(this),this.bindVertexBuffer=new xo(this),this.bindElementBuffer=new ha(this),this.bindVertexArray=new da(this),this.pixelStoreUnpack=new Xo(this),this.pixelStoreUnpackPremultiplyAlpha=new In(this),this.pixelStoreUnpackFlipY=new Ms(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.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),qn(t)){this.HALF_FLOAT=t.HALF_FLOAT;const l=t.getExtension("EXT_color_buffer_half_float");this.RGBA16F=null!==(n=t.RGBA16F)&&void 0!==n?n:l?.RGBA16F_EXT,this.RGB16F=null!==(s=t.RGB16F)&&void 0!==s?s:l?.RGB16F_EXT,t.getExtension("EXT_color_buffer_float")}else{t.getExtension("EXT_color_buffer_half_float"),t.getExtension("OES_texture_half_float_linear");const l=t.getExtension("OES_texture_half_float");this.HALF_FLOAT=l?.HALF_FLOAT_OES}}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.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(t,n){return new Di(this,t,n)}createVertexBuffer(t,n,s){return new fs(this,t,n,s)}createRenderbuffer(t,n,s){const l=this.gl,d=l.createRenderbuffer();return this.bindRenderbuffer.set(d),l.renderbufferStorage(l.RENDERBUFFER,t,n,s),this.bindRenderbuffer.set(null),d}createFramebuffer(t,n,s,l){return new Si(this,t,n,s,l)}clear({color:t,depth:n,stencil:s}){const l=this.gl;let d=0;t&&(d|=l.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),void 0!==n&&(d|=l.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(n),this.depthMask.set(!0)),void 0!==s&&(d|=l.STENCIL_BUFFER_BIT,this.clearStencil.set(s),this.stencilMask.set(255)),l.clear(d)}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(t){c.aG(t.blendFunction,Wi.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor)),this.colorMask.set(t.mask)}createVertexArray(){var t;return qn(this.gl)?this.gl.createVertexArray():null===(t=this.gl.getExtension("OES_vertex_array_object"))||void 0===t?void 0:t.createVertexArrayOES()}deleteVertexArray(t){var n;return qn(this.gl)?this.gl.deleteVertexArray(t):null===(n=this.gl.getExtension("OES_vertex_array_object"))||void 0===n?void 0:n.deleteVertexArrayOES(t)}unbindVAO(){this.bindVertexArray.set(null)}}class fi{constructor(t,n,s){this.func=t,this.mask=n,this.range=s}}fi.ReadOnly=!1,fi.ReadWrite=!0,fi.disabled=new fi(519,fi.ReadOnly,[0,1]);class Ni{constructor(t,n,s,l,d,g){this.test=t,this.ref=n,this.mask=s,this.fail=l,this.depthFail=d,this.pass=g}}Ni.disabled=new Ni({func:519,mask:0},0,0,7680,7680,7680);class Ei{constructor(t,n,s){this.enable=t,this.mode=n,this.frontFace=s}}let an;function oo(u,t,n,s,l,d,g){const _=u.context,v=_.gl,S=u.useProgram("collisionBox"),I=[];let E=0,D=0;for(let K=0;K<s.length;K++){const ae=s[K],ve=t.getTile(ae),xe=ve.getBucket(n);if(!xe)continue;let Re=ae.posMatrix;0===l[0]&&0===l[1]||(Re=u.translatePosMatrix(ae.posMatrix,ve,l,d));const Xe=g?xe.textCollisionBox:xe.iconCollisionBox,Ge=xe.collisionCircleArray;
1if(Ge.length>0){const rt=c.Z(),Et=Re;c.aU(rt,xe.placementInvProjMatrix,u.transform.glCoordMatrix),c.aU(rt,rt,xe.placementViewportMatrix),I.push({circleArray:Ge,circleOffset:D,transform:Et,invTransform:rt,coord:ae}),E+=Ge.length/4,D=E}Xe&&S.draw(_,v.LINES,fi.disabled,Ni.disabled,u.colorModeForRenderPass(),Ei.disabled,ie(Re,u.transform,ve),u.style.map.terrain&&u.style.map.terrain.getTerrainData(ae),n.id,Xe.layoutVertexBuffer,Xe.indexBuffer,Xe.segments,null,u.transform.zoom,null,null,Xe.collisionVertexBuffer)}if(!g||!I.length)return;const V=u.useProgram("collisionCircle"),U=new c.aV;U.resize(4*E),U._trim();let $=0;for(const K of I)for(let ae=0;ae<K.circleArray.length/4;ae++){const ve=4*ae,xe=K.circleArray[ve+0],Re=K.circleArray[ve+1],Xe=K.circleArray[ve+2],Ge=K.circleArray[ve+3];U.emplace($++,xe,Re,Xe,Ge,0),U.emplace($++,xe,Re,Xe,Ge,1),U.emplace($++,xe,Re,Xe,Ge,2),U.emplace($++,xe,Re,Xe,Ge,3)}(!an||an.length<2*E)&&(an=function(K){const ae=2*K,ve=new c.aX;ve.resize(ae),ve._trim();for(let xe=0;xe<ae;xe++){const Re=6*xe;ve.uint16[Re+0]=4*xe+0,ve.uint16[Re+1]=4*xe+1,ve.uint16[Re+2]=4*xe+2,ve.uint16[Re+3]=4*xe+2,ve.uint16[Re+4]=4*xe+3,ve.uint16[Re+5]=4*xe+0}return ve}(E));const B=_.createIndexBuffer(an,!0),oe=_.createVertexBuffer(U,c.aW.members,!0);for(const K of I){const ae={u_matrix:K.transform,u_inv_matrix:K.invTransform,u_camera_to_center_distance:(fe=u.transform).cameraToCenterDistance,u_viewport_size:[fe.width,fe.height]};V.draw(_,v.TRIANGLES,fi.disabled,Ni.disabled,u.colorModeForRenderPass(),Ei.disabled,ae,u.style.map.terrain&&u.style.map.terrain.getTerrainData(K.coord),n.id,oe,B,c.S.simpleSegment(0,2*K.circleOffset,K.circleArray.length,K.circleArray.length/2),null,u.transform.zoom,null,null,null)}var fe;oe.destroy(),B.destroy()}Ei.disabled=new Ei(!1,1029,2305),Ei.backCCW=new Ei(!0,1029,2305);const Do=c.ao(new Float32Array(16));function En(u,t,n,s,l,d){const{horizontalAlign:g,verticalAlign:_}=c.au(u);return new c.P((-(g-.5)*t/l+s[0])*d,(-(_-.5)*n/l+s[1])*d)}function Is(u,t,n,s,l,d,g,_,v,S,I){const E=u.text.placedSymbolArray,D=u.text.dynamicLayoutVertexArray,V=u.icon.dynamicLayoutVertexArray,U={};D.clear();for(let $=0;$<E.length;$++){const B=E.get($),oe=B.hidden||!B.crossTileID||u.allowVerticalPlacement&&!B.placedOrientation?null:s[B.crossTileID];if(oe){const fe=new c.P(B.anchorX,B.anchorY),K=zi(fe,n?g:d,I),ae=Rn(l.cameraToCenterDistance,K.signedDistanceFromCamera);let ve=c.aj(u.textSizeData,v,B)*ae/c.ap;n&&(ve*=u.tilePixelRatio/_);const{width:xe,height:Re,anchor:Xe,textOffset:Ge,textBoxScale:rt}=oe,Et=En(Xe,xe,Re,Ge,rt,ve),gi=n?zi(fe.add(Et),d,I).point:K.point.add(t?Et.rotate(-l.angle):Et),dt=u.allowVerticalPlacement&&B.placedOrientation===c.ai.vertical?Math.PI/2:0;for(let qt=0;qt<B.numGlyphs;qt++)c.ak(D,gi,dt);S&&B.associatedIconIndex>=0&&(U[B.associatedIconIndex]={shiftedAnchor:gi,angle:dt})}else F(B.numGlyphs,D)}if(S){V.clear();const $=u.icon.placedSymbolArray;for(let B=0;B<$.length;B++){const oe=$.get(B);if(oe.hidden)F(oe.numGlyphs,V);else{const fe=U[B];if(fe)for(let K=0;K<oe.numGlyphs;K++)c.ak(V,fe.shiftedAnchor,fe.angle);else F(oe.numGlyphs,V)}}u.icon.dynamicLayoutVertexBuffer.updateData(V)}u.text.dynamicLayoutVertexBuffer.updateData(D)}function Lo(u,t,n){return n.iconsInText&&t?"symbolTextAndIcon":u?"symbolSDF":"symbolIcon"}function so(u,t,n,s,l,d,g,_,v,S,I,E){const D=u.context,V=D.gl,U=u.transform,$="map"===_,B="map"===v,oe="viewport"!==_&&"point"!==n.layout.get("symbol-placement"),fe=$&&!B&&!oe,K=!n.layout.get("symbol-sort-key").isConstant();let ae=!1;const ve=u.depthModeForSublayer(0,fi.ReadOnly),xe=n._unevaluatedLayout.hasValue("text-variable-anchor")||n._unevaluatedLayout.hasValue("text-variable-anchor-offset"),Re=[];for(const Xe of s){const Ge=t.getTile(Xe),rt=Ge.getBucket(n);if(!rt)continue;const Et=l?rt.text:rt.icon;if(!Et||!Et.segments.get().length||!Et.hasVisibleVertices)continue;const gi=Et.programConfigurations.get(n.id),dt=l||rt.sdfIcons,qt=l?rt.textSizeData:rt.iconSizeData,kt=B||0!==U.pitch,Li=u.useProgram(Lo(dt,l,rt),gi),pi=c.ah(qt,U.zoom),ai=u.style.map.terrain&&u.style.map.terrain.getTerrainData(Xe);let _i,cr,Vi,Wr,Ar=[0,0],mr=null;if(l)cr=Ge.glyphAtlasTexture,Vi=V.LINEAR,_i=Ge.glyphAtlasTexture.size,rt.iconsInText&&(Ar=Ge.imageAtlasTexture.size,mr=Ge.imageAtlasTexture,Wr=kt||u.options.rotating||u.options.zooming||"composite"===qt.kind||"camera"===qt.kind?V.LINEAR:V.NEAREST);else{const ur=1!==n.layout.get("icon-size").constantOr(0)||rt.iconsNeedLinear;cr=Ge.imageAtlasTexture,Vi=dt||u.options.rotating||u.options.zooming||ur||kt?V.LINEAR:V.NEAREST,_i=Ge.imageAtlasTexture.size}const kn=ee(Ge,1,u.transform.zoom),Xi=tt(Xe.posMatrix,B,$,u.transform,kn),uo=Er(Xe.posMatrix,B,$,u.transform,kn),ho=xe&&rt.hasTextData(),Uo="none"!==n.layout.get("icon-text-fit")&&ho&&rt.hasIconData();if(oe){const ur=u.style.map.terrain?(vn,hr)=>u.style.map.terrain.getElevation(Xe,vn,hr):null,kr="map"===n.layout.get("text-rotation-alignment");nt(rt,Xe.posMatrix,u,l,Xi,uo,B,S,kr,ur)}const os=u.translatePosMatrix(Xe.posMatrix,Ge,d,g),Bs=oe||l&&xe||Uo?Do:Xi,tn=u.translatePosMatrix(uo,Ge,d,g,!0),qr=
vendor: 16,738 bytes, line 1
1dt&&0!==n.paint.get(l?"text-halo-width":"icon-halo-width").constantOr(1);let un;un=dt?rt.iconsInText?Zi(qt.kind,pi,fe,B,u,os,Bs,tn,_i,Ar):Ii(qt.kind,pi,fe,B,u,os,Bs,tn,l,_i,!0):At(qt.kind,pi,fe,B,u,os,Bs,tn,l,_i);const ss={program:Li,buffers:Et,uniformValues:un,atlasTexture:cr,atlasTextureIcon:mr,atlasInterpolation:Vi,atlasInterpolationIcon:Wr,isSDF:dt,hasHalo:qr};if(K&&rt.canOverlap){ae=!0;const ur=Et.segments.get();for(const kr of ur)Re.push({segments:new c.S([kr]),sortKey:kr.sortKey,state:ss,terrainData:ai})}else Re.push({segments:Et.segments,sortKey:0,state:ss,terrainData:ai})}ae&&Re.sort((Xe,Ge)=>Xe.sortKey-Ge.sortKey);for(const Xe of Re){const Ge=Xe.state;if(D.activeTexture.set(V.TEXTURE0),Ge.atlasTexture.bind(Ge.atlasInterpolation,V.CLAMP_TO_EDGE),Ge.atlasTextureIcon&&(D.activeTexture.set(V.TEXTURE1),Ge.atlasTextureIcon&&Ge.atlasTextureIcon.bind(Ge.atlasInterpolationIcon,V.CLAMP_TO_EDGE)),Ge.isSDF){const rt=Ge.uniformValues;Ge.hasHalo&&(rt.u_is_halo=1,Es(Ge.buffers,Xe.segments,n,u,Ge.program,ve,I,E,rt,Xe.terrainData)),rt.u_is_halo=0}Es(Ge.buffers,Xe.segments,n,u,Ge.program,ve,I,E,Ge.uniformValues,Xe.terrainData)}}function Es(u,t,n,s,l,d,g,_,v,S){const I=s.context;l.draw(I,I.gl.TRIANGLES,d,g,_,Ei.disabled,v,S,n.id,u.layoutVertexBuffer,u.indexBuffer,t,n.paint,s.transform.zoom,u.programConfigurations.get(n.id),u.dynamicLayoutVertexBuffer,u.opacityVertexBuffer)}function Oo(u,t,n,s,l){if(!n||!s||!s.imageAtlas)return;const d=s.imageAtlas.patternPositions;let g=d[n.to.toString()],_=d[n.from.toString()];if(!g&&_&&(g=_),!_&&g&&(_=g),!g||!_){const v=l.getPaintProperty(t);g=d[v],_=d[v]}g&&_&&u.setConstantPatternPositions(g,_)}function Jo(u,t,n,s,l,d,g){const _=u.context.gl,v="fill-pattern",S=n.paint.get(v),I=S&&S.constantOr(1),E=n.getCrossfadeParameters();let D,V,U,$,B;g?(V=I&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",D=_.LINES):(V=I?"fillPattern":"fill",D=_.TRIANGLES);const oe=S.constantOr(null);for(const fe of s){const K=t.getTile(fe);if(I&&!K.patternsLoaded())continue;const ae=K.getBucket(n);if(!ae)continue;const ve=ae.programConfigurations.get(n.id),xe=u.useProgram(V,ve),Re=u.style.map.terrain&&u.style.map.terrain.getTerrainData(fe);I&&(u.context.activeTexture.set(_.TEXTURE0),K.imageAtlasTexture.bind(_.LINEAR,_.CLAMP_TO_EDGE),ve.updatePaintBuffers(E)),Oo(ve,v,oe,K,n);const Xe=Re?fe:null,Ge=u.translatePosMatrix(Xe?Xe.posMatrix:fe.posMatrix,K,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(g){$=ae.indexBuffer2,B=ae.segments2;const rt=[_.drawingBufferWidth,_.drawingBufferHeight];U="fillOutlinePattern"===V&&I?L(Ge,u,E,K,rt):C(Ge,rt)}else $=ae.indexBuffer,B=ae.segments,U=I?m(Ge,u,E,K):$o(Ge);xe.draw(u.context,D,l,u.stencilModeForClipping(fe),d,Ei.disabled,U,Re,n.id,ae.layoutVertexBuffer,$,B,n.paint,u.transform.zoom,ve)}}function Ho(u,t,n,s,l,d,g){const _=u.context,v=_.gl,S="fill-extrusion-pattern",I=n.paint.get(S),E=I.constantOr(1),D=n.getCrossfadeParameters(),V=n.paint.get("fill-extrusion-opacity"),U=I.constantOr(null);for(const $ of s){const B=t.getTile($),oe=B.getBucket(n);if(!oe)continue;const fe=u.style.map.terrain&&u.style.map.terrain.getTerrainData($),K=oe.programConfigurations.get(n.id),ae=u.useProgram(E?"fillExtrusionPattern":"fillExtrusion",K);E&&(u.context.activeTexture.set(v.TEXTURE0),B.imageAtlasTexture.bind(v.LINEAR,v.CLAMP_TO_EDGE),K.updatePaintBuffers(D)),Oo(K,S,U,B,n);const ve=u.translatePosMatrix($.posMatrix,B,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),xe=n.paint.get("fill-extrusion-vertical-gradient"),Re=E?io(ve,u,xe,V,$,D,B):Zs(ve,u,xe,V);ae.draw(_,_.gl.TRIANGLES,l,d,g,Ei.backCCW,Re,fe,n.id,oe.layoutVertexBuffer,oe.indexBuffer,oe.segments,n.paint,u.transform.zoom,K,u.style.map.terrain&&oe.centroidVertexBuffer)}}function pa(u,t,n,s,l,d,g){const _=u.context,v=_.gl,S=n.fbo;if(!S)return;const I=u.useProgram("hillshade"),E=u.style.map.terrain&&u.style.map.terrain.getTerrainData(t);_.activeTexture.set(v.TEXTURE0),v.bindTexture(v.TEXTURE_2D,S.colorAttachment.get()),I.draw(_,v.TRIANGLES,l,d,g,Ei.disabled,((D,V,U,$)=>{const B=U.paint.get("hillshade-shadow-color"),oe=U.paint.get("hillshade-highlight-color"),fe=U.paint.get("hillshade-accent-color");let K=U.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===U.paint.get("hillshade-illumination-anchor")&&(K-=D.transform.angle);const ae=!D.options.moving;return{u_matrix:$?$.posMatrix:D.transform.calculatePosMatrix(V.tileID.toUnwrapped(),ae),u_image:0,u_latrange:it(0,V.tileID),u_light:[U.paint.get("hillshade-exaggeration"),K],u_shadow:B,u_highlight:oe,u_accent:fe}})(u,n,s,E?t:null),E,s.id,u.rasterBoundsBuffer,u.quadTriangleIndexBuffer,u.rasterBoundsSegments)}function Ts(u,t,n,s,l,d){const g=u.context,_=g.gl,v=t.dem;if(v&&v.data){const S=v.dim,I=v.stride,E=v.getPixels();if(g.activeTexture.set(_.TEXTURE1),g.pixelStoreUnpackPremultiplyAlpha.set(!1),t.demTexture=t.demTexture||u.getTileTexture(I),t.demTexture){const V=t.demTexture;V.update(E,{premultiply:!1}),V.bind(_.NEAREST,_.CLAMP_TO_EDGE)}else t.demTexture=new Ve(g,E,_.RGBA,{premultiply:!1}),t.demTexture.bind(_.NEAREST,_.CLAMP_TO_EDGE);g.activeTexture.set(_.TEXTURE0);let D=t.fbo;if(!D){const V=new Ve(g,{width:S,height:S,data:null},_.RGBA);V.bind(_.LINEAR,_.CLAMP_TO_EDGE),D=t.fbo=g.createFramebuffer(S,S,!0,!1),D.colorAttachment.set(V.texture)}g.bindFramebuffer.set(D.framebuffer),g.viewport.set([0,0,S,S]),u.useProgram("hillshadePrepare").draw(g,_.TRIANGLES,s,l,d,Ei.disabled,((V,U)=>{const $=U.stride,B=c.Z();return c.aS(B,0,c.N,-c.N,0,0,1),c.$(B,B,[0,-c.N,0]),{u_matrix:B,u_image:1,u_dimension:[$,$],u_zoom:V.overscaledZ,u_unpack:U.getUnpackVector()}})(t.tileID,v),null,n.id,u.rasterBoundsBuffer,u.quadTriangleIndexBuffer,u.rasterBoundsSegments),t.needsHillshadePrepare=!1}}function Ps(u,t,n,s,l,d){const g=s.paint.get("raster-fade-duration");if(!d&&g>0){const _=c.h.now(),v=(_-u.timeAdded)/g,S=t?(_-t.timeAdded)/g:-1,I=n.getSource(),E=l.coveringZoomLevel({tileSize:I.tileSize,roundZoom:I.roundZoom}),D=!t||Math.abs(t.tileID.overscaledZ-E)>Math.abs(u.tileID.overscaledZ-E),V=D&&u.refreshedUponExpiration?1:c.ad(D?v:1-S,0,1);return u.refreshedUponExpiration&&v>=1&&(u.refreshedUponExpiration=!1),t?{opacity:1,mix:1-V}:{opacity:V,mix:0}}return{opacity:1,mix:0}}const bo=new c.aT(1,0,0,1),As=new c.aT(0,1,0,1),Nn=new c.aT(0,0,1,1),ma=new c.aT(1,0,1,1),ao=new c.aT(0,1,1,1);function zo(u,t,n,s){wo(u,0,t+n/2,u.transform.width,n,s)}function ks(u,t,n,s){wo(u,t-n/2,0,n,u.transform.height,s)}function wo(u,t,n,s,l,d){const g=u.context,_=g.gl;_.enable(_.SCISSOR_TEST),_.scissor(t*u.pixelRatio,n*u.pixelRatio,s*u.pixelRatio,l*u.pixelRatio),g.clear({color:d}),_.disable(_.SCISSOR_TEST)}function Ds(u,t,n){const s=u.context,l=s.gl,d=n.posMatrix,g=u.useProgram("debug"),_=fi.disabled,v=Ni.disabled,S=u.colorModeForRenderPass(),I="$debug",E=u.style.map.terrain&&u.style.map.terrain.getTerrainData(n);s.activeTexture.set(l.TEXTURE0);const D=t.getTileByID(n.key).latestRawTileData,V=Math.floor((D&&D.byteLength||0)/1024),U=t.getTile(n).tileSize,$=512/Math.min(U,512)*(n.overscaledZ/u.transform.zoom)*.5;let B=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(B+=` => ${n.overscaledZ}`),function(oe,fe){oe.initDebugOverlayCanvas();const K=oe.debugOverlayCanvas,ae=oe.context.gl,ve=oe.debugOverlayCanvas.getContext("2d");ve.clearRect(0,0,K.width,K.height),ve.shadowColor="white",ve.shadowBlur=2,ve.lineWidth=1.5,ve.strokeStyle="white",ve.textBaseline="top",ve.font="bold 36px Open Sans, sans-serif",ve.fillText(fe,5,5),ve.strokeText(fe,5,5),oe.debugOverlayTexture.update(K),oe.debugOverlayTexture.bind(ae.LINEAR,ae.CLAMP_TO_EDGE)}(u,`${B} ${V}kB`),g.draw(s,l.TRIANGLES,_,v,Wi.alphaBlended,Ei.disabled,re(d,c.aT.transparent,$),null,I,u.debugBuffer,u.quadTriangleIndexBuffer,u.debugSegments),g.draw(s,l.LINE_STRIP,_,v,S,Ei.disabled,re(d,c.aT.red),E,I,u.debugBuffer,u.tileBorderIndexBuffer,u.debugSegments)}function qi(u,t,n){const s=u.context,l=s.gl,d=u.colorModeForRenderPass(),g=new fi(l.LEQUAL,fi.ReadWrite,u.depthRangeFor3D),_=u.useProgram("terrain"),v=t.getTerrainMesh();s.bindFramebuffer.set(null),s.viewport.set([0,0,u.width,u.height]);for(const S of n){const I=u.renderToTexture.getTexture(S),E=t.getTerrainData(S.tileID);s.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,I.texture);const D={u_matrix:u.transform.calculatePosMatrix(S.tileID.toUnwrapped()),u_texture:0,u_ele_delta:t.getMeshFrameDelta(u.transform.zoom)};_.draw(s,l.TRIANGLES,g,Ni.disabled,d,Ei.backCCW,D,E,"terrain",v.vertexBuffer,v.indexBuffer,v.segments)}}class lo{constructor(t,n){this.context=new Pa(t),this.transform=n,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:c.Z(),renderTime:0},this.setup(),this.numSublayers=ei.maxUnderzooming+ei.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new jr}resize(t,n,s){if(this.width=Math.floor(t*s),this.height=Math.floor(n*s),this.pixelRatio=s,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const l of this.style._order)this.style._layers[l].resize()}setup(){const t=this.context,n=new c.a_;n.emplaceBack(0,0),n.emplaceBack(c.N,0),n.emplaceBack(0,c.N),n.emplaceBack(c.N,c.N),this.tileExtentBuffer=t.createVertexBuffer(n,ps.members),this.tileExtentSegments=c.S.simpleSegment(0,0,4,2);const s=new c.a_;s.emplaceBack(0,0),s.emplaceBack(c.N,0),s.emplaceBack(0,c.N),s.emplaceBack(c.N,c.N),this.debugBuffer=t.createVertexBuffer(s,ps.members),this.debugSegments=c.S.simpleSegment(0,0,4,5);const l=new c.V;l.emplaceBack(0,0,0,0),l.emplaceBack(c.N,0,c.N,0),l.emplaceBack(0,c.N,0,c.N),l.emplaceBack(c.N,c.N,c.N,c.N),this.rasterBoundsBuffer=t.createVertexBuffer(l,xi.members),this.rasterBoundsSegments=c.S.simpleSegment(0,0,4,2);const d=new c.a_;d.emplaceBack(0,0),d.emplaceBack(1,0),d.emplaceBack(0,1),d.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(d,ps.members),this.viewportSegments=c.S.simpleSegment(0,0,4,2);const g=new c.a$;g.emplaceBack(0),g.emplaceBack(1),g.emplaceBack(3),g.emplaceBack(2),g.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(g);const _=new c.b0;_.emplaceBack(0,1,2),_.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(_);const v=this.context.gl;this.stencilClearMode=new Ni({func:v.ALWAYS,mask:0},0,255,v.ZERO,v.ZERO,v.ZERO)}clearStencil(){const t=this.context,n=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const s=c.Z();c.aS(s,0,this.width,this.height,0,0,1),c.a0(s,s,[n.drawingBufferWidth,n.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,n.TRIANGLES,fi.disabled,this.stencilClearMode,Wi.disabled,Ei.disabled,de(s),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,n){if(this.currentStencilSource===t.source||!t.isTileClipped()||!n||!n.length)return;this.currentStencilSource=t.source;const s=this.context,l=s.gl;this.nextStencilID+n.length>256&&this.clearStencil(),s.setColorMode(Wi.disabled),s.setDepthMode(fi.disabled);const d=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const g of n){const _=this._tileClippingMaskIDs[g.key]=this.nextStencilID++,v=this.style.map.terrain&&this.style.map.terrain.getTerrainData(g);d.draw(s,l.TRIANGLES,fi.disabled,new Ni({func:l.ALWAYS,mask:0},_,255,l.KEEP,l.KEEP,l.REPLACE),Wi.disabled,Ei.disabled,de(g.posMatrix),v,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,n=this.context.gl;return new Ni({func:n.NOTEQUAL,mask:255},t,255,n.KEEP,n.KEEP,n.REPLACE)}stencilModeForClipping(t){const n=this.context.gl;return new Ni({func:n.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,n.KEEP,n.KEEP,n.REPLACE)}stencilConfigForOverlap(t){const n=this.context.gl,s=t.sort((g,_)=>_.overscaledZ-g.overscaledZ),l=s[s.length-1].overscaledZ,d=s[0].overscaledZ-l+1;if(d>1){this.currentStencilSource=void 0,this.nextStencilID+d>256&&this.clearStencil();const g={};for(let _=0;_<d;_++)g[_+l]=new Ni({func:n.GEQUAL,mask:255},_+this.nextStencilID,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID+=d,[g,s]}return[{[l]:Ni.disabled},s]}colorModeForRenderPass(){const t=this.context.gl;return this._showOverdrawInspector?new Wi([t.CONSTANT_COLOR,t.ONE],new c.aT(.125,.125,.125,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?Wi.unblended:Wi.alphaBlended}depthModeForSublayer(t,n,s){if(!this.opaquePassEnabledForLayer())return fi.disabled;const l=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new fi(s||this.context.gl.LEQUAL,n,[l,l])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(t,n){this.style=t,this.options=n,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(c.h.now()),this.imageManager.beginFrame();const s=this.style._order,l=this.style.sourceCaches,d={},g={},_={};for(const v in l){const S=l[v];S.used&&S.prepare(this.context),d[v]=S.getVisibleCoordinates(),g[v]=d[v].slice().reverse(),_[v]=S.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let v=0;v<s.length;v++)if(this.style._layers[s[v]].is3D()){this.opaquePassCutoff=v;break}if(this.renderToTexture){this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0;const v=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime);(this.terrainFacilitator.dirty||!c.b1(this.terrainFacilitator.matrix,this.transform.projMatrix)||v.length)&&(c.b2(this.terrainFacilitator.matrix,this.transform.projMatrix),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(S,I){const E=S.context,D=E.gl,V=Wi.unblended,U=new fi(D.LEQUAL,fi.ReadWrite,[0,1]),$=I.getTerrainMesh(),B=I.sourceCache.getRenderableTiles(),oe=S.useProgram("terrainDepth");E.bindFramebuffer.set(I.getFramebuffer("depth").framebuffer),E.viewport.set([0,0,S.width/devicePixelRatio,S.height/devicePixelRatio]),E.clear({color:c.aT.transparent,depth:1});for(const fe of B){const K=I.getTerrainData(fe.tileID),ae={u_matrix:S.transform.calculatePosMatrix(fe.tileID.toUnwrapped()),u_ele_delta:I.getMeshFrameDelta(S.transform.zoom)};oe.draw(E,D.TRIANGLES,U,Ni.disabled,V,Ei.backCCW,ae,K,"terrain",$.vertexBuffer,$.indexBuffer,$.segments)}E.bindFramebuffer.set(null),E.viewport.set([0,0,S.width,S.height])}(this,this.style.map.terrain),function(S,I){const E=S.context,D=E.gl,V=Wi.unblended,U=new fi(D.LEQUAL,fi.ReadWrite,[0,1]),$=I.getTerrainMesh(),B=I.getCoordsTexture(),oe=I.sourceCache.getRenderableTiles(),fe=S.useProgram("terrainCoords");E.bindFramebuffer.set(I.getFramebuffer("coords").framebuffer),E.viewport.set([0,0,S.width/devicePixelRatio,S.height/devicePixelRatio]),E.clear({color:c.aT.transparent,depth:1}),I.coordsIndex=[];for(const K of oe){const ae=I.getTerrainData(K.tileID);E.activeTexture.set(D.TEXTURE0),D.bindTexture(D.TEXTURE_2D,B.texture);const ve={u_matrix:S.transform.calculatePosMatrix(K.tileID.toUnwrapped()),u_terrain_coords_id:(255-I.coordsIndex.length)/255,u_texture:0,u_ele_delta:I.getMeshFrameDelta(S.transform.zoom)};fe.draw(E,D.TRIANGLES,U,Ni.disabled,V,Ei.backCCW,ve,ae,"terrain",$.vertexBuffer,$.indexBuffer,$.segments),I.coordsIndex.push(K.tileID.key)}E.bindFramebuffer.set(null),E.viewport.set([0,0,S.width,S.height])}(this,this.style.map.terrain))}this.renderPass="offscreen";for(const v of s){const S=this.style._layers[v];if(!S.hasOffscreenPass()||S.isHidden(this.transform.zoom))continue;const I=g[S.source];("custom"===S.type||I.length)&&this.renderLayer(this,l[S.source],S,I)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:n.showOverdrawInspector?c.aT.black:c.aT.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=n.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=s.length-1;this.currentLayer>=0;this.currentLayer--){const v=this.style._layers[s[this.currentLayer]],S=l[v.source],I=d[v.source];this._renderTileClippingMasks(v,I),this.renderLayer(this,S,v,I)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<s.length;this.currentLayer++){const v=this.style._layers[s[this.currentLayer]],S=l[v.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(v))continue;const I=("symbol"===v.type?_:g)[v.source];this._renderTileClippingMasks(v,d[v.source]),this.renderLayer(this,S,v,I)}if(this.options.showTileBoundaries){const v=function(S,I){let E=null;const D=Object.values(S._layers).flatMap(B=>B.source&&!B.isHidden(I)?[S.sourceCaches[B.source]]:[]),V=D.filter(
1B=>"vector"===B.getSource().type),U=D.filter(B=>"vector"!==B.getSource().type),$=B=>{(!E||E.getSource().maxzoom<B.getSource().maxzoom)&&(E=B)};return V.forEach(B=>$(B)),E||U.forEach(B=>$(B)),E}(this.style,this.transform.zoom);v&&function(S,I,E){for(let D=0;D<E.length;D++)Ds(S,I,E[D])}(this,v,v.getVisibleCoordinates())}this.options.showPadding&&function(v){const S=v.transform.padding;zo(v,v.transform.height-(S.top||0),3,bo),zo(v,S.bottom||0,3,As),ks(v,S.left||0,3,Nn),ks(v,v.transform.width-(S.right||0),3,ma);const I=v.transform.centerPoint;var E,D,V,U;wo(E=v,(D=I.x)-1,(V=v.transform.height-I.y)-10,2,20,U=ao),wo(E,D-10,V-1,20,2,U)}(this),this.context.setDefault()}renderLayer(t,n,s,l){if(!s.isHidden(this.transform.zoom)&&("background"===s.type||"custom"===s.type||(l||[]).length))switch(this.id=s.id,s.type){case"symbol":!function(d,g,_,v,S){if("translucent"!==d.renderPass)return;const I=Ni.disabled,E=d.colorModeForRenderPass();(_._unevaluatedLayout.hasValue("text-variable-anchor")||_._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(D,V,U,$,B,oe,fe){const K=V.transform,ae="map"===B,ve="map"===oe;for(const xe of D){const Re=$.getTile(xe),Xe=Re.getBucket(U);if(!Xe||!Xe.text||!Xe.text.segments.get().length)continue;const Ge=c.ah(Xe.textSizeData,K.zoom),rt=ee(Re,1,V.transform.zoom),Et=tt(xe.posMatrix,ve,ae,V.transform,rt),gi="none"!==U.layout.get("icon-text-fit")&&Xe.hasIconData();if(Ge){const dt=Math.pow(2,K.zoom-Re.tileID.overscaledZ);Is(Xe,ae,ve,fe,K,Et,xe.posMatrix,dt,Ge,gi,V.style.map.terrain?(qt,kt)=>V.style.map.terrain.getElevation(xe,qt,kt):null)}}}(v,d,_,g,_.layout.get("text-rotation-alignment"),_.layout.get("text-pitch-alignment"),S),0!==_.paint.get("icon-opacity").constantOr(1)&&so(d,g,_,v,!1,_.paint.get("icon-translate"),_.paint.get("icon-translate-anchor"),_.layout.get("icon-rotation-alignment"),_.layout.get("icon-pitch-alignment"),_.layout.get("icon-keep-upright"),I,E),0!==_.paint.get("text-opacity").constantOr(1)&&so(d,g,_,v,!0,_.paint.get("text-translate"),_.paint.get("text-translate-anchor"),_.layout.get("text-rotation-alignment"),_.layout.get("text-pitch-alignment"),_.layout.get("text-keep-upright"),I,E),g.map.showCollisionBoxes&&(oo(d,g,_,v,_.paint.get("text-translate"),_.paint.get("text-translate-anchor"),!0),oo(d,g,_,v,_.paint.get("icon-translate"),_.paint.get("icon-translate-anchor"),!1))}(t,n,s,l,this.style.placement.variableOffsets);break;case"circle":!function(d,g,_,v){if("translucent"!==d.renderPass)return;const S=_.paint.get("circle-opacity"),I=_.paint.get("circle-stroke-width"),E=_.paint.get("circle-stroke-opacity"),D=!_.layout.get("circle-sort-key").isConstant();if(0===S.constantOr(1)&&(0===I.constantOr(1)||0===E.constantOr(1)))return;const V=d.context,U=V.gl,$=d.depthModeForSublayer(0,fi.ReadOnly),B=Ni.disabled,oe=d.colorModeForRenderPass(),fe=[];for(let K=0;K<v.length;K++){const ae=v[K],ve=g.getTile(ae),xe=ve.getBucket(_);if(!xe)continue;const Re=xe.programConfigurations.get(_.id),Xe=d.useProgram("circle",Re),Ge=xe.layoutVertexBuffer,rt=xe.indexBuffer,Et=d.style.map.terrain&&d.style.map.terrain.getTerrainData(ae),gi={programConfiguration:Re,program:Xe,layoutVertexBuffer:Ge,indexBuffer:rt,uniformValues:Z(d,ae,ve,_),terrainData:Et};if(D){const dt=xe.segments.get();for(const qt of dt)fe.push({segments:new c.S([qt]),sortKey:qt.sortKey,state:gi})}else fe.push({segments:xe.segments,sortKey:0,state:gi})}D&&fe.sort((K,ae)=>K.sortKey-ae.sortKey);for(const K of fe){const{programConfiguration:ae,program:ve,layoutVertexBuffer:xe,indexBuffer:Re,uniformValues:Xe,terrainData:Ge}=K.state;ve.draw(V,U.TRIANGLES,$,B,oe,Ei.disabled,Xe,Ge,_.id,xe,Re,K.segments,_.paint,d.transform.zoom,ae)}}(t,n,s,l);break;case"heatmap":!function(d,g,_,v){if(0!==_.paint.get("heatmap-opacity"))if("offscreen"===d.renderPass){const S=d.context,I=S.gl,E=Ni.disabled,D=new Wi([I.ONE,I.ONE],c.aT.transparent,[!0,!0,!0,!0]);(function(V,U,$){const B=V.gl;V.activeTexture.set(B.TEXTURE1),V.viewport.set([0,0,U.width/4,U.height/4]);let oe=$.heatmapFbo;if(oe)B.bindTexture(B.TEXTURE_2D,oe.colorAttachment.get()),V.bindFramebuffer.set(oe.framebuffer);else{const fe=B.createTexture();B.bindTexture(B.TEXTURE_2D,fe),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_WRAP_S,B.CLAMP_TO_EDGE),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_WRAP_T,B.CLAMP_TO_EDGE),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_MIN_FILTER,B.LINEAR),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_MAG_FILTER,B.LINEAR),oe=$.heatmapFbo=V.createFramebuffer(U.width/4,U.height/4,!1,!1),function(K,ae,ve,xe){var Re,Xe;const Ge=K.gl,rt=null!==(Re=K.HALF_FLOAT)&&void 0!==Re?Re:Ge.UNSIGNED_BYTE,Et=null!==(Xe=K.RGBA16F)&&void 0!==Xe?Xe:Ge.RGBA;Ge.texImage2D(Ge.TEXTURE_2D,0,Et,ae.width/4,ae.height/4,0,Ge.RGBA,rt,null),xe.colorAttachment.set(ve)}(V,U,fe,oe)}})(S,d,_),S.clear({color:c.aT.transparent});for(let V=0;V<v.length;V++){const U=v[V];if(g.hasRenderableParent(U))continue;const $=g.getTile(U),B=$.getBucket(_);if(!B)continue;const oe=B.programConfigurations.get(_.id),fe=d.useProgram("heatmap",oe),{zoom:K}=d.transform;fe.draw(S,I.TRIANGLES,fi.disabled,E,D,Ei.disabled,qe(U.posMatrix,$,K,_.paint.get("heatmap-intensity")),null,_.id,B.layoutVertexBuffer,B.indexBuffer,B.segments,_.paint,d.transform.zoom,oe)}S.viewport.set([0,0,d.width,d.height])}else"translucent"===d.renderPass&&(d.context.setColorMode(d.colorModeForRenderPass()),function(S,I){const E=S.context,D=E.gl,V=I.heatmapFbo;if(!V)return;E.activeTexture.set(D.TEXTURE0),D.bindTexture(D.TEXTURE_2D,V.colorAttachment.get()),E.activeTexture.set(D.TEXTURE1);let U=I.colorRampTexture;U||(U=I.colorRampTexture=new Ve(E,I.colorRamp,D.RGBA)),U.bind(D.LINEAR,D.CLAMP_TO_EDGE),S.useProgram("heatmapTexture").draw(E,D.TRIANGLES,fi.disabled,Ni.disabled,S.colorModeForRenderPass(),Ei.disabled,(($,B,oe,fe)=>{const K=c.Z();c.aS(K,0,$.width,$.height,0,0,1);const ae=$.context.gl;return{u_matrix:K,u_world:[ae.drawingBufferWidth,ae.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:B.paint.get("heatmap-opacity")}})(S,I),null,I.id,S.viewportBuffer,S.quadTriangleIndexBuffer,S.viewportSegments,I.paint,S.transform.zoom)}(d,_))}(t,n,s,l);break;case"line":!function(d,g,_,v){if("translucent"!==d.renderPass)return;const S=_.paint.get("line-opacity"),I=_.paint.get("line-width");if(0===S.constantOr(1)||0===I.constantOr(1))return;const E=d.depthModeForSublayer(0,fi.ReadOnly),D=d.colorModeForRenderPass(),V=_.paint.get("line-dasharray"),U=_.paint.get("line-pattern"),$=U.constantOr(1),B=_.paint.get("line-gradient"),oe=_.getCrossfadeParameters(),fe=$?"linePattern":V?"lineSDF":B?"lineGradient":"line",K=d.context,ae=K.gl;let ve=!0;for(const xe of v){const Re=g.getTile(xe);if($&&!Re.patternsLoaded())continue;const Xe=Re.getBucket(_);if(!Xe)continue;const Ge=Xe.programConfigurations.get(_.id),rt=d.context.program.get(),Et=d.useProgram(fe,Ge),gi=ve||Et.program!==rt,dt=d.style.map.terrain&&d.style.map.terrain.getTerrainData(xe),qt=U.constantOr(null);if(qt&&Re.imageAtlas){const pi=Re.imageAtlas,ai=pi.patternPositions[qt.to.toString()],_i=pi.patternPositions[qt.from.toString()];ai&&_i&&Ge.setConstantPatternPositions(ai,_i)}const kt=dt?xe:null,Li=$?lt(d,Re,_,oe,kt):V?Yt(d,Re,_,V,oe,kt):B?_t(d,Re,_,Xe.lineClipsArray.length,kt):gt(d,Re,_,kt);if($)K.activeTexture.set(ae.TEXTURE0),Re.imageAtlasTexture.bind(ae.LINEAR,ae.CLAMP_TO_EDGE),Ge.updatePaintBuffers(oe);else if(V&&(gi||d.lineAtlas.dirty))K.activeTexture.set(ae.TEXTURE0),d.lineAtlas.bind(K);else if(B){const pi=Xe.gradients[_.id];let ai=pi.texture;if(_.gradientVersion!==pi.version){let _i=256;if(_.stepInterpolant){const cr=g.getSource().maxzoom,Vi=xe.canonical.z===cr?Math.ceil(1<<d.transform.maxZoom-xe.canonical.z):1;_i=c.ad(c.aY(Xe.maxLineLength/c.N*1024*Vi),256,K.maxTextureSize)}pi.gradient=c.aZ({expression:_.gradientExpression(),evaluationKey:"lineProgress",resolution:_i,image:pi.gradient||void 0,clips:Xe.lineClipsArray}),pi.texture?pi.texture.update(pi.gradient):pi.texture=new Ve(K,pi.gradient,ae.RGBA),pi.version=_.gradientVersion,ai=pi.texture}K.activeTexture.set(ae.TEXTURE0),ai.bind(_.stepInterpolant?ae.NEAREST:ae.LINEAR,ae.CLAMP_TO_EDGE)}Et.draw(K,ae.TRIANGLES,E,d.stencilModeForClipping(xe),D,Ei.disabled,Li,dt,_.id,Xe.layoutVertexBuffer,Xe.indexBuffer,Xe.segments,_.paint,d.transform.zoom,Ge,Xe.layoutVertexBuffer2),ve=!1}}(t,n,s,l);break;case"fill":!function(d,g,_,v){const S=_.paint.get("fill-color"),I=_.paint.get("fill-opacity");if(0===I.constantOr(1))return;const E=d.colorModeForRenderPass(),D=_.paint.get("fill-pattern"),V=d.opaquePassEnabledForLayer()&&!D.constantOr(1)&&1===S.constantOr(c.aT.transparent).a&&1===I.constantOr(0)?"opaque":"translucent";if(d.renderPass===V){const U=d.depthModeForSublayer(1,"opaque"===d.renderPass?fi.ReadWrite:fi.ReadOnly);Jo(d,g,_,v,U,E,!1)}if("translucent"===d.renderPass&&_.paint.get("fill-antialias")){const U=d.depthModeForSublayer(_.getPaintProperty("fill-outline-color")?2:0,fi.ReadOnly);Jo(d,g,_,v,U,E,!0)}}(t,n,s,l);break;case"fill-extrusion":!function(d,g,_,v){const S=_.paint.get("fill-extrusion-opacity");if(0!==S&&"translucent"===d.renderPass){const I=new fi(d.context.gl.LEQUAL,fi.ReadWrite,d.depthRangeFor3D);if(1!==S||_.paint.get("fill-extrusion-pattern").constantOr(1))Ho(d,g,_,v,I,Ni.disabled,Wi.disabled),Ho(d,g,_,v,I,d.stencilModeFor3D(),d.colorModeForRenderPass());else{const E=d.colorModeForRenderPass();Ho(d,g,_,v,I,Ni.disabled,E)}}}(t,n,s,l);break;case"hillshade":!function(d,g,_,v){if("offscreen"!==d.renderPass&&"translucent"!==d.renderPass)return;
vendor: 14,253 bytes, line 1
1const S=d.context,I=d.depthModeForSublayer(0,fi.ReadOnly),E=d.colorModeForRenderPass(),[D,V]="translucent"===d.renderPass?d.stencilConfigForOverlap(v):[{},v];for(const U of V){const $=g.getTile(U);void 0!==$.needsHillshadePrepare&&$.needsHillshadePrepare&&"offscreen"===d.renderPass?Ts(d,$,_,I,Ni.disabled,E):"translucent"===d.renderPass&&pa(d,U,$,_,I,D[U.overscaledZ],E)}S.viewport.set([0,0,d.width,d.height])}(t,n,s,l);break;case"raster":!function(d,g,_,v){if("translucent"!==d.renderPass||0===_.paint.get("raster-opacity")||!v.length)return;const S=d.context,I=S.gl,E=g.getSource(),D=d.useProgram("raster"),V=d.colorModeForRenderPass(),[U,$]=E instanceof Ft?[{},v]:d.stencilConfigForOverlap(v),B=$[$.length-1].overscaledZ,oe=!d.options.moving;for(const fe of $){const K=d.depthModeForSublayer(fe.overscaledZ-B,1===_.paint.get("raster-opacity")?fi.ReadWrite:fi.ReadOnly,I.LESS),ae=g.getTile(fe);ae.registerFadeDuration(_.paint.get("raster-fade-duration"));const ve=g.findLoadedParent(fe,0),xe=Ps(ae,ve,g,_,d.transform,d.style.map.terrain);let Re,Xe;const Ge="nearest"===_.paint.get("raster-resampling")?I.NEAREST:I.LINEAR;S.activeTexture.set(I.TEXTURE0),ae.texture.bind(Ge,I.CLAMP_TO_EDGE,I.LINEAR_MIPMAP_NEAREST),S.activeTexture.set(I.TEXTURE1),ve?(ve.texture.bind(Ge,I.CLAMP_TO_EDGE,I.LINEAR_MIPMAP_NEAREST),Re=Math.pow(2,ve.tileID.overscaledZ-ae.tileID.overscaledZ),Xe=[ae.tileID.canonical.x*Re%1,ae.tileID.canonical.y*Re%1]):ae.texture.bind(Ge,I.CLAMP_TO_EDGE,I.LINEAR_MIPMAP_NEAREST);const rt=d.style.map.terrain&&d.style.map.terrain.getTerrainData(fe),Et=rt?fe:null,gi=Et?Et.posMatrix:d.transform.calculatePosMatrix(fe.toUnwrapped(),oe),dt=rr(gi,Xe||[0,0],Re||1,xe,_);E instanceof Ft?D.draw(S,I.TRIANGLES,K,Ni.disabled,V,Ei.disabled,dt,rt,_.id,E.boundsBuffer,d.quadTriangleIndexBuffer,E.boundsSegments):D.draw(S,I.TRIANGLES,K,U[fe.overscaledZ],V,Ei.disabled,dt,rt,_.id,d.rasterBoundsBuffer,d.quadTriangleIndexBuffer,d.rasterBoundsSegments)}}(t,n,s,l);break;case"background":!function(d,g,_,v){const S=_.paint.get("background-color"),I=_.paint.get("background-opacity");if(0===I)return;const E=d.context,D=E.gl,V=d.transform,U=V.tileSize,$=_.paint.get("background-pattern");if(d.isPatternMissing($))return;const B=!$&&1===S.a&&1===I&&d.opaquePassEnabledForLayer()?"opaque":"translucent";if(d.renderPass!==B)return;const oe=Ni.disabled,fe=d.depthModeForSublayer(0,"opaque"===B?fi.ReadWrite:fi.ReadOnly),K=d.colorModeForRenderPass(),ae=d.useProgram($?"backgroundPattern":"background"),ve=v||V.coveringTiles({tileSize:U,terrain:d.style.map.terrain});$&&(E.activeTexture.set(D.TEXTURE0),d.imageManager.bind(d.context));const xe=_.getCrossfadeParameters();for(const Re of ve){const Xe=v?Re.posMatrix:d.transform.calculatePosMatrix(Re.toUnwrapped()),Ge=$?Jr(Xe,I,d,$,{tileID:Re,tileSize:U},xe):Hi(Xe,I,S),rt=d.style.map.terrain&&d.style.map.terrain.getTerrainData(Re);ae.draw(E,D.TRIANGLES,fe,oe,K,Ei.disabled,Ge,rt,_.id,d.tileExtentBuffer,d.quadTriangleIndexBuffer,d.tileExtentSegments)}}(t,0,s,l);break;case"custom":!function(d,g,_){const v=d.context,S=_.implementation;if("offscreen"===d.renderPass){const I=S.prerender;I&&(d.setCustomLayerDefaults(),v.setColorMode(d.colorModeForRenderPass()),I.call(S,v.gl,d.transform.customLayerMatrix()),v.setDirty(),d.setBaseState())}else if("translucent"===d.renderPass){d.setCustomLayerDefaults(),v.setColorMode(d.colorModeForRenderPass()),v.setStencilMode(Ni.disabled);const I="3d"===S.renderingMode?new fi(d.context.gl.LEQUAL,fi.ReadWrite,d.depthRangeFor3D):d.depthModeForSublayer(0,fi.ReadOnly);v.setDepthMode(I),S.render(v.gl,d.transform.customLayerMatrix()),v.setDirty(),d.setBaseState(),v.bindFramebuffer.set(null)}}(t,0,s)}}translatePosMatrix(t,n,s,l,d){if(!s[0]&&!s[1])return t;const g=d?"map"===l?this.transform.angle:0:"viewport"===l?-this.transform.angle:0;if(g){const S=Math.sin(g),I=Math.cos(g);s=[s[0]*I-s[1]*S,s[0]*S+s[1]*I]}const _=[d?s[0]:ee(n,s[0],this.transform.zoom),d?s[1]:ee(n,s[1],this.transform.zoom),0],v=new Float32Array(16);return c.$(v,t,_),v}saveTileTexture(t){const n=this._tileTextures[t.size[0]];n?n.push(t):this._tileTextures[t.size[0]]=[t]}getTileTexture(t){const n=this._tileTextures[t];return n&&n.length>0?n.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;const n=this.imageManager.getPattern(t.from.toString()),s=this.imageManager.getPattern(t.to.toString());return!n||!s}useProgram(t,n){this.cache=this.cache||{};const s=t+(n?n.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[s]||(this.cache[s]=new jo(this.context,Gi[t],n,ms[t],this._showOverdrawInspector,this.style.map.terrain)),this.cache[s]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const 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=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new Ve(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:t,drawingBufferHeight:n}=this.context.gl;return this.width!==t||this.height!==n}}class Zr{constructor(t,n){this.points=t,this.planes=n}static fromInvProjectionMatrix(t,n,s){const l=Math.pow(2,s),d=[[-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(_=>{const v=1/(_=c.ag([],_,t))[3]/n*l;return c.b3(_,_,[v,v,1/_[3],v])}),g=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(_=>{const v=function(D,V){var U=V[0],$=V[1],B=V[2],oe=U*U+$*$+B*B;return oe>0&&(oe=1/Math.sqrt(oe)),D[0]=V[0]*oe,D[1]=V[1]*oe,D[2]=V[2]*oe,D}([],(D=[],V=be([],d[_[0]],d[_[1]]),U=be([],d[_[2]],d[_[1]]),$=V[0],fe=U[0],D[0]=(B=V[1])*(ae=U[2])-(oe=V[2])*(K=U[1]),D[1]=oe*fe-$*ae,D[2]=$*K-B*fe,D)),S=-((I=v)[0]*(E=d[_[1]])[0]+I[1]*E[1]+I[2]*E[2]);var D,V,U,$,B,oe,fe,K,ae,I,E;return v.concat(S)});return new Zr(d,g)}}class Un{constructor(t,n){var s,l,d;this.min=t,this.max=n,this.center=function(s,l,d){return s[0]=.5*l[0],s[1]=.5*l[1],s[2]=.5*l[2],s}([],((s=[])[0]=(l=this.min)[0]+(d=this.max)[0],s[1]=l[1]+d[1],s[2]=l[2]+d[2],s))}quadrant(t){const n=[t%2==0,t<2],s=xt(this.min),l=xt(this.max);for(let d=0;d<n.length;d++)s[d]=n[d]?this.min[d]:this.center[d],l[d]=n[d]?this.center[d]:this.max[d];return l[2]=this.max[2],new Un(s,l)}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]}intersects(t){const n=[[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 s=!0;for(let l=0;l<t.planes.length;l++){const d=t.planes[l];let g=0;for(let _=0;_<n.length;_++)c.b4(d,n[_])>=0&&g++;if(0===g)return 0;g!==n.length&&(s=!1)}if(s)return 2;for(let l=0;l<3;l++){let d=Number.MAX_VALUE,g=-Number.MAX_VALUE;for(let _=0;_<t.points.length;_++){const v=t.points[_][l]-this.min[l];d=Math.min(d,v),g=Math.max(g,v)}if(g<0||d>this.max[l]-this.min[l])return 0}return 1}}class Ro{constructor(t=0,n=0,s=0,l=0){if(isNaN(t)||t<0||isNaN(n)||n<0||isNaN(s)||s<0||isNaN(l)||l<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=n,this.left=s,this.right=l}interpolate(t,n,s){return null!=n.top&&null!=t.top&&(this.top=c.B.number(t.top,n.top,s)),null!=n.bottom&&null!=t.bottom&&(this.bottom=c.B.number(t.bottom,n.bottom,s)),null!=n.left&&null!=t.left&&(this.left=c.B.number(t.left,n.left,s)),null!=n.right&&null!=t.right&&(this.right=c.B.number(t.right,n.right,s)),this}getCenter(t,n){const s=c.ad((this.left+t-this.right)/2,0,t),l=c.ad((this.top+n-this.bottom)/2,0,n);return new c.P(s,l)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new Ro(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class Ls{constructor(t,n,s,l,d){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===d||!!d,this._minZoom=t||0,this._maxZoom=n||22,this._minPitch=s??0,this._maxPitch=l??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new c.L(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Ro,this._posMatrixCache={},this._alignedPosMatrixCache={},this._minEleveationForCurrentTile=0}clone(){const t=new Ls(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.apply(this),t}apply(t){this.tileSize=t.tileSize,this.latRange=t.latRange,this.width=t.width,this.height=t.height,this._center=t._center,this._elevation=t._elevation,this._minEleveationForCurrentTile=t._minEleveationForCurrentTile,this.zoom=t.zoom,this.angle=t.angle,this._fov=t._fov,this._pitch=t._pitch,this._unmodified=t._unmodified,this._edgeInsets=t._edgeInsets.clone(),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 centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new c.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(t){const n=-c.b5(t,-180,180)*Math.PI/180;var s;this.angle!==n&&(this._unmodified=!1,this.angle=n,this._calcMatrices(),this.rotationMatrix=(s=new c.A(4),c.A!=Float32Array&&(s[1]=0,s[2]=0),s[0]=1,s[3]=1,s),function(s,l,d){var g=l[0],_=l[1],v=l[2],S=l[3],I=Math.sin(d),E=Math.cos(d);s[0]=g*E+v*I,s[1]=_*E+S*I,s[2]=g*-I+v*E,s[3]=_*-I+S*E}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const n=c.ad(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(t){const n=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==n&&(this._unmodified=!1,this._zoom=n,this.tileZoom=Math.max(0,Math.floor(n)),this.scale=this.zoomScale(n),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(t){t!==this._elevation&&(this._elevation=t,this._constrain(),this._calcMatrices())}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())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,n,s){this._unmodified=!1,this._edgeInsets.interpolate(t,n,s),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){const n=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,n)}getVisibleUnwrappedCoordinates(t){const n=[new c.b6(0,t)];if(this._renderWorldCopies){const s=this.pointCoordinate(new c.P(0,0)),l=this.pointCoordinate(new c.P(this.width,0)),d=this.pointCoordinate(new c.P(this.width,this.height)),g=this.pointCoordinate(new c.P(0,this.height)),_=Math.floor(Math.min(s.x,l.x,d.x,g.x)),v=Math.floor(Math.max(s.x,l.x,d.x,g.x)),S=1;for(let I=_-S;I<=v+S;I++)0!==I&&n.push(new c.b6(I,t))}return n}coveringTiles(t){var n,s;let l=this.coveringZoomLevel(t);const d=l;if(void 0!==t.minzoom&&l<t.minzoom)return[];void 0!==t.maxzoom&&l>t.maxzoom&&(l=t.maxzoom);const g=this.pointCoordinate(this.getCameraPoint()),_=c.U.fromLngLat(this.center),v=Math.pow(2,l),S=[v*g.x,v*g.y,0],I=[v*_.x,v*_.y,0],E=Zr.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,l);let D=t.minzoom||0;!t.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(D=l);const V=t.terrain?2/Math.min(this.tileSize,t.tileSize)*this.tileSize:3,U=K=>({aabb:new Un([K*v,0,0],[(K+1)*v,v,0]),zoom:0,x:0,y:0,wrap:K,fullyVisible:!1}),$=[],B=[],oe=l,fe=t.reparseOverscaled?d:l;if(this._renderWorldCopies)for(let K=1;K<=3;K++)$.push(U(-K)),$.push(U(K));for($.push(U(0));$.length>0;){const K=$.pop(),ae=K.x,ve=K.y;let xe=K.fullyVisible;if(!xe){const Et=K.aabb.intersects(E);if(0===Et)continue;xe=2===Et}const Re=t.terrain?S:I,Xe=K.aabb.distanceX(Re),Ge=K.aabb.distanceY(Re),rt=Math.max(Math.abs(Xe),Math.abs(Ge));if(K.zoom===oe||rt>V+(1<<oe-K.zoom)-2&&K.zoom>=D){const Et=oe-K.zoom,gi=S[0]-.5-(ae<<Et),dt=S[1]-.5-(ve<<Et);B.push({tileID:new c.O(K.zoom===oe?fe:K.zoom,K.wrap,K.zoom,ae,ve),distanceSq:De([I[0]-.5-ae,I[1]-.5-ve]),tileDistanceToCamera:Math.sqrt(gi*gi+dt*dt)})}else for(let Et=0;Et<4;Et++){const gi=(ae<<1)+Et%2,dt=(ve<<1)+(Et>>1),qt=K.zoom+1;let kt=K.aabb.quadrant(Et);if(t.terrain){const Li=new c.O(qt,K.wrap,qt,gi,dt),pi=t.terrain.getMinMaxElevation(Li),ai=null!==(n=pi.minElevation)&&void 0!==n?n:this.elevation,_i=null!==(s=pi.maxElevation)&&void 0!==s?s:this.elevation;
1kt=new Un([kt.min[0],kt.min[1],ai],[kt.max[0],kt.max[1],_i])}$.push({aabb:kt,zoom:qt,x:gi,y:dt,wrap:K.wrap,fullyVisible:xe})}}return B.sort((K,ae)=>K.distanceSq-ae.distanceSq).map(K=>K.tileID)}resize(t,n){this.width=t,this.height=n,this.pixelsToGLUnits=[2/t,-2/n],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(t){const n=c.ad(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new c.P(c.G(t.lng)*this.worldSize,c.H(n)*this.worldSize)}unproject(t){return new c.U(t.x/this.worldSize,t.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(t){const n=this.pointLocation(this.centerPoint,t),s=t.getElevationForLngLatZoom(n,this.tileZoom);if(!(this.elevation-s))return;const l=this.getCameraPosition(),d=c.U.fromLngLat(l.lngLat,l.altitude),g=c.U.fromLngLat(n,s),_=d.x-g.x,v=d.y-g.y,S=d.z-g.z,I=Math.sqrt(_*_+v*v+S*S),E=this.scaleZoom(this.cameraToCenterDistance/I/this.tileSize);this._elevation=s,this._center=n,this.zoom=E}setLocationAtPoint(t,n){const s=this.pointCoordinate(n),l=this.pointCoordinate(this.centerPoint),d=this.locationCoordinate(t),g=new c.U(d.x-(s.x-l.x),d.y-(s.y-l.y));this.center=this.coordinateLocation(g),this._renderWorldCopies&&
1(this.center=this.center.wrap())}locationPoint(t,n){return n?this.coordinatePoint(this.locationCoordinate(t),n.getElevationForLngLatZoom(t,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(t))}pointLocation(t,n){return this.coordinateLocation(this.pointCoordinate(t,n))}locationCoordinate(t){return c.U.fromLngLat(t)}coordinateLocation(t){return t&&t.toLngLat()}pointCoordinate(t,n){if(n){const D=n.pointCoordinate(t);if(null!=D)return D}const s=[t.x,t.y,0,1],l=[t.x,t.y,1,1];c.ag(s,s,this.pixelMatrixInverse),c.ag(l,l,this.pixelMatrixInverse);const d=s[3],g=l[3],_=s[1]/d,v=l[1]/g,S=s[2]/d,I=l[2]/g,E=S===I?0:(0-S)/(I-S);return new c.U(c.B.number(s[0]/d,l[0]/g,E)/this.worldSize,c.B.number(_,v,E)/this.worldSize)}coordinatePoint(t,n=0,s=this.pixelMatrix){const l=[t.x*this.worldSize,t.y*this.worldSize,n,1];return c.ag(l,l,s),new c.P(l[0]/l[3],l[1]/l[3])}getBounds(){const t=Math.max(0,this.height/2-this.getHorizon());return(new Ke).extend(this.pointLocation(new c.P(0,t))).extend(this.pointLocation(new c.P(this.width,t))).extend(this.pointLocation(new c.P(this.width,this.height))).extend(this.pointLocation(new c.P(0,this.height)))}getMaxBounds(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new Ke([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(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(t,n=!1){const s=t.key,l=n?this._alignedPosMatrixCache:this._posMatrixCache;if(l[s])return l[s];const d=t.canonical,g=this.worldSize/this.zoomScale(d.z),_=d.x+Math.pow(2,d.z)*t.wrap,v=c.ao(new Float64Array(16));return c.$(v,v,[_*g,d.y*g,0]),c.a0(v,v,[g/c.N,g/c.N,1]),c.a1(v,n?this.alignedProjMatrix:this.projMatrix,v),l[s]=new Float32Array(v),l[s]}customLayerMatrix(){return this.mercatorMatrix.slice()}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let t,n,s,l,d=-90,g=90,_=-180,v=180;const S=this.size,I=this._unmodified;if(this.latRange){const V=this.latRange;d=c.H(V[1])*this.worldSize,g=c.H(V[0])*this.worldSize,t=g-d<S.y?S.y/(g-d):0}if(this.lngRange){const V=this.lngRange;_=c.b5(c.G(V[0])*this.worldSize,0,this.worldSize),v=c.b5(c.G(V[1])*this.worldSize,0,this.worldSize),v<_&&(v+=this.worldSize),n=v-_<S.x?S.x/(v-_):0}const E=this.point,D=Math.max(n||0,t||0);if(D)return this.center=this.unproject(new c.P(n?(v+_)/2:E.x,t?(g+d)/2:E.y)),this.zoom+=this.scaleZoom(D),this._unmodified=I,void(this._constraining=!1);if(this.latRange){const V=E.y,U=S.y/2;V-U<d&&(l=d+U),V+U>g&&(l=g-U)}if(this.lngRange){const V=(_+v)/2,U=c.b5(E.x,V-this.worldSize/2,V+this.worldSize/2),$=S.x/2;U-$<_&&(s=_+$),U+$>v&&(s=v-$)}void 0===s&&void 0===l||(this.center=this.unproject(new c.P(void 0!==s?s:E.x,void 0!==l?l:E.y)).wrap()),this._unmodified=I,this._constraining=!1}_calcMatrices(){if(!this.height)return;const t=this.centerOffset,n=this.point.x,s=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=c.b7(1,this.center.lat)*this.worldSize;let l=c.ao(new Float64Array(16));c.a0(l,l,[this.width/2,-this.height/2,1]),c.$(l,l,[1,-1,0]),this.labelPlaneMatrix=l,l=c.ao(new Float64Array(16)),c.a0(l,l,[1,-1,1]),c.$(l,l,[-1,-1,0]),c.a0(l,l,[2/this.width,2/this.height,1]),this.glCoordMatrix=l;const d=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),g=Math.min(this.elevation,this._minEleveationForCurrentTile),_=d-g*this._pixelPerMeter/Math.cos(this._pitch),v=g<0?_:d,S=Math.PI/2+this._pitch,I=this._fov*(.5+t.y/this.height),E=Math.sin(I)*v/Math.sin(c.ad(Math.PI-S-I,.01,Math.PI-.01)),D=this.getHorizon(),V=2*Math.atan(D/this.cameraToCenterDistance)*(.5+t.y/(2*D)
1),U=Math.sin(V)*v/Math.sin(c.ad(Math.PI-S-V,.01,Math.PI-.01)),$=Math.min(E,U),B=1.01*(Math.cos(Math.PI/2-this._pitch)*$+v),oe=this.height/50;l=new Float64Array(16),c.b8(l,this._fov,this.width/this.height,oe,B),l[8]=2*-t.x/this.width,l[9]=2*t.y/this.height,c.a0(l,l,[1,-1,1]),c.$(l,l,[0,0,-this.cameraToCenterDistance]),c.b9(l,l,this._pitch),c.ae(l,l,this.angle),c.$(l,l,[-n,-s,0]),this.mercatorMatrix=c.a0([],l,[this.worldSize,this.worldSize,this.worldSize]),c.a0(l,l,[1,1,this._pixelPerMeter]),this.pixelMatrix=c.a1(new Float64Array(16),this.labelPlaneMatrix,l),c.$(l,l,[0,0,-this.elevation]),this.projMatrix=l,this.invProjMatrix=c.as([],l),this.pixelMatrix3D=c.a1(new Float64Array(16),this.labelPlaneMatrix,l);const fe=this.width%2/2,K=this.height%2/2,ae=Math.cos(this.angle),ve=Math.sin(this.angle),xe=n-Math.round(n)+ae*fe+ve*K,Re=s-Math.round(s)+ae*K+ve*fe,Xe=new Float64Array(l);if(c.$(Xe,Xe,[xe>.5?xe-1:xe,Re>.5?Re-1:Re,0]),this.alignedProjMatrix=Xe,l=c.as(new Float64Array(16),this.pixelMatrix),!l)throw new Error("failed to invert matrix");this.pixelMatrixInverse=l,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const t=this.pointCoordinate(new c.P(0,0)),n=[t.x*this.worldSize,t.y*this.worldSize,0,1];return c.ag(n,n,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new c.P(0,t))}getCameraQueryGeometry(t){const n=this.getCameraPoint();if(1===t.length)return[t[0],n];{let s=n.x,l=n.y,d=n.x,g=n.y;for(const _ of t)s=Math.min(s,_.x),l=Math.min(l,_.y),d=Math.max(d,_.x),g=Math.max(g,_.y);return[new c.P(s,l),new c.P(d,l),new c.P(d,g),new c.P(s,g),new c.P(s,l)]}}}function ue(u,t){let n,s=!1,l=null,d=null;const g=()=>{l=null,s&&(u.apply(d,n),l=setTimeout(g,t),s=!1)};return(..._)=>(s=!0,d=this,n=_,l||g(),l)}class we{constructor(t){this._getCurrentHash=()=>{const n=window.location.hash.replace("#","");if(this._hashName){let s;return n.split("&").map(l=>l.split("=")).forEach(l=>{l[0]===this._hashName&&(s=l)}),(s&&s[1]||"").split("/")}return n.split("/")},this._onHashChange=()=>{const n=this._getCurrentHash();if(n.length>=3&&!n.some(s=>isNaN(s))){const s=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(n[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+n[2],+n[1]],zoom:+n[0],bearing:s,pitch:+(n[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const n=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,n)}catch{}},this._updateHash=ue(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(t){const n=this._map.getCenter(),s=Math.round(100*this._map.getZoom())/100,l=Math.ceil((s*Math.LN2+Math.log(512/360/.5))/Math.LN10),d=Math.pow(10,l),g=Math.round(n.lng*d)/d,_=Math.round(n.lat*d)/d,v=this._map.getBearing(),S=this._map.getPitch();let I="";if(I+=t?`/${g}/${_}/${s}`:`${s}/${_}/${g}`,(v||S)&&(I+="/"+Math.round(10*v)/10),S&&(I+=`/${Math.round(S)}`),this._hashName){const E=this._hashName;let D=!1;const V=window.location.hash.slice(1).split("&").map(U=>{const $=U.split("=")[0];return $===E?(D=!0,`${$}=${I}`):U}).filter(U=>U);return D||V.push(`${E}=${I}`),`#${V.join("&")}`}return`#${I}`}}const ct={linearity:.3,easing:c.ba(0,0,.3,1)},Vt=c.e({deceleration:2500,maxSpeed:1400},ct),Ui=c.e({deceleration:20,maxSpeed:1400},ct),yi=c.e({deceleration:1e3,maxSpeed:360},ct),Yi=c.e({deceleration:1e3,maxSpeed:90},ct);class nr{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:c.h.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,n=c.h.now();for(;t.length>0&&n-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const n={zoom:0,bearing:0,pitch:0,pan:new c.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:d}of this._inertiaBuffer)n.zoom+=d.zoomDelta||0,n.bearing+=d.bearingDelta||0,n.pitch+=d.pitchDelta||0,d.panDelta&&n.pan._add(d.panDelta),d.around&&(n.around=d.around),d.pinchAround&&(n.pinchAround=d.pinchAround);const s=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,l={};if(n.pan.mag()){const d=Qi(n.pan.mag(),s,c.e({},Vt,t||{}));l.offset=n.pan.mult(d.amount/n.pan.mag()),l.center=this._map.transform.center,ar(l,d)}if(n.zoom){const d=Qi(n.zoom,s,Ui);l.zoom=this._map.transform.zoom+d.amount,ar(l,d)}if(n.bearing){const d=Qi(n.bearing,s,yi);
vendor: 13,927 bytes, line 1
1l.bearing=this._map.transform.bearing+c.ad(d.amount,-179,179),ar(l,d)}if(n.pitch){const d=Qi(n.pitch,s,Yi);l.pitch=this._map.transform.pitch+d.amount,ar(l,d)}if(l.zoom||l.bearing){const d=void 0===n.pinchAround?n.around:n.pinchAround;l.around=d?this._map.unproject(d):this._map.getCenter()}return this.clear(),c.e(l,{noMoveStart:!0})}}function ar(u,t){(!u.duration||u.duration<t.duration)&&(u.duration=t.duration,u.easing=t.easing)}function Qi(u,t,n){const{maxSpeed:s,linearity:l,deceleration:d}=n,g=c.ad(u*l/(t/1e3),-s,s),_=Math.abs(g)/(d*l);return{easing:n.easing,duration:1e3*_,amount:g*(_/2)}}class Ti extends c.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,s,l={}){const d=pe.mousePos(n.getCanvasContainer(),s),g=n.unproject(d);super(t,c.e({point:d,lngLat:g,originalEvent:s},l)),this._defaultPrevented=!1,this.target=n}}class Qr extends c.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,s){const l="touchend"===t?s.changedTouches:s.touches,d=pe.touchPos(n.getCanvasContainer(),l),g=d.map(v=>n.unproject(v)),_=d.reduce((v,S,I,E)=>v.add(S.div(E.length)),new c.P(0,0));super(t,{points:d,point:_,lngLats:g,lngLat:n.unproject(_),originalEvent:s}),this._defaultPrevented=!1}}class Vn extends c.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,s){super(t,{originalEvent:s}),this._defaultPrevented=!1}}class Ur{constructor(t,n){this._map=t,this._clickTolerance=n.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new Vn(t.type,this._map,t))}mousedown(t,n){return this._mousedownPos=n,this._firePreventable(new Ti(t.type,this._map,t))}mouseup(t){this._map.fire(new Ti(t.type,this._map,t))}click(t,n){this._mousedownPos&&this._mousedownPos.dist(n)>=this._clickTolerance||this._map.fire(new Ti(t.type,this._map,t))}dblclick(t){return this._firePreventable(new Ti(t.type,this._map,t))}mouseover(t){this._map.fire(new Ti(t.type,this._map,t))}mouseout(t){this._map.fire(new Ti(t.type,this._map,t))}touchstart(t){return this._firePreventable(new Qr(t.type,this._map,t))}touchmove(t){this._map.fire(new Qr(t.type,this._map,t))}touchend(t){this._map.fire(new Qr(t.type,this._map,t))}touchcancel(t){this._map.fire(new Qr(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Gn{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new Ti(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ti("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new Ti(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class en{constructor(t){this._map=t}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(t){return this.transform.pointLocation(c.P.convert(t),this._map.terrain)}}class Yo{constructor(t,n){this._map=t,this._tr=new en(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=n.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,n){this.isEnabled()&&t.shiftKey&&0===t.button&&(pe.disableDrag(),this._startPos=this._lastPos=n,this._active=!0)}mousemoveWindow(t,n){if(!this._active)return;const s=n;if(this._lastPos.equals(s)||!this._box&&s.dist(this._startPos)<this._clickTolerance)return;const l=this._startPos;this._lastPos=s,this._box||(this._box=pe.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",t));const d=Math.min(l.x,s.x),g=Math.max(l.x,s.x),_=Math.min(l.y,s.y),v=Math.max(l.y,s.y);pe.setTransform(this._box,`translate(${d}px,${_}px)`),this._box.style.width=g-d+"px",this._box.style.height=v-_+"px"}mouseupWindow(t,n){if(!this._active||0!==t.button)return;const s=this._startPos,l=n;if(this.reset(),pe.suppressClick(),s.x!==l.x||s.y!==l.y)return this._map.fire(new c.k("boxzoomend",{originalEvent:t})),{cameraAnimation:d=>d.fitScreenCoordinates(s,l,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(pe.remove(this._box),this._box=null),pe.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,n){return this._map.fire(new c.k(t,{originalEvent:n}))}}function Pr(u,t){if(u.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${u.length}, points ${t.length}`);const n={};for(let s=0;s<u.length;s++)n[u[s].identifier]=t[s];return n}class ln{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(t,n,s){(this.centroid||s.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=t.timeStamp),s.length===this.numTouches&&(this.centroid=function(l){const d=new c.P(0,0);for(const g of l)d._add(g);return d.div(l.length)}(n),this.touches=Pr(s,n)))}touchmove(t,n,s){if(this.aborted||!this.centroid)return;const l=Pr(s,n);for(const d in this.touches){const g=l[d];(!g||g.dist(this.touches[d])>30)&&(this.aborted=!0)}}touchend(t,n,s){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===s.length){const l=!this.aborted&&this.centroid;if(this.reset(),l)return l}}}class Qo{constructor(t){this.singleTap=new ln(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,n,s){this.singleTap.touchstart(t,n,s)}touchmove(t,n,s){this.singleTap.touchmove(t,n,s)}touchend(t,n,s){const l=this.singleTap.touchend(t,n,s);if(l){const d=t.timeStamp-this.lastTime<500,g=!this.lastTap||this.lastTap.dist(l)<30;if(d&&g||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=l,this.count===this.numTaps)return this.reset(),l}}}class Xn{constructor(t){this._tr=new en(t),this._zoomIn=new Qo({numTouches:1,numTaps:2}),this._zoomOut=new Qo({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,n,s){this._zoomIn.touchstart(t,n,s),this._zoomOut.touchstart(t,n,s)}touchmove(t,n,s){this._zoomIn.touchmove(t,n,s),this._zoomOut.touchmove(t,n,s)}touchend(t,n,s){const l=this._zoomIn.touchend(t,n,s),d=this._zoomOut.touchend(t,n,s),g=this._tr;return l?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:_=>_.easeTo({duration:300,zoom:g.zoom+1,around:g.unproject(l)},{originalEvent:t})}):d?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:_=>_.easeTo({duration:300,zoom:g.zoom-1,around:g.unproject(d)},{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}}class Jn{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){const n=this._moveFunction(...t);if(n.bearingDelta||n.pitchDelta||n.around||n.panDelta)return this._active=!0,n}dragStart(t,n){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=n.length?n[0]:n,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,n){if(!this.isEnabled())return;const s=this._lastPoint;if(!s)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);const l=n.length?n[0]:n;return!this._moved&&l.dist(s)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=l,this._move(s,l))}dragEnd(t){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(t)&&(this._moved&&pe.suppressClick(),this.reset(t))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const Ri={0:1,2:2};class Pi{constructor(t){this._correctEvent=t.checkCorrectEvent}startMove(t){const n=pe.mouseButton(t);this._eventButton=n}endMove(t){delete this._eventButton}isValidStartEvent(t){return this._correctEvent(t)}isValidMoveEvent(t){return!function(n,s){const l=Ri[s];return void 0===n.buttons||(n.buttons&l)!==l}(t,this._eventButton)}isValidEndEvent(t){return pe.mouseButton(t)===this._eventButton}}class es{constructor(){this._firstTouch=void 0}_isOneFingerTouch(t){return 1===t.targetTouches.length}_isSameTouchEvent(t){return t.targetTouches[0].identifier===this._firstTouch}startMove(t){this._firstTouch=t.targetTouches[0].identifier}endMove(t){delete this._firstTouch}isValidStartEvent(t){return this._isOneFingerTouch(t)}isValidMoveEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}isValidEndEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}}const Tn=u=>{u.mousedown=u.dragStart,u.mousemoveWindow=u.dragMove,u.mouseup=u.dragEnd,u.contextmenu=function(t){t.preventDefault()}},co=({enable:u,clickTolerance:t,bearingDegreesPerPixelMoved:n=.8})=>{const s=new Pi({checkCorrectEvent:l=>0===pe.mouseButton(l)&&l.ctrlKey||2===pe.mouseButton(l)});return new Jn({clickTolerance:t,move:(l,d)=>({bearingDelta:(d.x-l.x)*n}),moveStateManager:s,enable:u,assignEvents:Tn})},lr=({enable:u,clickTolerance:t,pitchDegreesPerPixelMoved:n=-.5})=>{const s=new Pi({checkCorrectEvent:l=>0===pe.mouseButton(l)&&l.ctrlKey||2===pe.mouseButton(l)});return new Jn({clickTolerance:t,move:(l,d)=>({pitchDelta:(d.y-l.y)*n}),moveStateManager:s,enable:u,assignEvents:Tn})};class mt{constructor(t,n){this._minTouches=t.cooperativeGestures?2:1,this._clickTolerance=t.clickTolerance||1,this._map=n,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new c.P(0,0),setTimeout(()=>{this._cancelCooperativeMessage=!1},200)}touchstart(t,n,s){return this._calculateTransform(t,n,s)}touchmove(t,n,s){if(this._map._cooperativeGestures&&(2===this._minTouches&&s.length<2&&!this._cancelCooperativeMessage?this._map._onCooperativeGesture(t,!1,s.length):this._cancelCooperativeMessage||(this._cancelCooperativeMessage=!0)),this._active&&!(s.length<this._minTouches))return t.preventDefault(),this._calculateTransform(t,n,s)}touchend(t,n,s){this._calculateTransform(t,n,s),this._active&&s.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,n,s){s.length>0&&(this._active=!0);const l=Pr(s,n),d=new c.P(0,0),g=new c.P(0,0);let _=0;for(const S in l){const I=l[S],E=this._touches[S];E&&(d._add(I),g._add(I.sub(E)),_++,l[S]=I)}if(this._touches=l,_<this._minTouches||!g.mag())return;const v=g.div(_);return this._sum._add(v),this._sum.mag()<this._clickTolerance?void 0:{around:d.div(_),panDelta:v}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Pn{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(t,n,s){this._firstTwoTouches||s.length<2||(this._firstTwoTouches=[s[0].identifier,s[1].identifier],this._start([n[0],n[1]]))}touchmove(t,n,s){if(!this._firstTwoTouches)return;t.preventDefault();const[l,d]=this._firstTwoTouches,g=_n(s,n,l),_=_n(s,n,d);if(!g||!_)return;const v=this._aroundCenter?null:g.add(_).div(2);return this._move([g,_],v,t)}touchend(t,n,s){if(!this._firstTwoTouches)return;const[l,d]=this._firstTwoTouches,g=_n(s,n,l),_=_n(s,n,d);g&&_||(this._active&&pe.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 _n(u,t,n){for(let s=0;s<u.length;s++)if(u[s].identifier===n)return t[s]}function Hn(u,t){return Math.log(u/t)/Math.LN2}class Co extends Pn{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,n){const s=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(Hn(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Hn(this._distance,s),pinchAround:n}}}function st(u,t){return 180*u.angleWith(t)/Math.PI}class Os extends Pn{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,n){const s=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:st(this._vector,s),pinchAround:n}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());const n=25/(Math.PI*this._minDiameter)*360,s=st(t,this._startVector);return Math.abs(s)<n}}function Fo(u){return Math.abs(u.y)>Math.abs(u.x)}class Js extends Pn{constructor(t){super(),this._map=t}
1reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,n,s){super.touchstart(t,n,s),this._currentTouchCount=s.length}_start(t){this._lastPoints=t,Fo(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,n,s){if(this._map._cooperativeGestures&&this._currentTouchCount<3)return;const l=t[0].sub(this._lastPoints[0]),d=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(l,d,s.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(l.y+d.y)/2*-.5}):void 0}gestureBeginsVertically(t,n,s){if(void 0!==this._valid)return this._valid;const l=t.mag()>=2,d=n.mag()>=2;if(!l&&!d)return;if(!l||!d)return void 0===this._firstMove&&(this._firstMove=s),s-this._firstMove<100&&void 0;const g=t.y>0==n.y>0;return Fo(t)&&Fo(n)&&g}}const Bo={panStep:100,bearingStep:15,pitchStep:10};class ts{constructor(t){this._tr=new en(t);const n=Bo;this._panStep=n.panStep,this._bearingStep=n.bearingStep,this._pitchStep=n.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let n=0,s=0,l=0,d=0,g=0;switch(t.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:t.shiftKey?s=-1:(t.preventDefault(),d=-1);break;case 39:t.shiftKey?s=1:(t.preventDefault(),d=1);break;case 38:t.shiftKey?l=1:(t.preventDefault(),g=-1);break;case 40:t.shiftKey?l=-1:(t.preventDefault(),g=1);break;default:return}return this._rotationDisabled&&(s=0,l=0),{cameraAnimation:_=>{const v=this._tr;_.easeTo({duration:300,easeId:"keyboardHandler",easing:Hs,zoom:n?Math.round(v.zoom)+n*(t.shiftKey?2:1):v.zoom,bearing:v.bearing+s*this._bearingStep,pitch:v.pitch+l*this._pitchStep,offset:[-d*this._panStep,-g*this._panStep],center:v.center},{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 Hs(u){return u*(2-u)}const is=4.000244140625;class zs{constructor(t,n){this._onTimeout=s=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(s)},this._map=t,this._tr=new en(t),this._el=t.getCanvasContainer(),this._triggerRenderFrame=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}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(t){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!t[this._map._metaKey])return;t.preventDefault()}let n=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const s=c.h.now(),l=s-(this._lastWheelEventTime||0);this._lastWheelEventTime=s,0!==n&&n%is==0?this._type="wheel":0!==n&&Math.abs(n)<4?this._type="trackpad":l>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(l*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),t.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=t,this._delta-=n,this._active||this._start(t)),t.preventDefault()}_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 n=pe.mousePos(this._el,t),s=this._tr;this._around=c.L.convert(this._aroundCenter?s.center:s.unproject(n)),this._aroundPoint=s.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const t=this._tr.transform;if(0!==this._delta){const _="wheel"===this._type&&Math.abs(this._delta)>is?this._wheelZoomRate:this._defaultZoomRate;let v=2/(1+Math.exp(-Math.abs(this._delta*_)));this._delta<0&&0!==v&&(v=1/v);const S="number"==typeof this._targetZoom?t.zoomScale(this._targetZoom):t.scale;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(S*v))),"wheel"===this._type&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const n="number"==typeof this._targetZoom?this._targetZoom:t.zoom,s=this._startZoom,l=this._easing;let d,g=!1;if("wheel"===this._type&&s&&l){const _=Math.min((c.h.now()-this._lastWheelEventTime)/200,1),v=l(_);d=c.B.number(s,n,v),_<1?this._frameId||(this._frameId=!0):g=!0}else d=n,g=!0;return this._active=!0,g&&(this._active=!1,this._finishTimeout=setTimeout(()=>
vendor: 10,349 bytes, line 1
1{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!g,zoomDelta:d-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let n=c.bb;if(this._prevEase){const s=this._prevEase,l=(c.h.now()-s.start)/s.duration,d=s.easing(l+.01)-s.easing(l),g=.27/Math.sqrt(d*d+1e-4)*.01,_=Math.sqrt(.0729-g*g);n=c.ba(g,_,.25,1)}return this._prevEase={start:c.h.now(),duration:t,easing:n},n}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Aa{constructor(t,n){this._clickZoom=t,this._tapZoom=n}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class ka{constructor(t){this._tr=new en(t),this.reset()}reset(){this._active=!1}dblclick(t,n){return t.preventDefault(),{cameraAnimation:s=>{s.easeTo({duration:300,zoom:this._tr.zoom+(t.shiftKey?-1:1),around:this._tr.unproject(n)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Da{constructor(){this._tap=new Qo({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,n,s){if(!this._swipePoint)if(this._tapTime){const l=n[0],d=t.timeStamp-this._tapTime<500,g=this._tapPoint.dist(l)<30;d&&g?s.length>0&&(this._swipePoint=l,this._swipeTouch=s[0].identifier):this.reset()}else this._tap.touchstart(t,n,s)}touchmove(t,n,s){if(this._tapTime){if(this._swipePoint){if(s[0].identifier!==this._swipeTouch)return;const l=n[0],d=l.y-this._swipePoint.y;return this._swipePoint=l,t.preventDefault(),this._active=!0,{zoomDelta:d/128}}}else this._tap.touchmove(t,n,s)}touchend(t,n,s){if(this._tapTime)this._swipePoint&&0===s.length&&this.reset();else{const l=this._tap.touchend(t,n,s);l&&(this._tapTime=t.timeStamp,this._tapPoint=l)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class La{constructor(t,n,s){this._el=t,this._mousePan=n,this._touchPan=s}enable(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class yn{constructor(t,n,s){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=n,this._mousePitch=s}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 No{constructor(t,n,s,l){this._el=t,this._touchZoom=n,this._touchRotate=s,this._tapDragZoom=l,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("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const Ys=u=>u.zoom||u.drag||u.pitch||u.rotate;class Oa extends c.k{}function Qs(u){return u.panDelta&&u.panDelta.mag()||u.zoomDelta||u.bearingDelta||u.pitchDelta}class za{constructor(t,n){this.handleWindowEvent=l=>{this.handleEvent(l,`${l.type}Window`)},this.handleEvent=(l,d)=>{if("blur"===l.type)return void this.stop(!0);this._updatingCamera=!0;const g="renderFrame"===l.type?void 0:l,_={needsRenderFrame:!1},v={},S={},I=l.touches,E=I?this._getMapTouches(I):void 0,D=E?pe.touchPos(this._el,E):pe.mousePos(this._el,l);for(const{handlerName:$,handler:B,allowed:oe}of this._handlers){if(!B.isEnabled())continue;let fe;this._blockedByActive(S,oe,$)?B.reset():B[d||l.type]&&(fe=B[d||l.type](l,D,E),this.mergeHandlerResult(_,v,fe,$,g),fe&&fe.needsRenderFrame&&this._triggerRenderFrame()),(fe||B.isActive())&&(S[$]=B)}const V={};for(const $ in this._previousActiveHandlers)S[$]||(V[$]=g);this._previousActiveHandlers=S,(Object.keys(V).length||Qs(_))&&(this._changes.push([_,v,V]),this._triggerRenderFrame()),(Object.keys(S).length||Qs(_))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:U}=_;U&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],U(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new nr(t),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n);const s=this._el;this._listeners=[[s,"touchstart",{passive:!0}],[s,"touchmove",{passive:!1}],[s,"touchend",void 0],[s,"touchcancel",void 0],[s,"mousedown",void 0],[s,"mousemove",void 0],[s,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[s,"mouseover",void 0],[s,"mouseout",void 0],[s,"dblclick",void 0],[s,"click",void 0],[s,"keydown",{capture:!1}],[s,"keyup",void 0],[s,"wheel",{passive:!1}],[s,"contextmenu",void 0],[window,"blur",void 0]];for(const[l,d,g]of this._listeners)pe.addEventListener(l,d,l===document?this.handleWindowEvent:this.handleEvent,g)}destroy(){for(const[t,n,s]of this._listeners)pe.removeEventListener(t,n,t===document?this.handleWindowEvent:this.handleEvent,s)}_addDefaultHandlers(t){const n=this._map,s=n.getCanvasContainer();this._add("mapEvent",new Ur(n,t));const l=n.boxZoom=new Yo(n,t);this._add("boxZoom",l),t.interactive&&t.boxZoom&&l.enable();const d=new Xn(n),g=new ka(n);n.doubleClickZoom=new Aa(g,d),this._add("tapZoom",d),this._add("clickZoom",g),t.interactive&&t.doubleClickZoom&&n.doubleClickZoom.enable();const _=new Da;this._add("tapDragZoom",_);const v=n.touchPitch=new Js(n);this._add("touchPitch",v),t.interactive&&t.touchPitch&&n.touchPitch.enable(t.touchPitch);const S=co(t),I=lr(t);n.dragRotate=new yn(t,S,I),this._add("mouseRotate",S,["mousePitch"]),this._add("mousePitch",I,["mouseRotate"]),t.interactive&&t.dragRotate&&n.dragRotate.enable();const E=(({enable:oe,clickTolerance:fe})=>{const K=new Pi({checkCorrectEvent:ae=>0===pe.mouseButton(ae)&&!ae.ctrlKey});return new Jn({clickTolerance:fe,move:(ae,ve)=>({around:ve,panDelta:ve.sub(ae)}),activateOnStart:!0,moveStateManager:K,enable:oe,assignEvents:Tn})})(t),D=new mt(t,n);n.dragPan=new La(s,E,D),this._add("mousePan",E),this._add("touchPan",D,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&n.dragPan.enable(t.dragPan);const V=new Os,U=new Co;n.touchZoomRotate=new No(s,U,V,_),this._add("touchRotate",V,["touchPan","touchZoom"]),this._add("touchZoom",U,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&n.touchZoomRotate.enable(t.touchZoomRotate);const $=n.scrollZoom=new zs(n,()=>this._triggerRenderFrame());this._add("scrollZoom",$,["mousePan"]),t.interactive&&t.scrollZoom&&n.scrollZoom.enable(t.scrollZoom);const B=n.keyboard=new ts(n);this._add("keyboard",B),t.interactive&&t.keyboard&&n.keyboard.enable(),this._add("blockableMapEvent",new Gn(n))}_add(t,n,s){this._handlers.push({handlerName:t,handler:n,allowed:s}),this._handlersById[t]=n}stop(t){if(!this._updatingCamera){for(const{handler:n}of this._handlers)n.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!!Ys(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,n,s){for(const l in t)if(l!==s&&(!n||n.indexOf(l)<0))return!0;return!1}_getMapTouches(t){const n=[];for(const s of t)this._el.contains(s.target)&&n.push(s);return n}mergeHandlerResult(t,n,s,l,d){if(!s)return;c.e(t,s);const g={handlerName:l,originalEvent:s.originalEvent||d};void 0!==s.zoomDelta&&(n.zoom=g),void 0!==s.panDelta&&(n.drag=g),void 0!==s.pitchDelta&&(n.pitch=g),void 0!==s.bearingDelta&&(n.rotate=g)}_applyChanges(){const t={},n={},s={};for(const[l,d,g]of this._changes)l.panDelta&&(t.panDelta=(t.panDelta||new c.P(0,0))._add(l.panDelta)),l.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+l.zoomDelta),l.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+l.bearingDelta),l.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+l.pitchDelta),void 0!==l.around&&(t.around=l.around),void 0!==l.pinchAround&&(t.pinchAround=l.pinchAround),l.noInertia&&(t.noInertia=l.noInertia),c.e(n,d),c.e(s,g);this._updateMapTransform(t,n,s),this._changes=[]}_updateMapTransform(t,n,s){const l=this._map,d=l._getTransformForUpdate(),g=l.terrain;if(!(Qs(t)||g&&this._terrainMovement))return this._fireEvents(n,s,!0);let{panDelta:_,zoomDelta:v,bearingDelta:S,pitchDelta:I,around:E,pinchAround:D}=t;void 0!==D&&(E=D),l._stop(!0),E=E||l.transform.centerPoint;const V=d.pointLocation(_?E.sub(_):E);S&&(d.bearing+=S),I&&(d.pitch+=I),v&&(d.zoom+=v),g?this._terrainMovement||!n.drag&&!n.zoom?n.drag&&this._terrainMovement?d.center=d.pointLocation(d.centerPoint.sub(_)):d.setLocationAtPoint(V,E):(this._terrainMovement=!0,this._map._elevationFreeze=!0,d.setLocationAtPoint(V,E),this._map.once("moveend",()=>{this._map._elevationFreeze=!1,this._terrainMovement=!1,d.recalculateZoom(l.terrain)})):d.setLocationAtPoint(V,E),l._applyUpdatedTransform(d),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(n,s,!0)}
1_fireEvents(t,n,s){const l=Ys(this._eventsInProgress),d=Ys(t),g={};for(const I in t){const{originalEvent:E}=t[I];this._eventsInProgress[I]||(g[`${I}start`]=E),this._eventsInProgress[I]=t[I]}!l&&d&&this._fireEvent("movestart",d.originalEvent);for(const I in g)this._fireEvent(I,g[I]);d&&this._fireEvent("move",d.originalEvent);for(const I in t){const{originalEvent:E}=t[I];this._fireEvent(I,E)}const _={};let v;for(const I in this._eventsInProgress){const{handlerName:E,originalEvent:D}=this._eventsInProgress[I];this._handlersById[E].isActive()||(delete this._eventsInProgress[I],v=n[E]||D,_[`${I}end`]=v)}for(const I in _)this._fireEvent(I,_[I]);const S=Ys(this._eventsInProgress);if(s&&(l||d)&&!S){this._updatingCamera=!0;const I=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),E=D=>0!==D&&-this._bearingSnap<D&&D<this._bearingSnap;!I||!I.essential&&c.h.prefersReducedMotion?(this._map.fire(new c.k("moveend",{originalEvent:v})),E(this._map.getBearing())&&this._map.resetNorth()):(E(I.bearing||this._map.getBearing())&&(I.bearing=0),I.freezeElevation=!0,this._map.easeTo(I,{originalEvent:v})),this._updatingCamera=!1}}_fireEvent(t,n){this._map.fire(new c.k(t,n?{originalEvent:n}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(t=>{delete this._frameId,this.handleEvent(new Oa("renderFrame",{timeStamp:t})),this._applyChanges()})}
vendor: 5,937 bytes, line 1
1_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}class cl extends c.E{constructor(t,n){super(),this._renderFrameCallback=()=>{const s=Math.min((c.h.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(s)),s<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=n.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new c.L(this.transform.center.lng,this.transform.center.lat)}setCenter(t,n){return this.jumpTo({center:t},n)}panBy(t,n,s){return t=c.P.convert(t).mult(-1),this.panTo(this.transform.center,c.e({offset:t},n),s)}panTo(t,n,s){return this.easeTo(c.e({center:t},n),s)}getZoom(){return this.transform.zoom}setZoom(t,n){return this.jumpTo({zoom:t},n),this}zoomTo(t,n,s){return this.easeTo(c.e({zoom:t},n),s)}zoomIn(t,n){return this.zoomTo(this.getZoom()+1,t,n),this}zoomOut(t,n){return this.zoomTo(this.getZoom()-1,t,n),this}getBearing(){return this.transform.bearing}setBearing(t,n){return this.jumpTo({bearing:t},n),this}getPadding(){return this.transform.padding}setPadding(t,n){return this.jumpTo({padding:t},n),this}rotateTo(t,n,s){return this.easeTo(c.e({bearing:t},n),s)}resetNorth(t,n){return this.rotateTo(0,c.e({duration:1e3},t),n),this}resetNorthPitch(t,n){return this.easeTo(c.e({bearing:0,pitch:0,duration:1e3},t),n),this}snapToNorth(t,n){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,n):this}getPitch(){return this.transform.pitch}setPitch(t,n){return this.jumpTo({pitch:t},n),this}cameraForBounds(t,n){t=Ke.convert(t);const s=n&&n.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),s,n)}_cameraForBoxAndBearing(t,n,s,l){const d={top:0,bottom:0,right:0,left:0};if("number"==typeof(l=c.e({padding:d,offset:[0,0],maxZoom:this.transform.maxZoom},l)).padding){const ve=l.padding;l.padding={top:ve,bottom:ve,right:ve,left:ve}}l.padding=c.e(d,l.padding);const g=this.transform,_=g.padding,v=g.project(c.L.convert(t)),S=g.project(c.L.convert(n)),I=v.rotate(-s*Math.PI/180),E=S.rotate(-s*Math.PI/180),D=new c.P(Math.max(I.x,E.x),Math.max(I.y,E.y)),V=new c.P(Math.min(I.x,E.x),Math.min(I.y,E.y)),U=D.sub(V),$=(g.width-(_.left+_.right+l.padding.left+l.padding.right))/U.x,B=(g.height-(_.top+_.bottom+l.padding.top+l.padding.bottom))/U.y;if(B<0||$<0)return void c.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");const oe=Math.min(g.scaleZoom(g.scale*Math.min($,B)),l.maxZoom),fe=c.P.convert(l.offset),K=new c.P((l.padding.left-l.padding.right)/2,(l.padding.top-l.padding.bottom)/2).rotate(s*Math.PI/180),ae=fe.add(K).mult(g.scale/g.zoomScale(oe));return{center:g.unproject(v.add(S).div(2).sub(ae)),zoom:oe,bearing:s}}fitBounds(t,n,s){return this._fitInternal(this.cameraForBounds(t,n),n,s)}fitScreenCoordinates(t,n,s,l,d){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(c.P.convert(t)),this.transform.pointLocation(c.P.convert(n)),s,l),l,d)}_fitInternal(t,n,s){return t?(delete(n=c.e(t,n)).padding,n.linear?this.easeTo(n,s):this.flyTo(n,s)):this}jumpTo(t,n){this.stop();const s=this._getTransformForUpdate();let l=!1,d=!1,g=!1;return"zoom"in t&&s.zoom!==+t.zoom&&(l=!0,s.zoom=+t.zoom),void 0!==t.center&&(s.center=c.L.convert(t.center)),"bearing"in t&&s.bearing!==+t.bearing&&(d=!0,s.bearing=+t.bearing),"pitch"in t&&s.pitch!==+t.pitch&&(g=!0,s.pitch=+t.pitch),null==t.padding||s.isPaddingEqual(t.padding)||(s.padding=t.padding),this._applyUpdatedTransform(s),this.fire(new c.k("movestart",n)).fire(new c.k("move",n)),l&&this.fire(new c.k("zoomstart",n)).fire(new c.k("zoom",n)).fire(new c.k("zoomend",n)),d&&this.fire(new c.k("rotatestart",n)).fire(new c.k("rotate",n)).fire(new c.k("rotateend",n)),g&&this.fire(new c.k("pitchstart",n)).fire(new c.k("pitch",n)).fire(new c.k("pitchend",n)),this.fire(new c.k("moveend",n))}calculateCameraOptionsFromTo(t,n,s,l=0){const d=c.U.fromLngLat(t,n),g=c.U.fromLngLat(s,l),_=g.x-d.x,v=g.y-d.y,S=g.z-d.z,I=Math.hypot(_,v,S);if(0===I)throw new Error("Can't calculate camera options with same From and To");const E=Math.hypot(_,v),D=this.transform.scaleZoom(this.transform.cameraToCenterDistance/I/this.transform.tileSize),V=180*Math.atan2(_,-v)/Math.PI;let U=180*Math.acos(E/I)/Math.PI;return U=S<0?90-U:90+U,{center:g.toLngLat(),zoom:D,pitch:U,bearing:V}}easeTo(t,n){this._stop(!1,t.easeId),(!1===(t=c.e({offset:[0,0],duration:500,easing:c.bb},t)).animate||!t.essential&&c.h.prefersReducedMotion)&&(t.duration=0);const s=this._getTransformForUpdate(),l=this.getZoom(),d=this.getBearing(),g=this.getPitch(),_=this.getPadding(),v="zoom"in t?+t.zoom:l,S="bearing"in t?this._normalizeBearing(t.bearing,d):d,I="pitch"in t?+t.pitch:g,E="padding"in t?t.padding:s.padding,D=c.P.convert(t.offset);let V=s.centerPoint.add(D);const U=s.pointLocation(V),$=c.L.convert(t.center||U);this._normalizeCenter($);const B=s.project(U),oe=s.project($).sub(B),fe=s.zoomScale(v-l);let K,ae;t.around&&(K=c.L.convert(t.around),ae=s.locationPoint(K));const ve={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||v!==l,this._rotating=this._rotating||d!==S,this._pitching=this._pitching||I!==g,this._padding=!s.isPaddingEqual(E),this._easeId=t.easeId,this._prepareEase(n,t.noMoveStart,ve),this.terrain&&this._prepareElevation($),this._ease(xe=>{if(this._zooming&&(s.zoom=c.B.number(l,v,xe)),this._rotating&&(s.bearing=c.B.number(d,S,xe)),this._pitching&&(s.pitch=c.B.number(g,I,xe)),this._padding&&(s.interpolatePadding(_,E,xe),V=s.centerPoint.add(D)),this.terrain&&!t.freezeElevation&&this._updateElevation(xe),K)s.setLocationAtPoint(K,ae);else{const Re=s.zoomScale(s.zoom-l),Xe=v>l?Math.min(2,fe):Math.max(.5,fe),Ge=Math.pow(Xe,1-xe),rt=s.unproject(B.add(oe.mult(xe*Ge)).mult(Re));
1s.setLocationAtPoint(s.renderWorldCopies?rt.wrap():rt,V)}this._applyUpdatedTransform(s),this._fireMoveEvents(n)},xe=>{this.terrain&&this._finalizeElevation(),this._afterEase(n,xe)},t),this}_prepareEase(t,n,s={}){this._moving=!0,n||s.moving||this.fire(new c.k("movestart",t)),this._zooming&&!s.zooming&&this.fire(new c.k("zoomstart",t)),this._rotating&&!s.rotating&&this.fire(new c.k("rotatestart",t)),this._pitching&&!s.pitching&&this.fire(new c.k("pitchstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(t,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(t){this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const n=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&n!==this._elevationTarget){const s=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(s-(n-(s*t+this._elevationStart))/(1-t)),this._elevationTarget=n}this.transform.elevation=c.B.number(this._elevationStart,this._elevationTarget,t)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_applyUpdatedTransform(t){if(!this.transformCameraUpdate)return;const n=t.clone(),{center:s,zoom:l,pitch:d,bearing:g,elevation:_}=this.transformCameraUpdate(n);s&&(n.center=s),void 0!==l&&(n.zoom=l),void 0!==d&&(n.pitch=d),void 0!==g&&(n.bearing=g),void 0!==_&&(n.elevation=_),this.transform.apply(n)}_fireMoveEvents(t){this.fire(new c.k("move",t)),this._zooming&&this.fire(new c.k("zoom",t)),this._rotating&&this.fire(new c.k("rotate",t)),this._pitching&&this.fire(new c.k("pitch",t))}_afterEase(t,n){if(this._easeId&&n&&this._easeId===n)return;delete this._easeId;const s=this._zooming,l=this._rotating,d=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,s&&this.fire(new c.k("zoomend",t)),l&&this.fire(new c.k("rotateend",t)),d&&this.fire(new c.k("pitchend",t)),this.fire(new c.k("moveend",t))}flyTo(t,n){if(!t.essential&&c.h.prefersReducedMotion){const kt=c.F(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(kt,n)}this.stop(),t=c.e({offset:[0,0],speed:1.2,curve:1.42,easing:c.bb},t);const s=this._getTransformForUpdate(),l=this.getZoom(),d=this.getBearing(),g=this.getPitch(),_=this.getPadding(),v="zoom"in t?c.ad(+t.zoom,s.minZoom,s.maxZoom):l,S="bearing"in t?this._normalizeBearing(t.bearing,d):d,I="pitch"in t?+t.pitch:g,E="padding"in t?t.padding:s.padding,D=s.zoomScale(v-l),V=c.P.convert(t.offset);let U=s.centerPoint.add(V);const $=s.pointLocation(U),B=c.L.convert(t.center||$);this._normalizeCenter(B);const oe=s.project($),fe=s.project(B).sub(oe);let K=t.curve;const ae=Math.max(s.width,s.height),ve=ae/D,xe=fe.mag();if("minZoom"in t){const kt=c.ad(Math.min(t.minZoom,l,v),s.minZoom,s.maxZoom),Li=ae/s.zoomScale(kt-l);K=Math.sqrt(Li/xe*2)}const Re=K*K;function Xe(kt){const Li=(ve*ve-ae*ae+(kt?-1:1)*Re*Re*xe*xe)/(2*(kt?ve:ae)*Re*xe);return Math.log(Math.sqrt(Li*Li+1)-Li)}function Ge(kt){return(Math.exp(kt)-Math.exp(-kt))/2}function rt(kt){return(Math.exp(kt)+Math.exp(-kt))/2}const Et=Xe(!1);let gi=function(kt){return rt(Et)/rt(Et+K*kt)},dt=function(kt){return ae*((rt(Et)*(Ge(Li=Et+K*kt)/rt(Li))-Ge(Et))/Re)/xe;var Li},qt=(Xe(!0)-Et)/K;if(Math.abs(xe)<1e-6||!isFinite(qt)){if(Math.abs(ae-ve)<1e-6)return this.easeTo(t,n);const kt=ve<ae?-1:1;qt=Math.abs(Math.log(ve/ae))/K,dt=function(){return 0},gi=function(Li){return Math.exp(kt*K*Li)}}return t.duration="duration"in t?+t.duration:1e3*qt/("screenSpeed"in t?+t.screenSpeed/K:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=d!==S,this._pitching=I!==g,this._padding=!s.isPaddingEqual(E),this._prepareEase(n,!1),this.terrain&&this._prepareElevation(B),this._ease(kt=>{const Li=kt*qt,pi=1/gi(Li);s.zoom=1===kt?v:l+s.scaleZoom(pi),this._rotating&&(s.bearing=c.B.number(d,S,kt)),this._pitching&&(s.pitch=c.B.number(g,I,kt)),this._padding&&(s.interpolatePadding(_,E,kt),U=s.centerPoint.add(V)),this.terrain&&!t.freezeElevation&&this._updateElevation(kt);
1const ai=1===kt?B:s.unproject(oe.add(fe.mult(dt(Li))).mult(pi));s.setLocationAtPoint(s.renderWorldCopies?ai.wrap():ai,U),this._applyUpdatedTransform(s),this._fireMoveEvents(n)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(n)},t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,n){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const s=this._onEaseEnd;delete this._onEaseEnd,s.call(this,n)}if(!t){const s=this.handlers;s&&s.stop(!1)}return this}_ease(t,n,s){!1===s.animate||0===s.duration?(t(1),n()):(this._easeStart=c.h.now(),this._easeOptions=s,this._onEaseFrame=t,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,n){t=c.b5(t,-180,180);const s=Math.abs(t-n);return Math.abs(t-360-n)<s&&(t-=360),Math.abs(t+360-n)<s&&(t+=360),t}_normalizeCenter(t){const n=this.transform;if(!n.renderWorldCopies||n.lngRange)return;const s=t.lng-n.center.lng;t.lng+=s>180?-360:s<-180?360:0}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLatZoom(c.L.convert(t),this.transform.tileZoom)-this.transform.elevation:null}}class An{constructor(t={}){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=n=>{!n||"metadata"!==n.sourceDataType&&"visibility"!==n.sourceDataType&&"style"!==n.dataType&&"terrain"!==n.type||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options&&this.options.compact,this._container=pe.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=pe.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=pe.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){pe.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(t,n){const s=this._map._getUIString(`AttributionControl.${n}`);t.title=s,t.setAttribute("aria-label",s)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(l=>"string"!=typeof l?"":l)):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){const l=this._map.style.stylesheet;this.styleOwner=l.owner,this.styleId=l.id}const n=this._map.style.sourceCaches;for(const l in n){const d=n[l];if(d.used||d.usedForTerrain){const g=d.getSource();g.attribution&&t.indexOf(g.attribution)<0&&t.push(g.attribution)}}t=t.filter(l=>String(l).trim()),t.sort((l,d)=>l.length-d.length),t=t.filter((l,d)=>{for(let g=d+1;g<t.length;g++)if(t[g].indexOf(l)>=0)return!1;return!0});const s=t.join(" | ");s!==this._attribHTML&&(this._attribHTML=s,t.length?(this._innerContainer.innerHTML=s,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Ki{constructor(t={}){this._updateCompact=()=>{const n=this._container.children;if(n.length){const s=n[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&s.classList.add("maplibregl-compact"):s.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=pe.create("div","maplibregl-ctrl");const n=pe.create("a","maplibregl-ctrl-logo");return n.target="_blank",n.rel="noopener nofollow",n.href="https://maplibre.org/",n.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),n.setAttribute("rel","noopener nofollow"),this._container.appendChild(n),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){pe.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class fa{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const n=++this._id;return this._queue.push({callback:t,id:n,cancelled:!1}),n}remove(t){const n=this._currentlyRunning,s=n?this._queue.concat(n):this._queue;
vendor: 19,124 bytes, line 1
1for(const l of s)if(l.id===t)return void(l.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const n=this._currentlyRunning=this._queue;this._queue=[];for(const s of n)if(!s.cancelled&&(s.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}const Ra={"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","TerrainControl.enableTerrain":"Enable terrain","TerrainControl.disableTerrain":"Disable terrain"};var ul=c.Q([{name:"a_pos3d",type:"Int16",components:3}]);class hl extends c.E{constructor(t){super(),this.sourceCache=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,t.usedForTerrain=!0,t.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(t,n){this.sourceCache.update(t,n),this._renderableTilesKeys=[];const s={};for(const l of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:n}))s[l.key]=!0,this._renderableTilesKeys.push(l.key),this._tiles[l.key]||(l.posMatrix=new Float64Array(16),c.aS(l.posMatrix,0,c.N,0,c.N,0,1),this._tiles[l.key]=new Sr(l,this.tileSize));for(const l in this._tiles)s[l]||delete this._tiles[l]}freeRtt(t){for(const n in this._tiles){const s=this._tiles[n];(!t||s.tileID.equals(t)||s.tileID.isChildOf(t)||t.isChildOf(s.tileID))&&(s.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(t=>this.getTileByID(t))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t){const n={};for(const s of this._renderableTilesKeys){const l=this._tiles[s].tileID;if(l.canonical.equals(t.canonical)){const d=t.clone();d.posMatrix=new Float64Array(16),c.aS(d.posMatrix,0,c.N,0,c.N,0,1),n[s]=d}else if(l.canonical.isChildOf(t.canonical)){const d=t.clone();d.posMatrix=new Float64Array(16);const g=l.canonical.z-t.canonical.z,_=l.canonical.x-(l.canonical.x>>g<<g),v=l.canonical.y-(l.canonical.y>>g<<g),S=c.N>>g;c.aS(d.posMatrix,0,S,0,S,0,1),c.$(d.posMatrix,d.posMatrix,[-_*S,-v*S,0]),n[s]=d}else if(t.canonical.isChildOf(l.canonical)){const d=t.clone();d.posMatrix=new Float64Array(16);const g=t.canonical.z-l.canonical.z,_=t.canonical.x-(t.canonical.x>>g<<g),v=t.canonical.y-(t.canonical.y>>g<<g),S=c.N>>g;c.aS(d.posMatrix,0,c.N,0,c.N,0,1),c.$(d.posMatrix,d.posMatrix,[_*S,v*S,0]),c.a0(d.posMatrix,d.posMatrix,[1/2**g,1/2**g,0]),n[s]=d}}return n}getSourceTile(t,n){const s=this.sourceCache._source;let l=t.overscaledZ-this.deltaZoom;if(l>s.maxzoom&&(l=s.maxzoom),l<s.minzoom)return null;this._sourceTileCache[t.key]||(this._sourceTileCache[t.key]=t.scaledTo(l).key);let d=this.sourceCache.getTileByID(this._sourceTileCache[t.key]);if((!d||!d.dem)&&n)for(;l>=s.minzoom&&(!d||!d.dem);)d=this.sourceCache.getTileByID(t.scaledTo(l--).key);return d}tilesAfterTime(t=Date.now()){return Object.values(this._tiles).filter(n=>n.timeAdded>=t)}}class dl{constructor(t,n,s){this.painter=t,this.sourceCache=new hl(n),this.options=s,this.exaggeration="number"==typeof s.exaggeration?s.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,n,s,l=c.N){var d;if(!(n>=0&&n<l&&s>=0&&s<l))return 0;const g=this.getTerrainData(t),_=null===(d=g.tile)||void 0===d?void 0:d.dem;if(!_)return 0;const v=((U=[])[0]=(B=g.u_terrain_matrix)[0]*(oe=($=[n/l*c.N,s/l*c.N])[0])+B[4]*(fe=$[1])+B[12],U[1]=B[1]*oe+B[5]*fe+B[13],U),S=[v[0]*_.dim,v[1]*_.dim],I=Math.floor(S[0]),E=Math.floor(S[1]),D=S[0]-I,V=S[1]-E;var U,$,B,oe,fe;return _.get(I,E)*(1-D)*(1-V)+_.get(I+1,E)*D*(1-V)+_.get(I,E+1)*(1-D)*V+_.get(I+1,E+1)*D*V}getElevationForLngLatZoom(t,n){const{tileID:s,mercatorX:l,mercatorY:d}=this._getOverscaledTileIDFromLngLatZoom(t,n);return this.getElevation(s,l%c.N,d%c.N,c.N)}getElevation(t,n,s,l=c.N){return this.getDEMElevation(t,n,s,l)*this.exaggeration}getTerrainData(t){if(!this._emptyDemTexture){const l=this.painter.context,d=new c.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new Ve(l,d,l.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new Ve(l,new c.R({width:1,height:1}),l.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(l.gl.NEAREST,l.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=c.ao([])}const n=this.sourceCache.getSourceTile(t,!0);if(n&&n.dem&&(!n.demTexture||n.needsTerrainPrepare)){const l=this.painter.context;n.demTexture=this.painter.getTileTexture(n.dem.stride),n.demTexture?n.demTexture.update(n.dem.getPixels(),{premultiply:!1}):n.demTexture=new Ve(l,n.dem.getPixels(),l.gl.RGBA,{premultiply:!1}),n.demTexture.bind(l.gl.NEAREST,l.gl.CLAMP_TO_EDGE),n.needsTerrainPrepare=!1}const s=n&&n+n.tileID.key+t.key;if(s&&!this._demMatrixCache[s]){const l=this.sourceCache.sourceCache._source.maxzoom;let d=t.canonical.z-n.tileID.canonical.z;t.overscaledZ>t.canonical.z&&(t.canonical.z>=l?d=t.canonical.z-l:c.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const g=t.canonical.x-(t.canonical.x>>d<<d),_=t.canonical.y-(t.canonical.y>>d<<d),v=c.bc(new Float64Array(16),[1/(c.N<<d),1/(c.N<<d),0]);c.$(v,v,[g*c.N,_*c.N,0]),this._demMatrixCache[t.key]={matrix:v,coord:t}}return{u_depth:2,u_terrain:3,u_terrain_dim:n&&n.dem&&n.dem.dim||1,u_terrain_matrix:s?this._demMatrixCache[t.key].matrix:this._emptyDemMatrix,u_terrain_unpack:n&&n.dem&&n.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(n&&n.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:n}}getFramebuffer(t){const n=this.painter,s=n.width/devicePixelRatio,l=n.height/devicePixelRatio;return!this._fbo||this._fbo.width===s&&this._fbo.height===l||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new Ve(n.context,{width:s,height:l,data:null},n.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(n.context.gl.NEAREST,n.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new Ve(n.context,{width:s,height:l,data:null},n.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(n.context.gl.NEAREST,n.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=n.context.createFramebuffer(s,l,!0,!1),this._fbo.depthAttachment.set(n.context.createRenderbuffer(n.context.gl.DEPTH_COMPONENT16,s,l))),this._fbo.colorAttachment.set("coords"===t?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const t=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const n=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let d=0,g=0;d<this._coordsTextureSize;d++)for(let _=0;_<this._coordsTextureSize;_++,g+=4)n[g+0]=255&_,n[g+1]=255&d,n[g+2]=_>>8<<4|d>>8,n[g+3]=0;const s=new c.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(n.buffer)),l=new Ve(t,s,t.gl.RGBA,{premultiply:!1});return l.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=l,l}pointCoordinate(t){const n=new Uint8Array(4),s=this.painter.context,l=s.gl;s.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),l.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,l.RGBA,l.UNSIGNED_BYTE,n),s.bindFramebuffer.set(null);const d=n[0]+(n[2]>>4<<8),g=n[1]+((15&n[2])<<8),_=this.coordsIndex[255-n[3]],v=_&&this.sourceCache.getTileByID(_);if(!v)return null;const S=this._coordsTextureSize,I=(1<<v.tileID.canonical.z)*S;return new c.U(this._allowMercatorOverflow(t,(v.tileID.canonical.x*S+d)/I),(v.tileID.canonical.y*S+g)/I,this.getElevation(v.tileID,d,g,S))}getTerrainMesh(){if(this._mesh)return this._mesh;const t=this.painter.context,n=new c.bd,s=new c.b0,l=this.meshSize,d=c.N/l,g=l*l;for(let E=0;E<=l;E++)for(let D=0;D<=l;D++)n.emplaceBack(D*d,E*d,0);for(let E=0;E<g;E+=l+1)for(let D=0;D<l;D++)s.emplaceBack(D+E,l+D+E+1,l+D+E+2),s.emplaceBack(D+E,l+D+E+2,D+E+1);const _=n.length,v=_+2*(l+1);for(const E of[0,1])for(let D=0;D<=l;D++)for(const V of[0,1])n.emplaceBack(D*d,E*c.N,V);for(let E=0;E<2*l;E+=2)s.emplaceBack(v+E,v+E+1,v+E+3),s.emplaceBack(v+E,v+E+3,v+E+2),s.emplaceBack(_+E,_+E+3,_+E+1),s.emplaceBack(_+E,_+E+2,_+E+3);const S=n.length,I=S+2*(l+1);for(const E of[0,1])for(let D=0;D<=l;D++)for(const V of[0,1])n.emplaceBack(E*c.N,D*d,V);for(let E=0;E<2*l;E+=2)s.emplaceBack(S+E,S+E+1,S+E+3),s.emplaceBack(S+E,S+E+3,S+E+2),s.emplaceBack(I+E,I+E+3,I+E+1),s.emplaceBack(I+E,I+E+2,I+E+3);return this._mesh={indexBuffer:t.createIndexBuffer(s),vertexBuffer:t.createVertexBuffer(n,ul.members),segments:c.S.simpleSegment(0,0,n.length,s.length)},this._mesh}getMeshFrameDelta(t){return 2*Math.PI*c.be/Math.pow(2,t)/5}getMinTileElevationForLngLatZoom(t,n){var s;const{tileID:l}=this._getOverscaledTileIDFromLngLatZoom(t,n);return null!==(s=this.getMinMaxElevation(l).minElevation)&&void 0!==s?s:0}getMinMaxElevation(t){const n=this.getTerrainData(t).tile,s={minElevation:null,maxElevation:null};return n&&n.dem&&(s.minElevation=n.dem.min*this.exaggeration,s.maxElevation=n.dem.max*this.exaggeration),s}_getOverscaledTileIDFromLngLatZoom(t,n){const s=c.U.fromLngLat(t.wrap()),l=(1<<n)*c.N,d=s.x*l,g=s.y*l,_=Math.floor(d/c.N),v=Math.floor(g/c.N);return{tileID:new c.O(n,0,n,_,v),mercatorX:d,mercatorY:g}}_allowMercatorOverflow(t,n){const s=t.x<this.painter.width/2;let l=c.bf(n);const d=this.painter.transform.center.lng;return s&&Math.sign(l)>0&&Math.sign(d)<0||!s&&Math.sign(l)<0&&Math.sign(d)>0?(l=360*Math.sign(d)+l,c.G(l)):n}}class Fl{constructor(t,n,s){this._context=t,this._size=n,this._tileSize=s,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const t of this._objects)t.texture.destroy(),t.fbo.destroy()}_createObject(t){const n=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),s=new Ve(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return s.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),n.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),n.colorAttachment.set(s.texture),{id:t,fbo:n,texture:s,stamp:-1,inUse:!1}}getObjectForId(t){return this._objects[t]}useObject(t){t.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(n=>t.id!==n),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(const n of this._recentlyUsed)if(!this._objects[n].inUse)return this._objects[n];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(const t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length<this._size)&&!1===this._objects.some(t=>!t.inUse)}}const cn={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class ga{constructor(t,n){this.painter=t,this.terrain=n,this.pool=new Fl(t.context,30,n.sourceCache.tileSize*n.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,n){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=t._order.filter(s=>!t._layers[s].isHidden(n)),this._coordsDescendingInv={};for(const s in t.sourceCaches){this._coordsDescendingInv[s]={};const l=t.sourceCaches[s].getVisibleCoordinates();for(const d of l){const g=this.terrain.sourceCache.getTerrainCoords(d);for(const _ in g)this._coordsDescendingInv[s][_]||(this._coordsDescendingInv[s][_]=[]),this._coordsDescendingInv[s][_].push(g[_])}}this._coordsDescendingInvStr={};for(const s of t._order){const l=t._layers[s],d=l.source;if(cn[l.type]&&!this._coordsDescendingInvStr[d]){this._coordsDescendingInvStr[d]={};for(const g in this._coordsDescendingInv[d])this._coordsDescendingInvStr[d][g]=this._coordsDescendingInv[d][g].map(_=>_.key).sort().join()}}for(const s of this._renderableTiles)for(const l in this._coordsDescendingInvStr){const d=this._coordsDescendingInvStr[l][s.tileID.key];d&&d!==s.rttCoords[l]&&(s.rtt=[])}}renderLayer(t){if(t.isHidden(this.painter.transform.zoom))return!1;const n=t.type,s=this.painter,l=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(cn[n]&&(this._prevType&&cn[this._prevType]||this._stacks.push([]),this._prevType=n,this._stacks[this._stacks.length-1].push(t.id),!l))return!0;if(cn[this._prevType]||cn[n]&&l){this._prevType=n;const d=this._stacks.length-1,g=this._stacks[d]||[];for(const _ of this._renderableTiles){if(this.pool.isFull()&&(qi(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(_),_.rtt[d]){const S=this.pool.getObjectForId(_.rtt[d].id);if(S.stamp===_.rtt[d].stamp){this.pool.useObject(S);continue}}const v=this.pool.getOrCreateFreeObject();this.pool.useObject(v),this.pool.stampObject(v),_.rtt[d]={id:v.id,stamp:v.stamp},s.context.bindFramebuffer.set(v.fbo.framebuffer),s.context.clear({color:c.aT.transparent,stencil:0}),s.currentStencilSource=void 0;for(let S=0;S<g.length;S++){const I=s.style._layers[g[S]],E=I.source?this._coordsDescendingInv[I.source][_.tileID.key]:[_.tileID];s.context.viewport.set([0,0,v.fbo.width,v.fbo.height]),s._renderTileClippingMasks(I,E),s.renderLayer(s,s.style.sourceCaches[I.source],I,E),I.source&&(_.rttCoords[I.source]=this._coordsDescendingInvStr[I.source][_.tileID.key])}}return qi(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),cn[n]}return!1}}const Ot=Q,Wt={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:void 0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:c.c.MAX_TILE_CACHE_ZOOM_LEVELS,localIdeographFontFamily:"sans-serif",transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,validateStyle:!0,maxCanvasSize:[4096,4096]},ea=u=>{u.touchstart=u.dragStart,u.touchmoveWindow=u.dragMove,u.touchend=u.dragEnd},Fa={showCompass:!0,showZoom:!0,visualizePitch:!1};class Ba{constructor(t,n,s=!1){this.mousedown=g=>{this.startMouse(c.e({},g,{ctrlKey:!0,preventDefault:()=>g.preventDefault()}),pe.mousePos(this.element,g)),pe.addEventListener(window,"mousemove",this.mousemove),pe.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=g=>{this.moveMouse(g,pe.mousePos(this.element,g))},this.mouseup=g=>{this.mouseRotate.dragEnd(g),this.mousePitch&&this.mousePitch.dragEnd(g),this.offTemp()},this.touchstart=g=>{1!==g.targetTouches.length?this.reset():(this._startPos=this._lastPos=pe.touchPos(this.element,g.targetTouches)[0],this.startTouch(g,this._startPos),pe.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),pe.addEventListener(window,"touchend",this.touchend))},this.touchmove=g=>{1!==g.targetTouches.length?this.reset():(this._lastPos=pe.touchPos(this.element,g.targetTouches)[0],this.moveTouch(g,this._lastPos))},this.touchend=g=>{0===g.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const l=t.dragRotate._mouseRotate.getClickTolerance(),d=t.dragRotate._mousePitch.getClickTolerance();this.element=n,this.mouseRotate=co({clickTolerance:l,enable:!0}),this.touchRotate=(({enable:g,clickTolerance:_,bearingDegreesPerPixelMoved:v=.8})=>{const S=new es;return new Jn({clickTolerance:_,move:(I,E)=>({bearingDelta:(E.x-I.x)*v}),moveStateManager:S,enable:g,assignEvents:ea})})({clickTolerance:l,enable:!0}),this.map=t,s&&(this.mousePitch=lr({clickTolerance:d,enable:!0}),this.touchPitch=(({enable:g,clickTolerance:_,pitchDegreesPerPixelMoved:v=-.5})=>{const S=new es;return new Jn({clickTolerance:_,move:(I,E)=>({pitchDelta:(E.y-I.y)*v}),moveStateManager:S,enable:g,assignEvents:ea})})({clickTolerance:d,enable:!0})),pe.addEventListener(n,"mousedown",this.mousedown),pe.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),pe.addEventListener(n,"touchcancel",this.reset)}startMouse(t,n){this.mouseRotate.dragStart(t,n),this.mousePitch&&this.mousePitch.dragStart(t,n),pe.disableDrag()}startTouch(t,n){this.touchRotate.dragStart(t,n),this.touchPitch&&this.touchPitch.dragStart(t,n),pe.disableDrag()}moveMouse(t,n){const s=this.map,{bearingDelta:l}=this.mouseRotate.dragMove(t,n)||{};if(l&&s.setBearing(s.getBearing()+l),this.mousePitch){const{pitchDelta:d}=this.mousePitch.dragMove(t,n)||{};d&&s.setPitch(s.getPitch()+d)}}moveTouch(t,n){const s=this.map,{bearingDelta:l}=this.touchRotate.dragMove(t,n)||{};if(l&&s.setBearing(s.getBearing()+l),this.touchPitch){const{pitchDelta:d}=this.touchPitch.dragMove(t,n)||{};d&&s.setPitch(s.getPitch()+d)}}off(){const t=this.element;pe.removeEventListener(t,"mousedown",this.mousedown),pe.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),pe.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),pe.removeEventListener(window,"touchend",this.touchend),pe.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){pe.enableDrag(),pe.removeEventListener(window,"mousemove",this.mousemove),pe.removeEventListener(window,"mouseup",this.mouseup),pe.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),pe.removeEventListener(window,"touchend",this.touchend)}}let pr;function Na(u,t,n){if(u=new c.L(u.lng,u.lat),t){const s=new c.L(u.lng-360,u.lat),l=new c.L(u.lng+360,u.lat),d=n.locationPoint(u).distSqr(t);n.locationPoint(s).distSqr(t)<d?u=s:n.locationPoint(l).distSqr(t)<d&&(u=l)}for(;Math.abs(u.lng-n.center.lng)>180;){const s=n.locationPoint(u);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;u.lng>n.center.lng?u.lng-=360:u.lng+=360}return u}
1const jn={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 pl(u,t,n){const s=u.classList;for(const l in jn)s.remove(`maplibregl-${n}-anchor-${l}`);s.add(`maplibregl-${n}-anchor-${t}`)}class rs extends c.E{constructor(t){if(super(),this._onKeyPress=n=>{const s=n.code,l=n.charCode||n.keyCode;"Space"!==s&&"Enter"!==s&&32!==l&&13!==l||this.togglePopup()},this._onMapClick=n=>{const s=n.originalEvent.target,l=this._element;this._popup&&(s===l||l.contains(s))&&this.togglePopup()},this._update=n=>{if(!this._map)return;const s=this._map.loaded()&&!this._map.isMoving();("terrain"===n?.type||"render"===n?.type&&!s)&&this._map.once("render",this._update),this._map.transform.renderWorldCopies&&(this._lngLat=Na(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let l="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?l=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(l=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let d="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?d="rotateX(0deg)":"map"===this._pitchAlignment&&(d=`rotateX(${this._map.getPitch()}deg)`),n&&"moveend"!==n.type||(this._pos=this._pos.round()),pe.setTransform(this._element,`${jn[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${d} ${l}`),this._map.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout(()=>{const g=this._map.unproject(this._pos),_=40075016.686*Math.abs(Math.cos(this._lngLat.lat*Math.PI/180))/Math.pow(2,this._map.transform.tileZoom+8);this._element.style.opacity=g.distanceTo(this._lngLat)>20*_?"0.2":"1.0",this._opacityTimeout=null},100))},this._onMove=n=>{if(!this._isDragging){const s=this._clickTolerance||this._map._clickTolerance;this._isDragging=n.point.dist(this._pointerdownPos)>=s}this._isDragging&&(this._pos=n.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new c.k("dragstart"))),this.fire(new c.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new c.k("dragend")),this._state="inactive"},this._addDragHandler=n=>{this._element.contains(n.originalEvent.target)&&(n.preventDefault(),this._positionDelta=n.point.sub(this._pos).add(this._offset),this._pointerdownPos=n.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&"auto"!==t.pitchAlignment?t.pitchAlignment:this._rotationAlignment,t&&t.element)this._element=t.element,this._offset=c.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=pe.create("div"),this._element.setAttribute("aria-label","Map marker");const n=pe.createNS("http://www.w3.org/2000/svg","svg"),s=41,l=27;n.setAttributeNS(null,"display","block"),n.setAttributeNS(null,"height",`${s}px`),n.setAttributeNS(null,"width",`${l}px`),n.setAttributeNS(null,"viewBox",`0 0 ${l} ${s}`);const d=pe.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"stroke","none"),d.setAttributeNS(null,"stroke-width","1"),d.setAttributeNS(null,"fill","none"),d.setAttributeNS(null,"fill-rule","evenodd");const g=pe.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"fill-rule","nonzero");const _=pe.createNS("http://www.w3.org/2000/svg","g");_.setAttributeNS(null,"transform","translate(3.0, 29.0)"),_.setAttributeNS(null,"fill","#000000");const v=[{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 oe of v){const fe=pe.createNS("http://www.w3.org/2000/svg","ellipse");fe.setAttributeNS(null,"opacity","0.04"),fe.setAttributeNS(null,"cx","10.5"),fe.setAttributeNS(null,"cy","5.80029008"),fe.setAttributeNS(null,"rx",oe.rx),fe.setAttributeNS(null,"ry",oe.ry),_.appendChild(fe)}const S=pe.createNS("http://www.w3.org/2000/svg","g");S.setAttributeNS(null,"fill",this._color);const I=pe.createNS("http://www.w3.org/2000/svg","path");I.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"),S.appendChild(I);const E=pe.createNS("http://www.w3.org/2000/svg","g");E.setAttributeNS(null,"opacity","0.25"),E.setAttributeNS(null,"fill","#000000");const D=pe.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"),E.appendChild(D);const V=pe.createNS("http://www.w3.org/2000/svg","g");V.setAttributeNS(null,"transform","translate(6.0, 7.0)"),V.setAttributeNS(null,"fill","#FFFFFF");const U=pe.createNS("http://www.w3.org/2000/svg","g");U.setAttributeNS(null,"transform","translate(8.0, 8.0)");const $=pe.createNS("http://www.w3.org/2000/svg","circle");$.setAttributeNS(null,"fill","#000000"),$.setAttributeNS(null,"opacity","0.25"),$.setAttributeNS(null,"cx","5.5"),$.setAttributeNS(null,"cy","5.5"),$.setAttributeNS(null,"r","5.4999962");const B=pe.createNS("http://www.w3.org/2000/svg","circle");B.setAttributeNS(null,"fill","#FFFFFF"),B.setAttributeNS(null,"cx","5.5"),B.setAttributeNS(null,"cy","5.5"),B.setAttributeNS(null,"r","5.4999962"),U.appendChild($),U.appendChild(B),g.appendChild(_),g.appendChild(S),g.appendChild(E),g.appendChild(V),g.appendChild(U),n.appendChild(g),n.setAttributeNS(null,"height",s*this._scale+"px"),n.setAttributeNS(null,"width",l*this._scale+"px"),this._element.appendChild(n),this._offset=c.P.convert(t&&t.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",n=>{n.preventDefault()}),this._element.addEventListener("mousedown",n=>{n.preventDefault()}),pl(this._element,this._anchor,"marker"),t&&t.className)for(const n of t.className.split(" "))this._element.classList.add(n);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("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),pe.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=c.L.convert(t),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 l=Math.abs(13.5)/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[
10,-38.1],"bottom-left":[l,-1*(24.6+l)],"bottom-right":[-l,-1*(24.6+l)],left:[13.5,-24.6],right:[-13.5,-24.6]}: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}getPopup(){return this._popup}togglePopup(){const t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this}getOffset(){return this._offset}setOffset(t){return this._offset=c.P.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}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}}const or={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let ir=0,Rs=!1;const ta={maxWidth:100,unit:"metric"};function ia(u,t,n){const s=n&&n.maxWidth||100,l=u._container.clientHeight/2,d=u.unproject([0,l]),g=u.unproject([s,l]),_=d.distanceTo(g);if(n&&"imperial"===n.unit){const v=3.2808*_;v>5280?ns(t,s,v/5280,u._getUIString("ScaleControl.Miles")):ns(t,s,v,u._getUIString("ScaleControl.Feet"))}else n&&"nautical"===n.unit?ns(t,s,_/1852,u._getUIString("ScaleControl.NauticalMiles")):_>=1e3?ns(t,s,_/1e3,u._getUIString("ScaleControl.Kilometers")):ns(t,s,_,u._getUIString("ScaleControl.Meters"))}function ns(u,t,n,s){const l=function(d){const g=Math.pow(10,`${Math.floor(d)}`.length-1);let _=d/g;return _=_>=10?10:_>=5?5:_>=3?3:_>=2?2:_>=1?1:function(v){const S=Math.pow(10,Math.ceil(-Math.log(v)/Math.LN10));return Math.round(v*S)/S}(_),g*_}(n);u.style.width=t*(l/n)+"px",u.innerHTML=`${l} ${s}`}const Ua={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Va=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Fs(u){if(u){if("number"==typeof u){const t=Math.round(Math.abs(u)/Math.SQRT2);return{center:new c.P(0,0),top:new c.P(0,u),"top-left":new c.P(t,t),"top-right":new c.P(-t,t),bottom:new c.P(0,-u),"bottom-left":new c.P(t,-t),"bottom-right":new c.P(-t,-t),left:new c.P(u,0),right:new c.P(-u,0)}}if(u instanceof c.P||Array.isArray(u)){const t=c.P.convert(u);return{center:t,top:t,"top-left":t,"top-right":t,bottom:t,"bottom-left":t,"bottom-right":t,left:t,right:t}}return{center:c.P.convert(u.center||[0,0]),top:c.P.convert(u.top||[0,0]),"top-left":c.P.convert(u["top-left"]||[0,0]),"top-right":c.P.convert(u["top-right"]||[0,0]),bottom:c.P.convert(u.bottom||[0,0]),"bottom-left":c.P.convert(u["bottom-left"]||[0,0]),"bottom-right":c.P.convert(u["bottom-right"]||[0,0]),left:c.P.convert(u.left||[0,0]),right:c.P.convert(u.right||[0,0])}}return Fs(new c.P(0,0))}const Ga={extend:(u,...t)=>c.e(u,...t),run(u){u()},logToElement(u,t=!1,n="log"){const s=window.document.getElementById(n);s&&(t&&(s.innerHTML=""),s.innerHTML+=`<br>${u}`)}},ja=Q;class Ai{static get version(){return ja}static get workerCount(){return ft.workerCount}static set workerCount(t){ft.workerCount=t}static get maxParallelImageRequests(){return c.c.MAX_PARALLEL_IMAGE_REQUESTS}static set maxParallelImageRequests(t){c.c.MAX_PARALLEL_IMAGE_REQUESTS=t}static get workerUrl(){return c.c.WORKER_URL}static set workerUrl(t){c.c.WORKER_URL=t}static addProtocol(t,n){c.c.REGISTERED_PROTOCOLS[t]=n}static removeProtocol(t){delete c.c.REGISTERED_PROTOCOLS[t]}}return Ai.Map=class extends cl{constructor(u){if(c.bg.mark(c.bh.create),null!=(u=c.e({}
1,Wt,u)).minZoom&&null!=u.maxZoom&&u.minZoom>u.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=u.minPitch&&null!=u.maxPitch&&u.minPitch>u.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=u.minPitch&&u.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=u.maxPitch&&u.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Ls(u.minZoom,u.maxZoom,u.minPitch,u.maxPitch,u.renderWorldCopies),{bearingSnap:u.bearingSnap}),this._cooperativeGesturesOnWheel=t=>{this._onCooperativeGesture(t,t[this._metaKey],1)},this._contextLost=t=>{t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new c.k("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{this._setupPainter(),this.resize(),this._update(),this.fire(new c.k("webglcontextrestored",{originalEvent:t}))},this._onMapScroll=t=>{if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=u.interactive,this._cooperativeGestures=u.cooperativeGestures,this._metaKey=0===navigator.platform.indexOf("Mac")?"metaKey":"ctrlKey",this._maxTileCacheSize=u.maxTileCacheSize,this._maxTileCacheZoomLevels=u.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=u.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=u.preserveDrawingBuffer,this._antialias=u.antialias,this._trackResize=u.trackResize,this._bearingSnap=u.bearingSnap,this._refreshExpiredTiles=u.refreshExpiredTiles,this._fadeDuration=u.fadeDuration,this._crossSourceCollisions=u.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=u.collectResourceTiming,this._renderTaskQueue=new fa,this._controls=[],this._mapId=c.a2(),this._locale=c.e({},Ra,u.locale),this._clickTolerance=u.clickTolerance,this._overridePixelRatio=u.pixelRatio,this._maxCanvasSize=u.maxCanvasSize,this.transformCameraUpdate=u.transformCameraUpdate,this._imageQueueHandle=He.addThrottleControl(()=>this.isMoving()),this._requestManager=new zt(u.transformRequest),"string"==typeof u.container){if(this._container=document.getElementById(u.container),!this._container)throw new Error(`Container '${u.container}' not found.`)}else{if(!(u.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=u.container}if(u.maxBounds&&this.setMaxBounds(u.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let t=!1;const n=ue(s=>{this._trackResize&&!this._removed&&this.resize(s)._update()},50);this._resizeObserver=new ResizeObserver(s=>{t?n(s):t=!0}),this._resizeObserver.observe(this._container)}this.handlers=new za(this,u),this._cooperativeGestures&&this._setupCooperativeGestures(),this._hash=u.hash&&new we("string"==typeof u.hash&&u.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:u.center,zoom:u.zoom,bearing:u.bearing,pitch:u.pitch}),u.bounds&&(this.resize(),this.fitBounds(u.bounds,c.e({},u.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=u.localIdeographFontFamily,this._validateStyle=u.validateStyle,u.style&&this.setStyle(u.style,{localIdeographFontFamily:u.localIdeographFontFamily}),u.attributionControl&&this.addControl(new An({customAttribution:u.customAttribution})),u.maplibreLogo&&this.addControl(new Ki,u.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",t=>{this._update("style"===t.dataType),this.fire(new c.k(`${t.dataType}data`,t))}),this.on("dataloading",t=>{this.fire(new c.k(`${t.dataType}dataloading`,t))}),this.on("dataabort",t=>{this.fire(new c.k("sourcedataabort",t))})}_getMapId(){return this._mapId}addControl(u,t){if(void 0===t&&(t=u.getDefaultPosition?u.getDefaultPosition():"top-right"),!u||!u.onAdd)return this.fire(new c.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=u.onAdd(this);this._controls.push(u);const s=this._controlPositions[t];return-1!==t.indexOf("bottom")?s.insertBefore(n,s.firstChild):s.appendChild(n),this}
1removeControl(u){if(!u||!u.onRemove)return this.fire(new c.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const t=this._controls.indexOf(u);return t>-1&&this._controls.splice(t,1),u.onRemove(this),this}hasControl(u){return this._controls.indexOf(u)>-1}calculateCameraOptionsFromTo(u,t,n,s){return null==s&&this.terrain&&(s=this.terrain.getElevationForLngLatZoom(n,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(u,t,n,s)}resize(u){var t;const n=this._containerDimensions(),s=n[0],l=n[1],d=this._getClampedPixelRatio(s,l);if(this._resizeCanvas(s,l,d),this.painter.resize(s,l,d),this.painter.overLimit()){const _=this.painter.context.gl;this._maxCanvasSize=[_.drawingBufferWidth,_.drawingBufferHeight];const v=this._getClampedPixelRatio(s,l);this._resizeCanvas(s,l,v),this.painter.resize(s,l,v)}this.transform.resize(s,l),null===(t=this._requestedCameraState)||void 0===t||t.resize(s,l);const g=!this._moving;return g&&(this.stop(),this.fire(new c.k("movestart",u)).fire(new c.k("move",u))),this.fire(new c.k("resize",u)),g&&this.fire(new c.k("moveend",u)),this}_getClampedPixelRatio(u,t){const{0:n,1:s}=this._maxCanvasSize,l=this.getPixelRatio(),d=u*l,g=t*l;return Math.min(d>n?n/d:1,g>s?s/g:1)*l}getPixelRatio(){var u;return null!==(u=this._overridePixelRatio)&&void 0!==u?u:devicePixelRatio}setPixelRatio(u){this._overridePixelRatio=u,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(u){return this.transform.setMaxBounds(Ke.convert(u)),this._update()}setMinZoom(u){if((u=u??-2)>=-2&&u<=this.transform.maxZoom)return this.transform.minZoom=u,this._update(),this.getZoom()<u&&this.setZoom(u),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(u){if((u=u??22)>=this.transform.minZoom)return this.transform.maxZoom=u,this._update(),this.getZoom()>u&&this.setZoom(u),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(u){if((u=u??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(u>=0&&u<=this.transform.maxPitch)return this.transform.minPitch=u,this._update(),this.getPitch()<u&&this.setPitch(u),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(u){if((u=u??60)>85)throw new Error("maxPitch must be less than or equal to 85");if(u>=this.transform.minPitch)return this.transform.maxPitch=u,this._update(),this.getPitch()>u&&this.setPitch(u),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(u){return this.transform.renderWorldCopies=u,this._update()}getCooperativeGestures(){return this._cooperativeGestures}setCooperativeGestures(u){return this._cooperativeGestures=u,this._cooperativeGestures?this._setupCooperativeGestures():this._destroyCooperativeGestures(),this}project(u){return this.transform.locationPoint(c.L.convert(u),this.style&&this.terrain)}unproject(u){return this.transform.pointLocation(c.P.convert(u),this.terrain)}isMoving(){var u;return this._moving||(null===(u=this.handlers)||void 0===u?void 0:u.isMoving())}isZooming(){var u;return this._zooming||(null===(u=this.handlers)||void 0===u?void 0:u.isZooming())}isRotating(){var u;return this._rotating||(null===(u=this.handlers)||void 0===u?void 0:u.isRotating())}_createDelegatedListener(u,t,n){if("mouseenter"===u||"mouseover"===u){let s=!1;return{layer:t,listener:n,delegates:{mousemove:d=>{const g=this.getLayer(t)?this.queryRenderedFeatures(d.point,{layers:[t]}):[];g.length?s||(s=!0,n.call(this,new Ti(u,this,d.originalEvent,{features:g}))):s=!1},mouseout:()=>{s=!1}}}}if("mouseleave"===u||"mouseout"===u){let s=!1;return{layer:t,listener:n,delegates:{mousemove:g=>{(this.getLayer(t)?this.queryRenderedFeatures(g.point,{layers:[t]}):[]).length?s=!0:s&&(s=!1,n.call(this,new Ti(u,this,g.originalEvent)))},mouseout:g=>{s&&(s=!1,n.call(this,new Ti(u,this,g.originalEvent)))}}}}{const s=l=>{const d=this.getLayer(t)?this.queryRenderedFeatures(l.point,{layers:[t]}):[];d.length&&(l.features=d,n.call(this,l),delete l.features)};return{layer:t,listener:n,delegates:{[u]:s}}}}
1on(u,t,n){if(void 0===n)return super.on(u,t);const s=this._createDelegatedListener(u,t,n);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[u]=this._delegatedListeners[u]||[],this._delegatedListeners[u].push(s);for(const l in s.delegates)this.on(l,s.delegates[l]);return this}once(u,t,n){if(void 0===n)return super.once(u,t);const s=this._createDelegatedListener(u,t,n);for(const l in s.delegates)this.once(l,s.delegates[l]);return this}off(u,t,n){return void 0===n?super.off(u,t):(this._delegatedListeners&&this._delegatedListeners[u]&&(s=>{const l=this._delegatedListeners[u];for(let d=0;d<l.length;d++){const g=l[d];if(g.layer===t&&g.listener===n){for(const _ in g.delegates)this.off(_,g.delegates[_]);return l.splice(d,1),this}}})(),this)}queryRenderedFeatures(u,t){if(!this.style)return[];let n;const s=u instanceof c.P||Array.isArray(u),l=s?u:[[0,0],[this.transform.width,this.transform.height]];if(t=t||(s?{}:u)||{},l instanceof c.P||"number"==typeof l[0])n=[c.P.convert(l)];else{const d=c.P.convert(l[0]),g=c.P.convert(l[1]);n=[d,new c.P(g.x,d.y),g,new c.P(d.x,g.y),d]}return this.style.queryRenderedFeatures(n,t,this.transform)}querySourceFeatures(u,t){return this.style.querySourceFeatures(u,t)}setStyle(u,t){return!1!==(t=c.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._val
vendor: 8,482 bytes, line 1
1idateStyle},t)).diff&&t.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&u?(this._diffStyle(u,t),this):(this._localIdeographFontFamily=t.localIdeographFontFamily,this._updateStyle(u,t))}setTransformRequest(u){return this._requestManager.setTransformRequest(u),this}_getUIString(u){const t=this._locale[u];if(null==t)throw new Error(`Missing UI string '${u}'`);return t}_updateStyle(u,t){if(t.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(u,t));const n=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!u)),u?(this.style=new xr(this,t||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof u?this.style.loadURL(u,t,n):this.style.loadJSON(u,t,n),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new xr(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(u,t){if("string"==typeof u){const n=this._requestManager.transformRequest(u,Ze.Style);c.f(n,(s,l)=>{s?this.fire(new c.j(s)):l&&this._updateDiff(l,t)})}else"object"==typeof u&&this._updateDiff(u,t)}_updateDiff(u,t){try{this.style.setState(u,t)&&this._update(!0)}catch(n){c.w(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(u,t)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():c.w("There is no style added to the map.")}addSource(u,t){return this._lazyInitEmptyStyle(),this.style.addSource(u,t),this._update(!0)}isSourceLoaded(u){const t=this.style&&this.style.sourceCaches[u];if(void 0!==t)return t.loaded();this.fire(new c.j(new Error(`There is no source with ID '${u}'`)))}setTerrain(u){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),u){const t=this.style.sourceCaches[u.source];if(!t)throw new Error(`cannot load terrain, because there exists no source with ID: ${u.source}`);for(const n in this.style._layers){const s=this.style._layers[n];"hillshade"===s.type&&s.source===u.source&&c.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new dl(this.painter,t,u),this.painter.renderToTexture=new ga(this.painter,this.terrain),this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=n=>{"style"===n.dataType?this.terrain.sourceCache.freeRtt():"source"===n.dataType&&n.tile&&(n.sourceId!==u.source||this._elevationFreeze||(this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(n.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform._minEleveationForCurrentTile=0,this.transform.elevation=0;return this.fire(new c.k("terrain",{terrain:u})),this}getTerrain(){var u,t;return null!==(t=null===(u=this.terrain)||void 0===u?void 0:u.options)&&void 0!==t?t:null}areTilesLoaded(){const u=this.style&&this.style.sourceCaches;for(const t in u){const n=u[t]._tiles;for(const s in n){const l=n[s];if("loaded"!==l.state&&"errored"!==l.state)return!1}}return!0}addSourceType(u,t,n){return this._lazyInitEmptyStyle(),this.style.addSourceType(u,t,n)}removeSource(u){return this.style.removeSource(u),this._update(!0)}getSource(u){return this.style.getSource(u)}addImage(u,t,n={}){const{pixelRatio:s=1,sdf:l=!1,stretchX:d,stretchY:g,content:_}=n;if(this._lazyInitEmptyStyle(),!(t instanceof HTMLImageElement||c.a(t))){if(void 0===t.width||void 0===t.height)return this.fire(new c.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:v,height:S,data:I}=t,E=t;return this.style.addImage(u,{data:new c.R({width:v,height:S},new Uint8Array(I)),pixelRatio:s,stretchX:d,stretchY:g,content:_,sdf:l,version:0,userImage:E}),E.onAdd&&E.onAdd(this,u),this}}{const{width:v,height:S,data:I}=c.h.getImageData(t);this.style.addImage(u,{data:new c.R({width:v,height:S},I),pixelRatio:s,stretchX:d,stretchY:g,content:_,sdf:l,version:0})}}updateImage(u,t){const n=this.style.getImage(u);if(!n)return this.fire(new c.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const s=t instanceof HTMLImageElement||c.a(t)?c.h.getImageData(t):t,{width:l,height:d,data:g}=s;if(void 0===l||void 0===d)return this.fire(new c.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(l!==n.data.width||d!==n.data.height)return this.fire(new c.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const _=!(t instanceof HTMLImageElement||c.a(t));return n.data.replace(g,_),this.style.updateImage(u,n),this}getImage(u){return this.style.getImage(u)}hasImage(u){return u?!!this.style.getImage(u):(this.fire(new c.j(new Error("Missing required image id"))),!1)}removeImage(u){this.style.removeImage(u)}loadImage(u,t){He.getImage(this._requestManager.transformRequest(u,Ze.Image),t)}listImages(){return this.style.listImages()}addLayer(u,t){return this._lazyInitEmptyStyle(),this.style.addLayer(u,t),this._update(!0)}moveLayer(u,t){return this.style.moveLayer(u,t),this._update(!0)}removeLayer(u){return this.style.removeLayer(u),this._update(!0)}getLayer(u){return this.style.getLayer(u)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(u,t,n){return this.style.setLayerZoomRange(u,t,n),this._update(!0)}setFilter(u,t,n={}){return this.style.setFilter(u,t,n),this._update(!0)}getFilter(u){return this.style.getFilter(u)}setPaintProperty(u,t,n,s={}){return this.style.setPaintProperty(u,t,n,s),this._update(!0)}getPaintProperty(u,t){return this.style.getPaintProperty(u,t)}setLayoutProperty(u,t,n,s={}){return this.style.setLayoutProperty(u,t,n,s),this._update(!0)}getLayoutProperty(u,t){return this.style.getLayoutProperty(u,t)}setGlyphs(u,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(u,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(u,t,n={}){return this._lazyInitEmptyStyle(),this.style.addSprite(u,t,n,s=>{s||this._update(!0)}),this}removeSprite(u){return this._lazyInitEmptyStyle(),this.style.removeSprite(u),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(u,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(u,t,n=>{n||this._update(!0)}),this}setLight(u,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(u,t),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(u,t){return this.style.setFeatureState(u,t),this._update()}removeFeatureState(u,t){return this.style.removeFeatureState(u,t),this._update()}getFeatureState(u){return this.style.getFeatureState(u)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let u=0,t=0;return this._container&&(u=this._container.clientWidth||400,t=this._container.clientHeight||300),[u,t]}_setupContainer(){const u=this._container;u.classList.add("maplibregl-map");const t=this._canvasContainer=pe.create("div","maplibregl-canvas-container",u);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=pe.create("canvas","maplibregl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","regi
1on");const n=this._containerDimensions(),s=this._getClampedPixelRatio(n[0],n[1]);this._resizeCanvas(n[0],n[1],s);const l=this._controlContainer=pe.create("div","maplibregl-control-container",u),d=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(g=>{d[g]=pe.create("div",`maplibregl-ctrl-${g} `,l)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_setupCooperativeGestures(){this._cooperativeGesturesScreen=pe.create("div","maplibregl-cooperative-gesture-screen",this._container);let u="boolean"!=typeof this._cooperativeGestures&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";0===navigator.platform.indexOf("Mac")&&(u="boolean"!=typeof this._cooperativeGestures&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use \u2318 + scroll to zoom the map"),this._cooperativeGesturesScreen.innerHTML=`\n <div class="maplibregl-desktop-message">${u}</div>\n <div class="maplibregl-mobile-message">${"boolean"!=typeof this._cooperativeGestures&&this._cooperativeGestures.mobileHelpText?this._cooperativeGestures.mobileHelpText:"Use two fingers to move the map"}</div>\n `,this._cooperativeGesturesScreen.setAttribute("aria-hidden","true"),this._canvasContainer.addEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.add("maplibregl-cooperative-gestures")}_destroyCooperativeGestures(){pe.remove(this._cooperativeGesturesScreen),this._canvasContainer.removeEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.remove("maplibregl-cooperative-gestures")}_resizeCanvas(u,t,n){this._canvas.width=Math.floor(n*u),this._canvas.height=Math.floor(n*t),this._canvas.style.width=`${u}px`,this._canvas.style.height=`${t}px`}_setupPainter(){const u={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let t=null;this._canvas.addEventListener("webglcontextcreationerror",s=>{t={requestedAttributes:u},s&&(t.statusMessage=s.statusMessage,t.type=s.type)},{once:!0});const n=this._canvas.getContext("webgl2",u)||this._canvas.getContext("webgl",u);if(!n){const s="Failed to initialize WebGL";throw t?(t.message=s,new Error(JSON.stringify(t))):new Error(s)}this.painter=new lo(n,this.transform),Ct.testSupport(n)}_onCooperativeGesture(u,t,n){return!t&&n<2&&(this._cooperativeGesturesScreen.classList.add("maplibregl-show"),setTimeout(()=>{this._cooperativeGesturesScreen.classList.remove("maplibregl-show")},100)),!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(u){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||u,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(u){return this._update(),this._renderTaskQueue.add(u)}_cancelRenderFrame(u){this._renderTaskQueue.remove(u)}_render(u){const t=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(u),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const l=this.transform.zoom,d=c.h.now();this.style.zoomHistory.update(l,d);const g=new c.a8(l,{now:d,fadeDuration:t,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),_=g.crossFadingFactor();1===_&&_===this._crossFadingFactor||(n=!0,this._crossFadingFactor=_),this.style.update(g)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform._minEleveationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,t,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:t,showPadding:this.showPadding}),this.fire(new c.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,c.bg.mark(c.bh.load),this.fire(new c.k("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const s=this._sourcesDirty||this._styleDirty||this._placementDirty;return s||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new c.k("idle")),!this._loaded||this._fullyLoaded||s||(this._fullyLoaded=!0,c.bg.mark(c.bh.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){var u;this._hash&&this._hash.remove();for(const n of this._controls)n.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),He.removeThrottleControl(this._imageQueueHandle),null===(u=this._resizeObserver)||void 0===u||u.disconnect();const t=this.painter.context.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),pe.remove(this._canvasContainer),pe.remove(this._controlContainer),this._cooperativeGestures&&this._destroyCooperativeGestures(),this._container.classList.remove("maplibregl-map"),c.bg.clearMetrics(),this._removed=!0,this.fire(new c.k("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=c.h.frame(u=>{c.bg.frame(u),this._frame=null,this._render(u)}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(u){this._showTileBoundaries!==u&&(this._showTileBoundaries=u,this._update())}get showPadding(){return!!this._showPadding}set showPadding(u){this._showPadding!==u&&(this._showPadding=u,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(u){this._showCollisionBoxes!==u&&(this._showCollisionBoxes=u,u?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(u){this._showOverdrawInspector!==u&&(this._showOverdrawInspector=u,this._update())}get repaint(){return!!this._repaint}set repaint(u){this._repaint!==u&&(this._repaint=u,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(u){this._vertices=u,this._update()}get version(){return Ot}getCameraTargetElevation(){return this.transform.elevation}}
vendor: 6,730 bytes, line 1
1,Ai.NavigationControl=class{constructor(u){this._updateZoomButtons=()=>{const t=this._map.getZoom(),n=t===this._map.getMaxZoom(),s=t===this._map.getMinZoom();this._zoomInButton.disabled=n,this._zoomOutButton.disabled=s,this._zoomInButton.setAttribute("aria-disabled",n.toString()),this._zoomOutButton.setAttribute("aria-disabled",s.toString())},this._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._compassIcon.style.transform=t},this._setButtonTitle=(t,n)=>{const s=this._map._getUIString(`NavigationControl.${n}`);t.title=s,t.setAttribute("aria-label",s)},this.options=c.e({},Fa,u),this._container=pe.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",t=>t.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",t=>this._map.zoomIn({},{originalEvent:t})),pe.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",t=>this._map.zoomOut({},{originalEvent:t})),pe.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})}),this._compassIcon=pe.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(u){return this._map=u,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 Ba(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){pe.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(u,t){const n=pe.create("button",u,this._container);return n.type="button",n.addEventListener("click",t),n}},Ai.GeolocateControl=class extends c.E{constructor(u){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new c.k("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new c.k("geolocate",t)),this._finish()}},this._updateCamera=t=>{const n=new c.L(t.coords.longitude,t.coords.latitude),s=t.coords.accuracy,l=this._map.getBearing(),d=c.e({bearing:l},this.options.fitBoundsOptions),g=Ke.fromLngLat(n,s);this._map.fitBounds(g,d,{geolocateSource:!0})},this._updateMarker=t=>{if(t){const n=new c.L(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=t=>{if(this._map){if(this.options.trackUserLocation)if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&Rs)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new c.k("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=t=>{if(this._map){if(this._container.addEventListener("contextmenu",n=>n.preventDefault()),this._geolocateButton=pe.create("button","maplibregl-ctrl-geolocate",this._container),pe.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",!1===t){c.w("Geolocation support is not available so the GeolocateControl will be disabled.");const n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}else{const n=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","fal
1se"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=pe.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new rs({element:this._dotElement}),this._circleElement=pe.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new rs({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",n=>{n.geolocateSource||"ACTIVE_LOCK"!==this._watchState||n.originalEvent&&"resize"===n.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new c.k("trackuserlocationend")))})}},this.options=c.e({},or,u)}onAdd(u){return this._map=u,this._container=pe.create("div","maplibregl-ctrl maplibregl-ctrl-group"),function(t,n=!1){void 0===pr||n?void 0!==window.navigator.permissions?window.navigator.permissions.query({name:"geolocation"}).then(s=>{pr="denied"!==s.state,t(pr)}).catch(()=>{pr=!!window.navigator.geolocation,t(pr)}):(pr=!!window.navigator.geolocation,t(pr)):t(pr)}(this._setupUI),this._container}onRemove(){void 0!==this._geolocationWatchID&&(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(),pe.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,ir=0,Rs=!1}_isOutOfMapMaxBounds(u){const t=this._map.getMaxBounds(),n=u.coords;return t&&(n.longitude<t.getWest()||n.longitude>t.getEast()||n.latitude<t.getSouth()||n.latitude>t.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const u=this._map.getBounds(),t=u.getSouthEast(),n=u.getNorthEast(),s=t.distanceTo(n),l=Math.ceil(this._accuracy/(s/this._map._container.clientHeight)*2);this._circleElement.style.width=`${l}px`,this._circleElement.style.height=`${l}px`}trigger(){if(!this._setup)return c.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new c.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":ir--,Rs=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new c.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new c.k("trackuserlocationstart"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let u;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),ir
1++,ir>1?(u={maximumAge:6e5,timeout:0},Rs=!0):(u=this.options.positionOptions,Rs=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,u)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},Ai.AttributionControl=An,Ai.LogoControl=Ki,Ai.ScaleControl=class{constructor(u){this._onMove=()=>{ia(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,ia(this._map,this._container,this.options)},this.options=c.e({},ta,u)}getDefaultPosition(){return"bottom-left"}onAdd(u){return this._map=u,this._container=pe.create("div","maplibregl-ctrl maplibregl-ctrl-scale",u.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){pe.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},Ai.FullscreenControl=class extends c.E{constructor(u={}){super(),this._onFullscreenChange=()=>{(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,u&&u.container&&(u.container instanceof HTMLElement?this._container=u.container:c.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(u){return this._map=u,this._container||(this._container=this._map.getContainer()),this._controlContainer=pe.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){pe.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const u=this._fullscreenButton=pe.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);pe.create("span","maplibregl-ctrl-icon",u).setAttribute("aria-hidden","true"),u.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const u=this._getTitle();this._fullscreenButton.setAttribute("aria-label",u),this._fullscreenButton.title=u}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new c.k("fullscreenstart")),this._map._cooperativeGestures&&(this._prevCooperativeGestures=this._map._cooperativeGestures,this._map.setCooperativeGestures())):(this.fire(new c.k("fullscreenend")),this._prevCooperativeGestures&&(this._map.setCooperativeGestures(this._prevCooperativeGestures),delete this._prevCooperativeGestures))}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}}
1,Ai.TerrainControl=class{constructor(u){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))},this.options=u}onAdd(u){return this._map=u,this._container=pe.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=pe.create("button","maplibregl-ctrl-terrain",this._container),pe.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){pe.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},Ai.Popup=class extends c.E{constructor(u){super(),this.remove=()=>(this._content&&pe.remove(this._content),this._container&&(pe.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 c.k("close")),this),this._onMouseUp=t=>{this._update(t.point)},this._onMouseMove=t=>{this._update(t.point)},this._onDrag=t=>{this._update(t.point)},this._update=t=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=pe.create("div","maplibregl-popup",this._map.getContainer()),this._tip=pe.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const g of this.options.className.split(" "))this._container.classList.add(g);this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Na(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!t)return;const n=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);let s=this.options.anchor;const l=Fs(this.options.offset);if(!s){const g=this._container.offsetWidth,_=this._container.offsetHeight;let v;v=n.y+l.bottom.y<_?["top"]:n.y>this._map.transform.height-_?["bottom"]:[],n.x<g/2?v.push("left"):n.x>this._map.transform.width-g/2&&v.push("right"),s=0===v.length?"bottom":v.join("-")}const d=n.add(l[s]).round();pe.setTransform(this._container,`${jn[s]} translate(${d.x}px,${d.y}px)`),pl(this._container,s,"popup")},this._onClose=()=>{this.remove()},this.options=c.e(Object.create(Ua),u)}addTo(u){return this._map&&this.remove(),this._map=u,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new c.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(u){return this._lngLat=c.L.convert(u),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("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-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("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(u){return this.setDOMContent(document.createTextNode(u))}setHTML(u){const t=document.createDocumentFragment(),n=document.createElement("body");let s;for(n.innerHTML=u;s=n.firstChild,s;)t.appendChild(s);return this.setDOMContent(t)}getMaxWidth(){var u;return null===(u=this._container)||void 0===u?void 0:u.style.maxWidth}setMaxWidth(u){return this.options.maxWidth=u,this._update(),this}setDOMContent(u){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=pe.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(u),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(u){this._container&&this._container.classList.add(u)}removeClassName(u){this._container&&this._container.classList.remove(u)}setOffset(u){return this.options.offset=u,this._update(),this}toggleClassName(u){if(this._container)return this._container.classList.toggle(u)}_createCloseButton(){this.options.closeButton&&(this._closeButton=pe.create("button","maplibregl-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))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const u=this._container.querySelector(Va);u&&u.focus()}},Ai.Marker=rs,Ai.Style=xr,Ai.LngLat=c.L,Ai.LngLatBounds=Ke,Ai.Point=c.P,Ai.MercatorCoordinate=c.U,Ai.Evented=c.E,Ai.AJAXError=c.bi,Ai.config=c.c,Ai.CanvasSource=_r,Ai.GeoJSONSource=Bi,Ai.ImageSource=Ft,Ai.RasterDEMTileSource=Qt,Ai.RasterTileSource=$t,Ai.VectorTileSource=wt,Ai.VideoSource=Mn,Ai.setRTLTextPlugin=c.bj,Ai.getRTLTextPluginStatus=c.bk,Ai.prewarm=function(){ki().acquire(Ee)},Ai.clearPrewarmedResources=function(){const u=mi;u&&(u.isPreloaded()&&1===u.numActive()?(u.release(Ee),mi=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()"))},Ga.extend(Ai,{isSafari:c.ac,getPerformanceMetrics:c.bg.getPerformanceMetrics}),Ai}),Te}()},24624:(gr,Xt,X)=>{"use strict";X.d(Xt,{JD:()=>Vr,XH:()=>ze,UL:()=>Ut,hw:()=>ri,VW:()=>wt,iY:()=>$t,cw:()=>Qt,xc:()=>$e,H5:()=>sn,yG:()=>_r,C6:()=>li});var Te=X(10467),ke=X(60177),x=X(54438),c=X(10044),Q=X(21413);class pe extends Q.B{constructor(){super(...arguments),this._value=null,this._hasValue=!1,this._isComplete=!1}_checkFinalizedStatuses(ei){const{hasError:w,_hasValue:z,_value:Ee,thrownError:ft,isStopped:oi,_isComplete:mi}=this;w?ei.error(ft):(oi||mi)&&(z&&ei.next(Ee),ei.complete())}next(ei){this.isStopped||(this._value=ei,this._hasValue=!0)}complete(){const{_hasValue:ei,_value:w,_isComplete:z}=this;z||(this._isComplete=!0,ei&&super.next(w),super.complete())}}var Ct=X(18359),Ue=X(33726),Ce=X(61594),me=X(5964),ut=X(70152),Be=X(25558),He=X(99172),Ze=X(96354);
1const zt=["content"],Rt=["*"],xt=["container"];let Ie=(()=>{class Y{constructor(w){this.zone=w,this.mapCreated=new pe,this.mapLoaded=new pe,this.markersToRemove=[],this.popupsToRemove=[],this.imageIdsToRemove=[],this.subscription=new Ct.yU,this.mapCreated$=this.mapCreated.asObservable(),this.mapLoaded$=this.mapLoaded.asObservable()}setup(w){this.zone.onStable.pipe((0,Ce.$)()).subscribe(()=>{this.createMap(w.mapOptions),this.hookEvents(w.mapEvents),this.mapEvents=w.mapEvents,this.mapCreated.next(void 0),this.mapCreated.complete(),w.mapOptions.terrain&&this.mapInstance.on("load",()=>{this.updateTerrain(w.mapOptions.terrain)})})}destroyMap(){this.mapInstance&&(this.subscription.unsubscribe(),this.mapInstance.remove())}updateMinZoom(w){return this.zone.runOutsideAngular(()=>{this.mapInstance.setMinZoom(w)})}updateMaxZoom(w){return this.zone.runOutsideAngular(()=>{this.mapInstance.setMaxZoom(w)})}updateMinPitch(w){return this.zone.runOutsideAngular(()=>{this.mapInstance.setMinPitch(w)})}updateMaxPitch(w){return this.zone.runOutsideAngular(()=>{this.mapInstance.setMaxPitch(w)})}updateRenderWorldCopies(w){return this.zone.runOutsideAngular(()=>{this.mapInstance.setRenderWorldCopies(w)})}updateScrollZoom(w){return this.zone.runOutsideAngular(()=>{w?this.mapInstance.scrollZoom.enable():this.mapInstance.scrollZoom.disable()})}updateDragRotate(w){return this.zone.runOutsideAngular(()=>{w?this.mapInstance.dragRotate.enable():this.mapInstance.dragRotate.disable()})}updateTouchPitch(w){return this.zone.runOutsideAngular(()=>{w?this.mapInstance.touchPitch.enable():this.mapInstance.touchPitch.disable()})}updateTouchZoomRotate(w){return this.zone.runOutsideAngular(()=>{w?this.mapInstance.touchZoomRotate.enable():this.mapInstance.touchZoomRotate.disable()})}updateDoubleClickZoom(w){return this.zone.runOutsideAngular(()=>{w?this.mapInstance.doubleClickZoom.enable():this.mapInstance.doubleClickZoom.disable()})}updateKeyboard(w){return this.zone.runOutsideAngular(()=>{w?this.mapInstance.keyboard.enable():this.mapInstance.keyboard.disable()})}updateDragPan(w){return this.zone.runOutsideAngular(()=>{w?this.mapInstance.dragPan.enable():this.mapInstance.dragPan.disable()})}updateBoxZoom(w){return this.zone.runOutsideAngular(()=>{w?this.mapInstance.boxZoom.enable():this.mapInstance.boxZoom.disable()})}updateStyle(w){return this.zone.runOutsideAngular(()=>{this.mapInstance.setStyle(w)})}updateMaxBounds(w){return this.zone.runOutsideAngular(()=>{this.mapInstance.setMaxBounds(w)})}updateTerrain(w){return this.zone.runOutsideAngular(()=>{this.mapInstance.setTerrain(w)})}getTerrain(){return this.zone.runOutsideAngular(()=>this.mapInstance.getTerrain())}changeCanvasCursor(w){this.mapInstance.getCanvasContainer().style.cursor=w}queryRenderedFeatures(w,z){return this.mapInstance.queryRenderedFeatures(w,z)}panTo(w,z){return this.zone.runOutsideAngular(()=>{this.mapInstance.panTo(w,z)})}move(w,z,Ee,ft,oi,mi){return this.zone.runOutsideAngular(()=>{this.mapInstance[w]({...z,zoom:Ee??this.mapInstance.getZoom(),center:ft??this.mapInstance.getCenter(),bearing:oi??this.mapInstance.getBearing(),pitch:mi??this.mapInstance.getPitch()})})}addLayer(w,z,Ee){this.zone.runOutsideAngular(()=>{Object.keys(w.layerOptions).forEach(ft=>{void 0===w.layerOptions[ft]&&delete w.layerOptions[ft]}),this.mapInstance.addLayer(w.layerOptions,Ee),z&&(w.layerEvents.layerClick.observers.length&&this.mapInstance.on("click",w.layerOptions.id,ft=>{this.zone.run(()=>{w.layerEvents.layerClick.emit(ft)})}),w.layerEvents.layerDblClick.observers.length&&this.mapInstance.on("dblclick",w.layerOptions.id,ft=>{this.zone.run(()=>{w.layerEvents.layerDblClick.emit(ft)})}),w.layerEvents.layerMouseDown.observers.length&&this.mapInstance.on("mousedown",w.layerOptions.id,ft=>{this.zone.run(()=>{w.layerEvents.layerMouseDown.emit(ft)})}),w.layerEvents.layerMouseUp.observers.length&&this.mapInstance.on("mouseup",w.layerOptions.id,ft=>{this.zone.run(()=>{w.layerEvents.layerMouseUp.emit(ft)})}),w.layerEvents.layerMouseEnter.observers.length&&this.mapInstance.on("mouseenter",w.layerOptions.id,ft=>{this.zone.run(()=>{w.layerEvents.layerMouseEnter.emit(ft)})}),w.layerEvents.layerMouseLeave.observers.length&&this.mapInstance.on("mouseleave",w.layerOptions.id,ft=>{this.zone.run(()=>{w.layerEvents.layerMouseLeave.emit(ft)})}),w.layerEvents.layerMouseMove.observers.length&&this.mapInstance.on("mousemove",w.layerOptions.id,ft=>{this.zone.run(()=>{w.layerEvents.layerMouseMove.emit(ft)})}),w.layerEvents.layerMouseOver.observers.length&&this.mapInstance.on("mouseover",w.layerOptions.id,ft=>{this.zone.run(()=>{w.layerEvents.layerMouseOver.emit(ft)})}),w.layerEvents.layerMouseOut.observers.length&&this.mapInstance.on("mouseout",w.layerOptions.id,ft=>{this.zone.run(()=>{w.layerEvents.layerMouseOut.emit(ft)})}),w.layerEvents.layerContextMenu.observers.length&&this.mapInstance.on("contextmenu",w.layerOptions.id,ft=>{this.zone.run(()=>{w.layerEvents.layerContextMenu.emit(ft)})}),w.layerEvents.layerTouchStart.observers.length&&this.mapInstance.on("touchstart",w.layerOptions.id,ft=>{this.zone.run(()=>{w.layerEvents.layerTouchStart.emit(ft)})}),w.layerEvents.layerTouchEnd.observers.length&&this.mapInstance.on("touchend",w.layerOptions.id,ft=>{this.zone.run(()=>{w.layerEvents.layerTouchEnd.emit(ft)})}),w.layerEvents.layerTouchCancel.observers.length&&this.mapInstance.on("touchcancel",w.layerOptions.id,ft=>{this.zone.run(()=>{w.layerEvents.layerTouchCancel.emit(ft)})}))})}removeLayer(w){this.zone.runOutsideAngular(()=>{null!=this.mapInstance.getLayer(w)&&this.mapInstance.removeLayer(w)})}addMarker(w){const z={offset:w.markersOptions.offset,anchor:w.markersOptions.anchor,draggable:!!w.markersOptions.draggable,rotationAlignment:w.markersOptions.rotationAlignment,pitchAlignment:w.markersOptions.pitchAlignment,clickTolerance:w.markersOptions.clickTolerance};w.markersOptions.element.childNodes.length>0&&(z.element=w.markersOptions.element);const Ee=new c.Marker(z);return w.markersEvents.markerDragStart.observers.length&&Ee.on("dragstart",oi=>{if(oi){const{target:mi}=oi;this.zone.run(()=>{w.markersEvents.markerDragStart.emit(mi)})}}),w.markersEvents.markerDrag.observers.length&&Ee.on("drag",oi=>{if(oi){const{target:mi}=oi;this.zone.run(()=>{w.markersEvents.markerDrag.emit(mi)})}}),w.markersEvents.markerDragEnd.observers.length&&Ee.on("dragend",oi=>{if(oi){const{target:mi}=oi;this.zone.run(()=>{w.markersEvents.markerDragEnd.emit(mi)})}}),Ee.setLngLat(w.markersOptions.feature?w.markersOptions.feature.geometry.coordinates:w.markersOptions.lngLat),this.zone.runOutsideAngular(()=>(Ee.addTo(this.mapInstance),Ee))}removeMarker(w){this.markersToRemove.push(w)}createPopup(w,z){return this.zone.runOutsideAngular(()=>
1{Object.keys(w.popupOptions).forEach(ft=>void 0===w.popupOptions[ft]&&delete w.popupOptions[ft]);const Ee=new c.Popup(w.popupOptions);return Ee.setDOMContent(z),w.popupEvents.popupClose.observers.length&&Ee.on("close",()=>{this.zone.run(()=>{w.popupEvents.popupClose.emit()})}),w.popupEvents.popupOpen.observers.length&&Ee.on("open",()=>{this.zone.run(()=>{w.popupEvents.popupOpen.emit()})}),Ee})}addPopupToMap(w,z,Ee=!1){return this.zone.runOutsideAngular(()=>{Ee&&w._listeners&&delete w._listeners.open,w.setLngLat(z),w.addTo(this.mapInstance)})}addPopupToMarker(w,z){return this.zone.runOutsideAngular(()=>{w.setPopup(z)})}removePopupFromMap(w,z=!1){z&&w._listeners&&delete w._listeners.close,this.popupsToRemove.push(w)}removePopupFromMarker(w){return this.zone.runOutsideAngular(()=>{w.setPopup(void 0)})}addControl(w,z){return this.zone.runOutsideAngular(()=>{this.mapInstance.addControl(w,z)})}removeControl(w){return this.zone.runOutsideAngular(()=>{this.mapInstance.removeControl(w)})}loadAndAddImage(w,z,Ee){var ft=this;return(0,Te.A)(function*(){return ft.zone.runOutsideAngular(()=>new Promise((oi,mi)=>{ft.mapInstance.loadImage(z,(ki,Mr)=>{ki?mi(ki):(ft.addImage(w,Mr,Ee),oi())})}))})()}addImage(w,z,Ee){return this.zone.runOutsideAngular(()=>{this.mapInstance.addImage(w,z,Ee)})}removeImage(w){this.imageIdsToRemove.push(w)}addSource(w,z){return this.zone.runOutsideAngular(()=>{Object.keys(z).forEach(Ee=>void 0===z[Ee]&&delete z[Ee]),this.mapInstance.addSource(w,z)})}getSource(w){return this.mapInstance.getSource(w)}removeSource(w){this.zone.runOutsideAngular(()=>{this.findLayersBySourceId(w).forEach(z=>this.mapInstance.removeLayer(z.id)),this.mapInstance.removeSource(w)})}setAllLayerPaintProperty(w,z){return this.zone.runOutsideAngular(()=>{Object.keys(z).forEach(Ee=>{this.mapInstance.setPaintProperty(w,Ee,z[Ee])})})}setAllLayerLayoutProperty(w,z){return this.zone.runOutsideAngular(()=>{Object.keys(z).forEach(Ee=>{this.mapInstance.setLayoutProperty(w,Ee,z[Ee])})})}setLayerFilter(w,z){return this.zone.runOutsideAngular(()=>{this.mapInstance.setFilter(w,z)})}setLayerBefore(w,z){return this.zone.runOutsideAngular(()=>{this.mapInstance.moveLayer(w,z)})}setLayerZoomRange(w,z,Ee){return this.zone.runOutsideAngular(()=>{this.mapInstance.setLayerZoomRange(w,z||0,Ee||20)})}fitBounds(w,z){return this.zone.runOutsideAngular(()=>{this.mapInstance.fitBounds(w,z)})}fitScreenCoordinates(w,z,Ee){return this.zone.runOutsideAngular(()=>{this.mapInstance.fitScreenCoordinates(w[0],w[1],z,Ee)})}applyChanges(){this.zone.runOutsideAngular(()=>{this.removeMarkers(),this.removePopups(),this.removeImages()})}createMap(w){x.SKi.assertNotInAngularZone(),Object.keys(w).forEac
1h(Ee=>{void 0===w[Ee]&&delete w[Ee]}),this.mapInstance=new c.Map(w),window&&/msie\s|trident\/|edge\//i.test(window.navigator.userAgent)&&this.mapInstance.setStyle(w.style),this.subscription.add(this.zone.onMicrotaskEmpty.subscribe(()=>this.applyChanges()))}removeMarkers(){for(const w of this.markersToRemove)w.remove();this.markersToRemove=[]}removePopups(){for(const w of this.popupsToRemove)w.remove();this.popupsToRemove=[]}removeImages(){for(const w of this.imageIdsToRemove)this.mapInstance.removeImage(w);this.imageIdsToRemove=[]}findLayersBySourceId(w){const z=this.mapInstance.getStyle().layers;return null==z?[]:z.filter(Ee=>"source"in Ee&&Ee.source===w)}hookEvents(w){this.mapInstance.on("load",z=>{this.mapLoaded.next(void 0),this.mapLoaded.complete(),this.zone.run(()=>{w.mapLoad.emit(z.target)})}),w.mapResize.observers.length&&this.mapInstance.on("resize",z=>this.zone.run(()=>{w.mapResize.emit(z)})),w.mapRemove.observers.length&&this.mapInstance.on("remove",z=>this.zone.run(()=>{w.mapRemove.emit(z)})),w.mapMouseDown.observers.length&&this.mapInstance.on("mousedown",z=>this.zone.run(()=>{w.mapMouseDown.emit(z)})),w.mapMouseUp.observers.length&&this.mapInstance.on("mouseup",z=>this.zone.run(()=>{w.mapMouseUp.emit(z)})),w.mapMouseMove.observers.length&&this.mapInstance.on("mousemove",z=>this.zone.run(()=>{w.mapMouseMove.emit(z)})),w.mapClick.observers.length&&this.mapInstance.on("click",z=>this.zone.run(()=>{w.mapClick.emit(z)})),w.mapDblClick.observers.length&&this.mapInstance.on("dblclick",z=>this.zone.run(()=>{w.mapDblClick.emit(z)})),w.mapMouseOver.observers.length&&this.mapInstance.on("mouseover",z=>this.zone.run(()=>{w.mapMouseOver.emit(z)})),w.mapMouseOut.observers.length&&this.mapInstance.on("mouseout",z=>this.zone.run(()=>{w.mapMouseOut.emit(z)})),w.mapContextMenu.observers.length&&this.mapInstance.on("contextmenu",z=>this.zone.run(()=>{w.mapContextMenu.emit(z)})),w.mapTouchStart.observers.length&&this.mapInstance.on("touchstart",z=>this.zone.run(()=>{w.mapTouchStart.emit(z)})),w.mapTouchEnd.observers.length&&this.mapInstance.on("touchend",z=>this.zone.run(()=>{w.mapTouchEnd.emit(z)})),w.mapTouchMove.observers.length&&this.mapInstance.on("touchmove",z=>this.zone.run(()=>{w.mapTouchMove.emit(z)})),w.mapTouchCancel.observers.length&&this.mapInstance.on("touchcancel",z=>this.zone.run(()=>{w.mapTouchCancel.emit(z)})),w.mapWheel.observers.length&&this.mapInstance.on("wheel",z=>this.zone.run(()=>{w.mapWheel.emit(z)})),w.moveStart.observers.length&&this.mapInstance.on("movestart",z=>this.zone.run(()=>w.moveStart.emit(z))),w.move.observers.length&&this.mapInstance.on("move",z=>this.zone.run(()=>w.move.emit(z))),w.moveEnd.observers.length&&this.mapInstance.on("moveend",z=>this.zone.run(()=>w.moveEnd.emit(z))),w.mapDragStart.observers.length&&this.mapInstance.on("dragstart",z=>this.zone.run(()=>{w.mapDragStart.emit(z)})),w.mapDrag.observers.length&&this.mapInstance.on("drag",z=>this.zone.run(()=>{w.mapDrag.emit(z)})),w.mapDragEnd.observers.length&&this.mapInstance.on("dragend",z=>this.zone.run(()=>{w.mapDragEnd.emit(z)})),w.zoomStart.observers.length&&this.mapInstance.on("zoomstart",z=>this.zone.run(()=>w.zoomStart.emit(z))),w.zoomEvt.observers.length&&this.mapInstance.on("zoom",z=>this.zone.run(()=>w.zoomEvt.emit(z))),w.zoomEnd.observers.length&&this.mapInstance.on("zoomend",z=>this.zone.run(()=>w.zoomEnd.emit(z))),w.rotateStart.observers.length&&this.mapInstance.on("rotatestart",z=>this.zone.run(()=>w.rotateStart.emit(z))),w.rotate.observers.length&&this.mapInstance.on("rotate",z=>this.zone.run(()=>w.rotate.emit(z))),w.rotateEnd.observers.length&&this.mapInstance.on("rotateend",z=>this.zone.run(()=>w.rotateEnd.emit(z))),w.pitchStart.observers.length&&this.mapInstance.on("pitchstart",z=>this.zone.run(()=>w.pitchStart.emit(z))),w.pitchEvt.observers.length&&this.mapInstance.on("pitch",z=>this.zone.run(()=>w.pitchEvt.emit(z))),w.pitchEnd.observers.length&&this.mapInstance.on("pitchend",z=>this.zone.run(()=>w.pitchEnd.emit(z))),w.boxZoomStart.observers.length&&this.mapInstance.on("boxzoomstart",z=>this.zone.run(()=>w.boxZoomStart.emit(z))),w.boxZoomEnd.observers.length&&this.mapInstance.on("boxzoomend",z=>this.zone.run(()=>w.boxZoomEnd.emit(z))),w.boxZoomCancel.observers.length&&this.mapInstance.on("boxzoomcancel",z=>this.zone.run(()=>w.boxZoomCancel.emit(z))),w.webGlContextLost.observers.length&&this.mapInstance.on("webglcontextlost",z=>this.zone.run(()=>w.webGlContextLost.emit(z))),w.webGlContextRestored.observers.length&&this.mapInstance.on("webglcontextrestored",z=>this.zone.run(()=>w.webGlContextRestored.emit(z))),w.render.observers.length&&this.mapInstance.on("render",z=>this.zone.run(()=>w.render.emit(z))),w.mapError.observers.length&&this.mapInstance.on("error",z=>this.zone.run(()=>{w.mapError.emit(z)})),w.data.observers.length&&this.mapInstance.on("data",z=>this.zone.run(()=>w.data.emit(z))),w.styleData.observers.length&&this.mapInstance.on("styledata",z=>this.zone.run(()=>w.styleData.emit(z))),w.sourceData.observers.length&&this.mapInstance.on("sourcedata",z=>this.zone.run(()=>w.sourceData.emit(z))),w.dataLoading.observers.length&&this.mapInstance.on("dataloading",z=>this.zone.run(()=>w.dataLoading.emit(z))),w.styleDataLoading.observers.length&&this.mapInstance.on("styledataloading",z=>this.zone.run(()=>w.styleDataLoading.emit(z))),w.sourceDataLoading.observers.length&&this.mapInstance.on("sourcedataloading",z=>this.zone.run(()=>w.sourceDataLoading.emit(z))),w.styleImageMissing.observers.length&&this.mapInstance.on("styleimagemissing",z=>this.zone.run(()=>w.styleImageMissing.emit(z))),w.idle.observers.length&&this.mapInstance.on("idle",z=>this.zone.run(()=>w.idle.emit(z)))}static{this.\u0275fac=function(z){return new(z||Y)(x.KVO(x.SKi))}}static{this.\u0275prov=x.jDH({token:Y,factory:Y.\u0275fac})}}return Y})();class Qe{constructor(ei){this.container=ei}onAdd(){return this.container}onRemove(){return this.container.parentNode.removeChild(this.container)}getDefaultPosition(){return"top-right"}}let ze=(()=>{class Y{constructor(w){this.mapService=w}ngAfterContentInit(){this.content.nativeElement.childNodes.length&&(this.control=new Qe(this.content.nativeElement),this.mapService.mapCreated$.subscribe(()=>{this.mapService.addControl(this.control,this.position)}))}ngOnDestroy(){this.mapService.mapInstance.hasControl(this.control)&&this.mapService.removeControl(this.control)}static{this.\u0275fac=function(z){return new(z||Y)(x.rXU(Ie))}}static{this.\u0275cmp=x.VBU({type:Y,selectors:[["mgl-control"]],viewQuery:function(z,Ee){if(1&z&&x.GBs(zt,7),2&z){let ft;x.mGM(ft=x.lsd())&&(Ee.content=ft.first)}},inputs:{position:"position"},ngContentSelectors:Rt,decls:3,vars:0,consts:[["content",""],[1,"maplibregl-ctrl"]],template:function(z,Ee){1&z&&(x.NAR(),x.j41(0,"div",1,0),x.SdG(2),x.k0s())},encapsulation:2,changeDetection:0})}}return Y})(),$e=(()=>{class Y{constructor(w,z){this.mapService=w,this.controlComponent=z}ngAfterContentInit(){this.mapService.mapCreated$.subscribe(()=>{if(this.controlComponent.control)throw new Error("Another control is already set for this control");const w={};void 0!==this.showCompass&&(w.showCompass=this.showCompass),void 0!==this.showZoom&&(w.showZoom=this.showZoom),null!=this.visualizePitch&&(w.visualizePitch=this.visualizePitch),this.controlComponent.control=new c.NavigationControl(w),this.mapService.addControl(this.controlComponent.control,this.controlComponent.position)})}static{this.\u0275fac=function(z){return new(z||Y)(x.rXU(Ie),x.rXU(ze,1))}}static{this.\u0275dir=x.FsC({type:Y,selectors:[["","mglNavigation",""]],inputs:{showCompass:"showCompass",showZoom:"showZoom",visualizePitch:"visualizePitch"}})}}return Y})(),Ut=(()=>{class Y{constructor(w,z){this.mapService=w,this.zone=z,this.type="geojson",this.updateFeatureData=new Q.B,this.sub=new Ct.yU,this.sourceAdded=!1,this.featureIdCounter=0}ngOnInit(){this.data||(this.data={type:"FeatureCollection",features:[]});const w=this.mapService.mapLoaded$.subscribe(()=>{this.init();const z=(0,Ue.R)(this.mapService.mapInstance,"styledata").pipe((0,me.p)(()=>
1!this.mapService.mapInstance.getSource(this.id))).subscribe(()=>{this.init()});this.sub.add(z)});this.sub.add(w)}ngOnChanges(w){if(this.sourceAdded&&((w.maxzoom&&!w.maxzoom.isFirstChange()||w.attribution&&!w.attribution.isFirstChange()||w.buffer&&!w.buffer.isFirstChange()||w.tolerance&&!w.tolerance.isFirstChange()||w.cluster&&!w.cluster.isFirstChange()||w.clusterRadius&&!w.clusterRadius.isFirstChange()||w.clusterMaxZoom&&!w.clusterMaxZoom.isFirstChange()||w.clusterMinPoints&&!w.clusterMinPoints.isFirstChange()||w.clusterProperties&&!w.clusterProperties.isFirstChange()||w.lineMetrics&&!w.lineMetrics.isFirstChange()||w.generateId&&!w.generateId.isFirstChange()||w.promoteId&&!w.promoteId.isFirstChange()||w.filter&&!w.filter.isFirstChange())&&(this.ngOnDestroy(),this.ngOnInit()),w.data&&!w.data.isFirstChange())){const z=this.mapService.getSource(this.id);if(void 0===z)return;z.setData(this.data)}}ngOnDestroy(){this.sub.unsubscribe(),this.sourceAdded&&(this.mapService.removeSource(this.id),this.sourceAdded=!1)}getClusterExpansionZoom(w){var z=this;return(0,Te.A)(function*(){const Ee=z.mapService.getSource(z.id);return z.zone.run((0,Te.A)(function*(){return new Promise((ft,oi)=>{Ee.getClusterExpansionZoom(w,(mi,ki)=>{mi?oi(mi):ft(ki)})})}))})()}getClusterChildren(w){var z=this;return(0,Te.A)(function*(){const Ee=z.mapService.getSource(z.id);return z.zone.run((0,Te.A)(function*(){return new Promise((ft,oi)=>{Ee.getClusterChildren(w,(mi,ki)=>{mi?oi(mi):ft(ki)})})}))})()}getClusterLeaves(w,z,Ee){var ft=this;return(0,Te.A)(function*(){const oi=ft.mapService.getSource(ft.id);return ft.zone.run((0,Te.A)(function*(){return new Promise((mi,ki)=>{oi.getClusterLeaves(w,z,Ee,(Mr,yr)=>{Mr?ki(Mr):mi(yr)})})}))})()}_addFeature(w){this.data.features.push(w),this.updateFeatureData.next(void 0)}_removeFeature(w){const z=this.data,Ee=z.features.indexOf(w);Ee>-1&&z.features.splice(Ee,1),this.updateFeatureData.next(void 0)}_getNewFeatureId(){return++this.featureIdCounter}init(){this.mapService.addSource(this.id,{type:"geojson",data:this.data,maxzoom:this.maxzoom,attribution:this.attribution,buffer:this.buffer,tolerance:this.tolerance,cluster:this.cluster,clusterRadius:this.clusterRadius,clusterMaxZoom:this.clusterMaxZoom,clusterMinPoints:this.clusterMinPoints,clusterProperties:this.clusterProperties,lineMetrics:this.lineMetrics,generateId:this.generateId,promoteId:this.promoteId,filter:this.filter});const z=this.updateFeatureData.pipe((0,ut.B)(0)).subscribe(()=>{const Ee=this.mapService.getSource(this.id);void 0!==Ee&&Ee.setData(this.data)});this.sub.add(z),this.sourceAdded=!0}static{this.\u0275fac=function(z){return new(z||Y)(x.rXU(Ie),x.rXU(x.SKi))}}static{this.\u0275cmp=x.VBU({type:Y,selectors:[["mgl-geojson-source"]],inputs:{id:"id",data:"data",maxzoom:"maxzoom",attribution:"attribution",buffer:"buffer",tolerance:"tolerance",cluster:"cluster",clusterRadius:"clusterRadius",clusterMaxZoom:"clusterMaxZoom",clusterMinPoints:"clusterMinPoints",clusterProperties:"clusterProperties",lineMetrics:"lineMetrics",generateId:"generateId",promoteId:"promoteId",filter:"filter"},features:[x.OA$],decls:0,vars:0,template:function(z,Ee){},encapsulation:2,changeDetection:0})}}return Y})(),ri=(()=>{class Y{constructor(w,z){this.mapService=w,this.zone=z,this.imageError=new x.bkB,this.imageLoaded=new x.bkB,this.isAdded=!1,this.isAdding=!1}ngOnInit(){this.sub=this.mapService.mapLoaded$.pipe((0,Be.n)(()=>(0,Ue.R)(this.mapService.mapInstance,"styledata").pipe((0,He.Z)(void 0),(0,me.p)(()=>!this.isAdding&&!this.mapService.mapInstance.hasImage(this.id))))).subscribe(()=>this.init())}ngOnChanges(w){(w.data&&!w.data.isFirstChange()||w.options&&!w.options.isFirstChange()||w.url&&!w.url.isFirstChange())&&(this.ngOnDestroy(),this.ngOnInit())}ngOnDestroy(){this.isAdded&&this.mapService.removeImage(this.id),this.sub&&this.sub.unsubscribe()}init(){var w=this;return(0,Te.A)(function*(){if(w.isAdding=!0,w.data)w.mapService.addImage(w.id,w.data,w.options),w.isAdded=!0,w.isAdding=!1;else if(w.url)try{yield w.mapService.loadAndAddImage(w.id,w.url,w.options),w.isAdded=!0,w.isAdding=!1,w.zone.run(()=>{w.imageLoaded.emit()})}catch(z){w.zone.run(()=>{w.imageError.emit(z)})}})()}static{this.\u0275fac=function(z){return new(z||Y)(x.rXU(Ie),x.rXU(x.SKi))}}static{this.\u0275cmp=x.VBU({type:Y,selectors:[["mgl-image"]],inputs:{id:"id",data:"data",options:"options",url:"url"},outputs:{imageError:"imageError",imageLoaded:"imageLoaded"},features:[x.OA$],decls:0,vars:0,template:function(z,Ee){},encapsulation:2})}}return Y})(),wt=(()=>{class Y{constructor(w){this.mapService=w,this.layerClick=new x.bkB,this.layerDblClick=new x.bkB,this.layerMouseDown=new x.bkB,this.layerMouseUp=new x.bkB,this.layerMouseEnter=new x.bkB,this.layerMouseLeave=new x.bkB,this.layerMouseMove=new x.bkB,this.layerMouseOver=new x.bkB,this.layerMouseOut=new x.bkB,this.layerContextMenu=new x.bkB,this.layerTouchStart=new x.bkB,this.layerTouchEnd=new x.bkB,this.layerTouchCancel=ne
1w x.bkB,this.layerAdded=!1}ngOnInit(){this.sub=this.mapService.mapLoaded$.pipe((0,Be.n)(()=>(0,Ue.R)(this.mapService.mapInstance,"styledata").pipe((0,Ze.T)(()=>!1),(0,me.p)(()=>!this.mapService.mapInstance.getLayer(this.id)),(0,He.Z)(!0)))).subscribe(w=>this.init(w))}ngOnChanges(w){this.layerAdded&&(w.paint&&!w.paint.isFirstChange()&&this.mapService.setAllLayerPaintProperty(this.id,w.paint.currentValue),w.layout&&!w.layout.isFirstChange()&&this.mapService.setAllLayerLayoutProperty(this.id,w.layout.currentValue),w.filter&&!w.filter.isFirstChange()&&this.mapService.setLayerFilter(this.id,w.filter.currentValue),w.before&&!w.before.isFirstChange()&&this.mapService.setLayerBefore(this.id,w.before.currentValue),(w.minzoom&&!w.minzoom.isFirstChange()||w.maxzoom&&!w.maxzoom.isFirstChange())&&this.mapService.setLayerZoomRange(this.id,this.minzoom,this.maxzoom))}ngOnDestroy(){this.layerAdded&&(this.mapService.removeLayer(this.id),void 0!==this.sourceIdAdded&&this.mapService.getSource(this.sourceIdAdded)&&this.mapService.removeSource(this.sourceIdAdded)),this.sub&&this.sub.unsubscribe()}
1init(w){const z={layerOptions:{id:this.id,type:this.type,source:this.source,metadata:this.metadata,"source-layer":this.sourceLayer,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this.layout,paint:this.paint},layerEvents:{layerClick:this.layerClick,layerDblClick:this.layerDblClick,layerMouseDown:this.layerMouseDown,layerMouseUp:this.layerMouseUp,layerMouseEnter:this.layerMouseEnter,layerMouseLeave:this.layerMouseLeave,layerMouseMove:this.layerMouseMove,layerMouseOver:this.layerMouseOver,layerMouseOut:this.layerMouseOut,layerContextMenu:this.layerContextMenu,layerTouchStart:this.layerTouchStart,layerTouchEnd:this.layerTouchEnd,layerTouchCancel:this.layerTouchCancel}};this.removeSource&&"string"!=typeof this.source&&void 0===this.mapService.getSource(this.id)&&(this.sourceIdAdded=this.id),this.mapService.addLayer(z,w,this.before),void 0!==this.sourceIdAdded&&void 0===this.mapService.getSource(this.sourceIdAdded)&&(this.sourceIdAdded=void 0),this.layerAdded=!0}static{this.\u0275fac=function(z){return new(z||Y)(x.rXU(Ie))}}static{this.\u0275cmp=x.VBU({type:Y,selectors:[["mgl-layer"]],inputs:{id:"id",source:"source",type:"type",metadata:"metadata",sourceLayer:"sourceLayer",removeSource:"removeSource",filter:"filter",layout:"layout",paint:"paint",before:"before",minzoom:"minzoom",maxzoom:"maxzoom"},outputs:{layerClick:"layerClick",layerDblClick:"layerDblClick",layerMouseDown:"layerMouseDown",layerMouseUp:"layerMouseUp",layerMouseEnter:"layerMouseEnter",layerMouseLeave:"layerMouseLeave",layerMouseMove:"layerMouseMove",layerMouseOver:"layerMouseOver",layerMouseOut:"layerMouseOut",layerContextMenu:"layerContextMenu",layerTouchStart:"layerTouchStart",layerTouchEnd:"layerTouchEnd",layerTouchCancel:"layerTouchCancel"},features:[x.OA$],decls:0,vars:0,template:function(z,Ee){},encapsulation:2})}}return Y})(),$t=(()=>{class Y{get mapInstance(){return this.mapService.mapInstance}constructor(w){this.mapService=w,this.movingMethod="flyTo",this.mapResize=new x.bkB,this.mapRemove=new x.bkB,this.mapMouseDown=new x.bkB,this.mapMouseUp=new x.bkB,this.mapMouseMove=new x.bkB,this.mapClick=new x.bkB,this.mapDblClick=new x.bkB,this.mapMouseOver=new x.bkB,this.mapMouseOut=new x.bkB,this.mapContextMenu=new x.bkB,this.mapTouchStart=new x.bkB,this.mapTouchEnd=new x.bkB,this.mapTouchMove=new x.bkB,this.mapTouchCancel=new x.bkB,this.mapWheel=new x.bkB,this.moveStart=new x.bkB,this.move=new x.bkB,this.moveEnd=new x.bkB,this.mapDragStart=new x.bkB,this.mapDrag=new x.bkB,this.mapDragEnd=new x.bkB,this.zoomStart=new x.bkB,this.zoomEvt=new x.bkB,this.zoomEnd=new x.bkB,this.rotateStart=new x.bkB,this.rotate=new x.bkB,this.rotateEnd=new x.bkB,this.pitchStart=new x.bkB,this.pitchEvt=new x.bkB,this.pitchEnd=new x.bkB,this.boxZoomStart=new x.bkB,this.boxZoomEnd=new x.bkB,this.boxZoomCancel=new x.bkB,this.webGlContextLost=new x.bkB,this.webGlContextRestored=new x.bkB,this.mapLoad=new x.bkB,this.idle=new x.bkB,this.render=new x.bkB,this.mapError=ne
1w x.bkB,this.data=new x.bkB,this.styleData=new x.bkB,this.sourceData=new x.bkB,this.dataLoading=new x.bkB,this.styleDataLoading=new x.bkB,this.sourceDataLoading=new x.bkB,this.styleImageMissing=new x.bkB}ngAfterViewInit(){this.mapService.setup({mapOptions:{collectResourceTiming:this.collectResourceTiming,container:this.mapContainer.nativeElement,crossSourceCollisions:this.crossSourceCollisions,fadeDuration:this.fadeDuration,minZoom:this.minZoom,maxZoom:this.maxZoom,minPitch:this.minPitch,maxPitch:this.maxPitch,style:this.style,hash:this.hash,interactive:this.interactive,bearingSnap:this.bearingSnap,pitchWithRotate:this.pitchWithRotate,clickTolerance:this.clickTolerance,attributionControl:this.attributionControl,logoPosition:this.logoPosition,failIfMajorPerformanceCaveat:this.failIfMajorPerformanceCaveat,preserveDrawingBuffer:this.preserveDrawingBuffer,refreshExpiredTiles:this.refreshExpiredTiles,maxBounds:this.maxBounds,scrollZoom:this.scrollZoom,boxZoom:this.boxZoom,dragRotate:this.dragRotate,dragPan:this.dragPan,keyboard:this.keyboard,doubleClickZoom:this.doubleClickZoom,touchPitch:this.touchPitch,touchZoomRotate:this.touchZoomRotate,trackResize:this.trackResize,center:this.center,zoom:this.zoom,bearing:this.bearing,pitch:this.pitch,renderWorldCopies:this.renderWorldCopies,maxTileCacheSize:this.maxTileCacheSize,localIdeographFontFamily:this.localIdeographFontFamily,transformRequest:this.transformRequest,bounds:this.bounds?this.bounds:this.fitBounds,fitBoundsOptions:this.fitBoundsOptions,antialias:this.antialias,locale:this.locale,cooperativeGestures:this.cooperativeGestures,terrain:this.terrain},mapEvents:this}),this.cursorStyle&&this.mapService.changeCanvasCursor(this.cursorStyle)}ngOnDestroy(){this.mapService.destroyMap()}ngOnChanges(w){var z=this;return(0,Te.A)(function*(){yield z.mapService.mapCreated$.toPromise(),w.cursorStyle&&!w.cursorStyle.isFirstChange()&&z.mapService.changeCanvasCursor(w.cursorStyle.currentValue),w.minZoom&&!w.minZoom.isFirstChange()&&z.mapService.updateMinZoom(w.minZoom.currentValue),w.maxZoom&&!w.maxZoom.isFirstChange()&&z.mapService.updateMaxZoom(w.maxZoom.currentValue),w.minPitch&&!w.minPitch.isFirstChange()&&z.mapService.updateMinPitch(w.minPitch.currentValue),w.maxPitch&&!w.maxPitch.isFirstChange()&&z.mapService.updateMaxPitch(w.maxPitch.currentValue),w.renderWorldCopies&&!w.renderWorldCopies.isFirstChange()&&z.mapService.updateRenderWorldCopies(w.renderWorldCopies.currentValue),w.scrollZoom&&!w.scrollZoom.isFirstChange()&&z.mapService.updateScrollZoom(w.scrollZoom.currentValue),w.dragRotate&&!w.dragRotate.isFirstChange()&&z.mapService.updateDragRotate(w.dragRotate.currentValue),w.touchPitch&&!w.touchPitch.isFirstChange()&&z.mapService.updateTouchPitch(w.touchPitch.currentValue),w.touchZoomRotate&&!w.touchZoomRotate.isFirstChange()&&z.mapService.updateTouchZoomRotate(w.touchZoomRotate.currentValue),w.doubleClickZoom&&!w.doubleClickZoom.isFirstChange()&&z.mapService.updateDoubleClickZoom(w.doubleClickZoom.currentValue),w.keyboard&&!w.keyboard.isFirstChange()&&z.mapService.updateKeyboard(w.keyboard.currentValue),w.dragPan&&!w.dragPan.isFirstChange()&&z.mapService.updateDragPan(w.dragPan.currentValue),w.boxZoom&&!w.boxZoom.isFirstChange()&&z.mapService.updateBoxZoom(w.boxZoom.currentValue),w.style&&!w.style.isFirstChange()&&z.mapService.updateStyle(w.style.currentValue),w.maxBounds&&!w.maxBounds.isFirstChange()&&z.mapService.updateMaxBounds(w.maxBounds.currentValue),w.fitBounds&&w.fitBounds.currentValue&&!w.fitBounds.isFirstChange()&&z.mapService.fitBounds(w.fitBounds.currentValue,z.fitBoundsOptions),w.fitScreenCoordinates&&w.fitScreenCoordinates.currentValue&&((z.center||z.zoom||z.pitch||z.fitBounds)&&w.fitScreenCoordinates.isFirstChange()&&console.warn("[ngx-maplibre-gl] center / zoom / pitch / fitBounds inputs are being overridden by fitScreenCoordinates input"),z.mapService.fitScreenCoordinates(w.fitScreenCoordinates.currentValue,z.bearing?z.bearing[0]:0,z.movingOptions)),!z.centerWithPanTo||!w.center||w.center.isFirstChange()||w.zoom||w.bearing||w.pitch?(w.center&&!w.center.isFirstChange()||w.zoom&&!w.zoom.isFirstChange()||w.bearing&&!w.bearing.isFirstChange()&&!w.fitScreenCoordinates||w.pitch&&!w.pitch.isFirstChange())&&z.mapService.move(z.movingMethod,z.movingOptions,w.zoom&&z.zoom?z.zoom[0]:void 0,w.center?z.center:void 0,w.bearing&&z.bearing?z.bearing[0]:void 0,w.pitch&&z.pitch?z.pitch[0]:void 0):z.mapService.panTo(z.center,z.panToOptions),w.terrain&&!w.terrain.isFirstChange()&&z.mapService.updateTerrain(w.terrain.currentValue)})()}static{this.\u0275fac=function(z){return new(z||Y)(x.rXU(Ie))}}static{this.\u0275cmp=x.VBU({type:Y,selectors:[["mgl-map"]],viewQuery:function(z,Ee){if(1&z&&x.GBs(xt,7),2&z){let ft;x.mGM(ft=x.lsd())&&(Ee.mapContainer=ft.first)}},inputs:{collectResourceTiming:"collectResourceTiming",crossSourceCollisions:"crossSourceCollisions",customMapboxApiUrl:"customMapboxApiUrl",fadeDuration:"fadeDuration",hash:"hash",refreshExpiredTiles:"refreshExpiredTiles",failIfMajorPerformanceCaveat:"failIfMajorPerformanceCaveat",bearingSnap:"bearingSnap",interactive:"interactive",pitchWithRotate:"pitchWithRotate",clickTolerance:"clickTolerance",attributionControl:"attributionControl",logoPosition:"logoPosition",maxTileC
1acheSize:"maxTileCacheSize",localIdeographFontFamily:"localIdeographFontFamily",preserveDrawingBuffer:"preserveDrawingBuffer",trackResize:"trackResize",transformRequest:"transformRequest",bounds:"bounds",antialias:"antialias",locale:"locale",cooperativeGestures:"cooperativeGestures",minZoom:"minZoom",maxZoom:"maxZoom",minPitch:"minPitch",maxPitch:"maxPitch",scrollZoom:"scrollZoom",dragRotate:"dragRotate",touchPitch:"touchPitch",touchZoomRotate:"touchZoomRotate",doubleClickZoom:"doubleClickZoom",keyboard:"keyboard",dragPan:"dragPan",boxZoom:"boxZoom",style:"style",center:"center",maxBounds:"maxBounds",zoom:"zoom",bearing:"bearing",pitch:"pitch",fitBoundsOptions:"fitBoundsOptions",renderWorldCopies:"renderWorldCopies",movingMethod:"movingMethod",movingOptions:"movingOptions",terrain:"terrain",fitBounds:"fitBounds",fitScreenCoordinates:"fitScreenCoordinates",centerWithPanTo:"centerWithPanTo",panToOptions:"panToOptions",cursorStyle:"cursorStyle"},outputs:{mapResize:"mapResize",mapRemove:"mapRemove",mapMouseDown:"mapMouseDown",mapMouseUp:"mapMouseUp",mapMouseMove:"mapMouseMove",mapClick:"mapClick",mapDblClick:"mapDblClick",mapMouseOver:"mapMouseOver",mapMouseOut:"mapMouseOut",mapContextMenu:"mapContextMenu",mapTouchStart:"mapTouchStart",mapTouchEnd:"mapTouchEnd",mapTouchMove:"mapTouchMove",mapTouchCancel:"mapTouchCancel",mapWheel:"mapWheel",moveStart:"moveStart",move:"move",moveEnd:"moveEnd",mapDragStart:"mapDragStart",mapDrag:"mapDrag",mapDragEnd:"mapDragEnd",zoomStart:"zoomStart",zoomEvt:"zoomEvt",zoomEnd:"zoomEnd",rotateStart:"rotateStart",rotate:"rotate",rotateEnd:"rotateEnd",pitchStart:"pitchStart",pitchEvt:"pitchEvt",pitchEnd:"pitchEnd",boxZoomStart:"boxZoomStart",boxZoomEnd:"boxZoomEnd",boxZoomCancel:"boxZoomCancel",webGlContextLost:"webGlContextLost",webGlContextRestored:"webGlContextRestored",mapLoad:"mapLoad",idle:"idle",render:"render",mapError:"mapError",data:"data",styleData:"styleData",sourceData:"sourceData",dataLoading:"dataLoading",styleDataLoading:"styleDataLoading",sourceDataLoading:"sourceDataLoading",styleImageMissing:"styleImageMissing"},features:[x.Jv_([Ie]),x.OA$],decls:2,vars:0,consts:[["container",""]],template:function(z,Ee){1&z&&x.nrm(0,"div",null,0)},styles:["[_nghost-%COMP%]{display:block}div[_ngcontent-%COMP%]{height:100%;width:100%}"],changeDetection:0})}}return Y})(),Qt=(()=>{class Y{constructor(w){this.mapService=w,this.markerDragStart=new x.bkB,this.markerDragEnd=new x.bkB,this.markerDrag=new x.bkB}ngOnInit(){if(this.feature&&this.lngLat)throw new Error("feature and lngLat input are mutually exclusive")}ngOnChanges(w){w.lngLat&&!w.lngLat.isFirstChange()&&this.markerInstance.setLngLat(this.lngLat),w.feature&&!w.feature.isFirstChange()&&this.markerInstance.setLngLat(this.feature.geometry.coordinates),w.draggable&&!w.draggable.isFirstChange()&&this.markerInstance.setDraggable(!!this.draggable),w.popupShown&&!w.popupShown.isFirstChange()&&(w.popupShown.currentValue?this.markerInstance.getPopup().addTo(this.mapService.mapInstance):this.markerInstance.getPopup().remove()),w.pitchAlignment&&!w.pitchAlignment.isFirstChange()&&this.markerInstance.setPitchAlignment(w.pitchAlignment.currentValue),w.rotationAlignment&&!w.rotationAlignment.isFirstChange()&&this.markerInstance.setRotationAlignment(w.rotationAlignment.currentValue)}ngAfterViewInit(){this.mapService.mapCreated$.subscribe(()=>{this.markerInstance=this.mapService.addMarker({markersOptions:{offset:this.offset,anchor:this.anchor,pitchAlignment:this.pitchAlignment,rotationAlignment:this.rotationAlignment,draggable:!!this.draggable,element:this.content.nativeElement,feature:this.feature,lngLat:this.lngLat,clickTolerance:this.clickTolerance},markersEvents:{markerDragStart:this.markerDragStart,markerDrag:this.markerDrag,markerDragEnd:this.markerDragEnd}})})}ngOnDestroy(){this.mapService.removeMarker(this.markerInstance),this.markerInstance=void 0}togglePopup(){this.markerInstance.togglePopup()}updateCoordinates(w){this.markerInstance.setLngLat(w)}static{this.\u0275fac=function(z){return new(z||Y)(x.rXU(Ie))}}static{this.\u0275cmp=x.VBU({type:Y,selectors:[["mgl-marker"]],viewQuery:function(z,Ee){if(1&z&&x.GBs(zt,7),2&z){let ft;x.mGM(ft=x.lsd())&&(Ee.content=ft.first)}},inputs:{offset:"offset",anchor:"anchor",clickTolerance:"clickTolerance",feature:"feature",lngLat:"lngLat",draggable:"draggable",popupShown:"popupShown",className:"className",pitchAlignment:"pitchAlignment",rotationAlignment:"rotationAlignment"},outputs:{markerDragStart:"markerDragStart",markerDragEnd:"markerDragEnd",markerDrag:"markerDrag"},features:[x.OA$],ngContentSelectors:Rt,decls:3,vars:2,consts:[["content",""]],template:function(z,Ee){1&z&&(x.NAR(),x.j41(0,"div",null,0),x.SdG(2),x.k0s()),2&z&&x.HbH(Ee.className)},encapsulation:2,changeDetection:0})}}return Y})(),_r=(()=>{class Y{constructor(w){this.mapService=w,this.popupClose=new x.bkB,this.popupOpen=new x.bkB}ngOnInit(){if(this.lngLat&&this.marker||this.feature&&this.lngLat||this.feature&&this.marker)throw new Error("marker, lngLat, feature input are mutually exclusive")}
1ngOnChanges(w){if(w.feature&&!w.feature.isFirstChange()){const z=w.lngLat?this.lngLat:this.feature.geometry.coordinates;this.mapService.removePopupFromMap(this.popupInstance,!0);const Ee=this.createPopup();this.mapService.addPopupToMap(Ee,z,this.popupInstance.isOpen()),this.popupInstance=Ee}if(w.lngLat&&!w.lngLat.isFirstChange()&&this.popupInstance.setLngLat(this.lngLat),w.marker&&!w.marker.isFirstChange()){const z=w.marker.previousValue;z.markerInstance&&this.mapService.removePopupFromMarker(z.markerInstance),this.marker&&this.marker.markerInstance&&this.popupInstance&&this.mapService.addPopupToMarker(this.marker.markerInstance,this.popupInstance)}w.offset&&!w.offset.isFirstChange()&&this.popupInstance&&this.popupInstance.setOffset(this.offset)}ngAfterViewInit(){this.popupInstance=this.createPopup(),this.addPopup(this.popupInstance)}ngOnDestroy(){this.popupInstance&&(this.lngLat||this.feature?this.mapService.removePopupFromMap(this.popupInstance):this.marker&&this.marker.markerInstance&&this.mapService.removePopupFromMarker(this.marker.markerInstance)),this.popupInstance=void 0}createPopup(){return this.mapService.createPopup({popupOptions:{closeButton:this.closeButton,closeOnClick:this.closeOnClick,closeOnMove:this.closeOnMove,focusAfterOpen:this.focusAfterOpen,anchor:this.anchor,offset:this.offset,className:this.className,maxWidth:this.maxWidth},popupEvents:{popupOpen:this.popupOpen,popupClose:this.popupClose}},this.content.nativeElement)}addPopup(w){this.mapService.mapCreated$.subscribe(()=>{if(this.lngLat||this.feature)this.mapService.addPopupToMap(w,this.lngLat?this.lngLat:this.feature.geometry.coordinates);else{if(!this.marker||!this.marker.markerInstance)throw new Error("mgl-popup need either lngLat/marker/feature to be set");this.mapService.addPopupToMarker(this.marker.markerInstance,w)}})}static{this.\u0275fac=function(z){return new(z||Y)(x.rXU(Ie))}}static{this.\u0275cmp=x.VBU({type:Y,selectors:[["mgl-popup"]],viewQuery:function(z,Ee){if(1&z&&x.GBs(zt,7),2&z){let ft;x.mGM(ft=x.lsd())&&(Ee.content=ft.first)}},inputs:{closeButton:"closeButton",closeOnClick:"closeOnClick",closeOnMove:"closeOnMove",focusAfterOpen:"focusAfterOpen",anchor:"anchor",className:"className",maxWidth:"maxWidth",feature:"feature",lngLat:"lngLat",marker:"marker",offset:"offset"},outputs:{popupClose:"popupClose",popupOpen:"popupOpen"},features:[x.OA$],ngContentSelectors:Rt,decls:3,vars:0,consts:[["content",""]],template:function(z,Ee){1&z&&(x.NAR(),x.j41(0,"div",null,0),x.SdG(2),x.k0s())},encapsulation:2,changeDetection:0})}}return Y})(),Vr=(()=>{class Y{constructor(w){this.mapService=w,this.type="canvas",this.sourceAdded=!1,this.sub=new Ct.yU}ngOnInit(){const w=this.mapService.mapLoaded$.subscribe(()=>{this.init();const z=(0,Ue.R)(this.mapService.mapInstance,"styledata").pipe((0,me.p)(()=>!this.mapService.mapInstance.getSource(this.id))).subscribe(()=>{this.init()});this.sub.add(z)});this.sub.add(w)}ngOnChanges(w){if(this.sourceAdded)if(w.canvas&&!w.canvas.isFirstChange()||w.animate&&!w.animate.
1isFirstChange())this.ngOnDestroy(),this.ngOnInit();else if(w.coordinates&&!w.coordinates.isFirstChange()){const z=this.mapService.getSource(this.id);if(void 0===z)return;z.setCoordinates(this.coordinates)}}ngOnDestroy(){this.sub.unsubscribe(),this.sourceAdded&&(this.mapService.removeSource(this.id),this.sourceAdded=!1)}init(){this.mapService.addSource(this.id,{type:"canvas",coordinates:this.coordinates,canvas:this.canvas,animate:this.animate}),this.sourceAdded=!0}static{this.\u0275fac=function(z){return new(z||Y)(x.rXU(Ie))}}static{this.\u0275cmp=x.VBU({type:Y,selectors:[["mgl-canvas-source"]],inputs:{id:"id",coordinates:"coordinates",canvas:"canvas",animate:"animate"},features:[x.OA$],decls:0,vars:0,template:function(z,Ee){},encapsulation:2,changeDetection:0})}}return Y})(),li=(()=>{class Y{constructor(w){this.mapService=w,this.type="raster",this.sourceAdded=!1,this.sub=new Ct.yU}ngOnInit(){const w=this.mapService.mapLoaded$.subscribe(()=>{this.init();const z=(0,Ue.R)(this.mapService.mapInstance,"styledata").pipe((0,me.p)(()=>!this.mapService.mapInstance.getSource(this.id))).subscribe(()=>{this.init()});this.sub.add(z)});this.sub.add(w)}ngOnChanges(w){this.sourceAdded&&(w.url&&!w.url.isFirstChange()||w.tiles&&!w.tiles.isFirstChange()||w.bounds&&!w.bounds.isFirstChange()||w.minzoom&&!w.minzoom.isFirstChange()||w.maxzoom&&!w.maxzoom.isFirstChange()||w.tileSize&&!w.tileSize.isFirstChange()||w.scheme&&!w.scheme.isFirstChange()||w.attribution&&!w.attribution.isFirstChange())&&(this.ngOnDestroy(),this.ngOnInit())}ngOnDestroy(){this.sub.unsubscribe(),this.sourceAdded&&(this.mapService.removeSource(this.id),this.sourceAdded=!1)}
1init(){this.mapService.addSource(this.id,{type:this.type,url:this.url,tiles:this.tiles,bounds:this.bounds,minzoom:this.minzoom,maxzoom:this.maxzoom,tileSize:this.tileSize,scheme:this.scheme,attribution:this.attribution}),this.sourceAdded=!0}static{this.\u0275fac=function(z){return new(z||Y)(x.rXU(Ie))}}static{this.\u0275cmp=x.VBU({type:Y,selectors:[["mgl-raster-source"]],inputs:{id:"id",url:"url",tiles:"tiles",bounds:"bounds",minzoom:"minzoom",maxzoom:"maxzoom",tileSize:"tileSize",scheme:"scheme",attribution:"attribution"},features:[x.OA$],decls:0,vars:0,template:function(z,Ee){},encapsulation:2,changeDetection:0})}}return Y})(),sn=(()=>{class Y{static{this.\u0275fac=function(z){return new(z||Y)}}static{this.\u0275mod=x.$C({type:Y})}static{this.\u0275inj=x.G2t({imports:[ke.MD]})}}return Y})()},33256:(gr,Xt,X)=>{"use strict";X.d(Xt,{A:()=>x});var Te=X(35272),ke=6378137;function x(Ue){return(0,Te.jE)(Ue,function(Ce,me){return Ce+function c(Ue){var me,Ce=0;switch(Ue.type){case"Polygon":return Q(Ue.coordinates);case"MultiPolygon":for(me=0;me<Ue.coordinates.length;me++)Ce+=Q(Ue.coordinates[me]);return Ce;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(me)},0)}function Q(Ue){var Ce=0;if(Ue&&Ue.length>0){Ce+=Math.abs(pe(Ue[0]));for(var me=1;me<Ue.length;me++)Ce-=Math.abs(pe(Ue[me]))}return Ce}function pe(Ue){var Ce,me,Be,He,Ze,zt,Rt=0,xt=Ue.length;if(xt>2){for(zt=0;zt<xt;zt++)zt===xt-2?(Be=xt-2,He=xt-1,Ze=0):zt===xt-1?(Be=xt-1,He=0,Ze=1):(Be=zt,He=zt+1,Ze=zt+2),Ce=Ue[Be],me=Ue[He],Rt+=(Ct(Ue[Ze][0])-Ct(Ce[0]))*Math.sin(Ct(me[1]));Rt=Rt*ke*ke/2}return Rt}function Ct(Ue){return Ue*Math.PI/180}},98938:(gr,Xt,X)=>{"use strict";X.d(Xt,{A:()=>c});var Te=X(81247),ke=X(11354);const c=function x(Q,pe,Ct){void 0===Ct&&(Ct={});var Ue=(0,Te.uG)(Q),Ce=(0,Te.uG)(pe),me=(0,ke.tR)(Ce[1]-Ue[1]),ut=(0,ke.tR)(Ce[0]-Ue[0]),Be=(0,ke.tR)(Ue[1]),He=(0,ke.tR)(Ce[1]),Ze=Math.pow(Math.sin(me/2),2)+Math.pow(Math.sin(ut/2),2)*Math.cos(Be)*Math.cos(He);return(0,ke.cJ)(2*Math.atan2(Math.sqrt(Ze),Math.sqrt(1-Ze)),Ct.units)}},11354:(gr,Xt,X)=>{"use strict";X.d(Xt,{Lr:()=>He,N4:()=>Q,NU:()=>Ze,cJ:()=>be,kB:()=>zt,n1:()=>Ce,tR:()=>Oe,wi:()=>ut,zx:()=>Ct});var Te=6371008.8,ke={centimeters:100*Te,centimetres:100*Te,degrees:Te/111325,feet:3.28084*Te,inches:39.37*Te,kilometers:Te/1e3,kilometres:Te/1e3,meters:Te,metres:Te,miles:Te/1609.344,millimeters:1e3*Te,millimetres:1e3*Te,nauticalmiles:Te/1852,radians:1,yards:1.0936*Te};function Q($e,We,et){void 0===et&&(et={});var Ut={type:"Feature"};return(0===et.id||et.id)&&(Ut.id=et.id),et.bbox&&(Ut.bbox=et.bbox),Ut.properties=We||{},Ut.geometry=$e,Ut}function Ct($e,We,et){if(void 0===et&&(et={}),!$e)throw new Error("coordinates is required");if(!Array.isArray($e))throw new Error("coordinates must be an Array");if($e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!ze($e[0])||!ze($e[1]))throw new Error("coordinates must contain numbers");return Q({type:"Point",coordinates:$e},We,et)}function Ce($e,We,et){void 0===et&&(et={});for(var Ut=0,Oi=$e;Ut<Oi.length;Ut++){var Ke=Oi[Ut];if(Ke.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var ri=0;ri<Ke[Ke.length-1].length;ri++)if(Ke[Ke.length-1][ri]!==Ke[0][ri])throw new Error("First and last Position are not equivalent.")}return Q({type:"Polygon",coordinates:$e},We,et)}function ut($e,We,et){if(void 0===et&&(et={}),$e.length<2)throw new Error("coordinates must be an array of two or more positions");return Q({type:"LineString",coordinates:$e},We,et)}function He($e,We){void 0===We&&(We={});var et={type:"FeatureCollection"};return We.id&&(et.id=We.id),We.bbox&&(et.bbox=We.bbox),et.features=$e,et}function Ze($e,We,et){return void 0===et&&(et={}),Q({type:"MultiLineString",coordinates:$e},We,et)}function zt($e,We,et){return void 0===et&&(et={}),Q({type:"MultiPoint",coordinates:$e},We,et)}function be($e,We){void 0===We&&(We="kilometers");var et=ke[We];
1if(!et)throw new Error(We+" units is invalid");return $e*et}function Oe($e){return $e%360*Math.PI/180}function ze($e){return!isNaN($e)&&null!==$e&&!Array.isArray($e)}},72533:(gr,Xt,X)=>{"use strict";X.d(Xt,{A:()=>x});var Te=X(98938),ke=X(35272);function x(c,Q){return void 0===Q&&(Q={}),(0,ke.OQ)(c,function(pe,Ct){var Ue=Ct.geometry.coordinates;return pe+(0,Te.A)(Ue[0],Ue[1],Q)},0)}},35272:(gr,Xt,X)=>{"use strict";X.d(Xt,{Fh:()=>ke,OQ:()=>Ze,iw:()=>ut,jE:()=>me,k7:()=>x});var Te=X(11354);function ke(be,De,Ae){if(null!==be)for(var Me,Ve,Oe,Ie,Qe,ze,Gt,$e,St=0,ht=0,We=be.type,et="FeatureCollection"===We,Ut="Feature"===We,Oi=et?be.features.length:1,Ke=0;Ke<Oi;Ke++){Qe=($e=!!(Gt=et?be.features[Ke].geometry:Ut?be.geometry:be)&&"GeometryCollection"===Gt.type)?Gt.geometries.length:1;for(var ri=0;ri<Qe;ri++){var wt=0,$t=0;if(null!==(Ie=$e?Gt.geometries[ri]:Gt)){ze=Ie.coordinates;var Qt=Ie.type;switch(St=!Ae||"Polygon"!==Qt&&"MultiPolygon"!==Qt?0:1,Qt){case null:break;case"Point":if(!1===De(ze,ht,Ke,wt,$t))return!1;ht++,wt++;break;case"LineString":case"MultiPoint":for(Me=0;Me<ze.length;Me++){if(!1===De(ze[Me],ht,Ke,wt,$t))return!1;ht++,"MultiPoint"===Qt&&wt++}"LineString"===Qt&&wt++;break;case"Polygon":case"MultiLineString":for(Me=0;Me<ze.length;Me++){for(Ve=0;Ve<ze[Me].length-St;Ve++){if(!1===De(ze[Me][Ve],ht,Ke,wt,$t))return!1;ht++}"MultiLineString"===Qt&&wt++,"Polygon"===Qt&&$t++}"Polygon"===Qt&&wt++;break;case"MultiPolygon":for(Me=0;Me<ze.length;Me++){for($t=0,Ve=0;Ve<ze[Me].length;Ve++){for(Oe=0;Oe<ze[Me][Ve].length-St;Oe++){if(!1===De(ze[Me][Ve][Oe],ht,Ke,wt,$t))return!1;ht++}$t++}wt++}break;case"GeometryCollection":for(Me=0;Me<Ie.geometries.length;Me++)if(!1===ke(Ie.geometries[Me],De,Ae))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function x(be,De,Ae,Me){var Ve=Ae;return ke(be,function(Oe,Ie,Qe,ze,Gt){Ve=0===Ie&&void 0===Ae?Oe:De(Ve,Oe,Ie,Qe,ze,Gt)},Me),Ve}function Ce(be,De){var Ae,Me,Ve,Oe,Ie,Qe,ze,Gt,St,ht,$e=0,We="FeatureCollection"===be.type,et="Feature"===be.type,Ut=We?be.features.length:1;for(Ae=0;Ae<Ut;Ae++){for(Gt=We?be.features[Ae].properties:et?be.properties:{},St=We?be.features[Ae].bbox:et?be.bbox:void 0,ht=We?be.features[Ae].id:et?be.id:void 0,Ie=(ze=!!(Qe=We?be.features[Ae].geometry:et?be.geometry:be)&&"GeometryCollection"===Qe.type)?Qe.geometries.length:1,Ve=0;Ve<Ie;Ve++)if(null!==(Oe=ze?Qe.geometries[Ve]:Qe))switch(Oe.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===De(Oe,$e,Gt,St,ht))return!1;break;case"GeometryCollection":for(Me=0;Me<Oe.geometries.length;Me++)if(!1===De(Oe.geometries[Me],$e,Gt,St,ht))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===De(null,$e,Gt,St,ht))return!1;$e++}}function me(be,De,Ae){var Me=Ae;return Ce(be,function(Ve,Oe,Ie,Qe,ze){Me=0===Oe&&void 0===Ae?Ve:De(Me,Ve,Oe,Ie,Qe,ze)}),Me}function ut(be,De){Ce(be,function(Ae,Me,Ve,Oe,Ie){var ze,Qe=null===Ae?null:Ae.type;switch(Qe){case null:case"Point":case"LineString":case"Polygon":return!1!==De((0,Te.N4)(Ae,Ve,{bbox:Oe,id:Ie}),Me,0)&&void 0}switch(Qe){case"MultiPoint":ze="Point";break;case"MultiLineString":ze="LineString";break;case"MultiPolygon":ze="Polygon"}for(var Gt=0;Gt<Ae.coordinates.length;Gt++)if(!1===De((0,Te.N4)({type:ze,coordinates:Ae.coordinates[Gt]},Ve),Me,Gt))return!1})}function Ze(be,De,Ae){var Me=Ae,Ve=!1;return function He(be,De){ut(be,function(Ae,Me,Ve){var Oe=0;if(Ae.geometry){var Ie=Ae.geometry.type;if("Point"!==Ie&&"MultiPoint"!==Ie){var Qe,ze=0,Gt=0,St=0;if(!1===ke(Ae,function(ht,$e,We,et,Ut){if(void 0===Qe||Me>ze||et>Gt||Ut>St)return Qe=ht,ze=Me,Gt=et,St=Ut,void(Oe=0);var Oi=(0,Te.wi)([Qe,ht],Ae.properties);if(!1===De(Oi,Me,Ve,Ut,Oe))return!1;Oe++,Qe=ht}))return!1}}})}(be,function(Oe,Ie,Qe,ze,Gt){Me=!1===Ve&&void 0===Ae?Oe:De(Me,Oe,Ie,Qe,ze,Gt),Ve=!0}),Me}},39490:(gr,Xt,X)=>{"use strict";X.d(Xt,{Ay:()=>x});var Te=X(11354),ke=X(81247);function x(Ct,Ue){void 0===Ue&&(Ue={});var Ce=(0,ke.bg)(Ct);switch(!Ue.properties&&"Feature"===Ct.type&&(Ue.properties=Ct.properties),Ce.type){case"Polygon":return function c(Ct,Ue){return void 0===Ue&&(Ue={}),pe((0,ke.bg)(Ct).coordinates,Ue.properties?Ue.properties:"Feature"===Ct.type?Ct.properties:{})}(Ce,Ue);case"MultiPolygon":return function Q(Ct,Ue){void 0===Ue&&(Ue={});var Ce=(0,ke.bg)(Ct),ut=Ue.properties?Ue.properties:"Feature"===Ct.type?Ct.properties:{},Be=[];
1return Ce.coordinates.forEach(function(He){Be.push(pe(He,ut))}),(0,Te.Lr)(Be)}(Ce,Ue);default:throw new Error("invalid poly")}}function pe(Ct,Ue){return Ct.length>1?(0,Te.NU)(Ct,Ue):(0,Te.wi)(Ct[0],Ue)}},79382:(gr,Xt,X)=>{"use strict";X.d(Xt,{Bw9:()=>Ke.A,HOm:()=>li.Ay,IoC:()=>be.A,Qk1:()=>Ae.A,Wcw:()=>Ut.A,mFO:()=>Oe.A,n1:()=>bt.n1,wiw:()=>bt.wi,zx7:()=>bt.zx}),X(17733),X(28830),X(36949),X(8435),X(59361),X(79870),X(26342),X(22982),X(42111),X(22279),X(84809),X(37258),X(89117),X(10329),X(8264),X(17393),X(91341),X(682);var be=X(98938),Ae=(X(85026),X(38458)),Oe=(X(54016),X(82533),X(56267)),Ut=(X(41974),X(53745),X(60241),X(99557),X(23720),X(45185),X(85823),X(47611),X(41746),X(33256)),Ke=(X(47990),X(72533)),li=(X(8456),X(72520),X(5292),X(40927),X(50173),X(41671),X(60935),X(4758),X(24529),X(30699),X(51010),X(29618),X(39490)),bt=(X(60664),X(66067),X(72225),X(44235),X(95598),X(29487),X(65387),X(42262),X(92830),X(24018),X(71881),X(43140),X(3840),X(73337),X(13591),X(14546),X(33651),X(28622),X(23052),X(10529),X(37587),X(27210),X(4061),X(68640),X(22627),X(13090),X(88668),X(78122),X(54133),X(12329),X(73606),X(51001),X(61454),X(341),X(4740),X(49708),X(45554),X(58311),X(35905),X(83984),X(40098),X(3734),X(11354));X(81247),X(35272),X(80610),X(37775),X(40652),X(97238),X(92966),X(63433),X(62321),X(7081),X(25960),X(35752)}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.