!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ol=e():t.ol=e()}(window,(function(){return function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=24)}([function(t,e,r){"use strict";(function(t,i){r.d(e,"a",(function(){return J})),r.d(e,"b",(function(){return _r})),r.d(e,"c",(function(){return Zr})),r.d(e,"d",(function(){return ur})),r.d(e,"e",(function(){return Kr})),r.d(e,"f",(function(){return n}));var n={$version:8,$root:{version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},name:{type:"string",doc:"A human-readable name for the style.",example:"Bright"},metadata:{type:"*",doc:"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},center:{type:"array",value:"number",doc:"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:[-73.9749,40.7736]},zoom:{type:"number",doc:"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:12.5},bearing:{type:"number",default:0,period:360,units:"degrees",doc:'Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).',example:29},pitch:{type:"number",default:0,units:"degrees",doc:"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:50},light:{type:"light",doc:"The global light source.",example:{anchor:"viewport",color:"white",intensity:.4}},sources:{required:!0,type:"sources",doc:"Data source specifications.",example:{"mapbox-streets":{type:"vector",url:"mapbox://mapbox.mapbox-streets-v6"}}},sprite:{type:"string",doc:"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://sprites/mapbox/bright-v8"},glyphs:{type:"string",doc:"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},transition:{type:"transition",doc:"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's `transition` property.",example:{duration:300,delay:0}},layers:{required:!0,type:"array",value:"layer",doc:"Layers will be drawn in the order of this array.",example:[{id:"water",source:"mapbox-streets","source-layer":"water",type:"fill",paint:{"fill-color":"#00ffff"}}]}},sources:{"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{doc:"A vector tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`. If specified as a string for a vector tile source, the same property is used across all its source layers."},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster:{type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A RGB-encoded raster DEM source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},encoding:{type:"enum",values:{terrarium:{doc:"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},mapbox:{doc:"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},default:"mapbox",doc:"The encoding used by this source. Mapbox Terrain RGB is used by default"},"*":{type:"*",doc:"Other keys to configure the data source."}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\n * `cluster` Is `true` if the point is a cluster \n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\n * `point_count` Number of original points grouped into this cluster\n * `point_count_abbreviated` An abbreviated point count"},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered)."},clusterProperties:{type:"*",doc:'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\n\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\n\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`'},lineMetrics:{type:"boolean",default:!1,doc:"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},generateId:{type:"boolean",default:!1,doc:"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`."}},source_video:{type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_image:{type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},layer:{id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},filter:{type:"filter",doc:"A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions."},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"},"data-driven styling":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},"property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{doc:"The label is placed at the point where the geometry is located."},line:{doc:"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{doc:"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},default:"point",doc:"Label placement relative to its geometry.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0",macos:"0.10.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.","sdk-support":{"basic functionality":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"},"data-driven styling":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"viewport-y":{doc:"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},source:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}},default:"auto",doc:"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.","sdk-support":{"basic functionality":{js:"0.49.0",android:"6.6.0",ios:"4.5.0",macos:"0.12.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},viewport:{doc:"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",doc:"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{doc:"The icon is displayed at its intrinsic aspect ratio."},width:{doc:"The icon is scaled in the x-dimension to fit the width of the text."},height:{doc:"The icon is scaled in the y-dimension to fit the height of the text."},both:{doc:"The icon is scaled in both x- and y-dimensions."}},default:"none",doc:"Scales the icon to fit around the associated text.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"stretchable icons":{js:"1.6.0",android:"9.2.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",doc:"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",doc:"Name of image in sprite to use for drawing an image background.",tokens:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the icon bounding box used for detecting symbol collisions.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{doc:"The center of the icon is placed closest to the anchor."},left:{doc:"The left side of the icon is placed closest to the anchor."},right:{doc:"The right side of the icon is placed closest to the anchor."},top:{doc:"The top of the icon is placed closest to the anchor."},bottom:{doc:"The bottom of the icon is placed closest to the anchor."},"top-left":{doc:"The top left corner of the icon is placed closest to the anchor."},"top-right":{doc:"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the icon is placed closest to the anchor."}},default:"center",doc:"Part of the icon placed closest to the anchor.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{doc:"The icon is aligned to the plane of the map."},viewport:{doc:"The icon is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `icon-rotation-alignment`."}},default:"auto",doc:"Orientation of icon when map is pitched.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{doc:"The text is aligned to the plane of the map."},viewport:{doc:"The text is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `text-rotation-alignment`."}},default:"auto",doc:"Orientation of text when map is pitched.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},viewport:{doc:"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,doc:"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],doc:"Font stack to use for displaying text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",doc:"Font size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",doc:"The maximum line width for text wrapping.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",doc:"Text leading value for multi-line text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",doc:"Text tracking amount.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{doc:"The text is aligned towards the anchor position."},left:{doc:"The text is aligned to the left."},center:{doc:"The text is centered."},right:{doc:"The text is aligned to the right."}},default:"center",doc:"Text justification options.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,doc:"Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},requires:["text-field",{"symbol-placement":["point"]}],doc:"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},default:"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{doc:"If a text's language supports horizontal writing mode, symbols with point placement would be laid out horizontally."},vertical:{doc:"If a text's language supports vertical writing mode, symbols with point placement would be laid out vertically."}},doc:"The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. The order of elements in an array define priority order for the placement of an orientation variant.",requires:["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{js:"1.3.0",android:"8.3.0",ios:"5.3.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the text clockwise.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{doc:"The text is not altered."},uppercase:{doc:"Forces all letters to be displayed in uppercase."},lowercase:{doc:"Forces all letters to be displayed in lowercase."}},default:"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},filter_operator:{type:"enum",values:{"==":{doc:'`["==", key, value]` equality: `feature[key] = value`'},"!=":{doc:'`["!=", key, value]` inequality: `feature[key] ≠ value`'},">":{doc:'`[">", key, value]` greater than: `feature[key] > value`'},">=":{doc:'`[">=", key, value]` greater than or equal: `feature[key] ≥ value`'},"<":{doc:'`["<", key, value]` less than: `feature[key] < value`'},"<=":{doc:'`["<=", key, value]` less than or equal: `feature[key] ≤ value`'},in:{doc:'`["in", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`'},"!in":{doc:'`["!in", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`'},all:{doc:'`["all", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`'},any:{doc:'`["any", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`'},none:{doc:'`["none", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`'},has:{doc:'`["has", key]` `feature[key]` exists'},"!has":{doc:'`["!has", key]` `feature[key]` does not exist'},within:{doc:'`["within", object]` feature geometry is within object geometry'}},doc:"The filter operator."},geometry_type:{type:"enum",values:{Point:{doc:"Filter to point geometries."},LineString:{doc:"Filter to line geometries."},Polygon:{doc:"Filter to polygon geometries."}},doc:"The geometry type for the filter to select."},function:{expression:{type:"expression",doc:"An expression."},stops:{type:"array",doc:"An array of stops.",value:"function_stop"},base:{type:"number",default:1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a feature property to use as the function input.",default:"$zoom"},type:{type:"enum",values:{identity:{doc:"Return the input value as the output value."},exponential:{doc:"Generate an output by interpolating between stops just less than and just greater than the function input."},interval:{doc:"Return the output value of the stop just less than the function input."},categorical:{doc:"Return the output value of the stop equal to the function input."}},doc:"The interpolation strategy to use in function evaluation.",default:"exponential"},colorSpace:{type:"enum",values:{rgb:{doc:"Use the RGB color space to interpolate color values"},lab:{doc:"Use the LAB color space to interpolate color values."},hcl:{doc:"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},doc:"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",default:"rgb"},default:{type:"*",required:!1,doc:"A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:\n* In categorical functions, when the feature value does not match any of the stop domain values.\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\nIf no default is provided, the style property's default is used in these circumstances."}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2,doc:"Zoom level and value pair."},expression:{type:"array",value:"*",minimum:1,doc:"An expression defines a function that can be used for data-driven style properties or feature filters."},expression_name:{doc:"",type:"enum",values:{let:{doc:'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},var:{doc:'References variable bound using "let".',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},literal:{doc:"Provides a literal array or object value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},array:{doc:"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},at:{doc:"Retrieves an item from an array.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},in:{doc:"Determines whether an item exists in an array or a substring exists in a string.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.6.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"index-of":{doc:"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},slice:{doc:"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},case:{doc:"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},match:{doc:'Selects the output whose label value matches the input value, or the fallback value if no match is found. The input can be any expression (e.g. `["get", "building_type"]`). Each label must be either:\n - a single literal value; or\n - an array of literal values, whose values must be all strings or all numbers (e.g. `[100, 101]` or `["c", "b"]`). The input matches if any of the values in the array matches, similar to the `"in"` operator.\nEach label must be unique. If the input type does not match the type of the labels, the result will be the fallback value.',group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first non-null value is obtained, and returns that value.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},step:{doc:'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},interpolate:{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array`, or `color`.\n\nInterpolation types:\n- `["linear"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\n- `["exponential", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\n- `["cubic-bezier", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"interpolate-hcl":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},"interpolate-lab":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},ln2:{doc:"Returns mathematical constant ln(2).",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pi:{doc:"Returns the mathematical constant pi.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},e:{doc:"Returns the mathematical constant e.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},typeof:{doc:"Returns a string describing the type of the given value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},string:{doc:"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},number:{doc:"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},boolean:{doc:"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},object:{doc:"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},collator:{doc:"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",group:"Types","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},format:{doc:'Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\'image\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\n- `"text-font"`: Overrides the font stack specified by the root layout property.\n- `"text-color"`: Overrides the color specified by the root paint property.\n- `"font-scale"`: Applies a scaling factor on `text-size` as specified by the root layout property.',group:"Types","sdk-support":{"basic functionality":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-font":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"font-scale":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-color":{js:"1.3.0",android:"7.3.0",ios:"4.10.0",macos:"0.14.0"},image:{js:"1.6.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},image:{doc:"Returns an `image` type for use in `icon-image`, `*-pattern` entries and as a section in the `format` expression. If set, the `image` argument will check that the requested image exists in the style and will return either the resolved image name or `null`, depending on whether or not the image is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `image` argument.",group:"Types","sdk-support":{"basic functionality":{js:"1.4.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},"number-format":{doc:"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",group:"Types","sdk-support":{"basic functionality":{js:"0.54.0"}}},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a boolean, the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a color, it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-number":{doc:'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-boolean":{doc:"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-rgba":{doc:"Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-color":{doc:"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgb:{doc:"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgba:{doc:"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},get:{doc:"Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns null if the requested property is missing.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},has:{doc:"Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},length:{doc:"Gets the length of an array or string.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},properties:{doc:'Gets the feature properties object. Note that in some cases, it may be more efficient to use ["get", "property_name"] directly.',group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"feature-state":{doc:"Retrieves a property value from the current feature's state. Returns null if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.46.0"}}},"geometry-type":{doc:"Gets the feature's geometry type: `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},id:{doc:"Gets the feature's id, if it has one.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},zoom:{doc:'Gets the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.',group:"Zoom","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"heatmap-density":{doc:"Gets the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",group:"Heatmap","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"line-progress":{doc:"Gets the progress along a gradient line. Can only be used in the `line-gradient` property.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.6.0",macos:"0.12.0"}}},accumulated:{doc:"Gets the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.53.0"}}},"+":{doc:"Returns the sum of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"*":{doc:"Returns the product of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"-":{doc:"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"/":{doc:"Returns the result of floating point division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"%":{doc:"Returns the remainder after integer division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"^":{doc:"Returns the result of raising the first input to the power specified by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sqrt:{doc:"Returns the square root of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log10:{doc:"Returns the base-ten logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ln:{doc:"Returns the natural logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log2:{doc:"Returns the base-two logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sin:{doc:"Returns the sine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},cos:{doc:"Returns the cosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},tan:{doc:"Returns the tangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},asin:{doc:"Returns the arcsine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},acos:{doc:"Returns the arccosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},atan:{doc:"Returns the arctangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},min:{doc:"Returns the minimum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},max:{doc:"Returns the maximum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},round:{doc:'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.',group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},abs:{doc:"Returns the absolute value of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ceil:{doc:"Returns the smallest integer that is greater than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},floor:{doc:"Returns the largest integer that is less than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},distance:{doc:"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.",group:"Math","sdk-support":{"basic functionality":{android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}}},"==":{doc:"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"!=":{doc:"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">":{doc:"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<":{doc:"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">=":{doc:"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<=":{doc:"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},all:{doc:"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},any:{doc:"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"!":{doc:"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},within:{doc:"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line's endpoint is on the boundary.",group:"Decision","sdk-support":{"basic functionality":{js:"1.9.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"is-supported-script":{doc:"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.6.0"}}},upcase:{doc:"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},downcase:{doc:"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},concat:{doc:"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"resolved-locale":{doc:"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,doc:"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",doc:"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",transition:!0,requires:[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{doc:"The fill is translated relative to the map."},viewport:{doc:"The fill is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-translate`.",default:"map",requires:["fill-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",doc:"The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{doc:"The fill extrusion is translated relative to the map."},viewport:{doc:"The fill extrusion is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-extrusion-translate`.",default:"map",requires:["fill-extrusion-translate"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude this layer.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",transition:!0,requires:["fill-extrusion-height"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,doc:"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",transition:!1,"sdk-support":{"basic functionality":{js:"0.50.0",ios:"4.7.0",macos:"0.13.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",doc:"The color with which the line will be drawn.",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{doc:"The line is translated relative to the map."},viewport:{doc:"The line is translated relative to the viewport."}},doc:"Controls the frame of reference for `line-translate`.",default:"map",requires:["line-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",doc:"Stroke thickness.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,doc:"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,doc:"The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.12.1",android:"3.0.0",ios:"3.1.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",doc:'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0",macos:"0.11.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",doc:"Circle radius.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",doc:"The fill color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{doc:"The circle is translated relative to the map."},viewport:{doc:"The circle is translated relative to the viewport."}},doc:"Controls the frame of reference for `circle-translate`.",default:"map",requires:["circle-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{doc:"Circles are scaled according to their apparent distance to the camera."},viewport:{doc:"Circles are not scaled."}},default:"map",doc:"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{doc:"The circle is aligned to the plane of the map."},viewport:{doc:"The circle is aligned to the plane of the viewport."}},default:"viewport",doc:"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",doc:"The stroke color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",doc:"The opacity of the circle's stroke.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,doc:"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,doc:"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],doc:'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.',transition:!1,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",doc:"The global opacity at which the heatmap layer will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,doc:"The color of the icon. This can only be used with sdf icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the icon's halo. Icon halos can only be used with SDF icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the icon outline.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Fade out the halo towards the outside.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{doc:"Icons are translated relative to the map."},viewport:{doc:"Icons are translated relative to the viewport."}},doc:"Controls the frame of reference for `icon-translate`.",default:"map",requires:["icon-image","icon-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the text's halo, which helps it stand out from backgrounds.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The halo's fadeout distance towards the outside.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{doc:"The text is translated relative to the map."},viewport:{doc:"The text is translated relative to the viewport."}},doc:"Controls the frame of reference for `text-translate`.",default:"map",requires:["text-field","text-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",doc:"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",doc:"The resampling/interpolation method to use for overscaling, also known as texture magnification filter",values:{linear:{doc:"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},nearest:{doc:"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},default:"linear","sdk-support":{"basic functionality":{js:"0.47.0",android:"6.3.0",ios:"4.2.0",macos:"0.9.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",doc:"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,doc:"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{doc:"The hillshade illumination is relative to the north direction."},viewport:{doc:"The hillshade illumination is relative to the top of the viewport."}},default:"viewport",doc:"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",doc:"Intensity of the hillshade",default:.5,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",doc:"The shading color of areas that face away from the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",doc:"The shading color of areas that faces towards the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",doc:"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",doc:"The color with which the background will be drawn.",transition:!0,requires:[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number",default:0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}},"property-type":{"data-driven":{type:"property-type",doc:"Property is interpolable and can be represented using a property expression."},"cross-faded":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms."},"cross-faded-data-driven":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It can be represented using a property expression."},"color-ramp":{type:"property-type",doc:"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{type:"property-type",doc:"Property is interpolable but cannot be represented using a property expression."},constant:{type:"property-type",doc:"Property is constant across all zoom levels and property values."}},promoteId:{"*":{type:"string",doc:"A name of a feature property to use as ID for feature state."}}};var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{};function s(t,e){return t(e={exports:{}},e.exports),e.exports}var a=s((function(t,e){!function(r){var i=e&&!e.nodeType&&e,n=t&&!t.nodeType&&t,s="object"==typeof o&&o;s.global!==s&&s.window!==s&&s.self!==s||(r=s);var a,l,u=2147483647,h=/^xn--/,c=/[^\x20-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,g=String.fromCharCode;function y(t){throw RangeError(d[t])}function m(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function _(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+m((t=t.replace(p,".")).split("."),e).join(".")}function v(t){for(var e,r,i=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=g((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=g(t)})).join("")}function w(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function b(t,e,r){var i=0;for(t=r?f(t/700):t>>1,t+=f(t/e);t>455;i+=36)t=f(t/35);return f(i+36*t/(t+38))}function S(t){var e,r,i,n,o,s,a,l,h,c,p,d=[],g=t.length,m=0,_=128,v=72;for((r=t.lastIndexOf("-"))<0&&(r=0),i=0;i=128&&y("not-basic"),d.push(t.charCodeAt(i));for(n=r>0?r+1:0;n=g&&y("invalid-input"),((l=(p=t.charCodeAt(n++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:36)>=36||l>f((u-m)/s))&&y("overflow"),m+=l*s,!(l<(h=a<=v?1:a>=v+26?26:a-v));a+=36)s>f(u/(c=36-h))&&y("overflow"),s*=c;v=b(m-o,e=d.length+1,0==o),f(m/e)>u-_&&y("overflow"),_+=f(m/e),m%=e,d.splice(m++,0,_)}return x(d)}function T(t){var e,r,i,n,o,s,a,l,h,c,p,d,m,_,x,S=[];for(d=(t=v(t)).length,e=128,r=0,o=72,s=0;s=e&&pf((u-r)/(m=i+1))&&y("overflow"),r+=(a-e)*m,e=a,s=0;su&&y("overflow"),p==e){for(l=r,h=36;!(l<(c=h<=o?1:h>=o+26?26:h-o));h+=36)x=l-c,_=36-c,S.push(g(w(c+x%_,0))),l=f(x/_);S.push(g(w(l,0))),o=b(r,m,i==n),r=0,++i}++r,++e}return S.join("")}if(a={version:"1.3.2",ucs2:{decode:v,encode:x},decode:S,encode:T,toASCII:function(t){return _(t,(function(t){return c.test(t)?"xn--"+T(t):t}))},toUnicode:function(t){return _(t,(function(t){return h.test(t)?S(t.slice(4).toLowerCase()):t}))}},i&&n)if(t.exports==i)n.exports=a;else for(l in a)a.hasOwnProperty(l)&&(i[l]=a[l]);else r.punycode=a}(o)})),l=function(t){return"string"==typeof t},u=function(t){return"object"==typeof t&&null!==t},h=function(t){return null===t},c=function(t){return null==t};function p(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var d=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var l=0;l=0?(u=f.substr(0,g),h=f.substr(g+1)):(u=f,h=""),c=decodeURIComponent(u),d=decodeURIComponent(h),p(n,c)?Array.isArray(n[c])?n[c].push(d):n[c]=[n[c],d]:n[c]=d}return n},f=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},g=function(t,e,r,i){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(i){var n=encodeURIComponent(f(i))+r;return Array.isArray(t[i])?t[i].map((function(t){return n+encodeURIComponent(f(t))})).join(e):n+encodeURIComponent(f(t[i]))})).join(e):i?encodeURIComponent(f(i))+r+encodeURIComponent(f(t)):""},y=s((function(t,e){e.decode=e.parse=d,e.encode=e.stringify=g}));y.decode,y.parse,y.encode,y.stringify;function m(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var _=/^([a-z0-9.+-]+:)/i,v=/:[0-9]*$/,x=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,w=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),b=["'"].concat(w),S=["%","/","?",";","#"].concat(b),T=["/","?","#"],C=/^[+a-z0-9A-Z_-]{0,63}$/,E=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,R={javascript:!0,"javascript:":!0},P={javascript:!0,"javascript:":!0},I={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function O(t,e,r){if(t&&u(t)&&t instanceof m)return t;var i=new m;return i.parse(t,e,r),i}m.prototype.parse=function(t,e,r){if(!l(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=-1!==i&&i127?F+="x":F+=M[A];if(!F.match(C)){var N=O.slice(0,m),j=O.slice(m+1),D=M.match(E);D&&(N.push(D[1]),j.unshift(D[2])),j.length&&(s="/"+j.join(".")+s),this.hostname=N.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),w||(this.hostname=a.toASCII(this.hostname));var G=this.port?":"+this.port:"",z=this.hostname||"";this.host=z+G,this.href+=this.host,w&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!R[c])for(m=0,L=b.length;m0)&&r.host.split("@"))&&(r.auth=L.shift(),r.host=r.hostname=L.shift());return r.search=t.search,r.query=t.query,h(r.pathname)&&h(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!S.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var C=S.slice(-1)[0],E=(r.host||t.host||S.length>1)&&("."===C||".."===C)||""===C,R=0,O=S.length;O>=0;O--)"."===(C=S[O])?S.splice(O,1):".."===C?(S.splice(O,1),R++):R&&(S.splice(O,1),R--);if(!w&&!b)for(;R--;R)S.unshift("..");!w||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),E&&"/"!==S.join("/").substr(-1)&&S.push("");var L,M=""===S[0]||S[0]&&"/"===S[0].charAt(0);T&&(r.hostname=r.host=M?"":S.length?S.shift():"",(L=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=L.shift(),r.host=r.hostname=L.shift()));return(w=w||r.host&&S.length)&&!M&&S.unshift(""),S.length?r.pathname=S.join("/"):(r.pathname=null,r.path=null),h(r.pathname)&&h(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},m.prototype.parseHost=function(){var t=this.host,e=v.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};function L(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var i=0,n=e;i":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var X=[A,k,N,j,D,U,G,W(z),Y];function q(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!q(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,i=X;r255?255:t}function n(t){return t<0?0:t>1?1:t}function o(t){return"%"===t[t.length-1]?i(parseFloat(t)/100*255):i(parseInt(t))}function s(t){return"%"===t[t.length-1]?n(parseFloat(t)/100):n(parseFloat(t))}function a(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,n=t.replace(/ /g,"").toLowerCase();if(n in r)return r[n].slice();if("#"===n[0])return 4===n.length?(e=parseInt(n.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===n.length&&(e=parseInt(n.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=n.indexOf("("),u=n.indexOf(")");if(-1!==l&&u+1===n.length){var h=n.substr(0,l),c=n.substr(l+1,u-(l+1)).split(","),p=1;switch(h){case"rgba":if(4!==c.length)return null;p=s(c.pop());case"rgb":return 3!==c.length?null:[o(c[0]),o(c[1]),o(c[2]),p];case"hsla":if(4!==c.length)return null;p=s(c.pop());case"hsl":if(3!==c.length)return null;var d=(parseFloat(c[0])%360+360)%360/360,f=s(c[1]),g=s(c[2]),y=g<=.5?g*(f+1):g+f-g*f,m=2*g-y;return[i(255*a(m,y,d+1/3)),i(255*a(m,y,d)),i(255*a(m,y,d-1/3)),p];default:return null}}return null}}catch(t){}})).parseCSSColor,J=function(t,e,r,i){void 0===i&&(i=1),this.r=t,this.g=e,this.b=r,this.a=i};J.parse=function(t){if(t){if(t instanceof J)return t;if("string"==typeof t){var e=H(t);if(e)return new J(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},J.prototype.toString=function(){var t=this.toArray(),e=t[0],r=t[1],i=t[2],n=t[3];return"rgba("+Math.round(e)+","+Math.round(r)+","+Math.round(i)+","+n+")"},J.prototype.toArray=function(){var t=this.r,e=this.g,r=this.b,i=this.a;return 0===i?[0,0,0,0]:[255*t/i,255*e/i,255*r/i,i]},J.black=new J(0,0,0,1),J.white=new J(1,1,1,1),J.transparent=new J(0,0,0,0),J.red=new J(1,0,0,1);var $=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};$.prototype.compare=function(t,e){return this.collator.compare(t,e)},$.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Q=function(t,e,r,i,n){this.text=t,this.image=e,this.scale=r,this.fontStack=i,this.textColor=n},tt=function(t){this.sections=t};tt.fromString=function(t){return new tt([new Q(t,null,null,null,null)])},tt.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},tt.factory=function(t){return t instanceof tt?t:tt.fromString(t)},tt.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},tt.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===i||"number"==typeof i&&i>=0&&i<=1?null:"Invalid rgba value ["+[t,e,r,i].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof i?[t,e,r,i]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function it(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof J)return!0;if(t instanceof $)return!0;if(t instanceof tt)return!0;if(t instanceof et)return!0;if(Array.isArray(t)){for(var e=0,r=t;e2){var a=t[1];if("string"!=typeof a||!(a in lt)||"object"===a)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=lt[a],i++}else o=z;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);s=t[2],i++}r=W(o,s)}else r=lt[n];for(var l=[];i1)&&e.push(i)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var ht=function(t){this.type=U,this.sections=t};ht.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var i=[],n=!1,o=1;o<=t.length-1;++o){var s=t[o];if(n&&"object"==typeof s&&!Array.isArray(s)){n=!1;var a=null;if(s["font-scale"]&&!(a=e.parse(s["font-scale"],1,k)))return null;var l=null;if(s["text-font"]&&!(l=e.parse(s["text-font"],1,W(N))))return null;var u=null;if(s["text-color"]&&!(u=e.parse(s["text-color"],1,D)))return null;var h=i[i.length-1];h.scale=a,h.font=l,h.textColor=u}else{var c=e.parse(t[o],1,z);if(!c)return null;var p=c.type.kind;if("string"!==p&&"value"!==p&&"null"!==p&&"resolvedImage"!==p)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,i.push({content:c,scale:null,font:null,textColor:null})}}return new ht(i)},ht.prototype.evaluate=function(t){return new tt(this.sections.map((function(e){var r=e.content.evaluate(t);return nt(r)===Y?new Q("",r,null,null,null):new Q(ot(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},ht.prototype.eachChild=function(t){for(var e=0,r=this.sections;e-1),r},ct.prototype.eachChild=function(t){t(this.input)},ct.prototype.outputDefined=function(){return!1},ct.prototype.serialize=function(){return["image",this.input.serialize()]};var pt={"to-boolean":j,"to-color":D,"to-number":k,"to-string":N},dt=function(t,e){this.type=t,this.args=e};dt.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var i=pt[r],n=[],o=1;o4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":rt(e[0],e[1],e[2],e[3])))return new J(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new at(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var s=null,a=0,l=this.args;a=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function xt(t,e){var r,i=(180+t[0])/360,n=(r=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360),o=Math.pow(2,e.z);return[Math.round(i*o*8192),Math.round(n*o*8192)]}function wt(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function bt(t,e){for(var r,i,n,o,s,a,l,u=!1,h=0,c=e.length;h0&&c<0||h<0&&c>0}function Ct(t,e,r){for(var i=0,n=r;ir[2]){var n=.5*i,o=t[0]-r[0]>n?-i:r[0]-t[0]>n?i:0;0===o&&(o=t[0]-r[2]>n?-i:r[2]-t[0]>n?i:0),t[0]+=o}_t(e,t)}function Lt(t,e,r,i){for(var n=8192*Math.pow(2,i.z),o=[8192*i.x,8192*i.y],s=[],a=0,l=t;a=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Nt(t,e)&&(r=!1)})),r}Ft.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(it(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var i=0;ie))throw new at("Input is not a number.");s=a-1}return 0}Dt.prototype.parse=function(t,e,r,i,n){return void 0===n&&(n={}),e?this.concat(e,r,i)._parse(t,n):this._parse(t,n)},Dt.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new ut(e,[t]):"coerce"===r?new dt(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var i=t[0];if("string"!=typeof i)return this.error("Expression name must be a string, but found "+typeof i+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var n=this.registry[i];if(n){var o=n.parse(t,this);if(!o)return null;if(this.expectedType){var s=this.expectedType,a=o.type;if("string"!==s.kind&&"number"!==s.kind&&"boolean"!==s.kind&&"object"!==s.kind&&"array"!==s.kind||"value"!==a.kind)if("color"!==s.kind&&"formatted"!==s.kind&&"resolvedImage"!==s.kind||"value"!==a.kind&&"string"!==a.kind){if(this.checkSubtype(s,a))return null}else o=r(o,s,e.typeAnnotation||"coerce");else o=r(o,s,e.typeAnnotation||"assert")}if(!(o instanceof st)&&"resolvedImage"!==o.type.kind&&function t(e){if(e instanceof jt)return t(e.boundExpression);if(e instanceof yt&&"error"===e.name)return!1;if(e instanceof mt)return!1;if(e instanceof Ft)return!1;var r=e instanceof dt||e instanceof ut,i=!0;if(e.eachChild((function(e){i=r?i&&t(e):i&&e instanceof st})),!i)return!1;return At(e)&&Nt(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var l=new gt;try{o=new st(o.type,o.evaluate(l))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+i+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},Dt.prototype.concat=function(t,e,r){var i="number"==typeof t?this.path.concat(t):this.path,n=r?this.scope.concat(r):this.scope;return new Dt(this.registry,i,e||null,n,this.errors)},Dt.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var i=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new M(i,t))},Dt.prototype.checkSubtype=function(t,e){var r=q(t,e);return r&&this.error(r),r};var zt=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var i=0,n=r;i=s)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var h=e.parse(a,u,n);if(!h)return null;n=n||h.type,i.push([s,h])}return new zt(n,r,i)},zt.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);var n=e.length;return i>=e[n-1]?r[n-1].evaluate(t):r[Gt(e,i)].evaluate(t)},zt.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Bt=Ut;function Ut(t,e,r,i){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(i-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=i,this.p2x=r,this.p2y=i}function Yt(t,e,r){return t*(1-r)+e*r}Ut.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},Ut.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},Ut.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},Ut.prototype.solveCurveX=function(t,e){var r,i,n,o,s;for(void 0===e&&(e=1e-6),n=t,s=0;s<8;s++){if(o=this.sampleCurveX(n)-t,Math.abs(o)(i=1))return i;for(;ro?r=n:i=n,n=.5*(i-r)+r}return n},Ut.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var Wt=Object.freeze({__proto__:null,number:Yt,color:function(t,e,r){return new J(Yt(t.r,e.r,r),Yt(t.g,e.g,r),Yt(t.b,e.b,r),Yt(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,i){return Yt(t,e[i],r)}))}}),Vt=6/29,Xt=3*Vt*Vt,qt=Math.PI/180,Zt=180/Math.PI;function Kt(t){return t>.008856451679035631?Math.pow(t,1/3):t/Xt+4/29}function Ht(t){return t>Vt?t*t*t:Xt*(t-4/29)}function Jt(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function $t(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Qt(t){var e=$t(t.r),r=$t(t.g),i=$t(t.b),n=Kt((.4124564*e+.3575761*r+.1804375*i)/.95047),o=Kt((.2126729*e+.7151522*r+.072175*i)/1);return{l:116*o-16,a:500*(n-o),b:200*(o-Kt((.0193339*e+.119192*r+.9503041*i)/1.08883)),alpha:t.a}}function te(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,i=isNaN(t.b)?e:e-t.b/200;return e=1*Ht(e),r=.95047*Ht(r),i=1.08883*Ht(i),new J(Jt(3.2404542*r-1.5371385*e-.4985314*i),Jt(-.969266*r+1.8760108*e+.041556*i),Jt(.0556434*r-.2040259*e+1.0572252*i),t.alpha)}function ee(t,e,r){var i=e-t;return t+r*(i>180||i<-180?i-360*Math.round(i/360):i)}var re={forward:Qt,reverse:te,interpolate:function(t,e,r){return{l:Yt(t.l,e.l,r),a:Yt(t.a,e.a,r),b:Yt(t.b,e.b,r),alpha:Yt(t.alpha,e.alpha,r)}}},ie={forward:function(t){var e=Qt(t),r=e.l,i=e.a,n=e.b,o=Math.atan2(n,i)*Zt;return{h:o<0?o+360:o,c:Math.sqrt(i*i+n*n),l:r,alpha:t.a}},reverse:function(t){var e=t.h*qt,r=t.c;return te({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:ee(t.h,e.h,r),c:Yt(t.c,e.c,r),l:Yt(t.l,e.l,r),alpha:Yt(t.alpha,e.alpha,r)}}},ne=Object.freeze({__proto__:null,lab:re,hcl:ie}),oe=function(t,e,r,i,n){this.type=t,this.operator=e,this.interpolation=r,this.input=i,this.labels=[],this.outputs=[];for(var o=0,s=n;o1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:a}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(n=e.parse(n,2,k)))return null;var l=[],u=null;"interpolate-hcl"===r||"interpolate-lab"===r?u=D:e.expectedType&&"value"!==e.expectedType.kind&&(u=e.expectedType);for(var h=0;h=c)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',d);var g=e.parse(p,f,u);if(!g)return null;u=u||g.type,l.push([c,g])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new oe(u,r,i,n,l):e.error("Type "+V(u)+" is not interpolatable.")},oe.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);var n=e.length;if(i>=e[n-1])return r[n-1].evaluate(t);var o=Gt(e,i),s=e[o],a=e[o+1],l=oe.interpolationFactor(this.interpolation,i,s,a),u=r[o].evaluate(t),h=r[o+1].evaluate(t);return"interpolate"===this.operator?Wt[this.type.kind.toLowerCase()](u,h,l):"interpolate-hcl"===this.operator?ie.reverse(ie.interpolate(ie.forward(u),ie.forward(h),l)):re.reverse(re.interpolate(re.forward(u),re.forward(h),l))},oe.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new at("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new at("Array index must be an integer, but found "+e+" instead.");return r[e]},ue.prototype.eachChild=function(t){t(this.index),t(this.input)},ue.prototype.outputDefined=function(){return!1},ue.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var he=function(t,e){this.type=j,this.needle=t,this.haystack=e};he.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,z),i=e.parse(t[2],2,z);return r&&i?Z(r.type,[j,N,k,A,z])?new he(r,i):e.error("Expected first argument to be of type boolean, string, number or null, but found "+V(r.type)+" instead"):null},he.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!K(e,["boolean","string","number","null"]))throw new at("Expected first argument to be of type boolean, string, number or null, but found "+V(nt(e))+" instead.");if(!K(r,["string","array"]))throw new at("Expected second argument to be of type array or string, but found "+V(nt(r))+" instead.");return r.indexOf(e)>=0},he.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},he.prototype.outputDefined=function(){return!0},he.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var ce=function(t,e,r){this.type=k,this.needle=t,this.haystack=e,this.fromIndex=r};ce.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,z),i=e.parse(t[2],2,z);if(!r||!i)return null;if(!Z(r.type,[j,N,k,A,z]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+V(r.type)+" instead");if(4===t.length){var n=e.parse(t[3],3,k);return n?new ce(r,i,n):null}return new ce(r,i)},ce.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!K(e,["boolean","string","number","null"]))throw new at("Expected first argument to be of type boolean, string, number or null, but found "+V(nt(e))+" instead.");if(!K(r,["string","array"]))throw new at("Expected second argument to be of type array or string, but found "+V(nt(r))+" instead.");if(this.fromIndex){var i=this.fromIndex.evaluate(t);return r.indexOf(e,i)}return r.indexOf(e)},ce.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},ce.prototype.outputDefined=function(){return!1},ce.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var pe=function(t,e,r,i,n,o){this.inputType=t,this.type=e,this.input=r,this.cases=i,this.outputs=n,this.otherwise=o};pe.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var n={},o=[],s=2;sNumber.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof p&&Math.floor(p)!==p)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,nt(p)))return null}else r=nt(p);if(void 0!==n[String(p)])return u.error("Branch labels must be unique.");n[String(p)]=o.length}var d=e.parse(l,s,i);if(!d)return null;i=i||d.type,o.push(d)}var f=e.parse(t[1],1,z);if(!f)return null;var g=e.parse(t[t.length-1],t.length-1,i);return g?"value"!==f.type.kind&&e.concat(1).checkSubtype(r,f.type)?null:new pe(r,i,f,n,o,g):null},pe.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(nt(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},pe.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},pe.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},pe.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],i={},n=0,o=Object.keys(this.cases).sort();n=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,z),i=e.parse(t[2],2,k);if(!r||!i)return null;if(!Z(r.type,[W(z),N,z]))return e.error("Expected first argument to be of type array or string, but found "+V(r.type)+" instead");if(4===t.length){var n=e.parse(t[3],3,k);return n?new fe(r.type,r,i,n):null}return new fe(r.type,r,i)},fe.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!K(e,["string","array"]))throw new at("Expected first argument to be of type array or string, but found "+V(nt(e))+" instead.");if(this.endIndex){var i=this.endIndex.evaluate(t);return e.slice(r,i)}return e.slice(r)},fe.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},fe.prototype.outputDefined=function(){return!1},fe.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var _e=me("==",(function(t,e,r){return e===r}),ye),ve=me("!=",(function(t,e,r){return e!==r}),(function(t,e,r,i){return!ye(0,e,r,i)})),xe=me("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,i){return i.compare(e,r)>0})),be=me("<=",(function(t,e,r){return e<=r}),(function(t,e,r,i){return i.compare(e,r)<=0})),Se=me(">=",(function(t,e,r){return e>=r}),(function(t,e,r,i){return i.compare(e,r)>=0})),Te=function(t,e,r,i,n){this.type=N,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=i,this.maxFractionDigits=n};Te.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,k);if(!r)return null;var i=t[2];if("object"!=typeof i||Array.isArray(i))return e.error("NumberFormat options argument must be an object.");var n=null;if(i.locale&&!(n=e.parse(i.locale,1,N)))return null;var o=null;if(i.currency&&!(o=e.parse(i.currency,1,N)))return null;var s=null;if(i["min-fraction-digits"]&&!(s=e.parse(i["min-fraction-digits"],1,k)))return null;var a=null;return i["max-fraction-digits"]&&!(a=e.parse(i["max-fraction-digits"],1,k))?null:new Te(r,n,o,s,a)},Te.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},Te.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},Te.prototype.outputDefined=function(){return!1},Te.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Ce=function(t){this.type=k,this.input=t};Ce.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+V(r.type)+" instead."):new Ce(r):null},Ce.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new at("Expected value to be of type string or array, but found "+V(nt(e))+" instead.")},Ce.prototype.eachChild=function(t){t(this.input)},Ce.prototype.outputDefined=function(){return!1},Ce.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Ee={"==":_e,"!=":ve,">":we,"<":xe,">=":Se,"<=":be,array:ut,at:ue,boolean:ut,case:de,coalesce:ae,collator:mt,format:ht,image:ct,in:he,"index-of":ce,interpolate:oe,"interpolate-hcl":oe,"interpolate-lab":oe,length:Ce,let:le,literal:st,match:pe,number:ut,"number-format":Te,object:ut,slice:fe,step:zt,string:ut,"to-boolean":dt,"to-color":dt,"to-number":dt,"to-string":dt,var:jt,within:Ft};function Re(t,e){var r=e[0],i=e[1],n=e[2],o=e[3];r=r.evaluate(t),i=i.evaluate(t),n=n.evaluate(t);var s=o?o.evaluate(t):1,a=rt(r,i,n,s);if(a)throw new at(a);return new J(r/255*s,i/255*s,n/255*s,s)}function Pe(t,e){return t in e}function Ie(t,e){var r=e[t];return void 0===r?null:r}function Oe(t){return{type:t}}function Le(t){return{result:"success",value:t}}function Me(t){return{result:"error",value:t}}function Fe(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Ae(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function ke(t){return!!t.expression&&t.expression.interpolated}function Ne(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function je(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function De(t){return t}function Ge(t,e){var r,i,n,o="color"===e.type,s=t.stops&&"object"==typeof t.stops[0][0],a=s||void 0!==t.property,l=s||!a,u=t.type||(ke(e)?"exponential":"interval");if(o&&((t=L({},t)).stops&&(t.stops=t.stops.map((function(t){return[t[0],J.parse(t[1])]}))),t.default?t.default=J.parse(t.default):t.default=J.parse(e.default)),t.colorSpace&&"rgb"!==t.colorSpace&&!ne[t.colorSpace])throw new Error("Unknown color space: "+t.colorSpace);if("exponential"===u)r=Ye;else if("interval"===u)r=Ue;else if("categorical"===u){r=Be,i=Object.create(null);for(var h=0,c=t.stops;h=t.stops[i-1][0])return t.stops[i-1][1];var n=Gt(t.stops.map((function(t){return t[0]})),r);return t.stops[n][1]}function Ye(t,e,r){var i=void 0!==t.base?t.base:1;if("number"!==Ne(r))return ze(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var o=Gt(t.stops.map((function(t){return t[0]})),r),s=function(t,e,r,i){var n=i-r,o=t-r;return 0===n?0:1===e?o/n:(Math.pow(e,o)-1)/(Math.pow(e,n)-1)}(r,i,t.stops[o][0],t.stops[o+1][0]),a=t.stops[o][1],l=t.stops[o+1][1],u=Wt[e.type]||De;if(t.colorSpace&&"rgb"!==t.colorSpace){var h=ne[t.colorSpace];u=function(t,e){return h.reverse(h.interpolate(h.forward(t),h.forward(e),s))}}return"function"==typeof a.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=a.evaluate.apply(void 0,t),i=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==i)return u(r,i,s)}}:u(a,l,s)}function We(t,e,r){return"color"===e.type?r=J.parse(r):"formatted"===e.type?r=tt.fromString(r.toString()):"resolvedImage"===e.type?r=et.fromString(r.toString()):Ne(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),ze(r,t.default,e.default)}yt.register(Ee,{error:[{kind:"error"},[N],function(t,e){var r=e[0];throw new at(r.evaluate(t))}],typeof:[N,[z],function(t,e){return V(nt(e[0].evaluate(t)))}],"to-rgba":[W(k,4),[D],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[D,[k,k,k],Re],rgba:[D,[k,k,k,k],Re],has:{type:j,overloads:[[[N],function(t,e){return Pe(e[0].evaluate(t),t.properties())}],[[N,G],function(t,e){var r=e[0],i=e[1];return Pe(r.evaluate(t),i.evaluate(t))}]]},get:{type:z,overloads:[[[N],function(t,e){return Ie(e[0].evaluate(t),t.properties())}],[[N,G],function(t,e){var r=e[0],i=e[1];return Ie(r.evaluate(t),i.evaluate(t))}]]},"feature-state":[z,[N],function(t,e){return Ie(e[0].evaluate(t),t.featureState||{})}],properties:[G,[],function(t){return t.properties()}],"geometry-type":[N,[],function(t){return t.geometryType()}],id:[z,[],function(t){return t.id()}],zoom:[k,[],function(t){return t.globals.zoom}],"heatmap-density":[k,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[k,[],function(t){return t.globals.lineProgress||0}],accumulated:[z,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[k,Oe(k),function(t,e){for(var r=0,i=0,n=e;i":[j,[N,z],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],o=i.value;return typeof n==typeof o&&n>o}],"filter-id->":[j,[z],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i>n}],"filter-<=":[j,[N,z],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],o=i.value;return typeof n==typeof o&&n<=o}],"filter-id-<=":[j,[z],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i<=n}],"filter->=":[j,[N,z],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],o=i.value;return typeof n==typeof o&&n>=o}],"filter-id->=":[j,[z],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i>=n}],"filter-has":[j,[z],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[j,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[j,[W(N)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[j,[W(z)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[j,[N,W(z)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[j,[N,W(z)],function(t,e){var r=e[0],i=e[1];return function(t,e,r,i){for(;r<=i;){var n=r+i>>1;if(e[n]===t)return!0;e[n]>t?i=n-1:r=n+1}return!1}(t.properties()[r.value],i.value,0,i.value.length-1)}],all:{type:j,overloads:[[[j,j],function(t,e){var r=e[0],i=e[1];return r.evaluate(t)&&i.evaluate(t)}],[Oe(j),function(t,e){for(var r=0,i=e;r0&&"string"==typeof t[0]&&t[0]in Ee}function qe(t,e){var r=new Dt(Ee,[],e?function(t){var e={color:D,string:N,number:k,enum:N,boolean:j,formatted:U,resolvedImage:Y};if("array"===t.type)return W(e[t.value]||z,t.length);return e[t.type]}(e):void 0),i=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return i?Le(new Ve(i,e)):Me(r.errors)}Ve.prototype.evaluateWithoutErrorHandling=function(t,e,r,i,n,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)},Ve.prototype.evaluate=function(t,e,r,i,n,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=o||null;try{var s=this.expression.evaluate(this._evaluator);if(null==s||"number"==typeof s&&s!=s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new at("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(s)+" instead.");return s}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Ze=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!kt(e.expression)};Ze.prototype.evaluateWithoutErrorHandling=function(t,e,r,i,n,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,o)},Ze.prototype.evaluate=function(t,e,r,i,n,o){return this._styleExpression.evaluate(t,e,r,i,n,o)};var Ke=function(t,e,r,i){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!kt(e.expression),this.interpolationType=i};function He(t,e){if("error"===(t=qe(t,e)).result)return t;var r=t.value.expression,i=At(r);if(!i&&!Fe(e))return Me([new M("","data expressions not supported")]);var n=Nt(r,["zoom"]);if(!n&&!Ae(e))return Me([new M("","zoom expressions not supported")]);var o=function t(e){var r=null;if(e instanceof le)r=t(e.result);else if(e instanceof ae)for(var i=0,n=e.args;i3&&e===t[t.length-2]||(i&&2===t.length||t.push(e),t.push(r))}function or(t,e){return t.type?t.type:e.expression.interpolated?"exponential":"interval"}function sr(t){for(var e=["concat"],r=/{([^{}]+)}/g,i=0,n=r.exec(t);null!==n;n=r.exec(t)){var o=t.slice(i,r.lastIndex-n[0].length);i=r.lastIndex,o.length>0&&e.push(o),e.push(["get",n[1]])}if(1===e.length)return t;if(i=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);ee?1:0}function cr(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?pr(t[1],t[2],"=="):"!="===r?gr(pr(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?pr(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(cr))):"all"===r?["all"].concat(t.slice(1).map(cr)):"none"===r?["all"].concat(t.slice(1).map(cr).map(gr)):"in"===r?dr(t[1],t.slice(2)):"!in"===r?gr(dr(t[1],t.slice(2))):"has"===r?fr(t[1]):"!has"===r?gr(fr(t[1])):"within"!==r||t}function pr(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function dr(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(hr)]]:["filter-in-small",t,["literal",e]]}}function fr(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function gr(t){return["!",t]}var yr=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function mr(t,e){var r={};for(var i in t)"ref"!==i&&(r[i]=t[i]);return yr.forEach((function(t){t in e&&(r[t]=e[t])})),r}function _r(t){t=t.slice();for(var e=Object.create(null),r=0;ri.maximum?[new vr(e,r,r+" is greater than the maximum value "+i.maximum)]:[]}function Rr(t){var e,r,i,n=t.valueSpec,o=br(t.value.type),s={},a="categorical"!==o&&void 0===t.value.property,l=!a,u="array"===Ne(t.value.stops)&&"array"===Ne(t.value.stops[0])&&"object"===Ne(t.value.stops[0][0]),h=Tr({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new vr(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;e=e.concat(Cr({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:c})),"array"===Ne(r)&&0===r.length&&e.push(new vr(t.key,r,"array must have at least one stop"));return e},default:function(t){return zr({key:t.key,value:t.value,valueSpec:n,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&a&&h.push(new vr(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||h.push(new vr(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!ke(t.valueSpec)&&h.push(new vr(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!Fe(t.valueSpec)?h.push(new vr(t.key,t.value,"property functions not supported")):a&&!Ae(t.valueSpec)&&h.push(new vr(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!u||void 0!==t.value.property||h.push(new vr(t.key,t.value,'"property" property is required')),h;function c(t){var e=[],o=t.value,a=t.key;if("array"!==Ne(o))return[new vr(a,o,"array expected, "+Ne(o)+" found")];if(2!==o.length)return[new vr(a,o,"array length 2 expected, length "+o.length+" found")];if(u){if("object"!==Ne(o[0]))return[new vr(a,o,"object expected, "+Ne(o[0])+" found")];if(void 0===o[0].zoom)return[new vr(a,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new vr(a,o,"object stop key must have value")];if(i&&i>br(o[0].zoom))return[new vr(a,o[0].zoom,"stop zoom values must appear in ascending order")];br(o[0].zoom)!==i&&(i=br(o[0].zoom),r=void 0,s={}),e=e.concat(Tr({key:a+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Er,value:p}}))}else e=e.concat(p({key:a+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return Xe(Sr(o[1]))?e.concat([new vr(a+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(zr({key:a+"[1]",value:o[1],valueSpec:n,style:t.style,styleSpec:t.styleSpec}))}function p(t,i){var a=Ne(t.value),l=br(t.value),u=null!==t.value?t.value:i;if(e){if(a!==e)return[new vr(t.key,u,a+" stop domain type must match previous stop domain type "+e)]}else e=a;if("number"!==a&&"string"!==a&&"boolean"!==a)return[new vr(t.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==a&&"categorical"!==o){var h="number expected, "+a+" found";return Fe(n)&&void 0===o&&(h+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new vr(t.key,u,h)]}return"categorical"!==o||"number"!==a||isFinite(l)&&Math.floor(l)===l?"categorical"!==o&&"number"===a&&void 0!==r&&l":case">=":r.length>=2&&"$type"===br(r[1])&&s.push(new vr(i,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&s.push(new vr(i,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(n=Ne(r[1]))&&s.push(new vr(i+"[1]",r[1],"string expected, "+n+" found"));for(var a=2;au&&C.push("'"+this.terminals_[b]+"'");R=p.showPosition?"Parse error on line "+(a+1)+":\n"+p.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(a+1)+": Unexpected "+(_==h?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(R,{text:p.match,token:this.terminals_[_]||_,line:p.yylineno,loc:g,expected:C})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+_);switch(x[0]){case 1:r.push(_),i.push(p.yytext),n.push(p.yylloc),r.push(x[1]),_=null,l=p.yyleng,s=p.yytext,a=p.yylineno,g=p.yylloc;break;case 2:if(S=this.productions_[x[1]][1],E.$=i[i.length-S],E._$={first_line:n[n.length-(S||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(S||1)].first_column,last_column:n[n.length-1].last_column},y&&(E._$.range=[n[n.length-(S||1)].range[0],n[n.length-1].range[1]]),void 0!==(w=this.performAction.apply(E,[s,l,a,d.yy,x[1],i,n].concat(c))))return w;S&&(r=r.slice(0,-1*S*2),i=i.slice(0,-1*S),n=n.slice(0,-1*S)),r.push(this.productions_[x[1]][0]),i.push(E.$),n.push(E._$),T=o[r[r.length-2]][r[r.length-1]],r.push(T);break;case 3:return!0}}return!0}},p={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===i.length?this.yylloc.first_column:0)+i[i.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var r,i,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var o in n)this[o]=n[o];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,r,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),o=0;oe[0].length)){if(e=r,i=o,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,n[o])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,r,i){switch(r){case 0:break;case 1:return 6;case 2:return e.yytext=e.yytext.substr(1,e.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};function d(){this.yy={}}return c.lexer=p,d.prototype=c,c.Parser=d,new d}();e.parser=r,e.Parser=r.Parser,e.parse=function(){return r.parse.apply(r,arguments)}}));Vr.parser,Vr.Parser,Vr.parse;function Xr(t){if(t instanceof String||"string"==typeof t||t instanceof i)try{return Vr.parse(t.toString())}catch(t){throw new xr(t)}return t}function qr(t,e){void 0===e&&(e=n);var r=t;try{r=Xr(r)}catch(t){return[t]}return Ur(r,e)}var Zr={StyleExpression:Ve,isExpression:Xe,isExpressionFilter:ar,createExpression:qe,createPropertyExpression:He,normalizePropertyExpression:function(t,e){if(je(t))return new Je(t,e);if(Xe(t)){var r=He(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var i=t;return"string"==typeof t&&"color"===e.type&&(i=J.parse(t)),{kind:"constant",evaluate:function(){return i}}},ZoomConstantExpression:Ze,ZoomDependentExpression:Ke,StylePropertyFunction:Je},Kr={convertFunction:Qe,createFunction:Ge,isFunction:je};qr.parsed=qr,qr.latest=qr}).call(this,r(5),r(21).Buffer)},function(t,e,r){t.exports=function(){"use strict";function t(t,i,n,o,s){!function t(r,i,n,o,s){for(;o>n;){if(o-n>600){var a=o-n+1,l=i-n+1,u=Math.log(a),h=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*h*(a-h)/a)*(l-a/2<0?-1:1),p=Math.max(n,Math.floor(i-l*h/a+c)),d=Math.min(o,Math.floor(i+(a-l)*h/a+c));t(r,i,p,d,s)}var f=r[i],g=n,y=o;for(e(r,n,i),s(r[o],f)>0&&e(r,n,o);g0;)y--}0===s(r[n],f)?e(r,n,y):(y++,e(r,y,o)),y<=i&&(n=y+1),i<=y&&(o=y-1)}}(t,i,n||0,o||t.length-1,s||r)}function e(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function r(t,e){return te?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function n(t,e,r){if(!r)return e.indexOf(t);for(var i=0;i=t.minX&&e.maxY>=t.minY}function f(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,r,i,n,o){for(var s=[r,i];s.length;)if(!((i=s.pop())-(r=s.pop())<=n)){var a=r+Math.ceil((i-r)/n/2)*n;t(e,a,r,i,o),s.push(r,a,a,i)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,r=[];if(!d(t,e))return r;for(var i=this.toBBox,n=[];e;){for(var o=0;o=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(i,n,e)},i.prototype._split=function(t,e){var r=t[e],i=r.children.length,n=this._minEntries;this._chooseSplitAxis(r,n,i);var s=this._chooseSplitIndex(r,n,i),a=f(r.children.splice(s,r.children.length-s));a.height=r.height,a.leaf=r.leaf,o(r,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(r,a)},i.prototype._splitRoot=function(t,e){this.data=f([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,r){for(var i,n,o,a,l,u,c,p=1/0,d=1/0,f=e;f<=r-e;f++){var g=s(t,0,f,this.toBBox),y=s(t,f,r,this.toBBox),m=(n=g,o=y,a=void 0,l=void 0,u=void 0,c=void 0,a=Math.max(n.minX,o.minX),l=Math.max(n.minY,o.minY),u=Math.min(n.maxX,o.maxX),c=Math.min(n.maxY,o.maxY),Math.max(0,u-a)*Math.max(0,c-l)),_=h(g)+h(y);m=e;d--){var f=t.children[d];a(l,t.leaf?n(f):f),u+=c(l)}return u},i.prototype._adjustParentBBoxes=function(t,e,r){for(var i=r;i>=0;i--)a(e[i],t)},i.prototype._condense=function(t){for(var e=t.length-1,r=void 0;e>=0;e--)0===t[e].children.length?e>0?(r=t[e-1].children).splice(r.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},i}()},function(t,e,r){"use strict";t.exports=n;var i=r(4);function n(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}n.Varint=0,n.Fixed64=1,n.Bytes=2,n.Fixed32=5;var o="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function s(t){return t.type===n.Bytes?t.readVarint()+t.pos:t.pos+1}function a(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function l(t,e,r){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(i);for(var n=r.pos-1;n>=t;n--)r.buf[n+i]=r.buf[n]}function u(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function x(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}n.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos>3,o=this.pos;this.type=7&i,t(n,e,this),this.pos===o&&this.skip(i)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=_(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=x(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=_(this.buf,this.pos)+4294967296*_(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=_(this.buf,this.pos)+4294967296*x(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=i.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=i.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,i=this.buf;return e=127&(r=i[this.pos++]),r<128?e:(e|=(127&(r=i[this.pos++]))<<7,r<128?e:(e|=(127&(r=i[this.pos++]))<<14,r<128?e:(e|=(127&(r=i[this.pos++]))<<21,r<128?e:function(t,e,r){var i,n,o=r.buf;if(n=o[r.pos++],i=(112&n)>>4,n<128)return a(t,i,e);if(n=o[r.pos++],i|=(127&n)<<3,n<128)return a(t,i,e);if(n=o[r.pos++],i|=(127&n)<<10,n<128)return a(t,i,e);if(n=o[r.pos++],i|=(127&n)<<17,n<128)return a(t,i,e);if(n=o[r.pos++],i|=(127&n)<<24,n<128)return a(t,i,e);if(n=o[r.pos++],i|=(1&n)<<31,n<128)return a(t,i,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=i[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&o?function(t,e,r){return o.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){var i="",n=e;for(;n239?4:l>223?3:l>191?2:1;if(n+h>r)break;1===h?l<128&&(u=l):2===h?128==(192&(o=t[n+1]))&&(u=(31&l)<<6|63&o)<=127&&(u=null):3===h?(o=t[n+1],s=t[n+2],128==(192&o)&&128==(192&s)&&((u=(15&l)<<12|(63&o)<<6|63&s)<=2047||u>=55296&&u<=57343)&&(u=null)):4===h&&(o=t[n+1],s=t[n+2],a=t[n+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&((u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,h=1):u>65535&&(u-=65536,i+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),i+=String.fromCharCode(u),n+=h}return i}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==n.Bytes)return t.push(this.readVarint(e));var r=s(this);for(t=t||[];this.pos127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455||t<0?function(t,e){var r,i;t>=0?(r=t%4294967296|0,i=t/4294967296|0):(i=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,i=i+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;if(e.buf[e.pos++]|=r|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(i,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var i,n,o=0;o55295&&i<57344){if(!n){i>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):n=i;continue}if(i<56320){t[r++]=239,t[r++]=191,t[r++]=189,n=i;continue}i=n-55296<<10|i-56320|65536,n=null}else n&&(t[r++]=239,t[r++]=191,t[r++]=189,n=null);i<128?t[r++]=i:(i<2048?t[r++]=i>>6|192:(i<65536?t[r++]=i>>12|224:(t[r++]=i>>18|240,t[r++]=i>>12&63|128),t[r++]=i>>6&63|128),t[r++]=63&i|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&l(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),i.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),i.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&l(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,u,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,h,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,d,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,c,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,p,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,f,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,g,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,y,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,m,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},function(t,e){var r={thin:100,hairline:100,"ultra-light":100,"extra-light":100,light:200,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,heavy:800,black:800,"extra-bold":800,"ultra-black":900,"extra-black":900,"ultra-bold":900,"heavy-black":900,fat:900,poster:900},i=/(italic|oblique)$/i,n={};t.exports=function(t,e,o){var s=n[t];if(!s){Array.isArray(t)||(t=[t]);for(var a=400,l="normal",u=[],h=0,c=t.length;h>1,h=-7,c=r?n-1:0,p=r?-1:1,d=t[e+c];for(c+=p,o=d&(1<<-h)-1,d>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=p,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=i;h>0;s=256*s+t[e+c],c+=p,h-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,i),o-=u}return(d?-1:1)*s*Math.pow(2,o-i)},e.write=function(t,e,r,i,n,o){var s,a,l,u=8*o-n-1,h=(1<>1,p=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,f=i?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+c>=1?p/l:p*Math.pow(2,1-c))*l>=2&&(s++,l/=2),s+c>=h?(a=0,s=h):s+c>=1?(a=(e*l-1)*Math.pow(2,n),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,n),s=0));n>=8;t[r+d]=255&a,d+=f,a/=256,n-=8);for(s=s<0;t[r+d]=255&s,d+=f,s/=256,u-=8);t[r+d-f]|=128*g}},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){(function(){var e;t.exports={icon:"icons/google.svg",name:"google",title:"Google Fonts",link:"google.com/fonts",getNames:function(){return e},getLink:function(t){return"https://fonts.google.com/specimen/"+t.replace(/( )/g,"+")},normalizeName:function(t){return t}},e=["ABeeZee","Abel","Abril Fatface","Aclonica","Acme","Actor","Adamina","Advent Pro","Aguafina Script","Akronim","Aladin","Aldrich","Alef","Alegreya","Alegreya SC","Alegreya Sans","Alegreya Sans SC","Alex Brush","Alfa Slab One","Alice","Alike","Alike Angular","Allan","Allerta","Allerta Stencil","Allura","Almendra","Almendra Display","Almendra SC","Amarante","Amaranth","Amatic SC","Amethysta","Amiri","Amita","Anaheim","Andada","Andika","Angkor","Annie Use Your Telescope","Anonymous Pro","Antic","Antic Didone","Antic Slab","Anton","Arapey","Arbutus","Arbutus Slab","Architects Daughter","Archivo Black","Archivo Narrow","Arimo","Arizonia","Armata","Artifika","Arvo","Arya","Asap","Asar","Asset","Astloch","Asul","Atomic Age","Aubrey","Audiowide","Autour One","Average","Average Sans","Averia Gruesa Libre","Averia Libre","Averia Sans Libre","Averia Serif Libre","Bad Script","Balthazar","Bangers","Basic","Battambang","Baumans","Bayon","Belgrano","Belleza","BenchNine","Bentham","Berkshire Swash","Bevan","Bigelow Rules","Bigshot One","Bilbo","Bilbo Swash Caps","Biryani","Bitter","Black Ops One","Bokor","Bonbon","Boogaloo","Bowlby One","Bowlby One SC","Brawler","Bree Serif","Bubblegum Sans","Bubbler One","Buda","Buenard","Butcherman","Butterfly Kids","Cabin","Cabin Condensed","Cabin Sketch","Caesar Dressing","Cagliostro","Calligraffitti","Cambay","Cambo","Candal","Cantarell","Cantata One","Cantora One","Capriola","Cardo","Carme","Carrois Gothic","Carrois Gothic SC","Carter One","Catamaran","Caudex","Caveat","Caveat Brush","Cedarville Cursive","Ceviche One","Changa One","Chango","Chau Philomene One","Chela One","Chelsea Market","Chenla","Cherry Cream Soda","Cherry Swash","Chewy","Chicle","Chivo","Chonburi","Cinzel","Cinzel Decorative","Clicker Script","Coda","Coda Caption","Codystar","Combo","Comfortaa","Coming Soon","Concert One","Condiment","Content","Contrail One","Convergence","Cookie","Copse","Corben","Courgette","Cousine","Coustard","Covered By Your Grace","Crafty Girls","Creepster","Crete Round","Crimson Text","Croissant One","Crushed","Cuprum","Cutive","Cutive Mono","Damion","Dancing Script","Dangrek","Dawning of a New Day","Days One","Dekko","Delius","Delius Swash Caps","Delius Unicase","Della Respira","Denk One","Devonshire","Dhurjati","Didact Gothic","Diplomata","Diplomata SC","Domine","Donegal One","Doppio One","Dorsa","Dosis","Dr Sugiyama","Droid Sans","Droid Sans Mono","Droid Serif","Duru Sans","Dynalight","EB Garamond","Eagle Lake","Eater","Economica","Eczar","Ek Mukta","Electrolize","Elsie","Elsie Swash Caps","Emblema One","Emilys Candy","Engagement","Englebert","Enriqueta","Erica One","Esteban","Euphoria Script","Ewert","Exo","Exo 2","Expletus Sans","Fanwood Text","Fascinate","Fascinate Inline","Faster One","Fasthand","Fauna One","Federant","Federo","Felipa","Fenix","Finger Paint","Fira Mono","Fira Sans","Fjalla One","Fjord One","Flamenco","Flavors","Fondamento","Fontdiner Swanky","Forum","Francois One","Freckle Face","Fredericka the Great","Fredoka One","Freehand","Fresca","Frijole","Fruktur","Fugaz One","GFS Didot","GFS Neohellenic","Gabriela","Gafata","Galdeano","Galindo","Gentium Basic","Gentium Book Basic","Geo","Geostar","Geostar Fill","Germania One","Gidugu","Gilda Display","Give You Glory","Glass Antiqua","Glegoo","Gloria Hallelujah","Goblin One","Gochi Hand","Gorditas","Goudy Bookletter 1911","Graduate","Grand Hotel","Gravitas One","Great Vibes","Griffy","Gruppo","Gudea","Gurajada","Habibi","Halant","Hammersmith One","Hanalei","Hanalei Fill","Handlee","Hanuman","Happy Monkey","Headland One","Henny Penny","Herr Von Muellerhoff","Hind","Hind Siliguri","Hind Vadodara","Holtwood One SC","Homemade Apple","Homenaje","IM Fell DW Pica","IM Fell DW Pica SC","IM Fell Double Pica","IM Fell Double Pica SC","IM Fell English","IM Fell English SC","IM Fell French Canon","IM Fell French Canon SC","IM Fell Great Primer","IM Fell Great Primer SC","Iceberg","Iceland","Imprima","Inconsolata","Inder","Indie Flower","Inika","Inknut Antiqua","Irish Grover","Istok Web","Italiana","Italianno","Itim","Jacques Francois","Jacques Francois Shadow","Jaldi","Jim Nightshade","Jockey One","Jolly Lodger","Josefin Sans","Josefin Slab","Joti One","Judson","Julee","Julius Sans One","Junge","Jura","Just Another Hand","Just Me Again Down Here","Kadwa","Kalam","Kameron","Kantumruy","Karla","Karma","Kaushan Script","Kavoon","Kdam Thmor","Keania One","Kelly Slab","Kenia","Khand","Khmer","Khula","Kite One","Knewave","Kotta One","Koulen","Kranky","Kreon","Kristi","Krona One","Kurale","La Belle Aurore","Laila","Lakki Reddy","Lancelot","Lateef","Lato","League Script","Leckerli One","Ledger","Lekton","Lemon","Libre Baskerville","Life Savers","Lilita One","Lily Script One","Limelight","Linden Hill","Lobster","Lobster Two","Londrina Outline","Londrina Shadow","Londrina Sketch","Londrina Solid","Lora","Love Ya Like A Sister","Loved by the King","Lovers Quarrel","Luckiest Guy","Lusitana","Lustria","Macondo","Macondo Swash Caps","Magra","Maiden Orange","Mako","Mallanna","Mandali","Marcellus","Marcellus SC","Marck Script","Margarine","Marko One","Marmelad","Martel","Martel Sans","Marvel","Mate","Mate SC","Maven Pro","McLaren","Meddon","MedievalSharp","Medula One","Megrim","Meie Script","Merienda","Merienda One","Merriweather","Merriweather Sans","Metal","Metal Mania","Metamorphous","Metrophobic","Michroma","Milonga","Miltonian","Miltonian Tattoo","Miniver","Miss Fajardose","Modak","Modern Antiqua","Molengo","Molle","Monda","Monofett","Monoton","Monsieur La Doulaise","Montaga","Montez","Montserrat","Montserrat Alternates","Montserrat Subrayada","Moul","Moulpali","Mountains of Christmas","Mouse Memoirs","Mr Bedfort","Mr Dafoe","Mr De Haviland","Mrs Saint Delafield","Mrs Sheppards","Muli","Mystery Quest","NTR","Neucha","Neuton","New Rocker","News Cycle","Niconne","Nixie One","Nobile","Nokora","Norican","Nosifer","Nothing You Could Do","Noticia Text","Noto Sans","Noto Serif","Nova Cut","Nova Flat","Nova Mono","Nova Oval","Nova Round","Nova Script","Nova Slim","Nova Square","Numans","Nunito","Odor Mean Chey","Offside","Old Standard TT","Oldenburg","Oleo Script","Oleo Script Swash Caps","Open Sans","Open Sans Condensed","Oranienbaum","Orbitron","Oregano","Orienta","Original Surfer","Oswald","Over the Rainbow","Overlock","Overlock SC","Ovo","Oxygen","Oxygen Mono","PT Mono","PT Sans","PT Sans Caption","PT Sans Narrow","PT Serif","PT Serif Caption","Pacifico","Palanquin","Palanquin Dark","Paprika","Parisienne","Passero One","Passion One","Pathway Gothic One","Patrick Hand","Patrick Hand SC","Patua One","Paytone One","Peddana","Peralta","Permanent Marker","Petit Formal Script","Petrona","Philosopher","Piedra","Pinyon Script","Pirata One","Plaster","Play","Playball","Playfair Display","Playfair Display SC","Podkova","Poiret One","Poller One","Poly","Pompiere","Pontano Sans","Poppins","Port Lligat Sans","Port Lligat Slab","Pragati Narrow","Prata","Preahvihear","Press Start 2P","Princess Sofia","Prociono","Prosto One","Puritan","Purple Purse","Quando","Quantico","Quattrocento","Quattrocento Sans","Questrial","Quicksand","Quintessential","Qwigley","Racing Sans One","Radley","Rajdhani","Raleway","Raleway Dots","Ramabhadra","Ramaraja","Rambla","Rammetto One","Ranchers","Rancho","Ranga","Rationale","Ravi Prakash","Redressed","Reenie Beanie","Revalia","Rhodium Libre","Ribeye","Ribeye Marrow","Righteous","Risque","Roboto","Roboto Condensed","Roboto Mono","Roboto Slab","Rochester","Rock Salt","Rokkitt","Romanesco","Ropa Sans","Rosario","Rosarivo","Rouge Script","Rozha One","Rubik","Rubik Mono One","Rubik One","Ruda","Rufina","Ruge Boogie","Ruluko","Rum Raisin","Ruslan Display","Russo One","Ruthie","Rye","Sacramento","Sahitya","Sail","Salsa","Sanchez","Sancreek","Sansita One","Sarala","Sarina","Sarpanch","Satisfy","Scada","Scheherazade","Schoolbell","Seaweed Script","Sevillana","Seymour One","Shadows Into Light","Shadows Into Light Two","Shanti","Share","Share Tech","Share Tech Mono","Shojumaru","Short Stack","Siemreap","Sigmar One","Signika","Signika Negative","Simonetta","Sintony","Sirin Stencil","Six Caps","Skranji","Slabo 13px","Slabo 27px","Slackey","Smokum","Smythe","Sniglet","Snippet","Snowburst One","Sofadi One","Sofia","Sonsie One","Sorts Mill Goudy","Source Code Pro","Source Sans Pro","Source Serif Pro","Special Elite","Spicy Rice","Spinnaker","Spirax","Squada One","Sree Krushnadevaraya","Stalemate","Stalinist One","Stardos Stencil","Stint Ultra Condensed","Stint Ultra Expanded","Stoke","Strait","Sue Ellen Francisco","Sumana","Sunshiney","Supermercado One","Sura","Suranna","Suravaram","Suwannaphum","Swanky and Moo Moo","Syncopate","Tangerine","Taprom","Tauri","Teko","Telex","Tenali Ramakrishna","Tenor Sans","Text Me One","The Girl Next Door","Tienne","Tillana","Timmana","Tinos","Titan One","Titillium Web","Trade Winds","Trocchi","Trochut","Trykker","Tulpen One","Ubuntu","Ubuntu Condensed","Ubuntu Mono","Ultra","Uncial Antiqua","Underdog","Unica One","UnifrakturCook","UnifrakturMaguntia","Unkempt","Unlock","Unna","VT323","Vampiro One","Varela","Varela Round","Vast Shadow","Vesper Libre","Vibur","Vidaloka","Viga","Voces","Volkhov","Vollkorn","Voltaire","Waiting for the Sunrise","Wallpoet","Walter Turncoat","Warnes","Wellfleet","Wendy One","Wire One","Work Sans","Yanone Kaffeesatz","Yantramanav","Yellowtail","Yeseva One","Yesteryear","Zeyada"]}).call(this)},,,,,,,,,,,,,,,function(t,e,r){"use strict";(function(t){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ var i=r(22),n=r(4),o=r(23);function s(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function f(t,e){if(l.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return B(t).length;default:if(i)return z(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,r);case"utf8":case"utf-8":return E(this,e,r);case"ascii":return R(this,e,r);case"latin1":case"binary":return P(this,e,r);case"base64":return C(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function y(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function m(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=l.from(e,i)),l.isBuffer(e))return 0===e.length?-1:_(t,e,r,i,n);if("number"==typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):_(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function _(t,e,r,i,n){var o,s=1,a=t.length,l=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;s=2,a/=2,l/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(n){var h=-1;for(o=r;oa&&(r=a-l),o=r;o>=0;o--){for(var c=!0,p=0;pn&&(i=n):i=n;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var s=0;s>8,n=r%256,o.push(n),o.push(i);return o}(e,t.length-r),t,r,i)}function C(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function E(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n239?4:u>223?3:u>191?2:1;if(n+c<=r)switch(c){case 1:u<128&&(h=u);break;case 2:128==(192&(o=t[n+1]))&&(l=(31&u)<<6|63&o)>127&&(h=l);break;case 3:o=t[n+1],s=t[n+2],128==(192&o)&&128==(192&s)&&(l=(15&u)<<12|(63&o)<<6|63&s)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:o=t[n+1],s=t[n+2],a=t[n+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(l=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&l<1114112&&(h=l)}null===h?(h=65533,c=1):h>65535&&(h-=65536,i.push(h>>>10&1023|55296),h=56320|1023&h),i.push(h),n+=c}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",i=0;for(;i0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},l.prototype.compare=function(t,e,r,i,n){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(n>>>=0)-(i>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),u=this.slice(i,n),h=t.slice(e,r),c=0;cn)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return x(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return b(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function R(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;ni)&&(r=i);for(var n="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,r,i,n,o){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}function F(t,e,r,i){e<0&&(e=65535+e+1);for(var n=0,o=Math.min(t.length-r,2);n>>8*(i?n:1-n)}function A(t,e,r,i){e<0&&(e=4294967295+e+1);for(var n=0,o=Math.min(t.length-r,4);n>>8*(i?n:3-n)&255}function k(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(t,e,r,i,o){return o||k(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function j(t,e,r,i,o){return o||k(t,0,r,8),n.write(t,e,r,i,52,8),r+8}l.prototype.slice=function(t,e){var r,i=this.length;if((t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e0&&(n*=256);)i+=this[t+--e]*n;return i},l.prototype.readUInt8=function(t,e){return e||L(t,1,this.length),this[t]},l.prototype.readUInt16LE=function(t,e){return e||L(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUInt16BE=function(t,e){return e||L(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUInt32LE=function(t,e){return e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUInt32BE=function(t,e){return e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||L(t,e,this.length);for(var i=this[t],n=1,o=0;++o=(n*=128)&&(i-=Math.pow(2,8*e)),i},l.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||L(t,e,this.length);for(var i=e,n=1,o=this[t+--i];i>0&&(n*=256);)o+=this[t+--i]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*e)),o},l.prototype.readInt8=function(t,e){return e||L(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){e||L(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(t,e){e||L(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(t,e){return e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return e||L(t,4,this.length),n.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return e||L(t,4,this.length),n.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return e||L(t,8,this.length),n.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return e||L(t,8,this.length),n.read(this,t,!1,52,8)},l.prototype.writeUIntLE=function(t,e,r,i){(t=+t,e|=0,r|=0,i)||M(this,t,e,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+n]=t/o&255;return e+r},l.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,1,255,0),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},l.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):F(this,t,e,!0),e+2},l.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):F(this,t,e,!1),e+2},l.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):A(this,t,e,!0),e+4},l.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):A(this,t,e,!1),e+4},l.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);M(this,t,e,r,n-1,-n)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},l.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);M(this,t,e,r,n-1,-n)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},l.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):F(this,t,e,!0),e+2},l.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):F(this,t,e,!1),e+2},l.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):A(this,t,e,!0),e+4},l.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):A(this,t,e,!1),e+4},l.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},l.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},l.prototype.writeDoubleLE=function(t,e,r){return j(this,t,e,!0,r)},l.prototype.writeDoubleBE=function(t,e,r){return j(this,t,e,!1,r)},l.prototype.copy=function(t,e,r,i){if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--n)t[n+e]=this[n+r];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function B(t){return i.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(D,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function U(t,e,r,i){for(var n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}}).call(this,r(5))},function(t,e,r){"use strict";e.byteLength=function(t){var e=u(t),r=e[0],i=e[1];return 3*(r+i)/4-i},e.toByteArray=function(t){var e,r,i=u(t),s=i[0],a=i[1],l=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),h=0,c=a>0?s-4:s;for(r=0;r>16&255,l[h++]=e>>8&255,l[h++]=255&e;2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,l[h++]=255&e);1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,l[h++]=e>>8&255,l[h++]=255&e);return l},e.fromByteArray=function(t){for(var e,r=t.length,n=r%3,o=[],s=0,a=r-n;sa?a:s+16383));1===n?(e=t[r-1],o.push(i[e>>2]+i[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],o.push(i[e>>10]+i[e>>4&63]+i[e<<2&63]+"="));return o.join("")};for(var i=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function h(t,e,r){for(var n,o,s=[],a=e;a>18&63]+i[o>>12&63]+i[o>>6&63]+i[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){"use strict";function i(){return function(){throw new Error("Unimplemented abstract method.")}()}r.r(e);var n=0;function o(t){return t.ol_uid||(t.ol_uid=String(++n))}var s,a=(s=function(t,e){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),l=function(t){function e(e){var r=this,i="Assertion failed. See https://openlayers.org/en/"+("v"+"6.4.0".split("-")[0])+"/doc/errors/#"+e+" for details.";return(r=t.call(this,i)||this).code=e,r.name="AssertionError",r.message=i,r}return a(e,t),e}(Error);function u(t){t.stopPropagation()}var h=function(){function t(t){this.propagationStopped,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.propagationStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}(),c="propertychange",p=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function d(t,e){return t>e?1:t=0}function g(t,e,r){var i=t.length;if(t[0]<=e)return 0;if(e<=t[i-1])return i-1;var n=void 0;if(r>0){for(n=1;n>>0,n=0;n0)},e.prototype.removeEventListener=function(t,e){var r=this.listeners_&&this.listeners_[t];if(r){var i=r.indexOf(e);-1!==i&&(this.pendingRemovals_&&t in this.pendingRemovals_?(r[i]=S,++this.pendingRemovals_[t]):(r.splice(i,1),0===r.length&&delete this.listeners_[t]))}},e}(p),O="change",L="error",M="contextmenu",F="click",A="dblclick",k="dragenter",N="dragover",j="drop",D="keydown",G="keypress",z="load",B="resize",U="touchmove",Y="wheel";function W(t,e,r,i,n){if(i&&i!==t&&(r=r.bind(i)),n){var o=r;r=function(){t.removeEventListener(e,r),o.apply(this,arguments)}}var s={target:t,type:e,listener:r};return t.addEventListener(e,r),s}function V(t,e,r,i){return W(t,e,r,i,!0)}function X(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),C(t))}var q=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function Z(t){if(Array.isArray(t))for(var e=0,r=t.length;e0;)this.pop()},e.prototype.extend=function(t){for(var e=0,r=t.length;en&&(l|=kt),ao&&(l|=At),l===Mt&&(l=Ft),l}function Xt(){return[1/0,1/0,-1/0,-1/0]}function qt(t,e,r,i,n){return n?(n[0]=t,n[1]=e,n[2]=r,n[3]=i,n):[t,e,r,i]}function Zt(t){return qt(1/0,1/0,-1/0,-1/0,t)}function Kt(t,e){var r=t[0],i=t[1];return qt(r,i,r,i,e)}function Ht(t,e,r,i,n){return ee(Zt(n),t,e,r,i)}function Jt(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function $t(t,e){return e[0]t[2]&&(t[2]=e[2]),e[1]t[3]&&(t[3]=e[3]),t}function Qt(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function te(t,e){for(var r=0,i=e.length;re[0]?i[0]=t[0]:i[0]=e[0],t[1]>e[1]?i[1]=t[1]:i[1]=e[1],t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function ye(t){return t[2]1)for(var o=t[2]-t[0],s=t[3]-t[1],a=0;a=r[2])){var n=fe(r),o=Math.floor((i[0]-r[0])/n)*n;t[0]-=o,t[2]-=o}return t}var xe=function(){function t(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||mt[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},t.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},t.prototype.setWorldExtent=function(t){this.worldExtent_=t},t.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}();function we(t,e,r){return Math.min(Math.max(t,e),r)}var be="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},Se="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function Te(t,e,r,i,n,o){var s=n-r,a=o-i;if(0!==s||0!==a){var l=((t-r)*s+(e-i)*a)/(s*s+a*a);l>1?(r=n,i=o):l>0&&(r+=s*l,i+=a*l)}return Ce(t,e,r,i)}function Ce(t,e,r,i){var n=r-t,o=i-e;return n*n+o*o}function Ee(t){return 180*t/Math.PI}function Re(t){return t*Math.PI/180}function Pe(t,e){var r=t%e;return r*e<0?r+e:r}function Ie(t,e,r){return t+r*(e-t)}var Oe=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Le=6378137*Math.PI,Me=[-Le,-Le,Le,Le],Fe=[-180,-85,180,85],Ae=function(t){function e(e){return t.call(this,{code:e,units:_t.METERS,extent:Me,global:!0,worldExtent:Fe,getPointResolution:function(t,e){return t/be(e[1]/6378137)}})||this}return Oe(e,t),e}(xe),ke=[new Ae("EPSG:3857"),new Ae("EPSG:102100"),new Ae("EPSG:102113"),new Ae("EPSG:900913"),new Ae("urn:ogc:def:crs:EPSG:6.18:3:3857"),new Ae("urn:ogc:def:crs:EPSG::3857"),new Ae("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Ne(t,e,r){var i=t.length,n=r>1?r:2,o=e;void 0===o&&(o=n>2?t.slice():new Array(i));for(var s=Le,a=0;as?l=s:l<-s&&(l=-s),o[a+1]=l}return o}function je(t,e,r){var i=t.length,n=r>1?r:2,o=e;void 0===o&&(o=n>2?t.slice():new Array(i));for(var s=0;se?i:new Array(1+e-n).join("0")+i}function $e(t,e){for(var r=(""+t).split("."),i=(""+e).split("."),n=0;ns)return 1;if(s>o)return-1}return 0}function Qe(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function tr(t,e){var r,i,n=t[0],o=t[1],s=e[0],a=e[1],l=s[0],u=s[1],h=a[0],c=a[1],p=h-l,d=c-u,f=0===p&&0===d?0:(p*(n-l)+d*(o-u))/(p*p+d*d||0);return f<=0?(r=l,i=u):f>=1?(r=h,i=c):(r=l+f*p,i=u+f*d),[r,i]}function er(t,e,r){var i=Pe(e+180,360)-180,n=Math.abs(3600*i),o=r||0,s=Math.pow(10,o),a=Math.floor(n/3600),l=Math.floor((n-3600*a)/60),u=n-3600*a-60*l;return(u=Math.ceil(u*s)/s)>=60&&(u=0,l+=1),l>=60&&(l=0,a+=1),a+"° "+Je(l,2)+"′ "+Je(u,2,o)+"″"+(0==i?"":" "+t.charAt(i<0?1:0))}function rr(t,e,r){return t?e.replace("{x}",t[0].toFixed(r)).replace("{y}",t[1].toFixed(r)):""}function ir(t,e){for(var r=!0,i=t.length-1;i>=0;--i)if(t[i]!=e[i]){r=!1;break}return r}function nr(t,e){var r=Math.cos(e),i=Math.sin(e),n=t[0]*r-t[1]*i,o=t[1]*r+t[0]*i;return t[0]=n,t[1]=o,t}function or(t,e){return t[0]*=e,t[1]*=e,t}function sr(t,e){var r=t[0]-e[0],i=t[1]-e[1];return r*r+i*i}function ar(t,e){return Math.sqrt(sr(t,e))}function lr(t,e){return sr(t,tr(t,e))}function ur(t,e){return rr(t,"{x}, {y}",e)}function hr(t,e){var r=fe(e.getExtent()),i=cr(t,e,r);return i&&(t[0]-=i*r),t}function cr(t,e,r){var i=e.getExtent(),n=0;if(e.canWrapX()&&(t[0]i[2])){var o=r||fe(i);n=Math.floor((t[0]-i[0])/o)}return n}function pr(t,e,r){var i;if(void 0!==e){for(var n=0,o=t.length;n=2;--u)s[a+u]=e[a+u]}return s}}function xr(t,e,r,i){var n=gr(t),o=gr(e);Ve(n,o,vr(r)),Ve(o,n,vr(i))}function wr(t,e){if(t===e)return!0;var r=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||br(t,e)===pr)&&r}function br(t,e){var r=Xe(t.getCode(),e.getCode());return r||(r=dr),r}function Sr(t,e){return br(gr(t),gr(e))}function Tr(t,e,r){return Sr(e,r)(t,void 0,t.length)}function Cr(t,e,r,i){return _e(t,Sr(e,r),void 0,i)}var Er,Rr,Pr,Ir=null;function Or(){return Ir}function Lr(t,e){return Ir?Tr(t,e,Ir):t}function Mr(t,e){return Ir?Tr(t,Ir,e):t}function Fr(t,e){return Ir?Cr(t,e,Ir):t}function Ar(t,e){return Ir?Cr(t,Ir,e):t}function kr(t,e,r){return function(i){var n,o,s=i[0],a=i[1];if(t.canWrapX()){var l=t.getExtent(),u=fe(l);(o=cr(i,t,u))&&(s-=o*u),s=we(s,l[0],l[2]),a=we(a,l[1],l[3]),n=r([s,a])}else n=r(i);return o&&e.canWrapX()&&(n[0]+=o*fe(e.getExtent())),n}}function Nr(t,e,r,i,n,o){for(var s=o||[],a=0,l=e;l1)a=r;else{if(p>0){for(var d=0;dn&&(n=u),o=a,s=l}return n}function qr(t,e,r,i,n){for(var o=0,s=r.length;o0;){for(var c=u.pop(),p=u.pop(),d=0,f=t[p],g=t[p+1],y=t[c],m=t[c+1],_=p+i;_d&&(h=_,d=v)}d>n&&(l[(h-e)/i]=1,p+i0&&g>d)&&(f<0&&y0&&y>f)?(a=c,l=p):(o[s++]=a,o[s++]=l,u=a,h=l,a=c,l=p)}}return o[s++]=a,o[s++]=l,s}function ii(t,e,r,i,n,o,s,a){for(var l=0,u=r.length;lo&&(u-a)*(o-l)-(n-a)*(h-l)>0&&s++:h<=o&&(u-a)*(o-l)-(n-a)*(h-l)<0&&s--,a=u,l=h}return 0!==s}function gi(t,e,r,i,n,o){if(0===r.length)return!1;if(!fi(t,e,r[0],i,n,o))return!1;for(var s=1,a=r.length;sw&&gi(t,e,r,i,u=(h+c)/2,g)&&(x=u,w=b),h=c}return isNaN(x)&&(x=n[o]),s?(s.push(x,g,w),s):[x,g,w]}function mi(t,e,r,i,n){for(var o=[],s=0,a=r.length;s=n[0]&&o[2]<=n[2]||(o[1]>=n[1]&&o[3]<=n[3]||_i(t,e,r,i,(function(t,e){return function(t,e,r){var i=!1,n=Vt(t,e),o=Vt(t,r);if(n===Ft||o===Ft)i=!0;else{var s=t[0],a=t[1],l=t[2],u=t[3],h=e[0],c=e[1],p=r[0],d=r[1],f=(d-c)/(p-h),g=void 0,y=void 0;o&At&&!(n&At)&&(i=(g=p-(d-u)/f)>=s&&g<=l),i||!(o&kt)||n&kt||(i=(y=d-(p-l)*f)>=a&&y<=u),i||!(o&Nt)||n&Nt||(i=(g=p-(d-a)/f)>=s&&g<=l),i||!(o&jt)||n&jt||(i=(y=d-(p-s)*f)>=a&&y<=u)}return i}(n,t,e)})))))}function xi(t,e,r,i,n){if(!function(t,e,r,i,n){return!!vi(t,e,r,i,n)||(!!fi(t,e,r,i,n[0],n[1])||(!!fi(t,e,r,i,n[0],n[3])||(!!fi(t,e,r,i,n[2],n[1])||!!fi(t,e,r,i,n[2],n[3]))))}(t,e,r[0],i,n))return!1;if(1===r.length)return!0;for(var o=1,s=r.length;oo||(u==o&&l>=s||(n=a,o=u,s=l))}return n}(t,e,r,i),a=s-i;a=r&&(l=e);var u=t[a],h=t[a+1],c=t[s],p=t[s+1],d=t[l],f=t[l+1];return c*f+u*p+h*d-(h*c+p*d+u*f)<0}function Si(t,e,r,i,n){for(var o=void 0!==n&&n,s=0,a=r.length;s0&&this.points_[r+2]>t;)r-=3;var i=this.points_[e+2]-this.points_[r+2];if(i<1e3/60)return!1;var n=this.points_[e]-this.points_[r],o=this.points_[e+1]-this.points_[r+1];return this.angle_=Math.atan2(o,n),this.initialVelocity_=Math.sqrt(n*n+o*o)/i,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),qi=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Zi=/^([a-z]*)$|^hsla?\(.*\)$/i;function Ki(t){return"string"==typeof t?t:rn(t)}function Hi(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var r=getComputedStyle(e).color;return document.body.removeChild(e),r}return""}var Ji,$i,Qi=(Ji={},$i=0,function(t){var e;if(Ji.hasOwnProperty(t))e=Ji[t];else{if($i>=1024){var r=0;for(var i in Ji)0==(3&r++)&&(delete Ji[i],--$i)}e=function(t){var e,r,i,n,o;if(Zi.exec(t)&&(t=Hi(t)),qi.exec(t)){var s=t.length-1,a=void 0;a=s<=4?1:2;var l=4===s||8===s;e=parseInt(t.substr(1+0*a,a),16),r=parseInt(t.substr(1+1*a,a),16),i=parseInt(t.substr(1+2*a,a),16),n=l?parseInt(t.substr(1+3*a,a),16):255,1==a&&(e=(e<<4)+e,r=(r<<4)+r,i=(i<<4)+i,l&&(n=(n<<4)+n)),o=[e,r,i,n/255]}else 0==t.indexOf("rgba(")?en(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),en(o)):lt(!1,14);return o}(t),Ji[t]=e,++$i}return e});function tn(t){return Array.isArray(t)?t:Qi(t)}function en(t){return t[0]=we(t[0]+.5|0,0,255),t[1]=we(t[1]+.5|0,0,255),t[2]=we(t[2]+.5|0,0,255),t[3]=we(t[3],0,1),t}function rn(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var r=t[1];r!=(0|r)&&(r=r+.5|0);var i=t[2];return i!=(0|i)&&(i=i+.5|0),"rgba("+e+","+r+","+i+","+(void 0===t[3]?1:t[3])+")"}var nn=function(){function t(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return t.prototype.clear=function(){this.cache_={},this.cacheSize_=0},t.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var r=this.cache_[e];0!=(3&t++)||r.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,r){var i=on(t,e,r);return i in this.cache_?this.cache_[i]:null},t.prototype.set=function(t,e,r,i){var n=on(t,e,r);this.cache_[n]=i,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}();function on(t,e,r){return e+":"+t+":"+(r?Ki(r):"null")}var sn=new nn,an="opacity",ln="visible",un="extent",hn="zIndex",cn="maxResolution",pn="minResolution",dn="maxZoom",fn="minZoom",gn="source",yn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),mn=function(t){function e(e){var r=t.call(this)||this,i=T({},e);return i[an]=void 0!==e.opacity?e.opacity:1,lt("number"==typeof i[an],64),i[ln]=void 0===e.visible||e.visible,i[hn]=e.zIndex,i[cn]=void 0!==e.maxResolution?e.maxResolution:1/0,i[pn]=void 0!==e.minResolution?e.minResolution:0,i[fn]=void 0!==e.minZoom?e.minZoom:-1/0,i[dn]=void 0!==e.maxZoom?e.maxZoom:1/0,r.className_=void 0!==i.className?e.className:"ol-layer",delete i.className,r.setProperties(i),r.state_=null,r}return yn(e,t),e.prototype.getClassName=function(){return this.className_},e.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},r=this.getZIndex();return e.opacity=we(Math.round(100*this.getOpacity())/100,0,1),e.sourceState=this.getSourceState(),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==r?r:!1===e.managed?1/0:0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},e.prototype.getLayersArray=function(t){return i()},e.prototype.getLayerStatesArray=function(t){return i()},e.prototype.getExtent=function(){return this.get(un)},e.prototype.getMaxResolution=function(){return this.get(cn)},e.prototype.getMinResolution=function(){return this.get(pn)},e.prototype.getMinZoom=function(){return this.get(fn)},e.prototype.getMaxZoom=function(){return this.get(dn)},e.prototype.getOpacity=function(){return this.get(an)},e.prototype.getSourceState=function(){return i()},e.prototype.getVisible=function(){return this.get(ln)},e.prototype.getZIndex=function(){return this.get(hn)},e.prototype.setExtent=function(t){this.set(un,t)},e.prototype.setMaxResolution=function(t){this.set(cn,t)},e.prototype.setMinResolution=function(t){this.set(pn,t)},e.prototype.setMaxZoom=function(t){this.set(dn,t)},e.prototype.setMinZoom=function(t){this.set(fn,t)},e.prototype.setOpacity=function(t){lt("number"==typeof t,64),this.set(an,t)},e.prototype.setVisible=function(t){this.set(ln,t)},e.prototype.setZIndex=function(t){this.set(hn,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(et),_n="prerender",vn="postrender",xn="precompose",wn="postcompose",bn="rendercomplete",Sn="undefined",Tn="loading",Cn="ready",En="error",Rn=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function Pn(t,e){if(!t.visible)return!1;var r=e.resolution;if(r=t.maxResolution)return!1;var i=e.zoom;return i>t.minZoom&&i<=t.maxZoom}var In=function(t){function e(e){var r=this,i=T({},e);delete i.source,(r=t.call(this,i)||this).mapPrecomposeKey_=null,r.mapRenderKey_=null,r.sourceChangeKey_=null,r.renderer_=null,e.render&&(r.render=e.render),e.map&&r.setMap(e.map),r.addEventListener(tt(gn),r.handleSourcePropertyChange_);var n=e.source?e.source:null;return r.setSource(n),r}return Rn(e,t),e.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},e.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},e.prototype.getSource=function(){return this.get(gn)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():Sn},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(X(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=W(t,O,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(t){return this.renderer_.getFeatures(t)},e.prototype.render=function(t,e){var r=this.getRenderer();if(r.prepareFrame(t))return r.renderFrame(t,e)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(X(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(X(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=W(t,xn,(function(t){var e=t.frameState.layerStatesArray,r=this.getLayerState(!1);lt(!e.some((function(t){return t.layer===r.layer})),67),e.push(r)}),this),this.mapRenderKey_=W(this,O,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(gn,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.setSource(null),t.prototype.disposeInternal.call(this)},e}(mn),On=function(){function t(){}return t.prototype.drawCustom=function(t,e,r){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,e){},t.prototype.drawFeature=function(t,e){},t.prototype.drawGeometryCollection=function(t,e){},t.prototype.drawLineString=function(t,e){},t.prototype.drawMultiLineString=function(t,e){},t.prototype.drawMultiPoint=function(t,e){},t.prototype.drawMultiPolygon=function(t,e){},t.prototype.drawPoint=function(t,e){},t.prototype.drawPolygon=function(t,e){},t.prototype.drawText=function(t,e){},t.prototype.setFillStrokeStyle=function(t,e){},t.prototype.setImageStyle=function(t,e){},t.prototype.setTextStyle=function(t,e){},t}();function Ln(t){return Array.isArray(t)?rn(t):t}var Mn="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",Fn=-1!==Mn.indexOf("firefox"),An=(-1!==Mn.indexOf("safari")&&Mn.indexOf("chrom"),-1!==Mn.indexOf("webkit")&&-1==Mn.indexOf("edge")),kn=-1!==Mn.indexOf("macintosh"),Nn="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,jn="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,Dn="undefined"!=typeof Image&&Image.prototype.decode,Gn=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch(t){}return t}();function zn(t,e,r){var i=r&&r.length?r.shift():jn?new OffscreenCanvas(t||300,e||300):document.createElement("canvas");return t&&(i.width=t),e&&(i.height=e),i.getContext("2d")}function Bn(t){var e=t.offsetWidth,r=getComputedStyle(t);return e+=parseInt(r.marginLeft,10)+parseInt(r.marginRight,10)}function Un(t){var e=t.offsetHeight,r=getComputedStyle(t);return e+=parseInt(r.marginTop,10)+parseInt(r.marginBottom,10)}function Yn(t,e){var r=e.parentNode;r&&r.replaceChild(t,e)}function Wn(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function Vn(t){for(;t.lastChild;)t.removeChild(t.lastChild)}var Xn=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z]+?)\\s*$"].join(""),"i"),qn=["style","variant","weight","size","lineHeight","family"],Zn=function(t){var e=t.match(Xn);if(!e)return null;for(var r={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},i=0,n=qn.length;i=0;--i)for(var n=r[i],o=n.items,s=0,a=o.length;s=0;--x){var w=y[x],b=w.layer;if(b.hasRenderer()&&Pn(w,u)&&s.call(a,b)){var S=b.getRenderer(),T=b.getSource();if(S&&T){var C=T.getWrapX()?p:t,E=h.bind(null,w.managed);_[0]=C[0]+d[v][0],_[1]=C[1]+d[v][1],l=S.forEachFeatureAtCoordinate(_,e,r,E,g)}if(l)return l}}},e.prototype.forEachLayerAtPixel=function(t,e,r,n,o){return i()},e.prototype.hasFeatureAtCoordinate=function(t,e,r,i,n,o){return void 0!==this.forEachFeatureAtCoordinate(t,e,r,i,w,this,n,o)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){this.declutterTree_=Fo(t,this.declutterTree_)},e.prototype.scheduleExpireIconCache=function(t){sn.canExpireCache()&&t.postRenderFunctions.push(ko)},e}(p),jo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Do=function(t){function e(e,r,i,n){var o=t.call(this,e)||this;return o.inversePixelTransform=r,o.frameState=i,o.context=n,o}return jo(e,t),e}(h),Go=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),zo=function(t){function e(e){var r=t.call(this,e)||this;r.fontChangeListenerKey_=W(Jn,c,e.redrawText.bind(e)),r.element_=document.createElement("div");var i=r.element_.style;i.position="absolute",i.width="100%",i.height="100%",i.zIndex="0",r.element_.className="ol-unselectable ol-layers";var n=e.getViewport();return n.insertBefore(r.element_,n.firstChild||null),r.children_=[],r.renderedVisible_=!0,r}return Go(e,t),e.prototype.dispatchRenderEvent=function(t,e){var r=this.getMap();if(r.hasListener(t)){var i=new Do(t,void 0,e);r.dispatchEvent(i)}},e.prototype.disposeInternal=function(){X(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),t.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(e){if(e){this.calculateMatrices2D(e),this.dispatchRenderEvent(xn,e);var r=e.layerStatesArray.sort((function(t,e){return t.zIndex-e.zIndex})),i=e.viewState;this.children_.length=0;for(var n=null,o=0,s=r.length;o=0;--a){var l=s[a],u=l.layer;if(u.hasRenderer()&&Pn(l,o)&&n(u)){var h=u.getRenderer().getDataAtPixel(t,e,r);if(h){var c=i(u,h);if(c)return c}}}},e}(No),Bo=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Uo="layers",Yo=function(t){function e(e){var r=this,i=e||{},n=T({},i);delete n.layers;var o=i.layers;return(r=t.call(this,n)||this).layersListenerKeys_=[],r.listenerKeys_={},r.addEventListener(tt(Uo),r.handleLayersChanged_),o?Array.isArray(o)?o=new at(o.slice(),{unique:!0}):lt("function"==typeof o.getArray,43):o=new at(void 0,{unique:!0}),r.setLayers(o),r}return Bo(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(X),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(W(t,rt,this.handleLayersAdd_,this),W(t,it,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(X);C(this.listenerKeys_);for(var r=t.getArray(),i=0,n=r.length;ithis.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(X(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(U,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(X(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(X),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(I),es="postrender",rs="movestart",is="moveend",ns="layergroup",os="size",ss="target",as="view",ls=function(){function t(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,C(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,r=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var i=this.keyFunction_(r);return delete this.queuedElements_[i],r},t.prototype.enqueue=function(t){lt(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=1/0&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,r=this.priorities_,i=e.length,n=e[t],o=r[t],s=t;t>1;){var a=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),u=lt;){var s=this.getParentIndex_(e);if(!(i[s]>o))break;r[e]=r[s],i[e]=i[s],e=s}r[e]=n,i[e]=o},t.prototype.reprioritize=function(){var t,e,r,i=this.priorityFunction_,n=this.elements_,o=this.priorities_,s=0,a=n.length;for(e=0;e0;)i=(r=this.dequeue()[0]).getKey(),r.getState()!==us||i in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[i]=!0,++this.tilesLoading_,++n,r.load())},e}(ls);var ys=0,ms=1,_s="center",vs="resolution",xs="rotation";function ws(t,e,r){return function(i,n,o,s){if(i){var a=e?0:o[0]*n,l=e?0:o[1]*n,u=t[0]+a/2,h=t[2]-a/2,c=t[1]+l/2,p=t[3]-l/2;u>h&&(h=u=(h+u)/2),c>p&&(p=c=(p+c)/2);var d=we(i[0],u,h),f=we(i[1],c,p),g=30*n;return s&&r&&(d+=-g*Math.log(1+Math.max(0,u-i[0])/g)+g*Math.log(1+Math.max(0,i[0]-h)/g),f+=-g*Math.log(1+Math.max(0,c-i[1])/g)+g*Math.log(1+Math.max(0,i[1]-p)/g)),[d,f]}}}function bs(t){return t}function Ss(t,e,r,i){var n=fe(e)/r[0],o=he(e)/r[1];return i?Math.min(t,Math.max(n,o)):Math.min(t,Math.min(n,o))}function Ts(t,e,r){var i=Math.min(t,e);return i*=Math.log(1+50*Math.max(0,t/e-1))/50+1,r&&(i=Math.max(i,r),i/=Math.log(1+50*Math.max(0,r/t-1))/50+1),we(i,r/2,2*e)}function Cs(t,e,r,i,n){return function(o,s,a,l){if(void 0!==o){var u=i?Ss(t,i,a,n):t;return(void 0===r||r)&&l?Ts(o,u,e):we(o,e,u)}}}function Es(t){return void 0!==t?0:void 0}function Rs(t){return void 0!==t?t:void 0}function Ps(t){return Math.pow(t,3)}function Is(t){return 1-Ps(1-t)}function Os(t){return 3*t*t-2*t*t*t}function Ls(t){return t}var Ms=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function Fs(t,e){setTimeout((function(){t(e)}),0)}function As(t){return!(t.sourceCenter&&t.targetCenter&&!ir(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}var ks=function(t){function e(e){var r=t.call(this)||this,i=T({},e);return r.hints_=[0,0],r.animations_=[],r.updateAnimationKey_,r.projection_=_r(i.projection,"EPSG:3857"),r.viewportSize_=[100,100],r.targetCenter_=null,r.targetResolution_,r.targetRotation_,r.cancelAnchor_=void 0,i.center&&(i.center=Mr(i.center,r.projection_)),i.extent&&(i.extent=Ar(i.extent,r.projection_)),r.applyOptions_(i),r}return Ms(e,t),e.prototype.applyOptions_=function(t){var e=function(t){var e,r,i,n=void 0!==t.minZoom?t.minZoom:0,o=void 0!==t.maxZoom?t.maxZoom:28,s=void 0!==t.zoomFactor?t.zoomFactor:2,a=void 0!==t.multiWorld&&t.multiWorld,l=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,u=void 0!==t.showFullExtent&&t.showFullExtent,h=_r(t.projection,"EPSG:3857"),c=h.getExtent(),p=t.constrainOnlyCenter,d=t.extent;a||d||!h.isGlobal()||(p=!1,d=c);if(void 0!==t.resolutions){var f=t.resolutions;r=f[n],i=void 0!==f[o]?f[o]:f[f.length-1],e=t.constrainResolution?function(t,e,r,i){return function(n,o,s,a){if(void 0!==n){var l=t[0],u=t[t.length-1],h=r?Ss(l,r,s,i):l;if(a)return void 0===e||e?Ts(n,h,u):we(n,u,h);var c=Math.min(h,n),p=Math.floor(g(t,c,o));return t[p]>h&&p1&&"function"==typeof arguments[r-1]&&(e=arguments[r-1],--r),!this.isDef()){var i=arguments[r-1];return i.center&&this.setCenterInternal(i.center),void 0!==i.zoom&&this.setZoom(i.zoom),void 0!==i.rotation&&this.setRotation(i.rotation),void(e&&Fs(e,!0))}for(var n=Date.now(),o=this.targetCenter_.slice(),s=this.targetResolution_,a=this.targetRotation_,l=[],u=0;u0},e.prototype.getInteracting=function(){return this.hints_[ms]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(ys,-this.hints_[ys]);for(var e=0,r=this.animations_.length;e=0;--r){for(var i=this.animations_[r],n=!0,o=0,s=i.length;o0?l/a.duration:1;u>=1?(a.complete=!0,u=1):n=!1;var h=a.easing(u);if(a.sourceCenter){var c=a.sourceCenter[0],p=a.sourceCenter[1],d=c+h*(a.targetCenter[0]-c),f=p+h*(a.targetCenter[1]-p);this.targetCenter_=[d,f]}if(a.sourceResolution&&a.targetResolution){var g=1===h?a.targetResolution:a.sourceResolution+h*(a.targetResolution-a.sourceResolution);if(a.anchor){var y=this.getViewportSize_(this.getRotation()),m=this.constraints_.resolution(g,0,y,!0);this.targetCenter_=this.calculateCenterZoom(m,a.anchor)}this.targetResolution_=g,this.applyTargetState_(!0)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){var _=1===h?Pe(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+h*(a.targetRotation-a.sourceRotation);if(a.anchor){var v=this.constraints_.rotation(_,!0);this.targetCenter_=this.calculateCenterRotate(v,a.anchor)}this.targetRotation_=_}if(this.applyTargetState_(!0),e=!0,!a.complete)break}}if(n){this.animations_[r]=null,this.setHint(ys,-1);var x=i[0].callback;x&&Fs(x,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,e){var r,i=this.getCenterInternal();return void 0!==i&&(nr(r=[i[0]-e[0],i[1]-e[1]],t-this.getRotation()),Qe(r,e)),r},e.prototype.calculateCenterZoom=function(t,e){var r,i=this.getCenterInternal(),n=this.getResolution();void 0!==i&&void 0!==n&&(r=[e[0]-t*(e[0]-i[0])/n,e[1]-t*(e[1]-i[1])/n]);return r},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var r=e[0],i=e[1];return[Math.abs(r*Math.cos(t))+Math.abs(i*Math.sin(t)),Math.abs(r*Math.sin(t))+Math.abs(i*Math.cos(t))]}return e},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t?Lr(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(_s)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.options_.constrainResolution},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){return Fr(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSize_(),r=this.getCenterInternal();lt(r,1);var i=this.getResolution();lt(void 0!==i,2);var n=this.getRotation();return lt(void 0!==n,3),ue(r,i,n,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(vs)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(Ar(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var r=e||this.getViewportSize_(),i=fe(t)/r[0],n=he(t)/r[1];return Math.max(i,n)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,r=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,n=Math.log(r/i)/Math.log(e);return function(t){return r/Math.pow(e,t*n)}},e.prototype.getRotation=function(){return this.get(xs)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),r=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,n=Math.log(r/i)/e;return function(t){return Math.log(r/t)/e/n}},e.prototype.getState=function(){var t=this.getCenterInternal(),e=this.getProjection(),r=this.getResolution(),i=this.getRotation();return{center:t.slice(0),projection:void 0!==e?e:null,resolution:r,rotation:i,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,r,i=this.minZoom_||0;if(this.resolutions_){var n=g(this.resolutions_,t,1);i=n,e=this.resolutions_[n],r=n==this.resolutions_.length-1?2:e/this.resolutions_[n+1]}else e=this.maxResolution_,r=this.zoomFactor_;return i+Math.log(e/t)/Math.log(r)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=we(Math.floor(t),0,this.resolutions_.length-2),r=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(r,we(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var r,i=T({size:this.getViewportSize_()},e||{});if(lt(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))lt(!ye(t),25),r=Oi(n=Ar(t,this.getProjection()));else if(t.getType()===gt.CIRCLE){var n;(r=Oi(n=Ar(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),ae(n))}else{var o=Or();r=o?t.clone().transform(o,this.getProjection()):t}this.fitInternal(r,i)},e.prototype.fitInternal=function(t,e){var r=e||{},i=r.size;i||(i=this.getViewportSize_());var n,o=void 0!==r.padding?r.padding:[0,0,0,0],s=void 0!==r.nearest&&r.nearest;n=void 0!==r.minResolution?r.minResolution:void 0!==r.maxZoom?this.getResolutionForZoom(r.maxZoom):0;for(var a=t.getFlatCoordinates(),l=this.getRotation(),u=Math.cos(-l),h=Math.sin(-l),c=1/0,p=1/0,d=-1/0,f=-1/0,g=t.getStride(),y=0,m=a.length;y=0;s--){var a=o[s];if(a.getActive())if(!a.handleEvent(t))break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var r=this.maxTilesLoading_,i=r;if(t){var n=t.viewHints;if(n[ys]||n[ms]){var o=!Dn&&Date.now()-t.time>8;r=o?0:8,i=o?0:2}}e.getTilesLoading()0&&t[1]>0}(e)&&r&&r.isDef()){var o=r.getHints(this.frameState_?this.frameState_.viewHints:void 0),s=r.getState();n={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterItems:i?i.declutterItems:[],extent:ue(s.center,s.resolution,s.rotation,e),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:e,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:s,viewHints:o,wantedTiles:{}}}if(this.frameState_=n,this.renderer_.renderFrame(n),n){if(n.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,n.postRenderFunctions),i)(!this.previousExtent_||!ye(this.previousExtent_)&&!Jt(n.extent,this.previousExtent_))&&(this.dispatchEvent(new Vo(rs,this,i)),this.previousExtent_=Zt(this.previousExtent_));this.previousExtent_&&!n.viewHints[ys]&&!n.viewHints[ms]&&!Jt(n.extent,this.previousExtent_)&&(this.dispatchEvent(new Vo(is,this,n)),zt(n.extent,this.previousExtent_))}this.dispatchEvent(new Vo(es,this,n)),this.postRenderTimeoutHandle_=setTimeout(this.handlePostRender.bind(this),0)},e.prototype.setLayerGroup=function(t){this.set(ns,t)},e.prototype.setSize=function(t){this.set(os,t)},e.prototype.setTarget=function(t){this.set(ss,t)},e.prototype.setView=function(t){this.set(as,t)},e.prototype.updateSize=function(){var t=this.getTargetElement();if(t){var e=getComputedStyle(t);this.setSize([t.offsetWidth-parseFloat(e.borderLeftWidth)-parseFloat(e.paddingLeft)-parseFloat(e.paddingRight)-parseFloat(e.borderRightWidth),t.offsetHeight-parseFloat(e.borderTopWidth)-parseFloat(e.paddingTop)-parseFloat(e.paddingBottom)-parseFloat(e.borderBottomWidth)])}else this.setSize(void 0);this.updateViewportSize_()},e.prototype.updateViewportSize_=function(){var t=this.getView();if(t){var e=void 0,r=getComputedStyle(this.viewport_);r.width&&r.height&&(e=[parseInt(r.width,10),parseInt(r.height,10)]),t.setViewportSize(e)}},e}(et),Bs=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Us=function(t){function e(e){var r=t.call(this)||this,i=e.element;return!i||e.target||i.style.pointerEvents||(i.style.pointerEvents="auto"),r.element=i||null,r.target_=null,r.map_=null,r.listenerKeys=[],e.render&&(r.render=e.render),e.target&&r.setTarget(e.target),r}return Bs(e,t),e.prototype.disposeInternal=function(){Wn(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&Wn(this.element);for(var e=0,r=this.listenerKeys.length;e0;if(this.renderedVisible_!=r&&(this.element.style.display=r?"":"none",this.renderedVisible_=r),!v(e,this.renderedAttributions_)){Vn(this.ulElement_);for(var i=0,n=e.length;i0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:Is}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var r=e.viewState.rotation;if(r!=this.rotation_){var i="rotate("+r+"rad)";if(this.autoHide_){var n=this.element.classList.contains("ol-hidden");n||0!==r?n&&0!==r&&this.element.classList.remove("ol-hidden"):this.element.classList.add("ol-hidden")}this.label_.style.transform=i}this.rotation_=r}},e}(Us),qs=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Zs=function(t){function e(e){var r=this,i=e||{};r=t.call(this,{element:document.createElement("div"),target:i.target})||this;var n=void 0!==i.className?i.className:"ol-zoom",o=void 0!==i.delta?i.delta:1,s=void 0!==i.zoomInLabel?i.zoomInLabel:"+",a=void 0!==i.zoomOutLabel?i.zoomOutLabel:"−",l=void 0!==i.zoomInTipLabel?i.zoomInTipLabel:"Zoom in",u=void 0!==i.zoomOutTipLabel?i.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=n+"-in",h.setAttribute("type","button"),h.title=l,h.appendChild("string"==typeof s?document.createTextNode(s):s),h.addEventListener(F,r.handleClick_.bind(r,o),!1);var c=document.createElement("button");c.className=n+"-out",c.setAttribute("type","button"),c.title=u,c.appendChild("string"==typeof a?document.createTextNode(a):a),c.addEventListener(F,r.handleClick_.bind(r,-o),!1);var p=n+" ol-unselectable ol-control",d=r.element;return d.className=p,d.appendChild(h),d.appendChild(c),r.duration_=void 0!==i.duration?i.duration:250,r}return qs(e,t),e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var r=e.getZoom();if(void 0!==r){var i=e.getConstrainedZoom(r+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:i,duration:this.duration_,easing:Is})):e.setZoom(i)}}},e}(Us);function Ks(t){var e=t||{},r=new at;return(void 0===e.zoom||e.zoom)&&r.push(new Zs(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&r.push(new Xs(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&r.push(new Ws(e.attributionOptions)),r}var Hs="active",Js=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function $s(t,e,r,i){var n=t.getZoom();if(void 0!==n){var o=t.getConstrainedZoom(n+e),s=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:r,duration:void 0!==i?i:250,easing:Is})}}var Qs=function(t){function e(e){var r=t.call(this)||this;return e&&e.handleEvent&&(r.handleEvent=e.handleEvent),r.map_=null,r.setActive(!0),r}return Js(e,t),e.prototype.getActive=function(){return this.get(Hs)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(Hs,t)},e.prototype.setMap=function(t){this.map_=t},e}(et),ta=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),ea=function(t){function e(e){var r=t.call(this)||this,i=e||{};return r.delta_=i.delta?i.delta:1,r.duration_=void 0!==i.duration?i.duration:250,r}return ta(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Zo.DBLCLICK){var r=t.originalEvent,i=t.map,n=t.coordinate,o=r.shiftKey?-this.delta_:this.delta_;$s(i.getView(),o,n,this.duration_),t.preventDefault(),e=!0}return!e},e}(Qs),ra=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function ia(t){for(var e=t.length,r=0,i=0,n=0;n0}}else if(t.type==Zo.POINTERDOWN){var i=this.handleDownEvent(t);this.handlingDownUpSequence=i,e=this.stopDown(i)}else t.type==Zo.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===Zo.POINTERDOWN||e===Zo.POINTERDRAG||e===Zo.POINTERUP}(t)){var e=t.originalEvent,r=e.pointerId.toString();t.type==Zo.POINTERUP?delete this.trackedPointers_[r]:(t.type==Zo.POINTERDOWN||r in this.trackedPointers_)&&(this.trackedPointers_[r]=e),this.targetPointers=E(this.trackedPointers_)}},e}(Qs);function oa(t){var e=arguments;return function(t){for(var r=!0,i=0,n=e.length;i0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(na),wa=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),ba=function(t){function e(e){var r=this,i=e||{};return(r=t.call(this,{stopDown:b})||this).condition_=i.condition?i.condition:aa,r.lastAngle_=void 0,r.duration_=void 0!==i.duration?i.duration:250,r}return wa(e,t),e.prototype.handleDragEvent=function(t){if(ma(t)){var e=t.map,r=e.getView();if(r.getConstraints().rotation!==Es){var i=e.getSize(),n=t.pixel,o=Math.atan2(i[1]/2-n[1],n[0]-i[0]/2);if(void 0!==this.lastAngle_){var s=o-this.lastAngle_;r.adjustRotationInternal(-s)}this.lastAngle_=o}}},e.prototype.handleUpEvent=function(t){return!ma(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!ma(t)&&(!(!ca(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(na),Sa=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ta=function(t){function e(e){var r=t.call(this)||this;return r.geometry_=null,r.element_=document.createElement("div"),r.element_.style.position="absolute",r.element_.style.pointerEvents="auto",r.element_.className="ol-box "+e,r.map_=null,r.startPixel_=null,r.endPixel_=null,r}return Sa(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,r=this.element_.style;r.left=Math.min(t[0],e[0])+"px",r.top=Math.min(t[1],e[1])+"px",r.width=Math.abs(e[0]-t[0])+"px",r.height=Math.abs(e[1]-t[1])+"px"},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,r=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);r[4]=r[0].slice(),this.geometry_?this.geometry_.setCoordinates([r]):this.geometry_=new Pi([r])},e.prototype.getGeometry=function(){return this.geometry_},e}(p),Ca=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ea="boxstart",Ra="boxdrag",Pa="boxend",Ia=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.coordinate=r,n.mapBrowserEvent=i,n}return Ca(e,t),e}(h),Oa=function(t){function e(e){var r=t.call(this)||this,i=e||{};return r.box_=new Ta(i.className||"ol-dragbox"),r.minArea_=void 0!==i.minArea?i.minArea:64,i.onBoxEnd&&(r.onBoxEnd=i.onBoxEnd),r.startPixel_=null,r.condition_=i.condition?i.condition:ca,r.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:r.defaultBoxEndCondition,r}return Ca(e,t),e.prototype.defaultBoxEndCondition=function(t,e,r){var i=r[0]-e[0],n=r[1]-e[1];return i*i+n*n>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Ia(Ra,t.coordinate,t))},e.prototype.handleUpEvent=function(t){return this.box_.setMap(null),this.boxEndCondition_(t,this.startPixel_,t.pixel)&&(this.onBoxEnd(t),this.dispatchEvent(new Ia(Pa,t.coordinate,t))),!1},e.prototype.handleDownEvent=function(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Ia(Ea,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(na),La=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ma=function(t){function e(e){var r=this,i=e||{},n=i.condition?i.condition:ga;return(r=t.call(this,{condition:n,className:i.className||"ol-dragzoom",minArea:i.minArea})||this).duration_=void 0!==i.duration?i.duration:200,r.out_=void 0!==i.out&&i.out,r}return La(e,t),e.prototype.onBoxEnd=function(t){var e,r,i=this.getMap(),n=i.getView(),o=i.getSize(),s=this.getGeometry().getExtent();if(this.out_){var a=n.calculateExtentInternal(o),l=(e=[i.getPixelFromCoordinateInternal(oe(s)),i.getPixelFromCoordinateInternal(de(s))],te(Zt(r),e));me(a,1/n.getResolutionForExtentInternal(l,o)),s=a}var u=n.getConstrainedResolution(n.getResolutionForExtentInternal(s,o)),h=n.getConstrainedCenter(ae(s),u);n.animateInternal({resolution:u,center:h,duration:this.duration_,easing:Is})},e}(Oa),Fa=37,Aa=38,ka=39,Na=40,ja=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Da=function(t){function e(e){var r=t.call(this)||this,i=e||{};return r.defaultCondition_=function(t){return fa(t)&&ya(t)},r.condition_=void 0!==i.condition?i.condition:r.defaultCondition_,r.duration_=void 0!==i.duration?i.duration:100,r.pixelDelta_=void 0!==i.pixelDelta?i.pixelDelta:128,r}return ja(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==D){var r=t.originalEvent.keyCode;if(this.condition_(t)&&(r==Na||r==Fa||r==ka||r==Aa)){var i=t.map.getView(),n=i.getResolution()*this.pixelDelta_,o=0,s=0;r==Na?s=-n:r==Fa?o=-n:r==ka?o=n:s=n;var a=[o,s];nr(a,i.getRotation()),function(t,e,r){var i=t.getCenterInternal();if(i){var n=[i[0]+e[0],i[1]+e[1]];t.animateInternal({duration:void 0!==r?r:250,easing:Ls,center:t.getConstrainedCenter(n)})}}(i,a,this.duration_),t.preventDefault(),e=!0}}return!e},e}(Qs),Ga=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),za=function(t){function e(e){var r=t.call(this)||this,i=e||{};return r.condition_=i.condition?i.condition:ya,r.delta_=i.delta?i.delta:1,r.duration_=void 0!==i.duration?i.duration:100,r}return Ga(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==D||t.type==G){var r=t.originalEvent.charCode;if(this.condition_(t)&&(r=="+".charCodeAt(0)||r=="-".charCodeAt(0))){var i=t.map,n=r=="+".charCodeAt(0)?this.delta_:-this.delta_;$s(i.getView(),n,void 0,this.duration_),t.preventDefault(),e=!0}}return!e},e}(Qs),Ba=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ua="trackpad",Ya="wheel",Wa=function(t){function e(e){var r=this,i=e||{};(r=t.call(this,i)||this).totalDelta_=0,r.lastDelta_=0,r.maxDelta_=void 0!==i.maxDelta?i.maxDelta:1,r.duration_=void 0!==i.duration?i.duration:250,r.timeout_=void 0!==i.timeout?i.timeout:80,r.useAnchor_=void 0===i.useAnchor||i.useAnchor,r.constrainResolution_=void 0!==i.constrainResolution&&i.constrainResolution;var n=i.condition?i.condition:ha;return r.condition_=i.onFocusOnly?oa(ua,n):n,r.lastAnchor_=null,r.startTime_=void 0,r.timeoutId_,r.mode_=void 0,r.trackpadEventGap_=400,r.trackpadTimeoutId_,r.deltaPerZoom_=300,r}return Ba(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==Y)return!0;t.preventDefault();var e,r=t.map,i=t.originalEvent;if(this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==Y&&(e=i.deltaY,Fn&&i.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=Nn),i.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var n=Date.now();void 0===this.startTime_&&(this.startTime_=n),(!this.mode_||n-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?Ua:Ya);var o=r.getView();if(this.mode_===Ua&&!o.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(o.getAnimating()&&o.cancelAnimations(),o.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),o.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=n,!1;this.totalDelta_+=e;var s=Math.max(this.timeout_-(n-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,r),s),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var r=-we(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(r=r?r>0?1:-1:0),$s(e,r,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(Qs),Va=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Xa=function(t){function e(e){var r=this,i=e||{},n=i;return n.stopDown||(n.stopDown=b),(r=t.call(this,n)||this).anchor_=null,r.lastAngle_=void 0,r.rotating_=!1,r.rotationDelta_=0,r.threshold_=void 0!==i.threshold?i.threshold:.3,r.duration_=void 0!==i.duration?i.duration:250,r}return Va(e,t),e.prototype.handleDragEvent=function(t){var e=0,r=this.targetPointers[0],i=this.targetPointers[1],n=Math.atan2(i.clientY-r.clientY,i.clientX-r.clientX);if(void 0!==this.lastAngle_){var o=n-this.lastAngle_;this.rotationDelta_+=o,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=o}this.lastAngle_=n;var s=t.map,a=s.getView();if(a.getConstraints().rotation!==Es){var l=s.getViewport().getBoundingClientRect(),u=ia(this.targetPointers);u[0]-=l.left,u[1]-=l.top,this.anchor_=s.getCoordinateFromPixelInternal(u),this.rotating_&&(s.render(),a.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(na),qa=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Za=function(t){function e(e){var r=this,i=e||{},n=i;return n.stopDown||(n.stopDown=b),(r=t.call(this,n)||this).anchor_=null,r.duration_=void 0!==i.duration?i.duration:400,r.lastDistance_=void 0,r.lastScaleDelta_=1,r}return qa(e,t),e.prototype.handleDragEvent=function(t){var e=1,r=this.targetPointers[0],i=this.targetPointers[1],n=r.clientX-i.clientX,o=r.clientY-i.clientY,s=Math.sqrt(n*n+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/s),this.lastDistance_=s;var a=t.map,l=a.getView();1!=e&&(this.lastScaleDelta_=e);var u=a.getViewport().getBoundingClientRect(),h=ia(this.targetPointers);h[0]-=u.left,h[1]-=u.top,this.anchor_=a.getCoordinateFromPixelInternal(h),a.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),r=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,r),!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(na);function Ka(t){var e=t||{},r=new at,i=new Xi(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&r.push(new ba),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&r.push(new ea({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&r.push(new xa({onFocusOnly:e.onFocusOnly,kinetic:i})),(void 0===e.pinchRotate||e.pinchRotate)&&r.push(new Xa),(void 0===e.pinchZoom||e.pinchZoom)&&r.push(new Za({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(r.push(new Da),r.push(new za({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&r.push(new Wa({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&r.push(new Ma({duration:e.zoomDuration})),r}var Ha=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ja=function(t){function e(e){return(e=T({},e)).controls||(e.controls=Ks()),e.interactions||(e.interactions=Ka({onFocusOnly:!0})),t.call(this,e)||this}return Ha(e,t),e.prototype.createRenderer=function(){return new zo(this)},e}(zs),$a="bottom-left",Qa="bottom-center",tl="bottom-right",el="center-left",rl="center-center",il="center-right",nl="top-left",ol="top-center",sl="top-right",al=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),ll="element",ul="map",hl="offset",cl="position",pl="positioning",dl=function(t){function e(e){var r=t.call(this)||this;r.options=e,r.id=e.id,r.insertFirst=void 0===e.insertFirst||e.insertFirst,r.stopEvent=void 0===e.stopEvent||e.stopEvent,r.element=document.createElement("div"),r.element.className=void 0!==e.className?e.className:"ol-overlay-container ol-selectable",r.element.style.position="absolute",r.element.style.pointerEvents="auto";var i=e.autoPan;return i&&"object"!=typeof i&&(i={animation:e.autoPanAnimation,margin:e.autoPanMargin}),r.autoPan=i||!1,r.rendered={transform_:"",visible:!0},r.mapPostrenderListenerKey=null,r.addEventListener(tt(ll),r.handleElementChanged),r.addEventListener(tt(ul),r.handleMapChanged),r.addEventListener(tt(hl),r.handleOffsetChanged),r.addEventListener(tt(cl),r.handlePositionChanged),r.addEventListener(tt(pl),r.handlePositioningChanged),void 0!==e.element&&r.setElement(e.element),r.setOffset(void 0!==e.offset?e.offset:[0,0]),r.setPositioning(void 0!==e.positioning?e.positioning:nl),void 0!==e.position&&r.setPosition(e.position),r}return al(e,t),e.prototype.getElement=function(){return this.get(ll)},e.prototype.getId=function(){return this.id},e.prototype.getMap=function(){return this.get(ul)},e.prototype.getOffset=function(){return this.get(hl)},e.prototype.getPosition=function(){return this.get(cl)},e.prototype.getPositioning=function(){return this.get(pl)},e.prototype.handleElementChanged=function(){Vn(this.element);var t=this.getElement();t&&this.element.appendChild(t)},e.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(Wn(this.element),X(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=W(t,es,this.render,this),this.updatePixelPosition();var e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element),this.performAutoPan()}},e.prototype.render=function(){this.updatePixelPosition()},e.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},e.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.performAutoPan()},e.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},e.prototype.setElement=function(t){this.set(ll,t)},e.prototype.setMap=function(t){this.set(ul,t)},e.prototype.setOffset=function(t){this.set(hl,t)},e.prototype.setPosition=function(t){this.set(cl,t)},e.prototype.performAutoPan=function(){this.autoPan&&this.panIntoView(this.autoPan)},e.prototype.panIntoView=function(t){var e=this.getMap();if(e&&e.getTargetElement()&&this.get(cl)){var r=this.getRect(e.getTargetElement(),e.getSize()),i=this.getElement(),n=this.getRect(i,[Bn(i),Un(i)]),o=t||{},s=void 0===o.margin?20:o.margin;if(!Yt(r,n)){var a=n[0]-r[0],l=r[2]-n[2],u=n[1]-r[1],h=r[3]-n[3],c=[0,0];if(a<0?c[0]=a-s:l<0&&(c[0]=Math.abs(l)+s),u<0?c[1]=u-s:h<0&&(c[1]=Math.abs(h)+s),0!==c[0]||0!==c[1]){var p=e.getView().getCenterInternal(),d=e.getPixelFromCoordinateInternal(p),f=[d[0]+c[0],d[1]+c[1]],g=o.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(f),duration:g.duration,easing:g.easing})}}}},e.prototype.getRect=function(t,e){var r=t.getBoundingClientRect(),i=r.left+window.pageXOffset,n=r.top+window.pageYOffset;return[i,n,i+e[0],n+e[1]]},e.prototype.setPositioning=function(t){this.set(pl,t)},e.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},e.prototype.updatePixelPosition=function(){var t=this.getMap(),e=this.getPosition();if(t&&t.isRendered()&&e){var r=t.getPixelFromCoordinate(e),i=t.getSize();this.updateRenderedPosition(r,i)}else this.setVisible(!1)},e.prototype.updateRenderedPosition=function(t,e){var r=this.element.style,i=this.getOffset(),n=this.getPositioning();this.setVisible(!0);var o=Math.round(t[0]+i[0])+"px",s=Math.round(t[1]+i[1])+"px",a="0%",l="0%";n==tl||n==il||n==sl?a="-100%":n!=Qa&&n!=rl&&n!=ol||(a="-50%"),n==$a||n==Qa||n==tl?l="-100%":n!=el&&n!=rl&&n!=il||(l="-50%");var u="translate("+a+", "+l+") translate("+o+", "+s+")";this.rendered.transform_!=u&&(this.rendered.transform_=u,r.transform=u,r.msTransform=u)},e.prototype.getOptions=function(){return this.options},e}(et),fl="arraybuffer",gl="json",yl="text",ml="xml",_l=!1;function vl(t,e,r,i){return function(n,o,s){var a=new XMLHttpRequest;a.open("GET","function"==typeof t?t(n,o,s):t,!0),e.getType()==fl&&(a.responseType="arraybuffer"),a.withCredentials=_l,a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){var o=e.getType(),l=void 0;o==gl||o==yl?l=a.responseText:o==ml?(l=a.responseXML)||(l=(new DOMParser).parseFromString(a.responseText,"application/xml")):o==fl&&(l=a.response),l?r.call(this,e.readFeatures(l,{extent:n,featureProjection:s}),e.readProjection(l)):i.call(this)}else i.call(this)}.bind(this),a.onerror=function(){i.call(this)}.bind(this),a.send()}}function xl(t,e){return vl(t,e,(function(t,e){"function"==typeof this.addFeatures&&this.addFeatures(t)}),S)}function wl(t,e){return[[-1/0,-1/0,1/0,1/0]]}var bl=function(){function t(t,e,r,i){this.minX=t,this.maxX=e,this.minY=r,this.maxY=i}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function Sl(t,e,r,i,n){return void 0!==n?(n.minX=t,n.maxX=e,n.minY=r,n.maxY=i,n):new bl(t,e,r,i)}var Tl=bl;function Cl(t,e,r,i){return void 0!==i?(i[0]=t,i[1]=e,i[2]=r,i):[t,e,r]}function El(t,e,r){return t+"/"+e+"/"+r}function Rl(t){return El(t[0],t[1],t[2])}function Pl(t){return t.split("/").map(Number)}function Il(t){return(t[1]<0||r&&0===o)}))),17),!t.origins)for(var o=0,s=this.resolutions_.length-1;o=this.minZoom;){if(e(a,2===this.zoomFactor_?Sl(n=Math.floor(n/2),n,o=Math.floor(o/2),o,r):this.getTileRangeForExtentAndZ(s,a,r)))return!0;--a}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,r){if(t[0]0?i:Math.max(s/a[0],o/a[1]),u=n+1,h=new Array(u),c=0;c=0;o--)this.postProcessPasses_[o].init(t);e.bindTexture(e.TEXTURE_2D,null),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.enable(e.BLEND),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA),e.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.prepareDrawToRenderTarget=function(t,e,r){var i=this.getGL(),n=e.getSize();i.bindFramebuffer(i.FRAMEBUFFER,e.getFramebuffer()),i.viewport(0,0,n[0],n[1]),i.bindTexture(i.TEXTURE_2D,e.getTexture()),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.enable(i.BLEND),i.blendFunc(i.ONE,r?i.ZERO:i.ONE_MINUS_SRC_ALPHA),i.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.drawElements=function(t,e){var r=this.getGL(),i=r.UNSIGNED_INT,n=e-t,o=4*t;r.drawElements(r.TRIANGLES,n,i,o)},e.prototype.finalizeDraw=function(t){for(var e=0;ethis.size_[0]||e>=this.size_[1])return Ru[0]=0,Ru[1]=0,Ru[2]=0,Ru[3]=0,Ru;this.readAll();var r=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return Ru[0]=this.data_[4*r],Ru[1]=this.data_[4*r+1],Ru[2]=this.data_[4*r+2],Ru[3]=this.data_[4*r+3],Ru},t.prototype.getTexture=function(){return this.texture_},t.prototype.getFramebuffer=function(){return this.framebuffer_},t.prototype.updateSize_=function(){var t=this.size_,e=this.helper_.getGL();this.texture_=this.helper_.createTexture(t,null,this.texture_),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.viewport(0,0,t[0],t[1]),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture_,0),this.data_=new Uint8Array(t[0]*t[1]*4)},t}(),Iu=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ou=function(t){function e(e){var r=t.call(this,{extent:e.extent,origin:e.origin,origins:e.origins,resolutions:e.resolutions,tileSize:e.tileSize,tileSizes:e.tileSizes,sizes:e.sizes})||this;return r.matrixIds_=e.matrixIds,r}return Iu(e,t),e.prototype.getMatrixId=function(t){return this.matrixIds_[t]},e.prototype.getMatrixIds=function(){return this.matrixIds_},e}(Ll),Lu=Ou;function Mu(t,e,r){var i=[],n=[],o=[],s=[],a=[],l=void 0!==r?r:[],u=t.SupportedCRS,h=gr(u.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||gr(u),c=h.getMetersPerUnit(),p="ne"==h.getAxisOrientation().substr(0,2);return t.TileMatrix.sort((function(t,e){return e.ScaleDenominator-t.ScaleDenominator})),t.TileMatrix.forEach((function(e){if(!(l.length>0)||_(l,(function(r){return e.Identifier==r.TileMatrix||-1===e.Identifier.indexOf(":")&&t.Identifier+":"+e.Identifier===r.TileMatrix}))){n.push(e.Identifier);var r=28e-5*e.ScaleDenominator/c,u=e.TileWidth,h=e.TileHeight;p?o.push([e.TopLeftCorner[1],e.TopLeftCorner[0]]):o.push(e.TopLeftCorner),i.push(r),s.push(u==h?u:[u,h]),a.push([e.MatrixWidth,e.MatrixHeight])}})),new Ou({extent:e,origins:o,resolutions:i,matrixIds:n,tileSizes:s,sizes:a})}var Fu=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Ds(t.scale),this.displacement_=t.displacement}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getAnchor=function(){return i()},t.prototype.getImage=function(t){return i()},t.prototype.getHitDetectionImage=function(t){return i()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return i()},t.prototype.getImageSize=function(){return i()},t.prototype.getHitDetectionImageSize=function(){return i()},t.prototype.getOrigin=function(){return i()},t.prototype.getSize=function(){return i()},t.prototype.setOpacity=function(t){this.opacity_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Ds(t)},t.prototype.listenImageChange=function(t){i()},t.prototype.load=function(){i()},t.prototype.unlistenImageChange=function(t){i()},t}(),Au=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),ku=function(t){function e(e){var r=this,i=void 0!==e.rotateWithView&&e.rotateWithView;return(r=t.call(this,{opacity:1,rotateWithView:i,rotation:void 0!==e.rotation?e.rotation:0,scale:1,displacement:void 0!==e.displacement?e.displacement:[0,0]})||this).canvas_={},r.hitDetectionCanvas_={},r.fill_=void 0!==e.fill?e.fill:null,r.origin_=[0,0],r.points_=e.points,r.radius_=void 0!==e.radius?e.radius:e.radius1,r.radius2_=e.radius2,r.angle_=void 0!==e.angle?e.angle:0,r.stroke_=void 0!==e.stroke?e.stroke:null,r.anchor_=null,r.size_=null,r.imageSize_=null,r.hitDetectionImageSize_=null,r.render(),r}return Au(e,t),e.prototype.clone=function(){var t=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},e.prototype.getAnchor=function(){return this.anchor_},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.getHitDetectionImage=function(t){if(!this.hitDetectionCanvas_[t||1]){var e=this.createRenderOptions();this.createHitDetectionCanvas_(e,t||1)}return this.hitDetectionCanvas_[t||1]},e.prototype.getImage=function(t){if(!this.canvas_[t||1]){var e=this.createRenderOptions(),r=zn(e.size*t||1,e.size*t||1);this.draw_(e,r,0,0,t||1),this.canvas_[t||1]=r.canvas}return this.canvas_[t||1]},e.prototype.getPixelRatio=function(t){return t},e.prototype.getImageSize=function(){return this.imageSize_},e.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_},e.prototype.getImageState=function(){return To},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.listenImageChange=function(t){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t){},e.prototype.createRenderOptions=function(){var t,e="round",r="round",i=0,n=null,o=0,s=0;return this.stroke_&&(null===(t=this.stroke_.getColor())&&(t="#000"),t=Ln(t),void 0===(s=this.stroke_.getWidth())&&(s=1),n=this.stroke_.getLineDash(),o=this.stroke_.getLineDashOffset(),void 0===(r=this.stroke_.getLineJoin())&&(r="round"),void 0===(e=this.stroke_.getLineCap())&&(e="round"),void 0===(i=this.stroke_.getMiterLimit())&&(i=10)),{strokeStyle:t,strokeWidth:s,size:2*(this.radius_+s)+1,lineCap:e,lineDash:n,lineDashOffset:o,lineJoin:r,miterLimit:i}},e.prototype.render=function(){var t=this.createRenderOptions(),e=zn(t.size,t.size);this.draw_(t,e,0,0,1),this.canvas_[1]=e.canvas;var r=e.canvas.width,i=r,n=this.getDisplacement();this.hitDetectionImageSize_=[t.size,t.size],this.createHitDetectionCanvas_(t,1),this.anchor_=[r/2-n[0],r/2+n[1]],this.size_=[r,r],this.imageSize_=[i,i]},e.prototype.draw_=function(t,e,r,i,n){var o,s,a;e.setTransform(n,0,0,n,0,0),e.translate(r,i),e.beginPath();var l=this.points_;if(l===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var u=void 0!==this.radius2_?this.radius2_:this.radius_;for(u!==this.radius_&&(l*=2),o=0;o<=l;o++)s=2*o*Math.PI/l-Math.PI/2+this.angle_,a=o%2==0?this.radius_:u,e.lineTo(t.size/2+a*Math.cos(s),t.size/2+a*Math.sin(s))}if(this.fill_){var h=this.fill_.getColor();null===h&&(h="#000"),e.fillStyle=Ln(h),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,e.setLineDash&&t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineCap=t.lineCap,e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke()),e.closePath()},e.prototype.createHitDetectionCanvas_=function(t,e){if(this.hitDetectionCanvas_[e]=this.getImage(e),this.fill_){var r=this.fill_.getColor(),i=0;if("string"==typeof r&&(r=tn(r)),null===r?i=1:Array.isArray(r)&&(i=4===r.length?r[3]:1),0===i){var n=zn(t.size*e,t.size*e);this.hitDetectionCanvas_[e]=n.canvas,this.drawHitDetectionCanvas_(t,n,0,0,e)}}},e.prototype.drawHitDetectionCanvas_=function(t,e,r,i,n){e.setTransform(n,0,0,n,0,0),e.translate(r,i),e.beginPath();var o=this.points_;if(o===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var s=void 0!==this.radius2_?this.radius2_:this.radius_;s!==this.radius_&&(o*=2);var a=void 0,l=void 0,u=void 0;for(a=0;a<=o;a++)u=2*a*Math.PI/o-Math.PI/2+this.angle_,l=a%2==0?this.radius_:s,e.lineTo(t.size/2+l*Math.cos(u),t.size/2+l*Math.sin(u))}e.fillStyle="#000",e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.stroke()),e.closePath()},e}(Fu),Nu=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),ju=function(t){function e(e){var r=e||{};return t.call(this,{points:1/0,fill:r.fill,radius:r.radius,stroke:r.stroke,displacement:void 0!==r.displacement?r.displacement:[0,0]})||this}return Nu(e,t),e.prototype.clone=function(){var t=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),displacement:this.getDisplacement().slice()});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(ku),Du=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0})},t.prototype.getColor=function(){return this.color_},t.prototype.setColor=function(t){this.color_=t},t}(),Gu="fraction",zu="pixels",Bu="bottom-left",Uu="bottom-right",Yu="top-left",Wu="top-right",Vu=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Xu=function(t){function e(e,r,i,n){var o=t.call(this)||this;return o.extent=e,o.pixelRatio_=i,o.resolution=r,o.state=n,o}return Vu(e,t),e.prototype.changed=function(){this.dispatchEvent(O)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return i()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){i()},e}(I),qu=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function Zu(t,e,r){var i=t;if(i.src&&Dn){var n=i.decode(),o=!0;return n.then((function(){o&&e()})).catch((function(t){o&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():r())})),function(){o=!1}}var s=[V(i,z,e),V(i,L,r)];return function(){s.forEach(X)}}var Ku=function(t){function e(e,r,i,n,o,s){var a=t.call(this,e,r,i,bo)||this;return a.src_=n,a.image_=new Image,null!==o&&(a.image_.crossOrigin=o),a.unlisten_=null,a.state=bo,a.imageLoadFunction_=s,a}return qu(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=Co,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=he(this.extent)/this.image_.height),this.state=To,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=bo&&this.state!=Co||(this.state=So,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Zu(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Xu),Hu=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ju=null,$u=function(t){function e(e,r,i,n,o,s){var a=t.call(this)||this;return a.hitDetectionImage_={},a.image_=e||new Image,null!==n&&(a.image_.crossOrigin=n),a.canvas_={},a.color_=s,a.unlisten_=null,a.imageState_=o,a.size_=i,a.src_=r,a.tainted_,a}return Hu(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===To){Ju||(Ju=zn(1,1)),Ju.drawImage(this.image_,0,0);try{Ju.getImageData(0,0,1,1),this.tainted_=!1}catch(t){Ju=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(O)},e.prototype.handleImageError_=function(){this.imageState_=Co,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=To,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},e.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(t){if(!this.hitDetectionImage_[t])if(this.isTainted_()){var e=this.color_?t:1,r=this.size_[0],i=this.size_[1],n=zn(Math.ceil(r*e),Math.ceil(i*e));n.scale(e,e),n.fillRect(0,0,r,i),this.hitDetectionImage_[t]=n.canvas}else this.hitDetectionImage_[t]=this.image_;return this.hitDetectionImage_[t]},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==bo){this.imageState_=So;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=Zu(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]){var e=document.createElement("canvas");this.canvas_[t]=e,e.width=Math.ceil(this.image_.width*t),e.height=Math.ceil(this.image_.height*t);var r=e.getContext("2d");if(r.scale(t,t),r.drawImage(this.image_,0,0),this.isTainted_()){var i=this.color_;return r.globalCompositeOperation="multiply",r.fillStyle="rgb("+i[0]+","+i[1]+","+i[2]+")",r.fillRect(0,0,e.width,e.height),r.globalCompositeOperation="destination-in",void r.drawImage(this.image_,0,0)}for(var n=r.getImageData(0,0,e.width,e.height),o=n.data,s=this.color_[0]/255,a=this.color_[1]/255,l=this.color_[2]/255,u=0,h=o.length;u0,6);var p=void 0!==i.src?bo:To;return r.color_=void 0!==i.color?tn(i.color):null,r.iconImage_=function(t,e,r,i,n,o){var s=sn.get(e,i,o);return s||(s=new $u(t,e,r,i,n,o),sn.set(e,i,o,s)),s}(u,c,h,r.crossOrigin_,p,r.color_),r.offset_=void 0!==i.offset?i.offset:[0,0],r.offsetOrigin_=void 0!==i.offsetOrigin?i.offsetOrigin:Yu,r.origin_=null,r.size_=void 0!==i.size?i.size:null,r}return Qu(e,t),e.prototype.clone=function(){var t=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},e.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,e=this.getSize();if(this.anchorXUnits_==Gu||this.anchorYUnits_==Gu){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==Gu&&(t[0]*=e[0]),this.anchorYUnits_==Gu&&(t[1]*=e[1])}if(this.anchorOrigin_!=Yu){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=Wu&&this.anchorOrigin_!=Uu||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=Bu&&this.anchorOrigin_!=Uu||(t[1]=-t[1]+e[1])}return this.normalizedAnchor_=t,this.normalizedAnchor_},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getHitDetectionImageSize=function(){return this.getImageSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(t){return this.iconImage_.getHitDetectionImage(t)},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_,e=this.getDisplacement();if(this.offsetOrigin_!=Yu){var r=this.getSize(),i=this.iconImage_.getSize();if(!r||!i)return null;t=t.slice(),this.offsetOrigin_!=Wu&&this.offsetOrigin_!=Uu||(t[0]=i[0]-r[0]-t[0]),this.offsetOrigin_!=Bu&&this.offsetOrigin_!=Uu||(t[1]=i[1]-r[1]-t[1])}return t[0]+=e[0],t[1]+=e[1],this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(O,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(O,t)},e}(Fu),eh=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=void 0!==e.lineDash?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},t.prototype.getColor=function(){return this.color_},t.prototype.getLineCap=function(){return this.lineCap_},t.prototype.getLineDash=function(){return this.lineDash_},t.prototype.getLineDashOffset=function(){return this.lineDashOffset_},t.prototype.getLineJoin=function(){return this.lineJoin_},t.prototype.getMiterLimit=function(){return this.miterLimit_},t.prototype.getWidth=function(){return this.width_},t.prototype.setColor=function(t){this.color_=t},t.prototype.setLineCap=function(t){this.lineCap_=t},t.prototype.setLineDash=function(t){this.lineDash_=t},t.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t},t.prototype.setLineJoin=function(t){this.lineJoin_=t},t.prototype.setMiterLimit=function(t){this.miterLimit_=t},t.prototype.setWidth=function(t){this.width_=t},t}(),rh=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=sh,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex}return t.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new t({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.setRenderer=function(t){this.renderer_=t},t.prototype.getGeometry=function(){return this.geometry_},t.prototype.getGeometryFunction=function(){return this.geometryFunction_},t.prototype.getFill=function(){return this.fill_},t.prototype.setFill=function(t){this.fill_=t},t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(t){this.image_=t},t.prototype.getStroke=function(){return this.stroke_},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.getText=function(){return this.text_},t.prototype.setText=function(t){this.text_=t},t.prototype.getZIndex=function(){return this.zIndex_},t.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=sh,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var ih=null;function nh(t,e){if(!ih){var r=new Du({color:"rgba(255,255,255,0.4)"}),i=new eh({color:"#3399CC",width:1.25});ih=[new rh({image:new ju({fill:r,stroke:i,radius:5}),fill:r,stroke:i})]}return ih}function oh(){var t={},e=[255,255,255,1],r=[0,153,255,1];return t[gt.POLYGON]=[new rh({fill:new Du({color:[255,255,255,.5]})})],t[gt.MULTI_POLYGON]=t[gt.POLYGON],t[gt.LINE_STRING]=[new rh({stroke:new eh({color:e,width:5})}),new rh({stroke:new eh({color:r,width:3})})],t[gt.MULTI_LINE_STRING]=t[gt.LINE_STRING],t[gt.CIRCLE]=t[gt.POLYGON].concat(t[gt.LINE_STRING]),t[gt.POINT]=[new rh({image:new ju({radius:6,fill:new Du({color:r}),stroke:new eh({color:e,width:1.5})}),zIndex:1/0})],t[gt.MULTI_POINT]=t[gt.POINT],t[gt.GEOMETRY_COLLECTION]=t[gt.POLYGON].concat(t[gt.LINE_STRING],t[gt.POINT]),t}function sh(t){return t.getGeometry()}var ah=rh,lh="point",uh="line",hh=function(){function t(t){var e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=Ds(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new Du({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:lh,this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding}return t.prototype.clone=function(){var e=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()})},t.prototype.getOverflow=function(){return this.overflow_},t.prototype.getFont=function(){return this.font_},t.prototype.getMaxAngle=function(){return this.maxAngle_},t.prototype.getPlacement=function(){return this.placement_},t.prototype.getOffsetX=function(){return this.offsetX_},t.prototype.getOffsetY=function(){return this.offsetY_},t.prototype.getFill=function(){return this.fill_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.getText=function(){return this.text_},t.prototype.getTextAlign=function(){return this.textAlign_},t.prototype.getTextBaseline=function(){return this.textBaseline_},t.prototype.getBackgroundFill=function(){return this.backgroundFill_},t.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t.prototype.getPadding=function(){return this.padding_},t.prototype.setOverflow=function(t){this.overflow_=t},t.prototype.setFont=function(t){this.font_=t},t.prototype.setMaxAngle=function(t){this.maxAngle_=t},t.prototype.setOffsetX=function(t){this.offsetX_=t},t.prototype.setOffsetY=function(t){this.offsetY_=t},t.prototype.setPlacement=function(t){this.placement_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setFill=function(t){this.fill_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Ds(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.setText=function(t){this.text_=t},t.prototype.setTextAlign=function(t){this.textAlign_=t},t.prototype.setTextBaseline=function(t){this.textBaseline_=t},t.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},t.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},t.prototype.setPadding=function(t){this.padding_=t},t}(),ch=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),ph=function(t){function e(e,r,i){var n=t.call(this)||this,o=i||{};return n.tileCoord=e,n.state=r,n.interimTile=null,n.hifi=!0,n.key="",n.transition_=void 0===o.transition?250:o.transition,n.transitionStarts_={},n}return ch(e,t),e.prototype.changed=function(){this.dispatchEvent(O)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==cs)return this.transition_=0,t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==cs){t.interimTile=null;break}t.getState()==hs?e=t:t.getState()==us?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){if(this.state!==ps&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){i()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var r=this.transitionStarts_[t];if(r){if(-1===r)return 1}else r=e,this.transitionStarts_[t]=r;var i=e-r+1e3/60;return i>=this.transition_?1:Ps(i/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(I),dh=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();var fh,gh=function(t){function e(e,r,i,n,o,s){var a=t.call(this,e,r,s)||this;return a.crossOrigin_=n,a.src_=i,a.image_=new Image,null!==n&&(a.image_.crossOrigin=n),a.unlisten_=null,a.tileLoadFunction_=o,a}return dh(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.getKey=function(){return this.src_},e.prototype.handleImageError_=function(){var t;this.state=ps,this.unlistenImage_(),this.image_=((t=zn(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=cs:this.state=ds,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==ps&&(this.state=us,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==us&&(this.state=hs,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Zu(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(ph),yh=function(){function t(t,e,r,i,n,o){this.sourceProj_=t,this.targetProj_=e;var s={},a=Sr(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return s[e]||(s[e]=a(t)),s[e]},this.maxSourceExtent_=i,this.errorThresholdSquared_=n*n,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!i&&!!this.sourceProj_.getExtent()&&fe(i)==fe(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?fe(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?fe(this.targetProj_.getExtent()):null;var l=pe(r),u=de(r),h=se(r),c=oe(r),p=this.transformInv_(l),d=this.transformInv_(u),f=this.transformInv_(h),g=this.transformInv_(c),y=10+(o?Math.max(0,Math.ceil(Se(ne(r)/(o*o*256*256)))):0);if(this.addQuad_(l,u,h,c,p,d,f,g,y),this.wrapsXInSource_){var m=1/0;this.triangles_.forEach((function(t,e,r){m=Math.min(m,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-m>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-m>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-m>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-m>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var r=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-r.5&&h<1,d=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)d=fe(Dt([t,e,r,i]))/this.targetWorldWidth_>.25||d;!p&&this.sourceProj_.isGlobal()&&h&&(d=h>.25||d)}if(!(!d&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3]))||ge(u,this.maxSourceExtent_)){var f=0;if(!(d||isFinite(n[0])&&isFinite(n[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])))if(l>0)d=!0;else if(1!=(f=(isFinite(n[0])&&isFinite(n[1])?0:8)+(isFinite(o[0])&&isFinite(o[1])?0:4)+(isFinite(s[0])&&isFinite(s[1])?0:2)+(isFinite(a[0])&&isFinite(a[1])?0:1))&&2!=f&&4!=f&&8!=f)return;if(l>0){if(!d){var g=[(t[0]+r[0])/2,(t[1]+r[1])/2],y=this.transformInv_(g),m=void 0;if(p)m=(Pe(n[0],c)+Pe(s[0],c))/2-Pe(y[0],c);else m=(n[0]+s[0])/2-y[0];var _=(n[1]+s[1])/2-y[1];d=m*m+_*_>this.errorThresholdSquared_}if(d){if(Math.abs(t[0]-r[0])<=Math.abs(t[1]-r[1])){var v=[(e[0]+r[0])/2,(e[1]+r[1])/2],x=this.transformInv_(v),w=[(i[0]+t[0])/2,(i[1]+t[1])/2],b=this.transformInv_(w);this.addQuad_(t,e,v,w,n,o,x,b,l-1),this.addQuad_(w,v,r,i,b,x,s,a,l-1)}else{var S=[(t[0]+e[0])/2,(t[1]+e[1])/2],T=this.transformInv_(S),C=[(r[0]+i[0])/2,(r[1]+i[1])/2],E=this.transformInv_(C);this.addQuad_(t,S,C,i,n,T,E,a,l-1),this.addQuad_(S,e,r,C,T,o,s,E,l-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&f)&&this.addTriangle_(t,r,i,n,s,a),0==(14&f)&&this.addTriangle_(t,r,e,n,s,o),f&&(0==(13&f)&&this.addTriangle_(e,i,t,o,a,n),0==(7&f)&&this.addTriangle_(e,i,r,o,a,s))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,r,i){var n=e.source;Qt(t,n[0]),Qt(t,n[1]),Qt(t,n[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),mh={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1};function _h(t,e,r,i,n){t.beginPath(),t.moveTo(0,0),t.lineTo(e,r),t.lineTo(i,n),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,i)+1,Math.max(r,n)),t.restore()}function vh(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function xh(t,e,r,i){var n=Tr(r,e,t),o=yr(e,i,r),s=e.getMetersPerUnit();void 0!==s&&(o*=s);var a=t.getMetersPerUnit();void 0!==a&&(o/=a);var l=t.getExtent();if(!l||Ut(l,n)){var u=yr(t,o,n)/o;isFinite(u)&&u>0&&(o/=u)}return o}function wh(t,e,r,i,n,o,s,a,l,u,h,c){var p=zn(Math.round(r*t),Math.round(r*e));if(T(p,c),0===l.length)return p.canvas;function d(t){return Math.round(t*r)/r}p.scale(r,r),p.globalCompositeOperation="lighter";var f=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,r){$t(f,t.extent)}));var g=fe(f),y=he(f),m=zn(Math.round(r*g/i),Math.round(r*y/i));T(m,c);var _=r/i;l.forEach((function(t,e,r){var i=t.extent[0]-f[0],n=-(t.extent[3]-f[3]),o=fe(t.extent),s=he(t.extent);t.image.width>0&&t.image.height>0&&m.drawImage(t.image,u,u,t.image.width-2*u,t.image.height-2*u,i*_,n*_,o*_,s*_)}));var v=pe(s);return a.getTriangles().forEach((function(t,e,n){var s=t.source,a=t.target,l=s[0][0],u=s[0][1],h=s[1][0],g=s[1][1],y=s[2][0],_=s[2][1],x=d((a[0][0]-v[0])/o),w=d(-(a[0][1]-v[1])/o),b=d((a[1][0]-v[0])/o),S=d(-(a[1][1]-v[1])/o),T=d((a[2][0]-v[0])/o),C=d(-(a[2][1]-v[1])/o),E=l,R=u;l=0,u=0;var P=function(t){for(var e=t.length,r=0;rn&&(n=s,i=o)}if(0===n)return null;var a=t[i];t[i]=t[r],t[r]=a;for(var l=r+1;l=0;p--){c[p]=t[p][e]/t[p][p];for(var d=p-1;d>=0;d--)t[d][e]-=t[d][p]*c[p]}return c}([[h-=E,g-=R,0,0,b-x],[y-=E,_-=R,0,0,T-x],[0,0,h,g,S-w],[0,0,y,_,C-w]]);if(P){if(p.save(),p.beginPath(),function(){if(void 0===fh){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",_h(t,4,5,4,0),_h(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;fh=vh(e,0)||vh(e,4)||vh(e,8)}return fh}()||c===mh){p.moveTo(b,S);for(var I=x-b,O=w-S,L=0;L<4;L++)p.lineTo(b+d((L+1)*I/4),S+d(L*O/3)),3!=L&&p.lineTo(b+d((L+1)*I/4),S+d((L+1)*O/3));p.lineTo(T,C)}else p.moveTo(b,S),p.lineTo(x,w),p.lineTo(T,C);p.clip(),p.transform(P[0],P[2],P[1],P[3],x,w),p.translate(f[0]-E,f[3]-R),p.scale(i/r,-i/r),p.drawImage(m.canvas,0,0),p.restore()}})),h&&(p.save(),p.globalCompositeOperation="source-over",p.strokeStyle="black",p.lineWidth=1,a.getTriangles().forEach((function(t,e,r){var i=t.target,n=(i[0][0]-v[0])/o,s=-(i[0][1]-v[1])/o,a=(i[1][0]-v[0])/o,l=-(i[1][1]-v[1])/o,u=(i[2][0]-v[0])/o,h=-(i[2][1]-v[1])/o;p.beginPath(),p.moveTo(a,l),p.lineTo(n,s),p.lineTo(u,h),p.closePath(),p.stroke()})),p.restore()),p.canvas}var bh=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Sh=function(t){function e(e,r,i,n,o,s,a,l,u,h,c,p){var d=t.call(this,o,us)||this;d.renderEdges_=void 0!==c&&c,d.contextOptions_=p,d.pixelRatio_=a,d.gutter_=l,d.canvas_=null,d.sourceTileGrid_=r,d.targetTileGrid_=n,d.wrappedTileCoord_=s||o,d.sourceTiles_=[],d.sourcesListenerKeys_=null,d.sourceZ_=0;var f=n.getTileCoordExtent(d.wrappedTileCoord_),g=d.targetTileGrid_.getExtent(),y=d.sourceTileGrid_.getExtent(),m=g?ce(f,g):f;if(0===ne(m))return d.state=ds,d;var _=e.getExtent();_&&(y=y?ce(y,_):_);var v=n.getResolution(d.wrappedTileCoord_[0]),x=function(t,e,r,i){var n=ae(r),o=xh(t,e,n,i);return(!isFinite(o)||o<=0)&&ie(r,(function(r){return o=xh(t,e,r,i),isFinite(o)&&o>0})),o}(e,i,m,v);if(!isFinite(x)||x<=0)return d.state=ds,d;var w=void 0!==h?h:.5;if(d.triangulation_=new yh(e,i,m,y,x*w,v),0===d.triangulation_.getTriangles().length)return d.state=ds,d;d.sourceZ_=r.getZForResolution(x);var b=d.triangulation_.calculateSourceExtent();if(y&&(e.canWrapX()?(b[1]=we(b[1],y[1],y[3]),b[3]=we(b[3],y[1],y[3])):b=ce(b,y)),ne(b)){for(var S=r.getTileRangeForExtentAndZ(b,d.sourceZ_),T=S.minX;T<=S.maxX;T++)for(var C=S.minY;C<=S.maxY;C++){var E=u(d.sourceZ_,T,C,a);E&&d.sourceTiles_.push(E)}0===d.sourceTiles_.length&&(d.state=ds)}else d.state=ds;return d}return bh(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,r,i){e&&e.getState()==cs&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=ps;else{var e=this.wrappedTileCoord_[0],r=this.targetTileGrid_.getTileSize(e),i="number"==typeof r?r:r[0],n="number"==typeof r?r:r[1],o=this.targetTileGrid_.getResolution(e),s=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=wh(i,n,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),o,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=cs}this.changed()},e.prototype.load=function(){if(this.state==us){this.state=hs,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,r,i){var n=e.getState();if(n==us||n==hs){t++;var o=W(e,O,(function(r){var i=e.getState();i!=cs&&i!=ps&&i!=ds||(X(o),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(o)}}.bind(this)),this.sourceTiles_.forEach((function(t,e,r){t.getState()==us&&t.load()})),0===t&&setTimeout(this.reproject_.bind(this),0)}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(X),this.sourcesListenerKeys_=null},e}(ph),Th=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var r=this.entries_[t];return lt(void 0!==r,15),r===this.newest_||(r===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(r.newer.older=r.older,r.older.newer=r.newer),r.newer=null,r.older=this.newest_,this.newest_.newer=r,this.newest_=r),r.value_},t.prototype.remove=function(t){var e=this.entries_[t];return lt(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),r=0;for(t=this.newest_;t;t=t.older)e[r++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),r=0;for(t=this.newest_;t;t=t.older)e[r++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){lt(!(t in this.entries_),16);var r={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=r:this.oldest_=r,this.newest_=r,this.entries_[t]=r,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}(),Ch=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Eh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ch(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=Pl(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(Rl(e.tileCoord)),e.release())}.bind(this))}},e}(Th),Rh="tileloadstart",Ph="tileloadend",Ih="tileloaderror",Oh=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function Lh(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var Mh=function(t){function e(e){var r=t.call(this)||this;return r.projection_=gr(e.projection),r.attributions_=Lh(e.attributions),r.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,r.loading=!1,r.state_=void 0!==e.state?e.state:Cn,r.wrapX_=void 0!==e.wrapX&&e.wrapX,r}return Oh(e,t),e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolutions=function(){return i()},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getContextOptions=function(){},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=Lh(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(et),Fh=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ah=function(t){function e(e){var r=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX})||this;r.opaque_=void 0!==e.opaque&&e.opaque,r.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,r.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;var i=e.tileGrid;return i&&Ds(i.getTileSize(i.getMinZoom()),[256,256]),r.tileCache=new Eh(e.cacheSize||0),r.tmpSize=[0,0],r.key_=e.key||"",r.tileOptions={transition:e.transition},r.zDirection=e.zDirection?e.zDirection:0,r}return Fh(e,t),e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var r=this.getTileCacheForProjection(t);r&&r.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,r,i){var n=this.getTileCacheForProjection(t);if(!n)return!1;for(var o,s,a,l=!0,u=r.minX;u<=r.maxX;++u)for(var h=r.minY;h<=r.maxY;++h)s=El(e,u,h),a=!1,n.containsKey(s)&&(a=(o=n.get(s)).getState()===cs)&&(a=!1!==i(o)),a||(l=!1);return l},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},e.prototype.getTile=function(t,e,r,n,o){return i()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Ml(t)},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();return e&&!wr(e,t)?null:this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,r){var i=this.getTileGridForProjection(r),n=this.getTilePixelRatio(e),o=Ds(i.getTileSize(t),this.tmpSize);return 1==n?o:js(o,n,this.tmpSize)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var r=void 0!==e?e:this.getProjection(),i=this.getTileGridForProjection(r);return this.getWrapX()&&r.isGlobal()&&(t=function(t,e,r){var i=e[0],n=t.getTileCoordCenter(e),o=Nl(r);if(Ut(o,n))return e;var s=fe(o),a=Math.ceil((o[0]-n[0])/s);return n[0]+=s*a,t.getTileCoordForCoordAndZ(n,i)}(i,t,r)),function(t,e){var r=t[0],i=t[1],n=t[2];if(e.getMinZoom()>r||r>e.getMaxZoom())return!1;var o,s=e.getExtent();return!(o=s?e.getTileRangeForExtentAndZ(s,r):e.getFullTileRange(r))||o.containsXY(i,n)}(t,i)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var r=this.getTileCacheForProjection(e);t>r.highWaterMark&&(r.highWaterMark=t)},e.prototype.useTile=function(t,e,r,i){},e}(Mh),kh=function(t){function e(e,r){var i=t.call(this,e)||this;return i.tile=r,i}return Fh(e,t),e}(h),Nh=Ah;function jh(t,e){var r=/\{z\}/g,i=/\{x\}/g,n=/\{y\}/g,o=/\{-y\}/g;return function(s,a,l){return s?t.replace(r,s[0].toString()).replace(i,s[1].toString()).replace(n,s[2].toString()).replace(o,(function(){var t=s[0],r=e.getFullTileRange(t);return lt(r,55),(r.getHeight()-s[2]-1).toString()})):void 0}}function Dh(t,e){for(var r=t.length,i=new Array(r),n=0;n>=1;return n.join("")}(r))}}}))),e.imageryProviders){var u=br(gr("EPSG:4326"),this.getProjection());this.setAttributions(function(t){var r=[],i=t.viewState,n=this.getTileGrid(),o=n.getZForResolution(i.resolution,this.zDirection),s=n.getTileCoordForCoordAndZ(i.center,o)[0];return e.imageryProviders.map((function(e){for(var i=!1,n=e.coverageAreas,o=0,a=n.length;o=l.zoomMin&&s<=l.zoomMax){var h=l.bbox;if(ge(_e([h[1],h[0],h[3],h[2]],u),t.extent)){i=!0;break}}}i&&r.push(e.attribution)})),r.push('Terms of Use'),r}.bind(this))}this.setState(Cn)}else this.setState(En)},e}(Xh),Hh=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Jh=function(t){function e(e){var r=e||{},i=void 0!==r.projection?r.projection:"EPSG:3857",n=void 0!==r.tileGrid?r.tileGrid:Fl({extent:Nl(i),maxResolution:r.maxResolution,maxZoom:r.maxZoom,minZoom:r.minZoom,tileSize:r.tileSize});return t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,imageSmoothing:r.imageSmoothing,opaque:r.opaque,projection:i,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileGrid:n,tileLoadFunction:r.tileLoadFunction,tilePixelRatio:r.tilePixelRatio,tileUrlFunction:r.tileUrlFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,attributionsCollapsible:r.attributionsCollapsible,zDirection:r.zDirection})||this}return Hh(e,t),e}(Xh),$h=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Qh=function(t){function e(e){var r=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,maxZoom:void 0!==e.maxZoom?e.maxZoom:18,minZoom:e.minZoom,projection:e.projection,wrapX:e.wrapX})||this;return r.account_=e.account,r.mapId_=e.map||"",r.config_=e.config||{},r.templateCache_={},r.initializeMap_(),r}return $h(e,t),e.prototype.getConfig=function(){return this.config_},e.prototype.updateConfig=function(t){T(this.config_,t),this.initializeMap_()},e.prototype.setConfig=function(t){this.config_=t||{},this.initializeMap_()},e.prototype.initializeMap_=function(){var t=JSON.stringify(this.config_);if(this.templateCache_[t])this.applyTemplate_(this.templateCache_[t]);else{var e="https://"+this.account_+".carto.com/api/v1/map";this.mapId_&&(e+="/named/"+this.mapId_);var r=new XMLHttpRequest;r.addEventListener("load",this.handleInitResponse_.bind(this,t)),r.addEventListener("error",this.handleInitError_.bind(this)),r.open("POST",e),r.setRequestHeader("Content-type","application/json"),r.send(JSON.stringify(this.config_))}},e.prototype.handleInitResponse_=function(t,e){var r=e.target;if(!r.status||r.status>=200&&r.status<300){var i=void 0;try{i=JSON.parse(r.responseText)}catch(t){return void this.setState(En)}this.applyTemplate_(i),this.templateCache_[t]=i,this.setState(Cn)}else this.setState(En)},e.prototype.handleInitError_=function(t){this.setState(En)},e.prototype.applyTemplate_=function(t){var e="https://"+t.cdn_url.https+"/"+this.account_+"/api/v1/map/"+t.layergroupid+"/{z}/{x}/{y}.png";this.setUrl(e)},e}(Jh),tc=r(1),ec=r.n(tc),rc=function(){function t(t){this.rbush_=new ec.a(t),this.items_={}}return t.prototype.insert=function(t,e){var r={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(r),this.items_[o(e)]=r},t.prototype.load=function(t,e){for(var r=new Array(e.length),i=0,n=e.length;i=0;--r){var i=this.geometryFunction(t[r]);i?Qe(e,i.getCoordinates()):t.splice(r,1)}or(e,1/t.length);var n=new ht(new pi(e));return n.set("features",t),n},e}(uc),pc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),dc="default",fc="truncated",gc=function(t){function e(e,r,i,n,o,s,a){var l=t.call(this,r,i,n,o,s,a)||this;return l.zoomifyImage_=null,l.tileSize_=e,l}return pc(e,t),e.prototype.getImage=function(){if(this.zoomifyImage_)return this.zoomifyImage_;var e=t.prototype.getImage.call(this);if(this.state==cs){var r=this.tileSize_;if(e.width==r[0]&&e.height==r[1])return this.zoomifyImage_=e,e;var i=zn(r[0],r[1]);return i.drawImage(e,0,0),this.zoomifyImage_=i.canvas,i.canvas}return e},e}(gh),yc=function(t){function e(e){var r=this,i=e,n=i.size,o=void 0!==i.tierSizeCalculation?i.tierSizeCalculation:dc,s=i.tilePixelRatio||1,a=n[0],l=n[1],u=[],h=i.tileSize||256,c=h*s;switch(o){case dc:for(;a>c||l>c;)u.push([Math.ceil(a/c),Math.ceil(l/c)]),c+=c;break;case fc:for(var p=a,d=l;p>c||d>c;)u.push([Math.ceil(p/c),Math.ceil(d/c)]),p>>=1,d>>=1;break;default:lt(!1,53)}u.push([1,1]),u.reverse();for(var f=[s],g=[0],y=1,m=u.length;y1,i=r&&t.imageInfo.profile[1].supports?t.imageInfo.profile[1].supports:[],n=r&&t.imageInfo.profile[1].formats?t.imageInfo.profile[1].formats:[],o=r&&t.imageInfo.profile[1].qualities?t.imageInfo.profile[1].qualities:[];return{url:t.imageInfo["@id"].replace(/\/?(?:info\.json)?$/g,""),sizes:void 0===t.imageInfo.sizes?void 0:t.imageInfo.sizes.map((function(t){return[t.width,t.height]})),tileSize:void 0===t.imageInfo.tiles?void 0:[t.imageInfo.tiles.map((function(t){return t.width}))[0],t.imageInfo.tiles.map((function(t){return void 0===t.height?t.width:t.height}))[0]],resolutions:void 0===t.imageInfo.tiles?void 0:t.imageInfo.tiles.map((function(t){return t.scaleFactors}))[0],supports:mc(e.supports,i),formats:mc(e.formats,n),qualities:mc(e.qualities,o)}},Cc[xc]=function(t){var e=t.getComplianceLevelSupportedFeatures(),r=void 0===t.imageInfo.extraFormats?e.formats:mc(e.formats,t.imageInfo.extraFormats),i=void 0!==t.imageInfo.preferredFormats&&Array.isArray(t.imageInfo.preferredFormats)&&t.imageInfo.preferredFormats.length>0?t.imageInfo.preferredFormats.filter((function(t){return["jpg","png","gif"].includes(t)})).reduce((function(t,e){return void 0===t&&r.includes(e)?e:t}),void 0):void 0;return{url:t.imageInfo.id,sizes:void 0===t.imageInfo.sizes?void 0:t.imageInfo.sizes.map((function(t){return[t.width,t.height]})),tileSize:void 0===t.imageInfo.tiles?void 0:[t.imageInfo.tiles.map((function(t){return t.width}))[0],t.imageInfo.tiles.map((function(t){return t.height}))[0]],resolutions:void 0===t.imageInfo.tiles?void 0:t.imageInfo.tiles.map((function(t){return t.scaleFactors}))[0],supports:void 0===t.imageInfo.extraFeatures?e.supports:mc(e.supports,t.imageInfo.extraFeatures),formats:r,qualities:void 0===t.imageInfo.extraQualities?e.qualities:mc(e.qualities,t.imageInfo.extraQualities),preferredFormat:i}};var Ec=function(){function t(t){this.setImageInfo(t)}return t.prototype.setImageInfo=function(t){this.imageInfo="string"==typeof t?JSON.parse(t):t},t.prototype.getImageApiVersion=function(){if(void 0!==this.imageInfo){var t=this.imageInfo["@context"]||"ol-no-context";"string"==typeof t&&(t=[t]);for(var e=0;e0&&"string"==typeof this.imageInfo.profile[0]&&Sc.test(this.imageInfo.profile[0]))return this.imageInfo.profile[0]}},t.prototype.getComplianceLevelFromProfile=function(t){var e=this.getComplianceLevelEntryFromProfile(t);if(void 0!==e){var r=e.match(/level[0-2](?:\.json)?$/g);return Array.isArray(r)?r[0].replace(".json",""):void 0}},t.prototype.getComplianceLevelSupportedFeatures=function(){if(void 0!==this.imageInfo){var t=this.getImageApiVersion(),e=this.getComplianceLevelFromProfile(t);return void 0===e?wc.none.none:wc[t][e]}},t.prototype.getTileSourceOptions=function(t){var e=t||{},r=this.getImageApiVersion();if(void 0!==r){var i=void 0===r?void 0:Cc[r](this);if(void 0!==i)return{url:i.url,version:r,size:[this.imageInfo.width,this.imageInfo.height],sizes:i.sizes,format:void 0!==e.format&&i.formats.includes(e.format)?e.format:void 0!==i.preferredFormat?i.preferredFormat:"jpg",supports:i.supports,quality:e.quality&&i.qualities.includes(e.quality)?e.quality:i.qualities.includes("native")?"native":"default",resolutions:Array.isArray(i.resolutions)?i.resolutions.sort((function(t,e){return e-t})):void 0,tileSize:i.tileSize}}},t}(),Rc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function Pc(t){return t.toLocaleString("en",{maximumFractionDigits:10})}var Ic=function(t){function e(e){var r=this,i=e||{},n=i.url||"";n+=n.lastIndexOf("/")===n.length-1||""===n?"":"/";var o=i.version||vc,s=i.sizes||[],a=i.size;lt(null!=a&&Array.isArray(a)&&2==a.length&&!isNaN(a[0])&&a[0]>0&&!isNaN(a[1])&&a[1]>0,60);var l,u,h,c=a[0],p=a[1],d=i.tileSize,f=i.tilePixelRatio||1,g=i.format||"jpg",y=i.quality||(i.version==_c?"native":"default"),m=i.resolutions||[],_=i.supports||[],v=i.extent||[0,-p,c,0],x=null!=s&&Array.isArray(s)&&s.length>0,w=void 0!==d&&("number"==typeof d&&Number.isInteger(d)&&d>0||Array.isArray(d)&&d.length>0),b=null!=_&&Array.isArray(_)&&(_.includes("regionByPx")||_.includes("regionByPct"))&&(_.includes("sizeByWh")||_.includes("sizeByH")||_.includes("sizeByW")||_.includes("sizeByPct"));if(m.sort((function(t,e){return e-t})),w||b)if(null!=d&&("number"==typeof d&&Number.isInteger(d)&&d>0?(l=d,u=d):Array.isArray(d)&&d.length>0&&((1==d.length||null==d[1]&&Number.isInteger(d[0]))&&(l=d[0],u=d[0]),2==d.length&&(Number.isInteger(d[0])&&Number.isInteger(d[1])?(l=d[0],u=d[1]):null==d[0]&&Number.isInteger(d[1])&&(l=d[1],u=d[1])))),void 0!==l&&void 0!==u||(l=256,u=256),0==m.length)for(var S=h=Math.max(Math.ceil(Math.log(c/l)/Math.LN2),Math.ceil(Math.log(p/u)/Math.LN2));S>=0;S--)m.push(Math.pow(2,S));else{var T=Math.max.apply(Math,m);h=Math.round(Math.log(T)/Math.LN2)}else if(l=c,u=p,m=[],x){s.sort((function(t,e){return t[0]-e[0]})),h=-1;var C=[];for(S=0;S0&&m[m.length-1]==E?C.push(S):(m.push(E),h++)}if(C.length>0)for(S=0;Sh)){var f=t[1],v=t[2],S=m[d];if(!(void 0===f||void 0===v||void 0===S||f<0||Math.ceil(c/S/l)<=f||v<0||Math.ceil(p/S/u)<=v)){if(b||w){var T=f*l*S,C=v*u*S,E=l*S,R=u*S,P=l,I=u;if(T+E>c&&(E=c-T),C+R>p&&(R=p-C),T+l*S>c&&(P=Math.floor((c-T+S-1)/S)),C+u*S>p&&(I=Math.floor((p-C+S-1)/S)),0==T&&E==c&&0==C&&R==p)i="full";else if(!b||_.includes("regionByPx"))i=T+","+C+","+E+","+R;else if(_.includes("regionByPct")){i="pct:"+Pc(T/c*100)+","+Pc(C/p*100)+","+Pc(E/c*100)+","+Pc(R/p*100)}o!=xc||b&&!_.includes("sizeByWh")?!b||_.includes("sizeByW")?a=P+",":_.includes("sizeByH")?a=","+I:_.includes("sizeByWh")?a=P+","+I:_.includes("sizeByPct")&&(a="pct:"+Pc(100/S)):a=P+","+I}else if(i="full",x){var O=s[d][0],L=s[d][1];a=o==xc?O==c&&L==p?"max":O+","+L:O==c?"full":O+","}else a=o==xc?"max":"full";return n+i+"/"+a+"/0/"+y+"."+g}}},transition:i.transition})||this).zDirection=i.zDirection,r}return Rc(e,t),e}(Xh),Oc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Lc=function(t){function e(e,r,i,n,o,s,a){var l=this,u=e.getExtent(),h=r.getExtent(),c=h?ce(i,h):i,p=xh(e,r,ae(c),n),d=new yh(e,r,c,u,.5*p,n),f=s(d.calculateSourceExtent(),p,o),g=f?bo:Eo,y=f?f.getPixelRatio():1;return(l=t.call(this,i,n,y,g)||this).targetProj_=r,l.maxSourceExtent_=u,l.triangulation_=d,l.targetResolution_=n,l.targetExtent_=i,l.sourceImage_=f,l.sourcePixelRatio_=y,l.contextOptions_=a,l.canvas_=null,l.sourceListenerKey_=null,l}return Oc(e,t),e.prototype.disposeInternal=function(){this.state==So&&this.unlistenSource_(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.canvas_},e.prototype.getProjection=function(){return this.targetProj_},e.prototype.reproject_=function(){var t=this.sourceImage_.getState();if(t==To){var e=fe(this.targetExtent_)/this.targetResolution_,r=he(this.targetExtent_)/this.targetResolution_;this.canvas_=wh(e,r,this.sourcePixelRatio_,this.sourceImage_.getResolution(),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.contextOptions_)}this.state=t,this.changed()},e.prototype.load=function(){if(this.state==bo){this.state=So,this.changed();var t=this.sourceImage_.getState();t==To||t==Co?this.reproject_():(this.sourceListenerKey_=W(this.sourceImage_,O,(function(t){var e=this.sourceImage_.getState();e!=To&&e!=Co||(this.unlistenSource_(),this.reproject_())}),this),this.sourceImage_.load())}},e.prototype.unlistenSource_=function(){X(this.sourceListenerKey_),this.sourceListenerKey_=null},e}(Xu),Mc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Fc="imageloadstart",Ac="imageloadend",kc="imageloaderror",Nc=function(t){function e(e,r){var i=t.call(this,e)||this;return i.image=r,i}return Mc(e,t),e}(h);function jc(t,e){t.getImage().src=e}var Dc=function(t){function e(e){var r=t.call(this,{attributions:e.attributions,projection:e.projection,state:e.state})||this;return r.resolutions_=void 0!==e.resolutions?e.resolutions:null,r.reprojectedImage_=null,r.reprojectedRevision_=0,r.contextOptions_=!1===e.imageSmoothing?mh:void 0,r}return Mc(e,t),e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getContextOptions=function(){return this.contextOptions_},e.prototype.findNearestResolution=function(t){if(this.resolutions_){var e=g(this.resolutions_,t,0);t=this.resolutions_[e]}return t},e.prototype.getImage=function(t,e,r,i){var n=this.getProjection();if(n&&i&&!wr(n,i)){if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&wr(this.reprojectedImage_.getProjection(),i)&&this.reprojectedImage_.getResolution()==e&&Jt(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new Lc(n,i,t,e,r,function(t,e,r){return this.getImageInternal(t,e,r,n)}.bind(this),this.contextOptions_),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}return n&&(i=n),this.getImageInternal(t,e,r,i)},e.prototype.getImageInternal=function(t,e,r,n){return i()},e.prototype.handleImageChange=function(t){var e=t.target;switch(e.getState()){case So:this.loading=!0,this.dispatchEvent(new Nc(Fc,e));break;case To:this.loading=!1,this.dispatchEvent(new Nc(Ac,e));break;case Co:this.loading=!1,this.dispatchEvent(new Nc(kc,e))}},e}(Mh);function Gc(t,e){var r=[];Object.keys(e).forEach((function(t){null!==e[t]&&void 0!==e[t]&&r.push(t+"="+encodeURIComponent(e[t]))}));var i=r.join("&");return(t=-1===(t=t.replace(/[?&]$/,"")).indexOf("?")?t+"?":t+"&")+i}var zc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Bc=function(t){function e(e){var r=this,i=e||{};return(r=t.call(this,{attributions:i.attributions,imageSmoothing:i.imageSmoothing,projection:i.projection,resolutions:i.resolutions})||this).crossOrigin_=void 0!==i.crossOrigin?i.crossOrigin:null,r.hidpi_=void 0===i.hidpi||i.hidpi,r.url_=i.url,r.imageLoadFunction_=void 0!==i.imageLoadFunction?i.imageLoadFunction:jc,r.params_=i.params||{},r.image_=null,r.imageSize_=[0,0],r.renderedRevision_=0,r.ratio_=void 0!==i.ratio?i.ratio:1.5,r}return zc(e,t),e.prototype.getParams=function(){return this.params_},e.prototype.getImageInternal=function(t,e,r,i){if(void 0===this.url_)return null;e=this.findNearestResolution(e),r=this.hidpi_?r:1;var n=this.image_;if(n&&this.renderedRevision_==this.getRevision()&&n.getResolution()==e&&n.getPixelRatio()==r&&Yt(n.getExtent(),t))return n;var o={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};T(o,this.params_);var s=((t=t.slice())[0]+t[2])/2,a=(t[1]+t[3])/2;if(1!=this.ratio_){var l=this.ratio_*fe(t)/2,u=this.ratio_*he(t)/2;t[0]=s-l,t[1]=a-u,t[2]=s+l,t[3]=a+u}var h=e/r,c=Math.ceil(fe(t)/h),p=Math.ceil(he(t)/h);t[0]=s-h*c/2,t[2]=s+h*c/2,t[1]=a-h*p/2,t[3]=a+h*p/2,this.imageSize_[0]=c,this.imageSize_[1]=p;var d=this.getRequestUrl_(t,this.imageSize_,r,i,o);return this.image_=new Ku(t,e,r,d,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),this.image_.addEventListener(O,this.handleImageChange.bind(this)),this.image_},e.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},e.prototype.getRequestUrl_=function(t,e,r,i,n){var o=i.getCode().split(":").pop();n.SIZE=e[0]+","+e[1],n.BBOX=t.join(","),n.BBOXSR=o,n.IMAGESR=o,n.DPI=Math.round(90*r);var s=this.url_,a=s.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage");return a==s&<(!1,50),Gc(a,n)},e.prototype.getUrl=function(){return this.url_},e.prototype.setImageLoadFunction=function(t){this.image_=null,this.imageLoadFunction_=t,this.changed()},e.prototype.setUrl=function(t){t!=this.url_&&(this.url_=t,this.image_=null,this.changed())},e.prototype.updateParams=function(t){T(this.params_,t),this.image_=null,this.changed()},e}(Dc),Uc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Yc=function(t){function e(e,r,i,n,o){var s=this,a=void 0!==o?bo:To;return(s=t.call(this,e,r,i,a)||this).loader_=void 0!==o?o:null,s.canvas_=n,s.error_=null,s}return Uc(e,t),e.prototype.getError=function(){return this.error_},e.prototype.handleLoad_=function(t){t?(this.error_=t,this.state=Co):this.state=To,this.changed()},e.prototype.load=function(){this.state==bo&&(this.state=So,this.changed(),this.loader_(this.handleLoad_.bind(this)))},e.prototype.getImage=function(){return this.canvas_},e}(Xu),Wc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Vc=function(t){function e(e){var r=this,i=e||{};return(r=t.call(this,{attributions:i.attributions,imageSmoothing:i.imageSmoothing,projection:i.projection,resolutions:i.resolutions,state:i.state})||this).canvasFunction_=i.canvasFunction,r.canvas_=null,r.renderedRevision_=0,r.ratio_=void 0!==i.ratio?i.ratio:1.5,r}return Wc(e,t),e.prototype.getImageInternal=function(t,e,r,i){e=this.findNearestResolution(e);var n=this.canvas_;if(n&&this.renderedRevision_==this.getRevision()&&n.getResolution()==e&&n.getPixelRatio()==r&&Yt(n.getExtent(),t))return n;me(t=t.slice(),this.ratio_);var o=[fe(t)/e*r,he(t)/e*r],s=this.canvasFunction_.call(this,t,e,r,o,i);return s&&(n=new Yc(t,e,r,s)),this.canvas_=n,this.renderedRevision_=this.getRevision(),n},e}(Dc),Xc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();var qc=function(t){function e(e){var r=t.call(this,{imageSmoothing:e.imageSmoothing,projection:e.projection,resolutions:e.resolutions})||this;return r.crossOrigin_=void 0!==e.crossOrigin?e.crossOrigin:null,r.displayDpi_=void 0!==e.displayDpi?e.displayDpi:96,r.params_=e.params||{},r.url_=e.url,r.imageLoadFunction_=void 0!==e.imageLoadFunction?e.imageLoadFunction:jc,r.hidpi_=void 0===e.hidpi||e.hidpi,r.metersPerUnit_=void 0!==e.metersPerUnit?e.metersPerUnit:1,r.ratio_=void 0!==e.ratio?e.ratio:1,r.useOverlay_=void 0!==e.useOverlay&&e.useOverlay,r.image_=null,r.renderedRevision_=0,r}return Xc(e,t),e.prototype.getParams=function(){return this.params_},e.prototype.getImageInternal=function(t,e,r,i){e=this.findNearestResolution(e),r=this.hidpi_?r:1;var n=this.image_;if(n&&this.renderedRevision_==this.getRevision()&&n.getResolution()==e&&n.getPixelRatio()==r&&Yt(n.getExtent(),t))return n;1!=this.ratio_&&me(t=t.slice(),this.ratio_);var o=[fe(t)/e*r,he(t)/e*r];if(void 0!==this.url_){var s=this.getUrl(this.url_,this.params_,t,o,i);(n=new Ku(t,e,r,s,this.crossOrigin_,this.imageLoadFunction_)).addEventListener(O,this.handleImageChange.bind(this))}else n=null;return this.image_=n,this.renderedRevision_=this.getRevision(),n},e.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},e.prototype.updateParams=function(t){T(this.params_,t),this.changed()},e.prototype.getUrl=function(t,e,r,i,n){var o=function(t,e,r,i){var n=fe(t),o=he(t),s=e[0],a=e[1],l=.0254/i;return a*n>s*o?n*r/(s*l):o*r/(a*l)}(r,i,this.metersPerUnit_,this.displayDpi_),s=ae(r),a={OPERATION:this.useOverlay_?"GETDYNAMICMAPOVERLAYIMAGE":"GETMAPIMAGE",VERSION:"2.0.0",LOCALE:"en",CLIENTAGENT:"ol/source/ImageMapGuide source",CLIP:"1",SETDISPLAYDPI:this.displayDpi_,SETDISPLAYWIDTH:Math.round(i[0]),SETDISPLAYHEIGHT:Math.round(i[1]),SETVIEWSCALE:o,SETVIEWCENTERX:s[0],SETVIEWCENTERY:s[1]};return T(a,e),Gc(t,a)},e.prototype.setImageLoadFunction=function(t){this.image_=null,this.imageLoadFunction_=t,this.changed()},e}(Dc),Zc=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Kc=function(t){function e(e){var r=this,i=void 0!==e.crossOrigin?e.crossOrigin:null,n=void 0!==e.imageLoadFunction?e.imageLoadFunction:jc;return(r=t.call(this,{attributions:e.attributions,imageSmoothing:e.imageSmoothing,projection:gr(e.projection)})||this).url_=e.url,r.imageExtent_=e.imageExtent,r.image_=new Ku(r.imageExtent_,void 0,1,r.url_,i,n),r.imageSize_=e.imageSize?e.imageSize:null,r.image_.addEventListener(O,r.handleImageChange.bind(r)),r}return Zc(e,t),e.prototype.getImageExtent=function(){return this.imageExtent_},e.prototype.getImageInternal=function(t,e,r,i){return ge(t,this.image_.getExtent())?this.image_:null},e.prototype.getUrl=function(){return this.url_},e.prototype.handleImageChange=function(e){if(this.image_.getState()==To){var r=this.image_.getExtent(),i=this.image_.getImage(),n=void 0,o=void 0;this.imageSize_?(n=this.imageSize_[0],o=this.imageSize_[1]):(n=i.width,o=i.height);var s=he(r)/o,a=Math.ceil(fe(r)/s);if(a!=n){var l=zn(a,o),u=l.canvas;l.drawImage(i,0,0,n,o,0,0,u.width,u.height),this.image_.setImage(u)}}t.prototype.handleImageChange.call(this,e)},e}(Dc),Hc="carmentaserver",Jc="geoserver",$c="mapserver",Qc="qgis",tp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),ep=[101,101],rp=function(t){function e(e){var r=this,i=e||{};return(r=t.call(this,{attributions:i.attributions,imageSmoothing:i.imageSmoothing,projection:i.projection,resolutions:i.resolutions})||this).crossOrigin_=void 0!==i.crossOrigin?i.crossOrigin:null,r.url_=i.url,r.imageLoadFunction_=void 0!==i.imageLoadFunction?i.imageLoadFunction:jc,r.params_=i.params||{},r.v13_=!0,r.updateV13_(),r.serverType_=i.serverType,r.hidpi_=void 0===i.hidpi||i.hidpi,r.image_=null,r.imageSize_=[0,0],r.renderedRevision_=0,r.ratio_=void 0!==i.ratio?i.ratio:1.5,r}return tp(e,t),e.prototype.getFeatureInfoUrl=function(t,e,r,i){if(void 0!==this.url_){var n=gr(r),o=this.getProjection();o&&o!==n&&(e=xh(o,n,t,e),t=Tr(t,n,o));var s=ue(t,e,0,ep),a={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};T(a,this.params_,i);var l=Math.floor((t[0]-s[0])/e),u=Math.floor((s[3]-t[1])/e);return a[this.v13_?"I":"X"]=l,a[this.v13_?"J":"Y"]=u,this.getRequestUrl_(s,ep,1,o||n,a)}},e.prototype.getLegendUrl=function(t,e){if(void 0!==this.url_){var r={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){var i=this.params_.LAYERS;if(!(!Array.isArray(i)||1===i.length))return;r.LAYER=i}if(void 0!==t){var n=this.getProjection()?this.getProjection().getMetersPerUnit():1;r.SCALE=t*n*39.37*(25.4/.28)}return T(r,e),Gc(this.url_,r)}},e.prototype.getParams=function(){return this.params_},e.prototype.getImageInternal=function(t,e,r,i){if(void 0===this.url_)return null;e=this.findNearestResolution(e),1==r||this.hidpi_&&void 0!==this.serverType_||(r=1);var n=e/r,o=ae(t),s=ue(o,n,0,[Math.ceil(fe(t)/n),Math.ceil(he(t)/n)]),a=ue(o,n,0,[Math.ceil(this.ratio_*fe(t)/n),Math.ceil(this.ratio_*he(t)/n)]),l=this.image_;if(l&&this.renderedRevision_==this.getRevision()&&l.getResolution()==e&&l.getPixelRatio()==r&&Yt(l.getExtent(),s))return l;var u={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};T(u,this.params_),this.imageSize_[0]=Math.round(fe(a)/n),this.imageSize_[1]=Math.round(he(a)/n);var h=this.getRequestUrl_(a,this.imageSize_,r,i,u);return this.image_=new Ku(a,e,r,h,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),this.image_.addEventListener(O,this.handleImageChange.bind(this)),this.image_},e.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},e.prototype.getRequestUrl_=function(t,e,r,i,n){if(lt(void 0!==this.url_,9),n[this.v13_?"CRS":"SRS"]=i.getCode(),"STYLES"in this.params_||(n.STYLES=""),1!=r)switch(this.serverType_){case Jc:var o=90*r+.5|0;"FORMAT_OPTIONS"in n?n.FORMAT_OPTIONS+=";dpi:"+o:n.FORMAT_OPTIONS="dpi:"+o;break;case $c:n.MAP_RESOLUTION=90*r;break;case Hc:case Qc:n.DPI=90*r;break;default:lt(!1,8)}n.WIDTH=e[0],n.HEIGHT=e[1];var s,a=i.getAxisOrientation();return s=this.v13_&&"ne"==a.substr(0,2)?[t[1],t[0],t[3],t[2]]:t,n.BBOX=s.join(","),Gc(this.url_,n)},e.prototype.getUrl=function(){return this.url_},e.prototype.setImageLoadFunction=function(t){this.image_=null,this.imageLoadFunction_=t,this.changed()},e.prototype.setUrl=function(t){t!=this.url_&&(this.url_=t,this.image_=null,this.changed())},e.prototype.updateParams=function(t){T(this.params_,t),this.updateV13_(),this.image_=null,this.changed()},e.prototype.updateV13_=function(){var t=this.params_.VERSION||"1.3.0";this.v13_=$e(t,"1.3")>=0},e}(Dc),ip=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),np='© OpenStreetMap contributors.',op=function(t){function e(e){var r,i=e||{};r=void 0!==i.attributions?i.attributions:[np];var n=void 0!==i.crossOrigin?i.crossOrigin:"anonymous",o=void 0!==i.url?i.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:r,cacheSize:i.cacheSize,crossOrigin:n,imageSmoothing:i.imageSmoothing,opaque:void 0===i.opaque||i.opaque,maxZoom:void 0!==i.maxZoom?i.maxZoom:19,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileLoadFunction:i.tileLoadFunction,url:o,wrapX:i.wrapX,attributionsCollapsible:!1})||this}return ip(e,t),e}(Jh),sp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),ap=function(t){function e(e){var r=e||{};return t.call(this,r)||this}return sp(e,t),e}(In),lp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),up=function(t){function e(e){var r=t.call(this)||this;return r.boundHandleImageChange_=r.handleImageChange_.bind(r),r.layer_=e,r}return lp(e,t),e.prototype.getFeatures=function(t){return i()},e.prototype.prepareFrame=function(t){return i()},e.prototype.renderFrame=function(t,e){return i()},e.prototype.loadedTileCallback=function(t,e,r){t[e]||(t[e]={}),t[e][r.tileCoord.toString()]=r},e.prototype.createLoadedTileFinder=function(t,e,r){return function(i,n){var o=this.loadedTileCallback.bind(this,r,i);return t.forEachLoadedTile(e,i,n,o)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,i,n){},e.prototype.getDataAtPixel=function(t,e,r){return i()},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){t.target.getState()===To&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return e!=To&&e!=Co&&t.addEventListener(O,this.boundHandleImageChange_),e==bo&&(t.load(),e=t.getState()),e==To},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Cn&&t.changed()},e}(K),hp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),cp=function(t){function e(e){var r=t.call(this,e)||this;return r.container=null,r.renderedResolution,r.tempTransform=[1,0,0,1,0,0],r.pixelTransform=[1,0,0,1,0,0],r.inversePixelTransform=[1,0,0,1,0,0],r.context=null,r.containerReused=!1,r}return hp(e,t),e.prototype.useContainer=function(t,e,r){var i,n,o=this.getLayer().getClassName();t&&""===t.style.opacity&&t.className===o&&((a=t.firstElementChild)instanceof HTMLCanvasElement&&(n=a.getContext("2d")));if(!n||0!==n.canvas.width&&n.canvas.style.transform!==e?this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1):(this.container=t,this.context=n,this.containerReused=!0),!this.container){(i=document.createElement("div")).className=o;var s=i.style;s.position="absolute",s.width="100%",s.height="100%";var a=(n=zn()).canvas;i.appendChild(a),(s=a.style).position="absolute",s.left="0",s.transformOrigin="top left",this.container=i,this.context=n}},e.prototype.clip=function(t,e,r){var i=e.pixelRatio,n=e.size[0]*i/2,o=e.size[1]*i/2,s=e.viewState.rotation,a=pe(r),l=de(r),u=se(r),h=oe(r);St(e.coordinateToPixelTransform,a),St(e.coordinateToPixelTransform,l),St(e.coordinateToPixelTransform,u),St(e.coordinateToPixelTransform,h),t.save(),uo(t,-s,n,o),t.beginPath(),t.moveTo(a[0]*i,a[1]*i),t.lineTo(l[0]*i,l[1]*i),t.lineTo(u[0]*i,u[1]*i),t.lineTo(h[0]*i,h[1]*i),t.clip(),uo(t,s,n,o)},e.prototype.clipUnrotated=function(t,e,r){var i=pe(r),n=de(r),o=se(r),s=oe(r);St(e.coordinateToPixelTransform,i),St(e.coordinateToPixelTransform,n),St(e.coordinateToPixelTransform,o),St(e.coordinateToPixelTransform,s);var a=this.inversePixelTransform;St(a,i),St(a,n),St(a,o),St(a,s),t.save(),t.beginPath(),t.moveTo(Math.round(i[0]),Math.round(i[1])),t.lineTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,r){var i=this.getLayer();if(i.hasListener(t)){var n=new Do(t,this.inversePixelTransform,r,e);i.dispatchEvent(n)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(_n,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(vn,t,e)},e.prototype.getRenderTransform=function(t,e,r,i,n,o,s){var a=n/2,l=o/2,u=i/e,h=-u,c=-t[0]+s,p=-t[1];return Ct(this.tempTransform,a,l,u,h,-r,c,p)},e.prototype.getDataAtPixel=function(t,e,r){var i,n=St(this.inversePixelTransform,t.slice()),o=this.context;try{var s=Math.round(n[0]),a=Math.round(n[1]),l=document.createElement("canvas"),u=l.getContext("2d");l.width=1,l.height=1,u.clearRect(0,0,1,1),u.drawImage(o.canvas,s,a,1,1,0,0,1,1),i=u.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?new Uint8Array:i}return 0===i[3]?null:i},e}(up),pp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),dp=function(t){function e(e){var r=t.call(this,e)||this;return r.image_=null,r}return pp(e,t),e.prototype.getImage=function(){return this.image_?this.image_.getImage():null},e.prototype.prepareFrame=function(t){var e=t.layerStatesArray[t.layerIndex],r=t.pixelRatio,i=t.viewState,n=i.resolution,o=this.getLayer().getSource(),s=t.viewHints,a=t.extent;if(void 0!==e.extent&&(a=ce(a,Ar(e.extent,i.projection))),!s[ys]&&!s[ms]&&!ye(a))if(o){var l=i.projection,u=o.getImage(a,n,r,l);u&&this.loadImage(u)&&(this.image_=u)}else this.image_=null;return!!this.image_},e.prototype.renderFrame=function(t,e){var r=this.image_,i=r.getExtent(),n=r.getResolution(),o=r.getPixelRatio(),s=t.layerStatesArray[t.layerIndex],a=t.pixelRatio,l=t.viewState,u=l.center,h=l.resolution,c=t.size,p=a*n/(h*o),d=Math.round(c[0]*a),f=Math.round(c[1]*a),g=l.rotation;if(g){var y=Math.round(Math.sqrt(d*d+f*f));d=y,f=y}Ct(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/a,1/a,g,-d/2,-f/2),Et(this.inversePixelTransform,this.pixelTransform);var m=po(this.pixelTransform);this.useContainer(e,m,s.opacity);var _=this.context,v=_.canvas;v.width!=d||v.height!=f?(v.width=d,v.height=f):this.containerReused||_.clearRect(0,0,d,f);var x=!1;if(s.extent){var w=Ar(s.extent,l.projection);(x=!Yt(w,t.extent)&&ge(w,t.extent))&&this.clipUnrotated(_,t,w)}var b=r.getImage(),S=Ct(this.tempTransform,d/2,f/2,p,p,0,o*(i[0]-u[0])/n,o*(u[1]-i[3])/n);this.renderedResolution=n*a/o;var C=S[4],E=S[5],R=b.width*S[0],P=b.height*S[3];if(T(_,this.getLayer().getSource().getContextOptions()),this.preRender(_,t),R>=.5&&P>=.5){var I=s.opacity,O=void 0;1!==I&&(O=this.context.globalAlpha,this.context.globalAlpha=I),this.context.drawImage(b,0,0,+b.width,+b.height,Math.round(C),Math.round(E),Math.round(R),Math.round(P)),1!==I&&(this.context.globalAlpha=O)}return this.postRender(_,t),x&&_.restore(),m!==v.style.transform&&(v.style.transform=m),this.container},e}(cp),fp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),gp=function(t){function e(e){return t.call(this,e)||this}return fp(e,t),e.prototype.createRenderer=function(){return new dp(this)},e}(ap),yp="preload",mp="useInterimTilesOnError",_p=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),vp=function(t){function e(e){var r=this,i=e||{},n=T({},i);return delete n.preload,delete n.useInterimTilesOnError,(r=t.call(this,n)||this).setPreload(void 0!==i.preload?i.preload:0),r.setUseInterimTilesOnError(void 0===i.useInterimTilesOnError||i.useInterimTilesOnError),r}return _p(e,t),e.prototype.getPreload=function(){return this.get(yp)},e.prototype.setPreload=function(t){this.set(yp,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(mp)},e.prototype.setUseInterimTilesOnError=function(t){this.set(mp,t)},e}(In),xp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),wp=function(t){function e(e){var r=t.call(this,e)||this;return r.extentChanged=!0,r.renderedExtent_=null,r.renderedPixelRatio,r.renderedProjection=null,r.renderedRevision,r.renderedTiles=[],r.newTiles_=!1,r.tmpExtent=[1/0,1/0,-1/0,-1/0],r.tmpTileRange_=new Tl(0,0,0,0),r}return xp(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),r=t.getState(),i=e.getUseInterimTilesOnError();return r==cs||r==ds||r==ps&&!i},e.prototype.getTile=function(t,e,r,i){var n=i.pixelRatio,o=i.viewState.projection,s=this.getLayer(),a=s.getSource().getTile(t,e,r,n,o);return a.getState()==ps&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.newTiles_=!0):a.setState(cs)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},e.prototype.loadedTileCallback=function(e,r,i){return!!this.isDrawableTile(i)&&t.prototype.loadedTileCallback.call(this,e,r,i)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var r=t.layerStatesArray[t.layerIndex],i=t.viewState,n=i.projection,s=i.resolution,a=i.center,l=i.rotation,u=t.pixelRatio,h=this.getLayer(),c=h.getSource(),p=c.getRevision(),f=c.getTileGridForProjection(n),g=f.getZForResolution(s,c.zDirection),y=f.getResolution(g),m=t.extent,_=r.extent&&Ar(r.extent,n);_&&(m=ce(m,Ar(r.extent,n)));var v=c.getTilePixelRatio(u),x=Math.round(t.size[0]*v),w=Math.round(t.size[1]*v);if(l){var b=Math.round(Math.sqrt(x*x+w*w));x=b,w=b}var S=y*x/2/v,C=y*w/2/v,E=[a[0]-S,a[1]-C,a[0]+S,a[1]+C],R=f.getTileRangeForExtentAndZ(m,g),P={};P[g]={};var I=this.createLoadedTileFinder(c,n,P),O=this.tmpExtent,L=this.tmpTileRange_;this.newTiles_=!1;for(var M=R.minX;M<=R.maxX;++M)for(var F=R.minY;F<=R.maxY;++F){var A=this.getTile(g,M,F,t);if(this.isDrawableTile(A)){var k=o(this);if(A.getState()==cs){P[g][A.tileCoord.toString()]=A;var N=A.inTransition(k);this.newTiles_||!N&&-1!==this.renderedTiles.indexOf(A)||(this.newTiles_=!0)}if(1===A.getAlpha(k,t.time))continue}var j=f.getTileCoordChildTileRange(A.tileCoord,L,O),D=!1;j&&(D=I(g+1,j)),D||f.forEachTileCoordParentTileRange(A.tileCoord,I,L,O)}var G=y/s;Ct(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/v,1/v,l,-x/2,-w/2);var z=po(this.pixelTransform);this.useContainer(e,z,r.opacity);var B=this.context,U=B.canvas;Et(this.inversePixelTransform,this.pixelTransform),Ct(this.tempTransform,x/2,w/2,G,G,0,-x/2,-w/2),U.width!=x||U.height!=w?(U.width=x,U.height=w):this.containerReused||B.clearRect(0,0,x,w),_&&this.clipUnrotated(B,t,_),T(B,c.getContextOptions()),this.preRender(B,t),this.renderedTiles.length=0;var Y,W,V,X=Object.keys(P).map(Number);X.sort(d),1!==r.opacity||this.containerReused&&!c.getOpaque(t.viewState.projection)?(Y=[],W=[]):X=X.reverse();for(var q=X.length-1;q>=0;--q){var Z=X[q],K=c.getTilePixelSize(Z,u,n),H=f.getResolution(Z)/y,J=K[0]*H*G,$=K[1]*H*G,Q=f.getTileCoordForCoordAndZ(pe(E),Z),tt=f.getTileCoordExtent(Q),et=St(this.tempTransform,[v*(tt[0]-E[0])/y,v*(E[3]-tt[3])/y]),rt=v*c.getGutterForProjection(n),it=P[Z];for(var nt in it){var ot=(A=it[nt]).tileCoord,st=et[0]-(Q[1]-ot[1])*J,at=Math.round(st+J),lt=et[1]-(Q[2]-ot[2])*$,ut=Math.round(lt+$),ht=at-(M=Math.round(st)),ct=ut-(F=Math.round(lt)),pt=g===Z;if(!(N=pt&&1!==A.getAlpha(o(this),t.time)))if(Y){B.save(),V=[M,F,M+ht,F,M+ht,F+ct,M,F+ct];for(var dt=0,ft=Y.length;dtthis._maxQueueLength;)this._queue.shift().callback(null,null)},e.prototype._dispatch=function(){if(0===this._running&&this._queue.length>0){var t=this._queue.shift();this._job=t;var e=t.inputs[0].width,r=t.inputs[0].height,i=t.inputs.map((function(t){return t.data.buffer})),n=this._workers.length;if(this._running=n,1===n)this._workers[0].postMessage({buffers:i,meta:t.meta,imageOps:this._imageOps,width:e,height:r},i);else for(var o=t.inputs[0].data.length,s=4*Math.ceil(o/4/n),a=0;aStamen Design, under CC BY 3.0.',np],Yp={terrain:{extension:"jpg",opaque:!0},"terrain-background":{extension:"jpg",opaque:!0},"terrain-labels":{extension:"png",opaque:!1},"terrain-lines":{extension:"png",opaque:!1},"toner-background":{extension:"png",opaque:!0},toner:{extension:"png",opaque:!0},"toner-hybrid":{extension:"png",opaque:!1},"toner-labels":{extension:"png",opaque:!1},"toner-lines":{extension:"png",opaque:!1},"toner-lite":{extension:"png",opaque:!0},watercolor:{extension:"jpg",opaque:!0}},Wp={terrain:{minZoom:0,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:0,maxZoom:18}},Vp=function(t){function e(e){var r=e.layer.indexOf("-"),i=-1==r?e.layer:e.layer.slice(0,r),n=Wp[i],o=Yp[e.layer],s=void 0!==e.url?e.url:"https://stamen-tiles-{a-d}.a.ssl.fastly.net/"+e.layer+"/{z}/{x}/{y}."+o.extension;return t.call(this,{attributions:Up,cacheSize:e.cacheSize,crossOrigin:"anonymous",imageSmoothing:e.imageSmoothing,maxZoom:null!=e.maxZoom?e.maxZoom:n.maxZoom,minZoom:null!=e.minZoom?e.minZoom:n.minZoom,opaque:o.opaque,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,transition:e.transition,url:s,wrapX:e.wrapX})||this}return Bp(e,t),e}(Jh),Xp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),qp=function(t){function e(e){var r=this,i=e||{};return(r=t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,imageSmoothing:i.imageSmoothing,projection:i.projection,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileGrid:i.tileGrid,tileLoadFunction:i.tileLoadFunction,url:i.url,urls:i.urls,wrapX:void 0===i.wrapX||i.wrapX,transition:i.transition})||this).params_=i.params||{},r.hidpi_=void 0===i.hidpi||i.hidpi,r.tmpExtent_=[1/0,1/0,-1/0,-1/0],r.setKey(r.getKeyForParams_()),r}return Xp(e,t),e.prototype.getKeyForParams_=function(){var t=0,e=[];for(var r in this.params_)e[t++]=r+"-"+this.params_[r];return e.join("/")},e.prototype.getParams=function(){return this.params_},e.prototype.getRequestUrl_=function(t,e,r,i,n,o){var s=this.urls;if(s){var a,l=n.getCode().split(":").pop();if(o.SIZE=e[0]+","+e[1],o.BBOX=r.join(","),o.BBOXSR=l,o.IMAGESR=l,o.DPI=Math.round(o.DPI?o.DPI*i:90*i),1==s.length)a=s[0];else a=s[Pe(Il(t),s.length)];return Gc(a.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage"),o)}},e.prototype.getTilePixelRatio=function(t){return this.hidpi_?t:1},e.prototype.updateParams=function(t){T(this.params_,t),this.setKey(this.getKeyForParams_())},e.prototype.tileUrlFunction=function(t,e,r){var i=this.getTileGrid();if(i||(i=this.getTileGridForProjection(r)),!(i.getResolutions().length<=t[0])){1==e||this.hidpi_||(e=1);var n=i.getTileCoordExtent(t,this.tmpExtent_),o=Ds(i.getTileSize(t[0]),this.tmpSize);1!=e&&(o=js(o,e,this.tmpSize));var s={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};return T(s,this.params_),this.getRequestUrl_(t,o,n,e,r,s)}},e}(Xh),Zp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Kp=function(t){function e(e,r,i){var n=t.call(this,e,cs)||this;return n.tileSize_=r,n.text_=i,n.canvas_=null,n}return Zp(e,t),e.prototype.getImage=function(){if(this.canvas_)return this.canvas_;var t=this.tileSize_,e=zn(t[0],t[1]);return e.strokeStyle="grey",e.strokeRect(.5,.5,t[0]+.5,t[1]+.5),e.fillStyle="grey",e.strokeStyle="white",e.textAlign="center",e.textBaseline="middle",e.font="24px sans-serif",e.lineWidth=4,e.strokeText(this.text_,t[0]/2,t[1]/2,t[0]),e.fillText(this.text_,t[0]/2,t[1]/2,t[0]),this.canvas_=e.canvas,e.canvas},e.prototype.load=function(){},e}(ph),Hp=function(t){function e(e){var r=e||{};return t.call(this,{opaque:!1,projection:r.projection,tileGrid:r.tileGrid,wrapX:void 0===r.wrapX||r.wrapX,zDirection:r.zDirection})||this}return Zp(e,t),e.prototype.getTile=function(t,e,r){var i=El(t,e,r);if(this.tileCache.containsKey(i))return this.tileCache.get(i);var n=Ds(this.tileGrid.getTileSize(t)),o=[t,e,r],s=this.getTileCoordForTileUrlFunction(o),a=void 0;a=s?"z:"+s[0]+" x:"+s[1]+" y:"+s[2]:"none";var l=new Kp(o,n,a);return this.tileCache.set(i,l),l},e}(Jh),Jp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),$p=function(t){function e(e){var r=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,imageSmoothing:e.imageSmoothing,projection:gr("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:Tn,tileLoadFunction:e.tileLoadFunction,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition})||this;if(r.tileJSON_=null,r.tileSize_=e.tileSize,e.url)if(e.jsonp)qh(e.url,r.handleTileJSONResponse.bind(r),r.handleTileJSONError.bind(r));else{var i=new XMLHttpRequest;i.addEventListener("load",r.onXHRLoad_.bind(r)),i.addEventListener("error",r.onXHRError_.bind(r)),i.open("GET",e.url),i.send()}else e.tileJSON?r.handleTileJSONResponse(e.tileJSON):lt(!1,51);return r}return Jp(e,t),e.prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||e.status>=200&&e.status<300){var r=void 0;try{r=JSON.parse(e.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(r)}else this.handleTileJSONError()},e.prototype.onXHRError_=function(t){this.handleTileJSONError()},e.prototype.getTileJSON=function(){return this.tileJSON_},e.prototype.handleTileJSONResponse=function(t){var e,r=gr("EPSG:4326"),i=this.getProjection();if(void 0!==t.bounds){var n=br(r,i);e=_e(t.bounds,n)}var o=t.minzoom||0,s=t.maxzoom||22,a=Fl({extent:Nl(i),maxZoom:s,minZoom:o,tileSize:this.tileSize_});if(this.tileGrid=a,this.tileUrlFunction=Dh(t.tiles,a),void 0!==t.attribution&&!this.getAttributions()){var l=void 0!==e?e:r.getExtent();this.setAttributions((function(e){return ge(l,e.extent)?[t.attribution]:null}))}this.tileJSON_=t,this.setState(Cn)},e.prototype.handleTileJSONError=function(){this.setState(En)},e}(Xh),Qp=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),td=function(t){function e(e){var r=this,i=e||{},n=i.params||{},o=!("TRANSPARENT"in n)||n.TRANSPARENT;return(r=t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,imageSmoothing:i.imageSmoothing,opaque:!o,projection:i.projection,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileClass:i.tileClass,tileGrid:i.tileGrid,tileLoadFunction:i.tileLoadFunction,url:i.url,urls:i.urls,wrapX:void 0===i.wrapX||i.wrapX,transition:i.transition})||this).gutter_=void 0!==i.gutter?i.gutter:0,r.params_=n,r.v13_=!0,r.serverType_=i.serverType,r.hidpi_=void 0===i.hidpi||i.hidpi,r.tmpExtent_=[1/0,1/0,-1/0,-1/0],r.updateV13_(),r.setKey(r.getKeyForParams_()),r}return Qp(e,t),e.prototype.getFeatureInfoUrl=function(t,e,r,i){var n=gr(r),o=this.getProjection(),s=this.getTileGrid();s||(s=this.getTileGridForProjection(n));var a=s.getZForResolution(e,this.zDirection),l=s.getTileCoordForCoordAndZ(t,a);if(!(s.getResolutions().length<=l[0])){var u=s.getResolution(l[0]),h=s.getTileCoordExtent(l,this.tmpExtent_),c=Ds(s.getTileSize(l[0]),this.tmpSize),p=this.gutter_;0!==p&&(c=Ns(c,p,this.tmpSize),h=Gt(h,u*p,h)),o&&o!==n&&(u=xh(o,n,t,u),h=Cr(h,n,o),t=Tr(t,n,o));var d={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};T(d,this.params_,i);var f=Math.floor((t[0]-h[0])/u),g=Math.floor((h[3]-t[1])/u);return d[this.v13_?"I":"X"]=f,d[this.v13_?"J":"Y"]=g,this.getRequestUrl_(l,c,h,1,o||n,d)}},e.prototype.getLegendUrl=function(t,e){if(void 0!==this.urls[0]){var r={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){var i=this.params_.LAYERS;if(!(!Array.isArray(i)||1===i.length))return;r.LAYER=i}if(void 0!==t){var n=this.getProjection()?this.getProjection().getMetersPerUnit():1;r.SCALE=t*n*39.37*(25.4/.28)}return T(r,e),Gc(this.urls[0],r)}},e.prototype.getGutter=function(){return this.gutter_},e.prototype.getParams=function(){return this.params_},e.prototype.getRequestUrl_=function(t,e,r,i,n,o){var s=this.urls;if(s){if(o.WIDTH=e[0],o.HEIGHT=e[1],o[this.v13_?"CRS":"SRS"]=n.getCode(),"STYLES"in this.params_||(o.STYLES=""),1!=i)switch(this.serverType_){case Jc:var a=90*i+.5|0;"FORMAT_OPTIONS"in o?o.FORMAT_OPTIONS+=";dpi:"+a:o.FORMAT_OPTIONS="dpi:"+a;break;case $c:o.MAP_RESOLUTION=90*i;break;case Hc:case Qc:o.DPI=90*i;break;default:lt(!1,52)}var l,u=n.getAxisOrientation(),h=r;if(this.v13_&&"ne"==u.substr(0,2)){var c=void 0;c=r[0],h[0]=r[1],h[1]=c,c=r[2],h[2]=r[3],h[3]=c}if(o.BBOX=h.join(","),1==s.length)l=s[0];else l=s[Pe(Il(t),s.length)];return Gc(l,o)}},e.prototype.getTilePixelRatio=function(t){return this.hidpi_&&void 0!==this.serverType_?t:1},e.prototype.getKeyForParams_=function(){var t=0,e=[];for(var r in this.params_)e[t++]=r+"-"+this.params_[r];return e.join("/")},e.prototype.updateParams=function(t){T(this.params_,t),this.updateV13_(),this.setKey(this.getKeyForParams_())},e.prototype.updateV13_=function(){var t=this.params_.VERSION||"1.3.0";this.v13_=$e(t,"1.3")>=0},e.prototype.tileUrlFunction=function(t,e,r){var i=this.getTileGrid();if(i||(i=this.getTileGridForProjection(r)),!(i.getResolutions().length<=t[0])){1==e||this.hidpi_&&void 0!==this.serverType_||(e=1);var n=i.getResolution(t[0]),o=i.getTileCoordExtent(t,this.tmpExtent_),s=Ds(i.getTileSize(t[0]),this.tmpSize),a=this.gutter_;0!==a&&(s=Ns(s,a,this.tmpSize),o=Gt(o,n*a,o)),1!=e&&(s=js(s,e,this.tmpSize));var l={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return T(l,this.params_),this.getRequestUrl_(t,s,o,e,r,l)}},e}(Xh),ed=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),rd=function(t){function e(e,r,i,n,o,s){var a=t.call(this,e,r)||this;return a.src_=i,a.extent_=n,a.preemptive_=o,a.grid_=null,a.keys_=null,a.data_=null,a.jsonp_=s,a}return ed(e,t),e.prototype.getImage=function(){return null},e.prototype.getData=function(t){if(!this.grid_||!this.keys_)return null;var e=(t[0]-this.extent_[0])/(this.extent_[2]-this.extent_[0]),r=(t[1]-this.extent_[1])/(this.extent_[3]-this.extent_[1]),i=this.grid_[Math.floor((1-r)*this.grid_.length)];if("string"!=typeof i)return null;var n=i.charCodeAt(Math.floor(e*i.length));n>=93&&n--,n>=35&&n--;var o=null;if((n-=32)in this.keys_){var s=this.keys_[n];o=this.data_&&s in this.data_?this.data_[s]:s}return o},e.prototype.forDataAtCoordinate=function(t,e,r){this.state==ds&&!0===r?(this.state=us,V(this,O,(function(r){e(this.getData(t))}),this),this.loadInternal_()):!0===r?setTimeout(function(){e(this.getData(t))}.bind(this),0):e(this.getData(t))},e.prototype.getKey=function(){return this.src_},e.prototype.handleError_=function(){this.state=ps,this.changed()},e.prototype.handleLoad_=function(t){this.grid_=t.grid,this.keys_=t.keys,this.data_=t.data,this.state=cs,this.changed()},e.prototype.loadInternal_=function(){if(this.state==us)if(this.state=hs,this.jsonp_)qh(this.src_,this.handleLoad_.bind(this),this.handleError_.bind(this));else{var t=new XMLHttpRequest;t.addEventListener("load",this.onXHRLoad_.bind(this)),t.addEventListener("error",this.onXHRError_.bind(this)),t.open("GET",this.src_),t.send()}},e.prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||e.status>=200&&e.status<300){var r=void 0;try{r=JSON.parse(e.responseText)}catch(t){return void this.handleError_()}this.handleLoad_(r)}else this.handleError_()},e.prototype.onXHRError_=function(t){this.handleError_()},e.prototype.load=function(){this.preemptive_?this.loadInternal_():this.setState(ds)},e}(ph),id=function(t){function e(e){var r=t.call(this,{projection:gr("EPSG:3857"),state:Tn})||this;if(r.preemptive_=void 0===e.preemptive||e.preemptive,r.tileUrlFunction_=zh,r.template_=void 0,r.jsonp_=e.jsonp||!1,e.url)if(r.jsonp_)qh(e.url,r.handleTileJSONResponse.bind(r),r.handleTileJSONError.bind(r));else{var i=new XMLHttpRequest;i.addEventListener("load",r.onXHRLoad_.bind(r)),i.addEventListener("error",r.onXHRError_.bind(r)),i.open("GET",e.url),i.send()}else e.tileJSON?r.handleTileJSONResponse(e.tileJSON):lt(!1,51);return r}return ed(e,t),e.prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||e.status>=200&&e.status<300){var r=void 0;try{r=JSON.parse(e.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(r)}else this.handleTileJSONError()},e.prototype.onXHRError_=function(t){this.handleTileJSONError()},e.prototype.getTemplate=function(){return this.template_},e.prototype.forDataAtCoordinateAndResolution=function(t,e,r,i){if(this.tileGrid){var n=this.tileGrid.getZForResolution(e,this.zDirection),o=this.tileGrid.getTileCoordForCoordAndZ(t,n);this.getTile(o[0],o[1],o[2],1,this.getProjection()).forDataAtCoordinate(t,r,i)}else!0===i?setTimeout((function(){r(null)}),0):r(null)},e.prototype.handleTileJSONError=function(){this.setState(En)},e.prototype.handleTileJSONResponse=function(t){var e,r=gr("EPSG:4326"),i=this.getProjection();if(void 0!==t.bounds){var n=br(r,i);e=_e(t.bounds,n)}var o=t.minzoom||0,s=t.maxzoom||22,a=Fl({extent:Nl(i),maxZoom:s,minZoom:o});this.tileGrid=a,this.template_=t.template;var l=t.grids;if(l){if(this.tileUrlFunction_=Dh(l,a),void 0!==t.attribution){var u=void 0!==e?e:r.getExtent();this.setAttributions((function(e){return ge(u,e.extent)?[t.attribution]:null}))}this.setState(Cn)}else this.setState(En)},e.prototype.getTile=function(t,e,r,i,n){var o=El(t,e,r);if(this.tileCache.containsKey(o))return this.tileCache.get(o);var s=[t,e,r],a=this.getTileCoordForTileUrlFunction(s,n),l=this.tileUrlFunction_(a,i,n),u=new rd(s,void 0!==l?us:ds,void 0!==l?l:"",this.tileGrid.getTileCoordExtent(s),this.preemptive_,this.jsonp_);return this.tileCache.set(o,u),u},e.prototype.useTile=function(t,e,r){var i=El(t,e,r);this.tileCache.containsKey(i)&&this.tileCache.get(i)},e}(Nh),nd=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),od=function(t){function e(e,r,i,n,o,s){var a=t.call(this,e,r,s)||this;return a.extent=null,a.format_=n,a.features_=null,a.loader_,a.projection=null,a.resolution,a.tileLoadFunction_=o,a.url_=i,a}return nd(e,t),e.prototype.getFormat=function(){return this.format_},e.prototype.getFeatures=function(){return this.features_},e.prototype.getKey=function(){return this.url_},e.prototype.load=function(){this.state==us&&(this.setState(hs),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))},e.prototype.onLoad=function(t,e){this.setFeatures(t)},e.prototype.onError=function(){this.setState(ps)},e.prototype.setFeatures=function(t){this.features_=t,this.setState(cs)},e.prototype.setLoader=function(t){this.loader_=t},e}(ph),sd=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),ad=[],ld=function(t){function e(e,r,i,n){var o=t.call(this,e,r,{transition:0})||this;return o.context_={},o.executorGroups={},o.loadingSourceTiles=0,o.errorSourceTileKeys={},o.hitDetectionImageData={},o.replayState_={},o.sourceTiles=null,o.wantedResolution,o.getSourceTiles=n.bind(void 0,o),o.sourceZ=-1,o.hifi=!1,o.wrappedTileCoord=i,o}return sd(e,t),e.prototype.getContext=function(t){var e=o(t);return e in this.context_||(this.context_[e]=zn(1,1,ad)),this.context_[e]},e.prototype.hasContext=function(t){return o(t)in this.context_},e.prototype.getImage=function(t){return this.hasContext(t)?this.getContext(t).canvas:null},e.prototype.getReplayState=function(t){var e=o(t);return e in this.replayState_||(this.replayState_[e]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedZ:-1,renderedTileZ:-1}),this.replayState_[e]},e.prototype.load=function(){this.getSourceTiles()},e.prototype.release=function(){for(var e in this.context_)ad.push(this.context_[e].canvas);t.prototype.release.call(this)},e}(ph),ud=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),hd=function(t){function e(e){var r=this,i=e.projection||"EPSG:3857",n=e.extent||Nl(i),o=e.tileGrid||Fl({extent:n,maxResolution:e.maxResolution,maxZoom:void 0!==e.maxZoom?e.maxZoom:22,minZoom:e.minZoom,tileSize:e.tileSize||512});return(r=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,opaque:!1,projection:i,state:e.state,tileGrid:o,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:cd,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:void 0===e.zDirection?1:e.zDirection})||this).format_=e.format?e.format:null,r.loadingTiles_={},r.sourceTileCache=new Eh(r.tileCache.highWaterMark),r.overlaps_=null==e.overlaps||e.overlaps,r.tileClass=e.tileClass?e.tileClass:od,r.tileGrids_={},r}return ud(e,t),e.prototype.getFeaturesInExtent=function(t){var e=[],r=this.tileCache;if(0===r.getCount())return e;var i=Pl(r.peekFirstKey())[0],n=this.tileGrid;return r.forEach((function(r){if(r.tileCoord[0]===i&&r.getState()===cs)for(var o=r.getSourceTiles(),s=0,a=o.length;s0&&g[0].tileCoord[0]===d)h=g,c=!0,p=d;else{h=[],p=d+1;do{--p,c=!0,l.forEachTileCoord(o,p,function(i){var n,o=this.tileUrlFunction(i,t,e);if(void 0!==o)if(this.sourceTileCache.containsKey(o)){var s=(n=this.sourceTileCache.get(o)).getState();if(s===cs||s===ps||s===ds)return void h.push(n)}else p===d&&((n=new this.tileClass(i,us,o,this.format_,this.tileLoadFunction)).extent=l.getTileCoordExtent(i),n.projection=e,n.resolution=l.getResolution(i[0]),this.sourceTileCache.set(o,n),n.addEventListener(O,this.handleTileChange.bind(this)),n.load());c=c&&n&&n.getState()===cs,n&&n.getState()!==ds&&r.getState()===us&&(r.loadingSourceTiles++,n.addEventListener(O,(function t(){var e=n.getState(),i=n.getKey();if(e===cs||e===ps){e===cs?(n.removeEventListener(O,t),r.loadingSourceTiles--,delete r.errorSourceTileKeys[i]):e===ps&&(r.errorSourceTileKeys[i]=!0);var o=Object.keys(r.errorSourceTileKeys).length;r.loadingSourceTiles-o==0&&(r.hifi=0===o,r.sourceZ=d,r.setState(cs))}})))}.bind(this)),c||(h.length=0)}while(!c&&p>f)}return r.getState()===us&&r.setState(hs),c&&(r.hifi=d===p,r.sourceZ=p,r.getState()0&&(r.tileUrlFunction=Gh(o.map(r.createFromWMTSTemplate.bind(r)))),r}return fd(e,t),e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.setTileUrlFunction(Gh(t.map(this.createFromWMTSTemplate.bind(this))),e)},e.prototype.getDimensions=function(){return this.dimensions_},e.prototype.getFormat=function(){return this.format_},e.prototype.getLayer=function(){return this.layer_},e.prototype.getMatrixSet=function(){return this.matrixSet_},e.prototype.getRequestEncoding=function(){return this.requestEncoding_},e.prototype.getStyle=function(){return this.style_},e.prototype.getVersion=function(){return this.version_},e.prototype.getKeyForDimensions_=function(){var t=0,e=[];for(var r in this.dimensions_)e[t++]=r+"-"+this.dimensions_[r];return e.join("/")},e.prototype.updateDimensions=function(t){T(this.dimensions_,t),this.setKey(this.getKeyForDimensions_())},e.prototype.createFromWMTSTemplate=function(t){var e=this.requestEncoding_,r={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};e==pd&&T(r,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_}),t=e==pd?Gc(t,r):t.replace(/\{(\w+?)\}/g,(function(t,e){return e.toLowerCase()in r?r[e.toLowerCase()]:t}));var i=this.tileGrid,n=this.dimensions_;return function(r,o,s){if(r){var a={TileMatrix:i.getMatrixId(r[0]),TileCol:r[1],TileRow:r[2]};T(a,n);var l=t;return l=e==pd?Gc(l,a):l.replace(/\{(\w+?)\}/g,(function(t,e){return a[e]}))}}},e}(Xh);var yd=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),md="renderOrder",_d=function(t){function e(e){var r=this,i=e||{},n=T({},i);return delete n.style,delete n.renderBuffer,delete n.updateWhileAnimating,delete n.updateWhileInteracting,(r=t.call(this,n)||this).declutter_=void 0!==i.declutter&&i.declutter,r.renderBuffer_=void 0!==i.renderBuffer?i.renderBuffer:100,r.style_=null,r.styleFunction_=void 0,r.setStyle(i.style),r.updateWhileAnimating_=void 0!==i.updateWhileAnimating&&i.updateWhileAnimating,r.updateWhileInteracting_=void 0!==i.updateWhileInteracting&&i.updateWhileInteracting,r}return yd(e,t),e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(md)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.setRenderOrder=function(t){this.set(md,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:nh,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var r;if(Array.isArray(t))r=t;else lt("function"==typeof t.getZIndex,41),r=[t];e=function(){return r}}return e}(this.style_),this.changed()},e}(In),vd=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),xd="GENERATE_BUFFERS",wd=function(t){function e(e,r){var i=t.call(this,e)||this,n=r||{};return i.helper=new Eu({postProcesses:n.postProcesses,uniforms:n.uniforms}),i}return vd(e,t),e.prototype.disposeInternal=function(){this.helper.dispose(),t.prototype.disposeInternal.call(this)},e.prototype.getShaderCompileErrors=function(){return this.helper.getShaderCompileErrors()},e}(up);var bd=wd,Sd=new Blob(['var e="function"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,o=arguments.length;rthis.maxLineWidth&&(this.maxLineWidth=r.lineWidth,this.bufferedMaxExtent_=null)}else r.strokeStyle=void 0,r.lineCap=void 0,r.lineDash=null,r.lineDashOffset=void 0,r.lineJoin=void 0,r.lineWidth=void 0,r.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,r=[Md.SET_FILL_STYLE,e];return"string"!=typeof e&&r.push(!0),r},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[Md.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var r=t.fillStyle;"string"==typeof r&&t.currentFillStyle==r||(void 0!==r&&this.instructions.push(e.call(this,t)),t.currentFillStyle=r)},e.prototype.updateStrokeStyle=function(t,e){var r=t.strokeStyle,i=t.lineCap,n=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=r||t.currentLineCap!=i||n!=t.currentLineDash&&!v(t.currentLineDash,n)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=l)&&(void 0!==r&&e.call(this,t),t.currentStrokeStyle=r,t.currentLineCap=i,t.currentLineDash=n,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[Md.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=zt(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Gt(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(On),kd=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Nd=function(t){function e(e,r,i,n){var o=t.call(this,e,r,i,n)||this;return o.declutterGroups_=null,o.hitDetectionImage_=null,o.image_=null,o.imagePixelRatio_=void 0,o.anchorX_=void 0,o.anchorY_=void 0,o.height_=void 0,o.opacity_=void 0,o.originX_=void 0,o.originY_=void 0,o.rotateWithView_=void 0,o.rotation_=void 0,o.scale_=void 0,o.width_=void 0,o}return kd(e,t),e.prototype.drawCoordinates_=function(t,e,r,i){return this.appendFlatCoordinates(t,e,r,i,!1,!1)},e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var r=t.getFlatCoordinates(),i=t.getStride(),n=this.coordinates.length,o=this.drawCoordinates_(r,0,r.length,i);this.instructions.push([Md.DRAW_IMAGE,n,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,this.declutterGroups_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_)]),this.hitDetectionInstructions.push([Md.DRAW_IMAGE,n,o,this.hitDetectionImage_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,this.declutterGroups_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_)]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var r=t.getFlatCoordinates(),i=t.getStride(),n=this.coordinates.length,o=this.drawCoordinates_(r,0,r.length,i);this.instructions.push([Md.DRAW_IMAGE,n,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,this.declutterGroups_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_)]),this.hitDetectionInstructions.push([Md.DRAW_IMAGE,n,o,this.hitDetectionImage_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,this.declutterGroups_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_)]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var r=t.getAnchor(),i=t.getSize(),n=t.getHitDetectionImage(this.pixelRatio),o=t.getImage(this.pixelRatio),s=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=r[0],this.anchorY_=r[1],this.declutterGroups_=e,this.hitDetectionImage_=n,this.image_=o,this.height_=i[1],this.opacity_=t.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=i[0]},e}(Ad),jd=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Dd=function(t){function e(e,r,i,n){return t.call(this,e,r,i,n)||this}return jd(e,t),e.prototype.drawFlatCoordinates_=function(t,e,r,i){var n=this.coordinates.length,o=this.appendFlatCoordinates(t,e,r,i,!1,!1),s=[Md.MOVE_TO_LINE_TO,n,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),r},e.prototype.drawLineString=function(t,e){var r=this.state,i=r.strokeStyle,n=r.lineWidth;if(void 0!==i&&void 0!==n){this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([Md.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset],Od);var o=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(o,0,o.length,s),this.hitDetectionInstructions.push(Id),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var r=this.state,i=r.strokeStyle,n=r.lineWidth;if(void 0!==i&&void 0!==n){this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([Md.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset],Od);for(var o=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),l=0,u=0,h=o.length;ut&&(m>y&&(y=m,f=_,g=o),m=0,_=o-n)),s=a,h=p,c=d),l=v,u=x}return(m+=a)>y?[_,o]:[f,g]}var Ud=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Yd={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Wd={Circle:zd,Default:Ad,Image:Nd,LineString:Dd,Polygon:zd,Text:function(t){function e(e,r,i,n){var o=t.call(this,e,r,i,n)||this;return o.declutterGroups_,o.labels_=null,o.text_="",o.textOffsetX_=0,o.textOffsetY_=0,o.textRotateWithView_=void 0,o.textRotation_=0,o.textFillState_=null,o.fillStates={},o.textStrokeState_=null,o.strokeStates={},o.textState_={},o.textStates={},o.textKey_="",o.fillKey_="",o.strokeKey_="",o}return Ud(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var r=this.textFillState_,i=this.textStrokeState_,n=this.textState_;if(""!==this.text_&&n&&(r||i)){var o,s,a=this.coordinates.length,l=t.getType(),u=null,h=2,c=2;if(n.placement===uh){if(!ge(this.getBufferedMaxExtent(),t.getExtent()))return;var p=void 0;if(u=t.getFlatCoordinates(),c=t.getStride(),l==gt.LINE_STRING)p=[u.length];else if(l==gt.MULTI_LINE_STRING)p=t.getEnds();else if(l==gt.POLYGON)p=t.getEnds().slice(0,1);else if(l==gt.MULTI_POLYGON){var d=t.getEndss();for(p=[],o=0,s=d.length;of[f.length-i]}else p=t[e]>t[r-i];for(var g,y,m=n.length,_=t[e],v=t[e+1],x=t[e+=i],w=t[e+1],b=0,S=Math.sqrt(Math.pow(x-_,2)+Math.pow(w-v,2)),T=!1,C=0;C0?-Math.PI:Math.PI),void 0!==y){var L=O-y;if(T=T||0!==L,L+=L>Math.PI?-2*Math.PI:L<-Math.PI?2*Math.PI:0,Math.abs(L)>s)return null}y=O;var M=I/S,F=Ie(_,x,M),A=Ie(v,w,M);d[g]=[F,A,R/2,O,E],o+=R}return T?d:[[d[0][0],d[0][1],d[0][2],d[0][3],n]]}function qd(t,e,r,i){for(var n=t[e],o=t[e+1],s=0,a=e+i;an.width?n.width-h:g,w=l+c>n.height?n.height-c:l,b=y[3]+x*d[0]+y[1],S=y[0]+w*d[1]+y[2],T=r-y[3],C=i-y[0];(v||0!==p)&&(Hd[0]=T,Qd[0]=T,Hd[1]=C,Jd[1]=C,Jd[0]=T+b,$d[0]=Jd[0],$d[1]=C+S,Qd[1]=$d[1]);var E=null;if(0!==p){var R=r+o,P=i+s;E=Ct(Kd,R,P,1,1,p,-R,-P),St(Kd,Hd),St(Kd,Jd),St(Kd,$d),St(Kd,Qd),qt(Math.min(Hd[0],Jd[0],$d[0],Qd[0]),Math.min(Hd[1],Jd[1],$d[1],Qd[1]),Math.max(Hd[0],Jd[0],$d[0],Qd[0]),Math.max(Hd[1],Jd[1],$d[1],Qd[1]),Zd)}else qt(T,C,T+b,C+S,Zd);this.renderBuffer_[0]=Math.max(this.renderBuffer_[0],fe(Zd)),this.renderBuffer_[1]=Math.max(this.renderBuffer_[1],he(Zd));var I=t.canvas,O=_?_[2]*d[0]/2:0,L=this.renderBuffer_,M=Zd[0]-O<=(I.width+L[0])/e&&Zd[2]+O>=-L[0]/e&&Zd[1]-O<=(I.height+L[1])/e&&Zd[3]+O>=-L[1]/e;if(f&&(r=Math.round(r),i=Math.round(i)),a){if(!M&&1==a[0])return!1;var F=M?[t,E?E.slice(0):null,u,n,h,c,x,w,r,i,d,Zd.slice()]:null;F&&(v&&F.push(m,_,Hd.slice(0),Jd.slice(0),$d.slice(0),Qd.slice(0)),a.push(F))}else M&&(v&&this.replayTextBackground_(t,Hd,Jd,$d,Qd,m,_,!1),ho(t,E,u,n,h,c,x,w,r,i,d));return!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=St(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;t.save(),t.translate(e[0]%r,e[1]%r),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.renderDeclutter=function(t,e,r,i){for(var n=[],o=1,s=t.length;o12&&this.replayTextBackground_(c[0],c[14],c[15],c[16],c[17],c[12],c[13],!0),ho.apply(void 0,c),d!==r&&(p.globalAlpha=d)}}return t.length=1,i},t.prototype.drawLabelWithPointPlacement_=function(t,e,r,i){var n=this.textStates[e],o=this.createLabel(t,e,i,r),s=this.strokeStates[r],a=this.pixelRatio,l=Yd[n.textAlign||"center"],u=Yd[n.textBaseline||"middle"],h=s&&s.lineWidth?s.lineWidth:0;return{label:o,anchorX:l*(o.width/a-2*n.scale[0])+2*(.5-l)*h,anchorY:u*o.height/a+2*(.5-u)*h}},t.prototype.execute_=function(t,e,r,i,n,o,s){var a,l,u;this.declutterItems.length=0,this.pixelCoordinates_&&v(r,this.renderedTransform_)?a=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),a=Nr(this.coordinates,0,this.coordinates.length,2,r,this.pixelCoordinates_),l=this.renderedTransform_,u=r,l[0]=u[0],l[1]=u[1],l[2]=u[2],l[3]=u[3],l[4]=u[4],l[5]=u[5]);for(var h,c,p,d,f,g,y,m,_,x,w,b,S,T,C,E,R,P=0,I=i.length,O=0,L=0,M=0,F=null,A=null,k=this.coordinateCache_,N=this.viewRotation_,j=Math.round(1e12*Math.atan2(-r[1],r[0]))/1e12,D={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:N},G=this.instructions!=i||this.overlaps?0:200;PG&&(this.fill_(t),L=0),M>G&&(t.stroke(),M=0),L||M||(t.beginPath(),d=NaN,f=NaN),++P;break;case Md.CIRCLE:var B=a[O=z[1]],U=a[O+1],Y=a[O+2]-B,W=a[O+3]-U,V=Math.sqrt(Y*Y+W*W);t.moveTo(B+V,U),t.arc(B,U,V,0,2*Math.PI,!0),++P;break;case Md.CLOSE_PATH:t.closePath(),++P;break;case Md.CUSTOM:O=z[1],h=z[2];var X=z[3],q=z[4],Z=6==z.length?z[5]:void 0;D.geometry=X,D.feature=C,P in k||(k[P]=[]);var K=k[P];Z?Z(a,O,h,2,K):(K[0]=a[O],K[1]=a[O+1],K.length=2),q(K,D),++P;break;case Md.DRAW_IMAGE:O=z[1],h=z[2],x=z[3],c=z[4],p=z[5],_=o?null:z[6];var H=z[7],J=z[8],$=z[9],Q=z[10],tt=z[11],et=z[12],rt=z[13],it=z[14];if(!x&&z.length>=19){w=z[18],b=z[19],S=z[20],T=z[21];var nt=this.drawLabelWithPointPlacement_(w,b,S,T);x=nt.label,z[3]=x;var ot=z[22];c=(nt.anchorX-ot)*this.pixelRatio,z[4]=c;var st=z[23];p=(nt.anchorY-st)*this.pixelRatio,z[5]=p,H=x.height,z[7]=H,it=x.width,z[14]=it}var at=void 0;z.length>24&&(at=z[24]);var lt=void 0,ut=void 0,ht=void 0;z.length>16?(lt=z[15],ut=z[16],ht=z[17]):(lt=Hn,ut=!1,ht=!1),tt&&j?et+=N:tt||j||(et-=N);for(var ct=0,pt=0;O=o;)of(r,t+n,t+o),of(r,t+o,t+n),of(r,t-o,t+n),of(r,t-n,t+o),of(r,t-n,t-o),of(r,t-o,t-n),of(r,t+o,t-n),of(r,t+n,t-o),o++,2*((s+=1+2*o)-n)+1>0&&(s+=1-2*(n-=1));return nf[t]=r,r}(i);function p(t){for(var e=u.getImageData(0,0,s,s).data,r=0;r0){var a=void 0;return(!o||h!=_o&&h!=wo||-1!==o.indexOf(t))&&(a=n(t)),a||void u.clearRect(0,0,s,s)}}var f,g,y,m,_,v=Object.keys(this.executorsByZIndex_).map(Number);for(v.sort(d),f=v.length-1;f>=0;--f){var x=v[f].toString();for(y=this.executorsByZIndex_[x],g=ef.length-1;g>=0;--g)if(void 0!==(m=y[h=ef[g]])&&(_=m.executeHitDetection(u,a,r,p,l)))return _}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var r=e[0],i=e[1],n=e[2],o=e[3],s=[r,i,r,o,n,o,n,i];return Nr(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return R(this.executorsByZIndex_)},t.prototype.execute=function(t,e,r,i,n,o,s){var a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(d),this.maxExtent_&&(t.save(),this.clip(t,r));var l,u,h,c,p,f,g=o||ef;for(l=0,u=a.length;l=n)for(i=n;i0&&(h=f,o.push({items:f.declutterItems,opacity:i}))}}var af=rf;function lf(t,e,r,i,n,o,s){var a=zn(t[0]/2,t[1]/2);a.imageSmoothingEnabled=!1;for(var l=a.canvas,u=new go(a,.5,n,null,s),h=r.length,c=Math.floor(16777215/h),p={},f=1;f<=h;++f){var g=r[f-1],y=g.getStyleFunction()||i;if(i){var m=y(g,o);if(m){Array.isArray(m)||(m=[m]);for(var _="#"+("000000"+(f*c).toString(16)).slice(-6),v=0,x=m.length;v0&&(s.width=0),this.container;var l=Math.round(t.size[0]*r),u=Math.round(t.size[1]*r);s.width!=l||s.height!=u?(s.width=l,s.height=u,s.style.transform!==n&&(s.style.transform=n)):this.containerReused||o.clearRect(0,0,l,u),this.preRender(o,t);var h=t.extent,c=t.viewState,p=c.center,d=c.resolution,f=c.projection,g=c.rotation,y=f.getExtent(),m=this.getLayer().getSource(),_=!1;if(i.extent){var v=Ar(i.extent,f);(_=!Yt(v,t.extent)&&ge(v,t.extent))&&this.clipUnrotated(o,t,v)}var x=t.viewHints,w=!(x[ys]||x[ms]),b=this.getRenderTransform(p,d,g,r,l,u,0),S=this.getLayer().getDeclutter()?{}:null;if(a.execute(o,1,b,g,w,void 0,S),m.getWrapX()&&f.canWrapX()&&!Yt(y,h)){for(var T=h[0],C=fe(y),E=0,R=void 0;Ty[2];){R=C*++E;var I=this.getRenderTransform(p,d,g,r,l,u,R);a.execute(o,1,I,g,w,void 0,S),T-=C}}if(S){var O=t.viewHints;sf(S,o,g,1,!(O[ys]||O[ms]),t.declutterItems)}_&&o.restore(),this.postRender(o,t);var L=i.opacity,M=this.container;return L!==parseFloat(M.style.opacity)&&(M.style.opacity=1===L?"":String(L)),this.renderedRotation_!==c.rotation&&(this.renderedRotation_=c.rotation,this.hitDetectionImageData_=null),this.container},e.prototype.getFeatures=function(t){return new Promise(function(e,r){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var i=[this.context.canvas.width,this.context.canvas.height];St(this.pixelTransform,i);var n=this.renderedCenter_,o=this.renderedResolution_,s=this.renderedRotation_,a=this.renderedProjection_,l=this.renderedExtent_,u=this.getLayer(),h=[],c=i[0]/2,p=i[1]/2;h.push(this.getRenderTransform(n,o,s,.5,c,p,0).slice());var d=u.getSource(),f=a.getExtent();if(d.getWrapX()&&a.canWrapX()&&!Yt(f,l)){for(var g=l[0],y=fe(f),m=0,_=void 0;gf[2];)_=y*++m,h.push(this.getRenderTransform(n,o,s,.5,c,p,_).slice()),g-=y}this.hitDetectionImageData_=lf(i,h,this.renderedFeatures_,u.getStyleFunction(),l,o,s)}e(uf(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,i,n){if(this.replayGroup_){var s=e.viewState.resolution,a=e.viewState.rotation,l=this.getLayer(),u={};return this.replayGroup_.forEachFeatureAtCoordinate(t,s,a,r,(function(t){var e=o(t);if(!(e in u))return u[e]=!0,i(t,l)}),l.getDeclutter()?n:null)}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var e=this.getLayer(),r=e.getSource();if(!r)return!1;var i=t.viewHints[ys],n=t.viewHints[ms],o=e.getUpdateWhileAnimating(),s=e.getUpdateWhileInteracting();if(!this.dirty_&&!o&&i||!s&&n)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var a=t.extent,l=t.viewState,u=l.projection,h=l.resolution,c=t.pixelRatio,p=e.getRevision(),d=e.getRenderBuffer(),f=e.getRenderOrder();void 0===f&&(f=Po);var g=l.center.slice(),y=Gt(a,d*h),m=[y.slice()],_=u.getExtent();if(r.getWrapX()&&u.canWrapX()&&!Yt(_,t.extent)){var v=fe(_),x=Math.max(fe(y)/2,v);y[0]=_[0]-x,y[2]=_[2]+x,hr(g,u);var w=ve(m[0],u);w[0]<_[0]&&w[2]<_[2]?m.push([w[0]+v,w[1],w[2]+v,w[3]]):w[0]>_[0]&&w[2]>_[2]&&m.push([w[0]-v,w[1],w[2]-v,w[3]])}if(!this.dirty_&&this.renderedResolution_==h&&this.renderedRevision_==p&&this.renderedRenderOrder_==f&&Yt(this.renderedExtent_,y))return this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var b,S=new Vd(Oo(h,c),y,h,c,e.getDeclutter()),T=Or();if(T){for(var C=0,E=m.length;C0)e([]);else{var m=pe(c.getTileCoordExtent(i.wrappedTileCoord)),_=[(p[0]-m[0])/h,(m[1]-p[1])/h],v=i.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]),x=i.hitDetectionImageData[s];if(!x&&!this.animatingOrInteracting_){var w=Ds(c.getTileSize(c.getZForResolution(h))),b=[w[0]/2,w[1]/2],S=this.renderedRotation_;x=lf(w,[this.getRenderTransform(c.getTileCoordCenter(i.wrappedTileCoord),h,0,.5,b[0],b[1],0)],v,n.getStyleFunction(),c.getTileCoordExtent(i.wrappedTileCoord),i.getReplayState(n).renderedResolution,S),i.hitDetectionImageData[s]=x}e(uf(_,v,x))}}.bind(this))},e.prototype.handleFontsChanged=function(){C(this.renderTileImageQueue_);var t=this.getLayer();t.getVisible()&&void 0!==this.renderedLayerRevision_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.renderFrame=function(e,r){var i=e.viewHints,n=!(i[ys]||i[ms]);this.renderQueuedTileImages_(n,e),t.prototype.renderFrame.call(this,e,r),this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;var s=this.getLayer(),a=s.getRenderMode();if(a===ff)return this.container;var l=s.getSource(),u=e.usedTiles[o(l)];for(var h in this.renderTileImageQueue_)u&&h in u||delete this.renderTileImageQueue_[h];for(var c=this.context,p=s.getDeclutter()?{}:null,d=vf[a],f=e.pixelRatio,g=e.viewState,y=g.center,m=g.resolution,_=g.rotation,v=e.size,x=Math.round(v[0]*f),w=Math.round(v[1]*f),b=this.renderedTiles,S=l.getTileGridForProjection(e.viewState.projection),T=[],C=[],E=b.length-1;E>=0;--E)for(var R=b[E],P=R.tileCoord,I=S.getTileCoordExtent(R.wrappedTileCoord),O=S.getTileCoordExtent(P,this.tmpExtent)[0]-I[0],L=wt(Tt(this.inversePixelTransform.slice(),1/f,1/f),this.getRenderTransform(y,m,_,f,x,w,O)),M=R.executorGroups[o(s)],F=!1,A=0,k=M.length;A8){e.animate=!0;break}var i=this.renderTileImageQueue_[r];delete this.renderTileImageQueue_[r],this.renderTileImage_(i,e)}},e.prototype.renderFeature=function(t,e,r,i){if(!r)return!1;var n=!1;if(Array.isArray(r))for(var o=0,s=r.length;o>1)],e))<0?s=i+1:(a=i,l=!n);return l?s:~s}(f,_);v<0?(l=(_-f[-v-2])/(f[-v-1]-f[-v-2]),a=e+(-v-2)*i):a=e+v*i}var x=s>1?s:2,w=o||new Array(x);for(g=0;g>1;n0&&y.length>0;)o=y.pop(),h=f.pop(),p=g.pop(),(l=o.toString())in m||(u.push(p[0],p[1]),m[l]=!0),s=y.pop(),c=f.pop(),d=g.pop(),Te((n=e(i=t(a=(o+s)/2)))[0],n[1],p[0],p[1],d[0],d[1])this.featurePool_.length;)a=new ht,this.featurePool_.push(a);var u=i.getFeaturesCollection();u.clear();var h,c,p=0;for(h=0,c=this.meridians_.length;hMath.PI/2);for(var y=Mo(t),m=c;m<=p;++m){var _=this.meridians_.length+this.parallels_.length,v=void 0,x=void 0,w=void 0,b=void 0;if(this.meridiansLabels_)for(x=0,w=this.meridiansLabels_.length;x=a?(t[0]=s[0],t[2]=s[2]):o=!0);var l=[we(e[0],this.minX_,this.maxX_),we(e[1],this.minY_,this.maxY_)],u=this.toLonLatTransform_(l);isNaN(u[1])&&(u[1]=Math.abs(this.maxLat_)>=Math.abs(this.minLat_)?this.maxLat_:this.minLat_);var h,c,p,d,f=we(u[0],this.minLon_,this.maxLon_),g=we(u[1],this.minLat_,this.maxLat_),y=this.maxLines_,m=t;o||(m=[we(t[0],this.minX_,this.maxX_),we(t[1],this.minY_,this.maxY_),we(t[2],this.minX_,this.maxX_),we(t[3],this.minY_,this.maxY_)]);var _=_e(m,this.toLonLatTransform_,void 0,8),v=_[3],x=_[2],w=_[1],b=_[0];if(o||(Ut(m,this.bottomLeft_)&&(b=this.minLon_,w=this.minLat_),Ut(m,this.bottomRight_)&&(x=this.maxLon_,w=this.minLat_),Ut(m,this.topLeft_)&&(b=this.minLon_,v=this.maxLat_),Ut(m,this.topRight_)&&(x=this.maxLon_,v=this.maxLat_),v=we(v,g,this.maxLat_),x=we(x,f,this.maxLon_),w=we(w,this.minLat_,g),b=we(b,this.minLon_,f)),d=we(f=Math.floor(f/n)*n,this.minLon_,this.maxLon_),c=this.addMeridian_(d,w,v,i,t,0),h=0,o)for(;(d-=n)>=b&&h++i[o]&&(n=o,o=1);var s=Math.max(e[1],i[n]),a=Math.min(e[3],i[o]),l=we(e[1]+Math.abs(e[1]-e[3])*this.lonLabelPosition_,s,a),u=[i[n-1]+(i[o-1]-i[n-1])*(l-i[n])/(i[o]-i[n]),l],h=this.meridiansLabels_[r].geom;return h.setCoordinates(u),h},e.prototype.getMeridians=function(){return this.meridians_},e.prototype.getParallel_=function(t,e,r,i,n){var o=function(t,e,r,i,n){return Rf((function(i){return[e+(r-e)*i,t]}),Sr(gr("EPSG:4326"),i),n)}(t,e,r,this.projection_,i),s=this.parallels_[n];return s?(s.setFlatCoordinates(ct,o),s.changed()):s=new Tf(o,ct),s},e.prototype.getParallelPoint_=function(t,e,r){var i=t.getFlatCoordinates(),n=0,o=i.length-2;i[n]>i[o]&&(n=o,o=0);var s=Math.max(e[0],i[n]),a=Math.min(e[2],i[o]),l=we(e[0]+Math.abs(e[0]-e[2])*this.latLabelPosition_,s,a),u=[l,i[n+1]+(i[o+1]-i[n+1])*(l-i[n])/(i[o]-i[n])],h=this.parallelsLabels_[r].geom;return h.setCoordinates(u),h},e.prototype.getParallels=function(){return this.parallels_},e.prototype.updateProjectionInfo_=function(t){var e=gr("EPSG:4326"),r=t.getWorldExtent();this.maxLat_=r[3],this.maxLon_=r[2],this.minLat_=r[1],this.minLon_=r[0];var i=Sr(t,e);if(this.minLon_=Math.abs(this.minLat_)?this.maxLat_:this.minLat_),this.projection_=t},e}(Ef),Mf=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ff="blur",Af="gradient",kf="radius",Nf=["#00f","#0ff","#0f0","#ff0","#f00"];var jf=function(t){function e(e){var r=this,i=e||{},n=T({},i);delete n.gradient,delete n.radius,delete n.blur,delete n.weight,(r=t.call(this,n)||this).gradient_=null,r.addEventListener(tt(Af),r.handleGradientChanged_),r.setGradient(i.gradient?i.gradient:Nf),r.setBlur(void 0!==i.blur?i.blur:15),r.setRadius(void 0!==i.radius?i.radius:8);var o=i.weight?i.weight:"weight";return r.weightFunction_="string"==typeof o?function(t){return t.get(o)}:o,r.setRenderOrder(null),r}return Mf(e,t),e.prototype.getBlur=function(){return this.get(Ff)},e.prototype.getGradient=function(){return this.get(Af)},e.prototype.getRadius=function(){return this.get(kf)},e.prototype.handleGradientChanged_=function(){this.gradient_=function(t){for(var e=zn(1,256),r=e.createLinearGradient(0,0,1,256),i=1/(t.length-1),n=0,o=t.length;n>3)?r.readString():2===t?r.readFloat():3===t?r.readDouble():4===t?r.readVarint64():5===t?r.readVarint():6===t?r.readSVarint():7===t?r.readBoolean():null;e.values.push(i)}}function rg(t,e,r){if(1==t)e.id=r.readVarint();else if(2==t)for(var i=r.readVarint()+r.pos;r.pos>3}s--,1===o||2===o?(a+=t.readSVarint(),l+=t.readSVarint(),1===o&&u>h&&(i.push(u),h=u),r.push(a,l),u+=2):7===o?u>h&&(r.push(r[h],r[h+1]),u+=2):lt(!1,59)}u>h&&(i.push(u),h=u)},e.prototype.createFeature_=function(t,e,r){var i,n=e.type;if(0===n)return null;var o,s=e.properties;this.idProperty_?(o=s[this.idProperty_],delete s[this.idProperty_]):o=e.id,s[this.layerName_]=e.layer.name;var a=[],l=[];this.readRawGeometry_(t,e,a,l);var u=function(t,e){var r;1===t?r=1===e?gt.POINT:gt.MULTI_POINT:2===t?r=1===e?gt.LINE_STRING:gt.MULTI_LINE_STRING:3===t&&(r=gt.POLYGON);return r}(n,l.length);if(this.featureClass_===$f)(i=new this.featureClass_(u,a,l,s,o)).transform(r.dataProjection,r.featureProjection);else{var h=void 0;if(u==gt.POLYGON){for(var c=[],p=0,d=0,f=0,g=l.length;f1?new qf(a,ct,c):new Pi(a,ct,l)}else h=u===gt.POINT?new pi(a,ct):u===gt.LINE_STRING?new Tf(a,ct):u===gt.POLYGON?new Pi(a,ct,l):u===gt.MULTI_POINT?new Wf(a,ct):u===gt.MULTI_LINE_STRING?new Uf(a,ct,l):null;i=new(0,this.featureClass_),this.geometryName_&&i.setGeometryName(this.geometryName_);var m=Gf(h,!1,r);i.setGeometry(m),i.setId(o),i.setProperties(s,!0)}return i},e.prototype.getType=function(){return fl},e.prototype.readFeatures=function(t,e){var r=this.layers_,i=this.adaptOptions(e),n=gr(i.dataProjection);n.setWorldExtent(i.extent),i.dataProjection=n;var o=new Kf.a(t),s=o.readFields(tg,{}),a=[];for(var l in s)if(!r||-1!=r.indexOf(l)){var u=s[l],h=u?[0,0,u.extent,u.extent]:null;n.setExtent(h);for(var c=0,p=u.length;c1?(r=n,i=o):l>0&&(r+=s*l,i+=a*l)}return Cg(t,e,r,i)}function Cg(t,e,r,i){const n=r-t,o=i-e;return n*n+o*o}function Eg(t,e,r){return t+r*(e-t)}const Rg=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Pg=/^([a-z]*)$|^hsla?\(.*\)$/i;function Ig(t){const e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);const t=getComputedStyle(e).color;return document.body.removeChild(e),t}return""}const Og=function(){const t={};let e=0;return(function(r){let i;if(t.hasOwnProperty(r))i=t[r];else{if(e>=1024){let r=0;for(const i in t)0==(3&r++)&&(delete t[i],--e)}i=function(t){let e,r,i,n,o;Pg.exec(t)&&(t=Ig(t));if(Rg.exec(t)){const s=t.length-1;let a;a=s<=4?1:2;const l=4===s||8===s;e=parseInt(t.substr(1+0*a,a),16),r=parseInt(t.substr(1+1*a,a),16),i=parseInt(t.substr(1+2*a,a),16),n=l?parseInt(t.substr(1+3*a,a),16):255,1==a&&(e=(e<<4)+e,r=(r<<4)+r,i=(i<<4)+i,l&&(n=(n<<4)+n)),o=[e,r,i,n/255]}else 0==t.indexOf("rgba(")?(o=t.slice(5,-1).split(",").map(Number),Mg(o)):0==t.indexOf("rgb(")?(o=t.slice(4,-1).split(",").map(Number),o.push(1),Mg(o)):wg(!1,14);return o}(r),t[r]=i,++e}return i})}();function Lg(t){return Array.isArray(t)?t:Og(t)}function Mg(t){return t[0]=bg(t[0]+.5|0,0,255),t[1]=bg(t[1]+.5|0,0,255),t[2]=bg(t[2]+.5|0,0,255),t[3]=bg(t[3],0,1),t}function Fg(t){let e=t[0];e!=(0|e)&&(e=e+.5|0);let r=t[1];r!=(0|r)&&(r=r+.5|0);let i=t[2];return i!=(0|i)&&(i=i+.5|0),"rgba("+e+","+r+","+i+","+(void 0===t[3]?1:t[3])+")"}function Ag(t){return Array.isArray(t)?Fg(t):t}const kg="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",Ng=(kg.indexOf("firefox"),-1!==kg.indexOf("safari")&&kg.indexOf("chrom"),-1!==kg.indexOf("webkit")&&kg.indexOf("edge"),kg.indexOf("macintosh"),"undefined"!=typeof devicePixelRatio&&devicePixelRatio,"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope),jg="undefined"!=typeof Image&&Image.prototype.decode;!function(){let t=!1;try{const e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch(t){}}();function Dg(t,e,r){const i=r&&r.length?r.shift():Ng?new OffscreenCanvas(t||300,e||300):document.createElement("canvas");return t&&(i.width=t),e&&(i.height=e),i.getContext("2d")}var Gg=class{constructor(t){this.propagationStopped,this.type=t,this.target=null}preventDefault(){this.propagationStopped=!0}stopPropagation(){this.propagationStopped=!0}},zg="propertychange";var Bg=class{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}};function Ug(t,e){return t>e?1:t0)}removeEventListener(t,e){const r=this.listeners_&&this.listeners_[t];if(r){const i=r.indexOf(e);-1!==i&&(this.pendingRemovals_&&t in this.pendingRemovals_?(r[i]=Xg,++this.pendingRemovals_[t]):(r.splice(i,1),0===r.length&&delete this.listeners_[t]))}}},Jg="change",$g="error",Qg="clear",ty="load";function ey(t,e,r,i,n){if(i&&i!==t&&(r=r.bind(i)),n){const i=r;r=function(){t.removeEventListener(e,r),i.apply(this,arguments)}}const o={target:t,type:e,listener:r};return t.addEventListener(e,r),o}function ry(t,e,r,i){return ey(t,e,r,i,!0)}function iy(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),Zg(t))}function ny(t){if(Array.isArray(t))for(let e=0,r=t.length;ethis.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(const e in this.cache_){const r=this.cache_[e];0!=(3&t++)||r.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}}get(t,e,r){const i=pm(t,e,r);return i in this.cache_?this.cache_[i]:null}set(t,e,r,i){const n=pm(t,e,r);this.cache_[n]=i,++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}}function pm(t,e,r){return e+":"+t+":"+(r?function(t){return"string"==typeof t?t:Fg(t)}(r):"null")}const dm=new cm;var fm=0,gm=1,ym=2,mm=4,_m=8,vm=16;function xm(t,e,r){return r?(r[0]=t[0]-e,r[1]=t[1]-e,r[2]=t[2]+e,r[3]=t[3]+e,r):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function wm(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function bm(t,e,r){let i,n;return i=en&&(l|=mm),ao&&(l|=ym),l===fm&&(l=gm),l}function Rm(t,e,r,i,n){return n?(n[0]=t,n[1]=e,n[2]=r,n[3]=i,n):[t,e,r,i]}function Pm(t){return Rm(1/0,1/0,-1/0,-1/0,t)}function Im(t,e){const r=t[0],i=t[1];return Rm(r,i,r,i,e)}function Om(t,e,r,i,n){return Am(Pm(n),t,e,r,i)}function Lm(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function Mm(t,e){return e[0]t[2]&&(t[2]=e[2]),e[1]t[3]&&(t[3]=e[3]),t}function Fm(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function Am(t,e,r,i,n){for(;re[0]?i[0]=t[0]:i[0]=e[0],t[1]>e[1]?i[1]=t[1]:i[1]=e[1],t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function Xm(t,e,r,i){let n=[];if(i>1){const e=t[2]-t[0],r=t[3]-t[1];for(let o=0;o0,6);const u=void 0!==e.src?ug:cg;this.color_=void 0!==e.color?Lg(e.color):null,this.iconImage_=function(t,e,r,i,n,o){let s=dm.get(e,i,o);return s||(s=new Km(t,e,r,i,n,o),dm.set(e,i,o,s)),s}(s,l,a,this.crossOrigin_,u,this.color_),this.offset_=void 0!==e.offset?e.offset:[0,0],this.offsetOrigin_=void 0!==e.offsetOrigin?e.offsetOrigin:um,this.origin_=null,this.size_=void 0!==e.size?e.size:null}clone(){const t=this.getScale();return new Hm({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})}getAnchor(){if(this.normalizedAnchor_)return this.normalizedAnchor_;let t=this.anchor_;const e=this.getSize();if(this.anchorXUnits_==om||this.anchorYUnits_==om){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==om&&(t[0]*=e[0]),this.anchorYUnits_==om&&(t[1]*=e[1])}if(this.anchorOrigin_!=um){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=hm&&this.anchorOrigin_!=lm||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=am&&this.anchorOrigin_!=lm||(t[1]=-t[1]+e[1])}return this.normalizedAnchor_=t,this.normalizedAnchor_}setAnchor(t){this.anchor_=t,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(t){return this.iconImage_.getImage(t)}getPixelRatio(t){return this.iconImage_.getPixelRatio(t)}getImageSize(){return this.iconImage_.getSize()}getHitDetectionImageSize(){return this.getImageSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(t){return this.iconImage_.getHitDetectionImage(t)}getOrigin(){if(this.origin_)return this.origin_;let t=this.offset_;const e=this.getDisplacement();if(this.offsetOrigin_!=um){const e=this.getSize(),r=this.iconImage_.getSize();if(!e||!r)return null;t=t.slice(),this.offsetOrigin_!=hm&&this.offsetOrigin_!=lm||(t[0]=r[0]-e[0]-t[0]),this.offsetOrigin_!=am&&this.offsetOrigin_!=lm||(t[1]=r[1]-e[1]-t[1])}return t[0]+=e[0],t[1]+=e[1],this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}listenImageChange(t){this.iconImage_.addEventListener(Jg,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(Jg,t)}}var Jm=Hm,$m="point",Qm="line";class t_{constructor(t){const e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=yg(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new Uy({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:$m,this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding}clone(){const t=this.getScale();return new t_({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}setOverflow(t){this.overflow_=t}setFont(t){this.font_=t}setMaxAngle(t){this.maxAngle_=t}setOffsetX(t){this.offsetX_=t}setOffsetY(t){this.offsetY_=t}setPlacement(t){this.placement_=t}setRotateWithView(t){this.rotateWithView_=t}setFill(t){this.fill_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=yg(void 0!==t?t:1)}setStroke(t){this.stroke_=t}setText(t){this.text_=t}setTextAlign(t){this.textAlign_=t}setTextBaseline(t){this.textBaseline_=t}setBackgroundFill(t){this.backgroundFill_=t}setBackgroundStroke(t){this.backgroundStroke_=t}setPadding(t){this.padding_=t}}var e_=t_;function r_(t,e,r,i,n){return!Nm(n,(function(n){return!i_(t,e,r,i,n[0],n[1])}))}function i_(t,e,r,i,n,o){let s=0,a=t[r-i],l=t[r-i+1];for(;eo&&(r-a)*(o-l)-(n-a)*(i-l)>0&&s++:i<=o&&(r-a)*(o-l)-(n-a)*(i-l)<0&&s--,a=r,l=i}return 0!==s}function n_(t,e,r,i,n,o){if(0===r.length)return!1;if(!i_(t,e,r[0],i,n,o))return!1;for(let e=1,s=r.length;em&&(u=(h+c)/2,n_(t,e,r,i,u,f)&&(y=u,m=n)),h=c}return isNaN(y)&&(y=n[o]),s?(s.push(y,f,m),s):[y,f,m]}function s_(t,e,r,i,n){let o=[];for(let s=0,a=r.length;s1?r:2;let o=e;void 0===o&&(o=n>2?t.slice():new Array(i));const s=c_;for(let e=0;es?r=s:r<-s&&(r=-s),o[e+1]=r}return o}function m_(t,e,r){const i=t.length,n=r>1?r:2;let o=e;void 0===o&&(o=n>2?t.slice():new Array(i));for(let e=0;ei[2])){const e=r||Wm(i);n=Math.floor((t[0]-i[0])/e)}return n}function R_(t,e,r){let i;if(void 0!==e){for(let r=0,i=t.length;r>1),n=+o(t[i],e),n<0?s=i+1:(a=i,l=!n);return l?s:~s}(h,c);p<0?(l=(c-h[-p-2])/(h[-p-1]-h[-p-2]),a=e+(-p-2)*i):a=e+p*i}const h=s>1?s:2,c=o||new Array(h);for(let e=0;e>1;n=.05){for(var r="",i=t.split("\n"),n=Q_.slice(0,Math.round(e/.1)),o=0,s=i.length;o0&&(r+="\n"),r+=i[o].split("").join(n);return r}return t}function ev(){return $_||($_=J_(1,1).getContext("2d")),$_}function rv(t,e){return ev().measureText(t).width+(t.length-1)*e}var iv={};Cy&&ey(Cy,Qg,(function(){iv={}}));var nv,ov,sv=Z_.e.isFunction,av=Z_.e.convertFunction,lv=Z_.c.isExpression,uv=Z_.c.createPropertyExpression,hv={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},cv={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},pv={},dv={zoom:0},fv={};function gv(t,e,r,i,n){var o=t.id;fv[o]||(fv[o]={});var s=fv[o];if(!s[r]){var a=(t[e]||pv)[r],l=Z_.f[e+"_"+t.type][r];void 0===a&&(a=l.default);var u=lv(a);if(!u&&sv(a)&&(a=av(a,l),u=!0),u){var h=function(t,e){var r=uv(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}(a,l);s[r]=h.evaluate.bind(h)}else"color"==l.type&&(a=Z_.a.parse(a)),s[r]=function(){return a}}return dv.zoom=i,s[r](dv,n)}var yv={};function mv(t,e){if(t){if(0===t.a||0===e)return;var r=t.a;return e=void 0===e?1:e,"rgba("+Math.round(255*t.r/r)+","+Math.round(255*t.g/r)+","+Math.round(255*t.b/r)+","+r*e+")"}return t}var _v=/^([^]*)\{(.*)\}([^]*)$/;function vv(t,e){var r;do{if(r=t.match(_v)){var i=e[r[2]]||"";t=r[1]+i+r[3]}}while(r);return t}var xv=function(t,e,r,i,n,o,s){if(void 0===i&&(i=H_),"string"==typeof e&&(e=JSON.parse(e)),8!=e.version)throw new Error("glStyle version 8 required.");var a,l;if(o)if("undefined"!=typeof Image){var u=new Image;u.crossOrigin="anonymous",u.onload=function(){a=u,l=[u.width,u.height],t.changed(),u.onload=null},u.src=o}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){var h=self;h.postMessage({action:"loadImage",src:o}),h.addEventListener("message",(function(t){"imageLoaded"===t.data.action&&t.data.src===o&&(a=t.data.image,l=[a.width,a.height])}))}for(var c,p=Object(Z_.b)(e.layers),d={},f=[],g=0,y=p.length;g=g.maxzoom)return"continue";var v=g.filter;if(!v||function(t,e,r,i){return t in yv||(yv[t]=Object(Z_.d)(e).filter),dv.zoom=i,yv[t](dv,r)}(y,v,c,u)){var x=void 0,w=void 0,b=void 0,P=void 0,I=void 0,O=void 0,L=f.index;if(3==h&&"fill"==g.type)if(w=gv(g,"paint","fill-opacity",u,c),"fill-pattern"in _){var M=gv(g,"paint","fill-pattern",u,c);if(M){var F="string"==typeof M?vv(M,r):M.toString();if(a&&n&&n[F]){++p,(O=R[p])&&O.getFill()&&!O.getStroke()&&!O.getText()||(O=R[p]=new nm({fill:new Uy})),b=O.getFill(),O.setZIndex(L);var A=E[lt=F+"."+w];if(!A)(ct=(ht=J_((ut=n[F]).width,ut.height)).getContext("2d")).globalAlpha=w,ct.drawImage(a,ut.x,ut.y,ut.width,ut.height,0,0,ut.width,ut.height),A=ct.createPattern(ht,"repeat"),E[lt]=A;b.setColor(A)}}}else(x=mv(gv(g,"paint","fill-color",u,c),w))&&("fill-outline-color"in _&&(I=mv(gv(g,"paint","fill-outline-color",u,c),w)),I||(I=x),++p,(O=R[p])&&O.getFill()&&O.getStroke()&&!O.getText()||(O=R[p]=new nm({fill:new Uy,stroke:new Qy})),(b=O.getFill()).setColor(x),(P=O.getStroke()).setColor(I),P.setWidth(1),O.setZIndex(L));if(1!=h&&"line"==g.type){x=!("line-pattern"in _)&&"line-color"in _?mv(gv(g,"paint","line-color",u,c),gv(g,"paint","line-opacity",u,c)):void 0;var k=gv(g,"paint","line-width",u,c);x&&k>0&&(++p,(O=R[p])&&O.getStroke()&&!O.getFill()&&!O.getText()||(O=R[p]=new nm({stroke:new Qy})),(P=O.getStroke()).setLineCap(gv(g,"layout","line-cap",u,c)),P.setLineJoin(gv(g,"layout","line-join",u,c)),P.setMiterLimit(gv(g,"layout","line-miter-limit",u,c)),P.setColor(x),P.setWidth(k),P.setLineDash(_["line-dasharray"]?gv(g,"paint","line-dasharray",u,c).map((function(t){return t*k})):null),O.setZIndex(L))}var N=!1,j=null,D=0,G=void 0,z=void 0,B=void 0;if((1==h||2==h)&&"icon-image"in m){var U=gv(g,"layout","icon-image",u,c);if(U){G="string"==typeof U?vv(U,r):U.toString();var Y=void 0;if(a&&n&&n[G]){var W=gv(g,"layout","icon-rotation-alignment",u,c);if(2==h){var V=t.getGeometry();if(V.getFlatMidpoint||V.getFlatMidpoints){var X=V.getExtent();if(Math.sqrt(Math.max(Math.pow((X[2]-X[0])/e,2),Math.pow((X[3]-X[1])/e,2)))>150){var q="MultiLineString"===V.getType()?V.getFlatMidpoints():V.getFlatMidpoint();if(ov||(ov=new q_("Point",nv=[NaN,NaN],[],{},null)),Y=ov,nv[0]=q[0],nv[1]=q[1],"line"===(Lt=gv(g,"layout","symbol-placement",u,c))&&"map"===W)for(var Z=V.getStride(),K=V.getFlatCoordinates(),H=0,J=K.length-Z;H=rt&&q[0]<=nt&&q[1]>=it&&q[1]<=ot){D=Math.atan2(Q-et,tt-$);break}}}}}if(2!==h||Y){++p,(O=R[p])&&O.getImage()&&!O.getFill()&&!O.getStroke()||(O=R[p]=new nm),O.setGeometry(Y);var st=gv(g,"layout","icon-size",u,c),at=void 0!==_["icon-color"]?gv(g,"paint","icon-color",u,c):null,lt=G+"."+st;if(null!==at&&(lt+="."+at),!(z=C[lt])){var ut=n[G];if(null!==at){var ht,ct;(ct=(ht=J_(ut.width,ut.height)).getContext("2d")).drawImage(a,ut.x,ut.y,ut.width,ut.height,0,0,ut.width,ut.height);for(var pt=ct.getImageData(0,0,ht.width,ht.height),dt=0,ft=pt.data.length;dt0?new Qy({width:vt,color:mt}):void 0,fill:_t?new Uy({color:_t}):void 0})),O.setImage(z),j=O.getText(),O.setText(void 0),O.setGeometry(void 0),O.setZIndex(L),N=!0}var wt=void 0;if("text-field"in m)wt=vv(gv(g,"layout","text-field",u,c).toString(),r).trim(),w=gv(g,"paint","text-opacity",u,c);if(wt&&w&&!B){N||(++p,(O=R[p])&&O.getText()&&!O.getFill()&&!O.getStroke()||(O=R[p]=new nm),O.setImage(void 0),O.setGeometry(void 0)),O.getText()||O.setText(j||new e_({padding:[2,2,2,2]})),j=O.getText();var bt=Math.round(gv(g,"layout","text-size",u,c)),St=gv(g,"layout","text-font",u,c),Tt=gv(g,"layout","text-line-height",u,c),Ct=lg()(s?s(St):St,bt,Tt),Et=m["text-transform"];"uppercase"==Et?wt=wt.toUpperCase():"lowercase"==Et&&(wt=wt.toLowerCase());var Rt=gv(g,"layout","text-max-width",u,c),Pt=gv(g,"layout","text-letter-spacing",u,c),It=2==h?tv(wt,Pt):function t(e,r,i,n){if(-1!==e.indexOf("\n")){for(var o=e.split("\n"),s=[],a=0,l=o.length;a1){var p=ev();p.font=r;var d=p.measureText("M").width*i,f="";for(s=[],a=0,l=c.length;a0?rv(s[a-1],n):1/0,v=a.7*d&&rv(w,n)<.6*d){var b=x.split(" "),S=b.pop();rv(S,n)<.2*d&&(s[a]=b.join(" "),s[a+1]=S+" "+w),l-=1}}h=s.join("\n")}else h=e;h=tv(h,n),iv[u]=h}return h}(wt,Ct,Rt,Pt);j.setText(It),j.setFont(Ct),j.setRotation(K_(gv(g,"layout","text-rotate",u,c)));var Ot=gv(g,"layout","text-anchor",u,c),Lt=N||1==h?"point":gv(g,"layout","symbol-placement",u,c);j.setPlacement(Lt);var Mt=gv(g,"paint","text-halo-width",u,c),Ft=gv(g,"layout","text-offset",u,c),At=gv(g,"paint","text-translate",u,c),kt=0,Nt=0;if("point"==Lt){var jt="center";-1!==Ot.indexOf("left")?(jt="left",Nt=Mt):-1!==Ot.indexOf("right")&&(jt="right",Nt=-Mt),j.setTextAlign(jt);var Dt=gv(g,"layout","text-rotation-alignment",u,c);j.setRotateWithView("map"==Dt)}else j.setMaxAngle(K_(gv(g,"layout","text-max-angle",u,c))*wt.length/It.length),j.setTextAlign(),j.setRotateWithView(!1);var Gt="middle";0==Ot.indexOf("bottom")?(Gt="bottom",kt=-Mt-.5*(Tt-1)*bt):0==Ot.indexOf("top")&&(Gt="top",kt=Mt+.5*(Tt-1)*bt),j.setTextBaseline(Gt),j.setOffsetX(Ft[0]*bt+Nt+At[0]),j.setOffsetY(Ft[1]*bt+kt+At[1]),T.setColor(mv(gv(g,"paint","text-color",u,c),w)),j.setFill(T);var zt=mv(gv(g,"paint","text-halo-color",u,c),w);if(zt){S.setColor(zt),Mt*=2;var Bt=.5*bt;S.setWidth(Mt<=Bt?Mt:Bt),j.setStroke(S)}else j.setStroke(void 0);var Ut=gv(g,"layout","text-padding",u,c),Yt=j.getPadding();Ut!==Yt[0]&&(Yt[0]=Yt[1]=Yt[2]=Yt[3]=Ut),O.setZIndex(L)}}},g=0,y=o.length;g-1?(R.length=p+1,R):void 0}};return t.setStyle(P),t.set("mapbox-source",c),t.set("mapbox-layers",f),P},wv=r(6),bv=r.n(wv);class Sv{constructor(t,e,r,i){this.minX=t,this.maxX=e,this.minY=r,this.maxY=i}contains(t){return this.containsXY(t[1],t[2])}containsTileRange(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY}containsXY(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY}equals(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY}extend(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY}}var Tv=Sv;var Cv="opacity",Ev="visible",Rv="extent",Pv="zIndex",Iv="maxResolution",Ov="minResolution",Lv="maxZoom",Mv="minZoom",Fv="source";var Av=class extends uy{constructor(t){super();const e=qg({},t);e[Cv]=void 0!==t.opacity?t.opacity:1,wg("number"==typeof e[Cv],64),e[Ev]=void 0===t.visible||t.visible,e[Pv]=t.zIndex,e[Iv]=void 0!==t.maxResolution?t.maxResolution:1/0,e[Ov]=void 0!==t.minResolution?t.minResolution:0,e[Mv]=void 0!==t.minZoom?t.minZoom:-1/0,e[Lv]=void 0!==t.maxZoom?t.maxZoom:1/0,this.className_=void 0!==e.className?t.className:"ol-layer",delete e.className,this.setProperties(e),this.state_=null}getClassName(){return this.className_}getLayerState(t){const e=this.state_||{layer:this,managed:void 0===t||t},r=this.getZIndex();return e.opacity=bg(Math.round(100*this.getOpacity())/100,0,1),e.sourceState=this.getSourceState(),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==r?r:!1===e.managed?1/0:0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e}getLayersArray(t){return dg()}getLayerStatesArray(t){return dg()}getExtent(){return this.get(Rv)}getMaxResolution(){return this.get(Iv)}getMinResolution(){return this.get(Ov)}getMinZoom(){return this.get(Mv)}getMaxZoom(){return this.get(Lv)}getOpacity(){return this.get(Cv)}getSourceState(){return dg()}getVisible(){return this.get(Ev)}getZIndex(){return this.get(Pv)}setExtent(t){this.set(Rv,t)}setMaxResolution(t){this.set(Iv,t)}setMinResolution(t){this.set(Ov,t)}setMaxZoom(t){this.set(Lv,t)}setMinZoom(t){this.set(Mv,t)}setOpacity(t){wg("number"==typeof t,64),this.set(Cv,t)}setVisible(t){this.set(Ev,t)}setZIndex(t){this.set(Pv,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}},kv="prerender",Nv="postrender",jv="precompose",Dv="undefined",Gv="ready";var zv=class extends Av{constructor(t){const e=qg({},t);delete e.source,super(e),this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,this.renderer_=null,t.render&&(this.render=t.render),t.map&&this.setMap(t.map),this.addEventListener(ly(Fv),this.handleSourcePropertyChange_);const r=t.source?t.source:null;this.setSource(r)}getLayersArray(t){const e=t||[];return e.push(this),e}getLayerStatesArray(t){const e=t||[];return e.push(this.getLayerState()),e}getSource(){return this.get(Fv)||null}getSourceState(){const t=this.getSource();return t?t.getState():Dv}handleSourceChange_(){this.changed()}handleSourcePropertyChange_(){this.sourceChangeKey_&&(iy(this.sourceChangeKey_),this.sourceChangeKey_=null);const t=this.getSource();t&&(this.sourceChangeKey_=ey(t,Jg,this.handleSourceChange_,this)),this.changed()}getFeatures(t){return this.renderer_.getFeatures(t)}render(t,e){const r=this.getRenderer();if(r.prepareFrame(t))return r.renderFrame(t,e)}setMap(t){this.mapPrecomposeKey_&&(iy(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(iy(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=ey(t,jv,(function(t){const e=t.frameState.layerStatesArray,r=this.getLayerState(!1);wg(!e.some((function(t){return t.layer===r.layer})),67),e.push(r)}),this),this.mapRenderKey_=ey(this,Jg,t.render,t),this.changed())}setSource(t){this.set(Fv,t)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}disposeInternal(){this.setSource(null),super.disposeInternal()}};var Bv=class{drawCustom(t,e,r){}drawGeometry(t){}setStyle(t){}drawCircle(t,e){}drawFeature(t,e){}drawGeometryCollection(t,e){}drawLineString(t,e){}drawMultiLineString(t,e){}drawMultiPoint(t,e){}drawMultiPolygon(t,e){}drawPoint(t,e){}drawPolygon(t,e){}drawText(t,e){}setFillStrokeStyle(t,e){}setImageStyle(t,e){}setTextStyle(t,e){}};const Uv=[1,0,0,1,0,0];var Yv=class extends uy{constructor(){super(),this.extent_=[1/0,1/0,-1/0,-1/0],this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=function(t){let e,r,i,n=!1;return function(){const o=Array.prototype.slice.call(arguments);return n&&this===i&&Vg(o,r)||(n=!0,i=this,r=o,e=t.apply(this,arguments)),e}}((function(t,e,r){if(!r)return this.getSimplifiedGeometry(e);const i=this.clone();return i.applyTransform(r),i.getSimplifiedGeometry(e)}))}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return dg()}closestPointXY(t,e,r,i){return dg()}containsXY(t,e){const r=this.getClosestPoint([t,e]);return r[0]===t&&r[1]===e}getClosestPoint(t,e){const r=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],r,1/0),r}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return dg()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const t=this.computeExtent(this.extent_);(isNaN(t[0])||isNaN(t[1]))&&Pm(t),this.extentRevision_=this.getRevision()}return function(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}(this.extent_,t)}rotate(t,e){dg()}scale(t,e,r){dg()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return dg()}getType(){return dg()}applyTransform(t){dg()}intersectsExtent(t){return dg()}translate(t,e){dg()}transform(t,e){const r=O_(t),i=r.getUnits()==u_.TILE_PIXELS?function(t,i,n){const o=r.getExtent(),s=r.getWorldExtent(),a=zm(s)/zm(o);return vy(Uv,s[0],s[3],a,-a,0,0,0),Y_(t,0,t.length,n,Uv,i),A_(r,e)(t,i,n)}:A_(r,e);return this.applyTransform(i),this}},Wv="XY",Vv="XYZ",Xv="XYM",qv="XYZM";function Zv(t){let e;return t==Wv?e=2:t==Vv||t==Xv?e=3:t==qv&&(e=4),e}var Kv=class extends Yv{constructor(){super(),this.layout=Wv,this.stride=2,this.flatCoordinates=null}computeExtent(t){return Om(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return dg()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length1)c=r;else{if(p>0){for(let n=0;nn&&(n=a),o=r,s=i}return n}function mx(t,e,r,i,n){for(let o=0,s=r.length;o0;){const r=u.pop(),o=u.pop();let s=0;const a=t[o],c=t[o+1],p=t[r],d=t[r+1];for(let e=o+i;es&&(h=e,s=r)}s>n&&(l[(h-e)/i]=1,o+i0&&f>p)&&(d<0&&g0&&g>d)?(a=r,l=c):(o[s++]=a,o[s++]=l,u=a,h=l,a=r,l=c)}return o[s++]=a,o[s++]=l,s}function Ex(t,e,r,i,n,o,s,a){for(let l=0,u=r.length;l=n[0]&&o[2]<=n[2]||(o[1]>=n[1]&&o[3]<=n[3]||Nx(t,e,r,i,(function(t,e){return function(t,e,r){let i=!1;const n=Em(t,e),o=Em(t,r);if(n===gm||o===gm)i=!0;else{const s=t[0],a=t[1],l=t[2],u=t[3],h=e[0],c=e[1],p=r[0],d=r[1],f=(d-c)/(p-h);let g,y;o&ym&&!(n&ym)&&(g=p-(d-u)/f,i=g>=s&&g<=l),i||!(o&mm)||n&mm||(y=d-(p-l)*f,i=y>=a&&y<=u),i||!(o&_m)||n&_m||(g=p-(d-a)/f,i=g>=s&&g<=l),i||!(o&vm)||n&vm||(y=d-(p-s)*f,i=y>=a&&y<=u)}return i}(n,t,e)})))))}function Dx(t,e,r,i,n){if(!function(t,e,r,i,n){return!!jx(t,e,r,i,n)||(!!i_(t,e,r,i,n[0],n[1])||(!!i_(t,e,r,i,n[0],n[3])||(!!i_(t,e,r,i,n[2],n[1])||!!i_(t,e,r,i,n[2],n[3]))))}(t,e,r[0],i,n))return!1;if(1===r.length)return!0;for(let e=1,o=r.length;eo||(r==o&&e>=s||(n=a,o=r,s=e))}return n}(t,e,r,i);let s=o-i;s=r&&(a=e);const l=t[s],u=t[s+1],h=t[o],c=t[o+1],p=t[a],d=t[a+1];return h*d+l*c+u*p-(u*h+c*p+l*d)<0}function Bx(t,e,r,i,n){const o=void 0!==n&&n;for(let n=0,s=r.length;n0&&(this.newTiles_=!0):a.setState(hx)),this.isDrawableTile(a)||(a=a.getInterimTile()),a}loadedTileCallback(t,e,r){return!!this.isDrawableTile(r)&&super.loadedTileCallback(t,e,r)}prepareFrame(t){return!!this.getLayer().getSource()}renderFrame(t,e){const r=t.layerStatesArray[t.layerIndex],i=t.viewState,n=i.projection,o=i.resolution,s=i.center,a=i.rotation,l=t.pixelRatio,u=this.getLayer(),h=u.getSource(),c=h.getRevision(),p=h.getTileGridForProjection(n),d=p.getZForResolution(o,h.zDirection),f=p.getResolution(d);let g=t.extent;const y=r.extent&&G_(r.extent,n);y&&(g=Bm(g,G_(r.extent,n)));const m=h.getTilePixelRatio(l);let _=Math.round(t.size[0]*m),v=Math.round(t.size[1]*m);if(a){const t=Math.round(Math.sqrt(_*_+v*v));_=t,v=t}const x=f*_/2/m,w=f*v/2/m,b=[s[0]-x,s[1]-w,s[0]+x,s[1]+w],S=p.getTileRangeForExtentAndZ(g,d),T={};T[d]={};const C=this.createLoadedTileFinder(h,n,T),E=this.tmpExtent,R=this.tmpTileRange_;this.newTiles_=!1;for(let e=S.minX;e<=S.maxX;++e)for(let r=S.minY;r<=S.maxY;++r){const i=this.getTile(d,e,r,t);if(this.isDrawableTile(i)){const e=gg(this);if(i.getState()==hx){T[d][i.tileCoord.toString()]=i;const t=i.inTransition(e);this.newTiles_||!t&&-1!==this.renderedTiles.indexOf(i)||(this.newTiles_=!0)}if(1===i.getAlpha(e,t.time))continue}const n=p.getTileCoordChildTileRange(i.tileCoord,R,E);let o=!1;n&&(o=C(d+1,n)),o||p.forEachTileCoordParentTileRange(i.tileCoord,C,R,E)}const P=f/o;vy(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/m,1/m,a,-_/2,-v/2);const I=(O=this.pixelTransform,Ng?wy(O):(Ny||(Ny=Dg(1,1).canvas),Ny.style.transform=wy(O),Ny.style.transform));var O;this.useContainer(e,I,r.opacity);const L=this.context,M=L.canvas;xy(this.inversePixelTransform,this.pixelTransform),vy(this.tempTransform,_/2,v/2,P,P,0,-_/2,-v/2),M.width!=_||M.height!=v?(M.width=_,M.height=v):this.containerReused||L.clearRect(0,0,_,v),y&&this.clipUnrotated(L,t,y),qg(L,h.getContextOptions()),this.preRender(L,t),this.renderedTiles.length=0;let F,A,k,N=Object.keys(T).map(Number);N.sort(Ug),1!==r.opacity||this.containerReused&&!h.getOpaque(t.viewState.projection)?(F=[],A=[]):N=N.reverse();for(let e=N.length-1;e>=0;--e){const i=N[e],o=h.getTilePixelSize(i,l,n),s=p.getResolution(i)/f,a=o[0]*s*P,u=o[1]*s*P,c=p.getTileCoordForCoordAndZ(Um(b),i),g=p.getTileCoordExtent(c),y=my(this.tempTransform,[m*(g[0]-b[0])/f,m*(b[3]-g[3])/f]),_=m*h.getGutterForProjection(n),v=T[i];for(const e in v){const n=v[e],o=n.tileCoord,s=y[0]-(c[1]-o[1])*a,l=Math.round(s+a),p=y[1]-(c[2]-o[2])*u,f=Math.round(p+u),g=Math.round(s),m=Math.round(p),x=l-g,w=f-m,b=d===i,S=b&&1!==n.getAlpha(gg(this),t.time);if(!S)if(F){L.save(),k=[g,m,g+x,m,g+x,m+w,g,m+w];for(let t=0,e=F.length;tthis.maxLineWidth&&(this.maxLineWidth=r.lineWidth,this.bufferedMaxExtent_=null)}else r.strokeStyle=void 0,r.lineCap=void 0,r.lineDash=null,r.lineDashOffset=void 0,r.lineJoin=void 0,r.lineWidth=void 0,r.miterLimit=void 0}createFill(t){const e=t.fillStyle,r=[Rw.SET_FILL_STYLE,e];return"string"!=typeof e&&r.push(!0),r}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[Rw.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,e){const r=t.fillStyle;"string"==typeof r&&t.currentFillStyle==r||(void 0!==r&&this.instructions.push(e.call(this,t)),t.currentFillStyle=r)}updateStrokeStyle(t,e){const r=t.strokeStyle,i=t.lineCap,n=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=r||t.currentLineCap!=i||n!=t.currentLineDash&&!Vg(t.currentLineDash,n)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=l)&&(void 0!==r&&e.call(this,t),t.currentStrokeStyle=r,t.currentLineCap=i,t.currentLineDash=n,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=l)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const e=[Rw.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=wm(this.maxExtent),this.maxLineWidth>0)){const t=this.resolution*(this.maxLineWidth+1)/2;xm(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}};var Iw=class extends Pw{constructor(t,e,r,i){super(t,e,r,i)}drawFlatCoordinatess_(t,e,r,i){const n=this.state,o=void 0!==n.fillStyle,s=void 0!==n.strokeStyle,a=r.length;this.instructions.push(Cw),this.hitDetectionInstructions.push(Cw);for(let n=0;nt&&(_>m&&(m=_,g=v,y=s),_=0,v=s-n)),a=l,c=d,p=f),u=r,h=i}return _+=l,_>m?[v,s]:[g,y]}const Lw={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};const Mw={Circle:Iw,Default:Pw,Image:class extends Pw{constructor(t,e,r,i){super(t,e,r,i),this.declutterGroups_=null,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0}drawCoordinates_(t,e,r,i){return this.appendFlatCoordinates(t,e,r,i,!1,!1)}drawPoint(t,e){if(!this.image_)return;this.beginGeometry(t,e);const r=t.getFlatCoordinates(),i=t.getStride(),n=this.coordinates.length,o=this.drawCoordinates_(r,0,r.length,i);this.instructions.push([Rw.DRAW_IMAGE,n,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,this.declutterGroups_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_)]),this.hitDetectionInstructions.push([Rw.DRAW_IMAGE,n,o,this.hitDetectionImage_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,this.declutterGroups_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_)]),this.endGeometry(e)}drawMultiPoint(t,e){if(!this.image_)return;this.beginGeometry(t,e);const r=t.getFlatCoordinates(),i=t.getStride(),n=this.coordinates.length,o=this.drawCoordinates_(r,0,r.length,i);this.instructions.push([Rw.DRAW_IMAGE,n,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,this.declutterGroups_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_)]),this.hitDetectionInstructions.push([Rw.DRAW_IMAGE,n,o,this.hitDetectionImage_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,this.declutterGroups_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_)]),this.endGeometry(e)}finish(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,super.finish()}setImageStyle(t,e){const r=t.getAnchor(),i=t.getSize(),n=t.getHitDetectionImage(this.pixelRatio),o=t.getImage(this.pixelRatio),s=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=r[0],this.anchorY_=r[1],this.declutterGroups_=e,this.hitDetectionImage_=n,this.image_=o,this.height_=i[1],this.opacity_=t.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=i[0]}},LineString:class extends Pw{constructor(t,e,r,i){super(t,e,r,i)}drawFlatCoordinates_(t,e,r,i){const n=this.coordinates.length,o=this.appendFlatCoordinates(t,e,r,i,!1,!1),s=[Rw.MOVE_TO_LINE_TO,n,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),r}drawLineString(t,e){const r=this.state,i=r.strokeStyle,n=r.lineWidth;if(void 0===i||void 0===n)return;this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([Rw.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset],Cw);const o=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(o,0,o.length,s),this.hitDetectionInstructions.push(Tw),this.endGeometry(e)}drawMultiLineString(t,e){const r=this.state,i=r.strokeStyle,n=r.lineWidth;if(void 0===i||void 0===n)return;this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([Rw.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset],Cw);const o=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride();let l=0;for(let t=0,e=o.length;tn[n.length-i]}else d=t[e]>t[r-i];const f=n.length;let g,y,m=t[e],_=t[e+1],v=t[e+=i],x=t[e+1],w=0,b=Math.sqrt(Math.pow(v-m,2)+Math.pow(x-_,2)),S=!1;for(let c=0;c0?-Math.PI:Math.PI),void 0!==y){let t=P-y;if(S=S||0!==t,t+=t>Math.PI?-2*Math.PI:t<-Math.PI?2*Math.PI:0,Math.abs(t)>s)return null}y=P;const I=R/b,O=Eg(m,v,I),L=Eg(_,x,I);p[g]=[O,L,C/2,P,T],o+=C}return S?p:[[p[0][0],p[0][1],p[0][2],p[0][3],n]]}const kw=[1/0,1/0,-1/0,-1/0],Nw=[1,0,0,1,0,0],jw=[],Dw=[],Gw=[],zw=[];var Bw=class{constructor(t,e,r,i,n){this.overlaps=r,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.declutterItems=[],this.instructions=i.instructions,this.coordinates=i.coordinates,this.coordinateCache_={},this.renderBuffer_=n,this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=i.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=i.fillStates||{},this.strokeStates=i.strokeStates||{},this.textStates=i.textStates||{},this.widths_={},this.labels_={}}createLabel(t,e,r,i){const n=t+e+r+i;if(this.labels_[n])return this.labels_[n];const o=i?this.strokeStates[i]:null,s=r?this.fillStates[r]:null,a=this.textStates[e],l=this.pixelRatio,u=[a.scale[0]*l,a.scale[1]*l],h=Lw[a.textAlign||"center"],c=i&&o.lineWidth?o.lineWidth:0,p=t.split("\n"),d=p.length,f=[],g=function(t,e,r){const i=e.length;let n=0;for(let o=0;on.width?n.width-h:g,w=l+c>n.height?n.height-c:l,b=y[3]+x*d[0]+y[1],S=y[0]+w*d[1]+y[2],T=r-y[3],C=i-y[0];(v||0!==p)&&(jw[0]=T,zw[0]=T,jw[1]=C,Dw[1]=C,Dw[0]=T+b,Gw[0]=Dw[0],Gw[1]=C+S,zw[1]=Gw[1]);let E=null;if(0!==p){const t=r+o,e=i+s;E=vy(Nw,t,e,1,1,p,-t,-e),my(Nw,jw),my(Nw,Dw),my(Nw,Gw),my(Nw,zw),Rm(Math.min(jw[0],Dw[0],Gw[0],zw[0]),Math.min(jw[1],Dw[1],Gw[1],zw[1]),Math.max(jw[0],Dw[0],Gw[0],zw[0]),Math.max(jw[1],Dw[1],Gw[1],zw[1]),kw)}else Rm(T,C,T+b,C+S,kw);this.renderBuffer_[0]=Math.max(this.renderBuffer_[0],Wm(kw)),this.renderBuffer_[1]=Math.max(this.renderBuffer_[1],zm(kw));const R=t.canvas,P=_?_[2]*d[0]/2:0,I=this.renderBuffer_,O=kw[0]-P<=(R.width+I[0])/e&&kw[2]+P>=-I[0]/e&&kw[1]-P<=(R.height+I[1])/e&&kw[3]+P>=-I[1]/e;if(f&&(r=Math.round(r),i=Math.round(i)),a){if(!O&&1==a[0])return!1;const e=O?[t,E?E.slice(0):null,u,n,h,c,x,w,r,i,d,kw.slice()]:null;e&&(v&&e.push(m,_,jw.slice(0),Dw.slice(0),Gw.slice(0),zw.slice(0)),a.push(e))}else O&&(v&&this.replayTextBackground_(t,jw,Dw,Gw,zw,m,_,!1),ky(t,E,u,n,h,c,x,w,r,i,d));return!0}fill_(t){if(this.alignFill_){const e=my(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;t.save(),t.translate(e[0]%r,e[1]%r),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()}setStrokeStyle_(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))}renderDeclutter(t,e,r,i){const n=[];for(let r=1,i=t.length;r12&&this.replayTextBackground_(i[0],i[14],i[15],i[16],i[17],i[12],i[13],!0),ky.apply(void 0,i),o!==r&&(n.globalAlpha=o)}}return t.length=1,i}drawLabelWithPointPlacement_(t,e,r,i){const n=this.textStates[e],o=this.createLabel(t,e,i,r),s=this.strokeStates[r],a=this.pixelRatio,l=Lw[n.textAlign||"center"],u=Lw[n.textBaseline||"middle"],h=s&&s.lineWidth?s.lineWidth:0;return{label:o,anchorX:l*(o.width/a-2*n.scale[0])+2*(.5-l)*h,anchorY:u*o.height/a+2*(.5-u)*h}}execute_(t,e,r,i,n,o,s){let a;var l,u;this.declutterItems.length=0,this.pixelCoordinates_&&Vg(r,this.renderedTransform_)?a=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),a=Y_(this.coordinates,0,this.coordinates.length,2,r,this.pixelCoordinates_),l=this.renderedTransform_,u=r,l[0]=u[0],l[1]=u[1],l[2]=u[2],l[3]=u[3],l[4]=u[4],l[5]=u[5]);let h=0;const c=i.length;let p,d,f,g,y,m,_,v,x,w,b,S,T,C,E=0,R=0,P=0,I=null,O=null;const L=this.coordinateCache_,M=this.viewRotation_,F=Math.round(1e12*Math.atan2(-r[1],r[0]))/1e12,A={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:M},k=this.instructions!=i||this.overlaps?0:200;let N,j,D;for(;hk&&(this.fill_(t),R=0),P>k&&(t.stroke(),P=0),R||P||(t.beginPath(),g=NaN,y=NaN),++h;break;case Rw.CIRCLE:E=r[1];const i=a[E],l=a[E+1],u=a[E+2]-i,c=a[E+3]-l,G=Math.sqrt(u*u+c*c);t.moveTo(i+G,l),t.arc(i,l,G,0,2*Math.PI,!0),++h;break;case Rw.CLOSE_PATH:t.closePath(),++h;break;case Rw.CUSTOM:E=r[1],p=r[2];const z=r[3],B=r[4],U=6==r.length?r[5]:void 0;A.geometry=z,A.feature=N,h in L||(L[h]=[]);const Y=L[h];U?U(a,E,p,2,Y):(Y[0]=a[E],Y[1]=a[E+1],Y.length=2),B(Y,A),++h;break;case Rw.DRAW_IMAGE:E=r[1],p=r[2],w=r[3],d=r[4],f=r[5],x=o?null:r[6];let W=r[7];const V=r[8],X=r[9],q=r[10],Z=r[11];let K=r[12];const H=r[13];let J,$,Q,tt,et=r[14];if(!w&&r.length>=19){b=r[18],S=r[19],T=r[20],C=r[21];const t=this.drawLabelWithPointPlacement_(b,S,T,C);w=t.label,r[3]=w;const e=r[22];d=(t.anchorX-e)*this.pixelRatio,r[4]=d;const i=r[23];f=(t.anchorY-i)*this.pixelRatio,r[5]=f,W=w.height,r[7]=W,et=w.width,r[14]=et}r.length>24&&(J=r[24]),r.length>16?($=r[15],Q=r[16],tt=r[17]):($=Sy,Q=!1,tt=!1),Z&&F?K+=M:Z||F||(K-=M);let rt=0,it=0;for(;E=n)for(i=n;i0&&(u=s,o.push({items:s.declutterItems,opacity:i}))}}}var Xw=class{constructor(t,e,r,i,n,o){this.maxExtent_=t,this.overlaps_=i,this.pixelRatio_=r,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(n)}clip(t,e){const r=this.getClipCoords(e);t.beginPath(),t.moveTo(r[0],r[1]),t.lineTo(r[2],r[3]),t.lineTo(r[4],r[5]),t.lineTo(r[6],r[7]),t.clip()}createExecutors_(t){for(const e in t){let r=this.executorsByZIndex_[e];void 0===r&&(r={},this.executorsByZIndex_[e]=r);const i=t[e],n=[this.renderBuffer_||0,this.renderBuffer_||0];for(const t in i){const e=i[t];r[t]=new Bw(this.resolution_,this.pixelRatio_,this.overlaps_,e,n)}}}hasExecutors(t){for(const e in this.executorsByZIndex_){const r=this.executorsByZIndex_[e];for(let e=0,i=t.length;e=n;)Ww(r,t+i,t+n),Ww(r,t+n,t+i),Ww(r,t-n,t+i),Ww(r,t-i,t+n),Ww(r,t-i,t-n),Ww(r,t-n,t-i),Ww(r,t+n,t-i),Ww(r,t+i,t-n),n++,o+=1+2*n,2*(o-i)+1>0&&(i-=1,o+=1-2*i);return Yw[t]=r,r}(i);let c;function p(t){const e=l.getImageData(0,0,s,s).data;for(let r=0;r0){let e;return(!o||c!=Qv&&c!=rx||-1!==o.indexOf(t))&&(e=n(t)),e||void l.clearRect(0,0,s,s)}}const d=Object.keys(this.executorsByZIndex_).map(Number);let f,g,y,m,_;for(d.sort(Ug),f=d.length-1;f>=0;--f){const t=d[f].toString();for(y=this.executorsByZIndex_[t],g=Uw.length-1;g>=0;--g)if(c=Uw[g],m=y[c],void 0!==m&&(_=m.executeHitDetection(l,a,r,p,u),_))return _}}getClipCoords(t){const e=this.maxExtent_;if(!e)return null;const r=e[0],i=e[1],n=e[2],o=e[3],s=[r,i,r,o,n,o,n,i];return Y_(s,0,8,2,t,s),s}isEmpty(){return Kg(this.executorsByZIndex_)}execute(t,e,r,i,n,o,s){const a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(Ug),this.maxExtent_&&(t.save(),this.clip(t,r));const l=o||Uw;let u,h,c,p,d,f;for(u=0,h=a.length;u0&&(s.width=0),this.container;const l=Math.round(t.size[0]*r),u=Math.round(t.size[1]*r);s.width!=l||s.height!=u?(s.width=l,s.height=u,s.style.transform!==n&&(s.style.transform=n)):this.containerReused||o.clearRect(0,0,l,u),this.preRender(o,t);const h=t.extent,c=t.viewState,p=c.center,d=c.resolution,f=c.projection,g=c.rotation,y=f.getExtent(),m=this.getLayer().getSource();let _=!1;if(i.extent){const e=G_(i.extent,f);_=!Tm(e,t.extent)&&Vm(e,t.extent),_&&this.clipUnrotated(o,t,e)}const v=t.viewHints,x=!(v[dx]||v[fx]),w=this.getRenderTransform(p,d,g,r,l,u,0),b=this.getLayer().getDeclutter()?{}:null;if(a.execute(o,1,w,g,x,void 0,b),m.getWrapX()&&f.canWrapX()&&!Tm(y,h)){let t=h[0];const e=Wm(y);let i,n=0;for(;ty[2];){++n,i=e*n;const s=this.getRenderTransform(p,d,g,r,l,u,i);a.execute(o,1,s,g,x,void 0,b),t-=e}}if(b){const e=t.viewHints;Vw(b,o,g,1,!(e[dx]||e[fx]),t.declutterItems)}_&&o.restore(),this.postRender(o,t);const S=i.opacity,T=this.container;return S!==parseFloat(T.style.opacity)&&(T.style.opacity=1===S?"":String(S)),this.renderedRotation_!==c.rotation&&(this.renderedRotation_=c.rotation,this.hitDetectionImageData_=null),this.container}getFeatures(t){return new Promise(function(e,r){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const t=[this.context.canvas.width,this.context.canvas.height];my(this.pixelTransform,t);const e=this.renderedCenter_,r=this.renderedResolution_,i=this.renderedRotation_,n=this.renderedProjection_,o=this.renderedExtent_,s=this.getLayer(),a=[],l=t[0]/2,u=t[1]/2;a.push(this.getRenderTransform(e,r,i,.5,l,u,0).slice());const h=s.getSource(),c=n.getExtent();if(h.getWrapX()&&n.canWrapX()&&!Tm(c,o)){let t=o[0];const n=Wm(c);let s,h=0;for(;tc[2];)++h,s=n*h,a.push(this.getRenderTransform(e,r,i,.5,l,u,s).slice()),t-=n}this.hitDetectionImageData_=qw(t,a,this.renderedFeatures_,s.getStyleFunction(),o,r,i)}e(Zw(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))}forEachFeatureAtCoordinate(t,e,r,i,n){if(this.replayGroup_){const o=e.viewState.resolution,s=e.viewState.rotation,a=this.getLayer(),l={};return this.replayGroup_.forEachFeatureAtCoordinate(t,o,s,r,(function(t){const e=gg(t);if(!(e in l))return l[e]=!0,i(t,a)}),a.getDeclutter()?n:null)}}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){const e=this.getLayer(),r=e.getSource();if(!r)return!1;const i=t.viewHints[dx],n=t.viewHints[fx],o=e.getUpdateWhileAnimating(),s=e.getUpdateWhileInteracting();if(!this.dirty_&&!o&&i||!s&&n)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const a=t.extent,l=t.viewState,u=l.projection,h=l.resolution,c=t.pixelRatio,p=e.getRevision(),d=e.getRenderBuffer();let f=e.getRenderOrder();void 0===f&&(f=nx);const g=l.center.slice(),y=xm(a,d*h),m=[y.slice()],_=u.getExtent();if(r.getWrapX()&&u.canWrapX()&&!Tm(_,t.extent)){const t=Wm(_),e=Math.max(Wm(y)/2,t);y[0]=_[0]-e,y[2]=_[2]+e,C_(g,u);const r=function(t,e){const r=e.getExtent(),i=Gm(t);if(e.canWrapX()&&(i[0]=r[2])){const e=Wm(r),n=Math.floor((i[0]-r[0])/e)*e;t[0]-=n,t[2]-=n}return t}(m[0],u);r[0]<_[0]&&r[2]<_[2]?m.push([r[0]+t,r[1],r[2]+t,r[3]]):r[0]>_[0]&&r[2]>_[2]&&m.push([r[0]-t,r[1],r[2]-t,r[3]])}if(!this.dirty_&&this.renderedResolution_==h&&this.renderedRevision_==p&&this.renderedRenderOrder_==f&&Tm(this.renderedExtent_,y))return this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;const v=new Fw(sx(h,c),y,h,c,e.getDeclutter()),x=j_();let w;if(x){for(let t=0,e=m.length;t0)return void e([]);const d=Um(u.getTileCoordExtent(p.wrappedTileCoord)),f=[(h[0]-d[0])/l,(d[1]-h[1])/l],g=p.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]);let y=p.hitDetectionImageData[n];if(!y&&!this.animatingOrInteracting_){const t=yg(u.getTileSize(u.getZForResolution(l))),e=[t[0]/2,t[1]/2],r=this.renderedRotation_;y=qw(t,[this.getRenderTransform(u.getTileCoordCenter(p.wrappedTileCoord),l,0,.5,e[0],e[1],0)],g,i.getStyleFunction(),u.getTileCoordExtent(p.wrappedTileCoord),p.getReplayState(i).renderedResolution,r),p.hitDetectionImageData[n]=y}e(Zw(f,g,y))}.bind(this))}handleFontsChanged(){Zg(this.renderTileImageQueue_);const t=this.getLayer();t.getVisible()&&void 0!==this.renderedLayerRevision_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}renderFrame(t,e){const r=t.viewHints,i=!(r[dx]||r[fx]);this.renderQueuedTileImages_(i,t),super.renderFrame(t,e),this.renderedPixelToCoordinateTransform_=t.pixelToCoordinateTransform.slice(),this.renderedRotation_=t.viewState.rotation;const n=this.getLayer(),o=n.getRenderMode();if(o===Jw)return this.container;const s=n.getSource(),a=t.usedTiles[gg(s)];for(const t in this.renderTileImageQueue_)a&&t in a||delete this.renderTileImageQueue_[t];const l=this.context,u=n.getDeclutter()?{}:null,h=eb[o],c=t.pixelRatio,p=t.viewState,d=p.center,f=p.resolution,g=p.rotation,y=t.size,m=Math.round(y[0]*c),_=Math.round(y[1]*c),v=this.renderedTiles,x=s.getTileGridForProjection(t.viewState.projection),w=[],b=[];for(let t=v.length-1;t>=0;--t){const e=v[t],r=e.tileCoord,o=x.getTileCoordExtent(e.wrappedTileCoord),s=x.getTileCoordExtent(r,this.tmpExtent)[0]-o[0],a=gy(_y(this.inversePixelTransform.slice(),1/c,1/c),this.getRenderTransform(d,f,g,c,m,_,s)),p=e.executorGroups[gg(n)];let y=!1;for(let t=0,r=p.length;t8){e.animate=!0;break}const i=this.renderTileImageQueue_[r];delete this.renderTileImageQueue_[r],this.renderTileImage_(i,e)}}renderFeature(t,e,r,i){if(!r)return!1;let n=!1;if(Array.isArray(r))for(let o=0,s=r.length;o2?i[2]:""):t+r}function fb(t,e,r,i,n){return new Promise((function(o,s){if("object"!=typeof e&&(e=JSON.parse(e)),8!=e.version)return s(new Error("glStyle version 8 required."));if(!(t instanceof Hw||t instanceof ib))return s(new Error("Can only apply to VectorLayer or VectorTileLayer"));var a,l,u;function h(){u||e.sprite&&!a?u?(t.setStyle(u),o()):s(new Error("Something went wrong trying to apply style.")):(u=xv(t,e,r,n,a,l,hb),t.getStyle()?o():s(new Error("Nothing to show for source ["+r+"]")))}if(e.sprite){var c=.5==(window.devicePixelRatio>=1.5?.5:1)?"@2x":"",p=db(e.sprite,i,c+".json");fetch(p,{credentials:"same-origin"}).then((function(t){return t.ok||""===c?t:(p=db(e.sprite,i,".json"),fetch(p,{credentials:"same-origin"}))})).then((function(t){if(t.ok)return t.json();s(new Error("Problem fetching sprite from "+p+": "+t.statusText))})).then((function(t){if(void 0===t||0===Object.keys(t).length)return s(new Error("No sprites found."));a=t,l=db(e.sprite,i,c+".png"),h()})).catch((function(t){s(new Error("Sprites cannot be loaded: "+p+": "+t.message))}))}else h()}))}new dw;var gb=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function yb(t){return 0!==t.indexOf("mapbox://")?"":t.slice("mapbox://".length)}var mb=function(t){function e(e){var r=t.call(this,L)||this;return r.error=e,r}return gb(e,t),e}(h),_b="vector",vb=function(t){function e(e){var r=this,i=!("declutter"in e)||e.declutter,n=new hd({state:Tn,format:new ng});return(r=t.call(this,{source:n,declutter:i,className:e.className,opacity:e.opacity,visible:e.visible,zIndex:e.zIndex,minResolution:e.minResolution,maxResolution:e.maxResolution,minZoom:e.minZoom,maxZoom:e.maxZoom,renderOrder:e.renderOrder,renderBuffer:e.renderBuffer,renderMode:e.renderMode,map:e.map,updateWhileAnimating:e.updateWhileAnimating,updateWhileInteracting:e.updateWhileInteracting,preload:e.preload,useInterimTilesOnError:e.useInterimTilesOnError})||this).sourceId=e.source,r.layers=e.layers,r.accessToken=e.accessToken,r.fetchStyle(e.styleUrl),r}return gb(e,t),e.prototype.fetchStyle=function(t){var e=this,r=function(t,e){var r=yb(t);if(!r)return t;if(0!==r.indexOf("styles/"))throw new Error("unexpected style url: "+t);return"https://api.mapbox.com/styles/v1/"+r.slice("styles/".length)+"?&access_token="+e}(t,this.accessToken);fetch(r).then((function(t){if(!t.ok)throw new Error("unexpected response when fetching style: "+t.status);return t.json()})).then((function(t){e.onStyleLoad(t)})).catch((function(t){e.handleError(t)}))},e.prototype.onStyleLoad=function(t){var e,r,i=this;if(this.layers){for(var n={},o=0;o0){this.source_&&(this.source_.clear(),this.source_.addFeatures(u)),this.dispatchEvent(new Tb(Sb,t,u,n));break}}},e.prototype.registerListeners_=function(){var t=this.getMap();if(t){var e=this.target?this.target:t.getViewport();this.dropListenKeys_=[W(e,j,this.handleDrop,this),W(e,k,this.handleStop,this),W(e,N,this.handleStop,this),W(e,j,this.handleStop,this)]}},e.prototype.setActive=function(e){!this.getActive()&&e&&this.registerListeners_(),this.getActive()&&!e&&this.unregisterListeners_(),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.unregisterListeners_(),t.prototype.setMap.call(this,e),this.getActive()&&this.registerListeners_()},e.prototype.tryReadFeatures_=function(t,e,r){try{return t.readFeatures(e,r)}catch(t){return null}},e.prototype.unregisterListeners_=function(){this.dropListenKeys_&&(this.dropListenKeys_.forEach(X),this.dropListenKeys_=null)},e.prototype.handleDrop=function(t){for(var e=t.dataTransfer.files,r=0,i=e.length;r1?1:-1;return e.endInteraction(this.duration_,r),this.lastScaleDelta_=0,!1},e.prototype.handleDownEvent=function(t){return!!ma(t)&&(!!this.condition_(t)&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0))},e}(na),Pb=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Ib=function(t){function e(e,r,i){var n=t.call(this)||this;if(void 0!==i&&void 0===r)n.setFlatCoordinates(i,e);else{var o=r||0;n.setCenterAndRadius(e,o,i)}return n}return Pb(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),void 0,this.layout)},e.prototype.closestPointXY=function(t,e,r,i){var n=this.flatCoordinates,o=t-n[0],s=e-n[1],a=o*o+s*s;if(a=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||ie(t,this.intersectsCoordinate.bind(this)))}return!1},e.prototype.setCenter=function(t){var e=this.stride,r=this.flatCoordinates[e]-this.flatCoordinates[0],i=t.slice();i[e]=i[0]+r;for(var n=1;n=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,r=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===Zo.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),i=!1):this.freehand_&&e.type===Zo.POINTERDOWN?i=!1:r?(i=e.type===Zo.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.preventDefault()):("mouse"==e.originalEvent.pointerType||e.type===Zo.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===Zo.DBLCLICK&&(i=!1),t.prototype.handleEvent.call(this,e)&&i},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new qo(Zo.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(t){var e=!0;this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t);var r=this.mode_===kb;return this.shouldHandle_?(this.finishCoordinate_?this.freehand_||r?this.finishDrawing():this.atFinish_(t)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate):(this.startDrawing_(t),this.mode_===Mb&&this.finishDrawing()),e=!1):this.freehand_&&this.abortDrawing(),!e&&this.stopClick_&&t.stopPropagation(),e},e.prototype.handlePointerMove_=function(t){if(this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,r=t.pixel,i=e[0]-r[0],n=e[1]-r[1],o=i*i+n*n;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(t):this.createOrUpdateSketchPoint_(t)},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var r=!1,i=[this.finishCoordinate_];if(this.mode_===Fb)r=this.sketchCoords_.length>this.minPoints_;else if(this.mode_===Ab){var n=this.sketchCoords_;r=n[0].length>this.minPoints_,i=[n[0][0],n[0][n[0].length-2]]}if(r)for(var o=t.map,s=0,a=i.length;s=this.maxPoints_&&(this.freehand_?r.pop():e=!0),r.push(t.slice()),this.geometryFunction_(r,i,n)):this.mode_===Ab&&((r=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?r.pop():e=!0),r.push(t.slice()),e&&(this.finishCoordinate_=r[0]),this.geometryFunction_(this.sketchCoords_,i,n)),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection();this.mode_===Fb?((t=this.sketchCoords_).splice(-2,1),this.geometryFunction_(t,e,r),t.length>=2&&(this.finishCoordinate_=t[t.length-2].slice())):this.mode_===Ab&&((t=this.sketchCoords_[0]).splice(-2,1),this.sketchLine_.getGeometry().setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,r)),0===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,r=t.getGeometry(),i=this.getMap().getView().getProjection();this.mode_===Fb?(e.pop(),this.geometryFunction_(e,r,i)):this.mode_===Ab&&(e[0].pop(),this.geometryFunction_(e,r,i),e=r.getCoordinates()),this.type_===gt.MULTI_POINT?t.setGeometry(new Wf([e])):this.type_===gt.MULTI_LINE_STRING?t.setGeometry(new Uf([e])):this.type_===gt.MULTI_POLYGON&&t.setGeometry(new qf([e])),this.dispatchEvent(new Gb(jb,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),t},e.prototype.abortDrawing=function(){var t=this.abortDrawing_();t&&this.dispatchEvent(new Gb(Db,t))},e.prototype.appendCoordinates=function(t){var e=this.mode_,r=[];e===Fb?r=this.sketchCoords_:e===Ab&&(r=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]);for(var i=r.pop(),n=0;nc?o[1]:o[0]),s}}return null},e.prototype.handlePointerMove_=function(t){var e=t.pixel,r=t.map,i=this.snapToVertex_(e,r);i||(i=r.getCoordinateFromPixelInternal(e)),this.createOrUpdatePointerFeature_(i)},e.prototype.createOrUpdateExtentFeature_=function(t){var e=this.extentFeature_;return e?t?e.setGeometry(Oi(t)):e.setGeometry(void 0):(e=new ht(t?Oi(t):{}),this.extentFeature_=e,this.extentOverlay_.getSource().addFeature(e)),e},e.prototype.createOrUpdatePointerFeature_=function(t){var e=this.vertexFeature_;e?e.getGeometry().setCoordinates(t):(e=new ht(new pi(t)),this.vertexFeature_=e,this.vertexOverlay_.getSource().addFeature(e));return e},e.prototype.handleEvent=function(e){return!e.originalEvent||!this.condition_(e)||(e.type!=Zo.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),t.prototype.handleEvent.call(this,e),!1)},e.prototype.handleDownEvent=function(t){var e=t.pixel,r=t.map,i=this.getExtentInternal(),n=this.snapToVertex_(e,r),o=function(t){var e=null,r=null;return t[0]==i[0]?e=i[2]:t[0]==i[2]&&(e=i[0]),t[1]==i[1]?r=i[3]:t[1]==i[3]&&(r=i[1]),null!==e&&null!==r?[e,r]:null};if(n&&i){var s=n[0]==i[0]||n[0]==i[2]?n[0]:null,a=n[1]==i[1]||n[1]==i[3]?n[1]:null;null!==s&&null!==a?this.pointerHandler_=Vb(o(n)):null!==s?this.pointerHandler_=Xb(o([s,i[1]]),o([s,i[3]])):null!==a&&(this.pointerHandler_=Xb(o([i[0],a]),o([i[2],a])))}else n=r.getCoordinateFromPixelInternal(e),this.setExtent([n[0],n[1],n[0],n[1]]),this.pointerHandler_=Vb(n);return!0},e.prototype.handleDragEvent=function(t){if(this.pointerHandler_){var e=t.coordinate;this.setExtent(this.pointerHandler_(e)),this.createOrUpdatePointerFeature_(e)}},e.prototype.handleUpEvent=function(t){this.pointerHandler_=null;var e=this.getExtentInternal();return e&&0!==ne(e)||this.setExtent(null),!1},e.prototype.setMap=function(e){this.extentOverlay_.setMap(e),this.vertexOverlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getExtent=function(){return Fr(this.getExtentInternal(),this.getMap().getView().getProjection())},e.prototype.getExtentInternal=function(){return this.extent_},e.prototype.setExtent=function(t){this.extent_=t||null,this.createOrUpdateExtentFeature_(t),this.dispatchEvent(new Yb(this.extent_))},e}(na),Zb=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Kb=[0,0,0,0],Hb=[],Jb="modifystart",$b="modifyend",Qb=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.features=r,n.mapBrowserEvent=i,n}return Zb(e,t),e}(h);function tS(t,e){return t.index-e.index}function eS(t,e,r){var i=e.geometry;if(i.getType()===gt.CIRCLE){var n=i;if(1===e.index){var o=Or();o&&(n=n.clone().transform(o,r));var s=sr(n.getCenter(),Mr(t,r)),a=Math.sqrt(s)-n.getRadius();return a*a}}var l=Mr(t,r);return Hb[0]=Mr(e.segment[0],r),Hb[1]=Mr(e.segment[1],r),lr(l,Hb)}function rS(t,e,r){var i=e.geometry;if(i.getType()===gt.CIRCLE&&1===e.index){var n=i,o=Or();return o&&(n=n.clone().transform(o,r)),Lr(n.getClosestPoint(Mr(t,r)),r)}var s=Mr(t,r);return Hb[0]=Mr(e.segment[0],r),Hb[1]=Mr(e.segment[1],r),Lr(tr(s,Hb),r)}var iS=function(t){function e(e){var r,i,n=t.call(this,e)||this;if(n.boundHandleFeatureChange_=n.handleFeatureChange_.bind(n),n.condition_=e.condition?e.condition:_a,n.defaultDeleteCondition_=function(t){return sa(t)&&da(t)},n.deleteCondition_=e.deleteCondition?e.deleteCondition:n.defaultDeleteCondition_,n.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:ha,n.vertexFeature_=null,n.vertexSegments_=null,n.lastPixel_=[0,0],n.ignoreNextSingleClick_=!1,n.modified_=!1,n.rBush_=new rc,n.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,n.snappedToVertex_=!1,n.changingFeature_=!1,n.dragSegments_=[],n.overlay_=new Ef({source:new uc({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:(r=oh(),function(t,e){return r[gt.POINT]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),n.SEGMENT_WRITERS_={Point:n.writePointGeometry_.bind(n),LineString:n.writeLineStringGeometry_.bind(n),LinearRing:n.writeLineStringGeometry_.bind(n),Polygon:n.writePolygonGeometry_.bind(n),MultiPoint:n.writeMultiPointGeometry_.bind(n),MultiLineString:n.writeMultiLineStringGeometry_.bind(n),MultiPolygon:n.writeMultiPolygonGeometry_.bind(n),Circle:n.writeCircleGeometry_.bind(n),GeometryCollection:n.writeGeometryCollectionGeometry_.bind(n)},n.source_=null,e.source?(n.source_=e.source,i=new at(n.source_.getFeatures()),n.source_.addEventListener(ic,n.handleSourceAdd_.bind(n)),n.source_.addEventListener(sc,n.handleSourceRemove_.bind(n))):i=e.features,!i)throw new Error("The modify interaction requires features or a source");return n.features_=i,n.features_.forEach(n.addFeature_.bind(n)),n.features_.addEventListener(rt,n.handleFeatureAdd_.bind(n)),n.features_.addEventListener(it,n.handleFeatureRemove_.bind(n)),n.lastPointerEvent_=null,n}return Zb(e,t),e.prototype.addFeature_=function(t){var e=t.getGeometry();if(e){var r=this.SEGMENT_WRITERS_[e.getType()];r&&r(t,e)}var i=this.getMap();i&&i.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,i),t.addEventListener(O,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t){this.modified_||(this.modified_=!0,this.dispatchEvent(new Qb(Jb,this.features_,t)))},e.prototype.removeFeature_=function(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.removeEventListener(O,this.boundHandleFeatureChange_)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,r=[];e.forEach((function(e){t===e.feature&&r.push(e)}));for(var i=r.length-1;i>=0;--i){for(var n=r[i],o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===n&&this.dragSegments_.splice(o,1);e.remove(n)}},e.prototype.setActive=function(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.overlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleSourceAdd_=function(t){t.feature&&this.features_.push(t.feature)},e.prototype.handleSourceRemove_=function(t){t.feature&&this.features_.remove(t.feature)},e.prototype.handleFeatureAdd_=function(t){this.addFeature_(t.element)},e.prototype.handleFeatureChange_=function(t){if(!this.changingFeature_){var e=t.target;this.removeFeature_(e),this.addFeature_(e)}},e.prototype.handleFeatureRemove_=function(t){var e=t.element;this.removeFeature_(e)},e.prototype.writePointGeometry_=function(t,e){var r=e.getCoordinates(),i={feature:t,geometry:e,segment:[r,r]};this.rBush_.insert(e.getExtent(),i)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var r=e.getCoordinates(),i=0,n=r.length;i=0;--y)this.insertVertex_.apply(this,n[y])}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var r=this.dragSegments_[e][0],i=r.geometry;if(i.getType()===gt.CIRCLE){var n=i.getCenter(),o=r.featureSegments[0],s=r.featureSegments[1];o.segment[0]=n,o.segment[1]=n,s.segment[0]=n,s.segment[1]=n,this.rBush_.update(Kt(n),o);var a=i,l=Or();if(l){var u=t.map.getView().getProjection();a=Li(a=a.clone().transform(l,u)).transform(u,l)}this.rBush_.update(a.getExtent(),s)}else this.rBush_.update(Dt(r.segment),r)}return this.modified_&&(this.dispatchEvent(new Qb($b,this.features_,t)),this.modified_=!1),!1},e.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map,t.coordinate)},e.prototype.handlePointerAtPixel_=function(t,e,r){var i=r||e.getCoordinateFromPixel(t),n=e.getView().getProjection(),s=Fr(Gt(Ar(Kt(i,Kb),n),e.getView().getResolution()*this.pixelTolerance_,Kb),n),a=this.rBush_.getInExtent(s);if(a.length>0){a.sort((function(t,e){return eS(i,t,n)-eS(i,e,n)}));var l=a[0],u=l.segment,h=rS(i,l,n),c=e.getPixelFromCoordinate(h),p=ar(t,c);if(p<=this.pixelTolerance_){var d={};if(l.geometry.getType()===gt.CIRCLE&&1===l.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(h);else{var f=e.getPixelFromCoordinate(u[0]),g=e.getPixelFromCoordinate(u[1]),y=sr(c,f),m=sr(c,g);p=Math.sqrt(Math.min(y,m)),this.snappedToVertex_=p<=this.pixelTolerance_,this.snappedToVertex_&&(h=y>m?u[1]:u[0]),this.createOrUpdateVertexFeature_(h);for(var _=1,v=a.length;_=0;--n)c=o((h=(r=p[n])[0]).feature),h.depth&&(c+="-"+h.depth.join("-")),c in d||(d[c]={}),0===r[1]?(d[c].right=h,d[c].index=h.index):1==r[1]&&(d[c].left=h,d[c].index=h.index+1);for(c in d){switch(u=d[c].right,a=d[c].left,(l=(s=d[c].index)-1)<0&&(l=0),t=e=(i=(h=void 0!==a?a:u).geometry).getCoordinates(),f=!1,i.getType()){case gt.MULTI_LINE_STRING:e[h.depth[0]].length>2&&(e[h.depth[0]].splice(s,1),f=!0);break;case gt.LINE_STRING:e.length>2&&(e.splice(s,1),f=!0);break;case gt.MULTI_POLYGON:t=t[h.depth[1]];case gt.POLYGON:(t=t[h.depth[0]]).length>4&&(s==t.length-1&&(s=0),t.splice(s,1),f=!0,0===s&&(t.pop(),t.push(t[0]),l=t.length-1))}if(f){this.setGeometryCoordinates_(i,e);var g=[];if(void 0!==a&&(this.rBush_.remove(a),g.push(a.segment[0])),void 0!==u&&(this.rBush_.remove(u),g.push(u.segment[1])),void 0!==a&&void 0!==u){var y={depth:h.depth,feature:h.feature,geometry:h.geometry,index:l,segment:g};this.rBush_.insert(Dt(y.segment),y)}this.updateSegmentIndices_(i,s,h.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),p.length=0}}return f},e.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},e.prototype.updateSegmentIndices_=function(t,e,r,i){this.rBush_.forEachInExtent(t.getExtent(),(function(n){n.geometry===t&&(void 0===r||void 0===n.depth||v(n.depth,r))&&n.index>e&&(n.index+=i)}))},e}(na),nS=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),oS="select",sS=function(t){function e(e,r,i,n){var o=t.call(this,e)||this;return o.selected=r,o.deselected=i,o.mapBrowserEvent=n,o}return nS(e,t),e}(h),aS={};var lS=function(t){function e(e){var r,i,n=t.call(this)||this,o=e||{};if(n.boundAddFeature_=n.addFeature_.bind(n),n.boundRemoveFeature_=n.removeFeature_.bind(n),n.condition_=o.condition?o.condition:da,n.addCondition_=o.addCondition?o.addCondition:pa,n.removeCondition_=o.removeCondition?o.removeCondition:pa,n.toggleCondition_=o.toggleCondition?o.toggleCondition:ga,n.multi_=!!o.multi&&o.multi,n.filter_=o.filter?o.filter:w,n.hitTolerance_=o.hitTolerance?o.hitTolerance:0,n.style_=void 0!==o.style?o.style:(m((r=oh())[gt.POLYGON],r[gt.LINE_STRING]),m(r[gt.GEOMETRY_COLLECTION],r[gt.LINE_STRING]),function(t){return t.getGeometry()?r[t.getGeometry().getType()]:null}),n.features_=o.features||new at,o.layers)if("function"==typeof o.layers)i=o.layers;else{var s=o.layers;i=function(t){return f(s,t)}}else i=w;return n.layerFilter_=i,n.featureLayerAssociation_={},n}return nS(e,t),e.prototype.addFeatureLayerAssociation_=function(t,e){this.featureLayerAssociation_[o(t)]=e},e.prototype.getFeatures=function(){return this.features_},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.getLayer=function(t){return this.featureLayerAssociation_[o(t)]},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){this.getMap()&&this.style_&&this.features_.forEach(this.restorePreviousStyle_.bind(this)),t.prototype.setMap.call(this,e),e?(this.features_.addEventListener(rt,this.boundAddFeature_),this.features_.addEventListener(it,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(rt,this.boundAddFeature_),this.features_.removeEventListener(it,this.boundRemoveFeature_))},e.prototype.addFeature_=function(t){var e=t.element;this.style_&&this.applySelectedStyle_(e)},e.prototype.removeFeature_=function(t){var e=t.element;this.style_&&this.restorePreviousStyle_(e)},e.prototype.getStyle=function(){return this.style_},e.prototype.applySelectedStyle_=function(t){var e=o(t);e in aS||(aS[e]=t.getStyle()),t.setStyle(this.style_)},e.prototype.restorePreviousStyle_=function(t){var r=o(t),i=this.getMap().getInteractions().getArray().filter((function(r){return r instanceof e&&r.getStyle()&&-1!==r.getFeatures().getArray().indexOf(t)}));i.length>0?t.setStyle(i[i.length-1].getStyle()):(t.setStyle(aS[r]),delete aS[r])},e.prototype.removeFeatureLayerAssociation_=function(t){delete this.featureLayerAssociation_[o(t)]},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;var e=this.addCondition_(t),r=this.removeCondition_(t),i=this.toggleCondition_(t),n=!e&&!r&&!i,o=t.map,s=this.getFeatures(),a=[],l=[];if(n){C(this.featureLayerAssociation_),o.forEachFeatureAtPixel(t.pixel,function(t,e){if(this.filter_(t,e))return l.push(t),this.addFeatureLayerAssociation_(t,e),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var u=s.getLength()-1;u>=0;--u){var h=s.item(u),c=l.indexOf(h);c>-1?l.splice(c,1):(s.remove(h),a.push(h))}0!==l.length&&s.extend(l)}else{o.forEachFeatureAtPixel(t.pixel,function(t,n){if(this.filter_(t,n))return!e&&!i||f(s.getArray(),t)?(r||i)&&f(s.getArray(),t)&&(a.push(t),this.removeFeatureLayerAssociation_(t)):(l.push(t),this.addFeatureLayerAssociation_(t,n)),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var p=a.length-1;p>=0;--p)s.remove(a[p]);s.extend(l)}return(l.length>0||a.length>0)&&this.dispatchEvent(new sS(oS,l,a,t)),!0},e}(Qs),uS=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();function hS(t){return t.feature?t.feature:t.element?t.element:void 0}var cS=[],pS=function(t){function e(e){var r=this,i=e||{},n=i;return n.handleDownEvent||(n.handleDownEvent=w),n.stopDown||(n.stopDown=b),(r=t.call(this,n)||this).source_=i.source?i.source:null,r.vertex_=void 0===i.vertex||i.vertex,r.edge_=void 0===i.edge||i.edge,r.features_=i.features?i.features:null,r.featuresListenerKeys_=[],r.featureChangeListenerKeys_={},r.indexedFeaturesExtents_={},r.pendingFeatures_={},r.pixelTolerance_=void 0!==i.pixelTolerance?i.pixelTolerance:10,r.rBush_=new rc,r.SEGMENT_WRITERS_={Point:r.writePointGeometry_.bind(r),LineString:r.writeLineStringGeometry_.bind(r),LinearRing:r.writeLineStringGeometry_.bind(r),Polygon:r.writePolygonGeometry_.bind(r),MultiPoint:r.writeMultiPointGeometry_.bind(r),MultiLineString:r.writeMultiLineStringGeometry_.bind(r),MultiPolygon:r.writeMultiPolygonGeometry_.bind(r),GeometryCollection:r.writeGeometryCollectionGeometry_.bind(r),Circle:r.writeCircleGeometry_.bind(r)},r}return uS(e,t),e.prototype.addFeature=function(t,e){var r=void 0===e||e,i=o(t),n=t.getGeometry();if(n){var s=this.SEGMENT_WRITERS_[n.getType()];s&&(this.indexedFeaturesExtents_[i]=n.getExtent([1/0,1/0,-1/0,-1/0]),s(t,n))}r&&(this.featureChangeListenerKeys_[i]=W(t,O,this.handleFeatureChange_,this))},e.prototype.forEachFeatureAdd_=function(t){this.addFeature(t)},e.prototype.forEachFeatureRemove_=function(t){this.removeFeature(t)},e.prototype.getFeatures_=function(){var t;return this.features_?t=this.features_:this.source_&&(t=this.source_.getFeatures()),t},e.prototype.handleEvent=function(e){var r=this.snapTo(e.pixel,e.coordinate,e.map);return r.snapped&&(e.coordinate=r.vertex.slice(0,2),e.pixel=r.vertexPixel),t.prototype.handleEvent.call(this,e)},e.prototype.handleFeatureAdd_=function(t){var e=hS(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=hS(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var r=o(e);r in this.pendingFeatures_||(this.pendingFeatures_[r]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=E(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},e.prototype.removeFeature=function(t,e){var r=void 0===e||e,i=o(t),n=this.indexedFeaturesExtents_[i];if(n){var s=this.rBush_,a=[];s.forEachInExtent(n,(function(e){t===e.feature&&a.push(e)}));for(var l=a.length-1;l>=0;--l)s.remove(a[l])}r&&(X(this.featureChangeListenerKeys_[i]),delete this.featureChangeListenerKeys_[i])},e.prototype.setMap=function(e){var r=this.getMap(),i=this.featuresListenerKeys_,n=this.getFeatures_();r&&(i.forEach(X),i.length=0,n.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?i.push(W(this.features_,rt,this.handleFeatureAdd_,this),W(this.features_,it,this.handleFeatureRemove_,this)):this.source_&&i.push(W(this.source_,ic,this.handleFeatureAdd_,this),W(this.source_,sc,this.handleFeatureRemove_,this)),n.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,r){var i=Dt([r.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),r.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),n=this.rBush_.getInExtent(i);this.vertex_&&!this.edge_&&(n=n.filter((function(t){return t.feature.getGeometry().getType()!==gt.CIRCLE})));var o=!1,s=null,a=null;if(0===n.length)return{snapped:o,vertex:s,vertexPixel:a};for(var l,u=r.getView().getProjection(),h=Mr(e,u),c=1/0,p=0;pv?g[1]:g[0],a=r.getPixelFromCoordinate(s))}else if(this.edge_){var x=l.feature.getGeometry().getType()===gt.CIRCLE;if(x){var w=l.feature.getGeometry(),b=Or();b&&(w=w.clone().transform(b,u)),s=Lr(function(t,e){var r=e.getRadius(),i=e.getCenter(),n=i[0],o=i[1],s=t[0]-n,a=t[1]-o;0===s&&0===a&&(s=1);var l=Math.sqrt(s*s+a*a);return[n+r*s/l,o+r*a/l]}(h,w),u)}else cS[0]=Mr(g[0],u),cS[1]=Mr(g[1],u),s=Lr(tr(h,cS),u);if(ar(t,a=r.getPixelFromCoordinate(s))<=this.pixelTolerance_&&(o=!0,this.vertex_&&!x)){y=r.getPixelFromCoordinate(g[0]),m=r.getPixelFromCoordinate(g[1]),_=sr(a,y),v=sr(a,m);Math.sqrt(Math.min(_,v))<=this.pixelTolerance_&&(s=_>v?g[1]:g[0],a=r.getPixelFromCoordinate(s))}}return o&&(a=[Math.round(a[0]),Math.round(a[1])]),{snapped:o,vertex:s,vertexPixel:a}},e.prototype.updateFeature_=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},e.prototype.writeCircleGeometry_=function(t,e){var r=this.getMap().getView().getProjection(),i=e,n=Or();n&&(i=i.clone().transform(n,r));var o=Li(i);n&&o.transform(r,n);for(var s=o.getCoordinates()[0],a=0,l=s.length-1;a=0;r--){var u=o[r][0];if(Yt(new hi(u).getExtent(),new hi(a).getExtent())){o[r].push(a),l=!0;break}}l||o.push([a.reverse()])}return o}(o.rings,s);1===a.length?(n=gt.POLYGON,t=T({},t,((r={}).rings=a[0],r))):(n=gt.MULTI_POLYGON,t=T({},t,((i={}).rings=a,i)))}return Gf((0,ES[n])(t),!1,e)}function IS(t){var e=ct;return!0===t.hasZ&&!0===t.hasM?e=ft:!0===t.hasZ?e=pt:!0===t.hasM&&(e=dt),e}function OS(t){var e=t.getLayout();return{hasZ:e===pt||e===ft,hasM:e===dt||e===ft}}function LS(t,e){return(0,RS[t.getType()])(Gf(t,!0,e),e)}RS[gt.POINT]=function(t,e){var r,i=t.getCoordinates(),n=t.getLayout();n===pt?r={x:i[0],y:i[1],z:i[2]}:n===dt?r={x:i[0],y:i[1],m:i[2]}:n===ft?r={x:i[0],y:i[1],z:i[2],m:i[3]}:n===ct?r={x:i[0],y:i[1]}:lt(!1,34);return r},RS[gt.LINE_STRING]=function(t,e){var r=OS(t);return{hasZ:r.hasZ,hasM:r.hasM,paths:[t.getCoordinates()]}},RS[gt.POLYGON]=function(t,e){var r=OS(t);return{hasZ:r.hasZ,hasM:r.hasM,rings:t.getCoordinates(!1)}},RS[gt.MULTI_POINT]=function(t,e){var r=OS(t);return{hasZ:r.hasZ,hasM:r.hasM,points:t.getCoordinates()}},RS[gt.MULTI_LINE_STRING]=function(t,e){var r=OS(t);return{hasZ:r.hasZ,hasM:r.hasM,paths:t.getCoordinates()}},RS[gt.MULTI_POLYGON]=function(t,e){for(var r=OS(t),i=t.getCoordinates(!1),n=[],o=0;o=0;s--)n.push(i[o][s]);return{hasZ:r.hasZ,hasM:r.hasM,rings:n}};var MS=function(t){function e(e){var r=this,i=e||{};return(r=t.call(this)||this).geometryName_=i.geometryName,r}return CS(e,t),e.prototype.readFeatureFromObject=function(t,e,r){var i=t,n=PS(i.geometry,e),o=new ht;if(this.geometryName_&&o.setGeometryName(this.geometryName_),o.setGeometry(n),i.attributes){o.setProperties(i.attributes,!0);var s=i.attributes[r];void 0!==s&&o.setId(s)}return o},e.prototype.readFeaturesFromObject=function(t,e){var r=e||{};if(t.features){for(var i=[],n=t.features,o=0,s=n.length;o0?r[0]:null},e.prototype.readFeatureFromNode=function(t,e){return null},e.prototype.readFeatures=function(t,e){if(t){if("string"==typeof t){var r=Wl(t);return this.readFeaturesFromDocument(r,e)}return Yl(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e)}return[]},e.prototype.readFeaturesFromDocument=function(t,e){for(var r=[],i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&m(r,this.readFeaturesFromNode(i,e));return r},e.prototype.readFeaturesFromNode=function(t,e){return i()},e.prototype.readGeometry=function(t,e){if(t){if("string"==typeof t){var r=Wl(t);return this.readGeometryFromDocument(r,e)}return Yl(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e)}return null},e.prototype.readGeometryFromDocument=function(t,e){return null},e.prototype.readGeometryFromNode=function(t,e){return null},e.prototype.readProjection=function(t){if(t){if("string"==typeof t){var e=Wl(t);return this.readProjectionFromDocument(e)}return Yl(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}return null},e.prototype.readProjectionFromDocument=function(t){return this.dataProjection},e.prototype.readProjectionFromNode=function(t){return this.dataProjection},e.prototype.writeFeature=function(t,e){var r=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeFeatureNode=function(t,e){return null},e.prototype.writeFeatures=function(t,e){var r=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeFeaturesNode=function(t,e){return null},e.prototype.writeGeometry=function(t,e){var r=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeGeometryNode=function(t,e){return null},e}(Df),kS=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),NS="http://www.opengis.net/gml",jS=/^[\s\xa0]*$/,DS=function(t){function e(e){var r=t.call(this)||this,i=e||{};return r.featureType=i.featureType,r.featureNS=i.featureNS,r.srsName=i.srsName,r.schemaLocation="",r.FEATURE_COLLECTION_PARSERS={},r.FEATURE_COLLECTION_PARSERS[r.namespace]={featureMember:Xl(r.readFeaturesInternal),featureMembers:ql(r.readFeaturesInternal)},r}return kS(e,t),e.prototype.readFeaturesInternal=function(t,e){var r=t.localName,i=null;if("FeatureCollection"==r)i=iu([],this.FEATURE_COLLECTION_PARSERS,t,e,this);else if("featureMembers"==r||"featureMember"==r){var n=e[0],o=n.featureType,s=n.featureNS;if(!o&&t.childNodes){o=[],s={};for(var a=0,l=t.childNodes.length;a0){n[a]={_content_:n[a]};for(var u=0;u0:c===gt.POINT||c===gt.MULTI_POINT}}a&&(l=o.get("name"),(a=a&&!!l)&&l.search(/&[^&]+;/)>-1&&(FC||(FC=document.createElement("textarea")),FC.innerHTML=l,l=FC.value));var p=r;if(t?p=t:e&&(p=function t(e,r,i){return Array.isArray(e)?e:"string"==typeof e?(!(e in i)&&"#"+e in i&&(e="#"+e),t(i[e],r,i)):r}(e,r,i)),a){var d=function(t,e){var r=[0,0],i="start",n=t.getImage();if(n){var o=n.getImageSize();if(null===o&&(o=iC),2==o.length){var s=n.getScaleArray();r[0]=s[0]*o[0]/2,r[1]=-s[1]*o[1]/2,i="left"}}var a=t.getText();a?((a=a.clone()).setFont(a.getFont()||LC.getFont()),a.setScale(a.getScale()||LC.getScale()),a.setFill(a.getFill()||LC.getFill()),a.setStroke(a.getStroke()||IC)):a=LC.clone();return a.setText(e),a.setOffsetX(r[0]),a.setOffsetY(r[1]),a.setTextAlign(i),new ah({image:n,text:a})}(p[0],l);return u.length>0?(d.setGeometry(new wS(u)),[d,new ah({geometry:p[0].getGeometry(),image:null,fill:p[0].getFill(),stroke:p[0].getStroke(),text:null})].concat(p.slice(1))):d}return p}}(r.Style,r.styleUrl,this.defaultStyle_,this.sharedStyles_,this.showPointNames_);i.setStyle(a)}return delete r.Style,i.setProperties(r,!0),i}},e.prototype.readSharedStyle_=function(t,e){var r=t.getAttribute("id");if(null!==r){var i=uE.call(this,t,e);if(i){var n=void 0,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)n=new URL("#"+r,o).href;else n="#"+r;this.sharedStyles_[n]=i}}},e.prototype.readSharedStyleMap_=function(t,e){var r=t.getAttribute("id");if(null!==r){var i=BC.call(this,t,e);if(i){var n,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)n=new URL("#"+r,o).href;else n="#"+r;this.sharedStyles_[n]=i}}},e.prototype.readFeatureFromNode=function(t,e){if(!f(_C,t.namespaceURI))return null;var r=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return r||null},e.prototype.readFeaturesFromNode=function(t,e){if(!f(_C,t.namespaceURI))return[];var r,i=t.localName;if("Document"==i||"Folder"==i)return(r=this.readDocumentOrFolder_(t,[this.getReadOptions(t,e)]))||[];if("Placemark"==i){var n=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return n?[n]:[]}if("kml"==i){r=[];for(var o=t.firstElementChild;o;o=o.nextElementSibling){var s=this.readFeaturesFromNode(o,e);s&&m(r,s)}return r}return[]},e.prototype.readName=function(t){if(t){if("string"==typeof t){var e=Wl(t);return this.readNameFromDocument(e)}return Yl(t)?this.readNameFromDocument(t):this.readNameFromNode(t)}},e.prototype.readNameFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE){var r=this.readNameFromNode(e);if(r)return r}},e.prototype.readNameFromNode=function(t){for(var e=t.firstElementChild;e;e=e.nextElementSibling)if(f(_C,e.namespaceURI)&&"name"==e.localName)return qS(e);for(e=t.firstElementChild;e;e=e.nextElementSibling){var r=e.localName;if(f(_C,e.namespaceURI)&&("Document"==r||"Folder"==r||"Placemark"==r||"kml"==r)){var i=this.readNameFromNode(e);if(i)return i}}},e.prototype.readNetworkLinks=function(t){var e=[];if("string"==typeof t){var r=Wl(t);m(e,this.readNetworkLinksFromDocument(r))}else Yl(t)?m(e,this.readNetworkLinksFromDocument(t)):m(e,this.readNetworkLinksFromNode(t));return e},e.prototype.readNetworkLinksFromDocument=function(t){for(var e=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&m(e,this.readNetworkLinksFromNode(r));return e},e.prototype.readNetworkLinksFromNode=function(t){for(var e=[],r=t.firstElementChild;r;r=r.nextElementSibling)if(f(_C,r.namespaceURI)&&"NetworkLink"==r.localName){var i=iu({},wC,r,[]);e.push(i)}for(r=t.firstElementChild;r;r=r.nextElementSibling){var n=r.localName;!f(_C,r.namespaceURI)||"Document"!=n&&"Folder"!=n&&"kml"!=n||m(e,this.readNetworkLinksFromNode(r))}return e},e.prototype.readRegion=function(t){var e=[];if("string"==typeof t){var r=Wl(t);m(e,this.readRegionFromDocument(r))}else Yl(t)?m(e,this.readRegionFromDocument(t)):m(e,this.readRegionFromNode(t));return e},e.prototype.readRegionFromDocument=function(t){for(var e=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&m(e,this.readRegionFromNode(r));return e},e.prototype.readRegionFromNode=function(t){for(var e=[],r=t.firstElementChild;r;r=r.nextElementSibling)if(f(_C,r.namespaceURI)&&"Region"==r.localName){var i=iu({},SC,r,[]);e.push(i)}for(r=t.firstElementChild;r;r=r.nextElementSibling){var n=r.localName;!f(_C,r.namespaceURI)||"Document"!=n&&"Folder"!=n&&"kml"!=n||m(e,this.readRegionFromNode(r))}return e},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var r=Bl(_C[4],"kml"),i="http://www.w3.org/2000/xmlns/";r.setAttributeNS(i,"xmlns:gx",mC[0]),r.setAttributeNS(i,"xmlns:xsi",zl),r.setAttributeNS(zl,"xsi:schemaLocation","http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd");var n={node:r},o={};t.length>1?o.Document=t:1==t.length&&(o.Placemark=t[0]);var s=TC[r.namespaceURI],a=tu(o,s);return ou(n,CC,Ql,a,[e],s,this),r},e}(AS);function NC(t){var e=Ul(t,!1),r=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(e);if(r){var i=r[1];return[parseInt(i.substr(6,2),16),parseInt(i.substr(4,2),16),parseInt(i.substr(2,2),16),parseInt(i.substr(0,2),16)/255]}}function jC(t){for(var e,r=Ul(t,!1),i=[],n=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?))?\s*/i;e=n.exec(r);){var o=parseFloat(e[1]),s=parseFloat(e[2]),a=e[3]?parseFloat(e[3]):0;i.push(o,s,a),r=r.substr(e[0].length)}if(""===r)return i}function DC(t){var e=Ul(t,!1).trim(),r=t.baseURI;return r&&"about:blank"!=r||(r=window.location.href),r?new URL(e,r).href:e}function GC(t){return YS(t)}var zC=eu(_C,{Pair:function(t,e){var r=iu({},gE,t,e,this);if(!r)return;var i=r.key;if(i&&"normal"==i){var n=r.styleUrl;n&&(e[e.length-1]=n);var o=r.Style;o&&(e[e.length-1]=o)}}});function BC(t,e){return iu(void 0,zC,t,e,this)}var UC=eu(_C,{Icon:Kl((function(t,e){var r=iu({},JC,t,e);return r||null})),color:Kl(NC),heading:Kl(YS),hotSpot:Kl((function(t){var e,r=t.getAttribute("xunits"),i=t.getAttribute("yunits");return e="insetPixels"!==r?"insetPixels"!==i?Bu:Yu:"insetPixels"!==i?Uu:Wu,{x:parseFloat(t.getAttribute("x")),xunits:vC[r],y:parseFloat(t.getAttribute("y")),yunits:vC[i],origin:e}})),scale:Kl(GC)});var YC=eu(_C,{color:Kl(NC),scale:Kl(GC)});var WC=eu(_C,{color:Kl(NC),width:Kl(YS)});var VC=eu(_C,{color:Kl(NC),fill:Kl(zS),outline:Kl(zS)});var XC=eu(_C,{coordinates:ql(jC)});function qC(t,e){return iu(null,XC,t,e)}var ZC=eu(mC,{Track:Xl(HC)});var KC=eu(_C,{when:function(t,e){var r=e[e.length-1].whens,i=Ul(t,!1),n=Date.parse(i);r.push(isNaN(n)?0:n)}},eu(mC,{coord:function(t,e){var r=e[e.length-1].flatCoordinates,i=Ul(t,!1),n=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(i);if(n){var o=parseFloat(n[1]),s=parseFloat(n[2]),a=parseFloat(n[3]);r.push(o,s,a,0)}else r.push(0,0,0,0)}}));function HC(t,e){var r=iu({flatCoordinates:[],whens:[]},KC,t,e);if(r){for(var i=r.flatCoordinates,n=r.whens,o=0,s=Math.min(i.length,n.length);o0,h=l.href;h?i=h:u&&(i=nC);var c,p=Bu,d=r.hotSpot;d?(n=[d.x,d.y],o=d.xunits,s=d.yunits,p=d.origin):i===nC?(n=tC,o=eC,s=rC):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(i)&&(n=[.5,0],o=Gu,s=Gu);var f,g=l.x,y=l.y;void 0!==g&&void 0!==y&&(c=[g,y]);var m,_=l.w,v=l.h;void 0!==_&&void 0!==v&&(f=[_,v]);var x=r.heading;void 0!==x&&(m=Re(x));var w=r.scale,b=r.color;if(u){i==nC&&(f=iC,void 0===w&&(w=oC));var S=new th({anchor:n,anchorOrigin:p,anchorXUnits:o,anchorYUnits:s,crossOrigin:this.crossOrigin_,offset:c,offsetOrigin:Bu,rotation:m,scale:w,size:f,src:i,color:b});a.imageStyle=S}else a.imageStyle=RC}},LabelStyle:function(t,e){var r=iu({},YC,t,e);if(r){var i=e[e.length-1],n=new hh({fill:new Du({color:"color"in r?r.color:QT}),scale:r.scale});i.textStyle=n}},LineStyle:function(t,e){var r=iu({},WC,t,e);if(r){var i=e[e.length-1],n=new eh({color:"color"in r?r.color:QT,width:"width"in r?r.width:1});i.strokeStyle=n}},PolyStyle:function(t,e){var r=iu({},VC,t,e);if(r){var i=e[e.length-1],n=new Du({color:"color"in r?r.color:QT});i.fillStyle=n;var o=r.fill;void 0!==o&&(i.fill=o);var s=r.outline;void 0!==s&&(i.outline=s)}}});function uE(t,e){var r=iu({},lE,t,e,this);if(!r)return null;var i,n="fillStyle"in r?r.fillStyle:EC,o=r.fill;void 0===o||o||(n=null),"imageStyle"in r?r.imageStyle!=RC&&(i=r.imageStyle):i=PC;var s="textStyle"in r?r.textStyle:LC,a="strokeStyle"in r?r.strokeStyle:OC,l=r.outline;return void 0===l||l?[new ah({fill:n,image:i,stroke:a,text:s,zIndex:void 0})]:[new ah({geometry:function(t){var e=t.getGeometry(),r=e.getType();return r===gt.GEOMETRY_COLLECTION?new wS(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e!==gt.POLYGON&&e!==gt.MULTI_POLYGON}))):r!==gt.POLYGON&&r!==gt.MULTI_POLYGON?e:void 0},fill:n,image:i,stroke:a,text:s,zIndex:void 0}),new ah({geometry:function(t){var e=t.getGeometry(),r=e.getType();return r===gt.GEOMETRY_COLLECTION?new wS(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===gt.POLYGON||e===gt.MULTI_POLYGON}))):r===gt.POLYGON||r===gt.MULTI_POLYGON?e:void 0},fill:n,stroke:null,zIndex:void 0})]}function hE(t,e){var r,i,n,o=e.length,s=new Array(e.length),a=new Array(e.length),l=new Array(e.length);r=!1,i=!1,n=!1;for(var u=0;u0){var m=tu(n,s);ou(i,VE,qE,[{names:s,values:m}],r)}var _=r[0],v=e.getGeometry();v&&(v=Gf(v,!0,_)),ou(i,VE,NE,[v],r)}var KE=eu(_C,["extrude","tessellate","altitudeMode","coordinates"]),HE=eu(_C,{extrude:Hl(ZS),tessellate:Hl(ZS),altitudeMode:Hl(JS),coordinates:Hl((function(t,e,r){var i,n=r[r.length-1],o=n.layout,s=n.stride;o==ct||o==dt?i=2:o==pt||o==ft?i=3:lt(!1,34);var a=e.length,l="";if(a>0){l+=e[0];for(var u=1;u>1):n>>1}return e}(t),n=0,o=i.length;n=32;)e=63+(32|31&t),r+=String.fromCharCode(e),t>>=5;return e=t+63,r+=String.fromCharCode(e)}var SR=function(t){function e(e){var r=t.call(this)||this,i=e||{};return r.dataProjection=gr("EPSG:4326"),r.factor_=i.factor?i.factor:1e5,r.geometryLayout_=i.geometryLayout?i.geometryLayout:ct,r}return mR(e,t),e.prototype.readFeatureFromText=function(t,e){var r=this.readGeometryFromText(t,e);return new ht(r)},e.prototype.readFeaturesFromText=function(t,e){return[this.readFeatureFromText(t,e)]},e.prototype.readGeometryFromText=function(t,e){var r=Yr(this.geometryLayout_),i=vR(t,r,this.factor_);yR(i,0,i.length,r,i);var n=ni(i,0,i.length,r);return Gf(new Tf(n,this.geometryLayout_),!1,this.adaptOptions(e))},e.prototype.writeFeatureText=function(t,e){var r=t.getGeometry();return r?this.writeGeometryText(r,e):(lt(!1,40),"")},e.prototype.writeFeaturesText=function(t,e){return this.writeFeatureText(t[0],e)},e.prototype.writeGeometryText=function(t,e){var r=(t=Gf(t,!0,this.adaptOptions(e))).getFlatCoordinates(),i=t.getStride();return yR(r,0,r.length,i,r),_R(r,i,this.factor_)},e}(sC),TR=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),CR=function(t){function e(e){var r=t.call(this)||this,i=e||{};return r.layerName_=i.layerName,r.layers_=i.layers?i.layers:null,r.dataProjection=gr(i.dataProjection?i.dataProjection:"EPSG:4326"),r}return TR(e,t),e.prototype.readFeaturesFromObject=function(t,e){if("Topology"==t.type){var r=t,i=void 0,n=null,o=null;r.transform&&(n=(i=r.transform).scale,o=i.translate);var s=r.arcs;i&&function(t,e,r){for(var i=0,n=t.length;i0&&n.pop(),i=r>=0?e[r]:e[~r].slice().reverse(),n.push.apply(n,i);for(var a=0,l=n.length;a=2,57),i}return AR(e,t),e}(FR),NR=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),jR=function(t){function e(e){return t.call(this,"And",Array.prototype.slice.call(arguments))||this}return NR(e,t),e}(kR),DR=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),GR=function(t){function e(e,r,i){var n=t.call(this,"BBOX")||this;if(n.geometryName=e,n.extent=r,4!==r.length)throw new Error("Expected an extent with four values ([minX, minY, maxX, maxY])");return n.srsName=i,n}return DR(e,t),e}(FR),zR=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),BR=function(t){function e(e,r,i,n){var o=t.call(this,e)||this;return o.geometryName=r||"the_geom",o.geometry=i,o.srsName=n,o}return zR(e,t),e}(FR),UR=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),YR=function(t){function e(e,r,i){return t.call(this,"Contains",e,r,i)||this}return UR(e,t),e}(BR),WR=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),VR=function(t){function e(e,r){var i=t.call(this,e)||this;return i.propertyName=r,i}return WR(e,t),e}(FR),XR=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),qR=function(t){function e(e,r,i){var n=t.call(this,"During",e)||this;return n.begin=r,n.end=i,n}return XR(e,t),e}(VR),ZR=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),KR=function(t){function e(e,r,i,n){var o=t.call(this,e,r)||this;return o.expression=i,o.matchCase=n,o}return ZR(e,t),e}(VR),HR=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),JR=function(t){function e(e,r,i){return t.call(this,"PropertyIsEqualTo",e,r,i)||this}return HR(e,t),e}(KR),$R=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),QR=function(t){function e(e,r){return t.call(this,"PropertyIsGreaterThan",e,r)||this}return $R(e,t),e}(KR),tP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),eP=function(t){function e(e,r){return t.call(this,"PropertyIsGreaterThanOrEqualTo",e,r)||this}return tP(e,t),e}(KR),rP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),iP=function(t){function e(e,r,i){return t.call(this,"Intersects",e,r,i)||this}return rP(e,t),e}(BR),nP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),oP=function(t){function e(e,r,i){var n=t.call(this,"PropertyIsBetween",e)||this;return n.lowerBoundary=r,n.upperBoundary=i,n}return nP(e,t),e}(VR),sP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),aP=function(t){function e(e,r,i,n,o,s){var a=t.call(this,"PropertyIsLike",e)||this;return a.pattern=r,a.wildCard=void 0!==i?i:"*",a.singleChar=void 0!==n?n:".",a.escapeChar=void 0!==o?o:"!",a.matchCase=s,a}return sP(e,t),e}(VR),lP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),uP=function(t){function e(e){return t.call(this,"PropertyIsNull",e)||this}return lP(e,t),e}(VR),hP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),cP=function(t){function e(e,r){return t.call(this,"PropertyIsLessThan",e,r)||this}return hP(e,t),e}(KR),pP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),dP=function(t){function e(e,r){return t.call(this,"PropertyIsLessThanOrEqualTo",e,r)||this}return pP(e,t),e}(KR),fP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),gP=function(t){function e(e){var r=t.call(this,"Not")||this;return r.condition=e,r}return fP(e,t),e}(FR),yP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),mP=function(t){function e(e,r,i){return t.call(this,"PropertyIsNotEqualTo",e,r,i)||this}return yP(e,t),e}(KR),_P=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),vP=function(t){function e(e){return t.call(this,"Or",Array.prototype.slice.call(arguments))||this}return _P(e,t),e}(kR),xP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),wP=function(t){function e(e,r,i){return t.call(this,"Within",e,r,i)||this}return xP(e,t),e}(BR);function bP(t){var e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(jR,e))}function SP(t,e,r){return new GR(t,e,r)}var TP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),CP={"http://www.opengis.net/gml":{boundedBy:Kl(GS.prototype.readGeometryElement,"bounds")}},EP={"http://www.opengis.net/wfs":{totalInserted:Kl(VS),totalUpdated:Kl(VS),totalDeleted:Kl(VS)}},RP={"http://www.opengis.net/wfs":{TransactionSummary:Kl((function(t,e){return iu({},EP,t,e)}),"transactionSummary"),InsertResults:Kl((function(t,e){return iu([],NP,t,e)}),"insertIds")}},PP={"http://www.opengis.net/wfs":{PropertyName:Hl(JS)}},IP={"http://www.opengis.net/wfs":{Insert:Hl((function(t,e,r){var i=r[r.length-1],n=i.featureType,o=i.featureNS,s=i.gmlVersion,a=Bl(o,n);t.appendChild(a),2===s?aT.prototype.writeFeatureElement(a,e,r):eT.prototype.writeFeatureElement(a,e,r)})),Update:Hl((function(t,e,r){var i=r[r.length-1];lt(void 0!==e.getId(),27);var n=i.featureType,o=i.featurePrefix,s=i.featureNS,a=DP(o,n),l=e.getGeometryName();t.setAttribute("typeName",a),t.setAttributeNS(OP,"xmlns:"+o,s);var u=e.getId();if(void 0!==u){for(var h=e.getKeys(),c=[],p=0,d=h.length;p="a"&&t<="z"||t>="A"&&t<="Z"},t.prototype.isNumeric_=function(t,e){return t>="0"&&t<="9"||"."==t&&!(void 0!==e&&e)},t.prototype.isWhiteSpace_=function(t){return" "==t||"\t"==t||"\r"==t||"\n"==t},t.prototype.nextChar_=function(){return this.wkt.charAt(++this.index_)},t.prototype.nextToken=function(){var t,e=this.nextChar_(),r=this.index_,i=e;if("("==e)t=JP;else if(","==e)t=tI;else if(")"==e)t=$P;else if(this.isNumeric_(e)||"-"==e)t=QP,i=this.readNumber_();else if(this.isAlpha_(e))t=HP,i=this.readText_();else{if(this.isWhiteSpace_(e))return this.nextToken();if(""!==e)throw new Error("Unexpected character: "+e);t=eI}return{position:r,value:i,type:t}},t.prototype.readNumber_=function(){var t,e=this.index_,r=!1,i=!1;do{"."==t?r=!0:"e"!=t&&"E"!=t||(i=!0),t=this.nextChar_()}while(this.isNumeric_(t,r)||!i&&("e"==t||"E"==t)||i&&("-"==t||"+"==t));return parseFloat(this.wkt.substring(e,this.index_--))},t.prototype.readText_=function(){var t,e=this.index_;do{t=this.nextChar_()}while(this.isAlpha_(t));return this.wkt.substring(e,this.index_--).toUpperCase()},t}(),oI=function(){function t(t){this.lexer_=t,this.token_,this.layout_=ct}return t.prototype.consume_=function(){this.token_=this.lexer_.nextToken()},t.prototype.isTokenType=function(t){return this.token_.type==t},t.prototype.match=function(t){var e=this.isTokenType(t);return e&&this.consume_(),e},t.prototype.parse=function(){return this.consume_(),this.parseGeometry_()},t.prototype.parseGeometryLayout_=function(){var t=ct,e=this.token_;if(this.isTokenType(HP)){var r=e.value;"Z"===r?t=pt:"M"===r?t=dt:"ZM"===r&&(t=ft),t!==ct&&this.consume_()}return t},t.prototype.parseGeometryCollectionText_=function(){if(this.match(JP)){var t=[];do{t.push(this.parseGeometry_())}while(this.match(tI));if(this.match($P))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parsePointText_=function(){if(this.match(JP)){var t=this.parsePoint_();if(this.match($P))return t}else if(this.isEmptyGeometry_())return null;throw new Error(this.formatErrorMessage_())},t.prototype.parseLineStringText_=function(){if(this.match(JP)){var t=this.parsePointList_();if(this.match($P))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parsePolygonText_=function(){if(this.match(JP)){var t=this.parseLineStringTextList_();if(this.match($P))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiPointText_=function(){if(this.match(JP)){var t=void 0;if(t=this.token_.type==JP?this.parsePointTextList_():this.parsePointList_(),this.match($P))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiLineStringText_=function(){if(this.match(JP)){var t=this.parseLineStringTextList_();if(this.match($P))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiPolygonText_=function(){if(this.match(JP)){var t=this.parsePolygonTextList_();if(this.match($P))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parsePoint_=function(){for(var t=[],e=this.layout_.length,r=0;r0&&(e+=" "+i)}return 0===r.length?e+" EMPTY":e+"("+r+")"}var pI=sI,dI=function(){function t(){}return t.prototype.read=function(t){if(t){if("string"==typeof t){var e=Wl(t);return this.readFromDocument(e)}return Yl(t)?this.readFromDocument(t):this.readFromNode(t)}return null},t.prototype.readFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFromNode(e);return null},t.prototype.readFromNode=function(t){},t}();function fI(t){return t.getAttributeNS("http://www.w3.org/1999/xlink","href")}var gI=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),yI=[null,"http://www.opengis.net/wms"],mI=eu(yI,{Service:Kl((function(t,e){return iu({},xI,t,e)})),Capability:Kl((function(t,e){return iu({},_I,t,e)}))}),_I=eu(yI,{Request:Kl((function(t,e){return iu({},PI,t,e)})),Exception:Kl((function(t,e){return iu([],TI,t,e)})),Layer:Kl((function(t,e){return iu({},CI,t,e)}))}),vI=function(t){function e(){var e=t.call(this)||this;return e.version=void 0,e}return gI(e,t),e.prototype.readFromNode=function(t){this.version=t.getAttribute("version").trim();var e=iu({version:this.version},mI,t,[]);return e||null},e}(dI),xI=eu(yI,{Name:Kl(qS),Title:Kl(qS),Abstract:Kl(qS),KeywordList:Kl(DI),OnlineResource:Kl(fI),ContactInformation:Kl((function(t,e){return iu({},wI,t,e)})),Fees:Kl(qS),AccessConstraints:Kl(qS),LayerLimit:Kl(VS),MaxWidth:Kl(VS),MaxHeight:Kl(VS)}),wI=eu(yI,{ContactPersonPrimary:Kl((function(t,e){return iu({},bI,t,e)})),ContactPosition:Kl(qS),ContactAddress:Kl((function(t,e){return iu({},SI,t,e)})),ContactVoiceTelephone:Kl(qS),ContactFacsimileTelephone:Kl(qS),ContactElectronicMailAddress:Kl(qS)}),bI=eu(yI,{ContactPerson:Kl(qS),ContactOrganization:Kl(qS)}),SI=eu(yI,{AddressType:Kl(qS),Address:Kl(qS),City:Kl(qS),StateOrProvince:Kl(qS),PostCode:Kl(qS),Country:Kl(qS)}),TI=eu(yI,{Format:Xl(qS)}),CI=eu(yI,{Name:Kl(qS),Title:Kl(qS),Abstract:Kl(qS),KeywordList:Kl(DI),CRS:Zl(qS),EX_GeographicBoundingBox:Kl((function(t,e){var r=iu({},RI,t,e);if(!r)return;var i=r.westBoundLongitude,n=r.southBoundLatitude,o=r.eastBoundLongitude,s=r.northBoundLatitude;if(void 0===i||void 0===n||void 0===o||void 0===s)return;return[i,n,o,s]})),BoundingBox:Zl((function(t,e){var r=[WS(t.getAttribute("minx")),WS(t.getAttribute("miny")),WS(t.getAttribute("maxx")),WS(t.getAttribute("maxy"))],i=[WS(t.getAttribute("resx")),WS(t.getAttribute("resy"))];return{crs:t.getAttribute("CRS"),extent:r,res:i}})),Dimension:Zl((function(t,e){return{name:t.getAttribute("name"),units:t.getAttribute("units"),unitSymbol:t.getAttribute("unitSymbol"),default:t.getAttribute("default"),multipleValues:BS(t.getAttribute("multipleValues")),nearestValue:BS(t.getAttribute("nearestValue")),current:BS(t.getAttribute("current")),values:qS(t)}})),Attribution:Kl((function(t,e){return iu({},EI,t,e)})),AuthorityURL:Zl((function(t,e){var r=kI(t,e);if(r)return r.name=t.getAttribute("name"),r;return})),Identifier:Zl(qS),MetadataURL:Zl((function(t,e){var r=kI(t,e);if(r)return r.type=t.getAttribute("type"),r;return})),DataURL:Zl(kI),FeatureListURL:Zl(kI),Style:Zl((function(t,e){return iu({},MI,t,e)})),MinScaleDenominator:Kl(YS),MaxScaleDenominator:Kl(YS),Layer:Zl((function(t,e){var r=e[e.length-1],i=iu({},CI,t,e);if(!i)return;var n=BS(t.getAttribute("queryable"));void 0===n&&(n=r.queryable);i.queryable=void 0!==n&&n;var o=XS(t.getAttribute("cascaded"));void 0===o&&(o=r.cascaded);i.cascaded=o;var s=BS(t.getAttribute("opaque"));void 0===s&&(s=r.opaque);i.opaque=void 0!==s&&s;var a=BS(t.getAttribute("noSubsets"));void 0===a&&(a=r.noSubsets);i.noSubsets=void 0!==a&&a;var l=WS(t.getAttribute("fixedWidth"));l||(l=r.fixedWidth);i.fixedWidth=l;var u=WS(t.getAttribute("fixedHeight"));u||(u=r.fixedHeight);i.fixedHeight=u,["Style","CRS","AuthorityURL"].forEach((function(t){if(t in r){var e=i[t]||[];i[t]=e.concat(r[t])}}));return["EX_GeographicBoundingBox","BoundingBox","Dimension","Attribution","MinScaleDenominator","MaxScaleDenominator"].forEach((function(t){if(!(t in i)){var e=r[t];i[t]=e}})),i}))}),EI=eu(yI,{Title:Kl(qS),OnlineResource:Kl(fI),LogoURL:Kl(jI)}),RI=eu(yI,{westBoundLongitude:Kl(YS),eastBoundLongitude:Kl(YS),southBoundLatitude:Kl(YS),northBoundLatitude:Kl(YS)}),PI=eu(yI,{GetCapabilities:Kl(NI),GetMap:Kl(NI),GetFeatureInfo:Kl(NI)}),II=eu(yI,{Format:Zl(qS),DCPType:Zl((function(t,e){return iu({},OI,t,e)}))}),OI=eu(yI,{HTTP:Kl((function(t,e){return iu({},LI,t,e)}))}),LI=eu(yI,{Get:Kl(kI),Post:Kl(kI)}),MI=eu(yI,{Name:Kl(qS),Title:Kl(qS),Abstract:Kl(qS),LegendURL:Zl(jI),StyleSheetURL:Kl(kI),StyleURL:Kl(kI)}),FI=eu(yI,{Format:Kl(qS),OnlineResource:Kl(fI)}),AI=eu(yI,{Keyword:Xl(qS)});function kI(t,e){return iu({},FI,t,e)}function NI(t,e){return iu({},II,t,e)}function jI(t,e){var r=kI(t,e);if(r){var i=[XS(t.getAttribute("width")),XS(t.getAttribute("height"))];return r.size=i,r}}function DI(t,e){return iu([],AI,t,e)}var GI=vI,zI=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),BI=function(t){function e(e){var r=t.call(this)||this,i=e||{};return r.featureNS_="http://mapserver.gis.umn.edu/mapserver",r.gmlFormat_=new aT,r.layers_=i.layers?i.layers:null,r}return zI(e,t),e.prototype.getLayers=function(){return this.layers_},e.prototype.setLayers=function(t){this.layers_=t},e.prototype.readFeatures_=function(t,e){t.setAttribute("namespaceURI",this.featureNS_);var r=t.localName,i=[];if(0===t.childNodes.length)return i;if("msGMLOutput"==r)for(var n=0,o=t.childNodes.length;n.75*h||u>.75*c?this.resetExtent_():Yt(o,i)||this.recenter_()}}},e.prototype.resetExtent_=function(){var t=this.getMap(),e=this.ovmap_,r=t.getSize(),i=t.getView().calculateExtentInternal(r),n=e.getView(),o=Math.log(7.5)/Math.LN2;me(i,1/(.1*Math.pow(2,o/2))),n.fitInternal(Oi(i))},e.prototype.recenter_=function(){var t=this.getMap(),e=this.ovmap_,r=t.getView();e.getView().setCenterInternal(r.getCenterInternal())},e.prototype.updateBox_=function(){var t=this.getMap(),e=this.ovmap_;if(t.isRendered()&&e.isRendered()){var r=t.getSize(),i=t.getView(),n=e.getView(),o=this.rotateWithView_?0:-i.getRotation(),s=this.boxOverlay_,a=this.boxOverlay_.getElement(),l=i.getCenterInternal(),u=i.getResolution(),h=n.getResolution(),c=r[0]*u/h,p=r[1]*u/h;if(s.setPosition(l),a){a.style.width=c+"px",a.style.height=p+"px";var d="rotate("+o+"rad)";a.style.transform=d}}},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_()},e.prototype.handleToggle_=function(){this.element.classList.toggle("ol-collapsed"),this.collapsed_?Yn(this.collapseLabel_,this.label_):Yn(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;var t=this.ovmap_;if(!this.collapsed_){if(t.isRendered())return this.viewExtent_=void 0,void t.render();t.updateSize(),this.resetExtent_(),V(t,es,(function(t){this.updateBox_()}),this)}},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.getRotateWithView=function(){return this.rotateWithView_},e.prototype.setRotateWithView=function(t){this.rotateWithView_!==t&&(this.rotateWithView_=t,0!==this.getMap().getView().getRotation()&&(this.rotateWithView_?this.handleRotationChanged_():this.ovmap_.getView().setRotation(0),this.viewExtent_=void 0,this.validateExtent_(),this.updateBox_()))},e.prototype.getOverviewMap=function(){return this.ovmap_},e.prototype.render=function(t){this.validateExtent_(),this.updateBox_()},e}(Us),NO=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),jO="degrees",DO="imperial",GO="nautical",zO="metric",BO="us",UO=[1,2,5],YO=function(t){function e(e){var r=this,i=e||{},n=void 0!==i.className?i.className:i.bar?"ol-scale-bar":"ol-scale-line";return(r=t.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this).innerElement_=document.createElement("div"),r.innerElement_.className=n+"-inner",r.element.className=n+" ol-unselectable",r.element.appendChild(r.innerElement_),r.viewState_=null,r.minWidth_=void 0!==i.minWidth?i.minWidth:64,r.renderedVisible_=!1,r.renderedWidth_=void 0,r.renderedHTML_="",r.addEventListener(tt("units"),r.handleUnitsChanged_),r.setUnits(i.units||zO),r.scaleBar_=i.bar||!1,r.scaleBarSteps_=i.steps||4,r.scaleBarText_=i.text||!1,r.dpi_=i.dpi||void 0,r}return NO(e,t),e.prototype.getUnits=function(){return this.get("units")},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set("units",t)},e.prototype.setDpi=function(t){this.dpi_=t},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,r=t.projection,i=this.getUnits(),n=i==jO?_t.DEGREES:_t.METERS,o=yr(r,t.resolution,e,n),s=this.minWidth_*(this.dpi_||25.4/.28)/(25.4/.28),a=s*o,l="";if(i==jO){var u=mt[_t.DEGREES];(a*=u)=s)break;++f}d=this.scaleBar_?this.createScaleBar(c,h,l):h.toFixed(p<0?-p:0)+" "+l,this.renderedHTML_!=d&&(this.innerElement_.innerHTML=d,this.renderedHTML_=d),this.renderedWidth_!=c&&(this.innerElement_.style.width=c+"px",this.renderedWidth_=c),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.createScaleBar=function(t,e,r){for(var i="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),n=[],o=t/this.scaleBarSteps_,s="#ffffff",a=0;a
'+this.createMarker("relative",a)+(a%2==0||2===this.scaleBarSteps_?this.createStepText(a,t,!1,e,r):"")+""),a===this.scaleBarSteps_-1&&n.push(this.createStepText(a+1,t,!0,e,r)),s="#ffffff"===s?"#000000":"#ffffff";return'
'+(this.scaleBarText_?'
'+i+"
":"")+n.join("")+"
"},e.prototype.createMarker=function(t,e){return'
'},e.prototype.createStepText=function(t,e,r,i,n){var o=(0===t?0:Math.round(i/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+n);return'
'+o+"
"},e.prototype.getScaleForResolution=function(){var t=yr(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center),e=this.dpi_||25.4/.28,r=this.viewState_.projection.getMetersPerUnit();return parseFloat(t.toString())*r*39.37*e},e.prototype.render=function(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()},e}(Us),WO=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),VO=0,XO=1,qO=function(t){function e(e){var r=this,i=e||{};(r=t.call(this,{element:document.createElement("div"),render:i.render})||this).dragListenerKeys_=[],r.currentResolution_=void 0,r.direction_=VO,r.dragging_,r.heightLimit_=0,r.widthLimit_=0,r.startX_,r.startY_,r.thumbSize_=null,r.sliderInitialized_=!1,r.duration_=void 0!==i.duration?i.duration:200;var n=void 0!==i.className?i.className:"ol-zoomslider",o=document.createElement("button");o.setAttribute("type","button"),o.className=n+"-thumb ol-unselectable";var s=r.element;return s.className=n+" ol-unselectable ol-control",s.appendChild(o),s.addEventListener(Ho,r.handleDraggerStart_.bind(r),!1),s.addEventListener(Ko,r.handleDraggerDrag_.bind(r),!1),s.addEventListener(Jo,r.handleDraggerEnd_.bind(r),!1),s.addEventListener(F,r.handleContainerClick_.bind(r),!1),o.addEventListener(F,u,!1),r}return WO(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),e&&e.render()},e.prototype.initSlider_=function(){var t=this.element,e=t.offsetWidth,r=t.offsetHeight;if(0===e&&0===r)return this.sliderInitialized_=!1;var i=t.firstElementChild,n=getComputedStyle(i),o=i.offsetWidth+parseFloat(n.marginRight)+parseFloat(n.marginLeft),s=i.offsetHeight+parseFloat(n.marginTop)+parseFloat(n.marginBottom);return this.thumbSize_=[o,s],e>r?(this.direction_=XO,this.widthLimit_=e-o):(this.direction_=VO,this.heightLimit_=r-s),this.sliderInitialized_=!0},e.prototype.handleContainerClick_=function(t){var e=this.getMap().getView(),r=this.getRelativePosition_(t.offsetX-this.thumbSize_[0]/2,t.offsetY-this.thumbSize_[1]/2),i=this.getResolutionForPosition_(r),n=e.getConstrainedZoom(e.getZoomForResolution(i));e.animateInternal({zoom:n,duration:this.duration_,easing:Is})},e.prototype.handleDraggerStart_=function(t){if(!this.dragging_&&t.target===this.element.firstElementChild){var e=this.element.firstElementChild;if(this.getMap().getView().beginInteraction(),this.startX_=t.clientX-parseFloat(e.style.left),this.startY_=t.clientY-parseFloat(e.style.top),this.dragging_=!0,0===this.dragListenerKeys_.length){var r=this.handleDraggerDrag_,i=this.handleDraggerEnd_;this.dragListenerKeys_.push(W(document,Ko,r,this),W(document,Jo,i,this))}}},e.prototype.handleDraggerDrag_=function(t){if(this.dragging_){var e=t.clientX-this.startX_,r=t.clientY-this.startY_,i=this.getRelativePosition_(e,r);this.currentResolution_=this.getResolutionForPosition_(i),this.getMap().getView().setResolution(this.currentResolution_)}},e.prototype.handleDraggerEnd_=function(t){this.dragging_&&(this.getMap().getView().endInteraction(),this.dragging_=!1,this.startX_=void 0,this.startY_=void 0,this.dragListenerKeys_.forEach(X),this.dragListenerKeys_.length=0)},e.prototype.setThumbPosition_=function(t){var e=this.getPositionForResolution_(t),r=this.element.firstElementChild;this.direction_==XO?r.style.left=this.widthLimit_*e+"px":r.style.top=this.heightLimit_*e+"px"},e.prototype.getRelativePosition_=function(t,e){return we(this.direction_===XO?t/this.widthLimit_:e/this.heightLimit_,0,1)},e.prototype.getResolutionForPosition_=function(t){return this.getMap().getView().getResolutionForValueFunction()(1-t)},e.prototype.getPositionForResolution_=function(t){return we(1-this.getMap().getView().getValueForResolutionFunction()(t),0,1)},e.prototype.render=function(t){if(t.frameState&&(this.sliderInitialized_||this.initSlider_())){var e=t.frameState.viewState.resolution;this.currentResolution_=e,this.setThumbPosition_(e)}},e}(Us),ZO=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),KO=function(t){function e(e){var r=this,i=e||{};(r=t.call(this,{element:document.createElement("div"),target:i.target})||this).extent=i.extent?i.extent:null;var n=void 0!==i.className?i.className:"ol-zoom-extent",o=void 0!==i.label?i.label:"E",s=void 0!==i.tipLabel?i.tipLabel:"Fit to extent",a=document.createElement("button");a.setAttribute("type","button"),a.title=s,a.appendChild("string"==typeof o?document.createTextNode(o):o),a.addEventListener(F,r.handleClick_.bind(r),!1);var l=n+" ol-unselectable ol-control",u=r.element;return u.className=l,u.appendChild(a),r}return ZO(e,t),e.prototype.handleClick_=function(t){t.preventDefault(),this.handleZoomToExtent()},e.prototype.handleZoomToExtent=function(){var t=this.getMap().getView(),e=this.extent?this.extent:t.getProjection().getExtent();t.fitInternal(Oi(e))},e}(Us),HO={array:{},color:{},colorlike:{},control:{},coordinate:{},easing:{},events:{}};HO.events.condition={},HO.extent={},HO.featureloader={},HO.format={},HO.format.filter={},HO.geom={},HO.has={},HO.interaction={},HO.layer={},HO.loadingstrategy={},HO.proj={},HO.proj.Units={},HO.proj.proj4={},HO.render={},HO.render.canvas={},HO.renderer={},HO.renderer.canvas={},HO.renderer.webgl={},HO.size={},HO.source={},HO.sphere={},HO.style={},HO.style.IconImageCache={},HO.tilegrid={},HO.transform={},HO.util={},HO.webgl={},HO.xml={},HO.Collection=at,HO.Feature=ht,HO.Geolocation=Vi,HO.Kinetic=Xi,HO.Map=Ja,HO.Object=et,HO.Observable=K,HO.Observable.unByKey=Z,HO.Overlay=dl,HO.PluggableMap=zs,HO.View=ks,HO.array.stableSort=function(t,e){var r,i=t.length,n=Array(t.length);for(r=0;r180)&&(r[0]=Pe(i+180,360)-180),r},HO.proj.transform=Tr,HO.proj.transformExtent=Cr,HO.render.VectorContext=On,HO.render.canvas.labelCache=$n,HO.render.getRenderPixel=function(t,e){var r=e.slice(0);return St(t.inversePixelTransform.slice(),r),r},HO.render.getVectorContext=Mo,HO.render.toContext=function(t,e){var r=t.canvas,i=e||{},n=i.pixelRatio||Nn,o=i.size;o&&(r.width=o[0]*n,r.height=o[1]*n,r.style.width=o[0]+"px",r.style.height=o[1]+"px");var s=[0,0,r.width,r.height],a=Tt([1,0,0,1,0,0],n,n);return new go(t,n,s,a,0)},HO.renderer.Composite=zo,HO.renderer.canvas.ImageLayer=dp,HO.renderer.canvas.TileLayer=bp,HO.renderer.canvas.VectorImageLayer=df,HO.renderer.canvas.VectorLayer=cf,HO.renderer.canvas.VectorTileLayer=xf,HO.renderer.webgl.PointsLayer=Ed,HO.size.toSize=Ds,HO.source.BingMaps=Kh,HO.source.CartoDB=Qh,HO.source.Cluster=cc,HO.source.IIIF=Ic,HO.source.Image=Dc,HO.source.ImageArcGISRest=Bc,HO.source.ImageCanvas=Vc,HO.source.ImageMapGuide=qc,HO.source.ImageStatic=Kc,HO.source.ImageWMS=rp,HO.source.OSM=op,HO.source.OSM.ATTRIBUTION=np,HO.source.Raster=zp,HO.source.Source=Mh,HO.source.Stamen=Vp,HO.source.Tile=Nh,HO.source.TileArcGISRest=qp,HO.source.TileDebug=Hp,HO.source.TileImage=Xh,HO.source.TileJSON=$p,HO.source.TileWMS=td,HO.source.UTFGrid=id,HO.source.Vector=uc,HO.source.VectorTile=hd,HO.source.WMTS=gd,HO.source.WMTS.optionsFromCapabilities=function(t,e){var r=_(t.Contents.Layer,(function(t,r,i){return t.Identifier==e.layer}));if(null===r)return null;var i,n=t.Contents.TileMatrixSet;(i=r.TileMatrixSetLink.length>1?x(r.TileMatrixSetLink,"projection"in e?function(t,r,i){var o=_(n,(function(e){return e.Identifier==t.TileMatrixSet})).SupportedCRS,s=gr(o.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||gr(o),a=gr(e.projection);return s&&a?wr(s,a):o==e.projection}:function(t,r,i){return t.TileMatrixSet==e.matrixSet}):0)<0&&(i=0);var o=r.TileMatrixSetLink[i].TileMatrixSet,s=r.TileMatrixSetLink[i].TileMatrixSetLimits,a=r.Format[0];"format"in e&&(a=e.format),(i=x(r.Style,(function(t,r,i){return"style"in e?t.Title==e.style:t.isDefault})))<0&&(i=0);var l=r.Style[i].Identifier,u={};"Dimension"in r&&r.Dimension.forEach((function(t,e,r){var i=t.Identifier,n=t.Default;void 0===n&&(n=t.Value[0]),u[i]=n}));var h,c=_(t.Contents.TileMatrixSet,(function(t,e,r){return t.Identifier==o})),p=c.SupportedCRS;if(p&&(h=gr(p.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||gr(p)),"projection"in e){var d=gr(e.projection);d&&(h&&!wr(d,h)||(h=d))}var g="ne"==h.getAxisOrientation().substr(0,2),y=c.TileMatrix[0],m={MinTileCol:0,MinTileRow:0,MaxTileCol:y.MatrixWidth-1,MaxTileRow:y.MatrixHeight-1};s&&(m=s[s.length-1],y=_(c.TileMatrix,(function(t){return t.Identifier===m.TileMatrix})));var v=28e-5*y.ScaleDenominator/h.getMetersPerUnit(),w=g?[y.TopLeftCorner[1],y.TopLeftCorner[0]]:y.TopLeftCorner,b=y.TileWidth*v,S=y.TileHeight*v,T=[w[0]+b*m.MinTileCol,w[1]-S*(1+m.MaxTileRow),w[0]+b*(1+m.MaxTileCol),w[1]-S*m.MinTileRow];null===h.getExtent()&&h.setExtent(T);var C=Mu(c,T,s),E=[],R=e.requestEncoding;if(R=void 0!==R?R:"","OperationsMetadata"in t&&"GetTile"in t.OperationsMetadata)for(var P=t.OperationsMetadata.GetTile.DCP.HTTP.Get,I=0,O=P.length;I