@performant-software/geospatial 3.0.4-beta.0 → 3.0.4-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs14.js +1 -1
- package/dist/index.cjs15.js +1 -1
- package/dist/index.cjs184.js +1 -1
- package/dist/index.cjs184.js.map +1 -1
- package/dist/index.cjs185.js +1 -1
- package/dist/index.cjs185.js.map +1 -1
- package/dist/index.cjs186.js +4 -1
- package/dist/index.cjs186.js.map +1 -1
- package/dist/index.cjs187.js +1 -1
- package/dist/index.cjs187.js.map +1 -1
- package/dist/index.cjs188.js +1 -1
- package/dist/index.cjs188.js.map +1 -1
- package/dist/index.cjs189.js +1 -1
- package/dist/index.cjs189.js.map +1 -1
- package/dist/index.cjs19.js +1 -1
- package/dist/index.cjs190.js +1 -1
- package/dist/index.cjs190.js.map +1 -1
- package/dist/index.cjs191.js +1 -1
- package/dist/index.cjs191.js.map +1 -1
- package/dist/index.cjs192.js +1 -1
- package/dist/index.cjs192.js.map +1 -1
- package/dist/index.cjs193.js +1 -1
- package/dist/index.cjs193.js.map +1 -1
- package/dist/index.cjs194.js +1 -4
- package/dist/index.cjs194.js.map +1 -1
- package/dist/index.cjs195.js +1 -1
- package/dist/index.cjs195.js.map +1 -1
- package/dist/index.cjs196.js +1 -1
- package/dist/index.cjs196.js.map +1 -1
- package/dist/index.cjs197.js +1 -1
- package/dist/index.cjs197.js.map +1 -1
- package/dist/index.cjs198.js +1 -1
- package/dist/index.cjs198.js.map +1 -1
- package/dist/index.cjs199.js +1 -1
- package/dist/index.cjs199.js.map +1 -1
- package/dist/index.cjs200.js +1 -1
- package/dist/index.cjs200.js.map +1 -1
- package/dist/index.cjs201.js +1 -1
- package/dist/index.cjs201.js.map +1 -1
- package/dist/index.cjs202.js +1 -1
- package/dist/index.cjs202.js.map +1 -1
- package/dist/index.cjs203.js +1 -1
- package/dist/index.cjs203.js.map +1 -1
- package/dist/index.cjs204.js +1 -1
- package/dist/index.cjs204.js.map +1 -1
- package/dist/index.cjs205.js +1 -1
- package/dist/index.cjs205.js.map +1 -1
- package/dist/index.cjs206.js +1 -1
- package/dist/index.cjs206.js.map +1 -1
- package/dist/index.cjs209.js +1 -1
- package/dist/index.cjs21.js +1 -1
- package/dist/index.cjs210.js +1 -1
- package/dist/index.cjs211.js +1 -1
- package/dist/index.cjs22.js +1 -1
- package/dist/index.cjs229.js +1 -1
- package/dist/index.cjs234.js +1 -1
- package/dist/index.cjs236.js +1 -1
- package/dist/index.cjs236.js.map +1 -1
- package/dist/index.cjs237.js +1 -1
- package/dist/index.cjs237.js.map +1 -1
- package/dist/index.cjs238.js +1 -1
- package/dist/index.cjs238.js.map +1 -1
- package/dist/index.cjs240.js +1 -1
- package/dist/index.cjs243.js +1 -1
- package/dist/index.cjs246.js +1 -1
- package/dist/index.cjs249.js +1 -1
- package/dist/index.cjs251.js +1 -1
- package/dist/index.cjs254.js +1 -1
- package/dist/index.cjs255.js +1 -1
- package/dist/index.cjs258.js +1 -1
- package/dist/index.cjs258.js.map +1 -1
- package/dist/index.cjs259.js +1 -1
- package/dist/index.cjs259.js.map +1 -1
- package/dist/index.cjs26.js +1 -1
- package/dist/index.cjs260.js +1 -1
- package/dist/index.cjs57.js +1 -1
- package/dist/index.cjs59.js +1 -1
- package/dist/index.cjs63.js +1 -1
- package/dist/index.cjs64.js +1 -1
- package/dist/index.cjs65.js +1 -1
- package/dist/index.cjs65.js.map +1 -1
- package/dist/index.cjs66.js +1 -1
- package/dist/index.cjs66.js.map +1 -1
- package/dist/index.cjs67.js +1 -1
- package/dist/index.cjs67.js.map +1 -1
- package/dist/index.cjs68.js +1 -1
- package/dist/index.cjs69.js +1 -1
- package/dist/index.cjs70.js +1 -1
- package/dist/index.cjs71.js +1 -1
- package/dist/index.cjs72.js +1 -1
- package/dist/index.cjs73.js +1 -1
- package/dist/index.cjs74.js +1 -1
- package/dist/index.cjs75.js +1 -1
- package/dist/index.cjs77.js +1 -1
- package/dist/index.cjs77.js.map +1 -1
- package/dist/index.cjs78.js +1 -1
- package/dist/index.cjs78.js.map +1 -1
- package/dist/index.cjs79.js +1 -1
- package/dist/index.cjs79.js.map +1 -1
- package/dist/index.cjs80.js +1 -1
- package/dist/index.cjs80.js.map +1 -1
- package/dist/index.cjs81.js +1 -1
- package/dist/index.cjs81.js.map +1 -1
- package/dist/index.es14.js +1 -1
- package/dist/index.es15.js +3 -3
- package/dist/index.es184.js +7 -320
- package/dist/index.es184.js.map +1 -1
- package/dist/index.es185.js +144 -71
- package/dist/index.es185.js.map +1 -1
- package/dist/index.es186.js +12197 -3
- package/dist/index.es186.js.map +1 -1
- package/dist/index.es187.js +3 -18
- package/dist/index.es187.js.map +1 -1
- package/dist/index.es188.js +3 -13
- package/dist/index.es188.js.map +1 -1
- package/dist/index.es189.js +33 -28
- package/dist/index.es189.js.map +1 -1
- package/dist/index.es19.js +1 -1
- package/dist/index.es190.js +3 -7
- package/dist/index.es190.js.map +1 -1
- package/dist/index.es191.js +23 -2
- package/dist/index.es191.js.map +1 -1
- package/dist/index.es192.js +2 -10
- package/dist/index.es192.js.map +1 -1
- package/dist/index.es193.js +3 -150
- package/dist/index.es193.js.map +1 -1
- package/dist/index.es194.js +2 -12199
- package/dist/index.es194.js.map +1 -1
- package/dist/index.es195.js +34 -3
- package/dist/index.es195.js.map +1 -1
- package/dist/index.es196.js +14 -2
- package/dist/index.es196.js.map +1 -1
- package/dist/index.es197.js +13 -35
- package/dist/index.es197.js.map +1 -1
- package/dist/index.es198.js +11 -3
- package/dist/index.es198.js.map +1 -1
- package/dist/index.es199.js +319 -21
- package/dist/index.es199.js.map +1 -1
- package/dist/index.es200.js +77 -2
- package/dist/index.es200.js.map +1 -1
- package/dist/index.es201.js +5 -3
- package/dist/index.es201.js.map +1 -1
- package/dist/index.es202.js +18 -2
- package/dist/index.es202.js.map +1 -1
- package/dist/index.es203.js +10 -31
- package/dist/index.es203.js.map +1 -1
- package/dist/index.es204.js +31 -13
- package/dist/index.es204.js.map +1 -1
- package/dist/index.es205.js +4 -13
- package/dist/index.es205.js.map +1 -1
- package/dist/index.es206.js +2 -9
- package/dist/index.es206.js.map +1 -1
- package/dist/index.es209.js +1 -1
- package/dist/index.es21.js +2 -2
- package/dist/index.es210.js +1 -1
- package/dist/index.es211.js +1 -1
- package/dist/index.es22.js +2 -2
- package/dist/index.es229.js +1 -1
- package/dist/index.es234.js +1 -1
- package/dist/index.es236.js +3 -8
- package/dist/index.es236.js.map +1 -1
- package/dist/index.es237.js +6 -4
- package/dist/index.es237.js.map +1 -1
- package/dist/index.es238.js +6 -3
- package/dist/index.es238.js.map +1 -1
- package/dist/index.es240.js +1 -1
- package/dist/index.es243.js +1 -1
- package/dist/index.es246.js +1 -1
- package/dist/index.es249.js +2 -2
- package/dist/index.es251.js +1 -1
- package/dist/index.es254.js +1 -1
- package/dist/index.es255.js +1 -1
- package/dist/index.es258.js +4 -15
- package/dist/index.es258.js.map +1 -1
- package/dist/index.es259.js +15 -4
- package/dist/index.es259.js.map +1 -1
- package/dist/index.es26.js +1 -1
- package/dist/index.es260.js +2 -2
- package/dist/index.es57.js +1 -1
- package/dist/index.es59.js +12 -12
- package/dist/index.es61.js +2 -2
- package/dist/index.es63.js +1 -1
- package/dist/index.es64.js +1 -1
- package/dist/index.es65.js +2 -107
- package/dist/index.es65.js.map +1 -1
- package/dist/index.es66.js +107 -10
- package/dist/index.es66.js.map +1 -1
- package/dist/index.es67.js +10 -2
- package/dist/index.es67.js.map +1 -1
- package/dist/index.es68.js +4 -4
- package/dist/index.es69.js +2 -2
- package/dist/index.es70.js +2 -2
- package/dist/index.es71.js +1 -1
- package/dist/index.es72.js +1 -1
- package/dist/index.es73.js +1 -1
- package/dist/index.es74.js +1 -1
- package/dist/index.es75.js +1 -1
- package/dist/index.es77.js +2 -28
- package/dist/index.es77.js.map +1 -1
- package/dist/index.es78.js +2 -51
- package/dist/index.es78.js.map +1 -1
- package/dist/index.es79.js +25 -62
- package/dist/index.es79.js.map +1 -1
- package/dist/index.es80.js +51 -2
- package/dist/index.es80.js.map +1 -1
- package/dist/index.es81.js +65 -2
- package/dist/index.es81.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/build/index.js +0 -2
- package/build/index.js.map +0 -1
- package/build/main.css +0 -127
- package/types/components/LocationMarker.js.flow +0 -82
package/dist/index.cjs14.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const Re=require("./index.cjs60.js"),Zn=require("./index.cjs61.js");(function(Wn,ao){(function(ze,de){Wn.exports=de()})(Re.commonjsGlobal,function(){var ze=function(e,t){var n={drag:[],click:[],mousemove:[],mousedown:[],mouseup:[],mouseout:[],keydown:[],keyup:[],touchstart:[],touchmove:[],touchend:[],tap:[]},r={on:function(i,a,l){if(n[i]===void 0)throw new Error("Invalid event type: "+i);n[i].push({selector:a,fn:l})},render:function(i){t.store.featureChanged(i)}},o=function(i,a){for(var l=n[i],d=l.length;d--;){var h=l[d];if(h.selector(a)){h.fn.call(r,a)||t.store.render(),t.ui.updateMapClasses();break}}};return e.start.call(r),{render:e.render,stop:function(){e.stop&&e.stop()},trash:function(){e.trash&&(e.trash(),t.store.render())},combineFeatures:function(){e.combineFeatures&&e.combineFeatures()},uncombineFeatures:function(){e.uncombineFeatures&&e.uncombineFeatures()},drag:function(i){o("drag",i)},click:function(i){o("click",i)},mousemove:function(i){o("mousemove",i)},mousedown:function(i){o("mousedown",i)},mouseup:function(i){o("mouseup",i)},mouseout:function(i){o("mouseout",i)},keydown:function(i){o("keydown",i)},keyup:function(i){o("keyup",i)},touchstart:function(i){o("touchstart",i)},touchmove:function(i){o("touchmove",i)},touchend:function(i){o("touchend",i)},tap:function(i){o("tap",i)}}};function de(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Kn(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){if(this instanceof r){var o=[null];o.push.apply(o,arguments);var i=Function.bind.apply(t,o);return new i}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var Et={},Qn={RADIUS:6378137,FLATTENING:1/298.257223563,POLAR_RADIUS:63567523142e-4},Xt=Qn;function Zt(e){var t=0;if(e&&e.length>0){t+=Math.abs(Tt(e[0]));for(var n=1;n<e.length;n++)t-=Math.abs(Tt(e[n]))}return t}function Tt(e){var t,n,r,o,i,a,l=0,d=e.length;if(d>2){for(a=0;a<d;a++)a===d-2?(r=d-2,o=d-1,i=0):a===d-1?(r=d-1,o=0,i=1):(r=a,o=a+1,i=a+2),t=e[r],n=e[o],l+=(Ct(e[i][0])-Ct(t[0]))*Math.sin(Ct(n[1]));l=l*Xt.RADIUS*Xt.RADIUS/2}return l}function Ct(e){return e*Math.PI/180}Et.geometry=function e(t){var n,r=0;switch(t.type){case"Polygon":return Zt(t.coordinates);case"MultiPolygon":for(n=0;n<t.coordinates.length;n++)r+=Zt(t.coordinates[n]);return r;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(n=0;n<t.geometries.length;n++)r+=e(t.geometries[n]);return r}},Et.ring=Tt;var q={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"},X={HOT:"mapbox-gl-draw-hot",COLD:"mapbox-gl-draw-cold"},N={ADD:"add",MOVE:"move",DRAG:"drag",POINTER:"pointer",NONE:"none"},Y={POLYGON:"polygon",LINE:"line_string",POINT:"point"},m={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"},T={DRAW_LINE_STRING:"draw_line_string",DRAW_POLYGON:"draw_polygon",DRAW_POINT:"draw_point",SIMPLE_SELECT:"simple_select",DIRECT_SELECT:"direct_select",STATIC:"static"},H={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"},Ot={MOVE:"move",CHANGE_COORDINATES:"change_coordinates"},B={FEATURE:"feature",MIDPOINT:"midpoint",VERTEX:"vertex"},j={ACTIVE:"true",INACTIVE:"false"},Wt=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate"],St=-85,er=Object.freeze({__proto__:null,classes:q,sources:X,cursors:N,types:Y,geojsonTypes:m,modes:T,events:H,updateActions:Ot,meta:B,activeStates:j,interactions:Wt,LAT_MIN:-90,LAT_RENDERED_MIN:St,LAT_MAX:90,LAT_RENDERED_MAX:85,LNG_MIN:-270,LNG_MAX:270}),Kt={Point:0,LineString:1,MultiLineString:1,Polygon:2};function tr(e,t){var n=Kt[e.geometry.type]-Kt[t.geometry.type];return n===0&&e.geometry.type===m.POLYGON?e.area-t.area:n}function Qt(e){return e.map(function(t){return t.geometry.type===m.POLYGON&&(t.area=Et.geometry({type:m.FEATURE,property:{},geometry:t.geometry})),t}).sort(tr).map(function(t){return delete t.area,t})}function en(e,t){return t===void 0&&(t=0),[[e.point.x-t,e.point.y-t],[e.point.x+t,e.point.y+t]]}function Z(e){if(this._items={},this._nums={},this._length=e?e.length:0,e)for(var t=0,n=e.length;t<n;t++)this.add(e[t]),e[t]!==void 0&&(typeof e[t]=="string"?this._items[e[t]]=t:this._nums[e[t]]=t)}Z.prototype.add=function(e){return this.has(e)||(this._length++,typeof e=="string"?this._items[e]=this._length:this._nums[e]=this._length),this},Z.prototype.delete=function(e){return this.has(e)===!1||(this._length--,delete this._items[e],delete this._nums[e]),this},Z.prototype.has=function(e){return(typeof e=="string"||typeof e=="number")&&(this._items[e]!==void 0||this._nums[e]!==void 0)},Z.prototype.values=function(){var e=this,t=[];return Object.keys(this._items).forEach(function(n){t.push({k:n,v:e._items[n]})}),Object.keys(this._nums).forEach(function(n){t.push({k:JSON.parse(n),v:e._nums[n]})}),t.sort(function(n,r){return n.v-r.v}).map(function(n){return n.k})},Z.prototype.clear=function(){return this._length=0,this._items={},this._nums={},this};var nr=[B.FEATURE,B.MIDPOINT,B.VERTEX],xe={click:function(e,t,n){return tn(e,t,n,n.options.clickBuffer)},touch:function(e,t,n){return tn(e,t,n,n.options.touchBuffer)}};function tn(e,t,n,r){if(n.map===null)return[];var o=e?en(e,r):t,i={};n.options.styles&&(i.layers=n.options.styles.map(function(h){return h.id}).filter(function(h){return n.map.getLayer(h)!=null}));var a=n.map.queryRenderedFeatures(o,i).filter(function(h){return nr.indexOf(h.properties.meta)!==-1}),l=new Z,d=[];return a.forEach(function(h){var g=h.properties.id;l.has(g)||(l.add(g),d.push(h))}),Qt(d)}function Ye(e,t){var n=xe.click(e,null,t),r={mouse:N.NONE};return n[0]&&(r.mouse=n[0].properties.active===j.ACTIVE?N.MOVE:N.POINTER,r.feature=n[0].properties.meta),t.events.currentModeName().indexOf("draw")!==-1&&(r.mouse=N.ADD),t.ui.queueMapClasses(r),t.ui.updateMapClasses(),n[0]}function It(e,t){var n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)}function xt(e,t,n){n===void 0&&(n={});var r=n.fineTolerance!=null?n.fineTolerance:4,o=n.grossTolerance!=null?n.grossTolerance:12,i=n.interval!=null?n.interval:500;e.point=e.point||t.point,e.time=e.time||t.time;var a=It(e.point,t.point);return a<r||a<o&&t.time-e.time<i}function Mt(e,t,n){n===void 0&&(n={});var r=n.tolerance!=null?n.tolerance:25,o=n.interval!=null?n.interval:250;return e.point=e.point||t.point,e.time=e.time||t.time,It(e.point,t.point)<r&&t.time-e.time<o}var nn={exports:{}},Lt=nn.exports=function(e,t){if(t||(t=16),e===void 0&&(e=128),e<=0)return"0";for(var n=Math.log(Math.pow(2,e))/Math.log(t),r=2;n===1/0;r*=2)n=Math.log(Math.pow(2,e/r))/Math.log(t)*r;var o=n-Math.floor(n),i="";for(r=0;r<Math.floor(n);r++)i=Math.floor(Math.random()*t).toString(t)+i;if(o){var a=Math.pow(t,o);i=Math.floor(Math.random()*a).toString(t)+i}var l=parseInt(i,t);return l!==1/0&&l>=Math.pow(2,e)?Lt(e,t):i};Lt.rack=function(e,t,n){var r=function(i){var a=0;do{if(a++>10){if(!n)throw new Error("too many ID collisions, use more bits");e+=n}var l=Lt(e,t)}while(Object.hasOwnProperty.call(o,l));return o[l]=i,l},o=r.hats={};return r.get=function(i){return r.hats[i]},r.set=function(i,a){return r.hats[i]=a,r},r.bits=e||128,r.base=t||16,r};var Nt=de(nn.exports),G=function(e,t){this.ctx=e,this.properties=t.properties||{},this.coordinates=t.geometry.coordinates,this.id=t.id||Nt(),this.type=t.geometry.type};G.prototype.changed=function(){this.ctx.store.featureChanged(this.id)},G.prototype.incomingCoords=function(e){this.setCoordinates(e)},G.prototype.setCoordinates=function(e){this.coordinates=e,this.changed()},G.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.coordinates))},G.prototype.setProperty=function(e,t){this.properties[e]=t},G.prototype.toGeoJSON=function(){return JSON.parse(JSON.stringify({id:this.id,type:m.FEATURE,properties:this.properties,geometry:{coordinates:this.getCoordinates(),type:this.type}}))},G.prototype.internal=function(e){var t={id:this.id,meta:B.FEATURE,"meta:type":this.type,active:j.INACTIVE,mode:e};if(this.ctx.options.userProperties)for(var n in this.properties)t["user_"+n]=this.properties[n];return{type:m.FEATURE,properties:t,geometry:{coordinates:this.getCoordinates(),type:this.type}}};var me=function(e,t){G.call(this,e,t)};(me.prototype=Object.create(G.prototype)).isValid=function(){return typeof this.coordinates[0]=="number"&&typeof this.coordinates[1]=="number"},me.prototype.updateCoordinate=function(e,t,n){this.coordinates=arguments.length===3?[t,n]:[e,t],this.changed()},me.prototype.getCoordinate=function(){return this.getCoordinates()};var ie=function(e,t){G.call(this,e,t)};(ie.prototype=Object.create(G.prototype)).isValid=function(){return this.coordinates.length>1},ie.prototype.addCoordinate=function(e,t,n){this.changed();var r=parseInt(e,10);this.coordinates.splice(r,0,[t,n])},ie.prototype.getCoordinate=function(e){var t=parseInt(e,10);return JSON.parse(JSON.stringify(this.coordinates[t]))},ie.prototype.removeCoordinate=function(e){this.changed(),this.coordinates.splice(parseInt(e,10),1)},ie.prototype.updateCoordinate=function(e,t,n){var r=parseInt(e,10);this.coordinates[r]=[t,n],this.changed()};var W=function(e,t){G.call(this,e,t),this.coordinates=this.coordinates.map(function(n){return n.slice(0,-1)})};(W.prototype=Object.create(G.prototype)).isValid=function(){return this.coordinates.length!==0&&this.coordinates.every(function(e){return e.length>2})},W.prototype.incomingCoords=function(e){this.coordinates=e.map(function(t){return t.slice(0,-1)}),this.changed()},W.prototype.setCoordinates=function(e){this.coordinates=e,this.changed()},W.prototype.addCoordinate=function(e,t,n){this.changed();var r=e.split(".").map(function(o){return parseInt(o,10)});this.coordinates[r[0]].splice(r[1],0,[t,n])},W.prototype.removeCoordinate=function(e){this.changed();var t=e.split(".").map(function(r){return parseInt(r,10)}),n=this.coordinates[t[0]];n&&(n.splice(t[1],1),n.length<3&&this.coordinates.splice(t[0],1))},W.prototype.getCoordinate=function(e){var t=e.split(".").map(function(r){return parseInt(r,10)}),n=this.coordinates[t[0]];return JSON.parse(JSON.stringify(n[t[1]]))},W.prototype.getCoordinates=function(){return this.coordinates.map(function(e){return e.concat([e[0]])})},W.prototype.updateCoordinate=function(e,t,n){this.changed();var r=e.split("."),o=parseInt(r[0],10),i=parseInt(r[1],10);this.coordinates[o]===void 0&&(this.coordinates[o]=[]),this.coordinates[o][i]=[t,n]};var rr={MultiPoint:me,MultiLineString:ie,MultiPolygon:W},$e=function(e,t,n,r,o){var i=n.split("."),a=parseInt(i[0],10),l=i[1]?i.slice(1).join("."):null;return e[a][t](l,r,o)},$=function(e,t){if(G.call(this,e,t),delete this.coordinates,this.model=rr[t.geometry.type],this.model===void 0)throw new TypeError(t.geometry.type+" is not a valid type");this.features=this._coordinatesToFeatures(t.geometry.coordinates)};function E(e){this.map=e.map,this.drawConfig=JSON.parse(JSON.stringify(e.options||{})),this._ctx=e}($.prototype=Object.create(G.prototype))._coordinatesToFeatures=function(e){var t=this,n=this.model.bind(this);return e.map(function(r){return new n(t.ctx,{id:Nt(),type:m.FEATURE,properties:{},geometry:{coordinates:r,type:t.type.replace("Multi","")}})})},$.prototype.isValid=function(){return this.features.every(function(e){return e.isValid()})},$.prototype.setCoordinates=function(e){this.features=this._coordinatesToFeatures(e),this.changed()},$.prototype.getCoordinate=function(e){return $e(this.features,"getCoordinate",e)},$.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.features.map(function(e){return e.type===m.POLYGON?e.getCoordinates():e.coordinates})))},$.prototype.updateCoordinate=function(e,t,n){$e(this.features,"updateCoordinate",e,t,n),this.changed()},$.prototype.addCoordinate=function(e,t,n){$e(this.features,"addCoordinate",e,t,n),this.changed()},$.prototype.removeCoordinate=function(e){$e(this.features,"removeCoordinate",e),this.changed()},$.prototype.getFeatures=function(){return this.features},E.prototype.setSelected=function(e){return this._ctx.store.setSelected(e)},E.prototype.setSelectedCoordinates=function(e){var t=this;this._ctx.store.setSelectedCoordinates(e),e.reduce(function(n,r){return n[r.feature_id]===void 0&&(n[r.feature_id]=!0,t._ctx.store.get(r.feature_id).changed()),n},{})},E.prototype.getSelected=function(){return this._ctx.store.getSelected()},E.prototype.getSelectedIds=function(){return this._ctx.store.getSelectedIds()},E.prototype.isSelected=function(e){return this._ctx.store.isSelected(e)},E.prototype.getFeature=function(e){return this._ctx.store.get(e)},E.prototype.select=function(e){return this._ctx.store.select(e)},E.prototype.deselect=function(e){return this._ctx.store.deselect(e)},E.prototype.deleteFeature=function(e,t){return t===void 0&&(t={}),this._ctx.store.delete(e,t)},E.prototype.addFeature=function(e){return this._ctx.store.add(e)},E.prototype.clearSelectedFeatures=function(){return this._ctx.store.clearSelected()},E.prototype.clearSelectedCoordinates=function(){return this._ctx.store.clearSelectedCoordinates()},E.prototype.setActionableState=function(e){e===void 0&&(e={});var t={trash:e.trash||!1,combineFeatures:e.combineFeatures||!1,uncombineFeatures:e.uncombineFeatures||!1};return this._ctx.events.actionable(t)},E.prototype.changeMode=function(e,t,n){return t===void 0&&(t={}),n===void 0&&(n={}),this._ctx.events.changeMode(e,t,n)},E.prototype.updateUIClasses=function(e){return this._ctx.ui.queueMapClasses(e)},E.prototype.activateUIButton=function(e){return this._ctx.ui.setActiveButton(e)},E.prototype.featuresAt=function(e,t,n){if(n===void 0&&(n="click"),n!=="click"&&n!=="touch")throw new Error("invalid buffer type");return xe[n](e,t,this._ctx)},E.prototype.newFeature=function(e){var t=e.geometry.type;return t===m.POINT?new me(this._ctx,e):t===m.LINE_STRING?new ie(this._ctx,e):t===m.POLYGON?new W(this._ctx,e):new $(this._ctx,e)},E.prototype.isInstanceOf=function(e,t){if(e===m.POINT)return t instanceof me;if(e===m.LINE_STRING)return t instanceof ie;if(e===m.POLYGON)return t instanceof W;if(e==="MultiFeature")return t instanceof $;throw new Error("Unknown feature class: "+e)},E.prototype.doRender=function(e){return this._ctx.store.featureChanged(e)},E.prototype.onSetup=function(){},E.prototype.onDrag=function(){},E.prototype.onClick=function(){},E.prototype.onMouseMove=function(){},E.prototype.onMouseDown=function(){},E.prototype.onMouseUp=function(){},E.prototype.onMouseOut=function(){},E.prototype.onKeyUp=function(){},E.prototype.onKeyDown=function(){},E.prototype.onTouchStart=function(){},E.prototype.onTouchMove=function(){},E.prototype.onTouchEnd=function(){},E.prototype.onTap=function(){},E.prototype.onStop=function(){},E.prototype.onTrash=function(){},E.prototype.onCombineFeature=function(){},E.prototype.onUncombineFeature=function(){},E.prototype.toDisplayFeatures=function(){throw new Error("You must overwrite toDisplayFeatures")};var rn={drag:"onDrag",click:"onClick",mousemove:"onMouseMove",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseout:"onMouseOut",keyup:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",tap:"onTap"},or=Object.keys(rn);function ir(e){var t=Object.keys(e);return function(n,r){r===void 0&&(r={});var o={},i=t.reduce(function(a,l){return a[l]=e[l],a},new E(n));return{start:function(){var a=this;o=i.onSetup(r),or.forEach(function(l){var d,h=rn[l],g=function(){return!1};e[h]&&(g=function(){return!0}),a.on(l,g,(d=h,function(p){return i[d](o,p)}))})},stop:function(){i.onStop(o)},trash:function(){i.onTrash(o)},combineFeatures:function(){i.onCombineFeatures(o)},uncombineFeatures:function(){i.onUncombineFeatures(o)},render:function(a,l){i.toDisplayFeatures(o,a,l)}}}}function De(e){return[].concat(e).filter(function(t){return t!==void 0})}function ar(){var e=this;if(!(e.ctx.map&&e.ctx.map.getSource(X.HOT)!==void 0))return d();var t=e.ctx.events.currentModeName();e.ctx.ui.queueMapClasses({mode:t});var n=[],r=[];e.isDirty?r=e.getAllIds():(n=e.getChangedIds().filter(function(h){return e.get(h)!==void 0}),r=e.sources.hot.filter(function(h){return h.properties.id&&n.indexOf(h.properties.id)===-1&&e.get(h.properties.id)!==void 0}).map(function(h){return h.properties.id})),e.sources.hot=[];var o=e.sources.cold.length;e.sources.cold=e.isDirty?[]:e.sources.cold.filter(function(h){var g=h.properties.id||h.properties.parent;return n.indexOf(g)===-1});var i=o!==e.sources.cold.length||r.length>0;function a(h,g){var p=e.get(h).internal(t);e.ctx.events.currentModeRender(p,function(_){e.sources[g].push(_)})}if(n.forEach(function(h){return a(h,"hot")}),r.forEach(function(h){return a(h,"cold")}),i&&e.ctx.map.getSource(X.COLD).setData({type:m.FEATURE_COLLECTION,features:e.sources.cold}),e.ctx.map.getSource(X.HOT).setData({type:m.FEATURE_COLLECTION,features:e.sources.hot}),e._emitSelectionChange&&(e.ctx.map.fire(H.SELECTION_CHANGE,{features:e.getSelected().map(function(h){return h.toGeoJSON()}),points:e.getSelectedCoordinates().map(function(h){return{type:m.FEATURE,properties:{},geometry:{type:m.POINT,coordinates:h.coordinates}}})}),e._emitSelectionChange=!1),e._deletedFeaturesToEmit.length){var l=e._deletedFeaturesToEmit.map(function(h){return h.toGeoJSON()});e._deletedFeaturesToEmit=[],e.ctx.map.fire(H.DELETE,{features:l})}function d(){e.isDirty=!1,e.clearChangedIds()}d(),e.ctx.map.fire(H.RENDER,{})}function x(e){var t,n=this;this._features={},this._featureIds=new Z,this._selectedFeatureIds=new Z,this._selectedCoordinates=[],this._changedFeatureIds=new Z,this._deletedFeaturesToEmit=[],this._emitSelectionChange=!1,this._mapInitialConfig={},this.ctx=e,this.sources={hot:[],cold:[]},this.render=function(){t||(t=requestAnimationFrame(function(){t=null,ar.call(n)}))},this.isDirty=!1}function on(e,t){var n=e._selectedCoordinates.filter(function(r){return e._selectedFeatureIds.has(r.feature_id)});e._selectedCoordinates.length===n.length||t.silent||(e._emitSelectionChange=!0),e._selectedCoordinates=n}x.prototype.createRenderBatch=function(){var e=this,t=this.render,n=0;return this.render=function(){n++},function(){e.render=t,n>0&&e.render()}},x.prototype.setDirty=function(){return this.isDirty=!0,this},x.prototype.featureChanged=function(e){return this._changedFeatureIds.add(e),this},x.prototype.getChangedIds=function(){return this._changedFeatureIds.values()},x.prototype.clearChangedIds=function(){return this._changedFeatureIds.clear(),this},x.prototype.getAllIds=function(){return this._featureIds.values()},x.prototype.add=function(e){return this.featureChanged(e.id),this._features[e.id]=e,this._featureIds.add(e.id),this},x.prototype.delete=function(e,t){var n=this;return t===void 0&&(t={}),De(e).forEach(function(r){n._featureIds.has(r)&&(n._featureIds.delete(r),n._selectedFeatureIds.delete(r),t.silent||n._deletedFeaturesToEmit.indexOf(n._features[r])===-1&&n._deletedFeaturesToEmit.push(n._features[r]),delete n._features[r],n.isDirty=!0)}),on(this,t),this},x.prototype.get=function(e){return this._features[e]},x.prototype.getAll=function(){var e=this;return Object.keys(this._features).map(function(t){return e._features[t]})},x.prototype.select=function(e,t){var n=this;return t===void 0&&(t={}),De(e).forEach(function(r){n._selectedFeatureIds.has(r)||(n._selectedFeatureIds.add(r),n._changedFeatureIds.add(r),t.silent||(n._emitSelectionChange=!0))}),this},x.prototype.deselect=function(e,t){var n=this;return t===void 0&&(t={}),De(e).forEach(function(r){n._selectedFeatureIds.has(r)&&(n._selectedFeatureIds.delete(r),n._changedFeatureIds.add(r),t.silent||(n._emitSelectionChange=!0))}),on(this,t),this},x.prototype.clearSelected=function(e){return e===void 0&&(e={}),this.deselect(this._selectedFeatureIds.values(),{silent:e.silent}),this},x.prototype.setSelected=function(e,t){var n=this;return t===void 0&&(t={}),e=De(e),this.deselect(this._selectedFeatureIds.values().filter(function(r){return e.indexOf(r)===-1}),{silent:t.silent}),this.select(e.filter(function(r){return!n._selectedFeatureIds.has(r)}),{silent:t.silent}),this},x.prototype.setSelectedCoordinates=function(e){return this._selectedCoordinates=e,this._emitSelectionChange=!0,this},x.prototype.clearSelectedCoordinates=function(){return this._selectedCoordinates=[],this._emitSelectionChange=!0,this},x.prototype.getSelectedIds=function(){return this._selectedFeatureIds.values()},x.prototype.getSelected=function(){var e=this;return this._selectedFeatureIds.values().map(function(t){return e.get(t)})},x.prototype.getSelectedCoordinates=function(){var e=this;return this._selectedCoordinates.map(function(t){return{coordinates:e.get(t.feature_id).getCoordinate(t.coord_path)}})},x.prototype.isSelected=function(e){return this._selectedFeatureIds.has(e)},x.prototype.setFeatureProperty=function(e,t,n){this.get(e).setProperty(t,n),this.featureChanged(e)},x.prototype.storeMapConfig=function(){var e=this;Wt.forEach(function(t){e.ctx.map[t]&&(e._mapInitialConfig[t]=e.ctx.map[t].isEnabled())})},x.prototype.restoreMapConfig=function(){var e=this;Object.keys(this._mapInitialConfig).forEach(function(t){e._mapInitialConfig[t]?e.ctx.map[t].enable():e.ctx.map[t].disable()})},x.prototype.getInitialConfigValue=function(e){return this._mapInitialConfig[e]===void 0||this._mapInitialConfig[e]};var sr=function(){for(var e=arguments,t={},n=0;n<arguments.length;n++){var r=e[n];for(var o in r)ur.call(r,o)&&(t[o]=r[o])}return t},ur=Object.prototype.hasOwnProperty,pe=de(sr),cr=["mode","feature","mouse"];function lr(e){var t=null,n=null,r={onRemove:function(){return e.map.off("load",r.connect),clearInterval(n),r.removeLayers(),e.store.restoreMapConfig(),e.ui.removeButtons(),e.events.removeEventListeners(),e.ui.clearMapClasses(),e.boxZoomInitial&&e.map.boxZoom.enable(),e.map=null,e.container=null,e.store=null,t&&t.parentNode&&t.parentNode.removeChild(t),t=null,this},connect:function(){e.map.off("load",r.connect),clearInterval(n),r.addLayers(),e.store.storeMapConfig(),e.events.addEventListeners()},onAdd:function(o){var i=o.fire;return o.fire=function(a,l){var d=arguments;return i.length===1&&arguments.length!==1&&(d=[pe({},{type:a},l)]),i.apply(o,d)},e.map=o,e.events=function(a){var l=Object.keys(a.options.modes).reduce(function(c,y){return c[y]=ir(a.options.modes[y]),c},{}),d={},h={},g={},p=null,_=null;g.drag=function(c,y){y({point:c.point,time:new Date().getTime()})?(a.ui.queueMapClasses({mouse:N.DRAG}),_.drag(c)):c.originalEvent.stopPropagation()},g.mousedrag=function(c){g.drag(c,function(y){return!xt(d,y)})},g.touchdrag=function(c){g.drag(c,function(y){return!Mt(h,y)})},g.mousemove=function(c){if((c.originalEvent.buttons!==void 0?c.originalEvent.buttons:c.originalEvent.which)===1)return g.mousedrag(c);var y=Ye(c,a);c.featureTarget=y,_.mousemove(c)},g.mousedown=function(c){d={time:new Date().getTime(),point:c.point};var y=Ye(c,a);c.featureTarget=y,_.mousedown(c)},g.mouseup=function(c){var y=Ye(c,a);c.featureTarget=y,xt(d,{point:c.point,time:new Date().getTime()})?_.click(c):_.mouseup(c)},g.mouseout=function(c){_.mouseout(c)},g.touchstart=function(c){if(a.options.touchEnabled){h={time:new Date().getTime(),point:c.point};var y=xe.touch(c,null,a)[0];c.featureTarget=y,_.touchstart(c)}},g.touchmove=function(c){if(a.options.touchEnabled)return _.touchmove(c),g.touchdrag(c)},g.touchend=function(c){if(c.originalEvent.preventDefault(),a.options.touchEnabled){var y=xe.touch(c,null,a)[0];c.featureTarget=y,Mt(h,{time:new Date().getTime(),point:c.point})?_.tap(c):_.touchend(c)}};var A=function(c){return!(c===8||c===46||c>=48&&c<=57)};function b(c,y,O){O===void 0&&(O={}),_.stop();var V=l[c];if(V===void 0)throw new Error(c+" is not valid");p=c;var w=V(a,y);_=ze(w,a),O.silent||a.map.fire(H.MODE_CHANGE,{mode:c}),a.store.setDirty(),a.store.render()}g.keydown=function(c){(c.srcElement||c.target).classList.contains("mapboxgl-canvas")&&(c.keyCode!==8&&c.keyCode!==46||!a.options.controls.trash?A(c.keyCode)?_.keydown(c):c.keyCode===49&&a.options.controls.point?b(T.DRAW_POINT):c.keyCode===50&&a.options.controls.line_string?b(T.DRAW_LINE_STRING):c.keyCode===51&&a.options.controls.polygon&&b(T.DRAW_POLYGON):(c.preventDefault(),_.trash()))},g.keyup=function(c){A(c.keyCode)&&_.keyup(c)},g.zoomend=function(){a.store.changeZoom()},g.data=function(c){if(c.dataType==="style"){var y=a.setup,O=a.map,V=a.options,w=a.store;V.styles.some(function(Ut){return O.getLayer(Ut.id)})||(y.addLayers(),w.setDirty(),w.render())}};var F={trash:!1,combineFeatures:!1,uncombineFeatures:!1};return{start:function(){p=a.options.defaultMode,_=ze(l[p](a),a)},changeMode:b,actionable:function(c){var y=!1;Object.keys(c).forEach(function(O){if(F[O]===void 0)throw new Error("Invalid action type");F[O]!==c[O]&&(y=!0),F[O]=c[O]}),y&&a.map.fire(H.ACTIONABLE,{actions:F})},currentModeName:function(){return p},currentModeRender:function(c,y){return _.render(c,y)},fire:function(c,y){g[c]&&g[c](y)},addEventListeners:function(){a.map.on("mousemove",g.mousemove),a.map.on("mousedown",g.mousedown),a.map.on("mouseup",g.mouseup),a.map.on("data",g.data),a.map.on("touchmove",g.touchmove),a.map.on("touchstart",g.touchstart),a.map.on("touchend",g.touchend),a.container.addEventListener("mouseout",g.mouseout),a.options.keybindings&&(a.container.addEventListener("keydown",g.keydown),a.container.addEventListener("keyup",g.keyup))},removeEventListeners:function(){a.map.off("mousemove",g.mousemove),a.map.off("mousedown",g.mousedown),a.map.off("mouseup",g.mouseup),a.map.off("data",g.data),a.map.off("touchmove",g.touchmove),a.map.off("touchstart",g.touchstart),a.map.off("touchend",g.touchend),a.container.removeEventListener("mouseout",g.mouseout),a.options.keybindings&&(a.container.removeEventListener("keydown",g.keydown),a.container.removeEventListener("keyup",g.keyup))},trash:function(c){_.trash(c)},combineFeatures:function(){_.combineFeatures()},uncombineFeatures:function(){_.uncombineFeatures()},getMode:function(){return p}}}(e),e.ui=function(a){var l={},d=null,h={mode:null,feature:null,mouse:null},g={mode:null,feature:null,mouse:null};function p(c){g=pe(g,c)}function _(){var c,y;if(a.container){var O=[],V=[];cr.forEach(function(w){g[w]!==h[w]&&(O.push(w+"-"+h[w]),g[w]!==null&&V.push(w+"-"+g[w]))}),O.length>0&&(c=a.container.classList).remove.apply(c,O),V.length>0&&(y=a.container.classList).add.apply(y,V),h=pe(h,g)}}function A(c,y){y===void 0&&(y={});var O=document.createElement("button");return O.className=q.CONTROL_BUTTON+" "+y.className,O.setAttribute("title",y.title),y.container.appendChild(O),O.addEventListener("click",function(V){if(V.preventDefault(),V.stopPropagation(),V.target===d)return b(),void y.onDeactivate();F(c),y.onActivate()},!0),O}function b(){d&&(d.classList.remove(q.ACTIVE_BUTTON),d=null)}function F(c){b();var y=l[c];y&&y&&c!=="trash"&&(y.classList.add(q.ACTIVE_BUTTON),d=y)}return{setActiveButton:F,queueMapClasses:p,updateMapClasses:_,clearMapClasses:function(){p({mode:null,feature:null,mouse:null}),_()},addButtons:function(){var c=a.options.controls,y=document.createElement("div");return y.className=q.CONTROL_GROUP+" "+q.CONTROL_BASE,c&&(c[Y.LINE]&&(l[Y.LINE]=A(Y.LINE,{container:y,className:q.CONTROL_BUTTON_LINE,title:"LineString tool "+(a.options.keybindings?"(l)":""),onActivate:function(){return a.events.changeMode(T.DRAW_LINE_STRING)},onDeactivate:function(){return a.events.trash()}})),c[Y.POLYGON]&&(l[Y.POLYGON]=A(Y.POLYGON,{container:y,className:q.CONTROL_BUTTON_POLYGON,title:"Polygon tool "+(a.options.keybindings?"(p)":""),onActivate:function(){return a.events.changeMode(T.DRAW_POLYGON)},onDeactivate:function(){return a.events.trash()}})),c[Y.POINT]&&(l[Y.POINT]=A(Y.POINT,{container:y,className:q.CONTROL_BUTTON_POINT,title:"Marker tool "+(a.options.keybindings?"(m)":""),onActivate:function(){return a.events.changeMode(T.DRAW_POINT)},onDeactivate:function(){return a.events.trash()}})),c.trash&&(l.trash=A("trash",{container:y,className:q.CONTROL_BUTTON_TRASH,title:"Delete",onActivate:function(){a.events.trash()}})),c.combine_features&&(l.combine_features=A("combineFeatures",{container:y,className:q.CONTROL_BUTTON_COMBINE_FEATURES,title:"Combine",onActivate:function(){a.events.combineFeatures()}})),c.uncombine_features&&(l.uncombine_features=A("uncombineFeatures",{container:y,className:q.CONTROL_BUTTON_UNCOMBINE_FEATURES,title:"Uncombine",onActivate:function(){a.events.uncombineFeatures()}}))),y},removeButtons:function(){Object.keys(l).forEach(function(c){var y=l[c];y.parentNode&&y.parentNode.removeChild(y),delete l[c]})}}}(e),e.container=o.getContainer(),e.store=new x(e),t=e.ui.addButtons(),e.options.boxSelect&&(e.boxZoomInitial=o.boxZoom.isEnabled(),o.boxZoom.disable(),o.dragPan.disable(),o.dragPan.enable()),o.loaded()?r.connect():(o.on("load",r.connect),n=setInterval(function(){o.loaded()&&r.connect()},16)),e.events.start(),t},addLayers:function(){e.map.addSource(X.COLD,{data:{type:m.FEATURE_COLLECTION,features:[]},type:"geojson"}),e.map.addSource(X.HOT,{data:{type:m.FEATURE_COLLECTION,features:[]},type:"geojson"}),e.options.styles.forEach(function(o){e.map.addLayer(o)}),e.store.setDirty(!0),e.store.render()},removeLayers:function(){e.options.styles.forEach(function(o){e.map.getLayer(o.id)&&e.map.removeLayer(o.id)}),e.map.getSource(X.COLD)&&e.map.removeSource(X.COLD),e.map.getSource(X.HOT)&&e.map.removeSource(X.HOT)}};return e.setup=r,r}var an=[{id:"gl-draw-polygon-fill-inactive",type:"fill",filter:["all",["==","active","false"],["==","$type","Polygon"],["!=","mode","static"]],paint:{"fill-color":"#3bb2d0","fill-outline-color":"#3bb2d0","fill-opacity":.1}},{id:"gl-draw-polygon-fill-active",type:"fill",filter:["all",["==","active","true"],["==","$type","Polygon"]],paint:{"fill-color":"#fbb03b","fill-outline-color":"#fbb03b","fill-opacity":.1}},{id:"gl-draw-polygon-midpoint",type:"circle",filter:["all",["==","$type","Point"],["==","meta","midpoint"]],paint:{"circle-radius":3,"circle-color":"#fbb03b"}},{id:"gl-draw-polygon-stroke-inactive",type:"line",filter:["all",["==","active","false"],["==","$type","Polygon"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#3bb2d0","line-width":2}},{id:"gl-draw-polygon-stroke-active",type:"line",filter:["all",["==","active","true"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fbb03b","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-line-inactive",type:"line",filter:["all",["==","active","false"],["==","$type","LineString"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#3bb2d0","line-width":2}},{id:"gl-draw-line-active",type:"line",filter:["all",["==","$type","LineString"],["==","active","true"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fbb03b","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-polygon-and-line-vertex-stroke-inactive",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":5,"circle-color":"#fff"}},{id:"gl-draw-polygon-and-line-vertex-inactive",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":3,"circle-color":"#fbb03b"}},{id:"gl-draw-point-point-stroke-inactive",type:"circle",filter:["all",["==","active","false"],["==","$type","Point"],["==","meta","feature"],["!=","mode","static"]],paint:{"circle-radius":5,"circle-opacity":1,"circle-color":"#fff"}},{id:"gl-draw-point-inactive",type:"circle",filter:["all",["==","active","false"],["==","$type","Point"],["==","meta","feature"],["!=","mode","static"]],paint:{"circle-radius":3,"circle-color":"#3bb2d0"}},{id:"gl-draw-point-stroke-active",type:"circle",filter:["all",["==","$type","Point"],["==","active","true"],["!=","meta","midpoint"]],paint:{"circle-radius":7,"circle-color":"#fff"}},{id:"gl-draw-point-active",type:"circle",filter:["all",["==","$type","Point"],["!=","meta","midpoint"],["==","active","true"]],paint:{"circle-radius":5,"circle-color":"#fbb03b"}},{id:"gl-draw-polygon-fill-static",type:"fill",filter:["all",["==","mode","static"],["==","$type","Polygon"]],paint:{"fill-color":"#404040","fill-outline-color":"#404040","fill-opacity":.1}},{id:"gl-draw-polygon-stroke-static",type:"line",filter:["all",["==","mode","static"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#404040","line-width":2}},{id:"gl-draw-line-static",type:"line",filter:["all",["==","mode","static"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#404040","line-width":2}},{id:"gl-draw-point-static",type:"circle",filter:["all",["==","mode","static"],["==","$type","Point"]],paint:{"circle-radius":5,"circle-color":"#404040"}}];function qe(e){return function(t){var n=t.featureTarget;return!!n&&!!n.properties&&n.properties.meta===e}}function sn(e){return!!e.originalEvent&&!!e.originalEvent.shiftKey&&e.originalEvent.button===0}function _e(e){return!!e.featureTarget&&!!e.featureTarget.properties&&e.featureTarget.properties.active===j.ACTIVE&&e.featureTarget.properties.meta===B.FEATURE}function At(e){return!!e.featureTarget&&!!e.featureTarget.properties&&e.featureTarget.properties.active===j.INACTIVE&&e.featureTarget.properties.meta===B.FEATURE}function He(e){return e.featureTarget===void 0}function Pt(e){return!!e.featureTarget&&!!e.featureTarget.properties&&e.featureTarget.properties.meta===B.FEATURE}function ke(e){var t=e.featureTarget;return!!t&&!!t.properties&&t.properties.meta===B.VERTEX}function Xe(e){return!!e.originalEvent&&e.originalEvent.shiftKey===!0}function Ze(e){return e.keyCode===27}function We(e){return e.keyCode===13}var dr=Object.freeze({__proto__:null,isOfMetaType:qe,isShiftMousedown:sn,isActiveFeature:_e,isInactiveFeature:At,noTarget:He,isFeature:Pt,isVertex:ke,isShiftDown:Xe,isEscapeKey:Ze,isEnterKey:We,isTrue:function(){return!0}}),pr=Me;function Me(e,t){this.x=e,this.y=t}Me.prototype={clone:function(){return new Me(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,n=e.y-this.y;return t*t+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y,n=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=n,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),n=Math.sin(e),r=t*this.x-n*this.y,o=n*this.x+t*this.y;return this.x=r,this.y=o,this},_rotateAround:function(e,t){var n=Math.cos(e),r=Math.sin(e),o=t.x+n*(this.x-t.x)-r*(this.y-t.y),i=t.y+r*(this.x-t.x)+n*(this.y-t.y);return this.x=o,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Me.convert=function(e){return e instanceof Me?e:Array.isArray(e)?new Me(e[0],e[1]):e};var fr=de(pr);function Ft(e,t){var n=t.getBoundingClientRect();return new fr(e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0))}function Le(e,t,n,r){return{type:m.FEATURE,properties:{meta:B.VERTEX,parent:e,coord_path:n,active:r?j.ACTIVE:j.INACTIVE},geometry:{type:m.POINT,coordinates:t}}}function un(e,t,n){var r=t.geometry.coordinates,o=n.geometry.coordinates;if(r[1]>85||r[1]<St||o[1]>85||o[1]<St)return null;var i={lng:(r[0]+o[0])/2,lat:(r[1]+o[1])/2};return{type:m.FEATURE,properties:{meta:B.MIDPOINT,parent:e,lng:i.lng,lat:i.lat,coord_path:n.properties.coord_path},geometry:{type:m.POINT,coordinates:[i.lng,i.lat]}}}function Ke(e,t,n){t===void 0&&(t={}),n===void 0&&(n=null);var r,o=e.geometry,i=o.type,a=o.coordinates,l=e.properties&&e.properties.id,d=[];function h(p,_){var A="",b=null;p.forEach(function(F,c){var y=_!=null?_+"."+c:String(c),O=Le(l,F,y,g(y));if(t.midpoints&&b){var V=un(l,b,O);V&&d.push(V)}b=O;var w=JSON.stringify(F);A!==w&&d.push(O),c===0&&(A=w)})}function g(p){return!!t.selectedPaths&&t.selectedPaths.indexOf(p)!==-1}return i===m.POINT?d.push(Le(l,a,n,g(n))):i===m.POLYGON?a.forEach(function(p,_){h(p,n!==null?n+"."+_:String(_))}):i===m.LINE_STRING?h(a,n):i.indexOf(m.MULTI_PREFIX)===0&&(r=i.replace(m.MULTI_PREFIX,""),a.forEach(function(p,_){var A={type:m.FEATURE,properties:e.properties,geometry:{type:r,coordinates:p}};d=d.concat(Ke(A,t,_))})),d}var ee={enable:function(e){setTimeout(function(){e.map&&e.map.doubleClickZoom&&e._ctx&&e._ctx.store&&e._ctx.store.getInitialConfigValue&&e._ctx.store.getInitialConfigValue("doubleClickZoom")&&e.map.doubleClickZoom.enable()},0)},disable:function(e){setTimeout(function(){e.map&&e.map.doubleClickZoom&&e.map.doubleClickZoom.disable()},0)}},Qe={exports:{}},cn=function(e){if(!e||!e.type)return null;var t=hr[e.type];if(!t)return null;if(t==="geometry")return{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:e}]};if(t==="feature")return{type:"FeatureCollection",features:[e]};if(t==="featurecollection")return e},hr={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"},gr=de(cn),yr=Object.freeze({__proto__:null,default:function e(t){switch(t&&t.type||null){case"FeatureCollection":return t.features=t.features.reduce(function(n,r){return n.concat(e(r))},[]),t;case"Feature":return t.geometry?e(t.geometry).map(function(n){var r={type:"Feature",properties:JSON.parse(JSON.stringify(t.properties)),geometry:n};return t.id!==void 0&&(r.id=t.id),r}):[t];case"MultiPoint":return t.coordinates.map(function(n){return{type:"Point",coordinates:n}});case"MultiPolygon":return t.coordinates.map(function(n){return{type:"Polygon",coordinates:n}});case"MultiLineString":return t.coordinates.map(function(n){return{type:"LineString",coordinates:n}});case"GeometryCollection":return t.geometries.map(e).reduce(function(n,r){return n.concat(r)},[]);case"Point":case"Polygon":case"LineString":return[t]}}}),vr=cn,et=Kn(yr),mr=function(e){return function t(n){return Array.isArray(n)&&n.length&&typeof n[0]=="number"?[n]:n.reduce(function(r,o){return Array.isArray(o)&&Array.isArray(o[0])?r.concat(t(o)):(r.push(o),r)},[])}(e)};et instanceof Function||(et=et.default);var ln={exports:{}},_r=ln.exports=function(e){return new K(e)};function K(e){this.value=e}function dn(e,t,n){var r=[],o=[],i=!0;return function a(l){var d=n?pn(l):l,h={},g=!0,p={node:d,node_:l,path:[].concat(r),parent:o[o.length-1],parents:o,key:r.slice(-1)[0],isRoot:r.length===0,level:r.length,circular:null,update:function(b,F){p.isRoot||(p.parent.node[p.key]=b),p.node=b,F&&(g=!1)},delete:function(b){delete p.parent.node[p.key],b&&(g=!1)},remove:function(b){fn(p.parent.node)?p.parent.node.splice(p.key,1):delete p.parent.node[p.key],b&&(g=!1)},keys:null,before:function(b){h.before=b},after:function(b){h.after=b},pre:function(b){h.pre=b},post:function(b){h.post=b},stop:function(){i=!1},block:function(){g=!1}};if(!i)return p;function _(){if(typeof p.node=="object"&&p.node!==null){p.keys&&p.node_===p.node||(p.keys=tt(p.node)),p.isLeaf=p.keys.length==0;for(var b=0;b<o.length;b++)if(o[b].node_===l){p.circular=o[b];break}}else p.isLeaf=!0,p.keys=null;p.notLeaf=!p.isLeaf,p.notRoot=!p.isRoot}_();var A=t.call(p,p.node);return A!==void 0&&p.update&&p.update(A),h.before&&h.before.call(p,p.node),g&&(typeof p.node!="object"||p.node===null||p.circular||(o.push(p),_(),nt(p.keys,function(b,F){r.push(b),h.pre&&h.pre.call(p,p.node[b],b);var c=a(p.node[b]);n&&rt.call(p.node,b)&&(p.node[b]=c.node),c.isLast=F==p.keys.length-1,c.isFirst=F==0,h.post&&h.post.call(p,c),r.pop()}),o.pop()),h.after&&h.after.call(p,p.node)),p}(e).node}function pn(e){if(typeof e=="object"&&e!==null){var t;if(fn(e))t=[];else if(Ne(e)==="[object Date]")t=new Date(e.getTime?e.getTime():e);else if(function(o){return Ne(o)==="[object RegExp]"}(e))t=new RegExp(e);else if(function(o){return Ne(o)==="[object Error]"}(e))t={message:e.message};else if(function(o){return Ne(o)==="[object Boolean]"}(e))t=new Boolean(e);else if(function(o){return Ne(o)==="[object Number]"}(e))t=new Number(e);else if(function(o){return Ne(o)==="[object String]"}(e))t=new String(e);else if(Object.create&&Object.getPrototypeOf)t=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)t={};else{var n=e.constructor&&e.constructor.prototype||e.__proto__||{},r=function(){};r.prototype=n,t=new r}return nt(tt(e),function(o){t[o]=e[o]}),t}return e}K.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var r=e[n];if(!t||!rt.call(t,r)){t=void 0;break}t=t[r]}return t},K.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var r=e[n];if(!t||!rt.call(t,r))return!1;t=t[r]}return!0},K.prototype.set=function(e,t){for(var n=this.value,r=0;r<e.length-1;r++){var o=e[r];rt.call(n,o)||(n[o]={}),n=n[o]}return n[e[r]]=t,t},K.prototype.map=function(e){return dn(this.value,e,!0)},K.prototype.forEach=function(e){return this.value=dn(this.value,e,!1),this.value},K.prototype.reduce=function(e,t){var n=arguments.length===1,r=n?this.value:t;return this.forEach(function(o){this.isRoot&&n||(r=e.call(this,r,o))}),r},K.prototype.paths=function(){var e=[];return this.forEach(function(t){e.push(this.path)}),e},K.prototype.nodes=function(){var e=[];return this.forEach(function(t){e.push(this.node)}),e},K.prototype.clone=function(){var e=[],t=[];return function n(r){for(var o=0;o<e.length;o++)if(e[o]===r)return t[o];if(typeof r=="object"&&r!==null){var i=pn(r);return e.push(r),t.push(i),nt(tt(r),function(a){i[a]=n(r[a])}),e.pop(),t.pop(),i}return r}(this.value)};var tt=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function Ne(e){return Object.prototype.toString.call(e)}var fn=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},nt=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)};nt(tt(K.prototype),function(e){_r[e]=function(t){var n=[].slice.call(arguments,1),r=new K(t);return r[e].apply(r,n)}});var rt=Object.hasOwnProperty||function(e,t){return t in e},br=ln.exports,Er=J;function J(e){if(!(this instanceof J))return new J(e);this._bbox=e||[1/0,1/0,-1/0,-1/0],this._valid=!!e}J.prototype.include=function(e){return this._valid=!0,this._bbox[0]=Math.min(this._bbox[0],e[0]),this._bbox[1]=Math.min(this._bbox[1],e[1]),this._bbox[2]=Math.max(this._bbox[2],e[0]),this._bbox[3]=Math.max(this._bbox[3],e[1]),this},J.prototype.equals=function(e){var t;return t=e instanceof J?e.bbox():e,this._bbox[0]==t[0]&&this._bbox[1]==t[1]&&this._bbox[2]==t[2]&&this._bbox[3]==t[3]},J.prototype.center=function(e){return this._valid?[(this._bbox[0]+this._bbox[2])/2,(this._bbox[1]+this._bbox[3])/2]:null},J.prototype.union=function(e){var t;return this._valid=!0,t=e instanceof J?e.bbox():e,this._bbox[0]=Math.min(this._bbox[0],t[0]),this._bbox[1]=Math.min(this._bbox[1],t[1]),this._bbox[2]=Math.max(this._bbox[2],t[2]),this._bbox[3]=Math.max(this._bbox[3],t[3]),this},J.prototype.bbox=function(){return this._valid?this._bbox:null},J.prototype.contains=function(e){if(!e)return this._fastContains();if(!this._valid)return null;var t=e[0],n=e[1];return this._bbox[0]<=t&&this._bbox[1]<=n&&this._bbox[2]>=t&&this._bbox[3]>=n},J.prototype.intersect=function(e){return this._valid?(t=e instanceof J?e.bbox():e,!(this._bbox[0]>t[2]||this._bbox[2]<t[0]||this._bbox[3]<t[1]||this._bbox[1]>t[3])):null;var t},J.prototype._fastContains=function(){if(!this._valid)return new Function("return null;");var e="return "+this._bbox[0]+"<= ll[0] &&"+this._bbox[1]+"<= ll[1] &&"+this._bbox[2]+">= ll[0] &&"+this._bbox[3]+">= ll[1]";return new Function("ll",e)},J.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 Tr=function(e){if(!e)return[];var t=et(vr(e)),n=[];return t.features.forEach(function(r){r.geometry&&(n=n.concat(mr(r.geometry.coordinates)))}),n},Cr=br,Or=Er,hn={features:["FeatureCollection"],coordinates:["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],geometry:["Feature"],geometries:["GeometryCollection"]},Sr=Object.keys(hn);function wt(e){for(var t=Or(),n=Tr(e),r=0;r<n.length;r++)t.include(n[r]);return t}Qe.exports=function(e){return wt(e).bbox()},Qe.exports.polygon=function(e){return wt(e).polygon()},Qe.exports.bboxify=function(e){return Cr(e).map(function(t){t&&Sr.some(function(n){return!!t[n]&&hn[n].indexOf(t.type)!==-1})&&(t.bbox=wt(t).bbox(),this.update(t))})};var Ir=de(Qe.exports),ot=-90;function Rt(e,t){var n=ot,r=90,o=ot,i=90,a=270,l=-270;e.forEach(function(h){var g=Ir(h),p=g[1],_=g[3],A=g[0],b=g[2];p>n&&(n=p),_<r&&(r=_),_>o&&(o=_),p<i&&(i=p),A<a&&(a=A),b>l&&(l=b)});var d=t;return n+d.lat>85&&(d.lat=85-n),o+d.lat>90&&(d.lat=90-o),r+d.lat<-85&&(d.lat=-85-r),i+d.lat<ot&&(d.lat=ot-i),a+d.lng<=-270&&(d.lng+=360*Math.ceil(Math.abs(d.lng)/360)),l+d.lng>=270&&(d.lng-=360*Math.ceil(Math.abs(d.lng)/360)),d}function Dt(e,t){var n=Rt(e.map(function(r){return r.toGeoJSON()}),t);e.forEach(function(r){var o,i=r.getCoordinates(),a=function(d){var h={lng:d[0]+n.lng,lat:d[1]+n.lat};return[h.lng,h.lat]},l=function(d){return d.map(function(h){return a(h)})};r.type===m.POINT?o=a(i):r.type===m.LINE_STRING||r.type===m.MULTI_POINT?o=i.map(a):r.type===m.POLYGON||r.type===m.MULTI_LINE_STRING?o=i.map(l):r.type===m.MULTI_POLYGON&&(o=i.map(function(d){return d.map(function(h){return l(h)})})),r.incomingCoords(o)})}var D={onSetup:function(e){var t=this,n={dragMoveLocation:null,boxSelectStartLocation:null,boxSelectElement:void 0,boxSelecting:!1,canBoxSelect:!1,dragMoving:!1,canDragMove:!1,initiallySelectedFeatureIds:e.featureIds||[]};return this.setSelected(n.initiallySelectedFeatureIds.filter(function(r){return t.getFeature(r)!==void 0})),this.fireActionable(),this.setActionableState({combineFeatures:!0,uncombineFeatures:!0,trash:!0}),n},fireUpdate:function(){this.map.fire(H.UPDATE,{action:Ot.MOVE,features:this.getSelected().map(function(e){return e.toGeoJSON()})})},fireActionable:function(){var e=this,t=this.getSelected(),n=t.filter(function(l){return e.isInstanceOf("MultiFeature",l)}),r=!1;if(t.length>1){r=!0;var o=t[0].type.replace("Multi","");t.forEach(function(l){l.type.replace("Multi","")!==o&&(r=!1)})}var i=n.length>0,a=t.length>0;this.setActionableState({combineFeatures:r,uncombineFeatures:i,trash:a})},getUniqueIds:function(e){return e.length?e.map(function(t){return t.properties.id}).filter(function(t){return t!==void 0}).reduce(function(t,n){return t.add(n),t},new Z).values():[]},stopExtendedInteractions:function(e){e.boxSelectElement&&(e.boxSelectElement.parentNode&&e.boxSelectElement.parentNode.removeChild(e.boxSelectElement),e.boxSelectElement=null),this.map.dragPan.enable(),e.boxSelecting=!1,e.canBoxSelect=!1,e.dragMoving=!1,e.canDragMove=!1},onStop:function(){ee.enable(this)},onMouseMove:function(e,t){return Pt(t)&&e.dragMoving&&this.fireUpdate(),this.stopExtendedInteractions(e),!0},onMouseOut:function(e){return!e.dragMoving||this.fireUpdate()}};D.onTap=D.onClick=function(e,t){return He(t)?this.clickAnywhere(e,t):qe(B.VERTEX)(t)?this.clickOnVertex(e,t):Pt(t)?this.clickOnFeature(e,t):void 0},D.clickAnywhere=function(e){var t=this,n=this.getSelectedIds();n.length&&(this.clearSelectedFeatures(),n.forEach(function(r){return t.doRender(r)})),ee.enable(this),this.stopExtendedInteractions(e)},D.clickOnVertex=function(e,t){this.changeMode(T.DIRECT_SELECT,{featureId:t.featureTarget.properties.parent,coordPath:t.featureTarget.properties.coord_path,startPos:t.lngLat}),this.updateUIClasses({mouse:N.MOVE})},D.startOnActiveFeature=function(e,t){this.stopExtendedInteractions(e),this.map.dragPan.disable(),this.doRender(t.featureTarget.properties.id),e.canDragMove=!0,e.dragMoveLocation=t.lngLat},D.clickOnFeature=function(e,t){var n=this;ee.disable(this),this.stopExtendedInteractions(e);var r=Xe(t),o=this.getSelectedIds(),i=t.featureTarget.properties.id,a=this.isSelected(i);if(!r&&a&&this.getFeature(i).type!==m.POINT)return this.changeMode(T.DIRECT_SELECT,{featureId:i});a&&r?(this.deselect(i),this.updateUIClasses({mouse:N.POINTER}),o.length===1&&ee.enable(this)):!a&&r?(this.select(i),this.updateUIClasses({mouse:N.MOVE})):a||r||(o.forEach(function(l){return n.doRender(l)}),this.setSelected(i),this.updateUIClasses({mouse:N.MOVE})),this.doRender(i)},D.onMouseDown=function(e,t){return _e(t)?this.startOnActiveFeature(e,t):this.drawConfig.boxSelect&&sn(t)?this.startBoxSelect(e,t):void 0},D.startBoxSelect=function(e,t){this.stopExtendedInteractions(e),this.map.dragPan.disable(),e.boxSelectStartLocation=Ft(t.originalEvent,this.map.getContainer()),e.canBoxSelect=!0},D.onTouchStart=function(e,t){if(_e(t))return this.startOnActiveFeature(e,t)},D.onDrag=function(e,t){return e.canDragMove?this.dragMove(e,t):this.drawConfig.boxSelect&&e.canBoxSelect?this.whileBoxSelect(e,t):void 0},D.whileBoxSelect=function(e,t){e.boxSelecting=!0,this.updateUIClasses({mouse:N.ADD}),e.boxSelectElement||(e.boxSelectElement=document.createElement("div"),e.boxSelectElement.classList.add(q.BOX_SELECT),this.map.getContainer().appendChild(e.boxSelectElement));var n=Ft(t.originalEvent,this.map.getContainer()),r=Math.min(e.boxSelectStartLocation.x,n.x),o=Math.max(e.boxSelectStartLocation.x,n.x),i=Math.min(e.boxSelectStartLocation.y,n.y),a=Math.max(e.boxSelectStartLocation.y,n.y),l="translate("+r+"px, "+i+"px)";e.boxSelectElement.style.transform=l,e.boxSelectElement.style.WebkitTransform=l,e.boxSelectElement.style.width=o-r+"px",e.boxSelectElement.style.height=a-i+"px"},D.dragMove=function(e,t){e.dragMoving=!0,t.originalEvent.stopPropagation();var n={lng:t.lngLat.lng-e.dragMoveLocation.lng,lat:t.lngLat.lat-e.dragMoveLocation.lat};Dt(this.getSelected(),n),e.dragMoveLocation=t.lngLat},D.onTouchEnd=D.onMouseUp=function(e,t){var n=this;if(e.dragMoving)this.fireUpdate();else if(e.boxSelecting){var r=[e.boxSelectStartLocation,Ft(t.originalEvent,this.map.getContainer())],o=this.featuresAt(null,r,"click"),i=this.getUniqueIds(o).filter(function(a){return!n.isSelected(a)});i.length&&(this.select(i),i.forEach(function(a){return n.doRender(a)}),this.updateUIClasses({mouse:N.MOVE}))}this.stopExtendedInteractions(e)},D.toDisplayFeatures=function(e,t,n){t.properties.active=this.isSelected(t.properties.id)?j.ACTIVE:j.INACTIVE,n(t),this.fireActionable(),t.properties.active===j.ACTIVE&&t.geometry.type!==m.POINT&&Ke(t).forEach(n)},D.onTrash=function(){this.deleteFeature(this.getSelectedIds()),this.fireActionable()},D.onCombineFeatures=function(){var e=this.getSelected();if(!(e.length===0||e.length<2)){for(var t=[],n=[],r=e[0].type.replace("Multi",""),o=0;o<e.length;o++){var i=e[o];if(i.type.replace("Multi","")!==r)return;i.type.includes("Multi")?i.getCoordinates().forEach(function(l){t.push(l)}):t.push(i.getCoordinates()),n.push(i.toGeoJSON())}if(n.length>1){var a=this.newFeature({type:m.FEATURE,properties:n[0].properties,geometry:{type:"Multi"+r,coordinates:t}});this.addFeature(a),this.deleteFeature(this.getSelectedIds(),{silent:!0}),this.setSelected([a.id]),this.map.fire(H.COMBINE_FEATURES,{createdFeatures:[a.toGeoJSON()],deletedFeatures:n})}this.fireActionable()}},D.onUncombineFeatures=function(){var e=this,t=this.getSelected();if(t.length!==0){for(var n=[],r=[],o=function(a){var l=t[a];e.isInstanceOf("MultiFeature",l)&&(l.getFeatures().forEach(function(d){e.addFeature(d),d.properties=l.properties,n.push(d.toGeoJSON()),e.select([d.id])}),e.deleteFeature(l.id,{silent:!0}),r.push(l.toGeoJSON()))},i=0;i<t.length;i++)o(i);n.length>1&&this.map.fire(H.UNCOMBINE_FEATURES,{createdFeatures:n,deletedFeatures:r}),this.fireActionable()}};var gn=qe(B.VERTEX),yn=qe(B.MIDPOINT),fe={fireUpdate:function(){this.map.fire(H.UPDATE,{action:Ot.CHANGE_COORDINATES,features:this.getSelected().map(function(e){return e.toGeoJSON()})})},fireActionable:function(e){this.setActionableState({combineFeatures:!1,uncombineFeatures:!1,trash:e.selectedCoordPaths.length>0})},startDragging:function(e,t){this.map.dragPan.disable(),e.canDragMove=!0,e.dragMoveLocation=t.lngLat},stopDragging:function(e){this.map.dragPan.enable(),e.dragMoving=!1,e.canDragMove=!1,e.dragMoveLocation=null},onVertex:function(e,t){this.startDragging(e,t);var n=t.featureTarget.properties,r=e.selectedCoordPaths.indexOf(n.coord_path);Xe(t)||r!==-1?Xe(t)&&r===-1&&e.selectedCoordPaths.push(n.coord_path):e.selectedCoordPaths=[n.coord_path];var o=this.pathsToCoordinates(e.featureId,e.selectedCoordPaths);this.setSelectedCoordinates(o)},onMidpoint:function(e,t){this.startDragging(e,t);var n=t.featureTarget.properties;e.feature.addCoordinate(n.coord_path,n.lng,n.lat),this.fireUpdate(),e.selectedCoordPaths=[n.coord_path]},pathsToCoordinates:function(e,t){return t.map(function(n){return{feature_id:e,coord_path:n}})},onFeature:function(e,t){e.selectedCoordPaths.length===0?this.startDragging(e,t):this.stopDragging(e)},dragFeature:function(e,t,n){Dt(this.getSelected(),n),e.dragMoveLocation=t.lngLat},dragVertex:function(e,t,n){for(var r=e.selectedCoordPaths.map(function(l){return e.feature.getCoordinate(l)}),o=Rt(r.map(function(l){return{type:m.FEATURE,properties:{},geometry:{type:m.POINT,coordinates:l}}}),n),i=0;i<r.length;i++){var a=r[i];e.feature.updateCoordinate(e.selectedCoordPaths[i],a[0]+o.lng,a[1]+o.lat)}},clickNoTarget:function(){this.changeMode(T.SIMPLE_SELECT)},clickInactive:function(){this.changeMode(T.SIMPLE_SELECT)},clickActiveFeature:function(e){e.selectedCoordPaths=[],this.clearSelectedCoordinates(),e.feature.changed()},onSetup:function(e){var t=e.featureId,n=this.getFeature(t);if(!n)throw new Error("You must provide a featureId to enter direct_select mode");if(n.type===m.POINT)throw new TypeError("direct_select mode doesn't handle point features");var r={featureId:t,feature:n,dragMoveLocation:e.startPos||null,dragMoving:!1,canDragMove:!1,selectedCoordPaths:e.coordPath?[e.coordPath]:[]};return this.setSelectedCoordinates(this.pathsToCoordinates(t,r.selectedCoordPaths)),this.setSelected(t),ee.disable(this),this.setActionableState({trash:!0}),r},onStop:function(){ee.enable(this),this.clearSelectedCoordinates()},toDisplayFeatures:function(e,t,n){e.featureId===t.properties.id?(t.properties.active=j.ACTIVE,n(t),Ke(t,{map:this.map,midpoints:!0,selectedPaths:e.selectedCoordPaths}).forEach(n)):(t.properties.active=j.INACTIVE,n(t)),this.fireActionable(e)},onTrash:function(e){e.selectedCoordPaths.sort(function(t,n){return n.localeCompare(t,"en",{numeric:!0})}).forEach(function(t){return e.feature.removeCoordinate(t)}),this.fireUpdate(),e.selectedCoordPaths=[],this.clearSelectedCoordinates(),this.fireActionable(e),e.feature.isValid()===!1&&(this.deleteFeature([e.featureId]),this.changeMode(T.SIMPLE_SELECT,{}))},onMouseMove:function(e,t){var n=_e(t),r=gn(t),o=yn(t),i=e.selectedCoordPaths.length===0;return n&&i||r&&!i?this.updateUIClasses({mouse:N.MOVE}):this.updateUIClasses({mouse:N.NONE}),(r||n||o)&&e.dragMoving&&this.fireUpdate(),this.stopDragging(e),!0},onMouseOut:function(e){return e.dragMoving&&this.fireUpdate(),!0}};fe.onTouchStart=fe.onMouseDown=function(e,t){return gn(t)?this.onVertex(e,t):_e(t)?this.onFeature(e,t):yn(t)?this.onMidpoint(e,t):void 0},fe.onDrag=function(e,t){if(e.canDragMove===!0){e.dragMoving=!0,t.originalEvent.stopPropagation();var n={lng:t.lngLat.lng-e.dragMoveLocation.lng,lat:t.lngLat.lat-e.dragMoveLocation.lat};e.selectedCoordPaths.length>0?this.dragVertex(e,t,n):this.dragFeature(e,t,n),e.dragMoveLocation=t.lngLat}},fe.onClick=function(e,t){return He(t)?this.clickNoTarget(e,t):_e(t)?this.clickActiveFeature(e,t):At(t)?this.clickInactive(e,t):void this.stopDragging(e)},fe.onTap=function(e,t){return He(t)?this.clickNoTarget(e,t):_e(t)?this.clickActiveFeature(e,t):At(t)?this.clickInactive(e,t):void 0},fe.onTouchEnd=fe.onMouseUp=function(e){e.dragMoving&&this.fireUpdate(),this.stopDragging(e)};var ne={};function it(e,t){return!!e.lngLat&&e.lngLat.lng===t[0]&&e.lngLat.lat===t[1]}ne.onSetup=function(){var e=this.newFeature({type:m.FEATURE,properties:{},geometry:{type:m.POINT,coordinates:[]}});return this.addFeature(e),this.clearSelectedFeatures(),this.updateUIClasses({mouse:N.ADD}),this.activateUIButton(Y.POINT),this.setActionableState({trash:!0}),{point:e}},ne.stopDrawingAndRemove=function(e){this.deleteFeature([e.point.id],{silent:!0}),this.changeMode(T.SIMPLE_SELECT)},ne.onTap=ne.onClick=function(e,t){this.updateUIClasses({mouse:N.MOVE}),e.point.updateCoordinate("",t.lngLat.lng,t.lngLat.lat),this.map.fire(H.CREATE,{features:[e.point.toGeoJSON()]}),this.changeMode(T.SIMPLE_SELECT,{featureIds:[e.point.id]})},ne.onStop=function(e){this.activateUIButton(),e.point.getCoordinate().length||this.deleteFeature([e.point.id],{silent:!0})},ne.toDisplayFeatures=function(e,t,n){var r=t.properties.id===e.point.id;if(t.properties.active=r?j.ACTIVE:j.INACTIVE,!r)return n(t)},ne.onTrash=ne.stopDrawingAndRemove,ne.onKeyUp=function(e,t){if(Ze(t)||We(t))return this.stopDrawingAndRemove(e,t)};var be={onSetup:function(){var e=this.newFeature({type:m.FEATURE,properties:{},geometry:{type:m.POLYGON,coordinates:[[]]}});return this.addFeature(e),this.clearSelectedFeatures(),ee.disable(this),this.updateUIClasses({mouse:N.ADD}),this.activateUIButton(Y.POLYGON),this.setActionableState({trash:!0}),{polygon:e,currentVertexPosition:0}},clickAnywhere:function(e,t){if(e.currentVertexPosition>0&&it(t,e.polygon.coordinates[0][e.currentVertexPosition-1]))return this.changeMode(T.SIMPLE_SELECT,{featureIds:[e.polygon.id]});this.updateUIClasses({mouse:N.ADD}),e.polygon.updateCoordinate("0."+e.currentVertexPosition,t.lngLat.lng,t.lngLat.lat),e.currentVertexPosition++,e.polygon.updateCoordinate("0."+e.currentVertexPosition,t.lngLat.lng,t.lngLat.lat)},clickOnVertex:function(e){return this.changeMode(T.SIMPLE_SELECT,{featureIds:[e.polygon.id]})},onMouseMove:function(e,t){e.polygon.updateCoordinate("0."+e.currentVertexPosition,t.lngLat.lng,t.lngLat.lat),ke(t)&&this.updateUIClasses({mouse:N.POINTER})}};be.onTap=be.onClick=function(e,t){return ke(t)?this.clickOnVertex(e,t):this.clickAnywhere(e,t)},be.onKeyUp=function(e,t){Ze(t)?(this.deleteFeature([e.polygon.id],{silent:!0}),this.changeMode(T.SIMPLE_SELECT)):We(t)&&this.changeMode(T.SIMPLE_SELECT,{featureIds:[e.polygon.id]})},be.onStop=function(e){this.updateUIClasses({mouse:N.NONE}),ee.enable(this),this.activateUIButton(),this.getFeature(e.polygon.id)!==void 0&&(e.polygon.removeCoordinate("0."+e.currentVertexPosition),e.polygon.isValid()?this.map.fire(H.CREATE,{features:[e.polygon.toGeoJSON()]}):(this.deleteFeature([e.polygon.id],{silent:!0}),this.changeMode(T.SIMPLE_SELECT,{},{silent:!0})))},be.toDisplayFeatures=function(e,t,n){var r=t.properties.id===e.polygon.id;if(t.properties.active=r?j.ACTIVE:j.INACTIVE,!r)return n(t);if(t.geometry.coordinates.length!==0){var o=t.geometry.coordinates[0].length;if(!(o<3)){if(t.properties.meta=B.FEATURE,n(Le(e.polygon.id,t.geometry.coordinates[0][0],"0.0",!1)),o>3){var i=t.geometry.coordinates[0].length-3;n(Le(e.polygon.id,t.geometry.coordinates[0][i],"0."+i,!1))}if(o<=4){var a=[[t.geometry.coordinates[0][0][0],t.geometry.coordinates[0][0][1]],[t.geometry.coordinates[0][1][0],t.geometry.coordinates[0][1][1]]];if(n({type:m.FEATURE,properties:t.properties,geometry:{coordinates:a,type:m.LINE_STRING}}),o===3)return}return n(t)}}},be.onTrash=function(e){this.deleteFeature([e.polygon.id],{silent:!0}),this.changeMode(T.SIMPLE_SELECT)};var Ee={onSetup:function(e){var t,n,r=(e=e||{}).featureId,o="forward";if(r){if(!(t=this.getFeature(r)))throw new Error("Could not find a feature with the provided featureId");var i=e.from;if(i&&i.type==="Feature"&&i.geometry&&i.geometry.type==="Point"&&(i=i.geometry),i&&i.type==="Point"&&i.coordinates&&i.coordinates.length===2&&(i=i.coordinates),!i||!Array.isArray(i))throw new Error("Please use the `from` property to indicate which point to continue the line from");var a=t.coordinates.length-1;if(t.coordinates[a][0]===i[0]&&t.coordinates[a][1]===i[1])n=a+1,t.addCoordinate.apply(t,[n].concat(t.coordinates[a]));else{if(t.coordinates[0][0]!==i[0]||t.coordinates[0][1]!==i[1])throw new Error("`from` should match the point at either the start or the end of the provided LineString");o="backwards",n=0,t.addCoordinate.apply(t,[n].concat(t.coordinates[0]))}}else t=this.newFeature({type:m.FEATURE,properties:{},geometry:{type:m.LINE_STRING,coordinates:[]}}),n=0,this.addFeature(t);return this.clearSelectedFeatures(),ee.disable(this),this.updateUIClasses({mouse:N.ADD}),this.activateUIButton(Y.LINE),this.setActionableState({trash:!0}),{line:t,currentVertexPosition:n,direction:o}},clickAnywhere:function(e,t){if(e.currentVertexPosition>0&&it(t,e.line.coordinates[e.currentVertexPosition-1])||e.direction==="backwards"&&it(t,e.line.coordinates[e.currentVertexPosition+1]))return this.changeMode(T.SIMPLE_SELECT,{featureIds:[e.line.id]});this.updateUIClasses({mouse:N.ADD}),e.line.updateCoordinate(e.currentVertexPosition,t.lngLat.lng,t.lngLat.lat),e.direction==="forward"?(e.currentVertexPosition++,e.line.updateCoordinate(e.currentVertexPosition,t.lngLat.lng,t.lngLat.lat)):e.line.addCoordinate(0,t.lngLat.lng,t.lngLat.lat)},clickOnVertex:function(e){return this.changeMode(T.SIMPLE_SELECT,{featureIds:[e.line.id]})},onMouseMove:function(e,t){e.line.updateCoordinate(e.currentVertexPosition,t.lngLat.lng,t.lngLat.lat),ke(t)&&this.updateUIClasses({mouse:N.POINTER})}};Ee.onTap=Ee.onClick=function(e,t){if(ke(t))return this.clickOnVertex(e,t);this.clickAnywhere(e,t)},Ee.onKeyUp=function(e,t){We(t)?this.changeMode(T.SIMPLE_SELECT,{featureIds:[e.line.id]}):Ze(t)&&(this.deleteFeature([e.line.id],{silent:!0}),this.changeMode(T.SIMPLE_SELECT))},Ee.onStop=function(e){ee.enable(this),this.activateUIButton(),this.getFeature(e.line.id)!==void 0&&(e.line.removeCoordinate(""+e.currentVertexPosition),e.line.isValid()?this.map.fire(H.CREATE,{features:[e.line.toGeoJSON()]}):(this.deleteFeature([e.line.id],{silent:!0}),this.changeMode(T.SIMPLE_SELECT,{},{silent:!0})))},Ee.onTrash=function(e){this.deleteFeature([e.line.id],{silent:!0}),this.changeMode(T.SIMPLE_SELECT)},Ee.toDisplayFeatures=function(e,t,n){var r=t.properties.id===e.line.id;if(t.properties.active=r?j.ACTIVE:j.INACTIVE,!r)return n(t);t.geometry.coordinates.length<2||(t.properties.meta=B.FEATURE,n(Le(e.line.id,t.geometry.coordinates[e.direction==="forward"?t.geometry.coordinates.length-2:1],""+(e.direction==="forward"?t.geometry.coordinates.length-2:1),!1)),n(t))};var vn={simple_select:D,direct_select:fe,draw_point:ne,draw_polygon:be,draw_line_string:Ee},xr={defaultMode:T.SIMPLE_SELECT,keybindings:!0,touchEnabled:!0,clickBuffer:2,touchBuffer:25,boxSelect:!0,displayControlsDefault:!0,styles:an,modes:vn,controls:{},userProperties:!1},Mr={point:!0,line_string:!0,polygon:!0,trash:!0,combine_features:!0,uncombine_features:!0},Lr={point:!1,line_string:!1,polygon:!1,trash:!1,combine_features:!1,uncombine_features:!1};function mn(e,t){return e.map(function(n){return n.source?n:pe(n,{id:n.id+"."+t,source:t==="hot"?X.HOT:X.COLD})})}var kt={exports:{}};(function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,o="[object Arguments]",i="[object Array]",a="[object Boolean]",l="[object Date]",d="[object Error]",h="[object Function]",g="[object Map]",p="[object Number]",_="[object Object]",A="[object Promise]",b="[object RegExp]",F="[object Set]",c="[object String]",y="[object Symbol]",O="[object WeakMap]",V="[object ArrayBuffer]",w="[object DataView]",Ut=/^\[object .+?Constructor\]$/,Fr=/^(?:0|[1-9]\d*)$/,M={};M["[object Float32Array]"]=M["[object Float64Array]"]=M["[object Int8Array]"]=M["[object Int16Array]"]=M["[object Int32Array]"]=M["[object Uint8Array]"]=M["[object Uint8ClampedArray]"]=M["[object Uint16Array]"]=M["[object Uint32Array]"]=!0,M[o]=M[i]=M[V]=M[a]=M[w]=M[l]=M[d]=M[h]=M[g]=M[p]=M[_]=M[b]=M[F]=M[c]=M[O]=!1;var En=typeof Re.commonjsGlobal=="object"&&Re.commonjsGlobal&&Re.commonjsGlobal.Object===Object&&Re.commonjsGlobal,wr=typeof self=="object"&&self&&self.Object===Object&&self,ae=En||wr||Function("return this")(),Tn=t&&!t.nodeType&&t,Cn=Tn&&e&&!e.nodeType&&e,On=Cn&&Cn.exports===Tn,jt=On&&En.process,Sn=function(){try{return jt&&jt.binding&&jt.binding("util")}catch{}}(),In=Sn&&Sn.isTypedArray;function Rr(s,u){for(var f=-1,v=s==null?0:s.length;++f<v;)if(u(s[f],f,s))return!0;return!1}function Dr(s){var u=-1,f=Array(s.size);return s.forEach(function(v,L){f[++u]=[L,v]}),f}function kr(s){var u=-1,f=Array(s.size);return s.forEach(function(v){f[++u]=v}),f}var xn,Mn,Ln,Ur=Array.prototype,jr=Function.prototype,st=Object.prototype,Vt=ae["__core-js_shared__"],Nn=jr.toString,re=st.hasOwnProperty,An=(xn=/[^.]+$/.exec(Vt&&Vt.keys&&Vt.keys.IE_PROTO||""))?"Symbol(src)_1."+xn:"",Pn=st.toString,Vr=RegExp("^"+Nn.call(re).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Fn=On?ae.Buffer:void 0,ut=ae.Symbol,wn=ae.Uint8Array,Rn=st.propertyIsEnumerable,Br=Ur.splice,Te=ut?ut.toStringTag:void 0,Dn=Object.getOwnPropertySymbols,Gr=Fn?Fn.isBuffer:void 0,Jr=(Mn=Object.keys,Ln=Object,function(s){return Mn(Ln(s))}),Bt=Ae(ae,"DataView"),Ue=Ae(ae,"Map"),Gt=Ae(ae,"Promise"),Jt=Ae(ae,"Set"),zt=Ae(ae,"WeakMap"),je=Ae(Object,"create"),zr=Se(Bt),Yr=Se(Ue),$r=Se(Gt),qr=Se(Jt),Hr=Se(zt),kn=ut?ut.prototype:void 0,Yt=kn?kn.valueOf:void 0;function Ce(s){var u=-1,f=s==null?0:s.length;for(this.clear();++u<f;){var v=s[u];this.set(v[0],v[1])}}function se(s){var u=-1,f=s==null?0:s.length;for(this.clear();++u<f;){var v=s[u];this.set(v[0],v[1])}}function Oe(s){var u=-1,f=s==null?0:s.length;for(this.clear();++u<f;){var v=s[u];this.set(v[0],v[1])}}function ct(s){var u=-1,f=s==null?0:s.length;for(this.__data__=new Oe;++u<f;)this.add(s[u])}function he(s){var u=this.__data__=new se(s);this.size=u.size}function Xr(s,u){var f=pt(s),v=!f&&eo(s),L=!f&&!v&&$t(s),C=!f&&!v&&!L&&$n(s),P=f||v||L||C,R=P?function(U,oe){for(var ue=-1,z=Array(U);++ue<U;)z[ue]=oe(ue);return z}(s.length,String):[],te=R.length;for(var k in s)!u&&!re.call(s,k)||P&&(k=="length"||L&&(k=="offset"||k=="parent")||C&&(k=="buffer"||k=="byteLength"||k=="byteOffset")||Qr(k,te))||R.push(k);return R}function lt(s,u){for(var f=s.length;f--;)if(Gn(s[f][0],u))return f;return-1}function Ve(s){return s==null?s===void 0?"[object Undefined]":"[object Null]":Te&&Te in Object(s)?function(u){var f=re.call(u,Te),v=u[Te];try{u[Te]=void 0;var L=!0}catch{}var C=Pn.call(u);return L&&(f?u[Te]=v:delete u[Te]),C}(s):function(u){return Pn.call(u)}(s)}function Un(s){return Be(s)&&Ve(s)==o}function jn(s,u,f,v,L){return s===u||(s==null||u==null||!Be(s)&&!Be(u)?s!=s&&u!=u:function(C,P,R,te,k,U){var oe=pt(C),ue=pt(P),z=oe?i:ge(C),ce=ue?i:ge(P),Pe=(z=z==o?_:z)==_,ft=(ce=ce==o?_:ce)==_,Fe=z==ce;if(Fe&&$t(C)){if(!$t(P))return!1;oe=!0,Pe=!1}if(Fe&&!Pe)return U||(U=new he),oe||$n(C)?Vn(C,P,R,te,k,U):function(I,S,ht,ye,qt,Q,le){switch(ht){case w:if(I.byteLength!=S.byteLength||I.byteOffset!=S.byteOffset)return!1;I=I.buffer,S=S.buffer;case V:return!(I.byteLength!=S.byteLength||!Q(new wn(I),new wn(S)));case a:case l:case p:return Gn(+I,+S);case d:return I.name==S.name&&I.message==S.message;case b:case c:return I==S+"";case g:var ve=Dr;case F:var Je=1&ye;if(ve||(ve=kr),I.size!=S.size&&!Je)return!1;var gt=le.get(I);if(gt)return gt==S;ye|=2,le.set(I,S);var we=Vn(ve(I),ve(S),ye,qt,Q,le);return le.delete(I),we;case y:if(Yt)return Yt.call(I)==Yt.call(S)}return!1}(C,P,z,R,te,k,U);if(!(1&R)){var Ge=Pe&&re.call(C,"__wrapped__"),qn=ft&&re.call(P,"__wrapped__");if(Ge||qn){var no=Ge?C.value():C,ro=qn?P.value():P;return U||(U=new he),k(no,ro,R,te,U)}}return Fe?(U||(U=new he),function(I,S,ht,ye,qt,Q){var le=1&ht,ve=Bn(I),Je=ve.length,gt=Bn(S).length;if(Je!=gt&&!le)return!1;for(var we=Je;we--;){var Ie=ve[we];if(!(le?Ie in S:re.call(S,Ie)))return!1}var Hn=Q.get(I);if(Hn&&Q.get(S))return Hn==S;var yt=!0;Q.set(I,S),Q.set(S,I);for(var Ht=le;++we<Je;){var vt=I[Ie=ve[we]],mt=S[Ie];if(ye)var Xn=le?ye(mt,vt,Ie,S,I,Q):ye(vt,mt,Ie,I,S,Q);if(!(Xn===void 0?vt===mt||qt(vt,mt,ht,ye,Q):Xn)){yt=!1;break}Ht||(Ht=Ie=="constructor")}if(yt&&!Ht){var _t=I.constructor,bt=S.constructor;_t==bt||!("constructor"in I)||!("constructor"in S)||typeof _t=="function"&&_t instanceof _t&&typeof bt=="function"&&bt instanceof bt||(yt=!1)}return Q.delete(I),Q.delete(S),yt}(C,P,R,te,k,U)):!1}(s,u,f,v,jn,L))}function Zr(s){return!(!Yn(s)||function(u){return!!An&&An in u}(s))&&(Jn(s)?Vr:Ut).test(Se(s))}function Wr(s){if(f=(u=s)&&u.constructor,v=typeof f=="function"&&f.prototype||st,u!==v)return Jr(s);var u,f,v,L=[];for(var C in Object(s))re.call(s,C)&&C!="constructor"&&L.push(C);return L}function Vn(s,u,f,v,L,C){var P=1&f,R=s.length,te=u.length;if(R!=te&&!(P&&te>R))return!1;var k=C.get(s);if(k&&C.get(u))return k==u;var U=-1,oe=!0,ue=2&f?new ct:void 0;for(C.set(s,u),C.set(u,s);++U<R;){var z=s[U],ce=u[U];if(v)var Pe=P?v(ce,z,U,u,s,C):v(z,ce,U,s,u,C);if(Pe!==void 0){if(Pe)continue;oe=!1;break}if(ue){if(!Rr(u,function(ft,Fe){if(Ge=Fe,!ue.has(Ge)&&(z===ft||L(z,ft,f,v,C)))return ue.push(Fe);var Ge})){oe=!1;break}}else if(z!==ce&&!L(z,ce,f,v,C)){oe=!1;break}}return C.delete(s),C.delete(u),oe}function Bn(s){return function(u,f,v){var L=f(u);return pt(u)?L:function(C,P){for(var R=-1,te=P.length,k=C.length;++R<te;)C[k+R]=P[R];return C}(L,v(u))}(s,to,Kr)}function dt(s,u){var f,v,L=s.__data__;return((v=typeof(f=u))=="string"||v=="number"||v=="symbol"||v=="boolean"?f!=="__proto__":f===null)?L[typeof u=="string"?"string":"hash"]:L.map}function Ae(s,u){var f=function(v,L){return v==null?void 0:v[L]}(s,u);return Zr(f)?f:void 0}Ce.prototype.clear=function(){this.__data__=je?je(null):{},this.size=0},Ce.prototype.delete=function(s){var u=this.has(s)&&delete this.__data__[s];return this.size-=u?1:0,u},Ce.prototype.get=function(s){var u=this.__data__;if(je){var f=u[s];return f===n?void 0:f}return re.call(u,s)?u[s]:void 0},Ce.prototype.has=function(s){var u=this.__data__;return je?u[s]!==void 0:re.call(u,s)},Ce.prototype.set=function(s,u){var f=this.__data__;return this.size+=this.has(s)?0:1,f[s]=je&&u===void 0?n:u,this},se.prototype.clear=function(){this.__data__=[],this.size=0},se.prototype.delete=function(s){var u=this.__data__,f=lt(u,s);return!(f<0)&&(f==u.length-1?u.pop():Br.call(u,f,1),--this.size,!0)},se.prototype.get=function(s){var u=this.__data__,f=lt(u,s);return f<0?void 0:u[f][1]},se.prototype.has=function(s){return lt(this.__data__,s)>-1},se.prototype.set=function(s,u){var f=this.__data__,v=lt(f,s);return v<0?(++this.size,f.push([s,u])):f[v][1]=u,this},Oe.prototype.clear=function(){this.size=0,this.__data__={hash:new Ce,map:new(Ue||se),string:new Ce}},Oe.prototype.delete=function(s){var u=dt(this,s).delete(s);return this.size-=u?1:0,u},Oe.prototype.get=function(s){return dt(this,s).get(s)},Oe.prototype.has=function(s){return dt(this,s).has(s)},Oe.prototype.set=function(s,u){var f=dt(this,s),v=f.size;return f.set(s,u),this.size+=f.size==v?0:1,this},ct.prototype.add=ct.prototype.push=function(s){return this.__data__.set(s,n),this},ct.prototype.has=function(s){return this.__data__.has(s)},he.prototype.clear=function(){this.__data__=new se,this.size=0},he.prototype.delete=function(s){var u=this.__data__,f=u.delete(s);return this.size=u.size,f},he.prototype.get=function(s){return this.__data__.get(s)},he.prototype.has=function(s){return this.__data__.has(s)},he.prototype.set=function(s,u){var f=this.__data__;if(f instanceof se){var v=f.__data__;if(!Ue||v.length<199)return v.push([s,u]),this.size=++f.size,this;f=this.__data__=new Oe(v)}return f.set(s,u),this.size=f.size,this};var Kr=Dn?function(s){return s==null?[]:(s=Object(s),function(u,f){for(var v=-1,L=u==null?0:u.length,C=0,P=[];++v<L;){var R=u[v];f(R,v,u)&&(P[C++]=R)}return P}(Dn(s),function(u){return Rn.call(s,u)}))}:function(){return[]},ge=Ve;function Qr(s,u){return!!(u=u??r)&&(typeof s=="number"||Fr.test(s))&&s>-1&&s%1==0&&s<u}function Se(s){if(s!=null){try{return Nn.call(s)}catch{}try{return s+""}catch{}}return""}function Gn(s,u){return s===u||s!=s&&u!=u}(Bt&&ge(new Bt(new ArrayBuffer(1)))!=w||Ue&&ge(new Ue)!=g||Gt&&ge(Gt.resolve())!=A||Jt&&ge(new Jt)!=F||zt&&ge(new zt)!=O)&&(ge=function(s){var u=Ve(s),f=u==_?s.constructor:void 0,v=f?Se(f):"";if(v)switch(v){case zr:return w;case Yr:return g;case $r:return A;case qr:return F;case Hr:return O}return u});var eo=Un(function(){return arguments}())?Un:function(s){return Be(s)&&re.call(s,"callee")&&!Rn.call(s,"callee")},pt=Array.isArray,$t=Gr||function(){return!1};function Jn(s){if(!Yn(s))return!1;var u=Ve(s);return u==h||u=="[object GeneratorFunction]"||u=="[object AsyncFunction]"||u=="[object Proxy]"}function zn(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=r}function Yn(s){var u=typeof s;return s!=null&&(u=="object"||u=="function")}function Be(s){return s!=null&&typeof s=="object"}var $n=In?function(s){return function(u){return s(u)}}(In):function(s){return Be(s)&&zn(s.length)&&!!M[Ve(s)]};function to(s){return(u=s)!=null&&zn(u.length)&&!Jn(u)?Xr(s):Wr(s);var u}e.exports=function(s,u){return jn(s,u)}})(kt,kt.exports);var _n=de(kt.exports);function bn(e,t){return e.length===t.length&&JSON.stringify(e.map(function(n){return n}).sort())===JSON.stringify(t.map(function(n){return n}).sort())}var Nr={Polygon:W,LineString:ie,Point:me,MultiPolygon:$,MultiLineString:$,MultiPoint:$},Ar=Object.freeze({__proto__:null,CommonSelectors:dr,constrainFeatureMovement:Rt,createMidPoint:un,createSupplementaryPoints:Ke,createVertex:Le,doubleClickZoom:ee,euclideanDistance:It,featuresAt:xe,getFeatureAtAndSetCursors:Ye,isClick:xt,isEventAtCoordinates:it,isTap:Mt,mapEventToBoundingBox:en,ModeHandler:ze,moveFeatures:Dt,sortFeatures:Qt,stringSetsAreEqual:bn,StringSet:Z,theme:an,toDenseArray:De}),Pr=function(e,t){var n={options:e=function(o){o===void 0&&(o={});var i=pe(o);return o.controls||(i.controls={}),o.displayControlsDefault===!1?i.controls=pe(Lr,o.controls):i.controls=pe(Mr,o.controls),(i=pe(xr,i)).styles=mn(i.styles,"cold").concat(mn(i.styles,"hot")),i}(e)};t=function(o,i){return i.modes=T,i.getFeatureIdsAt=function(a){return xe.click({point:a},null,o).map(function(l){return l.properties.id})},i.getSelectedIds=function(){return o.store.getSelectedIds()},i.getSelected=function(){return{type:m.FEATURE_COLLECTION,features:o.store.getSelectedIds().map(function(a){return o.store.get(a)}).map(function(a){return a.toGeoJSON()})}},i.getSelectedPoints=function(){return{type:m.FEATURE_COLLECTION,features:o.store.getSelectedCoordinates().map(function(a){return{type:m.FEATURE,properties:{},geometry:{type:m.POINT,coordinates:a.coordinates}}})}},i.set=function(a){if(a.type===void 0||a.type!==m.FEATURE_COLLECTION||!Array.isArray(a.features))throw new Error("Invalid FeatureCollection");var l=o.store.createRenderBatch(),d=o.store.getAllIds().slice(),h=i.add(a),g=new Z(h);return(d=d.filter(function(p){return!g.has(p)})).length&&i.delete(d),l(),h},i.add=function(a){var l=JSON.parse(JSON.stringify(gr(a))).features.map(function(d){if(d.id=d.id||Nt(),d.geometry===null)throw new Error("Invalid geometry: null");if(o.store.get(d.id)===void 0||o.store.get(d.id).type!==d.geometry.type){var h=Nr[d.geometry.type];if(h===void 0)throw new Error("Invalid geometry type: "+d.geometry.type+".");var g=new h(o,d);o.store.add(g)}else{var p=o.store.get(d.id);p.properties=d.properties,_n(p.properties,d.properties)||o.store.featureChanged(p.id),_n(p.getCoordinates(),d.geometry.coordinates)||p.incomingCoords(d.geometry.coordinates)}return d.id});return o.store.render(),l},i.get=function(a){var l=o.store.get(a);if(l)return l.toGeoJSON()},i.getAll=function(){return{type:m.FEATURE_COLLECTION,features:o.store.getAll().map(function(a){return a.toGeoJSON()})}},i.delete=function(a){return o.store.delete(a,{silent:!0}),i.getMode()!==T.DIRECT_SELECT||o.store.getSelectedIds().length?o.store.render():o.events.changeMode(T.SIMPLE_SELECT,void 0,{silent:!0}),i},i.deleteAll=function(){return o.store.delete(o.store.getAllIds(),{silent:!0}),i.getMode()===T.DIRECT_SELECT?o.events.changeMode(T.SIMPLE_SELECT,void 0,{silent:!0}):o.store.render(),i},i.changeMode=function(a,l){return l===void 0&&(l={}),a===T.SIMPLE_SELECT&&i.getMode()===T.SIMPLE_SELECT?(bn(l.featureIds||[],o.store.getSelectedIds())||(o.store.setSelected(l.featureIds,{silent:!0}),o.store.render()),i):(a===T.DIRECT_SELECT&&i.getMode()===T.DIRECT_SELECT&&l.featureId===o.store.getSelectedIds()[0]||o.events.changeMode(a,l,{silent:!0}),i)},i.getMode=function(){return o.events.getMode()},i.trash=function(){return o.events.trash({silent:!0}),i},i.combineFeatures=function(){return o.events.combineFeatures({silent:!0}),i},i.uncombineFeatures=function(){return o.events.uncombineFeatures({silent:!0}),i},i.setFeatureProperty=function(a,l,d){return o.store.setFeatureProperty(a,l,d),i},i}(n,t),n.api=t;var r=lr(n);return t.onAdd=r.onAdd,t.onRemove=r.onRemove,t.types=Y,t.options=e,t};function at(e){Pr(e,this)}return at.modes=vn,at.constants=er,at.lib=Ar,at})})(Zn.__module);var oo=Zn.__module.exports;const io=Re.getDefaultExportFromCjs(oo);module.exports=io;
|
|
1
|
+
"use strict";const Re=require("./index.cjs60.js"),Zn=require("./index.cjs65.js");(function(Wn,ao){(function(ze,de){Wn.exports=de()})(Re.commonjsGlobal,function(){var ze=function(e,t){var n={drag:[],click:[],mousemove:[],mousedown:[],mouseup:[],mouseout:[],keydown:[],keyup:[],touchstart:[],touchmove:[],touchend:[],tap:[]},r={on:function(i,a,l){if(n[i]===void 0)throw new Error("Invalid event type: "+i);n[i].push({selector:a,fn:l})},render:function(i){t.store.featureChanged(i)}},o=function(i,a){for(var l=n[i],d=l.length;d--;){var h=l[d];if(h.selector(a)){h.fn.call(r,a)||t.store.render(),t.ui.updateMapClasses();break}}};return e.start.call(r),{render:e.render,stop:function(){e.stop&&e.stop()},trash:function(){e.trash&&(e.trash(),t.store.render())},combineFeatures:function(){e.combineFeatures&&e.combineFeatures()},uncombineFeatures:function(){e.uncombineFeatures&&e.uncombineFeatures()},drag:function(i){o("drag",i)},click:function(i){o("click",i)},mousemove:function(i){o("mousemove",i)},mousedown:function(i){o("mousedown",i)},mouseup:function(i){o("mouseup",i)},mouseout:function(i){o("mouseout",i)},keydown:function(i){o("keydown",i)},keyup:function(i){o("keyup",i)},touchstart:function(i){o("touchstart",i)},touchmove:function(i){o("touchmove",i)},touchend:function(i){o("touchend",i)},tap:function(i){o("tap",i)}}};function de(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Kn(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){if(this instanceof r){var o=[null];o.push.apply(o,arguments);var i=Function.bind.apply(t,o);return new i}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var Et={},Qn={RADIUS:6378137,FLATTENING:1/298.257223563,POLAR_RADIUS:63567523142e-4},Xt=Qn;function Zt(e){var t=0;if(e&&e.length>0){t+=Math.abs(Tt(e[0]));for(var n=1;n<e.length;n++)t-=Math.abs(Tt(e[n]))}return t}function Tt(e){var t,n,r,o,i,a,l=0,d=e.length;if(d>2){for(a=0;a<d;a++)a===d-2?(r=d-2,o=d-1,i=0):a===d-1?(r=d-1,o=0,i=1):(r=a,o=a+1,i=a+2),t=e[r],n=e[o],l+=(Ct(e[i][0])-Ct(t[0]))*Math.sin(Ct(n[1]));l=l*Xt.RADIUS*Xt.RADIUS/2}return l}function Ct(e){return e*Math.PI/180}Et.geometry=function e(t){var n,r=0;switch(t.type){case"Polygon":return Zt(t.coordinates);case"MultiPolygon":for(n=0;n<t.coordinates.length;n++)r+=Zt(t.coordinates[n]);return r;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(n=0;n<t.geometries.length;n++)r+=e(t.geometries[n]);return r}},Et.ring=Tt;var q={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"},X={HOT:"mapbox-gl-draw-hot",COLD:"mapbox-gl-draw-cold"},N={ADD:"add",MOVE:"move",DRAG:"drag",POINTER:"pointer",NONE:"none"},Y={POLYGON:"polygon",LINE:"line_string",POINT:"point"},m={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"},T={DRAW_LINE_STRING:"draw_line_string",DRAW_POLYGON:"draw_polygon",DRAW_POINT:"draw_point",SIMPLE_SELECT:"simple_select",DIRECT_SELECT:"direct_select",STATIC:"static"},H={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"},Ot={MOVE:"move",CHANGE_COORDINATES:"change_coordinates"},B={FEATURE:"feature",MIDPOINT:"midpoint",VERTEX:"vertex"},j={ACTIVE:"true",INACTIVE:"false"},Wt=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate"],St=-85,er=Object.freeze({__proto__:null,classes:q,sources:X,cursors:N,types:Y,geojsonTypes:m,modes:T,events:H,updateActions:Ot,meta:B,activeStates:j,interactions:Wt,LAT_MIN:-90,LAT_RENDERED_MIN:St,LAT_MAX:90,LAT_RENDERED_MAX:85,LNG_MIN:-270,LNG_MAX:270}),Kt={Point:0,LineString:1,MultiLineString:1,Polygon:2};function tr(e,t){var n=Kt[e.geometry.type]-Kt[t.geometry.type];return n===0&&e.geometry.type===m.POLYGON?e.area-t.area:n}function Qt(e){return e.map(function(t){return t.geometry.type===m.POLYGON&&(t.area=Et.geometry({type:m.FEATURE,property:{},geometry:t.geometry})),t}).sort(tr).map(function(t){return delete t.area,t})}function en(e,t){return t===void 0&&(t=0),[[e.point.x-t,e.point.y-t],[e.point.x+t,e.point.y+t]]}function Z(e){if(this._items={},this._nums={},this._length=e?e.length:0,e)for(var t=0,n=e.length;t<n;t++)this.add(e[t]),e[t]!==void 0&&(typeof e[t]=="string"?this._items[e[t]]=t:this._nums[e[t]]=t)}Z.prototype.add=function(e){return this.has(e)||(this._length++,typeof e=="string"?this._items[e]=this._length:this._nums[e]=this._length),this},Z.prototype.delete=function(e){return this.has(e)===!1||(this._length--,delete this._items[e],delete this._nums[e]),this},Z.prototype.has=function(e){return(typeof e=="string"||typeof e=="number")&&(this._items[e]!==void 0||this._nums[e]!==void 0)},Z.prototype.values=function(){var e=this,t=[];return Object.keys(this._items).forEach(function(n){t.push({k:n,v:e._items[n]})}),Object.keys(this._nums).forEach(function(n){t.push({k:JSON.parse(n),v:e._nums[n]})}),t.sort(function(n,r){return n.v-r.v}).map(function(n){return n.k})},Z.prototype.clear=function(){return this._length=0,this._items={},this._nums={},this};var nr=[B.FEATURE,B.MIDPOINT,B.VERTEX],xe={click:function(e,t,n){return tn(e,t,n,n.options.clickBuffer)},touch:function(e,t,n){return tn(e,t,n,n.options.touchBuffer)}};function tn(e,t,n,r){if(n.map===null)return[];var o=e?en(e,r):t,i={};n.options.styles&&(i.layers=n.options.styles.map(function(h){return h.id}).filter(function(h){return n.map.getLayer(h)!=null}));var a=n.map.queryRenderedFeatures(o,i).filter(function(h){return nr.indexOf(h.properties.meta)!==-1}),l=new Z,d=[];return a.forEach(function(h){var g=h.properties.id;l.has(g)||(l.add(g),d.push(h))}),Qt(d)}function Ye(e,t){var n=xe.click(e,null,t),r={mouse:N.NONE};return n[0]&&(r.mouse=n[0].properties.active===j.ACTIVE?N.MOVE:N.POINTER,r.feature=n[0].properties.meta),t.events.currentModeName().indexOf("draw")!==-1&&(r.mouse=N.ADD),t.ui.queueMapClasses(r),t.ui.updateMapClasses(),n[0]}function It(e,t){var n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)}function xt(e,t,n){n===void 0&&(n={});var r=n.fineTolerance!=null?n.fineTolerance:4,o=n.grossTolerance!=null?n.grossTolerance:12,i=n.interval!=null?n.interval:500;e.point=e.point||t.point,e.time=e.time||t.time;var a=It(e.point,t.point);return a<r||a<o&&t.time-e.time<i}function Mt(e,t,n){n===void 0&&(n={});var r=n.tolerance!=null?n.tolerance:25,o=n.interval!=null?n.interval:250;return e.point=e.point||t.point,e.time=e.time||t.time,It(e.point,t.point)<r&&t.time-e.time<o}var nn={exports:{}},Lt=nn.exports=function(e,t){if(t||(t=16),e===void 0&&(e=128),e<=0)return"0";for(var n=Math.log(Math.pow(2,e))/Math.log(t),r=2;n===1/0;r*=2)n=Math.log(Math.pow(2,e/r))/Math.log(t)*r;var o=n-Math.floor(n),i="";for(r=0;r<Math.floor(n);r++)i=Math.floor(Math.random()*t).toString(t)+i;if(o){var a=Math.pow(t,o);i=Math.floor(Math.random()*a).toString(t)+i}var l=parseInt(i,t);return l!==1/0&&l>=Math.pow(2,e)?Lt(e,t):i};Lt.rack=function(e,t,n){var r=function(i){var a=0;do{if(a++>10){if(!n)throw new Error("too many ID collisions, use more bits");e+=n}var l=Lt(e,t)}while(Object.hasOwnProperty.call(o,l));return o[l]=i,l},o=r.hats={};return r.get=function(i){return r.hats[i]},r.set=function(i,a){return r.hats[i]=a,r},r.bits=e||128,r.base=t||16,r};var Nt=de(nn.exports),G=function(e,t){this.ctx=e,this.properties=t.properties||{},this.coordinates=t.geometry.coordinates,this.id=t.id||Nt(),this.type=t.geometry.type};G.prototype.changed=function(){this.ctx.store.featureChanged(this.id)},G.prototype.incomingCoords=function(e){this.setCoordinates(e)},G.prototype.setCoordinates=function(e){this.coordinates=e,this.changed()},G.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.coordinates))},G.prototype.setProperty=function(e,t){this.properties[e]=t},G.prototype.toGeoJSON=function(){return JSON.parse(JSON.stringify({id:this.id,type:m.FEATURE,properties:this.properties,geometry:{coordinates:this.getCoordinates(),type:this.type}}))},G.prototype.internal=function(e){var t={id:this.id,meta:B.FEATURE,"meta:type":this.type,active:j.INACTIVE,mode:e};if(this.ctx.options.userProperties)for(var n in this.properties)t["user_"+n]=this.properties[n];return{type:m.FEATURE,properties:t,geometry:{coordinates:this.getCoordinates(),type:this.type}}};var me=function(e,t){G.call(this,e,t)};(me.prototype=Object.create(G.prototype)).isValid=function(){return typeof this.coordinates[0]=="number"&&typeof this.coordinates[1]=="number"},me.prototype.updateCoordinate=function(e,t,n){this.coordinates=arguments.length===3?[t,n]:[e,t],this.changed()},me.prototype.getCoordinate=function(){return this.getCoordinates()};var ie=function(e,t){G.call(this,e,t)};(ie.prototype=Object.create(G.prototype)).isValid=function(){return this.coordinates.length>1},ie.prototype.addCoordinate=function(e,t,n){this.changed();var r=parseInt(e,10);this.coordinates.splice(r,0,[t,n])},ie.prototype.getCoordinate=function(e){var t=parseInt(e,10);return JSON.parse(JSON.stringify(this.coordinates[t]))},ie.prototype.removeCoordinate=function(e){this.changed(),this.coordinates.splice(parseInt(e,10),1)},ie.prototype.updateCoordinate=function(e,t,n){var r=parseInt(e,10);this.coordinates[r]=[t,n],this.changed()};var W=function(e,t){G.call(this,e,t),this.coordinates=this.coordinates.map(function(n){return n.slice(0,-1)})};(W.prototype=Object.create(G.prototype)).isValid=function(){return this.coordinates.length!==0&&this.coordinates.every(function(e){return e.length>2})},W.prototype.incomingCoords=function(e){this.coordinates=e.map(function(t){return t.slice(0,-1)}),this.changed()},W.prototype.setCoordinates=function(e){this.coordinates=e,this.changed()},W.prototype.addCoordinate=function(e,t,n){this.changed();var r=e.split(".").map(function(o){return parseInt(o,10)});this.coordinates[r[0]].splice(r[1],0,[t,n])},W.prototype.removeCoordinate=function(e){this.changed();var t=e.split(".").map(function(r){return parseInt(r,10)}),n=this.coordinates[t[0]];n&&(n.splice(t[1],1),n.length<3&&this.coordinates.splice(t[0],1))},W.prototype.getCoordinate=function(e){var t=e.split(".").map(function(r){return parseInt(r,10)}),n=this.coordinates[t[0]];return JSON.parse(JSON.stringify(n[t[1]]))},W.prototype.getCoordinates=function(){return this.coordinates.map(function(e){return e.concat([e[0]])})},W.prototype.updateCoordinate=function(e,t,n){this.changed();var r=e.split("."),o=parseInt(r[0],10),i=parseInt(r[1],10);this.coordinates[o]===void 0&&(this.coordinates[o]=[]),this.coordinates[o][i]=[t,n]};var rr={MultiPoint:me,MultiLineString:ie,MultiPolygon:W},$e=function(e,t,n,r,o){var i=n.split("."),a=parseInt(i[0],10),l=i[1]?i.slice(1).join("."):null;return e[a][t](l,r,o)},$=function(e,t){if(G.call(this,e,t),delete this.coordinates,this.model=rr[t.geometry.type],this.model===void 0)throw new TypeError(t.geometry.type+" is not a valid type");this.features=this._coordinatesToFeatures(t.geometry.coordinates)};function E(e){this.map=e.map,this.drawConfig=JSON.parse(JSON.stringify(e.options||{})),this._ctx=e}($.prototype=Object.create(G.prototype))._coordinatesToFeatures=function(e){var t=this,n=this.model.bind(this);return e.map(function(r){return new n(t.ctx,{id:Nt(),type:m.FEATURE,properties:{},geometry:{coordinates:r,type:t.type.replace("Multi","")}})})},$.prototype.isValid=function(){return this.features.every(function(e){return e.isValid()})},$.prototype.setCoordinates=function(e){this.features=this._coordinatesToFeatures(e),this.changed()},$.prototype.getCoordinate=function(e){return $e(this.features,"getCoordinate",e)},$.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.features.map(function(e){return e.type===m.POLYGON?e.getCoordinates():e.coordinates})))},$.prototype.updateCoordinate=function(e,t,n){$e(this.features,"updateCoordinate",e,t,n),this.changed()},$.prototype.addCoordinate=function(e,t,n){$e(this.features,"addCoordinate",e,t,n),this.changed()},$.prototype.removeCoordinate=function(e){$e(this.features,"removeCoordinate",e),this.changed()},$.prototype.getFeatures=function(){return this.features},E.prototype.setSelected=function(e){return this._ctx.store.setSelected(e)},E.prototype.setSelectedCoordinates=function(e){var t=this;this._ctx.store.setSelectedCoordinates(e),e.reduce(function(n,r){return n[r.feature_id]===void 0&&(n[r.feature_id]=!0,t._ctx.store.get(r.feature_id).changed()),n},{})},E.prototype.getSelected=function(){return this._ctx.store.getSelected()},E.prototype.getSelectedIds=function(){return this._ctx.store.getSelectedIds()},E.prototype.isSelected=function(e){return this._ctx.store.isSelected(e)},E.prototype.getFeature=function(e){return this._ctx.store.get(e)},E.prototype.select=function(e){return this._ctx.store.select(e)},E.prototype.deselect=function(e){return this._ctx.store.deselect(e)},E.prototype.deleteFeature=function(e,t){return t===void 0&&(t={}),this._ctx.store.delete(e,t)},E.prototype.addFeature=function(e){return this._ctx.store.add(e)},E.prototype.clearSelectedFeatures=function(){return this._ctx.store.clearSelected()},E.prototype.clearSelectedCoordinates=function(){return this._ctx.store.clearSelectedCoordinates()},E.prototype.setActionableState=function(e){e===void 0&&(e={});var t={trash:e.trash||!1,combineFeatures:e.combineFeatures||!1,uncombineFeatures:e.uncombineFeatures||!1};return this._ctx.events.actionable(t)},E.prototype.changeMode=function(e,t,n){return t===void 0&&(t={}),n===void 0&&(n={}),this._ctx.events.changeMode(e,t,n)},E.prototype.updateUIClasses=function(e){return this._ctx.ui.queueMapClasses(e)},E.prototype.activateUIButton=function(e){return this._ctx.ui.setActiveButton(e)},E.prototype.featuresAt=function(e,t,n){if(n===void 0&&(n="click"),n!=="click"&&n!=="touch")throw new Error("invalid buffer type");return xe[n](e,t,this._ctx)},E.prototype.newFeature=function(e){var t=e.geometry.type;return t===m.POINT?new me(this._ctx,e):t===m.LINE_STRING?new ie(this._ctx,e):t===m.POLYGON?new W(this._ctx,e):new $(this._ctx,e)},E.prototype.isInstanceOf=function(e,t){if(e===m.POINT)return t instanceof me;if(e===m.LINE_STRING)return t instanceof ie;if(e===m.POLYGON)return t instanceof W;if(e==="MultiFeature")return t instanceof $;throw new Error("Unknown feature class: "+e)},E.prototype.doRender=function(e){return this._ctx.store.featureChanged(e)},E.prototype.onSetup=function(){},E.prototype.onDrag=function(){},E.prototype.onClick=function(){},E.prototype.onMouseMove=function(){},E.prototype.onMouseDown=function(){},E.prototype.onMouseUp=function(){},E.prototype.onMouseOut=function(){},E.prototype.onKeyUp=function(){},E.prototype.onKeyDown=function(){},E.prototype.onTouchStart=function(){},E.prototype.onTouchMove=function(){},E.prototype.onTouchEnd=function(){},E.prototype.onTap=function(){},E.prototype.onStop=function(){},E.prototype.onTrash=function(){},E.prototype.onCombineFeature=function(){},E.prototype.onUncombineFeature=function(){},E.prototype.toDisplayFeatures=function(){throw new Error("You must overwrite toDisplayFeatures")};var rn={drag:"onDrag",click:"onClick",mousemove:"onMouseMove",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseout:"onMouseOut",keyup:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",tap:"onTap"},or=Object.keys(rn);function ir(e){var t=Object.keys(e);return function(n,r){r===void 0&&(r={});var o={},i=t.reduce(function(a,l){return a[l]=e[l],a},new E(n));return{start:function(){var a=this;o=i.onSetup(r),or.forEach(function(l){var d,h=rn[l],g=function(){return!1};e[h]&&(g=function(){return!0}),a.on(l,g,(d=h,function(p){return i[d](o,p)}))})},stop:function(){i.onStop(o)},trash:function(){i.onTrash(o)},combineFeatures:function(){i.onCombineFeatures(o)},uncombineFeatures:function(){i.onUncombineFeatures(o)},render:function(a,l){i.toDisplayFeatures(o,a,l)}}}}function De(e){return[].concat(e).filter(function(t){return t!==void 0})}function ar(){var e=this;if(!(e.ctx.map&&e.ctx.map.getSource(X.HOT)!==void 0))return d();var t=e.ctx.events.currentModeName();e.ctx.ui.queueMapClasses({mode:t});var n=[],r=[];e.isDirty?r=e.getAllIds():(n=e.getChangedIds().filter(function(h){return e.get(h)!==void 0}),r=e.sources.hot.filter(function(h){return h.properties.id&&n.indexOf(h.properties.id)===-1&&e.get(h.properties.id)!==void 0}).map(function(h){return h.properties.id})),e.sources.hot=[];var o=e.sources.cold.length;e.sources.cold=e.isDirty?[]:e.sources.cold.filter(function(h){var g=h.properties.id||h.properties.parent;return n.indexOf(g)===-1});var i=o!==e.sources.cold.length||r.length>0;function a(h,g){var p=e.get(h).internal(t);e.ctx.events.currentModeRender(p,function(_){e.sources[g].push(_)})}if(n.forEach(function(h){return a(h,"hot")}),r.forEach(function(h){return a(h,"cold")}),i&&e.ctx.map.getSource(X.COLD).setData({type:m.FEATURE_COLLECTION,features:e.sources.cold}),e.ctx.map.getSource(X.HOT).setData({type:m.FEATURE_COLLECTION,features:e.sources.hot}),e._emitSelectionChange&&(e.ctx.map.fire(H.SELECTION_CHANGE,{features:e.getSelected().map(function(h){return h.toGeoJSON()}),points:e.getSelectedCoordinates().map(function(h){return{type:m.FEATURE,properties:{},geometry:{type:m.POINT,coordinates:h.coordinates}}})}),e._emitSelectionChange=!1),e._deletedFeaturesToEmit.length){var l=e._deletedFeaturesToEmit.map(function(h){return h.toGeoJSON()});e._deletedFeaturesToEmit=[],e.ctx.map.fire(H.DELETE,{features:l})}function d(){e.isDirty=!1,e.clearChangedIds()}d(),e.ctx.map.fire(H.RENDER,{})}function x(e){var t,n=this;this._features={},this._featureIds=new Z,this._selectedFeatureIds=new Z,this._selectedCoordinates=[],this._changedFeatureIds=new Z,this._deletedFeaturesToEmit=[],this._emitSelectionChange=!1,this._mapInitialConfig={},this.ctx=e,this.sources={hot:[],cold:[]},this.render=function(){t||(t=requestAnimationFrame(function(){t=null,ar.call(n)}))},this.isDirty=!1}function on(e,t){var n=e._selectedCoordinates.filter(function(r){return e._selectedFeatureIds.has(r.feature_id)});e._selectedCoordinates.length===n.length||t.silent||(e._emitSelectionChange=!0),e._selectedCoordinates=n}x.prototype.createRenderBatch=function(){var e=this,t=this.render,n=0;return this.render=function(){n++},function(){e.render=t,n>0&&e.render()}},x.prototype.setDirty=function(){return this.isDirty=!0,this},x.prototype.featureChanged=function(e){return this._changedFeatureIds.add(e),this},x.prototype.getChangedIds=function(){return this._changedFeatureIds.values()},x.prototype.clearChangedIds=function(){return this._changedFeatureIds.clear(),this},x.prototype.getAllIds=function(){return this._featureIds.values()},x.prototype.add=function(e){return this.featureChanged(e.id),this._features[e.id]=e,this._featureIds.add(e.id),this},x.prototype.delete=function(e,t){var n=this;return t===void 0&&(t={}),De(e).forEach(function(r){n._featureIds.has(r)&&(n._featureIds.delete(r),n._selectedFeatureIds.delete(r),t.silent||n._deletedFeaturesToEmit.indexOf(n._features[r])===-1&&n._deletedFeaturesToEmit.push(n._features[r]),delete n._features[r],n.isDirty=!0)}),on(this,t),this},x.prototype.get=function(e){return this._features[e]},x.prototype.getAll=function(){var e=this;return Object.keys(this._features).map(function(t){return e._features[t]})},x.prototype.select=function(e,t){var n=this;return t===void 0&&(t={}),De(e).forEach(function(r){n._selectedFeatureIds.has(r)||(n._selectedFeatureIds.add(r),n._changedFeatureIds.add(r),t.silent||(n._emitSelectionChange=!0))}),this},x.prototype.deselect=function(e,t){var n=this;return t===void 0&&(t={}),De(e).forEach(function(r){n._selectedFeatureIds.has(r)&&(n._selectedFeatureIds.delete(r),n._changedFeatureIds.add(r),t.silent||(n._emitSelectionChange=!0))}),on(this,t),this},x.prototype.clearSelected=function(e){return e===void 0&&(e={}),this.deselect(this._selectedFeatureIds.values(),{silent:e.silent}),this},x.prototype.setSelected=function(e,t){var n=this;return t===void 0&&(t={}),e=De(e),this.deselect(this._selectedFeatureIds.values().filter(function(r){return e.indexOf(r)===-1}),{silent:t.silent}),this.select(e.filter(function(r){return!n._selectedFeatureIds.has(r)}),{silent:t.silent}),this},x.prototype.setSelectedCoordinates=function(e){return this._selectedCoordinates=e,this._emitSelectionChange=!0,this},x.prototype.clearSelectedCoordinates=function(){return this._selectedCoordinates=[],this._emitSelectionChange=!0,this},x.prototype.getSelectedIds=function(){return this._selectedFeatureIds.values()},x.prototype.getSelected=function(){var e=this;return this._selectedFeatureIds.values().map(function(t){return e.get(t)})},x.prototype.getSelectedCoordinates=function(){var e=this;return this._selectedCoordinates.map(function(t){return{coordinates:e.get(t.feature_id).getCoordinate(t.coord_path)}})},x.prototype.isSelected=function(e){return this._selectedFeatureIds.has(e)},x.prototype.setFeatureProperty=function(e,t,n){this.get(e).setProperty(t,n),this.featureChanged(e)},x.prototype.storeMapConfig=function(){var e=this;Wt.forEach(function(t){e.ctx.map[t]&&(e._mapInitialConfig[t]=e.ctx.map[t].isEnabled())})},x.prototype.restoreMapConfig=function(){var e=this;Object.keys(this._mapInitialConfig).forEach(function(t){e._mapInitialConfig[t]?e.ctx.map[t].enable():e.ctx.map[t].disable()})},x.prototype.getInitialConfigValue=function(e){return this._mapInitialConfig[e]===void 0||this._mapInitialConfig[e]};var sr=function(){for(var e=arguments,t={},n=0;n<arguments.length;n++){var r=e[n];for(var o in r)ur.call(r,o)&&(t[o]=r[o])}return t},ur=Object.prototype.hasOwnProperty,pe=de(sr),cr=["mode","feature","mouse"];function lr(e){var t=null,n=null,r={onRemove:function(){return e.map.off("load",r.connect),clearInterval(n),r.removeLayers(),e.store.restoreMapConfig(),e.ui.removeButtons(),e.events.removeEventListeners(),e.ui.clearMapClasses(),e.boxZoomInitial&&e.map.boxZoom.enable(),e.map=null,e.container=null,e.store=null,t&&t.parentNode&&t.parentNode.removeChild(t),t=null,this},connect:function(){e.map.off("load",r.connect),clearInterval(n),r.addLayers(),e.store.storeMapConfig(),e.events.addEventListeners()},onAdd:function(o){var i=o.fire;return o.fire=function(a,l){var d=arguments;return i.length===1&&arguments.length!==1&&(d=[pe({},{type:a},l)]),i.apply(o,d)},e.map=o,e.events=function(a){var l=Object.keys(a.options.modes).reduce(function(c,y){return c[y]=ir(a.options.modes[y]),c},{}),d={},h={},g={},p=null,_=null;g.drag=function(c,y){y({point:c.point,time:new Date().getTime()})?(a.ui.queueMapClasses({mouse:N.DRAG}),_.drag(c)):c.originalEvent.stopPropagation()},g.mousedrag=function(c){g.drag(c,function(y){return!xt(d,y)})},g.touchdrag=function(c){g.drag(c,function(y){return!Mt(h,y)})},g.mousemove=function(c){if((c.originalEvent.buttons!==void 0?c.originalEvent.buttons:c.originalEvent.which)===1)return g.mousedrag(c);var y=Ye(c,a);c.featureTarget=y,_.mousemove(c)},g.mousedown=function(c){d={time:new Date().getTime(),point:c.point};var y=Ye(c,a);c.featureTarget=y,_.mousedown(c)},g.mouseup=function(c){var y=Ye(c,a);c.featureTarget=y,xt(d,{point:c.point,time:new Date().getTime()})?_.click(c):_.mouseup(c)},g.mouseout=function(c){_.mouseout(c)},g.touchstart=function(c){if(a.options.touchEnabled){h={time:new Date().getTime(),point:c.point};var y=xe.touch(c,null,a)[0];c.featureTarget=y,_.touchstart(c)}},g.touchmove=function(c){if(a.options.touchEnabled)return _.touchmove(c),g.touchdrag(c)},g.touchend=function(c){if(c.originalEvent.preventDefault(),a.options.touchEnabled){var y=xe.touch(c,null,a)[0];c.featureTarget=y,Mt(h,{time:new Date().getTime(),point:c.point})?_.tap(c):_.touchend(c)}};var A=function(c){return!(c===8||c===46||c>=48&&c<=57)};function b(c,y,O){O===void 0&&(O={}),_.stop();var V=l[c];if(V===void 0)throw new Error(c+" is not valid");p=c;var w=V(a,y);_=ze(w,a),O.silent||a.map.fire(H.MODE_CHANGE,{mode:c}),a.store.setDirty(),a.store.render()}g.keydown=function(c){(c.srcElement||c.target).classList.contains("mapboxgl-canvas")&&(c.keyCode!==8&&c.keyCode!==46||!a.options.controls.trash?A(c.keyCode)?_.keydown(c):c.keyCode===49&&a.options.controls.point?b(T.DRAW_POINT):c.keyCode===50&&a.options.controls.line_string?b(T.DRAW_LINE_STRING):c.keyCode===51&&a.options.controls.polygon&&b(T.DRAW_POLYGON):(c.preventDefault(),_.trash()))},g.keyup=function(c){A(c.keyCode)&&_.keyup(c)},g.zoomend=function(){a.store.changeZoom()},g.data=function(c){if(c.dataType==="style"){var y=a.setup,O=a.map,V=a.options,w=a.store;V.styles.some(function(Ut){return O.getLayer(Ut.id)})||(y.addLayers(),w.setDirty(),w.render())}};var F={trash:!1,combineFeatures:!1,uncombineFeatures:!1};return{start:function(){p=a.options.defaultMode,_=ze(l[p](a),a)},changeMode:b,actionable:function(c){var y=!1;Object.keys(c).forEach(function(O){if(F[O]===void 0)throw new Error("Invalid action type");F[O]!==c[O]&&(y=!0),F[O]=c[O]}),y&&a.map.fire(H.ACTIONABLE,{actions:F})},currentModeName:function(){return p},currentModeRender:function(c,y){return _.render(c,y)},fire:function(c,y){g[c]&&g[c](y)},addEventListeners:function(){a.map.on("mousemove",g.mousemove),a.map.on("mousedown",g.mousedown),a.map.on("mouseup",g.mouseup),a.map.on("data",g.data),a.map.on("touchmove",g.touchmove),a.map.on("touchstart",g.touchstart),a.map.on("touchend",g.touchend),a.container.addEventListener("mouseout",g.mouseout),a.options.keybindings&&(a.container.addEventListener("keydown",g.keydown),a.container.addEventListener("keyup",g.keyup))},removeEventListeners:function(){a.map.off("mousemove",g.mousemove),a.map.off("mousedown",g.mousedown),a.map.off("mouseup",g.mouseup),a.map.off("data",g.data),a.map.off("touchmove",g.touchmove),a.map.off("touchstart",g.touchstart),a.map.off("touchend",g.touchend),a.container.removeEventListener("mouseout",g.mouseout),a.options.keybindings&&(a.container.removeEventListener("keydown",g.keydown),a.container.removeEventListener("keyup",g.keyup))},trash:function(c){_.trash(c)},combineFeatures:function(){_.combineFeatures()},uncombineFeatures:function(){_.uncombineFeatures()},getMode:function(){return p}}}(e),e.ui=function(a){var l={},d=null,h={mode:null,feature:null,mouse:null},g={mode:null,feature:null,mouse:null};function p(c){g=pe(g,c)}function _(){var c,y;if(a.container){var O=[],V=[];cr.forEach(function(w){g[w]!==h[w]&&(O.push(w+"-"+h[w]),g[w]!==null&&V.push(w+"-"+g[w]))}),O.length>0&&(c=a.container.classList).remove.apply(c,O),V.length>0&&(y=a.container.classList).add.apply(y,V),h=pe(h,g)}}function A(c,y){y===void 0&&(y={});var O=document.createElement("button");return O.className=q.CONTROL_BUTTON+" "+y.className,O.setAttribute("title",y.title),y.container.appendChild(O),O.addEventListener("click",function(V){if(V.preventDefault(),V.stopPropagation(),V.target===d)return b(),void y.onDeactivate();F(c),y.onActivate()},!0),O}function b(){d&&(d.classList.remove(q.ACTIVE_BUTTON),d=null)}function F(c){b();var y=l[c];y&&y&&c!=="trash"&&(y.classList.add(q.ACTIVE_BUTTON),d=y)}return{setActiveButton:F,queueMapClasses:p,updateMapClasses:_,clearMapClasses:function(){p({mode:null,feature:null,mouse:null}),_()},addButtons:function(){var c=a.options.controls,y=document.createElement("div");return y.className=q.CONTROL_GROUP+" "+q.CONTROL_BASE,c&&(c[Y.LINE]&&(l[Y.LINE]=A(Y.LINE,{container:y,className:q.CONTROL_BUTTON_LINE,title:"LineString tool "+(a.options.keybindings?"(l)":""),onActivate:function(){return a.events.changeMode(T.DRAW_LINE_STRING)},onDeactivate:function(){return a.events.trash()}})),c[Y.POLYGON]&&(l[Y.POLYGON]=A(Y.POLYGON,{container:y,className:q.CONTROL_BUTTON_POLYGON,title:"Polygon tool "+(a.options.keybindings?"(p)":""),onActivate:function(){return a.events.changeMode(T.DRAW_POLYGON)},onDeactivate:function(){return a.events.trash()}})),c[Y.POINT]&&(l[Y.POINT]=A(Y.POINT,{container:y,className:q.CONTROL_BUTTON_POINT,title:"Marker tool "+(a.options.keybindings?"(m)":""),onActivate:function(){return a.events.changeMode(T.DRAW_POINT)},onDeactivate:function(){return a.events.trash()}})),c.trash&&(l.trash=A("trash",{container:y,className:q.CONTROL_BUTTON_TRASH,title:"Delete",onActivate:function(){a.events.trash()}})),c.combine_features&&(l.combine_features=A("combineFeatures",{container:y,className:q.CONTROL_BUTTON_COMBINE_FEATURES,title:"Combine",onActivate:function(){a.events.combineFeatures()}})),c.uncombine_features&&(l.uncombine_features=A("uncombineFeatures",{container:y,className:q.CONTROL_BUTTON_UNCOMBINE_FEATURES,title:"Uncombine",onActivate:function(){a.events.uncombineFeatures()}}))),y},removeButtons:function(){Object.keys(l).forEach(function(c){var y=l[c];y.parentNode&&y.parentNode.removeChild(y),delete l[c]})}}}(e),e.container=o.getContainer(),e.store=new x(e),t=e.ui.addButtons(),e.options.boxSelect&&(e.boxZoomInitial=o.boxZoom.isEnabled(),o.boxZoom.disable(),o.dragPan.disable(),o.dragPan.enable()),o.loaded()?r.connect():(o.on("load",r.connect),n=setInterval(function(){o.loaded()&&r.connect()},16)),e.events.start(),t},addLayers:function(){e.map.addSource(X.COLD,{data:{type:m.FEATURE_COLLECTION,features:[]},type:"geojson"}),e.map.addSource(X.HOT,{data:{type:m.FEATURE_COLLECTION,features:[]},type:"geojson"}),e.options.styles.forEach(function(o){e.map.addLayer(o)}),e.store.setDirty(!0),e.store.render()},removeLayers:function(){e.options.styles.forEach(function(o){e.map.getLayer(o.id)&&e.map.removeLayer(o.id)}),e.map.getSource(X.COLD)&&e.map.removeSource(X.COLD),e.map.getSource(X.HOT)&&e.map.removeSource(X.HOT)}};return e.setup=r,r}var an=[{id:"gl-draw-polygon-fill-inactive",type:"fill",filter:["all",["==","active","false"],["==","$type","Polygon"],["!=","mode","static"]],paint:{"fill-color":"#3bb2d0","fill-outline-color":"#3bb2d0","fill-opacity":.1}},{id:"gl-draw-polygon-fill-active",type:"fill",filter:["all",["==","active","true"],["==","$type","Polygon"]],paint:{"fill-color":"#fbb03b","fill-outline-color":"#fbb03b","fill-opacity":.1}},{id:"gl-draw-polygon-midpoint",type:"circle",filter:["all",["==","$type","Point"],["==","meta","midpoint"]],paint:{"circle-radius":3,"circle-color":"#fbb03b"}},{id:"gl-draw-polygon-stroke-inactive",type:"line",filter:["all",["==","active","false"],["==","$type","Polygon"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#3bb2d0","line-width":2}},{id:"gl-draw-polygon-stroke-active",type:"line",filter:["all",["==","active","true"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fbb03b","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-line-inactive",type:"line",filter:["all",["==","active","false"],["==","$type","LineString"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#3bb2d0","line-width":2}},{id:"gl-draw-line-active",type:"line",filter:["all",["==","$type","LineString"],["==","active","true"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fbb03b","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-polygon-and-line-vertex-stroke-inactive",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":5,"circle-color":"#fff"}},{id:"gl-draw-polygon-and-line-vertex-inactive",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":3,"circle-color":"#fbb03b"}},{id:"gl-draw-point-point-stroke-inactive",type:"circle",filter:["all",["==","active","false"],["==","$type","Point"],["==","meta","feature"],["!=","mode","static"]],paint:{"circle-radius":5,"circle-opacity":1,"circle-color":"#fff"}},{id:"gl-draw-point-inactive",type:"circle",filter:["all",["==","active","false"],["==","$type","Point"],["==","meta","feature"],["!=","mode","static"]],paint:{"circle-radius":3,"circle-color":"#3bb2d0"}},{id:"gl-draw-point-stroke-active",type:"circle",filter:["all",["==","$type","Point"],["==","active","true"],["!=","meta","midpoint"]],paint:{"circle-radius":7,"circle-color":"#fff"}},{id:"gl-draw-point-active",type:"circle",filter:["all",["==","$type","Point"],["!=","meta","midpoint"],["==","active","true"]],paint:{"circle-radius":5,"circle-color":"#fbb03b"}},{id:"gl-draw-polygon-fill-static",type:"fill",filter:["all",["==","mode","static"],["==","$type","Polygon"]],paint:{"fill-color":"#404040","fill-outline-color":"#404040","fill-opacity":.1}},{id:"gl-draw-polygon-stroke-static",type:"line",filter:["all",["==","mode","static"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#404040","line-width":2}},{id:"gl-draw-line-static",type:"line",filter:["all",["==","mode","static"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#404040","line-width":2}},{id:"gl-draw-point-static",type:"circle",filter:["all",["==","mode","static"],["==","$type","Point"]],paint:{"circle-radius":5,"circle-color":"#404040"}}];function qe(e){return function(t){var n=t.featureTarget;return!!n&&!!n.properties&&n.properties.meta===e}}function sn(e){return!!e.originalEvent&&!!e.originalEvent.shiftKey&&e.originalEvent.button===0}function _e(e){return!!e.featureTarget&&!!e.featureTarget.properties&&e.featureTarget.properties.active===j.ACTIVE&&e.featureTarget.properties.meta===B.FEATURE}function At(e){return!!e.featureTarget&&!!e.featureTarget.properties&&e.featureTarget.properties.active===j.INACTIVE&&e.featureTarget.properties.meta===B.FEATURE}function He(e){return e.featureTarget===void 0}function Pt(e){return!!e.featureTarget&&!!e.featureTarget.properties&&e.featureTarget.properties.meta===B.FEATURE}function ke(e){var t=e.featureTarget;return!!t&&!!t.properties&&t.properties.meta===B.VERTEX}function Xe(e){return!!e.originalEvent&&e.originalEvent.shiftKey===!0}function Ze(e){return e.keyCode===27}function We(e){return e.keyCode===13}var dr=Object.freeze({__proto__:null,isOfMetaType:qe,isShiftMousedown:sn,isActiveFeature:_e,isInactiveFeature:At,noTarget:He,isFeature:Pt,isVertex:ke,isShiftDown:Xe,isEscapeKey:Ze,isEnterKey:We,isTrue:function(){return!0}}),pr=Me;function Me(e,t){this.x=e,this.y=t}Me.prototype={clone:function(){return new Me(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,n=e.y-this.y;return t*t+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y,n=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=n,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),n=Math.sin(e),r=t*this.x-n*this.y,o=n*this.x+t*this.y;return this.x=r,this.y=o,this},_rotateAround:function(e,t){var n=Math.cos(e),r=Math.sin(e),o=t.x+n*(this.x-t.x)-r*(this.y-t.y),i=t.y+r*(this.x-t.x)+n*(this.y-t.y);return this.x=o,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Me.convert=function(e){return e instanceof Me?e:Array.isArray(e)?new Me(e[0],e[1]):e};var fr=de(pr);function Ft(e,t){var n=t.getBoundingClientRect();return new fr(e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0))}function Le(e,t,n,r){return{type:m.FEATURE,properties:{meta:B.VERTEX,parent:e,coord_path:n,active:r?j.ACTIVE:j.INACTIVE},geometry:{type:m.POINT,coordinates:t}}}function un(e,t,n){var r=t.geometry.coordinates,o=n.geometry.coordinates;if(r[1]>85||r[1]<St||o[1]>85||o[1]<St)return null;var i={lng:(r[0]+o[0])/2,lat:(r[1]+o[1])/2};return{type:m.FEATURE,properties:{meta:B.MIDPOINT,parent:e,lng:i.lng,lat:i.lat,coord_path:n.properties.coord_path},geometry:{type:m.POINT,coordinates:[i.lng,i.lat]}}}function Ke(e,t,n){t===void 0&&(t={}),n===void 0&&(n=null);var r,o=e.geometry,i=o.type,a=o.coordinates,l=e.properties&&e.properties.id,d=[];function h(p,_){var A="",b=null;p.forEach(function(F,c){var y=_!=null?_+"."+c:String(c),O=Le(l,F,y,g(y));if(t.midpoints&&b){var V=un(l,b,O);V&&d.push(V)}b=O;var w=JSON.stringify(F);A!==w&&d.push(O),c===0&&(A=w)})}function g(p){return!!t.selectedPaths&&t.selectedPaths.indexOf(p)!==-1}return i===m.POINT?d.push(Le(l,a,n,g(n))):i===m.POLYGON?a.forEach(function(p,_){h(p,n!==null?n+"."+_:String(_))}):i===m.LINE_STRING?h(a,n):i.indexOf(m.MULTI_PREFIX)===0&&(r=i.replace(m.MULTI_PREFIX,""),a.forEach(function(p,_){var A={type:m.FEATURE,properties:e.properties,geometry:{type:r,coordinates:p}};d=d.concat(Ke(A,t,_))})),d}var ee={enable:function(e){setTimeout(function(){e.map&&e.map.doubleClickZoom&&e._ctx&&e._ctx.store&&e._ctx.store.getInitialConfigValue&&e._ctx.store.getInitialConfigValue("doubleClickZoom")&&e.map.doubleClickZoom.enable()},0)},disable:function(e){setTimeout(function(){e.map&&e.map.doubleClickZoom&&e.map.doubleClickZoom.disable()},0)}},Qe={exports:{}},cn=function(e){if(!e||!e.type)return null;var t=hr[e.type];if(!t)return null;if(t==="geometry")return{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:e}]};if(t==="feature")return{type:"FeatureCollection",features:[e]};if(t==="featurecollection")return e},hr={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"},gr=de(cn),yr=Object.freeze({__proto__:null,default:function e(t){switch(t&&t.type||null){case"FeatureCollection":return t.features=t.features.reduce(function(n,r){return n.concat(e(r))},[]),t;case"Feature":return t.geometry?e(t.geometry).map(function(n){var r={type:"Feature",properties:JSON.parse(JSON.stringify(t.properties)),geometry:n};return t.id!==void 0&&(r.id=t.id),r}):[t];case"MultiPoint":return t.coordinates.map(function(n){return{type:"Point",coordinates:n}});case"MultiPolygon":return t.coordinates.map(function(n){return{type:"Polygon",coordinates:n}});case"MultiLineString":return t.coordinates.map(function(n){return{type:"LineString",coordinates:n}});case"GeometryCollection":return t.geometries.map(e).reduce(function(n,r){return n.concat(r)},[]);case"Point":case"Polygon":case"LineString":return[t]}}}),vr=cn,et=Kn(yr),mr=function(e){return function t(n){return Array.isArray(n)&&n.length&&typeof n[0]=="number"?[n]:n.reduce(function(r,o){return Array.isArray(o)&&Array.isArray(o[0])?r.concat(t(o)):(r.push(o),r)},[])}(e)};et instanceof Function||(et=et.default);var ln={exports:{}},_r=ln.exports=function(e){return new K(e)};function K(e){this.value=e}function dn(e,t,n){var r=[],o=[],i=!0;return function a(l){var d=n?pn(l):l,h={},g=!0,p={node:d,node_:l,path:[].concat(r),parent:o[o.length-1],parents:o,key:r.slice(-1)[0],isRoot:r.length===0,level:r.length,circular:null,update:function(b,F){p.isRoot||(p.parent.node[p.key]=b),p.node=b,F&&(g=!1)},delete:function(b){delete p.parent.node[p.key],b&&(g=!1)},remove:function(b){fn(p.parent.node)?p.parent.node.splice(p.key,1):delete p.parent.node[p.key],b&&(g=!1)},keys:null,before:function(b){h.before=b},after:function(b){h.after=b},pre:function(b){h.pre=b},post:function(b){h.post=b},stop:function(){i=!1},block:function(){g=!1}};if(!i)return p;function _(){if(typeof p.node=="object"&&p.node!==null){p.keys&&p.node_===p.node||(p.keys=tt(p.node)),p.isLeaf=p.keys.length==0;for(var b=0;b<o.length;b++)if(o[b].node_===l){p.circular=o[b];break}}else p.isLeaf=!0,p.keys=null;p.notLeaf=!p.isLeaf,p.notRoot=!p.isRoot}_();var A=t.call(p,p.node);return A!==void 0&&p.update&&p.update(A),h.before&&h.before.call(p,p.node),g&&(typeof p.node!="object"||p.node===null||p.circular||(o.push(p),_(),nt(p.keys,function(b,F){r.push(b),h.pre&&h.pre.call(p,p.node[b],b);var c=a(p.node[b]);n&&rt.call(p.node,b)&&(p.node[b]=c.node),c.isLast=F==p.keys.length-1,c.isFirst=F==0,h.post&&h.post.call(p,c),r.pop()}),o.pop()),h.after&&h.after.call(p,p.node)),p}(e).node}function pn(e){if(typeof e=="object"&&e!==null){var t;if(fn(e))t=[];else if(Ne(e)==="[object Date]")t=new Date(e.getTime?e.getTime():e);else if(function(o){return Ne(o)==="[object RegExp]"}(e))t=new RegExp(e);else if(function(o){return Ne(o)==="[object Error]"}(e))t={message:e.message};else if(function(o){return Ne(o)==="[object Boolean]"}(e))t=new Boolean(e);else if(function(o){return Ne(o)==="[object Number]"}(e))t=new Number(e);else if(function(o){return Ne(o)==="[object String]"}(e))t=new String(e);else if(Object.create&&Object.getPrototypeOf)t=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)t={};else{var n=e.constructor&&e.constructor.prototype||e.__proto__||{},r=function(){};r.prototype=n,t=new r}return nt(tt(e),function(o){t[o]=e[o]}),t}return e}K.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var r=e[n];if(!t||!rt.call(t,r)){t=void 0;break}t=t[r]}return t},K.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var r=e[n];if(!t||!rt.call(t,r))return!1;t=t[r]}return!0},K.prototype.set=function(e,t){for(var n=this.value,r=0;r<e.length-1;r++){var o=e[r];rt.call(n,o)||(n[o]={}),n=n[o]}return n[e[r]]=t,t},K.prototype.map=function(e){return dn(this.value,e,!0)},K.prototype.forEach=function(e){return this.value=dn(this.value,e,!1),this.value},K.prototype.reduce=function(e,t){var n=arguments.length===1,r=n?this.value:t;return this.forEach(function(o){this.isRoot&&n||(r=e.call(this,r,o))}),r},K.prototype.paths=function(){var e=[];return this.forEach(function(t){e.push(this.path)}),e},K.prototype.nodes=function(){var e=[];return this.forEach(function(t){e.push(this.node)}),e},K.prototype.clone=function(){var e=[],t=[];return function n(r){for(var o=0;o<e.length;o++)if(e[o]===r)return t[o];if(typeof r=="object"&&r!==null){var i=pn(r);return e.push(r),t.push(i),nt(tt(r),function(a){i[a]=n(r[a])}),e.pop(),t.pop(),i}return r}(this.value)};var tt=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function Ne(e){return Object.prototype.toString.call(e)}var fn=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},nt=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)};nt(tt(K.prototype),function(e){_r[e]=function(t){var n=[].slice.call(arguments,1),r=new K(t);return r[e].apply(r,n)}});var rt=Object.hasOwnProperty||function(e,t){return t in e},br=ln.exports,Er=J;function J(e){if(!(this instanceof J))return new J(e);this._bbox=e||[1/0,1/0,-1/0,-1/0],this._valid=!!e}J.prototype.include=function(e){return this._valid=!0,this._bbox[0]=Math.min(this._bbox[0],e[0]),this._bbox[1]=Math.min(this._bbox[1],e[1]),this._bbox[2]=Math.max(this._bbox[2],e[0]),this._bbox[3]=Math.max(this._bbox[3],e[1]),this},J.prototype.equals=function(e){var t;return t=e instanceof J?e.bbox():e,this._bbox[0]==t[0]&&this._bbox[1]==t[1]&&this._bbox[2]==t[2]&&this._bbox[3]==t[3]},J.prototype.center=function(e){return this._valid?[(this._bbox[0]+this._bbox[2])/2,(this._bbox[1]+this._bbox[3])/2]:null},J.prototype.union=function(e){var t;return this._valid=!0,t=e instanceof J?e.bbox():e,this._bbox[0]=Math.min(this._bbox[0],t[0]),this._bbox[1]=Math.min(this._bbox[1],t[1]),this._bbox[2]=Math.max(this._bbox[2],t[2]),this._bbox[3]=Math.max(this._bbox[3],t[3]),this},J.prototype.bbox=function(){return this._valid?this._bbox:null},J.prototype.contains=function(e){if(!e)return this._fastContains();if(!this._valid)return null;var t=e[0],n=e[1];return this._bbox[0]<=t&&this._bbox[1]<=n&&this._bbox[2]>=t&&this._bbox[3]>=n},J.prototype.intersect=function(e){return this._valid?(t=e instanceof J?e.bbox():e,!(this._bbox[0]>t[2]||this._bbox[2]<t[0]||this._bbox[3]<t[1]||this._bbox[1]>t[3])):null;var t},J.prototype._fastContains=function(){if(!this._valid)return new Function("return null;");var e="return "+this._bbox[0]+"<= ll[0] &&"+this._bbox[1]+"<= ll[1] &&"+this._bbox[2]+">= ll[0] &&"+this._bbox[3]+">= ll[1]";return new Function("ll",e)},J.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 Tr=function(e){if(!e)return[];var t=et(vr(e)),n=[];return t.features.forEach(function(r){r.geometry&&(n=n.concat(mr(r.geometry.coordinates)))}),n},Cr=br,Or=Er,hn={features:["FeatureCollection"],coordinates:["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],geometry:["Feature"],geometries:["GeometryCollection"]},Sr=Object.keys(hn);function wt(e){for(var t=Or(),n=Tr(e),r=0;r<n.length;r++)t.include(n[r]);return t}Qe.exports=function(e){return wt(e).bbox()},Qe.exports.polygon=function(e){return wt(e).polygon()},Qe.exports.bboxify=function(e){return Cr(e).map(function(t){t&&Sr.some(function(n){return!!t[n]&&hn[n].indexOf(t.type)!==-1})&&(t.bbox=wt(t).bbox(),this.update(t))})};var Ir=de(Qe.exports),ot=-90;function Rt(e,t){var n=ot,r=90,o=ot,i=90,a=270,l=-270;e.forEach(function(h){var g=Ir(h),p=g[1],_=g[3],A=g[0],b=g[2];p>n&&(n=p),_<r&&(r=_),_>o&&(o=_),p<i&&(i=p),A<a&&(a=A),b>l&&(l=b)});var d=t;return n+d.lat>85&&(d.lat=85-n),o+d.lat>90&&(d.lat=90-o),r+d.lat<-85&&(d.lat=-85-r),i+d.lat<ot&&(d.lat=ot-i),a+d.lng<=-270&&(d.lng+=360*Math.ceil(Math.abs(d.lng)/360)),l+d.lng>=270&&(d.lng-=360*Math.ceil(Math.abs(d.lng)/360)),d}function Dt(e,t){var n=Rt(e.map(function(r){return r.toGeoJSON()}),t);e.forEach(function(r){var o,i=r.getCoordinates(),a=function(d){var h={lng:d[0]+n.lng,lat:d[1]+n.lat};return[h.lng,h.lat]},l=function(d){return d.map(function(h){return a(h)})};r.type===m.POINT?o=a(i):r.type===m.LINE_STRING||r.type===m.MULTI_POINT?o=i.map(a):r.type===m.POLYGON||r.type===m.MULTI_LINE_STRING?o=i.map(l):r.type===m.MULTI_POLYGON&&(o=i.map(function(d){return d.map(function(h){return l(h)})})),r.incomingCoords(o)})}var D={onSetup:function(e){var t=this,n={dragMoveLocation:null,boxSelectStartLocation:null,boxSelectElement:void 0,boxSelecting:!1,canBoxSelect:!1,dragMoving:!1,canDragMove:!1,initiallySelectedFeatureIds:e.featureIds||[]};return this.setSelected(n.initiallySelectedFeatureIds.filter(function(r){return t.getFeature(r)!==void 0})),this.fireActionable(),this.setActionableState({combineFeatures:!0,uncombineFeatures:!0,trash:!0}),n},fireUpdate:function(){this.map.fire(H.UPDATE,{action:Ot.MOVE,features:this.getSelected().map(function(e){return e.toGeoJSON()})})},fireActionable:function(){var e=this,t=this.getSelected(),n=t.filter(function(l){return e.isInstanceOf("MultiFeature",l)}),r=!1;if(t.length>1){r=!0;var o=t[0].type.replace("Multi","");t.forEach(function(l){l.type.replace("Multi","")!==o&&(r=!1)})}var i=n.length>0,a=t.length>0;this.setActionableState({combineFeatures:r,uncombineFeatures:i,trash:a})},getUniqueIds:function(e){return e.length?e.map(function(t){return t.properties.id}).filter(function(t){return t!==void 0}).reduce(function(t,n){return t.add(n),t},new Z).values():[]},stopExtendedInteractions:function(e){e.boxSelectElement&&(e.boxSelectElement.parentNode&&e.boxSelectElement.parentNode.removeChild(e.boxSelectElement),e.boxSelectElement=null),this.map.dragPan.enable(),e.boxSelecting=!1,e.canBoxSelect=!1,e.dragMoving=!1,e.canDragMove=!1},onStop:function(){ee.enable(this)},onMouseMove:function(e,t){return Pt(t)&&e.dragMoving&&this.fireUpdate(),this.stopExtendedInteractions(e),!0},onMouseOut:function(e){return!e.dragMoving||this.fireUpdate()}};D.onTap=D.onClick=function(e,t){return He(t)?this.clickAnywhere(e,t):qe(B.VERTEX)(t)?this.clickOnVertex(e,t):Pt(t)?this.clickOnFeature(e,t):void 0},D.clickAnywhere=function(e){var t=this,n=this.getSelectedIds();n.length&&(this.clearSelectedFeatures(),n.forEach(function(r){return t.doRender(r)})),ee.enable(this),this.stopExtendedInteractions(e)},D.clickOnVertex=function(e,t){this.changeMode(T.DIRECT_SELECT,{featureId:t.featureTarget.properties.parent,coordPath:t.featureTarget.properties.coord_path,startPos:t.lngLat}),this.updateUIClasses({mouse:N.MOVE})},D.startOnActiveFeature=function(e,t){this.stopExtendedInteractions(e),this.map.dragPan.disable(),this.doRender(t.featureTarget.properties.id),e.canDragMove=!0,e.dragMoveLocation=t.lngLat},D.clickOnFeature=function(e,t){var n=this;ee.disable(this),this.stopExtendedInteractions(e);var r=Xe(t),o=this.getSelectedIds(),i=t.featureTarget.properties.id,a=this.isSelected(i);if(!r&&a&&this.getFeature(i).type!==m.POINT)return this.changeMode(T.DIRECT_SELECT,{featureId:i});a&&r?(this.deselect(i),this.updateUIClasses({mouse:N.POINTER}),o.length===1&&ee.enable(this)):!a&&r?(this.select(i),this.updateUIClasses({mouse:N.MOVE})):a||r||(o.forEach(function(l){return n.doRender(l)}),this.setSelected(i),this.updateUIClasses({mouse:N.MOVE})),this.doRender(i)},D.onMouseDown=function(e,t){return _e(t)?this.startOnActiveFeature(e,t):this.drawConfig.boxSelect&&sn(t)?this.startBoxSelect(e,t):void 0},D.startBoxSelect=function(e,t){this.stopExtendedInteractions(e),this.map.dragPan.disable(),e.boxSelectStartLocation=Ft(t.originalEvent,this.map.getContainer()),e.canBoxSelect=!0},D.onTouchStart=function(e,t){if(_e(t))return this.startOnActiveFeature(e,t)},D.onDrag=function(e,t){return e.canDragMove?this.dragMove(e,t):this.drawConfig.boxSelect&&e.canBoxSelect?this.whileBoxSelect(e,t):void 0},D.whileBoxSelect=function(e,t){e.boxSelecting=!0,this.updateUIClasses({mouse:N.ADD}),e.boxSelectElement||(e.boxSelectElement=document.createElement("div"),e.boxSelectElement.classList.add(q.BOX_SELECT),this.map.getContainer().appendChild(e.boxSelectElement));var n=Ft(t.originalEvent,this.map.getContainer()),r=Math.min(e.boxSelectStartLocation.x,n.x),o=Math.max(e.boxSelectStartLocation.x,n.x),i=Math.min(e.boxSelectStartLocation.y,n.y),a=Math.max(e.boxSelectStartLocation.y,n.y),l="translate("+r+"px, "+i+"px)";e.boxSelectElement.style.transform=l,e.boxSelectElement.style.WebkitTransform=l,e.boxSelectElement.style.width=o-r+"px",e.boxSelectElement.style.height=a-i+"px"},D.dragMove=function(e,t){e.dragMoving=!0,t.originalEvent.stopPropagation();var n={lng:t.lngLat.lng-e.dragMoveLocation.lng,lat:t.lngLat.lat-e.dragMoveLocation.lat};Dt(this.getSelected(),n),e.dragMoveLocation=t.lngLat},D.onTouchEnd=D.onMouseUp=function(e,t){var n=this;if(e.dragMoving)this.fireUpdate();else if(e.boxSelecting){var r=[e.boxSelectStartLocation,Ft(t.originalEvent,this.map.getContainer())],o=this.featuresAt(null,r,"click"),i=this.getUniqueIds(o).filter(function(a){return!n.isSelected(a)});i.length&&(this.select(i),i.forEach(function(a){return n.doRender(a)}),this.updateUIClasses({mouse:N.MOVE}))}this.stopExtendedInteractions(e)},D.toDisplayFeatures=function(e,t,n){t.properties.active=this.isSelected(t.properties.id)?j.ACTIVE:j.INACTIVE,n(t),this.fireActionable(),t.properties.active===j.ACTIVE&&t.geometry.type!==m.POINT&&Ke(t).forEach(n)},D.onTrash=function(){this.deleteFeature(this.getSelectedIds()),this.fireActionable()},D.onCombineFeatures=function(){var e=this.getSelected();if(!(e.length===0||e.length<2)){for(var t=[],n=[],r=e[0].type.replace("Multi",""),o=0;o<e.length;o++){var i=e[o];if(i.type.replace("Multi","")!==r)return;i.type.includes("Multi")?i.getCoordinates().forEach(function(l){t.push(l)}):t.push(i.getCoordinates()),n.push(i.toGeoJSON())}if(n.length>1){var a=this.newFeature({type:m.FEATURE,properties:n[0].properties,geometry:{type:"Multi"+r,coordinates:t}});this.addFeature(a),this.deleteFeature(this.getSelectedIds(),{silent:!0}),this.setSelected([a.id]),this.map.fire(H.COMBINE_FEATURES,{createdFeatures:[a.toGeoJSON()],deletedFeatures:n})}this.fireActionable()}},D.onUncombineFeatures=function(){var e=this,t=this.getSelected();if(t.length!==0){for(var n=[],r=[],o=function(a){var l=t[a];e.isInstanceOf("MultiFeature",l)&&(l.getFeatures().forEach(function(d){e.addFeature(d),d.properties=l.properties,n.push(d.toGeoJSON()),e.select([d.id])}),e.deleteFeature(l.id,{silent:!0}),r.push(l.toGeoJSON()))},i=0;i<t.length;i++)o(i);n.length>1&&this.map.fire(H.UNCOMBINE_FEATURES,{createdFeatures:n,deletedFeatures:r}),this.fireActionable()}};var gn=qe(B.VERTEX),yn=qe(B.MIDPOINT),fe={fireUpdate:function(){this.map.fire(H.UPDATE,{action:Ot.CHANGE_COORDINATES,features:this.getSelected().map(function(e){return e.toGeoJSON()})})},fireActionable:function(e){this.setActionableState({combineFeatures:!1,uncombineFeatures:!1,trash:e.selectedCoordPaths.length>0})},startDragging:function(e,t){this.map.dragPan.disable(),e.canDragMove=!0,e.dragMoveLocation=t.lngLat},stopDragging:function(e){this.map.dragPan.enable(),e.dragMoving=!1,e.canDragMove=!1,e.dragMoveLocation=null},onVertex:function(e,t){this.startDragging(e,t);var n=t.featureTarget.properties,r=e.selectedCoordPaths.indexOf(n.coord_path);Xe(t)||r!==-1?Xe(t)&&r===-1&&e.selectedCoordPaths.push(n.coord_path):e.selectedCoordPaths=[n.coord_path];var o=this.pathsToCoordinates(e.featureId,e.selectedCoordPaths);this.setSelectedCoordinates(o)},onMidpoint:function(e,t){this.startDragging(e,t);var n=t.featureTarget.properties;e.feature.addCoordinate(n.coord_path,n.lng,n.lat),this.fireUpdate(),e.selectedCoordPaths=[n.coord_path]},pathsToCoordinates:function(e,t){return t.map(function(n){return{feature_id:e,coord_path:n}})},onFeature:function(e,t){e.selectedCoordPaths.length===0?this.startDragging(e,t):this.stopDragging(e)},dragFeature:function(e,t,n){Dt(this.getSelected(),n),e.dragMoveLocation=t.lngLat},dragVertex:function(e,t,n){for(var r=e.selectedCoordPaths.map(function(l){return e.feature.getCoordinate(l)}),o=Rt(r.map(function(l){return{type:m.FEATURE,properties:{},geometry:{type:m.POINT,coordinates:l}}}),n),i=0;i<r.length;i++){var a=r[i];e.feature.updateCoordinate(e.selectedCoordPaths[i],a[0]+o.lng,a[1]+o.lat)}},clickNoTarget:function(){this.changeMode(T.SIMPLE_SELECT)},clickInactive:function(){this.changeMode(T.SIMPLE_SELECT)},clickActiveFeature:function(e){e.selectedCoordPaths=[],this.clearSelectedCoordinates(),e.feature.changed()},onSetup:function(e){var t=e.featureId,n=this.getFeature(t);if(!n)throw new Error("You must provide a featureId to enter direct_select mode");if(n.type===m.POINT)throw new TypeError("direct_select mode doesn't handle point features");var r={featureId:t,feature:n,dragMoveLocation:e.startPos||null,dragMoving:!1,canDragMove:!1,selectedCoordPaths:e.coordPath?[e.coordPath]:[]};return this.setSelectedCoordinates(this.pathsToCoordinates(t,r.selectedCoordPaths)),this.setSelected(t),ee.disable(this),this.setActionableState({trash:!0}),r},onStop:function(){ee.enable(this),this.clearSelectedCoordinates()},toDisplayFeatures:function(e,t,n){e.featureId===t.properties.id?(t.properties.active=j.ACTIVE,n(t),Ke(t,{map:this.map,midpoints:!0,selectedPaths:e.selectedCoordPaths}).forEach(n)):(t.properties.active=j.INACTIVE,n(t)),this.fireActionable(e)},onTrash:function(e){e.selectedCoordPaths.sort(function(t,n){return n.localeCompare(t,"en",{numeric:!0})}).forEach(function(t){return e.feature.removeCoordinate(t)}),this.fireUpdate(),e.selectedCoordPaths=[],this.clearSelectedCoordinates(),this.fireActionable(e),e.feature.isValid()===!1&&(this.deleteFeature([e.featureId]),this.changeMode(T.SIMPLE_SELECT,{}))},onMouseMove:function(e,t){var n=_e(t),r=gn(t),o=yn(t),i=e.selectedCoordPaths.length===0;return n&&i||r&&!i?this.updateUIClasses({mouse:N.MOVE}):this.updateUIClasses({mouse:N.NONE}),(r||n||o)&&e.dragMoving&&this.fireUpdate(),this.stopDragging(e),!0},onMouseOut:function(e){return e.dragMoving&&this.fireUpdate(),!0}};fe.onTouchStart=fe.onMouseDown=function(e,t){return gn(t)?this.onVertex(e,t):_e(t)?this.onFeature(e,t):yn(t)?this.onMidpoint(e,t):void 0},fe.onDrag=function(e,t){if(e.canDragMove===!0){e.dragMoving=!0,t.originalEvent.stopPropagation();var n={lng:t.lngLat.lng-e.dragMoveLocation.lng,lat:t.lngLat.lat-e.dragMoveLocation.lat};e.selectedCoordPaths.length>0?this.dragVertex(e,t,n):this.dragFeature(e,t,n),e.dragMoveLocation=t.lngLat}},fe.onClick=function(e,t){return He(t)?this.clickNoTarget(e,t):_e(t)?this.clickActiveFeature(e,t):At(t)?this.clickInactive(e,t):void this.stopDragging(e)},fe.onTap=function(e,t){return He(t)?this.clickNoTarget(e,t):_e(t)?this.clickActiveFeature(e,t):At(t)?this.clickInactive(e,t):void 0},fe.onTouchEnd=fe.onMouseUp=function(e){e.dragMoving&&this.fireUpdate(),this.stopDragging(e)};var ne={};function it(e,t){return!!e.lngLat&&e.lngLat.lng===t[0]&&e.lngLat.lat===t[1]}ne.onSetup=function(){var e=this.newFeature({type:m.FEATURE,properties:{},geometry:{type:m.POINT,coordinates:[]}});return this.addFeature(e),this.clearSelectedFeatures(),this.updateUIClasses({mouse:N.ADD}),this.activateUIButton(Y.POINT),this.setActionableState({trash:!0}),{point:e}},ne.stopDrawingAndRemove=function(e){this.deleteFeature([e.point.id],{silent:!0}),this.changeMode(T.SIMPLE_SELECT)},ne.onTap=ne.onClick=function(e,t){this.updateUIClasses({mouse:N.MOVE}),e.point.updateCoordinate("",t.lngLat.lng,t.lngLat.lat),this.map.fire(H.CREATE,{features:[e.point.toGeoJSON()]}),this.changeMode(T.SIMPLE_SELECT,{featureIds:[e.point.id]})},ne.onStop=function(e){this.activateUIButton(),e.point.getCoordinate().length||this.deleteFeature([e.point.id],{silent:!0})},ne.toDisplayFeatures=function(e,t,n){var r=t.properties.id===e.point.id;if(t.properties.active=r?j.ACTIVE:j.INACTIVE,!r)return n(t)},ne.onTrash=ne.stopDrawingAndRemove,ne.onKeyUp=function(e,t){if(Ze(t)||We(t))return this.stopDrawingAndRemove(e,t)};var be={onSetup:function(){var e=this.newFeature({type:m.FEATURE,properties:{},geometry:{type:m.POLYGON,coordinates:[[]]}});return this.addFeature(e),this.clearSelectedFeatures(),ee.disable(this),this.updateUIClasses({mouse:N.ADD}),this.activateUIButton(Y.POLYGON),this.setActionableState({trash:!0}),{polygon:e,currentVertexPosition:0}},clickAnywhere:function(e,t){if(e.currentVertexPosition>0&&it(t,e.polygon.coordinates[0][e.currentVertexPosition-1]))return this.changeMode(T.SIMPLE_SELECT,{featureIds:[e.polygon.id]});this.updateUIClasses({mouse:N.ADD}),e.polygon.updateCoordinate("0."+e.currentVertexPosition,t.lngLat.lng,t.lngLat.lat),e.currentVertexPosition++,e.polygon.updateCoordinate("0."+e.currentVertexPosition,t.lngLat.lng,t.lngLat.lat)},clickOnVertex:function(e){return this.changeMode(T.SIMPLE_SELECT,{featureIds:[e.polygon.id]})},onMouseMove:function(e,t){e.polygon.updateCoordinate("0."+e.currentVertexPosition,t.lngLat.lng,t.lngLat.lat),ke(t)&&this.updateUIClasses({mouse:N.POINTER})}};be.onTap=be.onClick=function(e,t){return ke(t)?this.clickOnVertex(e,t):this.clickAnywhere(e,t)},be.onKeyUp=function(e,t){Ze(t)?(this.deleteFeature([e.polygon.id],{silent:!0}),this.changeMode(T.SIMPLE_SELECT)):We(t)&&this.changeMode(T.SIMPLE_SELECT,{featureIds:[e.polygon.id]})},be.onStop=function(e){this.updateUIClasses({mouse:N.NONE}),ee.enable(this),this.activateUIButton(),this.getFeature(e.polygon.id)!==void 0&&(e.polygon.removeCoordinate("0."+e.currentVertexPosition),e.polygon.isValid()?this.map.fire(H.CREATE,{features:[e.polygon.toGeoJSON()]}):(this.deleteFeature([e.polygon.id],{silent:!0}),this.changeMode(T.SIMPLE_SELECT,{},{silent:!0})))},be.toDisplayFeatures=function(e,t,n){var r=t.properties.id===e.polygon.id;if(t.properties.active=r?j.ACTIVE:j.INACTIVE,!r)return n(t);if(t.geometry.coordinates.length!==0){var o=t.geometry.coordinates[0].length;if(!(o<3)){if(t.properties.meta=B.FEATURE,n(Le(e.polygon.id,t.geometry.coordinates[0][0],"0.0",!1)),o>3){var i=t.geometry.coordinates[0].length-3;n(Le(e.polygon.id,t.geometry.coordinates[0][i],"0."+i,!1))}if(o<=4){var a=[[t.geometry.coordinates[0][0][0],t.geometry.coordinates[0][0][1]],[t.geometry.coordinates[0][1][0],t.geometry.coordinates[0][1][1]]];if(n({type:m.FEATURE,properties:t.properties,geometry:{coordinates:a,type:m.LINE_STRING}}),o===3)return}return n(t)}}},be.onTrash=function(e){this.deleteFeature([e.polygon.id],{silent:!0}),this.changeMode(T.SIMPLE_SELECT)};var Ee={onSetup:function(e){var t,n,r=(e=e||{}).featureId,o="forward";if(r){if(!(t=this.getFeature(r)))throw new Error("Could not find a feature with the provided featureId");var i=e.from;if(i&&i.type==="Feature"&&i.geometry&&i.geometry.type==="Point"&&(i=i.geometry),i&&i.type==="Point"&&i.coordinates&&i.coordinates.length===2&&(i=i.coordinates),!i||!Array.isArray(i))throw new Error("Please use the `from` property to indicate which point to continue the line from");var a=t.coordinates.length-1;if(t.coordinates[a][0]===i[0]&&t.coordinates[a][1]===i[1])n=a+1,t.addCoordinate.apply(t,[n].concat(t.coordinates[a]));else{if(t.coordinates[0][0]!==i[0]||t.coordinates[0][1]!==i[1])throw new Error("`from` should match the point at either the start or the end of the provided LineString");o="backwards",n=0,t.addCoordinate.apply(t,[n].concat(t.coordinates[0]))}}else t=this.newFeature({type:m.FEATURE,properties:{},geometry:{type:m.LINE_STRING,coordinates:[]}}),n=0,this.addFeature(t);return this.clearSelectedFeatures(),ee.disable(this),this.updateUIClasses({mouse:N.ADD}),this.activateUIButton(Y.LINE),this.setActionableState({trash:!0}),{line:t,currentVertexPosition:n,direction:o}},clickAnywhere:function(e,t){if(e.currentVertexPosition>0&&it(t,e.line.coordinates[e.currentVertexPosition-1])||e.direction==="backwards"&&it(t,e.line.coordinates[e.currentVertexPosition+1]))return this.changeMode(T.SIMPLE_SELECT,{featureIds:[e.line.id]});this.updateUIClasses({mouse:N.ADD}),e.line.updateCoordinate(e.currentVertexPosition,t.lngLat.lng,t.lngLat.lat),e.direction==="forward"?(e.currentVertexPosition++,e.line.updateCoordinate(e.currentVertexPosition,t.lngLat.lng,t.lngLat.lat)):e.line.addCoordinate(0,t.lngLat.lng,t.lngLat.lat)},clickOnVertex:function(e){return this.changeMode(T.SIMPLE_SELECT,{featureIds:[e.line.id]})},onMouseMove:function(e,t){e.line.updateCoordinate(e.currentVertexPosition,t.lngLat.lng,t.lngLat.lat),ke(t)&&this.updateUIClasses({mouse:N.POINTER})}};Ee.onTap=Ee.onClick=function(e,t){if(ke(t))return this.clickOnVertex(e,t);this.clickAnywhere(e,t)},Ee.onKeyUp=function(e,t){We(t)?this.changeMode(T.SIMPLE_SELECT,{featureIds:[e.line.id]}):Ze(t)&&(this.deleteFeature([e.line.id],{silent:!0}),this.changeMode(T.SIMPLE_SELECT))},Ee.onStop=function(e){ee.enable(this),this.activateUIButton(),this.getFeature(e.line.id)!==void 0&&(e.line.removeCoordinate(""+e.currentVertexPosition),e.line.isValid()?this.map.fire(H.CREATE,{features:[e.line.toGeoJSON()]}):(this.deleteFeature([e.line.id],{silent:!0}),this.changeMode(T.SIMPLE_SELECT,{},{silent:!0})))},Ee.onTrash=function(e){this.deleteFeature([e.line.id],{silent:!0}),this.changeMode(T.SIMPLE_SELECT)},Ee.toDisplayFeatures=function(e,t,n){var r=t.properties.id===e.line.id;if(t.properties.active=r?j.ACTIVE:j.INACTIVE,!r)return n(t);t.geometry.coordinates.length<2||(t.properties.meta=B.FEATURE,n(Le(e.line.id,t.geometry.coordinates[e.direction==="forward"?t.geometry.coordinates.length-2:1],""+(e.direction==="forward"?t.geometry.coordinates.length-2:1),!1)),n(t))};var vn={simple_select:D,direct_select:fe,draw_point:ne,draw_polygon:be,draw_line_string:Ee},xr={defaultMode:T.SIMPLE_SELECT,keybindings:!0,touchEnabled:!0,clickBuffer:2,touchBuffer:25,boxSelect:!0,displayControlsDefault:!0,styles:an,modes:vn,controls:{},userProperties:!1},Mr={point:!0,line_string:!0,polygon:!0,trash:!0,combine_features:!0,uncombine_features:!0},Lr={point:!1,line_string:!1,polygon:!1,trash:!1,combine_features:!1,uncombine_features:!1};function mn(e,t){return e.map(function(n){return n.source?n:pe(n,{id:n.id+"."+t,source:t==="hot"?X.HOT:X.COLD})})}var kt={exports:{}};(function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,o="[object Arguments]",i="[object Array]",a="[object Boolean]",l="[object Date]",d="[object Error]",h="[object Function]",g="[object Map]",p="[object Number]",_="[object Object]",A="[object Promise]",b="[object RegExp]",F="[object Set]",c="[object String]",y="[object Symbol]",O="[object WeakMap]",V="[object ArrayBuffer]",w="[object DataView]",Ut=/^\[object .+?Constructor\]$/,Fr=/^(?:0|[1-9]\d*)$/,M={};M["[object Float32Array]"]=M["[object Float64Array]"]=M["[object Int8Array]"]=M["[object Int16Array]"]=M["[object Int32Array]"]=M["[object Uint8Array]"]=M["[object Uint8ClampedArray]"]=M["[object Uint16Array]"]=M["[object Uint32Array]"]=!0,M[o]=M[i]=M[V]=M[a]=M[w]=M[l]=M[d]=M[h]=M[g]=M[p]=M[_]=M[b]=M[F]=M[c]=M[O]=!1;var En=typeof Re.commonjsGlobal=="object"&&Re.commonjsGlobal&&Re.commonjsGlobal.Object===Object&&Re.commonjsGlobal,wr=typeof self=="object"&&self&&self.Object===Object&&self,ae=En||wr||Function("return this")(),Tn=t&&!t.nodeType&&t,Cn=Tn&&e&&!e.nodeType&&e,On=Cn&&Cn.exports===Tn,jt=On&&En.process,Sn=function(){try{return jt&&jt.binding&&jt.binding("util")}catch{}}(),In=Sn&&Sn.isTypedArray;function Rr(s,u){for(var f=-1,v=s==null?0:s.length;++f<v;)if(u(s[f],f,s))return!0;return!1}function Dr(s){var u=-1,f=Array(s.size);return s.forEach(function(v,L){f[++u]=[L,v]}),f}function kr(s){var u=-1,f=Array(s.size);return s.forEach(function(v){f[++u]=v}),f}var xn,Mn,Ln,Ur=Array.prototype,jr=Function.prototype,st=Object.prototype,Vt=ae["__core-js_shared__"],Nn=jr.toString,re=st.hasOwnProperty,An=(xn=/[^.]+$/.exec(Vt&&Vt.keys&&Vt.keys.IE_PROTO||""))?"Symbol(src)_1."+xn:"",Pn=st.toString,Vr=RegExp("^"+Nn.call(re).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Fn=On?ae.Buffer:void 0,ut=ae.Symbol,wn=ae.Uint8Array,Rn=st.propertyIsEnumerable,Br=Ur.splice,Te=ut?ut.toStringTag:void 0,Dn=Object.getOwnPropertySymbols,Gr=Fn?Fn.isBuffer:void 0,Jr=(Mn=Object.keys,Ln=Object,function(s){return Mn(Ln(s))}),Bt=Ae(ae,"DataView"),Ue=Ae(ae,"Map"),Gt=Ae(ae,"Promise"),Jt=Ae(ae,"Set"),zt=Ae(ae,"WeakMap"),je=Ae(Object,"create"),zr=Se(Bt),Yr=Se(Ue),$r=Se(Gt),qr=Se(Jt),Hr=Se(zt),kn=ut?ut.prototype:void 0,Yt=kn?kn.valueOf:void 0;function Ce(s){var u=-1,f=s==null?0:s.length;for(this.clear();++u<f;){var v=s[u];this.set(v[0],v[1])}}function se(s){var u=-1,f=s==null?0:s.length;for(this.clear();++u<f;){var v=s[u];this.set(v[0],v[1])}}function Oe(s){var u=-1,f=s==null?0:s.length;for(this.clear();++u<f;){var v=s[u];this.set(v[0],v[1])}}function ct(s){var u=-1,f=s==null?0:s.length;for(this.__data__=new Oe;++u<f;)this.add(s[u])}function he(s){var u=this.__data__=new se(s);this.size=u.size}function Xr(s,u){var f=pt(s),v=!f&&eo(s),L=!f&&!v&&$t(s),C=!f&&!v&&!L&&$n(s),P=f||v||L||C,R=P?function(U,oe){for(var ue=-1,z=Array(U);++ue<U;)z[ue]=oe(ue);return z}(s.length,String):[],te=R.length;for(var k in s)!u&&!re.call(s,k)||P&&(k=="length"||L&&(k=="offset"||k=="parent")||C&&(k=="buffer"||k=="byteLength"||k=="byteOffset")||Qr(k,te))||R.push(k);return R}function lt(s,u){for(var f=s.length;f--;)if(Gn(s[f][0],u))return f;return-1}function Ve(s){return s==null?s===void 0?"[object Undefined]":"[object Null]":Te&&Te in Object(s)?function(u){var f=re.call(u,Te),v=u[Te];try{u[Te]=void 0;var L=!0}catch{}var C=Pn.call(u);return L&&(f?u[Te]=v:delete u[Te]),C}(s):function(u){return Pn.call(u)}(s)}function Un(s){return Be(s)&&Ve(s)==o}function jn(s,u,f,v,L){return s===u||(s==null||u==null||!Be(s)&&!Be(u)?s!=s&&u!=u:function(C,P,R,te,k,U){var oe=pt(C),ue=pt(P),z=oe?i:ge(C),ce=ue?i:ge(P),Pe=(z=z==o?_:z)==_,ft=(ce=ce==o?_:ce)==_,Fe=z==ce;if(Fe&&$t(C)){if(!$t(P))return!1;oe=!0,Pe=!1}if(Fe&&!Pe)return U||(U=new he),oe||$n(C)?Vn(C,P,R,te,k,U):function(I,S,ht,ye,qt,Q,le){switch(ht){case w:if(I.byteLength!=S.byteLength||I.byteOffset!=S.byteOffset)return!1;I=I.buffer,S=S.buffer;case V:return!(I.byteLength!=S.byteLength||!Q(new wn(I),new wn(S)));case a:case l:case p:return Gn(+I,+S);case d:return I.name==S.name&&I.message==S.message;case b:case c:return I==S+"";case g:var ve=Dr;case F:var Je=1&ye;if(ve||(ve=kr),I.size!=S.size&&!Je)return!1;var gt=le.get(I);if(gt)return gt==S;ye|=2,le.set(I,S);var we=Vn(ve(I),ve(S),ye,qt,Q,le);return le.delete(I),we;case y:if(Yt)return Yt.call(I)==Yt.call(S)}return!1}(C,P,z,R,te,k,U);if(!(1&R)){var Ge=Pe&&re.call(C,"__wrapped__"),qn=ft&&re.call(P,"__wrapped__");if(Ge||qn){var no=Ge?C.value():C,ro=qn?P.value():P;return U||(U=new he),k(no,ro,R,te,U)}}return Fe?(U||(U=new he),function(I,S,ht,ye,qt,Q){var le=1&ht,ve=Bn(I),Je=ve.length,gt=Bn(S).length;if(Je!=gt&&!le)return!1;for(var we=Je;we--;){var Ie=ve[we];if(!(le?Ie in S:re.call(S,Ie)))return!1}var Hn=Q.get(I);if(Hn&&Q.get(S))return Hn==S;var yt=!0;Q.set(I,S),Q.set(S,I);for(var Ht=le;++we<Je;){var vt=I[Ie=ve[we]],mt=S[Ie];if(ye)var Xn=le?ye(mt,vt,Ie,S,I,Q):ye(vt,mt,Ie,I,S,Q);if(!(Xn===void 0?vt===mt||qt(vt,mt,ht,ye,Q):Xn)){yt=!1;break}Ht||(Ht=Ie=="constructor")}if(yt&&!Ht){var _t=I.constructor,bt=S.constructor;_t==bt||!("constructor"in I)||!("constructor"in S)||typeof _t=="function"&&_t instanceof _t&&typeof bt=="function"&&bt instanceof bt||(yt=!1)}return Q.delete(I),Q.delete(S),yt}(C,P,R,te,k,U)):!1}(s,u,f,v,jn,L))}function Zr(s){return!(!Yn(s)||function(u){return!!An&&An in u}(s))&&(Jn(s)?Vr:Ut).test(Se(s))}function Wr(s){if(f=(u=s)&&u.constructor,v=typeof f=="function"&&f.prototype||st,u!==v)return Jr(s);var u,f,v,L=[];for(var C in Object(s))re.call(s,C)&&C!="constructor"&&L.push(C);return L}function Vn(s,u,f,v,L,C){var P=1&f,R=s.length,te=u.length;if(R!=te&&!(P&&te>R))return!1;var k=C.get(s);if(k&&C.get(u))return k==u;var U=-1,oe=!0,ue=2&f?new ct:void 0;for(C.set(s,u),C.set(u,s);++U<R;){var z=s[U],ce=u[U];if(v)var Pe=P?v(ce,z,U,u,s,C):v(z,ce,U,s,u,C);if(Pe!==void 0){if(Pe)continue;oe=!1;break}if(ue){if(!Rr(u,function(ft,Fe){if(Ge=Fe,!ue.has(Ge)&&(z===ft||L(z,ft,f,v,C)))return ue.push(Fe);var Ge})){oe=!1;break}}else if(z!==ce&&!L(z,ce,f,v,C)){oe=!1;break}}return C.delete(s),C.delete(u),oe}function Bn(s){return function(u,f,v){var L=f(u);return pt(u)?L:function(C,P){for(var R=-1,te=P.length,k=C.length;++R<te;)C[k+R]=P[R];return C}(L,v(u))}(s,to,Kr)}function dt(s,u){var f,v,L=s.__data__;return((v=typeof(f=u))=="string"||v=="number"||v=="symbol"||v=="boolean"?f!=="__proto__":f===null)?L[typeof u=="string"?"string":"hash"]:L.map}function Ae(s,u){var f=function(v,L){return v==null?void 0:v[L]}(s,u);return Zr(f)?f:void 0}Ce.prototype.clear=function(){this.__data__=je?je(null):{},this.size=0},Ce.prototype.delete=function(s){var u=this.has(s)&&delete this.__data__[s];return this.size-=u?1:0,u},Ce.prototype.get=function(s){var u=this.__data__;if(je){var f=u[s];return f===n?void 0:f}return re.call(u,s)?u[s]:void 0},Ce.prototype.has=function(s){var u=this.__data__;return je?u[s]!==void 0:re.call(u,s)},Ce.prototype.set=function(s,u){var f=this.__data__;return this.size+=this.has(s)?0:1,f[s]=je&&u===void 0?n:u,this},se.prototype.clear=function(){this.__data__=[],this.size=0},se.prototype.delete=function(s){var u=this.__data__,f=lt(u,s);return!(f<0)&&(f==u.length-1?u.pop():Br.call(u,f,1),--this.size,!0)},se.prototype.get=function(s){var u=this.__data__,f=lt(u,s);return f<0?void 0:u[f][1]},se.prototype.has=function(s){return lt(this.__data__,s)>-1},se.prototype.set=function(s,u){var f=this.__data__,v=lt(f,s);return v<0?(++this.size,f.push([s,u])):f[v][1]=u,this},Oe.prototype.clear=function(){this.size=0,this.__data__={hash:new Ce,map:new(Ue||se),string:new Ce}},Oe.prototype.delete=function(s){var u=dt(this,s).delete(s);return this.size-=u?1:0,u},Oe.prototype.get=function(s){return dt(this,s).get(s)},Oe.prototype.has=function(s){return dt(this,s).has(s)},Oe.prototype.set=function(s,u){var f=dt(this,s),v=f.size;return f.set(s,u),this.size+=f.size==v?0:1,this},ct.prototype.add=ct.prototype.push=function(s){return this.__data__.set(s,n),this},ct.prototype.has=function(s){return this.__data__.has(s)},he.prototype.clear=function(){this.__data__=new se,this.size=0},he.prototype.delete=function(s){var u=this.__data__,f=u.delete(s);return this.size=u.size,f},he.prototype.get=function(s){return this.__data__.get(s)},he.prototype.has=function(s){return this.__data__.has(s)},he.prototype.set=function(s,u){var f=this.__data__;if(f instanceof se){var v=f.__data__;if(!Ue||v.length<199)return v.push([s,u]),this.size=++f.size,this;f=this.__data__=new Oe(v)}return f.set(s,u),this.size=f.size,this};var Kr=Dn?function(s){return s==null?[]:(s=Object(s),function(u,f){for(var v=-1,L=u==null?0:u.length,C=0,P=[];++v<L;){var R=u[v];f(R,v,u)&&(P[C++]=R)}return P}(Dn(s),function(u){return Rn.call(s,u)}))}:function(){return[]},ge=Ve;function Qr(s,u){return!!(u=u??r)&&(typeof s=="number"||Fr.test(s))&&s>-1&&s%1==0&&s<u}function Se(s){if(s!=null){try{return Nn.call(s)}catch{}try{return s+""}catch{}}return""}function Gn(s,u){return s===u||s!=s&&u!=u}(Bt&&ge(new Bt(new ArrayBuffer(1)))!=w||Ue&&ge(new Ue)!=g||Gt&&ge(Gt.resolve())!=A||Jt&&ge(new Jt)!=F||zt&&ge(new zt)!=O)&&(ge=function(s){var u=Ve(s),f=u==_?s.constructor:void 0,v=f?Se(f):"";if(v)switch(v){case zr:return w;case Yr:return g;case $r:return A;case qr:return F;case Hr:return O}return u});var eo=Un(function(){return arguments}())?Un:function(s){return Be(s)&&re.call(s,"callee")&&!Rn.call(s,"callee")},pt=Array.isArray,$t=Gr||function(){return!1};function Jn(s){if(!Yn(s))return!1;var u=Ve(s);return u==h||u=="[object GeneratorFunction]"||u=="[object AsyncFunction]"||u=="[object Proxy]"}function zn(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=r}function Yn(s){var u=typeof s;return s!=null&&(u=="object"||u=="function")}function Be(s){return s!=null&&typeof s=="object"}var $n=In?function(s){return function(u){return s(u)}}(In):function(s){return Be(s)&&zn(s.length)&&!!M[Ve(s)]};function to(s){return(u=s)!=null&&zn(u.length)&&!Jn(u)?Xr(s):Wr(s);var u}e.exports=function(s,u){return jn(s,u)}})(kt,kt.exports);var _n=de(kt.exports);function bn(e,t){return e.length===t.length&&JSON.stringify(e.map(function(n){return n}).sort())===JSON.stringify(t.map(function(n){return n}).sort())}var Nr={Polygon:W,LineString:ie,Point:me,MultiPolygon:$,MultiLineString:$,MultiPoint:$},Ar=Object.freeze({__proto__:null,CommonSelectors:dr,constrainFeatureMovement:Rt,createMidPoint:un,createSupplementaryPoints:Ke,createVertex:Le,doubleClickZoom:ee,euclideanDistance:It,featuresAt:xe,getFeatureAtAndSetCursors:Ye,isClick:xt,isEventAtCoordinates:it,isTap:Mt,mapEventToBoundingBox:en,ModeHandler:ze,moveFeatures:Dt,sortFeatures:Qt,stringSetsAreEqual:bn,StringSet:Z,theme:an,toDenseArray:De}),Pr=function(e,t){var n={options:e=function(o){o===void 0&&(o={});var i=pe(o);return o.controls||(i.controls={}),o.displayControlsDefault===!1?i.controls=pe(Lr,o.controls):i.controls=pe(Mr,o.controls),(i=pe(xr,i)).styles=mn(i.styles,"cold").concat(mn(i.styles,"hot")),i}(e)};t=function(o,i){return i.modes=T,i.getFeatureIdsAt=function(a){return xe.click({point:a},null,o).map(function(l){return l.properties.id})},i.getSelectedIds=function(){return o.store.getSelectedIds()},i.getSelected=function(){return{type:m.FEATURE_COLLECTION,features:o.store.getSelectedIds().map(function(a){return o.store.get(a)}).map(function(a){return a.toGeoJSON()})}},i.getSelectedPoints=function(){return{type:m.FEATURE_COLLECTION,features:o.store.getSelectedCoordinates().map(function(a){return{type:m.FEATURE,properties:{},geometry:{type:m.POINT,coordinates:a.coordinates}}})}},i.set=function(a){if(a.type===void 0||a.type!==m.FEATURE_COLLECTION||!Array.isArray(a.features))throw new Error("Invalid FeatureCollection");var l=o.store.createRenderBatch(),d=o.store.getAllIds().slice(),h=i.add(a),g=new Z(h);return(d=d.filter(function(p){return!g.has(p)})).length&&i.delete(d),l(),h},i.add=function(a){var l=JSON.parse(JSON.stringify(gr(a))).features.map(function(d){if(d.id=d.id||Nt(),d.geometry===null)throw new Error("Invalid geometry: null");if(o.store.get(d.id)===void 0||o.store.get(d.id).type!==d.geometry.type){var h=Nr[d.geometry.type];if(h===void 0)throw new Error("Invalid geometry type: "+d.geometry.type+".");var g=new h(o,d);o.store.add(g)}else{var p=o.store.get(d.id);p.properties=d.properties,_n(p.properties,d.properties)||o.store.featureChanged(p.id),_n(p.getCoordinates(),d.geometry.coordinates)||p.incomingCoords(d.geometry.coordinates)}return d.id});return o.store.render(),l},i.get=function(a){var l=o.store.get(a);if(l)return l.toGeoJSON()},i.getAll=function(){return{type:m.FEATURE_COLLECTION,features:o.store.getAll().map(function(a){return a.toGeoJSON()})}},i.delete=function(a){return o.store.delete(a,{silent:!0}),i.getMode()!==T.DIRECT_SELECT||o.store.getSelectedIds().length?o.store.render():o.events.changeMode(T.SIMPLE_SELECT,void 0,{silent:!0}),i},i.deleteAll=function(){return o.store.delete(o.store.getAllIds(),{silent:!0}),i.getMode()===T.DIRECT_SELECT?o.events.changeMode(T.SIMPLE_SELECT,void 0,{silent:!0}):o.store.render(),i},i.changeMode=function(a,l){return l===void 0&&(l={}),a===T.SIMPLE_SELECT&&i.getMode()===T.SIMPLE_SELECT?(bn(l.featureIds||[],o.store.getSelectedIds())||(o.store.setSelected(l.featureIds,{silent:!0}),o.store.render()),i):(a===T.DIRECT_SELECT&&i.getMode()===T.DIRECT_SELECT&&l.featureId===o.store.getSelectedIds()[0]||o.events.changeMode(a,l,{silent:!0}),i)},i.getMode=function(){return o.events.getMode()},i.trash=function(){return o.events.trash({silent:!0}),i},i.combineFeatures=function(){return o.events.combineFeatures({silent:!0}),i},i.uncombineFeatures=function(){return o.events.uncombineFeatures({silent:!0}),i},i.setFeatureProperty=function(a,l,d){return o.store.setFeatureProperty(a,l,d),i},i}(n,t),n.api=t;var r=lr(n);return t.onAdd=r.onAdd,t.onRemove=r.onRemove,t.types=Y,t.options=e,t};function at(e){Pr(e,this)}return at.modes=vn,at.constants=er,at.lib=Ar,at})})(Zn.__module);var oo=Zn.__module.exports;const io=Re.getDefaultExportFromCjs(oo);module.exports=io;
|
|
2
2
|
//# sourceMappingURL=index.cjs14.js.map
|
package/dist/index.cjs15.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("react"),a=require("./index.cjs68.js");require("./index.cjs69.js");require("./index.cjs70.js");require("./index.cjs71.js");require("./index.cjs72.js");require("./index.cjs73.js");const i=require("./index.cjs74.js");require("./index.cjs75.js");const c=require("./index.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("react"),a=require("./index.cjs68.js");require("./index.cjs69.js");require("./index.cjs70.js");require("./index.cjs71.js");require("./index.cjs72.js");require("./index.cjs73.js");const i=require("./index.cjs74.js");require("./index.cjs75.js");const c=require("./index.cjs80.js"),s=require("./index.cjs81.js"),l=require("./index.cjs76.js");function f(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const p=f(u);function q(){return l.useMap()}const d=Promise.resolve().then(()=>require("./index.cjs79.js")).then(e=>e.index),o=p.forwardRef(function(t,r){return a.default(t,r,d)}),g=i,M=c,b=s;exports.Layer=M;exports.Map=o;exports.NavigationControl=g;exports.Source=b;exports.default=o;exports.useMap=q;
|
|
2
2
|
//# sourceMappingURL=index.cjs15.js.map
|
package/dist/index.cjs184.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const c=require("./index.cjs57.js"),u=require("./index.cjs55.js");function x(t,e){e===void 0&&(e={});var r=c(t),i=(r[0]+r[2])/2,n=(r[1]+r[3])/2;return u.point([i,n],e.properties,e)}module.exports=x;
|
|
2
2
|
//# sourceMappingURL=index.cjs184.js.map
|
package/dist/index.cjs184.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs184.js","sources":["../../../node_modules/react-map-gl/dist/esm/mapbox/mapbox.js"],"sourcesContent":["import { transformToViewState, applyViewStateToTransform, cloneTransform, syncProjection } from '../utils/transform';\nimport { normalizeStyle } from '../utils/style-utils';\nimport { deepEqual } from '../utils/deep-equal';\nconst DEFAULT_STYLE = { version: 8, sources: {}, layers: [] };\nconst pointerEvents = {\n mousedown: 'onMouseDown',\n mouseup: 'onMouseUp',\n mouseover: 'onMouseOver',\n mousemove: 'onMouseMove',\n click: 'onClick',\n dblclick: 'onDblClick',\n mouseenter: 'onMouseEnter',\n mouseleave: 'onMouseLeave',\n mouseout: 'onMouseOut',\n contextmenu: 'onContextMenu',\n touchstart: 'onTouchStart',\n touchend: 'onTouchEnd',\n touchmove: 'onTouchMove',\n touchcancel: 'onTouchCancel'\n};\nconst cameraEvents = {\n movestart: 'onMoveStart',\n move: 'onMove',\n moveend: 'onMoveEnd',\n dragstart: 'onDragStart',\n drag: 'onDrag',\n dragend: 'onDragEnd',\n zoomstart: 'onZoomStart',\n zoom: 'onZoom',\n zoomend: 'onZoomEnd',\n rotatestart: 'onRotateStart',\n rotate: 'onRotate',\n rotateend: 'onRotateEnd',\n pitchstart: 'onPitchStart',\n pitch: 'onPitch',\n pitchend: 'onPitchEnd'\n};\nconst otherEvents = {\n wheel: 'onWheel',\n boxzoomstart: 'onBoxZoomStart',\n boxzoomend: 'onBoxZoomEnd',\n boxzoomcancel: 'onBoxZoomCancel',\n resize: 'onResize',\n load: 'onLoad',\n render: 'onRender',\n idle: 'onIdle',\n remove: 'onRemove',\n data: 'onData',\n styledata: 'onStyleData',\n sourcedata: 'onSourceData',\n error: 'onError'\n};\nconst settingNames = [\n 'minZoom',\n 'maxZoom',\n 'minPitch',\n 'maxPitch',\n 'maxBounds',\n 'projection',\n 'renderWorldCopies'\n];\nconst handlerNames = [\n 'scrollZoom',\n 'boxZoom',\n 'dragRotate',\n 'dragPan',\n 'keyboard',\n 'doubleClickZoom',\n 'touchZoomRotate',\n 'touchPitch'\n];\n/**\n * A wrapper for mapbox-gl's Map class\n */\nexport default class Mapbox {\n constructor(MapClass, props, container) {\n // mapboxgl.Map instance\n this._map = null;\n // Internal states\n this._internalUpdate = false;\n this._inRender = false;\n this._hoveredFeatures = null;\n this._deferredEvents = {\n move: false,\n zoom: false,\n pitch: false,\n rotate: false\n };\n this._onEvent = (e) => {\n // @ts-ignore\n const cb = this.props[otherEvents[e.type]];\n if (cb) {\n cb(e);\n }\n else if (e.type === 'error') {\n console.error(e.error); // eslint-disable-line\n }\n };\n this._onPointerEvent = (e) => {\n if (e.type === 'mousemove' || e.type === 'mouseout') {\n this._updateHover(e);\n }\n // @ts-ignore\n const cb = this.props[pointerEvents[e.type]];\n if (cb) {\n if (this.props.interactiveLayerIds && e.type !== 'mouseover' && e.type !== 'mouseout') {\n e.features = this._hoveredFeatures || this._queryRenderedFeatures(e.point);\n }\n cb(e);\n delete e.features;\n }\n };\n this._onCameraEvent = (e) => {\n if (!this._internalUpdate) {\n // @ts-ignore\n const cb = this.props[cameraEvents[e.type]];\n if (cb) {\n cb(e);\n }\n }\n if (e.type in this._deferredEvents) {\n this._deferredEvents[e.type] = false;\n }\n };\n this._MapClass = MapClass;\n this.props = props;\n this._initialize(container);\n }\n get map() {\n return this._map;\n }\n get transform() {\n return this._renderTransform;\n }\n setProps(props) {\n const oldProps = this.props;\n this.props = props;\n const settingsChanged = this._updateSettings(props, oldProps);\n if (settingsChanged) {\n this._createShadowTransform(this._map);\n }\n const sizeChanged = this._updateSize(props);\n const viewStateChanged = this._updateViewState(props, true);\n this._updateStyle(props, oldProps);\n this._updateStyleComponents(props, oldProps);\n this._updateHandlers(props, oldProps);\n // If 1) view state has changed to match props and\n // 2) the props change is not triggered by map events,\n // it's driven by an external state change. Redraw immediately\n if (settingsChanged || sizeChanged || (viewStateChanged && !this._map.isMoving())) {\n this.redraw();\n }\n }\n static reuse(props, container) {\n const that = Mapbox.savedMaps.pop();\n if (!that) {\n return null;\n }\n const map = that.map;\n // When reusing the saved map, we need to reparent the map(canvas) and other child nodes\n // intoto the new container from the props.\n // Step 1: reparenting child nodes from old container to new container\n const oldContainer = map.getContainer();\n container.className = oldContainer.className;\n while (oldContainer.childNodes.length > 0) {\n container.appendChild(oldContainer.childNodes[0]);\n }\n // Step 2: replace the internal container with new container from the react component\n // @ts-ignore\n map._container = container;\n // With maplibre-gl as mapLib, map uses ResizeObserver to observe when its container resizes.\n // When reusing the saved map, we need to disconnect the observer and observe the new container.\n // Step 3: telling the ResizeObserver to disconnect and observe the new container\n // @ts-ignore\n const resizeObserver = map._resizeObserver;\n if (resizeObserver) {\n resizeObserver.disconnect();\n resizeObserver.observe(container);\n }\n // Step 4: apply new props\n that.setProps({ ...props, styleDiffing: false });\n map.resize();\n const { initialViewState } = props;\n if (initialViewState) {\n if (initialViewState.bounds) {\n map.fitBounds(initialViewState.bounds, { ...initialViewState.fitBoundsOptions, duration: 0 });\n }\n else {\n that._updateViewState(initialViewState, false);\n }\n }\n // Simulate load event\n if (map.isStyleLoaded()) {\n map.fire('load');\n }\n else {\n map.once('styledata', () => map.fire('load'));\n }\n // Force reload\n // @ts-ignore\n map._update();\n return that;\n }\n /* eslint-disable complexity,max-statements */\n _initialize(container) {\n const { props } = this;\n const { mapStyle = DEFAULT_STYLE } = props;\n const mapOptions = {\n ...props,\n ...props.initialViewState,\n accessToken: props.mapboxAccessToken || getAccessTokenFromEnv() || null,\n container,\n style: normalizeStyle(mapStyle)\n };\n const viewState = mapOptions.initialViewState || mapOptions.viewState || mapOptions;\n Object.assign(mapOptions, {\n center: [viewState.longitude || 0, viewState.latitude || 0],\n zoom: viewState.zoom || 0,\n pitch: viewState.pitch || 0,\n bearing: viewState.bearing || 0\n });\n if (props.gl) {\n // eslint-disable-next-line\n const getContext = HTMLCanvasElement.prototype.getContext;\n // Hijack canvas.getContext to return our own WebGLContext\n // This will be called inside the mapboxgl.Map constructor\n // @ts-expect-error\n HTMLCanvasElement.prototype.getContext = () => {\n // Unhijack immediately\n HTMLCanvasElement.prototype.getContext = getContext;\n return props.gl;\n };\n }\n const map = new this._MapClass(mapOptions);\n // Props that are not part of constructor options\n if (viewState.padding) {\n map.setPadding(viewState.padding);\n }\n if (props.cursor) {\n map.getCanvas().style.cursor = props.cursor;\n }\n this._createShadowTransform(map);\n // Hack\n // Insert code into map's render cycle\n const renderMap = map._render;\n map._render = (arg) => {\n this._inRender = true;\n renderMap.call(map, arg);\n this._inRender = false;\n };\n const runRenderTaskQueue = map._renderTaskQueue.run;\n map._renderTaskQueue.run = (arg) => {\n runRenderTaskQueue.call(map._renderTaskQueue, arg);\n this._onBeforeRepaint();\n };\n map.on('render', () => this._onAfterRepaint());\n // Insert code into map's event pipeline\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const fireEvent = map.fire;\n map.fire = this._fireEvent.bind(this, fireEvent);\n // add listeners\n map.on('resize', () => {\n this._renderTransform.resize(map.transform.width, map.transform.height);\n });\n map.on('styledata', () => {\n this._updateStyleComponents(this.props, {});\n // Projection can be set in stylesheet\n syncProjection(map.transform, this._renderTransform);\n });\n map.on('sourcedata', () => this._updateStyleComponents(this.props, {}));\n for (const eventName in pointerEvents) {\n map.on(eventName, this._onPointerEvent);\n }\n for (const eventName in cameraEvents) {\n map.on(eventName, this._onCameraEvent);\n }\n for (const eventName in otherEvents) {\n map.on(eventName, this._onEvent);\n }\n this._map = map;\n }\n /* eslint-enable complexity,max-statements */\n recycle() {\n // Clean up unnecessary elements before storing for reuse.\n const container = this.map.getContainer();\n const children = container.querySelector('[mapboxgl-children]');\n children === null || children === void 0 ? void 0 : children.remove();\n Mapbox.savedMaps.push(this);\n }\n destroy() {\n this._map.remove();\n }\n // Force redraw the map now. Typically resize() and jumpTo() is reflected in the next\n // render cycle, which is managed by Mapbox's animation loop.\n // This removes the synchronization issue caused by requestAnimationFrame.\n redraw() {\n const map = this._map;\n // map._render will throw error if style does not exist\n // https://github.com/mapbox/mapbox-gl-js/blob/fb9fc316da14e99ff4368f3e4faa3888fb43c513\n // /src/ui/map.js#L1834\n if (!this._inRender && map.style) {\n // cancel the scheduled update\n if (map._frame) {\n map._frame.cancel();\n map._frame = null;\n }\n // the order is important - render() may schedule another update\n map._render();\n }\n }\n _createShadowTransform(map) {\n const renderTransform = cloneTransform(map.transform);\n map.painter.transform = renderTransform;\n this._renderTransform = renderTransform;\n }\n /* Trigger map resize if size is controlled\n @param {object} nextProps\n @returns {bool} true if size has changed\n */\n _updateSize(nextProps) {\n // Check if size is controlled\n const { viewState } = nextProps;\n if (viewState) {\n const map = this._map;\n if (viewState.width !== map.transform.width || viewState.height !== map.transform.height) {\n map.resize();\n return true;\n }\n }\n return false;\n }\n // Adapted from map.jumpTo\n /* Update camera to match props\n @param {object} nextProps\n @param {bool} triggerEvents - should fire camera events\n @returns {bool} true if anything is changed\n */\n _updateViewState(nextProps, triggerEvents) {\n if (this._internalUpdate) {\n return false;\n }\n const map = this._map;\n const tr = this._renderTransform;\n // Take a snapshot of the transform before mutation\n const { zoom, pitch, bearing } = tr;\n const isMoving = map.isMoving();\n if (isMoving) {\n // All movement of the camera is done relative to the sea level\n tr.cameraElevationReference = 'sea';\n }\n const changed = applyViewStateToTransform(tr, {\n ...transformToViewState(map.transform),\n ...nextProps\n });\n if (isMoving) {\n // Reset camera reference\n tr.cameraElevationReference = 'ground';\n }\n if (changed && triggerEvents) {\n const deferredEvents = this._deferredEvents;\n // Delay DOM control updates to the next render cycle\n deferredEvents.move = true;\n deferredEvents.zoom || (deferredEvents.zoom = zoom !== tr.zoom);\n deferredEvents.rotate || (deferredEvents.rotate = bearing !== tr.bearing);\n deferredEvents.pitch || (deferredEvents.pitch = pitch !== tr.pitch);\n }\n // Avoid manipulating the real transform when interaction/animation is ongoing\n // as it would interfere with Mapbox's handlers\n if (!isMoving) {\n applyViewStateToTransform(map.transform, nextProps);\n }\n return changed;\n }\n /* Update camera constraints and projection settings to match props\n @param {object} nextProps\n @param {object} currProps\n @returns {bool} true if anything is changed\n */\n _updateSettings(nextProps, currProps) {\n const map = this._map;\n let changed = false;\n for (const propName of settingNames) {\n if (propName in nextProps && !deepEqual(nextProps[propName], currProps[propName])) {\n changed = true;\n const setter = map[`set${propName[0].toUpperCase()}${propName.slice(1)}`];\n setter === null || setter === void 0 ? void 0 : setter.call(map, nextProps[propName]);\n }\n }\n return changed;\n }\n /* Update map style to match props\n @param {object} nextProps\n @param {object} currProps\n @returns {bool} true if style is changed\n */\n _updateStyle(nextProps, currProps) {\n if (nextProps.cursor !== currProps.cursor) {\n this._map.getCanvas().style.cursor = nextProps.cursor || '';\n }\n if (nextProps.mapStyle !== currProps.mapStyle) {\n const { mapStyle = DEFAULT_STYLE, styleDiffing = true } = nextProps;\n const options = {\n diff: styleDiffing\n };\n if ('localIdeographFontFamily' in nextProps) {\n // @ts-ignore Mapbox specific prop\n options.localIdeographFontFamily = nextProps.localIdeographFontFamily;\n }\n this._map.setStyle(normalizeStyle(mapStyle), options);\n return true;\n }\n return false;\n }\n /* Update fog, light and terrain to match props\n @param {object} nextProps\n @param {object} currProps\n @returns {bool} true if anything is changed\n */\n _updateStyleComponents(nextProps, currProps) {\n const map = this._map;\n let changed = false;\n if (map.isStyleLoaded()) {\n if ('light' in nextProps && map.setLight && !deepEqual(nextProps.light, currProps.light)) {\n changed = true;\n map.setLight(nextProps.light);\n }\n if ('fog' in nextProps && map.setFog && !deepEqual(nextProps.fog, currProps.fog)) {\n changed = true;\n map.setFog(nextProps.fog);\n }\n if ('terrain' in nextProps &&\n map.setTerrain &&\n !deepEqual(nextProps.terrain, currProps.terrain)) {\n if (!nextProps.terrain || map.getSource(nextProps.terrain.source)) {\n changed = true;\n map.setTerrain(nextProps.terrain);\n }\n }\n }\n return changed;\n }\n /* Update interaction handlers to match props\n @param {object} nextProps\n @param {object} currProps\n @returns {bool} true if anything is changed\n */\n _updateHandlers(nextProps, currProps) {\n var _a, _b;\n const map = this._map;\n let changed = false;\n for (const propName of handlerNames) {\n const newValue = (_a = nextProps[propName]) !== null && _a !== void 0 ? _a : true;\n const oldValue = (_b = currProps[propName]) !== null && _b !== void 0 ? _b : true;\n if (!deepEqual(newValue, oldValue)) {\n changed = true;\n if (newValue) {\n map[propName].enable(newValue);\n }\n else {\n map[propName].disable();\n }\n }\n }\n return changed;\n }\n _queryRenderedFeatures(point) {\n const map = this._map;\n const tr = map.transform;\n const { interactiveLayerIds = [] } = this.props;\n try {\n map.transform = this._renderTransform;\n return map.queryRenderedFeatures(point, {\n layers: interactiveLayerIds.filter(map.getLayer.bind(map))\n });\n }\n catch (_a) {\n // May fail if style is not loaded\n return [];\n }\n finally {\n map.transform = tr;\n }\n }\n _updateHover(e) {\n var _a;\n const { props } = this;\n const shouldTrackHoveredFeatures = props.interactiveLayerIds && (props.onMouseMove || props.onMouseEnter || props.onMouseLeave);\n if (shouldTrackHoveredFeatures) {\n const eventType = e.type;\n const wasHovering = ((_a = this._hoveredFeatures) === null || _a === void 0 ? void 0 : _a.length) > 0;\n const features = this._queryRenderedFeatures(e.point);\n const isHovering = features.length > 0;\n if (!isHovering && wasHovering) {\n e.type = 'mouseleave';\n this._onPointerEvent(e);\n }\n this._hoveredFeatures = features;\n if (isHovering && !wasHovering) {\n e.type = 'mouseenter';\n this._onPointerEvent(e);\n }\n e.type = eventType;\n }\n else {\n this._hoveredFeatures = null;\n }\n }\n _fireEvent(baseFire, event, properties) {\n const map = this._map;\n const tr = map.transform;\n const eventType = typeof event === 'string' ? event : event.type;\n if (eventType === 'move') {\n this._updateViewState(this.props, false);\n }\n if (eventType in cameraEvents) {\n if (typeof event === 'object') {\n event.viewState = transformToViewState(tr);\n }\n if (this._map.isMoving()) {\n // Replace map.transform with ours during the callbacks\n map.transform = this._renderTransform;\n baseFire.call(map, event, properties);\n map.transform = tr;\n return map;\n }\n }\n baseFire.call(map, event, properties);\n return map;\n }\n // All camera manipulations are complete, ready to repaint\n _onBeforeRepaint() {\n const map = this._map;\n // If there are camera changes driven by props, invoke camera events so that DOM controls are synced\n this._internalUpdate = true;\n for (const eventType in this._deferredEvents) {\n if (this._deferredEvents[eventType]) {\n map.fire(eventType);\n }\n }\n this._internalUpdate = false;\n const tr = this._map.transform;\n // Make sure camera matches the current props\n map.transform = this._renderTransform;\n this._onAfterRepaint = () => {\n // Mapbox transitions between non-mercator projection and mercator during render time\n // Copy it back to the other\n syncProjection(this._renderTransform, tr);\n // Restores camera state before render/load events are fired\n map.transform = tr;\n };\n }\n}\nMapbox.savedMaps = [];\n/**\n * Access token can be provided via one of:\n * mapboxAccessToken prop\n * access_token query parameter\n * MapboxAccessToken environment variable\n * REACT_APP_MAPBOX_ACCESS_TOKEN environment variable\n * @returns access token\n */\nfunction getAccessTokenFromEnv() {\n let accessToken = null;\n /* global location, process */\n if (typeof location !== 'undefined') {\n const match = /access_token=([^&\\/]*)/.exec(location.search);\n accessToken = match && match[1];\n }\n // Note: This depends on bundler plugins (e.g. webpack) importing environment correctly\n try {\n accessToken = accessToken || process.env.MapboxAccessToken;\n }\n catch (_a) {\n // ignore\n }\n try {\n accessToken = accessToken || process.env.REACT_APP_MAPBOX_ACCESS_TOKEN;\n }\n catch (_b) {\n // ignore\n }\n return accessToken;\n}\n//# sourceMappingURL=mapbox.js.map"],"names":["DEFAULT_STYLE","pointerEvents","cameraEvents","otherEvents","settingNames","handlerNames","Mapbox","MapClass","props","container","e","cb","oldProps","settingsChanged","sizeChanged","viewStateChanged","that","map","oldContainer","resizeObserver","initialViewState","mapStyle","mapOptions","getAccessTokenFromEnv","normalizeStyle","viewState","getContext","renderMap","arg","runRenderTaskQueue","fireEvent","syncProjection","eventName","children","renderTransform","cloneTransform","nextProps","triggerEvents","tr","zoom","pitch","bearing","isMoving","changed","applyViewStateToTransform","transformToViewState","deferredEvents","currProps","propName","deepEqual","setter","styleDiffing","options","_a","_b","newValue","oldValue","point","interactiveLayerIds","eventType","wasHovering","features","isHovering","baseFire","event","properties","accessToken","match"],"mappings":"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","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index.cjs184.js","sources":["../../../node_modules/@turf/center/dist/es/index.js"],"sourcesContent":["import bbox from \"@turf/bbox\";\nimport { point, } from \"@turf/helpers\";\n/**\n * Takes a {@link Feature} or {@link FeatureCollection} and returns the absolute center point of all features.\n *\n * @name center\n * @param {GeoJSON} geojson GeoJSON to be centered\n * @param {Object} [options={}] Optional parameters\n * @param {Object} [options.properties={}] Translate GeoJSON Properties to Point\n * @param {Object} [options.bbox={}] Translate GeoJSON BBox to Point\n * @param {Object} [options.id={}] Translate GeoJSON Id to Point\n * @returns {Feature<Point>} a Point feature at the absolute center point of all input features\n * @example\n * var features = turf.points([\n * [-97.522259, 35.4691],\n * [-97.502754, 35.463455],\n * [-97.508269, 35.463245]\n * ]);\n *\n * var center = turf.center(features);\n *\n * //addToMap\n * var addToMap = [features, center]\n * center.properties['marker-size'] = 'large';\n * center.properties['marker-color'] = '#000';\n */\nfunction center(geojson, options) {\n if (options === void 0) { options = {}; }\n var ext = bbox(geojson);\n var x = (ext[0] + ext[2]) / 2;\n var y = (ext[1] + ext[3]) / 2;\n return point([x, y], options.properties, options);\n}\nexport default center;\n"],"names":["center","geojson","options","ext","bbox","x","y","point"],"mappings":"+EA0BA,SAASA,EAAOC,EAASC,EAAS,CAC1BA,IAAY,SAAUA,EAAU,CAAA,GAChC,IAAAC,EAAMC,EAAKH,CAAO,EAClBI,GAAKF,EAAI,CAAC,EAAIA,EAAI,CAAC,GAAK,EACxBG,GAAKH,EAAI,CAAC,EAAIA,EAAI,CAAC,GAAK,EAC5B,OAAOI,EAAAA,MAAM,CAACF,EAAGC,CAAC,EAAGJ,EAAQ,WAAYA,CAAO,CACpD","x_google_ignoreList":[0]}
|
package/dist/index.cjs185.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function G(e,o,r){if(e!==null)for(var t,l,a,c,u,i,s,y=0,f=0,h,p=e.type,g=p==="FeatureCollection",v=p==="Feature",w=g?e.features.length:1,C=0;C<w;C++){s=g?e.features[C].geometry:v?e.geometry:e,h=s?s.type==="GeometryCollection":!1,u=h?s.geometries.length:1;for(var b=0;b<u;b++){var n=0,M=0;if(c=h?s.geometries[b]:s,c!==null){i=c.coordinates;var P=c.type;switch(y=r&&(P==="Polygon"||P==="MultiPolygon")?1:0,P){case null:break;case"Point":if(o(i,f,C,n,M)===!1)return!1;f++,n++;break;case"LineString":case"MultiPoint":for(t=0;t<i.length;t++){if(o(i[t],f,C,n,M)===!1)return!1;f++,P==="MultiPoint"&&n++}P==="LineString"&&n++;break;case"Polygon":case"MultiLineString":for(t=0;t<i.length;t++){for(l=0;l<i[t].length-y;l++){if(o(i[t][l],f,C,n,M)===!1)return!1;f++}P==="MultiLineString"&&n++,P==="Polygon"&&M++}P==="Polygon"&&n++;break;case"MultiPolygon":for(t=0;t<i.length;t++){for(M=0,l=0;l<i[t].length;l++){for(a=0;a<i[t][l].length-y;a++){if(o(i[t][l][a],f,C,n,M)===!1)return!1;f++}M++}n++}break;case"GeometryCollection":for(t=0;t<c.geometries.length;t++)if(G(c.geometries[t],o,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function S(e,o){if(e.type==="Feature")o(e,0);else if(e.type==="FeatureCollection")for(var r=0;r<e.features.length&&o(e.features[r],r)!==!1;r++);}function E(e,o){var r,t,l,a,c,u,i,s,y,f,h=0,p=e.type==="FeatureCollection",g=e.type==="Feature",v=p?e.features.length:1;for(r=0;r<v;r++){for(u=p?e.features[r].geometry:g?e.geometry:e,s=p?e.features[r].properties:g?e.properties:{},y=p?e.features[r].bbox:g?e.bbox:void 0,f=p?e.features[r].id:g?e.id:void 0,i=u?u.type==="GeometryCollection":!1,c=i?u.geometries.length:1,l=0;l<c;l++){if(a=i?u.geometries[l]:u,a===null){if(o(null,h,s,y,f)===!1)return!1;continue}switch(a.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(o(a,h,s,y,f)===!1)return!1;break}case"GeometryCollection":{for(t=0;t<a.geometries.length;t++)if(o(a.geometries[t],h,s,y,f)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}h++}}exports.coordEach=G;exports.featureEach=S;exports.geomEach=E;
|
|
2
2
|
//# sourceMappingURL=index.cjs185.js.map
|