aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/style-generator/index.html10713
-rw-r--r--examples/Example02.elm12
-rw-r--r--examples/Outdoors.elm1079
-rw-r--r--style-generator/elm.json33
-rw-r--r--style-generator/src/Color.elm376
-rw-r--r--style-generator/src/Decoder.elm776
-rw-r--r--style-generator/src/Main.elm138
-rw-r--r--style-generator/src/Writer.elm640
8 files changed, 13767 insertions, 0 deletions
diff --git a/docs/style-generator/index.html b/docs/style-generator/index.html
new file mode 100644
index 0000000..a85638d
--- /dev/null
+++ b/docs/style-generator/index.html
@@ -0,0 +1,10713 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <meta charset="UTF-8">
+ <title>Main</title>
+</head>
+
+<body>
+<div id="elm-f0111bc4e658d0f98db96260c16f7e49"></div>
+<script>
+(function(scope){
+'use strict';
+
+function F(arity, fun, wrapper) {
+ wrapper.a = arity;
+ wrapper.f = fun;
+ return wrapper;
+}
+
+function F2(fun) {
+ return F(2, fun, function(a) { return function(b) { return fun(a,b); }; })
+}
+function F3(fun) {
+ return F(3, fun, function(a) {
+ return function(b) { return function(c) { return fun(a, b, c); }; };
+ });
+}
+function F4(fun) {
+ return F(4, fun, function(a) { return function(b) { return function(c) {
+ return function(d) { return fun(a, b, c, d); }; }; };
+ });
+}
+function F5(fun) {
+ return F(5, fun, function(a) { return function(b) { return function(c) {
+ return function(d) { return function(e) { return fun(a, b, c, d, e); }; }; }; };
+ });
+}
+function F6(fun) {
+ return F(6, fun, function(a) { return function(b) { return function(c) {
+ return function(d) { return function(e) { return function(f) {
+ return fun(a, b, c, d, e, f); }; }; }; }; };
+ });
+}
+function F7(fun) {
+ return F(7, fun, function(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); }; }; }; }; }; };
+ });
+}
+function F8(fun) {
+ return F(8, fun, function(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); }; }; }; }; }; }; };
+ });
+}
+function F9(fun) {
+ return F(9, fun, function(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); }; }; }; }; }; }; }; };
+ });
+}
+
+function A2(fun, a, b) {
+ return fun.a === 2 ? fun.f(a, b) : fun(a)(b);
+}
+function A3(fun, a, b, c) {
+ return fun.a === 3 ? fun.f(a, b, c) : fun(a)(b)(c);
+}
+function A4(fun, a, b, c, d) {
+ return fun.a === 4 ? fun.f(a, b, c, d) : fun(a)(b)(c)(d);
+}
+function A5(fun, a, b, c, d, e) {
+ return fun.a === 5 ? fun.f(a, b, c, d, e) : fun(a)(b)(c)(d)(e);
+}
+function A6(fun, a, b, c, d, e, f) {
+ return fun.a === 6 ? fun.f(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.a === 7 ? fun.f(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.a === 8 ? fun.f(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.a === 9 ? fun.f(a, b, c, d, e, f, g, h, i) : fun(a)(b)(c)(d)(e)(f)(g)(h)(i);
+}
+
+
+
+
+var _List_Nil = { $: 0 };
+var _List_Nil_UNUSED = { $: '[]' };
+
+function _List_Cons(hd, tl) { return { $: 1, a: hd, b: tl }; }
+function _List_Cons_UNUSED(hd, tl) { return { $: '::', a: hd, b: tl }; }
+
+
+var _List_cons = F2(_List_Cons);
+
+function _List_fromArray(arr)
+{
+ var out = _List_Nil;
+ for (var i = arr.length; i--; )
+ {
+ out = _List_Cons(arr[i], out);
+ }
+ return out;
+}
+
+function _List_toArray(xs)
+{
+ for (var out = []; xs.b; xs = xs.b) // WHILE_CONS
+ {
+ out.push(xs.a);
+ }
+ return out;
+}
+
+var _List_map2 = F3(function(f, xs, ys)
+{
+ for (var arr = []; xs.b && ys.b; xs = xs.b, ys = ys.b) // WHILE_CONSES
+ {
+ arr.push(A2(f, xs.a, ys.a));
+ }
+ return _List_fromArray(arr);
+});
+
+var _List_map3 = F4(function(f, xs, ys, zs)
+{
+ for (var arr = []; xs.b && ys.b && zs.b; xs = xs.b, ys = ys.b, zs = zs.b) // WHILE_CONSES
+ {
+ arr.push(A3(f, xs.a, ys.a, zs.a));
+ }
+ return _List_fromArray(arr);
+});
+
+var _List_map4 = F5(function(f, ws, xs, ys, zs)
+{
+ for (var arr = []; ws.b && xs.b && ys.b && zs.b; ws = ws.b, xs = xs.b, ys = ys.b, zs = zs.b) // WHILE_CONSES
+ {
+ arr.push(A4(f, ws.a, xs.a, ys.a, zs.a));
+ }
+ return _List_fromArray(arr);
+});
+
+var _List_map5 = F6(function(f, vs, ws, xs, ys, zs)
+{
+ for (var arr = []; vs.b && ws.b && xs.b && ys.b && zs.b; vs = vs.b, ws = ws.b, xs = xs.b, ys = ys.b, zs = zs.b) // WHILE_CONSES
+ {
+ arr.push(A5(f, vs.a, ws.a, xs.a, ys.a, zs.a));
+ }
+ return _List_fromArray(arr);
+});
+
+var _List_sortBy = F2(function(f, xs)
+{
+ return _List_fromArray(_List_toArray(xs).sort(function(a, b) {
+ return _Utils_cmp(f(a), f(b));
+ }));
+});
+
+var _List_sortWith = F2(function(f, xs)
+{
+ return _List_fromArray(_List_toArray(xs).sort(function(a, b) {
+ var ord = A2(f, a, b);
+ return ord === elm$core$Basics$EQ ? 0 : ord === elm$core$Basics$LT ? -1 : 1;
+ }));
+});
+
+
+
+// EQUALITY
+
+function _Utils_eq(x, y)
+{
+ for (
+ var pair, stack = [], isEqual = _Utils_eqHelp(x, y, 0, stack);
+ isEqual && (pair = stack.pop());
+ isEqual = _Utils_eqHelp(pair.a, pair.b, 0, stack)
+ )
+ {}
+
+ return isEqual;
+}
+
+function _Utils_eqHelp(x, y, depth, stack)
+{
+ if (depth > 100)
+ {
+ stack.push(_Utils_Tuple2(x,y));
+ return true;
+ }
+
+ if (x === y)
+ {
+ return true;
+ }
+
+ if (typeof x !== 'object' || x === null || y === null)
+ {
+ typeof x === 'function' && _Debug_crash(5);
+ return false;
+ }
+
+ /**_UNUSED/
+ if (x.$ === 'Set_elm_builtin')
+ {
+ x = elm$core$Set$toList(x);
+ y = elm$core$Set$toList(y);
+ }
+ if (x.$ === 'RBNode_elm_builtin' || x.$ === 'RBEmpty_elm_builtin')
+ {
+ x = elm$core$Dict$toList(x);
+ y = elm$core$Dict$toList(y);
+ }
+ //*/
+
+ /**/
+ if (x.$ < 0)
+ {
+ x = elm$core$Dict$toList(x);
+ y = elm$core$Dict$toList(y);
+ }
+ //*/
+
+ for (var key in x)
+ {
+ if (!_Utils_eqHelp(x[key], y[key], depth + 1, stack))
+ {
+ return false;
+ }
+ }
+ return true;
+}
+
+var _Utils_equal = F2(_Utils_eq);
+var _Utils_notEqual = F2(function(a, b) { return !_Utils_eq(a,b); });
+
+
+
+// COMPARISONS
+
+// Code in Generate/JavaScript.hs, Basics.js, and List.js depends on
+// the particular integer values assigned to LT, EQ, and GT.
+
+function _Utils_cmp(x, y, ord)
+{
+ if (typeof x !== 'object')
+ {
+ return x === y ? /*EQ*/ 0 : x < y ? /*LT*/ -1 : /*GT*/ 1;
+ }
+
+ /**_UNUSED/
+ if (x instanceof String)
+ {
+ var a = x.valueOf();
+ var b = y.valueOf();
+ return a === b ? 0 : a < b ? -1 : 1;
+ }
+ //*/
+
+ /**/
+ if (!x.$)
+ //*/
+ /**_UNUSED/
+ if (x.$[0] === '#')
+ //*/
+ {
+ return (ord = _Utils_cmp(x.a, y.a))
+ ? ord
+ : (ord = _Utils_cmp(x.b, y.b))
+ ? ord
+ : _Utils_cmp(x.c, y.c);
+ }
+
+ // traverse conses until end of a list or a mismatch
+ for (; x.b && y.b && !(ord = _Utils_cmp(x.a, y.a)); x = x.b, y = y.b) {} // WHILE_CONSES
+ return ord || (x.b ? /*GT*/ 1 : y.b ? /*LT*/ -1 : /*EQ*/ 0);
+}
+
+var _Utils_lt = F2(function(a, b) { return _Utils_cmp(a, b) < 0; });
+var _Utils_le = F2(function(a, b) { return _Utils_cmp(a, b) < 1; });
+var _Utils_gt = F2(function(a, b) { return _Utils_cmp(a, b) > 0; });
+var _Utils_ge = F2(function(a, b) { return _Utils_cmp(a, b) >= 0; });
+
+var _Utils_compare = F2(function(x, y)
+{
+ var n = _Utils_cmp(x, y);
+ return n < 0 ? elm$core$Basics$LT : n ? elm$core$Basics$GT : elm$core$Basics$EQ;
+});
+
+
+// COMMON VALUES
+
+var _Utils_Tuple0 = 0;
+var _Utils_Tuple0_UNUSED = { $: '#0' };
+
+function _Utils_Tuple2(a, b) { return { a: a, b: b }; }
+function _Utils_Tuple2_UNUSED(a, b) { return { $: '#2', a: a, b: b }; }
+
+function _Utils_Tuple3(a, b, c) { return { a: a, b: b, c: c }; }
+function _Utils_Tuple3_UNUSED(a, b, c) { return { $: '#3', a: a, b: b, c: c }; }
+
+function _Utils_chr(c) { return c; }
+function _Utils_chr_UNUSED(c) { return new String(c); }
+
+
+// RECORDS
+
+function _Utils_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;
+}
+
+
+// APPEND
+
+var _Utils_append = F2(_Utils_ap);
+
+function _Utils_ap(xs, ys)
+{
+ // append Strings
+ if (typeof xs === 'string')
+ {
+ return xs + ys;
+ }
+
+ // append Lists
+ if (!xs.b)
+ {
+ return ys;
+ }
+ var root = _List_Cons(xs.a, ys);
+ xs = xs.b
+ for (var curr = root; xs.b; xs = xs.b) // WHILE_CONS
+ {
+ curr = curr.b = _List_Cons(xs.a, ys);
+ }
+ return root;
+}
+
+
+
+var _JsArray_empty = [];
+
+function _JsArray_singleton(value)
+{
+ return [value];
+}
+
+function _JsArray_length(array)
+{
+ return array.length;
+}
+
+var _JsArray_initialize = F3(function(size, offset, func)
+{
+ var result = new Array(size);
+
+ for (var i = 0; i < size; i++)
+ {
+ result[i] = func(offset + i);
+ }
+
+ return result;
+});
+
+var _JsArray_initializeFromList = F2(function (max, ls)
+{
+ var result = new Array(max);
+
+ for (var i = 0; i < max && ls.b; i++)
+ {
+ result[i] = ls.a;
+ ls = ls.b;
+ }
+
+ result.length = i;
+ return _Utils_Tuple2(result, ls);
+});
+
+var _JsArray_unsafeGet = F2(function(index, array)
+{
+ return array[index];
+});
+
+var _JsArray_unsafeSet = F3(function(index, value, array)
+{
+ var length = array.length;
+ var result = new Array(length);
+
+ for (var i = 0; i < length; i++)
+ {
+ result[i] = array[i];
+ }
+
+ result[index] = value;
+ return result;
+});
+
+var _JsArray_push = F2(function(value, array)
+{
+ var length = array.length;
+ var result = new Array(length + 1);
+
+ for (var i = 0; i < length; i++)
+ {
+ result[i] = array[i];
+ }
+
+ result[length] = value;
+ return result;
+});
+
+var _JsArray_foldl = F3(function(func, acc, array)
+{
+ var length = array.length;
+
+ for (var i = 0; i < length; i++)
+ {
+ acc = A2(func, array[i], acc);
+ }
+
+ return acc;
+});
+
+var _JsArray_foldr = F3(function(func, acc, array)
+{
+ for (var i = array.length - 1; i >= 0; i--)
+ {
+ acc = A2(func, array[i], acc);
+ }
+
+ return acc;
+});
+
+var _JsArray_map = F2(function(func, array)
+{
+ var length = array.length;
+ var result = new Array(length);
+
+ for (var i = 0; i < length; i++)
+ {
+ result[i] = func(array[i]);
+ }
+
+ return result;
+});
+
+var _JsArray_indexedMap = F3(function(func, offset, array)
+{
+ var length = array.length;
+ var result = new Array(length);
+
+ for (var i = 0; i < length; i++)
+ {
+ result[i] = A2(func, offset + i, array[i]);
+ }
+
+ return result;
+});
+
+var _JsArray_slice = F3(function(from, to, array)
+{
+ return array.slice(from, to);
+});
+
+var _JsArray_appendN = F3(function(n, dest, source)
+{
+ var destLen = dest.length;
+ var itemsToCopy = n - destLen;
+
+ if (itemsToCopy > source.length)
+ {
+ itemsToCopy = source.length;
+ }
+
+ var size = destLen + itemsToCopy;
+ var result = new Array(size);
+
+ for (var i = 0; i < destLen; i++)
+ {
+ result[i] = dest[i];
+ }
+
+ for (var i = 0; i < itemsToCopy; i++)
+ {
+ result[i + destLen] = source[i];
+ }
+
+ return result;
+});
+
+
+
+// LOG
+
+var _Debug_log = F2(function(tag, value)
+{
+ return value;
+});
+
+var _Debug_log_UNUSED = F2(function(tag, value)
+{
+ console.log(tag + ': ' + _Debug_toString(value));
+ return value;
+});
+
+
+// TODOS
+
+function _Debug_todo(moduleName, region)
+{
+ return function(message) {
+ _Debug_crash(8, moduleName, region, message);
+ };
+}
+
+function _Debug_todoCase(moduleName, region, value)
+{
+ return function(message) {
+ _Debug_crash(9, moduleName, region, value, message);
+ };
+}
+
+
+// TO STRING
+
+function _Debug_toString(value)
+{
+ return '<internals>';
+}
+
+function _Debug_toString_UNUSED(value)
+{
+ return _Debug_toAnsiString(false, value);
+}
+
+function _Debug_toAnsiString(ansi, value)
+{
+ if (typeof value === 'function')
+ {
+ return _Debug_internalColor(ansi, '<function>');
+ }
+
+ if (typeof value === 'boolean')
+ {
+ return _Debug_ctorColor(ansi, value ? 'True' : 'False');
+ }
+
+ if (typeof value === 'number')
+ {
+ return _Debug_numberColor(ansi, value + '');
+ }
+
+ if (value instanceof String)
+ {
+ return _Debug_charColor(ansi, "'" + _Debug_addSlashes(value, true) + "'");
+ }
+
+ if (typeof value === 'string')
+ {
+ return _Debug_stringColor(ansi, '"' + _Debug_addSlashes(value, false) + '"');
+ }
+
+ if (typeof value === 'object' && '$' in value)
+ {
+ var tag = value.$;
+
+ if (typeof tag === 'number')
+ {
+ return _Debug_internalColor(ansi, '<internals>');
+ }
+
+ if (tag[0] === '#')
+ {
+ var output = [];
+ for (var k in value)
+ {
+ if (k === '$') continue;
+ output.push(_Debug_toAnsiString(ansi, value[k]));
+ }
+ return '(' + output.join(',') + ')';
+ }
+
+ if (tag === 'Set_elm_builtin')
+ {
+ return _Debug_ctorColor(ansi, 'Set')
+ + _Debug_fadeColor(ansi, '.fromList') + ' '
+ + _Debug_toAnsiString(ansi, elm$core$Set$toList(value));
+ }
+
+ if (tag === 'RBNode_elm_builtin' || tag === 'RBEmpty_elm_builtin')
+ {
+ return _Debug_ctorColor(ansi, 'Dict')
+ + _Debug_fadeColor(ansi, '.fromList') + ' '
+ + _Debug_toAnsiString(ansi, elm$core$Dict$toList(value));
+ }
+
+ if (tag === 'Array_elm_builtin')
+ {
+ return _Debug_ctorColor(ansi, 'Array')
+ + _Debug_fadeColor(ansi, '.fromList') + ' '
+ + _Debug_toAnsiString(ansi, elm$core$Array$toList(value));
+ }
+
+ if (tag === '::' || tag === '[]')
+ {
+ var output = '[';
+
+ value.b && (output += _Debug_toAnsiString(ansi, value.a), value = value.b)
+
+ for (; value.b; value = value.b) // WHILE_CONS
+ {
+ output += ',' + _Debug_toAnsiString(ansi, value.a);
+ }
+ return output + ']';
+ }
+
+ var output = '';
+ for (var i in value)
+ {
+ if (i === '$') continue;
+ var str = _Debug_toAnsiString(ansi, value[i]);
+ var c0 = str[0];
+ var parenless = c0 === '{' || c0 === '(' || c0 === '[' || c0 === '<' || c0 === '"' || str.indexOf(' ') < 0;
+ output += ' ' + (parenless ? str : '(' + str + ')');
+ }
+ return _Debug_ctorColor(ansi, tag) + output;
+ }
+
+ if (typeof value === 'object')
+ {
+ var output = [];
+ for (var key in value)
+ {
+ var field = key[0] === '_' ? key.slice(1) : key;
+ output.push(_Debug_fadeColor(ansi, field) + ' = ' + _Debug_toAnsiString(ansi, value[key]));
+ }
+ if (output.length === 0)
+ {
+ return '{}';
+ }
+ return '{ ' + output.join(', ') + ' }';
+ }
+
+ return _Debug_internalColor(ansi, '<internals>');
+}
+
+function _Debug_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, '\\"');
+ }
+}
+
+function _Debug_ctorColor(ansi, string)
+{
+ return ansi ? '\x1b[96m' + string + '\x1b[0m' : string;
+}
+
+function _Debug_numberColor(ansi, string)
+{
+ return ansi ? '\x1b[95m' + string + '\x1b[0m' : string;
+}
+
+function _Debug_stringColor(ansi, string)
+{
+ return ansi ? '\x1b[93m' + string + '\x1b[0m' : string;
+}
+
+function _Debug_charColor(ansi, string)
+{
+ return ansi ? '\x1b[92m' + string + '\x1b[0m' : string;
+}
+
+function _Debug_fadeColor(ansi, string)
+{
+ return ansi ? '\x1b[37m' + string + '\x1b[0m' : string;
+}
+
+function _Debug_internalColor(ansi, string)
+{
+ return ansi ? '\x1b[94m' + string + '\x1b[0m' : string;
+}
+
+
+
+// CRASH
+
+
+function _Debug_crash(identifier)
+{
+ throw new Error('https://github.com/elm/core/blob/1.0.0/hints/' + identifier + '.md');
+}
+
+
+function _Debug_crash_UNUSED(identifier, fact1, fact2, fact3, fact4)
+{
+ switch(identifier)
+ {
+ case 0:
+ throw new Error('What node should I take over? In JavaScript I need something like:\n\n Elm.Main.init({\n node: document.getElementById("elm-node")\n })\n\nYou need to do this with any Browser.sandbox or Browser.element program.');
+
+ case 1:
+ throw new Error('Browser.application programs cannot handle URLs like this:\n\n ' + document.location.href + '\n\nWhat is the root? The root of your file system? Try looking at this program with `elm reactor` or some other server.');
+
+ case 2:
+ var message = fact1;
+ throw new Error('Problem with the flags given to your Elm program on initialization.\n\n' + message);
+
+ case 3:
+ var portName = fact1;
+ throw new Error('There can only be one port named `' + portName + '`, but your program has multiple.');
+
+ case 4:
+ var portName = fact1;
+ var problem = fact2;
+ throw new Error('Trying to send an unexpected type of value through port `' + portName + '`:\n' + problem);
+
+ case 5:
+ throw new Error('Trying to use `(==)` on functions.\nThere is no way to know if functions are "the same" in the Elm sense.\nRead more about this at https://package.elm-lang.org/packages/elm/core/latest/Basics#== which describes why it is this way and what the better version will look like.');
+
+ case 6:
+ var moduleName = fact1;
+ throw new Error('Your page is loading multiple Elm scripts with a module named ' + moduleName + '. Maybe a duplicate script is getting loaded accidentally? If not, rename one of them so I know which is which!');
+
+ case 8:
+ var moduleName = fact1;
+ var region = fact2;
+ var message = fact3;
+ throw new Error('TODO in module `' + moduleName + '` ' + _Debug_regionToString(region) + '\n\n' + message);
+
+ case 9:
+ var moduleName = fact1;
+ var region = fact2;
+ var value = fact3;
+ var message = fact4;
+ throw new Error(
+ 'TODO in module `' + moduleName + '` from the `case` expression '
+ + _Debug_regionToString(region) + '\n\nIt received the following value:\n\n '
+ + _Debug_toString(value).replace('\n', '\n ')
+ + '\n\nBut the branch that handles it says:\n\n ' + message.replace('\n', '\n ')
+ );
+
+ case 10:
+ throw new Error('Bug in https://github.com/elm/virtual-dom/issues');
+
+ case 11:
+ throw new Error('Cannot perform mod 0. Division by zero error.');
+ }
+}
+
+function _Debug_regionToString(region)
+{
+ if (region.bY.N === region.bA.N)
+ {
+ return 'on line ' + region.bY.N;
+ }
+ return 'on lines ' + region.bY.N + ' through ' + region.bA.N;
+}
+
+
+
+// MATH
+
+var _Basics_add = F2(function(a, b) { return a + b; });
+var _Basics_sub = F2(function(a, b) { return a - b; });
+var _Basics_mul = F2(function(a, b) { return a * b; });
+var _Basics_fdiv = F2(function(a, b) { return a / b; });
+var _Basics_idiv = F2(function(a, b) { return (a / b) | 0; });
+var _Basics_pow = F2(Math.pow);
+
+var _Basics_remainderBy = F2(function(b, a) { return a % b; });
+
+// https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/divmodnote-letter.pdf
+var _Basics_modBy = F2(function(modulus, x)
+{
+ var answer = x % modulus;
+ return modulus === 0
+ ? _Debug_crash(11)
+ :
+ ((answer > 0 && modulus < 0) || (answer < 0 && modulus > 0))
+ ? answer + modulus
+ : answer;
+});
+
+
+// TRIGONOMETRY
+
+var _Basics_pi = Math.PI;
+var _Basics_e = Math.E;
+var _Basics_cos = Math.cos;
+var _Basics_sin = Math.sin;
+var _Basics_tan = Math.tan;
+var _Basics_acos = Math.acos;
+var _Basics_asin = Math.asin;
+var _Basics_atan = Math.atan;
+var _Basics_atan2 = F2(Math.atan2);
+
+
+// MORE MATH
+
+function _Basics_toFloat(x) { return x; }
+function _Basics_truncate(n) { return n | 0; }
+function _Basics_isInfinite(n) { return n === Infinity || n === -Infinity; }
+
+var _Basics_ceiling = Math.ceil;
+var _Basics_floor = Math.floor;
+var _Basics_round = Math.round;
+var _Basics_sqrt = Math.sqrt;
+var _Basics_log = Math.log;
+var _Basics_isNaN = isNaN;
+
+
+// BOOLEANS
+
+function _Basics_not(bool) { return !bool; }
+var _Basics_and = F2(function(a, b) { return a && b; });
+var _Basics_or = F2(function(a, b) { return a || b; });
+var _Basics_xor = F2(function(a, b) { return a !== b; });
+
+
+
+// CORE DECODERS
+
+function _Json_succeed(msg)
+{
+ return {
+ $: 0,
+ a: msg
+ };
+}
+
+function _Json_fail(msg)
+{
+ return {
+ $: 1,
+ a: msg
+ };
+}
+
+var _Json_decodeInt = { $: 2 };
+var _Json_decodeBool = { $: 3 };
+var _Json_decodeFloat = { $: 4 };
+var _Json_decodeValue = { $: 5 };
+var _Json_decodeString = { $: 6 };
+
+function _Json_decodeList(decoder) { return { $: 7, b: decoder }; }
+function _Json_decodeArray(decoder) { return { $: 8, b: decoder }; }
+
+function _Json_decodeNull(value) { return { $: 9, c: value }; }
+
+var _Json_decodeField = F2(function(field, decoder)
+{
+ return {
+ $: 10,
+ d: field,
+ b: decoder
+ };
+});
+
+var _Json_decodeIndex = F2(function(index, decoder)
+{
+ return {
+ $: 11,
+ e: index,
+ b: decoder
+ };
+});
+
+function _Json_decodeKeyValuePairs(decoder)
+{
+ return {
+ $: 12,
+ b: decoder
+ };
+}
+
+function _Json_mapMany(f, decoders)
+{
+ return {
+ $: 13,
+ f: f,
+ g: decoders
+ };
+}
+
+var _Json_andThen = F2(function(callback, decoder)
+{
+ return {
+ $: 14,
+ b: decoder,
+ h: callback
+ };
+});
+
+function _Json_oneOf(decoders)
+{
+ return {
+ $: 15,
+ g: decoders
+ };
+}
+
+
+// DECODING OBJECTS
+
+var _Json_map1 = F2(function(f, d1)
+{
+ return _Json_mapMany(f, [d1]);
+});
+
+var _Json_map2 = F3(function(f, d1, d2)
+{
+ return _Json_mapMany(f, [d1, d2]);
+});
+
+var _Json_map3 = F4(function(f, d1, d2, d3)
+{
+ return _Json_mapMany(f, [d1, d2, d3]);
+});
+
+var _Json_map4 = F5(function(f, d1, d2, d3, d4)
+{
+ return _Json_mapMany(f, [d1, d2, d3, d4]);
+});
+
+var _Json_map5 = F6(function(f, d1, d2, d3, d4, d5)
+{
+ return _Json_mapMany(f, [d1, d2, d3, d4, d5]);
+});
+
+var _Json_map6 = F7(function(f, d1, d2, d3, d4, d5, d6)
+{
+ return _Json_mapMany(f, [d1, d2, d3, d4, d5, d6]);
+});
+
+var _Json_map7 = F8(function(f, d1, d2, d3, d4, d5, d6, d7)
+{
+ return _Json_mapMany(f, [d1, d2, d3, d4, d5, d6, d7]);
+});
+
+var _Json_map8 = F9(function(f, d1, d2, d3, d4, d5, d6, d7, d8)
+{
+ return _Json_mapMany(f, [d1, d2, d3, d4, d5, d6, d7, d8]);
+});
+
+
+// DECODE
+
+var _Json_runOnString = F2(function(decoder, string)
+{
+ try
+ {
+ var value = JSON.parse(string);
+ return _Json_runHelp(decoder, value);
+ }
+ catch (e)
+ {
+ return elm$core$Result$Err(A2(elm$json$Json$Decode$Failure, 'This is not valid JSON! ' + e.message, _Json_wrap(string)));
+ }
+});
+
+var _Json_run = F2(function(decoder, value)
+{
+ return _Json_runHelp(decoder, _Json_unwrap(value));
+});
+
+function _Json_runHelp(decoder, value)
+{
+ switch (decoder.$)
+ {
+ case 3:
+ return (typeof value === 'boolean')
+ ? elm$core$Result$Ok(value)
+ : _Json_expecting('a BOOL', value);
+
+ case 2:
+ if (typeof value !== 'number') {
+ return _Json_expecting('an INT', value);
+ }
+
+ if (-2147483647 < value && value < 2147483647 && (value | 0) === value) {
+ return elm$core$Result$Ok(value);
+ }
+
+ if (isFinite(value) && !(value % 1)) {
+ return elm$core$Result$Ok(value);
+ }
+
+ return _Json_expecting('an INT', value);
+
+ case 4:
+ return (typeof value === 'number')
+ ? elm$core$Result$Ok(value)
+ : _Json_expecting('a FLOAT', value);
+
+ case 6:
+ return (typeof value === 'string')
+ ? elm$core$Result$Ok(value)
+ : (value instanceof String)
+ ? elm$core$Result$Ok(value + '')
+ : _Json_expecting('a STRING', value);
+
+ case 9:
+ return (value === null)
+ ? elm$core$Result$Ok(decoder.c)
+ : _Json_expecting('null', value);
+
+ case 5:
+ return elm$core$Result$Ok(_Json_wrap(value));
+
+ case 7:
+ if (!Array.isArray(value))
+ {
+ return _Json_expecting('a LIST', value);
+ }
+ return _Json_runArrayDecoder(decoder.b, value, _List_fromArray);
+
+ case 8:
+ if (!Array.isArray(value))
+ {
+ return _Json_expecting('an ARRAY', value);
+ }
+ return _Json_runArrayDecoder(decoder.b, value, _Json_toElmArray);
+
+ case 10:
+ var field = decoder.d;
+ if (typeof value !== 'object' || value === null || !(field in value))
+ {
+ return _Json_expecting('an OBJECT with a field named `' + field + '`', value);
+ }
+ var result = _Json_runHelp(decoder.b, value[field]);
+ return (elm$core$Result$isOk(result)) ? result : elm$core$Result$Err(A2(elm$json$Json$Decode$Field, field, result.a));
+
+ case 11:
+ var index = decoder.e;
+ if (!Array.isArray(value))
+ {
+ return _Json_expecting('an ARRAY', value);
+ }
+ if (index >= value.length)
+ {
+ return _Json_expecting('a LONGER array. Need index ' + index + ' but only see ' + value.length + ' entries', value);
+ }
+ var result = _Json_runHelp(decoder.b, value[index]);
+ return (elm$core$Result$isOk(result)) ? result : elm$core$Result$Err(A2(elm$json$Json$Decode$Index, index, result.a));
+
+ case 12:
+ if (typeof value !== 'object' || value === null || Array.isArray(value))
+ {
+ return _Json_expecting('an OBJECT', value);
+ }
+
+ var keyValuePairs = _List_Nil;
+ // TODO test perf of Object.keys and switch when support is good enough
+ for (var key in value)
+ {
+ if (value.hasOwnProperty(key))
+ {
+ var result = _Json_runHelp(decoder.b, value[key]);
+ if (!elm$core$Result$isOk(result))
+ {
+ return elm$core$Result$Err(A2(elm$json$Json$Decode$Field, key, result.a));
+ }
+ keyValuePairs = _List_Cons(_Utils_Tuple2(key, result.a), keyValuePairs);
+ }
+ }
+ return elm$core$Result$Ok(elm$core$List$reverse(keyValuePairs));
+
+ case 13:
+ var answer = decoder.f;
+ var decoders = decoder.g;
+ for (var i = 0; i < decoders.length; i++)
+ {
+ var result = _Json_runHelp(decoders[i], value);
+ if (!elm$core$Result$isOk(result))
+ {
+ return result;
+ }
+ answer = answer(result.a);
+ }
+ return elm$core$Result$Ok(answer);
+
+ case 14:
+ var result = _Json_runHelp(decoder.b, value);
+ return (!elm$core$Result$isOk(result))
+ ? result
+ : _Json_runHelp(decoder.h(result.a), value);
+
+ case 15:
+ var errors = _List_Nil;
+ for (var temp = decoder.g; temp.b; temp = temp.b) // WHILE_CONS
+ {
+ var result = _Json_runHelp(temp.a, value);
+ if (elm$core$Result$isOk(result))
+ {
+ return result;
+ }
+ errors = _List_Cons(result.a, errors);
+ }
+ return elm$core$Result$Err(elm$json$Json$Decode$OneOf(elm$core$List$reverse(errors)));
+
+ case 1:
+ return elm$core$Result$Err(A2(elm$json$Json$Decode$Failure, decoder.a, _Json_wrap(value)));
+
+ case 0:
+ return elm$core$Result$Ok(decoder.a);
+ }
+}
+
+function _Json_runArrayDecoder(decoder, value, toElmValue)
+{
+ var len = value.length;
+ var array = new Array(len);
+ for (var i = 0; i < len; i++)
+ {
+ var result = _Json_runHelp(decoder, value[i]);
+ if (!elm$core$Result$isOk(result))
+ {
+ return elm$core$Result$Err(A2(elm$json$Json$Decode$Index, i, result.a));
+ }
+ array[i] = result.a;
+ }
+ return elm$core$Result$Ok(toElmValue(array));
+}
+
+function _Json_toElmArray(array)
+{
+ return A2(elm$core$Array$initialize, array.length, function(i) { return array[i]; });
+}
+
+function _Json_expecting(type, value)
+{
+ return elm$core$Result$Err(A2(elm$json$Json$Decode$Failure, 'Expecting ' + type, _Json_wrap(value)));
+}
+
+
+// EQUALITY
+
+function _Json_equality(x, y)
+{
+ if (x === y)
+ {
+ return true;
+ }
+
+ if (x.$ !== y.$)
+ {
+ return false;
+ }
+
+ switch (x.$)
+ {
+ case 0:
+ case 1:
+ return x.a === y.a;
+
+ case 3:
+ case 2:
+ case 4:
+ case 6:
+ case 5:
+ return true;
+
+ case 9:
+ return x.c === y.c;
+
+ case 7:
+ case 8:
+ case 12:
+ return _Json_equality(x.b, y.b);
+
+ case 10:
+ return x.d === y.d && _Json_equality(x.b, y.b);
+
+ case 11:
+ return x.e === y.e && _Json_equality(x.b, y.b);
+
+ case 13:
+ return x.f === y.f && _Json_listEquality(x.g, y.g);
+
+ case 14:
+ return x.h === y.h && _Json_equality(x.b, y.b);
+
+ case 15:
+ return _Json_listEquality(x.g, y.g);
+ }
+}
+
+function _Json_listEquality(aDecoders, bDecoders)
+{
+ var len = aDecoders.length;
+ if (len !== bDecoders.length)
+ {
+ return false;
+ }
+ for (var i = 0; i < len; i++)
+ {
+ if (!_Json_equality(aDecoders[i], bDecoders[i]))
+ {
+ return false;
+ }
+ }
+ return true;
+}
+
+
+// ENCODE
+
+var _Json_encode = F2(function(indentLevel, value)
+{
+ return JSON.stringify(_Json_unwrap(value), null, indentLevel);
+});
+
+function _Json_wrap_UNUSED(value) { return { $: 0, a: value }; }
+function _Json_unwrap_UNUSED(value) { return value.a; }
+
+function _Json_wrap(value) { return value; }
+function _Json_unwrap(value) { return value; }
+
+function _Json_emptyArray() { return []; }
+function _Json_emptyObject() { return {}; }
+
+var _Json_addField = F3(function(key, value, object)
+{
+ object[key] = _Json_unwrap(value);
+ return object;
+});
+
+function _Json_addEntry(func)
+{
+ return F2(function(entry, array)
+ {
+ array.push(_Json_unwrap(func(entry)));
+ return array;
+ });
+}
+
+var _Json_encodeNull = _Json_wrap(null);
+
+
+
+// TASKS
+
+function _Scheduler_succeed(value)
+{
+ return {
+ $: 0,
+ a: value
+ };
+}
+
+function _Scheduler_fail(error)
+{
+ return {
+ $: 1,
+ a: error
+ };
+}
+
+function _Scheduler_binding(callback)
+{
+ return {
+ $: 2,
+ b: callback,
+ c: null
+ };
+}
+
+var _Scheduler_andThen = F2(function(callback, task)
+{
+ return {
+ $: 3,
+ b: callback,
+ d: task
+ };
+});
+
+var _Scheduler_onError = F2(function(callback, task)
+{
+ return {
+ $: 4,
+ b: callback,
+ d: task
+ };
+});
+
+function _Scheduler_receive(callback)
+{
+ return {
+ $: 5,
+ b: callback
+ };
+}
+
+
+// PROCESSES
+
+var _Scheduler_guid = 0;
+
+function _Scheduler_rawSpawn(task)
+{
+ var proc = {
+ $: 0,
+ e: _Scheduler_guid++,
+ f: task,
+ g: null,
+ h: []
+ };
+
+ _Scheduler_enqueue(proc);
+
+ return proc;
+}
+
+function _Scheduler_spawn(task)
+{
+ return _Scheduler_binding(function(callback) {
+ callback(_Scheduler_succeed(_Scheduler_rawSpawn(task)));
+ });
+}
+
+function _Scheduler_rawSend(proc, msg)
+{
+ proc.h.push(msg);
+ _Scheduler_enqueue(proc);
+}
+
+var _Scheduler_send = F2(function(proc, msg)
+{
+ return _Scheduler_binding(function(callback) {
+ _Scheduler_rawSend(proc, msg);
+ callback(_Scheduler_succeed(_Utils_Tuple0));
+ });
+});
+
+function _Scheduler_kill(proc)
+{
+ return _Scheduler_binding(function(callback) {
+ var task = proc.f;
+ if (task.$ === 2 && task.c)
+ {
+ task.c();
+ }
+
+ proc.f = null;
+
+ callback(_Scheduler_succeed(_Utils_Tuple0));
+ });
+}
+
+
+/* STEP PROCESSES
+
+type alias Process =
+ { $ : tag
+ , id : unique_id
+ , root : Task
+ , stack : null | { $: SUCCEED | FAIL, a: callback, b: stack }
+ , mailbox : [msg]
+ }
+
+*/
+
+
+var _Scheduler_working = false;
+var _Scheduler_queue = [];
+
+
+function _Scheduler_enqueue(proc)
+{
+ _Scheduler_queue.push(proc);
+ if (_Scheduler_working)
+ {
+ return;
+ }
+ _Scheduler_working = true;
+ while (proc = _Scheduler_queue.shift())
+ {
+ _Scheduler_step(proc);
+ }
+ _Scheduler_working = false;
+}
+
+
+function _Scheduler_step(proc)
+{
+ while (proc.f)
+ {
+ var rootTag = proc.f.$;
+ if (rootTag === 0 || rootTag === 1)
+ {
+ while (proc.g && proc.g.$ !== rootTag)
+ {
+ proc.g = proc.g.i;
+ }
+ if (!proc.g)
+ {
+ return;
+ }
+ proc.f = proc.g.b(proc.f.a);
+ proc.g = proc.g.i;
+ }
+ else if (rootTag === 2)
+ {
+ proc.f.c = proc.f.b(function(newRoot) {
+ proc.f = newRoot;
+ _Scheduler_enqueue(proc);
+ });
+ return;
+ }
+ else if (rootTag === 5)
+ {
+ if (proc.h.length === 0)
+ {
+ return;
+ }
+ proc.f = proc.f.b(proc.h.shift());
+ }
+ else // if (rootTag === 3 || rootTag === 4)
+ {
+ proc.g = {
+ $: rootTag === 3 ? 0 : 1,
+ b: proc.f.b,
+ i: proc.g
+ };
+ proc.f = proc.f.d;
+ }
+ }
+}
+
+
+
+function _Process_sleep(time)
+{
+ return _Scheduler_binding(function(callback) {
+ var id = setTimeout(function() {
+ callback(_Scheduler_succeed(_Utils_Tuple0));
+ }, time);
+
+ return function() { clearTimeout(id); };
+ });
+}
+
+
+
+
+// PROGRAMS
+
+
+var _Platform_worker = F4(function(impl, flagDecoder, debugMetadata, args)
+{
+ return _Platform_initialize(
+ flagDecoder,
+ args,
+ impl.bJ,
+ impl.b1,
+ impl.b_,
+ function() { return function() {} }
+ );
+});
+
+
+
+// INITIALIZE A PROGRAM
+
+
+function _Platform_initialize(flagDecoder, args, init, update, subscriptions, stepperBuilder)
+{
+ var result = A2(_Json_run, flagDecoder, _Json_wrap(args ? args['flags'] : undefined));
+ elm$core$Result$isOk(result) || _Debug_crash(2, result.a);
+ var managers = {};
+ result = init(result.a);
+ var model = result.a;
+ var stepper = stepperBuilder(sendToApp, model);
+ var ports = _Platform_setupEffects(managers, sendToApp);
+
+ function sendToApp(msg, viewMetadata)
+ {
+ result = A2(update, msg, model);
+ stepper(model = result.a, viewMetadata);
+ _Platform_dispatchEffects(managers, result.b, subscriptions(model));
+ }
+
+ _Platform_dispatchEffects(managers, result.b, subscriptions(model));
+
+ return ports ? { ports: ports } : {};
+}
+
+
+
+// TRACK PRELOADS
+//
+// This is used by code in elm/browser and elm/http
+// to register any HTTP requests that are triggered by init.
+//
+
+
+var _Platform_preload;
+
+
+function _Platform_registerPreload(url)
+{
+ _Platform_preload.add(url);
+}
+
+
+
+// EFFECT MANAGERS
+
+
+var _Platform_effectManagers = {};
+
+
+function _Platform_setupEffects(managers, sendToApp)
+{
+ var ports;
+
+ // setup all necessary effect managers
+ for (var key in _Platform_effectManagers)
+ {
+ var manager = _Platform_effectManagers[key];
+
+ if (manager.a)
+ {
+ ports = ports || {};
+ ports[key] = manager.a(key, sendToApp);
+ }
+
+ managers[key] = _Platform_instantiateManager(manager, sendToApp);
+ }
+
+ return ports;
+}
+
+
+function _Platform_createManager(init, onEffects, onSelfMsg, cmdMap, subMap)
+{
+ return {
+ b: init,
+ c: onEffects,
+ d: onSelfMsg,
+ e: cmdMap,
+ f: subMap
+ };
+}
+
+
+function _Platform_instantiateManager(info, sendToApp)
+{
+ var router = {
+ g: sendToApp,
+ h: undefined
+ };
+
+ var onEffects = info.c;
+ var onSelfMsg = info.d;
+ var cmdMap = info.e;
+ var subMap = info.f;
+
+ function loop(state)
+ {
+ return A2(_Scheduler_andThen, loop, _Scheduler_receive(function(msg)
+ {
+ var value = msg.a;
+
+ if (msg.$ === 0)
+ {
+ return A3(onSelfMsg, router, value, state);
+ }
+
+ return cmdMap && subMap
+ ? A4(onEffects, router, value.i, value.j, state)
+ : A3(onEffects, router, cmdMap ? value.i : value.j, state);
+ }));
+ }
+
+ return router.h = _Scheduler_rawSpawn(A2(_Scheduler_andThen, loop, info.b));
+}
+
+
+
+// ROUTING
+
+
+var _Platform_sendToApp = F2(function(router, msg)
+{
+ return _Scheduler_binding(function(callback)
+ {
+ router.g(msg);
+ callback(_Scheduler_succeed(_Utils_Tuple0));
+ });
+});
+
+
+var _Platform_sendToSelf = F2(function(router, msg)
+{
+ return A2(_Scheduler_send, router.h, {
+ $: 0,
+ a: msg
+ });
+});
+
+
+
+// BAGS
+
+
+function _Platform_leaf(home)
+{
+ return function(value)
+ {
+ return {
+ $: 1,
+ k: home,
+ l: value
+ };
+ };
+}
+
+
+function _Platform_batch(list)
+{
+ return {
+ $: 2,
+ m: list
+ };
+}
+
+
+var _Platform_map = F2(function(tagger, bag)
+{
+ return {
+ $: 3,
+ n: tagger,
+ o: bag
+ }
+});
+
+
+
+// PIPE BAGS INTO EFFECT MANAGERS
+
+
+function _Platform_dispatchEffects(managers, cmdBag, subBag)
+{
+ var effectsDict = {};
+ _Platform_gatherEffects(true, cmdBag, effectsDict, null);
+ _Platform_gatherEffects(false, subBag, effectsDict, null);
+
+ for (var home in managers)
+ {
+ _Scheduler_rawSend(managers[home], {
+ $: 'fx',
+ a: effectsDict[home] || { i: _List_Nil, j: _List_Nil }
+ });
+ }
+}
+
+
+function _Platform_gatherEffects(isCmd, bag, effectsDict, taggers)
+{
+ switch (bag.$)
+ {
+ case 1:
+ var home = bag.k;
+ var effect = _Platform_toEffect(isCmd, home, taggers, bag.l);
+ effectsDict[home] = _Platform_insert(isCmd, effect, effectsDict[home]);
+ return;
+
+ case 2:
+ for (var list = bag.m; list.b; list = list.b) // WHILE_CONS
+ {
+ _Platform_gatherEffects(isCmd, list.a, effectsDict, taggers);
+ }
+ return;
+
+ case 3:
+ _Platform_gatherEffects(isCmd, bag.o, effectsDict, {
+ p: bag.n,
+ q: taggers
+ });
+ return;
+ }
+}
+
+
+function _Platform_toEffect(isCmd, home, taggers, value)
+{
+ function applyTaggers(x)
+ {
+ for (var temp = taggers; temp; temp = temp.q)
+ {
+ x = temp.p(x);
+ }
+ return x;
+ }
+
+ var map = isCmd
+ ? _Platform_effectManagers[home].e
+ : _Platform_effectManagers[home].f;
+
+ return A2(map, applyTaggers, value)
+}
+
+
+function _Platform_insert(isCmd, newEffect, effects)
+{
+ effects = effects || { i: _List_Nil, j: _List_Nil };
+
+ isCmd
+ ? (effects.i = _List_Cons(newEffect, effects.i))
+ : (effects.j = _List_Cons(newEffect, effects.j));
+
+ return effects;
+}
+
+
+
+// PORTS
+
+
+function _Platform_checkPortName(name)
+{
+ if (_Platform_effectManagers[name])
+ {
+ _Debug_crash(3, name)
+ }
+}
+
+
+
+// OUTGOING PORTS
+
+
+function _Platform_outgoingPort(name, converter)
+{
+ _Platform_checkPortName(name);
+ _Platform_effectManagers[name] = {
+ e: _Platform_outgoingPortMap,
+ r: converter,
+ a: _Platform_setupOutgoingPort
+ };
+ return _Platform_leaf(name);
+}
+
+
+var _Platform_outgoingPortMap = F2(function(tagger, value) { return value; });
+
+
+function _Platform_setupOutgoingPort(name)
+{
+ var subs = [];
+ var converter = _Platform_effectManagers[name].r;
+
+ // CREATE MANAGER
+
+ var init = _Process_sleep(0);
+
+ _Platform_effectManagers[name].b = init;
+ _Platform_effectManagers[name].c = F3(function(router, cmdList, state)
+ {
+ for ( ; cmdList.b; cmdList = cmdList.b) // WHILE_CONS
+ {
+ // grab a separate reference to subs in case unsubscribe is called
+ var currentSubs = subs;
+ var value = _Json_unwrap(converter(cmdList.a));
+ for (var i = 0; i < currentSubs.length; i++)
+ {
+ currentSubs[i](value);
+ }
+ }
+ return init;
+ });
+
+ // 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 _Platform_incomingPort(name, converter)
+{
+ _Platform_checkPortName(name);
+ _Platform_effectManagers[name] = {
+ f: _Platform_incomingPortMap,
+ r: converter,
+ a: _Platform_setupIncomingPort
+ };
+ return _Platform_leaf(name);
+}
+
+
+var _Platform_incomingPortMap = F2(function(tagger, finalTagger)
+{
+ return function(value)
+ {
+ return tagger(finalTagger(value));
+ };
+});
+
+
+function _Platform_setupIncomingPort(name, sendToApp)
+{
+ var subs = _List_Nil;
+ var converter = _Platform_effectManagers[name].r;
+
+ // CREATE MANAGER
+
+ var init = _Scheduler_succeed(null);
+
+ _Platform_effectManagers[name].b = init;
+ _Platform_effectManagers[name].c = F3(function(router, subList, state)
+ {
+ subs = subList;
+ return init;
+ });
+
+ // PUBLIC API
+
+ function send(incomingValue)
+ {
+ var result = A2(_Json_run, converter, _Json_wrap(incomingValue));
+
+ elm$core$Result$isOk(result) || _Debug_crash(4, name, result.a);
+
+ var value = result.a;
+ for (var temp = subs; temp.b; temp = temp.b) // WHILE_CONS
+ {
+ sendToApp(temp.a(value));
+ }
+ }
+
+ return { send: send };
+}
+
+
+
+// EXPORT ELM MODULES
+//
+// Have DEBUG and PROD versions so that we can (1) give nicer errors in
+// debug mode and (2) not pay for the bits needed for that in prod mode.
+//
+
+
+function _Platform_export(exports)
+{
+ scope['Elm']
+ ? _Platform_mergeExportsProd(scope['Elm'], exports)
+ : scope['Elm'] = exports;
+}
+
+
+function _Platform_mergeExportsProd(obj, exports)
+{
+ for (var name in exports)
+ {
+ (name in obj)
+ ? (name == 'init')
+ ? _Debug_crash(6)
+ : _Platform_mergeExportsProd(obj[name], exports[name])
+ : (obj[name] = exports[name]);
+ }
+}
+
+
+function _Platform_export_UNUSED(exports)
+{
+ scope['Elm']
+ ? _Platform_mergeExportsDebug('Elm', scope['Elm'], exports)
+ : scope['Elm'] = exports;
+}
+
+
+function _Platform_mergeExportsDebug(moduleName, obj, exports)
+{
+ for (var name in exports)
+ {
+ (name in obj)
+ ? (name == 'init')
+ ? _Debug_crash(6, moduleName)
+ : _Platform_mergeExportsDebug(moduleName + '.' + name, obj[name], exports[name])
+ : (obj[name] = exports[name]);
+ }
+}
+
+
+
+var _String_cons = F2(function(chr, str)
+{
+ return chr + str;
+});
+
+function _String_uncons(string)
+{
+ var word = string.charCodeAt(0);
+ return word
+ ? elm$core$Maybe$Just(
+ 0xD800 <= word && word <= 0xDBFF
+ ? _Utils_Tuple2(_Utils_chr(string[0] + string[1]), string.slice(2))
+ : _Utils_Tuple2(_Utils_chr(string[0]), string.slice(1))
+ )
+ : elm$core$Maybe$Nothing;
+}
+
+var _String_append = F2(function(a, b)
+{
+ return a + b;
+});
+
+function _String_length(str)
+{
+ return str.length;
+}
+
+var _String_map = F2(function(func, string)
+{
+ var len = string.length;
+ var array = new Array(len);
+ var i = 0;
+ while (i < len)
+ {
+ var word = string.charCodeAt(i);
+ if (0xD800 <= word && word <= 0xDBFF)
+ {
+ array[i] = func(_Utils_chr(string[i] + string[i+1]));
+ i += 2;
+ continue;
+ }
+ array[i] = func(_Utils_chr(string[i]));
+ i++;
+ }
+ return array.join('');
+});
+
+var _String_filter = F2(function(isGood, str)
+{
+ var arr = [];
+ var len = str.length;
+ var i = 0;
+ while (i < len)
+ {
+ var char = str[i];
+ var word = str.charCodeAt(i);
+ i++;
+ if (0xD800 <= word && word <= 0xDBFF)
+ {
+ char += str[i];
+ i++;
+ }
+
+ if (isGood(_Utils_chr(char)))
+ {
+ arr.push(char);
+ }
+ }
+ return arr.join('');
+});
+
+function _String_reverse(str)
+{
+ var len = str.length;
+ var arr = new Array(len);
+ var i = 0;
+ while (i < len)
+ {
+ var word = str.charCodeAt(i);
+ if (0xD800 <= word && word <= 0xDBFF)
+ {
+ arr[len - i] = str[i + 1];
+ i++;
+ arr[len - i] = str[i - 1];
+ i++;
+ }
+ else
+ {
+ arr[len - i] = str[i];
+ i++;
+ }
+ }
+ return arr.join('');
+}
+
+var _String_foldl = F3(function(func, state, string)
+{
+ var len = string.length;
+ var i = 0;
+ while (i < len)
+ {
+ var char = string[i];
+ var word = string.charCodeAt(i);
+ i++;
+ if (0xD800 <= word && word <= 0xDBFF)
+ {
+ char += string[i];
+ i++;
+ }
+ state = A2(func, _Utils_chr(char), state);
+ }
+ return state;
+});
+
+var _String_foldr = F3(function(func, state, string)
+{
+ var i = string.length;
+ while (i--)
+ {
+ var char = string[i];
+ var word = string.charCodeAt(i);
+ if (0xDC00 <= word && word <= 0xDFFF)
+ {
+ i--;
+ char = string[i] + char;
+ }
+ state = A2(func, _Utils_chr(char), state);
+ }
+ return state;
+});
+
+var _String_split = F2(function(sep, str)
+{
+ return str.split(sep);
+});
+
+var _String_join = F2(function(sep, strs)
+{
+ return strs.join(sep);
+});
+
+var _String_slice = F3(function(start, end, str) {
+ return str.slice(start, end);
+});
+
+function _String_trim(str)
+{
+ return str.trim();
+}
+
+function _String_trimLeft(str)
+{
+ return str.replace(/^\s+/, '');
+}
+
+function _String_trimRight(str)
+{
+ return str.replace(/\s+$/, '');
+}
+
+function _String_words(str)
+{
+ return _List_fromArray(str.trim().split(/\s+/g));
+}
+
+function _String_lines(str)
+{
+ return _List_fromArray(str.split(/\r\n|\r|\n/g));
+}
+
+function _String_toUpper(str)
+{
+ return str.toUpperCase();
+}
+
+function _String_toLower(str)
+{
+ return str.toLowerCase();
+}
+
+var _String_any = F2(function(isGood, string)
+{
+ var i = string.length;
+ while (i--)
+ {
+ var char = string[i];
+ var word = string.charCodeAt(i);
+ if (0xDC00 <= word && word <= 0xDFFF)
+ {
+ i--;
+ char = string[i] + char;
+ }
+ if (isGood(_Utils_chr(char)))
+ {
+ return true;
+ }
+ }
+ return false;
+});
+
+var _String_all = F2(function(isGood, string)
+{
+ var i = string.length;
+ while (i--)
+ {
+ var char = string[i];
+ var word = string.charCodeAt(i);
+ if (0xDC00 <= word && word <= 0xDFFF)
+ {
+ i--;
+ char = string[i] + char;
+ }
+ if (!isGood(_Utils_chr(char)))
+ {
+ return false;
+ }
+ }
+ return true;
+});
+
+var _String_contains = F2(function(sub, str)
+{
+ return str.indexOf(sub) > -1;
+});
+
+var _String_startsWith = F2(function(sub, str)
+{
+ return str.indexOf(sub) === 0;
+});
+
+var _String_endsWith = F2(function(sub, str)
+{
+ return str.length >= sub.length &&
+ str.lastIndexOf(sub) === str.length - sub.length;
+});
+
+var _String_indexes = F2(function(sub, str)
+{
+ var subLen = sub.length;
+
+ if (subLen < 1)
+ {
+ return _List_Nil;
+ }
+
+ var i = 0;
+ var is = [];
+
+ while ((i = str.indexOf(sub, i)) > -1)
+ {
+ is.push(i);
+ i = i + subLen;
+ }
+
+ return _List_fromArray(is);
+});
+
+
+// TO STRING
+
+function _String_fromNumber(number)
+{
+ return number + '';
+}
+
+
+// INT CONVERSIONS
+
+function _String_toInt(str)
+{
+ var total = 0;
+ var code0 = str.charCodeAt(0);
+ var start = code0 == 0x2B /* + */ || code0 == 0x2D /* - */ ? 1 : 0;
+
+ for (var i = start; i < str.length; ++i)
+ {
+ var code = str.charCodeAt(i);
+ if (code < 0x30 || 0x39 < code)
+ {
+ return elm$core$Maybe$Nothing;
+ }
+ total = 10 * total + code - 0x30;
+ }
+
+ return i == start
+ ? elm$core$Maybe$Nothing
+ : elm$core$Maybe$Just(code0 == 0x2D ? -total : total);
+}
+
+
+// FLOAT CONVERSIONS
+
+function _String_toFloat(s)
+{
+ // check if it is a hex, octal, or binary number
+ if (s.length === 0 || /[\sxbo]/.test(s))
+ {
+ return elm$core$Maybe$Nothing;
+ }
+ var n = +s;
+ // faster isNaN check
+ return n === n ? elm$core$Maybe$Just(n) : elm$core$Maybe$Nothing;
+}
+
+function _String_fromList(chars)
+{
+ return _List_toArray(chars).join('');
+}
+
+
+
+
+// SEND REQUEST
+
+var _Http_toTask = F2(function(request, maybeProgress)
+{
+ return _Scheduler_binding(function(callback)
+ {
+ var xhr = new XMLHttpRequest();
+
+ _Http_configureProgress(xhr, maybeProgress);
+
+ xhr.addEventListener('error', function() {
+ callback(_Scheduler_fail(elm$http$Http$NetworkError));
+ });
+ xhr.addEventListener('timeout', function() {
+ callback(_Scheduler_fail(elm$http$Http$Timeout));
+ });
+ xhr.addEventListener('load', function() {
+ callback(_Http_handleResponse(xhr, request.ab.a));
+ });
+
+ try
+ {
+ xhr.open(request.ad, request.b2, true);
+ }
+ catch (e)
+ {
+ return callback(_Scheduler_fail(elm$http$Http$BadUrl(request.b2)));
+ }
+
+ _Http_configureRequest(xhr, request);
+
+ var body = request.bm;
+ xhr.send(elm$http$Http$Internal$isStringBody(body)
+ ? (xhr.setRequestHeader('Content-Type', body.a), body.b)
+ : body.a
+ );
+
+ return function() { xhr.abort(); };
+ });
+});
+
+function _Http_configureProgress(xhr, maybeProgress)
+{
+ if (!elm$core$Maybe$isJust(maybeProgress))
+ {
+ return;
+ }
+
+ xhr.addEventListener('progress', function(event) {
+ if (!event.lengthComputable)
+ {
+ return;
+ }
+ _Scheduler_rawSpawn(maybeProgress.a({
+ bn: event.loaded,
+ bo: event.total
+ }));
+ });
+}
+
+function _Http_configureRequest(xhr, request)
+{
+ for (var headers = request.V; headers.b; headers = headers.b) // WHILE_CONS
+ {
+ xhr.setRequestHeader(headers.a.a, headers.a.b);
+ }
+
+ xhr.responseType = request.ab.b;
+ xhr.withCredentials = request.aD;
+
+ elm$core$Maybe$isJust(request.aC) && (xhr.timeout = request.aC.a);
+}
+
+
+// RESPONSES
+
+function _Http_handleResponse(xhr, responseToResult)
+{
+ var response = _Http_toResponse(xhr);
+
+ if (xhr.status < 200 || 300 <= xhr.status)
+ {
+ response.body = xhr.responseText;
+ return _Scheduler_fail(elm$http$Http$BadStatus(response));
+ }
+
+ var result = responseToResult(response);
+
+ if (elm$core$Result$isOk(result))
+ {
+ return _Scheduler_succeed(result.a);
+ }
+ else
+ {
+ response.body = xhr.responseText;
+ return _Scheduler_fail(A2(elm$http$Http$BadPayload, result.a, response));
+ }
+}
+
+function _Http_toResponse(xhr)
+{
+ return {
+ b2: xhr.responseURL,
+ bb: { br: xhr.status, bN: xhr.statusText },
+ V: _Http_parseHeaders(xhr.getAllResponseHeaders()),
+ bm: xhr.response
+ };
+}
+
+function _Http_parseHeaders(rawHeaders)
+{
+ var headers = elm$core$Dict$empty;
+
+ if (!rawHeaders)
+ {
+ return headers;
+ }
+
+ var headerPairs = rawHeaders.split('\u000d\u000a');
+ for (var i = headerPairs.length; i--; )
+ {
+ var headerPair = headerPairs[i];
+ var index = headerPair.indexOf('\u003a\u0020');
+ if (index > 0)
+ {
+ var key = headerPair.substring(0, index);
+ var value = headerPair.substring(index + 2);
+
+ headers = A3(elm$core$Dict$update, key, function(oldValue) {
+ return elm$core$Maybe$Just(elm$core$Maybe$isJust(oldValue)
+ ? value + ', ' + oldValue.a
+ : value
+ );
+ }, headers);
+ }
+ }
+
+ return headers;
+}
+
+
+// EXPECTORS
+
+function _Http_expectStringResponse(responseToResult)
+{
+ return {
+ $: 0,
+ b: 'text',
+ a: responseToResult
+ };
+}
+
+var _Http_mapExpect = F2(function(func, expect)
+{
+ return {
+ $: 0,
+ b: expect.b,
+ a: function(response) {
+ var convertedResponse = expect.a(response);
+ return A2(elm$core$Result$map, func, convertedResponse);
+ }
+ };
+});
+
+
+// BODY
+
+function _Http_multipart(parts)
+{
+
+
+ for (var formData = new FormData(); parts.b; parts = parts.b) // WHILE_CONS
+ {
+ var part = parts.a;
+ formData.append(part.a, part.b);
+ }
+
+ return elm$http$Http$Internal$FormDataBody(formData);
+}
+
+
+
+function _Char_toCode(char)
+{
+ var code = char.charCodeAt(0);
+ if (0xD800 <= code && code <= 0xDBFF)
+ {
+ return (code - 0xD800) * 0x400 + char.charCodeAt(1) - 0xDC00 + 0x10000
+ }
+ return code;
+}
+
+function _Char_fromCode(code)
+{
+ return _Utils_chr(
+ (code < 0 || 0x10FFFF < code)
+ ? '\uFFFD'
+ :
+ (code <= 0xFFFF)
+ ? String.fromCharCode(code)
+ :
+ (code -= 0x10000,
+ String.fromCharCode(Math.floor(code / 0x400) + 0xD800)
+ +
+ String.fromCharCode(code % 0x400 + 0xDC00)
+ )
+ );
+}
+
+function _Char_toUpper(char)
+{
+ return _Utils_chr(char.toUpperCase());
+}
+
+function _Char_toLower(char)
+{
+ return _Utils_chr(char.toLowerCase());
+}
+
+function _Char_toLocaleUpper(char)
+{
+ return _Utils_chr(char.toLocaleUpperCase());
+}
+
+function _Char_toLocaleLower(char)
+{
+ return _Utils_chr(char.toLocaleLowerCase());
+}
+
+
+
+
+// STRINGS
+
+
+var _Parser_isSubString = F5(function(smallString, offset, row, col, bigString)
+{
+ var smallLength = smallString.length;
+ var isGood = offset + smallLength <= bigString.length;
+
+ for (var i = 0; isGood && i < smallLength; )
+ {
+ var code = bigString.charCodeAt(offset);
+ isGood =
+ smallString[i++] === bigString[offset++]
+ && (
+ code === 0x000A /* \n */
+ ? ( row++, col=1 )
+ : ( col++, (code & 0xF800) === 0xD800 ? smallString[i++] === bigString[offset++] : 1 )
+ )
+ }
+
+ return _Utils_Tuple3(isGood ? offset : -1, row, col);
+});
+
+
+
+// CHARS
+
+
+var _Parser_isSubChar = F3(function(predicate, offset, string)
+{
+ return (
+ string.length <= offset
+ ? -1
+ :
+ (string.charCodeAt(offset) & 0xF800) === 0xD800
+ ? (predicate(_Utils_chr(string.substr(offset, 2))) ? offset + 2 : -1)
+ :
+ (predicate(_Utils_chr(string[offset]))
+ ? ((string[offset] === '\n') ? -2 : (offset + 1))
+ : -1
+ )
+ );
+});
+
+
+var _Parser_isAsciiCode = F3(function(code, offset, string)
+{
+ return string.charCodeAt(offset) === code;
+});
+
+
+
+// NUMBERS
+
+
+var _Parser_chompBase10 = F2(function(offset, string)
+{
+ for (; offset < string.length; offset++)
+ {
+ var code = string.charCodeAt(offset);
+ if (code < 0x30 || 0x39 < code)
+ {
+ return offset;
+ }
+ }
+ return offset;
+});
+
+
+var _Parser_consumeBase = F3(function(base, offset, string)
+{
+ for (var total = 0; offset < string.length; offset++)
+ {
+ var digit = string.charCodeAt(offset) - 0x30;
+ if (digit < 0 || base <= digit) break;
+ total = base * total + digit;
+ }
+ return _Utils_Tuple2(offset, total);
+});
+
+
+var _Parser_consumeBase16 = F2(function(offset, string)
+{
+ for (var total = 0; offset < string.length; offset++)
+ {
+ var code = string.charCodeAt(offset);
+ if (0x30 <= code && code <= 0x39)
+ {
+ total = 16 * total + code - 0x30;
+ }
+ else if (0x41 <= code && code <= 0x46)
+ {
+ total = 16 * total + code - 55;
+ }
+ else if (0x61 <= code && code <= 0x66)
+ {
+ total = 16 * total + code - 87;
+ }
+ else
+ {
+ break;
+ }
+ }
+ return _Utils_Tuple2(offset, total);
+});
+
+
+
+// FIND STRING
+
+
+var _Parser_findSubString = F5(function(smallString, offset, row, col, bigString)
+{
+ var newOffset = bigString.indexOf(smallString, offset);
+ var target = newOffset < 0 ? bigString.length : newOffset + smallString.length;
+
+ while (offset < target)
+ {
+ var code = bigString.charCodeAt(offset++);
+ code === 0x000A /* \n */
+ ? ( col=1, row++ )
+ : ( col++, (code & 0xF800) === 0xD800 && offset++ )
+ }
+
+ return _Utils_Tuple3(newOffset, row, col);
+});
+
+
+
+var _Bitwise_and = F2(function(a, b)
+{
+ return a & b;
+});
+
+var _Bitwise_or = F2(function(a, b)
+{
+ return a | b;
+});
+
+var _Bitwise_xor = F2(function(a, b)
+{
+ return a ^ b;
+});
+
+function _Bitwise_complement(a)
+{
+ return ~a;
+};
+
+var _Bitwise_shiftLeftBy = F2(function(offset, a)
+{
+ return a << offset;
+});
+
+var _Bitwise_shiftRightBy = F2(function(offset, a)
+{
+ return a >> offset;
+});
+
+var _Bitwise_shiftRightZfBy = F2(function(offset, a)
+{
+ return a >>> offset;
+});
+
+
+
+
+// HELPERS
+
+
+var _VirtualDom_divertHrefToApp;
+
+var _VirtualDom_doc = typeof document !== 'undefined' ? document : {};
+
+
+function _VirtualDom_appendChild(parent, child)
+{
+ parent.appendChild(child);
+}
+
+var _VirtualDom_init = F4(function(virtualNode, flagDecoder, debugMetadata, args)
+{
+ // NOTE: this function needs _Platform_export available to work
+
+ /**/
+ var node = args['node'];
+ //*/
+ /**_UNUSED/
+ var node = args && args['node'] ? args['node'] : _Debug_crash(0);
+ //*/
+
+ node.parentNode.replaceChild(
+ _VirtualDom_render(virtualNode, function() {}),
+ node
+ );
+
+ return {};
+});
+
+
+
+// TEXT
+
+
+function _VirtualDom_text(string)
+{
+ return {
+ $: 0,
+ a: string
+ };
+}
+
+
+
+// NODE
+
+
+var _VirtualDom_nodeNS = F2(function(namespace, tag)
+{
+ return F2(function(factList, kidList)
+ {
+ for (var kids = [], descendantsCount = 0; kidList.b; kidList = kidList.b) // WHILE_CONS
+ {
+ var kid = kidList.a;
+ descendantsCount += (kid.b || 0);
+ kids.push(kid);
+ }
+ descendantsCount += kids.length;
+
+ return {
+ $: 1,
+ c: tag,
+ d: _VirtualDom_organizeFacts(factList),
+ e: kids,
+ f: namespace,
+ b: descendantsCount
+ };
+ });
+});
+
+
+var _VirtualDom_node = _VirtualDom_nodeNS(undefined);
+
+
+
+// KEYED NODE
+
+
+var _VirtualDom_keyedNodeNS = F2(function(namespace, tag)
+{
+ return F2(function(factList, kidList)
+ {
+ for (var kids = [], descendantsCount = 0; kidList.b; kidList = kidList.b) // WHILE_CONS
+ {
+ var kid = kidList.a;
+ descendantsCount += (kid.b.b || 0);
+ kids.push(kid);
+ }
+ descendantsCount += kids.length;
+
+ return {
+ $: 2,
+ c: tag,
+ d: _VirtualDom_organizeFacts(factList),
+ e: kids,
+ f: namespace,
+ b: descendantsCount
+ };
+ });
+});
+
+
+var _VirtualDom_keyedNode = _VirtualDom_keyedNodeNS(undefined);
+
+
+
+// CUSTOM
+
+
+function _VirtualDom_custom(factList, model, render, diff)
+{
+ return {
+ $: 3,
+ d: _VirtualDom_organizeFacts(factList),
+ g: model,
+ h: render,
+ i: diff
+ };
+}
+
+
+
+// MAP
+
+
+var _VirtualDom_map = F2(function(tagger, node)
+{
+ return {
+ $: 4,
+ j: tagger,
+ k: node,
+ b: 1 + (node.b || 0)
+ };
+});
+
+
+
+// LAZY
+
+
+function _VirtualDom_thunk(refs, thunk)
+{
+ return {
+ $: 5,
+ l: refs,
+ m: thunk,
+ k: undefined
+ };
+}
+
+var _VirtualDom_lazy = F2(function(func, a)
+{
+ return _VirtualDom_thunk([func, a], function() {
+ return func(a);
+ });
+});
+
+var _VirtualDom_lazy2 = F3(function(func, a, b)
+{
+ return _VirtualDom_thunk([func, a, b], function() {
+ return A2(func, a, b);
+ });
+});
+
+var _VirtualDom_lazy3 = F4(function(func, a, b, c)
+{
+ return _VirtualDom_thunk([func, a, b, c], function() {
+ return A3(func, a, b, c);
+ });
+});
+
+var _VirtualDom_lazy4 = F5(function(func, a, b, c, d)
+{
+ return _VirtualDom_thunk([func, a, b, c, d], function() {
+ return A4(func, a, b, c, d);
+ });
+});
+
+var _VirtualDom_lazy5 = F6(function(func, a, b, c, d, e)
+{
+ return _VirtualDom_thunk([func, a, b, c, d, e], function() {
+ return A5(func, a, b, c, d, e);
+ });
+});
+
+var _VirtualDom_lazy6 = F7(function(func, a, b, c, d, e, f)
+{
+ return _VirtualDom_thunk([func, a, b, c, d, e, f], function() {
+ return A6(func, a, b, c, d, e, f);
+ });
+});
+
+var _VirtualDom_lazy7 = F8(function(func, a, b, c, d, e, f, g)
+{
+ return _VirtualDom_thunk([func, a, b, c, d, e, f, g], function() {
+ return A7(func, a, b, c, d, e, f, g);
+ });
+});
+
+var _VirtualDom_lazy8 = F9(function(func, a, b, c, d, e, f, g, h)
+{
+ return _VirtualDom_thunk([func, a, b, c, d, e, f, g, h], function() {
+ return A8(func, a, b, c, d, e, f, g, h);
+ });
+});
+
+
+
+// FACTS
+
+
+var _VirtualDom_on = F2(function(key, handler)
+{
+ return {
+ $: 'a0',
+ n: key,
+ o: handler
+ };
+});
+var _VirtualDom_style = F2(function(key, value)
+{
+ return {
+ $: 'a1',
+ n: key,
+ o: value
+ };
+});
+var _VirtualDom_property = F2(function(key, value)
+{
+ return {
+ $: 'a2',
+ n: key,
+ o: value
+ };
+});
+var _VirtualDom_attribute = F2(function(key, value)
+{
+ return {
+ $: 'a3',
+ n: key,
+ o: value
+ };
+});
+var _VirtualDom_attributeNS = F3(function(namespace, key, value)
+{
+ return {
+ $: 'a4',
+ n: key,
+ o: { f: namespace, o: value }
+ };
+});
+
+
+
+// XSS ATTACK VECTOR CHECKS
+
+
+function _VirtualDom_noScript(tag)
+{
+ return tag == 'script' ? 'p' : tag;
+}
+
+function _VirtualDom_noOnOrFormAction(key)
+{
+ return /^(on|formAction$)/i.test(key) ? 'data-' + key : key;
+}
+
+function _VirtualDom_noInnerHtmlOrFormAction(key)
+{
+ return key == 'innerHTML' || key == 'formAction' ? 'data-' + key : key;
+}
+
+function _VirtualDom_noJavaScriptUri(value)
+{
+ return /^\s*javascript:/i.test(value) ? '' : value;
+}
+
+function _VirtualDom_noJavaScriptUri_UNUSED(value)
+{
+ return /^\s*javascript:/i.test(value)
+ ? 'javascript:alert("This is an XSS vector. Please use ports or web components instead.")'
+ : value;
+}
+
+function _VirtualDom_noJavaScriptOrHtmlUri(value)
+{
+ return /^\s*(javascript:|data:text\/html)/i.test(value) ? '' : value;
+}
+
+function _VirtualDom_noJavaScriptOrHtmlUri_UNUSED(value)
+{
+ return /^\s*(javascript:|data:text\/html)/i.test(value)
+ ? 'javascript:alert("This is an XSS vector. Please use ports or web components instead.")'
+ : value;
+}
+
+
+
+// MAP FACTS
+
+
+var _VirtualDom_mapAttribute = F2(function(func, attr)
+{
+ return (attr.$ === 'a0')
+ ? A2(_VirtualDom_on, attr.n, _VirtualDom_mapHandler(func, attr.o))
+ : attr;
+});
+
+function _VirtualDom_mapHandler(func, handler)
+{
+ var tag = elm$virtual_dom$VirtualDom$toHandlerInt(handler);
+
+ // 0 = Normal
+ // 1 = MayStopPropagation
+ // 2 = MayPreventDefault
+ // 3 = Custom
+
+ return {
+ $: handler.$,
+ a:
+ !tag
+ ? A2(elm$json$Json$Decode$map, func, handler.a)
+ :
+ A3(elm$json$Json$Decode$map2,
+ tag < 3
+ ? _VirtualDom_mapEventTuple
+ : _VirtualDom_mapEventRecord,
+ elm$json$Json$Decode$succeed(func),
+ handler.a
+ )
+ };
+}
+
+var _VirtualDom_mapEventTuple = F2(function(func, tuple)
+{
+ return _Utils_Tuple2(func(tuple.a), tuple.b);
+});
+
+var _VirtualDom_mapEventRecord = F2(function(func, record)
+{
+ return {
+ bN: func(record.bN),
+ aA: record.aA,
+ ay: record.ay
+ }
+});
+
+
+
+// ORGANIZE FACTS
+
+
+function _VirtualDom_organizeFacts(factList)
+{
+ for (var facts = {}; factList.b; factList = factList.b) // WHILE_CONS
+ {
+ var entry = factList.a;
+
+ var tag = entry.$;
+ var key = entry.n;
+ var value = entry.o;
+
+ if (tag === 'a2')
+ {
+ (key === 'className')
+ ? _VirtualDom_addClass(facts, key, _Json_unwrap(value))
+ : facts[key] = _Json_unwrap(value);
+
+ continue;
+ }
+
+ var subFacts = facts[tag] || (facts[tag] = {});
+ (tag === 'a3' && key === 'class')
+ ? _VirtualDom_addClass(subFacts, key, value)
+ : subFacts[key] = value;
+ }
+
+ return facts;
+}
+
+function _VirtualDom_addClass(object, key, newClass)
+{
+ var classes = object[key];
+ object[key] = classes ? classes + ' ' + newClass : newClass;
+}
+
+
+
+// RENDER
+
+
+function _VirtualDom_render(vNode, eventNode)
+{
+ var tag = vNode.$;
+
+ if (tag === 5)
+ {
+ return _VirtualDom_render(vNode.k || (vNode.k = vNode.m()), eventNode);
+ }
+
+ if (tag === 0)
+ {
+ return _VirtualDom_doc.createTextNode(vNode.a);
+ }
+
+ if (tag === 4)
+ {
+ var subNode = vNode.k;
+ var tagger = vNode.j;
+
+ while (subNode.$ === 4)
+ {
+ typeof tagger !== 'object'
+ ? tagger = [tagger, subNode.j]
+ : tagger.push(subNode.j);
+
+ subNode = subNode.k;
+ }
+
+ var subEventRoot = { j: tagger, p: eventNode };
+ var domNode = _VirtualDom_render(subNode, subEventRoot);
+ domNode.elm_event_node_ref = subEventRoot;
+ return domNode;
+ }
+
+ if (tag === 3)
+ {
+ var domNode = vNode.h(vNode.g);
+ _VirtualDom_applyFacts(domNode, eventNode, vNode.d);
+ return domNode;
+ }
+
+ // at this point `tag` must be 1 or 2
+
+ var domNode = vNode.f
+ ? _VirtualDom_doc.createElementNS(vNode.f, vNode.c)
+ : _VirtualDom_doc.createElement(vNode.c);
+
+ if (_VirtualDom_divertHrefToApp && vNode.c == 'a')
+ {
+ domNode.addEventListener('click', _VirtualDom_divertHrefToApp(domNode));
+ }
+
+ _VirtualDom_applyFacts(domNode, eventNode, vNode.d);
+
+ for (var kids = vNode.e, i = 0; i < kids.length; i++)
+ {
+ _VirtualDom_appendChild(domNode, _VirtualDom_render(tag === 1 ? kids[i] : kids[i].b, eventNode));
+ }
+
+ return domNode;
+}
+
+
+
+// APPLY FACTS
+
+
+function _VirtualDom_applyFacts(domNode, eventNode, facts)
+{
+ for (var key in facts)
+ {
+ var value = facts[key];
+
+ key === 'a1'
+ ? _VirtualDom_applyStyles(domNode, value)
+ :
+ key === 'a0'
+ ? _VirtualDom_applyEvents(domNode, eventNode, value)
+ :
+ key === 'a3'
+ ? _VirtualDom_applyAttrs(domNode, value)
+ :
+ key === 'a4'
+ ? _VirtualDom_applyAttrsNS(domNode, value)
+ :
+ (key !== 'value' || domNode[key] !== value) && (domNode[key] = value);
+ }
+}
+
+
+
+// APPLY STYLES
+
+
+function _VirtualDom_applyStyles(domNode, styles)
+{
+ var domNodeStyle = domNode.style;
+
+ for (var key in styles)
+ {
+ domNodeStyle[key] = styles[key];
+ }
+}
+
+
+
+// APPLY ATTRS
+
+
+function _VirtualDom_applyAttrs(domNode, attrs)
+{
+ for (var key in attrs)
+ {
+ var value = attrs[key];
+ value
+ ? domNode.setAttribute(key, value)
+ : domNode.removeAttribute(key);
+ }
+}
+
+
+
+// APPLY NAMESPACED ATTRS
+
+
+function _VirtualDom_applyAttrsNS(domNode, nsAttrs)
+{
+ for (var key in nsAttrs)
+ {
+ var pair = nsAttrs[key];
+ var namespace = pair.f;
+ var value = pair.o;
+
+ value
+ ? domNode.setAttributeNS(namespace, key, value)
+ : domNode.removeAttributeNS(namespace, key);
+ }
+}
+
+
+
+// APPLY EVENTS
+
+
+function _VirtualDom_applyEvents(domNode, eventNode, events)
+{
+ var allCallbacks = domNode.elmFs || (domNode.elmFs = {});
+
+ for (var key in events)
+ {
+ var newHandler = events[key];
+ var oldCallback = allCallbacks[key];
+
+ if (!newHandler)
+ {
+ domNode.removeEventListener(key, oldCallback);
+ allCallbacks[key] = undefined;
+ continue;
+ }
+
+ if (oldCallback)
+ {
+ var oldHandler = oldCallback.q;
+ if (oldHandler.$ === newHandler.$)
+ {
+ oldCallback.q = newHandler;
+ continue;
+ }
+ domNode.removeEventListener(key, oldCallback);
+ }
+
+ oldCallback = _VirtualDom_makeCallback(eventNode, newHandler);
+ domNode.addEventListener(key, oldCallback,
+ _VirtualDom_passiveSupported
+ && { passive: elm$virtual_dom$VirtualDom$toHandlerInt(newHandler) < 2 }
+ );
+ allCallbacks[key] = oldCallback;
+ }
+}
+
+
+
+// PASSIVE EVENTS
+
+
+var _VirtualDom_passiveSupported;
+
+try
+{
+ window.addEventListener('t', null, Object.defineProperty({}, 'passive', {
+ get: function() { _VirtualDom_passiveSupported = true; }
+ }));
+}
+catch(e) {}
+
+
+
+// EVENT HANDLERS
+
+
+function _VirtualDom_makeCallback(eventNode, initialHandler)
+{
+ function callback(event)
+ {
+ var handler = callback.q;
+ var result = _Json_runHelp(handler.a, event);
+
+ if (!elm$core$Result$isOk(result))
+ {
+ return;
+ }
+
+ var tag = elm$virtual_dom$VirtualDom$toHandlerInt(handler);
+
+ // 0 = Normal
+ // 1 = MayStopPropagation
+ // 2 = MayPreventDefault
+ // 3 = Custom
+
+ var value = result.a;
+ var message = !tag ? value : tag < 3 ? value.a : value.bN;
+ var stopPropagation = tag == 1 ? value.b : tag == 3 && value.aA;
+ var currentEventNode = (
+ stopPropagation && event.stopPropagation(),
+ (tag == 2 ? value.b : tag == 3 && value.ay) && event.preventDefault(),
+ eventNode
+ );
+ var tagger;
+ var i;
+ while (tagger = currentEventNode.j)
+ {
+ if (typeof tagger == 'function')
+ {
+ message = tagger(message);
+ }
+ else
+ {
+ for (var i = tagger.length; i--; )
+ {
+ message = tagger[i](message);
+ }
+ }
+ currentEventNode = currentEventNode.p;
+ }
+ currentEventNode(message, stopPropagation); // stopPropagation implies isSync
+ }
+
+ callback.q = initialHandler;
+
+ return callback;
+}
+
+function _VirtualDom_equalEvents(x, y)
+{
+ return x.$ == y.$ && _Json_equality(x.a, y.a);
+}
+
+
+
+// DIFF
+
+
+// TODO: Should we do patches like in iOS?
+//
+// type Patch
+// = At Int Patch
+// | Batch (List Patch)
+// | Change ...
+//
+// How could it not be better?
+//
+function _VirtualDom_diff(x, y)
+{
+ var patches = [];
+ _VirtualDom_diffHelp(x, y, patches, 0);
+ return patches;
+}
+
+
+function _VirtualDom_pushPatch(patches, type, index, data)
+{
+ var patch = {
+ $: type,
+ r: index,
+ s: data,
+ t: undefined,
+ u: undefined
+ };
+ patches.push(patch);
+ return patch;
+}
+
+
+function _VirtualDom_diffHelp(x, y, patches, index)
+{
+ if (x === y)
+ {
+ return;
+ }
+
+ var xType = x.$;
+ var yType = y.$;
+
+ // Bail if you run into different types of nodes. Implies that the
+ // structure has changed significantly and it's not worth a diff.
+ if (xType !== yType)
+ {
+ if (xType === 1 && yType === 2)
+ {
+ y = _VirtualDom_dekey(y);
+ yType = 1;
+ }
+ else
+ {
+ _VirtualDom_pushPatch(patches, 0, index, y);
+ return;
+ }
+ }
+
+ // Now we know that both nodes are the same $.
+ switch (yType)
+ {
+ case 5:
+ var xRefs = x.l;
+ var yRefs = y.l;
+ var i = xRefs.length;
+ var same = i === yRefs.length;
+ while (same && i--)
+ {
+ same = xRefs[i] === yRefs[i];
+ }
+ if (same)
+ {
+ y.k = x.k;
+ return;
+ }
+ y.k = y.m();
+ var subPatches = [];
+ _VirtualDom_diffHelp(x.k, y.k, subPatches, 0);
+ subPatches.length > 0 && _VirtualDom_pushPatch(patches, 1, index, subPatches);
+ return;
+
+ case 4:
+ // gather nested taggers
+ var xTaggers = x.j;
+ var yTaggers = y.j;
+ var nesting = false;
+
+ var xSubNode = x.k;
+ while (xSubNode.$ === 4)
+ {
+ nesting = true;
+
+ typeof xTaggers !== 'object'
+ ? xTaggers = [xTaggers, xSubNode.j]
+ : xTaggers.push(xSubNode.j);
+
+ xSubNode = xSubNode.k;
+ }
+
+ var ySubNode = y.k;
+ while (ySubNode.$ === 4)
+ {
+ nesting = true;
+
+ typeof yTaggers !== 'object'
+ ? yTaggers = [yTaggers, ySubNode.j]
+ : yTaggers.push(ySubNode.j);
+
+ ySubNode = ySubNode.k;
+ }
+
+ // Just bail if different numbers of taggers. This implies the
+ // structure of the virtual DOM has changed.
+ if (nesting && xTaggers.length !== yTaggers.length)
+ {
+ _VirtualDom_pushPatch(patches, 0, index, y);
+ return;
+ }
+
+ // check if taggers are "the same"
+ if (nesting ? !_VirtualDom_pairwiseRefEqual(xTaggers, yTaggers) : xTaggers !== yTaggers)
+ {
+ _VirtualDom_pushPatch(patches, 2, index, yTaggers);
+ }
+
+ // diff everything below the taggers
+ _VirtualDom_diffHelp(xSubNode, ySubNode, patches, index + 1);
+ return;
+
+ case 0:
+ if (x.a !== y.a)
+ {
+ _VirtualDom_pushPatch(patches, 3, index, y.a);
+ }
+ return;
+
+ case 1:
+ _VirtualDom_diffNodes(x, y, patches, index, _VirtualDom_diffKids);
+ return;
+
+ case 2:
+ _VirtualDom_diffNodes(x, y, patches, index, _VirtualDom_diffKeyedKids);
+ return;
+
+ case 3:
+ if (x.h !== y.h)
+ {
+ _VirtualDom_pushPatch(patches, 0, index, y);
+ return;
+ }
+
+ var factsDiff = _VirtualDom_diffFacts(x.d, y.d);
+ factsDiff && _VirtualDom_pushPatch(patches, 4, index, factsDiff);
+
+ var patch = y.i(x.g, y.g);
+ patch && _VirtualDom_pushPatch(patches, 5, index, patch);
+
+ return;
+ }
+}
+
+// assumes the incoming arrays are the same length
+function _VirtualDom_pairwiseRefEqual(as, bs)
+{
+ for (var i = 0; i < as.length; i++)
+ {
+ if (as[i] !== bs[i])
+ {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+function _VirtualDom_diffNodes(x, y, patches, index, diffKids)
+{
+ // Bail if obvious indicators have changed. Implies more serious
+ // structural changes such that it's not worth it to diff.
+ if (x.c !== y.c || x.f !== y.f)
+ {
+ _VirtualDom_pushPatch(patches, 0, index, y);
+ return;
+ }
+
+ var factsDiff = _VirtualDom_diffFacts(x.d, y.d);
+ factsDiff && _VirtualDom_pushPatch(patches, 4, index, factsDiff);
+
+ diffKids(x, y, patches, index);
+}
+
+
+
+// DIFF FACTS
+
+
+// TODO Instead of creating a new diff object, it's possible to just test if
+// there *is* a diff. During the actual patch, do the diff again and make the
+// modifications directly. This way, there's no new allocations. Worth it?
+function _VirtualDom_diffFacts(x, y, category)
+{
+ var diff;
+
+ // look for changes and removals
+ for (var xKey in x)
+ {
+ if (xKey === 'a1' || xKey === 'a0' || xKey === 'a3' || xKey === 'a4')
+ {
+ var subDiff = _VirtualDom_diffFacts(x[xKey], y[xKey] || {}, xKey);
+ if (subDiff)
+ {
+ diff = diff || {};
+ diff[xKey] = subDiff;
+ }
+ continue;
+ }
+
+ // remove if not in the new facts
+ if (!(xKey in y))
+ {
+ diff = diff || {};
+ diff[xKey] =
+ !category
+ ? (typeof x[xKey] === 'string' ? '' : null)
+ :
+ (category === 'a1')
+ ? ''
+ :
+ (category === 'a0' || category === 'a3')
+ ? undefined
+ :
+ { f: x[xKey].f, o: undefined };
+
+ continue;
+ }
+
+ var xValue = x[xKey];
+ var yValue = y[xKey];
+
+ // reference equal, so don't worry about it
+ if (xValue === yValue && xKey !== 'value'
+ || category === 'a0' && _VirtualDom_equalEvents(xValue, yValue))
+ {
+ continue;
+ }
+
+ diff = diff || {};
+ diff[xKey] = yValue;
+ }
+
+ // add new stuff
+ for (var yKey in y)
+ {
+ if (!(yKey in x))
+ {
+ diff = diff || {};
+ diff[yKey] = y[yKey];
+ }
+ }
+
+ return diff;
+}
+
+
+
+// DIFF KIDS
+
+
+function _VirtualDom_diffKids(xParent, yParent, patches, index)
+{
+ var xKids = xParent.e;
+ var yKids = yParent.e;
+
+ var xLen = xKids.length;
+ var yLen = yKids.length;
+
+ // FIGURE OUT IF THERE ARE INSERTS OR REMOVALS
+
+ if (xLen > yLen)
+ {
+ _VirtualDom_pushPatch(patches, 6, index, {
+ v: yLen,
+ i: xLen - yLen
+ });
+ }
+ else if (xLen < yLen)
+ {
+ _VirtualDom_pushPatch(patches, 7, index, {
+ v: xLen,
+ e: yKids
+ });
+ }
+
+ // PAIRWISE DIFF EVERYTHING ELSE
+
+ for (var minLen = xLen < yLen ? xLen : yLen, i = 0; i < minLen; i++)
+ {
+ var xKid = xKids[i];
+ _VirtualDom_diffHelp(xKid, yKids[i], patches, ++index);
+ index += xKid.b || 0;
+ }
+}
+
+
+
+// KEYED DIFF
+
+
+function _VirtualDom_diffKeyedKids(xParent, yParent, patches, rootIndex)
+{
+ var localPatches = [];
+
+ var changes = {}; // Dict String Entry
+ var inserts = []; // Array { index : Int, entry : Entry }
+ // type Entry = { tag : String, vnode : VNode, index : Int, data : _ }
+
+ var xKids = xParent.e;
+ var yKids = yParent.e;
+ var xLen = xKids.length;
+ var yLen = yKids.length;
+ var xIndex = 0;
+ var yIndex = 0;
+
+ var index = rootIndex;
+
+ while (xIndex < xLen && yIndex < yLen)
+ {
+ var x = xKids[xIndex];
+ var y = yKids[yIndex];
+
+ var xKey = x.a;
+ var yKey = y.a;
+ var xNode = x.b;
+ var yNode = y.b;
+
+ // check if keys match
+
+ if (xKey === yKey)
+ {
+ index++;
+ _VirtualDom_diffHelp(xNode, yNode, localPatches, index);
+ index += xNode.b || 0;
+
+ xIndex++;
+ yIndex++;
+ continue;
+ }
+
+ // look ahead 1 to detect insertions and removals.
+
+ var xNext = xKids[xIndex + 1];
+ var yNext = yKids[yIndex + 1];
+
+ if (xNext)
+ {
+ var xNextKey = xNext.a;
+ var xNextNode = xNext.b;
+ var oldMatch = yKey === xNextKey;
+ }
+
+ if (yNext)
+ {
+ var yNextKey = yNext.a;
+ var yNextNode = yNext.b;
+ var newMatch = xKey === yNextKey;
+ }
+
+
+ // swap x and y
+ if (newMatch && oldMatch)
+ {
+ index++;
+ _VirtualDom_diffHelp(xNode, yNextNode, localPatches, index);
+ _VirtualDom_insertNode(changes, localPatches, xKey, yNode, yIndex, inserts);
+ index += xNode.b || 0;
+
+ index++;
+ _VirtualDom_removeNode(changes, localPatches, xKey, xNextNode, index);
+ index += xNextNode.b || 0;
+
+ xIndex += 2;
+ yIndex += 2;
+ continue;
+ }
+
+ // insert y
+ if (newMatch)
+ {
+ index++;
+ _VirtualDom_insertNode(changes, localPatches, yKey, yNode, yIndex, inserts);
+ _VirtualDom_diffHelp(xNode, yNextNode, localPatches, index);
+ index += xNode.b || 0;
+
+ xIndex += 1;
+ yIndex += 2;
+ continue;
+ }
+
+ // remove x
+ if (oldMatch)
+ {
+ index++;
+ _VirtualDom_removeNode(changes, localPatches, xKey, xNode, index);
+ index += xNode.b || 0;
+
+ index++;
+ _VirtualDom_diffHelp(xNextNode, yNode, localPatches, index);
+ index += xNextNode.b || 0;
+
+ xIndex += 2;
+ yIndex += 1;
+ continue;
+ }
+
+ // remove x, insert y
+ if (xNext && xNextKey === yNextKey)
+ {
+ index++;
+ _VirtualDom_removeNode(changes, localPatches, xKey, xNode, index);
+ _VirtualDom_insertNode(changes, localPatches, yKey, yNode, yIndex, inserts);
+ index += xNode.b || 0;
+
+ index++;
+ _VirtualDom_diffHelp(xNextNode, yNextNode, localPatches, index);
+ index += xNextNode.b || 0;
+
+ xIndex += 2;
+ yIndex += 2;
+ continue;
+ }
+
+ break;
+ }
+
+ // eat up any remaining nodes with removeNode and insertNode
+
+ while (xIndex < xLen)
+ {
+ index++;
+ var x = xKids[xIndex];
+ var xNode = x.b;
+ _VirtualDom_removeNode(changes, localPatches, x.a, xNode, index);
+ index += xNode.b || 0;
+ xIndex++;
+ }
+
+ while (yIndex < yLen)
+ {
+ var endInserts = endInserts || [];
+ var y = yKids[yIndex];
+ _VirtualDom_insertNode(changes, localPatches, y.a, y.b, undefined, endInserts);
+ yIndex++;
+ }
+
+ if (localPatches.length > 0 || inserts.length > 0 || endInserts)
+ {
+ _VirtualDom_pushPatch(patches, 8, rootIndex, {
+ w: localPatches,
+ x: inserts,
+ y: endInserts
+ });
+ }
+}
+
+
+
+// CHANGES FROM KEYED DIFF
+
+
+var _VirtualDom_POSTFIX = '_elmW6BL';
+
+
+function _VirtualDom_insertNode(changes, localPatches, key, vnode, yIndex, inserts)
+{
+ var entry = changes[key];
+
+ // never seen this key before
+ if (!entry)
+ {
+ entry = {
+ c: 0,
+ z: vnode,
+ r: yIndex,
+ s: undefined
+ };
+
+ inserts.push({ r: yIndex, A: entry });
+ changes[key] = entry;
+
+ return;
+ }
+
+ // this key was removed earlier, a match!
+ if (entry.c === 1)
+ {
+ inserts.push({ r: yIndex, A: entry });
+
+ entry.c = 2;
+ var subPatches = [];
+ _VirtualDom_diffHelp(entry.z, vnode, subPatches, entry.r);
+ entry.r = yIndex;
+ entry.s.s = {
+ w: subPatches,
+ A: entry
+ };
+
+ return;
+ }
+
+ // this key has already been inserted or moved, a duplicate!
+ _VirtualDom_insertNode(changes, localPatches, key + _VirtualDom_POSTFIX, vnode, yIndex, inserts);
+}
+
+
+function _VirtualDom_removeNode(changes, localPatches, key, vnode, index)
+{
+ var entry = changes[key];
+
+ // never seen this key before
+ if (!entry)
+ {
+ var patch = _VirtualDom_pushPatch(localPatches, 9, index, undefined);
+
+ changes[key] = {
+ c: 1,
+ z: vnode,
+ r: index,
+ s: patch
+ };
+
+ return;
+ }
+
+ // this key was inserted earlier, a match!
+ if (entry.c === 0)
+ {
+ entry.c = 2;
+ var subPatches = [];
+ _VirtualDom_diffHelp(vnode, entry.z, subPatches, index);
+
+ _VirtualDom_pushPatch(localPatches, 9, index, {
+ w: subPatches,
+ A: entry
+ });
+
+ return;
+ }
+
+ // this key has already been removed or moved, a duplicate!
+ _VirtualDom_removeNode(changes, localPatches, key + _VirtualDom_POSTFIX, vnode, index);
+}
+
+
+
+// ADD DOM NODES
+//
+// Each DOM node has an "index" assigned in order of traversal. It is important
+// to minimize our crawl over the actual DOM, so these indexes (along with the
+// descendantsCount of virtual nodes) let us skip touching entire subtrees of
+// the DOM if we know there are no patches there.
+
+
+function _VirtualDom_addDomNodes(domNode, vNode, patches, eventNode)
+{
+ _VirtualDom_addDomNodesHelp(domNode, vNode, patches, 0, 0, vNode.b, eventNode);
+}
+
+
+// assumes `patches` is non-empty and indexes increase monotonically.
+function _VirtualDom_addDomNodesHelp(domNode, vNode, patches, i, low, high, eventNode)
+{
+ var patch = patches[i];
+ var index = patch.r;
+
+ while (index === low)
+ {
+ var patchType = patch.$;
+
+ if (patchType === 1)
+ {
+ _VirtualDom_addDomNodes(domNode, vNode.k, patch.s, eventNode);
+ }
+ else if (patchType === 8)
+ {
+ patch.t = domNode;
+ patch.u = eventNode;
+
+ var subPatches = patch.s.w;
+ if (subPatches.length > 0)
+ {
+ _VirtualDom_addDomNodesHelp(domNode, vNode, subPatches, 0, low, high, eventNode);
+ }
+ }
+ else if (patchType === 9)
+ {
+ patch.t = domNode;
+ patch.u = eventNode;
+
+ var data = patch.s;
+ if (data)
+ {
+ data.A.s = domNode;
+ var subPatches = data.w;
+ if (subPatches.length > 0)
+ {
+ _VirtualDom_addDomNodesHelp(domNode, vNode, subPatches, 0, low, high, eventNode);
+ }
+ }
+ }
+ else
+ {
+ patch.t = domNode;
+ patch.u = eventNode;
+ }
+
+ i++;
+
+ if (!(patch = patches[i]) || (index = patch.r) > high)
+ {
+ return i;
+ }
+ }
+
+ var tag = vNode.$;
+
+ if (tag === 4)
+ {
+ var subNode = vNode.k;
+
+ while (subNode.$ === 4)
+ {
+ subNode = subNode.k;
+ }
+
+ return _VirtualDom_addDomNodesHelp(domNode, subNode, patches, i, low + 1, high, domNode.elm_event_node_ref);
+ }
+
+ // tag must be 1 or 2 at this point
+
+ var vKids = vNode.e;
+ var childNodes = domNode.childNodes;
+ for (var j = 0; j < vKids.length; j++)
+ {
+ low++;
+ var vKid = tag === 1 ? vKids[j] : vKids[j].b;
+ var nextLow = low + (vKid.b || 0);
+ if (low <= index && index <= nextLow)
+ {
+ i = _VirtualDom_addDomNodesHelp(childNodes[j], vKid, patches, i, low, nextLow, eventNode);
+ if (!(patch = patches[i]) || (index = patch.r) > high)
+ {
+ return i;
+ }
+ }
+ low = nextLow;
+ }
+ return i;
+}
+
+
+
+// APPLY PATCHES
+
+
+function _VirtualDom_applyPatches(rootDomNode, oldVirtualNode, patches, eventNode)
+{
+ if (patches.length === 0)
+ {
+ return rootDomNode;
+ }
+
+ _VirtualDom_addDomNodes(rootDomNode, oldVirtualNode, patches, eventNode);
+ return _VirtualDom_applyPatchesHelp(rootDomNode, patches);
+}
+
+function _VirtualDom_applyPatchesHelp(rootDomNode, patches)
+{
+ for (var i = 0; i < patches.length; i++)
+ {
+ var patch = patches[i];
+ var localDomNode = patch.t
+ var newNode = _VirtualDom_applyPatch(localDomNode, patch);
+ if (localDomNode === rootDomNode)
+ {
+ rootDomNode = newNode;
+ }
+ }
+ return rootDomNode;
+}
+
+function _VirtualDom_applyPatch(domNode, patch)
+{
+ switch (patch.$)
+ {
+ case 0:
+ return _VirtualDom_applyPatchRedraw(domNode, patch.s, patch.u);
+
+ case 4:
+ _VirtualDom_applyFacts(domNode, patch.u, patch.s);
+ return domNode;
+
+ case 3:
+ domNode.replaceData(0, domNode.length, patch.s);
+ return domNode;
+
+ case 1:
+ return _VirtualDom_applyPatchesHelp(domNode, patch.s);
+
+ case 2:
+ if (domNode.elm_event_node_ref)
+ {
+ domNode.elm_event_node_ref.j = patch.s;
+ }
+ else
+ {
+ domNode.elm_event_node_ref = { j: patch.s, p: patch.u };
+ }
+ return domNode;
+
+ case 6:
+ var data = patch.s;
+ for (var i = 0; i < data.i; i++)
+ {
+ domNode.removeChild(domNode.childNodes[data.v]);
+ }
+ return domNode;
+
+ case 7:
+ var data = patch.s;
+ var kids = data.e;
+ var i = data.v;
+ var theEnd = domNode.childNodes[i];
+ for (; i < kids.length; i++)
+ {
+ domNode.insertBefore(_VirtualDom_render(kids[i], patch.u), theEnd);
+ }
+ return domNode;
+
+ case 9:
+ var data = patch.s;
+ if (!data)
+ {
+ domNode.parentNode.removeChild(domNode);
+ return domNode;
+ }
+ var entry = data.A;
+ if (typeof entry.r !== 'undefined')
+ {
+ domNode.parentNode.removeChild(domNode);
+ }
+ entry.s = _VirtualDom_applyPatchesHelp(domNode, data.w);
+ return domNode;
+
+ case 8:
+ return _VirtualDom_applyPatchReorder(domNode, patch);
+
+ case 5:
+ return patch.s(domNode);
+
+ default:
+ _Debug_crash(10); // 'Ran into an unknown patch!'
+ }
+}
+
+
+function _VirtualDom_applyPatchRedraw(domNode, vNode, eventNode)
+{
+ var parentNode = domNode.parentNode;
+ var newNode = _VirtualDom_render(vNode, eventNode);
+
+ if (!newNode.elm_event_node_ref)
+ {
+ newNode.elm_event_node_ref = domNode.elm_event_node_ref;
+ }
+
+ if (parentNode && newNode !== domNode)
+ {
+ parentNode.replaceChild(newNode, domNode);
+ }
+ return newNode;
+}
+
+
+function _VirtualDom_applyPatchReorder(domNode, patch)
+{
+ var data = patch.s;
+
+ // remove end inserts
+ var frag = _VirtualDom_applyPatchReorderEndInsertsHelp(data.y, patch);
+
+ // removals
+ domNode = _VirtualDom_applyPatchesHelp(domNode, data.w);
+
+ // inserts
+ var inserts = data.x;
+ for (var i = 0; i < inserts.length; i++)
+ {
+ var insert = inserts[i];
+ var entry = insert.A;
+ var node = entry.c === 2
+ ? entry.s
+ : _VirtualDom_render(entry.z, patch.u);
+ domNode.insertBefore(node, domNode.childNodes[insert.r]);
+ }
+
+ // add end inserts
+ if (frag)
+ {
+ _VirtualDom_appendChild(domNode, frag);
+ }
+
+ return domNode;
+}
+
+
+function _VirtualDom_applyPatchReorderEndInsertsHelp(endInserts, patch)
+{
+ if (!endInserts)
+ {
+ return;
+ }
+
+ var frag = _VirtualDom_doc.createDocumentFragment();
+ for (var i = 0; i < endInserts.length; i++)
+ {
+ var insert = endInserts[i];
+ var entry = insert.A;
+ _VirtualDom_appendChild(frag, entry.c === 2
+ ? entry.s
+ : _VirtualDom_render(entry.z, patch.u)
+ );
+ }
+ return frag;
+}
+
+
+function _VirtualDom_virtualize(node)
+{
+ // TEXT NODES
+
+ if (node.nodeType === 3)
+ {
+ return _VirtualDom_text(node.textContent);
+ }
+
+
+ // WEIRD NODES
+
+ if (node.nodeType !== 1)
+ {
+ return _VirtualDom_text('');
+ }
+
+
+ // ELEMENT NODES
+
+ var attrList = _List_Nil;
+ var attrs = node.attributes;
+ for (var i = attrs.length; i--; )
+ {
+ var attr = attrs[i];
+ var name = attr.name;
+ var value = attr.value;
+ attrList = _List_Cons( A2(_VirtualDom_attribute, name, value), attrList );
+ }
+
+ var tag = node.tagName.toLowerCase();
+ var kidList = _List_Nil;
+ var kids = node.childNodes;
+
+ for (var i = kids.length; i--; )
+ {
+ kidList = _List_Cons(_VirtualDom_virtualize(kids[i]), kidList);
+ }
+ return A3(_VirtualDom_node, tag, attrList, kidList);
+}
+
+function _VirtualDom_dekey(keyedNode)
+{
+ var keyedKids = keyedNode.e;
+ var len = keyedKids.length;
+ var kids = new Array(len);
+ for (var i = 0; i < len; i++)
+ {
+ kids[i] = keyedKids[i].b;
+ }
+
+ return {
+ $: 1,
+ c: keyedNode.c,
+ d: keyedNode.d,
+ e: kids,
+ f: keyedNode.f,
+ b: keyedNode.b
+ };
+}
+
+
+
+// ELEMENT
+
+
+var _Debugger_element;
+
+var _Browser_element = _Debugger_element || F4(function(impl, flagDecoder, debugMetadata, args)
+{
+ return _Platform_initialize(
+ flagDecoder,
+ args,
+ impl.bJ,
+ impl.b1,
+ impl.b_,
+ function(sendToApp, initialModel) {
+ var view = impl.b4;
+ /**/
+ var domNode = args['node'];
+ //*/
+ /**_UNUSED/
+ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0);
+ //*/
+ var currNode = _VirtualDom_virtualize(domNode);
+
+ return _Browser_makeAnimator(initialModel, function(model)
+ {
+ var nextNode = view(model);
+ var patches = _VirtualDom_diff(currNode, nextNode);
+ domNode = _VirtualDom_applyPatches(domNode, currNode, patches, sendToApp);
+ currNode = nextNode;
+ });
+ }
+ );
+});
+
+
+
+// DOCUMENT
+
+
+var _Debugger_document;
+
+var _Browser_document = _Debugger_document || F4(function(impl, flagDecoder, debugMetadata, args)
+{
+ return _Platform_initialize(
+ flagDecoder,
+ args,
+ impl.bJ,
+ impl.b1,
+ impl.b_,
+ function(sendToApp, initialModel) {
+ var divertHrefToApp = impl.az && impl.az(sendToApp)
+ var view = impl.b4;
+ var title = _VirtualDom_doc.title;
+ var bodyNode = _VirtualDom_doc.body;
+ var currNode = _VirtualDom_virtualize(bodyNode);
+ return _Browser_makeAnimator(initialModel, function(model)
+ {
+ _VirtualDom_divertHrefToApp = divertHrefToApp;
+ var doc = view(model);
+ var nextNode = _VirtualDom_node('body')(_List_Nil)(doc.bm);
+ var patches = _VirtualDom_diff(currNode, nextNode);
+ bodyNode = _VirtualDom_applyPatches(bodyNode, currNode, patches, sendToApp);
+ currNode = nextNode;
+ _VirtualDom_divertHrefToApp = 0;
+ (title !== doc.b$) && (_VirtualDom_doc.title = title = doc.b$);
+ });
+ }
+ );
+});
+
+
+
+// ANIMATION
+
+
+var _Browser_requestAnimationFrame =
+ typeof requestAnimationFrame !== 'undefined'
+ ? requestAnimationFrame
+ : function(callback) { setTimeout(callback, 1000 / 60); };
+
+
+function _Browser_makeAnimator(model, draw)
+{
+ draw(model);
+
+ var state = 0;
+
+ function updateIfNeeded()
+ {
+ state = state === 1
+ ? 0
+ : ( _Browser_requestAnimationFrame(updateIfNeeded), draw(model), 1 );
+ }
+
+ return function(nextModel, isSync)
+ {
+ model = nextModel;
+
+ isSync
+ ? ( draw(model),
+ state === 2 && (state = 1)
+ )
+ : ( state === 0 && _Browser_requestAnimationFrame(updateIfNeeded),
+ state = 2
+ );
+ };
+}
+
+
+
+// APPLICATION
+
+
+function _Browser_application(impl)
+{
+ var key = {};
+ var onUrlChange = impl.bP;
+ var onUrlRequest = impl.bQ;
+ return _Browser_document({
+ az: function(sendToApp)
+ {
+ function reportChange()
+ {
+ sendToApp(onUrlChange(_Browser_getUrl()));
+ }
+
+ key.a = reportChange;
+
+ _Browser_window.addEventListener('popstate', reportChange);
+ _Browser_window.navigator.userAgent.indexOf('Trident') < 0 || _Browser_window.addEventListener('hashchange', reportChange);
+
+ return F2(function(domNode, event)
+ {
+ if (!event.ctrlKey && !event.metaKey && !event.shiftKey && event.button < 1 && !domNode.target)
+ {
+ event.preventDefault();
+ var href = domNode.href;
+ var curr = _Browser_getUrl();
+ var next = elm$url$Url$fromString(href).a;
+ sendToApp(onUrlRequest(
+ (next
+ && curr.a2 === next.a2
+ && curr.aR === next.aR
+ && curr.a_.a === next.a_.a
+ )
+ ? elm$browser$Browser$Internal(next)
+ : elm$browser$Browser$External(href)
+ ));
+ }
+ });
+ },
+ bJ: function(flags)
+ {
+ return A3(impl.bJ, flags, _Browser_getUrl(), key);
+ },
+ b4: impl.b4,
+ b1: impl.b1,
+ b_: impl.b_
+ });
+}
+
+function _Browser_getUrl()
+{
+ return elm$url$Url$fromString(_VirtualDom_doc.location.href).a || _Debug_crash(1);
+}
+
+var _Browser_go = F2(function(key, n)
+{
+ return A2(elm$core$Task$perform, elm$core$Basics$never, _Scheduler_binding(function() {
+ n && history.go(n);
+ key.a();
+ }));
+});
+
+var _Browser_pushUrl = F2(function(key, url)
+{
+ return A2(elm$core$Task$perform, elm$core$Basics$never, _Scheduler_binding(function() {
+ history.pushState({}, '', url);
+ key.a();
+ }));
+});
+
+var _Browser_replaceUrl = F2(function(key, url)
+{
+ return A2(elm$core$Task$perform, elm$core$Basics$never, _Scheduler_binding(function() {
+ history.replaceState({}, '', url);
+ key.a();
+ }));
+});
+
+
+
+// GLOBAL EVENTS
+
+
+var _Browser_fakeNode = { addEventListener: function() {}, removeEventListener: function() {} };
+var _Browser_doc = typeof document !== 'undefined' ? document : _Browser_fakeNode;
+var _Browser_window = typeof window !== 'undefined' ? window : _Browser_fakeNode;
+
+var _Browser_on = F3(function(node, eventName, sendToSelf)
+{
+ return _Scheduler_spawn(_Scheduler_binding(function(callback)
+ {
+ function handler(event) { _Scheduler_rawSpawn(sendToSelf(event)); }
+ node.addEventListener(eventName, handler, _VirtualDom_passiveSupported && { passive: true });
+ return function() { node.removeEventListener(eventName, handler); };
+ }));
+});
+
+var _Browser_decodeEvent = F2(function(decoder, event)
+{
+ var result = _Json_runHelp(decoder, event);
+ return elm$core$Result$isOk(result) ? elm$core$Maybe$Just(result.a) : elm$core$Maybe$Nothing;
+});
+
+
+
+// PAGE VISIBILITY
+
+
+function _Browser_visibilityInfo()
+{
+ return (typeof _VirtualDom_doc.hidden !== 'undefined')
+ ? { bG: 'hidden', L: 'visibilitychange' }
+ :
+ (typeof _VirtualDom_doc.mozHidden !== 'undefined')
+ ? { bG: 'mozHidden', L: 'mozvisibilitychange' }
+ :
+ (typeof _VirtualDom_doc.msHidden !== 'undefined')
+ ? { bG: 'msHidden', L: 'msvisibilitychange' }
+ :
+ (typeof _VirtualDom_doc.webkitHidden !== 'undefined')
+ ? { bG: 'webkitHidden', L: 'webkitvisibilitychange' }
+ : { bG: 'hidden', L: 'visibilitychange' };
+}
+
+
+
+// ANIMATION FRAMES
+
+
+function _Browser_rAF()
+{
+ return _Scheduler_binding(function(callback)
+ {
+ var id = requestAnimationFrame(function() {
+ callback(_Scheduler_succeed(Date.now()));
+ });
+
+ return function() {
+ cancelAnimationFrame(id);
+ };
+ });
+}
+
+
+function _Browser_now()
+{
+ return _Scheduler_binding(function(callback)
+ {
+ callback(_Scheduler_succeed(Date.now()));
+ });
+}
+
+
+
+// DOM STUFF
+
+
+function _Browser_withNode(id, doStuff)
+{
+ return _Scheduler_binding(function(callback)
+ {
+ _Browser_requestAnimationFrame(function() {
+ var node = document.getElementById(id);
+ callback(node
+ ? _Scheduler_succeed(doStuff(node))
+ : _Scheduler_fail(elm$browser$Browser$Dom$NotFound(id))
+ );
+ });
+ });
+}
+
+
+function _Browser_withWindow(doStuff)
+{
+ return _Scheduler_binding(function(callback)
+ {
+ _Browser_requestAnimationFrame(function() {
+ callback(_Scheduler_succeed(doStuff()));
+ });
+ });
+}
+
+
+// FOCUS and BLUR
+
+
+var _Browser_call = F2(function(functionName, id)
+{
+ return _Browser_withNode(id, function(node) {
+ node[functionName]();
+ return _Utils_Tuple0;
+ });
+});
+
+
+
+// WINDOW VIEWPORT
+
+
+function _Browser_getViewport()
+{
+ var node = _Browser_doc.documentElement;
+ return {
+ a8: {
+ C: node.scrollWidth,
+ w: node.scrollHeight
+ },
+ bf: {
+ Z: _Browser_window.pageXOffset,
+ _: _Browser_window.pageYOffset,
+ C: node.clientWidth,
+ w: node.clientHeight
+ }
+ };
+}
+
+
+var _Browser_setViewport = F2(function(x, y)
+{
+ return _Browser_withWindow(function()
+ {
+ _Browser_window.scroll(x, y);
+ return _Utils_Tuple0;
+ });
+});
+
+
+
+// ELEMENT VIEWPORT
+
+
+function _Browser_getViewportOf(id)
+{
+ return _Browser_withNode(id, function(node)
+ {
+ return {
+ a8: {
+ C: node.scrollWidth,
+ w: node.scrollHeight
+ },
+ bf: {
+ Z: node.scrollLeft,
+ _: node.scrollTop,
+ C: node.clientWidth,
+ w: node.clientHeight
+ }
+ };
+ });
+}
+
+
+var _Browser_setViewportOf = F3(function(id, x, y)
+{
+ return _Browser_withNode(id, function(node)
+ {
+ node.scrollLeft = x;
+ node.scrollTop = y;
+ return _Utils_Tuple0;
+ });
+});
+
+
+
+// ELEMENT
+
+
+function _Browser_getElement(id)
+{
+ return _Browser_withNode(id, function(node)
+ {
+ var rect = node.getBoundingClientRect();
+ var x = _Browser_window.pageXOffset;
+ var y = _Browser_window.pageYOffset;
+ return {
+ a8: {
+ C: node.scrollWidth,
+ w: node.scrollHeight
+ },
+ bf: {
+ Z: x,
+ _: y,
+ C: node.clientWidth,
+ w: node.clientHeight
+ },
+ bz: {
+ Z: x + rect.left,
+ _: y + rect.top,
+ C: rect.width,
+ w: rect.height
+ }
+ };
+ });
+}
+
+
+
+// LOAD and RELOAD
+
+
+function _Browser_reload(skipCache)
+{
+ return A2(elm$core$Task$perform, elm$core$Basics$never, _Scheduler_binding(function(callback)
+ {
+ _VirtualDom_doc.location.reload(skipCache);
+ }));
+}
+
+function _Browser_load(url)
+{
+ return A2(elm$core$Task$perform, elm$core$Basics$never, _Scheduler_binding(function(callback)
+ {
+ try
+ {
+ _Browser_window.location = url;
+ }
+ catch(err)
+ {
+ // Only Firefox can throw a NS_ERROR_MALFORMED_URI exception here.
+ // Other browsers reload the page, so let's be consistent about that.
+ _VirtualDom_doc.location.reload(false);
+ }
+ }));
+}
+var elm$core$Maybe$Nothing = {$: 1};
+var elm$core$Basics$False = 1;
+var elm$core$Basics$True = 0;
+var elm$core$Result$isOk = function (result) {
+ if (!result.$) {
+ return true;
+ } else {
+ return false;
+ }
+};
+var elm$core$Basics$EQ = 1;
+var elm$core$Basics$GT = 2;
+var elm$core$Basics$LT = 0;
+var elm$core$Dict$foldr = F3(
+ function (func, acc, t) {
+ foldr:
+ while (true) {
+ if (t.$ === -2) {
+ return acc;
+ } else {
+ var key = t.b;
+ var value = t.c;
+ var left = t.d;
+ var right = t.e;
+ var $temp$func = func,
+ $temp$acc = A3(
+ func,
+ key,
+ value,
+ A3(elm$core$Dict$foldr, func, acc, right)),
+ $temp$t = left;
+ func = $temp$func;
+ acc = $temp$acc;
+ t = $temp$t;
+ continue foldr;
+ }
+ }
+ });
+var elm$core$List$cons = _List_cons;
+var elm$core$Dict$toList = function (dict) {
+ return A3(
+ elm$core$Dict$foldr,
+ F3(
+ function (key, value, list) {
+ return A2(
+ elm$core$List$cons,
+ _Utils_Tuple2(key, value),
+ list);
+ }),
+ _List_Nil,
+ dict);
+};
+var elm$core$Dict$keys = function (dict) {
+ return A3(
+ elm$core$Dict$foldr,
+ F3(
+ function (key, value, keyList) {
+ return A2(elm$core$List$cons, key, keyList);
+ }),
+ _List_Nil,
+ dict);
+};
+var elm$core$Set$toList = function (_n0) {
+ var dict = _n0;
+ return elm$core$Dict$keys(dict);
+};
+var elm$core$Elm$JsArray$foldr = _JsArray_foldr;
+var elm$core$Array$foldr = F3(
+ function (func, baseCase, _n0) {
+ var tree = _n0.c;
+ var tail = _n0.d;
+ var helper = F2(
+ function (node, acc) {
+ if (!node.$) {
+ var subTree = node.a;
+ return A3(elm$core$Elm$JsArray$foldr, helper, acc, subTree);
+ } else {
+ var values = node.a;
+ return A3(elm$core$Elm$JsArray$foldr, func, acc, values);
+ }
+ });
+ return A3(
+ elm$core$Elm$JsArray$foldr,
+ helper,
+ A3(elm$core$Elm$JsArray$foldr, func, baseCase, tail),
+ tree);
+ });
+var elm$core$Array$toList = function (array) {
+ return A3(elm$core$Array$foldr, elm$core$List$cons, _List_Nil, array);
+};
+var elm$core$Array$branchFactor = 32;
+var elm$core$Array$Array_elm_builtin = F4(
+ function (a, b, c, d) {
+ return {$: 0, a: a, b: b, c: c, d: d};
+ });
+var elm$core$Basics$ceiling = _Basics_ceiling;
+var elm$core$Basics$fdiv = _Basics_fdiv;
+var elm$core$Basics$logBase = F2(
+ function (base, number) {
+ return _Basics_log(number) / _Basics_log(base);
+ });
+var elm$core$Basics$toFloat = _Basics_toFloat;
+var elm$core$Array$shiftStep = elm$core$Basics$ceiling(
+ A2(elm$core$Basics$logBase, 2, elm$core$Array$branchFactor));
+var elm$core$Elm$JsArray$empty = _JsArray_empty;
+var elm$core$Array$empty = A4(elm$core$Array$Array_elm_builtin, 0, elm$core$Array$shiftStep, elm$core$Elm$JsArray$empty, elm$core$Elm$JsArray$empty);
+var elm$core$Array$Leaf = function (a) {
+ return {$: 1, a: a};
+};
+var elm$core$Array$SubTree = function (a) {
+ return {$: 0, a: a};
+};
+var elm$core$Elm$JsArray$initializeFromList = _JsArray_initializeFromList;
+var elm$core$List$foldl = F3(
+ function (func, acc, list) {
+ foldl:
+ while (true) {
+ if (!list.b) {
+ return acc;
+ } else {
+ var x = list.a;
+ var xs = list.b;
+ var $temp$func = func,
+ $temp$acc = A2(func, x, acc),
+ $temp$list = xs;
+ func = $temp$func;
+ acc = $temp$acc;
+ list = $temp$list;
+ continue foldl;
+ }
+ }
+ });
+var elm$core$List$reverse = function (list) {
+ return A3(elm$core$List$foldl, elm$core$List$cons, _List_Nil, list);
+};
+var elm$core$Array$compressNodes = F2(
+ function (nodes, acc) {
+ compressNodes:
+ while (true) {
+ var _n0 = A2(elm$core$Elm$JsArray$initializeFromList, elm$core$Array$branchFactor, nodes);
+ var node = _n0.a;
+ var remainingNodes = _n0.b;
+ var newAcc = A2(
+ elm$core$List$cons,
+ elm$core$Array$SubTree(node),
+ acc);
+ if (!remainingNodes.b) {
+ return elm$core$List$reverse(newAcc);
+ } else {
+ var $temp$nodes = remainingNodes,
+ $temp$acc = newAcc;
+ nodes = $temp$nodes;
+ acc = $temp$acc;
+ continue compressNodes;
+ }
+ }
+ });
+var elm$core$Basics$apR = F2(
+ function (x, f) {
+ return f(x);
+ });
+var elm$core$Basics$eq = _Utils_equal;
+var elm$core$Tuple$first = function (_n0) {
+ var x = _n0.a;
+ return x;
+};
+var elm$core$Array$treeFromBuilder = F2(
+ function (nodeList, nodeListSize) {
+ treeFromBuilder:
+ while (true) {
+ var newNodeSize = elm$core$Basics$ceiling(nodeListSize / elm$core$Array$branchFactor);
+ if (newNodeSize === 1) {
+ return A2(elm$core$Elm$JsArray$initializeFromList, elm$core$Array$branchFactor, nodeList).a;
+ } else {
+ var $temp$nodeList = A2(elm$core$Array$compressNodes, nodeList, _List_Nil),
+ $temp$nodeListSize = newNodeSize;
+ nodeList = $temp$nodeList;
+ nodeListSize = $temp$nodeListSize;
+ continue treeFromBuilder;
+ }
+ }
+ });
+var elm$core$Basics$add = _Basics_add;
+var elm$core$Basics$apL = F2(
+ function (f, x) {
+ return f(x);
+ });
+var elm$core$Basics$floor = _Basics_floor;
+var elm$core$Basics$gt = _Utils_gt;
+var elm$core$Basics$max = F2(
+ function (x, y) {
+ return (_Utils_cmp(x, y) > 0) ? x : y;
+ });
+var elm$core$Basics$mul = _Basics_mul;
+var elm$core$Basics$sub = _Basics_sub;
+var elm$core$Elm$JsArray$length = _JsArray_length;
+var elm$core$Array$builderToArray = F2(
+ function (reverseNodeList, builder) {
+ if (!builder.f) {
+ return A4(
+ elm$core$Array$Array_elm_builtin,
+ elm$core$Elm$JsArray$length(builder.h),
+ elm$core$Array$shiftStep,
+ elm$core$Elm$JsArray$empty,
+ builder.h);
+ } else {
+ var treeLen = builder.f * elm$core$Array$branchFactor;
+ var depth = elm$core$Basics$floor(
+ A2(elm$core$Basics$logBase, elm$core$Array$branchFactor, treeLen - 1));
+ var correctNodeList = reverseNodeList ? elm$core$List$reverse(builder.i) : builder.i;
+ var tree = A2(elm$core$Array$treeFromBuilder, correctNodeList, builder.f);
+ return A4(
+ elm$core$Array$Array_elm_builtin,
+ elm$core$Elm$JsArray$length(builder.h) + treeLen,
+ A2(elm$core$Basics$max, 5, depth * elm$core$Array$shiftStep),
+ tree,
+ builder.h);
+ }
+ });
+var elm$core$Basics$idiv = _Basics_idiv;
+var elm$core$Basics$lt = _Utils_lt;
+var elm$core$Elm$JsArray$initialize = _JsArray_initialize;
+var elm$core$Array$initializeHelp = F5(
+ function (fn, fromIndex, len, nodeList, tail) {
+ initializeHelp:
+ while (true) {
+ if (fromIndex < 0) {
+ return A2(
+ elm$core$Array$builderToArray,
+ false,
+ {i: nodeList, f: (len / elm$core$Array$branchFactor) | 0, h: tail});
+ } else {
+ var leaf = elm$core$Array$Leaf(
+ A3(elm$core$Elm$JsArray$initialize, elm$core$Array$branchFactor, fromIndex, fn));
+ var $temp$fn = fn,
+ $temp$fromIndex = fromIndex - elm$core$Array$branchFactor,
+ $temp$len = len,
+ $temp$nodeList = A2(elm$core$List$cons, leaf, nodeList),
+ $temp$tail = tail;
+ fn = $temp$fn;
+ fromIndex = $temp$fromIndex;
+ len = $temp$len;
+ nodeList = $temp$nodeList;
+ tail = $temp$tail;
+ continue initializeHelp;
+ }
+ }
+ });
+var elm$core$Basics$le = _Utils_le;
+var elm$core$Basics$remainderBy = _Basics_remainderBy;
+var elm$core$Array$initialize = F2(
+ function (len, fn) {
+ if (len <= 0) {
+ return elm$core$Array$empty;
+ } else {
+ var tailLen = len % elm$core$Array$branchFactor;
+ var tail = A3(elm$core$Elm$JsArray$initialize, tailLen, len - tailLen, fn);
+ var initialFromIndex = (len - tailLen) - elm$core$Array$branchFactor;
+ return A5(elm$core$Array$initializeHelp, fn, initialFromIndex, len, _List_Nil, tail);
+ }
+ });
+var elm$core$Maybe$Just = function (a) {
+ return {$: 0, a: a};
+};
+var elm$core$Result$Err = function (a) {
+ return {$: 1, a: a};
+};
+var elm$core$Result$Ok = function (a) {
+ return {$: 0, a: a};
+};
+var elm$json$Json$Decode$Failure = F2(
+ function (a, b) {
+ return {$: 3, a: a, b: b};
+ });
+var elm$json$Json$Decode$Field = F2(
+ function (a, b) {
+ return {$: 0, a: a, b: b};
+ });
+var elm$json$Json$Decode$Index = F2(
+ function (a, b) {
+ return {$: 1, a: a, b: b};
+ });
+var elm$json$Json$Decode$OneOf = function (a) {
+ return {$: 2, a: a};
+};
+var elm$core$Platform$Cmd$batch = _Platform_batch;
+var elm$core$Platform$Cmd$none = elm$core$Platform$Cmd$batch(_List_Nil);
+var author$project$Main$init = function (_n0) {
+ return _Utils_Tuple2(
+ {aa: elm$core$Maybe$Nothing, aB: elm$core$Maybe$Nothing, X: '', Y: ''},
+ elm$core$Platform$Cmd$none);
+};
+var elm$core$Platform$Sub$batch = _Platform_batch;
+var elm$core$Platform$Sub$none = elm$core$Platform$Sub$batch(_List_Nil);
+var author$project$Main$subscriptions = function (model) {
+ return elm$core$Platform$Sub$none;
+};
+var author$project$Main$errorToString = function (err) {
+ switch (err.$) {
+ case 0:
+ var stringString = err.a;
+ return 'Invalid URL. Check the inputs to make sure that it is a valid https url or starts with mapbox://styles/';
+ case 1:
+ return 'Request timed out. Try again later.';
+ case 2:
+ return 'Network error. Are you online?';
+ case 3:
+ var response = err.a;
+ var _n1 = response.bb.br;
+ switch (_n1) {
+ case 401:
+ return 'An authentication error occurred. Check your key and try again.';
+ case 404:
+ return 'Couldn\'t find that style';
+ default:
+ return response.bb.bN;
+ }
+ default:
+ var m = err.a;
+ return m;
+ }
+};
+var author$project$Main$LoadedStyle = function (a) {
+ return {$: 0, a: a};
+};
+var elm$core$Basics$append = _Utils_append;
+var elm$core$String$join = F2(
+ function (sep, chunks) {
+ return A2(
+ _String_join,
+ sep,
+ _List_toArray(chunks));
+ });
+var elm$core$String$split = F2(
+ function (sep, string) {
+ return _List_fromArray(
+ A2(_String_split, sep, string));
+ });
+var elm$core$String$replace = F3(
+ function (before, after, string) {
+ return A2(
+ elm$core$String$join,
+ after,
+ A2(elm$core$String$split, before, string));
+ });
+var elm$http$Http$Internal$EmptyBody = {$: 0};
+var elm$http$Http$emptyBody = elm$http$Http$Internal$EmptyBody;
+var elm$core$Dict$RBEmpty_elm_builtin = {$: -2};
+var elm$core$Dict$empty = elm$core$Dict$RBEmpty_elm_builtin;
+var elm$core$Basics$compare = _Utils_compare;
+var elm$core$Dict$get = F2(
+ function (targetKey, dict) {
+ get:
+ while (true) {
+ if (dict.$ === -2) {
+ return elm$core$Maybe$Nothing;
+ } else {
+ var key = dict.b;
+ var value = dict.c;
+ var left = dict.d;
+ var right = dict.e;
+ var _n1 = A2(elm$core$Basics$compare, targetKey, key);
+ switch (_n1) {
+ case 0:
+ var $temp$targetKey = targetKey,
+ $temp$dict = left;
+ targetKey = $temp$targetKey;
+ dict = $temp$dict;
+ continue get;
+ case 1:
+ return elm$core$Maybe$Just(value);
+ default:
+ var $temp$targetKey = targetKey,
+ $temp$dict = right;
+ targetKey = $temp$targetKey;
+ dict = $temp$dict;
+ continue get;
+ }
+ }
+ }
+ });
+var elm$core$Dict$Black = 1;
+var elm$core$Dict$RBNode_elm_builtin = F5(
+ function (a, b, c, d, e) {
+ return {$: -1, a: a, b: b, c: c, d: d, e: e};
+ });
+var elm$core$Dict$Red = 0;
+var elm$core$Dict$balance = F5(
+ function (color, key, value, left, right) {
+ if ((right.$ === -1) && (!right.a)) {
+ var _n1 = right.a;
+ var rK = right.b;
+ var rV = right.c;
+ var rLeft = right.d;
+ var rRight = right.e;
+ if ((left.$ === -1) && (!left.a)) {
+ var _n3 = left.a;
+ var lK = left.b;
+ var lV = left.c;
+ var lLeft = left.d;
+ var lRight = left.e;
+ return A5(
+ elm$core$Dict$RBNode_elm_builtin,
+ 0,
+ key,
+ value,
+ A5(elm$core$Dict$RBNode_elm_builtin, 1, lK, lV, lLeft, lRight),
+ A5(elm$core$Dict$RBNode_elm_builtin, 1, rK, rV, rLeft, rRight));
+ } else {
+ return A5(
+ elm$core$Dict$RBNode_elm_builtin,
+ color,
+ rK,
+ rV,
+ A5(elm$core$Dict$RBNode_elm_builtin, 0, key, value, left, rLeft),
+ rRight);
+ }
+ } else {
+ if ((((left.$ === -1) && (!left.a)) && (left.d.$ === -1)) && (!left.d.a)) {
+ var _n5 = left.a;
+ var lK = left.b;
+ var lV = left.c;
+ var _n6 = left.d;
+ var _n7 = _n6.a;
+ var llK = _n6.b;
+ var llV = _n6.c;
+ var llLeft = _n6.d;
+ var llRight = _n6.e;
+ var lRight = left.e;
+ return A5(
+ elm$core$Dict$RBNode_elm_builtin,
+ 0,
+ lK,
+ lV,
+ A5(elm$core$Dict$RBNode_elm_builtin, 1, llK, llV, llLeft, llRight),
+ A5(elm$core$Dict$RBNode_elm_builtin, 1, key, value, lRight, right));
+ } else {
+ return A5(elm$core$Dict$RBNode_elm_builtin, color, key, value, left, right);
+ }
+ }
+ });
+var elm$core$Dict$insertHelp = F3(
+ function (key, value, dict) {
+ if (dict.$ === -2) {
+ return A5(elm$core$Dict$RBNode_elm_builtin, 0, key, value, elm$core$Dict$RBEmpty_elm_builtin, elm$core$Dict$RBEmpty_elm_builtin);
+ } else {
+ var nColor = dict.a;
+ var nKey = dict.b;
+ var nValue = dict.c;
+ var nLeft = dict.d;
+ var nRight = dict.e;
+ var _n1 = A2(elm$core$Basics$compare, key, nKey);
+ switch (_n1) {
+ case 0:
+ return A5(
+ elm$core$Dict$balance,
+ nColor,
+ nKey,
+ nValue,
+ A3(elm$core$Dict$insertHelp, key, value, nLeft),
+ nRight);
+ case 1:
+ return A5(elm$core$Dict$RBNode_elm_builtin, nColor, nKey, value, nLeft, nRight);
+ default:
+ return A5(
+ elm$core$Dict$balance,
+ nColor,
+ nKey,
+ nValue,
+ nLeft,
+ A3(elm$core$Dict$insertHelp, key, value, nRight));
+ }
+ }
+ });
+var elm$core$Dict$insert = F3(
+ function (key, value, dict) {
+ var _n0 = A3(elm$core$Dict$insertHelp, key, value, dict);
+ if ((_n0.$ === -1) && (!_n0.a)) {
+ var _n1 = _n0.a;
+ var k = _n0.b;
+ var v = _n0.c;
+ var l = _n0.d;
+ var r = _n0.e;
+ return A5(elm$core$Dict$RBNode_elm_builtin, 1, k, v, l, r);
+ } else {
+ var x = _n0;
+ return x;
+ }
+ });
+var elm$core$Dict$getMin = function (dict) {
+ getMin:
+ while (true) {
+ if ((dict.$ === -1) && (dict.d.$ === -1)) {
+ var left = dict.d;
+ var $temp$dict = left;
+ dict = $temp$dict;
+ continue getMin;
+ } else {
+ return dict;
+ }
+ }
+};
+var elm$core$Dict$moveRedLeft = function (dict) {
+ if (((dict.$ === -1) && (dict.d.$ === -1)) && (dict.e.$ === -1)) {
+ if ((dict.e.d.$ === -1) && (!dict.e.d.a)) {
+ var clr = dict.a;
+ var k = dict.b;
+ var v = dict.c;
+ var _n1 = dict.d;
+ var lClr = _n1.a;
+ var lK = _n1.b;
+ var lV = _n1.c;
+ var lLeft = _n1.d;
+ var lRight = _n1.e;
+ var _n2 = dict.e;
+ var rClr = _n2.a;
+ var rK = _n2.b;
+ var rV = _n2.c;
+ var rLeft = _n2.d;
+ var _n3 = rLeft.a;
+ var rlK = rLeft.b;
+ var rlV = rLeft.c;
+ var rlL = rLeft.d;
+ var rlR = rLeft.e;
+ var rRight = _n2.e;
+ return A5(
+ elm$core$Dict$RBNode_elm_builtin,
+ 0,
+ rlK,
+ rlV,
+ A5(
+ elm$core$Dict$RBNode_elm_builtin,
+ 1,
+ k,
+ v,
+ A5(elm$core$Dict$RBNode_elm_builtin, 0, lK, lV, lLeft, lRight),
+ rlL),
+ A5(elm$core$Dict$RBNode_elm_builtin, 1, rK, rV, rlR, rRight));
+ } else {
+ var clr = dict.a;
+ var k = dict.b;
+ var v = dict.c;
+ var _n4 = dict.d;
+ var lClr = _n4.a;
+ var lK = _n4.b;
+ var lV = _n4.c;
+ var lLeft = _n4.d;
+ var lRight = _n4.e;
+ var _n5 = dict.e;
+ var rClr = _n5.a;
+ var rK = _n5.b;
+ var rV = _n5.c;
+ var rLeft = _n5.d;
+ var rRight = _n5.e;
+ if (clr === 1) {
+ return A5(
+ elm$core$Dict$RBNode_elm_builtin,
+ 1,
+ k,
+ v,
+ A5(elm$core$Dict$RBNode_elm_builtin, 0, lK, lV, lLeft, lRight),
+ A5(elm$core$Dict$RBNode_elm_builtin, 0, rK, rV, rLeft, rRight));
+ } else {
+ return A5(
+ elm$core$Dict$RBNode_elm_builtin,
+ 1,
+ k,
+ v,
+ A5(elm$core$Dict$RBNode_elm_builtin, 0, lK, lV, lLeft, lRight),
+ A5(elm$core$Dict$RBNode_elm_builtin, 0, rK, rV, rLeft, rRight));
+ }
+ }
+ } else {
+ return dict;
+ }
+};
+var elm$core$Dict$moveRedRight = function (dict) {
+ if (((dict.$ === -1) && (dict.d.$ === -1)) && (dict.e.$ === -1)) {
+ if ((dict.d.d.$ === -1) && (!dict.d.d.a)) {
+ var clr = dict.a;
+ var k = dict.b;
+ var v = dict.c;
+ var _n1 = dict.d;
+ var lClr = _n1.a;
+ var lK = _n1.b;
+ var lV = _n1.c;
+ var _n2 = _n1.d;
+ var _n3 = _n2.a;
+ var llK = _n2.b;
+ var llV = _n2.c;
+ var llLeft = _n2.d;
+ var llRight = _n2.e;
+ var lRight = _n1.e;
+ var _n4 = dict.e;
+ var rClr = _n4.a;
+ var rK = _n4.b;
+ var rV = _n4.c;
+ var rLeft = _n4.d;
+ var rRight = _n4.e;
+ return A5(
+ elm$core$Dict$RBNode_elm_builtin,
+ 0,
+ lK,
+ lV,
+ A5(elm$core$Dict$RBNode_elm_builtin, 1, llK, llV, llLeft, llRight),
+ A5(
+ elm$core$Dict$RBNode_elm_builtin,
+ 1,
+ k,
+ v,
+ lRight,
+ A5(elm$core$Dict$RBNode_elm_builtin, 0, rK, rV, rLeft, rRight)));
+ } else {
+ var clr = dict.a;
+ var k = dict.b;
+ var v = dict.c;
+ var _n5 = dict.d;
+ var lClr = _n5.a;
+ var lK = _n5.b;
+ var lV = _n5.c;
+ var lLeft = _n5.d;
+ var lRight = _n5.e;
+ var _n6 = dict.e;
+ var rClr = _n6.a;
+ var rK = _n6.b;
+ var rV = _n6.c;
+ var rLeft = _n6.d;
+ var rRight = _n6.e;
+ if (clr === 1) {
+ return A5(
+ elm$core$Dict$RBNode_elm_builtin,
+ 1,
+ k,
+ v,
+ A5(elm$core$Dict$RBNode_elm_builtin, 0, lK, lV, lLeft, lRight),
+ A5(elm$core$Dict$RBNode_elm_builtin, 0, rK, rV, rLeft, rRight));
+ } else {
+ return A5(
+ elm$core$Dict$RBNode_elm_builtin,
+ 1,
+ k,
+ v,
+ A5(elm$core$Dict$RBNode_elm_builtin, 0, lK, lV, lLeft, lRight),
+ A5(elm$core$Dict$RBNode_elm_builtin, 0, rK, rV, rLeft, rRight));
+ }
+ }
+ } else {
+ return dict;
+ }
+};
+var elm$core$Dict$removeHelpPrepEQGT = F7(
+ function (targetKey, dict, color, key, value, left, right) {
+ if ((left.$ === -1) && (!left.a)) {
+ var _n1 = left.a;
+ var lK = left.b;
+ var lV = left.c;
+ var lLeft = left.d;
+ var lRight = left.e;
+ return A5(
+ elm$core$Dict$RBNode_elm_builtin,
+ color,
+ lK,
+ lV,
+ lLeft,
+ A5(elm$core$Dict$RBNode_elm_builtin, 0, key, value, lRight, right));
+ } else {
+ _n2$2:
+ while (true) {
+ if ((right.$ === -1) && (right.a === 1)) {
+ if (right.d.$ === -1) {
+ if (right.d.a === 1) {
+ var _n3 = right.a;
+ var _n4 = right.d;
+ var _n5 = _n4.a;
+ return elm$core$Dict$moveRedRight(dict);
+ } else {
+ break _n2$2;
+ }
+ } else {
+ var _n6 = right.a;
+ var _n7 = right.d;
+ return elm$core$Dict$moveRedRight(dict);
+ }
+ } else {
+ break _n2$2;
+ }
+ }
+ return dict;
+ }
+ });
+var elm$core$Dict$removeMin = function (dict) {
+ if ((dict.$ === -1) && (dict.d.$ === -1)) {
+ var color = dict.a;
+ var key = dict.b;
+ var value = dict.c;
+ var left = dict.d;
+ var lColor = left.a;
+ var lLeft = left.d;
+ var right = dict.e;
+ if (lColor === 1) {
+ if ((lLeft.$ === -1) && (!lLeft.a)) {
+ var _n3 = lLeft.a;
+ return A5(
+ elm$core$Dict$RBNode_elm_builtin,
+ color,
+ key,
+ value,
+ elm$core$Dict$removeMin(left),
+ right);
+ } else {
+ var _n4 = elm$core$Dict$moveRedLeft(dict);
+ if (_n4.$ === -1) {
+ var nColor = _n4.a;
+ var nKey = _n4.b;
+ var nValue = _n4.c;
+ var nLeft = _n4.d;
+ var nRight = _n4.e;
+ return A5(
+ elm$core$Dict$balance,
+ nColor,
+ nKey,
+ nValue,
+ elm$core$Dict$removeMin(nLeft),
+ nRight);
+ } else {
+ return elm$core$Dict$RBEmpty_elm_builtin;
+ }
+ }
+ } else {
+ return A5(
+ elm$core$Dict$RBNode_elm_builtin,
+ color,
+ key,
+ value,
+ elm$core$Dict$removeMin(left),
+ right);
+ }
+ } else {
+ return elm$core$Dict$RBEmpty_elm_builtin;
+ }
+};
+var elm$core$Dict$removeHelp = F2(
+ function (targetKey, dict) {
+ if (dict.$ === -2) {
+ return elm$core$Dict$RBEmpty_elm_builtin;
+ } else {
+ var color = dict.a;
+ var key = dict.b;
+ var value = dict.c;
+ var left = dict.d;
+ var right = dict.e;
+ if (_Utils_cmp(targetKey, key) < 0) {
+ if ((left.$ === -1) && (left.a === 1)) {
+ var _n4 = left.a;
+ var lLeft = left.d;
+ if ((lLeft.$ === -1) && (!lLeft.a)) {
+ var _n6 = lLeft.a;
+ return A5(
+ elm$core$Dict$RBNode_elm_builtin,
+ color,
+ key,
+ value,
+ A2(elm$core$Dict$removeHelp, targetKey, left),
+ right);
+ } else {
+ var _n7 = elm$core$Dict$moveRedLeft(dict);
+ if (_n7.$ === -1) {
+ var nColor = _n7.a;
+ var nKey = _n7.b;
+ var nValue = _n7.c;
+ var nLeft = _n7.d;
+ var nRight = _n7.e;
+ return A5(
+ elm$core$Dict$balance,
+ nColor,
+ nKey,
+ nValue,
+ A2(elm$core$Dict$removeHelp, targetKey, nLeft),
+ nRight);
+ } else {
+ return elm$core$Dict$RBEmpty_elm_builtin;
+ }
+ }
+ } else {
+ return A5(
+ elm$core$Dict$RBNode_elm_builtin,
+ color,
+ key,
+ value,
+ A2(elm$core$Dict$removeHelp, targetKey, left),
+ right);
+ }
+ } else {
+ return A2(
+ elm$core$Dict$removeHelpEQGT,
+ targetKey,
+ A7(elm$core$Dict$removeHelpPrepEQGT, targetKey, dict, color, key, value, left, right));
+ }
+ }
+ });
+var elm$core$Dict$removeHelpEQGT = F2(
+ function (targetKey, dict) {
+ if (dict.$ === -1) {
+ var color = dict.a;
+ var key = dict.b;
+ var value = dict.c;
+ var left = dict.d;
+ var right = dict.e;
+ if (_Utils_eq(targetKey, key)) {
+ var _n1 = elm$core$Dict$getMin(right);
+ if (_n1.$ === -1) {
+ var minKey = _n1.b;
+ var minValue = _n1.c;
+ return A5(
+ elm$core$Dict$balance,
+ color,
+ minKey,
+ minValue,
+ left,
+ elm$core$Dict$removeMin(right));
+ } else {
+ return elm$core$Dict$RBEmpty_elm_builtin;
+ }
+ } else {
+ return A5(
+ elm$core$Dict$balance,
+ color,
+ key,
+ value,
+ left,
+ A2(elm$core$Dict$removeHelp, targetKey, right));
+ }
+ } else {
+ return elm$core$Dict$RBEmpty_elm_builtin;
+ }
+ });
+var elm$core$Dict$remove = F2(
+ function (key, dict) {
+ var _n0 = A2(elm$core$Dict$removeHelp, key, dict);
+ if ((_n0.$ === -1) && (!_n0.a)) {
+ var _n1 = _n0.a;
+ var k = _n0.b;
+ var v = _n0.c;
+ var l = _n0.d;
+ var r = _n0.e;
+ return A5(elm$core$Dict$RBNode_elm_builtin, 1, k, v, l, r);
+ } else {
+ var x = _n0;
+ return x;
+ }
+ });
+var elm$core$Dict$update = F3(
+ function (targetKey, alter, dictionary) {
+ var _n0 = alter(
+ A2(elm$core$Dict$get, targetKey, dictionary));
+ if (!_n0.$) {
+ var value = _n0.a;
+ return A3(elm$core$Dict$insert, targetKey, value, dictionary);
+ } else {
+ return A2(elm$core$Dict$remove, targetKey, dictionary);
+ }
+ });
+var elm$core$Maybe$isJust = function (maybe) {
+ if (!maybe.$) {
+ return true;
+ } else {
+ return false;
+ }
+};
+var elm$core$Result$map = F2(
+ function (func, ra) {
+ if (!ra.$) {
+ var a = ra.a;
+ return elm$core$Result$Ok(
+ func(a));
+ } else {
+ var e = ra.a;
+ return elm$core$Result$Err(e);
+ }
+ });
+var elm$http$Http$BadPayload = F2(
+ function (a, b) {
+ return {$: 4, a: a, b: b};
+ });
+var elm$http$Http$BadStatus = function (a) {
+ return {$: 3, a: a};
+};
+var elm$http$Http$BadUrl = function (a) {
+ return {$: 0, a: a};
+};
+var elm$http$Http$NetworkError = {$: 2};
+var elm$http$Http$Timeout = {$: 1};
+var elm$http$Http$Internal$FormDataBody = function (a) {
+ return {$: 2, a: a};
+};
+var elm$http$Http$Internal$isStringBody = function (body) {
+ if (body.$ === 1) {
+ return true;
+ } else {
+ return false;
+ }
+};
+var elm$http$Http$expectStringResponse = _Http_expectStringResponse;
+var elm$http$Http$expectString = elm$http$Http$expectStringResponse(
+ function (response) {
+ return elm$core$Result$Ok(response.bm);
+ });
+var elm$core$Basics$identity = function (x) {
+ return x;
+};
+var elm$http$Http$Internal$Request = elm$core$Basics$identity;
+var elm$http$Http$request = elm$core$Basics$identity;
+var elm$http$Http$getString = function (url) {
+ return elm$http$Http$request(
+ {bm: elm$http$Http$emptyBody, ab: elm$http$Http$expectString, V: _List_Nil, ad: 'GET', aC: elm$core$Maybe$Nothing, b2: url, aD: false});
+};
+var elm$core$Basics$composeL = F3(
+ function (g, f, x) {
+ return g(
+ f(x));
+ });
+var elm$core$Task$Perform = elm$core$Basics$identity;
+var elm$core$Task$andThen = _Scheduler_andThen;
+var elm$core$Task$succeed = _Scheduler_succeed;
+var elm$core$Task$init = elm$core$Task$succeed(0);
+var elm$core$List$foldrHelper = F4(
+ function (fn, acc, ctr, ls) {
+ if (!ls.b) {
+ return acc;
+ } else {
+ var a = ls.a;
+ var r1 = ls.b;
+ if (!r1.b) {
+ return A2(fn, a, acc);
+ } else {
+ var b = r1.a;
+ var r2 = r1.b;
+ if (!r2.b) {
+ return A2(
+ fn,
+ a,
+ A2(fn, b, acc));
+ } else {
+ var c = r2.a;
+ var r3 = r2.b;
+ if (!r3.b) {
+ return A2(
+ fn,
+ a,
+ A2(
+ fn,
+ b,
+ A2(fn, c, acc)));
+ } else {
+ var d = r3.a;
+ var r4 = r3.b;
+ var res = (ctr > 500) ? A3(
+ elm$core$List$foldl,
+ fn,
+ acc,
+ elm$core$List$reverse(r4)) : A4(elm$core$List$foldrHelper, fn, acc, ctr + 1, r4);
+ return A2(
+ fn,
+ a,
+ A2(
+ fn,
+ b,
+ A2(
+ fn,
+ c,
+ A2(fn, d, res))));
+ }
+ }
+ }
+ }
+ });
+var elm$core$List$foldr = F3(
+ function (fn, acc, ls) {
+ return A4(elm$core$List$foldrHelper, fn, acc, 0, ls);
+ });
+var elm$core$List$map = F2(
+ function (f, xs) {
+ return A3(
+ elm$core$List$foldr,
+ F2(
+ function (x, acc) {
+ return A2(
+ elm$core$List$cons,
+ f(x),
+ acc);
+ }),
+ _List_Nil,
+ xs);
+ });
+var elm$core$Task$map = F2(
+ function (func, taskA) {
+ return A2(
+ elm$core$Task$andThen,
+ function (a) {
+ return elm$core$Task$succeed(
+ func(a));
+ },
+ taskA);
+ });
+var elm$core$Task$map2 = F3(
+ function (func, taskA, taskB) {
+ return A2(
+ elm$core$Task$andThen,
+ function (a) {
+ return A2(
+ elm$core$Task$andThen,
+ function (b) {
+ return elm$core$Task$succeed(
+ A2(func, a, b));
+ },
+ taskB);
+ },
+ taskA);
+ });
+var elm$core$Task$sequence = function (tasks) {
+ return A3(
+ elm$core$List$foldr,
+ elm$core$Task$map2(elm$core$List$cons),
+ elm$core$Task$succeed(_List_Nil),
+ tasks);
+};
+var elm$core$Platform$sendToApp = _Platform_sendToApp;
+var elm$core$Task$spawnCmd = F2(
+ function (router, _n0) {
+ var task = _n0;
+ return _Scheduler_spawn(
+ A2(
+ elm$core$Task$andThen,
+ elm$core$Platform$sendToApp(router),
+ task));
+ });
+var elm$core$Task$onEffects = F3(
+ function (router, commands, state) {
+ return A2(
+ elm$core$Task$map,
+ function (_n0) {
+ return 0;
+ },
+ elm$core$Task$sequence(
+ A2(
+ elm$core$List$map,
+ elm$core$Task$spawnCmd(router),
+ commands)));
+ });
+var elm$core$Task$onSelfMsg = F3(
+ function (_n0, _n1, _n2) {
+ return elm$core$Task$succeed(0);
+ });
+var elm$core$Task$cmdMap = F2(
+ function (tagger, _n0) {
+ var task = _n0;
+ return A2(elm$core$Task$map, tagger, task);
+ });
+_Platform_effectManagers['Task'] = _Platform_createManager(elm$core$Task$init, elm$core$Task$onEffects, elm$core$Task$onSelfMsg, elm$core$Task$cmdMap);
+var elm$core$Task$command = _Platform_leaf('Task');
+var elm$core$Task$onError = _Scheduler_onError;
+var elm$core$Task$attempt = F2(
+ function (resultToMessage, task) {
+ return elm$core$Task$command(
+ A2(
+ elm$core$Task$onError,
+ A2(
+ elm$core$Basics$composeL,
+ A2(elm$core$Basics$composeL, elm$core$Task$succeed, resultToMessage),
+ elm$core$Result$Err),
+ A2(
+ elm$core$Task$andThen,
+ A2(
+ elm$core$Basics$composeL,
+ A2(elm$core$Basics$composeL, elm$core$Task$succeed, resultToMessage),
+ elm$core$Result$Ok),
+ task)));
+ });
+var elm$http$Http$toTask = function (_n0) {
+ var request_ = _n0;
+ return A2(_Http_toTask, request_, elm$core$Maybe$Nothing);
+};
+var elm$http$Http$send = F2(
+ function (resultToMessage, request_) {
+ return A2(
+ elm$core$Task$attempt,
+ resultToMessage,
+ elm$http$Http$toTask(request_));
+ });
+var author$project$Main$fetchStyle = F2(
+ function (styleUrl, token) {
+ return A2(
+ elm$http$Http$send,
+ author$project$Main$LoadedStyle,
+ elm$http$Http$getString(
+ A3(elm$core$String$replace, 'mapbox://styles/', 'https://api.mapbox.com/styles/v1/', styleUrl) + ('?access_token=' + token)));
+ });
+var author$project$Main$update = F2(
+ function (msg, model) {
+ switch (msg.$) {
+ case 0:
+ if (!msg.a.$) {
+ var style = msg.a.a;
+ return _Utils_Tuple2(
+ _Utils_update(
+ model,
+ {
+ aB: elm$core$Maybe$Just(style)
+ }),
+ elm$core$Platform$Cmd$none);
+ } else {
+ var e = msg.a.a;
+ return _Utils_Tuple2(
+ _Utils_update(
+ model,
+ {
+ aa: elm$core$Maybe$Just(
+ author$project$Main$errorToString(e))
+ }),
+ elm$core$Platform$Cmd$none);
+ }
+ case 1:
+ return _Utils_Tuple2(
+ model,
+ A2(author$project$Main$fetchStyle, model.X, model.Y));
+ case 2:
+ var s = msg.a;
+ return _Utils_Tuple2(
+ _Utils_update(
+ model,
+ {X: s}),
+ elm$core$Platform$Cmd$none);
+ default:
+ var s = msg.a;
+ return _Utils_Tuple2(
+ _Utils_update(
+ model,
+ {Y: s}),
+ elm$core$Platform$Cmd$none);
+ }
+ });
+var stil4m$elm_syntax$Elm$Syntax$Node$Node = F2(
+ function (a, b) {
+ return {$: 0, a: a, b: b};
+ });
+var stil4m$elm_syntax$Elm$Syntax$Range$emptyRange = {
+ bA: {aI: 0, a7: 0},
+ bY: {aI: 0, a7: 0}
+};
+var author$project$Decoder$node = stil4m$elm_syntax$Elm$Syntax$Node$Node(stil4m$elm_syntax$Elm$Syntax$Range$emptyRange);
+var author$project$Decoder$wrapNodes = elm$core$List$map(author$project$Decoder$node);
+var stil4m$elm_syntax$Elm$Syntax$Declaration$FunctionDeclaration = function (a) {
+ return {$: 0, a: a};
+};
+var stil4m$elm_syntax$Elm$Syntax$Expression$Application = function (a) {
+ return {$: 1, a: a};
+};
+var stil4m$elm_syntax$Elm$Syntax$Expression$FunctionOrValue = F2(
+ function (a, b) {
+ return {$: 3, a: a, b: b};
+ });
+var stil4m$elm_syntax$Elm$Syntax$Expression$RecordExpr = function (a) {
+ return {$: 18, a: a};
+};
+var stil4m$elm_syntax$Elm$Syntax$TypeAnnotation$Typed = F2(
+ function (a, b) {
+ return {$: 1, a: a, b: b};
+ });
+var author$project$Decoder$declarations = function (styleDec) {
+ return _List_fromArray(
+ [
+ stil4m$elm_syntax$Elm$Syntax$Declaration$FunctionDeclaration(
+ {
+ bv: author$project$Decoder$node(
+ {
+ bk: _List_Nil,
+ bC: author$project$Decoder$node(
+ stil4m$elm_syntax$Elm$Syntax$Expression$Application(
+ author$project$Decoder$wrapNodes(
+ _List_fromArray(
+ [
+ A2(stil4m$elm_syntax$Elm$Syntax$Expression$FunctionOrValue, _List_Nil, 'Style'),
+ stil4m$elm_syntax$Elm$Syntax$Expression$RecordExpr(styleDec)
+ ])))),
+ ae: author$project$Decoder$node('style')
+ }),
+ by: elm$core$Maybe$Nothing,
+ bX: elm$core$Maybe$Just(
+ author$project$Decoder$node(
+ {
+ ae: author$project$Decoder$node('style'),
+ b0: author$project$Decoder$node(
+ A2(
+ stil4m$elm_syntax$Elm$Syntax$TypeAnnotation$Typed,
+ author$project$Decoder$node(
+ _Utils_Tuple2(_List_Nil, 'Style')),
+ _List_Nil))
+ }))
+ })
+ ]);
+};
+var stil4m$elm_syntax$Elm$Syntax$Exposing$Explicit = function (a) {
+ return {$: 1, a: a};
+};
+var stil4m$elm_syntax$Elm$Syntax$Exposing$FunctionExpose = function (a) {
+ return {$: 1, a: a};
+};
+var stil4m$elm_syntax$Elm$Syntax$Exposing$TypeExpose = function (a) {
+ return {$: 3, a: a};
+};
+var stil4m$elm_syntax$Elm$Syntax$Module$NormalModule = function (a) {
+ return {$: 0, a: a};
+};
+var author$project$Decoder$file = function (styleDec) {
+ return {
+ bt: _List_Nil,
+ bw: A2(
+ elm$core$List$map,
+ author$project$Decoder$node,
+ author$project$Decoder$declarations(styleDec)),
+ bI: _List_fromArray(
+ [
+ author$project$Decoder$node(
+ {
+ M: elm$core$Maybe$Just(
+ stil4m$elm_syntax$Elm$Syntax$Exposing$Explicit(
+ _List_fromArray(
+ [
+ author$project$Decoder$node(
+ stil4m$elm_syntax$Elm$Syntax$Exposing$TypeExpose(
+ {
+ ae: 'Style',
+ bR: elm$core$Maybe$Just(stil4m$elm_syntax$Elm$Syntax$Range$emptyRange)
+ }))
+ ]))),
+ W: elm$core$Maybe$Just(
+ author$project$Decoder$node(
+ _List_fromArray(
+ ['Style']))),
+ O: author$project$Decoder$node(
+ _List_fromArray(
+ ['Mapbox', 'Style']))
+ }),
+ author$project$Decoder$node(
+ {
+ M: elm$core$Maybe$Nothing,
+ W: elm$core$Maybe$Just(
+ author$project$Decoder$node(
+ _List_fromArray(
+ ['Source']))),
+ O: author$project$Decoder$node(
+ _List_fromArray(
+ ['Mapbox', 'Source']))
+ }),
+ author$project$Decoder$node(
+ {
+ M: elm$core$Maybe$Nothing,
+ W: elm$core$Maybe$Just(
+ author$project$Decoder$node(
+ _List_fromArray(
+ ['Layer']))),
+ O: author$project$Decoder$node(
+ _List_fromArray(
+ ['Mapbox', 'Layer']))
+ }),
+ author$project$Decoder$node(
+ {
+ M: elm$core$Maybe$Just(
+ stil4m$elm_syntax$Elm$Syntax$Exposing$Explicit(
+ _List_fromArray(
+ [
+ author$project$Decoder$node(
+ stil4m$elm_syntax$Elm$Syntax$Exposing$FunctionExpose('str')),
+ author$project$Decoder$node(
+ stil4m$elm_syntax$Elm$Syntax$Exposing$FunctionExpose('float')),
+ author$project$Decoder$node(
+ stil4m$elm_syntax$Elm$Syntax$Exposing$FunctionExpose('int')),
+ author$project$Decoder$node(
+ stil4m$elm_syntax$Elm$Syntax$Exposing$FunctionExpose('true')),
+ author$project$Decoder$node(
+ stil4m$elm_syntax$Elm$Syntax$Exposing$FunctionExpose('false'))
+ ]))),
+ W: elm$core$Maybe$Just(
+ author$project$Decoder$node(
+ _List_fromArray(
+ ['E']))),
+ O: author$project$Decoder$node(
+ _List_fromArray(
+ ['Mapbox', 'Expression']))
+ })
+ ]),
+ bO: author$project$Decoder$node(
+ stil4m$elm_syntax$Elm$Syntax$Module$NormalModule(
+ {
+ M: author$project$Decoder$node(
+ stil4m$elm_syntax$Elm$Syntax$Exposing$Explicit(
+ _List_fromArray(
+ [
+ author$project$Decoder$node(
+ stil4m$elm_syntax$Elm$Syntax$Exposing$FunctionExpose('style'))
+ ]))),
+ O: author$project$Decoder$node(
+ _List_fromArray(
+ ['Style']))
+ }))
+ };
+};
+var author$project$Decoder$addBogusRange = F2(
+ function (index, _n0) {
+ var v = _n0.b;
+ return A2(
+ stil4m$elm_syntax$Elm$Syntax$Node$Node,
+ {
+ bA: {aI: 0, a7: index + 1},
+ bY: {aI: 0, a7: index}
+ },
+ v);
+ });
+var elm$core$Basics$composeR = F3(
+ function (f, g, x) {
+ return g(
+ f(x));
+ });
+var stil4m$elm_syntax$Elm$Syntax$Expression$ParenthesizedExpression = function (a) {
+ return {$: 14, a: a};
+};
+var author$project$Decoder$parens = A2(elm$core$Basics$composeR, stil4m$elm_syntax$Elm$Syntax$Expression$ParenthesizedExpression, author$project$Decoder$node);
+var author$project$Decoder$call = F3(
+ function (ns, name, args) {
+ return author$project$Decoder$parens(
+ author$project$Decoder$node(
+ stil4m$elm_syntax$Elm$Syntax$Expression$Application(
+ A2(
+ elm$core$List$cons,
+ author$project$Decoder$node(
+ A2(
+ stil4m$elm_syntax$Elm$Syntax$Expression$FunctionOrValue,
+ _List_fromArray(
+ [ns]),
+ name)),
+ args))));
+ });
+var elm$json$Json$Decode$map2 = _Json_map2;
+var elm$json$Json$Decode$succeed = _Json_succeed;
+var author$project$Decoder$combine = A2(
+ elm$core$List$foldr,
+ elm$json$Json$Decode$map2(elm$core$List$cons),
+ elm$json$Json$Decode$succeed(_List_Nil));
+var elm$core$Basics$and = _Basics_and;
+var elm$core$Basics$or = _Basics_or;
+var elm$core$Char$toCode = _Char_toCode;
+var elm$core$Char$isLower = function (_char) {
+ var code = elm$core$Char$toCode(_char);
+ return (97 <= code) && (code <= 122);
+};
+var elm$core$Char$isUpper = function (_char) {
+ var code = elm$core$Char$toCode(_char);
+ return (code <= 90) && (65 <= code);
+};
+var elm$core$Char$isAlpha = function (_char) {
+ return elm$core$Char$isLower(_char) || elm$core$Char$isUpper(_char);
+};
+var elm$core$Char$isDigit = function (_char) {
+ var code = elm$core$Char$toCode(_char);
+ return (code <= 57) && (48 <= code);
+};
+var elm$core$Char$isAlphaNum = function (_char) {
+ return elm$core$Char$isLower(_char) || (elm$core$Char$isUpper(_char) || elm$core$Char$isDigit(_char));
+};
+var elm$core$List$length = function (xs) {
+ return A3(
+ elm$core$List$foldl,
+ F2(
+ function (_n0, i) {
+ return i + 1;
+ }),
+ 0,
+ xs);
+};
+var elm$core$List$map2 = _List_map2;
+var elm$core$List$rangeHelp = F3(
+ function (lo, hi, list) {
+ rangeHelp:
+ while (true) {
+ if (_Utils_cmp(lo, hi) < 1) {
+ var $temp$lo = lo,
+ $temp$hi = hi - 1,
+ $temp$list = A2(elm$core$List$cons, hi, list);
+ lo = $temp$lo;
+ hi = $temp$hi;
+ list = $temp$list;
+ continue rangeHelp;
+ } else {
+ return list;
+ }
+ }
+ });
+var elm$core$List$range = F2(
+ function (lo, hi) {
+ return A3(elm$core$List$rangeHelp, lo, hi, _List_Nil);
+ });
+var elm$core$List$indexedMap = F2(
+ function (f, xs) {
+ return A3(
+ elm$core$List$map2,
+ f,
+ A2(
+ elm$core$List$range,
+ 0,
+ elm$core$List$length(xs) - 1),
+ xs);
+ });
+var elm$core$String$all = _String_all;
+var elm$core$String$fromInt = _String_fromNumber;
+var elm$core$String$uncons = _String_uncons;
+var elm$json$Json$Decode$indent = function (str) {
+ return A2(
+ elm$core$String$join,
+ '\n ',
+ A2(elm$core$String$split, '\n', str));
+};
+var elm$json$Json$Encode$encode = _Json_encode;
+var elm$json$Json$Decode$errorOneOf = F2(
+ function (i, error) {
+ return '\n\n(' + (elm$core$String$fromInt(i + 1) + (') ' + elm$json$Json$Decode$indent(
+ elm$json$Json$Decode$errorToString(error))));
+ });
+var elm$json$Json$Decode$errorToString = function (error) {
+ return A2(elm$json$Json$Decode$errorToStringHelp, error, _List_Nil);
+};
+var elm$json$Json$Decode$errorToStringHelp = F2(
+ function (error, context) {
+ errorToStringHelp:
+ while (true) {
+ switch (error.$) {
+ case 0:
+ var f = error.a;
+ var err = error.b;
+ var isSimple = function () {
+ var _n1 = elm$core$String$uncons(f);
+ if (_n1.$ === 1) {
+ return false;
+ } else {
+ var _n2 = _n1.a;
+ var _char = _n2.a;
+ var rest = _n2.b;
+ return elm$core$Char$isAlpha(_char) && A2(elm$core$String$all, elm$core$Char$isAlphaNum, rest);
+ }
+ }();
+ var fieldName = isSimple ? ('.' + f) : ('[\'' + (f + '\']'));
+ var $temp$error = err,
+ $temp$context = A2(elm$core$List$cons, fieldName, context);
+ error = $temp$error;
+ context = $temp$context;
+ continue errorToStringHelp;
+ case 1:
+ var i = error.a;
+ var err = error.b;
+ var indexName = '[' + (elm$core$String$fromInt(i) + ']');
+ var $temp$error = err,
+ $temp$context = A2(elm$core$List$cons, indexName, context);
+ error = $temp$error;
+ context = $temp$context;
+ continue errorToStringHelp;
+ case 2:
+ var errors = error.a;
+ if (!errors.b) {
+ return 'Ran into a Json.Decode.oneOf with no possibilities' + function () {
+ if (!context.b) {
+ return '!';
+ } else {
+ return ' at json' + A2(
+ elm$core$String$join,
+ '',
+ elm$core$List$reverse(context));
+ }
+ }();
+ } else {
+ if (!errors.b.b) {
+ var err = errors.a;
+ var $temp$error = err,
+ $temp$context = context;
+ error = $temp$error;
+ context = $temp$context;
+ continue errorToStringHelp;
+ } else {
+ var starter = function () {
+ if (!context.b) {
+ return 'Json.Decode.oneOf';
+ } else {
+ return 'The Json.Decode.oneOf at json' + A2(
+ elm$core$String$join,
+ '',
+ elm$core$List$reverse(context));
+ }
+ }();
+ var introduction = starter + (' failed in the following ' + (elm$core$String$fromInt(
+ elm$core$List$length(errors)) + ' ways:'));
+ return A2(
+ elm$core$String$join,
+ '\n\n',
+ A2(
+ elm$core$List$cons,
+ introduction,
+ A2(elm$core$List$indexedMap, elm$json$Json$Decode$errorOneOf, errors)));
+ }
+ }
+ default:
+ var msg = error.a;
+ var json = error.b;
+ var introduction = function () {
+ if (!context.b) {
+ return 'Problem with the given value:\n\n';
+ } else {
+ return 'Problem with the value at json' + (A2(
+ elm$core$String$join,
+ '',
+ elm$core$List$reverse(context)) + ':\n\n ');
+ }
+ }();
+ return introduction + (elm$json$Json$Decode$indent(
+ A2(elm$json$Json$Encode$encode, 4, json)) + ('\n\n' + msg));
+ }
+ }
+ });
+var elm$json$Json$Decode$fail = _Json_fail;
+var author$project$Decoder$resultToDecoder = function (res) {
+ if (!res.$) {
+ var a = res.a;
+ return elm$json$Json$Decode$succeed(a);
+ } else {
+ var e = res.a;
+ return elm$json$Json$Decode$fail(
+ elm$json$Json$Decode$errorToString(e));
+ }
+};
+var elm$json$Json$Decode$decodeValue = _Json_run;
+var elm$json$Json$Decode$map = _Json_map1;
+var elm$core$List$intersperse = F2(
+ function (sep, xs) {
+ if (!xs.b) {
+ return _List_Nil;
+ } else {
+ var hd = xs.a;
+ var tl = xs.b;
+ var step = F2(
+ function (x, rest) {
+ return A2(
+ elm$core$List$cons,
+ sep,
+ A2(elm$core$List$cons, x, rest));
+ });
+ var spersed = A3(elm$core$List$foldr, step, _List_Nil, tl);
+ return A2(elm$core$List$cons, hd, spersed);
+ }
+ });
+var elm$core$String$concat = function (strings) {
+ return A2(elm$core$String$join, '', strings);
+};
+var elm$core$Basics$not = _Basics_not;
+var elm$core$Char$toLower = _Char_toLower;
+var elm$core$Char$toUpper = _Char_toUpper;
+var elm$core$String$fromList = _String_fromList;
+var elm$core$String$foldr = _String_foldr;
+var elm$core$String$toList = function (string) {
+ return A3(elm$core$String$foldr, elm$core$List$cons, _List_Nil, string);
+};
+var the_sett$elm_string_case$String$Case$ContinueWordCaps = 2;
+var the_sett$elm_string_case$String$Case$ContinueWordLower = 3;
+var the_sett$elm_string_case$String$Case$Initial = 0;
+var the_sett$elm_string_case$String$Case$StartWord = 1;
+var the_sett$elm_string_case$String$Case$isLetterOrDigit = function (_char) {
+ return elm$core$Char$isUpper(_char) || (elm$core$Char$isLower(_char) || elm$core$Char$isDigit(_char));
+};
+var the_sett$elm_string_case$String$Case$isUpperCase = elm$core$Char$isUpper;
+var the_sett$elm_string_case$String$Case$split = F3(
+ function (firstLetterUpper, firstLetterOfWordUpper, value) {
+ var writeChar = F2(
+ function (_char, state) {
+ return (((!state.F) && state.m) || (state.F && firstLetterUpper)) ? _Utils_update(
+ state,
+ {
+ n: A2(
+ elm$core$List$cons,
+ elm$core$Char$toUpper(_char),
+ state.n)
+ }) : _Utils_update(
+ state,
+ {
+ n: A2(
+ elm$core$List$cons,
+ elm$core$Char$toLower(_char),
+ state.n)
+ });
+ });
+ var wordBreak = F2(
+ function (condition, state) {
+ return condition ? _Utils_update(
+ state,
+ {
+ n: _List_Nil,
+ D: A2(
+ elm$core$List$cons,
+ elm$core$String$fromList(
+ elm$core$List$reverse(state.n)),
+ state.D)
+ }) : _Utils_update(
+ state,
+ {n: state.n, D: state.D});
+ });
+ var stateTxWhitespace = F2(
+ function (_char, state) {
+ return _Utils_update(
+ state,
+ {k: 0, m: false});
+ });
+ var stateTxUpperCase = F2(
+ function (_char, state) {
+ return function (nextState) {
+ return _Utils_update(
+ nextState,
+ {F: false});
+ }(
+ A2(
+ writeChar,
+ _char,
+ function () {
+ var _n1 = state.k;
+ switch (_n1) {
+ case 0:
+ return A2(
+ wordBreak,
+ !state.G,
+ _Utils_update(
+ state,
+ {G: false, k: 1, m: firstLetterOfWordUpper}));
+ case 1:
+ return _Utils_update(
+ state,
+ {k: 2, m: false});
+ case 2:
+ return _Utils_update(
+ state,
+ {k: 2, m: false});
+ default:
+ return A2(
+ wordBreak,
+ true,
+ _Utils_update(
+ state,
+ {k: 1, m: firstLetterOfWordUpper}));
+ }
+ }()));
+ });
+ var stateTxLetterOrDigit = F2(
+ function (_char, state) {
+ return function (nextState) {
+ return _Utils_update(
+ nextState,
+ {F: false});
+ }(
+ A2(
+ writeChar,
+ _char,
+ function () {
+ var _n0 = state.k;
+ switch (_n0) {
+ case 0:
+ return A2(
+ wordBreak,
+ !state.G,
+ _Utils_update(
+ state,
+ {G: false, k: 1, m: firstLetterOfWordUpper}));
+ case 1:
+ return _Utils_update(
+ state,
+ {k: 3, m: false});
+ case 2:
+ return _Utils_update(
+ state,
+ {k: 3, m: false});
+ default:
+ return _Utils_update(
+ state,
+ {k: 3, m: false});
+ }
+ }()));
+ });
+ var stateFn = F2(
+ function (_char, state) {
+ return the_sett$elm_string_case$String$Case$isUpperCase(_char) ? A2(stateTxUpperCase, _char, state) : (the_sett$elm_string_case$String$Case$isLetterOrDigit(_char) ? A2(stateTxLetterOrDigit, _char, state) : A2(stateTxWhitespace, _char, state));
+ });
+ var start = {n: _List_Nil, F: true, G: true, k: 0, m: false, D: _List_Nil};
+ var appendLastWord = function (state) {
+ return _Utils_eq(state.n, _List_Nil) ? state : A2(wordBreak, true, state);
+ };
+ return appendLastWord(
+ A3(
+ elm$core$List$foldl,
+ function (_char) {
+ return function (state) {
+ return A2(stateFn, _char, state);
+ };
+ },
+ start,
+ elm$core$String$toList(value))).D;
+ });
+var the_sett$elm_string_case$String$Case$convertCase = F4(
+ function (separator, firstLetterUpper, firstLetterOfWordUpper, value) {
+ return elm$core$String$concat(
+ A2(
+ elm$core$List$intersperse,
+ separator,
+ elm$core$List$reverse(
+ A3(the_sett$elm_string_case$String$Case$split, firstLetterUpper, firstLetterOfWordUpper, value))));
+ });
+var the_sett$elm_string_case$String$Case$toCamelCaseLower = function (name) {
+ return A4(the_sett$elm_string_case$String$Case$convertCase, '', false, true, name);
+};
+var author$project$Decoder$decodeAttr = F3(
+ function (attrName, expressionNodeDecoder, attrValue) {
+ return elm$core$Maybe$Just(
+ A2(
+ elm$json$Json$Decode$map,
+ function (v) {
+ return A3(
+ author$project$Decoder$call,
+ 'Layer',
+ the_sett$elm_string_case$String$Case$toCamelCaseLower(attrName),
+ _List_fromArray(
+ [v]));
+ },
+ author$project$Decoder$resultToDecoder(
+ A2(elm$json$Json$Decode$decodeValue, expressionNodeDecoder, attrValue))));
+ });
+var author$project$Decoder$evalue = function (name) {
+ return author$project$Decoder$node(
+ A2(stil4m$elm_syntax$Elm$Syntax$Expression$FunctionOrValue, _List_Nil, name));
+};
+var elm$json$Json$Decode$bool = _Json_decodeBool;
+var author$project$Decoder$decodeBool = A2(
+ elm$json$Json$Decode$map,
+ function (b) {
+ return b ? author$project$Decoder$evalue('true') : author$project$Decoder$evalue('false');
+ },
+ elm$json$Json$Decode$bool);
+var author$project$Decoder$subdecode = F2(
+ function (d, v) {
+ return author$project$Decoder$resultToDecoder(
+ A2(elm$json$Json$Decode$decodeValue, d, v));
+ });
+var elm$json$Json$Decode$andThen = _Json_andThen;
+var elm$json$Json$Decode$list = _Json_decodeList;
+var elm$json$Json$Decode$value = _Json_decodeValue;
+var author$project$Decoder$decodeTail = function (itemDecoder) {
+ return A2(
+ elm$json$Json$Decode$andThen,
+ function (l) {
+ if (!l.b) {
+ return elm$json$Json$Decode$fail('Can\'t get tail of empty');
+ } else {
+ var head = l.a;
+ var t = l.b;
+ return author$project$Decoder$combine(
+ A2(
+ elm$core$List$map,
+ author$project$Decoder$subdecode(itemDecoder),
+ t));
+ }
+ },
+ elm$json$Json$Decode$list(elm$json$Json$Decode$value));
+};
+var author$project$Decoder$ecall = F2(
+ function (name, arg) {
+ return author$project$Decoder$parens(
+ author$project$Decoder$node(
+ stil4m$elm_syntax$Elm$Syntax$Expression$Application(
+ _List_fromArray(
+ [
+ author$project$Decoder$node(
+ A2(stil4m$elm_syntax$Elm$Syntax$Expression$FunctionOrValue, _List_Nil, name)),
+ arg
+ ]))));
+ });
+var stil4m$elm_syntax$Elm$Syntax$Expression$Floatable = function (a) {
+ return {$: 9, a: a};
+};
+var author$project$Decoder$float = A2(elm$core$Basics$composeR, stil4m$elm_syntax$Elm$Syntax$Expression$Floatable, author$project$Decoder$node);
+var stil4m$elm_syntax$Elm$Syntax$Expression$ListExpr = function (a) {
+ return {$: 19, a: a};
+};
+var author$project$Decoder$list = function (l) {
+ return author$project$Decoder$node(
+ stil4m$elm_syntax$Elm$Syntax$Expression$ListExpr(l));
+};
+var stil4m$elm_syntax$Elm$Syntax$Expression$Literal = function (a) {
+ return {$: 11, a: a};
+};
+var author$project$Decoder$str = function (s) {
+ return author$project$Decoder$node(
+ stil4m$elm_syntax$Elm$Syntax$Expression$Literal(s));
+};
+var author$project$Decoder$todoExpr = function (msg) {
+ return author$project$Decoder$node(
+ stil4m$elm_syntax$Elm$Syntax$Expression$ParenthesizedExpression(
+ A3(
+ author$project$Decoder$call,
+ 'Debug',
+ 'todo',
+ _List_fromArray(
+ [
+ author$project$Decoder$str(msg)
+ ]))));
+};
+var stil4m$elm_syntax$Elm$Syntax$Expression$OperatorApplication = F4(
+ function (a, b, c, d) {
+ return {$: 2, a: a, b: b, c: c, d: d};
+ });
+var stil4m$elm_syntax$Elm$Syntax$Infix$Left = 0;
+var author$project$Decoder$pipelineCall = F3(
+ function (ns, name, args) {
+ if (args.b) {
+ var fst = args.a;
+ var rest = args.b;
+ return author$project$Decoder$parens(
+ author$project$Decoder$node(
+ A4(
+ stil4m$elm_syntax$Elm$Syntax$Expression$OperatorApplication,
+ '|>',
+ 0,
+ fst,
+ A3(author$project$Decoder$call, ns, name, rest))));
+ } else {
+ return author$project$Decoder$todoExpr('Wrong number of arguments passed to ' + (ns + ('.' + name)));
+ }
+ });
+var author$project$Decoder$value = F2(
+ function (ns, name) {
+ return author$project$Decoder$node(
+ A2(
+ stil4m$elm_syntax$Elm$Syntax$Expression$FunctionOrValue,
+ _List_fromArray(
+ [ns]),
+ name));
+ });
+var elm$core$List$drop = F2(
+ function (n, list) {
+ drop:
+ while (true) {
+ if (n <= 0) {
+ return list;
+ } else {
+ if (!list.b) {
+ return list;
+ } else {
+ var x = list.a;
+ var xs = list.b;
+ var $temp$n = n - 1,
+ $temp$list = xs;
+ n = $temp$n;
+ list = $temp$list;
+ continue drop;
+ }
+ }
+ }
+ });
+var elm$core$List$singleton = function (value) {
+ return _List_fromArray(
+ [value]);
+};
+var elm$json$Json$Decode$float = _Json_decodeFloat;
+var elm$json$Json$Decode$index = _Json_decodeIndex;
+var elm$json$Json$Decode$oneOf = _Json_oneOf;
+var elm$json$Json$Decode$string = _Json_decodeString;
+function author$project$Decoder$cyclic$decodeLegacyFilter() {
+ var decodeVals = elm$json$Json$Decode$list(
+ elm$json$Json$Decode$oneOf(
+ _List_fromArray(
+ [
+ A2(
+ elm$json$Json$Decode$map,
+ A2(
+ elm$core$Basics$composeR,
+ author$project$Decoder$str,
+ author$project$Decoder$ecall('str')),
+ elm$json$Json$Decode$string),
+ A2(
+ elm$json$Json$Decode$map,
+ A2(
+ elm$core$Basics$composeR,
+ author$project$Decoder$float,
+ author$project$Decoder$ecall('float')),
+ elm$json$Json$Decode$float),
+ author$project$Decoder$decodeBool
+ ])));
+ var decodeVal = A2(
+ elm$json$Json$Decode$index,
+ 2,
+ elm$json$Json$Decode$oneOf(
+ _List_fromArray(
+ [
+ A2(
+ elm$json$Json$Decode$map,
+ A2(
+ elm$core$Basics$composeR,
+ author$project$Decoder$str,
+ author$project$Decoder$ecall('str')),
+ elm$json$Json$Decode$string),
+ A2(
+ elm$json$Json$Decode$map,
+ A2(
+ elm$core$Basics$composeR,
+ author$project$Decoder$float,
+ author$project$Decoder$ecall('float')),
+ elm$json$Json$Decode$float),
+ author$project$Decoder$decodeBool
+ ])));
+ var decodeProp = A2(
+ elm$json$Json$Decode$map,
+ function (prop) {
+ switch (prop) {
+ case '$type':
+ return A2(author$project$Decoder$value, 'E', 'geometryType');
+ case '$id':
+ return A2(author$project$Decoder$value, 'E', 'id');
+ default:
+ return A3(
+ author$project$Decoder$call,
+ 'E',
+ 'getProperty',
+ _List_fromArray(
+ [
+ A2(
+ author$project$Decoder$ecall,
+ 'str',
+ author$project$Decoder$str(prop))
+ ]));
+ }
+ },
+ A2(elm$json$Json$Decode$index, 1, elm$json$Json$Decode$string));
+ return A2(
+ elm$json$Json$Decode$andThen,
+ function (filter) {
+ switch (filter) {
+ case 'all':
+ return A2(
+ elm$json$Json$Decode$map,
+ function (filters) {
+ return A3(
+ author$project$Decoder$call,
+ 'E',
+ 'all',
+ _List_fromArray(
+ [
+ author$project$Decoder$list(filters)
+ ]));
+ },
+ author$project$Decoder$decodeTail(
+ author$project$Decoder$cyclic$decodeLegacyFilter()));
+ case 'any':
+ return A2(
+ elm$json$Json$Decode$map,
+ function (filters) {
+ return A3(
+ author$project$Decoder$call,
+ 'E',
+ 'any',
+ _List_fromArray(
+ [
+ author$project$Decoder$list(filters)
+ ]));
+ },
+ author$project$Decoder$decodeTail(
+ author$project$Decoder$cyclic$decodeLegacyFilter()));
+ case 'none':
+ return A2(
+ elm$json$Json$Decode$map,
+ function (filters) {
+ return A3(
+ author$project$Decoder$call,
+ 'E',
+ 'all',
+ _List_fromArray(
+ [
+ author$project$Decoder$list(
+ A2(
+ elm$core$List$map,
+ function (f) {
+ return A3(
+ author$project$Decoder$call,
+ 'E',
+ 'not',
+ _List_fromArray(
+ [f]));
+ },
+ filters))
+ ]));
+ },
+ author$project$Decoder$decodeTail(
+ author$project$Decoder$cyclic$decodeLegacyFilter()));
+ case 'has':
+ return A2(
+ elm$json$Json$Decode$map,
+ function (prop) {
+ return A3(
+ author$project$Decoder$call,
+ 'E',
+ 'hasProperty',
+ _List_fromArray(
+ [
+ A2(
+ author$project$Decoder$ecall,
+ 'str',
+ author$project$Decoder$str(prop))
+ ]));
+ },
+ A2(elm$json$Json$Decode$index, 1, elm$json$Json$Decode$string));
+ case '!has':
+ return A2(
+ elm$json$Json$Decode$map,
+ function (prop) {
+ return A3(
+ author$project$Decoder$call,
+ 'E',
+ 'not',
+ _List_fromArray(
+ [
+ A3(
+ author$project$Decoder$call,
+ 'E',
+ 'hasProperty',
+ _List_fromArray(
+ [
+ A2(
+ author$project$Decoder$ecall,
+ 'str',
+ author$project$Decoder$str(prop))
+ ]))
+ ]));
+ },
+ A2(elm$json$Json$Decode$index, 1, elm$json$Json$Decode$string));
+ case '==':
+ return A3(
+ elm$json$Json$Decode$map2,
+ F2(
+ function (prop, val) {
+ return A3(
+ author$project$Decoder$pipelineCall,
+ 'E',
+ 'isEqual',
+ _List_fromArray(
+ [prop, val]));
+ }),
+ decodeProp,
+ decodeVal);
+ case '!=':
+ return A3(
+ elm$json$Json$Decode$map2,
+ F2(
+ function (prop, val) {
+ return A3(
+ author$project$Decoder$pipelineCall,
+ 'E',
+ 'notEqual',
+ _List_fromArray(
+ [prop, val]));
+ }),
+ decodeProp,
+ decodeVal);
+ case '>':
+ return A3(
+ elm$json$Json$Decode$map2,
+ F2(
+ function (prop, val) {
+ return A3(
+ author$project$Decoder$pipelineCall,
+ 'E',
+ 'greaterThan',
+ _List_fromArray(
+ [prop, val]));
+ }),
+ decodeProp,
+ decodeVal);
+ case '>=':
+ return A3(
+ elm$json$Json$Decode$map2,
+ F2(
+ function (prop, val) {
+ return A3(
+ author$project$Decoder$pipelineCall,
+ 'E',
+ 'greaterThanOrEqual',
+ _List_fromArray(
+ [prop, val]));
+ }),
+ decodeProp,
+ decodeVal);
+ case '<':
+ return A3(
+ elm$json$Json$Decode$map2,
+ F2(
+ function (prop, val) {
+ return A3(
+ author$project$Decoder$pipelineCall,
+ 'E',
+ 'lessThan',
+ _List_fromArray(
+ [prop, val]));
+ }),
+ decodeProp,
+ decodeVal);
+ case '<=':
+ return A3(
+ elm$json$Json$Decode$map2,
+ F2(
+ function (prop, val) {
+ return A3(
+ author$project$Decoder$pipelineCall,
+ 'E',
+ 'lessThanOrEqual',
+ _List_fromArray(
+ [prop, val]));
+ }),
+ decodeProp,
+ decodeVal);
+ case 'in':
+ return A3(
+ elm$json$Json$Decode$map2,
+ F2(
+ function (prop, values) {
+ return A3(
+ author$project$Decoder$call,
+ 'E',
+ 'any',
+ elm$core$List$singleton(
+ author$project$Decoder$list(
+ A2(
+ elm$core$List$map,
+ function (v) {
+ return A3(
+ author$project$Decoder$pipelineCall,
+ 'E',
+ 'isEqual',
+ _List_fromArray(
+ [prop, v]));
+ },
+ A2(elm$core$List$drop, 2, values)))));
+ }),
+ decodeProp,
+ decodeVals);
+ case '!in':
+ return A3(
+ elm$json$Json$Decode$map2,
+ F2(
+ function (prop, values) {
+ return A3(
+ author$project$Decoder$call,
+ 'E',
+ 'all',
+ elm$core$List$singleton(
+ author$project$Decoder$list(
+ A2(
+ elm$core$List$map,
+ function (v) {
+ return A3(
+ author$project$Decoder$pipelineCall,
+ 'E',
+ 'notEqual',
+ _List_fromArray(
+ [prop, v]));
+ },
+ A2(elm$core$List$drop, 2, values)))));
+ }),
+ decodeProp,
+ decodeVals);
+ default:
+ return elm$json$Json$Decode$fail('not actually a legacy filter');
+ }
+ },
+ A2(elm$json$Json$Decode$index, 0, elm$json$Json$Decode$string));
+}
+var author$project$Decoder$decodeLegacyFilter = author$project$Decoder$cyclic$decodeLegacyFilter();
+author$project$Decoder$cyclic$decodeLegacyFilter = function () {
+ return author$project$Decoder$decodeLegacyFilter;
+};
+var elm$core$Basics$round = _Basics_round;
+var elm$parser$Parser$ExpectingFloat = {$: 5};
+var elm$parser$Parser$Advanced$Parser = elm$core$Basics$identity;
+var elm$parser$Parser$Advanced$consumeBase = _Parser_consumeBase;
+var elm$parser$Parser$Advanced$consumeBase16 = _Parser_consumeBase16;
+var elm$core$String$slice = _String_slice;
+var elm$core$String$toFloat = _String_toFloat;
+var elm$parser$Parser$Advanced$Bad = F2(
+ function (a, b) {
+ return {$: 1, a: a, b: b};
+ });
+var elm$parser$Parser$Advanced$Good = F3(
+ function (a, b, c) {
+ return {$: 0, a: a, b: b, c: c};
+ });
+var elm$parser$Parser$Advanced$bumpOffset = F2(
+ function (newOffset, s) {
+ return {aH: s.aH + (newOffset - s.b), c: s.c, d: s.d, b: newOffset, a7: s.a7, a: s.a};
+ });
+var elm$parser$Parser$Advanced$chompBase10 = _Parser_chompBase10;
+var elm$core$Basics$negate = function (n) {
+ return -n;
+};
+var elm$parser$Parser$Advanced$isAsciiCode = _Parser_isAsciiCode;
+var elm$parser$Parser$Advanced$consumeExp = F2(
+ function (offset, src) {
+ if (A3(elm$parser$Parser$Advanced$isAsciiCode, 101, offset, src) || A3(elm$parser$Parser$Advanced$isAsciiCode, 69, offset, src)) {
+ var eOffset = offset + 1;
+ var expOffset = (A3(elm$parser$Parser$Advanced$isAsciiCode, 43, eOffset, src) || A3(elm$parser$Parser$Advanced$isAsciiCode, 45, eOffset, src)) ? (eOffset + 1) : eOffset;
+ var newOffset = A2(elm$parser$Parser$Advanced$chompBase10, expOffset, src);
+ return _Utils_eq(expOffset, newOffset) ? (-newOffset) : newOffset;
+ } else {
+ return offset;
+ }
+ });
+var elm$parser$Parser$Advanced$consumeDotAndExp = F2(
+ function (offset, src) {
+ return A3(elm$parser$Parser$Advanced$isAsciiCode, 46, offset, src) ? A2(
+ elm$parser$Parser$Advanced$consumeExp,
+ A2(elm$parser$Parser$Advanced$chompBase10, offset + 1, src),
+ src) : A2(elm$parser$Parser$Advanced$consumeExp, offset, src);
+ });
+var elm$parser$Parser$Advanced$AddRight = F2(
+ function (a, b) {
+ return {$: 1, a: a, b: b};
+ });
+var elm$parser$Parser$Advanced$DeadEnd = F4(
+ function (row, col, problem, contextStack) {
+ return {aH: col, bu: contextStack, a$: problem, a7: row};
+ });
+var elm$parser$Parser$Advanced$Empty = {$: 0};
+var elm$parser$Parser$Advanced$fromState = F2(
+ function (s, x) {
+ return A2(
+ elm$parser$Parser$Advanced$AddRight,
+ elm$parser$Parser$Advanced$Empty,
+ A4(elm$parser$Parser$Advanced$DeadEnd, s.a7, s.aH, x, s.c));
+ });
+var elm$parser$Parser$Advanced$finalizeInt = F5(
+ function (invalid, handler, startOffset, _n0, s) {
+ var endOffset = _n0.a;
+ var n = _n0.b;
+ if (handler.$ === 1) {
+ var x = handler.a;
+ return A2(
+ elm$parser$Parser$Advanced$Bad,
+ true,
+ A2(elm$parser$Parser$Advanced$fromState, s, x));
+ } else {
+ var toValue = handler.a;
+ return _Utils_eq(startOffset, endOffset) ? A2(
+ elm$parser$Parser$Advanced$Bad,
+ _Utils_cmp(s.b, startOffset) < 0,
+ A2(elm$parser$Parser$Advanced$fromState, s, invalid)) : A3(
+ elm$parser$Parser$Advanced$Good,
+ true,
+ toValue(n),
+ A2(elm$parser$Parser$Advanced$bumpOffset, endOffset, s));
+ }
+ });
+var elm$parser$Parser$Advanced$fromInfo = F4(
+ function (row, col, x, context) {
+ return A2(
+ elm$parser$Parser$Advanced$AddRight,
+ elm$parser$Parser$Advanced$Empty,
+ A4(elm$parser$Parser$Advanced$DeadEnd, row, col, x, context));
+ });
+var elm$parser$Parser$Advanced$finalizeFloat = F6(
+ function (invalid, expecting, intSettings, floatSettings, intPair, s) {
+ var intOffset = intPair.a;
+ var floatOffset = A2(elm$parser$Parser$Advanced$consumeDotAndExp, intOffset, s.a);
+ if (floatOffset < 0) {
+ return A2(
+ elm$parser$Parser$Advanced$Bad,
+ true,
+ A4(elm$parser$Parser$Advanced$fromInfo, s.a7, s.aH - (floatOffset + s.b), invalid, s.c));
+ } else {
+ if (_Utils_eq(s.b, floatOffset)) {
+ return A2(
+ elm$parser$Parser$Advanced$Bad,
+ false,
+ A2(elm$parser$Parser$Advanced$fromState, s, expecting));
+ } else {
+ if (_Utils_eq(intOffset, floatOffset)) {
+ return A5(elm$parser$Parser$Advanced$finalizeInt, invalid, intSettings, s.b, intPair, s);
+ } else {
+ if (floatSettings.$ === 1) {
+ var x = floatSettings.a;
+ return A2(
+ elm$parser$Parser$Advanced$Bad,
+ true,
+ A2(elm$parser$Parser$Advanced$fromState, s, invalid));
+ } else {
+ var toValue = floatSettings.a;
+ var _n1 = elm$core$String$toFloat(
+ A3(elm$core$String$slice, s.b, floatOffset, s.a));
+ if (_n1.$ === 1) {
+ return A2(
+ elm$parser$Parser$Advanced$Bad,
+ true,
+ A2(elm$parser$Parser$Advanced$fromState, s, invalid));
+ } else {
+ var n = _n1.a;
+ return A3(
+ elm$parser$Parser$Advanced$Good,
+ true,
+ toValue(n),
+ A2(elm$parser$Parser$Advanced$bumpOffset, floatOffset, s));
+ }
+ }
+ }
+ }
+ }
+ });
+var elm$parser$Parser$Advanced$number = function (c) {
+ return function (s) {
+ if (A3(elm$parser$Parser$Advanced$isAsciiCode, 48, s.b, s.a)) {
+ var zeroOffset = s.b + 1;
+ var baseOffset = zeroOffset + 1;
+ return A3(elm$parser$Parser$Advanced$isAsciiCode, 120, zeroOffset, s.a) ? A5(
+ elm$parser$Parser$Advanced$finalizeInt,
+ c.bL,
+ c.aQ,
+ baseOffset,
+ A2(elm$parser$Parser$Advanced$consumeBase16, baseOffset, s.a),
+ s) : (A3(elm$parser$Parser$Advanced$isAsciiCode, 111, zeroOffset, s.a) ? A5(
+ elm$parser$Parser$Advanced$finalizeInt,
+ c.bL,
+ c.aX,
+ baseOffset,
+ A3(elm$parser$Parser$Advanced$consumeBase, 8, baseOffset, s.a),
+ s) : (A3(elm$parser$Parser$Advanced$isAsciiCode, 98, zeroOffset, s.a) ? A5(
+ elm$parser$Parser$Advanced$finalizeInt,
+ c.bL,
+ c.aF,
+ baseOffset,
+ A3(elm$parser$Parser$Advanced$consumeBase, 2, baseOffset, s.a),
+ s) : A6(
+ elm$parser$Parser$Advanced$finalizeFloat,
+ c.bL,
+ c.aM,
+ c.aT,
+ c.aN,
+ _Utils_Tuple2(zeroOffset, 0),
+ s)));
+ } else {
+ return A6(
+ elm$parser$Parser$Advanced$finalizeFloat,
+ c.bL,
+ c.aM,
+ c.aT,
+ c.aN,
+ A3(elm$parser$Parser$Advanced$consumeBase, 10, s.b, s.a),
+ s);
+ }
+ };
+};
+var elm$parser$Parser$Advanced$float = F2(
+ function (expecting, invalid) {
+ return elm$parser$Parser$Advanced$number(
+ {
+ aF: elm$core$Result$Err(invalid),
+ aM: expecting,
+ aN: elm$core$Result$Ok(elm$core$Basics$identity),
+ aQ: elm$core$Result$Err(invalid),
+ aT: elm$core$Result$Ok(elm$core$Basics$toFloat),
+ bL: invalid,
+ aX: elm$core$Result$Err(invalid)
+ });
+ });
+var elm$parser$Parser$float = A2(elm$parser$Parser$Advanced$float, elm$parser$Parser$ExpectingFloat, elm$parser$Parser$ExpectingFloat);
+var elm$parser$Parser$Advanced$map = F2(
+ function (func, _n0) {
+ var parse = _n0;
+ return function (s0) {
+ var _n1 = parse(s0);
+ if (!_n1.$) {
+ var p = _n1.a;
+ var a = _n1.b;
+ var s1 = _n1.c;
+ return A3(
+ elm$parser$Parser$Advanced$Good,
+ p,
+ func(a),
+ s1);
+ } else {
+ var p = _n1.a;
+ var x = _n1.b;
+ return A2(elm$parser$Parser$Advanced$Bad, p, x);
+ }
+ };
+ });
+var elm$parser$Parser$map = elm$parser$Parser$Advanced$map;
+var author$project$Color$angle = A2(elm$parser$Parser$map, elm$core$Basics$round, elm$parser$Parser$float);
+var author$project$Color$Color = F4(
+ function (r, g, b, a) {
+ return {bh: a, bl: b, bF: g, bU: r};
+ });
+var author$project$Color$fromHSLA = F4(
+ function (hue, sat, light, alpha) {
+ var _n0 = _Utils_Tuple3(hue / 360, sat / 100, light / 100);
+ var h = _n0.a;
+ var s = _n0.b;
+ var l = _n0.c;
+ var m2 = (l <= 0.5) ? (l * (s + 1)) : ((l + s) - (l * s));
+ var m1 = (l * 2) - m2;
+ var hueToRgb = function (h__) {
+ var h_ = (h__ < 0) ? (h__ + 1) : ((h__ > 1) ? (h__ - 1) : h__);
+ return ((h_ * 6) < 1) ? (m1 + (((m2 - m1) * h_) * 6)) : (((h_ * 2) < 1) ? m2 : (((h_ * 3) < 2) ? (m1 + (((m2 - m1) * ((2 / 3) - h_)) * 6)) : m1));
+ };
+ var b = hueToRgb(h - (1 / 3));
+ var g = hueToRgb(h);
+ var r = hueToRgb(h + (1 / 3));
+ return A4(
+ author$project$Color$Color,
+ elm$core$Basics$floor(r * 255),
+ elm$core$Basics$floor(g * 255),
+ elm$core$Basics$floor(b * 255),
+ alpha);
+ });
+var elm$core$Basics$always = F2(
+ function (a, _n0) {
+ return a;
+ });
+var elm$parser$Parser$Advanced$map2 = F3(
+ function (func, _n0, _n1) {
+ var parseA = _n0;
+ var parseB = _n1;
+ return function (s0) {
+ var _n2 = parseA(s0);
+ if (_n2.$ === 1) {
+ var p = _n2.a;
+ var x = _n2.b;
+ return A2(elm$parser$Parser$Advanced$Bad, p, x);
+ } else {
+ var p1 = _n2.a;
+ var a = _n2.b;
+ var s1 = _n2.c;
+ var _n3 = parseB(s1);
+ if (_n3.$ === 1) {
+ var p2 = _n3.a;
+ var x = _n3.b;
+ return A2(elm$parser$Parser$Advanced$Bad, p1 || p2, x);
+ } else {
+ var p2 = _n3.a;
+ var b = _n3.b;
+ var s2 = _n3.c;
+ return A3(
+ elm$parser$Parser$Advanced$Good,
+ p1 || p2,
+ A2(func, a, b),
+ s2);
+ }
+ }
+ };
+ });
+var elm$parser$Parser$Advanced$ignorer = F2(
+ function (keepParser, ignoreParser) {
+ return A3(elm$parser$Parser$Advanced$map2, elm$core$Basics$always, keepParser, ignoreParser);
+ });
+var elm$parser$Parser$ignorer = elm$parser$Parser$Advanced$ignorer;
+var elm$parser$Parser$ExpectingSymbol = function (a) {
+ return {$: 8, a: a};
+};
+var elm$parser$Parser$Advanced$Token = F2(
+ function (a, b) {
+ return {$: 0, a: a, b: b};
+ });
+var elm$core$String$isEmpty = function (string) {
+ return string === '';
+};
+var elm$parser$Parser$Advanced$isSubString = _Parser_isSubString;
+var elm$parser$Parser$Advanced$token = function (_n0) {
+ var str = _n0.a;
+ var expecting = _n0.b;
+ var progress = !elm$core$String$isEmpty(str);
+ return function (s) {
+ var _n1 = A5(elm$parser$Parser$Advanced$isSubString, str, s.b, s.a7, s.aH, s.a);
+ var newOffset = _n1.a;
+ var newRow = _n1.b;
+ var newCol = _n1.c;
+ return _Utils_eq(newOffset, -1) ? A2(
+ elm$parser$Parser$Advanced$Bad,
+ false,
+ A2(elm$parser$Parser$Advanced$fromState, s, expecting)) : A3(
+ elm$parser$Parser$Advanced$Good,
+ progress,
+ 0,
+ {aH: newCol, c: s.c, d: s.d, b: newOffset, a7: newRow, a: s.a});
+ };
+};
+var elm$parser$Parser$Advanced$symbol = elm$parser$Parser$Advanced$token;
+var elm$parser$Parser$symbol = function (str) {
+ return elm$parser$Parser$Advanced$symbol(
+ A2(
+ elm$parser$Parser$Advanced$Token,
+ str,
+ elm$parser$Parser$ExpectingSymbol(str)));
+};
+var author$project$Color$percentage = A2(
+ elm$parser$Parser$ignorer,
+ A2(elm$parser$Parser$map, elm$core$Basics$round, elm$parser$Parser$float),
+ elm$parser$Parser$symbol('%'));
+var elm$parser$Parser$Advanced$keeper = F2(
+ function (parseFunc, parseArg) {
+ return A3(elm$parser$Parser$Advanced$map2, elm$core$Basics$apL, parseFunc, parseArg);
+ });
+var elm$parser$Parser$keeper = elm$parser$Parser$Advanced$keeper;
+var elm$parser$Parser$ExpectingKeyword = function (a) {
+ return {$: 9, a: a};
+};
+var elm$parser$Parser$Advanced$isSubChar = _Parser_isSubChar;
+var elm$parser$Parser$Advanced$keyword = function (_n0) {
+ var kwd = _n0.a;
+ var expecting = _n0.b;
+ var progress = !elm$core$String$isEmpty(kwd);
+ return function (s) {
+ var _n1 = A5(elm$parser$Parser$Advanced$isSubString, kwd, s.b, s.a7, s.aH, s.a);
+ var newOffset = _n1.a;
+ var newRow = _n1.b;
+ var newCol = _n1.c;
+ return (_Utils_eq(newOffset, -1) || (0 <= A3(
+ elm$parser$Parser$Advanced$isSubChar,
+ function (c) {
+ return elm$core$Char$isAlphaNum(c) || (c === '_');
+ },
+ newOffset,
+ s.a))) ? A2(
+ elm$parser$Parser$Advanced$Bad,
+ false,
+ A2(elm$parser$Parser$Advanced$fromState, s, expecting)) : A3(
+ elm$parser$Parser$Advanced$Good,
+ progress,
+ 0,
+ {aH: newCol, c: s.c, d: s.d, b: newOffset, a7: newRow, a: s.a});
+ };
+};
+var elm$parser$Parser$keyword = function (kwd) {
+ return elm$parser$Parser$Advanced$keyword(
+ A2(
+ elm$parser$Parser$Advanced$Token,
+ kwd,
+ elm$parser$Parser$ExpectingKeyword(kwd)));
+};
+var elm$parser$Parser$Advanced$Append = F2(
+ function (a, b) {
+ return {$: 2, a: a, b: b};
+ });
+var elm$parser$Parser$Advanced$oneOfHelp = F3(
+ function (s0, bag, parsers) {
+ oneOfHelp:
+ while (true) {
+ if (!parsers.b) {
+ return A2(elm$parser$Parser$Advanced$Bad, false, bag);
+ } else {
+ var parse = parsers.a;
+ var remainingParsers = parsers.b;
+ var _n1 = parse(s0);
+ if (!_n1.$) {
+ var step = _n1;
+ return step;
+ } else {
+ var step = _n1;
+ var p = step.a;
+ var x = step.b;
+ if (p) {
+ return step;
+ } else {
+ var $temp$s0 = s0,
+ $temp$bag = A2(elm$parser$Parser$Advanced$Append, bag, x),
+ $temp$parsers = remainingParsers;
+ s0 = $temp$s0;
+ bag = $temp$bag;
+ parsers = $temp$parsers;
+ continue oneOfHelp;
+ }
+ }
+ }
+ }
+ });
+var elm$parser$Parser$Advanced$oneOf = function (parsers) {
+ return function (s) {
+ return A3(elm$parser$Parser$Advanced$oneOfHelp, s, elm$parser$Parser$Advanced$Empty, parsers);
+ };
+};
+var elm$parser$Parser$oneOf = elm$parser$Parser$Advanced$oneOf;
+var elm$parser$Parser$Advanced$chompWhileHelp = F5(
+ function (isGood, offset, row, col, s0) {
+ chompWhileHelp:
+ while (true) {
+ var newOffset = A3(elm$parser$Parser$Advanced$isSubChar, isGood, offset, s0.a);
+ if (_Utils_eq(newOffset, -1)) {
+ return A3(
+ elm$parser$Parser$Advanced$Good,
+ _Utils_cmp(s0.b, offset) < 0,
+ 0,
+ {aH: col, c: s0.c, d: s0.d, b: offset, a7: row, a: s0.a});
+ } else {
+ if (_Utils_eq(newOffset, -2)) {
+ var $temp$isGood = isGood,
+ $temp$offset = offset + 1,
+ $temp$row = row + 1,
+ $temp$col = 1,
+ $temp$s0 = s0;
+ isGood = $temp$isGood;
+ offset = $temp$offset;
+ row = $temp$row;
+ col = $temp$col;
+ s0 = $temp$s0;
+ continue chompWhileHelp;
+ } else {
+ var $temp$isGood = isGood,
+ $temp$offset = newOffset,
+ $temp$row = row,
+ $temp$col = col + 1,
+ $temp$s0 = s0;
+ isGood = $temp$isGood;
+ offset = $temp$offset;
+ row = $temp$row;
+ col = $temp$col;
+ s0 = $temp$s0;
+ continue chompWhileHelp;
+ }
+ }
+ }
+ });
+var elm$parser$Parser$Advanced$chompWhile = function (isGood) {
+ return function (s) {
+ return A5(elm$parser$Parser$Advanced$chompWhileHelp, isGood, s.b, s.a7, s.aH, s);
+ };
+};
+var elm$parser$Parser$Advanced$spaces = elm$parser$Parser$Advanced$chompWhile(
+ function (c) {
+ return (c === ' ') || ((c === '\n') || (c === '\r'));
+ });
+var elm$parser$Parser$spaces = elm$parser$Parser$Advanced$spaces;
+var elm$parser$Parser$Advanced$succeed = function (a) {
+ return function (s) {
+ return A3(elm$parser$Parser$Advanced$Good, false, a, s);
+ };
+};
+var elm$parser$Parser$succeed = elm$parser$Parser$Advanced$succeed;
+var author$project$Color$hsla = A2(
+ elm$parser$Parser$keeper,
+ A2(
+ elm$parser$Parser$keeper,
+ A2(
+ elm$parser$Parser$keeper,
+ A2(
+ elm$parser$Parser$keeper,
+ A2(
+ elm$parser$Parser$ignorer,
+ A2(
+ elm$parser$Parser$ignorer,
+ elm$parser$Parser$succeed(author$project$Color$fromHSLA),
+ elm$parser$Parser$oneOf(
+ _List_fromArray(
+ [
+ elm$parser$Parser$keyword('hsla'),
+ elm$parser$Parser$keyword('hsl')
+ ]))),
+ elm$parser$Parser$symbol('(')),
+ A2(
+ elm$parser$Parser$ignorer,
+ A2(
+ elm$parser$Parser$ignorer,
+ A2(elm$parser$Parser$ignorer, author$project$Color$angle, elm$parser$Parser$spaces),
+ elm$parser$Parser$symbol(',')),
+ elm$parser$Parser$spaces)),
+ A2(
+ elm$parser$Parser$ignorer,
+ A2(
+ elm$parser$Parser$ignorer,
+ A2(elm$parser$Parser$ignorer, author$project$Color$percentage, elm$parser$Parser$spaces),
+ elm$parser$Parser$symbol(',')),
+ elm$parser$Parser$spaces)),
+ author$project$Color$percentage),
+ A2(
+ elm$parser$Parser$ignorer,
+ elm$parser$Parser$oneOf(
+ _List_fromArray(
+ [
+ A2(
+ elm$parser$Parser$keeper,
+ A2(
+ elm$parser$Parser$ignorer,
+ A2(
+ elm$parser$Parser$ignorer,
+ elm$parser$Parser$succeed(elm$core$Basics$identity),
+ elm$parser$Parser$symbol(',')),
+ elm$parser$Parser$spaces),
+ elm$parser$Parser$float),
+ elm$parser$Parser$succeed(1)
+ ])),
+ elm$parser$Parser$symbol(')')));
+var author$project$Color$hexToInt = function (_char) {
+ var _n0 = elm$core$Char$toLower(_char);
+ switch (_n0) {
+ case '0':
+ return elm$core$Maybe$Just(0);
+ case '1':
+ return elm$core$Maybe$Just(1);
+ case '2':
+ return elm$core$Maybe$Just(2);
+ case '3':
+ return elm$core$Maybe$Just(3);
+ case '4':
+ return elm$core$Maybe$Just(4);
+ case '5':
+ return elm$core$Maybe$Just(5);
+ case '6':
+ return elm$core$Maybe$Just(6);
+ case '7':
+ return elm$core$Maybe$Just(7);
+ case '8':
+ return elm$core$Maybe$Just(8);
+ case '9':
+ return elm$core$Maybe$Just(9);
+ case 'a':
+ return elm$core$Maybe$Just(10);
+ case 'b':
+ return elm$core$Maybe$Just(11);
+ case 'c':
+ return elm$core$Maybe$Just(12);
+ case 'd':
+ return elm$core$Maybe$Just(13);
+ case 'e':
+ return elm$core$Maybe$Just(14);
+ case 'f':
+ return elm$core$Maybe$Just(15);
+ default:
+ return elm$core$Maybe$Nothing;
+ }
+};
+var elm$core$Bitwise$shiftLeftBy = _Bitwise_shiftLeftBy;
+var elm$core$Maybe$map2 = F3(
+ function (func, ma, mb) {
+ if (ma.$ === 1) {
+ return elm$core$Maybe$Nothing;
+ } else {
+ var a = ma.a;
+ if (mb.$ === 1) {
+ return elm$core$Maybe$Nothing;
+ } else {
+ var b = mb.a;
+ return elm$core$Maybe$Just(
+ A2(func, a, b));
+ }
+ }
+ });
+var author$project$Color$hex2ToInt = F2(
+ function (c1, c2) {
+ return A3(
+ elm$core$Maybe$map2,
+ F2(
+ function (v1, v2) {
+ return (v1 << 4) + v2;
+ }),
+ author$project$Color$hexToInt(c1),
+ author$project$Color$hexToInt(c2));
+ });
+var elm$parser$Parser$Problem = function (a) {
+ return {$: 12, a: a};
+};
+var elm$parser$Parser$Advanced$problem = function (x) {
+ return function (s) {
+ return A2(
+ elm$parser$Parser$Advanced$Bad,
+ false,
+ A2(elm$parser$Parser$Advanced$fromState, s, x));
+ };
+};
+var elm$parser$Parser$problem = function (msg) {
+ return elm$parser$Parser$Advanced$problem(
+ elm$parser$Parser$Problem(msg));
+};
+var author$project$Color$maybeToParser = function (aMaybe) {
+ if (!aMaybe.$) {
+ var a = aMaybe.a;
+ return elm$parser$Parser$succeed(a);
+ } else {
+ return elm$parser$Parser$problem('something went wrong');
+ }
+};
+var elm$core$Maybe$map4 = F5(
+ function (func, ma, mb, mc, md) {
+ if (ma.$ === 1) {
+ return elm$core$Maybe$Nothing;
+ } else {
+ var a = ma.a;
+ if (mb.$ === 1) {
+ return elm$core$Maybe$Nothing;
+ } else {
+ var b = mb.a;
+ if (mc.$ === 1) {
+ return elm$core$Maybe$Nothing;
+ } else {
+ var c = mc.a;
+ if (md.$ === 1) {
+ return elm$core$Maybe$Nothing;
+ } else {
+ var d = md.a;
+ return elm$core$Maybe$Just(
+ A4(func, a, b, c, d));
+ }
+ }
+ }
+ }
+ });
+var author$project$Color$fromHex8 = F4(
+ function (_n0, _n1, _n2, _n3) {
+ var r1 = _n0.a;
+ var r2 = _n0.b;
+ var g1 = _n1.a;
+ var g2 = _n1.b;
+ var b1 = _n2.a;
+ var b2 = _n2.b;
+ var a1 = _n3.a;
+ var a2 = _n3.b;
+ return author$project$Color$maybeToParser(
+ A5(
+ elm$core$Maybe$map4,
+ F4(
+ function (r, g, b, a) {
+ return A4(author$project$Color$Color, r, g, b, a / 255);
+ }),
+ A2(author$project$Color$hex2ToInt, r1, r2),
+ A2(author$project$Color$hex2ToInt, g1, g2),
+ A2(author$project$Color$hex2ToInt, b1, b2),
+ A2(author$project$Color$hex2ToInt, a1, a2)));
+ });
+var author$project$Color$fromHexString = function (hexString) {
+ var _n0 = elm$core$String$toList(hexString);
+ _n0$8:
+ while (true) {
+ if ((_n0.b && _n0.b.b) && _n0.b.b.b) {
+ if (!_n0.b.b.b.b) {
+ var r = _n0.a;
+ var _n4 = _n0.b;
+ var g = _n4.a;
+ var _n5 = _n4.b;
+ var b = _n5.a;
+ return A4(
+ author$project$Color$fromHex8,
+ _Utils_Tuple2(r, r),
+ _Utils_Tuple2(g, g),
+ _Utils_Tuple2(b, b),
+ _Utils_Tuple2('f', 'f'));
+ } else {
+ if (!_n0.b.b.b.b.b) {
+ if ('#' === _n0.a) {
+ var _n1 = _n0.b;
+ var r = _n1.a;
+ var _n2 = _n1.b;
+ var g = _n2.a;
+ var _n3 = _n2.b;
+ var b = _n3.a;
+ return A4(
+ author$project$Color$fromHex8,
+ _Utils_Tuple2(r, r),
+ _Utils_Tuple2(g, g),
+ _Utils_Tuple2(b, b),
+ _Utils_Tuple2('f', 'f'));
+ } else {
+ var r = _n0.a;
+ var _n10 = _n0.b;
+ var g = _n10.a;
+ var _n11 = _n10.b;
+ var b = _n11.a;
+ var _n12 = _n11.b;
+ var a = _n12.a;
+ return A4(
+ author$project$Color$fromHex8,
+ _Utils_Tuple2(r, r),
+ _Utils_Tuple2(g, g),
+ _Utils_Tuple2(b, b),
+ _Utils_Tuple2(a, a));
+ }
+ } else {
+ if (!_n0.b.b.b.b.b.b) {
+ if ('#' === _n0.a) {
+ var _n6 = _n0.b;
+ var r = _n6.a;
+ var _n7 = _n6.b;
+ var g = _n7.a;
+ var _n8 = _n7.b;
+ var b = _n8.a;
+ var _n9 = _n8.b;
+ var a = _n9.a;
+ return A4(
+ author$project$Color$fromHex8,
+ _Utils_Tuple2(r, r),
+ _Utils_Tuple2(g, g),
+ _Utils_Tuple2(b, b),
+ _Utils_Tuple2(a, a));
+ } else {
+ break _n0$8;
+ }
+ } else {
+ if (!_n0.b.b.b.b.b.b.b) {
+ var r1 = _n0.a;
+ var _n19 = _n0.b;
+ var r2 = _n19.a;
+ var _n20 = _n19.b;
+ var g1 = _n20.a;
+ var _n21 = _n20.b;
+ var g2 = _n21.a;
+ var _n22 = _n21.b;
+ var b1 = _n22.a;
+ var _n23 = _n22.b;
+ var b2 = _n23.a;
+ return A4(
+ author$project$Color$fromHex8,
+ _Utils_Tuple2(r1, r2),
+ _Utils_Tuple2(g1, g2),
+ _Utils_Tuple2(b1, b2),
+ _Utils_Tuple2('f', 'f'));
+ } else {
+ if (!_n0.b.b.b.b.b.b.b.b) {
+ if ('#' === _n0.a) {
+ var _n13 = _n0.b;
+ var r1 = _n13.a;
+ var _n14 = _n13.b;
+ var r2 = _n14.a;
+ var _n15 = _n14.b;
+ var g1 = _n15.a;
+ var _n16 = _n15.b;
+ var g2 = _n16.a;
+ var _n17 = _n16.b;
+ var b1 = _n17.a;
+ var _n18 = _n17.b;
+ var b2 = _n18.a;
+ return A4(
+ author$project$Color$fromHex8,
+ _Utils_Tuple2(r1, r2),
+ _Utils_Tuple2(g1, g2),
+ _Utils_Tuple2(b1, b2),
+ _Utils_Tuple2('f', 'f'));
+ } else {
+ break _n0$8;
+ }
+ } else {
+ if (_n0.b.b.b.b.b.b.b.b.b) {
+ if (('#' === _n0.a) && (!_n0.b.b.b.b.b.b.b.b.b.b)) {
+ var _n24 = _n0.b;
+ var r1 = _n24.a;
+ var _n25 = _n24.b;
+ var r2 = _n25.a;
+ var _n26 = _n25.b;
+ var g1 = _n26.a;
+ var _n27 = _n26.b;
+ var g2 = _n27.a;
+ var _n28 = _n27.b;
+ var b1 = _n28.a;
+ var _n29 = _n28.b;
+ var b2 = _n29.a;
+ var _n30 = _n29.b;
+ var a1 = _n30.a;
+ var _n31 = _n30.b;
+ var a2 = _n31.a;
+ return A4(
+ author$project$Color$fromHex8,
+ _Utils_Tuple2(r1, r2),
+ _Utils_Tuple2(g1, g2),
+ _Utils_Tuple2(b1, b2),
+ _Utils_Tuple2(a1, a2));
+ } else {
+ break _n0$8;
+ }
+ } else {
+ var r1 = _n0.a;
+ var _n32 = _n0.b;
+ var r2 = _n32.a;
+ var _n33 = _n32.b;
+ var g1 = _n33.a;
+ var _n34 = _n33.b;
+ var g2 = _n34.a;
+ var _n35 = _n34.b;
+ var b1 = _n35.a;
+ var _n36 = _n35.b;
+ var b2 = _n36.a;
+ var _n37 = _n36.b;
+ var a1 = _n37.a;
+ var _n38 = _n37.b;
+ var a2 = _n38.a;
+ return A4(
+ author$project$Color$fromHex8,
+ _Utils_Tuple2(r1, r2),
+ _Utils_Tuple2(g1, g2),
+ _Utils_Tuple2(b1, b2),
+ _Utils_Tuple2(a1, a2));
+ }
+ }
+ }
+ }
+ }
+ }
+ } else {
+ break _n0$8;
+ }
+ }
+ return elm$parser$Parser$problem('Invalid color');
+};
+var author$project$Color$keywords = elm$parser$Parser$oneOf(
+ _List_fromArray(
+ [
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#000000'),
+ elm$parser$Parser$keyword('black')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#c0c0c0'),
+ elm$parser$Parser$keyword('silver')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#808080'),
+ elm$parser$Parser$keyword('gray')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#ffffff'),
+ elm$parser$Parser$keyword('white')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#800000'),
+ elm$parser$Parser$keyword('maroon')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#ff0000'),
+ elm$parser$Parser$keyword('red')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#800080'),
+ elm$parser$Parser$keyword('purple')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#ff00ff'),
+ elm$parser$Parser$keyword('fuchsia')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#008000'),
+ elm$parser$Parser$keyword('green')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#00ff00'),
+ elm$parser$Parser$keyword('lime')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#808000'),
+ elm$parser$Parser$keyword('olive')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#ffff00'),
+ elm$parser$Parser$keyword('yellow')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#000080'),
+ elm$parser$Parser$keyword('navy')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#0000ff'),
+ elm$parser$Parser$keyword('blue')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#008080'),
+ elm$parser$Parser$keyword('teal')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#00ffff'),
+ elm$parser$Parser$keyword('aqua')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#ffa500'),
+ elm$parser$Parser$keyword('orange')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#f0f8ff'),
+ elm$parser$Parser$keyword('aliceblue')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#faebd7'),
+ elm$parser$Parser$keyword('antiquewhite')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#7fffd4'),
+ elm$parser$Parser$keyword('aquamarine')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#f0ffff'),
+ elm$parser$Parser$keyword('azure')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#f5f5dc'),
+ elm$parser$Parser$keyword('beige')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#ffe4c4'),
+ elm$parser$Parser$keyword('bisque')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#ffebcd'),
+ elm$parser$Parser$keyword('blanchedalmond')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#8a2be2'),
+ elm$parser$Parser$keyword('blueviolet')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#a52a2a'),
+ elm$parser$Parser$keyword('brown')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#deb887'),
+ elm$parser$Parser$keyword('burlywood')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#5f9ea0'),
+ elm$parser$Parser$keyword('cadetblue')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#7fff00'),
+ elm$parser$Parser$keyword('chartreuse')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#d2691e'),
+ elm$parser$Parser$keyword('chocolate')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#ff7f50'),
+ elm$parser$Parser$keyword('coral')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#6495ed'),
+ elm$parser$Parser$keyword('cornflowerblue')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#fff8dc'),
+ elm$parser$Parser$keyword('cornsilk')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#dc143c'),
+ elm$parser$Parser$keyword('crimson')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#00ffff'),
+ elm$parser$Parser$keyword('cyan')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#00008b'),
+ elm$parser$Parser$keyword('darkblue')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#008b8b'),
+ elm$parser$Parser$keyword('darkcyan')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#b8860b'),
+ elm$parser$Parser$keyword('darkgoldenrod')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#a9a9a9'),
+ elm$parser$Parser$keyword('darkgray')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#006400'),
+ elm$parser$Parser$keyword('darkgreen')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#a9a9a9'),
+ elm$parser$Parser$keyword('darkgrey')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#bdb76b'),
+ elm$parser$Parser$keyword('darkkhaki')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#8b008b'),
+ elm$parser$Parser$keyword('darkmagenta')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#556b2f'),
+ elm$parser$Parser$keyword('darkolivegreen')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#ff8c00'),
+ elm$parser$Parser$keyword('darkorange')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#9932cc'),
+ elm$parser$Parser$keyword('darkorchid')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#8b0000'),
+ elm$parser$Parser$keyword('darkred')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#e9967a'),
+ elm$parser$Parser$keyword('darksalmon')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#8fbc8f'),
+ elm$parser$Parser$keyword('darkseagreen')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#483d8b'),
+ elm$parser$Parser$keyword('darkslateblue')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#2f4f4f'),
+ elm$parser$Parser$keyword('darkslategray')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#2f4f4f'),
+ elm$parser$Parser$keyword('darkslategrey')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#00ced1'),
+ elm$parser$Parser$keyword('darkturquoise')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#9400d3'),
+ elm$parser$Parser$keyword('darkviolet')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#ff1493'),
+ elm$parser$Parser$keyword('deeppink')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#00bfff'),
+ elm$parser$Parser$keyword('deepskyblue')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#696969'),
+ elm$parser$Parser$keyword('dimgray')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#696969'),
+ elm$parser$Parser$keyword('dimgrey')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#1e90ff'),
+ elm$parser$Parser$keyword('dodgerblue')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#b22222'),
+ elm$parser$Parser$keyword('firebrick')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#fffaf0'),
+ elm$parser$Parser$keyword('floralwhite')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#228b22'),
+ elm$parser$Parser$keyword('forestgreen')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#dcdcdc'),
+ elm$parser$Parser$keyword('gainsboro')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#f8f8ff'),
+ elm$parser$Parser$keyword('ghostwhite')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#ffd700'),
+ elm$parser$Parser$keyword('gold')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#daa520'),
+ elm$parser$Parser$keyword('goldenrod')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#adff2f'),
+ elm$parser$Parser$keyword('greenyellow')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#808080'),
+ elm$parser$Parser$keyword('grey')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#f0fff0'),
+ elm$parser$Parser$keyword('honeydew')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#ff69b4'),
+ elm$parser$Parser$keyword('hotpink')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#cd5c5c'),
+ elm$parser$Parser$keyword('indianred')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#4b0082'),
+ elm$parser$Parser$keyword('indigo')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#fffff0'),
+ elm$parser$Parser$keyword('ivory')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#f0e68c'),
+ elm$parser$Parser$keyword('khaki')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#e6e6fa'),
+ elm$parser$Parser$keyword('lavender')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#fff0f5'),
+ elm$parser$Parser$keyword('lavenderblush')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#7cfc00'),
+ elm$parser$Parser$keyword('lawngreen')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#fffacd'),
+ elm$parser$Parser$keyword('lemonchiffon')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#add8e6'),
+ elm$parser$Parser$keyword('lightblue')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#f08080'),
+ elm$parser$Parser$keyword('lightcoral')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#e0ffff'),
+ elm$parser$Parser$keyword('lightcyan')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#fafad2'),
+ elm$parser$Parser$keyword('lightgoldenrodyellow')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#d3d3d3'),
+ elm$parser$Parser$keyword('lightgray')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#90ee90'),
+ elm$parser$Parser$keyword('lightgreen')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#d3d3d3'),
+ elm$parser$Parser$keyword('lightgrey')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#ffb6c1'),
+ elm$parser$Parser$keyword('lightpink')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#ffa07a'),
+ elm$parser$Parser$keyword('lightsalmon')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#20b2aa'),
+ elm$parser$Parser$keyword('lightseagreen')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#87cefa'),
+ elm$parser$Parser$keyword('lightskyblue')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#778899'),
+ elm$parser$Parser$keyword('lightslategray')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#778899'),
+ elm$parser$Parser$keyword('lightslategrey')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#b0c4de'),
+ elm$parser$Parser$keyword('lightsteelblue')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#ffffe0'),
+ elm$parser$Parser$keyword('lightyellow')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#32cd32'),
+ elm$parser$Parser$keyword('limegreen')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#faf0e6'),
+ elm$parser$Parser$keyword('linen')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#ff00ff'),
+ elm$parser$Parser$keyword('magenta')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#66cdaa'),
+ elm$parser$Parser$keyword('mediumaquamarine')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#0000cd'),
+ elm$parser$Parser$keyword('mediumblue')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#ba55d3'),
+ elm$parser$Parser$keyword('mediumorchid')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#9370db'),
+ elm$parser$Parser$keyword('mediumpurple')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#3cb371'),
+ elm$parser$Parser$keyword('mediumseagreen')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#7b68ee'),
+ elm$parser$Parser$keyword('mediumslateblue')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#00fa9a'),
+ elm$parser$Parser$keyword('mediumspringgreen')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#48d1cc'),
+ elm$parser$Parser$keyword('mediumturquoise')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#c71585'),
+ elm$parser$Parser$keyword('mediumvioletred')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#191970'),
+ elm$parser$Parser$keyword('midnightblue')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#f5fffa'),
+ elm$parser$Parser$keyword('mintcream')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#ffe4e1'),
+ elm$parser$Parser$keyword('mistyrose')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#ffe4b5'),
+ elm$parser$Parser$keyword('moccasin')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#ffdead'),
+ elm$parser$Parser$keyword('navajowhite')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#fdf5e6'),
+ elm$parser$Parser$keyword('oldlace')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#6b8e23'),
+ elm$parser$Parser$keyword('olivedrab')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#ff4500'),
+ elm$parser$Parser$keyword('orangered')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#da70d6'),
+ elm$parser$Parser$keyword('orchid')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#eee8aa'),
+ elm$parser$Parser$keyword('palegoldenrod')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#98fb98'),
+ elm$parser$Parser$keyword('palegreen')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#afeeee'),
+ elm$parser$Parser$keyword('paleturquoise')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#db7093'),
+ elm$parser$Parser$keyword('palevioletred')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#ffefd5'),
+ elm$parser$Parser$keyword('papayawhip')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#ffdab9'),
+ elm$parser$Parser$keyword('peachpuff')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#cd853f'),
+ elm$parser$Parser$keyword('peru')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#ffc0cb'),
+ elm$parser$Parser$keyword('pink')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#dda0dd'),
+ elm$parser$Parser$keyword('plum')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#b0e0e6'),
+ elm$parser$Parser$keyword('powderblue')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#bc8f8f'),
+ elm$parser$Parser$keyword('rosybrown')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#4169e1'),
+ elm$parser$Parser$keyword('royalblue')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#8b4513'),
+ elm$parser$Parser$keyword('saddlebrown')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#fa8072'),
+ elm$parser$Parser$keyword('salmon')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#f4a460'),
+ elm$parser$Parser$keyword('sandybrown')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#2e8b57'),
+ elm$parser$Parser$keyword('seagreen')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#fff5ee'),
+ elm$parser$Parser$keyword('seashell')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#a0522d'),
+ elm$parser$Parser$keyword('sienna')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#87ceeb'),
+ elm$parser$Parser$keyword('skyblue')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#6a5acd'),
+ elm$parser$Parser$keyword('slateblue')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#708090'),
+ elm$parser$Parser$keyword('slategray')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#708090'),
+ elm$parser$Parser$keyword('slategrey')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#fffafa'),
+ elm$parser$Parser$keyword('snow')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#00ff7f'),
+ elm$parser$Parser$keyword('springgreen')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#4682b4'),
+ elm$parser$Parser$keyword('steelblue')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#d2b48c'),
+ elm$parser$Parser$keyword('tan')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#d8bfd8'),
+ elm$parser$Parser$keyword('thistle')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#ff6347'),
+ elm$parser$Parser$keyword('tomato')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#40e0d0'),
+ elm$parser$Parser$keyword('turquoise')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#ee82ee'),
+ elm$parser$Parser$keyword('violet')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#f5deb3'),
+ elm$parser$Parser$keyword('wheat')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#f5f5f5'),
+ elm$parser$Parser$keyword('whitesmoke')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#9acd32'),
+ elm$parser$Parser$keyword('yellowgreen')),
+ A2(
+ elm$parser$Parser$ignorer,
+ author$project$Color$fromHexString('#663399'),
+ elm$parser$Parser$keyword('rebeccapurple')),
+ A2(
+ elm$parser$Parser$ignorer,
+ elm$parser$Parser$succeed(
+ A4(author$project$Color$Color, 0, 0, 0, 0)),
+ elm$parser$Parser$keyword('transparent'))
+ ]));
+var elm$parser$Parser$ExpectingEnd = {$: 10};
+var elm$core$String$length = _String_length;
+var elm$parser$Parser$Advanced$end = function (x) {
+ return function (s) {
+ return _Utils_eq(
+ elm$core$String$length(s.a),
+ s.b) ? A3(elm$parser$Parser$Advanced$Good, false, 0, s) : A2(
+ elm$parser$Parser$Advanced$Bad,
+ false,
+ A2(elm$parser$Parser$Advanced$fromState, s, x));
+ };
+};
+var elm$parser$Parser$end = elm$parser$Parser$Advanced$end(elm$parser$Parser$ExpectingEnd);
+var author$project$Color$parser = A2(
+ elm$parser$Parser$ignorer,
+ elm$parser$Parser$oneOf(
+ _List_fromArray(
+ [author$project$Color$keywords, author$project$Color$hsla])),
+ elm$parser$Parser$end);
+var elm$core$Result$mapError = F2(
+ function (f, result) {
+ if (!result.$) {
+ var v = result.a;
+ return elm$core$Result$Ok(v);
+ } else {
+ var e = result.a;
+ return elm$core$Result$Err(
+ f(e));
+ }
+ });
+var elm$parser$Parser$deadEndsToString = function (deadEnds) {
+ return 'TODO deadEndsToString';
+};
+var elm$parser$Parser$DeadEnd = F3(
+ function (row, col, problem) {
+ return {aH: col, a$: problem, a7: row};
+ });
+var elm$parser$Parser$problemToDeadEnd = function (p) {
+ return A3(elm$parser$Parser$DeadEnd, p.a7, p.aH, p.a$);
+};
+var elm$parser$Parser$Advanced$bagToList = F2(
+ function (bag, list) {
+ bagToList:
+ while (true) {
+ switch (bag.$) {
+ case 0:
+ return list;
+ case 1:
+ var bag1 = bag.a;
+ var x = bag.b;
+ var $temp$bag = bag1,
+ $temp$list = A2(elm$core$List$cons, x, list);
+ bag = $temp$bag;
+ list = $temp$list;
+ continue bagToList;
+ default:
+ var bag1 = bag.a;
+ var bag2 = bag.b;
+ var $temp$bag = bag1,
+ $temp$list = A2(elm$parser$Parser$Advanced$bagToList, bag2, list);
+ bag = $temp$bag;
+ list = $temp$list;
+ continue bagToList;
+ }
+ }
+ });
+var elm$parser$Parser$Advanced$run = F2(
+ function (_n0, src) {
+ var parse = _n0;
+ var _n1 = parse(
+ {aH: 1, c: _List_Nil, d: 1, b: 0, a7: 1, a: src});
+ if (!_n1.$) {
+ var value = _n1.b;
+ return elm$core$Result$Ok(value);
+ } else {
+ var bag = _n1.b;
+ return elm$core$Result$Err(
+ A2(elm$parser$Parser$Advanced$bagToList, bag, _List_Nil));
+ }
+ });
+var elm$parser$Parser$run = F2(
+ function (parser, source) {
+ var _n0 = A2(elm$parser$Parser$Advanced$run, parser, source);
+ if (!_n0.$) {
+ var a = _n0.a;
+ return elm$core$Result$Ok(a);
+ } else {
+ var problems = _n0.a;
+ return elm$core$Result$Err(
+ A2(elm$core$List$map, elm$parser$Parser$problemToDeadEnd, problems));
+ }
+ });
+var author$project$Color$parse = function (string) {
+ return A2(
+ elm$core$Result$mapError,
+ elm$parser$Parser$deadEndsToString,
+ A2(elm$parser$Parser$run, author$project$Color$parser, string));
+};
+var stil4m$elm_syntax$Elm$Syntax$Expression$Integer = function (a) {
+ return {$: 7, a: a};
+};
+var author$project$Decoder$integer = A2(elm$core$Basics$composeR, stil4m$elm_syntax$Elm$Syntax$Expression$Integer, author$project$Decoder$node);
+var author$project$Decoder$makeConstant = function (s) {
+ switch (s) {
+ case 'map':
+ return A2(author$project$Decoder$value, 'E', 'anchorMap');
+ case 'viewport':
+ return A2(author$project$Decoder$value, 'E', 'anchorViewport');
+ case 'auto':
+ return A2(author$project$Decoder$value, 'E', 'anchorAuto');
+ case 'center':
+ return A2(author$project$Decoder$value, 'E', 'positionCenter');
+ case 'left':
+ return A2(author$project$Decoder$value, 'E', 'positionLeft');
+ case 'right':
+ return A2(author$project$Decoder$value, 'E', 'positionRight');
+ case 'top':
+ return A2(author$project$Decoder$value, 'E', 'positionTop');
+ case 'bottom':
+ return A2(author$project$Decoder$value, 'E', 'positionBottom');
+ case 'topRight':
+ return A2(author$project$Decoder$value, 'E', 'positionTopRight');
+ case 'topLeft':
+ return A2(author$project$Decoder$value, 'E', 'positionTopLeft');
+ case 'bottomLeft':
+ return A2(author$project$Decoder$value, 'E', 'positionBottomLeft');
+ case 'bottomRight':
+ return A2(author$project$Decoder$value, 'E', 'positionBottomRight');
+ case 'none':
+ return A2(author$project$Decoder$value, 'E', 'textFitNone');
+ case 'width':
+ return A2(author$project$Decoder$value, 'E', 'textFitWidth');
+ case 'height':
+ return A2(author$project$Decoder$value, 'E', 'textFitHeight');
+ case 'both':
+ return A2(author$project$Decoder$value, 'E', 'textFitBoth');
+ case 'butt':
+ return A2(author$project$Decoder$value, 'E', 'lineCapButt');
+ case 'round':
+ return A2(author$project$Decoder$value, 'E', 'lineCapRound');
+ case 'square':
+ return A2(author$project$Decoder$value, 'E', 'lineCapSquare');
+ case 'bevel':
+ return A2(author$project$Decoder$value, 'E', 'lineJoinBevel');
+ case 'miter':
+ return A2(author$project$Decoder$value, 'E', 'lineJoinMiter');
+ case 'point':
+ return A2(author$project$Decoder$value, 'E', 'symbolPlacementPoint');
+ case 'line-center':
+ return A2(author$project$Decoder$value, 'E', 'symbolPlacementLineCenter');
+ case 'line':
+ return A2(author$project$Decoder$value, 'E', 'symbolPlacementLine');
+ case 'uppercase':
+ return A2(author$project$Decoder$value, 'E', 'textTransformUppercase');
+ case 'lowercase':
+ return A2(author$project$Decoder$value, 'E', 'textTransformLowercase');
+ case 'linear':
+ return A2(author$project$Decoder$value, 'E', 'rasterResamplingLinear');
+ case 'nearest':
+ return A2(author$project$Decoder$value, 'E', 'rasterResamplingNearest');
+ default:
+ var _n1 = author$project$Color$parse(s);
+ if (!_n1.$) {
+ var r = _n1.a.bU;
+ var g = _n1.a.bF;
+ var b = _n1.a.bl;
+ var a = _n1.a.bh;
+ return A3(
+ author$project$Decoder$call,
+ 'E',
+ 'rgba',
+ _List_fromArray(
+ [
+ author$project$Decoder$integer(r),
+ author$project$Decoder$integer(g),
+ author$project$Decoder$integer(b),
+ author$project$Decoder$float(a)
+ ]));
+ } else {
+ var err = _n1.a;
+ return A2(
+ author$project$Decoder$ecall,
+ 'str',
+ author$project$Decoder$str(s));
+ }
+ }
+};
+var author$project$Decoder$todo = A2(
+ elm$json$Json$Decode$map,
+ function (val) {
+ return author$project$Decoder$todoExpr(
+ 'The expression ' + (A2(elm$json$Json$Encode$encode, 0, val) + ' is not yet supported'));
+ },
+ elm$json$Json$Decode$value);
+var elm$core$Basics$neq = _Utils_notEqual;
+var elm$core$String$toLower = _String_toLower;
+var elm$json$Json$Decode$int = _Json_decodeInt;
+var elm$json$Json$Decode$map3 = _Json_map3;
+var stil4m$elm_syntax$Elm$Syntax$Expression$TupledExpression = function (a) {
+ return {$: 13, a: a};
+};
+var stil4m$elm_syntax$Elm$Syntax$Infix$Right = 1;
+var author$project$Decoder$decodeExpression = function (funName) {
+ switch (funName) {
+ case 'literal':
+ return A2(
+ elm$json$Json$Decode$index,
+ 1,
+ elm$json$Json$Decode$oneOf(
+ _List_fromArray(
+ [
+ A2(
+ elm$json$Json$Decode$map,
+ function (strs) {
+ return A3(
+ author$project$Decoder$call,
+ 'E',
+ 'strings',
+ _List_fromArray(
+ [
+ author$project$Decoder$list(
+ A2(elm$core$List$map, author$project$Decoder$str, strs))
+ ]));
+ },
+ elm$json$Json$Decode$list(elm$json$Json$Decode$string)),
+ A2(
+ elm$json$Json$Decode$map,
+ function (floats) {
+ return A3(
+ author$project$Decoder$call,
+ 'E',
+ 'floats',
+ _List_fromArray(
+ [
+ author$project$Decoder$list(
+ A2(elm$core$List$map, author$project$Decoder$float, floats))
+ ]));
+ },
+ elm$json$Json$Decode$list(elm$json$Json$Decode$float))
+ ])));
+ case 'match':
+ return elm$json$Json$Decode$oneOf(
+ _List_fromArray(
+ [
+ A2(
+ elm$json$Json$Decode$andThen,
+ author$project$Decoder$decodeMatch(true),
+ A2(elm$json$Json$Decode$index, 2, elm$json$Json$Decode$string)),
+ A2(
+ elm$json$Json$Decode$andThen,
+ author$project$Decoder$decodeMatch(false),
+ A2(elm$json$Json$Decode$index, 2, elm$json$Json$Decode$float))
+ ]));
+ case 'exponential':
+ return A2(
+ elm$json$Json$Decode$map,
+ function (base) {
+ return A3(
+ author$project$Decoder$call,
+ 'E',
+ 'Exponential',
+ _List_fromArray(
+ [
+ author$project$Decoder$float(base)
+ ]));
+ },
+ A2(elm$json$Json$Decode$index, 1, elm$json$Json$Decode$float));
+ case 'interpolate':
+ return A4(
+ elm$json$Json$Decode$map3,
+ F3(
+ function (interpolation, options, input) {
+ return A3(
+ author$project$Decoder$pipelineCall,
+ 'E',
+ 'interpolate',
+ A2(
+ elm$core$List$cons,
+ input,
+ A2(elm$core$List$cons, interpolation, options)));
+ }),
+ A2(
+ elm$json$Json$Decode$index,
+ 1,
+ author$project$Decoder$cyclic$decodeValue()),
+ A2(
+ elm$json$Json$Decode$andThen,
+ A2(
+ author$project$Decoder$organizeArgs,
+ A2(elm$json$Json$Decode$map, author$project$Decoder$float, elm$json$Json$Decode$float),
+ _List_Nil),
+ A2(
+ elm$json$Json$Decode$map,
+ elm$core$List$drop(2),
+ author$project$Decoder$decodeTail(elm$json$Json$Decode$value))),
+ A2(
+ elm$json$Json$Decode$index,
+ 2,
+ author$project$Decoder$cyclic$decodeValue()));
+ case 'step':
+ return A4(
+ elm$json$Json$Decode$map3,
+ F3(
+ function (inp, def, stps) {
+ return A3(
+ author$project$Decoder$pipelineCall,
+ 'E',
+ 'step',
+ A2(
+ elm$core$List$cons,
+ inp,
+ A2(elm$core$List$cons, def, stps)));
+ }),
+ A2(
+ elm$json$Json$Decode$index,
+ 1,
+ author$project$Decoder$cyclic$decodeValue()),
+ A2(
+ elm$json$Json$Decode$index,
+ 2,
+ author$project$Decoder$cyclic$decodeValue()),
+ A2(
+ elm$json$Json$Decode$andThen,
+ A2(
+ author$project$Decoder$organizeArgs,
+ A2(elm$json$Json$Decode$map, author$project$Decoder$float, elm$json$Json$Decode$float),
+ _List_Nil),
+ A2(
+ elm$json$Json$Decode$map,
+ elm$core$List$drop(2),
+ author$project$Decoder$decodeTail(elm$json$Json$Decode$value))));
+ default:
+ var fallback = A2(
+ elm$json$Json$Decode$map,
+ function (_arguments) {
+ switch (funName) {
+ case '==':
+ return A3(author$project$Decoder$pipelineCall, 'E', 'isEqual', _arguments);
+ case '!=':
+ return A3(author$project$Decoder$pipelineCall, 'E', 'notEqual', _arguments);
+ case '!has':
+ return author$project$Decoder$todoExpr('!has is not supported');
+ case '!in':
+ return author$project$Decoder$todoExpr('!in is not supported');
+ case 'in':
+ return author$project$Decoder$todoExpr('in is not supported');
+ case '>=':
+ return A3(author$project$Decoder$pipelineCall, 'E', 'greaterThanOrEqual', _arguments);
+ case '<=':
+ return A3(author$project$Decoder$pipelineCall, 'E', 'lessThanOrEqual', _arguments);
+ case 'concat':
+ return A3(author$project$Decoder$pipelineCall, 'E', 'append', _arguments);
+ case 'linear':
+ return A3(author$project$Decoder$call, 'E', 'Linear', _arguments);
+ case 'rgb':
+ return A3(author$project$Decoder$call, 'E', 'makeRGBColor', _arguments);
+ case 'rgba':
+ return A3(author$project$Decoder$call, 'E', 'makeRGBAColor', _arguments);
+ case 'to-rgba':
+ return A3(author$project$Decoder$call, 'E', 'rgbaChannels', _arguments);
+ case '-':
+ return A3(author$project$Decoder$pipelineCall, 'E', 'minus', _arguments);
+ case '*':
+ return A3(author$project$Decoder$pipelineCall, 'E', 'multiply', _arguments);
+ case '+':
+ return A3(author$project$Decoder$pipelineCall, 'E', 'plus', _arguments);
+ case '/':
+ return A3(author$project$Decoder$pipelineCall, 'E', 'divideBy', _arguments);
+ case '%':
+ return A3(author$project$Decoder$pipelineCall, 'E', 'modBy', _arguments);
+ case '^':
+ return A3(author$project$Decoder$pipelineCall, 'E', 'raiseBy', _arguments);
+ case 'get':
+ return (elm$core$List$length(_arguments) === 1) ? A3(author$project$Decoder$call, 'E', 'getProperty', _arguments) : A3(author$project$Decoder$call, 'E', 'get', _arguments);
+ default:
+ return A3(
+ author$project$Decoder$call,
+ 'E',
+ the_sett$elm_string_case$String$Case$toCamelCaseLower(funName),
+ _arguments);
+ }
+ },
+ author$project$Decoder$decodeTail(
+ author$project$Decoder$cyclic$decodeValue()));
+ return (!_Utils_eq(
+ elm$core$String$toLower(funName),
+ funName)) ? elm$json$Json$Decode$oneOf(
+ _List_fromArray(
+ [
+ A2(
+ elm$json$Json$Decode$map,
+ function (strs) {
+ return A3(
+ author$project$Decoder$call,
+ 'E',
+ 'strings',
+ _List_fromArray(
+ [
+ author$project$Decoder$list(
+ A2(elm$core$List$map, author$project$Decoder$str, strs))
+ ]));
+ },
+ elm$json$Json$Decode$list(elm$json$Json$Decode$string)),
+ fallback
+ ])) : fallback;
+ }
+};
+var author$project$Decoder$decodeMatch = F2(
+ function (isString, _n2) {
+ return A2(
+ elm$json$Json$Decode$andThen,
+ function (args) {
+ if (!args.b) {
+ return author$project$Decoder$todo;
+ } else {
+ var head = args.a;
+ var tail = args.b;
+ return A3(
+ elm$json$Json$Decode$map2,
+ F2(
+ function (cond, rest) {
+ return author$project$Decoder$parens(
+ author$project$Decoder$node(
+ A4(
+ stil4m$elm_syntax$Elm$Syntax$Expression$OperatorApplication,
+ '|>',
+ 1,
+ cond,
+ A3(
+ author$project$Decoder$call,
+ 'E',
+ isString ? 'matchesStr' : 'matchesFloat',
+ rest))));
+ }),
+ A2(
+ author$project$Decoder$subdecode,
+ author$project$Decoder$cyclic$decodeValue(),
+ head),
+ A3(
+ author$project$Decoder$organizeArgs,
+ isString ? A2(elm$json$Json$Decode$map, author$project$Decoder$str, elm$json$Json$Decode$string) : A2(elm$json$Json$Decode$map, author$project$Decoder$float, elm$json$Json$Decode$float),
+ _List_Nil,
+ tail));
+ }
+ },
+ author$project$Decoder$decodeTail(elm$json$Json$Decode$value));
+ });
+var author$project$Decoder$organizeArgs = F3(
+ function (inpDec, accu, args) {
+ organizeArgs:
+ while (true) {
+ if (!args.b) {
+ return author$project$Decoder$combine(
+ _List_fromArray(
+ [
+ A2(
+ elm$json$Json$Decode$map,
+ author$project$Decoder$list,
+ author$project$Decoder$combine(
+ elm$core$List$reverse(accu)))
+ ]));
+ } else {
+ if (!args.b.b) {
+ var _default = args.a;
+ return author$project$Decoder$combine(
+ _List_fromArray(
+ [
+ A2(
+ elm$json$Json$Decode$map,
+ author$project$Decoder$list,
+ author$project$Decoder$combine(
+ elm$core$List$reverse(accu))),
+ A2(
+ author$project$Decoder$subdecode,
+ author$project$Decoder$cyclic$decodeValue(),
+ _default)
+ ]));
+ } else {
+ var a = args.a;
+ var _n1 = args.b;
+ var b = _n1.a;
+ var rest = _n1.b;
+ var newAccu = A2(
+ elm$core$List$cons,
+ A3(
+ elm$json$Json$Decode$map2,
+ F2(
+ function (inp, out) {
+ return author$project$Decoder$parens(
+ author$project$Decoder$node(
+ stil4m$elm_syntax$Elm$Syntax$Expression$TupledExpression(
+ _List_fromArray(
+ [inp, out]))));
+ }),
+ A2(author$project$Decoder$subdecode, inpDec, a),
+ A2(
+ author$project$Decoder$subdecode,
+ author$project$Decoder$cyclic$decodeValue(),
+ b)),
+ accu);
+ var $temp$inpDec = inpDec,
+ $temp$accu = newAccu,
+ $temp$args = rest;
+ inpDec = $temp$inpDec;
+ accu = $temp$accu;
+ args = $temp$args;
+ continue organizeArgs;
+ }
+ }
+ }
+ });
+function author$project$Decoder$cyclic$decodeValue() {
+ return A2(
+ elm$json$Json$Decode$map,
+ A2(elm$core$Basics$composeR, stil4m$elm_syntax$Elm$Syntax$Expression$ParenthesizedExpression, author$project$Decoder$node),
+ elm$json$Json$Decode$oneOf(
+ _List_fromArray(
+ [
+ A2(elm$json$Json$Decode$map, author$project$Decoder$makeConstant, elm$json$Json$Decode$string),
+ author$project$Decoder$decodeBool,
+ A2(
+ elm$json$Json$Decode$map,
+ A2(
+ elm$core$Basics$composeR,
+ stil4m$elm_syntax$Elm$Syntax$Expression$Floatable,
+ A2(
+ elm$core$Basics$composeR,
+ author$project$Decoder$node,
+ author$project$Decoder$ecall('float'))),
+ elm$json$Json$Decode$float),
+ A2(
+ elm$json$Json$Decode$map,
+ A2(
+ elm$core$Basics$composeR,
+ stil4m$elm_syntax$Elm$Syntax$Expression$Integer,
+ A2(
+ elm$core$Basics$composeR,
+ author$project$Decoder$node,
+ author$project$Decoder$ecall('int'))),
+ elm$json$Json$Decode$int),
+ A2(
+ elm$json$Json$Decode$andThen,
+ author$project$Decoder$decodeExpression,
+ A2(elm$json$Json$Decode$index, 0, elm$json$Json$Decode$string)),
+ author$project$Decoder$todo
+ ])));
+}
+var author$project$Decoder$decodeValue = author$project$Decoder$cyclic$decodeValue();
+author$project$Decoder$cyclic$decodeValue = function () {
+ return author$project$Decoder$decodeValue;
+};
+var elm$core$List$maybeCons = F3(
+ function (f, mx, xs) {
+ var _n0 = f(mx);
+ if (!_n0.$) {
+ var x = _n0.a;
+ return A2(elm$core$List$cons, x, xs);
+ } else {
+ return xs;
+ }
+ });
+var elm$core$List$filterMap = F2(
+ function (f, xs) {
+ return A3(
+ elm$core$List$foldr,
+ elm$core$List$maybeCons(f),
+ _List_Nil,
+ xs);
+ });
+var elm$json$Json$Decode$field = _Json_decodeField;
+var elm$json$Json$Decode$keyValuePairs = _Json_decodeKeyValuePairs;
+var author$project$Decoder$decodeAttrs = A2(
+ elm$json$Json$Decode$map,
+ elm$core$List$indexedMap(author$project$Decoder$addBogusRange),
+ A2(
+ elm$json$Json$Decode$andThen,
+ A2(
+ elm$core$Basics$composeR,
+ elm$core$List$filterMap(
+ function (_n0) {
+ var attrName = _n0.a;
+ var attrValue = _n0.b;
+ switch (attrName) {
+ case 'id':
+ return elm$core$Maybe$Nothing;
+ case 'type':
+ return elm$core$Maybe$Nothing;
+ case 'source':
+ return elm$core$Maybe$Nothing;
+ case 'paint':
+ return elm$core$Maybe$Nothing;
+ case 'layout':
+ return elm$core$Maybe$Nothing;
+ case 'source-layer':
+ return A3(
+ author$project$Decoder$decodeAttr,
+ 'sourceLayer',
+ A2(elm$json$Json$Decode$map, author$project$Decoder$str, elm$json$Json$Decode$string),
+ attrValue);
+ case 'minzoom':
+ return A3(
+ author$project$Decoder$decodeAttr,
+ 'minzoom',
+ A2(elm$json$Json$Decode$map, author$project$Decoder$float, elm$json$Json$Decode$float),
+ attrValue);
+ case 'maxzoom':
+ return A3(
+ author$project$Decoder$decodeAttr,
+ 'maxzoom',
+ A2(elm$json$Json$Decode$map, author$project$Decoder$float, elm$json$Json$Decode$float),
+ attrValue);
+ case 'filter':
+ return A3(
+ author$project$Decoder$decodeAttr,
+ 'filter',
+ elm$json$Json$Decode$oneOf(
+ _List_fromArray(
+ [author$project$Decoder$decodeLegacyFilter, author$project$Decoder$decodeValue])),
+ attrValue);
+ default:
+ var other = attrName;
+ return A3(
+ author$project$Decoder$decodeAttr,
+ the_sett$elm_string_case$String$Case$toCamelCaseLower(attrName),
+ author$project$Decoder$decodeValue,
+ attrValue);
+ }
+ }),
+ author$project$Decoder$combine),
+ A4(
+ elm$json$Json$Decode$map3,
+ F3(
+ function (top, paint, layout) {
+ return _Utils_ap(
+ top,
+ _Utils_ap(paint, layout));
+ }),
+ elm$json$Json$Decode$keyValuePairs(elm$json$Json$Decode$value),
+ A2(
+ elm$json$Json$Decode$field,
+ 'paint',
+ elm$json$Json$Decode$keyValuePairs(elm$json$Json$Decode$value)),
+ A2(
+ elm$json$Json$Decode$field,
+ 'layout',
+ elm$json$Json$Decode$keyValuePairs(elm$json$Json$Decode$value)))));
+var author$project$Decoder$layerDecodeHelp = function (t) {
+ return A4(
+ elm$json$Json$Decode$map3,
+ F3(
+ function (id, source, attrs) {
+ return A3(
+ author$project$Decoder$call,
+ 'Layer',
+ t,
+ _List_fromArray(
+ [
+ author$project$Decoder$str(id),
+ author$project$Decoder$str(source),
+ author$project$Decoder$list(attrs)
+ ]));
+ }),
+ A2(elm$json$Json$Decode$field, 'id', elm$json$Json$Decode$string),
+ A2(elm$json$Json$Decode$field, 'source', elm$json$Json$Decode$string),
+ author$project$Decoder$decodeAttrs);
+};
+var author$project$Decoder$decodeLayer = A2(
+ elm$json$Json$Decode$andThen,
+ function (t) {
+ switch (t) {
+ case 'background':
+ return A3(
+ elm$json$Json$Decode$map2,
+ F2(
+ function (id, attrs) {
+ return A3(
+ author$project$Decoder$call,
+ 'Layer',
+ 'background',
+ _List_fromArray(
+ [
+ author$project$Decoder$str(id),
+ author$project$Decoder$list(attrs)
+ ]));
+ }),
+ A2(elm$json$Json$Decode$field, 'id', elm$json$Json$Decode$string),
+ author$project$Decoder$decodeAttrs);
+ case 'fill':
+ return author$project$Decoder$layerDecodeHelp('fill');
+ case 'symbol':
+ return author$project$Decoder$layerDecodeHelp('symbol');
+ case 'line':
+ return author$project$Decoder$layerDecodeHelp('line');
+ case 'raster':
+ return author$project$Decoder$layerDecodeHelp('raster');
+ case 'circle':
+ return author$project$Decoder$layerDecodeHelp('circle');
+ case 'fill-extrusion':
+ return author$project$Decoder$layerDecodeHelp('fillExtrusion');
+ case 'heatmap':
+ return author$project$Decoder$layerDecodeHelp('heatmap');
+ case 'hillshade':
+ return author$project$Decoder$layerDecodeHelp('hillshade');
+ default:
+ var other = t;
+ return elm$json$Json$Decode$fail('Layer type ' + (t + ' not supported'));
+ }
+ },
+ A2(elm$json$Json$Decode$field, 'type', elm$json$Json$Decode$string));
+var author$project$Decoder$decodeLayers = A2(
+ elm$json$Json$Decode$map,
+ function (layers) {
+ return author$project$Decoder$node(
+ stil4m$elm_syntax$Elm$Syntax$Expression$ListExpr(
+ A2(elm$core$List$indexedMap, author$project$Decoder$addBogusRange, layers)));
+ },
+ elm$json$Json$Decode$list(author$project$Decoder$decodeLayer));
+var author$project$Decoder$valueDecoder = F2(
+ function (ns, name) {
+ return elm$json$Json$Decode$succeed(
+ author$project$Decoder$node(
+ A2(
+ stil4m$elm_syntax$Elm$Syntax$Expression$FunctionOrValue,
+ _List_fromArray(
+ [ns]),
+ name)));
+ });
+var author$project$Decoder$decodeLight = A2(author$project$Decoder$valueDecoder, 'Style', 'defaultLight');
+var author$project$Decoder$decodeMisc = elm$json$Json$Decode$succeed(
+ author$project$Decoder$node(
+ stil4m$elm_syntax$Elm$Syntax$Expression$ListExpr(_List_Nil)));
+var author$project$Decoder$decodeSource = A2(
+ elm$json$Json$Decode$andThen,
+ function (t) {
+ if (t === 'vector') {
+ return A2(
+ elm$json$Json$Decode$map,
+ function (url) {
+ return function (id) {
+ return A3(
+ author$project$Decoder$call,
+ 'Source',
+ 'vectorFromUrl',
+ _List_fromArray(
+ [
+ author$project$Decoder$str(id),
+ author$project$Decoder$str(url)
+ ]));
+ };
+ },
+ A2(elm$json$Json$Decode$field, 'url', elm$json$Json$Decode$string));
+ } else {
+ return elm$json$Json$Decode$succeed(
+ function (a) {
+ return author$project$Decoder$todoExpr('type ' + (t + 'not yet supported'));
+ });
+ }
+ },
+ A2(elm$json$Json$Decode$field, 'type', elm$json$Json$Decode$string));
+var author$project$Decoder$decodeSources = A2(
+ elm$json$Json$Decode$map,
+ function (sources) {
+ return author$project$Decoder$node(
+ stil4m$elm_syntax$Elm$Syntax$Expression$ListExpr(sources));
+ },
+ A2(
+ elm$json$Json$Decode$map,
+ elm$core$List$map(
+ function (_n0) {
+ var key = _n0.a;
+ var fn = _n0.b;
+ return fn(key);
+ }),
+ elm$json$Json$Decode$keyValuePairs(author$project$Decoder$decodeSource)));
+var author$project$Decoder$decodeTransition = A3(
+ elm$json$Json$Decode$map2,
+ F2(
+ function (duration, delay) {
+ return author$project$Decoder$node(
+ stil4m$elm_syntax$Elm$Syntax$Expression$RecordExpr(
+ _List_fromArray(
+ [
+ author$project$Decoder$node(
+ _Utils_Tuple2(
+ author$project$Decoder$node('duration'),
+ author$project$Decoder$node(
+ stil4m$elm_syntax$Elm$Syntax$Expression$Integer(duration)))),
+ author$project$Decoder$node(
+ _Utils_Tuple2(
+ author$project$Decoder$node('delay'),
+ author$project$Decoder$node(
+ stil4m$elm_syntax$Elm$Syntax$Expression$Integer(delay))))
+ ])));
+ }),
+ elm$json$Json$Decode$oneOf(
+ _List_fromArray(
+ [
+ A2(elm$json$Json$Decode$field, 'duration', elm$json$Json$Decode$int),
+ elm$json$Json$Decode$succeed(300)
+ ])),
+ elm$json$Json$Decode$oneOf(
+ _List_fromArray(
+ [
+ A2(elm$json$Json$Decode$field, 'delay', elm$json$Json$Decode$int),
+ elm$json$Json$Decode$succeed(0)
+ ])));
+var elm$json$Json$Decode$map5 = _Json_map5;
+var author$project$Decoder$style = A6(
+ elm$json$Json$Decode$map5,
+ F5(
+ function (transition, light, layers, sources, misc) {
+ return _List_fromArray(
+ [
+ author$project$Decoder$node(
+ _Utils_Tuple2(
+ author$project$Decoder$node('transition'),
+ transition)),
+ author$project$Decoder$node(
+ _Utils_Tuple2(
+ author$project$Decoder$node('light'),
+ light)),
+ author$project$Decoder$node(
+ _Utils_Tuple2(
+ author$project$Decoder$node('layers'),
+ layers)),
+ author$project$Decoder$node(
+ _Utils_Tuple2(
+ author$project$Decoder$node('sources'),
+ sources)),
+ author$project$Decoder$node(
+ _Utils_Tuple2(
+ author$project$Decoder$node('misc'),
+ misc))
+ ]);
+ }),
+ elm$json$Json$Decode$oneOf(
+ _List_fromArray(
+ [
+ A2(elm$json$Json$Decode$field, 'transition', author$project$Decoder$decodeTransition),
+ A2(author$project$Decoder$valueDecoder, 'Style', 'defaultTransition')
+ ])),
+ elm$json$Json$Decode$oneOf(
+ _List_fromArray(
+ [
+ A2(elm$json$Json$Decode$field, 'light', author$project$Decoder$decodeLight),
+ A2(author$project$Decoder$valueDecoder, 'Style', 'defaultLight')
+ ])),
+ A2(elm$json$Json$Decode$field, 'layers', author$project$Decoder$decodeLayers),
+ A2(elm$json$Json$Decode$field, 'sources', author$project$Decoder$decodeSources),
+ author$project$Decoder$decodeMisc);
+var elm$core$List$append = F2(
+ function (xs, ys) {
+ if (!ys.b) {
+ return xs;
+ } else {
+ return A3(elm$core$List$foldr, elm$core$List$cons, ys, xs);
+ }
+ });
+var elm$core$List$concat = function (lists) {
+ return A3(elm$core$List$foldr, elm$core$List$append, _List_Nil, lists);
+};
+var elm$core$List$concatMap = F2(
+ function (f, list) {
+ return elm$core$List$concat(
+ A2(elm$core$List$map, f, list));
+ });
+var elm$core$Bitwise$and = _Bitwise_and;
+var elm$core$Bitwise$shiftRightBy = _Bitwise_shiftRightBy;
+var elm$core$String$repeatHelp = F3(
+ function (n, chunk, result) {
+ return (n <= 0) ? result : A3(
+ elm$core$String$repeatHelp,
+ n >> 1,
+ _Utils_ap(chunk, chunk),
+ (!(n & 1)) ? result : _Utils_ap(result, chunk));
+ });
+var elm$core$String$repeat = F2(
+ function (n, chunk) {
+ return A3(elm$core$String$repeatHelp, n, chunk, '');
+ });
+var stil4m$structured_writer$StructuredWriter$asIndent = function (amount) {
+ return A2(elm$core$String$repeat, amount, ' ');
+};
+var stil4m$structured_writer$StructuredWriter$writeIndented = F2(
+ function (indent_, w) {
+ switch (w.$) {
+ case 0:
+ var _n1 = w.a;
+ var pre = _n1.a;
+ var sep = _n1.b;
+ var post = _n1.c;
+ var differentLines = w.b;
+ var items = w.c;
+ var seperator = differentLines ? ('\n' + (stil4m$structured_writer$StructuredWriter$asIndent(indent_) + sep)) : sep;
+ return elm$core$String$concat(
+ _List_fromArray(
+ [
+ pre,
+ A2(
+ elm$core$String$join,
+ seperator,
+ A2(
+ elm$core$List$map,
+ A2(
+ elm$core$Basics$composeR,
+ elm$core$Basics$identity,
+ stil4m$structured_writer$StructuredWriter$writeIndented(indent_)),
+ items)),
+ post
+ ]));
+ case 1:
+ var items = w.a;
+ return A2(
+ elm$core$String$join,
+ '\n' + stil4m$structured_writer$StructuredWriter$asIndent(indent_),
+ A2(
+ elm$core$List$concatMap,
+ A2(
+ elm$core$Basics$composeR,
+ stil4m$structured_writer$StructuredWriter$writeIndented(0),
+ elm$core$String$split('\n')),
+ items));
+ case 2:
+ var s = w.a;
+ return s;
+ case 4:
+ var n = w.a;
+ var next = w.b;
+ return _Utils_ap(
+ stil4m$structured_writer$StructuredWriter$asIndent(n + indent_),
+ A2(stil4m$structured_writer$StructuredWriter$writeIndented, n + indent_, next));
+ case 5:
+ var items = w.a;
+ return A2(
+ elm$core$String$join,
+ ' ',
+ A2(
+ elm$core$List$map,
+ stil4m$structured_writer$StructuredWriter$writeIndented(indent_),
+ items));
+ case 6:
+ var items = w.a;
+ return elm$core$String$concat(
+ A2(
+ elm$core$List$map,
+ stil4m$structured_writer$StructuredWriter$writeIndented(indent_),
+ items));
+ default:
+ var x = w.a;
+ var y = w.b;
+ return _Utils_ap(
+ A2(stil4m$structured_writer$StructuredWriter$writeIndented, indent_, x),
+ A2(stil4m$structured_writer$StructuredWriter$writeIndented, indent_, y));
+ }
+ });
+var stil4m$structured_writer$StructuredWriter$write = stil4m$structured_writer$StructuredWriter$writeIndented(0);
+var author$project$Writer$write = stil4m$structured_writer$StructuredWriter$write;
+var elm$core$Set$Set_elm_builtin = elm$core$Basics$identity;
+var elm$core$Set$empty = elm$core$Dict$empty;
+var elm$core$Set$insert = F2(
+ function (key, _n0) {
+ var dict = _n0;
+ return A3(elm$core$Dict$insert, key, 0, dict);
+ });
+var elm$core$Dict$member = F2(
+ function (key, dict) {
+ var _n0 = A2(elm$core$Dict$get, key, dict);
+ if (!_n0.$) {
+ return true;
+ } else {
+ return false;
+ }
+ });
+var elm$core$Set$member = F2(
+ function (key, _n0) {
+ var dict = _n0;
+ return A2(elm$core$Dict$member, key, dict);
+ });
+var elm_community$list_extra$List$Extra$uniqueHelp = F4(
+ function (f, existing, remaining, accumulator) {
+ uniqueHelp:
+ while (true) {
+ if (!remaining.b) {
+ return elm$core$List$reverse(accumulator);
+ } else {
+ var first = remaining.a;
+ var rest = remaining.b;
+ var computedFirst = f(first);
+ if (A2(elm$core$Set$member, computedFirst, existing)) {
+ var $temp$f = f,
+ $temp$existing = existing,
+ $temp$remaining = rest,
+ $temp$accumulator = accumulator;
+ f = $temp$f;
+ existing = $temp$existing;
+ remaining = $temp$remaining;
+ accumulator = $temp$accumulator;
+ continue uniqueHelp;
+ } else {
+ var $temp$f = f,
+ $temp$existing = A2(elm$core$Set$insert, computedFirst, existing),
+ $temp$remaining = rest,
+ $temp$accumulator = A2(elm$core$List$cons, first, accumulator);
+ f = $temp$f;
+ existing = $temp$existing;
+ remaining = $temp$remaining;
+ accumulator = $temp$accumulator;
+ continue uniqueHelp;
+ }
+ }
+ }
+ });
+var elm_community$list_extra$List$Extra$unique = function (list) {
+ return A4(elm_community$list_extra$List$Extra$uniqueHelp, elm$core$Basics$identity, elm$core$Set$empty, list, _List_Nil);
+};
+var author$project$Writer$startOnDifferentLines = function (xs) {
+ return elm$core$List$length(
+ elm_community$list_extra$List$Extra$unique(
+ A2(
+ elm$core$List$map,
+ A2(
+ elm$core$Basics$composeR,
+ function ($) {
+ return $.bY;
+ },
+ function ($) {
+ return $.a7;
+ }),
+ xs))) > 1;
+};
+var stil4m$elm_syntax$Elm$Syntax$Node$value = function (_n0) {
+ var v = _n0.b;
+ return v;
+};
+var stil4m$structured_writer$StructuredWriter$Str = function (a) {
+ return {$: 2, a: a};
+};
+var stil4m$structured_writer$StructuredWriter$string = stil4m$structured_writer$StructuredWriter$Str;
+var author$project$Writer$writeDocumentation = A2(elm$core$Basics$composeR, stil4m$elm_syntax$Elm$Syntax$Node$value, stil4m$structured_writer$StructuredWriter$string);
+var author$project$Writer$writeModuleName = function (moduleName) {
+ return stil4m$structured_writer$StructuredWriter$string(
+ A2(elm$core$String$join, '.', moduleName));
+};
+var stil4m$structured_writer$StructuredWriter$Joined = function (a) {
+ return {$: 6, a: a};
+};
+var stil4m$structured_writer$StructuredWriter$join = stil4m$structured_writer$StructuredWriter$Joined;
+var author$project$Writer$writeQualifiedNameRef = function (_n0) {
+ var moduleName = _n0.O;
+ var name = _n0.ae;
+ if (!moduleName.b) {
+ return stil4m$structured_writer$StructuredWriter$string(name);
+ } else {
+ return stil4m$structured_writer$StructuredWriter$join(
+ _List_fromArray(
+ [
+ author$project$Writer$writeModuleName(moduleName),
+ stil4m$structured_writer$StructuredWriter$string('.'),
+ stil4m$structured_writer$StructuredWriter$string(name)
+ ]));
+ }
+};
+var elm$core$String$fromFloat = _String_fromNumber;
+var stil4m$structured_writer$StructuredWriter$Sep = F3(
+ function (a, b, c) {
+ return {$: 0, a: a, b: b, c: c};
+ });
+var stil4m$structured_writer$StructuredWriter$bracesComma = stil4m$structured_writer$StructuredWriter$Sep(
+ _Utils_Tuple3('{', ', ', '}'));
+var stil4m$structured_writer$StructuredWriter$bracketsComma = stil4m$structured_writer$StructuredWriter$Sep(
+ _Utils_Tuple3('[', ', ', ']'));
+var stil4m$structured_writer$StructuredWriter$parensComma = stil4m$structured_writer$StructuredWriter$Sep(
+ _Utils_Tuple3('(', ', ', ')'));
+var stil4m$structured_writer$StructuredWriter$Spaced = function (a) {
+ return {$: 5, a: a};
+};
+var stil4m$structured_writer$StructuredWriter$spaced = stil4m$structured_writer$StructuredWriter$Spaced;
+var author$project$Writer$writePattern = function (_n0) {
+ var p = _n0.b;
+ switch (p.$) {
+ case 0:
+ return stil4m$structured_writer$StructuredWriter$string('_');
+ case 1:
+ return stil4m$structured_writer$StructuredWriter$string('()');
+ case 2:
+ var c = p.a;
+ return stil4m$structured_writer$StructuredWriter$string(
+ '\'' + (elm$core$String$fromList(
+ _List_fromArray(
+ [c])) + '\''));
+ case 3:
+ var s = p.a;
+ return stil4m$structured_writer$StructuredWriter$string(s);
+ case 5:
+ var h = p.a;
+ return stil4m$structured_writer$StructuredWriter$string('TODO');
+ case 4:
+ var i = p.a;
+ return stil4m$structured_writer$StructuredWriter$string(
+ elm$core$String$fromInt(i));
+ case 6:
+ var f = p.a;
+ return stil4m$structured_writer$StructuredWriter$string(
+ elm$core$String$fromFloat(f));
+ case 7:
+ var inner = p.a;
+ return A2(
+ stil4m$structured_writer$StructuredWriter$parensComma,
+ false,
+ A2(elm$core$List$map, author$project$Writer$writePattern, inner));
+ case 8:
+ var inner = p.a;
+ return A2(
+ stil4m$structured_writer$StructuredWriter$bracesComma,
+ false,
+ A2(
+ elm$core$List$map,
+ A2(elm$core$Basics$composeR, stil4m$elm_syntax$Elm$Syntax$Node$value, stil4m$structured_writer$StructuredWriter$string),
+ inner));
+ case 9:
+ var left = p.a;
+ var right = p.b;
+ return stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ author$project$Writer$writePattern(left),
+ stil4m$structured_writer$StructuredWriter$string('::'),
+ author$project$Writer$writePattern(right)
+ ]));
+ case 10:
+ var inner = p.a;
+ return A2(
+ stil4m$structured_writer$StructuredWriter$bracketsComma,
+ false,
+ A2(elm$core$List$map, author$project$Writer$writePattern, inner));
+ case 11:
+ var _var = p.a;
+ return stil4m$structured_writer$StructuredWriter$string(_var);
+ case 12:
+ var qnr = p.a;
+ var others = p.b;
+ return stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ author$project$Writer$writeQualifiedNameRef(qnr),
+ stil4m$structured_writer$StructuredWriter$spaced(
+ A2(elm$core$List$map, author$project$Writer$writePattern, others))
+ ]));
+ case 13:
+ var innerPattern = p.a;
+ var asName = p.b;
+ return stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ author$project$Writer$writePattern(innerPattern),
+ stil4m$structured_writer$StructuredWriter$string('as'),
+ stil4m$structured_writer$StructuredWriter$string(
+ stil4m$elm_syntax$Elm$Syntax$Node$value(asName))
+ ]));
+ default:
+ var innerPattern = p.a;
+ return stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string('('),
+ author$project$Writer$writePattern(innerPattern),
+ stil4m$structured_writer$StructuredWriter$string(')')
+ ]));
+ }
+};
+var elm$core$String$contains = _String_contains;
+var author$project$Writer$parensIfContainsSpaces = function (w) {
+ return A2(
+ elm$core$String$contains,
+ ' ',
+ stil4m$structured_writer$StructuredWriter$write(w)) ? stil4m$structured_writer$StructuredWriter$join(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string('('),
+ w,
+ stil4m$structured_writer$StructuredWriter$string(')')
+ ])) : w;
+};
+var elm$core$Tuple$second = function (_n0) {
+ var y = _n0.b;
+ return y;
+};
+var stil4m$structured_writer$StructuredWriter$sepByComma = stil4m$structured_writer$StructuredWriter$Sep(
+ _Utils_Tuple3('', ', ', ''));
+var author$project$Writer$writeRecordField = function (_n4) {
+ var _n5 = _n4.b;
+ var name = _n5.a;
+ var ref = _n5.b;
+ return stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string(
+ stil4m$elm_syntax$Elm$Syntax$Node$value(name)),
+ stil4m$structured_writer$StructuredWriter$string(':'),
+ author$project$Writer$writeTypeAnnotation(ref)
+ ]));
+};
+var author$project$Writer$writeTypeAnnotation = function (_n0) {
+ var typeAnnotation = _n0.b;
+ switch (typeAnnotation.$) {
+ case 0:
+ var s = typeAnnotation.a;
+ return stil4m$structured_writer$StructuredWriter$string(s);
+ case 1:
+ var moduleNameAndName = typeAnnotation.a;
+ var args = typeAnnotation.b;
+ var moduleName = stil4m$elm_syntax$Elm$Syntax$Node$value(moduleNameAndName).a;
+ var k = stil4m$elm_syntax$Elm$Syntax$Node$value(moduleNameAndName).b;
+ return stil4m$structured_writer$StructuredWriter$spaced(
+ A2(
+ elm$core$List$cons,
+ stil4m$structured_writer$StructuredWriter$string(
+ A2(
+ elm$core$String$join,
+ '.',
+ _Utils_ap(
+ moduleName,
+ _List_fromArray(
+ [k])))),
+ A2(
+ elm$core$List$map,
+ A2(elm$core$Basics$composeR, author$project$Writer$writeTypeAnnotation, author$project$Writer$parensIfContainsSpaces),
+ args)));
+ case 2:
+ return stil4m$structured_writer$StructuredWriter$string('()');
+ case 3:
+ var xs = typeAnnotation.a;
+ return A2(
+ stil4m$structured_writer$StructuredWriter$parensComma,
+ false,
+ A2(elm$core$List$map, author$project$Writer$writeTypeAnnotation, xs));
+ case 4:
+ var xs = typeAnnotation.a;
+ return A2(
+ stil4m$structured_writer$StructuredWriter$bracesComma,
+ false,
+ A2(elm$core$List$map, author$project$Writer$writeRecordField, xs));
+ case 5:
+ var name = typeAnnotation.a;
+ var fields = typeAnnotation.b;
+ return stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string('{'),
+ stil4m$structured_writer$StructuredWriter$string(
+ stil4m$elm_syntax$Elm$Syntax$Node$value(name)),
+ stil4m$structured_writer$StructuredWriter$string('|'),
+ A2(
+ stil4m$structured_writer$StructuredWriter$sepByComma,
+ false,
+ A2(
+ elm$core$List$map,
+ author$project$Writer$writeRecordField,
+ stil4m$elm_syntax$Elm$Syntax$Node$value(fields))),
+ stil4m$structured_writer$StructuredWriter$string('}')
+ ]));
+ default:
+ var left = typeAnnotation.a;
+ var right = typeAnnotation.b;
+ var addParensForSubTypeAnnotation = function (type_) {
+ if (type_.b.$ === 6) {
+ var _n3 = type_.b;
+ return stil4m$structured_writer$StructuredWriter$join(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string('('),
+ author$project$Writer$writeTypeAnnotation(type_),
+ stil4m$structured_writer$StructuredWriter$string(')')
+ ]));
+ } else {
+ return author$project$Writer$writeTypeAnnotation(type_);
+ }
+ };
+ return stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ addParensForSubTypeAnnotation(left),
+ stil4m$structured_writer$StructuredWriter$string('->'),
+ addParensForSubTypeAnnotation(right)
+ ]));
+ }
+};
+var author$project$Writer$writeSignature = function (signature) {
+ return stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string(
+ stil4m$elm_syntax$Elm$Syntax$Node$value(signature.ae)),
+ stil4m$structured_writer$StructuredWriter$string(':'),
+ author$project$Writer$writeTypeAnnotation(signature.b0)
+ ]));
+};
+var elm$core$Maybe$map = F2(
+ function (f, maybe) {
+ if (!maybe.$) {
+ var value = maybe.a;
+ return elm$core$Maybe$Just(
+ f(value));
+ } else {
+ return elm$core$Maybe$Nothing;
+ }
+ });
+var stil4m$elm_syntax$Elm$Syntax$Node$range = function (_n0) {
+ var r = _n0.a;
+ return r;
+};
+var stil4m$structured_writer$StructuredWriter$Append = F2(
+ function (a, b) {
+ return {$: 3, a: a, b: b};
+ });
+var stil4m$structured_writer$StructuredWriter$append = stil4m$structured_writer$StructuredWriter$Append;
+var stil4m$structured_writer$StructuredWriter$Breaked = function (a) {
+ return {$: 1, a: a};
+};
+var stil4m$structured_writer$StructuredWriter$breaked = stil4m$structured_writer$StructuredWriter$Breaked;
+var stil4m$structured_writer$StructuredWriter$epsilon = stil4m$structured_writer$StructuredWriter$Str('');
+var stil4m$structured_writer$StructuredWriter$Indent = F2(
+ function (a, b) {
+ return {$: 4, a: a, b: b};
+ });
+var stil4m$structured_writer$StructuredWriter$indent = stil4m$structured_writer$StructuredWriter$Indent;
+var elm$core$Maybe$withDefault = F2(
+ function (_default, maybe) {
+ if (!maybe.$) {
+ var value = maybe.a;
+ return value;
+ } else {
+ return _default;
+ }
+ });
+var stil4m$structured_writer$StructuredWriter$maybe = elm$core$Maybe$withDefault(stil4m$structured_writer$StructuredWriter$epsilon);
+var stil4m$structured_writer$StructuredWriter$sepBySpace = stil4m$structured_writer$StructuredWriter$Sep(
+ _Utils_Tuple3('', ' ', ''));
+var author$project$Writer$writeDestructuring = F2(
+ function (pattern, expression) {
+ return stil4m$structured_writer$StructuredWriter$breaked(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ author$project$Writer$writePattern(pattern),
+ stil4m$structured_writer$StructuredWriter$string('=')
+ ])),
+ A2(
+ stil4m$structured_writer$StructuredWriter$indent,
+ 4,
+ author$project$Writer$writeExpression(expression))
+ ]));
+ });
+var author$project$Writer$writeExpression = function (_n3) {
+ writeExpression:
+ while (true) {
+ var range = _n3.a;
+ var inner = _n3.b;
+ var writeRecordSetter = function (_n11) {
+ var name = _n11.a;
+ var expr = _n11.b;
+ return _Utils_Tuple2(
+ stil4m$elm_syntax$Elm$Syntax$Node$range(expr),
+ stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string(
+ stil4m$elm_syntax$Elm$Syntax$Node$value(name)),
+ stil4m$structured_writer$StructuredWriter$string('='),
+ author$project$Writer$writeExpression(expr)
+ ])));
+ };
+ var sepHelper = F2(
+ function (f, l) {
+ var diffLines = author$project$Writer$startOnDifferentLines(
+ A2(elm$core$List$map, elm$core$Tuple$first, l));
+ return A2(
+ f,
+ diffLines,
+ A2(elm$core$List$map, elm$core$Tuple$second, l));
+ });
+ var recurRangeHelper = function (_n10) {
+ var x = _n10.a;
+ var y = _n10.b;
+ return _Utils_Tuple2(
+ x,
+ author$project$Writer$writeExpression(
+ A2(stil4m$elm_syntax$Elm$Syntax$Node$Node, x, y)));
+ };
+ var fakeSepHelper = F2(
+ function (f, l) {
+ return A2(
+ f,
+ true,
+ A2(elm$core$List$map, elm$core$Tuple$second, l));
+ });
+ switch (inner.$) {
+ case 0:
+ return stil4m$structured_writer$StructuredWriter$string('()');
+ case 1:
+ var xs = inner.a;
+ if (!xs.b) {
+ return stil4m$structured_writer$StructuredWriter$epsilon;
+ } else {
+ if (!xs.b.b) {
+ var x = xs.a;
+ var $temp$_n3 = x;
+ _n3 = $temp$_n3;
+ continue writeExpression;
+ } else {
+ var x = xs.a;
+ var rest = xs.b;
+ return stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ author$project$Writer$writeExpression(x),
+ A2(
+ sepHelper,
+ stil4m$structured_writer$StructuredWriter$sepBySpace,
+ A2(elm$core$List$map, recurRangeHelper, rest))
+ ]));
+ }
+ }
+ case 2:
+ var x = inner.a;
+ var dir = inner.b;
+ var left = inner.c;
+ var right = inner.d;
+ switch (dir) {
+ case 0:
+ return A2(
+ sepHelper,
+ stil4m$structured_writer$StructuredWriter$sepBySpace,
+ _List_fromArray(
+ [
+ _Utils_Tuple2(
+ stil4m$elm_syntax$Elm$Syntax$Node$range(left),
+ author$project$Writer$writeExpression(left)),
+ _Utils_Tuple2(
+ range,
+ stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string(x),
+ author$project$Writer$writeExpression(right)
+ ])))
+ ]));
+ case 1:
+ return A2(
+ sepHelper,
+ stil4m$structured_writer$StructuredWriter$sepBySpace,
+ _List_fromArray(
+ [
+ _Utils_Tuple2(
+ stil4m$elm_syntax$Elm$Syntax$Node$range(left),
+ stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ author$project$Writer$writeExpression(left),
+ stil4m$structured_writer$StructuredWriter$string(x)
+ ]))),
+ _Utils_Tuple2(
+ stil4m$elm_syntax$Elm$Syntax$Node$range(right),
+ author$project$Writer$writeExpression(right))
+ ]));
+ default:
+ return A2(
+ sepHelper,
+ stil4m$structured_writer$StructuredWriter$sepBySpace,
+ _List_fromArray(
+ [
+ _Utils_Tuple2(
+ stil4m$elm_syntax$Elm$Syntax$Node$range(left),
+ stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ author$project$Writer$writeExpression(left),
+ stil4m$structured_writer$StructuredWriter$string(x)
+ ]))),
+ _Utils_Tuple2(
+ stil4m$elm_syntax$Elm$Syntax$Node$range(right),
+ author$project$Writer$writeExpression(right))
+ ]));
+ }
+ case 3:
+ var moduleName = inner.a;
+ var name = inner.b;
+ if (!moduleName.b) {
+ return stil4m$structured_writer$StructuredWriter$string(name);
+ } else {
+ return stil4m$structured_writer$StructuredWriter$join(
+ _List_fromArray(
+ [
+ author$project$Writer$writeModuleName(moduleName),
+ stil4m$structured_writer$StructuredWriter$string('.'),
+ stil4m$structured_writer$StructuredWriter$string(name)
+ ]));
+ }
+ case 4:
+ var condition = inner.a;
+ var thenCase = inner.b;
+ var elseCase = inner.c;
+ return stil4m$structured_writer$StructuredWriter$breaked(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string('if'),
+ author$project$Writer$writeExpression(condition),
+ stil4m$structured_writer$StructuredWriter$string('then')
+ ])),
+ A2(
+ stil4m$structured_writer$StructuredWriter$indent,
+ 2,
+ author$project$Writer$writeExpression(thenCase)),
+ stil4m$structured_writer$StructuredWriter$string('else'),
+ A2(
+ stil4m$structured_writer$StructuredWriter$indent,
+ 2,
+ author$project$Writer$writeExpression(elseCase))
+ ]));
+ case 5:
+ var x = inner.a;
+ return stil4m$structured_writer$StructuredWriter$string('(' + (x + ')'));
+ case 6:
+ var x = inner.a;
+ return stil4m$structured_writer$StructuredWriter$string(x);
+ case 8:
+ var h = inner.a;
+ return stil4m$structured_writer$StructuredWriter$string('TODO');
+ case 7:
+ var i = inner.a;
+ return stil4m$structured_writer$StructuredWriter$string(
+ elm$core$String$fromInt(i));
+ case 9:
+ var f = inner.a;
+ return stil4m$structured_writer$StructuredWriter$string(
+ elm$core$String$fromFloat(f));
+ case 10:
+ var x = inner.a;
+ return A2(
+ stil4m$structured_writer$StructuredWriter$append,
+ stil4m$structured_writer$StructuredWriter$string('-'),
+ author$project$Writer$writeExpression(x));
+ case 11:
+ var s = inner.a;
+ return stil4m$structured_writer$StructuredWriter$string('\"' + (s + '\"'));
+ case 12:
+ var c = inner.a;
+ return stil4m$structured_writer$StructuredWriter$string(
+ '\'' + (elm$core$String$fromList(
+ _List_fromArray(
+ [c])) + '\''));
+ case 13:
+ var t = inner.a;
+ return A2(
+ sepHelper,
+ stil4m$structured_writer$StructuredWriter$sepByComma,
+ A2(elm$core$List$map, recurRangeHelper, t));
+ case 14:
+ var x = inner.a;
+ return stil4m$structured_writer$StructuredWriter$join(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string('('),
+ author$project$Writer$writeExpression(x),
+ stil4m$structured_writer$StructuredWriter$string(')')
+ ]));
+ case 15:
+ var letBlock = inner.a;
+ return stil4m$structured_writer$StructuredWriter$breaked(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string('let'),
+ A2(
+ stil4m$structured_writer$StructuredWriter$indent,
+ 2,
+ stil4m$structured_writer$StructuredWriter$breaked(
+ A2(elm$core$List$map, author$project$Writer$writeLetDeclaration, letBlock.bw))),
+ stil4m$structured_writer$StructuredWriter$string('in'),
+ A2(
+ stil4m$structured_writer$StructuredWriter$indent,
+ 2,
+ author$project$Writer$writeExpression(letBlock.bC))
+ ]));
+ case 16:
+ var caseBlock = inner.a;
+ var writeCaseBranch = function (_n8) {
+ var pattern = _n8.a;
+ var expression = _n8.b;
+ return A2(
+ stil4m$structured_writer$StructuredWriter$indent,
+ 2,
+ stil4m$structured_writer$StructuredWriter$breaked(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ author$project$Writer$writePattern(pattern),
+ stil4m$structured_writer$StructuredWriter$string('->')
+ ])),
+ A2(
+ stil4m$structured_writer$StructuredWriter$indent,
+ 2,
+ author$project$Writer$writeExpression(expression))
+ ])));
+ };
+ return stil4m$structured_writer$StructuredWriter$breaked(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string('case'),
+ author$project$Writer$writeExpression(caseBlock.bC),
+ stil4m$structured_writer$StructuredWriter$string('of')
+ ])),
+ stil4m$structured_writer$StructuredWriter$breaked(
+ A2(elm$core$List$map, writeCaseBranch, caseBlock.bp))
+ ]));
+ case 17:
+ var lambda = inner.a;
+ return stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$join(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string('\\'),
+ stil4m$structured_writer$StructuredWriter$spaced(
+ A2(elm$core$List$map, author$project$Writer$writePattern, lambda.bi))
+ ])),
+ stil4m$structured_writer$StructuredWriter$string('->'),
+ author$project$Writer$writeExpression(lambda.bC)
+ ]));
+ case 18:
+ var setters = inner.a;
+ return A2(
+ stil4m$structured_writer$StructuredWriter$bracesComma,
+ true,
+ A2(
+ elm$core$List$map,
+ A2(
+ elm$core$Basics$composeR,
+ stil4m$elm_syntax$Elm$Syntax$Node$value,
+ function (_n9) {
+ var name = _n9.a;
+ var expr = _n9.b;
+ return stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string(
+ stil4m$elm_syntax$Elm$Syntax$Node$value(name)),
+ stil4m$structured_writer$StructuredWriter$string('='),
+ author$project$Writer$writeExpression(expr)
+ ]));
+ }),
+ setters));
+ case 19:
+ var xs = inner.a;
+ return A2(
+ fakeSepHelper,
+ stil4m$structured_writer$StructuredWriter$bracketsComma,
+ A2(elm$core$List$map, recurRangeHelper, xs));
+ case 20:
+ var expression = inner.a;
+ var accessor = inner.b;
+ return stil4m$structured_writer$StructuredWriter$join(
+ _List_fromArray(
+ [
+ author$project$Writer$writeExpression(expression),
+ stil4m$structured_writer$StructuredWriter$string('.'),
+ stil4m$structured_writer$StructuredWriter$string(
+ stil4m$elm_syntax$Elm$Syntax$Node$value(accessor))
+ ]));
+ case 21:
+ var s = inner.a;
+ return stil4m$structured_writer$StructuredWriter$join(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string('.'),
+ stil4m$structured_writer$StructuredWriter$string(s)
+ ]));
+ case 22:
+ var name = inner.a;
+ var updates = inner.b;
+ return stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string('{'),
+ stil4m$structured_writer$StructuredWriter$string(
+ stil4m$elm_syntax$Elm$Syntax$Node$value(name)),
+ stil4m$structured_writer$StructuredWriter$string('|'),
+ A2(
+ sepHelper,
+ stil4m$structured_writer$StructuredWriter$sepByComma,
+ A2(
+ elm$core$List$map,
+ A2(elm$core$Basics$composeR, stil4m$elm_syntax$Elm$Syntax$Node$value, writeRecordSetter),
+ updates)),
+ stil4m$structured_writer$StructuredWriter$string('}')
+ ]));
+ default:
+ var s = inner.a;
+ return stil4m$structured_writer$StructuredWriter$join(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string('[glsl|'),
+ stil4m$structured_writer$StructuredWriter$string(s),
+ stil4m$structured_writer$StructuredWriter$string('|]')
+ ]));
+ }
+ }
+};
+var author$project$Writer$writeFunction = function (_n2) {
+ var documentation = _n2.by;
+ var signature = _n2.bX;
+ var declaration = _n2.bv;
+ return stil4m$structured_writer$StructuredWriter$breaked(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$maybe(
+ A2(elm$core$Maybe$map, author$project$Writer$writeDocumentation, documentation)),
+ stil4m$structured_writer$StructuredWriter$maybe(
+ A2(
+ elm$core$Maybe$map,
+ A2(elm$core$Basics$composeR, stil4m$elm_syntax$Elm$Syntax$Node$value, author$project$Writer$writeSignature),
+ signature)),
+ author$project$Writer$writeFunctionImplementation(
+ stil4m$elm_syntax$Elm$Syntax$Node$value(declaration))
+ ]));
+};
+var author$project$Writer$writeFunctionImplementation = function (declaration) {
+ return stil4m$structured_writer$StructuredWriter$breaked(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string(
+ stil4m$elm_syntax$Elm$Syntax$Node$value(declaration.ae)),
+ stil4m$structured_writer$StructuredWriter$spaced(
+ A2(elm$core$List$map, author$project$Writer$writePattern, declaration.bk)),
+ stil4m$structured_writer$StructuredWriter$string('=')
+ ])),
+ A2(
+ stil4m$structured_writer$StructuredWriter$indent,
+ 4,
+ author$project$Writer$writeExpression(declaration.bC))
+ ]));
+};
+var author$project$Writer$writeLetDeclaration = function (_n0) {
+ var letDeclaration = _n0.b;
+ if (!letDeclaration.$) {
+ var _function = letDeclaration.a;
+ return author$project$Writer$writeFunction(_function);
+ } else {
+ var pattern = letDeclaration.a;
+ var expression = letDeclaration.b;
+ return A2(author$project$Writer$writeDestructuring, pattern, expression);
+ }
+};
+var author$project$Writer$writeInfix = function (_n0) {
+ var direction = _n0.bx;
+ var precedence = _n0.bT;
+ var operator = _n0.bS;
+ var _function = _n0.bE;
+ return stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string('infix'),
+ function () {
+ var _n1 = stil4m$elm_syntax$Elm$Syntax$Node$value(direction);
+ switch (_n1) {
+ case 0:
+ return stil4m$structured_writer$StructuredWriter$string('left');
+ case 1:
+ return stil4m$structured_writer$StructuredWriter$string('right');
+ default:
+ return stil4m$structured_writer$StructuredWriter$string('non');
+ }
+ }(),
+ stil4m$structured_writer$StructuredWriter$string(
+ elm$core$String$fromInt(
+ stil4m$elm_syntax$Elm$Syntax$Node$value(precedence))),
+ stil4m$structured_writer$StructuredWriter$string(
+ stil4m$elm_syntax$Elm$Syntax$Node$value(operator)),
+ stil4m$structured_writer$StructuredWriter$string('='),
+ stil4m$structured_writer$StructuredWriter$string(
+ stil4m$elm_syntax$Elm$Syntax$Node$value(_function))
+ ]));
+};
+var author$project$Writer$writePortDeclaration = function (signature) {
+ return stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string('port'),
+ author$project$Writer$writeSignature(signature)
+ ]));
+};
+var author$project$Writer$writeValueConstructor = function (_n0) {
+ var name = _n0.ae;
+ var _arguments = _n0.bk;
+ return stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string(
+ stil4m$elm_syntax$Elm$Syntax$Node$value(name)),
+ stil4m$structured_writer$StructuredWriter$spaced(
+ A2(elm$core$List$map, author$project$Writer$writeTypeAnnotation, _arguments))
+ ]));
+};
+var stil4m$structured_writer$StructuredWriter$sepBy = stil4m$structured_writer$StructuredWriter$Sep;
+var author$project$Writer$writeType = function (type_) {
+ return stil4m$structured_writer$StructuredWriter$breaked(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string('type'),
+ stil4m$structured_writer$StructuredWriter$string(
+ stil4m$elm_syntax$Elm$Syntax$Node$value(type_.ae)),
+ stil4m$structured_writer$StructuredWriter$spaced(
+ A2(
+ elm$core$List$map,
+ A2(elm$core$Basics$composeR, stil4m$elm_syntax$Elm$Syntax$Node$value, stil4m$structured_writer$StructuredWriter$string),
+ type_.aP))
+ ])),
+ function () {
+ var diffLines = author$project$Writer$startOnDifferentLines(
+ A2(elm$core$List$map, stil4m$elm_syntax$Elm$Syntax$Node$range, type_.aJ));
+ return A3(
+ stil4m$structured_writer$StructuredWriter$sepBy,
+ _Utils_Tuple3('=', '|', ''),
+ diffLines,
+ A2(
+ elm$core$List$map,
+ A2(elm$core$Basics$composeR, stil4m$elm_syntax$Elm$Syntax$Node$value, author$project$Writer$writeValueConstructor),
+ type_.aJ));
+ }()
+ ]));
+};
+var author$project$Writer$writeTypeAlias = function (typeAlias) {
+ return stil4m$structured_writer$StructuredWriter$breaked(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string('type alias'),
+ stil4m$structured_writer$StructuredWriter$string(
+ stil4m$elm_syntax$Elm$Syntax$Node$value(typeAlias.ae)),
+ stil4m$structured_writer$StructuredWriter$spaced(
+ A2(
+ elm$core$List$map,
+ A2(elm$core$Basics$composeR, stil4m$elm_syntax$Elm$Syntax$Node$value, stil4m$structured_writer$StructuredWriter$string),
+ typeAlias.aP)),
+ stil4m$structured_writer$StructuredWriter$string('=')
+ ])),
+ A2(
+ stil4m$structured_writer$StructuredWriter$indent,
+ 4,
+ author$project$Writer$writeTypeAnnotation(typeAlias.b0))
+ ]));
+};
+var author$project$Writer$writeDeclaration = function (_n0) {
+ var decl = _n0.b;
+ switch (decl.$) {
+ case 0:
+ var _function = decl.a;
+ return author$project$Writer$writeFunction(_function);
+ case 1:
+ var typeAlias = decl.a;
+ return author$project$Writer$writeTypeAlias(typeAlias);
+ case 2:
+ var type_ = decl.a;
+ return author$project$Writer$writeType(type_);
+ case 3:
+ var p = decl.a;
+ return author$project$Writer$writePortDeclaration(p);
+ case 4:
+ var i = decl.a;
+ return author$project$Writer$writeInfix(i);
+ default:
+ var pattern = decl.a;
+ var expression = decl.b;
+ return A2(author$project$Writer$writeDestructuring, pattern, expression);
+ }
+};
+var author$project$Writer$writeExpose = function (_n0) {
+ var exp = _n0.b;
+ switch (exp.$) {
+ case 0:
+ var x = exp.a;
+ return stil4m$structured_writer$StructuredWriter$string('(' + (x + ')'));
+ case 1:
+ var f = exp.a;
+ return stil4m$structured_writer$StructuredWriter$string(f);
+ case 2:
+ var t = exp.a;
+ return stil4m$structured_writer$StructuredWriter$string(t);
+ default:
+ var name = exp.a.ae;
+ var open = exp.a.bR;
+ if (!open.$) {
+ return stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string(name),
+ stil4m$structured_writer$StructuredWriter$string('(..)')
+ ]));
+ } else {
+ return stil4m$structured_writer$StructuredWriter$string(name);
+ }
+ }
+};
+var author$project$Writer$writeExposureExpose = function (x) {
+ if (!x.$) {
+ return stil4m$structured_writer$StructuredWriter$string('exposing (..)');
+ } else {
+ var exposeList = x.a;
+ var diffLines = author$project$Writer$startOnDifferentLines(
+ A2(elm$core$List$map, stil4m$elm_syntax$Elm$Syntax$Node$range, exposeList));
+ return stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string('exposing'),
+ A2(
+ stil4m$structured_writer$StructuredWriter$parensComma,
+ diffLines,
+ A2(elm$core$List$map, author$project$Writer$writeExpose, exposeList))
+ ]));
+ }
+};
+var author$project$Writer$writeImport = function (_n0) {
+ var moduleName = _n0.O;
+ var moduleAlias = _n0.W;
+ var exposingList = _n0.M;
+ return stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string('import'),
+ author$project$Writer$writeModuleName(
+ stil4m$elm_syntax$Elm$Syntax$Node$value(moduleName)),
+ stil4m$structured_writer$StructuredWriter$maybe(
+ A2(
+ elm$core$Maybe$map,
+ A2(
+ elm$core$Basics$composeR,
+ stil4m$elm_syntax$Elm$Syntax$Node$value,
+ A2(
+ elm$core$Basics$composeR,
+ author$project$Writer$writeModuleName,
+ function (x) {
+ return stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string('as'),
+ x
+ ]));
+ })),
+ moduleAlias)),
+ stil4m$structured_writer$StructuredWriter$maybe(
+ A2(elm$core$Maybe$map, author$project$Writer$writeExposureExpose, exposingList))
+ ]));
+};
+var author$project$Writer$writeDefaultModuleData = function (_n0) {
+ var moduleName = _n0.O;
+ var exposingList = _n0.M;
+ return stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string('module'),
+ author$project$Writer$writeModuleName(
+ stil4m$elm_syntax$Elm$Syntax$Node$value(moduleName)),
+ author$project$Writer$writeExposureExpose(
+ stil4m$elm_syntax$Elm$Syntax$Node$value(exposingList))
+ ]));
+};
+var author$project$Writer$writeWhere = function (input) {
+ if (input.a.$ === 1) {
+ if (input.b.$ === 1) {
+ var _n1 = input.a;
+ var _n2 = input.b;
+ return stil4m$structured_writer$StructuredWriter$epsilon;
+ } else {
+ var _n4 = input.a;
+ var x = input.b.a;
+ return stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string('where { subscription ='),
+ stil4m$structured_writer$StructuredWriter$string(
+ stil4m$elm_syntax$Elm$Syntax$Node$value(x)),
+ stil4m$structured_writer$StructuredWriter$string('}')
+ ]));
+ }
+ } else {
+ if (input.b.$ === 1) {
+ var x = input.a.a;
+ var _n3 = input.b;
+ return stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string('where { command ='),
+ stil4m$structured_writer$StructuredWriter$string(
+ stil4m$elm_syntax$Elm$Syntax$Node$value(x)),
+ stil4m$structured_writer$StructuredWriter$string('}')
+ ]));
+ } else {
+ var x = input.a.a;
+ var y = input.b.a;
+ return stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string('where { command ='),
+ stil4m$structured_writer$StructuredWriter$string(
+ stil4m$elm_syntax$Elm$Syntax$Node$value(x)),
+ stil4m$structured_writer$StructuredWriter$string(', subscription ='),
+ stil4m$structured_writer$StructuredWriter$string(
+ stil4m$elm_syntax$Elm$Syntax$Node$value(y)),
+ stil4m$structured_writer$StructuredWriter$string('}')
+ ]));
+ }
+ }
+};
+var author$project$Writer$writeEffectModuleData = function (_n0) {
+ var moduleName = _n0.O;
+ var exposingList = _n0.M;
+ var command = _n0.bs;
+ var subscription = _n0.bZ;
+ return stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string('effect'),
+ stil4m$structured_writer$StructuredWriter$string('module'),
+ author$project$Writer$writeModuleName(
+ stil4m$elm_syntax$Elm$Syntax$Node$value(moduleName)),
+ author$project$Writer$writeWhere(
+ _Utils_Tuple2(command, subscription)),
+ author$project$Writer$writeExposureExpose(
+ stil4m$elm_syntax$Elm$Syntax$Node$value(exposingList))
+ ]));
+};
+var author$project$Writer$writeModule = function (m) {
+ switch (m.$) {
+ case 0:
+ var defaultModuleData = m.a;
+ return author$project$Writer$writeDefaultModuleData(defaultModuleData);
+ case 1:
+ var defaultModuleData = m.a;
+ return stil4m$structured_writer$StructuredWriter$spaced(
+ _List_fromArray(
+ [
+ stil4m$structured_writer$StructuredWriter$string('port'),
+ author$project$Writer$writeDefaultModuleData(defaultModuleData)
+ ]));
+ default:
+ var effectModuleData = m.a;
+ return author$project$Writer$writeEffectModuleData(effectModuleData);
+ }
+};
+var author$project$Writer$writeFile = function (file) {
+ return stil4m$structured_writer$StructuredWriter$breaked(
+ _List_fromArray(
+ [
+ author$project$Writer$writeModule(
+ stil4m$elm_syntax$Elm$Syntax$Node$value(file.bO)),
+ stil4m$structured_writer$StructuredWriter$breaked(
+ A2(
+ elm$core$List$map,
+ A2(elm$core$Basics$composeR, stil4m$elm_syntax$Elm$Syntax$Node$value, author$project$Writer$writeImport),
+ file.bI)),
+ stil4m$structured_writer$StructuredWriter$breaked(
+ A2(elm$core$List$map, author$project$Writer$writeDeclaration, file.bw))
+ ]));
+};
+var author$project$Decoder$styleCode = A2(
+ elm$json$Json$Decode$map,
+ A2(
+ elm$core$Basics$composeR,
+ author$project$Decoder$file,
+ A2(elm$core$Basics$composeR, author$project$Writer$writeFile, author$project$Writer$write)),
+ author$project$Decoder$style);
+var author$project$Main$LoadStyle = {$: 1};
+var author$project$Main$StyleURLChanged = function (a) {
+ return {$: 2, a: a};
+};
+var author$project$Main$TokenChanged = function (a) {
+ return {$: 3, a: a};
+};
+var elm$virtual_dom$VirtualDom$toHandlerInt = function (handler) {
+ switch (handler.$) {
+ case 0:
+ return 0;
+ case 1:
+ return 1;
+ case 2:
+ return 2;
+ default:
+ return 3;
+ }
+};
+var elm$html$Html$div = _VirtualDom_node('div');
+var elm$html$Html$input = _VirtualDom_node('input');
+var elm$html$Html$label = _VirtualDom_node('label');
+var elm$virtual_dom$VirtualDom$text = _VirtualDom_text;
+var elm$html$Html$text = elm$virtual_dom$VirtualDom$text;
+var elm$json$Json$Encode$string = _Json_wrap;
+var elm$html$Html$Attributes$stringProperty = F2(
+ function (key, string) {
+ return A2(
+ _VirtualDom_property,
+ key,
+ elm$json$Json$Encode$string(string));
+ });
+var elm$html$Html$Attributes$type_ = elm$html$Html$Attributes$stringProperty('type');
+var elm$html$Html$Attributes$value = elm$html$Html$Attributes$stringProperty('value');
+var elm$virtual_dom$VirtualDom$Normal = function (a) {
+ return {$: 0, a: a};
+};
+var elm$virtual_dom$VirtualDom$on = _VirtualDom_on;
+var elm$html$Html$Events$on = F2(
+ function (event, decoder) {
+ return A2(
+ elm$virtual_dom$VirtualDom$on,
+ event,
+ elm$virtual_dom$VirtualDom$Normal(decoder));
+ });
+var elm$html$Html$Events$onClick = function (msg) {
+ return A2(
+ elm$html$Html$Events$on,
+ 'click',
+ elm$json$Json$Decode$succeed(msg));
+};
+var elm$html$Html$Events$alwaysStop = function (x) {
+ return _Utils_Tuple2(x, true);
+};
+var elm$virtual_dom$VirtualDom$MayStopPropagation = function (a) {
+ return {$: 1, a: a};
+};
+var elm$html$Html$Events$stopPropagationOn = F2(
+ function (event, decoder) {
+ return A2(
+ elm$virtual_dom$VirtualDom$on,
+ event,
+ elm$virtual_dom$VirtualDom$MayStopPropagation(decoder));
+ });
+var elm$json$Json$Decode$at = F2(
+ function (fields, decoder) {
+ return A3(elm$core$List$foldr, elm$json$Json$Decode$field, decoder, fields);
+ });
+var elm$html$Html$Events$targetValue = A2(
+ elm$json$Json$Decode$at,
+ _List_fromArray(
+ ['target', 'value']),
+ elm$json$Json$Decode$string);
+var elm$html$Html$Events$onInput = function (tagger) {
+ return A2(
+ elm$html$Html$Events$stopPropagationOn,
+ 'input',
+ A2(
+ elm$json$Json$Decode$map,
+ elm$html$Html$Events$alwaysStop,
+ A2(elm$json$Json$Decode$map, tagger, elm$html$Html$Events$targetValue)));
+};
+var author$project$Main$form = function (model) {
+ return A2(
+ elm$html$Html$div,
+ _List_Nil,
+ _List_fromArray(
+ [
+ A2(
+ elm$html$Html$div,
+ _List_Nil,
+ _List_fromArray(
+ [
+ A2(
+ elm$html$Html$label,
+ _List_Nil,
+ _List_fromArray(
+ [
+ elm$html$Html$text('Style URL:')
+ ])),
+ A2(
+ elm$html$Html$input,
+ _List_fromArray(
+ [
+ elm$html$Html$Attributes$type_('text'),
+ elm$html$Html$Attributes$value(model.X),
+ elm$html$Html$Events$onInput(author$project$Main$StyleURLChanged)
+ ]),
+ _List_Nil)
+ ])),
+ A2(
+ elm$html$Html$div,
+ _List_Nil,
+ _List_fromArray(
+ [
+ A2(
+ elm$html$Html$label,
+ _List_Nil,
+ _List_fromArray(
+ [
+ elm$html$Html$text('Token:')
+ ])),
+ A2(
+ elm$html$Html$input,
+ _List_fromArray(
+ [
+ elm$html$Html$Attributes$type_('text'),
+ elm$html$Html$Attributes$value(model.Y),
+ elm$html$Html$Events$onInput(author$project$Main$TokenChanged)
+ ]),
+ _List_Nil)
+ ])),
+ A2(
+ elm$html$Html$div,
+ _List_Nil,
+ _List_fromArray(
+ [
+ A2(
+ elm$html$Html$input,
+ _List_fromArray(
+ [
+ elm$html$Html$Attributes$type_('submit'),
+ elm$html$Html$Attributes$value('Fetch'),
+ elm$html$Html$Events$onClick(author$project$Main$LoadStyle)
+ ]),
+ _List_Nil)
+ ]))
+ ]));
+};
+var author$project$Main$resultToString = function (r) {
+ if (!r.$) {
+ var s = r.a;
+ return s;
+ } else {
+ var s = r.a;
+ return s;
+ }
+};
+var elm$html$Html$p = _VirtualDom_node('p');
+var elm$html$Html$pre = _VirtualDom_node('pre');
+var elm$virtual_dom$VirtualDom$style = _VirtualDom_style;
+var elm$html$Html$Attributes$style = elm$virtual_dom$VirtualDom$style;
+var elm$json$Json$Decode$decodeString = _Json_runOnString;
+var author$project$Main$view = function (model) {
+ return {
+ bm: _List_fromArray(
+ [
+ author$project$Main$form(model),
+ function () {
+ var _n0 = _Utils_Tuple2(model.aa, model.aB);
+ if (!_n0.a.$) {
+ var err = _n0.a.a;
+ return A2(
+ elm$html$Html$p,
+ _List_fromArray(
+ [
+ A2(elm$html$Html$Attributes$style, 'color', 'red')
+ ]),
+ _List_fromArray(
+ [
+ elm$html$Html$text(err)
+ ]));
+ } else {
+ if (!_n0.b.$) {
+ var _n1 = _n0.a;
+ var styl = _n0.b.a;
+ return A2(
+ elm$html$Html$pre,
+ _List_Nil,
+ _List_fromArray(
+ [
+ elm$html$Html$text(
+ author$project$Main$resultToString(
+ A2(
+ elm$core$Result$mapError,
+ elm$json$Json$Decode$errorToString,
+ A2(elm$json$Json$Decode$decodeString, author$project$Decoder$styleCode, styl))))
+ ]));
+ } else {
+ var _n2 = _n0.a;
+ var _n3 = _n0.b;
+ return A2(
+ elm$html$Html$p,
+ _List_Nil,
+ _List_fromArray(
+ [
+ elm$html$Html$text('This is a tool that helps you generate elm-mapbox styles from Mapbox Studio. In Studio, hit the share button. This will give you the above two pieces of information. Then hit fetch. This tool will attempt to generate an elm-mapbox style for you. It is not perfect, but should give a nice head-start. Run the output through elm-format, than fix any compiler warnings. Then fix any Debug.todo calls.')
+ ]));
+ }
+ }
+ }()
+ ]),
+ b$: 'Style Generator'
+ };
+};
+var elm$browser$Browser$External = function (a) {
+ return {$: 1, a: a};
+};
+var elm$browser$Browser$Internal = function (a) {
+ return {$: 0, a: a};
+};
+var elm$browser$Browser$Dom$NotFound = elm$core$Basics$identity;
+var elm$core$Basics$never = function (_n0) {
+ never:
+ while (true) {
+ var nvr = _n0;
+ var $temp$_n0 = nvr;
+ _n0 = $temp$_n0;
+ continue never;
+ }
+};
+var elm$core$Task$perform = F2(
+ function (toMessage, task) {
+ return elm$core$Task$command(
+ A2(elm$core$Task$map, toMessage, task));
+ });
+var elm$core$String$dropLeft = F2(
+ function (n, string) {
+ return (n < 1) ? string : A3(
+ elm$core$String$slice,
+ n,
+ elm$core$String$length(string),
+ string);
+ });
+var elm$core$String$startsWith = _String_startsWith;
+var elm$url$Url$Http = 0;
+var elm$url$Url$Https = 1;
+var elm$core$String$indexes = _String_indexes;
+var elm$core$String$left = F2(
+ function (n, string) {
+ return (n < 1) ? '' : A3(elm$core$String$slice, 0, n, string);
+ });
+var elm$core$String$toInt = _String_toInt;
+var elm$url$Url$Url = F6(
+ function (protocol, host, port_, path, query, fragment) {
+ return {aO: fragment, aR: host, aY: path, a_: port_, a2: protocol, a3: query};
+ });
+var elm$url$Url$chompBeforePath = F5(
+ function (protocol, path, params, frag, str) {
+ if (elm$core$String$isEmpty(str) || A2(elm$core$String$contains, '@', str)) {
+ return elm$core$Maybe$Nothing;
+ } else {
+ var _n0 = A2(elm$core$String$indexes, ':', str);
+ if (!_n0.b) {
+ return elm$core$Maybe$Just(
+ A6(elm$url$Url$Url, protocol, str, elm$core$Maybe$Nothing, path, params, frag));
+ } else {
+ if (!_n0.b.b) {
+ var i = _n0.a;
+ var _n1 = elm$core$String$toInt(
+ A2(elm$core$String$dropLeft, i + 1, str));
+ if (_n1.$ === 1) {
+ return elm$core$Maybe$Nothing;
+ } else {
+ var port_ = _n1;
+ return elm$core$Maybe$Just(
+ A6(
+ elm$url$Url$Url,
+ protocol,
+ A2(elm$core$String$left, i, str),
+ port_,
+ path,
+ params,
+ frag));
+ }
+ } else {
+ return elm$core$Maybe$Nothing;
+ }
+ }
+ }
+ });
+var elm$url$Url$chompBeforeQuery = F4(
+ function (protocol, params, frag, str) {
+ if (elm$core$String$isEmpty(str)) {
+ return elm$core$Maybe$Nothing;
+ } else {
+ var _n0 = A2(elm$core$String$indexes, '/', str);
+ if (!_n0.b) {
+ return A5(elm$url$Url$chompBeforePath, protocol, '/', params, frag, str);
+ } else {
+ var i = _n0.a;
+ return A5(
+ elm$url$Url$chompBeforePath,
+ protocol,
+ A2(elm$core$String$dropLeft, i, str),
+ params,
+ frag,
+ A2(elm$core$String$left, i, str));
+ }
+ }
+ });
+var elm$url$Url$chompBeforeFragment = F3(
+ function (protocol, frag, str) {
+ if (elm$core$String$isEmpty(str)) {
+ return elm$core$Maybe$Nothing;
+ } else {
+ var _n0 = A2(elm$core$String$indexes, '?', str);
+ if (!_n0.b) {
+ return A4(elm$url$Url$chompBeforeQuery, protocol, elm$core$Maybe$Nothing, frag, str);
+ } else {
+ var i = _n0.a;
+ return A4(
+ elm$url$Url$chompBeforeQuery,
+ protocol,
+ elm$core$Maybe$Just(
+ A2(elm$core$String$dropLeft, i + 1, str)),
+ frag,
+ A2(elm$core$String$left, i, str));
+ }
+ }
+ });
+var elm$url$Url$chompAfterProtocol = F2(
+ function (protocol, str) {
+ if (elm$core$String$isEmpty(str)) {
+ return elm$core$Maybe$Nothing;
+ } else {
+ var _n0 = A2(elm$core$String$indexes, '#', str);
+ if (!_n0.b) {
+ return A3(elm$url$Url$chompBeforeFragment, protocol, elm$core$Maybe$Nothing, str);
+ } else {
+ var i = _n0.a;
+ return A3(
+ elm$url$Url$chompBeforeFragment,
+ protocol,
+ elm$core$Maybe$Just(
+ A2(elm$core$String$dropLeft, i + 1, str)),
+ A2(elm$core$String$left, i, str));
+ }
+ }
+ });
+var elm$url$Url$fromString = function (str) {
+ return A2(elm$core$String$startsWith, 'http://', str) ? A2(
+ elm$url$Url$chompAfterProtocol,
+ 0,
+ A2(elm$core$String$dropLeft, 7, str)) : (A2(elm$core$String$startsWith, 'https://', str) ? A2(
+ elm$url$Url$chompAfterProtocol,
+ 1,
+ A2(elm$core$String$dropLeft, 8, str)) : elm$core$Maybe$Nothing);
+};
+var elm$browser$Browser$document = _Browser_document;
+var author$project$Main$main = elm$browser$Browser$document(
+ {bJ: author$project$Main$init, b_: author$project$Main$subscriptions, b1: author$project$Main$update, b4: author$project$Main$view});
+_Platform_export({'Main':{'init':author$project$Main$main(
+ elm$json$Json$Decode$succeed(0))(0)}});}(this));
+
+var app = Elm.Main.init({ node: document.getElementById("elm-f0111bc4e658d0f98db96260c16f7e49") });
+if (document.getElementById("elm-f0111bc4e658d0f98db96260c16f7e49"))
+{
+ document.getElementById("elm-f0111bc4e658d0f98db96260c16f7e49").innerText = 'This is a headless program, meaning there is nothing to show here.\n\nI started the program anyway though, and you can access it as `app` in the developer console.';
+}
+</script>
+</body>
+</html> \ No newline at end of file
diff --git a/examples/Example02.elm b/examples/Example02.elm
new file mode 100644
index 0000000..5e04567
--- /dev/null
+++ b/examples/Example02.elm
@@ -0,0 +1,12 @@
+module Example02 exposing (main)
+
+import Browser
+import Html exposing (div)
+import Html.Attributes exposing (style)
+import Mapbox.Element exposing (..)
+import Outdoors
+
+
+main =
+ div [ style "height" "100vh" ]
+ [ map [] Outdoors.style ]
diff --git a/examples/Outdoors.elm b/examples/Outdoors.elm
new file mode 100644
index 0000000..9fc5f4d
--- /dev/null
+++ b/examples/Outdoors.elm
@@ -0,0 +1,1079 @@
+module Outdoors exposing (style)
+
+import Mapbox.Expression as E exposing (false, float, int, str, true)
+import Mapbox.Layer as Layer
+import Mapbox.Source as Source
+import Mapbox.Style as Style exposing (Style(..))
+
+
+style : Style
+style =
+ Style
+ { transition = Style.defaultTransition
+ , light = Style.defaultLight
+ , layers =
+ [ Layer.background "background"
+ [ Layer.backgroundColor
+ (E.zoom
+ |> E.interpolate E.Linear
+ [ ( 5, E.rgba 239 230 214 1 )
+ , ( 7, E.rgba 236 223 202 1 )
+ ]
+ )
+ ]
+ , Layer.fill "national_park"
+ "mapbox-streets"
+ [ Layer.sourceLayer "landuse_overlay"
+ , Layer.filter (E.getProperty (str "class") |> E.isEqual (str "national_park"))
+ , Layer.fillColor (E.rgba 200 221 151 1)
+ , Layer.fillOpacity
+ (E.zoom
+ |> E.interpolate E.Linear
+ [ ( 5, float 0 )
+ , ( 6, float 0.5 )
+ ]
+ )
+ ]
+ , Layer.fill "landuse"
+ "mapbox-streets"
+ [ Layer.sourceLayer "landuse"
+ , Layer.filter
+ (E.any
+ [ E.getProperty (str "class") |> E.isEqual (str "hospital")
+ , E.getProperty (str "class") |> E.isEqual (str "park")
+ , E.getProperty (str "class") |> E.isEqual (str "pitch")
+ , E.getProperty (str "class") |> E.isEqual (str "school")
+ ]
+ )
+ , Layer.fillColor
+ (E.getProperty (str "class")
+ |> E.matchesStr
+ [ ( "park", E.rgba 200 221 151 1 )
+ , ( "pitch", E.rgba 200 221 151 1 )
+ , ( "hospital", E.rgba 242 211 211 1 )
+ , ( "school", E.rgba 233 213 199 1 )
+ ]
+ (E.rgba 0 0 0 0)
+ )
+ , Layer.fillOpacity
+ (E.zoom
+ |> E.interpolate E.Linear
+ [ ( 5, float 0 )
+ , ( 6, float 1 )
+ ]
+ )
+ ]
+ , Layer.line "waterway"
+ "mapbox-streets"
+ [ Layer.minzoom 8
+ , Layer.filter
+ (E.all
+ [ E.geometryType |> E.isEqual (str "LineString")
+ , E.any
+ [ E.getProperty (str "class") |> E.isEqual (str "canal")
+ , E.getProperty (str "class") |> E.isEqual (str "river")
+ ]
+ ]
+ )
+ , Layer.sourceLayer "waterway"
+ , Layer.lineColor (E.rgba 120 188 236 1)
+ , Layer.lineWidth
+ (E.zoom
+ |> E.interpolate (E.Exponential 1.3)
+ [ ( 8.5, float 0.1 )
+ , ( 20, float 8 )
+ ]
+ )
+ , Layer.lineOpacity
+ (E.zoom
+ |> E.interpolate E.Linear
+ [ ( 8, float 0 )
+ , ( 8.5, float 1 )
+ ]
+ )
+ , Layer.lineJoin E.lineJoinRound
+ , Layer.lineCap E.lineCapRound
+ ]
+ , Layer.fill "water"
+ "mapbox-streets"
+ [ Layer.sourceLayer "water"
+ , Layer.fillColor
+ (E.zoom
+ |> E.interpolate E.Linear
+ [ ( 5, E.rgba 106 181 234 1 )
+ , ( 7, E.rgba 120 188 236 1 )
+ ]
+ )
+ ]
+ , Layer.fill "aeroway-polygon"
+ "mapbox-streets"
+ [ Layer.sourceLayer "aeroway"
+ , Layer.filter
+ (E.all
+ [ E.geometryType |> E.isEqual (str "Polygon")
+ , E.any
+ [ E.getProperty (str "type") |> E.isEqual (str "helipad")
+ , E.getProperty (str "type") |> E.isEqual (str "runway")
+ , E.getProperty (str "type") |> E.isEqual (str "taxiway")
+ ]
+ ]
+ )
+ , Layer.fillColor (E.rgba 196 196 196 1)
+ ]
+ , Layer.line "aeroway-line"
+ "mapbox-streets"
+ [ Layer.sourceLayer "aeroway"
+ , Layer.filter
+ (E.all
+ [ E.geometryType |> E.isEqual (str "LineString")
+ , E.any
+ [ E.getProperty (str "type") |> E.isEqual (str "runway")
+ , E.getProperty (str "type") |> E.isEqual (str "taxiway")
+ ]
+ ]
+ )
+ , Layer.lineWidth
+ (E.zoom
+ |> E.interpolate (E.Exponential 1.5)
+ [ ( 10, float 0.5 )
+ , ( 18, float 20 )
+ ]
+ )
+ , Layer.lineColor (E.rgba 196 196 196 1)
+ ]
+ , Layer.fill "building"
+ "mapbox-streets"
+ [ Layer.minzoom 15
+ , Layer.filter
+ (E.all
+ [ E.getProperty (str "type") |> E.notEqual (str "building:part")
+ , E.getProperty (str "underground") |> E.isEqual (str "false")
+ ]
+ )
+ , Layer.sourceLayer "building"
+ , Layer.fillColor (E.rgba 212 200 179 1)
+ , Layer.fillOpacity
+ (E.zoom
+ |> E.interpolate E.Linear
+ [ ( 15.5, float 0 )
+ , ( 16, float 1 )
+ ]
+ )
+ ]
+ , Layer.line "pedestrian-path"
+ "mapbox-streets"
+ [ Layer.minzoom 14
+ , Layer.filter
+ (E.all
+ [ E.geometryType |> E.isEqual (str "LineString")
+ , E.all
+ [ E.getProperty (str "type") |> E.notEqual (str "platform")
+ , E.any
+ [ E.getProperty (str "class") |> E.isEqual (str "path")
+ , E.getProperty (str "class") |> E.isEqual (str "pedestrian")
+ ]
+ ]
+ ]
+ )
+ , Layer.sourceLayer "road"
+ , Layer.lineWidth
+ (E.zoom
+ |> E.interpolate (E.Exponential 1.5)
+ [ ( 14
+ , E.getProperty (str "class")
+ |> E.matchesStr
+ [ ( "pedestrian", float 1 )
+ , ( "path", float 0.75 )
+ ]
+ (float 0.75)
+ )
+ , ( 20
+ , E.getProperty (str "class")
+ |> E.matchesStr
+ [ ( "pedestrian", float 8 )
+ , ( "path", float 5 )
+ ]
+ (float 5)
+ )
+ ]
+ )
+ , Layer.lineColor
+ (E.getProperty (str "type")
+ |> E.matchesStr
+ [ ( "sidewalk", E.rgba 221 208 186 1 )
+ , ( "crossing", E.rgba 221 208 186 1 )
+ ]
+ (E.rgba 199 184 157 1)
+ )
+ , Layer.lineJoin E.lineJoinRound
+ , Layer.lineCap E.lineCapRound
+ ]
+ , Layer.line "tunnel"
+ "mapbox-streets"
+ [ Layer.sourceLayer "road"
+ , Layer.filter
+ (E.all
+ [ E.geometryType |> E.isEqual (str "LineString")
+ , E.all
+ [ E.getProperty (str "type") |> E.notEqual (str "service:parking_aisle")
+ , E.getProperty (str "structure") |> E.isEqual (str "tunnel")
+ , E.any
+ [ E.getProperty (str "class") |> E.isEqual (str "link")
+ , E.getProperty (str "class") |> E.isEqual (str "motorway")
+ , E.getProperty (str "class") |> E.isEqual (str "motorway_link")
+ , E.getProperty (str "class") |> E.isEqual (str "primary")
+ , E.getProperty (str "class") |> E.isEqual (str "secondary")
+ , E.getProperty (str "class") |> E.isEqual (str "service")
+ , E.getProperty (str "class") |> E.isEqual (str "street")
+ , E.getProperty (str "class") |> E.isEqual (str "street_limited")
+ , E.getProperty (str "class") |> E.isEqual (str "tertiary")
+ , E.getProperty (str "class") |> E.isEqual (str "track")
+ , E.getProperty (str "class") |> E.isEqual (str "trunk")
+ ]
+ ]
+ ]
+ )
+ , Layer.lineWidth
+ (E.zoom
+ |> E.interpolate (E.Exponential 1.5)
+ [ ( 5
+ , E.getProperty (str "class")
+ |> E.matchesStr
+ [ ( "motorway", float 0.5 )
+ , ( "trunk", float 0.5 )
+ , ( "primary", float 0.5 )
+ , ( "secondary", float 0.01 )
+ , ( "tertiary", float 0.01 )
+ , ( "street", float 0 )
+ , ( "street_limited", float 0 )
+ , ( "motorway_link", float 0 )
+ , ( "service", float 0 )
+ , ( "track", float 0 )
+ , ( "link", float 0 )
+ ]
+ (float 0)
+ )
+ , ( 12
+ , E.getProperty (str "class")
+ |> E.matchesStr
+ [ ( "motorway", float 3 )
+ , ( "trunk", float 3 )
+ , ( "primary", float 3 )
+ , ( "secondary", float 2 )
+ , ( "tertiary", float 2 )
+ , ( "street", float 0.5 )
+ , ( "street_limited", float 0.5 )
+ , ( "motorway_link", float 0.5 )
+ , ( "service", float 0 )
+ , ( "track", float 0 )
+ , ( "link", float 0 )
+ ]
+ (float 0)
+ )
+ , ( 18
+ , E.getProperty (str "class")
+ |> E.matchesStr
+ [ ( "motorway", float 30 )
+ , ( "trunk", float 30 )
+ , ( "primary", float 30 )
+ , ( "secondary", float 24 )
+ , ( "tertiary", float 24 )
+ , ( "street", float 12 )
+ , ( "street_limited", float 12 )
+ , ( "motorway_link", float 12 )
+ , ( "service", float 10 )
+ , ( "track", float 10 )
+ , ( "link", float 10 )
+ ]
+ (float 10)
+ )
+ ]
+ )
+ , Layer.lineColor
+ (E.getProperty (str "class")
+ |> E.matchesStr
+ [ ( "street", E.rgba 255 251 244 1 )
+ , ( "street_limited", E.rgba 255 251 244 1 )
+ , ( "service", E.rgba 255 251 244 1 )
+ , ( "track", E.rgba 255 251 244 1 )
+ , ( "link", E.rgba 255 251 244 1 )
+ ]
+ (E.rgba 255 255 255 1)
+ )
+ , Layer.lineDasharray (E.floats [ 0.2, 0.2 ])
+ , Layer.lineJoin E.lineJoinRound
+ ]
+ , Layer.line "road"
+ "mapbox-streets"
+ [ Layer.sourceLayer "road"
+ , Layer.filter
+ (E.all
+ [ E.geometryType |> E.isEqual (str "LineString")
+ , E.all
+ [ E.getProperty (str "type") |> E.notEqual (str "service:parking_aisle")
+ , E.all
+ [ E.getProperty (str "structure") |> E.notEqual (str "bridge")
+ , E.getProperty (str "structure") |> E.notEqual (str "tunnel")
+ ]
+ , E.any
+ [ E.getProperty (str "class") |> E.isEqual (str "link")
+ , E.getProperty (str "class") |> E.isEqual (str "motorway")
+ , E.getProperty (str "class") |> E.isEqual (str "motorway_link")
+ , E.getProperty (str "class") |> E.isEqual (str "primary")
+ , E.getProperty (str "class") |> E.isEqual (str "secondary")
+ , E.getProperty (str "class") |> E.isEqual (str "service")
+ , E.getProperty (str "class") |> E.isEqual (str "street")
+ , E.getProperty (str "class") |> E.isEqual (str "street_limited")
+ , E.getProperty (str "class") |> E.isEqual (str "tertiary")
+ , E.getProperty (str "class") |> E.isEqual (str "track")
+ , E.getProperty (str "class") |> E.isEqual (str "trunk")
+ ]
+ ]
+ ]
+ )
+ , Layer.lineWidth
+ (E.zoom
+ |> E.interpolate (E.Exponential 1.5)
+ [ ( 5
+ , E.getProperty (str "class")
+ |> E.matchesStr
+ [ ( "motorway", float 0.5 )
+ , ( "trunk", float 0.5 )
+ , ( "primary", float 0.5 )
+ , ( "secondary", float 0.01 )
+ , ( "tertiary", float 0.01 )
+ , ( "street", float 0 )
+ , ( "street_limited", float 0 )
+ , ( "motorway_link", float 0 )
+ , ( "service", float 0 )
+ , ( "track", float 0 )
+ , ( "link", float 0 )
+ ]
+ (float 0)
+ )
+ , ( 12
+ , E.getProperty (str "class")
+ |> E.matchesStr
+ [ ( "motorway", float 3 )
+ , ( "trunk", float 3 )
+ , ( "primary", float 3 )
+ , ( "secondary", float 2 )
+ , ( "tertiary", float 2 )
+ , ( "street", float 0.5 )
+ , ( "street_limited", float 0.5 )
+ , ( "motorway_link", float 0.5 )
+ , ( "service", float 0 )
+ , ( "track", float 0 )
+ , ( "link", float 0 )
+ ]
+ (float 0)
+ )
+ , ( 18
+ , E.getProperty (str "class")
+ |> E.matchesStr
+ [ ( "motorway", float 30 )
+ , ( "trunk", float 30 )
+ , ( "primary", float 30 )
+ , ( "secondary", float 24 )
+ , ( "tertiary", float 24 )
+ , ( "street", float 12 )
+ , ( "street_limited", float 12 )
+ , ( "motorway_link", float 12 )
+ , ( "service", float 10 )
+ , ( "track", float 10 )
+ , ( "link", float 10 )
+ ]
+ (float 10)
+ )
+ ]
+ )
+ , Layer.lineColor
+ (E.getProperty (str "class")
+ |> E.matchesStr
+ [ ( "street", E.rgba 255 251 244 1 )
+ , ( "street_limited", E.rgba 255 251 244 1 )
+ , ( "service", E.rgba 255 251 244 1 )
+ , ( "track", E.rgba 255 251 244 1 )
+ , ( "link", E.rgba 255 251 244 1 )
+ ]
+ (E.rgba 255 255 255 1)
+ )
+ , Layer.lineJoin E.lineJoinRound
+ , Layer.lineCap E.lineCapRound
+ ]
+ , Layer.line "bridge-case"
+ "mapbox-streets"
+ [ Layer.sourceLayer "road"
+ , Layer.filter
+ (E.all
+ [ E.geometryType |> E.isEqual (str "LineString")
+ , E.all
+ [ E.getProperty (str "type") |> E.notEqual (str "service:parking_aisle")
+ , E.getProperty (str "structure") |> E.isEqual (str "bridge")
+ , E.any
+ [ E.getProperty (str "class") |> E.isEqual (str "link")
+ , E.getProperty (str "class") |> E.isEqual (str "motorway")
+ , E.getProperty (str "class") |> E.isEqual (str "motorway_link")
+ , E.getProperty (str "class") |> E.isEqual (str "primary")
+ , E.getProperty (str "class") |> E.isEqual (str "secondary")
+ , E.getProperty (str "class") |> E.isEqual (str "service")
+ , E.getProperty (str "class") |> E.isEqual (str "street")
+ , E.getProperty (str "class") |> E.isEqual (str "street_limited")
+ , E.getProperty (str "class") |> E.isEqual (str "tertiary")
+ , E.getProperty (str "class") |> E.isEqual (str "track")
+ , E.getProperty (str "class") |> E.isEqual (str "trunk")
+ ]
+ ]
+ ]
+ )
+ , Layer.lineWidth
+ (E.zoom
+ |> E.interpolate (E.Exponential 1.5)
+ [ ( 10, float 1 )
+ , ( 16, float 2 )
+ ]
+ )
+ , Layer.lineColor (E.rgba 236 223 202 1)
+ , Layer.lineGapWidth
+ (E.zoom
+ |> E.interpolate (E.Exponential 1.5)
+ [ ( 5
+ , E.getProperty (str "class")
+ |> E.matchesStr
+ [ ( "motorway", float 0.5 )
+ , ( "trunk", float 0.5 )
+ , ( "primary", float 0.5 )
+ , ( "secondary", float 0.01 )
+ , ( "tertiary", float 0.01 )
+ , ( "street", float 0 )
+ , ( "street_limited", float 0 )
+ , ( "motorway_link", float 0 )
+ , ( "service", float 0 )
+ , ( "track", float 0 )
+ , ( "link", float 0 )
+ ]
+ (float 0)
+ )
+ , ( 12
+ , E.getProperty (str "class")
+ |> E.matchesStr
+ [ ( "motorway", float 3 )
+ , ( "trunk", float 3 )
+ , ( "primary", float 3 )
+ , ( "secondary", float 2 )
+ , ( "tertiary", float 2 )
+ , ( "street", float 0.5 )
+ , ( "street_limited", float 0.5 )
+ , ( "motorway_link", float 0.5 )
+ , ( "service", float 0 )
+ , ( "track", float 0 )
+ , ( "link", float 0 )
+ ]
+ (float 0)
+ )
+ , ( 18
+ , E.getProperty (str "class")
+ |> E.matchesStr
+ [ ( "motorway", float 30 )
+ , ( "trunk", float 30 )
+ , ( "primary", float 30 )
+ , ( "secondary", float 24 )
+ , ( "tertiary", float 24 )
+ , ( "street", float 12 )
+ , ( "street_limited", float 12 )
+ , ( "motorway_link", float 12 )
+ , ( "service", float 10 )
+ , ( "track", float 10 )
+ , ( "link", float 10 )
+ ]
+ (float 10)
+ )
+ ]
+ )
+ , Layer.lineJoin E.lineJoinRound
+ ]
+ , Layer.line "bridge"
+ "mapbox-streets"
+ [ Layer.sourceLayer "road"
+ , Layer.filter
+ (E.all
+ [ E.geometryType |> E.isEqual (str "LineString")
+ , E.all
+ [ E.getProperty (str "type") |> E.notEqual (str "service:parking_aisle")
+ , E.getProperty (str "structure") |> E.isEqual (str "bridge")
+ , E.any
+ [ E.getProperty (str "class") |> E.isEqual (str "link")
+ , E.getProperty (str "class") |> E.isEqual (str "motorway")
+ , E.getProperty (str "class") |> E.isEqual (str "motorway_link")
+ , E.getProperty (str "class") |> E.isEqual (str "primary")
+ , E.getProperty (str "class") |> E.isEqual (str "secondary")
+ , E.getProperty (str "class") |> E.isEqual (str "service")
+ , E.getProperty (str "class") |> E.isEqual (str "street")
+ , E.getProperty (str "class") |> E.isEqual (str "street_limited")
+ , E.getProperty (str "class") |> E.isEqual (str "tertiary")
+ , E.getProperty (str "class") |> E.isEqual (str "track")
+ , E.getProperty (str "class") |> E.isEqual (str "trunk")
+ ]
+ ]
+ ]
+ )
+ , Layer.lineWidth
+ (E.zoom
+ |> E.interpolate (E.Exponential 1.5)
+ [ ( 5
+ , E.getProperty (str "class")
+ |> E.matchesStr
+ [ ( "motorway", float 0.5 )
+ , ( "trunk", float 0.5 )
+ , ( "primary", float 0.5 )
+ , ( "secondary", float 0.01 )
+ , ( "tertiary", float 0.01 )
+ , ( "street", float 0 )
+ , ( "street_limited", float 0 )
+ , ( "motorway_link", float 0 )
+ , ( "service", float 0 )
+ , ( "track", float 0 )
+ , ( "link", float 0 )
+ ]
+ (float 0)
+ )
+ , ( 12
+ , E.getProperty (str "class")
+ |> E.matchesStr
+ [ ( "motorway", float 3 )
+ , ( "trunk", float 3 )
+ , ( "primary", float 3 )
+ , ( "secondary", float 2 )
+ , ( "tertiary", float 2 )
+ , ( "street", float 0.5 )
+ , ( "street_limited", float 0.5 )
+ , ( "motorway_link", float 0.5 )
+ , ( "service", float 0 )
+ , ( "track", float 0 )
+ , ( "link", float 0 )
+ ]
+ (float 0)
+ )
+ , ( 18
+ , E.getProperty (str "class")
+ |> E.matchesStr
+ [ ( "motorway", float 30 )
+ , ( "trunk", float 30 )
+ , ( "primary", float 30 )
+ , ( "secondary", float 24 )
+ , ( "tertiary", float 24 )
+ , ( "street", float 12 )
+ , ( "street_limited", float 12 )
+ , ( "motorway_link", float 12 )
+ , ( "service", float 10 )
+ , ( "track", float 10 )
+ , ( "link", float 10 )
+ ]
+ (float 10)
+ )
+ ]
+ )
+ , Layer.lineColor
+ (E.getProperty (str "class")
+ |> E.matchesStr
+ [ ( "street", E.rgba 255 251 244 1 )
+ , ( "street_limited", E.rgba 255 251 244 1 )
+ , ( "service", E.rgba 255 251 244 1 )
+ , ( "track", E.rgba 255 251 244 1 )
+ , ( "link", E.rgba 255 251 244 1 )
+ ]
+ (E.rgba 255 255 255 1)
+ )
+ , Layer.lineJoin E.lineJoinRound
+ , Layer.lineCap E.lineCapRound
+ ]
+ , Layer.line "admin-state-province"
+ "mapbox-streets"
+ [ Layer.minzoom 2
+ , Layer.filter
+ (E.all
+ [ E.getProperty (str "maritime") |> E.isEqual (float 0)
+ , E.getProperty (str "admin_level") |> E.greaterThanOrEqual (float 3)
+ ]
+ )
+ , Layer.sourceLayer "admin"
+ , Layer.lineDasharray
+ (E.zoom
+ |> E.step
+ (E.floats
+ [ 2
+ , 0
+ ]
+ )
+ [ ( 7
+ , E.floats
+ [ 2
+ , 2
+ , 6
+ , 2
+ ]
+ )
+ ]
+ )
+ , Layer.lineWidth
+ (E.zoom
+ |> E.interpolate E.Linear
+ [ ( 7, float 0.75 )
+ , ( 12, float 1.5 )
+ ]
+ )
+ , Layer.lineOpacity
+ (E.zoom
+ |> E.interpolate E.Linear
+ [ ( 2, float 0 )
+ , ( 3, float 1 )
+ ]
+ )
+ , Layer.lineColor (E.zoom |> E.step (E.rgba 204 204 204 1) [ ( 4, E.rgba 165 165 165 1 ) ])
+ , Layer.lineJoin E.lineJoinRound
+ , Layer.lineCap E.lineCapRound
+ ]
+ , Layer.line "admin-country"
+ "mapbox-streets"
+ [ Layer.minzoom 1
+ , Layer.filter
+ (E.all
+ [ E.getProperty (str "admin_level") |> E.lessThanOrEqual (float 2)
+ , E.getProperty (str "disputed") |> E.isEqual (float 0)
+ , E.getProperty (str "maritime") |> E.isEqual (float 0)
+ ]
+ )
+ , Layer.sourceLayer "admin"
+ , Layer.lineColor (E.rgba 127 127 127 1)
+ , Layer.lineWidth
+ (E.zoom
+ |> E.interpolate E.Linear
+ [ ( 3, float 0.5 )
+ , ( 10, float 2 )
+ ]
+ )
+ , Layer.lineJoin E.lineJoinRound
+ , Layer.lineCap E.lineCapRound
+ ]
+ , Layer.line "admin-country-disputed"
+ "mapbox-streets"
+ [ Layer.minzoom 1
+ , Layer.filter
+ (E.all
+ [ E.getProperty (str "admin_level") |> E.lessThanOrEqual (float 2)
+ , E.getProperty (str "disputed") |> E.isEqual (float 1)
+ , E.getProperty (str "maritime") |> E.isEqual (float 0)
+ ]
+ )
+ , Layer.sourceLayer "admin"
+ , Layer.lineColor (E.rgba 127 127 127 1)
+ , Layer.lineWidth
+ (E.zoom
+ |> E.interpolate E.Linear
+ [ ( 3, float 0.5 )
+ , ( 10, float 2 )
+ ]
+ )
+ , Layer.lineDasharray (E.floats [ 1.5, 1.5 ])
+ , Layer.lineJoin E.lineJoinRound
+ ]
+ , Layer.symbol "road-label"
+ "mapbox-streets"
+ [ Layer.minzoom 12
+ , Layer.filter
+ (E.any
+ [ E.getProperty (str "class") |> E.isEqual (str "link")
+ , E.getProperty (str "class") |> E.isEqual (str "motorway")
+ , E.getProperty (str "class") |> E.isEqual (str "pedestrian")
+ , E.getProperty (str "class") |> E.isEqual (str "primary")
+ , E.getProperty (str "class") |> E.isEqual (str "secondary")
+ , E.getProperty (str "class") |> E.isEqual (str "street")
+ , E.getProperty (str "class") |> E.isEqual (str "street_limited")
+ , E.getProperty (str "class") |> E.isEqual (str "tertiary")
+ , E.getProperty (str "class") |> E.isEqual (str "trunk")
+ ]
+ )
+ , Layer.sourceLayer "road_label"
+ , Layer.textColor (E.rgba 0 0 0 1)
+ , Layer.textHaloColor (E.rgba 255 255 255 1)
+ , Layer.textHaloWidth (float 1)
+ , Layer.textSize
+ (E.zoom
+ |> E.interpolate E.Linear
+ [ ( 9
+ , E.getProperty (str "class")
+ |> E.matchesStr
+ [ ( "motorway", float 10 )
+ , ( "trunk", float 10 )
+ , ( "primary", float 10 )
+ , ( "secondary", float 10 )
+ , ( "tertiary", float 10 )
+ ]
+ (float 9)
+ )
+ , ( 20
+ , E.getProperty (str "class")
+ |> E.matchesStr
+ [ ( "motorway", float 15 )
+ , ( "trunk", float 15 )
+ , ( "primary", float 15 )
+ , ( "secondary", float 15 )
+ , ( "tertiary", float 15 )
+ ]
+ (float 14)
+ )
+ ]
+ )
+ , Layer.textMaxAngle (float 30)
+ , Layer.textFont
+ (E.strings
+ [ "Roboto Regular"
+ , "Arial Unicode MS Regular"
+ ]
+ )
+ , Layer.symbolPlacement E.symbolPlacementLine
+ , Layer.textPadding (float 1)
+ , Layer.textRotationAlignment E.anchorMap
+ , Layer.textPitchAlignment E.anchorViewport
+ , Layer.textField (E.getProperty (str "name_en"))
+ ]
+ , Layer.symbol "poi-label"
+ "mapbox-streets"
+ [ Layer.sourceLayer "poi_label"
+ , Layer.filter (E.getProperty (str "scalerank") |> E.lessThanOrEqual (float 3))
+ , Layer.textColor (E.rgba 88 77 59 1)
+ , Layer.textHaloColor (E.rgba 255 255 255 0.75)
+ , Layer.textHaloWidth (float 1)
+ , Layer.textHaloBlur (float 0.5)
+ , Layer.textLineHeight (float 1.1)
+ , Layer.textSize
+ (E.zoom
+ |> E.interpolate E.Linear
+ [ ( 10, float 11 )
+ , ( 18, float 13 )
+ ]
+ )
+ , Layer.iconImage (E.getProperty (str "maki") |> E.append (str "-11"))
+ , Layer.textMaxAngle (float 38)
+ , Layer.textFont
+ (E.strings
+ [ "Roboto Regular"
+ , "Arial Unicode MS Regular"
+ ]
+ )
+ , Layer.textPadding (float 2)
+ , Layer.textOffset (E.floats [ 0, 0.75 ])
+ , Layer.textAnchor E.positionTop
+ , Layer.textField (E.getProperty (str "name_en"))
+ , Layer.textMaxWidth (float 8)
+ ]
+ , Layer.symbol "airport-label"
+ "mapbox-streets"
+ [ Layer.sourceLayer "airport_label"
+ , Layer.filter (E.getProperty (str "scalerank") |> E.lessThanOrEqual (float 2))
+ , Layer.textColor (E.rgba 88 77 59 1)
+ , Layer.textHaloColor (E.rgba 255 255 255 1)
+ , Layer.textHaloWidth (float 1)
+ , Layer.textLineHeight (float 1.1)
+ , Layer.textSize
+ (E.zoom
+ |> E.interpolate E.Linear
+ [ ( 10, float 12 )
+ , ( 18, float 18 )
+ ]
+ )
+ , Layer.iconImage
+ (E.zoom
+ |> E.step (E.getProperty (str "maki") |> E.append (str "-11"))
+ [ ( 13, E.getProperty (str "maki") |> E.append (str "-15") ) ]
+ )
+ , Layer.textFont
+ (E.strings
+ [ "Roboto Regular"
+ , "Arial Unicode MS Regular"
+ ]
+ )
+ , Layer.textPadding (float 2)
+ , Layer.textOffset (E.floats [ 0, 0.75 ])
+ , Layer.textAnchor E.positionTop
+ , Layer.textField (E.zoom |> E.step (E.getProperty (str "ref")) [ ( 14, E.getProperty (str "name_en") ) ])
+ , Layer.textMaxWidth (float 9)
+ ]
+ , Layer.symbol "place-neighborhood-suburb-label"
+ "mapbox-streets"
+ [ Layer.minzoom 12
+ , Layer.maxzoom 15
+ , Layer.filter
+ (E.any
+ [ E.getProperty (str "type") |> E.isEqual (str "neighbourhood")
+ , E.getProperty (str "type") |> E.isEqual (str "suburb")
+ ]
+ )
+ , Layer.sourceLayer "place_label"
+ , Layer.textHaloColor (E.rgba 255 255 255 1)
+ , Layer.textHaloWidth (float 1)
+ , Layer.textColor (E.rgba 86 62 20 1)
+ , Layer.textField (E.getProperty (str "name_en"))
+ , Layer.textTransform E.textTransformUppercase
+ , Layer.textLetterSpacing (float 0.15)
+ , Layer.textMaxWidth (float 8)
+ , Layer.textFont
+ (E.strings
+ [ "Roboto Regular"
+ , "Arial Unicode MS Regular"
+ ]
+ )
+ , Layer.textPadding (float 3)
+ , Layer.textSize
+ (E.zoom
+ |> E.interpolate E.Linear
+ [ ( 12, float 11 )
+ , ( 16, float 16 )
+ ]
+ )
+ ]
+ , Layer.symbol "place-town-village-hamlet-label"
+ "mapbox-streets"
+ [ Layer.minzoom 6
+ , Layer.maxzoom 14
+ , Layer.filter
+ (E.any
+ [ E.getProperty (str "type") |> E.isEqual (str "hamlet")
+ , E.getProperty (str "type") |> E.isEqual (str "town")
+ , E.getProperty (str "type") |> E.isEqual (str "village")
+ ]
+ )
+ , Layer.sourceLayer "place_label"
+ , Layer.textColor (E.rgba 0 0 0 1)
+ , Layer.textHaloBlur (float 0.5)
+ , Layer.textHaloColor (E.rgba 255 255 255 1)
+ , Layer.textHaloWidth (float 1)
+ , Layer.textSize
+ (E.zoom
+ |> E.interpolate E.Linear
+ [ ( 5, E.getProperty (str "type") |> E.matchesStr [ ( "town", float 9.5 ) ] (float 8) )
+ , ( 16, E.getProperty (str "type") |> E.matchesStr [ ( "town", float 20 ) ] (float 16) )
+ ]
+ )
+ , Layer.textFont
+ (E.zoom
+ |> E.step
+ (E.strings
+ [ "Roboto Regular"
+ , "Arial Unicode MS Regular"
+ ]
+ )
+ [ ( 12
+ , E.getProperty (str "type")
+ |> E.matchesStr
+ [ ( "town"
+ , E.strings
+ [ "Roboto Medium"
+ , "Arial Unicode MS Regular"
+ ]
+ )
+ ]
+ (E.strings
+ [ "Roboto Regular"
+ , "Arial Unicode MS Regular"
+ ]
+ )
+ )
+ ]
+ )
+ , Layer.textMaxWidth (float 7)
+ , Layer.textField (E.getProperty (str "name_en"))
+ ]
+ , Layer.symbol "place-city-label-minor"
+ "mapbox-streets"
+ [ Layer.minzoom 1
+ , Layer.maxzoom 14
+ , Layer.filter
+ (E.all
+ [ E.not (E.hasProperty (str "scalerank"))
+ , E.getProperty (str "type") |> E.isEqual (str "city")
+ ]
+ )
+ , Layer.sourceLayer "place_label"
+ , Layer.textColor
+ (E.zoom
+ |> E.interpolate E.Linear
+ [ ( 5, E.rgba 84 84 84 1 )
+ , ( 6, E.rgba 0 0 0 1 )
+ ]
+ )
+ , Layer.textHaloBlur (float 0.5)
+ , Layer.textHaloColor (E.rgba 255 255 255 1)
+ , Layer.textHaloWidth (float 1.25)
+ , Layer.textSize
+ (E.zoom
+ |> E.interpolate E.Linear
+ [ ( 5, float 12 )
+ , ( 16, float 22 )
+ ]
+ )
+ , Layer.textFont
+ (E.strings
+ [ "Roboto Medium"
+ , "Arial Unicode MS Regular"
+ ]
+ )
+ , Layer.textMaxWidth (float 10)
+ , Layer.textField (E.getProperty (str "name_en"))
+ ]
+ , Layer.symbol "place-city-label-major"
+ "mapbox-streets"
+ [ Layer.minzoom 1
+ , Layer.maxzoom 14
+ , Layer.filter
+ (E.all
+ [ E.getProperty (str "type") |> E.isEqual (str "city")
+ , E.hasProperty (str "scalerank")
+ ]
+ )
+ , Layer.sourceLayer "place_label"
+ , Layer.textColor
+ (E.zoom
+ |> E.interpolate E.Linear
+ [ ( 5, E.rgba 84 84 84 1 )
+ , ( 6, E.rgba 0 0 0 1 )
+ ]
+ )
+ , Layer.textHaloBlur (float 0.5)
+ , Layer.textHaloColor (E.rgba 255 255 255 1)
+ , Layer.textHaloWidth (float 1.25)
+ , Layer.textSize
+ (E.zoom
+ |> E.interpolate E.Linear
+ [ ( 5, E.getProperty (str "scalerank") |> E.step (float 14) [ ( 4, float 12 ) ] )
+ , ( 16, E.getProperty (str "scalerank") |> E.step (float 30) [ ( 4, float 22 ) ] )
+ ]
+ )
+ , Layer.textFont
+ (E.zoom
+ |> E.step
+ (E.strings
+ [ "Roboto Medium"
+ , "Arial Unicode MS Regular"
+ ]
+ )
+ [ ( 10
+ , E.getProperty (str "scalerank")
+ |> E.step
+ (E.strings
+ [ "Roboto Bold"
+ , "Arial Unicode MS Bold"
+ ]
+ )
+ [ ( 5
+ , E.strings
+ [ "Roboto Medium"
+ , "Arial Unicode MS Regular"
+ ]
+ )
+ ]
+ )
+ ]
+ )
+ , Layer.textMaxWidth (float 10)
+ , Layer.textField (E.getProperty (str "name_en"))
+ ]
+ , Layer.symbol "state-label"
+ "mapbox-streets"
+ [ Layer.sourceLayer "state_label"
+ , Layer.minzoom 4
+ , Layer.maxzoom 8
+ , Layer.textColor (E.rgba 169 164 156 1)
+ , Layer.textHaloWidth (float 1)
+ , Layer.textHaloColor (E.rgba 255 255 255 1)
+ , Layer.textLineHeight (float 1.2)
+ , Layer.textSize
+ (E.zoom
+ |> E.interpolate E.Linear
+ [ ( 4
+ , E.getProperty (str "area")
+ |> E.step (float 8)
+ [ ( 20000, float 9 )
+ , ( 80000, float 10 )
+ ]
+ )
+ , ( 9
+ , E.getProperty (str "area")
+ |> E.step (float 14)
+ [ ( 20000, float 18 )
+ , ( 80000, float 23 )
+ ]
+ )
+ ]
+ )
+ , Layer.textTransform E.textTransformUppercase
+ , Layer.textFont
+ (E.strings
+ [ "Roboto Black"
+ , "Arial Unicode MS Bold"
+ ]
+ )
+ , Layer.textPadding (float 1)
+ , Layer.textField (E.zoom |> E.step (E.getProperty (str "area") |> E.step (E.getProperty (str "abbr")) [ ( 80000, E.getProperty (str "name_en") ) ]) [ ( 5, E.getProperty (str "name_en") ) ])
+ , Layer.textLetterSpacing (float 0.2)
+ , Layer.textMaxWidth (float 6)
+ ]
+ , Layer.symbol "country-label"
+ "mapbox-streets"
+ [ Layer.sourceLayer "country_label"
+ , Layer.minzoom 1
+ , Layer.maxzoom 8
+ , Layer.textHaloWidth (float 1.5)
+ , Layer.textHaloColor (E.rgba 255 255 255 1)
+ , Layer.textColor (E.rgba 0 0 0 1)
+ , Layer.textField (E.getProperty (str "name_en"))
+ , Layer.textMaxWidth
+ (E.zoom
+ |> E.interpolate E.Linear
+ [ ( 0, float 5 )
+ , ( 3, float 6 )
+ ]
+ )
+ , Layer.textFont
+ (E.zoom
+ |> E.step
+ (E.strings
+ [ "Roboto Medium"
+ , "Arial Unicode MS Regular"
+ ]
+ )
+ [ ( 4
+ , E.strings
+ [ "Roboto Bold"
+ , "Arial Unicode MS Bold"
+ ]
+ )
+ ]
+ )
+ , Layer.textSize
+ (E.zoom
+ |> E.interpolate E.Linear
+ [ ( 2
+ , E.getProperty (str "scalerank")
+ |> E.step (float 13)
+ [ ( 3, float 11 )
+ , ( 5, float 9 )
+ ]
+ )
+ , ( 9
+ , E.getProperty (str "scalerank")
+ |> E.step (float 35)
+ [ ( 3, float 27 )
+ , ( 5, float 22 )
+ ]
+ )
+ ]
+ )
+ ]
+ ]
+ , sources = [ Source.vectorFromUrl "mapbox-streets" "mapbox://mapbox.mapbox-streets-v7" ]
+ , misc =
+ [ Style.glyphs "mapbox://fonts/mapbox/{fontstack}/{range}.pbf"
+ , Style.sprite "mapbox://sprites/astrosat/cjlnn5red6a2o2sqtzzyg7prr"
+ ]
+ }
diff --git a/style-generator/elm.json b/style-generator/elm.json
new file mode 100644
index 0000000..4f116f6
--- /dev/null
+++ b/style-generator/elm.json
@@ -0,0 +1,33 @@
+{
+ "type": "application",
+ "source-directories": [
+ "src"
+ ],
+ "elm-version": "0.19.0",
+ "dependencies": {
+ "direct": {
+ "elm/browser": "1.0.0",
+ "elm/core": "1.0.0",
+ "elm/html": "1.0.0",
+ "elm/http": "1.0.0",
+ "elm/json": "1.0.0",
+ "elm/parser": "1.1.0",
+ "elm-community/list-extra": "8.0.0",
+ "stil4m/elm-syntax": "6.1.0",
+ "stil4m/structured-writer": "1.0.2",
+ "the-sett/elm-string-case": "1.0.2"
+ },
+ "indirect": {
+ "elm/time": "1.0.0",
+ "elm/url": "1.0.0",
+ "elm/virtual-dom": "1.0.0",
+ "elm-community/json-extra": "4.0.0",
+ "rtfeldman/elm-hex": "1.0.0",
+ "rtfeldman/elm-iso8601-date-strings": "1.1.2"
+ }
+ },
+ "test-dependencies": {
+ "direct": {},
+ "indirect": {}
+ }
+} \ No newline at end of file
diff --git a/style-generator/src/Color.elm b/style-generator/src/Color.elm
new file mode 100644
index 0000000..b4e8b73
--- /dev/null
+++ b/style-generator/src/Color.elm
@@ -0,0 +1,376 @@
+module Color exposing (parse)
+
+import Bitwise exposing (shiftLeftBy)
+import Parser exposing ((|.), (|=), Parser, backtrackable, end, keyword, oneOf, spaces, succeed, symbol)
+
+
+type alias Color =
+ { r : Int, g : Int, b : Int, a : Float }
+
+
+parser : Parser Color
+parser =
+ oneOf
+ [ keywords
+ , hsla
+
+ -- , rgba
+ -- , hex
+ ]
+ |. end
+
+
+fromHSLA hue sat light alpha =
+ let
+ ( h, s, l ) =
+ ( toFloat hue / 360, toFloat sat / 100, toFloat light / 100 )
+
+ m2 =
+ if l <= 0.5 then
+ l * (s + 1)
+ else
+ l + s - l * s
+
+ m1 =
+ l * 2 - m2
+
+ r =
+ hueToRgb (h + 1 / 3)
+
+ g =
+ hueToRgb h
+
+ b =
+ hueToRgb (h - 1 / 3)
+
+ hueToRgb h__ =
+ let
+ h_ =
+ if h__ < 0 then
+ h__ + 1
+ else if h__ > 1 then
+ h__ - 1
+ else
+ h__
+ in
+ if h_ * 6 < 1 then
+ m1 + (m2 - m1) * h_ * 6
+ else if h_ * 2 < 1 then
+ m2
+ else if h_ * 3 < 2 then
+ m1 + (m2 - m1) * (2 / 3 - h_) * 6
+ else
+ m1
+ in
+ Color (r * 255 |> floor) (g * 255 |> floor) (b * 255 |> floor) alpha
+
+
+hsla : Parser Color
+hsla =
+ succeed fromHSLA
+ |. oneOf [ keyword "hsla", keyword "hsl" ]
+ |. symbol "("
+ |= angle
+ |. spaces
+ |. symbol ","
+ |. spaces
+ |= percentage
+ |. spaces
+ |. symbol ","
+ |. spaces
+ |= percentage
+ |= oneOf
+ [ succeed identity
+ |. symbol ","
+ |. spaces
+ |= Parser.float
+ , succeed 1
+ ]
+ |. symbol ")"
+
+
+angle =
+ Parser.map round Parser.float
+
+
+percentage =
+ Parser.map round Parser.float
+ |. symbol "%"
+
+
+fromHexString : String -> Parser Color
+fromHexString hexString =
+ case String.toList hexString of
+ [ '#', r, g, b ] ->
+ fromHex8 ( r, r ) ( g, g ) ( b, b ) ( 'f', 'f' )
+
+ [ r, g, b ] ->
+ fromHex8 ( r, r ) ( g, g ) ( b, b ) ( 'f', 'f' )
+
+ [ '#', r, g, b, a ] ->
+ fromHex8 ( r, r ) ( g, g ) ( b, b ) ( a, a )
+
+ [ r, g, b, a ] ->
+ fromHex8 ( r, r ) ( g, g ) ( b, b ) ( a, a )
+
+ [ '#', r1, r2, g1, g2, b1, b2 ] ->
+ fromHex8 ( r1, r2 ) ( g1, g2 ) ( b1, b2 ) ( 'f', 'f' )
+
+ [ r1, r2, g1, g2, b1, b2 ] ->
+ fromHex8 ( r1, r2 ) ( g1, g2 ) ( b1, b2 ) ( 'f', 'f' )
+
+ [ '#', r1, r2, g1, g2, b1, b2, a1, a2 ] ->
+ fromHex8 ( r1, r2 ) ( g1, g2 ) ( b1, b2 ) ( a1, a2 )
+
+ [ r1, r2, g1, g2, b1, b2, a1, a2 ] ->
+ fromHex8 ( r1, r2 ) ( g1, g2 ) ( b1, b2 ) ( a1, a2 )
+
+ _ ->
+ Parser.problem "Invalid color"
+
+
+maybeToParser : Maybe a -> Parser a
+maybeToParser aMaybe =
+ case aMaybe of
+ Just a ->
+ succeed a
+
+ Nothing ->
+ Parser.problem "something went wrong"
+
+
+fromHex8 : ( Char, Char ) -> ( Char, Char ) -> ( Char, Char ) -> ( Char, Char ) -> Parser Color
+fromHex8 ( r1, r2 ) ( g1, g2 ) ( b1, b2 ) ( a1, a2 ) =
+ Maybe.map4
+ (\r g b a ->
+ Color
+ r
+ g
+ b
+ (toFloat a / 255)
+ )
+ (hex2ToInt r1 r2)
+ (hex2ToInt g1 g2)
+ (hex2ToInt b1 b2)
+ (hex2ToInt a1 a2)
+ |> maybeToParser
+
+
+hex2ToInt : Char -> Char -> Maybe Int
+hex2ToInt c1 c2 =
+ Maybe.map2 (\v1 v2 -> shiftLeftBy 4 v1 + v2) (hexToInt c1) (hexToInt c2)
+
+
+hexToInt : Char -> Maybe Int
+hexToInt char =
+ case Char.toLower char of
+ '0' ->
+ Just 0
+
+ '1' ->
+ Just 1
+
+ '2' ->
+ Just 2
+
+ '3' ->
+ Just 3
+
+ '4' ->
+ Just 4
+
+ '5' ->
+ Just 5
+
+ '6' ->
+ Just 6
+
+ '7' ->
+ Just 7
+
+ '8' ->
+ Just 8
+
+ '9' ->
+ Just 9
+
+ 'a' ->
+ Just 10
+
+ 'b' ->
+ Just 11
+
+ 'c' ->
+ Just 12
+
+ 'd' ->
+ Just 13
+
+ 'e' ->
+ Just 14
+
+ 'f' ->
+ Just 15
+
+ _ ->
+ Nothing
+
+
+keywords : Parser Color
+keywords =
+ oneOf
+ [ fromHexString "#000000" |. keyword "black"
+ , fromHexString "#c0c0c0" |. keyword "silver"
+ , fromHexString "#808080" |. keyword "gray"
+ , fromHexString "#ffffff" |. keyword "white"
+ , fromHexString "#800000" |. keyword "maroon"
+ , fromHexString "#ff0000" |. keyword "red"
+ , fromHexString "#800080" |. keyword "purple"
+ , fromHexString "#ff00ff" |. keyword "fuchsia"
+ , fromHexString "#008000" |. keyword "green"
+ , fromHexString "#00ff00" |. keyword "lime"
+ , fromHexString "#808000" |. keyword "olive"
+ , fromHexString "#ffff00" |. keyword "yellow"
+ , fromHexString "#000080" |. keyword "navy"
+ , fromHexString "#0000ff" |. keyword "blue"
+ , fromHexString "#008080" |. keyword "teal"
+ , fromHexString "#00ffff" |. keyword "aqua"
+ , fromHexString "#ffa500" |. keyword "orange"
+ , fromHexString "#f0f8ff" |. keyword "aliceblue"
+ , fromHexString "#faebd7" |. keyword "antiquewhite"
+ , fromHexString "#7fffd4" |. keyword "aquamarine"
+ , fromHexString "#f0ffff" |. keyword "azure"
+ , fromHexString "#f5f5dc" |. keyword "beige"
+ , fromHexString "#ffe4c4" |. keyword "bisque"
+ , fromHexString "#ffebcd" |. keyword "blanchedalmond"
+ , fromHexString "#8a2be2" |. keyword "blueviolet"
+ , fromHexString "#a52a2a" |. keyword "brown"
+ , fromHexString "#deb887" |. keyword "burlywood"
+ , fromHexString "#5f9ea0" |. keyword "cadetblue"
+ , fromHexString "#7fff00" |. keyword "chartreuse"
+ , fromHexString "#d2691e" |. keyword "chocolate"
+ , fromHexString "#ff7f50" |. keyword "coral"
+ , fromHexString "#6495ed" |. keyword "cornflowerblue"
+ , fromHexString "#fff8dc" |. keyword "cornsilk"
+ , fromHexString "#dc143c" |. keyword "crimson"
+ , fromHexString "#00ffff" |. keyword "cyan"
+ , fromHexString "#00008b" |. keyword "darkblue"
+ , fromHexString "#008b8b" |. keyword "darkcyan"
+ , fromHexString "#b8860b" |. keyword "darkgoldenrod"
+ , fromHexString "#a9a9a9" |. keyword "darkgray"
+ , fromHexString "#006400" |. keyword "darkgreen"
+ , fromHexString "#a9a9a9" |. keyword "darkgrey"
+ , fromHexString "#bdb76b" |. keyword "darkkhaki"
+ , fromHexString "#8b008b" |. keyword "darkmagenta"
+ , fromHexString "#556b2f" |. keyword "darkolivegreen"
+ , fromHexString "#ff8c00" |. keyword "darkorange"
+ , fromHexString "#9932cc" |. keyword "darkorchid"
+ , fromHexString "#8b0000" |. keyword "darkred"
+ , fromHexString "#e9967a" |. keyword "darksalmon"
+ , fromHexString "#8fbc8f" |. keyword "darkseagreen"
+ , fromHexString "#483d8b" |. keyword "darkslateblue"
+ , fromHexString "#2f4f4f" |. keyword "darkslategray"
+ , fromHexString "#2f4f4f" |. keyword "darkslategrey"
+ , fromHexString "#00ced1" |. keyword "darkturquoise"
+ , fromHexString "#9400d3" |. keyword "darkviolet"
+ , fromHexString "#ff1493" |. keyword "deeppink"
+ , fromHexString "#00bfff" |. keyword "deepskyblue"
+ , fromHexString "#696969" |. keyword "dimgray"
+ , fromHexString "#696969" |. keyword "dimgrey"
+ , fromHexString "#1e90ff" |. keyword "dodgerblue"
+ , fromHexString "#b22222" |. keyword "firebrick"
+ , fromHexString "#fffaf0" |. keyword "floralwhite"
+ , fromHexString "#228b22" |. keyword "forestgreen"
+ , fromHexString "#dcdcdc" |. keyword "gainsboro"
+ , fromHexString "#f8f8ff" |. keyword "ghostwhite"
+ , fromHexString "#ffd700" |. keyword "gold"
+ , fromHexString "#daa520" |. keyword "goldenrod"
+ , fromHexString "#adff2f" |. keyword "greenyellow"
+ , fromHexString "#808080" |. keyword "grey"
+ , fromHexString "#f0fff0" |. keyword "honeydew"
+ , fromHexString "#ff69b4" |. keyword "hotpink"
+ , fromHexString "#cd5c5c" |. keyword "indianred"
+ , fromHexString "#4b0082" |. keyword "indigo"
+ , fromHexString "#fffff0" |. keyword "ivory"
+ , fromHexString "#f0e68c" |. keyword "khaki"
+ , fromHexString "#e6e6fa" |. keyword "lavender"
+ , fromHexString "#fff0f5" |. keyword "lavenderblush"
+ , fromHexString "#7cfc00" |. keyword "lawngreen"
+ , fromHexString "#fffacd" |. keyword "lemonchiffon"
+ , fromHexString "#add8e6" |. keyword "lightblue"
+ , fromHexString "#f08080" |. keyword "lightcoral"
+ , fromHexString "#e0ffff" |. keyword "lightcyan"
+ , fromHexString "#fafad2" |. keyword "lightgoldenrodyellow"
+ , fromHexString "#d3d3d3" |. keyword "lightgray"
+ , fromHexString "#90ee90" |. keyword "lightgreen"
+ , fromHexString "#d3d3d3" |. keyword "lightgrey"
+ , fromHexString "#ffb6c1" |. keyword "lightpink"
+ , fromHexString "#ffa07a" |. keyword "lightsalmon"
+ , fromHexString "#20b2aa" |. keyword "lightseagreen"
+ , fromHexString "#87cefa" |. keyword "lightskyblue"
+ , fromHexString "#778899" |. keyword "lightslategray"
+ , fromHexString "#778899" |. keyword "lightslategrey"
+ , fromHexString "#b0c4de" |. keyword "lightsteelblue"
+ , fromHexString "#ffffe0" |. keyword "lightyellow"
+ , fromHexString "#32cd32" |. keyword "limegreen"
+ , fromHexString "#faf0e6" |. keyword "linen"
+ , fromHexString "#ff00ff" |. keyword "magenta"
+ , fromHexString "#66cdaa" |. keyword "mediumaquamarine"
+ , fromHexString "#0000cd" |. keyword "mediumblue"
+ , fromHexString "#ba55d3" |. keyword "mediumorchid"
+ , fromHexString "#9370db" |. keyword "mediumpurple"
+ , fromHexString "#3cb371" |. keyword "mediumseagreen"
+ , fromHexString "#7b68ee" |. keyword "mediumslateblue"
+ , fromHexString "#00fa9a" |. keyword "mediumspringgreen"
+ , fromHexString "#48d1cc" |. keyword "mediumturquoise"
+ , fromHexString "#c71585" |. keyword "mediumvioletred"
+ , fromHexString "#191970" |. keyword "midnightblue"
+ , fromHexString "#f5fffa" |. keyword "mintcream"
+ , fromHexString "#ffe4e1" |. keyword "mistyrose"
+ , fromHexString "#ffe4b5" |. keyword "moccasin"
+ , fromHexString "#ffdead" |. keyword "navajowhite"
+ , fromHexString "#fdf5e6" |. keyword "oldlace"
+ , fromHexString "#6b8e23" |. keyword "olivedrab"
+ , fromHexString "#ff4500" |. keyword "orangered"
+ , fromHexString "#da70d6" |. keyword "orchid"
+ , fromHexString "#eee8aa" |. keyword "palegoldenrod"
+ , fromHexString "#98fb98" |. keyword "palegreen"
+ , fromHexString "#afeeee" |. keyword "paleturquoise"
+ , fromHexString "#db7093" |. keyword "palevioletred"
+ , fromHexString "#ffefd5" |. keyword "papayawhip"
+ , fromHexString "#ffdab9" |. keyword "peachpuff"
+ , fromHexString "#cd853f" |. keyword "peru"
+ , fromHexString "#ffc0cb" |. keyword "pink"
+ , fromHexString "#dda0dd" |. keyword "plum"
+ , fromHexString "#b0e0e6" |. keyword "powderblue"
+ , fromHexString "#bc8f8f" |. keyword "rosybrown"
+ , fromHexString "#4169e1" |. keyword "royalblue"
+ , fromHexString "#8b4513" |. keyword "saddlebrown"
+ , fromHexString "#fa8072" |. keyword "salmon"
+ , fromHexString "#f4a460" |. keyword "sandybrown"
+ , fromHexString "#2e8b57" |. keyword "seagreen"
+ , fromHexString "#fff5ee" |. keyword "seashell"
+ , fromHexString "#a0522d" |. keyword "sienna"
+ , fromHexString "#87ceeb" |. keyword "skyblue"
+ , fromHexString "#6a5acd" |. keyword "slateblue"
+ , fromHexString "#708090" |. keyword "slategray"
+ , fromHexString "#708090" |. keyword "slategrey"
+ , fromHexString "#fffafa" |. keyword "snow"
+ , fromHexString "#00ff7f" |. keyword "springgreen"
+ , fromHexString "#4682b4" |. keyword "steelblue"
+ , fromHexString "#d2b48c" |. keyword "tan"
+ , fromHexString "#d8bfd8" |. keyword "thistle"
+ , fromHexString "#ff6347" |. keyword "tomato"
+ , fromHexString "#40e0d0" |. keyword "turquoise"
+ , fromHexString "#ee82ee" |. keyword "violet"
+ , fromHexString "#f5deb3" |. keyword "wheat"
+ , fromHexString "#f5f5f5" |. keyword "whitesmoke"
+ , fromHexString "#9acd32" |. keyword "yellowgreen"
+ , fromHexString "#663399" |. keyword "rebeccapurple"
+ , succeed (Color 0 0 0 0) |. keyword "transparent"
+ ]
+
+
+parse : String -> Result String Color
+parse string =
+ Parser.run parser string |> Result.mapError Parser.deadEndsToString
diff --git a/style-generator/src/Decoder.elm b/style-generator/src/Decoder.elm
new file mode 100644
index 0000000..65dc0a2
--- /dev/null
+++ b/style-generator/src/Decoder.elm
@@ -0,0 +1,776 @@
+module Decoder exposing (styleCode)
+
+import Color
+import Elm.Syntax.Declaration exposing (Declaration(..))
+import Elm.Syntax.Exposing exposing (Exposing(..), TopLevelExpose(..))
+import Elm.Syntax.Expression exposing (Expression(..), RecordSetter)
+import Elm.Syntax.Infix exposing (InfixDirection(..))
+import Elm.Syntax.Module exposing (Module(..))
+import Elm.Syntax.Node exposing (Node(..))
+import Elm.Syntax.Pattern
+import Elm.Syntax.Range exposing (emptyRange)
+import Elm.Syntax.TypeAnnotation exposing (TypeAnnotation(..))
+import Json.Decode as D exposing (Decoder)
+import Json.Encode
+import String.Case exposing (toCamelCaseLower)
+import Writer
+
+
+node =
+ Node emptyRange
+
+
+wrapNodes =
+ List.map node
+
+
+styleCode : Decoder String
+styleCode =
+ D.map (file >> Writer.writeFile >> Writer.write) style
+
+
+declarations styleDec =
+ [ FunctionDeclaration
+ { documentation = Nothing
+ , signature =
+ Just
+ (node
+ { name = node "style"
+ , typeAnnotation = node (Typed (node ( [], "Style" )) [])
+ }
+ )
+ , declaration =
+ node
+ { name = node "style"
+ , arguments = []
+ , expression =
+ node <|
+ Application <|
+ wrapNodes
+ [ FunctionOrValue [] "Style"
+ , RecordExpr styleDec
+ ]
+ }
+ }
+ ]
+
+
+file styleDec =
+ { moduleDefinition =
+ node
+ (NormalModule
+ { moduleName = node [ "Style" ]
+ , exposingList = node (Explicit [ node (FunctionExpose "style") ])
+ }
+ )
+ , imports =
+ [ node
+ { moduleName = node [ "Mapbox", "Style" ]
+ , moduleAlias = Just (node [ "Style" ])
+ , exposingList = Just (Explicit [ node (TypeExpose { name = "Style", open = Just emptyRange }) ])
+ }
+ , node
+ { moduleName = node [ "Mapbox", "Source" ]
+ , moduleAlias = Just (node [ "Source" ])
+ , exposingList = Nothing
+ }
+ , node
+ { moduleName = node [ "Mapbox", "Layer" ]
+ , moduleAlias = Just (node [ "Layer" ])
+ , exposingList = Nothing
+ }
+ , node
+ { moduleName = node [ "Mapbox", "Expression" ]
+ , moduleAlias = Just (node [ "E" ])
+ , exposingList = Just (Explicit [ node (FunctionExpose "str"), node (FunctionExpose "float"), node (FunctionExpose "int"), node (FunctionExpose "true"), node (FunctionExpose "false") ])
+ }
+ ]
+ , declarations = List.map node (declarations styleDec)
+ , comments = []
+ }
+
+
+style : Decoder (List (Node RecordSetter))
+style =
+ D.map5
+ (\transition light layers sources misc ->
+ [ node ( node "transition", transition )
+ , node ( node "light", light )
+ , node ( node "layers", layers )
+ , node ( node "sources", sources )
+ , node ( node "misc", misc )
+ ]
+ )
+ (D.oneOf
+ [ D.field "transition" decodeTransition
+ , valueDecoder "Style" "defaultTransition"
+ ]
+ )
+ (D.oneOf
+ [ D.field "light" decodeLight
+ , valueDecoder "Style" "defaultLight"
+ ]
+ )
+ (D.field "layers" decodeLayers)
+ (D.field "sources" decodeSources)
+ decodeMisc
+
+
+decodeTransition : Decoder (Node Expression)
+decodeTransition =
+ D.map2
+ (\duration delay ->
+ node
+ (RecordExpr
+ [ node ( node "duration", node (Integer duration) )
+ , node ( node "delay", node (Integer delay) )
+ ]
+ )
+ )
+ (D.oneOf [ D.field "duration" D.int, D.succeed 300 ])
+ (D.oneOf [ D.field "delay" D.int, D.succeed 0 ])
+
+
+decodeLight : Decoder (Node Expression)
+decodeLight =
+ valueDecoder "Style" "defaultLight"
+
+
+addBogusRange index (Node _ v) =
+ Node { start = { row = index, column = 0 }, end = { row = index + 1, column = 0 } } v
+
+
+decodeLayers : Decoder (Node Expression)
+decodeLayers =
+ D.list decodeLayer
+ |> D.map (\layers -> node (ListExpr (List.indexedMap addBogusRange layers)))
+
+
+layerDecodeHelp t =
+ D.map3 (\id source attrs -> call "Layer" t [ str id, str source, list attrs ]) (D.field "id" D.string) (D.field "source" D.string) decodeAttrs
+
+
+decodeLayer : Decoder (Node Expression)
+decodeLayer =
+ D.field "type" D.string
+ |> D.andThen
+ (\t ->
+ case t of
+ "background" ->
+ D.map2 (\id attrs -> call "Layer" "background" [ str id, list attrs ]) (D.field "id" D.string) decodeAttrs
+
+ "fill" ->
+ layerDecodeHelp "fill"
+
+ "symbol" ->
+ layerDecodeHelp "symbol"
+
+ "line" ->
+ layerDecodeHelp "line"
+
+ "raster" ->
+ layerDecodeHelp "raster"
+
+ "circle" ->
+ layerDecodeHelp "circle"
+
+ "fill-extrusion" ->
+ layerDecodeHelp "fillExtrusion"
+
+ "heatmap" ->
+ layerDecodeHelp "heatmap"
+
+ "hillshade" ->
+ layerDecodeHelp "hillshade"
+
+ other ->
+ D.fail ("Layer type " ++ t ++ " not supported")
+ )
+
+
+decodeAttrs : Decoder (List (Node Expression))
+decodeAttrs =
+ D.map3 (\top paint layout -> top ++ paint ++ layout) (D.keyValuePairs D.value) (D.field "paint" (D.keyValuePairs D.value)) (D.field "layout" (D.keyValuePairs D.value))
+ |> D.andThen
+ (List.filterMap
+ (\( attrName, attrValue ) ->
+ case attrName of
+ "id" ->
+ Nothing
+
+ "type" ->
+ Nothing
+
+ "source" ->
+ Nothing
+
+ "paint" ->
+ Nothing
+
+ "layout" ->
+ Nothing
+
+ "source-layer" ->
+ decodeAttr "sourceLayer" (D.map str D.string) attrValue
+
+ "minzoom" ->
+ decodeAttr "minzoom" (D.map float D.float) attrValue
+
+ "maxzoom" ->
+ decodeAttr "maxzoom" (D.map float D.float) attrValue
+
+ "filter" ->
+ decodeAttr "filter" (D.oneOf [ decodeLegacyFilter, decodeValue ]) attrValue
+
+ other ->
+ decodeAttr (toCamelCaseLower attrName) decodeValue attrValue
+ )
+ >> combine
+ )
+ |> D.map (List.indexedMap addBogusRange)
+
+
+decodeAttr : String -> Decoder (Node Expression) -> D.Value -> Maybe (Decoder (Node Expression))
+decodeAttr attrName expressionNodeDecoder attrValue =
+ Just
+ (D.decodeValue expressionNodeDecoder attrValue
+ |> resultToDecoder
+ |> D.map (\v -> call "Layer" (toCamelCaseLower attrName) [ v ])
+ )
+
+
+resultToDecoder : Result D.Error a -> Decoder a
+resultToDecoder res =
+ case res of
+ Ok a ->
+ D.succeed a
+
+ Err e ->
+ D.fail (D.errorToString e)
+
+
+decodeBool : Decoder (Node Expression)
+decodeBool =
+ D.bool
+ |> D.map
+ (\b ->
+ if b then
+ evalue "true"
+ else
+ evalue "false"
+ )
+
+
+decodeValue : Decoder (Node Expression)
+decodeValue =
+ D.oneOf
+ [ D.string |> D.map makeConstant
+ , decodeBool
+ , D.float |> D.map (Floatable >> node >> ecall "float")
+ , D.int |> D.map (Integer >> node >> ecall "int")
+ , D.index 0 D.string |> D.andThen decodeExpression
+ , todo
+ ]
+ |> D.map (ParenthesizedExpression >> node)
+
+
+makeConstant s =
+ case s of
+ "map" ->
+ value "E" "anchorMap"
+
+ "viewport" ->
+ value "E" "anchorViewport"
+
+ "auto" ->
+ value "E" "anchorAuto"
+
+ "center" ->
+ value "E" "positionCenter"
+
+ "left" ->
+ value "E" "positionLeft"
+
+ "right" ->
+ value "E" "positionRight"
+
+ "top" ->
+ value "E" "positionTop"
+
+ "bottom" ->
+ value "E" "positionBottom"
+
+ "topRight" ->
+ value "E" "positionTopRight"
+
+ "topLeft" ->
+ value "E" "positionTopLeft"
+
+ "bottomLeft" ->
+ value "E" "positionBottomLeft"
+
+ "bottomRight" ->
+ value "E" "positionBottomRight"
+
+ "none" ->
+ value "E" "textFitNone"
+
+ "width" ->
+ value "E" "textFitWidth"
+
+ "height" ->
+ value "E" "textFitHeight"
+
+ "both" ->
+ value "E" "textFitBoth"
+
+ "butt" ->
+ value "E" "lineCapButt"
+
+ "round" ->
+ value "E" "lineCapRound"
+
+ "square" ->
+ value "E" "lineCapSquare"
+
+ "bevel" ->
+ value "E" "lineJoinBevel"
+
+ "miter" ->
+ value "E" "lineJoinMiter"
+
+ "point" ->
+ value "E" "symbolPlacementPoint"
+
+ "line-center" ->
+ value "E" "symbolPlacementLineCenter"
+
+ "line" ->
+ value "E" "symbolPlacementLine"
+
+ "uppercase" ->
+ value "E" "textTransformUppercase"
+
+ "lowercase" ->
+ value "E" "textTransformLowercase"
+
+ "linear" ->
+ value "E" "rasterResamplingLinear"
+
+ "nearest" ->
+ value "E" "rasterResamplingNearest"
+
+ _ ->
+ case Color.parse s of
+ Ok { r, g, b, a } ->
+ call "E" "rgba" [ integer r, integer g, integer b, float a ]
+
+ Err err ->
+ str s |> ecall "str"
+
+
+
+-- legacy filter
+
+
+decodeLegacyFilter : Decoder (Node Expression)
+decodeLegacyFilter =
+ let
+ decodeProp =
+ D.index 1 D.string
+ |> D.map
+ (\prop ->
+ case prop of
+ "$type" ->
+ value "E" "geometryType"
+
+ "$id" ->
+ value "E" "id"
+
+ _ ->
+ call "E" "getProperty" [ ecall "str" (str prop) ]
+ )
+
+ decodeVal =
+ D.index 2 <|
+ D.oneOf
+ [ D.map (str >> ecall "str") D.string
+ , D.map (float >> ecall "float") D.float
+ , decodeBool
+ ]
+
+ decodeVals =
+ D.list <|
+ D.oneOf
+ [ D.map (str >> ecall "str") D.string
+ , D.map (float >> ecall "float") D.float
+ , decodeBool
+ ]
+ in
+ D.index 0 D.string
+ |> D.andThen
+ (\filter ->
+ case filter of
+ "all" ->
+ decodeTail decodeLegacyFilter |> D.map (\filters -> call "E" "all" [ list filters ])
+
+ "any" ->
+ decodeTail decodeLegacyFilter |> D.map (\filters -> call "E" "any" [ list filters ])
+
+ "none" ->
+ decodeTail decodeLegacyFilter |> D.map (\filters -> call "E" "all" [ list (List.map (\f -> call "E" "not" [ f ]) filters) ])
+
+ "has" ->
+ D.index 1 D.string |> D.map (\prop -> call "E" "hasProperty" [ ecall "str" (str prop) ])
+
+ "!has" ->
+ D.index 1 D.string |> D.map (\prop -> call "E" "not" [ call "E" "hasProperty" [ ecall "str" (str prop) ] ])
+
+ "==" ->
+ D.map2 (\prop val -> pipelineCall "E" "isEqual" [ prop, val ]) decodeProp decodeVal
+
+ "!=" ->
+ D.map2 (\prop val -> pipelineCall "E" "notEqual" [ prop, val ]) decodeProp decodeVal
+
+ ">" ->
+ D.map2 (\prop val -> pipelineCall "E" "greaterThan" [ prop, val ]) decodeProp decodeVal
+
+ ">=" ->
+ D.map2 (\prop val -> pipelineCall "E" "greaterThanOrEqual" [ prop, val ]) decodeProp decodeVal
+
+ "<" ->
+ D.map2 (\prop val -> pipelineCall "E" "lessThan" [ prop, val ]) decodeProp decodeVal
+
+ "<=" ->
+ D.map2 (\prop val -> pipelineCall "E" "lessThanOrEqual" [ prop, val ]) decodeProp decodeVal
+
+ "in" ->
+ D.map2
+ (\prop values ->
+ List.drop 2 values
+ |> List.map (\v -> pipelineCall "E" "isEqual" [ prop, v ])
+ |> list
+ |> List.singleton
+ |> call "E" "any"
+ )
+ decodeProp
+ decodeVals
+
+ "!in" ->
+ D.map2
+ (\prop values ->
+ List.drop 2 values
+ |> List.map (\v -> pipelineCall "E" "notEqual" [ prop, v ])
+ |> list
+ |> List.singleton
+ |> call "E" "all"
+ )
+ decodeProp
+ decodeVals
+
+ _ ->
+ D.fail "not actually a legacy filter"
+ )
+
+
+
+-- Expressions
+
+
+decodeTail : Decoder a -> Decoder (List a)
+decodeTail itemDecoder =
+ D.list D.value
+ |> D.andThen
+ (\l ->
+ case l of
+ [] ->
+ D.fail "Can't get tail of empty"
+
+ head :: t ->
+ List.map (subdecode itemDecoder) t |> combine
+ )
+
+
+subdecode : Decoder a -> D.Value -> Decoder a
+subdecode d v =
+ D.decodeValue d v |> resultToDecoder
+
+
+decodeMatch : Bool -> any -> Decoder (Node Expression)
+decodeMatch isString _ =
+ decodeTail D.value
+ |> D.andThen
+ (\args ->
+ case args of
+ [] ->
+ todo
+
+ head :: tail ->
+ D.map2
+ (\cond rest ->
+ parens
+ (node
+ (OperatorApplication "|>"
+ Right
+ cond
+ (call "E"
+ (if isString then
+ "matchesStr"
+ else
+ "matchesFloat"
+ )
+ rest
+ )
+ )
+ )
+ )
+ (subdecode decodeValue head)
+ (organizeArgs
+ (if isString then
+ D.map str D.string
+ else
+ D.map float D.float
+ )
+ []
+ tail
+ )
+ )
+
+
+organizeArgs : Decoder (Node Expression) -> List (Decoder (Node Expression)) -> List D.Value -> Decoder (List (Node Expression))
+organizeArgs inpDec accu args =
+ case args of
+ [] ->
+ combine [ D.map list (List.reverse accu |> combine) ]
+
+ [ default ] ->
+ combine [ D.map list (List.reverse accu |> combine), subdecode decodeValue default ]
+
+ a :: b :: rest ->
+ let
+ newAccu =
+ D.map2
+ (\inp out ->
+ parens (node (TupledExpression [ inp, out ]))
+ )
+ (subdecode inpDec a)
+ (subdecode decodeValue b)
+ :: accu
+ in
+ organizeArgs inpDec newAccu rest
+
+
+decodeExpression : String -> Decoder (Node Expression)
+decodeExpression funName =
+ case funName of
+ "literal" ->
+ D.index 1
+ (D.oneOf
+ [ D.list D.string |> D.map (\strs -> call "E" "strings" [ list (List.map str strs) ])
+ , D.list D.float |> D.map (\floats -> call "E" "floats" [ list (List.map float floats) ])
+ ]
+ )
+
+ "match" ->
+ D.oneOf
+ [ D.index 2 D.string |> D.andThen (decodeMatch True)
+ , D.index 2 D.float |> D.andThen (decodeMatch False)
+ ]
+
+ "exponential" ->
+ D.map (\base -> call "E" "Exponential" [ float base ]) (D.index 1 D.float)
+
+ "interpolate" ->
+ D.map3
+ (\interpolation options input ->
+ pipelineCall "E" "interpolate" (input :: interpolation :: options)
+ )
+ (D.index 1 decodeValue)
+ (decodeTail D.value |> D.map (List.drop 2) |> D.andThen (organizeArgs (D.map float D.float) []))
+ (D.index 2 decodeValue)
+
+ "step" ->
+ D.map3
+ (\inp def stps ->
+ pipelineCall "E" "step" (inp :: def :: stps)
+ )
+ (D.index 1 decodeValue)
+ (D.index 2 decodeValue)
+ (decodeTail D.value |> D.map (List.drop 2) |> D.andThen (organizeArgs (D.map float D.float) []))
+
+ _ ->
+ let
+ fallback =
+ decodeTail decodeValue
+ |> D.map
+ (\arguments ->
+ case funName of
+ "==" ->
+ pipelineCall "E" "isEqual" arguments
+
+ "!=" ->
+ pipelineCall "E" "notEqual" arguments
+
+ "!has" ->
+ todoExpr "!has is not supported"
+
+ "!in" ->
+ todoExpr "!in is not supported"
+
+ "in" ->
+ todoExpr "in is not supported"
+
+ ">=" ->
+ pipelineCall "E" "greaterThanOrEqual" arguments
+
+ "<=" ->
+ pipelineCall "E" "lessThanOrEqual" arguments
+
+ "concat" ->
+ pipelineCall "E" "append" arguments
+
+ "linear" ->
+ call "E" "Linear" arguments
+
+ "rgb" ->
+ call "E" "makeRGBColor" arguments
+
+ "rgba" ->
+ call "E" "makeRGBAColor" arguments
+
+ "to-rgba" ->
+ call "E" "rgbaChannels" arguments
+
+ "-" ->
+ pipelineCall "E" "minus" arguments
+
+ "*" ->
+ pipelineCall "E" "multiply" arguments
+
+ "+" ->
+ pipelineCall "E" "plus" arguments
+
+ "/" ->
+ pipelineCall "E" "divideBy" arguments
+
+ "%" ->
+ pipelineCall "E" "modBy" arguments
+
+ "^" ->
+ pipelineCall "E" "raiseBy" arguments
+
+ "get" ->
+ if List.length arguments == 1 then
+ call "E" "getProperty" arguments
+ else
+ call "E" "get" arguments
+
+ _ ->
+ call "E" (toCamelCaseLower funName) arguments
+ )
+ in
+ if String.toLower funName /= funName then
+ D.oneOf
+ [ D.map (\strs -> call "E" "strings" [ list (List.map str strs) ]) <| D.list D.string
+ , fallback
+ ]
+ else
+ fallback
+
+
+decodeSources : Decoder (Node Expression)
+decodeSources =
+ D.keyValuePairs decodeSource
+ |> D.map (List.map (\( key, fn ) -> fn key))
+ |> D.map (\sources -> node (ListExpr sources))
+
+
+decodeSource : Decoder (String -> Node Expression)
+decodeSource =
+ D.field "type" D.string
+ |> D.andThen
+ (\t ->
+ case t of
+ "vector" ->
+ D.field "url" D.string
+ |> D.map
+ (\url ->
+ \id ->
+ call "Source"
+ "vectorFromUrl"
+ [ str id
+ , str url
+ ]
+ )
+
+ _ ->
+ D.succeed (\a -> todoExpr ("type " ++ t ++ "not yet supported"))
+ )
+
+
+decodeMisc : Decoder (Node Expression)
+decodeMisc =
+ D.succeed (node (ListExpr []))
+
+
+list l =
+ node (ListExpr l)
+
+
+str s =
+ node (Literal s)
+
+
+ecall name arg =
+ parens (node (Application [ node (FunctionOrValue [] name), arg ]))
+
+
+call ns name args =
+ parens (node (Application (node (FunctionOrValue [ ns ] name) :: args)))
+
+
+pipelineCall ns name args =
+ case args of
+ fst :: rest ->
+ parens (node (OperatorApplication "|>" Left fst (call ns name rest)))
+
+ _ ->
+ todoExpr <| "Wrong number of arguments passed to " ++ ns ++ "." ++ name
+
+
+value ns name =
+ node (FunctionOrValue [ ns ] name)
+
+
+evalue name =
+ node (FunctionOrValue [] name)
+
+
+integer =
+ Integer >> node
+
+
+float =
+ Floatable >> node
+
+
+parens =
+ ParenthesizedExpression >> node
+
+
+valueDecoder ns name =
+ D.succeed (node (FunctionOrValue [ ns ] name))
+
+
+todo : Decoder (Node Expression)
+todo =
+ D.map (\val -> todoExpr ("The expression " ++ Json.Encode.encode 0 val ++ " is not yet supported")) D.value
+
+
+todoExpr msg =
+ node (ParenthesizedExpression (call "Debug" "todo" [ str msg ]))
+
+
+combine : List (Decoder a) -> Decoder (List a)
+combine =
+ List.foldr (D.map2 (::)) (D.succeed [])
diff --git a/style-generator/src/Main.elm b/style-generator/src/Main.elm
new file mode 100644
index 0000000..e46254e
--- /dev/null
+++ b/style-generator/src/Main.elm
@@ -0,0 +1,138 @@
+module Main exposing (main)
+
+import Browser
+import Decoder
+import Html exposing (div, input, label, p, pre, text)
+import Html.Attributes exposing (style, type_, value)
+import Html.Events exposing (onClick, onInput)
+import Http
+import Json.Decode
+
+
+main =
+ Browser.document
+ { init = init
+ , view = view
+ , update = update
+ , subscriptions = subscriptions
+ }
+
+
+init () =
+ ( { styleUrl = ""
+ , token = ""
+ , style = Nothing
+ , error = Nothing
+ }
+ , Cmd.none
+ )
+
+
+type Msg
+ = LoadedStyle (Result Http.Error String)
+ | LoadStyle
+ | StyleURLChanged String
+ | TokenChanged String
+
+
+update msg model =
+ case msg of
+ LoadedStyle (Ok style) ->
+ ( { model | style = Just style }, Cmd.none )
+
+ LoadedStyle (Err e) ->
+ ( { model | error = Just (errorToString e) }, Cmd.none )
+
+ LoadStyle ->
+ ( model, fetchStyle model.styleUrl model.token )
+
+ StyleURLChanged s ->
+ ( { model | styleUrl = s }, Cmd.none )
+
+ TokenChanged s ->
+ ( { model | token = s }, Cmd.none )
+
+
+subscriptions model =
+ Sub.none
+
+
+fetchStyle styleUrl token =
+ String.replace "mapbox://styles/" "https://api.mapbox.com/styles/v1/" styleUrl
+ ++ "?access_token="
+ ++ token
+ |> Http.getString
+ |> Http.send LoadedStyle
+
+
+form model =
+ div []
+ [ div []
+ [ label [] [ text "Style URL:" ]
+ , input [ type_ "text", value model.styleUrl, onInput StyleURLChanged ] []
+ ]
+ , div []
+ [ label [] [ text "Token:" ]
+ , input [ type_ "text", value model.token, onInput TokenChanged ] []
+ ]
+ , div [] [ input [ type_ "submit", value "Fetch", onClick LoadStyle ] [] ]
+ ]
+
+
+errorToString : Http.Error -> String
+errorToString err =
+ case err of
+ Http.BadUrl stringString ->
+ "Invalid URL. Check the inputs to make sure that it is a valid https url or starts with mapbox://styles/"
+
+ Http.Timeout ->
+ "Request timed out. Try again later."
+
+ Http.NetworkError ->
+ "Network error. Are you online?"
+
+ Http.BadStatus response ->
+ case response.status.code of
+ 401 ->
+ "An authentication error occurred. Check your key and try again."
+
+ 404 ->
+ "Couldn't find that style"
+
+ _ ->
+ response.status.message
+
+ Http.BadPayload m _ ->
+ m
+
+
+resultToString r =
+ case r of
+ Ok s ->
+ s
+
+ Err s ->
+ s
+
+
+view model =
+ { title = "Style Generator"
+ , body =
+ [ form model
+ , case ( model.error, model.style ) of
+ ( Just err, _ ) ->
+ p [ style "color" "red" ] [ text err ]
+
+ ( Nothing, Just styl ) ->
+ pre
+ []
+ [ Json.Decode.decodeString Decoder.styleCode styl
+ |> Result.mapError Json.Decode.errorToString
+ |> resultToString
+ |> text
+ ]
+
+ ( Nothing, Nothing ) ->
+ p [] [ text "This is a tool that helps you generate elm-mapbox styles from Mapbox Studio. In Studio, hit the share button. This will give you the above two pieces of information. Then hit fetch. This tool will attempt to generate an elm-mapbox style for you. It is not perfect, but should give a nice head-start. Run the output through elm-format, than fix any compiler warnings. Then fix any Debug.todo calls." ]
+ ]
+ }
diff --git a/style-generator/src/Writer.elm b/style-generator/src/Writer.elm
new file mode 100644
index 0000000..ad9f3fd
--- /dev/null
+++ b/style-generator/src/Writer.elm
@@ -0,0 +1,640 @@
+module Writer exposing (write, writeDeclaration, writeExpression, writeFile, writePattern, writeTypeAnnotation)
+
+{-| Copied and tweaked from Elm Syntax.
+
+
+# Elm.Writer
+
+Write a file to a string.
+@docs write, writeFile, writePattern, writeExpression, writeTypeAnnotation, writeDeclaration
+
+-}
+
+import Elm.Syntax.Declaration exposing (..)
+import Elm.Syntax.Documentation exposing (..)
+import Elm.Syntax.Exposing as Exposing exposing (..)
+import Elm.Syntax.Expression exposing (..)
+import Elm.Syntax.File exposing (..)
+import Elm.Syntax.Import exposing (Import)
+import Elm.Syntax.Infix exposing (..)
+import Elm.Syntax.Module exposing (..)
+import Elm.Syntax.ModuleName exposing (..)
+import Elm.Syntax.Node as Node exposing (Node(..))
+import Elm.Syntax.Pattern exposing (..)
+import Elm.Syntax.Range exposing (Range)
+import Elm.Syntax.Signature exposing (Signature)
+import Elm.Syntax.Type exposing (..)
+import Elm.Syntax.TypeAlias exposing (..)
+import Elm.Syntax.TypeAnnotation exposing (..)
+import List.Extra as List
+import StructuredWriter as Writer exposing (..)
+
+
+{-| Transform a writer to a string
+-}
+write : Writer -> String
+write =
+ Writer.write
+
+
+{-| Write a file
+-}
+writeFile : File -> Writer
+writeFile file =
+ breaked
+ [ writeModule <| Node.value file.moduleDefinition
+ , breaked (List.map (Node.value >> writeImport) file.imports)
+ , breaked (List.map writeDeclaration file.declarations)
+ ]
+
+
+writeModule : Module -> Writer
+writeModule m =
+ case m of
+ NormalModule defaultModuleData ->
+ writeDefaultModuleData defaultModuleData
+
+ PortModule defaultModuleData ->
+ spaced
+ [ string "port"
+ , writeDefaultModuleData defaultModuleData
+ ]
+
+ EffectModule effectModuleData ->
+ writeEffectModuleData effectModuleData
+
+
+writeDefaultModuleData : DefaultModuleData -> Writer
+writeDefaultModuleData { moduleName, exposingList } =
+ spaced
+ [ string "module"
+ , writeModuleName <| Node.value moduleName
+ , writeExposureExpose <| Node.value exposingList
+ ]
+
+
+writeEffectModuleData : EffectModuleData -> Writer
+writeEffectModuleData { moduleName, exposingList, command, subscription } =
+ spaced
+ [ string "effect"
+ , string "module"
+ , writeModuleName <| Node.value moduleName
+ , writeWhere ( command, subscription )
+ , writeExposureExpose <| Node.value exposingList
+ ]
+
+
+writeWhere : ( Maybe (Node String), Maybe (Node String) ) -> Writer
+writeWhere input =
+ case input of
+ ( Nothing, Nothing ) ->
+ epsilon
+
+ ( Just x, Nothing ) ->
+ spaced
+ [ string "where { command ="
+ , string <| Node.value x
+ , string "}"
+ ]
+
+ ( Nothing, Just x ) ->
+ spaced
+ [ string "where { subscription ="
+ , string <| Node.value x
+ , string "}"
+ ]
+
+ ( Just x, Just y ) ->
+ spaced
+ [ string "where { command ="
+ , string <| Node.value x
+ , string ", subscription ="
+ , string <| Node.value y
+ , string "}"
+ ]
+
+
+writeModuleName : ModuleName -> Writer
+writeModuleName moduleName =
+ string (String.join "." moduleName)
+
+
+writeExposureExpose : Exposing -> Writer
+writeExposureExpose x =
+ case x of
+ All _ ->
+ string "exposing (..)"
+
+ Explicit exposeList ->
+ let
+ diffLines =
+ List.map Node.range exposeList
+ |> startOnDifferentLines
+ in
+ spaced
+ [ string "exposing"
+ , parensComma diffLines (List.map writeExpose exposeList)
+ ]
+
+
+writeExpose : Node TopLevelExpose -> Writer
+writeExpose (Node _ exp) =
+ case exp of
+ InfixExpose x ->
+ string ("(" ++ x ++ ")")
+
+ FunctionExpose f ->
+ string f
+
+ TypeOrAliasExpose t ->
+ string t
+
+ TypeExpose { name, open } ->
+ case open of
+ Just _ ->
+ spaced
+ [ string name
+ , string "(..)"
+ ]
+
+ Nothing ->
+ string name
+
+
+startOnDifferentLines : List Range -> Bool
+startOnDifferentLines xs =
+ List.length (List.unique (List.map (.start >> .row) xs)) > 1
+
+
+writeImport : Import -> Writer
+writeImport { moduleName, moduleAlias, exposingList } =
+ spaced
+ [ string "import"
+ , writeModuleName <| Node.value moduleName
+ , maybe (Maybe.map (Node.value >> writeModuleName >> (\x -> spaced [ string "as", x ])) moduleAlias)
+ , maybe (Maybe.map writeExposureExpose exposingList)
+ ]
+
+
+writeLetDeclaration : Node LetDeclaration -> Writer
+writeLetDeclaration (Node _ letDeclaration) =
+ case letDeclaration of
+ LetFunction function ->
+ writeFunction function
+
+ LetDestructuring pattern expression ->
+ writeDestructuring pattern expression
+
+
+{-| Write a declaration
+-}
+writeDeclaration : Node Declaration -> Writer
+writeDeclaration (Node _ decl) =
+ case decl of
+ FunctionDeclaration function ->
+ writeFunction function
+
+ AliasDeclaration typeAlias ->
+ writeTypeAlias typeAlias
+
+ CustomTypeDeclaration type_ ->
+ writeType type_
+
+ PortDeclaration p ->
+ writePortDeclaration p
+
+ InfixDeclaration i ->
+ writeInfix i
+
+ Destructuring pattern expression ->
+ writeDestructuring pattern expression
+
+
+writeFunction : Function -> Writer
+writeFunction { documentation, signature, declaration } =
+ breaked
+ [ maybe (Maybe.map writeDocumentation documentation)
+ , maybe (Maybe.map (Node.value >> writeSignature) signature)
+ , writeFunctionImplementation <| Node.value declaration
+ ]
+
+
+writeFunctionImplementation : FunctionImplementation -> Writer
+writeFunctionImplementation declaration =
+ breaked
+ [ spaced
+ [ string <| Node.value declaration.name
+ , spaced (List.map writePattern declaration.arguments)
+ , string "="
+ ]
+ , indent 4 (writeExpression declaration.expression)
+ ]
+
+
+writeSignature : Signature -> Writer
+writeSignature signature =
+ spaced
+ [ string <| Node.value signature.name
+ , string ":"
+ , writeTypeAnnotation signature.typeAnnotation
+ ]
+
+
+writeDocumentation : Node Documentation -> Writer
+writeDocumentation =
+ Node.value >> string
+
+
+writeTypeAlias : TypeAlias -> Writer
+writeTypeAlias typeAlias =
+ breaked
+ [ spaced
+ [ string "type alias"
+ , string <| Node.value typeAlias.name
+ , spaced (List.map (Node.value >> string) typeAlias.generics)
+ , string "="
+ ]
+ , indent 4 (writeTypeAnnotation typeAlias.typeAnnotation)
+ ]
+
+
+writeType : Type -> Writer
+writeType type_ =
+ breaked
+ [ spaced
+ [ string "type"
+ , string <| Node.value type_.name
+ , spaced (List.map (Node.value >> string) type_.generics)
+ ]
+ , let
+ diffLines =
+ List.map Node.range type_.constructors
+ |> startOnDifferentLines
+ in
+ sepBy ( "=", "|", "" )
+ diffLines
+ (List.map (Node.value >> writeValueConstructor) type_.constructors)
+ ]
+
+
+writeValueConstructor : ValueConstructor -> Writer
+writeValueConstructor { name, arguments } =
+ spaced
+ [ string <| Node.value name
+ , spaced (List.map writeTypeAnnotation arguments)
+ ]
+
+
+writePortDeclaration : Signature -> Writer
+writePortDeclaration signature =
+ spaced [ string "port", writeSignature signature ]
+
+
+writeInfix : Infix -> Writer
+writeInfix { direction, precedence, operator, function } =
+ spaced
+ [ string "infix"
+ , case Node.value direction of
+ Left ->
+ string "left"
+
+ Right ->
+ string "right"
+
+ Non ->
+ string "non"
+ , string (String.fromInt (Node.value precedence))
+ , string (Node.value operator)
+ , string "="
+ , string (Node.value function)
+ ]
+
+
+writeDestructuring : Node Pattern -> Node Expression -> Writer
+writeDestructuring pattern expression =
+ breaked
+ [ spaced [ writePattern pattern, string "=" ]
+ , indent 4 (writeExpression expression)
+ ]
+
+
+{-| Write a type annotation
+-}
+writeTypeAnnotation : Node TypeAnnotation -> Writer
+writeTypeAnnotation (Node _ typeAnnotation) =
+ case typeAnnotation of
+ GenericType s ->
+ string s
+
+ Typed moduleNameAndName args ->
+ let
+ moduleName =
+ Node.value moduleNameAndName |> Tuple.first
+
+ k =
+ Node.value moduleNameAndName |> Tuple.second
+ in
+ spaced
+ ((string <| String.join "." (moduleName ++ [ k ]))
+ :: List.map (writeTypeAnnotation >> parensIfContainsSpaces) args
+ )
+
+ Unit ->
+ string "()"
+
+ Tupled xs ->
+ parensComma False (List.map writeTypeAnnotation xs)
+
+ Record xs ->
+ bracesComma False (List.map writeRecordField xs)
+
+ GenericRecord name fields ->
+ spaced
+ [ string "{"
+ , string <| Node.value name
+ , string "|"
+ , sepByComma False (List.map writeRecordField <| Node.value fields)
+ , string "}"
+ ]
+
+ FunctionTypeAnnotation left right ->
+ let
+ addParensForSubTypeAnnotation type_ =
+ case type_ of
+ Node _ (FunctionTypeAnnotation _ _) ->
+ join [ string "(", writeTypeAnnotation type_, string ")" ]
+
+ _ ->
+ writeTypeAnnotation type_
+ in
+ spaced
+ [ addParensForSubTypeAnnotation left
+ , string "->"
+ , addParensForSubTypeAnnotation right
+ ]
+
+
+writeRecordField : Node RecordField -> Writer
+writeRecordField (Node _ ( name, ref )) =
+ spaced
+ [ string <| Node.value name
+ , string ":"
+ , writeTypeAnnotation ref
+ ]
+
+
+{-| Writer an expression
+-}
+writeExpression : Node Expression -> Writer
+writeExpression (Node range inner) =
+ let
+ recurRangeHelper (Node x y) =
+ ( x, writeExpression (Node x y) )
+
+ writeRecordSetter : RecordSetter -> ( Range, Writer )
+ writeRecordSetter ( name, expr ) =
+ ( Node.range expr
+ , spaced [ string <| Node.value name, string "=", writeExpression expr ]
+ )
+
+ sepHelper : (Bool -> List Writer -> Writer) -> List ( Range, Writer ) -> Writer
+ sepHelper f l =
+ let
+ diffLines =
+ List.map Tuple.first l
+ |> startOnDifferentLines
+ in
+ f diffLines (List.map Tuple.second l)
+
+ fakeSepHelper : (Bool -> List Writer -> Writer) -> List ( Range, Writer ) -> Writer
+ fakeSepHelper f l =
+ f True (List.map Tuple.second l)
+ in
+ case inner of
+ UnitExpr ->
+ string "()"
+
+ Application xs ->
+ case xs of
+ [] ->
+ epsilon
+
+ [ x ] ->
+ writeExpression x
+
+ x :: rest ->
+ spaced
+ [ writeExpression x
+ , sepHelper sepBySpace (List.map recurRangeHelper rest)
+ ]
+
+ OperatorApplication x dir left right ->
+ case dir of
+ Left ->
+ sepHelper sepBySpace
+ [ ( Node.range left, writeExpression left )
+ , ( range, spaced [ string x, writeExpression right ] )
+ ]
+
+ Right ->
+ sepHelper sepBySpace
+ [ ( Node.range left, spaced [ writeExpression left, string x ] )
+ , ( Node.range right, writeExpression right )
+ ]
+
+ Non ->
+ sepHelper sepBySpace
+ [ ( Node.range left, spaced [ writeExpression left, string x ] )
+ , ( Node.range right, writeExpression right )
+ ]
+
+ FunctionOrValue moduleName name ->
+ case moduleName of
+ [] ->
+ string name
+
+ _ ->
+ join
+ [ writeModuleName <| moduleName
+ , string "."
+ , string <| name
+ ]
+
+ IfBlock condition thenCase elseCase ->
+ breaked
+ [ spaced [ string "if", writeExpression condition, string "then" ]
+ , indent 2 (writeExpression thenCase)
+ , string "else"
+ , indent 2 (writeExpression elseCase)
+ ]
+
+ PrefixOperator x ->
+ string ("(" ++ x ++ ")")
+
+ Operator x ->
+ string x
+
+ Hex h ->
+ string "TODO"
+
+ Integer i ->
+ string (String.fromInt i)
+
+ Floatable f ->
+ string (String.fromFloat f)
+
+ Negation x ->
+ append (string "-") (writeExpression x)
+
+ Literal s ->
+ string ("\"" ++ s ++ "\"")
+
+ CharLiteral c ->
+ string ("'" ++ String.fromList [ c ] ++ "'")
+
+ TupledExpression t ->
+ sepHelper sepByComma (List.map recurRangeHelper t)
+
+ ParenthesizedExpression x ->
+ join [ string "(", writeExpression x, string ")" ]
+
+ LetExpression letBlock ->
+ breaked
+ [ string "let"
+ , indent 2 (breaked (List.map writeLetDeclaration letBlock.declarations))
+ , string "in"
+ , indent 2 (writeExpression letBlock.expression)
+ ]
+
+ CaseExpression caseBlock ->
+ let
+ writeCaseBranch ( pattern, expression ) =
+ indent 2 <|
+ breaked
+ [ spaced [ writePattern pattern, string "->" ]
+ , indent 2 (writeExpression expression)
+ ]
+ in
+ breaked
+ [ spaced [ string "case", writeExpression caseBlock.expression, string "of" ]
+ , breaked (List.map writeCaseBranch caseBlock.cases)
+ ]
+
+ LambdaExpression lambda ->
+ spaced
+ [ join
+ [ string "\\"
+ , spaced (List.map writePattern lambda.args)
+ ]
+ , string "->"
+ , writeExpression lambda.expression
+ ]
+
+ RecordExpr setters ->
+ --sepHelper bracesComma (List.map (Node.value >> writeRecordSetter) setters)
+ bracesComma True (List.map (Node.value >> (\( name, expr ) -> spaced [ string <| Node.value name, string "=", writeExpression expr ])) setters)
+
+ ListExpr xs ->
+ fakeSepHelper bracketsComma (List.map recurRangeHelper xs)
+
+ RecordAccess expression accessor ->
+ join [ writeExpression expression, string ".", string <| Node.value accessor ]
+
+ RecordAccessFunction s ->
+ join [ string ".", string s ]
+
+ RecordUpdateExpression name updates ->
+ spaced
+ [ string "{"
+ , string <| Node.value name
+ , string "|"
+ , sepHelper sepByComma (List.map (Node.value >> writeRecordSetter) updates)
+ , string "}"
+ ]
+
+ GLSLExpression s ->
+ join
+ [ string "[glsl|"
+ , string s
+ , string "|]"
+ ]
+
+
+{-| Write a pattern
+-}
+writePattern : Node Pattern -> Writer
+writePattern (Node _ p) =
+ case p of
+ AllPattern ->
+ string "_"
+
+ UnitPattern ->
+ string "()"
+
+ CharPattern c ->
+ string ("'" ++ String.fromList [ c ] ++ "'")
+
+ StringPattern s ->
+ string s
+
+ HexPattern h ->
+ string "TODO"
+
+ IntPattern i ->
+ string (String.fromInt i)
+
+ FloatPattern f ->
+ string (String.fromFloat f)
+
+ TuplePattern inner ->
+ parensComma False (List.map writePattern inner)
+
+ RecordPattern inner ->
+ bracesComma False (List.map (Node.value >> string) inner)
+
+ UnConsPattern left right ->
+ spaced [ writePattern left, string "::", writePattern right ]
+
+ ListPattern inner ->
+ bracketsComma False (List.map writePattern inner)
+
+ VarPattern var ->
+ string var
+
+ NamedPattern qnr others ->
+ spaced
+ [ writeQualifiedNameRef qnr
+ , spaced (List.map writePattern others)
+ ]
+
+ AsPattern innerPattern asName ->
+ spaced [ writePattern innerPattern, string "as", string <| Node.value asName ]
+
+ ParenthesizedPattern innerPattern ->
+ spaced [ string "(", writePattern innerPattern, string ")" ]
+
+
+writeQualifiedNameRef : QualifiedNameRef -> Writer
+writeQualifiedNameRef { moduleName, name } =
+ case moduleName of
+ [] ->
+ string name
+
+ _ ->
+ join
+ [ writeModuleName moduleName
+ , string "."
+ , string name
+ ]
+
+
+
+-- Helpers
+
+
+parensIfContainsSpaces : Writer -> Writer
+parensIfContainsSpaces w =
+ if Writer.write w |> String.contains " " then
+ join [ string "(", w, string ")" ]
+ else
+ w
[cgit] Unable to lock slot /tmp/cgit/d8000000.lock: No such file or directory (2)