aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--README.md3
-rw-r--r--docs.json1769
-rw-r--r--elm-package.json20
-rw-r--r--examples/Light.elm49
-rw-r--r--examples/elm-package.json15
-rw-r--r--generate-elm.js359
-rw-r--r--index.html7982
-rw-r--r--src/Mapbox/Expression.elm1390
-rw-r--r--src/Mapbox/Helpers.elm14
-rw-r--r--src/Mapbox/Layer.elm1399
-rw-r--r--src/Mapbox/Source.elm362
-rw-r--r--src/Mapbox/Style.elm220
13 files changed, 13584 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..02e94ce
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+elm-stuff/
+.DS_Store
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..968034b
--- /dev/null
+++ b/README.md
@@ -0,0 +1,3 @@
+# elm-markdown
+
+MapboxGl.js bindings for elm. More to come.
diff --git a/docs.json b/docs.json
new file mode 100644
index 0000000..8c0265a
--- /dev/null
+++ b/docs.json
@@ -0,0 +1,1769 @@
+[
+ {
+ "name": "Mapbox.Style",
+ "comment": " A Mapbox style is a document that defines the visual appearance of a map: what data to draw, the order to draw it in, and how to style the data when drawing it. A style document is a JSON object with specific root level and nested properties. This specification defines and describes these properties.\n\n@docs Style, encode\n\n\n### Light\n\n@docs Light, defaultLight\n\n\n### Transition\n\n@docs Transition, defaultTransition\n\n\n### Misc Attributes\n\n@docs MiscAttr, sprite, glyphs, name, defaultCenter, defaultZoomLevel, defaultBearing, defaultPitch, metadata\n\n",
+ "aliases": [
+ {
+ "name": "Light",
+ "comment": " The global light source.\n\n\n#### `anchor`\n\nWhether extruded geometries are lit relative to the map or viewport.\n\n\n### `position`\n\nPosition 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 the `anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `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).\n\n\n### `color`\n\nColor tint for lighting extruded geometries.\n\n\n### `intensity`\n\nIntensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.\n\n",
+ "args": [],
+ "type": "{ anchor : Mapbox.Expression.Anchor , position : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression (Array.Array Float) , color : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.Color , intensity : Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Float }"
+ },
+ {
+ "name": "Style",
+ "comment": " This is the core representation of a Mapbox style. It has the following keys:\n\n\n### Layers\n\nThese define what is actually rendered on screen. See the Mapbox.Layer module on how to configure these.\n\n\n### Sources\n\nThese define the data sources that feed the Layers. See the Mapbox.Source module for more.\n\n\n### Misc\n\nThese are all optional attributes.\n\nAll the other keys are values defined below.\n\n",
+ "args": [],
+ "type": "{ transition : Mapbox.Style.Transition , light : Mapbox.Style.Light , layers : List Mapbox.Layer.Layer , sources : List Mapbox.Source.Source , misc : List Mapbox.Style.MiscAttr }"
+ },
+ {
+ "name": "Transition",
+ "comment": " A transition property controls timing for the interpolation between a transitionable style property's previous value and new value.\n\n\n### `duration`\n\nTime (in ms) allotted for transitions to complete.\n\n\n### `delay`\n\nLength of time (in ms) before a transition begins.\n\n",
+ "args": [],
+ "type": "{ duration : Int, delay : Int }"
+ }
+ ],
+ "types": [
+ {
+ "name": "MiscAttr",
+ "comment": " ",
+ "args": [],
+ "cases": []
+ }
+ ],
+ "values": [
+ {
+ "name": "defaultBearing",
+ "comment": " 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).\n",
+ "type": "Float -> Mapbox.Style.MiscAttr"
+ },
+ {
+ "name": "defaultCenter",
+ "comment": " 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).\n",
+ "type": "Float -> Float -> Mapbox.Style.MiscAttr"
+ },
+ {
+ "name": "defaultLight",
+ "comment": " A decent default light.\n",
+ "type": "Mapbox.Style.Light"
+ },
+ {
+ "name": "defaultPitch",
+ "comment": " 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).\n",
+ "type": "Float -> Mapbox.Style.MiscAttr"
+ },
+ {
+ "name": "defaultTransition",
+ "comment": " The defaults for a transition\n",
+ "type": "Mapbox.Style.Transition"
+ },
+ {
+ "name": "defaultZoomLevel",
+ "comment": " 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).\n",
+ "type": "Float -> Mapbox.Style.MiscAttr"
+ },
+ {
+ "name": "encode",
+ "comment": " Encodes the style into JSON.\n",
+ "type": "Mapbox.Style.Style -> Json.Encode.Value"
+ },
+ {
+ "name": "glyphs",
+ "comment": " 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 `textField` layout property.\n",
+ "type": "String -> Mapbox.Style.MiscAttr"
+ },
+ {
+ "name": "metadata",
+ "comment": " Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'.\n",
+ "type": "List ( String, Json.Encode.Value ) -> Mapbox.Style.MiscAttr"
+ },
+ {
+ "name": "name",
+ "comment": " A human-readable name for the style.\n",
+ "type": "String -> Mapbox.Style.MiscAttr"
+ },
+ {
+ "name": "sprite",
+ "comment": " 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 `backgroundPattern`, `fillPattern`, `linePattern`, `fillExtrusionPattern`, or `iconImage` properties.\n",
+ "type": "String -> Mapbox.Style.MiscAttr"
+ }
+ ],
+ "generated-with-elm-version": "0.18.0"
+ },
+ {
+ "name": "Mapbox.Layer",
+ "comment": " Layers specify what is actually rendered on the map and are rendered in order.\n\nExcept for layers of the background type, each layer needs to refer to a source. Layers take the data that they get from a source, optionally filter features, and then define how those features are styled.\n\nThere are two kinds of properties: *Layout* and *Paint* properties.\n\nLayout properties are applied early in the rendering process and define how data for that layer is passed to the GPU. Changes to a layout property require an asynchronous \"layout\" step.\n\nPaint properties are applied later in the rendering process. Changes to a paint property are cheap and happen synchronously.\n\n\n### Working with layers\n\n@docs Layer, SourceId, encode\n\n\n### Layer Types\n\n@docs background, fill, symbol, line, raster, circle, fillExtrusion, heatmap, hillshade\n@docs Background, Fill, Symbol, Line, Raster, Circle, FillExtrusion, Heatmap, Hillshade\n\n\n### General Attributes\n\n@docs LayerAttr\n@docs metadata, sourceLayer, minzoom, maxzoom, filter, visible\n\n\n### Fill Attributes\n\n@docs fillAntialias, fillColor, fillOpacity, fillOutlineColor, fillPattern, fillTranslate, fillTranslateAnchor\n\n\n### Line Attributes\n\n@docs lineBlur, lineCap, lineColor, lineDasharray, lineGapWidth, lineGradient, lineJoin, lineMiterLimit, lineOffset, lineOpacity, linePattern, lineRoundLimit, lineTranslate, lineTranslateAnchor, lineWidth\n\n\n### Circle Attributes\n\n@docs circleBlur, circleColor, circleOpacity, circlePitchAlignment, circlePitchScale, circleRadius, circleStrokeColor, circleStrokeOpacity, circleStrokeWidth, circleTranslate, circleTranslateAnchor\n\n\n### Heatmap Attributes\n\n@docs heatmapColor, heatmapIntensity, heatmapOpacity, heatmapRadius, heatmapWeight\n\n\n### FillExtrusion Attributes\n\n@docs fillExtrusionBase, fillExtrusionColor, fillExtrusionHeight, fillExtrusionOpacity, fillExtrusionPattern, fillExtrusionTranslate, fillExtrusionTranslateAnchor\n\n\n### Symbol Attributes\n\n@docs iconAllowOverlap, iconAnchor, iconColor, iconHaloBlur, iconHaloColor, iconHaloWidth, iconIgnorePlacement, iconImage, iconKeepUpright, iconOffset, iconOpacity, iconOptional, iconPadding, iconPitchAlignment, iconRotate, iconRotationAlignment, iconSize, iconTextFit, iconTextFitPadding, iconTranslate, iconTranslateAnchor, symbolAvoidEdges, symbolPlacement, symbolSpacing, textAllowOverlap, textAnchor, textColor, textField, textFont, textHaloBlur, textHaloColor, textHaloWidth, textIgnorePlacement, textJustify, textKeepUpright, textLetterSpacing, textLineHeight, textMaxAngle, textMaxWidth, textOffset, textOpacity, textOptional, textPadding, textPitchAlignment, textRotate, textRotationAlignment, textSize, textTransform, textTranslate, textTranslateAnchor\n\n\n### Raster Attributes\n\n@docs rasterBrightnessMax, rasterBrightnessMin, rasterContrast, rasterFadeDuration, rasterHueRotate, rasterOpacity, rasterSaturation\n\n\n### Hillshade Attributes\n\n@docs hillshadeAccentColor, hillshadeExaggeration, hillshadeHighlightColor, hillshadeIlluminationAnchor, hillshadeIlluminationDirection, hillshadeShadowColor\n\n\n### Background Attributes\n\n@docs backgroundColor, backgroundOpacity, backgroundPattern\n\n",
+ "aliases": [
+ {
+ "name": "SourceId",
+ "comment": " All layers (except background layers) need a source\n",
+ "args": [],
+ "type": "String"
+ }
+ ],
+ "types": [
+ {
+ "name": "Background",
+ "comment": " ",
+ "args": [],
+ "cases": []
+ },
+ {
+ "name": "Circle",
+ "comment": " ",
+ "args": [],
+ "cases": []
+ },
+ {
+ "name": "Fill",
+ "comment": " ",
+ "args": [],
+ "cases": []
+ },
+ {
+ "name": "FillExtrusion",
+ "comment": " ",
+ "args": [],
+ "cases": []
+ },
+ {
+ "name": "Heatmap",
+ "comment": " ",
+ "args": [],
+ "cases": []
+ },
+ {
+ "name": "Hillshade",
+ "comment": " ",
+ "args": [],
+ "cases": []
+ },
+ {
+ "name": "Layer",
+ "comment": " Represents a layer.\n",
+ "args": [],
+ "cases": []
+ },
+ {
+ "name": "LayerAttr",
+ "comment": " ",
+ "args": [
+ "tipe"
+ ],
+ "cases": []
+ },
+ {
+ "name": "Line",
+ "comment": " ",
+ "args": [],
+ "cases": []
+ },
+ {
+ "name": "Raster",
+ "comment": " ",
+ "args": [],
+ "cases": []
+ },
+ {
+ "name": "Symbol",
+ "comment": " ",
+ "args": [],
+ "cases": []
+ }
+ ],
+ "values": [
+ {
+ "name": "background",
+ "comment": " The background color or pattern of the map.\n",
+ "type": "String -> List (Mapbox.Layer.LayerAttr Mapbox.Layer.Background) -> Mapbox.Layer.Layer"
+ },
+ {
+ "name": "backgroundColor",
+ "comment": " The color with which the background will be drawn. Paint property. Defaults to `#000000`. Disabled by `backgroundPattern`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.Color -> Mapbox.Layer.LayerAttr Mapbox.Layer.Background"
+ },
+ {
+ "name": "backgroundOpacity",
+ "comment": " The opacity at which the background will be drawn. Paint property.\n\nShould be between `0` and `1` inclusive. Defaults to `1`.\n\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Background"
+ },
+ {
+ "name": "backgroundPattern",
+ "comment": " 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. Paint property.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression String -> Mapbox.Layer.LayerAttr Mapbox.Layer.Background"
+ },
+ {
+ "name": "circle",
+ "comment": " A filled circle.\n",
+ "type": "String -> Mapbox.Layer.SourceId -> List (Mapbox.Layer.LayerAttr Mapbox.Layer.Circle) -> Mapbox.Layer.Layer"
+ },
+ {
+ "name": "circleBlur",
+ "comment": " Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity. Paint property. Defaults to `0`.\n",
+ "type": "Mapbox.Expression.Expression any Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Circle"
+ },
+ {
+ "name": "circleColor",
+ "comment": " The fill color of the circle. Paint property. Defaults to `#000000`.\n",
+ "type": "Mapbox.Expression.Expression any Mapbox.Expression.Color -> Mapbox.Layer.LayerAttr Mapbox.Layer.Circle"
+ },
+ {
+ "name": "circleOpacity",
+ "comment": " The opacity at which the circle will be drawn. Paint property.\n\nShould be between `0` and `1` inclusive. Defaults to `1`.\n\n",
+ "type": "Mapbox.Expression.Expression any Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Circle"
+ },
+ {
+ "name": "circlePitchAlignment",
+ "comment": " Orientation of circle when map is pitched. Paint property. Defaults to `viewport`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.Anchor -> Mapbox.Layer.LayerAttr Mapbox.Layer.Circle"
+ },
+ {
+ "name": "circlePitchScale",
+ "comment": " Controls the scaling behavior of the circle when the map is pitched. Paint property. Defaults to `map`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.Anchor -> Mapbox.Layer.LayerAttr Mapbox.Layer.Circle"
+ },
+ {
+ "name": "circleRadius",
+ "comment": " Circle radius. Paint property.\n\nShould be greater than or equal to `0`.\nUnits in pixels. Defaults to `5`.\n\n",
+ "type": "Mapbox.Expression.Expression any Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Circle"
+ },
+ {
+ "name": "circleStrokeColor",
+ "comment": " The stroke color of the circle. Paint property. Defaults to `#000000`.\n",
+ "type": "Mapbox.Expression.Expression any Mapbox.Expression.Color -> Mapbox.Layer.LayerAttr Mapbox.Layer.Circle"
+ },
+ {
+ "name": "circleStrokeOpacity",
+ "comment": " The opacity of the circle's stroke. Paint property.\n\nShould be between `0` and `1` inclusive. Defaults to `1`.\n\n",
+ "type": "Mapbox.Expression.Expression any Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Circle"
+ },
+ {
+ "name": "circleStrokeWidth",
+ "comment": " The width of the circle's stroke. Strokes are placed outside of the `circleRadius`. Paint property.\n\nShould be greater than or equal to `0`.\nUnits in pixels. Defaults to `0`.\n\n",
+ "type": "Mapbox.Expression.Expression any Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Circle"
+ },
+ {
+ "name": "circleTranslate",
+ "comment": " The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. Paint property.\nUnits in pixels. Defaults to `0,0`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression (Array.Array Float) -> Mapbox.Layer.LayerAttr Mapbox.Layer.Circle"
+ },
+ {
+ "name": "circleTranslateAnchor",
+ "comment": " Controls the frame of reference for `circleTranslate`. Paint property. Defaults to `map`. Requires `circleTranslate`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.Anchor -> Mapbox.Layer.LayerAttr Mapbox.Layer.Circle"
+ },
+ {
+ "name": "encode",
+ "comment": " Turns a layer into JSON\n",
+ "type": "Mapbox.Layer.Layer -> Json.Encode.Value"
+ },
+ {
+ "name": "fill",
+ "comment": " A filled polygon with an optional stroked border.\n",
+ "type": "String -> Mapbox.Layer.SourceId -> List (Mapbox.Layer.LayerAttr Mapbox.Layer.Fill) -> Mapbox.Layer.Layer"
+ },
+ {
+ "name": "fillAntialias",
+ "comment": " Whether or not the fill should be antialiased. Paint property. Defaults to `true`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Bool -> Mapbox.Layer.LayerAttr Mapbox.Layer.Fill"
+ },
+ {
+ "name": "fillColor",
+ "comment": " 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. Paint property. Defaults to `#000000`. Disabled by `fillPattern`.\n",
+ "type": "Mapbox.Expression.Expression any Mapbox.Expression.Color -> Mapbox.Layer.LayerAttr Mapbox.Layer.Fill"
+ },
+ {
+ "name": "fillExtrusion",
+ "comment": " An extruded (3D) polygon.\n",
+ "type": "String -> Mapbox.Layer.SourceId -> List (Mapbox.Layer.LayerAttr Mapbox.Layer.FillExtrusion) -> Mapbox.Layer.Layer"
+ },
+ {
+ "name": "fillExtrusionBase",
+ "comment": " The height with which to extrude the base of this layer. Must be less than or equal to `fillExtrusionHeight`. Paint property.\n\nShould be greater than or equal to `0`.\nUnits in meters. Defaults to `0`. Requires `fillExtrusionHeight`.\n\n",
+ "type": "Mapbox.Expression.Expression any Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.FillExtrusion"
+ },
+ {
+ "name": "fillExtrusionColor",
+ "comment": " 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 `fillExtrusionOpacity` to set layer opacity. Paint property. Defaults to `#000000`. Disabled by `fillExtrusionPattern`.\n",
+ "type": "Mapbox.Expression.Expression any Mapbox.Expression.Color -> Mapbox.Layer.LayerAttr Mapbox.Layer.FillExtrusion"
+ },
+ {
+ "name": "fillExtrusionHeight",
+ "comment": " The height with which to extrude this layer. Paint property.\n\nShould be greater than or equal to `0`.\nUnits in meters. Defaults to `0`.\n\n",
+ "type": "Mapbox.Expression.Expression any Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.FillExtrusion"
+ },
+ {
+ "name": "fillExtrusionOpacity",
+ "comment": " 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. Paint property.\n\nShould be between `0` and `1` inclusive. Defaults to `1`.\n\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.FillExtrusion"
+ },
+ {
+ "name": "fillExtrusionPattern",
+ "comment": " 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. Paint property.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression String -> Mapbox.Layer.LayerAttr Mapbox.Layer.FillExtrusion"
+ },
+ {
+ "name": "fillExtrusionTranslate",
+ "comment": " The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively. Paint property.\nUnits in pixels. Defaults to `0,0`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression (Array.Array Float) -> Mapbox.Layer.LayerAttr Mapbox.Layer.FillExtrusion"
+ },
+ {
+ "name": "fillExtrusionTranslateAnchor",
+ "comment": " Controls the frame of reference for `fillExtrusionTranslate`. Paint property. Defaults to `map`. Requires `fillExtrusionTranslate`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.Anchor -> Mapbox.Layer.LayerAttr Mapbox.Layer.FillExtrusion"
+ },
+ {
+ "name": "fillOpacity",
+ "comment": " The opacity of the entire fill layer. In contrast to the `fillColor`, this value will also affect the 1px stroke around the fill, if the stroke is used. Paint property.\n\nShould be between `0` and `1` inclusive. Defaults to `1`.\n\n",
+ "type": "Mapbox.Expression.Expression any Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Fill"
+ },
+ {
+ "name": "fillOutlineColor",
+ "comment": " The outline color of the fill. Matches the value of `fillColor` if unspecified. Paint property. Disabled by `fillPattern`. Requires `fillAntialias` to be `true`.\n",
+ "type": "Mapbox.Expression.Expression any Mapbox.Expression.Color -> Mapbox.Layer.LayerAttr Mapbox.Layer.Fill"
+ },
+ {
+ "name": "fillPattern",
+ "comment": " 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. Paint property.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression String -> Mapbox.Layer.LayerAttr Mapbox.Layer.Fill"
+ },
+ {
+ "name": "fillTranslate",
+ "comment": " The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. Paint property.\nUnits in pixels. Defaults to `0,0`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression (Array.Array Float) -> Mapbox.Layer.LayerAttr Mapbox.Layer.Fill"
+ },
+ {
+ "name": "fillTranslateAnchor",
+ "comment": " Controls the frame of reference for `fillTranslate`. Paint property. Defaults to `map`. Requires `fillTranslate`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.Anchor -> Mapbox.Layer.LayerAttr Mapbox.Layer.Fill"
+ },
+ {
+ "name": "filter",
+ "comment": " A expression specifying conditions on source features. Only features that match the filter are displayed.\n",
+ "type": "Mapbox.Expression.Expression any Bool -> Mapbox.Layer.LayerAttr all"
+ },
+ {
+ "name": "heatmap",
+ "comment": " A heatmap.\n",
+ "type": "String -> Mapbox.Layer.SourceId -> List (Mapbox.Layer.LayerAttr Mapbox.Layer.Heatmap) -> Mapbox.Layer.Layer"
+ },
+ {
+ "name": "heatmapColor",
+ "comment": " Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `[\"heatmap-density\"]` as input. Paint property. Defaults to `interpolate,linear,heatmap-density,0,rgba(0, 0, 255, 0),0.1,royalblue,0.3,cyan,0.5,lime,0.7,yellow,1,red`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.Color -> Mapbox.Layer.LayerAttr Mapbox.Layer.Heatmap"
+ },
+ {
+ "name": "heatmapIntensity",
+ "comment": " Similar to `heatmapWeight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level. Paint property.\n\nShould be greater than or equal to `0`. Defaults to `1`.\n\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Heatmap"
+ },
+ {
+ "name": "heatmapOpacity",
+ "comment": " The global opacity at which the heatmap layer will be drawn. Paint property.\n\nShould be between `0` and `1` inclusive. Defaults to `1`.\n\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Heatmap"
+ },
+ {
+ "name": "heatmapRadius",
+ "comment": " Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed. Paint property.\n\nShould be greater than or equal to `1`.\nUnits in pixels. Defaults to `30`.\n\n",
+ "type": "Mapbox.Expression.Expression any Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Heatmap"
+ },
+ {
+ "name": "heatmapWeight",
+ "comment": " 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. Paint property.\n\nShould be greater than or equal to `0`. Defaults to `1`.\n\n",
+ "type": "Mapbox.Expression.Expression any Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Heatmap"
+ },
+ {
+ "name": "hillshade",
+ "comment": " Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.\n",
+ "type": "String -> Mapbox.Layer.SourceId -> List (Mapbox.Layer.LayerAttr Mapbox.Layer.Hillshade) -> Mapbox.Layer.Layer"
+ },
+ {
+ "name": "hillshadeAccentColor",
+ "comment": " The shading color used to accentuate rugged terrain like sharp cliffs and gorges. Paint property. Defaults to `#000000`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.Color -> Mapbox.Layer.LayerAttr Mapbox.Layer.Hillshade"
+ },
+ {
+ "name": "hillshadeExaggeration",
+ "comment": " Intensity of the hillshade Paint property.\n\nShould be between `0` and `1` inclusive. Defaults to `0.5`.\n\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Hillshade"
+ },
+ {
+ "name": "hillshadeHighlightColor",
+ "comment": " The shading color of areas that faces towards the light source. Paint property. Defaults to `#FFFFFF`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.Color -> Mapbox.Layer.LayerAttr Mapbox.Layer.Hillshade"
+ },
+ {
+ "name": "hillshadeIlluminationAnchor",
+ "comment": " Direction of light source when map is rotated. Paint property. Defaults to `viewport`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.Anchor -> Mapbox.Layer.LayerAttr Mapbox.Layer.Hillshade"
+ },
+ {
+ "name": "hillshadeIlluminationDirection",
+ "comment": " The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshadeIlluminationAnchor` is set to `viewport` and due north if `hillshadeIlluminationAnchor` is set to `map`. Paint property.\n\nShould be between `0` and `359` inclusive. Defaults to `335`.\n\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Hillshade"
+ },
+ {
+ "name": "hillshadeShadowColor",
+ "comment": " The shading color of areas that face away from the light source. Paint property. Defaults to `#000000`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.Color -> Mapbox.Layer.LayerAttr Mapbox.Layer.Hillshade"
+ },
+ {
+ "name": "iconAllowOverlap",
+ "comment": " If true, the icon will be visible even if it collides with other previously drawn symbols. Layout property. Defaults to `false`. Requires `iconImage`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Bool -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "iconAnchor",
+ "comment": " Part of the icon placed closest to the anchor. Layout property. Defaults to `center`. Requires `iconImage`.\n",
+ "type": "Mapbox.Expression.Expression any Mapbox.Expression.Position -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "iconColor",
+ "comment": " The color of the icon. This can only be used with sdf icons. Paint property. Defaults to `#000000`. Requires `iconImage`.\n",
+ "type": "Mapbox.Expression.Expression any Mapbox.Expression.Color -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "iconHaloBlur",
+ "comment": " Fade out the halo towards the outside. Paint property.\n\nShould be greater than or equal to `0`.\nUnits in pixels. Defaults to `0`. Requires `iconImage`.\n\n",
+ "type": "Mapbox.Expression.Expression any Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "iconHaloColor",
+ "comment": " The color of the icon's halo. Icon halos can only be used with SDF icons. Paint property. Defaults to `rgba(0, 0, 0, 0)`. Requires `iconImage`.\n",
+ "type": "Mapbox.Expression.Expression any Mapbox.Expression.Color -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "iconHaloWidth",
+ "comment": " Distance of halo to the icon outline. Paint property.\n\nShould be greater than or equal to `0`.\nUnits in pixels. Defaults to `0`. Requires `iconImage`.\n\n",
+ "type": "Mapbox.Expression.Expression any Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "iconIgnorePlacement",
+ "comment": " If true, other symbols can be visible even if they collide with the icon. Layout property. Defaults to `false`. Requires `iconImage`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Bool -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "iconImage",
+ "comment": " Name of image in sprite to use for drawing an image background. Layout property.\n",
+ "type": "Mapbox.Expression.Expression any String -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "iconKeepUpright",
+ "comment": " If true, the icon may be flipped to prevent it from being rendered upside-down. Layout property. Defaults to `false`. Requires `iconImage`. Requires `iconRotationAlignment` to be `map`. Requires `symbolPlacement` to be `line`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Bool -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "iconOffset",
+ "comment": " 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 `iconSize` to obtain the final offset in pixels. When combined with `iconRotate` the offset will be as if the rotated direction was up. Layout property. Defaults to `0,0`. Requires `iconImage`.\n",
+ "type": "Mapbox.Expression.Expression any (Array.Array Float) -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "iconOpacity",
+ "comment": " The opacity at which the icon will be drawn. Paint property.\n\nShould be between `0` and `1` inclusive. Defaults to `1`. Requires `iconImage`.\n\n",
+ "type": "Mapbox.Expression.Expression any Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "iconOptional",
+ "comment": " If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not. Layout property. Defaults to `false`. Requires `iconImage`. Requires `textField`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Bool -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "iconPadding",
+ "comment": " Size of the additional area around the icon bounding box used for detecting symbol collisions. Layout property.\n\nShould be greater than or equal to `0`.\nUnits in pixels. Defaults to `2`. Requires `iconImage`.\n\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "iconPitchAlignment",
+ "comment": " Orientation of icon when map is pitched. Layout property. Defaults to `auto`. Requires `iconImage`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.AnchorAuto -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "iconRotate",
+ "comment": " Rotates the icon clockwise. Layout property.\nUnits in degrees. Defaults to `0`. Requires `iconImage`.\n",
+ "type": "Mapbox.Expression.Expression any Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "iconRotationAlignment",
+ "comment": " In combination with `symbolPlacement`, determines the rotation behavior of icons. Layout property. Defaults to `auto`. Requires `iconImage`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.AnchorAuto -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "iconSize",
+ "comment": " 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 `iconSize`. 1 is the original size; 3 triples the size of the image. Layout property.\n\nShould be greater than or equal to `0`.\nUnits in factor of the original icon size. Defaults to `1`. Requires `iconImage`.\n\n",
+ "type": "Mapbox.Expression.Expression any Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "iconTextFit",
+ "comment": " Scales the icon to fit around the associated text. Layout property. Defaults to `none`. Requires `iconImage`. Requires `textField`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.TextFit -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "iconTextFitPadding",
+ "comment": " Size of the additional area added to dimensions determined by `iconTextFit`, in clockwise order: top, right, bottom, left. Layout property.\nUnits in pixels. Defaults to `0,0,0,0`. Requires `iconImage`. Requires `textField`. Requires `iconTextFit` to be both,, or ,width,, or ,height.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression (Array.Array Float) -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "iconTranslate",
+ "comment": " 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. Paint property.\nUnits in pixels. Defaults to `0,0`. Requires `iconImage`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression (Array.Array Float) -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "iconTranslateAnchor",
+ "comment": " Controls the frame of reference for `iconTranslate`. Paint property. Defaults to `map`. Requires `iconImage`. Requires `iconTranslate`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.Anchor -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "line",
+ "comment": " A stroked line.\n",
+ "type": "String -> Mapbox.Layer.SourceId -> List (Mapbox.Layer.LayerAttr Mapbox.Layer.Line) -> Mapbox.Layer.Layer"
+ },
+ {
+ "name": "lineBlur",
+ "comment": " Blur applied to the line, in pixels. Paint property.\n\nShould be greater than or equal to `0`.\nUnits in pixels. Defaults to `0`.\n\n",
+ "type": "Mapbox.Expression.Expression any Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Line"
+ },
+ {
+ "name": "lineCap",
+ "comment": " The display of line endings. Layout property. Defaults to `butt`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.LineCap -> Mapbox.Layer.LayerAttr Mapbox.Layer.Line"
+ },
+ {
+ "name": "lineColor",
+ "comment": " The color with which the line will be drawn. Paint property. Defaults to `#000000`. Disabled by `linePattern`.\n",
+ "type": "Mapbox.Expression.Expression any Mapbox.Expression.Color -> Mapbox.Layer.LayerAttr Mapbox.Layer.Line"
+ },
+ {
+ "name": "lineDasharray",
+ "comment": " 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. Paint property.\n\nShould be greater than or equal to `0`.\nUnits in line widths. Disabled by `linePattern`.\n\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression (Array.Array Float) -> Mapbox.Layer.LayerAttr Mapbox.Layer.Line"
+ },
+ {
+ "name": "lineGapWidth",
+ "comment": " Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap. Paint property.\n\nShould be greater than or equal to `0`.\nUnits in pixels. Defaults to `0`.\n\n",
+ "type": "Mapbox.Expression.Expression any Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Line"
+ },
+ {
+ "name": "lineGradient",
+ "comment": " Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `\"lineMetrics\": true`. Paint property. Disabled by `lineDasharray`. Disabled by `linePattern`. Requires `source` to be `geojson`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.Color -> Mapbox.Layer.LayerAttr Mapbox.Layer.Line"
+ },
+ {
+ "name": "lineJoin",
+ "comment": " The display of lines when joining. Layout property. Defaults to `miter`.\n",
+ "type": "Mapbox.Expression.Expression any Mapbox.Expression.LineJoin -> Mapbox.Layer.LayerAttr Mapbox.Layer.Line"
+ },
+ {
+ "name": "lineMiterLimit",
+ "comment": " Used to automatically convert miter joins to bevel joins for sharp angles. Layout property. Defaults to `2`. Requires `lineJoin` to be `miter`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Line"
+ },
+ {
+ "name": "lineOffset",
+ "comment": " 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. Paint property.\nUnits in pixels. Defaults to `0`.\n",
+ "type": "Mapbox.Expression.Expression any Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Line"
+ },
+ {
+ "name": "lineOpacity",
+ "comment": " The opacity at which the line will be drawn. Paint property.\n\nShould be between `0` and `1` inclusive. Defaults to `1`.\n\n",
+ "type": "Mapbox.Expression.Expression any Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Line"
+ },
+ {
+ "name": "linePattern",
+ "comment": " 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. Paint property.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression String -> Mapbox.Layer.LayerAttr Mapbox.Layer.Line"
+ },
+ {
+ "name": "lineRoundLimit",
+ "comment": " Used to automatically convert round joins to miter joins for shallow angles. Layout property. Defaults to `1.05`. Requires `lineJoin` to be `round`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Line"
+ },
+ {
+ "name": "lineTranslate",
+ "comment": " The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. Paint property.\nUnits in pixels. Defaults to `0,0`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression (Array.Array Float) -> Mapbox.Layer.LayerAttr Mapbox.Layer.Line"
+ },
+ {
+ "name": "lineTranslateAnchor",
+ "comment": " Controls the frame of reference for `lineTranslate`. Paint property. Defaults to `map`. Requires `lineTranslate`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.Anchor -> Mapbox.Layer.LayerAttr Mapbox.Layer.Line"
+ },
+ {
+ "name": "lineWidth",
+ "comment": " Stroke thickness. Paint property.\n\nShould be greater than or equal to `0`.\nUnits in pixels. Defaults to `1`.\n\n",
+ "type": "Mapbox.Expression.Expression any Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Line"
+ },
+ {
+ "name": "maxzoom",
+ "comment": " The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden. A number between 0 and 24 inclusive.\n",
+ "type": "Float -> Mapbox.Layer.LayerAttr all"
+ },
+ {
+ "name": "metadata",
+ "comment": " Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'.\n",
+ "type": "Json.Encode.Value -> Mapbox.Layer.LayerAttr all"
+ },
+ {
+ "name": "minzoom",
+ "comment": " The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden. A number between 0 and 24 inclusive.\n",
+ "type": "Float -> Mapbox.Layer.LayerAttr all"
+ },
+ {
+ "name": "raster",
+ "comment": " Raster map textures such as satellite imagery.\n",
+ "type": "String -> Mapbox.Layer.SourceId -> List (Mapbox.Layer.LayerAttr Mapbox.Layer.Raster) -> Mapbox.Layer.Layer"
+ },
+ {
+ "name": "rasterBrightnessMax",
+ "comment": " Increase or reduce the brightness of the image. The value is the maximum brightness. Paint property.\n\nShould be between `0` and `1` inclusive. Defaults to `1`.\n\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Raster"
+ },
+ {
+ "name": "rasterBrightnessMin",
+ "comment": " Increase or reduce the brightness of the image. The value is the minimum brightness. Paint property.\n\nShould be between `0` and `1` inclusive. Defaults to `0`.\n\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Raster"
+ },
+ {
+ "name": "rasterContrast",
+ "comment": " Increase or reduce the contrast of the image. Paint property.\n\nShould be between `-1` and `1` inclusive. Defaults to `0`.\n\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Raster"
+ },
+ {
+ "name": "rasterFadeDuration",
+ "comment": " Fade duration when a new tile is added. Paint property.\n\nShould be greater than or equal to `0`.\nUnits in milliseconds. Defaults to `300`.\n\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Raster"
+ },
+ {
+ "name": "rasterHueRotate",
+ "comment": " Rotates hues around the color wheel. Paint property.\nUnits in degrees. Defaults to `0`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Raster"
+ },
+ {
+ "name": "rasterOpacity",
+ "comment": " The opacity at which the image will be drawn. Paint property.\n\nShould be between `0` and `1` inclusive. Defaults to `1`.\n\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Raster"
+ },
+ {
+ "name": "rasterSaturation",
+ "comment": " Increase or reduce the saturation of the image. Paint property.\n\nShould be between `-1` and `1` inclusive. Defaults to `0`.\n\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Raster"
+ },
+ {
+ "name": "sourceLayer",
+ "comment": " Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources.\n",
+ "type": "String -> Mapbox.Layer.LayerAttr all"
+ },
+ {
+ "name": "symbol",
+ "comment": " An icon or a text label.\n",
+ "type": "String -> Mapbox.Layer.SourceId -> List (Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol) -> Mapbox.Layer.Layer"
+ },
+ {
+ "name": "symbolAvoidEdges",
+ "comment": " 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. Layout property. Defaults to `false`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Bool -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "symbolPlacement",
+ "comment": " Label placement relative to its geometry. Layout property. Defaults to `point`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.SymbolPlacement -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "symbolSpacing",
+ "comment": " Distance between two symbol anchors. Layout property.\n\nShould be greater than or equal to `1`.\nUnits in pixels. Defaults to `250`. Requires `symbolPlacement` to be `line`.\n\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "textAllowOverlap",
+ "comment": " If true, the text will be visible even if it collides with other previously drawn symbols. Layout property. Defaults to `false`. Requires `textField`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Bool -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "textAnchor",
+ "comment": " Part of the text placed closest to the anchor. Layout property. Defaults to `center`. Requires `textField`.\n",
+ "type": "Mapbox.Expression.Expression any Mapbox.Expression.Position -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "textColor",
+ "comment": " The color with which the text will be drawn. Paint property. Defaults to `#000000`. Requires `textField`.\n",
+ "type": "Mapbox.Expression.Expression any Mapbox.Expression.Color -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "textField",
+ "comment": " Value to use for a text label. Layout property. Defaults to ``.\n",
+ "type": "Mapbox.Expression.Expression any String -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "textFont",
+ "comment": " Font stack to use for displaying text. Layout property. Defaults to `Open Sans Regular,Arial Unicode MS Regular`. Requires `textField`.\n",
+ "type": "Mapbox.Expression.Expression any (Array.Array String) -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "textHaloBlur",
+ "comment": " The halo's fadeout distance towards the outside. Paint property.\n\nShould be greater than or equal to `0`.\nUnits in pixels. Defaults to `0`. Requires `textField`.\n\n",
+ "type": "Mapbox.Expression.Expression any Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "textHaloColor",
+ "comment": " The color of the text's halo, which helps it stand out from backgrounds. Paint property. Defaults to `rgba(0, 0, 0, 0)`. Requires `textField`.\n",
+ "type": "Mapbox.Expression.Expression any Mapbox.Expression.Color -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "textHaloWidth",
+ "comment": " Distance of halo to the font outline. Max text halo width is 1/4 of the font-size. Paint property.\n\nShould be greater than or equal to `0`.\nUnits in pixels. Defaults to `0`. Requires `textField`.\n\n",
+ "type": "Mapbox.Expression.Expression any Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "textIgnorePlacement",
+ "comment": " If true, other symbols can be visible even if they collide with the text. Layout property. Defaults to `false`. Requires `textField`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Bool -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "textJustify",
+ "comment": " Text justification options. Layout property. Defaults to `center`. Requires `textField`.\n",
+ "type": "Mapbox.Expression.Expression any Mapbox.Expression.TextJustify -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "textKeepUpright",
+ "comment": " If true, the text may be flipped vertically to prevent it from being rendered upside-down. Layout property. Defaults to `true`. Requires `textField`. Requires `textRotationAlignment` to be `map`. Requires `symbolPlacement` to be `line`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Bool -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "textLetterSpacing",
+ "comment": " Text tracking amount. Layout property.\nUnits in ems. Defaults to `0`. Requires `textField`.\n",
+ "type": "Mapbox.Expression.Expression any Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "textLineHeight",
+ "comment": " Text leading value for multi-line text. Layout property.\nUnits in ems. Defaults to `1.2`. Requires `textField`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "textMaxAngle",
+ "comment": " Maximum angle change between adjacent characters. Layout property.\nUnits in degrees. Defaults to `45`. Requires `textField`. Requires `symbolPlacement` to be `line`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "textMaxWidth",
+ "comment": " The maximum line width for text wrapping. Layout property.\n\nShould be greater than or equal to `0`.\nUnits in ems. Defaults to `10`. Requires `textField`.\n\n",
+ "type": "Mapbox.Expression.Expression any Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "textOffset",
+ "comment": " Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. Layout property.\nUnits in ems. Defaults to `0,0`. Requires `textField`.\n",
+ "type": "Mapbox.Expression.Expression any (Array.Array Float) -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "textOpacity",
+ "comment": " The opacity at which the text will be drawn. Paint property.\n\nShould be between `0` and `1` inclusive. Defaults to `1`. Requires `textField`.\n\n",
+ "type": "Mapbox.Expression.Expression any Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "textOptional",
+ "comment": " If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not. Layout property. Defaults to `false`. Requires `textField`. Requires `iconImage`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Bool -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "textPadding",
+ "comment": " Size of the additional area around the text bounding box used for detecting symbol collisions. Layout property.\n\nShould be greater than or equal to `0`.\nUnits in pixels. Defaults to `2`. Requires `textField`.\n\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "textPitchAlignment",
+ "comment": " Orientation of text when map is pitched. Layout property. Defaults to `auto`. Requires `textField`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.AnchorAuto -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "textRotate",
+ "comment": " Rotates the text clockwise. Layout property.\nUnits in degrees. Defaults to `0`. Requires `textField`.\n",
+ "type": "Mapbox.Expression.Expression any Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "textRotationAlignment",
+ "comment": " In combination with `symbolPlacement`, determines the rotation behavior of the individual glyphs forming the text. Layout property. Defaults to `auto`. Requires `textField`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.AnchorAuto -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "textSize",
+ "comment": " Font size. Layout property.\n\nShould be greater than or equal to `0`.\nUnits in pixels. Defaults to `16`. Requires `textField`.\n\n",
+ "type": "Mapbox.Expression.Expression any Float -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "textTransform",
+ "comment": " Specifies how to capitalize text, similar to the CSS `textTransform` property. Layout property. Defaults to `none`. Requires `textField`.\n",
+ "type": "Mapbox.Expression.Expression any Mapbox.Expression.TextTransform -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "textTranslate",
+ "comment": " 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. Paint property.\nUnits in pixels. Defaults to `0,0`. Requires `textField`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression (Array.Array Float) -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "textTranslateAnchor",
+ "comment": " Controls the frame of reference for `textTranslate`. Paint property. Defaults to `map`. Requires `textField`. Requires `textTranslate`.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Mapbox.Expression.Anchor -> Mapbox.Layer.LayerAttr Mapbox.Layer.Symbol"
+ },
+ {
+ "name": "visible",
+ "comment": " Whether this layer is displayed.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Bool -> Mapbox.Layer.LayerAttr any"
+ }
+ ],
+ "generated-with-elm-version": "0.18.0"
+ },
+ {
+ "name": "Mapbox.Expression",
+ "comment": " Expressions form a little language that can be used to compute values for various layer properties.\n\nIt is recommended to import them in the following fashion:\n\n import Mapbox.Expression as E exposing (str, float, int, true, false)\n\nThis way you can use the language without much syntactic fuss and you have easy access to the literals.\n\n**Note**: If you are familiar with the JS version of the style spec,\nwe have made a few changes. Argument order has been switched for many functions to support using pipeline style more naturally. Some functions use overloading in the original, these have been renamed to\nnot be overloaded. Finally, we have chosen not to represent some parts of the spec that are superflous (especially when used form Elm), namely functions and let-in expressions.\n\n@docs Expression, DataExpression, CameraExpression\n\n@docs encode\n\n\n### Types\n\nAll of the types used as expression results are phantom (i.e. they don't have any runtime values but are used purely for compile-time checking). As such we use a mix of standard elm types for their familiarty:\n\n - `Float`\n - `String`\n - `Array`\n - `Bool`\n\nWe introduce the following types:\n\n@docs Color, Object, Collator\n\n(And also a bunch of Enum types, that will be documented in the Enums section).\n\nYou can use the following functions to transfer Elm values into the Expression language:\n\n@docs true, false, bool, int, float, str, rgba, floats, strings, object, collator, defaultCollator\n\nIn some cases, you will need to force the type system to cooperate.\nThe following assertions will force the type and cause a run-time error\nif the type is wrong:\n\n@docs assertArray, assertArrayOfStrings, assertArrayOfFloats, assertArrayOfBools, assertBool, assertFloat, assertObject, assertString\n\nYou can also use these functions to explicitly cast to a particular type:\n\n@docs toBool, toColor, toFloat, toString\n\n@docs typeof\n\n\n### Lookup\n\n@docs at, get, has, count, length\n\n\n### Feature data\n\n@docs geometryType, id, properties, getProperty, hasProperty\n\n\n### Decision\n\nThe expressions in this section can be used to add conditional logic to your styles.\n\n@docs isEqual, notEqual, lessThan, lessThanOrEqual, greaterThan, greaterThanOrEqual\n\nStrings can be compared with a collator for locale specific comparisons:\n\n@docs isEqualWithCollator, notEqualWithCollator,lessThanWithCollator, lessThanOrEqualWithCollator, greaterThanWithCollator, greaterThanOrEqualWithCollator\n\nLogical operators:\n\n@docs not, all, any\n\nControl flow:\n\n@docs ifElse, conditionally, matchesStr, matchesFloat, coallesce\n\n\n### Ramps, scales, curves\n\n@docs interpolate, Interpolation, step\n\n\n### String\n\n@docs append, downcase, upcase, isSupportedScript, resolvedLocale\n\n\n### Color\n\n@docs makeRGBColor, makeRGBAColor, rgbaChannels\n\n\n### Math\n\n@docs minus, multiply, divideBy, modBy, plus, raiseBy, sqrt, abs, ceil, floor, round, cos, sin, tan, acos, asin, atan, e, pi, ln, ln2, log10, log2\n\n\n### Zoom\n\n@docs zoom\n\n\n### Heatmap\n\n@docs heatmapDensity, lineProgress\n\n\n### Enums\n\nThese are required for various layer properties.\n\n@docs Anchor, anchorMap, anchorViewport, AnchorAuto, anchorAutoMap, anchorAutoViewport, anchorAutoAuto, Position, positionCenter, positionLeft, positionRight, positionTop, positionBottom, positionTopLeft, positionTopRight, positionBottomLeft, positionBottomRight, TextFit, textFitNone, textFitWidth, textFitHeight, textFitBoth, LineCap, lineCapButt, lineCapRound, lineCapSquare, LineJoin, lineJoinBevel, lineJoinRound, lineJoinMiter, SymbolPlacement, symbolPlacementPoint, symbolPlacementLine, TextJustify, textJustifyLeft, textJustifyCenter, textJustifyRight, TextTransform, textTransformNone, textTransformUppercase, textTransformLowercase\n\n",
+ "aliases": [],
+ "types": [
+ {
+ "name": "Anchor",
+ "comment": " ",
+ "args": [],
+ "cases": [
+ [
+ "Map",
+ []
+ ],
+ [
+ "Viewport",
+ []
+ ]
+ ]
+ },
+ {
+ "name": "AnchorAuto",
+ "comment": " ",
+ "args": [],
+ "cases": []
+ },
+ {
+ "name": "CameraExpression",
+ "comment": " A camera expression is any expression that uses the zoom operator. Such expressions allow the the appearance of a layer\nto change with the map's zoom level. Camera expressions can be used to create the appearance of depth and to control data density.\n\n zoom\n |> interpolate Linear\n [ ( 5, int 1 )\n , ( 10, int 5 )\n ]\n |> Layer.circleRadius\n\nThis example uses the `interpolate` operator to define a linear relationship between zoom level and circle size using a set of input-output pairs. In this case, the expression indicates that the circle radius should be 1 pixel when the zoom level is 5 or below, and 5 pixels when the zoom is 10 or above. In between, the radius will be linearly interpolated between 1 and 5 pixels\n\nCamera expressions are allowed anywhere an expression may be used. However, when a camera expression used as the value of a layout or paint property, the `zoom` operator must appear only as the input to an outer `interpolate` or `step` expression\n\nThere is an important difference between layout and paint properties in the timing of camera expression evaluation. Paint property camera expressions are re-evaluated whenever the zoom level changes, even fractionally. For example, a paint property camera expression will be re-evaluated continuously as the map moves between zoom levels 4.1 and 4.6. On the other hand, a layout property camera expression is evaluated only at integer zoom levels. It will not be re-evaluated as the zoom changes from 4.1 to 4.6 -- only if it goes above 5 or below 4.\n\n",
+ "args": [],
+ "cases": []
+ },
+ {
+ "name": "Collator",
+ "comment": " Used for locale sensitive string comparisons.\n",
+ "args": [],
+ "cases": []
+ },
+ {
+ "name": "Color",
+ "comment": " Represents a color value\n",
+ "args": [],
+ "cases": []
+ },
+ {
+ "name": "DataExpression",
+ "comment": " A data expression is any expression that access feature data -- that is, any expression that uses one of the data operators: `getProperty`, `hasProperty` , `id`, `geometryType`, or `properties`. Data expressions allow a feature's properties to determine its appearance. They can be used to differentiate features within the same layer and to create data visualizations.\n\n makeRGBColor\n -- red is higher when feature.properties.temperature is higher\n (getProperty \"temperature\")\n -- green is always zero\n (int 0)\n -- blue is higher when feature.properties.temperature is lower\n (getProperty \"temperature\" |> minus 100)\n |> Layer.circleColor\n\nThis example uses the `getProperty` operator to obtain the temperature value of each feature. That value is used to compute arguments to the `makeRGBColor` operator, defining a color in terms of its red, green, and blue components.\n\n",
+ "args": [],
+ "cases": []
+ },
+ {
+ "name": "Expression",
+ "comment": " Expressions are zero overhead wrappers over the underlying JSON language that attempt to provide some type safety.\n\nNote however, that while being a strictly typed language, it has slighlty different semantics tham Elm:\n\n - There is only a single number type. I have denoted it `Float`. You will notice that the `int` function takes an Elm int\n value and converts it to an `Expression expr Float`.\n - All values may be `null`. There is no `Maybe` type. You can use the `coallesce` function to handle this.\n - There is no distinction between `List`, `Array`, and tuples. Hence all collections are labeled as `Array`.\n - Dictionaries are called `Object`. The keys are always `String`, but the values can be of mixed types. Hence retrieving\n values from them makes code untyped.\n - You can force the types of things using the `assert...` functions. This will generate a runtime error if the type doesn't\n match. This should be necessary only rarely.\n\nThe `exprType` can be:\n\n - `CameraExpression`\n - `DataExpression`\n - or a type variable representing either of the above\n\nThe intent is to help you not break your style by using a DataExpression (for example) where it isn't supported. However, this isn't entirely foolproof, so some caution is advised.\n\n",
+ "args": [
+ "exprType",
+ "resultType"
+ ],
+ "cases": []
+ },
+ {
+ "name": "Interpolation",
+ "comment": " Interpolation types:\n\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 - `CubicBezier (x1, y1) (x2, y2)`: interpolates using the cubic bezier curve defined by the given control points.\n\n",
+ "args": [],
+ "cases": [
+ [
+ "Linear",
+ []
+ ],
+ [
+ "Exponential",
+ [
+ "Float"
+ ]
+ ],
+ [
+ "CubicBezier",
+ [
+ "( Float, Float )",
+ "( Float, Float )"
+ ]
+ ]
+ ]
+ },
+ {
+ "name": "LineCap",
+ "comment": " ",
+ "args": [],
+ "cases": []
+ },
+ {
+ "name": "LineJoin",
+ "comment": " ",
+ "args": [],
+ "cases": []
+ },
+ {
+ "name": "Object",
+ "comment": " Represents a mixed-type dictionary where keys are always strings\n",
+ "args": [],
+ "cases": []
+ },
+ {
+ "name": "Position",
+ "comment": " ",
+ "args": [],
+ "cases": []
+ },
+ {
+ "name": "SymbolPlacement",
+ "comment": " ",
+ "args": [],
+ "cases": []
+ },
+ {
+ "name": "TextFit",
+ "comment": " ",
+ "args": [],
+ "cases": []
+ },
+ {
+ "name": "TextJustify",
+ "comment": " ",
+ "args": [],
+ "cases": []
+ },
+ {
+ "name": "TextTransform",
+ "comment": " ",
+ "args": [],
+ "cases": []
+ }
+ ],
+ "values": [
+ {
+ "name": "abs",
+ "comment": " Returns the absolute value of the input.\n",
+ "type": "Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "acos",
+ "comment": " Returns the arccosine of the input.\n",
+ "type": "Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "all",
+ "comment": " 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.\n",
+ "type": "List (Mapbox.Expression.Expression exprType Bool) -> Mapbox.Expression.Expression exprType Bool"
+ },
+ {
+ "name": "anchorAutoAuto",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.AnchorAuto"
+ },
+ {
+ "name": "anchorAutoMap",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.AnchorAuto"
+ },
+ {
+ "name": "anchorAutoViewport",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.AnchorAuto"
+ },
+ {
+ "name": "anchorMap",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.Anchor"
+ },
+ {
+ "name": "anchorViewport",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.Anchor"
+ },
+ {
+ "name": "any",
+ "comment": " 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.\n",
+ "type": "List (Mapbox.Expression.Expression exprType Bool) -> Mapbox.Expression.Expression exprType Bool"
+ },
+ {
+ "name": "append",
+ "comment": " Returns a string consisting of the concatenation of the inputs.\n\nArgument order designed for pipelines:\n\n a |> append b --> a ++ b\n\n",
+ "type": "Mapbox.Expression.Expression exprType String -> Mapbox.Expression.Expression exprType String -> Mapbox.Expression.Expression exprType String"
+ },
+ {
+ "name": "asin",
+ "comment": " Returns the arcsine of the input.\n",
+ "type": "Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "assertArray",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType any -> Mapbox.Expression.Expression exprType (Array.Array any)"
+ },
+ {
+ "name": "assertArrayOfBools",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType any -> Mapbox.Expression.Expression exprType (Array.Array Bool)"
+ },
+ {
+ "name": "assertArrayOfFloats",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType any -> Mapbox.Expression.Expression exprType (Array.Array Float)"
+ },
+ {
+ "name": "assertArrayOfStrings",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType any -> Mapbox.Expression.Expression exprType (Array.Array String)"
+ },
+ {
+ "name": "assertBool",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType any -> Mapbox.Expression.Expression exprType Bool"
+ },
+ {
+ "name": "assertFloat",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType any -> Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "assertObject",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType any -> Mapbox.Expression.Expression exprType Mapbox.Expression.Object"
+ },
+ {
+ "name": "assertString",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType any -> Mapbox.Expression.Expression exprType String"
+ },
+ {
+ "name": "at",
+ "comment": " Retrieves an item from an array.\n",
+ "type": "Mapbox.Expression.Expression exprType1 Float -> Mapbox.Expression.Expression exprType2 (Array.Array a) -> Mapbox.Expression.Expression exprType2 a"
+ },
+ {
+ "name": "atan",
+ "comment": " Returns the arctangent of the input.\n",
+ "type": "Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "bool",
+ "comment": " ",
+ "type": "Bool -> Mapbox.Expression.Expression exprType Bool"
+ },
+ {
+ "name": "ceil",
+ "comment": " Returns the smallest integer that is greater than or equal to the input.\n",
+ "type": "Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "coallesce",
+ "comment": " Evaluates each expression in turn until the first non-null value is obtained, and returns that value.\n",
+ "type": "List (Mapbox.Expression.Expression exprType outputType) -> Mapbox.Expression.Expression exprType outputType"
+ },
+ {
+ "name": "collator",
+ "comment": " Returns a `Collator` for use in locale-dependent comparison operations. The first argument specifies if the comparison should be case sensitive. The second specifies if it is diacritic sensitive. The final locale argument specifies the IETF language tag of the locale to use.\n",
+ "type": "Mapbox.Expression.Expression e1 Bool -> Mapbox.Expression.Expression e2 Bool -> Mapbox.Expression.Expression e3 String -> Mapbox.Expression.Expression e4 Mapbox.Expression.Collator"
+ },
+ {
+ "name": "conditionally",
+ "comment": " Selects the first output whose condition evaluates to `true`\n",
+ "type": "List ( Mapbox.Expression.Expression exprType1 Bool , Mapbox.Expression.Expression exprType2 output ) -> Mapbox.Expression.Expression exprType2 output -> Mapbox.Expression.Expression exprType1 output"
+ },
+ {
+ "name": "cos",
+ "comment": " Returns the cosine of the input.\n",
+ "type": "Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "count",
+ "comment": " Gets the length of an array.\n",
+ "type": "Mapbox.Expression.Expression exprType (Array.Array any) -> Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "defaultCollator",
+ "comment": " Returns a `Collator` with the default locale (which depends on the system running the code), which is not sensitive to case nor diacritic.\n",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.Collator"
+ },
+ {
+ "name": "divideBy",
+ "comment": " Returns the result of floating point division of the second input by the first.\n\n a |> divideBy b --> a / b\n\n",
+ "type": "Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "downcase",
+ "comment": " 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.\n",
+ "type": "Mapbox.Expression.Expression exprType String -> Mapbox.Expression.Expression exprType String"
+ },
+ {
+ "name": "e",
+ "comment": " Returns the mathematical constant e.\n",
+ "type": "Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "encode",
+ "comment": " Turns an expression into JSON\n",
+ "type": "Mapbox.Expression.Expression exprType a -> Json.Encode.Value"
+ },
+ {
+ "name": "false",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Bool"
+ },
+ {
+ "name": "float",
+ "comment": " ",
+ "type": "Float -> Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "floats",
+ "comment": " ",
+ "type": "List Float -> Mapbox.Expression.Expression exprType (Array.Array Float)"
+ },
+ {
+ "name": "floor",
+ "comment": " Returns the largest integer that is less than or equal to the input.\n",
+ "type": "Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "geometryType",
+ "comment": " Gets the feature's geometry type: Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.DataExpression String"
+ },
+ {
+ "name": "get",
+ "comment": " Retrieves a property value from an object. Returns null if the requested property is missing.\n",
+ "type": "Mapbox.Expression.Expression exprType1 String -> Mapbox.Expression.Expression exprType2 Mapbox.Expression.Object -> Mapbox.Expression.Expression exprType2 any"
+ },
+ {
+ "name": "getProperty",
+ "comment": " Retrieves a property value from the current feature's properties. Returns null if the requested property is missing.\n",
+ "type": "Mapbox.Expression.Expression exprType String -> Mapbox.Expression.Expression Mapbox.Expression.DataExpression any"
+ },
+ {
+ "name": "greaterThan",
+ "comment": " Returns true if the first input is strictly greater than the second, false otherwise.\n",
+ "type": "Mapbox.Expression.Expression exprType1 comparable -> Mapbox.Expression.Expression exprType2 comparable -> Mapbox.Expression.Expression exprType1 Bool"
+ },
+ {
+ "name": "greaterThanOrEqual",
+ "comment": " Returns true if the first input is greater than or equal to the second, false otherwise.\n",
+ "type": "Mapbox.Expression.Expression exprType1 comparable -> Mapbox.Expression.Expression exprType2 comparable -> Mapbox.Expression.Expression exprType1 Bool"
+ },
+ {
+ "name": "greaterThanOrEqualWithCollator",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType1 String -> Mapbox.Expression.Expression exprType2 String -> Mapbox.Expression.Expression exprType3 Mapbox.Expression.Collator -> Mapbox.Expression.Expression exprType1 Bool"
+ },
+ {
+ "name": "greaterThanWithCollator",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType1 String -> Mapbox.Expression.Expression exprType2 String -> Mapbox.Expression.Expression exprType3 Mapbox.Expression.Collator -> Mapbox.Expression.Expression exprType1 Bool"
+ },
+ {
+ "name": "has",
+ "comment": " Tests for the presence of an property value in an object.\n",
+ "type": "Mapbox.Expression.Expression exprType1 String -> Mapbox.Expression.Expression exprType2 Mapbox.Expression.Object -> Mapbox.Expression.Expression exprType2 Bool"
+ },
+ {
+ "name": "hasProperty",
+ "comment": " Tests for the presence of an property value in the current feature's properties.\n",
+ "type": "Mapbox.Expression.Expression exprType String -> Mapbox.Expression.Expression Mapbox.Expression.DataExpression Bool"
+ },
+ {
+ "name": "heatmapDensity",
+ "comment": " 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 `heatmapColor` property.\n",
+ "type": "Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "id",
+ "comment": " Gets the feature's id, if it has one.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.DataExpression any"
+ },
+ {
+ "name": "ifElse",
+ "comment": " The ternary operator:\n\n Layer.iconImage <|\n ifElse\n (greaterThan (getProperty (str \"size\")) (float 30))\n (str \"hospital-32\")\n (str \"clinic-32\")\n\n",
+ "type": "Mapbox.Expression.Expression exprType1 Bool -> Mapbox.Expression.Expression exprType2 output -> Mapbox.Expression.Expression exprType3 output -> Mapbox.Expression.Expression exprType1 output"
+ },
+ {
+ "name": "int",
+ "comment": " ",
+ "type": "Int -> Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "interpolate",
+ "comment": " Produces continuous, smooth results by interpolating between pairs of input and output values (\"stops\"). The output type must be `Float`, `Array Float`, or `Color`.\n\n zoom\n |> interpolate Linear\n [ ( 5, int 1 )\n , ( 10, int 5 )\n ]\n |> Layer.circleRadius\n\n",
+ "type": "Mapbox.Expression.Interpolation -> List ( Float, Mapbox.Expression.Expression exprType2 outputType ) -> Mapbox.Expression.Expression exprType1 Float -> Mapbox.Expression.Expression exprType1 outputType"
+ },
+ {
+ "name": "isEqual",
+ "comment": " Returns true if the input values are equal, false otherwise.\n",
+ "type": "Mapbox.Expression.Expression exprType1 a -> Mapbox.Expression.Expression exprType2 a -> Mapbox.Expression.Expression exprType1 Bool"
+ },
+ {
+ "name": "isEqualWithCollator",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType1 String -> Mapbox.Expression.Expression exprType2 String -> Mapbox.Expression.Expression exprType3 Mapbox.Expression.Collator -> Mapbox.Expression.Expression exprType1 Bool"
+ },
+ {
+ "name": "isSupportedScript",
+ "comment": " 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).\n",
+ "type": "Mapbox.Expression.Expression exprType String -> Mapbox.Expression.Expression exprType Bool"
+ },
+ {
+ "name": "length",
+ "comment": " Gets the length of a string.\n",
+ "type": "Mapbox.Expression.Expression exprType String -> Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "lessThan",
+ "comment": " Returns true if the first input is strictly less than the second, false otherwise.\n",
+ "type": "Mapbox.Expression.Expression exprType1 comparable -> Mapbox.Expression.Expression exprType2 comparable -> Mapbox.Expression.Expression exprType1 Bool"
+ },
+ {
+ "name": "lessThanOrEqual",
+ "comment": " Returns true if the first input is less than or equal to the second, false otherwise.\n",
+ "type": "Mapbox.Expression.Expression exprType1 comparable -> Mapbox.Expression.Expression exprType2 comparable -> Mapbox.Expression.Expression exprType1 Bool"
+ },
+ {
+ "name": "lessThanOrEqualWithCollator",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType1 String -> Mapbox.Expression.Expression exprType2 String -> Mapbox.Expression.Expression exprType3 Mapbox.Expression.Collator -> Mapbox.Expression.Expression exprType1 Bool"
+ },
+ {
+ "name": "lessThanWithCollator",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType1 String -> Mapbox.Expression.Expression exprType2 String -> Mapbox.Expression.Expression exprType3 Mapbox.Expression.Collator -> Mapbox.Expression.Expression exprType1 Bool"
+ },
+ {
+ "name": "lineCapButt",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.LineCap"
+ },
+ {
+ "name": "lineCapRound",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.LineCap"
+ },
+ {
+ "name": "lineCapSquare",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.LineCap"
+ },
+ {
+ "name": "lineJoinBevel",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.LineJoin"
+ },
+ {
+ "name": "lineJoinMiter",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.LineJoin"
+ },
+ {
+ "name": "lineJoinRound",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.LineJoin"
+ },
+ {
+ "name": "lineProgress",
+ "comment": " Gets the progress along a gradient line. Can only be used in the `lineGradient` property.\n",
+ "type": "Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "ln",
+ "comment": " Returns the natural logarithm of the input.\n",
+ "type": "Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "ln2",
+ "comment": " Returns mathematical constant ln(2).\n",
+ "type": "Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "log10",
+ "comment": " Returns the base-ten logarithm of the input.\n",
+ "type": "Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "log2",
+ "comment": " Returns the base-two logarithm of the input.\n",
+ "type": "Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "makeRGBAColor",
+ "comment": " 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.\n",
+ "type": "Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Mapbox.Expression.Color"
+ },
+ {
+ "name": "makeRGBColor",
+ "comment": " 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.\n",
+ "type": "Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Mapbox.Expression.Color"
+ },
+ {
+ "name": "matchesFloat",
+ "comment": " Selects the output whose label value matches the input value, or the fallback value if no match is found.\n\n getProperty (str \"size\")\n |> matchesStr\n [ (1, str \"icon-hospital\")\n , (2, str \"icon-medical\")\n ]\n (str \"icon-generic\") -- fallback value\n |> Layer.iconImage\n\n",
+ "type": "List ( Float, Mapbox.Expression.Expression exprType2 output ) -> Mapbox.Expression.Expression exprType1 output -> Mapbox.Expression.Expression exprType3 Float -> Mapbox.Expression.Expression exprType3 output"
+ },
+ {
+ "name": "matchesStr",
+ "comment": " Selects the output whose label value matches the input value, or the fallback value if no match is found.\n\n getProperty (str \"type\")\n |> matchesStr\n [ (\"hospital\", str \"icon-hospital\")\n , (\"clinic\", str \"icon-medical\")\n ]\n (str \"icon-generic\") -- fallback value\n |> Layer.iconImage\n\n",
+ "type": "List ( String, Mapbox.Expression.Expression exprType2 output ) -> Mapbox.Expression.Expression exprType1 output -> Mapbox.Expression.Expression exprType3 String -> Mapbox.Expression.Expression exprType3 output"
+ },
+ {
+ "name": "minus",
+ "comment": " Returns the result of subtracting the first input from the second.\n\n a |> minus b --> a - b\n\n",
+ "type": "Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "modBy",
+ "comment": " Returns the remainder after integer division of the second input by the first.\n\n a |> modBy b --> a % b\n\n",
+ "type": "Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "multiply",
+ "comment": " Returns the product of the inputs.\n",
+ "type": "Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "not",
+ "comment": " Logical negation. Returns true if the input is false, and false if the input is true.\n",
+ "type": "Mapbox.Expression.Expression exprType Bool -> Mapbox.Expression.Expression exprType Bool"
+ },
+ {
+ "name": "notEqual",
+ "comment": " Returns true if the input values are not equal, false otherwise.\n",
+ "type": "Mapbox.Expression.Expression exprType1 a -> Mapbox.Expression.Expression exprType2 a -> Mapbox.Expression.Expression exprType1 Bool"
+ },
+ {
+ "name": "notEqualWithCollator",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType1 String -> Mapbox.Expression.Expression exprType2 String -> Mapbox.Expression.Expression exprType3 Mapbox.Expression.Collator -> Mapbox.Expression.Expression exprType1 Bool"
+ },
+ {
+ "name": "object",
+ "comment": " Takes a list of key value pairs. The values are JSON Values,\ntherefore allowing for mixed types.\n",
+ "type": "List ( String, Json.Encode.Value ) -> Mapbox.Expression.Expression exprType Mapbox.Expression.Object"
+ },
+ {
+ "name": "pi",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "plus",
+ "comment": " Returns the sum of the inputs.\n",
+ "type": "Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "positionBottom",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.Position"
+ },
+ {
+ "name": "positionBottomLeft",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.Position"
+ },
+ {
+ "name": "positionBottomRight",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.Position"
+ },
+ {
+ "name": "positionCenter",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.Position"
+ },
+ {
+ "name": "positionLeft",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.Position"
+ },
+ {
+ "name": "positionRight",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.Position"
+ },
+ {
+ "name": "positionTop",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.Position"
+ },
+ {
+ "name": "positionTopLeft",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.Position"
+ },
+ {
+ "name": "positionTopRight",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.Position"
+ },
+ {
+ "name": "properties",
+ "comment": " Gets the feature properties object. Note that in some cases, it may be more efficient to use `getProperty (str \"property-name\")` directly.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.DataExpression Mapbox.Expression.Object"
+ },
+ {
+ "name": "raiseBy",
+ "comment": " Returns the result of raising the second input to the power specified by the first.\n\n a |> raiseBy b --> a ^ b\n\n",
+ "type": "Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "resolvedLocale",
+ "comment": " 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.\n",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.Collator -> Mapbox.Expression.Expression exprType String"
+ },
+ {
+ "name": "rgba",
+ "comment": " ",
+ "type": "Float -> Float -> Float -> Float -> Mapbox.Expression.Expression exprType Mapbox.Expression.Color"
+ },
+ {
+ "name": "rgbaChannels",
+ "comment": " Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.\n",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.Color -> Mapbox.Expression.Expression exprType (Array.Array Float)"
+ },
+ {
+ "name": "round",
+ "comment": " Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `round (float -1.5)` evaluates to -2.\n",
+ "type": "Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "sin",
+ "comment": " Returns the sine of the input.\n",
+ "type": "Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "sqrt",
+ "comment": " Returns the square root of the input.\n",
+ "type": "Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "step",
+ "comment": " Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values (\"stops\"). Stop inputs must be Floats in strictly ascending order. Returns the output value of the stop just less than the input, or the first input if the input is less than the first stop.\n\n zoom\n |> step (int 1)\n [ ( 5, int 3 )\n , ( 10, int 5 )\n ]\n |> Layer.circleRadius\n\n",
+ "type": "Mapbox.Expression.Expression exprType2 Float -> List ( Float, Mapbox.Expression.Expression exprType1 output ) -> Mapbox.Expression.Expression exprType1 output -> Mapbox.Expression.Expression exprType2 output"
+ },
+ {
+ "name": "str",
+ "comment": " ",
+ "type": "String -> Mapbox.Expression.Expression exprType String"
+ },
+ {
+ "name": "strings",
+ "comment": " ",
+ "type": "List String -> Mapbox.Expression.Expression exprType (Array.Array String)"
+ },
+ {
+ "name": "symbolPlacementLine",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.SymbolPlacement"
+ },
+ {
+ "name": "symbolPlacementPoint",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.SymbolPlacement"
+ },
+ {
+ "name": "tan",
+ "comment": " Returns the tangent of the input.\n",
+ "type": "Mapbox.Expression.Expression exprType Float -> Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "textFitBoth",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.TextFit"
+ },
+ {
+ "name": "textFitHeight",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.TextFit"
+ },
+ {
+ "name": "textFitNone",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.TextFit"
+ },
+ {
+ "name": "textFitWidth",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.TextFit"
+ },
+ {
+ "name": "textJustifyCenter",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.TextJustify"
+ },
+ {
+ "name": "textJustifyLeft",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.TextJustify"
+ },
+ {
+ "name": "textJustifyRight",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.TextJustify"
+ },
+ {
+ "name": "textTransformLowercase",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.TextTransform"
+ },
+ {
+ "name": "textTransformNone",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.TextTransform"
+ },
+ {
+ "name": "textTransformUppercase",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Mapbox.Expression.TextTransform"
+ },
+ {
+ "name": "toBool",
+ "comment": " 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.\n",
+ "type": "Mapbox.Expression.Expression exprType any -> Mapbox.Expression.Expression exprType Bool"
+ },
+ {
+ "name": "toColor",
+ "comment": " Converts the input value to a color. If it can't be converted, the falback value will be used.\n\n input\n |> toColor (rgba 0 0 0 1) -- fallback color\n\n",
+ "type": "Mapbox.Expression.Expression exprType2 Mapbox.Expression.Color -> Mapbox.Expression.Expression exprType any -> Mapbox.Expression.Expression exprType Mapbox.Expression.Color"
+ },
+ {
+ "name": "toFloat",
+ "comment": " 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 of the ECMAScript Language Specification](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type). If this fails, the fallback value is used.\n\n input\n |> toFloat 0 -- fallback\n\n",
+ "type": "Float -> Mapbox.Expression.Expression exprType any -> Mapbox.Expression.Expression exprType Float"
+ },
+ {
+ "name": "toString",
+ "comment": " 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.\n",
+ "type": "Mapbox.Expression.Expression exprType any -> Mapbox.Expression.Expression exprType String"
+ },
+ {
+ "name": "true",
+ "comment": " ",
+ "type": "Mapbox.Expression.Expression exprType Bool"
+ },
+ {
+ "name": "typeof",
+ "comment": " Returns a string describing the type of the given value.\n",
+ "type": "Mapbox.Expression.Expression exprType any -> Mapbox.Expression.Expression exprType String"
+ },
+ {
+ "name": "upcase",
+ "comment": " 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.\n",
+ "type": "Mapbox.Expression.Expression exprType String -> Mapbox.Expression.Expression exprType String"
+ },
+ {
+ "name": "zoom",
+ "comment": " 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.\n",
+ "type": "Mapbox.Expression.Expression Mapbox.Expression.CameraExpression Float"
+ }
+ ],
+ "generated-with-elm-version": "0.18.0"
+ },
+ {
+ "name": "Mapbox.Source",
+ "comment": "\n\n\n# Sources\n\n@docs Source, SourceOption\n\n@docs Id, Url\n\n\n### Vector\n\n@docs vector, vectorFromUrl, VectorSource\n\n\n### Raster\n\n@docs raster, tileSize, rasterFromUrl, RasterSource, scheme, Scheme\n\n\n### Raster DEM\n\n@docs rasterDEMMapbox, rasterDEMTerrarium\n\n\n### GeoJSON\n\n@docs geoJSONFromUrl, geoJSONFromValue, GeoJSONSource, buffer, tolerance, cluster, clusterRadius, lineMetrics\n\n\n### Image, Video & Canvas\n\n@docs Coords, image, video, staticCanvas, animatedCanvas\n\n\n### Tiled sources\n\nTiled sources can also take the following attributes:\n\n@docs bounds, minzoom, maxzoom, attribution\n\n\n### Working with sources\n\n@docs encode, getId\n\n",
+ "aliases": [
+ {
+ "name": "Coords",
+ "comment": " `(longitude, latitude)` pairs for the corners. You can use the type alias constructor in clockwise order: top left, top right, bottom right, bottom left.\n",
+ "args": [],
+ "type": "{ topLeft : ( Float, Float ) , topRight : ( Float, Float ) , bottomRight : ( Float, Float ) , bottomLeft : ( Float, Float ) }"
+ },
+ {
+ "name": "Id",
+ "comment": " Every layer is identified by an id.\n",
+ "args": [],
+ "type": "String"
+ },
+ {
+ "name": "Url",
+ "comment": " Represents a URL. For tiles hosted by Mapbox, the \"url\" value should be of the form mapbox://mapid.\n",
+ "args": [],
+ "type": "String"
+ }
+ ],
+ "types": [
+ {
+ "name": "GeoJSONSource",
+ "comment": " Marks attributes that are only applicable to GeoJSON sources\n",
+ "args": [],
+ "cases": []
+ },
+ {
+ "name": "RasterSource",
+ "comment": " Marks attributes that are only applicable to raster sources\n",
+ "args": [],
+ "cases": []
+ },
+ {
+ "name": "Scheme",
+ "comment": " `XYZ`: Slippy map tilenames scheme.\n\n`TMS`: OSGeo spec scheme.\n\n",
+ "args": [],
+ "cases": [
+ [
+ "XYZ",
+ []
+ ],
+ [
+ "TMS",
+ []
+ ]
+ ]
+ },
+ {
+ "name": "Source",
+ "comment": " Sources supply data to be shown on the map. Adding a source won't immediately make data appear on the map because sources don't contain styling details like color or width. Layers refer to a source and give it a visual representation. This makes it possible to style the same source in different ways, like differentiating between types of roads in a highways layer.\n",
+ "args": [],
+ "cases": []
+ },
+ {
+ "name": "SourceOption",
+ "comment": " Some sources can take options.\n",
+ "args": [
+ "sourceType"
+ ],
+ "cases": []
+ },
+ {
+ "name": "VectorSource",
+ "comment": " Marks attributes that are only applicable to vector sources\n",
+ "args": [],
+ "cases": []
+ }
+ ],
+ "values": [
+ {
+ "name": "animatedCanvas",
+ "comment": " A data source containing the contents of an HTML canvas. The second argument must be the DOM ID of the canvas element. This method is only appropriate with an animated Canvas (i.e. one that changes over time).\n",
+ "type": "Mapbox.Source.Id -> String -> Mapbox.Source.Coords -> Mapbox.Source.Source"
+ },
+ {
+ "name": "attribution",
+ "comment": " Contains an attribution to be displayed when the map is shown to a user.\n",
+ "type": "String -> Mapbox.Source.SourceOption any"
+ },
+ {
+ "name": "bounds",
+ "comment": " 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.\n",
+ "type": "Float -> Float -> Float -> Float -> Mapbox.Source.SourceOption any"
+ },
+ {
+ "name": "buffer",
+ "comment": " 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. Defaults to 128.\n",
+ "type": "Int -> Mapbox.Source.SourceOption Mapbox.Source.GeoJSONSource"
+ },
+ {
+ "name": "cluster",
+ "comment": " If the data is a collection of point features, setting this to true clusters the points by radius into groups.\n",
+ "type": "Bool -> Mapbox.Source.SourceOption Mapbox.Source.GeoJSONSource"
+ },
+ {
+ "name": "clusterRadius",
+ "comment": " Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile.\n",
+ "type": "Float -> Mapbox.Source.SourceOption Mapbox.Source.GeoJSONSource"
+ },
+ {
+ "name": "encode",
+ "comment": " ",
+ "type": "Mapbox.Source.Source -> Json.Encode.Value"
+ },
+ {
+ "name": "geoJSONFromUrl",
+ "comment": " A remote GeoJSON source.\n",
+ "type": "Mapbox.Source.Id -> Mapbox.Source.Url -> List (Mapbox.Source.SourceOption Mapbox.Source.GeoJSONSource) -> Mapbox.Source.Source"
+ },
+ {
+ "name": "geoJSONFromValue",
+ "comment": " A GeoJSON source from some local data.\n",
+ "type": "Mapbox.Source.Id -> List (Mapbox.Source.SourceOption Mapbox.Source.GeoJSONSource) -> Json.Encode.Value -> Mapbox.Source.Source"
+ },
+ {
+ "name": "getId",
+ "comment": " ",
+ "type": "Mapbox.Source.Source -> String"
+ },
+ {
+ "name": "image",
+ "comment": " An image source\n",
+ "type": "Mapbox.Source.Id -> Mapbox.Source.Url -> Mapbox.Source.Coords -> Mapbox.Source.Source"
+ },
+ {
+ "name": "lineMetrics",
+ "comment": " Whether to calculate line distance metrics. This is required for line layers that specify `lineGradient` values.\n",
+ "type": "Bool -> Mapbox.Source.SourceOption Mapbox.Source.GeoJSONSource"
+ },
+ {
+ "name": "maxzoom",
+ "comment": " 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.\n",
+ "type": "Float -> Mapbox.Source.SourceOption any"
+ },
+ {
+ "name": "minzoom",
+ "comment": " Minimum zoom level for which tiles are available, as in the TileJSON spec.\n",
+ "type": "Float -> Mapbox.Source.SourceOption any"
+ },
+ {
+ "name": "raster",
+ "comment": " A raster tile source. Takes a list of one or more tile source URLs, as in the TileJSON spec.\n",
+ "type": "Mapbox.Source.Id -> List Mapbox.Source.Url -> List (Mapbox.Source.SourceOption Mapbox.Source.RasterSource) -> Mapbox.Source.Source"
+ },
+ {
+ "name": "rasterDEMMapbox",
+ "comment": " The [Mapbox Terrain RGB](https://blog.mapbox.com/global-elevation-data-6689f1d0ba65) DEM source.\n",
+ "type": "Mapbox.Source.Id -> Mapbox.Source.Source"
+ },
+ {
+ "name": "rasterDEMTerrarium",
+ "comment": " A raster DEM source in the Terarrium format.\n",
+ "type": "Mapbox.Source.Id -> Mapbox.Source.Url -> List (Mapbox.Source.SourceOption Mapbox.Source.RasterSource) -> Mapbox.Source.Source"
+ },
+ {
+ "name": "rasterFromUrl",
+ "comment": " A raster tile source configured from a TileJSON spec.\n",
+ "type": "Mapbox.Source.Id -> Mapbox.Source.Url -> Mapbox.Source.Source"
+ },
+ {
+ "name": "scheme",
+ "comment": " Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed.\n",
+ "type": "Mapbox.Source.Scheme -> Mapbox.Source.SourceOption Mapbox.Source.RasterSource"
+ },
+ {
+ "name": "staticCanvas",
+ "comment": " A data source containing the contents of an HTML canvas. The second argument must be the DOM ID of the canvas element. This method is only appropriate with a static Canvas (i.e. one that doesn't change), as it will be cached to improve performance.\n",
+ "type": "Mapbox.Source.Id -> String -> Mapbox.Source.Coords -> Mapbox.Source.Source"
+ },
+ {
+ "name": "tileSize",
+ "comment": " The minimum visual size to display tiles for this layer.\n",
+ "type": "Int -> Mapbox.Source.SourceOption Mapbox.Source.RasterSource"
+ },
+ {
+ "name": "tolerance",
+ "comment": " Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance). Defaults to 0.375.\n",
+ "type": "Float -> Mapbox.Source.SourceOption Mapbox.Source.GeoJSONSource"
+ },
+ {
+ "name": "vector",
+ "comment": " A vector tile source. Tiles must be in [Mapbox Vector Tile format](https://www.mapbox.com/developers/vector-tiles/). All geometric coordinates in vector tiles must be between `-1 * extent` and `(extent * 2) - 1` inclusive. All layers that use a vector source must specify a `sourceLayer` value.\n\nThis takes an array of one or more tile source URLs, as in the TileJSON spec.\n\n",
+ "type": "Mapbox.Source.Id -> List Mapbox.Source.Url -> List (Mapbox.Source.SourceOption Mapbox.Source.VectorSource) -> Mapbox.Source.Source"
+ },
+ {
+ "name": "vectorFromUrl",
+ "comment": " A vector tile source. Tiles must be in [Mapbox Vector Tile format](https://www.mapbox.com/developers/vector-tiles/). All geometric coordinates in vector tiles must be between `-1 * extent` and `(extent * 2) - 1` inclusive. All layers that use a vector source must specify a `sourceLayer` value.\n\nThe first argument is the layers id, the second is a url to a [TileJSON specification](https://github.com/mapbox/tilejson-spec) that configures the source.\n\n",
+ "type": "Mapbox.Source.Id -> Mapbox.Source.Url -> Mapbox.Source.Source"
+ },
+ {
+ "name": "video",
+ "comment": " A video source. For each URL in the list, a video element source will be created, in order to support same media in multiple formats supported by different browsers.\n",
+ "type": "Mapbox.Source.Id -> List Mapbox.Source.Url -> Mapbox.Source.Coords -> Mapbox.Source.Source"
+ }
+ ],
+ "generated-with-elm-version": "0.18.0"
+ }
+] \ No newline at end of file
diff --git a/elm-package.json b/elm-package.json
new file mode 100644
index 0000000..89cf782
--- /dev/null
+++ b/elm-package.json
@@ -0,0 +1,20 @@
+{
+ "version": "1.0.0",
+ "summary": "helpful summary of your project, less than 80 characters",
+ "repository": "https://github.com/user/project.git",
+ "license": "BSD3",
+ "source-directories": [
+ "./src"
+ ],
+ "exposed-modules": [
+ "Mapbox.Style",
+ "Mapbox.Source",
+ "Mapbox.Layer",
+ "Mapbox.Expression"
+ ],
+ "dependencies": {
+ "elm-lang/core": "5.1.1 <= v < 6.0.0",
+ "elm-lang/html": "2.0.0 <= v < 3.0.0"
+ },
+ "elm-version": "0.18.0 <= v < 0.19.0"
+}
diff --git a/examples/Light.elm b/examples/Light.elm
new file mode 100644
index 0000000..a83308a
--- /dev/null
+++ b/examples/Light.elm
@@ -0,0 +1,49 @@
+module Light exposing (main)
+
+import Html exposing (text, pre)
+import Json.Encode
+import Mapbox.Expression exposing (..)
+import Mapbox.Layer as Layer
+import Mapbox.Source as Source
+import Mapbox.Style as Style
+
+
+style =
+ Style.encode
+ { transition = Style.defaultTransition
+ , light = Style.defaultLight
+ , sources =
+ [ Source.vectorFromUrl "composite" "mapbox://mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v7" ]
+ , misc =
+ [ Style.name "light"
+ , Style.defaultCenter 20.39789404164037 43.22523201923144
+ , Style.defaultZoomLevel 1.5967483759772743
+ , Style.sprite "mapbox://sprites/seppotamminen/cjascxlb86kfe2rrvvtkd4ay1"
+ , Style.glyphs "mapbox://fonts/seppotamminen/{fontstack}/{range}.pbf"
+ ]
+ , layers =
+ [ Layer.background "background"
+ [ getProperty (str "emotion")
+ |> matchesStr (rgba 55 22 32 1) [ ( "funny", rgba 20 200 20 1 ), ( "angry", rgba 200 20 20 1 ) ]
+ |> Layer.backgroundColor
+ , zoom
+ |> interpolate Linear
+ [ ( 5, int 1 )
+ , ( 10, int 5 )
+ ]
+ |> Layer.circleRadius
+ , makeRGBColor
+ -- red is higher when feature.properties.temperature is higher
+ (getProperty (str "temperature"))
+ -- green is always zero
+ (int 0)
+ -- blue is higher when feature.properties.temperature is lower
+ (getProperty (str "temperature") |> minus (int 100))
+ |> Layer.circleColor
+ ]
+ ]
+ }
+
+
+main =
+ pre [] [ text <| Json.Encode.encode 2 style ]
diff --git a/examples/elm-package.json b/examples/elm-package.json
new file mode 100644
index 0000000..00c0096
--- /dev/null
+++ b/examples/elm-package.json
@@ -0,0 +1,15 @@
+{
+ "version": "1.0.0",
+ "summary": "helpful summary of your project, less than 80 characters",
+ "repository": "https://github.com/user/project.git",
+ "license": "BSD3",
+ "source-directories": [
+ "../src", "."
+ ],
+ "exposed-modules": [],
+ "dependencies": {
+ "elm-lang/core": "5.1.1 <= v < 6.0.0",
+ "elm-lang/html": "2.0.0 <= v < 3.0.0"
+ },
+ "elm-version": "0.18.0 <= v < 0.19.0"
+}
diff --git a/generate-elm.js b/generate-elm.js
new file mode 100644
index 0000000..1643428
--- /dev/null
+++ b/generate-elm.js
@@ -0,0 +1,359 @@
+function generateProperties(spec) {
+ const layouts = spec.layout;
+ const paints = spec.paint;
+ var codes = {};
+ var docs = {};
+ var enums = {};
+ layouts.forEach(l => {
+ const layerType = titleCase(l.split('_')[1])
+ docs[layerType] = [];
+ codes[layerType] = [];
+ Object.entries(spec[l]).forEach(([name, prop]) => {
+ if (name == 'visibility') return '';
+ if (prop.type === 'enum') {
+ enums[name] = Object.keys(prop.values).join(' | ');
+ }
+ codes[layerType].push(generateElmProperty(name, prop, layerType, 'Layout'));
+ docs[layerType].push(camelCase(name));
+ })
+ })
+ paints.forEach(l => {
+ const layerType = titleCase(l.split('_')[1])
+ Object.entries(spec[l]).forEach(([name, prop]) => {
+ if (name == 'visibility') return '';
+ if (prop.type === 'enum') {
+ enums[name] = Object.keys(prop.values).join(' | ');
+ }
+ codes[layerType].push(generateElmProperty(name, prop, layerType, 'Paint'))
+ docs[layerType].push(camelCase(name));
+ })
+ })
+ Object.values(docs).forEach(d => d.sort())
+ Object.values(codes).forEach(d => d.sort());
+ console.log(enums);
+ return `
+module Mapbox.Layer exposing (
+ Layer, SourceId, Background, Fill, Symbol, Line, Raster, Circle, FillExtrusion, Heatmap, Hillshade, LayerAttr,
+ encode,
+ background, fill, symbol, line, raster, circle, fillExtrusion, heatmap, hillshade,
+ metadata, source, sourceLayer, minzoom, maxzoom, filter, visible,
+ ${Object.values(docs).map(d => d.join(', ')).join(',\n ')})
+{-|
+Layers specify what is actually rendered on the map and are rendered in order.
+
+Except for layers of the background type, each layer needs to refer to a source. Layers take the data that they get from a source, optionally filter features, and then define how those features are styled.
+
+There are two kinds of properties: *Layout* and *Paint* properties.
+
+Layout properties are applied early in the rendering process and define how data for that layer is passed to the GPU. Changes to a layout property require an asynchronous "layout" step.
+
+Paint properties are applied later in the rendering process. Changes to a paint property are cheap and happen synchronously.
+
+
+### Working with layers
+
+@docs Layer, SourceId, encode
+
+### Layer Types
+
+@docs background, fill, symbol, line, raster, circle, fillExtrusion, heatmap, hillshade
+@docs Background, Fill, Symbol, Line, Raster, Circle, FillExtrusion, Heatmap, Hillshade
+
+### General Attributes
+
+@docs LayerAttr
+@docs metadata, source, sourceLayer, minzoom, maxzoom, filter, visible
+
+${Object.entries(docs).map(([section, docs]) => `### ${section} Attributes\n\n@docs ${docs.join(', ')}`).join('\n\n')}
+-}
+
+import Array exposing (Array)
+import Json.Decode
+import Json.Encode as Encode exposing (Value)
+import Mapbox.Expression as Expression exposing (Anchor, CameraExpression, Color, DataExpression, Expression, LineJoin)
+
+{-| Represents a layer. -}
+type Layer
+ = Layer Value
+
+{-| All layers (except background layers) need a source -}
+type alias SourceId = String
+
+{-| -}
+type Background
+ = BackgroundLayer
+
+{-| -}
+type Fill
+ = FillLayer
+
+{-| -}
+type Symbol
+ = SymbolLayer
+
+{-| -}
+type Line
+ = LineLayer
+
+{-| -}
+type Raster
+ = RasterLayer
+
+{-| -}
+type Circle
+ = CircleLayer
+
+{-| -}
+type FillExtrusion
+ = FillExtrusionLayer
+
+{-| -}
+type Heatmap
+ = HeatmapLayer
+
+{-| -}
+type Hillshade
+ = HillshadeLayer
+
+{-| Turns a layer into JSON -}
+encode : Layer -> Value
+encode (Layer value) =
+ value
+
+
+
+
+layerImpl tipe source id attrs =
+ [ ( "type", Encode.string tipe )
+ , ( "id", Encode.string id )
+ , ( "source", Encode.string source)
+ ]
+ ++ encodeAttrs attrs
+ |> Encode.object
+ |> Layer
+
+
+encodeAttrs attrs =
+ let
+ { top, layout, paint } =
+ List.foldl
+ (\\attr ({ top, layout, paint } as lists) ->
+ case attr of
+ Top key val ->
+ { lists | top = ( key, val ) :: top }
+
+ Paint key val ->
+ { lists | paint = ( key, val ) :: paint }
+
+ Layout key val ->
+ { lists | layout = ( key, val ) :: layout }
+ )
+ { top = [], layout = [], paint = [] }
+ attrs
+ in
+ ( "layout", Encode.object layout ) :: ( "paint", Encode.object paint ) :: top
+
+{-| The background color or pattern of the map. -}
+background : String -> List (LayerAttr Background) -> Layer
+background tipe id attrs =
+ [ ( "type", Encode.string "background" )
+ , ( "id", Encode.string id )
+ ]
+ ++ encodeAttrs attrs
+ |> Encode.object
+ |> Layer
+
+{-| A filled polygon with an optional stroked border. -}
+fill : String -> SourceId -> List (LayerAttr Fill) -> Layer
+fill =
+ layerImpl "fill"
+
+{-| A stroked line. -}
+line : String -> SourceId -> List (LayerAttr Line) -> Layer
+line =
+ layerImpl "line"
+
+{-| An icon or a text label. -}
+symbol : String -> SourceId -> List (LayerAttr Symbol) -> Layer
+symbol =
+ layerImpl "symbol"
+
+{-| Raster map textures such as satellite imagery. -}
+raster : String -> SourceId -> List (LayerAttr Raster) -> Layer
+raster =
+ layerImpl "raster"
+
+{-| A filled circle. -}
+circle : String -> SourceId -> List (LayerAttr Circle) -> Layer
+circle =
+ layerImpl "circle"
+
+{-| An extruded (3D) polygon. -}
+fillExtrusion : String -> SourceId -> List (LayerAttr FillExtrusion) -> Layer
+fillExtrusion =
+ layerImpl "fill-extrusion"
+
+{-| A heatmap. -}
+heatmap : String -> SourceId -> List (LayerAttr Heatmap) -> Layer
+heatmap =
+ layerImpl "heatmap"
+
+{-| Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles. -}
+hillshade : String -> SourceId -> List (LayerAttr Hillshade) -> Layer
+hillshade =
+ layerImpl "hillshade"
+
+{-| -}
+type LayerAttr tipe
+ = Top String Value
+ | Paint String Value
+ | Layout String Value
+
+
+
+-- General Attributes
+
+{-| Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'. -}
+metadata : Value -> LayerAttr all
+metadata =
+ Top "metadata"
+
+
+{-| Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources. -}
+sourceLayer : String -> LayerAttr all
+sourceLayer =
+ Encode.string >> Top "source-layer"
+
+{-| The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden. A number between 0 and 24 inclusive. -}
+minzoom : Float -> LayerAttr all
+minzoom =
+ Encode.float >> Top "minzoom"
+
+{-| The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden. A number between 0 and 24 inclusive. -}
+maxzoom : Float -> LayerAttr all
+maxzoom =
+ Encode.float >> Top "maxzoom"
+
+{-| A expression specifying conditions on source features. Only features that match the filter are displayed. -}
+filter : Expression any Bool -> LayerAttr all
+filter =
+ Expression.encode >> Top "filter"
+
+{-| Whether this layer is displayed. -}
+visible : Expression CameraExpression Bool -> LayerAttr any
+visible vis =
+ Layout "visibility" <| Expression.encode <| Expression.ifElse vis (Expression.str "visible") (Expression.str "none")
+
+${Object.entries(codes).map(([section, codes]) => `-- ${section}\n\n${codes.join('\n')}`).join('\n\n')}
+`
+}
+
+function requires(req) {
+ if (typeof req === 'string') {
+ return `Requires \`${camelCase(req)}\`.`;
+ } else if (req['!']) {
+ return `Disabled by \`${camelCase(req['!'])}\`.`;
+ } else if (req['<=']) {
+ return `Must be less than or equal to \`${camelCase(req['<='])}\`.`;
+ } else {
+ const [name, value] = Object.entries(req)[0];
+ if (Array.isArray(value)) {
+ return `Requires \`${camelCase(name)}\` to be ${
+ value
+ .reduce((prev, curr) => [prev, ', or ', curr])}.`;
+ } else {
+ return `Requires \`${camelCase(name)}\` to be \`${value}\`.`;
+ }
+ }
+}
+
+function generateElmProperty(name, prop, layerType, position) {
+ if (name == 'visibility') return ''
+ if (prop['property-type'] === 'constant') throw "Constant property type not supported";
+ const elmName = camelCase(name);
+ const exprKind = prop['sdk-support']['data-driven styling'] && prop['sdk-support']['data-driven styling'].js ? 'any' : 'CameraExpression';
+ const exprType = getElmType(prop);
+ let bounds = '';
+ if ('minimum' in prop && 'maximum' in prop) {
+ bounds = `\n\nShould be between \`${prop.minimum}\` and \`${prop.maximum}\` inclusive. `
+ } else if ('minimum' in prop) {
+ bounds = `\n\nShould be greater than or equal to \`${prop.minimum}\`. `
+ } else if ('maximum' in prop) {
+ bounds = `\n\nShould be less than or equal to \`${prop.maximum}\`. `
+ }
+ return `
+{-| ${prop.doc.replace(/`(\w+\-.+?)`/g, str => '`' + camelCase(str.substr(1)))} ${position} property. ${bounds}${prop.units ? `\nUnits in ${prop.units}. ` : ''}${prop.default !== undefined ? 'Defaults to `' + prop.default + '`. ' : ''}${prop.requires ? prop.requires.map(requires).join(' ') : ''}
+-}
+${elmName} : Expression ${exprKind} ${exprType} -> LayerAttr ${layerType}
+${elmName} =
+ Expression.encode >> ${position} "${name}"`
+}
+
+function getElmType({type, value, values}) {
+ switch(type) {
+ case 'number':
+ return 'Float';
+ case 'boolean':
+ return "Bool";
+ case 'string':
+ return 'String';
+ case 'color':
+ return 'Color';
+ case 'array':
+ switch(value) {
+ case 'number':
+ return '(Array Float)';
+ case 'string':
+ return '(Array String)';
+ }
+ case 'enum':
+ switch(Object.keys(values).join(' | ')) {
+ case "map | viewport":
+ return 'Anchor';
+ case "map | viewport | auto":
+ return 'AnchorAuto';
+ case "center | left | right | top | bottom | top-left | top-right | bottom-left | bottom-right":
+ return 'Position';
+ case 'none | width | height | both':
+ return 'TextFit';
+ case 'butt | round | square':
+ return 'LineCap';
+ case 'bevel | round | miter':
+ return 'LineJoin';
+ case 'point | line':
+ return 'SymbolPlacement';
+ case 'left | center | right':
+ return 'TextJustify';
+ case 'none | uppercase | lowercase':
+ return 'TextTransform';
+ }
+ }
+ throw `Unknown type ${type}`
+}
+
+function titleCase(str) {
+ return str.replace(/\-/, ' ').replace(
+ /\w\S*/g,
+ function(txt) {
+ return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
+ }
+ ).replace(/\s/, '');
+ }
+
+function camelCase(str) {
+ return str.replace(/(?:^\w|[A-Z]|\b\w|\-\w)/g, function(letter, index) {
+ return index == 0 ? letter.toLowerCase() : letter.toUpperCase();
+ }).replace(/(?:\s|\-)+/g, '');
+}
+
+
+function makeSignatures(name, constants) {
+ return `{-| -}
+type ${name} = ${name}
+
+ ${constants.split(' | ').map(c => `
+{-| -}
+${camelCase(name + ' ' + c)} : Expression exprType ${name}
+${camelCase(name + ' ' + c)} = Expression (Json.Encode.string "${c}")
+`).join('\n')}`
+}
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..f7f1716
--- /dev/null
+++ b/index.html
@@ -0,0 +1,7982 @@
+<!DOCTYPE HTML>
+<html><head><meta charset="UTF-8"><title>Mapbox.Style</title><style>html,head,body { padding:0; margin:0; }
+body { font-family: calibri, helvetica, arial, sans-serif; }</style><script type="text/javascript">
+(function() {
+'use strict';
+
+function F2(fun)
+{
+ function wrapper(a) { return function(b) { return fun(a,b); }; }
+ wrapper.arity = 2;
+ wrapper.func = fun;
+ return wrapper;
+}
+
+function F3(fun)
+{
+ function wrapper(a) {
+ return function(b) { return function(c) { return fun(a, b, c); }; };
+ }
+ wrapper.arity = 3;
+ wrapper.func = fun;
+ return wrapper;
+}
+
+function F4(fun)
+{
+ function wrapper(a) { return function(b) { return function(c) {
+ return function(d) { return fun(a, b, c, d); }; }; };
+ }
+ wrapper.arity = 4;
+ wrapper.func = fun;
+ return wrapper;
+}
+
+function F5(fun)
+{
+ function wrapper(a) { return function(b) { return function(c) {
+ return function(d) { return function(e) { return fun(a, b, c, d, e); }; }; }; };
+ }
+ wrapper.arity = 5;
+ wrapper.func = fun;
+ return wrapper;
+}
+
+function F6(fun)
+{
+ function wrapper(a) { return function(b) { return function(c) {
+ return function(d) { return function(e) { return function(f) {
+ return fun(a, b, c, d, e, f); }; }; }; }; };
+ }
+ wrapper.arity = 6;
+ wrapper.func = fun;
+ return wrapper;
+}
+
+function F7(fun)
+{
+ function wrapper(a) { return function(b) { return function(c) {
+ return function(d) { return function(e) { return function(f) {
+ return function(g) { return fun(a, b, c, d, e, f, g); }; }; }; }; }; };
+ }
+ wrapper.arity = 7;
+ wrapper.func = fun;
+ return wrapper;
+}
+
+function F8(fun)
+{
+ function wrapper(a) { return function(b) { return function(c) {
+ return function(d) { return function(e) { return function(f) {
+ return function(g) { return function(h) {
+ return fun(a, b, c, d, e, f, g, h); }; }; }; }; }; }; };
+ }
+ wrapper.arity = 8;
+ wrapper.func = fun;
+ return wrapper;
+}
+
+function F9(fun)
+{
+ function wrapper(a) { return function(b) { return function(c) {
+ return function(d) { return function(e) { return function(f) {
+ return function(g) { return function(h) { return function(i) {
+ return fun(a, b, c, d, e, f, g, h, i); }; }; }; }; }; }; }; };
+ }
+ wrapper.arity = 9;
+ wrapper.func = fun;
+ return wrapper;
+}
+
+function A2(fun, a, b)
+{
+ return fun.arity === 2
+ ? fun.func(a, b)
+ : fun(a)(b);
+}
+function A3(fun, a, b, c)
+{
+ return fun.arity === 3
+ ? fun.func(a, b, c)
+ : fun(a)(b)(c);
+}
+function A4(fun, a, b, c, d)
+{
+ return fun.arity === 4
+ ? fun.func(a, b, c, d)
+ : fun(a)(b)(c)(d);
+}
+function A5(fun, a, b, c, d, e)
+{
+ return fun.arity === 5
+ ? fun.func(a, b, c, d, e)
+ : fun(a)(b)(c)(d)(e);
+}
+function A6(fun, a, b, c, d, e, f)
+{
+ return fun.arity === 6
+ ? fun.func(a, b, c, d, e, f)
+ : fun(a)(b)(c)(d)(e)(f);
+}
+function A7(fun, a, b, c, d, e, f, g)
+{
+ return fun.arity === 7
+ ? fun.func(a, b, c, d, e, f, g)
+ : fun(a)(b)(c)(d)(e)(f)(g);
+}
+function A8(fun, a, b, c, d, e, f, g, h)
+{
+ return fun.arity === 8
+ ? fun.func(a, b, c, d, e, f, g, h)
+ : fun(a)(b)(c)(d)(e)(f)(g)(h);
+}
+function A9(fun, a, b, c, d, e, f, g, h, i)
+{
+ return fun.arity === 9
+ ? fun.func(a, b, c, d, e, f, g, h, i)
+ : fun(a)(b)(c)(d)(e)(f)(g)(h)(i);
+}
+//import Native.List //
+
+var _elm_lang$core$Native_Array = function() {
+
+// A RRB-Tree has two distinct data types.
+// Leaf -> "height" is always 0
+// "table" is an array of elements
+// Node -> "height" is always greater than 0
+// "table" is an array of child nodes
+// "lengths" is an array of accumulated lengths of the child nodes
+
+// M is the maximal table size. 32 seems fast. E is the allowed increase
+// of search steps when concatting to find an index. Lower values will
+// decrease balancing, but will increase search steps.
+var M = 32;
+var E = 2;
+
+// An empty array.
+var empty = {
+ ctor: '_Array',
+ height: 0,
+ table: []
+};
+
+
+function get(i, array)
+{
+ if (i < 0 || i >= length(array))
+ {
+ throw new Error(
+ 'Index ' + i + ' is out of range. Check the length of ' +
+ 'your array first or use getMaybe or getWithDefault.');
+ }
+ return unsafeGet(i, array);
+}
+
+
+function unsafeGet(i, array)
+{
+ for (var x = array.height; x > 0; x--)
+ {
+ var slot = i >> (x * 5);
+ while (array.lengths[slot] <= i)
+ {
+ slot++;
+ }
+ if (slot > 0)
+ {
+ i -= array.lengths[slot - 1];
+ }
+ array = array.table[slot];
+ }
+ return array.table[i];
+}
+
+
+// Sets the value at the index i. Only the nodes leading to i will get
+// copied and updated.
+function set(i, item, array)
+{
+ if (i < 0 || length(array) <= i)
+ {
+ return array;
+ }
+ return unsafeSet(i, item, array);
+}
+
+
+function unsafeSet(i, item, array)
+{
+ array = nodeCopy(array);
+
+ if (array.height === 0)
+ {
+ array.table[i] = item;
+ }
+ else
+ {
+ var slot = getSlot(i, array);
+ if (slot > 0)
+ {
+ i -= array.lengths[slot - 1];
+ }
+ array.table[slot] = unsafeSet(i, item, array.table[slot]);
+ }
+ return array;
+}
+
+
+function initialize(len, f)
+{
+ if (len <= 0)
+ {
+ return empty;
+ }
+ var h = Math.floor( Math.log(len) / Math.log(M) );
+ return initialize_(f, h, 0, len);
+}
+
+function initialize_(f, h, from, to)
+{
+ if (h === 0)
+ {
+ var table = new Array((to - from) % (M + 1));
+ for (var i = 0; i < table.length; i++)
+ {
+ table[i] = f(from + i);
+ }
+ return {
+ ctor: '_Array',
+ height: 0,
+ table: table
+ };
+ }
+
+ var step = Math.pow(M, h);
+ var table = new Array(Math.ceil((to - from) / step));
+ var lengths = new Array(table.length);
+ for (var i = 0; i < table.length; i++)
+ {
+ table[i] = initialize_(f, h - 1, from + (i * step), Math.min(from + ((i + 1) * step), to));
+ lengths[i] = length(table[i]) + (i > 0 ? lengths[i-1] : 0);
+ }
+ return {
+ ctor: '_Array',
+ height: h,
+ table: table,
+ lengths: lengths
+ };
+}
+
+function fromList(list)
+{
+ if (list.ctor === '[]')
+ {
+ return empty;
+ }
+
+ // Allocate M sized blocks (table) and write list elements to it.
+ var table = new Array(M);
+ var nodes = [];
+ var i = 0;
+
+ while (list.ctor !== '[]')
+ {
+ table[i] = list._0;
+ list = list._1;
+ i++;
+
+ // table is full, so we can push a leaf containing it into the
+ // next node.
+ if (i === M)
+ {
+ var leaf = {
+ ctor: '_Array',
+ height: 0,
+ table: table
+ };
+ fromListPush(leaf, nodes);
+ table = new Array(M);
+ i = 0;
+ }
+ }
+
+ // Maybe there is something left on the table.
+ if (i > 0)
+ {
+ var leaf = {
+ ctor: '_Array',
+ height: 0,
+ table: table.splice(0, i)
+ };
+ fromListPush(leaf, nodes);
+ }
+
+ // Go through all of the nodes and eventually push them into higher nodes.
+ for (var h = 0; h < nodes.length - 1; h++)
+ {
+ if (nodes[h].table.length > 0)
+ {
+ fromListPush(nodes[h], nodes);
+ }
+ }
+
+ var head = nodes[nodes.length - 1];
+ if (head.height > 0 && head.table.length === 1)
+ {
+ return head.table[0];
+ }
+ else
+ {
+ return head;
+ }
+}
+
+// Push a node into a higher node as a child.
+function fromListPush(toPush, nodes)
+{
+ var h = toPush.height;
+
+ // Maybe the node on this height does not exist.
+ if (nodes.length === h)
+ {
+ var node = {
+ ctor: '_Array',
+ height: h + 1,
+ table: [],
+ lengths: []
+ };
+ nodes.push(node);
+ }
+
+ nodes[h].table.push(toPush);
+ var len = length(toPush);
+ if (nodes[h].lengths.length > 0)
+ {
+ len += nodes[h].lengths[nodes[h].lengths.length - 1];
+ }
+ nodes[h].lengths.push(len);
+
+ if (nodes[h].table.length === M)
+ {
+ fromListPush(nodes[h], nodes);
+ nodes[h] = {
+ ctor: '_Array',
+ height: h + 1,
+ table: [],
+ lengths: []
+ };
+ }
+}
+
+// Pushes an item via push_ to the bottom right of a tree.
+function push(item, a)
+{
+ var pushed = push_(item, a);
+ if (pushed !== null)
+ {
+ return pushed;
+ }
+
+ var newTree = create(item, a.height);
+ return siblise(a, newTree);
+}
+
+// Recursively tries to push an item to the bottom-right most
+// tree possible. If there is no space left for the item,
+// null will be returned.
+function push_(item, a)
+{
+ // Handle resursion stop at leaf level.
+ if (a.height === 0)
+ {
+ if (a.table.length < M)
+ {
+ var newA = {
+ ctor: '_Array',
+ height: 0,
+ table: a.table.slice()
+ };
+ newA.table.push(item);
+ return newA;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ // Recursively push
+ var pushed = push_(item, botRight(a));
+
+ // There was space in the bottom right tree, so the slot will
+ // be updated.
+ if (pushed !== null)
+ {
+ var newA = nodeCopy(a);
+ newA.table[newA.table.length - 1] = pushed;
+ newA.lengths[newA.lengths.length - 1]++;
+ return newA;
+ }
+
+ // When there was no space left, check if there is space left
+ // for a new slot with a tree which contains only the item
+ // at the bottom.
+ if (a.table.length < M)
+ {
+ var newSlot = create(item, a.height - 1);
+ var newA = nodeCopy(a);
+ newA.table.push(newSlot);
+ newA.lengths.push(newA.lengths[newA.lengths.length - 1] + length(newSlot));
+ return newA;
+ }
+ else
+ {
+ return null;
+ }
+}
+
+// Converts an array into a list of elements.
+function toList(a)
+{
+ return toList_(_elm_lang$core$Native_List.Nil, a);
+}
+
+function toList_(list, a)
+{
+ for (var i = a.table.length - 1; i >= 0; i--)
+ {
+ list =
+ a.height === 0
+ ? _elm_lang$core$Native_List.Cons(a.table[i], list)
+ : toList_(list, a.table[i]);
+ }
+ return list;
+}
+
+// Maps a function over the elements of an array.
+function map(f, a)
+{
+ var newA = {
+ ctor: '_Array',
+ height: a.height,
+ table: new Array(a.table.length)
+ };
+ if (a.height > 0)
+ {
+ newA.lengths = a.lengths;
+ }
+ for (var i = 0; i < a.table.length; i++)
+ {
+ newA.table[i] =
+ a.height === 0
+ ? f(a.table[i])
+ : map(f, a.table[i]);
+ }
+ return newA;
+}
+
+// Maps a function over the elements with their index as first argument.
+function indexedMap(f, a)
+{
+ return indexedMap_(f, a, 0);
+}
+
+function indexedMap_(f, a, from)
+{
+ var newA = {
+ ctor: '_Array',
+ height: a.height,
+ table: new Array(a.table.length)
+ };
+ if (a.height > 0)
+ {
+ newA.lengths = a.lengths;
+ }
+ for (var i = 0; i < a.table.length; i++)
+ {
+ newA.table[i] =
+ a.height === 0
+ ? A2(f, from + i, a.table[i])
+ : indexedMap_(f, a.table[i], i == 0 ? from : from + a.lengths[i - 1]);
+ }
+ return newA;
+}
+
+function foldl(f, b, a)
+{
+ if (a.height === 0)
+ {
+ for (var i = 0; i < a.table.length; i++)
+ {
+ b = A2(f, a.table[i], b);
+ }
+ }
+ else
+ {
+ for (var i = 0; i < a.table.length; i++)
+ {
+ b = foldl(f, b, a.table[i]);
+ }
+ }
+ return b;
+}
+
+function foldr(f, b, a)
+{
+ if (a.height === 0)
+ {
+ for (var i = a.table.length; i--; )
+ {
+ b = A2(f, a.table[i], b);
+ }
+ }
+ else
+ {
+ for (var i = a.table.length; i--; )
+ {
+ b = foldr(f, b, a.table[i]);
+ }
+ }
+ return b;
+}
+
+// TODO: currently, it slices the right, then the left. This can be
+// optimized.
+function slice(from, to, a)
+{
+ if (from < 0)
+ {
+ from += length(a);
+ }
+ if (to < 0)
+ {
+ to += length(a);
+ }
+ return sliceLeft(from, sliceRight(to, a));
+}
+
+function sliceRight(to, a)
+{
+ if (to === length(a))
+ {
+ return a;
+ }
+
+ // Handle leaf level.
+ if (a.height === 0)
+ {
+ var newA = { ctor:'_Array', height:0 };
+ newA.table = a.table.slice(0, to);
+ return newA;
+ }
+
+ // Slice the right recursively.
+ var right = getSlot(to, a);
+ var sliced = sliceRight(to - (right > 0 ? a.lengths[right - 1] : 0), a.table[right]);
+
+ // Maybe the a node is not even needed, as sliced contains the whole slice.
+ if (right === 0)
+ {
+ return sliced;
+ }
+
+ // Create new node.
+ var newA = {
+ ctor: '_Array',
+ height: a.height,
+ table: a.table.slice(0, right),
+ lengths: a.lengths.slice(0, right)
+ };
+ if (sliced.table.length > 0)
+ {
+ newA.table[right] = sliced;
+ newA.lengths[right] = length(sliced) + (right > 0 ? newA.lengths[right - 1] : 0);
+ }
+ return newA;
+}
+
+function sliceLeft(from, a)
+{
+ if (from === 0)
+ {
+ return a;
+ }
+
+ // Handle leaf level.
+ if (a.height === 0)
+ {
+ var newA = { ctor:'_Array', height:0 };
+ newA.table = a.table.slice(from, a.table.length + 1);
+ return newA;
+ }
+
+ // Slice the left recursively.
+ var left = getSlot(from, a);
+ var sliced = sliceLeft(from - (left > 0 ? a.lengths[left - 1] : 0), a.table[left]);
+
+ // Maybe the a node is not even needed, as sliced contains the whole slice.
+ if (left === a.table.length - 1)
+ {
+ return sliced;
+ }
+
+ // Create new node.
+ var newA = {
+ ctor: '_Array',
+ height: a.height,
+ table: a.table.slice(left, a.table.length + 1),
+ lengths: new Array(a.table.length - left)
+ };
+ newA.table[0] = sliced;
+ var len = 0;
+ for (var i = 0; i < newA.table.length; i++)
+ {
+ len += length(newA.table[i]);
+ newA.lengths[i] = len;
+ }
+
+ return newA;
+}
+
+// Appends two trees.
+function append(a,b)
+{
+ if (a.table.length === 0)
+ {
+ return b;
+ }
+ if (b.table.length === 0)
+ {
+ return a;
+ }
+
+ var c = append_(a, b);
+
+ // Check if both nodes can be crunshed together.
+ if (c[0].table.length + c[1].table.length <= M)
+ {
+ if (c[0].table.length === 0)
+ {
+ return c[1];
+ }
+ if (c[1].table.length === 0)
+ {
+ return c[0];
+ }
+
+ // Adjust .table and .lengths
+ c[0].table = c[0].table.concat(c[1].table);
+ if (c[0].height > 0)
+ {
+ var len = length(c[0]);
+ for (var i = 0; i < c[1].lengths.length; i++)
+ {
+ c[1].lengths[i] += len;
+ }
+ c[0].lengths = c[0].lengths.concat(c[1].lengths);
+ }
+
+ return c[0];
+ }
+
+ if (c[0].height > 0)
+ {
+ var toRemove = calcToRemove(a, b);
+ if (toRemove > E)
+ {
+ c = shuffle(c[0], c[1], toRemove);
+ }
+ }
+
+ return siblise(c[0], c[1]);
+}
+
+// Returns an array of two nodes; right and left. One node _may_ be empty.
+function append_(a, b)
+{
+ if (a.height === 0 && b.height === 0)
+ {
+ return [a, b];
+ }
+
+ if (a.height !== 1 || b.height !== 1)
+ {
+ if (a.height === b.height)
+ {
+ a = nodeCopy(a);
+ b = nodeCopy(b);
+ var appended = append_(botRight(a), botLeft(b));
+
+ insertRight(a, appended[1]);
+ insertLeft(b, appended[0]);
+ }
+ else if (a.height > b.height)
+ {
+ a = nodeCopy(a);
+ var appended = append_(botRight(a), b);
+
+ insertRight(a, appended[0]);
+ b = parentise(appended[1], appended[1].height + 1);
+ }
+ else
+ {
+ b = nodeCopy(b);
+ var appended = append_(a, botLeft(b));
+
+ var left = appended[0].table.length === 0 ? 0 : 1;
+ var right = left === 0 ? 1 : 0;
+ insertLeft(b, appended[left]);
+ a = parentise(appended[right], appended[right].height + 1);
+ }
+ }
+
+ // Check if balancing is needed and return based on that.
+ if (a.table.length === 0 || b.table.length === 0)
+ {
+ return [a, b];
+ }
+
+ var toRemove = calcToRemove(a, b);
+ if (toRemove <= E)
+ {
+ return [a, b];
+ }
+ return shuffle(a, b, toRemove);
+}
+
+// Helperfunctions for append_. Replaces a child node at the side of the parent.
+function insertRight(parent, node)
+{
+ var index = parent.table.length - 1;
+ parent.table[index] = node;
+ parent.lengths[index] = length(node);
+ parent.lengths[index] += index > 0 ? parent.lengths[index - 1] : 0;
+}
+
+function insertLeft(parent, node)
+{
+ if (node.table.length > 0)
+ {
+ parent.table[0] = node;
+ parent.lengths[0] = length(node);
+
+ var len = length(parent.table[0]);
+ for (var i = 1; i < parent.lengths.length; i++)
+ {
+ len += length(parent.table[i]);
+ parent.lengths[i] = len;
+ }
+ }
+ else
+ {
+ parent.table.shift();
+ for (var i = 1; i < parent.lengths.length; i++)
+ {
+ parent.lengths[i] = parent.lengths[i] - parent.lengths[0];
+ }
+ parent.lengths.shift();
+ }
+}
+
+// Returns the extra search steps for E. Refer to the paper.
+function calcToRemove(a, b)
+{
+ var subLengths = 0;
+ for (var i = 0; i < a.table.length; i++)
+ {
+ subLengths += a.table[i].table.length;
+ }
+ for (var i = 0; i < b.table.length; i++)
+ {
+ subLengths += b.table[i].table.length;
+ }
+
+ var toRemove = a.table.length + b.table.length;
+ return toRemove - (Math.floor((subLengths - 1) / M) + 1);
+}
+
+// get2, set2 and saveSlot are helpers for accessing elements over two arrays.
+function get2(a, b, index)
+{
+ return index < a.length
+ ? a[index]
+ : b[index - a.length];
+}
+
+function set2(a, b, index, value)
+{
+ if (index < a.length)
+ {
+ a[index] = value;
+ }
+ else
+ {
+ b[index - a.length] = value;
+ }
+}
+
+function saveSlot(a, b, index, slot)
+{
+ set2(a.table, b.table, index, slot);
+
+ var l = (index === 0 || index === a.lengths.length)
+ ? 0
+ : get2(a.lengths, a.lengths, index - 1);
+
+ set2(a.lengths, b.lengths, index, l + length(slot));
+}
+
+// Creates a node or leaf with a given length at their arrays for perfomance.
+// Is only used by shuffle.
+function createNode(h, length)
+{
+ if (length < 0)
+ {
+ length = 0;
+ }
+ var a = {
+ ctor: '_Array',
+ height: h,
+ table: new Array(length)
+ };
+ if (h > 0)
+ {
+ a.lengths = new Array(length);
+ }
+ return a;
+}
+
+// Returns an array of two balanced nodes.
+function shuffle(a, b, toRemove)
+{
+ var newA = createNode(a.height, Math.min(M, a.table.length + b.table.length - toRemove));
+ var newB = createNode(a.height, newA.table.length - (a.table.length + b.table.length - toRemove));
+
+ // Skip the slots with size M. More precise: copy the slot references
+ // to the new node
+ var read = 0;
+ while (get2(a.table, b.table, read).table.length % M === 0)
+ {
+ set2(newA.table, newB.table, read, get2(a.table, b.table, read));
+ set2(newA.lengths, newB.lengths, read, get2(a.lengths, b.lengths, read));
+ read++;
+ }
+
+ // Pulling items from left to right, caching in a slot before writing
+ // it into the new nodes.
+ var write = read;
+ var slot = new createNode(a.height - 1, 0);
+ var from = 0;
+
+ // If the current slot is still containing data, then there will be at
+ // least one more write, so we do not break this loop yet.
+ while (read - write - (slot.table.length > 0 ? 1 : 0) < toRemove)
+ {
+ // Find out the max possible items for copying.
+ var source = get2(a.table, b.table, read);
+ var to = Math.min(M - slot.table.length, source.table.length);
+
+ // Copy and adjust size table.
+ slot.table = slot.table.concat(source.table.slice(from, to));
+ if (slot.height > 0)
+ {
+ var len = slot.lengths.length;
+ for (var i = len; i < len + to - from; i++)
+ {
+ slot.lengths[i] = length(slot.table[i]);
+ slot.lengths[i] += (i > 0 ? slot.lengths[i - 1] : 0);
+ }
+ }
+
+ from += to;
+
+ // Only proceed to next slots[i] if the current one was
+ // fully copied.
+ if (source.table.length <= to)
+ {
+ read++; from = 0;
+ }
+
+ // Only create a new slot if the current one is filled up.
+ if (slot.table.length === M)
+ {
+ saveSlot(newA, newB, write, slot);
+ slot = createNode(a.height - 1, 0);
+ write++;
+ }
+ }
+
+ // Cleanup after the loop. Copy the last slot into the new nodes.
+ if (slot.table.length > 0)
+ {
+ saveSlot(newA, newB, write, slot);
+ write++;
+ }
+
+ // Shift the untouched slots to the left
+ while (read < a.table.length + b.table.length )
+ {
+ saveSlot(newA, newB, write, get2(a.table, b.table, read));
+ read++;
+ write++;
+ }
+
+ return [newA, newB];
+}
+
+// Navigation functions
+function botRight(a)
+{
+ return a.table[a.table.length - 1];
+}
+function botLeft(a)
+{
+ return a.table[0];
+}
+
+// Copies a node for updating. Note that you should not use this if
+// only updating only one of "table" or "lengths" for performance reasons.
+function nodeCopy(a)
+{
+ var newA = {
+ ctor: '_Array',
+ height: a.height,
+ table: a.table.slice()
+ };
+ if (a.height > 0)
+ {
+ newA.lengths = a.lengths.slice();
+ }
+ return newA;
+}
+
+// Returns how many items are in the tree.
+function length(array)
+{
+ if (array.height === 0)
+ {
+ return array.table.length;
+ }
+ else
+ {
+ return array.lengths[array.lengths.length - 1];
+ }
+}
+
+// Calculates in which slot of "table" the item probably is, then
+// find the exact slot via forward searching in "lengths". Returns the index.
+function getSlot(i, a)
+{
+ var slot = i >> (5 * a.height);
+ while (a.lengths[slot] <= i)
+ {
+ slot++;
+ }
+ return slot;
+}
+
+// Recursively creates a tree with a given height containing
+// only the given item.
+function create(item, h)
+{
+ if (h === 0)
+ {
+ return {
+ ctor: '_Array',
+ height: 0,
+ table: [item]
+ };
+ }
+ return {
+ ctor: '_Array',
+ height: h,
+ table: [create(item, h - 1)],
+ lengths: [1]
+ };
+}
+
+// Recursively creates a tree that contains the given tree.
+function parentise(tree, h)
+{
+ if (h === tree.height)
+ {
+ return tree;
+ }
+
+ return {
+ ctor: '_Array',
+ height: h,
+ table: [parentise(tree, h - 1)],
+ lengths: [length(tree)]
+ };
+}
+
+// Emphasizes blood brotherhood beneath two trees.
+function siblise(a, b)
+{
+ return {
+ ctor: '_Array',
+ height: a.height + 1,
+ table: [a, b],
+ lengths: [length(a), length(a) + length(b)]
+ };
+}
+
+function toJSArray(a)
+{
+ var jsArray = new Array(length(a));
+ toJSArray_(jsArray, 0, a);
+ return jsArray;
+}
+
+function toJSArray_(jsArray, i, a)
+{
+ for (var t = 0; t < a.table.length; t++)
+ {
+ if (a.height === 0)
+ {
+ jsArray[i + t] = a.table[t];
+ }
+ else
+ {
+ var inc = t === 0 ? 0 : a.lengths[t - 1];
+ toJSArray_(jsArray, i + inc, a.table[t]);
+ }
+ }
+}
+
+function fromJSArray(jsArray)
+{
+ if (jsArray.length === 0)
+ {
+ return empty;
+ }
+ var h = Math.floor(Math.log(jsArray.length) / Math.log(M));
+ return fromJSArray_(jsArray, h, 0, jsArray.length);
+}
+
+function fromJSArray_(jsArray, h, from, to)
+{
+ if (h === 0)
+ {
+ return {
+ ctor: '_Array',
+ height: 0,
+ table: jsArray.slice(from, to)
+ };
+ }
+
+ var step = Math.pow(M, h);
+ var table = new Array(Math.ceil((to - from) / step));
+ var lengths = new Array(table.length);
+ for (var i = 0; i < table.length; i++)
+ {
+ table[i] = fromJSArray_(jsArray, h - 1, from + (i * step), Math.min(from + ((i + 1) * step), to));
+ lengths[i] = length(table[i]) + (i > 0 ? lengths[i - 1] : 0);
+ }
+ return {
+ ctor: '_Array',
+ height: h,
+ table: table,
+ lengths: lengths
+ };
+}
+
+return {
+ empty: empty,
+ fromList: fromList,
+ toList: toList,
+ initialize: F2(initialize),
+ append: F2(append),
+ push: F2(push),
+ slice: F3(slice),
+ get: F2(get),
+ set: F3(set),
+ map: F2(map),
+ indexedMap: F2(indexedMap),
+ foldl: F3(foldl),
+ foldr: F3(foldr),
+ length: length,
+
+ toJSArray: toJSArray,
+ fromJSArray: fromJSArray
+};
+
+}();//import Native.Utils //
+
+var _elm_lang$core$Native_Basics = function() {
+
+function div(a, b)
+{
+ return (a / b) | 0;
+}
+function rem(a, b)
+{
+ return a % b;
+}
+function mod(a, b)
+{
+ if (b === 0)
+ {
+ throw new Error('Cannot perform mod 0. Division by zero error.');
+ }
+ var r = a % b;
+ var m = a === 0 ? 0 : (b > 0 ? (a >= 0 ? r : r + b) : -mod(-a, -b));
+
+ return m === b ? 0 : m;
+}
+function logBase(base, n)
+{
+ return Math.log(n) / Math.log(base);
+}
+function negate(n)
+{
+ return -n;
+}
+function abs(n)
+{
+ return n < 0 ? -n : n;
+}
+
+function min(a, b)
+{
+ return _elm_lang$core$Native_Utils.cmp(a, b) < 0 ? a : b;
+}
+function max(a, b)
+{
+ return _elm_lang$core$Native_Utils.cmp(a, b) > 0 ? a : b;
+}
+function clamp(lo, hi, n)
+{
+ return _elm_lang$core$Native_Utils.cmp(n, lo) < 0
+ ? lo
+ : _elm_lang$core$Native_Utils.cmp(n, hi) > 0
+ ? hi
+ : n;
+}
+
+var ord = ['LT', 'EQ', 'GT'];
+
+function compare(x, y)
+{
+ return { ctor: ord[_elm_lang$core$Native_Utils.cmp(x, y) + 1] };
+}
+
+function xor(a, b)
+{
+ return a !== b;
+}
+function not(b)
+{
+ return !b;
+}
+function isInfinite(n)
+{
+ return n === Infinity || n === -Infinity;
+}
+
+function truncate(n)
+{
+ return n | 0;
+}
+
+function degrees(d)
+{
+ return d * Math.PI / 180;
+}
+function turns(t)
+{
+ return 2 * Math.PI * t;
+}
+function fromPolar(point)
+{
+ var r = point._0;
+ var t = point._1;
+ return _elm_lang$core$Native_Utils.Tuple2(r * Math.cos(t), r * Math.sin(t));
+}
+function toPolar(point)
+{
+ var x = point._0;
+ var y = point._1;
+ return _elm_lang$core$Native_Utils.Tuple2(Math.sqrt(x * x + y * y), Math.atan2(y, x));
+}
+
+return {
+ div: F2(div),
+ rem: F2(rem),
+ mod: F2(mod),
+
+ pi: Math.PI,
+ e: Math.E,
+ cos: Math.cos,
+ sin: Math.sin,
+ tan: Math.tan,
+ acos: Math.acos,
+ asin: Math.asin,
+ atan: Math.atan,
+ atan2: F2(Math.atan2),
+
+ degrees: degrees,
+ turns: turns,
+ fromPolar: fromPolar,
+ toPolar: toPolar,
+
+ sqrt: Math.sqrt,
+ logBase: F2(logBase),
+ negate: negate,
+ abs: abs,
+ min: F2(min),
+ max: F2(max),
+ clamp: F3(clamp),
+ compare: F2(compare),
+
+ xor: F2(xor),
+ not: not,
+
+ truncate: truncate,
+ ceiling: Math.ceil,
+ floor: Math.floor,
+ round: Math.round,
+ toFloat: function(x) { return x; },
+ isNaN: isNaN,
+ isInfinite: isInfinite
+};
+
+}();//import //
+
+var _elm_lang$core$Native_Utils = function() {
+
+// COMPARISONS
+
+function eq(x, y)
+{
+ var stack = [];
+ var isEqual = eqHelp(x, y, 0, stack);
+ var pair;
+ while (isEqual && (pair = stack.pop()))
+ {
+ isEqual = eqHelp(pair.x, pair.y, 0, stack);
+ }
+ return isEqual;
+}
+
+
+function eqHelp(x, y, depth, stack)
+{
+ if (depth > 100)
+ {
+ stack.push({ x: x, y: y });
+ return true;
+ }
+
+ if (x === y)
+ {
+ return true;
+ }
+
+ if (typeof x !== 'object')
+ {
+ if (typeof x === 'function')
+ {
+ throw new Error(
+ 'Trying to use `(==)` on functions. There is no way to know if functions are "the same" in the Elm sense.'
+ + ' Read more about this at http://package.elm-lang.org/packages/elm-lang/core/latest/Basics#=='
+ + ' which describes why it is this way and what the better version will look like.'
+ );
+ }
+ return false;
+ }
+
+ if (x === null || y === null)
+ {
+ return false
+ }
+
+ if (x instanceof Date)
+ {
+ return x.getTime() === y.getTime();
+ }
+
+ if (!('ctor' in x))
+ {
+ for (var key in x)
+ {
+ if (!eqHelp(x[key], y[key], depth + 1, stack))
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ // convert Dicts and Sets to lists
+ if (x.ctor === 'RBNode_elm_builtin' || x.ctor === 'RBEmpty_elm_builtin')
+ {
+ x = _elm_lang$core$Dict$toList(x);
+ y = _elm_lang$core$Dict$toList(y);
+ }
+ if (x.ctor === 'Set_elm_builtin')
+ {
+ x = _elm_lang$core$Set$toList(x);
+ y = _elm_lang$core$Set$toList(y);
+ }
+
+ // check if lists are equal without recursion
+ if (x.ctor === '::')
+ {
+ var a = x;
+ var b = y;
+ while (a.ctor === '::' && b.ctor === '::')
+ {
+ if (!eqHelp(a._0, b._0, depth + 1, stack))
+ {
+ return false;
+ }
+ a = a._1;
+ b = b._1;
+ }
+ return a.ctor === b.ctor;
+ }
+
+ // check if Arrays are equal
+ if (x.ctor === '_Array')
+ {
+ var xs = _elm_lang$core$Native_Array.toJSArray(x);
+ var ys = _elm_lang$core$Native_Array.toJSArray(y);
+ if (xs.length !== ys.length)
+ {
+ return false;
+ }
+ for (var i = 0; i < xs.length; i++)
+ {
+ if (!eqHelp(xs[i], ys[i], depth + 1, stack))
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ if (!eqHelp(x.ctor, y.ctor, depth + 1, stack))
+ {
+ return false;
+ }
+
+ for (var key in x)
+ {
+ if (!eqHelp(x[key], y[key], depth + 1, stack))
+ {
+ return false;
+ }
+ }
+ return true;
+}
+
+// Code in Generate/JavaScript.hs, Basics.js, and List.js depends on
+// the particular integer values assigned to LT, EQ, and GT.
+
+var LT = -1, EQ = 0, GT = 1;
+
+function cmp(x, y)
+{
+ if (typeof x !== 'object')
+ {
+ return x === y ? EQ : x < y ? LT : GT;
+ }
+
+ if (x instanceof String)
+ {
+ var a = x.valueOf();
+ var b = y.valueOf();
+ return a === b ? EQ : a < b ? LT : GT;
+ }
+
+ if (x.ctor === '::' || x.ctor === '[]')
+ {
+ while (x.ctor === '::' && y.ctor === '::')
+ {
+ var ord = cmp(x._0, y._0);
+ if (ord !== EQ)
+ {
+ return ord;
+ }
+ x = x._1;
+ y = y._1;
+ }
+ return x.ctor === y.ctor ? EQ : x.ctor === '[]' ? LT : GT;
+ }
+
+ if (x.ctor.slice(0, 6) === '_Tuple')
+ {
+ var ord;
+ var n = x.ctor.slice(6) - 0;
+ var err = 'cannot compare tuples with more than 6 elements.';
+ if (n === 0) return EQ;
+ if (n >= 1) { ord = cmp(x._0, y._0); if (ord !== EQ) return ord;
+ if (n >= 2) { ord = cmp(x._1, y._1); if (ord !== EQ) return ord;
+ if (n >= 3) { ord = cmp(x._2, y._2); if (ord !== EQ) return ord;
+ if (n >= 4) { ord = cmp(x._3, y._3); if (ord !== EQ) return ord;
+ if (n >= 5) { ord = cmp(x._4, y._4); if (ord !== EQ) return ord;
+ if (n >= 6) { ord = cmp(x._5, y._5); if (ord !== EQ) return ord;
+ if (n >= 7) throw new Error('Comparison error: ' + err); } } } } } }
+ return EQ;
+ }
+
+ throw new Error(
+ 'Comparison error: comparison is only defined on ints, '
+ + 'floats, times, chars, strings, lists of comparable values, '
+ + 'and tuples of comparable values.'
+ );
+}
+
+
+// COMMON VALUES
+
+var Tuple0 = {
+ ctor: '_Tuple0'
+};
+
+function Tuple2(x, y)
+{
+ return {
+ ctor: '_Tuple2',
+ _0: x,
+ _1: y
+ };
+}
+
+function chr(c)
+{
+ return new String(c);
+}
+
+
+// GUID
+
+var count = 0;
+function guid(_)
+{
+ return count++;
+}
+
+
+// RECORDS
+
+function update(oldRecord, updatedFields)
+{
+ var newRecord = {};
+
+ for (var key in oldRecord)
+ {
+ newRecord[key] = oldRecord[key];
+ }
+
+ for (var key in updatedFields)
+ {
+ newRecord[key] = updatedFields[key];
+ }
+
+ return newRecord;
+}
+
+
+//// LIST STUFF ////
+
+var Nil = { ctor: '[]' };
+
+function Cons(hd, tl)
+{
+ return {
+ ctor: '::',
+ _0: hd,
+ _1: tl
+ };
+}
+
+function append(xs, ys)
+{
+ // append Strings
+ if (typeof xs === 'string')
+ {
+ return xs + ys;
+ }
+
+ // append Lists
+ if (xs.ctor === '[]')
+ {
+ return ys;
+ }
+ var root = Cons(xs._0, Nil);
+ var curr = root;
+ xs = xs._1;
+ while (xs.ctor !== '[]')
+ {
+ curr._1 = Cons(xs._0, Nil);
+ xs = xs._1;
+ curr = curr._1;
+ }
+ curr._1 = ys;
+ return root;
+}
+
+
+// CRASHES
+
+function crash(moduleName, region)
+{
+ return function(message) {
+ throw new Error(
+ 'Ran into a `Debug.crash` in module `' + moduleName + '` ' + regionToString(region) + '\n'
+ + 'The message provided by the code author is:\n\n '
+ + message
+ );
+ };
+}
+
+function crashCase(moduleName, region, value)
+{
+ return function(message) {
+ throw new Error(
+ 'Ran into a `Debug.crash` in module `' + moduleName + '`\n\n'
+ + 'This was caused by the `case` expression ' + regionToString(region) + '.\n'
+ + 'One of the branches ended with a crash and the following value got through:\n\n ' + toString(value) + '\n\n'
+ + 'The message provided by the code author is:\n\n '
+ + message
+ );
+ };
+}
+
+function regionToString(region)
+{
+ if (region.start.line == region.end.line)
+ {
+ return 'on line ' + region.start.line;
+ }
+ return 'between lines ' + region.start.line + ' and ' + region.end.line;
+}
+
+
+// TO STRING
+
+function toString(v)
+{
+ var type = typeof v;
+ if (type === 'function')
+ {
+ return '<function>';
+ }
+
+ if (type === 'boolean')
+ {
+ return v ? 'True' : 'False';
+ }
+
+ if (type === 'number')
+ {
+ return v + '';
+ }
+
+ if (v instanceof String)
+ {
+ return '\'' + addSlashes(v, true) + '\'';
+ }
+
+ if (type === 'string')
+ {
+ return '"' + addSlashes(v, false) + '"';
+ }
+
+ if (v === null)
+ {
+ return 'null';
+ }
+
+ if (type === 'object' && 'ctor' in v)
+ {
+ var ctorStarter = v.ctor.substring(0, 5);
+
+ if (ctorStarter === '_Tupl')
+ {
+ var output = [];
+ for (var k in v)
+ {
+ if (k === 'ctor') continue;
+ output.push(toString(v[k]));
+ }
+ return '(' + output.join(',') + ')';
+ }
+
+ if (ctorStarter === '_Task')
+ {
+ return '<task>'
+ }
+
+ if (v.ctor === '_Array')
+ {
+ var list = _elm_lang$core$Array$toList(v);
+ return 'Array.fromList ' + toString(list);
+ }
+
+ if (v.ctor === '<decoder>')
+ {
+ return '<decoder>';
+ }
+
+ if (v.ctor === '_Process')
+ {
+ return '<process:' + v.id + '>';
+ }
+
+ if (v.ctor === '::')
+ {
+ var output = '[' + toString(v._0);
+ v = v._1;
+ while (v.ctor === '::')
+ {
+ output += ',' + toString(v._0);
+ v = v._1;
+ }
+ return output + ']';
+ }
+
+ if (v.ctor === '[]')
+ {
+ return '[]';
+ }
+
+ if (v.ctor === 'Set_elm_builtin')
+ {
+ return 'Set.fromList ' + toString(_elm_lang$core$Set$toList(v));
+ }
+
+ if (v.ctor === 'RBNode_elm_builtin' || v.ctor === 'RBEmpty_elm_builtin')
+ {
+ return 'Dict.fromList ' + toString(_elm_lang$core$Dict$toList(v));
+ }
+
+ var output = '';
+ for (var i in v)
+ {
+ if (i === 'ctor') continue;
+ var str = toString(v[i]);
+ var c0 = str[0];
+ var parenless = c0 === '{' || c0 === '(' || c0 === '<' || c0 === '"' || str.indexOf(' ') < 0;
+ output += ' ' + (parenless ? str : '(' + str + ')');
+ }
+ return v.ctor + output;
+ }
+
+ if (type === 'object')
+ {
+ if (v instanceof Date)
+ {
+ return '<' + v.toString() + '>';
+ }
+
+ if (v.elm_web_socket)
+ {
+ return '<websocket>';
+ }
+
+ var output = [];
+ for (var k in v)
+ {
+ output.push(k + ' = ' + toString(v[k]));
+ }
+ if (output.length === 0)
+ {
+ return '{}';
+ }
+ return '{ ' + output.join(', ') + ' }';
+ }
+
+ return '<internal structure>';
+}
+
+function addSlashes(str, isChar)
+{
+ var s = str.replace(/\\/g, '\\\\')
+ .replace(/\n/g, '\\n')
+ .replace(/\t/g, '\\t')
+ .replace(/\r/g, '\\r')
+ .replace(/\v/g, '\\v')
+ .replace(/\0/g, '\\0');
+ if (isChar)
+ {
+ return s.replace(/\'/g, '\\\'');
+ }
+ else
+ {
+ return s.replace(/\"/g, '\\"');
+ }
+}
+
+
+return {
+ eq: eq,
+ cmp: cmp,
+ Tuple0: Tuple0,
+ Tuple2: Tuple2,
+ chr: chr,
+ update: update,
+ guid: guid,
+
+ append: F2(append),
+
+ crash: crash,
+ crashCase: crashCase,
+
+ toString: toString
+};
+
+}();var _elm_lang$core$Basics$never = function (_p0) {
+ never:
+ while (true) {
+ var _p1 = _p0;
+ var _v1 = _p1._0;
+ _p0 = _v1;
+ continue never;
+ }
+};
+var _elm_lang$core$Basics$uncurry = F2(
+ function (f, _p2) {
+ var _p3 = _p2;
+ return A2(f, _p3._0, _p3._1);
+ });
+var _elm_lang$core$Basics$curry = F3(
+ function (f, a, b) {
+ return f(
+ {ctor: '_Tuple2', _0: a, _1: b});
+ });
+var _elm_lang$core$Basics$flip = F3(
+ function (f, b, a) {
+ return A2(f, a, b);
+ });
+var _elm_lang$core$Basics$always = F2(
+ function (a, _p4) {
+ return a;
+ });
+var _elm_lang$core$Basics$identity = function (x) {
+ return x;
+};
+var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {};
+_elm_lang$core$Basics_ops['<|'] = F2(
+ function (f, x) {
+ return f(x);
+ });
+var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {};
+_elm_lang$core$Basics_ops['|>'] = F2(
+ function (x, f) {
+ return f(x);
+ });
+var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {};
+_elm_lang$core$Basics_ops['>>'] = F3(
+ function (f, g, x) {
+ return g(
+ f(x));
+ });
+var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {};
+_elm_lang$core$Basics_ops['<<'] = F3(
+ function (g, f, x) {
+ return g(
+ f(x));
+ });
+var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {};
+_elm_lang$core$Basics_ops['++'] = _elm_lang$core$Native_Utils.append;
+var _elm_lang$core$Basics$toString = _elm_lang$core$Native_Utils.toString;
+var _elm_lang$core$Basics$isInfinite = _elm_lang$core$Native_Basics.isInfinite;
+var _elm_lang$core$Basics$isNaN = _elm_lang$core$Native_Basics.isNaN;
+var _elm_lang$core$Basics$toFloat = _elm_lang$core$Native_Basics.toFloat;
+var _elm_lang$core$Basics$ceiling = _elm_lang$core$Native_Basics.ceiling;
+var _elm_lang$core$Basics$floor = _elm_lang$core$Native_Basics.floor;
+var _elm_lang$core$Basics$truncate = _elm_lang$core$Native_Basics.truncate;
+var _elm_lang$core$Basics$round = _elm_lang$core$Native_Basics.round;
+var _elm_lang$core$Basics$not = _elm_lang$core$Native_Basics.not;
+var _elm_lang$core$Basics$xor = _elm_lang$core$Native_Basics.xor;
+var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {};
+_elm_lang$core$Basics_ops['||'] = _elm_lang$core$Native_Basics.or;
+var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {};
+_elm_lang$core$Basics_ops['&&'] = _elm_lang$core$Native_Basics.and;
+var _elm_lang$core$Basics$max = _elm_lang$core$Native_Basics.max;
+var _elm_lang$core$Basics$min = _elm_lang$core$Native_Basics.min;
+var _elm_lang$core$Basics$compare = _elm_lang$core$Native_Basics.compare;
+var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {};
+_elm_lang$core$Basics_ops['>='] = _elm_lang$core$Native_Basics.ge;
+var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {};
+_elm_lang$core$Basics_ops['<='] = _elm_lang$core$Native_Basics.le;
+var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {};
+_elm_lang$core$Basics_ops['>'] = _elm_lang$core$Native_Basics.gt;
+var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {};
+_elm_lang$core$Basics_ops['<'] = _elm_lang$core$Native_Basics.lt;
+var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {};
+_elm_lang$core$Basics_ops['/='] = _elm_lang$core$Native_Basics.neq;
+var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {};
+_elm_lang$core$Basics_ops['=='] = _elm_lang$core$Native_Basics.eq;
+var _elm_lang$core$Basics$e = _elm_lang$core$Native_Basics.e;
+var _elm_lang$core$Basics$pi = _elm_lang$core$Native_Basics.pi;
+var _elm_lang$core$Basics$clamp = _elm_lang$core$Native_Basics.clamp;
+var _elm_lang$core$Basics$logBase = _elm_lang$core$Native_Basics.logBase;
+var _elm_lang$core$Basics$abs = _elm_lang$core$Native_Basics.abs;
+var _elm_lang$core$Basics$negate = _elm_lang$core$Native_Basics.negate;
+var _elm_lang$core$Basics$sqrt = _elm_lang$core$Native_Basics.sqrt;
+var _elm_lang$core$Basics$atan2 = _elm_lang$core$Native_Basics.atan2;
+var _elm_lang$core$Basics$atan = _elm_lang$core$Native_Basics.atan;
+var _elm_lang$core$Basics$asin = _elm_lang$core$Native_Basics.asin;
+var _elm_lang$core$Basics$acos = _elm_lang$core$Native_Basics.acos;
+var _elm_lang$core$Basics$tan = _elm_lang$core$Native_Basics.tan;
+var _elm_lang$core$Basics$sin = _elm_lang$core$Native_Basics.sin;
+var _elm_lang$core$Basics$cos = _elm_lang$core$Native_Basics.cos;
+var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {};
+_elm_lang$core$Basics_ops['^'] = _elm_lang$core$Native_Basics.exp;
+var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {};
+_elm_lang$core$Basics_ops['%'] = _elm_lang$core$Native_Basics.mod;
+var _elm_lang$core$Basics$rem = _elm_lang$core$Native_Basics.rem;
+var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {};
+_elm_lang$core$Basics_ops['//'] = _elm_lang$core$Native_Basics.div;
+var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {};
+_elm_lang$core$Basics_ops['/'] = _elm_lang$core$Native_Basics.floatDiv;
+var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {};
+_elm_lang$core$Basics_ops['*'] = _elm_lang$core$Native_Basics.mul;
+var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {};
+_elm_lang$core$Basics_ops['-'] = _elm_lang$core$Native_Basics.sub;
+var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {};
+_elm_lang$core$Basics_ops['+'] = _elm_lang$core$Native_Basics.add;
+var _elm_lang$core$Basics$toPolar = _elm_lang$core$Native_Basics.toPolar;
+var _elm_lang$core$Basics$fromPolar = _elm_lang$core$Native_Basics.fromPolar;
+var _elm_lang$core$Basics$turns = _elm_lang$core$Native_Basics.turns;
+var _elm_lang$core$Basics$degrees = _elm_lang$core$Native_Basics.degrees;
+var _elm_lang$core$Basics$radians = function (t) {
+ return t;
+};
+var _elm_lang$core$Basics$GT = {ctor: 'GT'};
+var _elm_lang$core$Basics$EQ = {ctor: 'EQ'};
+var _elm_lang$core$Basics$LT = {ctor: 'LT'};
+var _elm_lang$core$Basics$JustOneMore = function (a) {
+ return {ctor: 'JustOneMore', _0: a};
+};
+var _elm_lang$core$Maybe$withDefault = F2(
+ function ($default, maybe) {
+ var _p0 = maybe;
+ if (_p0.ctor === 'Just') {
+ return _p0._0;
+ } else {
+ return $default;
+ }
+ });
+var _elm_lang$core$Maybe$Nothing = {ctor: 'Nothing'};
+var _elm_lang$core$Maybe$andThen = F2(
+ function (callback, maybeValue) {
+ var _p1 = maybeValue;
+ if (_p1.ctor === 'Just') {
+ return callback(_p1._0);
+ } else {
+ return _elm_lang$core$Maybe$Nothing;
+ }
+ });
+var _elm_lang$core$Maybe$Just = function (a) {
+ return {ctor: 'Just', _0: a};
+};
+var _elm_lang$core$Maybe$map = F2(
+ function (f, maybe) {
+ var _p2 = maybe;
+ if (_p2.ctor === 'Just') {
+ return _elm_lang$core$Maybe$Just(
+ f(_p2._0));
+ } else {
+ return _elm_lang$core$Maybe$Nothing;
+ }
+ });
+var _elm_lang$core$Maybe$map2 = F3(
+ function (func, ma, mb) {
+ var _p3 = {ctor: '_Tuple2', _0: ma, _1: mb};
+ if (((_p3.ctor === '_Tuple2') && (_p3._0.ctor === 'Just')) && (_p3._1.ctor === 'Just')) {
+ return _elm_lang$core$Maybe$Just(
+ A2(func, _p3._0._0, _p3._1._0));
+ } else {
+ return _elm_lang$core$Maybe$Nothing;
+ }
+ });
+var _elm_lang$core$Maybe$map3 = F4(
+ function (func, ma, mb, mc) {
+ var _p4 = {ctor: '_Tuple3', _0: ma, _1: mb, _2: mc};
+ if ((((_p4.ctor === '_Tuple3') && (_p4._0.ctor === 'Just')) && (_p4._1.ctor === 'Just')) && (_p4._2.ctor === 'Just')) {
+ return _elm_lang$core$Maybe$Just(
+ A3(func, _p4._0._0, _p4._1._0, _p4._2._0));
+ } else {
+ return _elm_lang$core$Maybe$Nothing;
+ }
+ });
+var _elm_lang$core$Maybe$map4 = F5(
+ function (func, ma, mb, mc, md) {
+ var _p5 = {ctor: '_Tuple4', _0: ma, _1: mb, _2: mc, _3: md};
+ if (((((_p5.ctor === '_Tuple4') && (_p5._0.ctor === 'Just')) && (_p5._1.ctor === 'Just')) && (_p5._2.ctor === 'Just')) && (_p5._3.ctor === 'Just')) {
+ return _elm_lang$core$Maybe$Just(
+ A4(func, _p5._0._0, _p5._1._0, _p5._2._0, _p5._3._0));
+ } else {
+ return _elm_lang$core$Maybe$Nothing;
+ }
+ });
+var _elm_lang$core$Maybe$map5 = F6(
+ function (func, ma, mb, mc, md, me) {
+ var _p6 = {ctor: '_Tuple5', _0: ma, _1: mb, _2: mc, _3: md, _4: me};
+ if ((((((_p6.ctor === '_Tuple5') && (_p6._0.ctor === 'Just')) && (_p6._1.ctor === 'Just')) && (_p6._2.ctor === 'Just')) && (_p6._3.ctor === 'Just')) && (_p6._4.ctor === 'Just')) {
+ return _elm_lang$core$Maybe$Just(
+ A5(func, _p6._0._0, _p6._1._0, _p6._2._0, _p6._3._0, _p6._4._0));
+ } else {
+ return _elm_lang$core$Maybe$Nothing;
+ }
+ });
+//import Native.Utils //
+
+var _elm_lang$core$Native_List = function() {
+
+var Nil = { ctor: '[]' };
+
+function Cons(hd, tl)
+{
+ return { ctor: '::', _0: hd, _1: tl };
+}
+
+function fromArray(arr)
+{
+ var out = Nil;
+ for (var i = arr.length; i--; )
+ {
+ out = Cons(arr[i], out);
+ }
+ return out;
+}
+
+function toArray(xs)
+{
+ var out = [];
+ while (xs.ctor !== '[]')
+ {
+ out.push(xs._0);
+ xs = xs._1;
+ }
+ return out;
+}
+
+function foldr(f, b, xs)
+{
+ var arr = toArray(xs);
+ var acc = b;
+ for (var i = arr.length; i--; )
+ {
+ acc = A2(f, arr[i], acc);
+ }
+ return acc;
+}
+
+function map2(f, xs, ys)
+{
+ var arr = [];
+ while (xs.ctor !== '[]' && ys.ctor !== '[]')
+ {
+ arr.push(A2(f, xs._0, ys._0));
+ xs = xs._1;
+ ys = ys._1;
+ }
+ return fromArray(arr);
+}
+
+function map3(f, xs, ys, zs)
+{
+ var arr = [];
+ while (xs.ctor !== '[]' && ys.ctor !== '[]' && zs.ctor !== '[]')
+ {
+ arr.push(A3(f, xs._0, ys._0, zs._0));
+ xs = xs._1;
+ ys = ys._1;
+ zs = zs._1;
+ }
+ return fromArray(arr);
+}
+
+function map4(f, ws, xs, ys, zs)
+{
+ var arr = [];
+ while ( ws.ctor !== '[]'
+ && xs.ctor !== '[]'
+ && ys.ctor !== '[]'
+ && zs.ctor !== '[]')
+ {
+ arr.push(A4(f, ws._0, xs._0, ys._0, zs._0));
+ ws = ws._1;
+ xs = xs._1;
+ ys = ys._1;
+ zs = zs._1;
+ }
+ return fromArray(arr);
+}
+
+function map5(f, vs, ws, xs, ys, zs)
+{
+ var arr = [];
+ while ( vs.ctor !== '[]'
+ && ws.ctor !== '[]'
+ && xs.ctor !== '[]'
+ && ys.ctor !== '[]'
+ && zs.ctor !== '[]')
+ {
+ arr.push(A5(f, vs._0, ws._0, xs._0, ys._0, zs._0));
+ vs = vs._1;
+ ws = ws._1;
+ xs = xs._1;
+ ys = ys._1;
+ zs = zs._1;
+ }
+ return fromArray(arr);
+}
+
+function sortBy(f, xs)
+{
+ return fromArray(toArray(xs).sort(function(a, b) {
+ return _elm_lang$core$Native_Utils.cmp(f(a), f(b));
+ }));
+}
+
+function sortWith(f, xs)
+{
+ return fromArray(toArray(xs).sort(function(a, b) {
+ var ord = f(a)(b).ctor;
+ return ord === 'EQ' ? 0 : ord === 'LT' ? -1 : 1;
+ }));
+}
+
+return {
+ Nil: Nil,
+ Cons: Cons,
+ cons: F2(Cons),
+ toArray: toArray,
+ fromArray: fromArray,
+
+ foldr: F3(foldr),
+
+ map2: F3(map2),
+ map3: F4(map3),
+ map4: F5(map4),
+ map5: F6(map5),
+ sortBy: F2(sortBy),
+ sortWith: F2(sortWith)
+};
+
+}();var _elm_lang$core$List$sortWith = _elm_lang$core$Native_List.sortWith;
+var _elm_lang$core$List$sortBy = _elm_lang$core$Native_List.sortBy;
+var _elm_lang$core$List$sort = function (xs) {
+ return A2(_elm_lang$core$List$sortBy, _elm_lang$core$Basics$identity, xs);
+};
+var _elm_lang$core$List$singleton = function (value) {
+ return {
+ ctor: '::',
+ _0: value,
+ _1: {ctor: '[]'}
+ };
+};
+var _elm_lang$core$List$drop = F2(
+ function (n, list) {
+ drop:
+ while (true) {
+ if (_elm_lang$core$Native_Utils.cmp(n, 0) < 1) {
+ return list;
+ } else {
+ var _p0 = list;
+ if (_p0.ctor === '[]') {
+ return list;
+ } else {
+ var _v1 = n - 1,
+ _v2 = _p0._1;
+ n = _v1;
+ list = _v2;
+ continue drop;
+ }
+ }
+ }
+ });
+var _elm_lang$core$List$map5 = _elm_lang$core$Native_List.map5;
+var _elm_lang$core$List$map4 = _elm_lang$core$Native_List.map4;
+var _elm_lang$core$List$map3 = _elm_lang$core$Native_List.map3;
+var _elm_lang$core$List$map2 = _elm_lang$core$Native_List.map2;
+var _elm_lang$core$List$any = F2(
+ function (isOkay, list) {
+ any:
+ while (true) {
+ var _p1 = list;
+ if (_p1.ctor === '[]') {
+ return false;
+ } else {
+ if (isOkay(_p1._0)) {
+ return true;
+ } else {
+ var _v4 = isOkay,
+ _v5 = _p1._1;
+ isOkay = _v4;
+ list = _v5;
+ continue any;
+ }
+ }
+ }
+ });
+var _elm_lang$core$List$all = F2(
+ function (isOkay, list) {
+ return !A2(
+ _elm_lang$core$List$any,
+ function (_p2) {
+ return !isOkay(_p2);
+ },
+ list);
+ });
+var _elm_lang$core$List$foldr = _elm_lang$core$Native_List.foldr;
+var _elm_lang$core$List$foldl = F3(
+ function (func, acc, list) {
+ foldl:
+ while (true) {
+ var _p3 = list;
+ if (_p3.ctor === '[]') {
+ return acc;
+ } else {
+ var _v7 = func,
+ _v8 = A2(func, _p3._0, acc),
+ _v9 = _p3._1;
+ func = _v7;
+ acc = _v8;
+ list = _v9;
+ continue foldl;
+ }
+ }
+ });
+var _elm_lang$core$List$length = function (xs) {
+ return A3(
+ _elm_lang$core$List$foldl,
+ F2(
+ function (_p4, i) {
+ return i + 1;
+ }),
+ 0,
+ xs);
+};
+var _elm_lang$core$List$sum = function (numbers) {
+ return A3(
+ _elm_lang$core$List$foldl,
+ F2(
+ function (x, y) {
+ return x + y;
+ }),
+ 0,
+ numbers);
+};
+var _elm_lang$core$List$product = function (numbers) {
+ return A3(
+ _elm_lang$core$List$foldl,
+ F2(
+ function (x, y) {
+ return x * y;
+ }),
+ 1,
+ numbers);
+};
+var _elm_lang$core$List$maximum = function (list) {
+ var _p5 = list;
+ if (_p5.ctor === '::') {
+ return _elm_lang$core$Maybe$Just(
+ A3(_elm_lang$core$List$foldl, _elm_lang$core$Basics$max, _p5._0, _p5._1));
+ } else {
+ return _elm_lang$core$Maybe$Nothing;
+ }
+};
+var _elm_lang$core$List$minimum = function (list) {
+ var _p6 = list;
+ if (_p6.ctor === '::') {
+ return _elm_lang$core$Maybe$Just(
+ A3(_elm_lang$core$List$foldl, _elm_lang$core$Basics$min, _p6._0, _p6._1));
+ } else {
+ return _elm_lang$core$Maybe$Nothing;
+ }
+};
+var _elm_lang$core$List$member = F2(
+ function (x, xs) {
+ return A2(
+ _elm_lang$core$List$any,
+ function (a) {
+ return _elm_lang$core$Native_Utils.eq(a, x);
+ },
+ xs);
+ });
+var _elm_lang$core$List$isEmpty = function (xs) {
+ var _p7 = xs;
+ if (_p7.ctor === '[]') {
+ return true;
+ } else {
+ return false;
+ }
+};
+var _elm_lang$core$List$tail = function (list) {
+ var _p8 = list;
+ if (_p8.ctor === '::') {
+ return _elm_lang$core$Maybe$Just(_p8._1);
+ } else {
+ return _elm_lang$core$Maybe$Nothing;
+ }
+};
+var _elm_lang$core$List$head = function (list) {
+ var _p9 = list;
+ if (_p9.ctor === '::') {
+ return _elm_lang$core$Maybe$Just(_p9._0);
+ } else {
+ return _elm_lang$core$Maybe$Nothing;
+ }
+};
+var _elm_lang$core$List_ops = _elm_lang$core$List_ops || {};
+_elm_lang$core$List_ops['::'] = _elm_lang$core$Native_List.cons;
+var _elm_lang$core$List$map = F2(
+ function (f, xs) {
+ return A3(
+ _elm_lang$core$List$foldr,
+ F2(
+ function (x, acc) {
+ return {
+ ctor: '::',
+ _0: f(x),
+ _1: acc
+ };
+ }),
+ {ctor: '[]'},
+ xs);
+ });
+var _elm_lang$core$List$filter = F2(
+ function (pred, xs) {
+ var conditionalCons = F2(
+ function (front, back) {
+ return pred(front) ? {ctor: '::', _0: front, _1: back} : back;
+ });
+ return A3(
+ _elm_lang$core$List$foldr,
+ conditionalCons,
+ {ctor: '[]'},
+ xs);
+ });
+var _elm_lang$core$List$maybeCons = F3(
+ function (f, mx, xs) {
+ var _p10 = f(mx);
+ if (_p10.ctor === 'Just') {
+ return {ctor: '::', _0: _p10._0, _1: xs};
+ } else {
+ return xs;
+ }
+ });
+var _elm_lang$core$List$filterMap = F2(
+ function (f, xs) {
+ return A3(
+ _elm_lang$core$List$foldr,
+ _elm_lang$core$List$maybeCons(f),
+ {ctor: '[]'},
+ xs);
+ });
+var _elm_lang$core$List$reverse = function (list) {
+ return A3(
+ _elm_lang$core$List$foldl,
+ F2(
+ function (x, y) {
+ return {ctor: '::', _0: x, _1: y};
+ }),
+ {ctor: '[]'},
+ list);
+};
+var _elm_lang$core$List$scanl = F3(
+ function (f, b, xs) {
+ var scan1 = F2(
+ function (x, accAcc) {
+ var _p11 = accAcc;
+ if (_p11.ctor === '::') {
+ return {
+ ctor: '::',
+ _0: A2(f, x, _p11._0),
+ _1: accAcc
+ };
+ } else {
+ return {ctor: '[]'};
+ }
+ });
+ return _elm_lang$core$List$reverse(
+ A3(
+ _elm_lang$core$List$foldl,
+ scan1,
+ {
+ ctor: '::',
+ _0: b,
+ _1: {ctor: '[]'}
+ },
+ xs));
+ });
+var _elm_lang$core$List$append = F2(
+ function (xs, ys) {
+ var _p12 = ys;
+ if (_p12.ctor === '[]') {
+ return xs;
+ } else {
+ return A3(
+ _elm_lang$core$List$foldr,
+ F2(
+ function (x, y) {
+ return {ctor: '::', _0: x, _1: y};
+ }),
+ ys,
+ xs);
+ }
+ });
+var _elm_lang$core$List$concat = function (lists) {
+ return A3(
+ _elm_lang$core$List$foldr,
+ _elm_lang$core$List$append,
+ {ctor: '[]'},
+ lists);
+};
+var _elm_lang$core$List$concatMap = F2(
+ function (f, list) {
+ return _elm_lang$core$List$concat(
+ A2(_elm_lang$core$List$map, f, list));
+ });
+var _elm_lang$core$List$partition = F2(
+ function (pred, list) {
+ var step = F2(
+ function (x, _p13) {
+ var _p14 = _p13;
+ var _p16 = _p14._0;
+ var _p15 = _p14._1;
+ return pred(x) ? {
+ ctor: '_Tuple2',
+ _0: {ctor: '::', _0: x, _1: _p16},
+ _1: _p15
+ } : {
+ ctor: '_Tuple2',
+ _0: _p16,
+ _1: {ctor: '::', _0: x, _1: _p15}
+ };
+ });
+ return A3(
+ _elm_lang$core$List$foldr,
+ step,
+ {
+ ctor: '_Tuple2',
+ _0: {ctor: '[]'},
+ _1: {ctor: '[]'}
+ },
+ list);
+ });
+var _elm_lang$core$List$unzip = function (pairs) {
+ var step = F2(
+ function (_p18, _p17) {
+ var _p19 = _p18;
+ var _p20 = _p17;
+ return {
+ ctor: '_Tuple2',
+ _0: {ctor: '::', _0: _p19._0, _1: _p20._0},
+ _1: {ctor: '::', _0: _p19._1, _1: _p20._1}
+ };
+ });
+ return A3(
+ _elm_lang$core$List$foldr,
+ step,
+ {
+ ctor: '_Tuple2',
+ _0: {ctor: '[]'},
+ _1: {ctor: '[]'}
+ },
+ pairs);
+};
+var _elm_lang$core$List$intersperse = F2(
+ function (sep, xs) {
+ var _p21 = xs;
+ if (_p21.ctor === '[]') {
+ return {ctor: '[]'};
+ } else {
+ var step = F2(
+ function (x, rest) {
+ return {
+ ctor: '::',
+ _0: sep,
+ _1: {ctor: '::', _0: x, _1: rest}
+ };
+ });
+ var spersed = A3(
+ _elm_lang$core$List$foldr,
+ step,
+ {ctor: '[]'},
+ _p21._1);
+ return {ctor: '::', _0: _p21._0, _1: spersed};
+ }
+ });
+var _elm_lang$core$List$takeReverse = F3(
+ function (n, list, taken) {
+ takeReverse:
+ while (true) {
+ if (_elm_lang$core$Native_Utils.cmp(n, 0) < 1) {
+ return taken;
+ } else {
+ var _p22 = list;
+ if (_p22.ctor === '[]') {
+ return taken;
+ } else {
+ var _v23 = n - 1,
+ _v24 = _p22._1,
+ _v25 = {ctor: '::', _0: _p22._0, _1: taken};
+ n = _v23;
+ list = _v24;
+ taken = _v25;
+ continue takeReverse;
+ }
+ }
+ }
+ });
+var _elm_lang$core$List$takeTailRec = F2(
+ function (n, list) {
+ return _elm_lang$core$List$reverse(
+ A3(
+ _elm_lang$core$List$takeReverse,
+ n,
+ list,
+ {ctor: '[]'}));
+ });
+var _elm_lang$core$List$takeFast = F3(
+ function (ctr, n, list) {
+ if (_elm_lang$core$Native_Utils.cmp(n, 0) < 1) {
+ return {ctor: '[]'};
+ } else {
+ var _p23 = {ctor: '_Tuple2', _0: n, _1: list};
+ _v26_5:
+ do {
+ _v26_1:
+ do {
+ if (_p23.ctor === '_Tuple2') {
+ if (_p23._1.ctor === '[]') {
+ return list;
+ } else {
+ if (_p23._1._1.ctor === '::') {
+ switch (_p23._0) {
+ case 1:
+ break _v26_1;
+ case 2:
+ return {
+ ctor: '::',
+ _0: _p23._1._0,
+ _1: {
+ ctor: '::',
+ _0: _p23._1._1._0,
+ _1: {ctor: '[]'}
+ }
+ };
+ case 3:
+ if (_p23._1._1._1.ctor === '::') {
+ return {
+ ctor: '::',
+ _0: _p23._1._0,
+ _1: {
+ ctor: '::',
+ _0: _p23._1._1._0,
+ _1: {
+ ctor: '::',
+ _0: _p23._1._1._1._0,
+ _1: {ctor: '[]'}
+ }
+ }
+ };
+ } else {
+ break _v26_5;
+ }
+ default:
+ if ((_p23._1._1._1.ctor === '::') && (_p23._1._1._1._1.ctor === '::')) {
+ var _p28 = _p23._1._1._1._0;
+ var _p27 = _p23._1._1._0;
+ var _p26 = _p23._1._0;
+ var _p25 = _p23._1._1._1._1._0;
+ var _p24 = _p23._1._1._1._1._1;
+ return (_elm_lang$core$Native_Utils.cmp(ctr, 1000) > 0) ? {
+ ctor: '::',
+ _0: _p26,
+ _1: {
+ ctor: '::',
+ _0: _p27,
+ _1: {
+ ctor: '::',
+ _0: _p28,
+ _1: {
+ ctor: '::',
+ _0: _p25,
+ _1: A2(_elm_lang$core$List$takeTailRec, n - 4, _p24)
+ }
+ }
+ }
+ } : {
+ ctor: '::',
+ _0: _p26,
+ _1: {
+ ctor: '::',
+ _0: _p27,
+ _1: {
+ ctor: '::',
+ _0: _p28,
+ _1: {
+ ctor: '::',
+ _0: _p25,
+ _1: A3(_elm_lang$core$List$takeFast, ctr + 1, n - 4, _p24)
+ }
+ }
+ }
+ };
+ } else {
+ break _v26_5;
+ }
+ }
+ } else {
+ if (_p23._0 === 1) {
+ break _v26_1;
+ } else {
+ break _v26_5;
+ }
+ }
+ }
+ } else {
+ break _v26_5;
+ }
+ } while(false);
+ return {
+ ctor: '::',
+ _0: _p23._1._0,
+ _1: {ctor: '[]'}
+ };
+ } while(false);
+ return list;
+ }
+ });
+var _elm_lang$core$List$take = F2(
+ function (n, list) {
+ return A3(_elm_lang$core$List$takeFast, 0, n, list);
+ });
+var _elm_lang$core$List$repeatHelp = F3(
+ function (result, n, value) {
+ repeatHelp:
+ while (true) {
+ if (_elm_lang$core$Native_Utils.cmp(n, 0) < 1) {
+ return result;
+ } else {
+ var _v27 = {ctor: '::', _0: value, _1: result},
+ _v28 = n - 1,
+ _v29 = value;
+ result = _v27;
+ n = _v28;
+ value = _v29;
+ continue repeatHelp;
+ }
+ }
+ });
+var _elm_lang$core$List$repeat = F2(
+ function (n, value) {
+ return A3(
+ _elm_lang$core$List$repeatHelp,
+ {ctor: '[]'},
+ n,
+ value);
+ });
+var _elm_lang$core$List$rangeHelp = F3(
+ function (lo, hi, list) {
+ rangeHelp:
+ while (true) {
+ if (_elm_lang$core$Native_Utils.cmp(lo, hi) < 1) {
+ var _v30 = lo,
+ _v31 = hi - 1,
+ _v32 = {ctor: '::', _0: hi, _1: list};
+ lo = _v30;
+ hi = _v31;
+ list = _v32;
+ continue rangeHelp;
+ } else {
+ return list;
+ }
+ }
+ });
+var _elm_lang$core$List$range = F2(
+ function (lo, hi) {
+ return A3(
+ _elm_lang$core$List$rangeHelp,
+ lo,
+ hi,
+ {ctor: '[]'});
+ });
+var _elm_lang$core$List$indexedMap = F2(
+ function (f, xs) {
+ return A3(
+ _elm_lang$core$List$map2,
+ f,
+ A2(
+ _elm_lang$core$List$range,
+ 0,
+ _elm_lang$core$List$length(xs) - 1),
+ xs);
+ });
+var _elm_lang$core$Array$append = _elm_lang$core$Native_Array.append;
+var _elm_lang$core$Array$length = _elm_lang$core$Native_Array.length;
+var _elm_lang$core$Array$isEmpty = function (array) {
+ return _elm_lang$core$Native_Utils.eq(
+ _elm_lang$core$Array$length(array),
+ 0);
+};
+var _elm_lang$core$Array$slice = _elm_lang$core$Native_Array.slice;
+var _elm_lang$core$Array$set = _elm_lang$core$Native_Array.set;
+var _elm_lang$core$Array$get = F2(
+ function (i, array) {
+ return ((_elm_lang$core$Native_Utils.cmp(0, i) < 1) && (_elm_lang$core$Native_Utils.cmp(
+ i,
+ _elm_lang$core$Native_Array.length(array)) < 0)) ? _elm_lang$core$Maybe$Just(
+ A2(_elm_lang$core$Native_Array.get, i, array)) : _elm_lang$core$Maybe$Nothing;
+ });
+var _elm_lang$core$Array$push = _elm_lang$core$Native_Array.push;
+var _elm_lang$core$Array$empty = _elm_lang$core$Native_Array.empty;
+var _elm_lang$core$Array$filter = F2(
+ function (isOkay, arr) {
+ var update = F2(
+ function (x, xs) {
+ return isOkay(x) ? A2(_elm_lang$core$Native_Array.push, x, xs) : xs;
+ });
+ return A3(_elm_lang$core$Native_Array.foldl, update, _elm_lang$core$Native_Array.empty, arr);
+ });
+var _elm_lang$core$Array$foldr = _elm_lang$core$Native_Array.foldr;
+var _elm_lang$core$Array$foldl = _elm_lang$core$Native_Array.foldl;
+var _elm_lang$core$Array$indexedMap = _elm_lang$core$Native_Array.indexedMap;
+var _elm_lang$core$Array$map = _elm_lang$core$Native_Array.map;
+var _elm_lang$core$Array$toIndexedList = function (array) {
+ return A3(
+ _elm_lang$core$List$map2,
+ F2(
+ function (v0, v1) {
+ return {ctor: '_Tuple2', _0: v0, _1: v1};
+ }),
+ A2(
+ _elm_lang$core$List$range,
+ 0,
+ _elm_lang$core$Native_Array.length(array) - 1),
+ _elm_lang$core$Native_Array.toList(array));
+};
+var _elm_lang$core$Array$toList = _elm_lang$core$Native_Array.toList;
+var _elm_lang$core$Array$fromList = _elm_lang$core$Native_Array.fromList;
+var _elm_lang$core$Array$initialize = _elm_lang$core$Native_Array.initialize;
+var _elm_lang$core$Array$repeat = F2(
+ function (n, e) {
+ return A2(
+ _elm_lang$core$Array$initialize,
+ n,
+ _elm_lang$core$Basics$always(e));
+ });
+var _elm_lang$core$Array$Array = {ctor: 'Array'};
+//import Native.Utils //
+
+var _elm_lang$core$Native_Char = function() {
+
+return {
+ fromCode: function(c) { return _elm_lang$core$Native_Utils.chr(String.fromCharCode(c)); },
+ toCode: function(c) { return c.charCodeAt(0); },
+ toUpper: function(c) { return _elm_lang$core$Native_Utils.chr(c.toUpperCase()); },
+ toLower: function(c) { return _elm_lang$core$Native_Utils.chr(c.toLowerCase()); },
+ toLocaleUpper: function(c) { return _elm_lang$core$Native_Utils.chr(c.toLocaleUpperCase()); },
+ toLocaleLower: function(c) { return _elm_lang$core$Native_Utils.chr(c.toLocaleLowerCase()); }
+};
+
+}();var _elm_lang$core$Char$fromCode = _elm_lang$core$Native_Char.fromCode;
+var _elm_lang$core$Char$toCode = _elm_lang$core$Native_Char.toCode;
+var _elm_lang$core$Char$toLocaleLower = _elm_lang$core$Native_Char.toLocaleLower;
+var _elm_lang$core$Char$toLocaleUpper = _elm_lang$core$Native_Char.toLocaleUpper;
+var _elm_lang$core$Char$toLower = _elm_lang$core$Native_Char.toLower;
+var _elm_lang$core$Char$toUpper = _elm_lang$core$Native_Char.toUpper;
+var _elm_lang$core$Char$isBetween = F3(
+ function (low, high, $char) {
+ var code = _elm_lang$core$Char$toCode($char);
+ return (_elm_lang$core$Native_Utils.cmp(
+ code,
+ _elm_lang$core$Char$toCode(low)) > -1) && (_elm_lang$core$Native_Utils.cmp(
+ code,
+ _elm_lang$core$Char$toCode(high)) < 1);
+ });
+var _elm_lang$core$Char$isUpper = A2(
+ _elm_lang$core$Char$isBetween,
+ _elm_lang$core$Native_Utils.chr('A'),
+ _elm_lang$core$Native_Utils.chr('Z'));
+var _elm_lang$core$Char$isLower = A2(
+ _elm_lang$core$Char$isBetween,
+ _elm_lang$core$Native_Utils.chr('a'),
+ _elm_lang$core$Native_Utils.chr('z'));
+var _elm_lang$core$Char$isDigit = A2(
+ _elm_lang$core$Char$isBetween,
+ _elm_lang$core$Native_Utils.chr('0'),
+ _elm_lang$core$Native_Utils.chr('9'));
+var _elm_lang$core$Char$isOctDigit = A2(
+ _elm_lang$core$Char$isBetween,
+ _elm_lang$core$Native_Utils.chr('0'),
+ _elm_lang$core$Native_Utils.chr('7'));
+var _elm_lang$core$Char$isHexDigit = function ($char) {
+ return _elm_lang$core$Char$isDigit($char) || (A3(
+ _elm_lang$core$Char$isBetween,
+ _elm_lang$core$Native_Utils.chr('a'),
+ _elm_lang$core$Native_Utils.chr('f'),
+ $char) || A3(
+ _elm_lang$core$Char$isBetween,
+ _elm_lang$core$Native_Utils.chr('A'),
+ _elm_lang$core$Native_Utils.chr('F'),
+ $char));
+};
+//import Native.Utils //
+
+var _elm_lang$core$Native_Scheduler = function() {
+
+var MAX_STEPS = 10000;
+
+
+// TASKS
+
+function succeed(value)
+{
+ return {
+ ctor: '_Task_succeed',
+ value: value
+ };
+}
+
+function fail(error)
+{
+ return {
+ ctor: '_Task_fail',
+ value: error
+ };
+}
+
+function nativeBinding(callback)
+{
+ return {
+ ctor: '_Task_nativeBinding',
+ callback: callback,
+ cancel: null
+ };
+}
+
+function andThen(callback, task)
+{
+ return {
+ ctor: '_Task_andThen',
+ callback: callback,
+ task: task
+ };
+}
+
+function onError(callback, task)
+{
+ return {
+ ctor: '_Task_onError',
+ callback: callback,
+ task: task
+ };
+}
+
+function receive(callback)
+{
+ return {
+ ctor: '_Task_receive',
+ callback: callback
+ };
+}
+
+
+// PROCESSES
+
+function rawSpawn(task)
+{
+ var process = {
+ ctor: '_Process',
+ id: _elm_lang$core$Native_Utils.guid(),
+ root: task,
+ stack: null,
+ mailbox: []
+ };
+
+ enqueue(process);
+
+ return process;
+}
+
+function spawn(task)
+{
+ return nativeBinding(function(callback) {
+ var process = rawSpawn(task);
+ callback(succeed(process));
+ });
+}
+
+function rawSend(process, msg)
+{
+ process.mailbox.push(msg);
+ enqueue(process);
+}
+
+function send(process, msg)
+{
+ return nativeBinding(function(callback) {
+ rawSend(process, msg);
+ callback(succeed(_elm_lang$core$Native_Utils.Tuple0));
+ });
+}
+
+function kill(process)
+{
+ return nativeBinding(function(callback) {
+ var root = process.root;
+ if (root.ctor === '_Task_nativeBinding' && root.cancel)
+ {
+ root.cancel();
+ }
+
+ process.root = null;
+
+ callback(succeed(_elm_lang$core$Native_Utils.Tuple0));
+ });
+}
+
+function sleep(time)
+{
+ return nativeBinding(function(callback) {
+ var id = setTimeout(function() {
+ callback(succeed(_elm_lang$core$Native_Utils.Tuple0));
+ }, time);
+
+ return function() { clearTimeout(id); };
+ });
+}
+
+
+// STEP PROCESSES
+
+function step(numSteps, process)
+{
+ while (numSteps < MAX_STEPS)
+ {
+ var ctor = process.root.ctor;
+
+ if (ctor === '_Task_succeed')
+ {
+ while (process.stack && process.stack.ctor === '_Task_onError')
+ {
+ process.stack = process.stack.rest;
+ }
+ if (process.stack === null)
+ {
+ break;
+ }
+ process.root = process.stack.callback(process.root.value);
+ process.stack = process.stack.rest;
+ ++numSteps;
+ continue;
+ }
+
+ if (ctor === '_Task_fail')
+ {
+ while (process.stack && process.stack.ctor === '_Task_andThen')
+ {
+ process.stack = process.stack.rest;
+ }
+ if (process.stack === null)
+ {
+ break;
+ }
+ process.root = process.stack.callback(process.root.value);
+ process.stack = process.stack.rest;
+ ++numSteps;
+ continue;
+ }
+
+ if (ctor === '_Task_andThen')
+ {
+ process.stack = {
+ ctor: '_Task_andThen',
+ callback: process.root.callback,
+ rest: process.stack
+ };
+ process.root = process.root.task;
+ ++numSteps;
+ continue;
+ }
+
+ if (ctor === '_Task_onError')
+ {
+ process.stack = {
+ ctor: '_Task_onError',
+ callback: process.root.callback,
+ rest: process.stack
+ };
+ process.root = process.root.task;
+ ++numSteps;
+ continue;
+ }
+
+ if (ctor === '_Task_nativeBinding')
+ {
+ process.root.cancel = process.root.callback(function(newRoot) {
+ process.root = newRoot;
+ enqueue(process);
+ });
+
+ break;
+ }
+
+ if (ctor === '_Task_receive')
+ {
+ var mailbox = process.mailbox;
+ if (mailbox.length === 0)
+ {
+ break;
+ }
+
+ process.root = process.root.callback(mailbox.shift());
+ ++numSteps;
+ continue;
+ }
+
+ throw new Error(ctor);
+ }
+
+ if (numSteps < MAX_STEPS)
+ {
+ return numSteps + 1;
+ }
+ enqueue(process);
+
+ return numSteps;
+}
+
+
+// WORK QUEUE
+
+var working = false;
+var workQueue = [];
+
+function enqueue(process)
+{
+ workQueue.push(process);
+
+ if (!working)
+ {
+ setTimeout(work, 0);
+ working = true;
+ }
+}
+
+function work()
+{
+ var numSteps = 0;
+ var process;
+ while (numSteps < MAX_STEPS && (process = workQueue.shift()))
+ {
+ if (process.root)
+ {
+ numSteps = step(numSteps, process);
+ }
+ }
+ if (!process)
+ {
+ working = false;
+ return;
+ }
+ setTimeout(work, 0);
+}
+
+
+return {
+ succeed: succeed,
+ fail: fail,
+ nativeBinding: nativeBinding,
+ andThen: F2(andThen),
+ onError: F2(onError),
+ receive: receive,
+
+ spawn: spawn,
+ kill: kill,
+ sleep: sleep,
+ send: F2(send),
+
+ rawSpawn: rawSpawn,
+ rawSend: rawSend
+};
+
+}();//import //
+
+var _elm_lang$core$Native_Platform = function() {
+
+
+// PROGRAMS
+
+function program(impl)
+{
+ return function(flagDecoder)
+ {
+ return function(object, moduleName)
+ {
+ object['worker'] = function worker(flags)
+ {
+ if (typeof flags !== 'undefined')
+ {
+ throw new Error(
+ 'The `' + moduleName + '` module does not need flags.\n'
+ + 'Call ' + moduleName + '.worker() with no arguments and you should be all set!'
+ );
+ }
+
+ return initialize(
+ impl.init,
+ impl.update,
+ impl.subscriptions,
+ renderer
+ );
+ };
+ };
+ };
+}
+
+function programWithFlags(impl)
+{
+ return function(flagDecoder)
+ {
+ return function(object, moduleName)
+ {
+ object['worker'] = function worker(flags)
+ {
+ if (typeof flagDecoder === 'undefined')
+ {
+ throw new Error(
+ 'Are you trying to sneak a Never value into Elm? Trickster!\n'
+ + 'It looks like ' + moduleName + '.main is defined with `programWithFlags` but has type `Program Never`.\n'
+ + 'Use `program` instead if you do not want flags.'
+ );
+ }
+
+ var result = A2(_elm_lang$core$Native_Json.run, flagDecoder, flags);
+ if (result.ctor === 'Err')
+ {
+ throw new Error(
+ moduleName + '.worker(...) was called with an unexpected argument.\n'
+ + 'I tried to convert it to an Elm value, but ran into this problem:\n\n'
+ + result._0
+ );
+ }
+
+ return initialize(
+ impl.init(result._0),
+ impl.update,
+ impl.subscriptions,
+ renderer
+ );
+ };
+ };
+ };
+}
+
+function renderer(enqueue, _)
+{
+ return function(_) {};
+}
+
+
+// HTML TO PROGRAM
+
+function htmlToProgram(vnode)
+{
+ var emptyBag = batch(_elm_lang$core$Native_List.Nil);
+ var noChange = _elm_lang$core$Native_Utils.Tuple2(
+ _elm_lang$core$Native_Utils.Tuple0,
+ emptyBag
+ );
+
+ return _elm_lang$virtual_dom$VirtualDom$program({
+ init: noChange,
+ view: function(model) { return main; },
+ update: F2(function(msg, model) { return noChange; }),
+ subscriptions: function (model) { return emptyBag; }
+ });
+}
+
+
+// INITIALIZE A PROGRAM
+
+function initialize(init, update, subscriptions, renderer)
+{
+ // ambient state
+ var managers = {};
+ var updateView;
+
+ // init and update state in main process
+ var initApp = _elm_lang$core$Native_Scheduler.nativeBinding(function(callback) {
+ var model = init._0;
+ updateView = renderer(enqueue, model);
+ var cmds = init._1;
+ var subs = subscriptions(model);
+ dispatchEffects(managers, cmds, subs);
+ callback(_elm_lang$core$Native_Scheduler.succeed(model));
+ });
+
+ function onMessage(msg, model)
+ {
+ return _elm_lang$core$Native_Scheduler.nativeBinding(function(callback) {
+ var results = A2(update, msg, model);
+ model = results._0;
+ updateView(model);
+ var cmds = results._1;
+ var subs = subscriptions(model);
+ dispatchEffects(managers, cmds, subs);
+ callback(_elm_lang$core$Native_Scheduler.succeed(model));
+ });
+ }
+
+ var mainProcess = spawnLoop(initApp, onMessage);
+
+ function enqueue(msg)
+ {
+ _elm_lang$core$Native_Scheduler.rawSend(mainProcess, msg);
+ }
+
+ var ports = setupEffects(managers, enqueue);
+
+ return ports ? { ports: ports } : {};
+}
+
+
+// EFFECT MANAGERS
+
+var effectManagers = {};
+
+function setupEffects(managers, callback)
+{
+ var ports;
+
+ // setup all necessary effect managers
+ for (var key in effectManagers)
+ {
+ var manager = effectManagers[key];
+
+ if (manager.isForeign)
+ {
+ ports = ports || {};
+ ports[key] = manager.tag === 'cmd'
+ ? setupOutgoingPort(key)
+ : setupIncomingPort(key, callback);
+ }
+
+ managers[key] = makeManager(manager, callback);
+ }
+
+ return ports;
+}
+
+function makeManager(info, callback)
+{
+ var router = {
+ main: callback,
+ self: undefined
+ };
+
+ var tag = info.tag;
+ var onEffects = info.onEffects;
+ var onSelfMsg = info.onSelfMsg;
+
+ function onMessage(msg, state)
+ {
+ if (msg.ctor === 'self')
+ {
+ return A3(onSelfMsg, router, msg._0, state);
+ }
+
+ var fx = msg._0;
+ switch (tag)
+ {
+ case 'cmd':
+ return A3(onEffects, router, fx.cmds, state);
+
+ case 'sub':
+ return A3(onEffects, router, fx.subs, state);
+
+ case 'fx':
+ return A4(onEffects, router, fx.cmds, fx.subs, state);
+ }
+ }
+
+ var process = spawnLoop(info.init, onMessage);
+ router.self = process;
+ return process;
+}
+
+function sendToApp(router, msg)
+{
+ return _elm_lang$core$Native_Scheduler.nativeBinding(function(callback)
+ {
+ router.main(msg);
+ callback(_elm_lang$core$Native_Scheduler.succeed(_elm_lang$core$Native_Utils.Tuple0));
+ });
+}
+
+function sendToSelf(router, msg)
+{
+ return A2(_elm_lang$core$Native_Scheduler.send, router.self, {
+ ctor: 'self',
+ _0: msg
+ });
+}
+
+
+// HELPER for STATEFUL LOOPS
+
+function spawnLoop(init, onMessage)
+{
+ var andThen = _elm_lang$core$Native_Scheduler.andThen;
+
+ function loop(state)
+ {
+ var handleMsg = _elm_lang$core$Native_Scheduler.receive(function(msg) {
+ return onMessage(msg, state);
+ });
+ return A2(andThen, loop, handleMsg);
+ }
+
+ var task = A2(andThen, loop, init);
+
+ return _elm_lang$core$Native_Scheduler.rawSpawn(task);
+}
+
+
+// BAGS
+
+function leaf(home)
+{
+ return function(value)
+ {
+ return {
+ type: 'leaf',
+ home: home,
+ value: value
+ };
+ };
+}
+
+function batch(list)
+{
+ return {
+ type: 'node',
+ branches: list
+ };
+}
+
+function map(tagger, bag)
+{
+ return {
+ type: 'map',
+ tagger: tagger,
+ tree: bag
+ }
+}
+
+
+// PIPE BAGS INTO EFFECT MANAGERS
+
+function dispatchEffects(managers, cmdBag, subBag)
+{
+ var effectsDict = {};
+ gatherEffects(true, cmdBag, effectsDict, null);
+ gatherEffects(false, subBag, effectsDict, null);
+
+ for (var home in managers)
+ {
+ var fx = home in effectsDict
+ ? effectsDict[home]
+ : {
+ cmds: _elm_lang$core$Native_List.Nil,
+ subs: _elm_lang$core$Native_List.Nil
+ };
+
+ _elm_lang$core$Native_Scheduler.rawSend(managers[home], { ctor: 'fx', _0: fx });
+ }
+}
+
+function gatherEffects(isCmd, bag, effectsDict, taggers)
+{
+ switch (bag.type)
+ {
+ case 'leaf':
+ var home = bag.home;
+ var effect = toEffect(isCmd, home, taggers, bag.value);
+ effectsDict[home] = insert(isCmd, effect, effectsDict[home]);
+ return;
+
+ case 'node':
+ var list = bag.branches;
+ while (list.ctor !== '[]')
+ {
+ gatherEffects(isCmd, list._0, effectsDict, taggers);
+ list = list._1;
+ }
+ return;
+
+ case 'map':
+ gatherEffects(isCmd, bag.tree, effectsDict, {
+ tagger: bag.tagger,
+ rest: taggers
+ });
+ return;
+ }
+}
+
+function toEffect(isCmd, home, taggers, value)
+{
+ function applyTaggers(x)
+ {
+ var temp = taggers;
+ while (temp)
+ {
+ x = temp.tagger(x);
+ temp = temp.rest;
+ }
+ return x;
+ }
+
+ var map = isCmd
+ ? effectManagers[home].cmdMap
+ : effectManagers[home].subMap;
+
+ return A2(map, applyTaggers, value)
+}
+
+function insert(isCmd, newEffect, effects)
+{
+ effects = effects || {
+ cmds: _elm_lang$core$Native_List.Nil,
+ subs: _elm_lang$core$Native_List.Nil
+ };
+ if (isCmd)
+ {
+ effects.cmds = _elm_lang$core$Native_List.Cons(newEffect, effects.cmds);
+ return effects;
+ }
+ effects.subs = _elm_lang$core$Native_List.Cons(newEffect, effects.subs);
+ return effects;
+}
+
+
+// PORTS
+
+function checkPortName(name)
+{
+ if (name in effectManagers)
+ {
+ throw new Error('There can only be one port named `' + name + '`, but your program has multiple.');
+ }
+}
+
+
+// OUTGOING PORTS
+
+function outgoingPort(name, converter)
+{
+ checkPortName(name);
+ effectManagers[name] = {
+ tag: 'cmd',
+ cmdMap: outgoingPortMap,
+ converter: converter,
+ isForeign: true
+ };
+ return leaf(name);
+}
+
+var outgoingPortMap = F2(function cmdMap(tagger, value) {
+ return value;
+});
+
+function setupOutgoingPort(name)
+{
+ var subs = [];
+ var converter = effectManagers[name].converter;
+
+ // CREATE MANAGER
+
+ var init = _elm_lang$core$Native_Scheduler.succeed(null);
+
+ function onEffects(router, cmdList, state)
+ {
+ while (cmdList.ctor !== '[]')
+ {
+ // grab a separate reference to subs in case unsubscribe is called
+ var currentSubs = subs;
+ var value = converter(cmdList._0);
+ for (var i = 0; i < currentSubs.length; i++)
+ {
+ currentSubs[i](value);
+ }
+ cmdList = cmdList._1;
+ }
+ return init;
+ }
+
+ effectManagers[name].init = init;
+ effectManagers[name].onEffects = F3(onEffects);
+
+ // PUBLIC API
+
+ function subscribe(callback)
+ {
+ subs.push(callback);
+ }
+
+ function unsubscribe(callback)
+ {
+ // copy subs into a new array in case unsubscribe is called within a
+ // subscribed callback
+ subs = subs.slice();
+ var index = subs.indexOf(callback);
+ if (index >= 0)
+ {
+ subs.splice(index, 1);
+ }
+ }
+
+ return {
+ subscribe: subscribe,
+ unsubscribe: unsubscribe
+ };
+}
+
+
+// INCOMING PORTS
+
+function incomingPort(name, converter)
+{
+ checkPortName(name);
+ effectManagers[name] = {
+ tag: 'sub',
+ subMap: incomingPortMap,
+ converter: converter,
+ isForeign: true
+ };
+ return leaf(name);
+}
+
+var incomingPortMap = F2(function subMap(tagger, finalTagger)
+{
+ return function(value)
+ {
+ return tagger(finalTagger(value));
+ };
+});
+
+function setupIncomingPort(name, callback)
+{
+ var sentBeforeInit = [];
+ var subs = _elm_lang$core$Native_List.Nil;
+ var converter = effectManagers[name].converter;
+ var currentOnEffects = preInitOnEffects;
+ var currentSend = preInitSend;
+
+ // CREATE MANAGER
+
+ var init = _elm_lang$core$Native_Scheduler.succeed(null);
+
+ function preInitOnEffects(router, subList, state)
+ {
+ var postInitResult = postInitOnEffects(router, subList, state);
+
+ for(var i = 0; i < sentBeforeInit.length; i++)
+ {
+ postInitSend(sentBeforeInit[i]);
+ }
+
+ sentBeforeInit = null; // to release objects held in queue
+ currentSend = postInitSend;
+ currentOnEffects = postInitOnEffects;
+ return postInitResult;
+ }
+
+ function postInitOnEffects(router, subList, state)
+ {
+ subs = subList;
+ return init;
+ }
+
+ function onEffects(router, subList, state)
+ {
+ return currentOnEffects(router, subList, state);
+ }
+
+ effectManagers[name].init = init;
+ effectManagers[name].onEffects = F3(onEffects);
+
+ // PUBLIC API
+
+ function preInitSend(value)
+ {
+ sentBeforeInit.push(value);
+ }
+
+ function postInitSend(value)
+ {
+ var temp = subs;
+ while (temp.ctor !== '[]')
+ {
+ callback(temp._0(value));
+ temp = temp._1;
+ }
+ }
+
+ function send(incomingValue)
+ {
+ var result = A2(_elm_lang$core$Json_Decode$decodeValue, converter, incomingValue);
+ if (result.ctor === 'Err')
+ {
+ throw new Error('Trying to send an unexpected type of value through port `' + name + '`:\n' + result._0);
+ }
+
+ currentSend(result._0);
+ }
+
+ return { send: send };
+}
+
+return {
+ // routers
+ sendToApp: F2(sendToApp),
+ sendToSelf: F2(sendToSelf),
+
+ // global setup
+ effectManagers: effectManagers,
+ outgoingPort: outgoingPort,
+ incomingPort: incomingPort,
+
+ htmlToProgram: htmlToProgram,
+ program: program,
+ programWithFlags: programWithFlags,
+ initialize: initialize,
+
+ // effect bags
+ leaf: leaf,
+ batch: batch,
+ map: F2(map)
+};
+
+}();
+var _elm_lang$core$Platform_Cmd$batch = _elm_lang$core$Native_Platform.batch;
+var _elm_lang$core$Platform_Cmd$none = _elm_lang$core$Platform_Cmd$batch(
+ {ctor: '[]'});
+var _elm_lang$core$Platform_Cmd_ops = _elm_lang$core$Platform_Cmd_ops || {};
+_elm_lang$core$Platform_Cmd_ops['!'] = F2(
+ function (model, commands) {
+ return {
+ ctor: '_Tuple2',
+ _0: model,
+ _1: _elm_lang$core$Platform_Cmd$batch(commands)
+ };
+ });
+var _elm_lang$core$Platform_Cmd$map = _elm_lang$core$Native_Platform.map;
+var _elm_lang$core$Platform_Cmd$Cmd = {ctor: 'Cmd'};
+var _elm_lang$core$Platform_Sub$batch = _elm_lang$core$Native_Platform.batch;
+var _elm_lang$core$Platform_Sub$none = _elm_lang$core$Platform_Sub$batch(
+ {ctor: '[]'});
+var _elm_lang$core$Platform_Sub$map = _elm_lang$core$Native_Platform.map;
+var _elm_lang$core$Platform_Sub$Sub = {ctor: 'Sub'};
+var _elm_lang$core$Platform$hack = _elm_lang$core$Native_Scheduler.succeed;
+var _elm_lang$core$Platform$sendToSelf = _elm_lang$core$Native_Platform.sendToSelf;
+var _elm_lang$core$Platform$sendToApp = _elm_lang$core$Native_Platform.sendToApp;
+var _elm_lang$core$Platform$programWithFlags = _elm_lang$core$Native_Platform.programWithFlags;
+var _elm_lang$core$Platform$program = _elm_lang$core$Native_Platform.program;
+var _elm_lang$core$Platform$Program = {ctor: 'Program'};
+var _elm_lang$core$Platform$Task = {ctor: 'Task'};
+var _elm_lang$core$Platform$ProcessId = {ctor: 'ProcessId'};
+var _elm_lang$core$Platform$Router = {ctor: 'Router'};
+var _elm_lang$core$Result$toMaybe = function (result) {
+ var _p0 = result;
+ if (_p0.ctor === 'Ok') {
+ return _elm_lang$core$Maybe$Just(_p0._0);
+ } else {
+ return _elm_lang$core$Maybe$Nothing;
+ }
+};
+var _elm_lang$core$Result$withDefault = F2(
+ function (def, result) {
+ var _p1 = result;
+ if (_p1.ctor === 'Ok') {
+ return _p1._0;
+ } else {
+ return def;
+ }
+ });
+var _elm_lang$core$Result$Err = function (a) {
+ return {ctor: 'Err', _0: a};
+};
+var _elm_lang$core$Result$andThen = F2(
+ function (callback, result) {
+ var _p2 = result;
+ if (_p2.ctor === 'Ok') {
+ return callback(_p2._0);
+ } else {
+ return _elm_lang$core$Result$Err(_p2._0);
+ }
+ });
+var _elm_lang$core$Result$Ok = function (a) {
+ return {ctor: 'Ok', _0: a};
+};
+var _elm_lang$core$Result$map = F2(
+ function (func, ra) {
+ var _p3 = ra;
+ if (_p3.ctor === 'Ok') {
+ return _elm_lang$core$Result$Ok(
+ func(_p3._0));
+ } else {
+ return _elm_lang$core$Result$Err(_p3._0);
+ }
+ });
+var _elm_lang$core$Result$map2 = F3(
+ function (func, ra, rb) {
+ var _p4 = {ctor: '_Tuple2', _0: ra, _1: rb};
+ if (_p4._0.ctor === 'Ok') {
+ if (_p4._1.ctor === 'Ok') {
+ return _elm_lang$core$Result$Ok(
+ A2(func, _p4._0._0, _p4._1._0));
+ } else {
+ return _elm_lang$core$Result$Err(_p4._1._0);
+ }
+ } else {
+ return _elm_lang$core$Result$Err(_p4._0._0);
+ }
+ });
+var _elm_lang$core$Result$map3 = F4(
+ function (func, ra, rb, rc) {
+ var _p5 = {ctor: '_Tuple3', _0: ra, _1: rb, _2: rc};
+ if (_p5._0.ctor === 'Ok') {
+ if (_p5._1.ctor === 'Ok') {
+ if (_p5._2.ctor === 'Ok') {
+ return _elm_lang$core$Result$Ok(
+ A3(func, _p5._0._0, _p5._1._0, _p5._2._0));
+ } else {
+ return _elm_lang$core$Result$Err(_p5._2._0);
+ }
+ } else {
+ return _elm_lang$core$Result$Err(_p5._1._0);
+ }
+ } else {
+ return _elm_lang$core$Result$Err(_p5._0._0);
+ }
+ });
+var _elm_lang$core$Result$map4 = F5(
+ function (func, ra, rb, rc, rd) {
+ var _p6 = {ctor: '_Tuple4', _0: ra, _1: rb, _2: rc, _3: rd};
+ if (_p6._0.ctor === 'Ok') {
+ if (_p6._1.ctor === 'Ok') {
+ if (_p6._2.ctor === 'Ok') {
+ if (_p6._3.ctor === 'Ok') {
+ return _elm_lang$core$Result$Ok(
+ A4(func, _p6._0._0, _p6._1._0, _p6._2._0, _p6._3._0));
+ } else {
+ return _elm_lang$core$Result$Err(_p6._3._0);
+ }
+ } else {
+ return _elm_lang$core$Result$Err(_p6._2._0);
+ }
+ } else {
+ return _elm_lang$core$Result$Err(_p6._1._0);
+ }
+ } else {
+ return _elm_lang$core$Result$Err(_p6._0._0);
+ }
+ });
+var _elm_lang$core$Result$map5 = F6(
+ function (func, ra, rb, rc, rd, re) {
+ var _p7 = {ctor: '_Tuple5', _0: ra, _1: rb, _2: rc, _3: rd, _4: re};
+ if (_p7._0.ctor === 'Ok') {
+ if (_p7._1.ctor === 'Ok') {
+ if (_p7._2.ctor === 'Ok') {
+ if (_p7._3.ctor === 'Ok') {
+ if (_p7._4.ctor === 'Ok') {
+ return _elm_lang$core$Result$Ok(
+ A5(func, _p7._0._0, _p7._1._0, _p7._2._0, _p7._3._0, _p7._4._0));
+ } else {
+ return _elm_lang$core$Result$Err(_p7._4._0);
+ }
+ } else {
+ return _elm_lang$core$Result$Err(_p7._3._0);
+ }
+ } else {
+ return _elm_lang$core$Result$Err(_p7._2._0);
+ }
+ } else {
+ return _elm_lang$core$Result$Err(_p7._1._0);
+ }
+ } else {
+ return _elm_lang$core$Result$Err(_p7._0._0);
+ }
+ });
+var _elm_lang$core$Result$mapError = F2(
+ function (f, result) {
+ var _p8 = result;
+ if (_p8.ctor === 'Ok') {
+ return _elm_lang$core$Result$Ok(_p8._0);
+ } else {
+ return _elm_lang$core$Result$Err(
+ f(_p8._0));
+ }
+ });
+var _elm_lang$core$Result$fromMaybe = F2(
+ function (err, maybe) {
+ var _p9 = maybe;
+ if (_p9.ctor === 'Just') {
+ return _elm_lang$core$Result$Ok(_p9._0);
+ } else {
+ return _elm_lang$core$Result$Err(err);
+ }
+ });
+//import Native.Utils //
+
+var _elm_lang$core$Native_Debug = function() {
+
+function log(tag, value)
+{
+ var msg = tag + ': ' + _elm_lang$core$Native_Utils.toString(value);
+ var process = process || {};
+ if (process.stdout)
+ {
+ process.stdout.write(msg);
+ }
+ else
+ {
+ console.log(msg);
+ }
+ return value;
+}
+
+function crash(message)
+{
+ throw new Error(message);
+}
+
+return {
+ crash: crash,
+ log: F2(log)
+};
+
+}();//import Maybe, Native.List, Native.Utils, Result //
+
+var _elm_lang$core$Native_String = function() {
+
+function isEmpty(str)
+{
+ return str.length === 0;
+}
+function cons(chr, str)
+{
+ return chr + str;
+}
+function uncons(str)
+{
+ var hd = str[0];
+ if (hd)
+ {
+ return _elm_lang$core$Maybe$Just(_elm_lang$core$Native_Utils.Tuple2(_elm_lang$core$Native_Utils.chr(hd), str.slice(1)));
+ }
+ return _elm_lang$core$Maybe$Nothing;
+}
+function append(a, b)
+{
+ return a + b;
+}
+function concat(strs)
+{
+ return _elm_lang$core$Native_List.toArray(strs).join('');
+}
+function length(str)
+{
+ return str.length;
+}
+function map(f, str)
+{
+ var out = str.split('');
+ for (var i = out.length; i--; )
+ {
+ out[i] = f(_elm_lang$core$Native_Utils.chr(out[i]));
+ }
+ return out.join('');
+}
+function filter(pred, str)
+{
+ return str.split('').map(_elm_lang$core$Native_Utils.chr).filter(pred).join('');
+}
+function reverse(str)
+{
+ return str.split('').reverse().join('');
+}
+function foldl(f, b, str)
+{
+ var len = str.length;
+ for (var i = 0; i < len; ++i)
+ {
+ b = A2(f, _elm_lang$core$Native_Utils.chr(str[i]), b);
+ }
+ return b;
+}
+function foldr(f, b, str)
+{
+ for (var i = str.length; i--; )
+ {
+ b = A2(f, _elm_lang$core$Native_Utils.chr(str[i]), b);
+ }
+ return b;
+}
+function split(sep, str)
+{
+ return _elm_lang$core$Native_List.fromArray(str.split(sep));
+}
+function join(sep, strs)
+{
+ return _elm_lang$core$Native_List.toArray(strs).join(sep);
+}
+function repeat(n, str)
+{
+ var result = '';
+ while (n > 0)
+ {
+ if (n & 1)
+ {
+ result += str;
+ }
+ n >>= 1, str += str;
+ }
+ return result;
+}
+function slice(start, end, str)
+{
+ return str.slice(start, end);
+}
+function left(n, str)
+{
+ return n < 1 ? '' : str.slice(0, n);
+}
+function right(n, str)
+{
+ return n < 1 ? '' : str.slice(-n);
+}
+function dropLeft(n, str)
+{
+ return n < 1 ? str : str.slice(n);
+}
+function dropRight(n, str)
+{
+ return n < 1 ? str : str.slice(0, -n);
+}
+function pad(n, chr, str)
+{
+ var half = (n - str.length) / 2;
+ return repeat(Math.ceil(half), chr) + str + repeat(half | 0, chr);
+}
+function padRight(n, chr, str)
+{
+ return str + repeat(n - str.length, chr);
+}
+function padLeft(n, chr, str)
+{
+ return repeat(n - str.length, chr) + str;
+}
+
+function trim(str)
+{
+ return str.trim();
+}
+function trimLeft(str)
+{
+ return str.replace(/^\s+/, '');
+}
+function trimRight(str)
+{
+ return str.replace(/\s+$/, '');
+}
+
+function words(str)
+{
+ return _elm_lang$core$Native_List.fromArray(str.trim().split(/\s+/g));
+}
+function lines(str)
+{
+ return _elm_lang$core$Native_List.fromArray(str.split(/\r\n|\r|\n/g));
+}
+
+function toUpper(str)
+{
+ return str.toUpperCase();
+}
+function toLower(str)
+{
+ return str.toLowerCase();
+}
+
+function any(pred, str)
+{
+ for (var i = str.length; i--; )
+ {
+ if (pred(_elm_lang$core$Native_Utils.chr(str[i])))
+ {
+ return true;
+ }
+ }
+ return false;
+}
+function all(pred, str)
+{
+ for (var i = str.length; i--; )
+ {
+ if (!pred(_elm_lang$core$Native_Utils.chr(str[i])))
+ {
+ return false;
+ }
+ }
+ return true;
+}
+
+function contains(sub, str)
+{
+ return str.indexOf(sub) > -1;
+}
+function startsWith(sub, str)
+{
+ return str.indexOf(sub) === 0;
+}
+function endsWith(sub, str)
+{
+ return str.length >= sub.length &&
+ str.lastIndexOf(sub) === str.length - sub.length;
+}
+function indexes(sub, str)
+{
+ var subLen = sub.length;
+
+ if (subLen < 1)
+ {
+ return _elm_lang$core$Native_List.Nil;
+ }
+
+ var i = 0;
+ var is = [];
+
+ while ((i = str.indexOf(sub, i)) > -1)
+ {
+ is.push(i);
+ i = i + subLen;
+ }
+
+ return _elm_lang$core$Native_List.fromArray(is);
+}
+
+
+function toInt(s)
+{
+ var len = s.length;
+
+ // if empty
+ if (len === 0)
+ {
+ return intErr(s);
+ }
+
+ // if hex
+ var c = s[0];
+ if (c === '0' && s[1] === 'x')
+ {
+ for (var i = 2; i < len; ++i)
+ {
+ var c = s[i];
+ if (('0' <= c && c <= '9') || ('A' <= c && c <= 'F') || ('a' <= c && c <= 'f'))
+ {
+ continue;
+ }
+ return intErr(s);
+ }
+ return _elm_lang$core$Result$Ok(parseInt(s, 16));
+ }
+
+ // is decimal
+ if (c > '9' || (c < '0' && c !== '-' && c !== '+'))
+ {
+ return intErr(s);
+ }
+ for (var i = 1; i < len; ++i)
+ {
+ var c = s[i];
+ if (c < '0' || '9' < c)
+ {
+ return intErr(s);
+ }
+ }
+
+ return _elm_lang$core$Result$Ok(parseInt(s, 10));
+}
+
+function intErr(s)
+{
+ return _elm_lang$core$Result$Err("could not convert string '" + s + "' to an Int");
+}
+
+
+function toFloat(s)
+{
+ // check if it is a hex, octal, or binary number
+ if (s.length === 0 || /[\sxbo]/.test(s))
+ {
+ return floatErr(s);
+ }
+ var n = +s;
+ // faster isNaN check
+ return n === n ? _elm_lang$core$Result$Ok(n) : floatErr(s);
+}
+
+function floatErr(s)
+{
+ return _elm_lang$core$Result$Err("could not convert string '" + s + "' to a Float");
+}
+
+
+function toList(str)
+{
+ return _elm_lang$core$Native_List.fromArray(str.split('').map(_elm_lang$core$Native_Utils.chr));
+}
+function fromList(chars)
+{
+ return _elm_lang$core$Native_List.toArray(chars).join('');
+}
+
+return {
+ isEmpty: isEmpty,
+ cons: F2(cons),
+ uncons: uncons,
+ append: F2(append),
+ concat: concat,
+ length: length,
+ map: F2(map),
+ filter: F2(filter),
+ reverse: reverse,
+ foldl: F3(foldl),
+ foldr: F3(foldr),
+
+ split: F2(split),
+ join: F2(join),
+ repeat: F2(repeat),
+
+ slice: F3(slice),
+ left: F2(left),
+ right: F2(right),
+ dropLeft: F2(dropLeft),
+ dropRight: F2(dropRight),
+
+ pad: F3(pad),
+ padLeft: F3(padLeft),
+ padRight: F3(padRight),
+
+ trim: trim,
+ trimLeft: trimLeft,
+ trimRight: trimRight,
+
+ words: words,
+ lines: lines,
+
+ toUpper: toUpper,
+ toLower: toLower,
+
+ any: F2(any),
+ all: F2(all),
+
+ contains: F2(contains),
+ startsWith: F2(startsWith),
+ endsWith: F2(endsWith),
+ indexes: F2(indexes),
+
+ toInt: toInt,
+ toFloat: toFloat,
+ toList: toList,
+ fromList: fromList
+};
+
+}();
+var _elm_lang$core$String$fromList = _elm_lang$core$Native_String.fromList;
+var _elm_lang$core$String$toList = _elm_lang$core$Native_String.toList;
+var _elm_lang$core$String$toFloat = _elm_lang$core$Native_String.toFloat;
+var _elm_lang$core$String$toInt = _elm_lang$core$Native_String.toInt;
+var _elm_lang$core$String$indices = _elm_lang$core$Native_String.indexes;
+var _elm_lang$core$String$indexes = _elm_lang$core$Native_String.indexes;
+var _elm_lang$core$String$endsWith = _elm_lang$core$Native_String.endsWith;
+var _elm_lang$core$String$startsWith = _elm_lang$core$Native_String.startsWith;
+var _elm_lang$core$String$contains = _elm_lang$core$Native_String.contains;
+var _elm_lang$core$String$all = _elm_lang$core$Native_String.all;
+var _elm_lang$core$String$any = _elm_lang$core$Native_String.any;
+var _elm_lang$core$String$toLower = _elm_lang$core$Native_String.toLower;
+var _elm_lang$core$String$toUpper = _elm_lang$core$Native_String.toUpper;
+var _elm_lang$core$String$lines = _elm_lang$core$Native_String.lines;
+var _elm_lang$core$String$words = _elm_lang$core$Native_String.words;
+var _elm_lang$core$String$trimRight = _elm_lang$core$Native_String.trimRight;
+var _elm_lang$core$String$trimLeft = _elm_lang$core$Native_String.trimLeft;
+var _elm_lang$core$String$trim = _elm_lang$core$Native_String.trim;
+var _elm_lang$core$String$padRight = _elm_lang$core$Native_String.padRight;
+var _elm_lang$core$String$padLeft = _elm_lang$core$Native_String.padLeft;
+var _elm_lang$core$String$pad = _elm_lang$core$Native_String.pad;
+var _elm_lang$core$String$dropRight = _elm_lang$core$Native_String.dropRight;
+var _elm_lang$core$String$dropLeft = _elm_lang$core$Native_String.dropLeft;
+var _elm_lang$core$String$right = _elm_lang$core$Native_String.right;
+var _elm_lang$core$String$left = _elm_lang$core$Native_String.left;
+var _elm_lang$core$String$slice = _elm_lang$core$Native_String.slice;
+var _elm_lang$core$String$repeat = _elm_lang$core$Native_String.repeat;
+var _elm_lang$core$String$join = _elm_lang$core$Native_String.join;
+var _elm_lang$core$String$split = _elm_lang$core$Native_String.split;
+var _elm_lang$core$String$foldr = _elm_lang$core$Native_String.foldr;
+var _elm_lang$core$String$foldl = _elm_lang$core$Native_String.foldl;
+var _elm_lang$core$String$reverse = _elm_lang$core$Native_String.reverse;
+var _elm_lang$core$String$filter = _elm_lang$core$Native_String.filter;
+var _elm_lang$core$String$map = _elm_lang$core$Native_String.map;
+var _elm_lang$core$String$length = _elm_lang$core$Native_String.length;
+var _elm_lang$core$String$concat = _elm_lang$core$Native_String.concat;
+var _elm_lang$core$String$append = _elm_lang$core$Native_String.append;
+var _elm_lang$core$String$uncons = _elm_lang$core$Native_String.uncons;
+var _elm_lang$core$String$cons = _elm_lang$core$Native_String.cons;
+var _elm_lang$core$String$fromChar = function ($char) {
+ return A2(_elm_lang$core$String$cons, $char, '');
+};
+var _elm_lang$core$String$isEmpty = _elm_lang$core$Native_String.isEmpty;
+var _elm_lang$core$Dict$foldr = F3(
+ function (f, acc, t) {
+ foldr:
+ while (true) {
+ var _p0 = t;
+ if (_p0.ctor === 'RBEmpty_elm_builtin') {
+ return acc;
+ } else {
+ var _v1 = f,
+ _v2 = A3(
+ f,
+ _p0._1,
+ _p0._2,
+ A3(_elm_lang$core$Dict$foldr, f, acc, _p0._4)),
+ _v3 = _p0._3;
+ f = _v1;
+ acc = _v2;
+ t = _v3;
+ continue foldr;
+ }
+ }
+ });
+var _elm_lang$core$Dict$keys = function (dict) {
+ return A3(
+ _elm_lang$core$Dict$foldr,
+ F3(
+ function (key, value, keyList) {
+ return {ctor: '::', _0: key, _1: keyList};
+ }),
+ {ctor: '[]'},
+ dict);
+};
+var _elm_lang$core$Dict$values = function (dict) {
+ return A3(
+ _elm_lang$core$Dict$foldr,
+ F3(
+ function (key, value, valueList) {
+ return {ctor: '::', _0: value, _1: valueList};
+ }),
+ {ctor: '[]'},
+ dict);
+};
+var _elm_lang$core$Dict$toList = function (dict) {
+ return A3(
+ _elm_lang$core$Dict$foldr,
+ F3(
+ function (key, value, list) {
+ return {
+ ctor: '::',
+ _0: {ctor: '_Tuple2', _0: key, _1: value},
+ _1: list
+ };
+ }),
+ {ctor: '[]'},
+ dict);
+};
+var _elm_lang$core$Dict$foldl = F3(
+ function (f, acc, dict) {
+ foldl:
+ while (true) {
+ var _p1 = dict;
+ if (_p1.ctor === 'RBEmpty_elm_builtin') {
+ return acc;
+ } else {
+ var _v5 = f,
+ _v6 = A3(
+ f,
+ _p1._1,
+ _p1._2,
+ A3(_elm_lang$core$Dict$foldl, f, acc, _p1._3)),
+ _v7 = _p1._4;
+ f = _v5;
+ acc = _v6;
+ dict = _v7;
+ continue foldl;
+ }
+ }
+ });
+var _elm_lang$core$Dict$merge = F6(
+ function (leftStep, bothStep, rightStep, leftDict, rightDict, initialResult) {
+ var stepState = F3(
+ function (rKey, rValue, _p2) {
+ stepState:
+ while (true) {
+ var _p3 = _p2;
+ var _p9 = _p3._1;
+ var _p8 = _p3._0;
+ var _p4 = _p8;
+ if (_p4.ctor === '[]') {
+ return {
+ ctor: '_Tuple2',
+ _0: _p8,
+ _1: A3(rightStep, rKey, rValue, _p9)
+ };
+ } else {
+ var _p7 = _p4._1;
+ var _p6 = _p4._0._1;
+ var _p5 = _p4._0._0;
+ if (_elm_lang$core$Native_Utils.cmp(_p5, rKey) < 0) {
+ var _v10 = rKey,
+ _v11 = rValue,
+ _v12 = {
+ ctor: '_Tuple2',
+ _0: _p7,
+ _1: A3(leftStep, _p5, _p6, _p9)
+ };
+ rKey = _v10;
+ rValue = _v11;
+ _p2 = _v12;
+ continue stepState;
+ } else {
+ if (_elm_lang$core$Native_Utils.cmp(_p5, rKey) > 0) {
+ return {
+ ctor: '_Tuple2',
+ _0: _p8,
+ _1: A3(rightStep, rKey, rValue, _p9)
+ };
+ } else {
+ return {
+ ctor: '_Tuple2',
+ _0: _p7,
+ _1: A4(bothStep, _p5, _p6, rValue, _p9)
+ };
+ }
+ }
+ }
+ }
+ });
+ var _p10 = A3(
+ _elm_lang$core$Dict$foldl,
+ stepState,
+ {
+ ctor: '_Tuple2',
+ _0: _elm_lang$core$Dict$toList(leftDict),
+ _1: initialResult
+ },
+ rightDict);
+ var leftovers = _p10._0;
+ var intermediateResult = _p10._1;
+ return A3(
+ _elm_lang$core$List$foldl,
+ F2(
+ function (_p11, result) {
+ var _p12 = _p11;
+ return A3(leftStep, _p12._0, _p12._1, result);
+ }),
+ intermediateResult,
+ leftovers);
+ });
+var _elm_lang$core$Dict$reportRemBug = F4(
+ function (msg, c, lgot, rgot) {
+ return _elm_lang$core$Native_Debug.crash(
+ _elm_lang$core$String$concat(
+ {
+ ctor: '::',
+ _0: 'Internal red-black tree invariant violated, expected ',
+ _1: {
+ ctor: '::',
+ _0: msg,
+ _1: {
+ ctor: '::',
+ _0: ' and got ',
+ _1: {
+ ctor: '::',
+ _0: _elm_lang$core$Basics$toString(c),
+ _1: {
+ ctor: '::',
+ _0: '/',
+ _1: {
+ ctor: '::',
+ _0: lgot,
+ _1: {
+ ctor: '::',
+ _0: '/',
+ _1: {
+ ctor: '::',
+ _0: rgot,
+ _1: {
+ ctor: '::',
+ _0: '\nPlease report this bug to <https://github.com/elm-lang/core/issues>',
+ _1: {ctor: '[]'}
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }));
+ });
+var _elm_lang$core$Dict$isBBlack = function (dict) {
+ var _p13 = dict;
+ _v14_2:
+ do {
+ if (_p13.ctor === 'RBNode_elm_builtin') {
+ if (_p13._0.ctor === 'BBlack') {
+ return true;
+ } else {
+ break _v14_2;
+ }
+ } else {
+ if (_p13._0.ctor === 'LBBlack') {
+ return true;
+ } else {
+ break _v14_2;
+ }
+ }
+ } while(false);
+ return false;
+};
+var _elm_lang$core$Dict$sizeHelp = F2(
+ function (n, dict) {
+ sizeHelp:
+ while (true) {
+ var _p14 = dict;
+ if (_p14.ctor === 'RBEmpty_elm_builtin') {
+ return n;
+ } else {
+ var _v16 = A2(_elm_lang$core$Dict$sizeHelp, n + 1, _p14._4),
+ _v17 = _p14._3;
+ n = _v16;
+ dict = _v17;
+ continue sizeHelp;
+ }
+ }
+ });
+var _elm_lang$core$Dict$size = function (dict) {
+ return A2(_elm_lang$core$Dict$sizeHelp, 0, dict);
+};
+var _elm_lang$core$Dict$get = F2(
+ function (targetKey, dict) {
+ get:
+ while (true) {
+ var _p15 = dict;
+ if (_p15.ctor === 'RBEmpty_elm_builtin') {
+ return _elm_lang$core$Maybe$Nothing;
+ } else {
+ var _p16 = A2(_elm_lang$core$Basics$compare, targetKey, _p15._1);
+ switch (_p16.ctor) {
+ case 'LT':
+ var _v20 = targetKey,
+ _v21 = _p15._3;
+ targetKey = _v20;
+ dict = _v21;
+ continue get;
+ case 'EQ':
+ return _elm_lang$core$Maybe$Just(_p15._2);
+ default:
+ var _v22 = targetKey,
+ _v23 = _p15._4;
+ targetKey = _v22;
+ dict = _v23;
+ continue get;
+ }
+ }
+ }
+ });
+var _elm_lang$core$Dict$member = F2(
+ function (key, dict) {
+ var _p17 = A2(_elm_lang$core$Dict$get, key, dict);
+ if (_p17.ctor === 'Just') {
+ return true;
+ } else {
+ return false;
+ }
+ });
+var _elm_lang$core$Dict$maxWithDefault = F3(
+ function (k, v, r) {
+ maxWithDefault:
+ while (true) {
+ var _p18 = r;
+ if (_p18.ctor === 'RBEmpty_elm_builtin') {
+ return {ctor: '_Tuple2', _0: k, _1: v};
+ } else {
+ var _v26 = _p18._1,
+ _v27 = _p18._2,
+ _v28 = _p18._4;
+ k = _v26;
+ v = _v27;
+ r = _v28;
+ continue maxWithDefault;
+ }
+ }
+ });
+var _elm_lang$core$Dict$NBlack = {ctor: 'NBlack'};
+var _elm_lang$core$Dict$BBlack = {ctor: 'BBlack'};
+var _elm_lang$core$Dict$Black = {ctor: 'Black'};
+var _elm_lang$core$Dict$blackish = function (t) {
+ var _p19 = t;
+ if (_p19.ctor === 'RBNode_elm_builtin') {
+ var _p20 = _p19._0;
+ return _elm_lang$core$Native_Utils.eq(_p20, _elm_lang$core$Dict$Black) || _elm_lang$core$Native_Utils.eq(_p20, _elm_lang$core$Dict$BBlack);
+ } else {
+ return true;
+ }
+};
+var _elm_lang$core$Dict$Red = {ctor: 'Red'};
+var _elm_lang$core$Dict$moreBlack = function (color) {
+ var _p21 = color;
+ switch (_p21.ctor) {
+ case 'Black':
+ return _elm_lang$core$Dict$BBlack;
+ case 'Red':
+ return _elm_lang$core$Dict$Black;
+ case 'NBlack':
+ return _elm_lang$core$Dict$Red;
+ default:
+ return _elm_lang$core$Native_Debug.crash('Can\'t make a double black node more black!');
+ }
+};
+var _elm_lang$core$Dict$lessBlack = function (color) {
+ var _p22 = color;
+ switch (_p22.ctor) {
+ case 'BBlack':
+ return _elm_lang$core$Dict$Black;
+ case 'Black':
+ return _elm_lang$core$Dict$Red;
+ case 'Red':
+ return _elm_lang$core$Dict$NBlack;
+ default:
+ return _elm_lang$core$Native_Debug.crash('Can\'t make a negative black node less black!');
+ }
+};
+var _elm_lang$core$Dict$LBBlack = {ctor: 'LBBlack'};
+var _elm_lang$core$Dict$LBlack = {ctor: 'LBlack'};
+var _elm_lang$core$Dict$RBEmpty_elm_builtin = function (a) {
+ return {ctor: 'RBEmpty_elm_builtin', _0: a};
+};
+var _elm_lang$core$Dict$empty = _elm_lang$core$Dict$RBEmpty_elm_builtin(_elm_lang$core$Dict$LBlack);
+var _elm_lang$core$Dict$isEmpty = function (dict) {
+ return _elm_lang$core$Native_Utils.eq(dict, _elm_lang$core$Dict$empty);
+};
+var _elm_lang$core$Dict$RBNode_elm_builtin = F5(
+ function (a, b, c, d, e) {
+ return {ctor: 'RBNode_elm_builtin', _0: a, _1: b, _2: c, _3: d, _4: e};
+ });
+var _elm_lang$core$Dict$ensureBlackRoot = function (dict) {
+ var _p23 = dict;
+ if ((_p23.ctor === 'RBNode_elm_builtin') && (_p23._0.ctor === 'Red')) {
+ return A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Black, _p23._1, _p23._2, _p23._3, _p23._4);
+ } else {
+ return dict;
+ }
+};
+var _elm_lang$core$Dict$lessBlackTree = function (dict) {
+ var _p24 = dict;
+ if (_p24.ctor === 'RBNode_elm_builtin') {
+ return A5(
+ _elm_lang$core$Dict$RBNode_elm_builtin,
+ _elm_lang$core$Dict$lessBlack(_p24._0),
+ _p24._1,
+ _p24._2,
+ _p24._3,
+ _p24._4);
+ } else {
+ return _elm_lang$core$Dict$RBEmpty_elm_builtin(_elm_lang$core$Dict$LBlack);
+ }
+};
+var _elm_lang$core$Dict$balancedTree = function (col) {
+ return function (xk) {
+ return function (xv) {
+ return function (yk) {
+ return function (yv) {
+ return function (zk) {
+ return function (zv) {
+ return function (a) {
+ return function (b) {
+ return function (c) {
+ return function (d) {
+ return A5(
+ _elm_lang$core$Dict$RBNode_elm_builtin,
+ _elm_lang$core$Dict$lessBlack(col),
+ yk,
+ yv,
+ A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Black, xk, xv, a, b),
+ A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Black, zk, zv, c, d));
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+};
+var _elm_lang$core$Dict$blacken = function (t) {
+ var _p25 = t;
+ if (_p25.ctor === 'RBEmpty_elm_builtin') {
+ return _elm_lang$core$Dict$RBEmpty_elm_builtin(_elm_lang$core$Dict$LBlack);
+ } else {
+ return A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Black, _p25._1, _p25._2, _p25._3, _p25._4);
+ }
+};
+var _elm_lang$core$Dict$redden = function (t) {
+ var _p26 = t;
+ if (_p26.ctor === 'RBEmpty_elm_builtin') {
+ return _elm_lang$core$Native_Debug.crash('can\'t make a Leaf red');
+ } else {
+ return A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Red, _p26._1, _p26._2, _p26._3, _p26._4);
+ }
+};
+var _elm_lang$core$Dict$balanceHelp = function (tree) {
+ var _p27 = tree;
+ _v36_6:
+ do {
+ _v36_5:
+ do {
+ _v36_4:
+ do {
+ _v36_3:
+ do {
+ _v36_2:
+ do {
+ _v36_1:
+ do {
+ _v36_0:
+ do {
+ if (_p27.ctor === 'RBNode_elm_builtin') {
+ if (_p27._3.ctor === 'RBNode_elm_builtin') {
+ if (_p27._4.ctor === 'RBNode_elm_builtin') {
+ switch (_p27._3._0.ctor) {
+ case 'Red':
+ switch (_p27._4._0.ctor) {
+ case 'Red':
+ if ((_p27._3._3.ctor === 'RBNode_elm_builtin') && (_p27._3._3._0.ctor === 'Red')) {
+ break _v36_0;
+ } else {
+ if ((_p27._3._4.ctor === 'RBNode_elm_builtin') && (_p27._3._4._0.ctor === 'Red')) {
+ break _v36_1;
+ } else {
+ if ((_p27._4._3.ctor === 'RBNode_elm_builtin') && (_p27._4._3._0.ctor === 'Red')) {
+ break _v36_2;
+ } else {
+ if ((_p27._4._4.ctor === 'RBNode_elm_builtin') && (_p27._4._4._0.ctor === 'Red')) {
+ break _v36_3;
+ } else {
+ break _v36_6;
+ }
+ }
+ }
+ }
+ case 'NBlack':
+ if ((_p27._3._3.ctor === 'RBNode_elm_builtin') && (_p27._3._3._0.ctor === 'Red')) {
+ break _v36_0;
+ } else {
+ if ((_p27._3._4.ctor === 'RBNode_elm_builtin') && (_p27._3._4._0.ctor === 'Red')) {
+ break _v36_1;
+ } else {
+ if (((((_p27._0.ctor === 'BBlack') && (_p27._4._3.ctor === 'RBNode_elm_builtin')) && (_p27._4._3._0.ctor === 'Black')) && (_p27._4._4.ctor === 'RBNode_elm_builtin')) && (_p27._4._4._0.ctor === 'Black')) {
+ break _v36_4;
+ } else {
+ break _v36_6;
+ }
+ }
+ }
+ default:
+ if ((_p27._3._3.ctor === 'RBNode_elm_builtin') && (_p27._3._3._0.ctor === 'Red')) {
+ break _v36_0;
+ } else {
+ if ((_p27._3._4.ctor === 'RBNode_elm_builtin') && (_p27._3._4._0.ctor === 'Red')) {
+ break _v36_1;
+ } else {
+ break _v36_6;
+ }
+ }
+ }
+ case 'NBlack':
+ switch (_p27._4._0.ctor) {
+ case 'Red':
+ if ((_p27._4._3.ctor === 'RBNode_elm_builtin') && (_p27._4._3._0.ctor === 'Red')) {
+ break _v36_2;
+ } else {
+ if ((_p27._4._4.ctor === 'RBNode_elm_builtin') && (_p27._4._4._0.ctor === 'Red')) {
+ break _v36_3;
+ } else {
+ if (((((_p27._0.ctor === 'BBlack') && (_p27._3._3.ctor === 'RBNode_elm_builtin')) && (_p27._3._3._0.ctor === 'Black')) && (_p27._3._4.ctor === 'RBNode_elm_builtin')) && (_p27._3._4._0.ctor === 'Black')) {
+ break _v36_5;
+ } else {
+ break _v36_6;
+ }
+ }
+ }
+ case 'NBlack':
+ if (_p27._0.ctor === 'BBlack') {
+ if ((((_p27._4._3.ctor === 'RBNode_elm_builtin') && (_p27._4._3._0.ctor === 'Black')) && (_p27._4._4.ctor === 'RBNode_elm_builtin')) && (_p27._4._4._0.ctor === 'Black')) {
+ break _v36_4;
+ } else {
+ if ((((_p27._3._3.ctor === 'RBNode_elm_builtin') && (_p27._3._3._0.ctor === 'Black')) && (_p27._3._4.ctor === 'RBNode_elm_builtin')) && (_p27._3._4._0.ctor === 'Black')) {
+ break _v36_5;
+ } else {
+ break _v36_6;
+ }
+ }
+ } else {
+ break _v36_6;
+ }
+ default:
+ if (((((_p27._0.ctor === 'BBlack') && (_p27._3._3.ctor === 'RBNode_elm_builtin')) && (_p27._3._3._0.ctor === 'Black')) && (_p27._3._4.ctor === 'RBNode_elm_builtin')) && (_p27._3._4._0.ctor === 'Black')) {
+ break _v36_5;
+ } else {
+ break _v36_6;
+ }
+ }
+ default:
+ switch (_p27._4._0.ctor) {
+ case 'Red':
+ if ((_p27._4._3.ctor === 'RBNode_elm_builtin') && (_p27._4._3._0.ctor === 'Red')) {
+ break _v36_2;
+ } else {
+ if ((_p27._4._4.ctor === 'RBNode_elm_builtin') && (_p27._4._4._0.ctor === 'Red')) {
+ break _v36_3;
+ } else {
+ break _v36_6;
+ }
+ }
+ case 'NBlack':
+ if (((((_p27._0.ctor === 'BBlack') && (_p27._4._3.ctor === 'RBNode_elm_builtin')) && (_p27._4._3._0.ctor === 'Black')) && (_p27._4._4.ctor === 'RBNode_elm_builtin')) && (_p27._4._4._0.ctor === 'Black')) {
+ break _v36_4;
+ } else {
+ break _v36_6;
+ }
+ default:
+ break _v36_6;
+ }
+ }
+ } else {
+ switch (_p27._3._0.ctor) {
+ case 'Red':
+ if ((_p27._3._3.ctor === 'RBNode_elm_builtin') && (_p27._3._3._0.ctor === 'Red')) {
+ break _v36_0;
+ } else {
+ if ((_p27._3._4.ctor === 'RBNode_elm_builtin') && (_p27._3._4._0.ctor === 'Red')) {
+ break _v36_1;
+ } else {
+ break _v36_6;
+ }
+ }
+ case 'NBlack':
+ if (((((_p27._0.ctor === 'BBlack') && (_p27._3._3.ctor === 'RBNode_elm_builtin')) && (_p27._3._3._0.ctor === 'Black')) && (_p27._3._4.ctor === 'RBNode_elm_builtin')) && (_p27._3._4._0.ctor === 'Black')) {
+ break _v36_5;
+ } else {
+ break _v36_6;
+ }
+ default:
+ break _v36_6;
+ }
+ }
+ } else {
+ if (_p27._4.ctor === 'RBNode_elm_builtin') {
+ switch (_p27._4._0.ctor) {
+ case 'Red':
+ if ((_p27._4._3.ctor === 'RBNode_elm_builtin') && (_p27._4._3._0.ctor === 'Red')) {
+ break _v36_2;
+ } else {
+ if ((_p27._4._4.ctor === 'RBNode_elm_builtin') && (_p27._4._4._0.ctor === 'Red')) {
+ break _v36_3;
+ } else {
+ break _v36_6;
+ }
+ }
+ case 'NBlack':
+ if (((((_p27._0.ctor === 'BBlack') && (_p27._4._3.ctor === 'RBNode_elm_builtin')) && (_p27._4._3._0.ctor === 'Black')) && (_p27._4._4.ctor === 'RBNode_elm_builtin')) && (_p27._4._4._0.ctor === 'Black')) {
+ break _v36_4;
+ } else {
+ break _v36_6;
+ }
+ default:
+ break _v36_6;
+ }
+ } else {
+ break _v36_6;
+ }
+ }
+ } else {
+ break _v36_6;
+ }
+ } while(false);
+ return _elm_lang$core$Dict$balancedTree(_p27._0)(_p27._3._3._1)(_p27._3._3._2)(_p27._3._1)(_p27._3._2)(_p27._1)(_p27._2)(_p27._3._3._3)(_p27._3._3._4)(_p27._3._4)(_p27._4);
+ } while(false);
+ return _elm_lang$core$Dict$balancedTree(_p27._0)(_p27._3._1)(_p27._3._2)(_p27._3._4._1)(_p27._3._4._2)(_p27._1)(_p27._2)(_p27._3._3)(_p27._3._4._3)(_p27._3._4._4)(_p27._4);
+ } while(false);
+ return _elm_lang$core$Dict$balancedTree(_p27._0)(_p27._1)(_p27._2)(_p27._4._3._1)(_p27._4._3._2)(_p27._4._1)(_p27._4._2)(_p27._3)(_p27._4._3._3)(_p27._4._3._4)(_p27._4._4);
+ } while(false);
+ return _elm_lang$core$Dict$balancedTree(_p27._0)(_p27._1)(_p27._2)(_p27._4._1)(_p27._4._2)(_p27._4._4._1)(_p27._4._4._2)(_p27._3)(_p27._4._3)(_p27._4._4._3)(_p27._4._4._4);
+ } while(false);
+ return A5(
+ _elm_lang$core$Dict$RBNode_elm_builtin,
+ _elm_lang$core$Dict$Black,
+ _p27._4._3._1,
+ _p27._4._3._2,
+ A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Black, _p27._1, _p27._2, _p27._3, _p27._4._3._3),
+ A5(
+ _elm_lang$core$Dict$balance,
+ _elm_lang$core$Dict$Black,
+ _p27._4._1,
+ _p27._4._2,
+ _p27._4._3._4,
+ _elm_lang$core$Dict$redden(_p27._4._4)));
+ } while(false);
+ return A5(
+ _elm_lang$core$Dict$RBNode_elm_builtin,
+ _elm_lang$core$Dict$Black,
+ _p27._3._4._1,
+ _p27._3._4._2,
+ A5(
+ _elm_lang$core$Dict$balance,
+ _elm_lang$core$Dict$Black,
+ _p27._3._1,
+ _p27._3._2,
+ _elm_lang$core$Dict$redden(_p27._3._3),
+ _p27._3._4._3),
+ A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Black, _p27._1, _p27._2, _p27._3._4._4, _p27._4));
+ } while(false);
+ return tree;
+};
+var _elm_lang$core$Dict$balance = F5(
+ function (c, k, v, l, r) {
+ var tree = A5(_elm_lang$core$Dict$RBNode_elm_builtin, c, k, v, l, r);
+ return _elm_lang$core$Dict$blackish(tree) ? _elm_lang$core$Dict$balanceHelp(tree) : tree;
+ });
+var _elm_lang$core$Dict$bubble = F5(
+ function (c, k, v, l, r) {
+ return (_elm_lang$core$Dict$isBBlack(l) || _elm_lang$core$Dict$isBBlack(r)) ? A5(
+ _elm_lang$core$Dict$balance,
+ _elm_lang$core$Dict$moreBlack(c),
+ k,
+ v,
+ _elm_lang$core$Dict$lessBlackTree(l),
+ _elm_lang$core$Dict$lessBlackTree(r)) : A5(_elm_lang$core$Dict$RBNode_elm_builtin, c, k, v, l, r);
+ });
+var _elm_lang$core$Dict$removeMax = F5(
+ function (c, k, v, l, r) {
+ var _p28 = r;
+ if (_p28.ctor === 'RBEmpty_elm_builtin') {
+ return A3(_elm_lang$core$Dict$rem, c, l, r);
+ } else {
+ return A5(
+ _elm_lang$core$Dict$bubble,
+ c,
+ k,
+ v,
+ l,
+ A5(_elm_lang$core$Dict$removeMax, _p28._0, _p28._1, _p28._2, _p28._3, _p28._4));
+ }
+ });
+var _elm_lang$core$Dict$rem = F3(
+ function (color, left, right) {
+ var _p29 = {ctor: '_Tuple2', _0: left, _1: right};
+ if (_p29._0.ctor === 'RBEmpty_elm_builtin') {
+ if (_p29._1.ctor === 'RBEmpty_elm_builtin') {
+ var _p30 = color;
+ switch (_p30.ctor) {
+ case 'Red':
+ return _elm_lang$core$Dict$RBEmpty_elm_builtin(_elm_lang$core$Dict$LBlack);
+ case 'Black':
+ return _elm_lang$core$Dict$RBEmpty_elm_builtin(_elm_lang$core$Dict$LBBlack);
+ default:
+ return _elm_lang$core$Native_Debug.crash('cannot have bblack or nblack nodes at this point');
+ }
+ } else {
+ var _p33 = _p29._1._0;
+ var _p32 = _p29._0._0;
+ var _p31 = {ctor: '_Tuple3', _0: color, _1: _p32, _2: _p33};
+ if ((((_p31.ctor === '_Tuple3') && (_p31._0.ctor === 'Black')) && (_p31._1.ctor === 'LBlack')) && (_p31._2.ctor === 'Red')) {
+ return A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Black, _p29._1._1, _p29._1._2, _p29._1._3, _p29._1._4);
+ } else {
+ return A4(
+ _elm_lang$core$Dict$reportRemBug,
+ 'Black/LBlack/Red',
+ color,
+ _elm_lang$core$Basics$toString(_p32),
+ _elm_lang$core$Basics$toString(_p33));
+ }
+ }
+ } else {
+ if (_p29._1.ctor === 'RBEmpty_elm_builtin') {
+ var _p36 = _p29._1._0;
+ var _p35 = _p29._0._0;
+ var _p34 = {ctor: '_Tuple3', _0: color, _1: _p35, _2: _p36};
+ if ((((_p34.ctor === '_Tuple3') && (_p34._0.ctor === 'Black')) && (_p34._1.ctor === 'Red')) && (_p34._2.ctor === 'LBlack')) {
+ return A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Black, _p29._0._1, _p29._0._2, _p29._0._3, _p29._0._4);
+ } else {
+ return A4(
+ _elm_lang$core$Dict$reportRemBug,
+ 'Black/Red/LBlack',
+ color,
+ _elm_lang$core$Basics$toString(_p35),
+ _elm_lang$core$Basics$toString(_p36));
+ }
+ } else {
+ var _p40 = _p29._0._2;
+ var _p39 = _p29._0._4;
+ var _p38 = _p29._0._1;
+ var newLeft = A5(_elm_lang$core$Dict$removeMax, _p29._0._0, _p38, _p40, _p29._0._3, _p39);
+ var _p37 = A3(_elm_lang$core$Dict$maxWithDefault, _p38, _p40, _p39);
+ var k = _p37._0;
+ var v = _p37._1;
+ return A5(_elm_lang$core$Dict$bubble, color, k, v, newLeft, right);
+ }
+ }
+ });
+var _elm_lang$core$Dict$map = F2(
+ function (f, dict) {
+ var _p41 = dict;
+ if (_p41.ctor === 'RBEmpty_elm_builtin') {
+ return _elm_lang$core$Dict$RBEmpty_elm_builtin(_elm_lang$core$Dict$LBlack);
+ } else {
+ var _p42 = _p41._1;
+ return A5(
+ _elm_lang$core$Dict$RBNode_elm_builtin,
+ _p41._0,
+ _p42,
+ A2(f, _p42, _p41._2),
+ A2(_elm_lang$core$Dict$map, f, _p41._3),
+ A2(_elm_lang$core$Dict$map, f, _p41._4));
+ }
+ });
+var _elm_lang$core$Dict$Same = {ctor: 'Same'};
+var _elm_lang$core$Dict$Remove = {ctor: 'Remove'};
+var _elm_lang$core$Dict$Insert = {ctor: 'Insert'};
+var _elm_lang$core$Dict$update = F3(
+ function (k, alter, dict) {
+ var up = function (dict) {
+ var _p43 = dict;
+ if (_p43.ctor === 'RBEmpty_elm_builtin') {
+ var _p44 = alter(_elm_lang$core$Maybe$Nothing);
+ if (_p44.ctor === 'Nothing') {
+ return {ctor: '_Tuple2', _0: _elm_lang$core$Dict$Same, _1: _elm_lang$core$Dict$empty};
+ } else {
+ return {
+ ctor: '_Tuple2',
+ _0: _elm_lang$core$Dict$Insert,
+ _1: A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Red, k, _p44._0, _elm_lang$core$Dict$empty, _elm_lang$core$Dict$empty)
+ };
+ }
+ } else {
+ var _p55 = _p43._2;
+ var _p54 = _p43._4;
+ var _p53 = _p43._3;
+ var _p52 = _p43._1;
+ var _p51 = _p43._0;
+ var _p45 = A2(_elm_lang$core$Basics$compare, k, _p52);
+ switch (_p45.ctor) {
+ case 'EQ':
+ var _p46 = alter(
+ _elm_lang$core$Maybe$Just(_p55));
+ if (_p46.ctor === 'Nothing') {
+ return {
+ ctor: '_Tuple2',
+ _0: _elm_lang$core$Dict$Remove,
+ _1: A3(_elm_lang$core$Dict$rem, _p51, _p53, _p54)
+ };
+ } else {
+ return {
+ ctor: '_Tuple2',
+ _0: _elm_lang$core$Dict$Same,
+ _1: A5(_elm_lang$core$Dict$RBNode_elm_builtin, _p51, _p52, _p46._0, _p53, _p54)
+ };
+ }
+ case 'LT':
+ var _p47 = up(_p53);
+ var flag = _p47._0;
+ var newLeft = _p47._1;
+ var _p48 = flag;
+ switch (_p48.ctor) {
+ case 'Same':
+ return {
+ ctor: '_Tuple2',
+ _0: _elm_lang$core$Dict$Same,
+ _1: A5(_elm_lang$core$Dict$RBNode_elm_builtin, _p51, _p52, _p55, newLeft, _p54)
+ };
+ case 'Insert':
+ return {
+ ctor: '_Tuple2',
+ _0: _elm_lang$core$Dict$Insert,
+ _1: A5(_elm_lang$core$Dict$balance, _p51, _p52, _p55, newLeft, _p54)
+ };
+ default:
+ return {
+ ctor: '_Tuple2',
+ _0: _elm_lang$core$Dict$Remove,
+ _1: A5(_elm_lang$core$Dict$bubble, _p51, _p52, _p55, newLeft, _p54)
+ };
+ }
+ default:
+ var _p49 = up(_p54);
+ var flag = _p49._0;
+ var newRight = _p49._1;
+ var _p50 = flag;
+ switch (_p50.ctor) {
+ case 'Same':
+ return {
+ ctor: '_Tuple2',
+ _0: _elm_lang$core$Dict$Same,
+ _1: A5(_elm_lang$core$Dict$RBNode_elm_builtin, _p51, _p52, _p55, _p53, newRight)
+ };
+ case 'Insert':
+ return {
+ ctor: '_Tuple2',
+ _0: _elm_lang$core$Dict$Insert,
+ _1: A5(_elm_lang$core$Dict$balance, _p51, _p52, _p55, _p53, newRight)
+ };
+ default:
+ return {
+ ctor: '_Tuple2',
+ _0: _elm_lang$core$Dict$Remove,
+ _1: A5(_elm_lang$core$Dict$bubble, _p51, _p52, _p55, _p53, newRight)
+ };
+ }
+ }
+ }
+ };
+ var _p56 = up(dict);
+ var flag = _p56._0;
+ var updatedDict = _p56._1;
+ var _p57 = flag;
+ switch (_p57.ctor) {
+ case 'Same':
+ return updatedDict;
+ case 'Insert':
+ return _elm_lang$core$Dict$ensureBlackRoot(updatedDict);
+ default:
+ return _elm_lang$core$Dict$blacken(updatedDict);
+ }
+ });
+var _elm_lang$core$Dict$insert = F3(
+ function (key, value, dict) {
+ return A3(
+ _elm_lang$core$Dict$update,
+ key,
+ _elm_lang$core$Basics$always(
+ _elm_lang$core$Maybe$Just(value)),
+ dict);
+ });
+var _elm_lang$core$Dict$singleton = F2(
+ function (key, value) {
+ return A3(_elm_lang$core$Dict$insert, key, value, _elm_lang$core$Dict$empty);
+ });
+var _elm_lang$core$Dict$union = F2(
+ function (t1, t2) {
+ return A3(_elm_lang$core$Dict$foldl, _elm_lang$core$Dict$insert, t2, t1);
+ });
+var _elm_lang$core$Dict$filter = F2(
+ function (predicate, dictionary) {
+ var add = F3(
+ function (key, value, dict) {
+ return A2(predicate, key, value) ? A3(_elm_lang$core$Dict$insert, key, value, dict) : dict;
+ });
+ return A3(_elm_lang$core$Dict$foldl, add, _elm_lang$core$Dict$empty, dictionary);
+ });
+var _elm_lang$core$Dict$intersect = F2(
+ function (t1, t2) {
+ return A2(
+ _elm_lang$core$Dict$filter,
+ F2(
+ function (k, _p58) {
+ return A2(_elm_lang$core$Dict$member, k, t2);
+ }),
+ t1);
+ });
+var _elm_lang$core$Dict$partition = F2(
+ function (predicate, dict) {
+ var add = F3(
+ function (key, value, _p59) {
+ var _p60 = _p59;
+ var _p62 = _p60._1;
+ var _p61 = _p60._0;
+ return A2(predicate, key, value) ? {
+ ctor: '_Tuple2',
+ _0: A3(_elm_lang$core$Dict$insert, key, value, _p61),
+ _1: _p62
+ } : {
+ ctor: '_Tuple2',
+ _0: _p61,
+ _1: A3(_elm_lang$core$Dict$insert, key, value, _p62)
+ };
+ });
+ return A3(
+ _elm_lang$core$Dict$foldl,
+ add,
+ {ctor: '_Tuple2', _0: _elm_lang$core$Dict$empty, _1: _elm_lang$core$Dict$empty},
+ dict);
+ });
+var _elm_lang$core$Dict$fromList = function (assocs) {
+ return A3(
+ _elm_lang$core$List$foldl,
+ F2(
+ function (_p63, dict) {
+ var _p64 = _p63;
+ return A3(_elm_lang$core$Dict$insert, _p64._0, _p64._1, dict);
+ }),
+ _elm_lang$core$Dict$empty,
+ assocs);
+};
+var _elm_lang$core$Dict$remove = F2(
+ function (key, dict) {
+ return A3(
+ _elm_lang$core$Dict$update,
+ key,
+ _elm_lang$core$Basics$always(_elm_lang$core$Maybe$Nothing),
+ dict);
+ });
+var _elm_lang$core$Dict$diff = F2(
+ function (t1, t2) {
+ return A3(
+ _elm_lang$core$Dict$foldl,
+ F3(
+ function (k, v, t) {
+ return A2(_elm_lang$core$Dict$remove, k, t);
+ }),
+ t1,
+ t2);
+ });
+var _elm_lang$core$Debug$crash = _elm_lang$core$Native_Debug.crash;
+var _elm_lang$core$Debug$log = _elm_lang$core$Native_Debug.log;
+//import Maybe, Native.Array, Native.List, Native.Utils, Result //
+
+var _elm_lang$core$Native_Json = function() {
+
+
+// CORE DECODERS
+
+function succeed(msg)
+{
+ return {
+ ctor: '<decoder>',
+ tag: 'succeed',
+ msg: msg
+ };
+}
+
+function fail(msg)
+{
+ return {
+ ctor: '<decoder>',
+ tag: 'fail',
+ msg: msg
+ };
+}
+
+function decodePrimitive(tag)
+{
+ return {
+ ctor: '<decoder>',
+ tag: tag
+ };
+}
+
+function decodeContainer(tag, decoder)
+{
+ return {
+ ctor: '<decoder>',
+ tag: tag,
+ decoder: decoder
+ };
+}
+
+function decodeNull(value)
+{
+ return {
+ ctor: '<decoder>',
+ tag: 'null',
+ value: value
+ };
+}
+
+function decodeField(field, decoder)
+{
+ return {
+ ctor: '<decoder>',
+ tag: 'field',
+ field: field,
+ decoder: decoder
+ };
+}
+
+function decodeIndex(index, decoder)
+{
+ return {
+ ctor: '<decoder>',
+ tag: 'index',
+ index: index,
+ decoder: decoder
+ };
+}
+
+function decodeKeyValuePairs(decoder)
+{
+ return {
+ ctor: '<decoder>',
+ tag: 'key-value',
+ decoder: decoder
+ };
+}
+
+function mapMany(f, decoders)
+{
+ return {
+ ctor: '<decoder>',
+ tag: 'map-many',
+ func: f,
+ decoders: decoders
+ };
+}
+
+function andThen(callback, decoder)
+{
+ return {
+ ctor: '<decoder>',
+ tag: 'andThen',
+ decoder: decoder,
+ callback: callback
+ };
+}
+
+function oneOf(decoders)
+{
+ return {
+ ctor: '<decoder>',
+ tag: 'oneOf',
+ decoders: decoders
+ };
+}
+
+
+// DECODING OBJECTS
+
+function map1(f, d1)
+{
+ return mapMany(f, [d1]);
+}
+
+function map2(f, d1, d2)
+{
+ return mapMany(f, [d1, d2]);
+}
+
+function map3(f, d1, d2, d3)
+{
+ return mapMany(f, [d1, d2, d3]);
+}
+
+function map4(f, d1, d2, d3, d4)
+{
+ return mapMany(f, [d1, d2, d3, d4]);
+}
+
+function map5(f, d1, d2, d3, d4, d5)
+{
+ return mapMany(f, [d1, d2, d3, d4, d5]);
+}
+
+function map6(f, d1, d2, d3, d4, d5, d6)
+{
+ return mapMany(f, [d1, d2, d3, d4, d5, d6]);
+}
+
+function map7(f, d1, d2, d3, d4, d5, d6, d7)
+{
+ return mapMany(f, [d1, d2, d3, d4, d5, d6, d7]);
+}
+
+function map8(f, d1, d2, d3, d4, d5, d6, d7, d8)
+{
+ return mapMany(f, [d1, d2, d3, d4, d5, d6, d7, d8]);
+}
+
+
+// DECODE HELPERS
+
+function ok(value)
+{
+ return { tag: 'ok', value: value };
+}
+
+function badPrimitive(type, value)
+{
+ return { tag: 'primitive', type: type, value: value };
+}
+
+function badIndex(index, nestedProblems)
+{
+ return { tag: 'index', index: index, rest: nestedProblems };
+}
+
+function badField(field, nestedProblems)
+{
+ return { tag: 'field', field: field, rest: nestedProblems };
+}
+
+function badIndex(index, nestedProblems)
+{
+ return { tag: 'index', index: index, rest: nestedProblems };
+}
+
+function badOneOf(problems)
+{
+ return { tag: 'oneOf', problems: problems };
+}
+
+function bad(msg)
+{
+ return { tag: 'fail', msg: msg };
+}
+
+function badToString(problem)
+{
+ var context = '_';
+ while (problem)
+ {
+ switch (problem.tag)
+ {
+ case 'primitive':
+ return 'Expecting ' + problem.type
+ + (context === '_' ? '' : ' at ' + context)
+ + ' but instead got: ' + jsToString(problem.value);
+
+ case 'index':
+ context += '[' + problem.index + ']';
+ problem = problem.rest;
+ break;
+
+ case 'field':
+ context += '.' + problem.field;
+ problem = problem.rest;
+ break;
+
+ case 'oneOf':
+ var problems = problem.problems;
+ for (var i = 0; i < problems.length; i++)
+ {
+ problems[i] = badToString(problems[i]);
+ }
+ return 'I ran into the following problems'
+ + (context === '_' ? '' : ' at ' + context)
+ + ':\n\n' + problems.join('\n');
+
+ case 'fail':
+ return 'I ran into a `fail` decoder'
+ + (context === '_' ? '' : ' at ' + context)
+ + ': ' + problem.msg;
+ }
+ }
+}
+
+function jsToString(value)
+{
+ return value === undefined
+ ? 'undefined'
+ : JSON.stringify(value);
+}
+
+
+// DECODE
+
+function runOnString(decoder, string)
+{
+ var json;
+ try
+ {
+ json = JSON.parse(string);
+ }
+ catch (e)
+ {
+ return _elm_lang$core$Result$Err('Given an invalid JSON: ' + e.message);
+ }
+ return run(decoder, json);
+}
+
+function run(decoder, value)
+{
+ var result = runHelp(decoder, value);
+ return (result.tag === 'ok')
+ ? _elm_lang$core$Result$Ok(result.value)
+ : _elm_lang$core$Result$Err(badToString(result));
+}
+
+function runHelp(decoder, value)
+{
+ switch (decoder.tag)
+ {
+ case 'bool':
+ return (typeof value === 'boolean')
+ ? ok(value)
+ : badPrimitive('a Bool', value);
+
+ case 'int':
+ if (typeof value !== 'number') {
+ return badPrimitive('an Int', value);
+ }
+
+ if (-2147483647 < value && value < 2147483647 && (value | 0) === value) {
+ return ok(value);
+ }
+
+ if (isFinite(value) && !(value % 1)) {
+ return ok(value);
+ }
+
+ return badPrimitive('an Int', value);
+
+ case 'float':
+ return (typeof value === 'number')
+ ? ok(value)
+ : badPrimitive('a Float', value);
+
+ case 'string':
+ return (typeof value === 'string')
+ ? ok(value)
+ : (value instanceof String)
+ ? ok(value + '')
+ : badPrimitive('a String', value);
+
+ case 'null':
+ return (value === null)
+ ? ok(decoder.value)
+ : badPrimitive('null', value);
+
+ case 'value':
+ return ok(value);
+
+ case 'list':
+ if (!(value instanceof Array))
+ {
+ return badPrimitive('a List', value);
+ }
+
+ var list = _elm_lang$core$Native_List.Nil;
+ for (var i = value.length; i--; )
+ {
+ var result = runHelp(decoder.decoder, value[i]);
+ if (result.tag !== 'ok')
+ {
+ return badIndex(i, result)
+ }
+ list = _elm_lang$core$Native_List.Cons(result.value, list);
+ }
+ return ok(list);
+
+ case 'array':
+ if (!(value instanceof Array))
+ {
+ return badPrimitive('an Array', value);
+ }
+
+ var len = value.length;
+ var array = new Array(len);
+ for (var i = len; i--; )
+ {
+ var result = runHelp(decoder.decoder, value[i]);
+ if (result.tag !== 'ok')
+ {
+ return badIndex(i, result);
+ }
+ array[i] = result.value;
+ }
+ return ok(_elm_lang$core$Native_Array.fromJSArray(array));
+
+ case 'maybe':
+ var result = runHelp(decoder.decoder, value);
+ return (result.tag === 'ok')
+ ? ok(_elm_lang$core$Maybe$Just(result.value))
+ : ok(_elm_lang$core$Maybe$Nothing);
+
+ case 'field':
+ var field = decoder.field;
+ if (typeof value !== 'object' || value === null || !(field in value))
+ {
+ return badPrimitive('an object with a field named `' + field + '`', value);
+ }
+
+ var result = runHelp(decoder.decoder, value[field]);
+ return (result.tag === 'ok') ? result : badField(field, result);
+
+ case 'index':
+ var index = decoder.index;
+ if (!(value instanceof Array))
+ {
+ return badPrimitive('an array', value);
+ }
+ if (index >= value.length)
+ {
+ return badPrimitive('a longer array. Need index ' + index + ' but there are only ' + value.length + ' entries', value);
+ }
+
+ var result = runHelp(decoder.decoder, value[index]);
+ return (result.tag === 'ok') ? result : badIndex(index, result);
+
+ case 'key-value':
+ if (typeof value !== 'object' || value === null || value instanceof Array)
+ {
+ return badPrimitive('an object', value);
+ }
+
+ var keyValuePairs = _elm_lang$core$Native_List.Nil;
+ for (var key in value)
+ {
+ var result = runHelp(decoder.decoder, value[key]);
+ if (result.tag !== 'ok')
+ {
+ return badField(key, result);
+ }
+ var pair = _elm_lang$core$Native_Utils.Tuple2(key, result.value);
+ keyValuePairs = _elm_lang$core$Native_List.Cons(pair, keyValuePairs);
+ }
+ return ok(keyValuePairs);
+
+ case 'map-many':
+ var answer = decoder.func;
+ var decoders = decoder.decoders;
+ for (var i = 0; i < decoders.length; i++)
+ {
+ var result = runHelp(decoders[i], value);
+ if (result.tag !== 'ok')
+ {
+ return result;
+ }
+ answer = answer(result.value);
+ }
+ return ok(answer);
+
+ case 'andThen':
+ var result = runHelp(decoder.decoder, value);
+ return (result.tag !== 'ok')
+ ? result
+ : runHelp(decoder.callback(result.value), value);
+
+ case 'oneOf':
+ var errors = [];
+ var temp = decoder.decoders;
+ while (temp.ctor !== '[]')
+ {
+ var result = runHelp(temp._0, value);
+
+ if (result.tag === 'ok')
+ {
+ return result;
+ }
+
+ errors.push(result);
+
+ temp = temp._1;
+ }
+ return badOneOf(errors);
+
+ case 'fail':
+ return bad(decoder.msg);
+
+ case 'succeed':
+ return ok(decoder.msg);
+ }
+}
+
+
+// EQUALITY
+
+function equality(a, b)
+{
+ if (a === b)
+ {
+ return true;
+ }
+
+ if (a.tag !== b.tag)
+ {
+ return false;
+ }
+
+ switch (a.tag)
+ {
+ case 'succeed':
+ case 'fail':
+ return a.msg === b.msg;
+
+ case 'bool':
+ case 'int':
+ case 'float':
+ case 'string':
+ case 'value':
+ return true;
+
+ case 'null':
+ return a.value === b.value;
+
+ case 'list':
+ case 'array':
+ case 'maybe':
+ case 'key-value':
+ return equality(a.decoder, b.decoder);
+
+ case 'field':
+ return a.field === b.field && equality(a.decoder, b.decoder);
+
+ case 'index':
+ return a.index === b.index && equality(a.decoder, b.decoder);
+
+ case 'map-many':
+ if (a.func !== b.func)
+ {
+ return false;
+ }
+ return listEquality(a.decoders, b.decoders);
+
+ case 'andThen':
+ return a.callback === b.callback && equality(a.decoder, b.decoder);
+
+ case 'oneOf':
+ return listEquality(a.decoders, b.decoders);
+ }
+}
+
+function listEquality(aDecoders, bDecoders)
+{
+ var len = aDecoders.length;
+ if (len !== bDecoders.length)
+ {
+ return false;
+ }
+ for (var i = 0; i < len; i++)
+ {
+ if (!equality(aDecoders[i], bDecoders[i]))
+ {
+ return false;
+ }
+ }
+ return true;
+}
+
+
+// ENCODE
+
+function encode(indentLevel, value)
+{
+ return JSON.stringify(value, null, indentLevel);
+}
+
+function identity(value)
+{
+ return value;
+}
+
+function encodeObject(keyValuePairs)
+{
+ var obj = {};
+ while (keyValuePairs.ctor !== '[]')
+ {
+ var pair = keyValuePairs._0;
+ obj[pair._0] = pair._1;
+ keyValuePairs = keyValuePairs._1;
+ }
+ return obj;
+}
+
+return {
+ encode: F2(encode),
+ runOnString: F2(runOnString),
+ run: F2(run),
+
+ decodeNull: decodeNull,
+ decodePrimitive: decodePrimitive,
+ decodeContainer: F2(decodeContainer),
+
+ decodeField: F2(decodeField),
+ decodeIndex: F2(decodeIndex),
+
+ map1: F2(map1),
+ map2: F3(map2),
+ map3: F4(map3),
+ map4: F5(map4),
+ map5: F6(map5),
+ map6: F7(map6),
+ map7: F8(map7),
+ map8: F9(map8),
+ decodeKeyValuePairs: decodeKeyValuePairs,
+
+ andThen: F2(andThen),
+ fail: fail,
+ succeed: succeed,
+ oneOf: oneOf,
+
+ identity: identity,
+ encodeNull: null,
+ encodeArray: _elm_lang$core$Native_Array.toJSArray,
+ encodeList: _elm_lang$core$Native_List.toArray,
+ encodeObject: encodeObject,
+
+ equality: equality
+};
+
+}();
+var _elm_lang$core$Json_Encode$list = _elm_lang$core$Native_Json.encodeList;
+var _elm_lang$core$Json_Encode$array = _elm_lang$core$Native_Json.encodeArray;
+var _elm_lang$core$Json_Encode$object = _elm_lang$core$Native_Json.encodeObject;
+var _elm_lang$core$Json_Encode$null = _elm_lang$core$Native_Json.encodeNull;
+var _elm_lang$core$Json_Encode$bool = _elm_lang$core$Native_Json.identity;
+var _elm_lang$core$Json_Encode$float = _elm_lang$core$Native_Json.identity;
+var _elm_lang$core$Json_Encode$int = _elm_lang$core$Native_Json.identity;
+var _elm_lang$core$Json_Encode$string = _elm_lang$core$Native_Json.identity;
+var _elm_lang$core$Json_Encode$encode = _elm_lang$core$Native_Json.encode;
+var _elm_lang$core$Json_Encode$Value = {ctor: 'Value'};
+var _elm_lang$core$Json_Decode$null = _elm_lang$core$Native_Json.decodeNull;
+var _elm_lang$core$Json_Decode$value = _elm_lang$core$Native_Json.decodePrimitive('value');
+var _elm_lang$core$Json_Decode$andThen = _elm_lang$core$Native_Json.andThen;
+var _elm_lang$core$Json_Decode$fail = _elm_lang$core$Native_Json.fail;
+var _elm_lang$core$Json_Decode$succeed = _elm_lang$core$Native_Json.succeed;
+var _elm_lang$core$Json_Decode$lazy = function (thunk) {
+ return A2(
+ _elm_lang$core$Json_Decode$andThen,
+ thunk,
+ _elm_lang$core$Json_Decode$succeed(
+ {ctor: '_Tuple0'}));
+};
+var _elm_lang$core$Json_Decode$decodeValue = _elm_lang$core$Native_Json.run;
+var _elm_lang$core$Json_Decode$decodeString = _elm_lang$core$Native_Json.runOnString;
+var _elm_lang$core$Json_Decode$map8 = _elm_lang$core$Native_Json.map8;
+var _elm_lang$core$Json_Decode$map7 = _elm_lang$core$Native_Json.map7;
+var _elm_lang$core$Json_Decode$map6 = _elm_lang$core$Native_Json.map6;
+var _elm_lang$core$Json_Decode$map5 = _elm_lang$core$Native_Json.map5;
+var _elm_lang$core$Json_Decode$map4 = _elm_lang$core$Native_Json.map4;
+var _elm_lang$core$Json_Decode$map3 = _elm_lang$core$Native_Json.map3;
+var _elm_lang$core$Json_Decode$map2 = _elm_lang$core$Native_Json.map2;
+var _elm_lang$core$Json_Decode$map = _elm_lang$core$Native_Json.map1;
+var _elm_lang$core$Json_Decode$oneOf = _elm_lang$core$Native_Json.oneOf;
+var _elm_lang$core$Json_Decode$maybe = function (decoder) {
+ return A2(_elm_lang$core$Native_Json.decodeContainer, 'maybe', decoder);
+};
+var _elm_lang$core$Json_Decode$index = _elm_lang$core$Native_Json.decodeIndex;
+var _elm_lang$core$Json_Decode$field = _elm_lang$core$Native_Json.decodeField;
+var _elm_lang$core$Json_Decode$at = F2(
+ function (fields, decoder) {
+ return A3(_elm_lang$core$List$foldr, _elm_lang$core$Json_Decode$field, decoder, fields);
+ });
+var _elm_lang$core$Json_Decode$keyValuePairs = _elm_lang$core$Native_Json.decodeKeyValuePairs;
+var _elm_lang$core$Json_Decode$dict = function (decoder) {
+ return A2(
+ _elm_lang$core$Json_Decode$map,
+ _elm_lang$core$Dict$fromList,
+ _elm_lang$core$Json_Decode$keyValuePairs(decoder));
+};
+var _elm_lang$core$Json_Decode$array = function (decoder) {
+ return A2(_elm_lang$core$Native_Json.decodeContainer, 'array', decoder);
+};
+var _elm_lang$core$Json_Decode$list = function (decoder) {
+ return A2(_elm_lang$core$Native_Json.decodeContainer, 'list', decoder);
+};
+var _elm_lang$core$Json_Decode$nullable = function (decoder) {
+ return _elm_lang$core$Json_Decode$oneOf(
+ {
+ ctor: '::',
+ _0: _elm_lang$core$Json_Decode$null(_elm_lang$core$Maybe$Nothing),
+ _1: {
+ ctor: '::',
+ _0: A2(_elm_lang$core$Json_Decode$map, _elm_lang$core$Maybe$Just, decoder),
+ _1: {ctor: '[]'}
+ }
+ });
+};
+var _elm_lang$core$Json_Decode$float = _elm_lang$core$Native_Json.decodePrimitive('float');
+var _elm_lang$core$Json_Decode$int = _elm_lang$core$Native_Json.decodePrimitive('int');
+var _elm_lang$core$Json_Decode$bool = _elm_lang$core$Native_Json.decodePrimitive('bool');
+var _elm_lang$core$Json_Decode$string = _elm_lang$core$Native_Json.decodePrimitive('string');
+var _elm_lang$core$Json_Decode$Decoder = {ctor: 'Decoder'};
+var _elm_lang$core$Tuple$mapSecond = F2(
+ function (func, _p0) {
+ var _p1 = _p0;
+ return {
+ ctor: '_Tuple2',
+ _0: _p1._0,
+ _1: func(_p1._1)
+ };
+ });
+var _elm_lang$core$Tuple$mapFirst = F2(
+ function (func, _p2) {
+ var _p3 = _p2;
+ return {
+ ctor: '_Tuple2',
+ _0: func(_p3._0),
+ _1: _p3._1
+ };
+ });
+var _elm_lang$core$Tuple$second = function (_p4) {
+ var _p5 = _p4;
+ return _p5._1;
+};
+var _elm_lang$core$Tuple$first = function (_p6) {
+ var _p7 = _p6;
+ return _p7._0;
+};
+var _user$project$Mapbox_Expression$encode = function (_p0) {
+ var _p1 = _p0;
+ return _p1._0;
+};
+var _user$project$Mapbox_Expression$Expression = function (a) {
+ return {ctor: 'Expression', _0: a};
+};
+var _user$project$Mapbox_Expression$anchorMap = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('map'));
+var _user$project$Mapbox_Expression$anchorViewport = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('viewport'));
+var _user$project$Mapbox_Expression$anchorAutoMap = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('map'));
+var _user$project$Mapbox_Expression$anchorAutoViewport = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('viewport'));
+var _user$project$Mapbox_Expression$anchorAutoAuto = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('auto'));
+var _user$project$Mapbox_Expression$positionCenter = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('center'));
+var _user$project$Mapbox_Expression$positionLeft = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('left'));
+var _user$project$Mapbox_Expression$positionRight = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('right'));
+var _user$project$Mapbox_Expression$positionTop = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('top'));
+var _user$project$Mapbox_Expression$positionBottom = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('bottom'));
+var _user$project$Mapbox_Expression$positionTopLeft = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('top-left'));
+var _user$project$Mapbox_Expression$positionTopRight = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('top-right'));
+var _user$project$Mapbox_Expression$positionBottomLeft = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('bottom-left'));
+var _user$project$Mapbox_Expression$positionBottomRight = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('bottom-right'));
+var _user$project$Mapbox_Expression$textFitNone = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('none'));
+var _user$project$Mapbox_Expression$textFitWidth = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('width'));
+var _user$project$Mapbox_Expression$textFitHeight = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('height'));
+var _user$project$Mapbox_Expression$textFitBoth = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('both'));
+var _user$project$Mapbox_Expression$lineCapButt = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('butt'));
+var _user$project$Mapbox_Expression$lineCapRound = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('round'));
+var _user$project$Mapbox_Expression$lineCapSquare = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('square'));
+var _user$project$Mapbox_Expression$lineJoinBevel = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('bevel'));
+var _user$project$Mapbox_Expression$lineJoinRound = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('round'));
+var _user$project$Mapbox_Expression$lineJoinMiter = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('miter'));
+var _user$project$Mapbox_Expression$symbolPlacementPoint = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('point'));
+var _user$project$Mapbox_Expression$symbolPlacementLine = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('line'));
+var _user$project$Mapbox_Expression$textJustifyLeft = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('left'));
+var _user$project$Mapbox_Expression$textJustifyCenter = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('center'));
+var _user$project$Mapbox_Expression$textJustifyRight = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('right'));
+var _user$project$Mapbox_Expression$textTransformNone = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('none'));
+var _user$project$Mapbox_Expression$textTransformUppercase = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('uppercase'));
+var _user$project$Mapbox_Expression$textTransformLowercase = _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string('lowercase'));
+var _user$project$Mapbox_Expression$rgba = F4(
+ function (r, g, b, a) {
+ return _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string(
+ A2(
+ _elm_lang$core$Basics_ops['++'],
+ 'rgba',
+ _elm_lang$core$Basics$toString(
+ {ctor: '_Tuple4', _0: r, _1: g, _2: b, _3: a}))));
+ });
+var _user$project$Mapbox_Expression$str = function (s) {
+ return _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$string(s));
+};
+var _user$project$Mapbox_Expression$bool = function (b) {
+ return _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$bool(b));
+};
+var _user$project$Mapbox_Expression$true = _user$project$Mapbox_Expression$bool(true);
+var _user$project$Mapbox_Expression$false = _user$project$Mapbox_Expression$bool(false);
+var _user$project$Mapbox_Expression$int = function (number) {
+ return _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$int(number));
+};
+var _user$project$Mapbox_Expression$float = function (number) {
+ return _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$float(number));
+};
+var _user$project$Mapbox_Expression$collator = F3(
+ function (_p4, _p3, _p2) {
+ var _p5 = _p4;
+ var _p6 = _p3;
+ var _p7 = _p2;
+ return _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$list(
+ {
+ ctor: '::',
+ _0: _elm_lang$core$Json_Encode$string('collator'),
+ _1: {
+ ctor: '::',
+ _0: _elm_lang$core$Json_Encode$object(
+ {
+ ctor: '::',
+ _0: {ctor: '_Tuple2', _0: 'case-sensitive', _1: _p5._0},
+ _1: {
+ ctor: '::',
+ _0: {ctor: '_Tuple2', _0: 'diacritic-sensitive', _1: _p6._0},
+ _1: {
+ ctor: '::',
+ _0: {ctor: '_Tuple2', _0: 'locale', _1: _p7._0},
+ _1: {ctor: '[]'}
+ }
+ }
+ }),
+ _1: {ctor: '[]'}
+ }
+ }));
+ });
+var _user$project$Mapbox_Expression$call = F2(
+ function (name, args) {
+ return _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$list(
+ {
+ ctor: '::',
+ _0: _elm_lang$core$Json_Encode$string(name),
+ _1: args
+ }));
+ });
+var _user$project$Mapbox_Expression$call0 = function (n) {
+ return A2(
+ _user$project$Mapbox_Expression$call,
+ n,
+ {ctor: '[]'});
+};
+var _user$project$Mapbox_Expression$defaultCollator = _user$project$Mapbox_Expression$call0('collator');
+var _user$project$Mapbox_Expression$geometryType = _user$project$Mapbox_Expression$call0('geometry-type');
+var _user$project$Mapbox_Expression$id = _user$project$Mapbox_Expression$call0('id');
+var _user$project$Mapbox_Expression$properties = _user$project$Mapbox_Expression$call0('properties');
+var _user$project$Mapbox_Expression$e = _user$project$Mapbox_Expression$call0('e');
+var _user$project$Mapbox_Expression$ln2 = _user$project$Mapbox_Expression$call0('ln2');
+var _user$project$Mapbox_Expression$pi = _user$project$Mapbox_Expression$call0('pi');
+var _user$project$Mapbox_Expression$zoom = _user$project$Mapbox_Expression$call0('zoom');
+var _user$project$Mapbox_Expression$heatmapDensity = _user$project$Mapbox_Expression$call0('heatmap-density');
+var _user$project$Mapbox_Expression$lineProgress = _user$project$Mapbox_Expression$call0('line-progress');
+var _user$project$Mapbox_Expression$call1 = F2(
+ function (n, _p8) {
+ var _p9 = _p8;
+ return A2(
+ _user$project$Mapbox_Expression$call,
+ n,
+ {
+ ctor: '::',
+ _0: _p9._0,
+ _1: {ctor: '[]'}
+ });
+ });
+var _user$project$Mapbox_Expression$list = function (_p10) {
+ return A2(
+ _user$project$Mapbox_Expression$call1,
+ 'literal',
+ _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$list(
+ A2(_elm_lang$core$List$map, _user$project$Mapbox_Expression$encode, _p10))));
+};
+var _user$project$Mapbox_Expression$floats = function (_p11) {
+ return _user$project$Mapbox_Expression$list(
+ A2(_elm_lang$core$List$map, _user$project$Mapbox_Expression$float, _p11));
+};
+var _user$project$Mapbox_Expression$strings = function (_p12) {
+ return _user$project$Mapbox_Expression$list(
+ A2(_elm_lang$core$List$map, _user$project$Mapbox_Expression$str, _p12));
+};
+var _user$project$Mapbox_Expression$object = function (_p13) {
+ return A2(
+ _user$project$Mapbox_Expression$call1,
+ 'literal',
+ _user$project$Mapbox_Expression$Expression(
+ _elm_lang$core$Json_Encode$object(_p13)));
+};
+var _user$project$Mapbox_Expression$assertArray = _user$project$Mapbox_Expression$call1('array');
+var _user$project$Mapbox_Expression$assertBool = _user$project$Mapbox_Expression$call1('boolean');
+var _user$project$Mapbox_Expression$assertFloat = _user$project$Mapbox_Expression$call1('number');
+var _user$project$Mapbox_Expression$assertObject = _user$project$Mapbox_Expression$call1('object');
+var _user$project$Mapbox_Expression$assertString = _user$project$Mapbox_Expression$call1('string');
+var _user$project$Mapbox_Expression$toBool = _user$project$Mapbox_Expression$call1('to-boolean');
+var _user$project$Mapbox_Expression$toString = _user$project$Mapbox_Expression$call1('to-string');
+var _user$project$Mapbox_Expression$typeof = _user$project$Mapbox_Expression$call1('typeof');
+var _user$project$Mapbox_Expression$getProperty = _user$project$Mapbox_Expression$call1('get');
+var _user$project$Mapbox_Expression$hasProperty = _user$project$Mapbox_Expression$call1('has');
+var _user$project$Mapbox_Expression$count = _user$project$Mapbox_Expression$call1('length');
+var _user$project$Mapbox_Expression$length = _user$project$Mapbox_Expression$call1('length');
+var _user$project$Mapbox_Expression$not = _user$project$Mapbox_Expression$call1('!');
+var _user$project$Mapbox_Expression$downcase = _user$project$Mapbox_Expression$call1('downcase');
+var _user$project$Mapbox_Expression$isSupportedScript = _user$project$Mapbox_Expression$call1('is-supported-script');
+var _user$project$Mapbox_Expression$resolvedLocale = _user$project$Mapbox_Expression$call1('resolved-locale');
+var _user$project$Mapbox_Expression$upcase = _user$project$Mapbox_Expression$call1('upcase');
+var _user$project$Mapbox_Expression$rgbaChannels = _user$project$Mapbox_Expression$call1('to-rgba');
+var _user$project$Mapbox_Expression$abs = _user$project$Mapbox_Expression$call1('abs');
+var _user$project$Mapbox_Expression$acos = _user$project$Mapbox_Expression$call1('acos');
+var _user$project$Mapbox_Expression$asin = _user$project$Mapbox_Expression$call1('asin');
+var _user$project$Mapbox_Expression$atan = _user$project$Mapbox_Expression$call1('atan');
+var _user$project$Mapbox_Expression$ceil = _user$project$Mapbox_Expression$call1('ceil');
+var _user$project$Mapbox_Expression$cos = _user$project$Mapbox_Expression$call1('cos');
+var _user$project$Mapbox_Expression$floor = _user$project$Mapbox_Expression$call1('floor');
+var _user$project$Mapbox_Expression$ln = _user$project$Mapbox_Expression$call1('ln');
+var _user$project$Mapbox_Expression$log10 = _user$project$Mapbox_Expression$call1('log10');
+var _user$project$Mapbox_Expression$log2 = _user$project$Mapbox_Expression$call1('log2');
+var _user$project$Mapbox_Expression$round = _user$project$Mapbox_Expression$call1('round');
+var _user$project$Mapbox_Expression$sin = _user$project$Mapbox_Expression$call1('sin');
+var _user$project$Mapbox_Expression$sqrt = _user$project$Mapbox_Expression$call1('sqrt');
+var _user$project$Mapbox_Expression$tan = _user$project$Mapbox_Expression$call1('tan');
+var _user$project$Mapbox_Expression$call2 = F3(
+ function (n, _p15, _p14) {
+ var _p16 = _p15;
+ var _p17 = _p14;
+ return A2(
+ _user$project$Mapbox_Expression$call,
+ n,
+ {
+ ctor: '::',
+ _0: _p16._0,
+ _1: {
+ ctor: '::',
+ _0: _p17._0,
+ _1: {ctor: '[]'}
+ }
+ });
+ });
+var _user$project$Mapbox_Expression$assertArrayOfStrings = A2(
+ _user$project$Mapbox_Expression$call2,
+ 'array',
+ _user$project$Mapbox_Expression$str('string'));
+var _user$project$Mapbox_Expression$assertArrayOfFloats = A2(
+ _user$project$Mapbox_Expression$call2,
+ 'array',
+ _user$project$Mapbox_Expression$str('number'));
+var _user$project$Mapbox_Expression$assertArrayOfBools = A2(
+ _user$project$Mapbox_Expression$call2,
+ 'array',
+ _user$project$Mapbox_Expression$str('boolean'));
+var _user$project$Mapbox_Expression$toColor = F2(
+ function (fallback, input) {
+ return A3(_user$project$Mapbox_Expression$call2, 'to-color', input, fallback);
+ });
+var _user$project$Mapbox_Expression$toFloat = F2(
+ function (fallback, input) {
+ return A3(
+ _user$project$Mapbox_Expression$call2,
+ 'to-number',
+ input,
+ _user$project$Mapbox_Expression$float(fallback));
+ });
+var _user$project$Mapbox_Expression$at = _user$project$Mapbox_Expression$call2('at');
+var _user$project$Mapbox_Expression$get = _user$project$Mapbox_Expression$call2('get');
+var _user$project$Mapbox_Expression$has = _user$project$Mapbox_Expression$call2('has');
+var _user$project$Mapbox_Expression$notEqual = _user$project$Mapbox_Expression$call2('!=');
+var _user$project$Mapbox_Expression$lessThan = _user$project$Mapbox_Expression$call2('<');
+var _user$project$Mapbox_Expression$lessThanOrEqual = _user$project$Mapbox_Expression$call2('<=');
+var _user$project$Mapbox_Expression$isEqual = _user$project$Mapbox_Expression$call2('==');
+var _user$project$Mapbox_Expression$greaterThan = _user$project$Mapbox_Expression$call2('>');
+var _user$project$Mapbox_Expression$greaterThanOrEqual = _user$project$Mapbox_Expression$call2('>=');
+var _user$project$Mapbox_Expression$append = F2(
+ function (a, b) {
+ return A3(_user$project$Mapbox_Expression$call2, 'concat', b, a);
+ });
+var _user$project$Mapbox_Expression$minus = F2(
+ function (a, b) {
+ return A3(_user$project$Mapbox_Expression$call2, '-', b, a);
+ });
+var _user$project$Mapbox_Expression$multiply = _user$project$Mapbox_Expression$call2('*');
+var _user$project$Mapbox_Expression$divideBy = F2(
+ function (a, b) {
+ return A3(_user$project$Mapbox_Expression$call2, '/', b, a);
+ });
+var _user$project$Mapbox_Expression$modBy = F2(
+ function (a, b) {
+ return A3(_user$project$Mapbox_Expression$call2, '%', b, a);
+ });
+var _user$project$Mapbox_Expression$raiseBy = F2(
+ function (a, b) {
+ return A3(_user$project$Mapbox_Expression$call2, '^', b, a);
+ });
+var _user$project$Mapbox_Expression$plus = _user$project$Mapbox_Expression$call2('+');
+var _user$project$Mapbox_Expression$max = _user$project$Mapbox_Expression$call2('max');
+var _user$project$Mapbox_Expression$min = _user$project$Mapbox_Expression$call2('min');
+var _user$project$Mapbox_Expression$call3 = F4(
+ function (n, _p20, _p19, _p18) {
+ var _p21 = _p20;
+ var _p22 = _p19;
+ var _p23 = _p18;
+ return A2(
+ _user$project$Mapbox_Expression$call,
+ n,
+ {
+ ctor: '::',
+ _0: _p21._0,
+ _1: {
+ ctor: '::',
+ _0: _p22._0,
+ _1: {
+ ctor: '::',
+ _0: _p23._0,
+ _1: {ctor: '[]'}
+ }
+ }
+ });
+ });
+var _user$project$Mapbox_Expression$notEqualWithCollator = _user$project$Mapbox_Expression$call3('!=');
+var _user$project$Mapbox_Expression$lessThanWithCollator = _user$project$Mapbox_Expression$call3('<');
+var _user$project$Mapbox_Expression$lessThanOrEqualWithCollator = _user$project$Mapbox_Expression$call3('<=');
+var _user$project$Mapbox_Expression$isEqualWithCollator = _user$project$Mapbox_Expression$call3('==');
+var _user$project$Mapbox_Expression$greaterThanWithCollator = _user$project$Mapbox_Expression$call3('>');
+var _user$project$Mapbox_Expression$greaterThanOrEqualWithCollator = _user$project$Mapbox_Expression$call3('>=');
+var _user$project$Mapbox_Expression$ifElse = _user$project$Mapbox_Expression$call3('case');
+var _user$project$Mapbox_Expression$makeRGBColor = _user$project$Mapbox_Expression$call3('rgb');
+var _user$project$Mapbox_Expression$call4 = F5(
+ function (n, _p27, _p26, _p25, _p24) {
+ var _p28 = _p27;
+ var _p29 = _p26;
+ var _p30 = _p25;
+ var _p31 = _p24;
+ return A2(
+ _user$project$Mapbox_Expression$call,
+ n,
+ {
+ ctor: '::',
+ _0: _p28._0,
+ _1: {
+ ctor: '::',
+ _0: _p29._0,
+ _1: {
+ ctor: '::',
+ _0: _p30._0,
+ _1: {
+ ctor: '::',
+ _0: _p31._0,
+ _1: {ctor: '[]'}
+ }
+ }
+ }
+ });
+ });
+var _user$project$Mapbox_Expression$makeRGBAColor = _user$project$Mapbox_Expression$call4('rgba');
+var _user$project$Mapbox_Expression$calln = F2(
+ function (n, expressions) {
+ return A2(
+ _user$project$Mapbox_Expression$call,
+ n,
+ A2(_elm_lang$core$List$map, _user$project$Mapbox_Expression$encode, expressions));
+ });
+var _user$project$Mapbox_Expression$all = _user$project$Mapbox_Expression$calln('all');
+var _user$project$Mapbox_Expression$any = _user$project$Mapbox_Expression$calln('any');
+var _user$project$Mapbox_Expression$coallesce = _user$project$Mapbox_Expression$calln('coallesce');
+var _user$project$Mapbox_Expression$conditionally = F2(
+ function (vals, _p32) {
+ var _p33 = _p32;
+ return A2(
+ _user$project$Mapbox_Expression$call,
+ 'case',
+ A2(
+ _elm_lang$core$Basics_ops['++'],
+ A2(
+ _elm_lang$core$List$concatMap,
+ function (_p34) {
+ var _p35 = _p34;
+ return {
+ ctor: '::',
+ _0: _p35._0._0,
+ _1: {
+ ctor: '::',
+ _0: _p35._1._0,
+ _1: {ctor: '[]'}
+ }
+ };
+ },
+ vals),
+ {
+ ctor: '::',
+ _0: _p33._0,
+ _1: {ctor: '[]'}
+ }));
+ });
+var _user$project$Mapbox_Expression$matchesStr = F3(
+ function (options, _p37, _p36) {
+ var _p38 = _p37;
+ var _p39 = _p36;
+ var properOptions = A2(
+ _elm_lang$core$List$concatMap,
+ function (_p40) {
+ var _p41 = _p40;
+ return {
+ ctor: '::',
+ _0: _elm_lang$core$Json_Encode$string(_p41._0),
+ _1: {
+ ctor: '::',
+ _0: _p41._1._0,
+ _1: {ctor: '[]'}
+ }
+ };
+ },
+ options);
+ return A2(
+ _user$project$Mapbox_Expression$call,
+ 'match',
+ {
+ ctor: '::',
+ _0: _p39._0,
+ _1: A2(
+ _elm_lang$core$Basics_ops['++'],
+ properOptions,
+ {
+ ctor: '::',
+ _0: _p38._0,
+ _1: {ctor: '[]'}
+ })
+ });
+ });
+var _user$project$Mapbox_Expression$matchesFloat = F3(
+ function (options, _p43, _p42) {
+ var _p44 = _p43;
+ var _p45 = _p42;
+ var properOptions = A2(
+ _elm_lang$core$List$concatMap,
+ function (_p46) {
+ var _p47 = _p46;
+ return {
+ ctor: '::',
+ _0: _elm_lang$core$Json_Encode$float(_p47._0),
+ _1: {
+ ctor: '::',
+ _0: _p47._1._0,
+ _1: {ctor: '[]'}
+ }
+ };
+ },
+ options);
+ return A2(
+ _user$project$Mapbox_Expression$call,
+ 'match',
+ {
+ ctor: '::',
+ _0: _p45._0,
+ _1: A2(
+ _elm_lang$core$Basics_ops['++'],
+ properOptions,
+ {
+ ctor: '::',
+ _0: _p44._0,
+ _1: {ctor: '[]'}
+ })
+ });
+ });
+var _user$project$Mapbox_Expression$encodeInterpolation = function (interpolation) {
+ var _p48 = interpolation;
+ switch (_p48.ctor) {
+ case 'Linear':
+ return _user$project$Mapbox_Expression$call0('linear');
+ case 'Exponential':
+ return A2(
+ _user$project$Mapbox_Expression$call,
+ 'exponential',
+ {
+ ctor: '::',
+ _0: _elm_lang$core$Json_Encode$float(_p48._0),
+ _1: {ctor: '[]'}
+ });
+ default:
+ return A2(
+ _user$project$Mapbox_Expression$call,
+ 'cubic-bezier',
+ {
+ ctor: '::',
+ _0: _elm_lang$core$Json_Encode$float(_p48._0._0),
+ _1: {
+ ctor: '::',
+ _0: _elm_lang$core$Json_Encode$float(_p48._0._1),
+ _1: {
+ ctor: '::',
+ _0: _elm_lang$core$Json_Encode$float(_p48._1._0),
+ _1: {
+ ctor: '::',
+ _0: _elm_lang$core$Json_Encode$float(_p48._1._1),
+ _1: {ctor: '[]'}
+ }
+ }
+ }
+ });
+ }
+};
+var _user$project$Mapbox_Expression$interpolate = F3(
+ function (interpolation, stops, _p49) {
+ var _p50 = _p49;
+ return A2(
+ _user$project$Mapbox_Expression$call,
+ 'interpolate',
+ {
+ ctor: '::',
+ _0: _user$project$Mapbox_Expression$encode(
+ _user$project$Mapbox_Expression$encodeInterpolation(interpolation)),
+ _1: {
+ ctor: '::',
+ _0: _p50._0,
+ _1: A2(
+ _elm_lang$core$List$concatMap,
+ function (_p51) {
+ var _p52 = _p51;
+ return {
+ ctor: '::',
+ _0: _elm_lang$core$Json_Encode$float(_p52._0),
+ _1: {
+ ctor: '::',
+ _0: _p52._1._0,
+ _1: {ctor: '[]'}
+ }
+ };
+ },
+ stops)
+ }
+ });
+ });
+var _user$project$Mapbox_Expression$step = F3(
+ function (_p54, stops, _p53) {
+ var _p55 = _p54;
+ var _p56 = _p53;
+ return A2(
+ _user$project$Mapbox_Expression$call,
+ 'step',
+ {
+ ctor: '::',
+ _0: _p56._0,
+ _1: {
+ ctor: '::',
+ _0: _p55._0,
+ _1: A2(
+ _elm_lang$core$List$concatMap,
+ function (_p57) {
+ var _p58 = _p57;
+ return {
+ ctor: '::',
+ _0: _elm_lang$core$Json_Encode$float(_p58._0),
+ _1: {
+ ctor: '::',
+ _0: _p58._1._0,
+ _1: {ctor: '[]'}
+ }
+ };
+ },
+ stops)
+ }
+ });
+ });
+var _user$project$Mapbox_Expression$CameraExpression = {ctor: 'CameraExpression'};
+var _user$project$Mapbox_Expression$DataExpression = {ctor: 'DataExpression'};
+var _user$project$Mapbox_Expression$Object = {ctor: 'Object'};
+var _user$project$Mapbox_Expression$Color = {ctor: 'Color'};
+var _user$project$Mapbox_Expression$Collator = {ctor: 'Collator'};
+var _user$project$Mapbox_Expression$Viewport = {ctor: 'Viewport'};
+var _user$project$Mapbox_Expression$Map = {ctor: 'Map'};
+var _user$project$Mapbox_Expression$AnchorAuto = {ctor: 'AnchorAuto'};
+var _user$project$Mapbox_Expression$Position = {ctor: 'Position'};
+var _user$project$Mapbox_Expression$TextFit = {ctor: 'TextFit'};
+var _user$project$Mapbox_Expression$LineCap = {ctor: 'LineCap'};
+var _user$project$Mapbox_Expression$LineJoin = {ctor: 'LineJoin'};
+var _user$project$Mapbox_Expression$SymbolPlacement = {ctor: 'SymbolPlacement'};
+var _user$project$Mapbox_Expression$TextJustify = {ctor: 'TextJustify'};
+var _user$project$Mapbox_Expression$TextTransform = {ctor: 'TextTransform'};
+var _user$project$Mapbox_Expression$CubicBezier = F2(
+ function (a, b) {
+ return {ctor: 'CubicBezier', _0: a, _1: b};
+ });
+var _user$project$Mapbox_Expression$Exponential = function (a) {
+ return {ctor: 'Exponential', _0: a};
+};
+var _user$project$Mapbox_Expression$Linear = {ctor: 'Linear'};
+var _user$project$Mapbox_Helpers$encodeAnchor = function (v) {
+ var _p0 = v;
+ if (_p0.ctor === 'Viewport') {
+ return _elm_lang$core$Json_Encode$string('viewport');
+ } else {
+ return _elm_lang$core$Json_Encode$string('map');
+ }
+};
+var _user$project$Mapbox_Layer$encodeAttrs = function (attrs) {
+ var _p0 = A3(
+ _elm_lang$core$List$foldl,
+ F2(
+ function (attr, _p1) {
+ var _p2 = _p1;
+ var _p4 = _p2;
+ var _p3 = attr;
+ switch (_p3.ctor) {
+ case 'Top':
+ return _elm_lang$core$Native_Utils.update(
+ _p4,
+ {
+ top: {
+ ctor: '::',
+ _0: {ctor: '_Tuple2', _0: _p3._0, _1: _p3._1},
+ _1: _p2.top
+ }
+ });
+ case 'Paint':
+ return _elm_lang$core$Native_Utils.update(
+ _p4,
+ {
+ paint: {
+ ctor: '::',
+ _0: {ctor: '_Tuple2', _0: _p3._0, _1: _p3._1},
+ _1: _p2.paint
+ }
+ });
+ default:
+ return _elm_lang$core$Native_Utils.update(
+ _p4,
+ {
+ layout: {
+ ctor: '::',
+ _0: {ctor: '_Tuple2', _0: _p3._0, _1: _p3._1},
+ _1: _p2.layout
+ }
+ });
+ }
+ }),
+ {
+ top: {ctor: '[]'},
+ layout: {ctor: '[]'},
+ paint: {ctor: '[]'}
+ },
+ attrs);
+ var top = _p0.top;
+ var layout = _p0.layout;
+ var paint = _p0.paint;
+ return {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'layout',
+ _1: _elm_lang$core$Json_Encode$object(layout)
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'paint',
+ _1: _elm_lang$core$Json_Encode$object(paint)
+ },
+ _1: top
+ }
+ };
+};
+var _user$project$Mapbox_Layer$encode = function (_p5) {
+ var _p6 = _p5;
+ return _p6._0;
+};
+var _user$project$Mapbox_Layer$Layer = function (a) {
+ return {ctor: 'Layer', _0: a};
+};
+var _user$project$Mapbox_Layer$layerImpl = F4(
+ function (tipe, source, id, attrs) {
+ return _user$project$Mapbox_Layer$Layer(
+ _elm_lang$core$Json_Encode$object(
+ A2(
+ _elm_lang$core$Basics_ops['++'],
+ {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'type',
+ _1: _elm_lang$core$Json_Encode$string(tipe)
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'id',
+ _1: _elm_lang$core$Json_Encode$string(id)
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'source',
+ _1: _elm_lang$core$Json_Encode$string(source)
+ },
+ _1: {ctor: '[]'}
+ }
+ }
+ },
+ _user$project$Mapbox_Layer$encodeAttrs(attrs))));
+ });
+var _user$project$Mapbox_Layer$fill = _user$project$Mapbox_Layer$layerImpl('fill');
+var _user$project$Mapbox_Layer$line = _user$project$Mapbox_Layer$layerImpl('line');
+var _user$project$Mapbox_Layer$symbol = _user$project$Mapbox_Layer$layerImpl('symbol');
+var _user$project$Mapbox_Layer$raster = _user$project$Mapbox_Layer$layerImpl('raster');
+var _user$project$Mapbox_Layer$circle = _user$project$Mapbox_Layer$layerImpl('circle');
+var _user$project$Mapbox_Layer$fillExtrusion = _user$project$Mapbox_Layer$layerImpl('fill-extrusion');
+var _user$project$Mapbox_Layer$heatmap = _user$project$Mapbox_Layer$layerImpl('heatmap');
+var _user$project$Mapbox_Layer$hillshade = _user$project$Mapbox_Layer$layerImpl('hillshade');
+var _user$project$Mapbox_Layer$background = F2(
+ function (id, attrs) {
+ return _user$project$Mapbox_Layer$Layer(
+ _elm_lang$core$Json_Encode$object(
+ A2(
+ _elm_lang$core$Basics_ops['++'],
+ {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'type',
+ _1: _elm_lang$core$Json_Encode$string('background')
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'id',
+ _1: _elm_lang$core$Json_Encode$string(id)
+ },
+ _1: {ctor: '[]'}
+ }
+ },
+ _user$project$Mapbox_Layer$encodeAttrs(attrs))));
+ });
+var _user$project$Mapbox_Layer$BackgroundLayer = {ctor: 'BackgroundLayer'};
+var _user$project$Mapbox_Layer$FillLayer = {ctor: 'FillLayer'};
+var _user$project$Mapbox_Layer$SymbolLayer = {ctor: 'SymbolLayer'};
+var _user$project$Mapbox_Layer$LineLayer = {ctor: 'LineLayer'};
+var _user$project$Mapbox_Layer$RasterLayer = {ctor: 'RasterLayer'};
+var _user$project$Mapbox_Layer$CircleLayer = {ctor: 'CircleLayer'};
+var _user$project$Mapbox_Layer$FillExtrusionLayer = {ctor: 'FillExtrusionLayer'};
+var _user$project$Mapbox_Layer$HeatmapLayer = {ctor: 'HeatmapLayer'};
+var _user$project$Mapbox_Layer$HillshadeLayer = {ctor: 'HillshadeLayer'};
+var _user$project$Mapbox_Layer$Layout = F2(
+ function (a, b) {
+ return {ctor: 'Layout', _0: a, _1: b};
+ });
+var _user$project$Mapbox_Layer$visible = function (vis) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'visibility',
+ _user$project$Mapbox_Expression$encode(
+ A3(
+ _user$project$Mapbox_Expression$ifElse,
+ vis,
+ _user$project$Mapbox_Expression$str('visible'),
+ _user$project$Mapbox_Expression$str('none'))));
+};
+var _user$project$Mapbox_Layer$lineCap = function (_p7) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'line-cap',
+ _user$project$Mapbox_Expression$encode(_p7));
+};
+var _user$project$Mapbox_Layer$lineJoin = function (_p8) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'line-join',
+ _user$project$Mapbox_Expression$encode(_p8));
+};
+var _user$project$Mapbox_Layer$lineMiterLimit = function (_p9) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'line-miter-limit',
+ _user$project$Mapbox_Expression$encode(_p9));
+};
+var _user$project$Mapbox_Layer$lineRoundLimit = function (_p10) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'line-round-limit',
+ _user$project$Mapbox_Expression$encode(_p10));
+};
+var _user$project$Mapbox_Layer$symbolSpacing = function (_p11) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'symbol-spacing',
+ _user$project$Mapbox_Expression$encode(_p11));
+};
+var _user$project$Mapbox_Layer$textSize = function (_p12) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'text-size',
+ _user$project$Mapbox_Expression$encode(_p12));
+};
+var _user$project$Mapbox_Layer$textFont = function (_p13) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'text-font',
+ _user$project$Mapbox_Expression$encode(_p13));
+};
+var _user$project$Mapbox_Layer$textOptional = function (_p14) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'text-optional',
+ _user$project$Mapbox_Expression$encode(_p14));
+};
+var _user$project$Mapbox_Layer$iconIgnorePlacement = function (_p15) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'icon-ignore-placement',
+ _user$project$Mapbox_Expression$encode(_p15));
+};
+var _user$project$Mapbox_Layer$textIgnorePlacement = function (_p16) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'text-ignore-placement',
+ _user$project$Mapbox_Expression$encode(_p16));
+};
+var _user$project$Mapbox_Layer$iconOptional = function (_p17) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'icon-optional',
+ _user$project$Mapbox_Expression$encode(_p17));
+};
+var _user$project$Mapbox_Layer$iconKeepUpright = function (_p18) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'icon-keep-upright',
+ _user$project$Mapbox_Expression$encode(_p18));
+};
+var _user$project$Mapbox_Layer$iconAllowOverlap = function (_p19) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'icon-allow-overlap',
+ _user$project$Mapbox_Expression$encode(_p19));
+};
+var _user$project$Mapbox_Layer$symbolAvoidEdges = function (_p20) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'symbol-avoid-edges',
+ _user$project$Mapbox_Expression$encode(_p20));
+};
+var _user$project$Mapbox_Layer$textKeepUpright = function (_p21) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'text-keep-upright',
+ _user$project$Mapbox_Expression$encode(_p21));
+};
+var _user$project$Mapbox_Layer$textAllowOverlap = function (_p22) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'text-allow-overlap',
+ _user$project$Mapbox_Expression$encode(_p22));
+};
+var _user$project$Mapbox_Layer$iconRotationAlignment = function (_p23) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'icon-rotation-alignment',
+ _user$project$Mapbox_Expression$encode(_p23));
+};
+var _user$project$Mapbox_Layer$textRotationAlignment = function (_p24) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'text-rotation-alignment',
+ _user$project$Mapbox_Expression$encode(_p24));
+};
+var _user$project$Mapbox_Layer$symbolPlacement = function (_p25) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'symbol-placement',
+ _user$project$Mapbox_Expression$encode(_p25));
+};
+var _user$project$Mapbox_Layer$textMaxAngle = function (_p26) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'text-max-angle',
+ _user$project$Mapbox_Expression$encode(_p26));
+};
+var _user$project$Mapbox_Layer$iconImage = function (_p27) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'icon-image',
+ _user$project$Mapbox_Expression$encode(_p27));
+};
+var _user$project$Mapbox_Layer$iconOffset = function (_p28) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'icon-offset',
+ _user$project$Mapbox_Expression$encode(_p28));
+};
+var _user$project$Mapbox_Layer$textOffset = function (_p29) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'text-offset',
+ _user$project$Mapbox_Expression$encode(_p29));
+};
+var _user$project$Mapbox_Layer$iconPitchAlignment = function (_p30) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'icon-pitch-alignment',
+ _user$project$Mapbox_Expression$encode(_p30));
+};
+var _user$project$Mapbox_Layer$textPitchAlignment = function (_p31) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'text-pitch-alignment',
+ _user$project$Mapbox_Expression$encode(_p31));
+};
+var _user$project$Mapbox_Layer$iconAnchor = function (_p32) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'icon-anchor',
+ _user$project$Mapbox_Expression$encode(_p32));
+};
+var _user$project$Mapbox_Layer$textAnchor = function (_p33) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'text-anchor',
+ _user$project$Mapbox_Expression$encode(_p33));
+};
+var _user$project$Mapbox_Layer$iconRotate = function (_p34) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'icon-rotate',
+ _user$project$Mapbox_Expression$encode(_p34));
+};
+var _user$project$Mapbox_Layer$textRotate = function (_p35) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'text-rotate',
+ _user$project$Mapbox_Expression$encode(_p35));
+};
+var _user$project$Mapbox_Layer$iconTextFit = function (_p36) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'icon-text-fit',
+ _user$project$Mapbox_Expression$encode(_p36));
+};
+var _user$project$Mapbox_Layer$iconSize = function (_p37) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'icon-size',
+ _user$project$Mapbox_Expression$encode(_p37));
+};
+var _user$project$Mapbox_Layer$iconTextFitPadding = function (_p38) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'icon-text-fit-padding',
+ _user$project$Mapbox_Expression$encode(_p38));
+};
+var _user$project$Mapbox_Layer$iconPadding = function (_p39) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'icon-padding',
+ _user$project$Mapbox_Expression$encode(_p39));
+};
+var _user$project$Mapbox_Layer$textPadding = function (_p40) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'text-padding',
+ _user$project$Mapbox_Expression$encode(_p40));
+};
+var _user$project$Mapbox_Layer$textTransform = function (_p41) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'text-transform',
+ _user$project$Mapbox_Expression$encode(_p41));
+};
+var _user$project$Mapbox_Layer$textJustify = function (_p42) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'text-justify',
+ _user$project$Mapbox_Expression$encode(_p42));
+};
+var _user$project$Mapbox_Layer$textLineHeight = function (_p43) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'text-line-height',
+ _user$project$Mapbox_Expression$encode(_p43));
+};
+var _user$project$Mapbox_Layer$textLetterSpacing = function (_p44) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'text-letter-spacing',
+ _user$project$Mapbox_Expression$encode(_p44));
+};
+var _user$project$Mapbox_Layer$textMaxWidth = function (_p45) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'text-max-width',
+ _user$project$Mapbox_Expression$encode(_p45));
+};
+var _user$project$Mapbox_Layer$textField = function (_p46) {
+ return A2(
+ _user$project$Mapbox_Layer$Layout,
+ 'text-field',
+ _user$project$Mapbox_Expression$encode(_p46));
+};
+var _user$project$Mapbox_Layer$Paint = F2(
+ function (a, b) {
+ return {ctor: 'Paint', _0: a, _1: b};
+ });
+var _user$project$Mapbox_Layer$fillTranslateAnchor = function (_p47) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'fill-translate-anchor',
+ _user$project$Mapbox_Expression$encode(_p47));
+};
+var _user$project$Mapbox_Layer$fillPattern = function (_p48) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'fill-pattern',
+ _user$project$Mapbox_Expression$encode(_p48));
+};
+var _user$project$Mapbox_Layer$fillColor = function (_p49) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'fill-color',
+ _user$project$Mapbox_Expression$encode(_p49));
+};
+var _user$project$Mapbox_Layer$fillTranslate = function (_p50) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'fill-translate',
+ _user$project$Mapbox_Expression$encode(_p50));
+};
+var _user$project$Mapbox_Layer$fillOpacity = function (_p51) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'fill-opacity',
+ _user$project$Mapbox_Expression$encode(_p51));
+};
+var _user$project$Mapbox_Layer$fillOutlineColor = function (_p52) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'fill-outline-color',
+ _user$project$Mapbox_Expression$encode(_p52));
+};
+var _user$project$Mapbox_Layer$fillAntialias = function (_p53) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'fill-antialias',
+ _user$project$Mapbox_Expression$encode(_p53));
+};
+var _user$project$Mapbox_Layer$lineBlur = function (_p54) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'line-blur',
+ _user$project$Mapbox_Expression$encode(_p54));
+};
+var _user$project$Mapbox_Layer$lineTranslateAnchor = function (_p55) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'line-translate-anchor',
+ _user$project$Mapbox_Expression$encode(_p55));
+};
+var _user$project$Mapbox_Layer$lineGradient = function (_p56) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'line-gradient',
+ _user$project$Mapbox_Expression$encode(_p56));
+};
+var _user$project$Mapbox_Layer$lineGapWidth = function (_p57) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'line-gap-width',
+ _user$project$Mapbox_Expression$encode(_p57));
+};
+var _user$project$Mapbox_Layer$linePattern = function (_p58) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'line-pattern',
+ _user$project$Mapbox_Expression$encode(_p58));
+};
+var _user$project$Mapbox_Layer$lineDasharray = function (_p59) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'line-dasharray',
+ _user$project$Mapbox_Expression$encode(_p59));
+};
+var _user$project$Mapbox_Layer$lineWidth = function (_p60) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'line-width',
+ _user$project$Mapbox_Expression$encode(_p60));
+};
+var _user$project$Mapbox_Layer$lineColor = function (_p61) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'line-color',
+ _user$project$Mapbox_Expression$encode(_p61));
+};
+var _user$project$Mapbox_Layer$lineTranslate = function (_p62) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'line-translate',
+ _user$project$Mapbox_Expression$encode(_p62));
+};
+var _user$project$Mapbox_Layer$lineOffset = function (_p63) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'line-offset',
+ _user$project$Mapbox_Expression$encode(_p63));
+};
+var _user$project$Mapbox_Layer$lineOpacity = function (_p64) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'line-opacity',
+ _user$project$Mapbox_Expression$encode(_p64));
+};
+var _user$project$Mapbox_Layer$circleBlur = function (_p65) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'circle-blur',
+ _user$project$Mapbox_Expression$encode(_p65));
+};
+var _user$project$Mapbox_Layer$circleRadius = function (_p66) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'circle-radius',
+ _user$project$Mapbox_Expression$encode(_p66));
+};
+var _user$project$Mapbox_Layer$circleTranslateAnchor = function (_p67) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'circle-translate-anchor',
+ _user$project$Mapbox_Expression$encode(_p67));
+};
+var _user$project$Mapbox_Layer$circlePitchScale = function (_p68) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'circle-pitch-scale',
+ _user$project$Mapbox_Expression$encode(_p68));
+};
+var _user$project$Mapbox_Layer$circlePitchAlignment = function (_p69) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'circle-pitch-alignment',
+ _user$project$Mapbox_Expression$encode(_p69));
+};
+var _user$project$Mapbox_Layer$circleColor = function (_p70) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'circle-color',
+ _user$project$Mapbox_Expression$encode(_p70));
+};
+var _user$project$Mapbox_Layer$circleTranslate = function (_p71) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'circle-translate',
+ _user$project$Mapbox_Expression$encode(_p71));
+};
+var _user$project$Mapbox_Layer$circleOpacity = function (_p72) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'circle-opacity',
+ _user$project$Mapbox_Expression$encode(_p72));
+};
+var _user$project$Mapbox_Layer$circleStrokeOpacity = function (_p73) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'circle-stroke-opacity',
+ _user$project$Mapbox_Expression$encode(_p73));
+};
+var _user$project$Mapbox_Layer$circleStrokeColor = function (_p74) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'circle-stroke-color',
+ _user$project$Mapbox_Expression$encode(_p74));
+};
+var _user$project$Mapbox_Layer$circleStrokeWidth = function (_p75) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'circle-stroke-width',
+ _user$project$Mapbox_Expression$encode(_p75));
+};
+var _user$project$Mapbox_Layer$heatmapWeight = function (_p76) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'heatmap-weight',
+ _user$project$Mapbox_Expression$encode(_p76));
+};
+var _user$project$Mapbox_Layer$heatmapColor = function (_p77) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'heatmap-color',
+ _user$project$Mapbox_Expression$encode(_p77));
+};
+var _user$project$Mapbox_Layer$heatmapRadius = function (_p78) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'heatmap-radius',
+ _user$project$Mapbox_Expression$encode(_p78));
+};
+var _user$project$Mapbox_Layer$heatmapIntensity = function (_p79) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'heatmap-intensity',
+ _user$project$Mapbox_Expression$encode(_p79));
+};
+var _user$project$Mapbox_Layer$heatmapOpacity = function (_p80) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'heatmap-opacity',
+ _user$project$Mapbox_Expression$encode(_p80));
+};
+var _user$project$Mapbox_Layer$fillExtrusionTranslateAnchor = function (_p81) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'fill-extrusion-translate-anchor',
+ _user$project$Mapbox_Expression$encode(_p81));
+};
+var _user$project$Mapbox_Layer$fillExtrusionPattern = function (_p82) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'fill-extrusion-pattern',
+ _user$project$Mapbox_Expression$encode(_p82));
+};
+var _user$project$Mapbox_Layer$fillExtrusionColor = function (_p83) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'fill-extrusion-color',
+ _user$project$Mapbox_Expression$encode(_p83));
+};
+var _user$project$Mapbox_Layer$fillExtrusionTranslate = function (_p84) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'fill-extrusion-translate',
+ _user$project$Mapbox_Expression$encode(_p84));
+};
+var _user$project$Mapbox_Layer$fillExtrusionBase = function (_p85) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'fill-extrusion-base',
+ _user$project$Mapbox_Expression$encode(_p85));
+};
+var _user$project$Mapbox_Layer$fillExtrusionHeight = function (_p86) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'fill-extrusion-height',
+ _user$project$Mapbox_Expression$encode(_p86));
+};
+var _user$project$Mapbox_Layer$fillExtrusionOpacity = function (_p87) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'fill-extrusion-opacity',
+ _user$project$Mapbox_Expression$encode(_p87));
+};
+var _user$project$Mapbox_Layer$iconTranslateAnchor = function (_p88) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'icon-translate-anchor',
+ _user$project$Mapbox_Expression$encode(_p88));
+};
+var _user$project$Mapbox_Layer$textTranslateAnchor = function (_p89) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'text-translate-anchor',
+ _user$project$Mapbox_Expression$encode(_p89));
+};
+var _user$project$Mapbox_Layer$textHaloWidth = function (_p90) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'text-halo-width',
+ _user$project$Mapbox_Expression$encode(_p90));
+};
+var _user$project$Mapbox_Layer$iconHaloWidth = function (_p91) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'icon-halo-width',
+ _user$project$Mapbox_Expression$encode(_p91));
+};
+var _user$project$Mapbox_Layer$iconTranslate = function (_p92) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'icon-translate',
+ _user$project$Mapbox_Expression$encode(_p92));
+};
+var _user$project$Mapbox_Layer$textTranslate = function (_p93) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'text-translate',
+ _user$project$Mapbox_Expression$encode(_p93));
+};
+var _user$project$Mapbox_Layer$iconHaloBlur = function (_p94) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'icon-halo-blur',
+ _user$project$Mapbox_Expression$encode(_p94));
+};
+var _user$project$Mapbox_Layer$iconHaloColor = function (_p95) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'icon-halo-color',
+ _user$project$Mapbox_Expression$encode(_p95));
+};
+var _user$project$Mapbox_Layer$iconColor = function (_p96) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'icon-color',
+ _user$project$Mapbox_Expression$encode(_p96));
+};
+var _user$project$Mapbox_Layer$textHaloColor = function (_p97) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'text-halo-color',
+ _user$project$Mapbox_Expression$encode(_p97));
+};
+var _user$project$Mapbox_Layer$textColor = function (_p98) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'text-color',
+ _user$project$Mapbox_Expression$encode(_p98));
+};
+var _user$project$Mapbox_Layer$textHaloBlur = function (_p99) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'text-halo-blur',
+ _user$project$Mapbox_Expression$encode(_p99));
+};
+var _user$project$Mapbox_Layer$iconOpacity = function (_p100) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'icon-opacity',
+ _user$project$Mapbox_Expression$encode(_p100));
+};
+var _user$project$Mapbox_Layer$textOpacity = function (_p101) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'text-opacity',
+ _user$project$Mapbox_Expression$encode(_p101));
+};
+var _user$project$Mapbox_Layer$rasterFadeDuration = function (_p102) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'raster-fade-duration',
+ _user$project$Mapbox_Expression$encode(_p102));
+};
+var _user$project$Mapbox_Layer$rasterBrightnessMax = function (_p103) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'raster-brightness-max',
+ _user$project$Mapbox_Expression$encode(_p103));
+};
+var _user$project$Mapbox_Layer$rasterBrightnessMin = function (_p104) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'raster-brightness-min',
+ _user$project$Mapbox_Expression$encode(_p104));
+};
+var _user$project$Mapbox_Layer$rasterContrast = function (_p105) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'raster-contrast',
+ _user$project$Mapbox_Expression$encode(_p105));
+};
+var _user$project$Mapbox_Layer$rasterSaturation = function (_p106) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'raster-saturation',
+ _user$project$Mapbox_Expression$encode(_p106));
+};
+var _user$project$Mapbox_Layer$rasterHueRotate = function (_p107) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'raster-hue-rotate',
+ _user$project$Mapbox_Expression$encode(_p107));
+};
+var _user$project$Mapbox_Layer$rasterOpacity = function (_p108) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'raster-opacity',
+ _user$project$Mapbox_Expression$encode(_p108));
+};
+var _user$project$Mapbox_Layer$hillshadeIlluminationAnchor = function (_p109) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'hillshade-illumination-anchor',
+ _user$project$Mapbox_Expression$encode(_p109));
+};
+var _user$project$Mapbox_Layer$hillshadeExaggeration = function (_p110) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'hillshade-exaggeration',
+ _user$project$Mapbox_Expression$encode(_p110));
+};
+var _user$project$Mapbox_Layer$hillshadeIlluminationDirection = function (_p111) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'hillshade-illumination-direction',
+ _user$project$Mapbox_Expression$encode(_p111));
+};
+var _user$project$Mapbox_Layer$hillshadeShadowColor = function (_p112) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'hillshade-shadow-color',
+ _user$project$Mapbox_Expression$encode(_p112));
+};
+var _user$project$Mapbox_Layer$hillshadeHighlightColor = function (_p113) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'hillshade-highlight-color',
+ _user$project$Mapbox_Expression$encode(_p113));
+};
+var _user$project$Mapbox_Layer$hillshadeAccentColor = function (_p114) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'hillshade-accent-color',
+ _user$project$Mapbox_Expression$encode(_p114));
+};
+var _user$project$Mapbox_Layer$backgroundPattern = function (_p115) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'background-pattern',
+ _user$project$Mapbox_Expression$encode(_p115));
+};
+var _user$project$Mapbox_Layer$backgroundColor = function (_p116) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'background-color',
+ _user$project$Mapbox_Expression$encode(_p116));
+};
+var _user$project$Mapbox_Layer$backgroundOpacity = function (_p117) {
+ return A2(
+ _user$project$Mapbox_Layer$Paint,
+ 'background-opacity',
+ _user$project$Mapbox_Expression$encode(_p117));
+};
+var _user$project$Mapbox_Layer$Top = F2(
+ function (a, b) {
+ return {ctor: 'Top', _0: a, _1: b};
+ });
+var _user$project$Mapbox_Layer$metadata = _user$project$Mapbox_Layer$Top('metadata');
+var _user$project$Mapbox_Layer$sourceLayer = function (_p118) {
+ return A2(
+ _user$project$Mapbox_Layer$Top,
+ 'source-layer',
+ _elm_lang$core$Json_Encode$string(_p118));
+};
+var _user$project$Mapbox_Layer$minzoom = function (_p119) {
+ return A2(
+ _user$project$Mapbox_Layer$Top,
+ 'minzoom',
+ _elm_lang$core$Json_Encode$float(_p119));
+};
+var _user$project$Mapbox_Layer$maxzoom = function (_p120) {
+ return A2(
+ _user$project$Mapbox_Layer$Top,
+ 'maxzoom',
+ _elm_lang$core$Json_Encode$float(_p120));
+};
+var _user$project$Mapbox_Layer$filter = function (_p121) {
+ return A2(
+ _user$project$Mapbox_Layer$Top,
+ 'filter',
+ _user$project$Mapbox_Expression$encode(_p121));
+};
+var _user$project$Mapbox_Source$encodeCoordinates = function (_p0) {
+ var _p1 = _p0;
+ var encodePair = function (_p2) {
+ var _p3 = _p2;
+ return _elm_lang$core$Json_Encode$list(
+ {
+ ctor: '::',
+ _0: _elm_lang$core$Json_Encode$float(_p3._0),
+ _1: {
+ ctor: '::',
+ _0: _elm_lang$core$Json_Encode$float(_p3._1),
+ _1: {ctor: '[]'}
+ }
+ });
+ };
+ return _elm_lang$core$Json_Encode$list(
+ {
+ ctor: '::',
+ _0: encodePair(_p1.topLeft),
+ _1: {
+ ctor: '::',
+ _0: encodePair(_p1.topRight),
+ _1: {
+ ctor: '::',
+ _0: encodePair(_p1.bottomRight),
+ _1: {
+ ctor: '::',
+ _0: encodePair(_p1.bottomLeft),
+ _1: {ctor: '[]'}
+ }
+ }
+ }
+ });
+};
+var _user$project$Mapbox_Source$getId = function (_p4) {
+ var _p5 = _p4;
+ return _p5._0;
+};
+var _user$project$Mapbox_Source$encode = function (_p6) {
+ var _p7 = _p6;
+ return _p7._1;
+};
+var _user$project$Mapbox_Source$Coords = F4(
+ function (a, b, c, d) {
+ return {topLeft: a, topRight: b, bottomRight: c, bottomLeft: d};
+ });
+var _user$project$Mapbox_Source$Source = F2(
+ function (a, b) {
+ return {ctor: 'Source', _0: a, _1: b};
+ });
+var _user$project$Mapbox_Source$vectorFromUrl = F2(
+ function (id, url) {
+ return A2(
+ _user$project$Mapbox_Source$Source,
+ id,
+ _elm_lang$core$Json_Encode$object(
+ {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'type',
+ _1: _elm_lang$core$Json_Encode$string('vector')
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'url',
+ _1: _elm_lang$core$Json_Encode$string(url)
+ },
+ _1: {ctor: '[]'}
+ }
+ }));
+ });
+var _user$project$Mapbox_Source$vector = F3(
+ function (id, urls, options) {
+ return A2(
+ _user$project$Mapbox_Source$Source,
+ id,
+ _elm_lang$core$Json_Encode$object(
+ {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'tiles',
+ _1: _elm_lang$core$Json_Encode$list(
+ A2(_elm_lang$core$List$map, _elm_lang$core$Json_Encode$string, urls))
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'type',
+ _1: _elm_lang$core$Json_Encode$string('vector')
+ },
+ _1: A2(
+ _elm_lang$core$List$map,
+ function (_p8) {
+ var _p9 = _p8;
+ return {ctor: '_Tuple2', _0: _p9._0, _1: _p9._1};
+ },
+ options)
+ }
+ }));
+ });
+var _user$project$Mapbox_Source$rasterFromUrl = F2(
+ function (id, url) {
+ return A2(
+ _user$project$Mapbox_Source$Source,
+ id,
+ _elm_lang$core$Json_Encode$object(
+ {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'type',
+ _1: _elm_lang$core$Json_Encode$string('raster')
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'url',
+ _1: _elm_lang$core$Json_Encode$string(url)
+ },
+ _1: {ctor: '[]'}
+ }
+ }));
+ });
+var _user$project$Mapbox_Source$raster = F3(
+ function (id, urls, options) {
+ return A2(
+ _user$project$Mapbox_Source$Source,
+ id,
+ _elm_lang$core$Json_Encode$object(
+ {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'tiles',
+ _1: _elm_lang$core$Json_Encode$list(
+ A2(_elm_lang$core$List$map, _elm_lang$core$Json_Encode$string, urls))
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'type',
+ _1: _elm_lang$core$Json_Encode$string('raster')
+ },
+ _1: A2(
+ _elm_lang$core$List$map,
+ function (_p10) {
+ var _p11 = _p10;
+ return {ctor: '_Tuple2', _0: _p11._0, _1: _p11._1};
+ },
+ options)
+ }
+ }));
+ });
+var _user$project$Mapbox_Source$rasterDEMMapbox = function (id) {
+ return A2(
+ _user$project$Mapbox_Source$Source,
+ id,
+ _elm_lang$core$Json_Encode$object(
+ {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'type',
+ _1: _elm_lang$core$Json_Encode$string('raster-dem')
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'url',
+ _1: _elm_lang$core$Json_Encode$string('mapbox://mapbox.terrain-rgb')
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'encoding',
+ _1: _elm_lang$core$Json_Encode$string('mapbox')
+ },
+ _1: {ctor: '[]'}
+ }
+ }
+ }));
+};
+var _user$project$Mapbox_Source$rasterDEMTerrarium = F3(
+ function (id, url, options) {
+ return A2(
+ _user$project$Mapbox_Source$Source,
+ id,
+ _elm_lang$core$Json_Encode$object(
+ {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'type',
+ _1: _elm_lang$core$Json_Encode$string('raster-dem')
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'url',
+ _1: _elm_lang$core$Json_Encode$string(url)
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'encoding',
+ _1: _elm_lang$core$Json_Encode$string('terrarium')
+ },
+ _1: A2(
+ _elm_lang$core$List$map,
+ function (_p12) {
+ var _p13 = _p12;
+ return {ctor: '_Tuple2', _0: _p13._0, _1: _p13._1};
+ },
+ options)
+ }
+ }
+ }));
+ });
+var _user$project$Mapbox_Source$geoJSONFromUrl = F3(
+ function (id, url, options) {
+ return A2(
+ _user$project$Mapbox_Source$Source,
+ id,
+ _elm_lang$core$Json_Encode$object(
+ {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'data',
+ _1: _elm_lang$core$Json_Encode$string(url)
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'type',
+ _1: _elm_lang$core$Json_Encode$string('geojson')
+ },
+ _1: A2(
+ _elm_lang$core$List$map,
+ function (_p14) {
+ var _p15 = _p14;
+ return {ctor: '_Tuple2', _0: _p15._0, _1: _p15._1};
+ },
+ options)
+ }
+ }));
+ });
+var _user$project$Mapbox_Source$geoJSONFromValue = F3(
+ function (id, options, data) {
+ return A2(
+ _user$project$Mapbox_Source$Source,
+ id,
+ _elm_lang$core$Json_Encode$object(
+ {
+ ctor: '::',
+ _0: {ctor: '_Tuple2', _0: 'data', _1: data},
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'type',
+ _1: _elm_lang$core$Json_Encode$string('geojson')
+ },
+ _1: A2(
+ _elm_lang$core$List$map,
+ function (_p16) {
+ var _p17 = _p16;
+ return {ctor: '_Tuple2', _0: _p17._0, _1: _p17._1};
+ },
+ options)
+ }
+ }));
+ });
+var _user$project$Mapbox_Source$image = F3(
+ function (id, url, coordinates) {
+ return A2(
+ _user$project$Mapbox_Source$Source,
+ id,
+ _elm_lang$core$Json_Encode$object(
+ {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'type',
+ _1: _elm_lang$core$Json_Encode$string('image')
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'url',
+ _1: _elm_lang$core$Json_Encode$string(url)
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'coordinates',
+ _1: _user$project$Mapbox_Source$encodeCoordinates(coordinates)
+ },
+ _1: {ctor: '[]'}
+ }
+ }
+ }));
+ });
+var _user$project$Mapbox_Source$video = F3(
+ function (id, urls, coordinates) {
+ return A2(
+ _user$project$Mapbox_Source$Source,
+ id,
+ _elm_lang$core$Json_Encode$object(
+ {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'type',
+ _1: _elm_lang$core$Json_Encode$string('video')
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'urls',
+ _1: _elm_lang$core$Json_Encode$list(
+ A2(_elm_lang$core$List$map, _elm_lang$core$Json_Encode$string, urls))
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'coordinates',
+ _1: _user$project$Mapbox_Source$encodeCoordinates(coordinates)
+ },
+ _1: {ctor: '[]'}
+ }
+ }
+ }));
+ });
+var _user$project$Mapbox_Source$staticCanvas = F3(
+ function (id, domid, coordinates) {
+ return A2(
+ _user$project$Mapbox_Source$Source,
+ id,
+ _elm_lang$core$Json_Encode$object(
+ {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'type',
+ _1: _elm_lang$core$Json_Encode$string('canvas')
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'animate',
+ _1: _elm_lang$core$Json_Encode$bool(false)
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'canvas',
+ _1: _elm_lang$core$Json_Encode$string(domid)
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'coordinates',
+ _1: _user$project$Mapbox_Source$encodeCoordinates(coordinates)
+ },
+ _1: {ctor: '[]'}
+ }
+ }
+ }
+ }));
+ });
+var _user$project$Mapbox_Source$animatedCanvas = F3(
+ function (id, domid, coordinates) {
+ return A2(
+ _user$project$Mapbox_Source$Source,
+ id,
+ _elm_lang$core$Json_Encode$object(
+ {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'type',
+ _1: _elm_lang$core$Json_Encode$string('canvas')
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'animate',
+ _1: _elm_lang$core$Json_Encode$bool(true)
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'canvas',
+ _1: _elm_lang$core$Json_Encode$string(domid)
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'coordinates',
+ _1: _user$project$Mapbox_Source$encodeCoordinates(coordinates)
+ },
+ _1: {ctor: '[]'}
+ }
+ }
+ }
+ }));
+ });
+var _user$project$Mapbox_Source$TMS = {ctor: 'TMS'};
+var _user$project$Mapbox_Source$XYZ = {ctor: 'XYZ'};
+var _user$project$Mapbox_Source$VectorSource = {ctor: 'VectorSource'};
+var _user$project$Mapbox_Source$RasterSource = {ctor: 'RasterSource'};
+var _user$project$Mapbox_Source$GeoJSONSource = {ctor: 'GeoJSONSource'};
+var _user$project$Mapbox_Source$SourceOption = F2(
+ function (a, b) {
+ return {ctor: 'SourceOption', _0: a, _1: b};
+ });
+var _user$project$Mapbox_Source$bounds = F4(
+ function (a, b, c, d) {
+ return A2(
+ _user$project$Mapbox_Source$SourceOption,
+ 'bounds',
+ _elm_lang$core$Json_Encode$list(
+ {
+ ctor: '::',
+ _0: _elm_lang$core$Json_Encode$float(a),
+ _1: {
+ ctor: '::',
+ _0: _elm_lang$core$Json_Encode$float(b),
+ _1: {
+ ctor: '::',
+ _0: _elm_lang$core$Json_Encode$float(c),
+ _1: {
+ ctor: '::',
+ _0: _elm_lang$core$Json_Encode$float(d),
+ _1: {ctor: '[]'}
+ }
+ }
+ }
+ }));
+ });
+var _user$project$Mapbox_Source$minzoom = function (z) {
+ return A2(
+ _user$project$Mapbox_Source$SourceOption,
+ 'minzoom',
+ _elm_lang$core$Json_Encode$float(z));
+};
+var _user$project$Mapbox_Source$maxzoom = function (z) {
+ return A2(
+ _user$project$Mapbox_Source$SourceOption,
+ 'maxzoom',
+ _elm_lang$core$Json_Encode$float(z));
+};
+var _user$project$Mapbox_Source$attribution = function (att) {
+ return A2(
+ _user$project$Mapbox_Source$SourceOption,
+ 'attribution',
+ _elm_lang$core$Json_Encode$string(att));
+};
+var _user$project$Mapbox_Source$tileSize = function (ts) {
+ return A2(
+ _user$project$Mapbox_Source$SourceOption,
+ 'minzoom',
+ _elm_lang$core$Json_Encode$int(ts));
+};
+var _user$project$Mapbox_Source$buffer = function ($int) {
+ return A2(
+ _user$project$Mapbox_Source$SourceOption,
+ 'buffer',
+ _elm_lang$core$Json_Encode$int($int));
+};
+var _user$project$Mapbox_Source$tolerance = function ($float) {
+ return A2(
+ _user$project$Mapbox_Source$SourceOption,
+ 'tolerance',
+ _elm_lang$core$Json_Encode$float($float));
+};
+var _user$project$Mapbox_Source$cluster = function (_p18) {
+ return A2(
+ _user$project$Mapbox_Source$SourceOption,
+ 'cluster',
+ _elm_lang$core$Json_Encode$bool(_p18));
+};
+var _user$project$Mapbox_Source$clusterRadius = function (_p19) {
+ return A2(
+ _user$project$Mapbox_Source$SourceOption,
+ 'clusterRadius',
+ _elm_lang$core$Json_Encode$float(_p19));
+};
+var _user$project$Mapbox_Source$clusterMaxZoom = function (_p20) {
+ return A2(
+ _user$project$Mapbox_Source$SourceOption,
+ 'clusterMaxZoom',
+ _elm_lang$core$Json_Encode$float(_p20));
+};
+var _user$project$Mapbox_Source$lineMetrics = function (_p21) {
+ return A2(
+ _user$project$Mapbox_Source$SourceOption,
+ 'lineMetrics',
+ _elm_lang$core$Json_Encode$bool(_p21));
+};
+var _user$project$Mapbox_Source$scheme = function (s) {
+ var _p22 = s;
+ if (_p22.ctor === 'XYZ') {
+ return A2(
+ _user$project$Mapbox_Source$SourceOption,
+ 'scheme',
+ _elm_lang$core$Json_Encode$string('xyz'));
+ } else {
+ return A2(
+ _user$project$Mapbox_Source$SourceOption,
+ 'scheme',
+ _elm_lang$core$Json_Encode$string('tms'));
+ }
+};
+var _user$project$Mapbox_Style$defaultTransition = {duration: 300, delay: 0};
+var _user$project$Mapbox_Style$defaultLight = {
+ anchor: _user$project$Mapbox_Expression$Viewport,
+ position: _user$project$Mapbox_Expression$floats(
+ {
+ ctor: '::',
+ _0: 1.15,
+ _1: {
+ ctor: '::',
+ _0: 210,
+ _1: {
+ ctor: '::',
+ _0: 30,
+ _1: {ctor: '[]'}
+ }
+ }
+ }),
+ color: A4(_user$project$Mapbox_Expression$rgba, 255, 255, 255, 1),
+ intensity: _user$project$Mapbox_Expression$float(0.5)
+};
+var _user$project$Mapbox_Style$encodeLight = function (_p0) {
+ var _p1 = _p0;
+ return _elm_lang$core$Json_Encode$object(
+ {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'anchor',
+ _1: _user$project$Mapbox_Helpers$encodeAnchor(_p1.anchor)
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'position',
+ _1: _user$project$Mapbox_Expression$encode(_p1.position)
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'color',
+ _1: _user$project$Mapbox_Expression$encode(_p1.color)
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'intensity',
+ _1: _user$project$Mapbox_Expression$encode(_p1.intensity)
+ },
+ _1: {ctor: '[]'}
+ }
+ }
+ }
+ });
+};
+var _user$project$Mapbox_Style$encodeTransition = function (_p2) {
+ var _p3 = _p2;
+ return _elm_lang$core$Json_Encode$object(
+ {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'duration',
+ _1: _elm_lang$core$Json_Encode$int(_p3.duration)
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'delay',
+ _1: _elm_lang$core$Json_Encode$int(_p3.delay)
+ },
+ _1: {ctor: '[]'}
+ }
+ });
+};
+var _user$project$Mapbox_Style$encode = function (style) {
+ return _elm_lang$core$Json_Encode$object(
+ A2(
+ _elm_lang$core$Basics_ops['++'],
+ {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'version',
+ _1: _elm_lang$core$Json_Encode$int(8)
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'transition',
+ _1: _user$project$Mapbox_Style$encodeTransition(style.transition)
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'light',
+ _1: _user$project$Mapbox_Style$encodeLight(style.light)
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'sources',
+ _1: _elm_lang$core$Json_Encode$object(
+ A2(
+ _elm_lang$core$List$map,
+ function (source) {
+ return {
+ ctor: '_Tuple2',
+ _0: _user$project$Mapbox_Source$getId(source),
+ _1: _user$project$Mapbox_Source$encode(source)
+ };
+ },
+ style.sources))
+ },
+ _1: {
+ ctor: '::',
+ _0: {
+ ctor: '_Tuple2',
+ _0: 'layers',
+ _1: _elm_lang$core$Json_Encode$list(
+ A2(_elm_lang$core$List$map, _user$project$Mapbox_Layer$encode, style.layers))
+ },
+ _1: {ctor: '[]'}
+ }
+ }
+ }
+ }
+ },
+ A2(
+ _elm_lang$core$List$map,
+ function (_p4) {
+ var _p5 = _p4;
+ return {ctor: '_Tuple2', _0: _p5._0, _1: _p5._1};
+ },
+ style.misc)));
+};
+var _user$project$Mapbox_Style$Style = F5(
+ function (a, b, c, d, e) {
+ return {transition: a, light: b, layers: c, sources: d, misc: e};
+ });
+var _user$project$Mapbox_Style$Light = F4(
+ function (a, b, c, d) {
+ return {anchor: a, position: b, color: c, intensity: d};
+ });
+var _user$project$Mapbox_Style$Transition = F2(
+ function (a, b) {
+ return {duration: a, delay: b};
+ });
+var _user$project$Mapbox_Style$MiscAttr = F2(
+ function (a, b) {
+ return {ctor: 'MiscAttr', _0: a, _1: b};
+ });
+var _user$project$Mapbox_Style$name = function (_p6) {
+ return A2(
+ _user$project$Mapbox_Style$MiscAttr,
+ 'name',
+ _elm_lang$core$Json_Encode$string(_p6));
+};
+var _user$project$Mapbox_Style$defaultCenter = F2(
+ function (lat, lng) {
+ return A2(
+ _user$project$Mapbox_Style$MiscAttr,
+ 'center',
+ _elm_lang$core$Json_Encode$list(
+ {
+ ctor: '::',
+ _0: _elm_lang$core$Json_Encode$float(lat),
+ _1: {
+ ctor: '::',
+ _0: _elm_lang$core$Json_Encode$float(lng),
+ _1: {ctor: '[]'}
+ }
+ }));
+ });
+var _user$project$Mapbox_Style$defaultZoomLevel = function (_p7) {
+ return A2(
+ _user$project$Mapbox_Style$MiscAttr,
+ 'zoom',
+ _elm_lang$core$Json_Encode$float(_p7));
+};
+var _user$project$Mapbox_Style$metadata = function (_p8) {
+ return A2(
+ _user$project$Mapbox_Style$MiscAttr,
+ 'metadata',
+ _elm_lang$core$Json_Encode$object(_p8));
+};
+var _user$project$Mapbox_Style$defaultBearing = function (_p9) {
+ return A2(
+ _user$project$Mapbox_Style$MiscAttr,
+ 'bearing',
+ _elm_lang$core$Json_Encode$float(_p9));
+};
+var _user$project$Mapbox_Style$defaultPitch = function (_p10) {
+ return A2(
+ _user$project$Mapbox_Style$MiscAttr,
+ 'pitch',
+ _elm_lang$core$Json_Encode$float(_p10));
+};
+var _user$project$Mapbox_Style$sprite = function (_p11) {
+ return A2(
+ _user$project$Mapbox_Style$MiscAttr,
+ 'sprite',
+ _elm_lang$core$Json_Encode$string(_p11));
+};
+var _user$project$Mapbox_Style$glyphs = function (_p12) {
+ return A2(
+ _user$project$Mapbox_Style$MiscAttr,
+ 'glyphs',
+ _elm_lang$core$Json_Encode$string(_p12));
+};
+var Elm = {};
+Elm['Mapbox'] = Elm['Mapbox'] || {};
+Elm['Mapbox']['Style'] = Elm['Mapbox']['Style'] || {};
+if (typeof _user$project$Mapbox_Style$main !== 'undefined') {
+ _user$project$Mapbox_Style$main(Elm['Mapbox']['Style'], 'Mapbox.Style', undefined);
+}
+
+if (typeof define === "function" && define['amd'])
+{
+ define([], function() { return Elm; });
+ return;
+}
+
+if (typeof module === "object")
+{
+ module['exports'] = Elm;
+ return;
+}
+
+var globalElm = this['Elm'];
+if (typeof globalElm === "undefined")
+{
+ this['Elm'] = Elm;
+ return;
+}
+
+for (var publicModule in Elm)
+{
+ if (publicModule in globalElm)
+ {
+ throw new Error('There are two Elm modules called `' + publicModule + '` on this page! Rename one of them.');
+ }
+ globalElm[publicModule] = Elm[publicModule];
+}
+
+}).call(this);
+</script></head><body><script type="text/javascript">Elm.Mapbox.Style.fullscreen()</script></body></html> \ No newline at end of file
diff --git a/src/Mapbox/Expression.elm b/src/Mapbox/Expression.elm
new file mode 100644
index 0000000..6a9d9f7
--- /dev/null
+++ b/src/Mapbox/Expression.elm
@@ -0,0 +1,1390 @@
+module Mapbox.Expression
+ exposing
+ ( Expression
+ , DataExpression
+ , CameraExpression
+ , encode
+ , Color
+ , Object
+ , Collator
+ , defaultCollator
+ , true
+ , false
+ , bool
+ , int
+ , float
+ , str
+ , rgba
+ , floats
+ , strings
+ , object
+ , collator
+ , assertArray
+ , assertArrayOfStrings
+ , assertArrayOfFloats
+ , assertArrayOfBools
+ , assertBool
+ , assertFloat
+ , assertObject
+ , assertString
+ , toBool
+ , toColor
+ , toFloat
+ , toString
+ , typeof
+ , at
+ , get
+ , has
+ , count
+ , length
+ , geometryType
+ , id
+ , properties
+ , getProperty
+ , hasProperty
+ , isEqual
+ , notEqual
+ , lessThan
+ , lessThanOrEqual
+ , greaterThan
+ , greaterThanOrEqual
+ , isEqualWithCollator
+ , notEqualWithCollator
+ , lessThanWithCollator
+ , lessThanOrEqualWithCollator
+ , greaterThanWithCollator
+ , greaterThanOrEqualWithCollator
+ , not
+ , all
+ , any
+ , ifElse
+ , conditionally
+ , matchesStr
+ , matchesFloat
+ , coallesce
+ , interpolate
+ , Interpolation(..)
+ , step
+ , append
+ , downcase
+ , upcase
+ , isSupportedScript
+ , resolvedLocale
+ , makeRGBColor
+ , makeRGBAColor
+ , rgbaChannels
+ , minus
+ , multiply
+ , divideBy
+ , modBy
+ , plus
+ , raiseBy
+ , sqrt
+ , abs
+ , ceil
+ , floor
+ , round
+ , cos
+ , sin
+ , tan
+ , acos
+ , asin
+ , atan
+ , e
+ , pi
+ , ln
+ , ln2
+ , log10
+ , log2
+ , zoom
+ , heatmapDensity
+ , lineProgress
+ , Anchor(..)
+ , anchorMap
+ , anchorViewport
+ , AnchorAuto
+ , anchorAutoMap
+ , anchorAutoViewport
+ , anchorAutoAuto
+ , Position
+ , positionCenter
+ , positionLeft
+ , positionRight
+ , positionTop
+ , positionBottom
+ , positionTopLeft
+ , positionTopRight
+ , positionBottomLeft
+ , positionBottomRight
+ , TextFit
+ , textFitNone
+ , textFitWidth
+ , textFitHeight
+ , textFitBoth
+ , LineCap
+ , lineCapButt
+ , lineCapRound
+ , lineCapSquare
+ , LineJoin
+ , lineJoinBevel
+ , lineJoinRound
+ , lineJoinMiter
+ , SymbolPlacement
+ , symbolPlacementPoint
+ , symbolPlacementLine
+ , TextJustify
+ , textJustifyLeft
+ , textJustifyCenter
+ , textJustifyRight
+ , TextTransform
+ , textTransformNone
+ , textTransformUppercase
+ , textTransformLowercase
+ )
+
+{-| Expressions form a little language that can be used to compute values for various layer properties.
+
+It is recommended to import them in the following fashion:
+
+ import Mapbox.Expression as E exposing (str, float, int, true, false)
+
+This way you can use the language without much syntactic fuss and you have easy access to the literals.
+
+**Note**: If you are familiar with the JS version of the style spec,
+we have made a few changes. Argument order has been switched for many functions to support using pipeline style more naturally. Some functions use overloading in the original, these have been renamed to
+not be overloaded. Finally, we have chosen not to represent some parts of the spec that are superflous (especially when used form Elm), namely functions and let-in expressions.
+
+@docs Expression, DataExpression, CameraExpression
+
+@docs encode
+
+
+### Types
+
+All of the types used as expression results are phantom (i.e. they don't have any runtime values but are used purely for compile-time checking). As such we use a mix of standard elm types for their familiarty:
+
+ - `Float`
+ - `String`
+ - `Array`
+ - `Bool`
+
+We introduce the following types:
+
+@docs Color, Object, Collator
+
+(And also a bunch of Enum types, that will be documented in the Enums section).
+
+You can use the following functions to transfer Elm values into the Expression language:
+
+@docs true, false, bool, int, float, str, rgba, floats, strings, object, collator, defaultCollator
+
+In some cases, you will need to force the type system to cooperate.
+The following assertions will force the type and cause a run-time error
+if the type is wrong:
+
+@docs assertArray, assertArrayOfStrings, assertArrayOfFloats, assertArrayOfBools, assertBool, assertFloat, assertObject, assertString
+
+You can also use these functions to explicitly cast to a particular type:
+
+@docs toBool, toColor, toFloat, toString
+
+@docs typeof
+
+
+### Lookup
+
+@docs at, get, has, count, length
+
+
+### Feature data
+
+@docs geometryType, id, properties, getProperty, hasProperty
+
+
+### Decision
+
+The expressions in this section can be used to add conditional logic to your styles.
+
+@docs isEqual, notEqual, lessThan, lessThanOrEqual, greaterThan, greaterThanOrEqual
+
+Strings can be compared with a collator for locale specific comparisons:
+
+@docs isEqualWithCollator, notEqualWithCollator,lessThanWithCollator, lessThanOrEqualWithCollator, greaterThanWithCollator, greaterThanOrEqualWithCollator
+
+Logical operators:
+
+@docs not, all, any
+
+Control flow:
+
+@docs ifElse, conditionally, matchesStr, matchesFloat, coallesce
+
+
+### Ramps, scales, curves
+
+@docs interpolate, Interpolation, step
+
+
+### String
+
+@docs append, downcase, upcase, isSupportedScript, resolvedLocale
+
+
+### Color
+
+@docs makeRGBColor, makeRGBAColor, rgbaChannels
+
+
+### Math
+
+@docs minus, multiply, divideBy, modBy, plus, raiseBy, sqrt, abs, ceil, floor, round, cos, sin, tan, acos, asin, atan, e, pi, ln, ln2, log10, log2
+
+
+### Zoom
+
+@docs zoom
+
+
+### Heatmap
+
+@docs heatmapDensity, lineProgress
+
+
+### Enums
+
+These are required for various layer properties.
+
+@docs Anchor, anchorMap, anchorViewport, AnchorAuto, anchorAutoMap, anchorAutoViewport, anchorAutoAuto, Position, positionCenter, positionLeft, positionRight, positionTop, positionBottom, positionTopLeft, positionTopRight, positionBottomLeft, positionBottomRight, TextFit, textFitNone, textFitWidth, textFitHeight, textFitBoth, LineCap, lineCapButt, lineCapRound, lineCapSquare, LineJoin, lineJoinBevel, lineJoinRound, lineJoinMiter, SymbolPlacement, symbolPlacementPoint, symbolPlacementLine, TextJustify, textJustifyLeft, textJustifyCenter, textJustifyRight, TextTransform, textTransformNone, textTransformUppercase, textTransformLowercase
+
+-}
+
+import Array exposing (Array)
+import Json.Encode exposing (Value)
+
+
+{-| Expressions are zero overhead wrappers over the underlying JSON language that attempt to provide some type safety.
+
+Note however, that while being a strictly typed language, it has slighlty different semantics tham Elm:
+
+ - There is only a single number type. I have denoted it `Float`. You will notice that the `int` function takes an Elm int
+ value and converts it to an `Expression expr Float`.
+ - All values may be `null`. There is no `Maybe` type. You can use the `coallesce` function to handle this.
+ - There is no distinction between `List`, `Array`, and tuples. Hence all collections are labeled as `Array`.
+ - Dictionaries are called `Object`. The keys are always `String`, but the values can be of mixed types. Hence retrieving
+ values from them makes code untyped.
+ - You can force the types of things using the `assert...` functions. This will generate a runtime error if the type doesn't
+ match. This should be necessary only rarely.
+
+The `exprType` can be:
+
+ - `CameraExpression`
+ - `DataExpression`
+ - or a type variable representing either of the above
+
+The intent is to help you not break your style by using a DataExpression (for example) where it isn't supported. However, this isn't entirely foolproof, so some caution is advised.
+
+-}
+type Expression exprType resultType
+ = Expression Value
+
+
+{-| A camera expression is any expression that uses the zoom operator. Such expressions allow the the appearance of a layer
+to change with the map's zoom level. Camera expressions can be used to create the appearance of depth and to control data density.
+
+ zoom
+ |> interpolate Linear
+ [ ( 5, int 1 )
+ , ( 10, int 5 )
+ ]
+ |> Layer.circleRadius
+
+This example uses the `interpolate` operator to define a linear relationship between zoom level and circle size using a set of input-output pairs. In this case, the expression indicates that the circle radius should be 1 pixel when the zoom level is 5 or below, and 5 pixels when the zoom is 10 or above. In between, the radius will be linearly interpolated between 1 and 5 pixels
+
+Camera expressions are allowed anywhere an expression may be used. However, when a camera expression used as the value of a layout or paint property, the `zoom` operator must appear only as the input to an outer `interpolate` or `step` expression
+
+There is an important difference between layout and paint properties in the timing of camera expression evaluation. Paint property camera expressions are re-evaluated whenever the zoom level changes, even fractionally. For example, a paint property camera expression will be re-evaluated continuously as the map moves between zoom levels 4.1 and 4.6. On the other hand, a layout property camera expression is evaluated only at integer zoom levels. It will not be re-evaluated as the zoom changes from 4.1 to 4.6 -- only if it goes above 5 or below 4.
+
+-}
+type CameraExpression
+ = CameraExpression
+
+
+{-| A data expression is any expression that access feature data -- that is, any expression that uses one of the data operators: `getProperty`, `hasProperty` , `id`, `geometryType`, or `properties`. Data expressions allow a feature's properties to determine its appearance. They can be used to differentiate features within the same layer and to create data visualizations.
+
+ makeRGBColor
+ -- red is higher when feature.properties.temperature is higher
+ (getProperty "temperature")
+ -- green is always zero
+ (int 0)
+ -- blue is higher when feature.properties.temperature is lower
+ (getProperty "temperature" |> minus 100)
+ |> Layer.circleColor
+
+This example uses the `getProperty` operator to obtain the temperature value of each feature. That value is used to compute arguments to the `makeRGBColor` operator, defining a color in terms of its red, green, and blue components.
+
+-}
+type DataExpression
+ = DataExpression
+
+
+{-| Turns an expression into JSON
+-}
+encode : Expression exprType a -> Value
+encode (Expression value) =
+ value
+
+
+{-| Represents a mixed-type dictionary where keys are always strings
+-}
+type Object
+ = Object
+
+
+{-| Represents a color value
+-}
+type Color
+ = Color
+
+
+{-| Used for locale sensitive string comparisons.
+-}
+type Collator
+ = Collator
+
+
+
+-- Enums
+
+
+{-| -}
+type Anchor
+ = Map
+ | Viewport
+
+
+{-| -}
+anchorMap : Expression exprType Anchor
+anchorMap =
+ Expression (Json.Encode.string "map")
+
+
+{-| -}
+anchorViewport : Expression exprType Anchor
+anchorViewport =
+ Expression (Json.Encode.string "viewport")
+
+
+{-| -}
+type AnchorAuto
+ = AnchorAuto
+
+
+{-| -}
+anchorAutoMap : Expression exprType AnchorAuto
+anchorAutoMap =
+ Expression (Json.Encode.string "map")
+
+
+{-| -}
+anchorAutoViewport : Expression exprType AnchorAuto
+anchorAutoViewport =
+ Expression (Json.Encode.string "viewport")
+
+
+{-| -}
+anchorAutoAuto : Expression exprType AnchorAuto
+anchorAutoAuto =
+ Expression (Json.Encode.string "auto")
+
+
+{-| -}
+type Position
+ = Position
+
+
+{-| -}
+positionCenter : Expression exprType Position
+positionCenter =
+ Expression (Json.Encode.string "center")
+
+
+{-| -}
+positionLeft : Expression exprType Position
+positionLeft =
+ Expression (Json.Encode.string "left")
+
+
+{-| -}
+positionRight : Expression exprType Position
+positionRight =
+ Expression (Json.Encode.string "right")
+
+
+{-| -}
+positionTop : Expression exprType Position
+positionTop =
+ Expression (Json.Encode.string "top")
+
+
+{-| -}
+positionBottom : Expression exprType Position
+positionBottom =
+ Expression (Json.Encode.string "bottom")
+
+
+{-| -}
+positionTopLeft : Expression exprType Position
+positionTopLeft =
+ Expression (Json.Encode.string "top-left")
+
+
+{-| -}
+positionTopRight : Expression exprType Position
+positionTopRight =
+ Expression (Json.Encode.string "top-right")
+
+
+{-| -}
+positionBottomLeft : Expression exprType Position
+positionBottomLeft =
+ Expression (Json.Encode.string "bottom-left")
+
+
+{-| -}
+positionBottomRight : Expression exprType Position
+positionBottomRight =
+ Expression (Json.Encode.string "bottom-right")
+
+
+{-| -}
+type TextFit
+ = TextFit
+
+
+{-| -}
+textFitNone : Expression exprType TextFit
+textFitNone =
+ Expression (Json.Encode.string "none")
+
+
+{-| -}
+textFitWidth : Expression exprType TextFit
+textFitWidth =
+ Expression (Json.Encode.string "width")
+
+
+{-| -}
+textFitHeight : Expression exprType TextFit
+textFitHeight =
+ Expression (Json.Encode.string "height")
+
+
+{-| -}
+textFitBoth : Expression exprType TextFit
+textFitBoth =
+ Expression (Json.Encode.string "both")
+
+
+{-| -}
+type LineCap
+ = LineCap
+
+
+{-| -}
+lineCapButt : Expression exprType LineCap
+lineCapButt =
+ Expression (Json.Encode.string "butt")
+
+
+{-| -}
+lineCapRound : Expression exprType LineCap
+lineCapRound =
+ Expression (Json.Encode.string "round")
+
+
+{-| -}
+lineCapSquare : Expression exprType LineCap
+lineCapSquare =
+ Expression (Json.Encode.string "square")
+
+
+{-| -}
+type LineJoin
+ = LineJoin
+
+
+{-| -}
+lineJoinBevel : Expression exprType LineJoin
+lineJoinBevel =
+ Expression (Json.Encode.string "bevel")
+
+
+{-| -}
+lineJoinRound : Expression exprType LineJoin
+lineJoinRound =
+ Expression (Json.Encode.string "round")
+
+
+{-| -}
+lineJoinMiter : Expression exprType LineJoin
+lineJoinMiter =
+ Expression (Json.Encode.string "miter")
+
+
+{-| -}
+type SymbolPlacement
+ = SymbolPlacement
+
+
+{-| -}
+symbolPlacementPoint : Expression exprType SymbolPlacement
+symbolPlacementPoint =
+ Expression (Json.Encode.string "point")
+
+
+{-| -}
+symbolPlacementLine : Expression exprType SymbolPlacement
+symbolPlacementLine =
+ Expression (Json.Encode.string "line")
+
+
+{-| -}
+type TextJustify
+ = TextJustify
+
+
+{-| -}
+textJustifyLeft : Expression exprType TextJustify
+textJustifyLeft =
+ Expression (Json.Encode.string "left")
+
+
+{-| -}
+textJustifyCenter : Expression exprType TextJustify
+textJustifyCenter =
+ Expression (Json.Encode.string "center")
+
+
+{-| -}
+textJustifyRight : Expression exprType TextJustify
+textJustifyRight =
+ Expression (Json.Encode.string "right")
+
+
+{-| -}
+type TextTransform
+ = TextTransform
+
+
+{-| -}
+textTransformNone : Expression exprType TextTransform
+textTransformNone =
+ Expression (Json.Encode.string "none")
+
+
+{-| -}
+textTransformUppercase : Expression exprType TextTransform
+textTransformUppercase =
+ Expression (Json.Encode.string "uppercase")
+
+
+{-| -}
+textTransformLowercase : Expression exprType TextTransform
+textTransformLowercase =
+ Expression (Json.Encode.string "lowercase")
+
+
+
+-- literals
+
+
+{-| -}
+rgba : Float -> Float -> Float -> Float -> Expression exprType Color
+rgba r g b a =
+ Expression (Json.Encode.string ("rgba" ++ Basics.toString ( r, g, b, a )))
+
+
+{-| -}
+str : String -> Expression exprType String
+str s =
+ Expression (Json.Encode.string s)
+
+
+{-| -}
+bool : Bool -> Expression exprType Bool
+bool b =
+ Expression (Json.Encode.bool b)
+
+
+{-| -}
+true : Expression exprType Bool
+true =
+ bool True
+
+
+{-| -}
+false : Expression exprType Bool
+false =
+ bool False
+
+
+{-| -}
+int : Int -> Expression exprType Float
+int number =
+ Expression (Json.Encode.int number)
+
+
+{-| -}
+float : Float -> Expression exprType Float
+float number =
+ Expression (Json.Encode.float number)
+
+
+{-| -}
+floats : List Float -> Expression exprType (Array Float)
+floats =
+ List.map float >> list
+
+
+{-| -}
+strings : List String -> Expression exprType (Array String)
+strings =
+ List.map str >> list
+
+
+list : List (Expression exprType a) -> Expression exprType (Array a)
+list =
+ List.map encode >> Json.Encode.list >> Expression >> call1 "literal"
+
+
+{-| Returns a `Collator` for use in locale-dependent comparison operations. The first argument specifies if the comparison should be case sensitive. The second specifies if it is diacritic sensitive. The final locale argument specifies the IETF language tag of the locale to use.
+-}
+collator : Expression e1 Bool -> Expression e2 Bool -> Expression e3 String -> Expression e4 Collator
+collator (Expression caseSensitive) (Expression diacriticSensitive) (Expression locale) =
+ Expression
+ (Json.Encode.list
+ (Json.Encode.string "collator"
+ :: [ Json.Encode.object
+ [ ( "case-sensitive", caseSensitive )
+ , ( "diacritic-sensitive", diacriticSensitive )
+ , ( "locale", locale )
+ ]
+ ]
+ )
+ )
+
+
+{-| Returns a `Collator` with the default locale (which depends on the system running the code), which is not sensitive to case nor diacritic.
+-}
+defaultCollator : Expression exprType Collator
+defaultCollator =
+ call0 "collator"
+
+
+{-| Takes a list of key value pairs. The values are JSON Values,
+therefore allowing for mixed types.
+-}
+object : List ( String, Value ) -> Expression exprType Object
+object =
+ Json.Encode.object >> Expression >> call1 "literal"
+
+
+
+-- Type Functions
+
+
+{-| -}
+assertArray : Expression exprType any -> Expression exprType (Array any)
+assertArray =
+ call1 "array"
+
+
+{-| -}
+assertArrayOfStrings : Expression exprType any -> Expression exprType (Array String)
+assertArrayOfStrings =
+ call2 "array" (str "string")
+
+
+{-| -}
+assertArrayOfFloats : Expression exprType any -> Expression exprType (Array Float)
+assertArrayOfFloats =
+ call2 "array" (str "number")
+
+
+{-| -}
+assertArrayOfBools : Expression exprType any -> Expression exprType (Array Bool)
+assertArrayOfBools =
+ call2 "array" (str "boolean")
+
+
+{-| -}
+assertBool : Expression exprType any -> Expression exprType Bool
+assertBool =
+ call1 "boolean"
+
+
+
+-- assertAtLeastOneBool : List (Expression exprType any) -> Expression exprType Bool
+-- assertAtLeastOneBool =
+-- call "boolean"
+
+
+{-| -}
+assertFloat : Expression exprType any -> Expression exprType Float
+assertFloat =
+ call1 "number"
+
+
+{-| -}
+assertObject : Expression exprType any -> Expression exprType Object
+assertObject =
+ call1 "object"
+
+
+{-| -}
+assertString : Expression exprType any -> Expression exprType String
+assertString =
+ call1 "string"
+
+
+{-| 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.
+-}
+toBool : Expression exprType any -> Expression exprType Bool
+toBool =
+ call1 "to-boolean"
+
+
+{-| Converts the input value to a color. If it can't be converted, the falback value will be used.
+
+ input
+ |> toColor (rgba 0 0 0 1) -- fallback color
+
+-}
+toColor : Expression exprType2 Color -> Expression exprType any -> Expression exprType Color
+toColor fallback input =
+ call2 "to-color" input fallback
+
+
+{-| 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 of the ECMAScript Language Specification](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type). If this fails, the fallback value is used.
+
+ input
+ |> toFloat 0 -- fallback
+
+-}
+toFloat : Float -> Expression exprType any -> Expression exprType Float
+toFloat fallback input =
+ call2 "to-number" input (float fallback)
+
+
+{-| 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.
+-}
+toString : Expression exprType any -> Expression exprType String
+toString =
+ call1 "to-string"
+
+
+{-| Returns a string describing the type of the given value.
+-}
+typeof : Expression exprType any -> Expression exprType String
+typeof =
+ call1 "typeof"
+
+
+
+-- Expressions
+
+
+call0 n =
+ call n []
+
+
+call1 n (Expression a) =
+ call n [ a ]
+
+
+call2 n (Expression a) (Expression b) =
+ call n [ a, b ]
+
+
+call3 n (Expression a) (Expression b) (Expression c) =
+ call n [ a, b, c ]
+
+
+call4 n (Expression a) (Expression b) (Expression c) (Expression d) =
+ call n [ a, b, c, d ]
+
+
+calln n expressions =
+ call n (List.map encode expressions)
+
+
+call name args =
+ Expression (Json.Encode.list (Json.Encode.string name :: args))
+
+
+{-| Gets the feature's geometry type: Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon.
+-}
+geometryType : Expression DataExpression String
+geometryType =
+ call0 "geometry-type"
+
+
+{-| Gets the feature's id, if it has one.
+-}
+id : Expression DataExpression any
+id =
+ call0 "id"
+
+
+{-| Gets the feature properties object. Note that in some cases, it may be more efficient to use `getProperty (str "property-name")` directly.
+-}
+properties : Expression DataExpression Object
+properties =
+ call0 "properties"
+
+
+{-| Retrieves an item from an array.
+-}
+at : Expression exprType1 Float -> Expression exprType2 (Array a) -> Expression exprType2 a
+at =
+ call2 "at"
+
+
+{-| Retrieves a property value from the current feature's properties. Returns null if the requested property is missing.
+-}
+getProperty : Expression exprType String -> Expression DataExpression any
+getProperty =
+ call1 "get"
+
+
+{-| Retrieves a property value from an object. Returns null if the requested property is missing.
+-}
+get : Expression exprType1 String -> Expression exprType2 Object -> Expression exprType2 any
+get =
+ call2 "get"
+
+
+{-| Tests for the presence of an property value in the current feature's properties.
+-}
+hasProperty : Expression exprType String -> Expression DataExpression Bool
+hasProperty =
+ call1 "has"
+
+
+{-| Tests for the presence of an property value in an object.
+-}
+has : Expression exprType1 String -> Expression exprType2 Object -> Expression exprType2 Bool
+has =
+ call2 "has"
+
+
+{-| Gets the length of an array.
+-}
+count : Expression exprType (Array any) -> Expression exprType Float
+count =
+ call1 "length"
+
+
+{-| Gets the length of a string.
+-}
+length : Expression exprType String -> Expression exprType Float
+length =
+ call1 "length"
+
+
+{-| Logical negation. Returns true if the input is false, and false if the input is true.
+-}
+not : Expression exprType Bool -> Expression exprType Bool
+not =
+ call1 "!"
+
+
+{-| Returns true if the input values are not equal, false otherwise.
+-}
+notEqual : Expression exprType1 a -> Expression exprType2 a -> Expression exprType1 Bool
+notEqual =
+ call2 "!="
+
+
+{-| -}
+notEqualWithCollator : Expression exprType1 String -> Expression exprType2 String -> Expression exprType3 Collator -> Expression exprType1 Bool
+notEqualWithCollator =
+ call3 "!="
+
+
+{-| Returns true if the first input is strictly less than the second, false otherwise.
+-}
+lessThan : Expression exprType1 comparable -> Expression exprType2 comparable -> Expression exprType1 Bool
+lessThan =
+ call2 "<"
+
+
+{-| -}
+lessThanWithCollator : Expression exprType1 String -> Expression exprType2 String -> Expression exprType3 Collator -> Expression exprType1 Bool
+lessThanWithCollator =
+ call3 "<"
+
+
+{-| Returns true if the first input is less than or equal to the second, false otherwise.
+-}
+lessThanOrEqual : Expression exprType1 comparable -> Expression exprType2 comparable -> Expression exprType1 Bool
+lessThanOrEqual =
+ call2 "<="
+
+
+{-| -}
+lessThanOrEqualWithCollator : Expression exprType1 String -> Expression exprType2 String -> Expression exprType3 Collator -> Expression exprType1 Bool
+lessThanOrEqualWithCollator =
+ call3 "<="
+
+
+{-| Returns true if the input values are equal, false otherwise.
+-}
+isEqual : Expression exprType1 a -> Expression exprType2 a -> Expression exprType1 Bool
+isEqual =
+ call2 "=="
+
+
+{-| -}
+isEqualWithCollator : Expression exprType1 String -> Expression exprType2 String -> Expression exprType3 Collator -> Expression exprType1 Bool
+isEqualWithCollator =
+ call3 "=="
+
+
+{-| Returns true if the first input is strictly greater than the second, false otherwise.
+-}
+greaterThan : Expression exprType1 comparable -> Expression exprType2 comparable -> Expression exprType1 Bool
+greaterThan =
+ call2 ">"
+
+
+{-| -}
+greaterThanWithCollator : Expression exprType1 String -> Expression exprType2 String -> Expression exprType3 Collator -> Expression exprType1 Bool
+greaterThanWithCollator =
+ call3 ">"
+
+
+{-| Returns true if the first input is greater than or equal to the second, false otherwise.
+-}
+greaterThanOrEqual : Expression exprType1 comparable -> Expression exprType2 comparable -> Expression exprType1 Bool
+greaterThanOrEqual =
+ call2 ">="
+
+
+{-| -}
+greaterThanOrEqualWithCollator : Expression exprType1 String -> Expression exprType2 String -> Expression exprType3 Collator -> Expression exprType1 Bool
+greaterThanOrEqualWithCollator =
+ call3 ">="
+
+
+{-| 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.
+-}
+all : List (Expression exprType Bool) -> Expression exprType Bool
+all =
+ calln "all"
+
+
+{-| 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.
+-}
+any : List (Expression exprType Bool) -> Expression exprType Bool
+any =
+ calln "any"
+
+
+{-| Evaluates each expression in turn until the first non-null value is obtained, and returns that value.
+-}
+coallesce : List (Expression exprType outputType) -> Expression exprType outputType
+coallesce =
+ calln "coallesce"
+
+
+{-| The ternary operator:
+
+ Layer.iconImage <|
+ ifElse
+ (greaterThan (getProperty (str "size")) (float 30))
+ (str "hospital-32")
+ (str "clinic-32")
+
+-}
+ifElse : Expression exprType1 Bool -> Expression exprType2 output -> Expression exprType3 output -> Expression exprType1 output
+ifElse =
+ call3 "case"
+
+
+{-| Selects the first output whose condition evaluates to `true`
+-}
+conditionally : List ( Expression exprType1 Bool, Expression exprType2 output ) -> Expression exprType2 output -> Expression exprType1 output
+conditionally vals (Expression default) =
+ call "case" (List.concatMap (\( Expression cond, Expression res ) -> [ cond, res ]) vals ++ [ default ])
+
+
+{-| Selects the output whose label value matches the input value, or the fallback value if no match is found.
+
+ getProperty (str "type")
+ |> matchesStr
+ [ ("hospital", str "icon-hospital")
+ , ("clinic", str "icon-medical")
+ ]
+ (str "icon-generic") -- fallback value
+ |> Layer.iconImage
+
+-}
+matchesStr : List ( String, Expression exprType2 output ) -> Expression exprType1 output -> Expression exprType3 String -> Expression exprType3 output
+matchesStr options (Expression default) (Expression input) =
+ let
+ properOptions =
+ List.concatMap (\( label, Expression output ) -> [ Json.Encode.string label, output ]) options
+ in
+ call "match" (input :: properOptions ++ [ default ])
+
+
+{-| Selects the output whose label value matches the input value, or the fallback value if no match is found.
+
+ getProperty (str "size")
+ |> matchesStr
+ [ (1, str "icon-hospital")
+ , (2, str "icon-medical")
+ ]
+ (str "icon-generic") -- fallback value
+ |> Layer.iconImage
+
+-}
+matchesFloat : List ( Float, Expression exprType2 output ) -> Expression exprType1 output -> Expression exprType3 Float -> Expression exprType3 output
+matchesFloat options (Expression default) (Expression input) =
+ let
+ properOptions =
+ List.concatMap (\( label, Expression output ) -> [ Json.Encode.float label, output ]) options
+ in
+ call "match" (input :: properOptions ++ [ default ])
+
+
+{-| Interpolation types:
+
+ - `Linear`: interpolates linearly between the pair of stops just less than and just greater than the input.
+ - `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.
+ - `CubicBezier (x1, y1) (x2, y2)`: interpolates using the cubic bezier curve defined by the given control points.
+
+-}
+type Interpolation
+ = Linear
+ | Exponential Float
+ | CubicBezier ( Float, Float ) ( Float, Float )
+
+
+encodeInterpolation interpolation =
+ case interpolation of
+ Linear ->
+ call0 "linear"
+
+ Exponential base ->
+ call "exponential" [ Json.Encode.float base ]
+
+ CubicBezier ( x1, y1 ) ( x2, y2 ) ->
+ call "cubic-bezier" [ Json.Encode.float x1, Json.Encode.float y1, Json.Encode.float x2, Json.Encode.float y2 ]
+
+
+{-| Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The output type must be `Float`, `Array Float`, or `Color`.
+
+ zoom
+ |> interpolate Linear
+ [ ( 5, int 1 )
+ , ( 10, int 5 )
+ ]
+ |> Layer.circleRadius
+
+-}
+interpolate : Interpolation -> List ( Float, Expression exprType2 outputType ) -> Expression exprType1 Float -> Expression exprType1 outputType
+interpolate interpolation stops (Expression input) =
+ call "interpolate" <| (encodeInterpolation interpolation |> encode) :: input :: List.concatMap (\( stop, Expression res ) -> [ Json.Encode.float stop, res ]) stops
+
+
+{-| Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). Stop inputs must be Floats in strictly ascending order. Returns the output value of the stop just less than the input, or the first input if the input is less than the first stop.
+
+ zoom
+ |> step (int 1)
+ [ ( 5, int 3 )
+ , ( 10, int 5 )
+ ]
+ |> Layer.circleRadius
+
+-}
+step : Expression exprType2 Float -> List ( Float, Expression exprType1 output ) -> Expression exprType1 output -> Expression exprType2 output
+step (Expression default) stops (Expression input) =
+ call "step" <| input :: default :: List.concatMap (\( stop, Expression res ) -> [ Json.Encode.float stop, res ]) stops
+
+
+{-| Returns a string consisting of the concatenation of the inputs.
+
+Argument order designed for pipelines:
+
+ a |> append b --> a ++ b
+
+-}
+append : Expression exprType String -> Expression exprType String -> Expression exprType String
+append a b =
+ call2 "concat" b a
+
+
+{-| 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.
+-}
+downcase : Expression exprType String -> Expression exprType String
+downcase =
+ call1 "downcase"
+
+
+{-| 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).
+-}
+isSupportedScript : Expression exprType String -> Expression exprType Bool
+isSupportedScript =
+ call1 "is-supported-script"
+
+
+{-| 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.
+-}
+resolvedLocale : Expression exprType Collator -> Expression exprType String
+resolvedLocale =
+ call1 "resolved-locale"
+
+
+{-| 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.
+-}
+upcase : Expression exprType String -> Expression exprType String
+upcase =
+ call1 "upcase"
+
+
+{-| 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.
+-}
+makeRGBColor : Expression exprType Float -> Expression exprType Float -> Expression exprType Float -> Expression exprType Color
+makeRGBColor =
+ call3 "rgb"
+
+
+{-| 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.
+-}
+makeRGBAColor : Expression exprType Float -> Expression exprType Float -> Expression exprType Float -> Expression exprType Float -> Expression exprType Color
+makeRGBAColor =
+ call4 "rgba"
+
+
+{-| Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.
+-}
+rgbaChannels : Expression exprType Color -> Expression exprType (Array Float)
+rgbaChannels =
+ call1 "to-rgba"
+
+
+
+-- Math
+
+
+{-| Returns the result of subtracting the first input from the second.
+
+ a |> minus b --> a - b
+
+-}
+minus : Expression exprType Float -> Expression exprType Float -> Expression exprType Float
+minus a b =
+ call2 "-" b a
+
+
+{-| Returns the product of the inputs.
+-}
+multiply : Expression exprType Float -> Expression exprType Float -> Expression exprType Float
+multiply =
+ call2 "*"
+
+
+{-| Returns the result of floating point division of the second input by the first.
+
+ a |> divideBy b --> a / b
+
+-}
+divideBy : Expression exprType Float -> Expression exprType Float -> Expression exprType Float
+divideBy a b =
+ call2 "/" b a
+
+
+{-| Returns the remainder after integer division of the second input by the first.
+
+ a |> modBy b --> a % b
+
+-}
+modBy : Expression exprType Float -> Expression exprType Float -> Expression exprType Float
+modBy a b =
+ call2 "%" b a
+
+
+{-| Returns the result of raising the second input to the power specified by the first.
+
+ a |> raiseBy b --> a ^ b
+
+-}
+raiseBy : Expression exprType Float -> Expression exprType Float -> Expression exprType Float
+raiseBy a b =
+ call2 "^" b a
+
+
+{-| Returns the sum of the inputs.
+-}
+plus : Expression exprType Float -> Expression exprType Float -> Expression exprType Float
+plus =
+ call2 "+"
+
+
+{-| Returns the absolute value of the input.
+-}
+abs : Expression exprType Float -> Expression exprType Float
+abs =
+ call1 "abs"
+
+
+{-| Returns the arccosine of the input.
+-}
+acos : Expression exprType Float -> Expression exprType Float
+acos =
+ call1 "acos"
+
+
+{-| Returns the arcsine of the input.
+-}
+asin : Expression exprType Float -> Expression exprType Float
+asin =
+ call1 "asin"
+
+
+{-| Returns the arctangent of the input.
+-}
+atan : Expression exprType Float -> Expression exprType Float
+atan =
+ call1 "atan"
+
+
+{-| Returns the smallest integer that is greater than or equal to the input.
+-}
+ceil : Expression exprType Float -> Expression exprType Float
+ceil =
+ call1 "ceil"
+
+
+{-| Returns the cosine of the input.
+-}
+cos : Expression exprType Float -> Expression exprType Float
+cos =
+ call1 "cos"
+
+
+{-| Returns the mathematical constant e.
+-}
+e : Expression exprType Float
+e =
+ call0 "e"
+
+
+{-| Returns the largest integer that is less than or equal to the input.
+-}
+floor : Expression exprType Float -> Expression exprType Float
+floor =
+ call1 "floor"
+
+
+{-| Returns the natural logarithm of the input.
+-}
+ln : Expression exprType Float -> Expression exprType Float
+ln =
+ call1 "ln"
+
+
+{-| Returns mathematical constant ln(2).
+-}
+ln2 : Expression exprType Float
+ln2 =
+ call0 "ln2"
+
+
+{-| Returns the base-ten logarithm of the input.
+-}
+log10 : Expression exprType Float -> Expression exprType Float
+log10 =
+ call1 "log10"
+
+
+{-| Returns the base-two logarithm of the input.
+-}
+log2 : Expression exprType Float -> Expression exprType Float
+log2 =
+ call1 "log2"
+
+
+{-| Returns the maximum value of the inputs.
+-}
+max : Expression exprType Float -> Expression exprType Float -> Expression exprType Float
+max =
+ call2 "max"
+
+
+{-| Returns the minimum value of the inputs.
+-}
+min : Expression exprType Float -> Expression exprType Float -> Expression exprType Float
+min =
+ call2 "min"
+
+
+{-| -}
+pi : Expression exprType Float
+pi =
+ call0 "pi"
+
+
+{-| Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `round (float -1.5)` evaluates to -2.
+-}
+round : Expression exprType Float -> Expression exprType Float
+round =
+ call1 "round"
+
+
+{-| Returns the sine of the input.
+-}
+sin : Expression exprType Float -> Expression exprType Float
+sin =
+ call1 "sin"
+
+
+{-| Returns the square root of the input.
+-}
+sqrt : Expression exprType Float -> Expression exprType Float
+sqrt =
+ call1 "sqrt"
+
+
+{-| Returns the tangent of the input.
+-}
+tan : Expression exprType Float -> Expression exprType Float
+tan =
+ call1 "tan"
+
+
+
+-- Zoom
+
+
+{-| 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.
+-}
+zoom : Expression CameraExpression Float
+zoom =
+ call0 "zoom"
+
+
+{-| 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 `heatmapColor` property.
+-}
+heatmapDensity : Expression exprType Float
+heatmapDensity =
+ call0 "heatmap-density"
+
+
+{-| Gets the progress along a gradient line. Can only be used in the `lineGradient` property.
+-}
+lineProgress : Expression exprType Float
+lineProgress =
+ call0 "line-progress"
diff --git a/src/Mapbox/Helpers.elm b/src/Mapbox/Helpers.elm
new file mode 100644
index 0000000..f2072aa
--- /dev/null
+++ b/src/Mapbox/Helpers.elm
@@ -0,0 +1,14 @@
+module Mapbox.Helpers exposing (..)
+
+import Json.Encode as Encode exposing (Value)
+import Mapbox.Expression exposing (Anchor(..))
+
+
+encodeAnchor : Anchor -> Value
+encodeAnchor v =
+ case v of
+ Viewport ->
+ Encode.string "viewport"
+
+ Map ->
+ Encode.string "map"
diff --git a/src/Mapbox/Layer.elm b/src/Mapbox/Layer.elm
new file mode 100644
index 0000000..8d97965
--- /dev/null
+++ b/src/Mapbox/Layer.elm
@@ -0,0 +1,1399 @@
+module Mapbox.Layer
+ exposing
+ ( Layer
+ , SourceId
+ , Background
+ , Fill
+ , Symbol
+ , Line
+ , Raster
+ , Circle
+ , FillExtrusion
+ , Heatmap
+ , Hillshade
+ , LayerAttr
+ , encode
+ , background
+ , fill
+ , symbol
+ , line
+ , raster
+ , circle
+ , fillExtrusion
+ , heatmap
+ , hillshade
+ , metadata
+ , sourceLayer
+ , minzoom
+ , maxzoom
+ , filter
+ , visible
+ , fillAntialias
+ , fillColor
+ , fillOpacity
+ , fillOutlineColor
+ , fillPattern
+ , fillTranslate
+ , fillTranslateAnchor
+ , lineBlur
+ , lineCap
+ , lineColor
+ , lineDasharray
+ , lineGapWidth
+ , lineGradient
+ , lineJoin
+ , lineMiterLimit
+ , lineOffset
+ , lineOpacity
+ , linePattern
+ , lineRoundLimit
+ , lineTranslate
+ , lineTranslateAnchor
+ , lineWidth
+ , circleBlur
+ , circleColor
+ , circleOpacity
+ , circlePitchAlignment
+ , circlePitchScale
+ , circleRadius
+ , circleStrokeColor
+ , circleStrokeOpacity
+ , circleStrokeWidth
+ , circleTranslate
+ , circleTranslateAnchor
+ , heatmapColor
+ , heatmapIntensity
+ , heatmapOpacity
+ , heatmapRadius
+ , heatmapWeight
+ , fillExtrusionBase
+ , fillExtrusionColor
+ , fillExtrusionHeight
+ , fillExtrusionOpacity
+ , fillExtrusionPattern
+ , fillExtrusionTranslate
+ , fillExtrusionTranslateAnchor
+ , iconAllowOverlap
+ , iconAnchor
+ , iconColor
+ , iconHaloBlur
+ , iconHaloColor
+ , iconHaloWidth
+ , iconIgnorePlacement
+ , iconImage
+ , iconKeepUpright
+ , iconOffset
+ , iconOpacity
+ , iconOptional
+ , iconPadding
+ , iconPitchAlignment
+ , iconRotate
+ , iconRotationAlignment
+ , iconSize
+ , iconTextFit
+ , iconTextFitPadding
+ , iconTranslate
+ , iconTranslateAnchor
+ , symbolAvoidEdges
+ , symbolPlacement
+ , symbolSpacing
+ , textAllowOverlap
+ , textAnchor
+ , textColor
+ , textField
+ , textFont
+ , textHaloBlur
+ , textHaloColor
+ , textHaloWidth
+ , textIgnorePlacement
+ , textJustify
+ , textKeepUpright
+ , textLetterSpacing
+ , textLineHeight
+ , textMaxAngle
+ , textMaxWidth
+ , textOffset
+ , textOpacity
+ , textOptional
+ , textPadding
+ , textPitchAlignment
+ , textRotate
+ , textRotationAlignment
+ , textSize
+ , textTransform
+ , textTranslate
+ , textTranslateAnchor
+ , rasterBrightnessMax
+ , rasterBrightnessMin
+ , rasterContrast
+ , rasterFadeDuration
+ , rasterHueRotate
+ , rasterOpacity
+ , rasterSaturation
+ , hillshadeAccentColor
+ , hillshadeExaggeration
+ , hillshadeHighlightColor
+ , hillshadeIlluminationAnchor
+ , hillshadeIlluminationDirection
+ , hillshadeShadowColor
+ , backgroundColor
+ , backgroundOpacity
+ , backgroundPattern
+ )
+
+{-| Layers specify what is actually rendered on the map and are rendered in order.
+
+Except for layers of the background type, each layer needs to refer to a source. Layers take the data that they get from a source, optionally filter features, and then define how those features are styled.
+
+There are two kinds of properties: *Layout* and *Paint* properties.
+
+Layout properties are applied early in the rendering process and define how data for that layer is passed to the GPU. Changes to a layout property require an asynchronous "layout" step.
+
+Paint properties are applied later in the rendering process. Changes to a paint property are cheap and happen synchronously.
+
+
+### Working with layers
+
+@docs Layer, SourceId, encode
+
+
+### Layer Types
+
+@docs background, fill, symbol, line, raster, circle, fillExtrusion, heatmap, hillshade
+@docs Background, Fill, Symbol, Line, Raster, Circle, FillExtrusion, Heatmap, Hillshade
+
+
+### General Attributes
+
+@docs LayerAttr
+@docs metadata, sourceLayer, minzoom, maxzoom, filter, visible
+
+
+### Fill Attributes
+
+@docs fillAntialias, fillColor, fillOpacity, fillOutlineColor, fillPattern, fillTranslate, fillTranslateAnchor
+
+
+### Line Attributes
+
+@docs lineBlur, lineCap, lineColor, lineDasharray, lineGapWidth, lineGradient, lineJoin, lineMiterLimit, lineOffset, lineOpacity, linePattern, lineRoundLimit, lineTranslate, lineTranslateAnchor, lineWidth
+
+
+### Circle Attributes
+
+@docs circleBlur, circleColor, circleOpacity, circlePitchAlignment, circlePitchScale, circleRadius, circleStrokeColor, circleStrokeOpacity, circleStrokeWidth, circleTranslate, circleTranslateAnchor
+
+
+### Heatmap Attributes
+
+@docs heatmapColor, heatmapIntensity, heatmapOpacity, heatmapRadius, heatmapWeight
+
+
+### FillExtrusion Attributes
+
+@docs fillExtrusionBase, fillExtrusionColor, fillExtrusionHeight, fillExtrusionOpacity, fillExtrusionPattern, fillExtrusionTranslate, fillExtrusionTranslateAnchor
+
+
+### Symbol Attributes
+
+@docs iconAllowOverlap, iconAnchor, iconColor, iconHaloBlur, iconHaloColor, iconHaloWidth, iconIgnorePlacement, iconImage, iconKeepUpright, iconOffset, iconOpacity, iconOptional, iconPadding, iconPitchAlignment, iconRotate, iconRotationAlignment, iconSize, iconTextFit, iconTextFitPadding, iconTranslate, iconTranslateAnchor, symbolAvoidEdges, symbolPlacement, symbolSpacing, textAllowOverlap, textAnchor, textColor, textField, textFont, textHaloBlur, textHaloColor, textHaloWidth, textIgnorePlacement, textJustify, textKeepUpright, textLetterSpacing, textLineHeight, textMaxAngle, textMaxWidth, textOffset, textOpacity, textOptional, textPadding, textPitchAlignment, textRotate, textRotationAlignment, textSize, textTransform, textTranslate, textTranslateAnchor
+
+
+### Raster Attributes
+
+@docs rasterBrightnessMax, rasterBrightnessMin, rasterContrast, rasterFadeDuration, rasterHueRotate, rasterOpacity, rasterSaturation
+
+
+### Hillshade Attributes
+
+@docs hillshadeAccentColor, hillshadeExaggeration, hillshadeHighlightColor, hillshadeIlluminationAnchor, hillshadeIlluminationDirection, hillshadeShadowColor
+
+
+### Background Attributes
+
+@docs backgroundColor, backgroundOpacity, backgroundPattern
+
+-}
+
+import Array exposing (Array)
+import Json.Decode
+import Json.Encode as Encode exposing (Value)
+import Mapbox.Expression as Expression exposing (Anchor, AnchorAuto, CameraExpression, Color, DataExpression, Expression, LineCap, LineJoin, Position, SymbolPlacement, TextFit, TextJustify, TextTransform)
+
+
+{-| Represents a layer.
+-}
+type Layer
+ = Layer Value
+
+
+{-| All layers (except background layers) need a source
+-}
+type alias SourceId =
+ String
+
+
+{-| -}
+type Background
+ = BackgroundLayer
+
+
+{-| -}
+type Fill
+ = FillLayer
+
+
+{-| -}
+type Symbol
+ = SymbolLayer
+
+
+{-| -}
+type Line
+ = LineLayer
+
+
+{-| -}
+type Raster
+ = RasterLayer
+
+
+{-| -}
+type Circle
+ = CircleLayer
+
+
+{-| -}
+type FillExtrusion
+ = FillExtrusionLayer
+
+
+{-| -}
+type Heatmap
+ = HeatmapLayer
+
+
+{-| -}
+type Hillshade
+ = HillshadeLayer
+
+
+{-| Turns a layer into JSON
+-}
+encode : Layer -> Value
+encode (Layer value) =
+ value
+
+
+layerImpl tipe source id attrs =
+ [ ( "type", Encode.string tipe )
+ , ( "id", Encode.string id )
+ , ( "source", Encode.string source )
+ ]
+ ++ encodeAttrs attrs
+ |> Encode.object
+ |> Layer
+
+
+encodeAttrs attrs =
+ let
+ { top, layout, paint } =
+ List.foldl
+ (\attr ({ top, layout, paint } as lists) ->
+ case attr of
+ Top key val ->
+ { lists | top = ( key, val ) :: top }
+
+ Paint key val ->
+ { lists | paint = ( key, val ) :: paint }
+
+ Layout key val ->
+ { lists | layout = ( key, val ) :: layout }
+ )
+ { top = [], layout = [], paint = [] }
+ attrs
+ in
+ ( "layout", Encode.object layout ) :: ( "paint", Encode.object paint ) :: top
+
+
+{-| The background color or pattern of the map.
+-}
+background : String -> List (LayerAttr Background) -> Layer
+background id attrs =
+ [ ( "type", Encode.string "background" )
+ , ( "id", Encode.string id )
+ ]
+ ++ encodeAttrs attrs
+ |> Encode.object
+ |> Layer
+
+
+{-| A filled polygon with an optional stroked border.
+-}
+fill : String -> SourceId -> List (LayerAttr Fill) -> Layer
+fill =
+ layerImpl "fill"
+
+
+{-| A stroked line.
+-}
+line : String -> SourceId -> List (LayerAttr Line) -> Layer
+line =
+ layerImpl "line"
+
+
+{-| An icon or a text label.
+-}
+symbol : String -> SourceId -> List (LayerAttr Symbol) -> Layer
+symbol =
+ layerImpl "symbol"
+
+
+{-| Raster map textures such as satellite imagery.
+-}
+raster : String -> SourceId -> List (LayerAttr Raster) -> Layer
+raster =
+ layerImpl "raster"
+
+
+{-| A filled circle.
+-}
+circle : String -> SourceId -> List (LayerAttr Circle) -> Layer
+circle =
+ layerImpl "circle"
+
+
+{-| An extruded (3D) polygon.
+-}
+fillExtrusion : String -> SourceId -> List (LayerAttr FillExtrusion) -> Layer
+fillExtrusion =
+ layerImpl "fill-extrusion"
+
+
+{-| A heatmap.
+-}
+heatmap : String -> SourceId -> List (LayerAttr Heatmap) -> Layer
+heatmap =
+ layerImpl "heatmap"
+
+
+{-| Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.
+-}
+hillshade : String -> SourceId -> List (LayerAttr Hillshade) -> Layer
+hillshade =
+ layerImpl "hillshade"
+
+
+{-| -}
+type LayerAttr tipe
+ = Top String Value
+ | Paint String Value
+ | Layout String Value
+
+
+
+-- General Attributes
+
+
+{-| Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'.
+-}
+metadata : Value -> LayerAttr all
+metadata =
+ Top "metadata"
+
+
+{-| Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources.
+-}
+sourceLayer : String -> LayerAttr all
+sourceLayer =
+ Encode.string >> Top "source-layer"
+
+
+{-| The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden. A number between 0 and 24 inclusive.
+-}
+minzoom : Float -> LayerAttr all
+minzoom =
+ Encode.float >> Top "minzoom"
+
+
+{-| The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden. A number between 0 and 24 inclusive.
+-}
+maxzoom : Float -> LayerAttr all
+maxzoom =
+ Encode.float >> Top "maxzoom"
+
+
+{-| A expression specifying conditions on source features. Only features that match the filter are displayed.
+-}
+filter : Expression any Bool -> LayerAttr all
+filter =
+ Expression.encode >> Top "filter"
+
+
+{-| Whether this layer is displayed.
+-}
+visible : Expression CameraExpression Bool -> LayerAttr any
+visible vis =
+ Layout "visibility" <| Expression.encode <| Expression.ifElse vis (Expression.str "visible") (Expression.str "none")
+
+
+
+-- Fill
+
+
+{-| Controls the frame of reference for `fillTranslate`. Paint property. Defaults to `map`. Requires `fillTranslate`.
+-}
+fillTranslateAnchor : Expression CameraExpression Anchor -> LayerAttr Fill
+fillTranslateAnchor =
+ Expression.encode >> Paint "fill-translate-anchor"
+
+
+{-| 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. Paint property.
+-}
+fillPattern : Expression CameraExpression String -> LayerAttr Fill
+fillPattern =
+ Expression.encode >> Paint "fill-pattern"
+
+
+{-| 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. Paint property. Defaults to `#000000`. Disabled by `fillPattern`.
+-}
+fillColor : Expression any Color -> LayerAttr Fill
+fillColor =
+ Expression.encode >> Paint "fill-color"
+
+
+{-| The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. Paint property.
+Units in pixels. Defaults to `0,0`.
+-}
+fillTranslate : Expression CameraExpression (Array Float) -> LayerAttr Fill
+fillTranslate =
+ Expression.encode >> Paint "fill-translate"
+
+
+{-| The opacity of the entire fill layer. In contrast to the `fillColor`, this value will also affect the 1px stroke around the fill, if the stroke is used. Paint property.
+
+Should be between `0` and `1` inclusive. Defaults to `1`.
+
+-}
+fillOpacity : Expression any Float -> LayerAttr Fill
+fillOpacity =
+ Expression.encode >> Paint "fill-opacity"
+
+
+{-| The outline color of the fill. Matches the value of `fillColor` if unspecified. Paint property. Disabled by `fillPattern`. Requires `fillAntialias` to be `true`.
+-}
+fillOutlineColor : Expression any Color -> LayerAttr Fill
+fillOutlineColor =
+ Expression.encode >> Paint "fill-outline-color"
+
+
+{-| Whether or not the fill should be antialiased. Paint property. Defaults to `true`.
+-}
+fillAntialias : Expression CameraExpression Bool -> LayerAttr Fill
+fillAntialias =
+ Expression.encode >> Paint "fill-antialias"
+
+
+
+-- Line
+
+
+{-| Blur applied to the line, in pixels. Paint property.
+
+Should be greater than or equal to `0`.
+Units in pixels. Defaults to `0`.
+
+-}
+lineBlur : Expression any Float -> LayerAttr Line
+lineBlur =
+ Expression.encode >> Paint "line-blur"
+
+
+{-| Controls the frame of reference for `lineTranslate`. Paint property. Defaults to `map`. Requires `lineTranslate`.
+-}
+lineTranslateAnchor : Expression CameraExpression Anchor -> LayerAttr Line
+lineTranslateAnchor =
+ Expression.encode >> Paint "line-translate-anchor"
+
+
+{-| Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`. Paint property. Disabled by `lineDasharray`. Disabled by `linePattern`. Requires `source` to be `geojson`.
+-}
+lineGradient : Expression CameraExpression Color -> LayerAttr Line
+lineGradient =
+ Expression.encode >> Paint "line-gradient"
+
+
+{-| Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap. Paint property.
+
+Should be greater than or equal to `0`.
+Units in pixels. Defaults to `0`.
+
+-}
+lineGapWidth : Expression any Float -> LayerAttr Line
+lineGapWidth =
+ Expression.encode >> Paint "line-gap-width"
+
+
+{-| 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. Paint property.
+-}
+linePattern : Expression CameraExpression String -> LayerAttr Line
+linePattern =
+ Expression.encode >> Paint "line-pattern"
+
+
+{-| 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. Paint property.
+
+Should be greater than or equal to `0`.
+Units in line widths. Disabled by `linePattern`.
+
+-}
+lineDasharray : Expression CameraExpression (Array Float) -> LayerAttr Line
+lineDasharray =
+ Expression.encode >> Paint "line-dasharray"
+
+
+{-| Stroke thickness. Paint property.
+
+Should be greater than or equal to `0`.
+Units in pixels. Defaults to `1`.
+
+-}
+lineWidth : Expression any Float -> LayerAttr Line
+lineWidth =
+ Expression.encode >> Paint "line-width"
+
+
+{-| The color with which the line will be drawn. Paint property. Defaults to `#000000`. Disabled by `linePattern`.
+-}
+lineColor : Expression any Color -> LayerAttr Line
+lineColor =
+ Expression.encode >> Paint "line-color"
+
+
+{-| The display of line endings. Layout property. Defaults to `butt`.
+-}
+lineCap : Expression CameraExpression LineCap -> LayerAttr Line
+lineCap =
+ Expression.encode >> Layout "line-cap"
+
+
+{-| The display of lines when joining. Layout property. Defaults to `miter`.
+-}
+lineJoin : Expression any LineJoin -> LayerAttr Line
+lineJoin =
+ Expression.encode >> Layout "line-join"
+
+
+{-| The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. Paint property.
+Units in pixels. Defaults to `0,0`.
+-}
+lineTranslate : Expression CameraExpression (Array Float) -> LayerAttr Line
+lineTranslate =
+ Expression.encode >> Paint "line-translate"
+
+
+{-| 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. Paint property.
+Units in pixels. Defaults to `0`.
+-}
+lineOffset : Expression any Float -> LayerAttr Line
+lineOffset =
+ Expression.encode >> Paint "line-offset"
+
+
+{-| The opacity at which the line will be drawn. Paint property.
+
+Should be between `0` and `1` inclusive. Defaults to `1`.
+
+-}
+lineOpacity : Expression any Float -> LayerAttr Line
+lineOpacity =
+ Expression.encode >> Paint "line-opacity"
+
+
+{-| Used to automatically convert miter joins to bevel joins for sharp angles. Layout property. Defaults to `2`. Requires `lineJoin` to be `miter`.
+-}
+lineMiterLimit : Expression CameraExpression Float -> LayerAttr Line
+lineMiterLimit =
+ Expression.encode >> Layout "line-miter-limit"
+
+
+{-| Used to automatically convert round joins to miter joins for shallow angles. Layout property. Defaults to `1.05`. Requires `lineJoin` to be `round`.
+-}
+lineRoundLimit : Expression CameraExpression Float -> LayerAttr Line
+lineRoundLimit =
+ Expression.encode >> Layout "line-round-limit"
+
+
+
+-- Circle
+
+
+{-| Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity. Paint property. Defaults to `0`.
+-}
+circleBlur : Expression any Float -> LayerAttr Circle
+circleBlur =
+ Expression.encode >> Paint "circle-blur"
+
+
+{-| Circle radius. Paint property.
+
+Should be greater than or equal to `0`.
+Units in pixels. Defaults to `5`.
+
+-}
+circleRadius : Expression any Float -> LayerAttr Circle
+circleRadius =
+ Expression.encode >> Paint "circle-radius"
+
+
+{-| Controls the frame of reference for `circleTranslate`. Paint property. Defaults to `map`. Requires `circleTranslate`.
+-}
+circleTranslateAnchor : Expression CameraExpression Anchor -> LayerAttr Circle
+circleTranslateAnchor =
+ Expression.encode >> Paint "circle-translate-anchor"
+
+
+{-| Controls the scaling behavior of the circle when the map is pitched. Paint property. Defaults to `map`.
+-}
+circlePitchScale : Expression CameraExpression Anchor -> LayerAttr Circle
+circlePitchScale =
+ Expression.encode >> Paint "circle-pitch-scale"
+
+
+{-| Orientation of circle when map is pitched. Paint property. Defaults to `viewport`.
+-}
+circlePitchAlignment : Expression CameraExpression Anchor -> LayerAttr Circle
+circlePitchAlignment =
+ Expression.encode >> Paint "circle-pitch-alignment"
+
+
+{-| The fill color of the circle. Paint property. Defaults to `#000000`.
+-}
+circleColor : Expression any Color -> LayerAttr Circle
+circleColor =
+ Expression.encode >> Paint "circle-color"
+
+
+{-| The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively. Paint property.
+Units in pixels. Defaults to `0,0`.
+-}
+circleTranslate : Expression CameraExpression (Array Float) -> LayerAttr Circle
+circleTranslate =
+ Expression.encode >> Paint "circle-translate"
+
+
+{-| The opacity at which the circle will be drawn. Paint property.
+
+Should be between `0` and `1` inclusive. Defaults to `1`.
+
+-}
+circleOpacity : Expression any Float -> LayerAttr Circle
+circleOpacity =
+ Expression.encode >> Paint "circle-opacity"
+
+
+{-| The opacity of the circle's stroke. Paint property.
+
+Should be between `0` and `1` inclusive. Defaults to `1`.
+
+-}
+circleStrokeOpacity : Expression any Float -> LayerAttr Circle
+circleStrokeOpacity =
+ Expression.encode >> Paint "circle-stroke-opacity"
+
+
+{-| The stroke color of the circle. Paint property. Defaults to `#000000`.
+-}
+circleStrokeColor : Expression any Color -> LayerAttr Circle
+circleStrokeColor =
+ Expression.encode >> Paint "circle-stroke-color"
+
+
+{-| The width of the circle's stroke. Strokes are placed outside of the `circleRadius`. Paint property.
+
+Should be greater than or equal to `0`.
+Units in pixels. Defaults to `0`.
+
+-}
+circleStrokeWidth : Expression any Float -> LayerAttr Circle
+circleStrokeWidth =
+ Expression.encode >> Paint "circle-stroke-width"
+
+
+
+-- Heatmap
+
+
+{-| 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. Paint property.
+
+Should be greater than or equal to `0`. Defaults to `1`.
+
+-}
+heatmapWeight : Expression any Float -> LayerAttr Heatmap
+heatmapWeight =
+ Expression.encode >> Paint "heatmap-weight"
+
+
+{-| Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input. Paint property. Defaults to `interpolate,linear,heatmap-density,0,rgba(0, 0, 255, 0),0.1,royalblue,0.3,cyan,0.5,lime,0.7,yellow,1,red`.
+-}
+heatmapColor : Expression CameraExpression Color -> LayerAttr Heatmap
+heatmapColor =
+ Expression.encode >> Paint "heatmap-color"
+
+
+{-| Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed. Paint property.
+
+Should be greater than or equal to `1`.
+Units in pixels. Defaults to `30`.
+
+-}
+heatmapRadius : Expression any Float -> LayerAttr Heatmap
+heatmapRadius =
+ Expression.encode >> Paint "heatmap-radius"
+
+
+{-| Similar to `heatmapWeight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level. Paint property.
+
+Should be greater than or equal to `0`. Defaults to `1`.
+
+-}
+heatmapIntensity : Expression CameraExpression Float -> LayerAttr Heatmap
+heatmapIntensity =
+ Expression.encode >> Paint "heatmap-intensity"
+
+
+{-| The global opacity at which the heatmap layer will be drawn. Paint property.
+
+Should be between `0` and `1` inclusive. Defaults to `1`.
+
+-}
+heatmapOpacity : Expression CameraExpression Float -> LayerAttr Heatmap
+heatmapOpacity =
+ Expression.encode >> Paint "heatmap-opacity"
+
+
+
+-- FillExtrusion
+
+
+{-| Controls the frame of reference for `fillExtrusionTranslate`. Paint property. Defaults to `map`. Requires `fillExtrusionTranslate`.
+-}
+fillExtrusionTranslateAnchor : Expression CameraExpression Anchor -> LayerAttr FillExtrusion
+fillExtrusionTranslateAnchor =
+ Expression.encode >> Paint "fill-extrusion-translate-anchor"
+
+
+{-| 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. Paint property.
+-}
+fillExtrusionPattern : Expression CameraExpression String -> LayerAttr FillExtrusion
+fillExtrusionPattern =
+ Expression.encode >> Paint "fill-extrusion-pattern"
+
+
+{-| 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 `fillExtrusionOpacity` to set layer opacity. Paint property. Defaults to `#000000`. Disabled by `fillExtrusionPattern`.
+-}
+fillExtrusionColor : Expression any Color -> LayerAttr FillExtrusion
+fillExtrusionColor =
+ Expression.encode >> Paint "fill-extrusion-color"
+
+
+{-| The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively. Paint property.
+Units in pixels. Defaults to `0,0`.
+-}
+fillExtrusionTranslate : Expression CameraExpression (Array Float) -> LayerAttr FillExtrusion
+fillExtrusionTranslate =
+ Expression.encode >> Paint "fill-extrusion-translate"
+
+
+{-| The height with which to extrude the base of this layer. Must be less than or equal to `fillExtrusionHeight`. Paint property.
+
+Should be greater than or equal to `0`.
+Units in meters. Defaults to `0`. Requires `fillExtrusionHeight`.
+
+-}
+fillExtrusionBase : Expression any Float -> LayerAttr FillExtrusion
+fillExtrusionBase =
+ Expression.encode >> Paint "fill-extrusion-base"
+
+
+{-| The height with which to extrude this layer. Paint property.
+
+Should be greater than or equal to `0`.
+Units in meters. Defaults to `0`.
+
+-}
+fillExtrusionHeight : Expression any Float -> LayerAttr FillExtrusion
+fillExtrusionHeight =
+ Expression.encode >> Paint "fill-extrusion-height"
+
+
+{-| 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. Paint property.
+
+Should be between `0` and `1` inclusive. Defaults to `1`.
+
+-}
+fillExtrusionOpacity : Expression CameraExpression Float -> LayerAttr FillExtrusion
+fillExtrusionOpacity =
+ Expression.encode >> Paint "fill-extrusion-opacity"
+
+
+
+-- Symbol
+
+
+{-| Controls the frame of reference for `iconTranslate`. Paint property. Defaults to `map`. Requires `iconImage`. Requires `iconTranslate`.
+-}
+iconTranslateAnchor : Expression CameraExpression Anchor -> LayerAttr Symbol
+iconTranslateAnchor =
+ Expression.encode >> Paint "icon-translate-anchor"
+
+
+{-| Controls the frame of reference for `textTranslate`. Paint property. Defaults to `map`. Requires `textField`. Requires `textTranslate`.
+-}
+textTranslateAnchor : Expression CameraExpression Anchor -> LayerAttr Symbol
+textTranslateAnchor =
+ Expression.encode >> Paint "text-translate-anchor"
+
+
+{-| Distance between two symbol anchors. Layout property.
+
+Should be greater than or equal to `1`.
+Units in pixels. Defaults to `250`. Requires `symbolPlacement` to be `line`.
+
+-}
+symbolSpacing : Expression CameraExpression Float -> LayerAttr Symbol
+symbolSpacing =
+ Expression.encode >> Layout "symbol-spacing"
+
+
+{-| Distance of halo to the font outline. Max text halo width is 1/4 of the font-size. Paint property.
+
+Should be greater than or equal to `0`.
+Units in pixels. Defaults to `0`. Requires `textField`.
+
+-}
+textHaloWidth : Expression any Float -> LayerAttr Symbol
+textHaloWidth =
+ Expression.encode >> Paint "text-halo-width"
+
+
+{-| Distance of halo to the icon outline. Paint property.
+
+Should be greater than or equal to `0`.
+Units in pixels. Defaults to `0`. Requires `iconImage`.
+
+-}
+iconHaloWidth : Expression any Float -> LayerAttr Symbol
+iconHaloWidth =
+ Expression.encode >> Paint "icon-halo-width"
+
+
+{-| 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. Paint property.
+Units in pixels. Defaults to `0,0`. Requires `iconImage`.
+-}
+iconTranslate : Expression CameraExpression (Array Float) -> LayerAttr Symbol
+iconTranslate =
+ Expression.encode >> Paint "icon-translate"
+
+
+{-| 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. Paint property.
+Units in pixels. Defaults to `0,0`. Requires `textField`.
+-}
+textTranslate : Expression CameraExpression (Array Float) -> LayerAttr Symbol
+textTranslate =
+ Expression.encode >> Paint "text-translate"
+
+
+{-| Fade out the halo towards the outside. Paint property.
+
+Should be greater than or equal to `0`.
+Units in pixels. Defaults to `0`. Requires `iconImage`.
+
+-}
+iconHaloBlur : Expression any Float -> LayerAttr Symbol
+iconHaloBlur =
+ Expression.encode >> Paint "icon-halo-blur"
+
+
+{-| Font size. Layout property.
+
+Should be greater than or equal to `0`.
+Units in pixels. Defaults to `16`. Requires `textField`.
+
+-}
+textSize : Expression any Float -> LayerAttr Symbol
+textSize =
+ Expression.encode >> Layout "text-size"
+
+
+{-| Font stack to use for displaying text. Layout property. Defaults to `Open Sans Regular,Arial Unicode MS Regular`. Requires `textField`.
+-}
+textFont : Expression any (Array String) -> LayerAttr Symbol
+textFont =
+ Expression.encode >> Layout "text-font"
+
+
+{-| If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not. Layout property. Defaults to `false`. Requires `textField`. Requires `iconImage`.
+-}
+textOptional : Expression CameraExpression Bool -> LayerAttr Symbol
+textOptional =
+ Expression.encode >> Layout "text-optional"
+
+
+{-| If true, other symbols can be visible even if they collide with the icon. Layout property. Defaults to `false`. Requires `iconImage`.
+-}
+iconIgnorePlacement : Expression CameraExpression Bool -> LayerAttr Symbol
+iconIgnorePlacement =
+ Expression.encode >> Layout "icon-ignore-placement"
+
+
+{-| If true, other symbols can be visible even if they collide with the text. Layout property. Defaults to `false`. Requires `textField`.
+-}
+textIgnorePlacement : Expression CameraExpression Bool -> LayerAttr Symbol
+textIgnorePlacement =
+ Expression.encode >> Layout "text-ignore-placement"
+
+
+{-| If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not. Layout property. Defaults to `false`. Requires `iconImage`. Requires `textField`.
+-}
+iconOptional : Expression CameraExpression Bool -> LayerAttr Symbol
+iconOptional =
+ Expression.encode >> Layout "icon-optional"
+
+
+{-| If true, the icon may be flipped to prevent it from being rendered upside-down. Layout property. Defaults to `false`. Requires `iconImage`. Requires `iconRotationAlignment` to be `map`. Requires `symbolPlacement` to be `line`.
+-}
+iconKeepUpright : Expression CameraExpression Bool -> LayerAttr Symbol
+iconKeepUpright =
+ Expression.encode >> Layout "icon-keep-upright"
+
+
+{-| If true, the icon will be visible even if it collides with other previously drawn symbols. Layout property. Defaults to `false`. Requires `iconImage`.
+-}
+iconAllowOverlap : Expression CameraExpression Bool -> LayerAttr Symbol
+iconAllowOverlap =
+ Expression.encode >> Layout "icon-allow-overlap"
+
+
+{-| 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. Layout property. Defaults to `false`.
+-}
+symbolAvoidEdges : Expression CameraExpression Bool -> LayerAttr Symbol
+symbolAvoidEdges =
+ Expression.encode >> Layout "symbol-avoid-edges"
+
+
+{-| If true, the text may be flipped vertically to prevent it from being rendered upside-down. Layout property. Defaults to `true`. Requires `textField`. Requires `textRotationAlignment` to be `map`. Requires `symbolPlacement` to be `line`.
+-}
+textKeepUpright : Expression CameraExpression Bool -> LayerAttr Symbol
+textKeepUpright =
+ Expression.encode >> Layout "text-keep-upright"
+
+
+{-| If true, the text will be visible even if it collides with other previously drawn symbols. Layout property. Defaults to `false`. Requires `textField`.
+-}
+textAllowOverlap : Expression CameraExpression Bool -> LayerAttr Symbol
+textAllowOverlap =
+ Expression.encode >> Layout "text-allow-overlap"
+
+
+{-| In combination with `symbolPlacement`, determines the rotation behavior of icons. Layout property. Defaults to `auto`. Requires `iconImage`.
+-}
+iconRotationAlignment : Expression CameraExpression AnchorAuto -> LayerAttr Symbol
+iconRotationAlignment =
+ Expression.encode >> Layout "icon-rotation-alignment"
+
+
+{-| In combination with `symbolPlacement`, determines the rotation behavior of the individual glyphs forming the text. Layout property. Defaults to `auto`. Requires `textField`.
+-}
+textRotationAlignment : Expression CameraExpression AnchorAuto -> LayerAttr Symbol
+textRotationAlignment =
+ Expression.encode >> Layout "text-rotation-alignment"
+
+
+{-| Label placement relative to its geometry. Layout property. Defaults to `point`.
+-}
+symbolPlacement : Expression CameraExpression SymbolPlacement -> LayerAttr Symbol
+symbolPlacement =
+ Expression.encode >> Layout "symbol-placement"
+
+
+{-| Maximum angle change between adjacent characters. Layout property.
+Units in degrees. Defaults to `45`. Requires `textField`. Requires `symbolPlacement` to be `line`.
+-}
+textMaxAngle : Expression CameraExpression Float -> LayerAttr Symbol
+textMaxAngle =
+ Expression.encode >> Layout "text-max-angle"
+
+
+{-| Name of image in sprite to use for drawing an image background. Layout property.
+-}
+iconImage : Expression any String -> LayerAttr Symbol
+iconImage =
+ Expression.encode >> Layout "icon-image"
+
+
+{-| 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 `iconSize` to obtain the final offset in pixels. When combined with `iconRotate` the offset will be as if the rotated direction was up. Layout property. Defaults to `0,0`. Requires `iconImage`.
+-}
+iconOffset : Expression any (Array Float) -> LayerAttr Symbol
+iconOffset =
+ Expression.encode >> Layout "icon-offset"
+
+
+{-| Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. Layout property.
+Units in ems. Defaults to `0,0`. Requires `textField`.
+-}
+textOffset : Expression any (Array Float) -> LayerAttr Symbol
+textOffset =
+ Expression.encode >> Layout "text-offset"
+
+
+{-| Orientation of icon when map is pitched. Layout property. Defaults to `auto`. Requires `iconImage`.
+-}
+iconPitchAlignment : Expression CameraExpression AnchorAuto -> LayerAttr Symbol
+iconPitchAlignment =
+ Expression.encode >> Layout "icon-pitch-alignment"
+
+
+{-| Orientation of text when map is pitched. Layout property. Defaults to `auto`. Requires `textField`.
+-}
+textPitchAlignment : Expression CameraExpression AnchorAuto -> LayerAttr Symbol
+textPitchAlignment =
+ Expression.encode >> Layout "text-pitch-alignment"
+
+
+{-| Part of the icon placed closest to the anchor. Layout property. Defaults to `center`. Requires `iconImage`.
+-}
+iconAnchor : Expression any Position -> LayerAttr Symbol
+iconAnchor =
+ Expression.encode >> Layout "icon-anchor"
+
+
+{-| Part of the text placed closest to the anchor. Layout property. Defaults to `center`. Requires `textField`.
+-}
+textAnchor : Expression any Position -> LayerAttr Symbol
+textAnchor =
+ Expression.encode >> Layout "text-anchor"
+
+
+{-| Rotates the icon clockwise. Layout property.
+Units in degrees. Defaults to `0`. Requires `iconImage`.
+-}
+iconRotate : Expression any Float -> LayerAttr Symbol
+iconRotate =
+ Expression.encode >> Layout "icon-rotate"
+
+
+{-| Rotates the text clockwise. Layout property.
+Units in degrees. Defaults to `0`. Requires `textField`.
+-}
+textRotate : Expression any Float -> LayerAttr Symbol
+textRotate =
+ Expression.encode >> Layout "text-rotate"
+
+
+{-| Scales the icon to fit around the associated text. Layout property. Defaults to `none`. Requires `iconImage`. Requires `textField`.
+-}
+iconTextFit : Expression CameraExpression TextFit -> LayerAttr Symbol
+iconTextFit =
+ Expression.encode >> Layout "icon-text-fit"
+
+
+{-| 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 `iconSize`. 1 is the original size; 3 triples the size of the image. Layout property.
+
+Should be greater than or equal to `0`.
+Units in factor of the original icon size. Defaults to `1`. Requires `iconImage`.
+
+-}
+iconSize : Expression any Float -> LayerAttr Symbol
+iconSize =
+ Expression.encode >> Layout "icon-size"
+
+
+{-| Size of the additional area added to dimensions determined by `iconTextFit`, in clockwise order: top, right, bottom, left. Layout property.
+Units in pixels. Defaults to `0,0,0,0`. Requires `iconImage`. Requires `textField`. Requires `iconTextFit` to be both,, or ,width,, or ,height.
+-}
+iconTextFitPadding : Expression CameraExpression (Array Float) -> LayerAttr Symbol
+iconTextFitPadding =
+ Expression.encode >> Layout "icon-text-fit-padding"
+
+
+{-| Size of the additional area around the icon bounding box used for detecting symbol collisions. Layout property.
+
+Should be greater than or equal to `0`.
+Units in pixels. Defaults to `2`. Requires `iconImage`.
+
+-}
+iconPadding : Expression CameraExpression Float -> LayerAttr Symbol
+iconPadding =
+ Expression.encode >> Layout "icon-padding"
+
+
+{-| Size of the additional area around the text bounding box used for detecting symbol collisions. Layout property.
+
+Should be greater than or equal to `0`.
+Units in pixels. Defaults to `2`. Requires `textField`.
+
+-}
+textPadding : Expression CameraExpression Float -> LayerAttr Symbol
+textPadding =
+ Expression.encode >> Layout "text-padding"
+
+
+{-| Specifies how to capitalize text, similar to the CSS `textTransform` property. Layout property. Defaults to `none`. Requires `textField`.
+-}
+textTransform : Expression any TextTransform -> LayerAttr Symbol
+textTransform =
+ Expression.encode >> Layout "text-transform"
+
+
+{-| Text justification options. Layout property. Defaults to `center`. Requires `textField`.
+-}
+textJustify : Expression any TextJustify -> LayerAttr Symbol
+textJustify =
+ Expression.encode >> Layout "text-justify"
+
+
+{-| Text leading value for multi-line text. Layout property.
+Units in ems. Defaults to `1.2`. Requires `textField`.
+-}
+textLineHeight : Expression CameraExpression Float -> LayerAttr Symbol
+textLineHeight =
+ Expression.encode >> Layout "text-line-height"
+
+
+{-| Text tracking amount. Layout property.
+Units in ems. Defaults to `0`. Requires `textField`.
+-}
+textLetterSpacing : Expression any Float -> LayerAttr Symbol
+textLetterSpacing =
+ Expression.encode >> Layout "text-letter-spacing"
+
+
+{-| The color of the icon's halo. Icon halos can only be used with SDF icons. Paint property. Defaults to `rgba(0, 0, 0, 0)`. Requires `iconImage`.
+-}
+iconHaloColor : Expression any Color -> LayerAttr Symbol
+iconHaloColor =
+ Expression.encode >> Paint "icon-halo-color"
+
+
+{-| The color of the icon. This can only be used with sdf icons. Paint property. Defaults to `#000000`. Requires `iconImage`.
+-}
+iconColor : Expression any Color -> LayerAttr Symbol
+iconColor =
+ Expression.encode >> Paint "icon-color"
+
+
+{-| The color of the text's halo, which helps it stand out from backgrounds. Paint property. Defaults to `rgba(0, 0, 0, 0)`. Requires `textField`.
+-}
+textHaloColor : Expression any Color -> LayerAttr Symbol
+textHaloColor =
+ Expression.encode >> Paint "text-halo-color"
+
+
+{-| The color with which the text will be drawn. Paint property. Defaults to `#000000`. Requires `textField`.
+-}
+textColor : Expression any Color -> LayerAttr Symbol
+textColor =
+ Expression.encode >> Paint "text-color"
+
+
+{-| The halo's fadeout distance towards the outside. Paint property.
+
+Should be greater than or equal to `0`.
+Units in pixels. Defaults to `0`. Requires `textField`.
+
+-}
+textHaloBlur : Expression any Float -> LayerAttr Symbol
+textHaloBlur =
+ Expression.encode >> Paint "text-halo-blur"
+
+
+{-| The maximum line width for text wrapping. Layout property.
+
+Should be greater than or equal to `0`.
+Units in ems. Defaults to `10`. Requires `textField`.
+
+-}
+textMaxWidth : Expression any Float -> LayerAttr Symbol
+textMaxWidth =
+ Expression.encode >> Layout "text-max-width"
+
+
+{-| The opacity at which the icon will be drawn. Paint property.
+
+Should be between `0` and `1` inclusive. Defaults to `1`. Requires `iconImage`.
+
+-}
+iconOpacity : Expression any Float -> LayerAttr Symbol
+iconOpacity =
+ Expression.encode >> Paint "icon-opacity"
+
+
+{-| The opacity at which the text will be drawn. Paint property.
+
+Should be between `0` and `1` inclusive. Defaults to `1`. Requires `textField`.
+
+-}
+textOpacity : Expression any Float -> LayerAttr Symbol
+textOpacity =
+ Expression.encode >> Paint "text-opacity"
+
+
+{-| Value to use for a text label. Layout property. Defaults to ``.
+-}
+textField : Expression any String -> LayerAttr Symbol
+textField =
+ Expression.encode >> Layout "text-field"
+
+
+
+-- Raster
+
+
+{-| Fade duration when a new tile is added. Paint property.
+
+Should be greater than or equal to `0`.
+Units in milliseconds. Defaults to `300`.
+
+-}
+rasterFadeDuration : Expression CameraExpression Float -> LayerAttr Raster
+rasterFadeDuration =
+ Expression.encode >> Paint "raster-fade-duration"
+
+
+{-| Increase or reduce the brightness of the image. The value is the maximum brightness. Paint property.
+
+Should be between `0` and `1` inclusive. Defaults to `1`.
+
+-}
+rasterBrightnessMax : Expression CameraExpression Float -> LayerAttr Raster
+rasterBrightnessMax =
+ Expression.encode >> Paint "raster-brightness-max"
+
+
+{-| Increase or reduce the brightness of the image. The value is the minimum brightness. Paint property.
+
+Should be between `0` and `1` inclusive. Defaults to `0`.
+
+-}
+rasterBrightnessMin : Expression CameraExpression Float -> LayerAttr Raster
+rasterBrightnessMin =
+ Expression.encode >> Paint "raster-brightness-min"
+
+
+{-| Increase or reduce the contrast of the image. Paint property.
+
+Should be between `-1` and `1` inclusive. Defaults to `0`.
+
+-}
+rasterContrast : Expression CameraExpression Float -> LayerAttr Raster
+rasterContrast =
+ Expression.encode >> Paint "raster-contrast"
+
+
+{-| Increase or reduce the saturation of the image. Paint property.
+
+Should be between `-1` and `1` inclusive. Defaults to `0`.
+
+-}
+rasterSaturation : Expression CameraExpression Float -> LayerAttr Raster
+rasterSaturation =
+ Expression.encode >> Paint "raster-saturation"
+
+
+{-| Rotates hues around the color wheel. Paint property.
+Units in degrees. Defaults to `0`.
+-}
+rasterHueRotate : Expression CameraExpression Float -> LayerAttr Raster
+rasterHueRotate =
+ Expression.encode >> Paint "raster-hue-rotate"
+
+
+{-| The opacity at which the image will be drawn. Paint property.
+
+Should be between `0` and `1` inclusive. Defaults to `1`.
+
+-}
+rasterOpacity : Expression CameraExpression Float -> LayerAttr Raster
+rasterOpacity =
+ Expression.encode >> Paint "raster-opacity"
+
+
+
+-- Hillshade
+
+
+{-| Direction of light source when map is rotated. Paint property. Defaults to `viewport`.
+-}
+hillshadeIlluminationAnchor : Expression CameraExpression Anchor -> LayerAttr Hillshade
+hillshadeIlluminationAnchor =
+ Expression.encode >> Paint "hillshade-illumination-anchor"
+
+
+{-| Intensity of the hillshade Paint property.
+
+Should be between `0` and `1` inclusive. Defaults to `0.5`.
+
+-}
+hillshadeExaggeration : Expression CameraExpression Float -> LayerAttr Hillshade
+hillshadeExaggeration =
+ Expression.encode >> Paint "hillshade-exaggeration"
+
+
+{-| The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshadeIlluminationAnchor` is set to `viewport` and due north if `hillshadeIlluminationAnchor` is set to `map`. Paint property.
+
+Should be between `0` and `359` inclusive. Defaults to `335`.
+
+-}
+hillshadeIlluminationDirection : Expression CameraExpression Float -> LayerAttr Hillshade
+hillshadeIlluminationDirection =
+ Expression.encode >> Paint "hillshade-illumination-direction"
+
+
+{-| The shading color of areas that face away from the light source. Paint property. Defaults to `#000000`.
+-}
+hillshadeShadowColor : Expression CameraExpression Color -> LayerAttr Hillshade
+hillshadeShadowColor =
+ Expression.encode >> Paint "hillshade-shadow-color"
+
+
+{-| The shading color of areas that faces towards the light source. Paint property. Defaults to `#FFFFFF`.
+-}
+hillshadeHighlightColor : Expression CameraExpression Color -> LayerAttr Hillshade
+hillshadeHighlightColor =
+ Expression.encode >> Paint "hillshade-highlight-color"
+
+
+{-| The shading color used to accentuate rugged terrain like sharp cliffs and gorges. Paint property. Defaults to `#000000`.
+-}
+hillshadeAccentColor : Expression CameraExpression Color -> LayerAttr Hillshade
+hillshadeAccentColor =
+ Expression.encode >> Paint "hillshade-accent-color"
+
+
+
+-- Background
+
+
+{-| 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. Paint property.
+-}
+backgroundPattern : Expression CameraExpression String -> LayerAttr Background
+backgroundPattern =
+ Expression.encode >> Paint "background-pattern"
+
+
+{-| The color with which the background will be drawn. Paint property. Defaults to `#000000`. Disabled by `backgroundPattern`.
+-}
+backgroundColor : Expression CameraExpression Color -> LayerAttr Background
+backgroundColor =
+ Expression.encode >> Paint "background-color"
+
+
+{-| The opacity at which the background will be drawn. Paint property.
+
+Should be between `0` and `1` inclusive. Defaults to `1`.
+
+-}
+backgroundOpacity : Expression CameraExpression Float -> LayerAttr Background
+backgroundOpacity =
+ Expression.encode >> Paint "background-opacity"
diff --git a/src/Mapbox/Source.elm b/src/Mapbox/Source.elm
new file mode 100644
index 0000000..a927621
--- /dev/null
+++ b/src/Mapbox/Source.elm
@@ -0,0 +1,362 @@
+module Mapbox.Source exposing (Source, SourceOption, raster, tileSize, rasterFromUrl, RasterSource, scheme, Scheme(..), rasterDEMMapbox, rasterDEMTerrarium, geoJSONFromUrl, geoJSONFromValue, GeoJSONSource, buffer, tolerance, cluster, clusterRadius, lineMetrics, Coords, image, video, staticCanvas, animatedCanvas, bounds, minzoom, maxzoom, attribution, encode, getId, Id, Url, vector, vectorFromUrl, VectorSource)
+
+{-|
+
+
+# Sources
+
+@docs Source, SourceOption
+
+@docs Id, Url
+
+
+### Vector
+
+@docs vector, vectorFromUrl, VectorSource
+
+
+### Raster
+
+@docs raster, tileSize, rasterFromUrl, RasterSource, scheme, Scheme
+
+
+### Raster DEM
+
+@docs rasterDEMMapbox, rasterDEMTerrarium
+
+
+### GeoJSON
+
+@docs geoJSONFromUrl, geoJSONFromValue, GeoJSONSource, buffer, tolerance, cluster, clusterRadius, lineMetrics
+
+
+### Image, Video & Canvas
+
+@docs Coords, image, video, staticCanvas, animatedCanvas
+
+
+### Tiled sources
+
+Tiled sources can also take the following attributes:
+
+@docs bounds, minzoom, maxzoom, attribution
+
+
+### Working with sources
+
+@docs encode, getId
+
+-}
+
+import Json.Encode exposing (Value)
+
+
+{-| Every layer is identified by an id.
+-}
+type alias Id =
+ String
+
+
+{-| Represents a URL. For tiles hosted by Mapbox, the "url" value should be of the form mapbox://mapid.
+-}
+type alias Url =
+ String
+
+
+{-| Sources supply data to be shown on the map. Adding a source won't immediately make data appear on the map because sources don't contain styling details like color or width. Layers refer to a source and give it a visual representation. This makes it possible to style the same source in different ways, like differentiating between types of roads in a highways layer.
+-}
+type Source
+ = Source String Value
+
+
+{-| `XYZ`: Slippy map tilenames scheme.
+
+`TMS`: OSGeo spec scheme.
+
+-}
+type Scheme
+ = XYZ
+ | TMS
+
+
+{-| Marks attributes that are only applicable to vector sources
+-}
+type VectorSource
+ = VectorSource
+
+
+{-| Marks attributes that are only applicable to raster sources
+-}
+type RasterSource
+ = RasterSource
+
+
+{-| Marks attributes that are only applicable to GeoJSON sources
+-}
+type GeoJSONSource
+ = GeoJSONSource
+
+
+{-| Some sources can take options.
+-}
+type SourceOption sourceType
+ = SourceOption String Value
+
+
+{-| -}
+encode : Source -> Value
+encode (Source _ value) =
+ value
+
+
+{-| -}
+getId : Source -> String
+getId (Source k _) =
+ k
+
+
+{-| 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.
+-}
+bounds : Float -> Float -> Float -> Float -> SourceOption any
+bounds a b c d =
+ SourceOption "bounds" (Json.Encode.list [ Json.Encode.float a, Json.Encode.float b, Json.Encode.float c, Json.Encode.float d ])
+
+
+{-| Minimum zoom level for which tiles are available, as in the TileJSON spec.
+-}
+minzoom : Float -> SourceOption any
+minzoom z =
+ SourceOption "minzoom" (Json.Encode.float z)
+
+
+{-| 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.
+-}
+maxzoom : Float -> SourceOption any
+maxzoom z =
+ SourceOption "maxzoom" (Json.Encode.float z)
+
+
+{-| Contains an attribution to be displayed when the map is shown to a user.
+-}
+attribution : String -> SourceOption any
+attribution att =
+ SourceOption "attribution" (Json.Encode.string att)
+
+
+{-| The minimum visual size to display tiles for this layer.
+-}
+tileSize : Int -> SourceOption RasterSource
+tileSize ts =
+ SourceOption "minzoom" (Json.Encode.int ts)
+
+
+{-| 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. Defaults to 128.
+-}
+buffer : Int -> SourceOption GeoJSONSource
+buffer int =
+ SourceOption "buffer" (Json.Encode.int int)
+
+
+{-| Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance). Defaults to 0.375.
+-}
+tolerance : Float -> SourceOption GeoJSONSource
+tolerance float =
+ SourceOption "tolerance" (Json.Encode.float float)
+
+
+{-| If the data is a collection of point features, setting this to true clusters the points by radius into groups.
+-}
+cluster : Bool -> SourceOption GeoJSONSource
+cluster =
+ Json.Encode.bool >> SourceOption "cluster"
+
+
+{-| Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile.
+-}
+clusterRadius : Float -> SourceOption GeoJSONSource
+clusterRadius =
+ Json.Encode.float >> SourceOption "clusterRadius"
+
+
+{-| 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).
+-}
+clusterMaxZoom : Float -> SourceOption GeoJSONSource
+clusterMaxZoom =
+ Json.Encode.float >> SourceOption "clusterMaxZoom"
+
+
+{-| Whether to calculate line distance metrics. This is required for line layers that specify `lineGradient` values.
+-}
+lineMetrics : Bool -> SourceOption GeoJSONSource
+lineMetrics =
+ Json.Encode.bool >> SourceOption "lineMetrics"
+
+
+{-| Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed.
+-}
+scheme : Scheme -> SourceOption RasterSource
+scheme s =
+ case s of
+ XYZ ->
+ SourceOption "scheme" (Json.Encode.string "xyz")
+
+ TMS ->
+ SourceOption "scheme" (Json.Encode.string "tms")
+
+
+{-| A vector tile source. Tiles must be in [Mapbox Vector Tile format](https://www.mapbox.com/developers/vector-tiles/). All geometric coordinates in vector tiles must be between `-1 * extent` and `(extent * 2) - 1` inclusive. All layers that use a vector source must specify a `sourceLayer` value.
+
+The first argument is the layers id, the second is a url to a [TileJSON specification](https://github.com/mapbox/tilejson-spec) that configures the source.
+
+-}
+vectorFromUrl : Id -> Url -> Source
+vectorFromUrl id url =
+ Source id (Json.Encode.object [ ( "type", Json.Encode.string "vector" ), ( "url", Json.Encode.string url ) ])
+
+
+{-| A vector tile source. Tiles must be in [Mapbox Vector Tile format](https://www.mapbox.com/developers/vector-tiles/). All geometric coordinates in vector tiles must be between `-1 * extent` and `(extent * 2) - 1` inclusive. All layers that use a vector source must specify a `sourceLayer` value.
+
+This takes an array of one or more tile source URLs, as in the TileJSON spec.
+
+-}
+vector : Id -> List Url -> List (SourceOption VectorSource) -> Source
+vector id urls options =
+ ( "tiles", Json.Encode.list (List.map Json.Encode.string urls) )
+ :: ( "type", Json.Encode.string "vector" )
+ :: List.map (\(SourceOption k v) -> ( k, v )) options
+ |> Json.Encode.object
+ |> Source id
+
+
+{-| A raster tile source configured from a TileJSON spec.
+-}
+rasterFromUrl : Id -> Url -> Source
+rasterFromUrl id url =
+ Source id (Json.Encode.object [ ( "type", Json.Encode.string "raster" ), ( "url", Json.Encode.string url ) ])
+
+
+{-| A raster tile source. Takes a list of one or more tile source URLs, as in the TileJSON spec.
+-}
+raster : Id -> List Url -> List (SourceOption RasterSource) -> Source
+raster id urls options =
+ ( "tiles", Json.Encode.list (List.map Json.Encode.string urls) )
+ :: ( "type", Json.Encode.string "raster" )
+ :: List.map (\(SourceOption k v) -> ( k, v )) options
+ |> Json.Encode.object
+ |> Source id
+
+
+{-| The [Mapbox Terrain RGB](https://blog.mapbox.com/global-elevation-data-6689f1d0ba65) DEM source.
+-}
+rasterDEMMapbox : Id -> Source
+rasterDEMMapbox id =
+ Source id
+ (Json.Encode.object
+ [ ( "type", Json.Encode.string "raster-dem" )
+ , ( "url", Json.Encode.string "mapbox://mapbox.terrain-rgb" )
+ , ( "encoding", Json.Encode.string "mapbox" )
+ ]
+ )
+
+
+{-| A raster DEM source in the Terarrium format.
+-}
+rasterDEMTerrarium : Id -> Url -> List (SourceOption RasterSource) -> Source
+rasterDEMTerrarium id url options =
+ ( "type", Json.Encode.string "raster-dem" )
+ :: ( "url", Json.Encode.string url )
+ :: ( "encoding", Json.Encode.string "terrarium" )
+ :: List.map (\(SourceOption k v) -> ( k, v )) options
+ |> Json.Encode.object
+ |> Source id
+
+
+{-| A remote GeoJSON source.
+-}
+geoJSONFromUrl : Id -> Url -> List (SourceOption GeoJSONSource) -> Source
+geoJSONFromUrl id url options =
+ ( "data", Json.Encode.string url )
+ :: ( "type", Json.Encode.string "geojson" )
+ :: List.map (\(SourceOption k v) -> ( k, v )) options
+ |> Json.Encode.object
+ |> Source id
+
+
+{-| A GeoJSON source from some local data.
+-}
+geoJSONFromValue : Id -> List (SourceOption GeoJSONSource) -> Value -> Source
+geoJSONFromValue id options data =
+ ( "data", data )
+ :: ( "type", Json.Encode.string "geojson" )
+ :: List.map (\(SourceOption k v) -> ( k, v )) options
+ |> Json.Encode.object
+ |> Source id
+
+
+{-| `(longitude, latitude)` pairs for the corners. You can use the type alias constructor in clockwise order: top left, top right, bottom right, bottom left.
+-}
+type alias Coords =
+ { topLeft : ( Float, Float )
+ , topRight : ( Float, Float )
+ , bottomRight : ( Float, Float )
+ , bottomLeft : ( Float, Float )
+ }
+
+
+encodeCoordinates : Coords -> Value
+encodeCoordinates { topLeft, topRight, bottomRight, bottomLeft } =
+ let
+ encodePair ( x, y ) =
+ Json.Encode.list [ Json.Encode.float x, Json.Encode.float y ]
+ in
+ Json.Encode.list [ encodePair topLeft, encodePair topRight, encodePair bottomRight, encodePair bottomLeft ]
+
+
+{-| An image source
+-}
+image : Id -> Url -> Coords -> Source
+image id url coordinates =
+ [ ( "type", Json.Encode.string "image" )
+ , ( "url", Json.Encode.string url )
+ , ( "coordinates", encodeCoordinates coordinates )
+ ]
+ |> Json.Encode.object
+ |> Source id
+
+
+{-| A video source. For each URL in the list, a video element source will be created, in order to support same media in multiple formats supported by different browsers.
+-}
+video : Id -> List Url -> Coords -> Source
+video id urls coordinates =
+ [ ( "type", Json.Encode.string "video" )
+ , ( "urls", Json.Encode.list (List.map Json.Encode.string urls) )
+ , ( "coordinates", encodeCoordinates coordinates )
+ ]
+ |> Json.Encode.object
+ |> Source id
+
+
+{-| A data source containing the contents of an HTML canvas. The second argument must be the DOM ID of the canvas element. This method is only appropriate with a static Canvas (i.e. one that doesn't change), as it will be cached to improve performance.
+-}
+staticCanvas : Id -> String -> Coords -> Source
+staticCanvas id domid coordinates =
+ [ ( "type", Json.Encode.string "canvas" )
+ , ( "animate", Json.Encode.bool False )
+ , ( "canvas", Json.Encode.string domid )
+ , ( "coordinates", encodeCoordinates coordinates )
+ ]
+ |> Json.Encode.object
+ |> Source id
+
+
+{-| A data source containing the contents of an HTML canvas. The second argument must be the DOM ID of the canvas element. This method is only appropriate with an animated Canvas (i.e. one that changes over time).
+-}
+animatedCanvas : Id -> String -> Coords -> Source
+animatedCanvas id domid coordinates =
+ [ ( "type", Json.Encode.string "canvas" )
+ , ( "animate", Json.Encode.bool True )
+ , ( "canvas", Json.Encode.string domid )
+ , ( "coordinates", encodeCoordinates coordinates )
+ ]
+ |> Json.Encode.object
+ |> Source id
diff --git a/src/Mapbox/Style.elm b/src/Mapbox/Style.elm
new file mode 100644
index 0000000..5d47e7e
--- /dev/null
+++ b/src/Mapbox/Style.elm
@@ -0,0 +1,220 @@
+module Mapbox.Style exposing (Style, encode, Light, defaultLight, Transition, defaultTransition, MiscAttr, sprite, glyphs, name, defaultCenter, defaultZoomLevel, defaultBearing, defaultPitch, metadata)
+
+{-| A Mapbox style is a document that defines the visual appearance of a map: what data to draw, the order to draw it in, and how to style the data when drawing it. A style document is a JSON object with specific root level and nested properties. This specification defines and describes these properties.
+
+@docs Style, encode
+
+
+### Light
+
+@docs Light, defaultLight
+
+
+### Transition
+
+@docs Transition, defaultTransition
+
+
+### Misc Attributes
+
+@docs MiscAttr, sprite, glyphs, name, defaultCenter, defaultZoomLevel, defaultBearing, defaultPitch, metadata
+
+-}
+
+import Array exposing (Array)
+import Json.Encode as Encode exposing (Value)
+import Mapbox.Expression exposing (Anchor(Viewport), CameraExpression, Color, Expression, float, floats, rgba)
+import Mapbox.Helpers exposing (encodeAnchor)
+import Mapbox.Layer exposing (Layer)
+import Mapbox.Source exposing (Source)
+
+
+{-| Encodes the style into JSON.
+-}
+encode : Style -> Value
+encode style =
+ [ ( "version", Encode.int 8 )
+ , ( "transition", encodeTransition style.transition )
+ , ( "light", encodeLight style.light )
+ , ( "sources", Encode.object <| List.map (\source -> ( Mapbox.Source.getId source, Mapbox.Source.encode source )) style.sources )
+ , ( "layers", Encode.list (List.map Mapbox.Layer.encode style.layers) )
+ ]
+ ++ List.map (\(MiscAttr key value) -> ( key, value )) style.misc
+ |> Encode.object
+
+
+encodeTransition : Transition -> Value
+encodeTransition { duration, delay } =
+ Encode.object [ ( "duration", Encode.int duration ), ( "delay", Encode.int delay ) ]
+
+
+encodeLight : Light -> Value
+encodeLight { anchor, position, color, intensity } =
+ Encode.object
+ [ ( "anchor", encodeAnchor anchor )
+ , ( "position", Mapbox.Expression.encode position )
+ , ( "color", Mapbox.Expression.encode color )
+ , ( "intensity", Mapbox.Expression.encode intensity )
+ ]
+
+
+{-| This is the core representation of a Mapbox style. It has the following keys:
+
+
+### Layers
+
+These define what is actually rendered on screen. See the Mapbox.Layer module on how to configure these.
+
+
+### Sources
+
+These define the data sources that feed the Layers. See the Mapbox.Source module for more.
+
+
+### Misc
+
+These are all optional attributes.
+
+All the other keys are values defined below.
+
+-}
+type alias Style =
+ { transition : Transition
+ , light : Light
+ , layers : List Layer
+ , sources : List Source
+ , misc : List MiscAttr
+ }
+
+
+{-| -}
+type MiscAttr
+ = MiscAttr String Value
+
+
+{-| A human-readable name for the style.
+-}
+name : String -> MiscAttr
+name =
+ Encode.string >> MiscAttr "name"
+
+
+{-| 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).
+-}
+defaultCenter : Float -> Float -> MiscAttr
+defaultCenter lat lng =
+ Encode.list [ Encode.float lat, Encode.float lng ] |> MiscAttr "center"
+
+
+{-| 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).
+-}
+defaultZoomLevel : Float -> MiscAttr
+defaultZoomLevel =
+ Encode.float >> MiscAttr "zoom"
+
+
+{-| Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'.
+-}
+metadata : List ( String, Value ) -> MiscAttr
+metadata =
+ Encode.object >> MiscAttr "metadata"
+
+
+{-| 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).
+-}
+defaultBearing : Float -> MiscAttr
+defaultBearing =
+ Encode.float >> MiscAttr "bearing"
+
+
+{-| 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).
+-}
+defaultPitch : Float -> MiscAttr
+defaultPitch =
+ Encode.float >> MiscAttr "pitch"
+
+
+{-| 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 `backgroundPattern`, `fillPattern`, `linePattern`, `fillExtrusionPattern`, or `iconImage` properties.
+-}
+sprite : String -> MiscAttr
+sprite =
+ Encode.string >> MiscAttr "sprite"
+
+
+{-| 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 `textField` layout property.
+-}
+glyphs : String -> MiscAttr
+glyphs =
+ Encode.string >> MiscAttr "glyphs"
+
+
+
+-- Light
+
+
+{-| The global light source.
+
+
+### `anchor`
+
+Whether extruded geometries are lit relative to the map or viewport.
+
+
+### `position`
+
+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 the `anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `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).
+
+
+### `color`
+
+Color tint for lighting extruded geometries.
+
+
+### `intensity`
+
+Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.
+
+-}
+type alias Light =
+ { anchor : Anchor
+ , position : Expression CameraExpression (Array Float)
+ , color : Expression CameraExpression Color
+ , intensity : Expression CameraExpression Float
+ }
+
+
+{-| A decent default light.
+-}
+defaultLight : Light
+defaultLight =
+ { anchor = Viewport
+ , position = floats [ 1.15, 210, 30 ]
+ , color = rgba 255 255 255 1
+ , intensity = float 0.5
+ }
+
+
+{-| A transition property controls timing for the interpolation between a transitionable style property's previous value and new value.
+
+
+### `duration`
+
+Time (in ms) allotted for transitions to complete.
+
+
+### `delay`
+
+Length of time (in ms) before a transition begins.
+
+-}
+type alias Transition =
+ { duration : Int, delay : Int }
+
+
+{-| The defaults for a transition
+-}
+defaultTransition : Transition
+defaultTransition =
+ { duration = 300
+ , delay = 0
+ }
[cgit] Unable to lock slot /tmp/cgit/6b000000.lock: Permission denied (13)